@_tc/template-core 0.3.2 → 0.4.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/.skills/tc-component-usage-skills/SKILL.md +46 -121
- package/.skills/tc-component-usage-skills/reference/component-api.md +58 -25
- package/.skills/tc-component-usage-skills/reference/examples.md +30 -12
- package/.skills/tc-component-usage-skills/reference/patterns.md +45 -27
- package/.skills/tc-component-usage-skills/reference/template-core-frontend.md +27 -9
- package/.skills/tc-generator/SKILL.md +51 -69
- package/.skills/tc-generator/reference/example.md +150 -99
- package/.skills/tc-generator/reference/model-schema.md +4 -4
- package/.skills/tc-generator/reference/project-template/backend/business.module.ts +9 -0
- package/.skills/tc-generator/reference/project-template/backend/product.controller.ts +71 -0
- package/.skills/tc-generator/reference/project-template/backend/product.service.ts +58 -0
- package/.skills/tc-generator/reference/project-template/backend/product.types.ts +15 -0
- package/.skills/tc-generator/reference/project-template/index.js +32 -13
- package/.skills/tc-generator/reference/project-template/package.json +20 -3
- package/.skills/tc-generator/reference/project-template/scripts/build-backend.mjs +12 -0
- package/.skills/tc-generator/reference/project-template/scripts/build-frontend.mjs +7 -0
- package/.skills/tc-generator/reference/project-template/scripts/build-ssr.mjs +7 -0
- package/.skills/tc-generator/reference/project-template/ssr/apps/hello/hello.entry.tsx +44 -0
- package/.skills/tc-generator/reference/project-template/tsconfig.json +14 -0
- package/.skills/tc-generator/reference/runtime-extensions.md +142 -89
- package/AGENT_README.md +69 -156
- package/CHANGE.md +31 -12
- package/README.md +383 -357
- package/cjs/app/ai/agent/agent-scanner.service.js +1 -0
- package/cjs/app/ai/agent/agent.module.js +1 -0
- package/cjs/app/ai/ai-config.module.js +1 -0
- package/cjs/app/ai/ai-config.service.js +1 -0
- package/cjs/app/ai/ai.controller.js +1 -0
- package/cjs/app/ai/ai.module.js +1 -0
- package/cjs/app/ai/declaration-paths.js +1 -0
- package/cjs/app/ai/eval/assertions.js +1 -0
- package/cjs/app/ai/guardrail/guardrail.module.js +1 -0
- package/cjs/app/ai/guardrail/guardrail.service.js +1 -0
- package/cjs/app/ai/guardrail/internal/load-guardrail-config.js +1 -0
- package/cjs/app/ai/index.js +1 -0
- package/cjs/app/ai/mcp/internal/load-mcp-config.js +1 -0
- package/cjs/app/ai/mcp/internal/read-sse-response.js +2 -0
- package/cjs/app/ai/mcp/internal/stdio-process.js +1 -0
- package/cjs/app/ai/mcp/mcp-registry.service.js +2 -0
- package/cjs/app/ai/mcp/mcp.client.js +3 -0
- package/cjs/app/ai/mcp/mcp.loader.js +1 -0
- package/cjs/app/ai/mcp/mcp.module.js +1 -0
- package/cjs/app/ai/mcp/mcp.types.js +1 -0
- package/cjs/app/ai/memory/checkpoint.service.js +1 -0
- package/cjs/app/ai/memory/internal/load-memory-config.js +1 -0
- package/cjs/app/ai/memory/memory.module.js +1 -0
- package/cjs/app/ai/memory/thread.service.js +1 -0
- package/cjs/app/ai/models/chat-sse.js +4 -0
- package/cjs/app/ai/models/chat.js +1 -0
- package/cjs/app/ai/models/http.js +1 -0
- package/cjs/app/ai/models/image.js +1 -0
- package/cjs/app/ai/models/video.js +1 -0
- package/cjs/app/ai/nest-service-provider.js +1 -0
- package/cjs/app/ai/rag/chunker.js +2 -0
- package/cjs/app/ai/rag/internal/load-embedding-config.js +1 -0
- package/cjs/app/ai/rag/internal/load-rag-config.js +1 -0
- package/cjs/app/ai/rag/rag.interface.js +1 -0
- package/cjs/app/ai/rag/rag.module.js +1 -0
- package/cjs/app/ai/rag/retriever.service.js +1 -0
- package/cjs/app/ai/retention/conversation-retention.service.js +1 -0
- package/cjs/app/ai/retention/retention-policy.js +1 -0
- package/cjs/app/ai/runtime/ai-runtime-startup.validator.js +1 -0
- package/cjs/app/ai/runtime/ai-runtime.js +1 -0
- package/cjs/app/ai/runtime/internal/agent-run-context.js +1 -0
- package/cjs/app/ai/runtime/internal/compact-tool-result.js +1 -0
- package/cjs/app/ai/runtime/internal/context-compaction.service.js +4 -0
- package/cjs/app/ai/runtime/internal/declaration-snapshot.js +1 -0
- package/cjs/app/ai/runtime/internal/load-llm-config.js +1 -0
- package/cjs/app/ai/runtime/internal/load-runtime-config.js +1 -0
- package/cjs/app/ai/runtime/internal/owned-runtime-resources.js +1 -0
- package/cjs/app/ai/runtime/internal/request-budget.js +1 -0
- package/cjs/app/ai/runtime/internal/run-event-queue.js +1 -0
- package/cjs/app/ai/runtime/langchain/langchain-planner.service.js +1 -0
- package/cjs/app/ai/runtime/langchain/skill-tool.adapter.js +1 -0
- package/cjs/app/ai/runtime/langgraph/agent.graph.js +1 -0
- package/cjs/app/ai/runtime/langgraph/agent.state.js +1 -0
- package/cjs/app/ai/runtime/langgraph/langgraph-orchestrator.service.js +1 -0
- package/cjs/app/ai/runtime/runtime.module.js +1 -0
- package/cjs/app/ai/runtime/thread-execution-coordinator.js +1 -0
- package/cjs/app/ai/skill/skill-scanner.service.js +1 -0
- package/cjs/app/ai/skill/skill.module.js +1 -0
- package/cjs/app/ai/snapshot-data.js +1 -0
- package/cjs/app/ai/store/internal/archive-id.js +1 -0
- package/cjs/app/ai/store/internal/create-vector-store.js +1 -0
- package/cjs/app/ai/store/internal/load-store-config.js +1 -0
- package/cjs/app/ai/store/internal/load-thread-state-store.js +1 -0
- package/cjs/app/ai/store/reference/file-memory.store.js +1 -0
- package/cjs/app/ai/store/reference/file-trace.store.js +1 -0
- package/cjs/app/ai/store/reference/file-vector.store.js +1 -0
- package/cjs/app/ai/store/reference/qdrant-vector.store.js +1 -0
- package/cjs/app/ai/store/store.interface.js +1 -0
- package/cjs/app/ai/store/store.module.js +1 -0
- package/cjs/app/ai/tool/builtin/index.js +1 -0
- package/cjs/app/ai/tool/builtin/invoke-agent.tool.js +1 -0
- package/cjs/app/ai/tool/builtin/retrieve.tool.js +1 -0
- package/cjs/app/ai/tool/executor.service.js +1 -0
- package/cjs/app/ai/tool/tool-registry.service.js +1 -0
- package/cjs/app/ai/tool/tool.module.js +1 -0
- package/cjs/app/ai/trace/trace.service.js +1 -0
- package/cjs/app/csr/controller.js +1 -0
- package/cjs/app/extends/$fetch.js +1 -1
- package/cjs/app/extends/crypto.js +1 -1
- package/cjs/app/extends/db.js +4 -4
- package/cjs/app/extends/logger.js +1 -1
- package/cjs/app/frontend-development.js +1 -0
- package/cjs/app/html/browser-options.js +1 -0
- package/cjs/app/html/shell.js +31 -16
- package/cjs/app/http/api-signing.js +1 -0
- package/cjs/app/http/body-parser.middleware.js +1 -0
- package/cjs/app/http/compression.middleware.js +1 -0
- package/cjs/app/http/context.js +1 -0
- package/cjs/app/http/controller.js +1 -0
- package/cjs/app/http/csp-nonce.js +1 -0
- package/cjs/app/http/error-response.js +1 -0
- package/cjs/app/http/errors.js +1 -0
- package/cjs/app/http/exception-filter.js +1 -0
- package/cjs/app/http/request-body-parser-policy.js +1 -0
- package/cjs/app/http/request-data.js +1 -0
- package/cjs/app/http/request-schema.pipe.js +1 -0
- package/cjs/app/http/response.interceptor.js +1 -0
- package/cjs/app/http/response.js +1 -0
- package/cjs/app/http/security.guard.js +1 -0
- package/cjs/app/project/controller.js +1 -0
- package/cjs/app/project/service.js +1 -0
- package/cjs/app/providers/csr.js +1 -0
- package/cjs/app/providers/foundation.js +1 -0
- package/cjs/app/ssr/artifacts.js +1 -0
- package/cjs/app/ssr/controller.js +1 -0
- package/cjs/app/ssr/html.js +19 -11
- package/cjs/app/ssr/manifest.js +2 -2
- package/cjs/app/ssr/session.js +1 -0
- package/cjs/app/ssr/stream.js +1 -0
- package/cjs/app/ssr/streaming-request-cache.js +1 -0
- package/cjs/app/static-assets.middleware.js +1 -0
- package/cjs/app/template-core.module.js +1 -0
- package/cjs/app/view/entry.tpl +2 -2
- package/cjs/bundler/buildBE.js +1 -1
- package/cjs/bundler/buildFE.js +1 -1
- package/cjs/bundler/buildSSR.js +1 -1
- package/cjs/bundler/dev-session.js +1 -0
- package/cjs/bundler/dev.js +1 -1
- package/cjs/bundler/entryCollect.js +1 -1
- package/cjs/bundler/feSharedConfig.js +1 -1
- package/cjs/bundler/index.js +1 -1
- package/cjs/bundler/prod.js +1 -1
- package/cjs/bundler/ssrClientManifest.js +1 -1
- package/cjs/bundler/ssrEntries.js +1 -1
- package/cjs/bundler/state.js +1 -1
- package/cjs/bundler/utils.js +3 -3
- package/cjs/config/config.default.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/package.json +1 -0
- package/cjs/packages/common/index.js +1 -1
- package/cjs/packages/core/bootstrap.js +1 -0
- package/cjs/packages/core/config-service.js +1 -0
- package/cjs/packages/core/duplicate-route-checking-adapter.js +1 -0
- package/cjs/packages/core/index.js +1 -1
- package/cjs/packages/core/legacy-factory-diagnostics.js +1 -0
- package/cjs/packages/core/loader/model.js +1 -1
- package/cjs/packages/core/paths.js +1 -1
- package/cjs/packages/core/resource-lifecycle.js +1 -0
- package/cjs/packages/core/startup.js +1 -0
- package/cjs/packages/core/tokens.js +1 -0
- package/cjs/packages/utils/runFileFn.js +1 -1
- package/cjs/scripts/vite-build/build.js +2 -1
- package/esm/app/ai/agent/agent-scanner.service.js +88 -0
- package/esm/app/ai/agent/agent.interface.js +0 -0
- package/esm/app/ai/agent/agent.module.js +13 -0
- package/esm/app/ai/ai-config.module.js +24 -0
- package/esm/app/ai/ai-config.service.js +42 -0
- package/esm/app/ai/ai.controller.js +162 -0
- package/esm/app/ai/ai.module.js +48 -0
- package/esm/app/ai/contracts/index.js +0 -0
- package/esm/app/ai/declaration-paths.js +28 -0
- package/esm/app/ai/eval/assertions.js +49 -0
- package/esm/app/ai/guardrail/guardrail.interface.js +0 -0
- package/esm/app/ai/guardrail/guardrail.module.js +13 -0
- package/esm/app/ai/guardrail/guardrail.service.js +30 -0
- package/esm/app/ai/guardrail/internal/load-guardrail-config.js +17 -0
- package/esm/app/ai/index.js +2 -0
- package/esm/app/ai/mcp/internal/load-mcp-config.js +50 -0
- package/esm/app/ai/mcp/internal/read-sse-response.js +35 -0
- package/esm/app/ai/mcp/internal/stdio-process.js +59 -0
- package/esm/app/ai/mcp/mcp-registry.service.js +20 -0
- package/esm/app/ai/mcp/mcp.client.js +198 -0
- package/esm/app/ai/mcp/mcp.loader.js +85 -0
- package/esm/app/ai/mcp/mcp.module.js +70 -0
- package/esm/app/ai/mcp/mcp.types.js +4 -0
- package/esm/app/ai/memory/checkpoint.service.js +79 -0
- package/esm/app/ai/memory/internal/load-memory-config.js +15 -0
- package/esm/app/ai/memory/memory.module.js +17 -0
- package/esm/app/ai/memory/thread.service.js +75 -0
- package/esm/app/ai/models/chat-sse.js +44 -0
- package/esm/app/ai/models/chat.js +60 -0
- package/esm/app/ai/models/http.js +52 -0
- package/esm/app/ai/models/image.js +37 -0
- package/esm/app/ai/models/video.js +32 -0
- package/esm/app/ai/nest-service-provider.js +10 -0
- package/esm/app/ai/rag/chunker.js +23 -0
- package/esm/app/ai/rag/internal/load-embedding-config.js +44 -0
- package/esm/app/ai/rag/internal/load-rag-config.js +35 -0
- package/esm/app/ai/rag/rag.interface.js +4 -0
- package/esm/app/ai/rag/rag.module.js +30 -0
- package/esm/app/ai/rag/retriever.service.js +62 -0
- package/esm/app/ai/retention/conversation-retention.service.js +48 -0
- package/esm/app/ai/retention/retention-policy.js +14 -0
- package/esm/app/ai/runtime/ai-runtime-startup.validator.js +15 -0
- package/esm/app/ai/runtime/ai-runtime.js +104 -0
- package/esm/app/ai/runtime/internal/agent-run-context.js +5 -0
- package/esm/app/ai/runtime/internal/compact-tool-result.js +94 -0
- package/esm/app/ai/runtime/internal/context-compaction.service.js +346 -0
- package/esm/app/ai/runtime/internal/declaration-snapshot.js +32 -0
- package/esm/app/ai/runtime/internal/load-llm-config.js +52 -0
- package/esm/app/ai/runtime/internal/load-runtime-config.js +12 -0
- package/esm/app/ai/runtime/internal/owned-runtime-resources.js +21 -0
- package/esm/app/ai/runtime/internal/request-budget.js +152 -0
- package/esm/app/ai/runtime/internal/run-event-queue.js +23 -0
- package/esm/app/ai/runtime/langchain/langchain-planner.service.js +189 -0
- package/esm/app/ai/runtime/langchain/skill-tool.adapter.js +29 -0
- package/esm/app/ai/runtime/langgraph/agent.graph.js +157 -0
- package/esm/app/ai/runtime/langgraph/agent.state.js +37 -0
- package/esm/app/ai/runtime/langgraph/langgraph-orchestrator.service.js +404 -0
- package/esm/app/ai/runtime/runtime.module.js +65 -0
- package/esm/app/ai/runtime/thread-execution-coordinator.js +27 -0
- package/esm/app/ai/skill/skill-scanner.service.js +66 -0
- package/esm/app/ai/skill/skill.interface.js +0 -0
- package/esm/app/ai/skill/skill.module.js +13 -0
- package/esm/app/ai/snapshot-data.js +24 -0
- package/esm/app/ai/store/internal/archive-id.js +11 -0
- package/esm/app/ai/store/internal/create-vector-store.js +10 -0
- package/esm/app/ai/store/internal/load-store-config.js +27 -0
- package/esm/app/ai/store/internal/load-thread-state-store.js +17 -0
- package/esm/app/ai/store/reference/file-memory.store.js +279 -0
- package/esm/app/ai/store/reference/file-trace.store.js +44 -0
- package/esm/app/ai/store/reference/file-vector.store.js +41 -0
- package/esm/app/ai/store/reference/qdrant-vector.store.js +65 -0
- package/esm/app/ai/store/store.interface.js +4 -0
- package/esm/app/ai/store/store.module.js +36 -0
- package/esm/app/ai/tool/builtin/index.js +18 -0
- package/esm/app/ai/tool/builtin/invoke-agent.tool.js +82 -0
- package/esm/app/ai/tool/builtin/retrieve.tool.js +27 -0
- package/esm/app/ai/tool/executor.service.js +71 -0
- package/esm/app/ai/tool/tool-registry.service.js +23 -0
- package/esm/app/ai/tool/tool.interface.js +0 -0
- package/esm/app/ai/tool/tool.module.js +28 -0
- package/esm/app/ai/trace/trace.service.js +80 -0
- package/esm/app/csr/controller.js +187 -0
- package/esm/app/csr/types.js +0 -0
- package/esm/app/extends/$fetch.js +6 -6
- package/esm/app/extends/crypto.js +4 -3
- package/esm/app/extends/db.js +65 -65
- package/esm/app/extends/logger.js +73 -12
- package/esm/app/frontend-development.js +24 -0
- package/esm/app/html/browser-options.js +7 -0
- package/esm/app/html/shell.js +173 -32
- package/esm/app/http/api-signing.js +13 -0
- package/esm/app/http/body-parser.middleware.js +73 -0
- package/esm/app/http/compression.middleware.js +13 -0
- package/esm/app/http/context.js +21 -0
- package/esm/app/http/controller.js +9 -0
- package/esm/app/http/csp-nonce.js +13 -0
- package/esm/app/http/error-response.js +39 -0
- package/esm/app/http/errors.js +24 -0
- package/esm/app/http/exception-filter.js +52 -0
- package/esm/app/http/request-body-parser-policy.js +46 -0
- package/esm/app/http/request-data.js +17 -0
- package/esm/app/http/request-schema.pipe.js +40 -0
- package/esm/app/http/response.interceptor.js +26 -0
- package/esm/app/http/response.js +23 -0
- package/esm/app/http/security.guard.js +53 -0
- package/esm/app/project/controller.js +81 -0
- package/esm/app/project/service.js +35 -0
- package/esm/app/providers/csr.js +65 -0
- package/esm/app/providers/foundation.js +158 -0
- package/esm/app/ssr/artifacts.js +70 -0
- package/esm/app/ssr/controller.js +193 -0
- package/esm/app/ssr/html.js +67 -53
- package/esm/app/ssr/manifest.js +24 -10
- package/esm/app/ssr/session.js +91 -0
- package/esm/app/ssr/stream.js +51 -0
- package/esm/app/ssr/streaming-request-cache.js +30 -0
- package/esm/app/ssr/types.js +0 -0
- package/esm/app/static-assets.middleware.js +68 -0
- package/esm/app/template-core.module.js +97 -0
- package/esm/app/view/entry.tpl +2 -2
- package/esm/bundler/buildBE.js +1 -0
- package/esm/bundler/buildFE.js +11 -11
- package/esm/bundler/buildSSR.js +61 -63
- package/esm/bundler/dev-session.js +145 -0
- package/esm/bundler/dev.js +8 -9
- package/esm/bundler/entryCollect.js +9 -9
- package/esm/bundler/feSharedConfig.js +41 -11
- package/esm/bundler/index.js +2 -1
- package/esm/bundler/prod.js +7 -11
- package/esm/bundler/ssrClientManifest.js +5 -5
- package/esm/bundler/ssrEntries.js +5 -5
- package/esm/bundler/state.js +5 -7
- package/esm/bundler/utils.js +171 -161
- package/esm/config/config.default.js +4 -3
- package/esm/index.js +29 -12
- package/esm/package.json +1 -0
- package/esm/packages/common/index.js +5 -5
- package/esm/packages/core/bootstrap.js +82 -0
- package/esm/packages/core/config-service.js +46 -0
- package/esm/packages/core/duplicate-route-checking-adapter.js +106 -0
- package/esm/packages/core/index.js +7 -60
- package/esm/packages/core/legacy-factory-diagnostics.js +74 -0
- package/esm/packages/core/loader/model.js +6 -1
- package/esm/packages/core/paths.js +5 -11
- package/esm/packages/core/resource-lifecycle.js +83 -0
- package/esm/packages/core/startup.js +256 -0
- package/esm/packages/core/tokens.js +4 -0
- package/esm/packages/utils/runFileFn.js +19 -35
- package/esm/scripts/vite-build/build.js +29 -22
- package/fe/frontend/apps/dash/Dashboard.js +3 -3
- package/fe/frontend/apps/ui-components/UiComponentsPreview.d.ts +2 -0
- package/fe/frontend/apps/ui-components/UiComponentsPreview.js +182 -0
- package/fe/frontend/apps/ui-components/index.d.ts +1 -2
- package/fe/frontend/apps/ui-components/index.js +2 -8
- package/fe/frontend/apps/ui-components/ui-components.entry.js +3 -2
- package/fe/frontend/src/common/fetchErrorShow.js +1 -1
- package/fe/frontend/src/common/importComponent.js +1 -1
- package/fe/frontend/src/common/language.d.ts +1 -1
- package/fe/frontend/src/common/language.js +2 -2
- package/fe/frontend/src/common/request.d.ts +2 -0
- package/fe/frontend/src/common/request.js +19 -5
- package/fe/frontend/src/common/schemaForm.js +2 -2
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +1 -1
- package/fe/frontend/src/components/AsyncSelect/AsyncSelect.js +3 -3
- package/fe/frontend/src/components/BasePage/HeaderView.js +1 -2
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.d.ts +1 -1
- package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.js +7 -7
- package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.js +14 -8
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.js +3 -3
- package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.js +4 -4
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.js +2 -2
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/PreviewImage.d.ts +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/PreviewImage.js +1 -1
- package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.js +7 -7
- package/fe/frontend/src/defaultPages/SchemaPage/index.js +2 -2
- package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +2 -2
- package/fe/frontend/src/hooks/useRouterParams.d.ts +4 -2
- package/fe/frontend/src/hooks/useText.d.ts +1 -1
- package/fe/frontend/src/hooks/useText.js +2 -2
- package/fe/frontend/src/index.d.ts +4 -4
- package/fe/frontend/src/index.js +4 -4
- package/fe/frontend/src/language/resources.d.ts +1 -1
- package/fe/frontend/src/main.css +1 -1
- package/fe/frontend/src/stores/apiFreezer.d.ts +1 -1
- package/fe/frontend/src/stores/apiFreezer.js +2 -2
- package/fe/frontend/src/stores/mode.js +1 -2
- package/fe/frontend/src/stores/schemaStore.d.ts +2 -2
- package/fe/frontend/src/stores/schemaStore.js +1 -2
- package/fe/frontend/src/typing/scalability.d.ts +2 -2
- package/fe/models/types/data/button.d.ts +1 -1
- package/fe/models/types/data/component.d.ts +1 -1
- package/fe/models/types/data/schema.d.ts +1 -1
- package/fe/models/types/data/search.d.ts +1 -1
- package/fe/packages/common/index.js +4 -4
- package/fe/packages/common/ssr/hydration.d.ts +9 -0
- package/fe/packages/react/core/Button/Button.js +88 -0
- package/fe/packages/react/core/Button/SubmitButton.d.ts +8 -0
- package/fe/packages/react/core/Button/SubmitButton.js +31 -0
- package/fe/packages/react/core/Button/index.js +3 -0
- package/fe/packages/react/core/Card/Card.js +31 -0
- package/fe/packages/react/core/Card/index.js +2 -0
- package/fe/packages/react/core/Checkbox/Checkbox.js +52 -0
- package/fe/packages/react/core/Checkbox/index.js +2 -0
- package/fe/packages/react/core/Label/Label.d.ts +22 -0
- package/fe/packages/react/core/Label/Label.js +60 -0
- package/fe/packages/react/core/Label/index.js +2 -0
- package/fe/packages/react/core/Layout/Layout.js +33 -0
- package/fe/packages/react/core/Layout/index.js +2 -0
- package/fe/packages/react/core/Loading/Loading.js +48 -0
- package/fe/packages/react/core/Loading/index.js +2 -0
- package/fe/packages/react/core/Skeleton/Skeleton.js +101 -0
- package/fe/packages/react/core/Skeleton/index.js +2 -0
- package/fe/packages/react/core/breadcrumb/breadcrumb.js +155 -0
- package/fe/packages/react/core/breadcrumb/index.js +2 -0
- package/fe/packages/react/core/hooks/index.d.ts +12 -0
- package/fe/packages/react/core/hooks/index.js +13 -0
- package/fe/packages/react/core/hooks/useBreadcrumb.d.ts +9 -0
- package/fe/packages/react/core/hooks/useBreadcrumb.js +5 -0
- package/fe/packages/react/core/hooks/useDropdownPositioning.js +122 -0
- package/fe/packages/react/core/hooks/useExecuteOnce.js +47 -0
- package/fe/packages/react/core/hooks/useHydrationData.d.ts +2 -0
- package/fe/packages/react/core/hooks/useHydrationData.js +23 -0
- package/fe/packages/react/core/hooks/useInit.js +11 -0
- package/fe/packages/react/core/hooks/useInputController.js +39 -0
- package/fe/packages/react/core/hooks/useLanguage.d.ts +1 -0
- package/fe/packages/react/core/hooks/useLanguage.js +8 -0
- package/fe/packages/react/core/hooks/usePagination.js +30 -0
- package/fe/packages/react/core/hooks/useRefState.js +45 -0
- package/fe/packages/react/core/hooks/useSSR.js +46 -0
- package/fe/packages/react/core/hooks/useTableState.d.ts +22 -0
- package/fe/packages/react/core/hooks/useTableState.js +22 -0
- package/fe/packages/react/core/hooks/useWatch.js +60 -0
- package/fe/packages/react/core/index.d.ts +12 -0
- package/fe/packages/react/core/index.js +37 -0
- package/fe/packages/react/core/internal/hydration.d.ts +12 -0
- package/fe/packages/react/core/internal/hydration.js +17 -0
- package/fe/packages/react/core/internal/i18n/default.d.ts +99 -0
- package/fe/packages/react/core/internal/i18n/default.js +111 -0
- package/fe/packages/react/core/internal/i18n/en-US.d.ts +99 -0
- package/fe/packages/react/core/internal/i18n/en-US.js +111 -0
- package/fe/packages/react/core/internal/i18n/index.d.ts +18 -0
- package/fe/packages/react/core/internal/i18n/index.js +179 -0
- package/fe/packages/react/core/internal/i18n/locales.d.ts +7 -0
- package/fe/packages/react/core/internal/i18n/locales.js +18 -0
- package/fe/packages/react/core/internal/i18n/types.d.ts +47 -0
- package/fe/packages/react/core/internal/i18n/types.js +0 -0
- package/fe/packages/react/core/internal/raf-timeout.d.ts +2 -0
- package/fe/packages/react/core/internal/raf-timeout.js +54 -0
- package/fe/packages/react/core/internal/react19-compat.d.ts +15 -0
- package/fe/packages/react/core/internal/react19-compat.js +0 -0
- package/fe/packages/react/core/lib/createStoreHook.js +9 -0
- package/fe/packages/react/core/lib/dataTableWidth.js +33 -0
- package/fe/packages/react/core/lib/export.d.ts +21 -0
- package/fe/packages/react/core/lib/export.js +112 -0
- package/fe/packages/react/core/lib/index.d.ts +4 -0
- package/fe/packages/react/core/lib/index.js +5 -0
- package/fe/packages/react/core/lib/utils.d.ts +10 -0
- package/fe/packages/react/core/lib/utils.js +64 -0
- package/fe/packages/react/core/stores/breadcrumb.d.ts +14 -0
- package/fe/packages/react/core/stores/breadcrumb.js +52 -0
- package/fe/packages/react/core/stores/index.d.ts +2 -0
- package/fe/packages/react/core/stores/index.js +5 -0
- package/fe/packages/react/core/stores/language.d.ts +3 -0
- package/fe/packages/react/core/stores/language.js +3 -0
- package/fe/packages/react/core/types/baseType.js +0 -0
- package/fe/packages/react/core/types/index.js +0 -0
- package/fe/packages/react/dev/preview/DemoSection.d.ts +12 -0
- package/fe/packages/react/dev/preview/demoRegistry.d.ts +8 -0
- package/fe/packages/react/dev/preview/demos/core/ButtonDemo.d.ts +3 -0
- package/fe/packages/react/dev/preview/demos/forms/InputDemo.d.ts +3 -0
- package/fe/packages/react/dev/preview/demos/overlays/ModalDemo.d.ts +3 -0
- package/fe/packages/react/dev/preview/index.d.ts +2 -0
- package/fe/packages/react/forms/DataTable/ActionBtn.d.ts +7 -0
- package/fe/packages/react/forms/DataTable/ActionBtn.js +116 -0
- package/fe/packages/react/forms/DataTable/index.d.ts +34 -0
- package/fe/packages/react/forms/DataTable/index.js +230 -0
- package/fe/packages/react/forms/Date/Calendar.js +351 -0
- package/fe/packages/react/forms/Date/Date.js +210 -0
- package/fe/packages/react/forms/Date/LocaleContext.js +27 -0
- package/fe/packages/react/forms/Date/LocaleProvider.js +22 -0
- package/fe/packages/react/forms/Date/TimePicker.js +136 -0
- package/fe/packages/react/forms/Date/data.js +7 -0
- package/fe/packages/react/forms/Date/dateLocaleStore.js +14 -0
- package/fe/packages/react/forms/Date/dropdownPositioning.d.ts +2 -0
- package/fe/packages/react/forms/Date/dropdownPositioning.js +12 -0
- package/fe/packages/react/forms/Date/index.js +6 -0
- package/fe/packages/react/forms/Date/locales.d.ts +30 -0
- package/fe/packages/react/forms/Date/locales.js +58 -0
- package/fe/packages/react/forms/Form/Form.js +15 -0
- package/fe/packages/react/forms/Form/FormItem.d.ts +19 -0
- package/fe/packages/react/forms/Form/FormItem.js +87 -0
- package/fe/packages/react/forms/Form/SchemaForm/data.d.ts +40 -0
- package/fe/packages/react/forms/Form/SchemaForm/data.js +15 -0
- package/fe/packages/react/forms/Form/SchemaForm/defaultComponentsMap.js +4 -0
- package/fe/packages/react/forms/Form/SchemaForm/index.d.ts +60 -0
- package/fe/packages/react/forms/Form/SchemaForm/index.js +119 -0
- package/fe/packages/react/forms/Form/index.d.ts +5 -0
- package/fe/packages/react/forms/Form/index.js +6 -0
- package/fe/packages/react/forms/Input/Input.js +146 -0
- package/fe/packages/react/forms/Input/index.js +2 -0
- package/fe/packages/react/forms/InputNumber/InputNumber.d.ts +25 -0
- package/fe/packages/react/forms/InputNumber/InputNumber.js +207 -0
- package/fe/packages/react/forms/InputNumber/index.js +2 -0
- package/fe/packages/react/forms/InputNumber/inputNumberUtils.js +45 -0
- package/fe/packages/react/forms/MultiSelect/MultiSelect.d.ts +26 -0
- package/fe/packages/react/forms/MultiSelect/MultiSelect.js +218 -0
- package/fe/packages/react/forms/MultiSelect/index.d.ts +1 -0
- package/fe/packages/react/forms/MultiSelect/index.js +2 -0
- package/fe/packages/react/forms/Pagination/Pagination.d.ts +15 -0
- package/fe/packages/react/forms/Pagination/Pagination.js +124 -0
- package/fe/packages/react/forms/Pagination/index.js +2 -0
- package/fe/packages/react/forms/Radio/Radio.js +36 -0
- package/fe/packages/react/forms/Radio/RadioGroup.js +33 -0
- package/fe/packages/react/forms/Radio/index.js +3 -0
- package/fe/packages/react/forms/Search/Search.d.ts +13 -0
- package/fe/packages/react/forms/Search/Search.js +24 -0
- package/fe/packages/react/forms/Search/index.js +2 -0
- package/fe/packages/react/forms/Select/Select.d.ts +32 -0
- package/fe/packages/react/forms/Select/Select.js +295 -0
- package/fe/packages/react/forms/Select/dropdownPositioning.d.ts +2 -0
- package/fe/packages/react/forms/Select/dropdownPositioning.js +16 -0
- package/fe/packages/react/forms/Select/index.js +2 -0
- package/fe/packages/react/forms/Switch/Switch.js +28 -0
- package/fe/packages/react/forms/Switch/index.js +2 -0
- package/fe/packages/react/forms/TableSearch/TableSearch.d.ts +30 -0
- package/fe/packages/react/forms/TableSearch/TableSearch.js +154 -0
- package/fe/packages/react/forms/TableSearch/index.js +2 -0
- package/fe/packages/react/forms/TableSearch/lang.d.ts +16 -0
- package/fe/packages/react/forms/TableSearch/lang.js +25 -0
- package/fe/packages/react/forms/TableSearch/tableSearchLocaleStore.js +10 -0
- package/fe/packages/react/forms/Textarea/Textarea.js +58 -0
- package/fe/packages/react/forms/Textarea/index.js +2 -0
- package/fe/packages/react/forms/TreeSelect/TreeSelect.js +190 -0
- package/fe/packages/react/forms/TreeSelect/index.js +2 -0
- package/fe/packages/react/forms/Upload/ImageUpload.js +101 -0
- package/fe/packages/react/forms/Upload/Upload.js +29 -0
- package/fe/packages/react/forms/Upload/index.js +3 -0
- package/fe/packages/react/forms/index.d.ts +16 -0
- package/fe/packages/react/forms/index.js +43 -0
- package/fe/packages/react/forms/table/index.js +2 -0
- package/fe/packages/react/forms/table/table.js +166 -0
- package/fe/packages/react/i18n/I18nContext.d.ts +6 -0
- package/fe/packages/react/i18n/I18nContext.js +5 -0
- package/fe/packages/react/i18n/I18nProvider.d.ts +6 -0
- package/fe/packages/react/i18n/I18nProvider.js +19 -0
- package/fe/packages/react/i18n/getUiReactLocale.d.ts +202 -0
- package/fe/packages/react/i18n/getUiReactLocale.js +13 -0
- package/fe/packages/react/i18n/index.d.ts +5 -0
- package/fe/packages/react/i18n/index.js +7 -0
- package/fe/packages/react/i18n/legacy.d.ts +9 -0
- package/fe/packages/react/i18n/legacy.js +12 -0
- package/fe/packages/react/i18n/locales/en-US.d.ts +1 -0
- package/fe/packages/react/i18n/locales/en-US.js +2 -0
- package/fe/packages/react/i18n/locales/zh-CN.d.ts +1 -0
- package/fe/packages/react/i18n/locales/zh-CN.js +2 -0
- package/fe/packages/react/i18n/useI18n.d.ts +2 -0
- package/fe/packages/react/i18n/useI18n.js +15 -0
- package/fe/packages/react/i18n/useI18nState.d.ts +3 -0
- package/fe/packages/react/i18n/useI18nState.js +24 -0
- package/fe/packages/react/index.d.ts +6 -0
- package/fe/packages/react/index.js +81 -0
- package/fe/packages/react/overlays/Dialog/ConfirmDialog.js +41 -0
- package/fe/packages/react/overlays/Dialog/index.js +2 -0
- package/fe/packages/react/overlays/Drawer/Drawer.d.ts +23 -0
- package/fe/packages/react/overlays/Drawer/Drawer.js +165 -0
- package/fe/packages/react/overlays/Drawer/index.js +2 -0
- package/fe/packages/react/overlays/Dropdown/Dropdown.d.ts +34 -0
- package/fe/packages/react/overlays/Dropdown/Dropdown.js +118 -0
- package/fe/packages/react/overlays/Dropdown/index.js +2 -0
- package/fe/packages/react/overlays/DropdownMenu/Menu.js +147 -0
- package/fe/packages/react/overlays/DropdownMenu/MenuContext.js +88 -0
- package/fe/packages/react/overlays/DropdownMenu/MenuItem.js +78 -0
- package/fe/packages/react/overlays/DropdownMenu/SubMenu.js +207 -0
- package/fe/packages/react/overlays/DropdownMenu/index.js +5 -0
- package/fe/packages/react/overlays/DropdownMenu/menuTypes.js +0 -0
- package/fe/packages/react/overlays/DropdownMenu/utils.js +8 -0
- package/fe/packages/react/overlays/Message/Message.js +76 -0
- package/fe/packages/react/overlays/Message/MessageManager.js +104 -0
- package/fe/packages/react/overlays/Message/data.js +4 -0
- package/fe/packages/react/overlays/Message/index.js +2 -0
- package/fe/packages/react/overlays/Modal/Modal.d.ts +28 -0
- package/fe/packages/react/overlays/Modal/Modal.js +83 -0
- package/fe/packages/react/overlays/Modal/ModalManager.d.ts +47 -0
- package/fe/packages/react/overlays/Modal/ModalManager.js +116 -0
- package/fe/packages/react/overlays/Modal/index.d.ts +4 -0
- package/fe/packages/react/overlays/Modal/index.js +3 -0
- package/fe/packages/react/overlays/Overlay/Overlay.d.ts +23 -0
- package/fe/packages/react/overlays/Overlay/Overlay.js +78 -0
- package/fe/packages/react/overlays/Overlay/focusTypes.d.ts +8 -0
- package/fe/packages/react/overlays/Overlay/focusTypes.js +0 -0
- package/fe/packages/react/overlays/Overlay/index.d.ts +3 -0
- package/fe/packages/react/overlays/Overlay/index.js +2 -0
- package/fe/packages/react/overlays/Overlay/overlayStack.d.ts +16 -0
- package/fe/packages/react/overlays/Overlay/overlayStack.js +290 -0
- package/fe/packages/react/overlays/Popover/Notification.js +56 -0
- package/fe/packages/react/overlays/Popover/index.js +2 -0
- package/fe/packages/react/overlays/Popup/Popup.d.ts +26 -0
- package/fe/packages/react/overlays/Popup/Popup.js +108 -0
- package/fe/packages/react/overlays/Popup/index.js +2 -0
- package/fe/packages/react/overlays/Tooltip/Tooltip.js +88 -0
- package/fe/packages/react/overlays/Tooltip/index.js +2 -0
- package/fe/packages/react/overlays/index.d.ts +10 -0
- package/fe/packages/react/overlays/index.js +25 -0
- package/fe/packages/react/styles.css +299 -0
- package/fe/packages/react/ui/components/Button/index.d.ts +1 -3
- package/fe/packages/react/ui/components/Button/index.js +3 -2
- package/fe/packages/react/ui/components/Card/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Card/index.js +2 -1
- package/fe/packages/react/ui/components/Checkbox/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Checkbox/index.js +2 -1
- package/fe/packages/react/ui/components/ConfirmDialog/index.d.ts +1 -1
- package/fe/packages/react/ui/components/ConfirmDialog/index.js +2 -1
- package/fe/packages/react/ui/components/DataTable/index.d.ts +1 -32
- package/fe/packages/react/ui/components/DataTable/index.js +2 -215
- package/fe/packages/react/ui/components/Date/index.d.ts +1 -5
- package/fe/packages/react/ui/components/Date/index.js +6 -5
- package/fe/packages/react/ui/components/Drawer/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Drawer/index.js +2 -1
- package/fe/packages/react/ui/components/Dropdown/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Dropdown/index.js +2 -1
- package/fe/packages/react/ui/components/Form/index.d.ts +1 -4
- package/fe/packages/react/ui/components/Form/index.js +6 -5
- package/fe/packages/react/ui/components/ImagePreview/ImagePreview.js +9 -5
- package/fe/packages/react/ui/components/ImagePreview/PreviewImage.d.ts +1 -1
- package/fe/packages/react/ui/components/ImagePreview/PreviewImage.js +4 -4
- package/fe/packages/react/ui/components/Input/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Input/index.js +2 -1
- package/fe/packages/react/ui/components/InputNumber/index.d.ts +1 -1
- package/fe/packages/react/ui/components/InputNumber/index.js +2 -1
- package/fe/packages/react/ui/components/Label/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Label/index.js +3 -2
- package/fe/packages/react/ui/components/Layout/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Layout/index.js +2 -1
- package/fe/packages/react/ui/components/Loading/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Loading/index.js +2 -1
- package/fe/packages/react/ui/components/Menu/index.d.ts +1 -8
- package/fe/packages/react/ui/components/Menu/index.js +5 -4
- package/fe/packages/react/ui/components/Message/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Message/index.js +2 -1
- package/fe/packages/react/ui/components/Modal/index.d.ts +1 -3
- package/fe/packages/react/ui/components/Modal/index.js +3 -2
- package/fe/packages/react/ui/components/Notification/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Notification/index.js +2 -1
- package/fe/packages/react/ui/components/Overlay/Overlay.js +1 -1
- package/fe/packages/react/ui/components/Overlay/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Overlay/index.js +2 -1
- package/fe/packages/react/ui/components/Pagination/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Pagination/index.js +2 -1
- package/fe/packages/react/ui/components/Popup/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Popup/index.js +2 -1
- package/fe/packages/react/ui/components/Radio/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Radio/index.js +3 -2
- package/fe/packages/react/ui/components/Search/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Search/index.js +2 -1
- package/fe/packages/react/ui/components/Select/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Select/index.js +2 -1
- package/fe/packages/react/ui/components/Skeleton/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Skeleton/index.js +2 -1
- package/fe/packages/react/ui/components/Switch/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Switch/index.js +2 -1
- package/fe/packages/react/ui/components/TableSearch/index.d.ts +1 -2
- package/fe/packages/react/ui/components/TableSearch/index.js +2 -1
- package/fe/packages/react/ui/components/Tabs/Tabs.js +1 -1
- package/fe/packages/react/ui/components/Textarea/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Textarea/index.js +2 -1
- package/fe/packages/react/ui/components/Tooltip/index.d.ts +1 -1
- package/fe/packages/react/ui/components/Tooltip/index.js +2 -1
- package/fe/packages/react/ui/components/TreeSelect/index.d.ts +1 -1
- package/fe/packages/react/ui/components/TreeSelect/index.js +2 -1
- package/fe/packages/react/ui/components/Upload/index.d.ts +1 -2
- package/fe/packages/react/ui/components/Upload/index.js +3 -2
- package/fe/packages/react/ui/components/breadcrumb/index.d.ts +1 -1
- package/fe/packages/react/ui/components/breadcrumb/index.js +2 -1
- package/fe/packages/react/ui/components/index.d.ts +3 -33
- package/fe/packages/react/ui/components/index.js +70 -77
- package/fe/packages/react/ui/components/table/index.d.ts +1 -1
- package/fe/packages/react/ui/components/table/index.js +2 -1
- package/fe/packages/react/ui/i18n/I18nProvider.d.ts +1 -1
- package/fe/packages/react/ui/i18n/I18nProvider.js +2 -1
- package/fe/packages/react/ui/i18n/index.d.ts +1 -3
- package/fe/packages/react/ui/i18n/index.js +8 -7
- package/fe/packages/react/ui/i18n/useI18n.d.ts +6 -6
- package/fe/packages/react/ui/i18n/useI18n.js +2 -2
- package/fe/packages/react/ui/index.css +2 -299
- package/fe/packages/react/ui/index.d.ts +0 -2
- package/fe/packages/react/ui/index.js +73 -55
- package/fe/ssr/apps/dash/dash.entry.js +7 -3
- package/fe/ssr/apps/ui-components/ui-components.entry.js +3 -2
- package/fe/ssr/components/StreamingRender/StreamingCache.d.ts +1 -0
- package/fe/ssr/components/StreamingRender/StreamingCache.js +11 -1
- package/fe/ssr/components/StreamingRender/StreamingRender.d.ts +1 -1
- package/fe/ssr/components/StreamingRender/StreamingRender.js +29 -23
- package/fe/ssr/components/StreamingRender/StreamingScript.d.ts +3 -0
- package/fe/ssr/components/StreamingRender/StreamingScript.js +47 -1
- package/fe/ssr/createSSREntry.d.ts +9 -3
- package/fe/ssr/createSSREntry.js +43 -19
- package/fe/ssr/index.d.ts +4 -1
- package/fe/ssr/index.js +2 -1
- package/fe/ssr/router.d.ts +76 -0
- package/fe/ssr/router.js +349 -0
- package/fe/ssr/types.d.ts +1 -13
- package/models/frontend/src/common/language.d.ts +1 -1
- package/models/frontend/src/common/request.d.ts +2 -0
- package/models/frontend/src/components/AsyncSelect/AsyncSelect.d.ts +1 -1
- package/models/frontend/src/hooks/useText.d.ts +1 -1
- package/models/frontend/src/language/resources.d.ts +1 -1
- package/models/frontend/src/stores/apiFreezer.d.ts +1 -1
- package/models/frontend/src/stores/schemaStore.d.ts +2 -2
- package/models/frontend/src/typing/scalability.d.ts +2 -2
- package/models/models/types/data/button.d.ts +1 -1
- package/models/models/types/data/component.d.ts +1 -1
- package/models/models/types/data/schema.d.ts +1 -1
- package/models/models/types/data/search.d.ts +1 -1
- package/models/packages/common/ssr/hydration.d.ts +9 -0
- package/models/packages/react/core/Button/SubmitButton.d.ts +8 -0
- package/models/packages/react/core/Button/index.d.ts +3 -0
- package/models/packages/react/core/Card/index.d.ts +1 -0
- package/models/packages/react/core/Checkbox/index.d.ts +1 -0
- package/models/packages/react/core/Label/Label.d.ts +22 -0
- package/models/packages/react/core/Label/index.d.ts +2 -0
- package/models/packages/react/core/Layout/index.d.ts +1 -0
- package/models/packages/react/core/Loading/index.d.ts +1 -0
- package/models/packages/react/core/Skeleton/index.d.ts +2 -0
- package/models/packages/react/core/breadcrumb/index.d.ts +1 -0
- package/models/packages/react/core/hooks/index.d.ts +12 -0
- package/models/packages/react/core/hooks/useBreadcrumb.d.ts +9 -0
- package/models/packages/react/core/hooks/useHydrationData.d.ts +2 -0
- package/models/packages/react/core/hooks/useInit.d.ts +2 -0
- package/models/packages/react/core/hooks/useLanguage.d.ts +1 -0
- package/models/packages/react/core/hooks/usePagination.d.ts +15 -0
- package/models/packages/react/core/hooks/useRefState.d.ts +9 -0
- package/models/packages/react/core/hooks/useSSR.d.ts +6 -0
- package/models/packages/react/core/hooks/useTableState.d.ts +22 -0
- package/models/packages/react/core/hooks/useWatch.d.ts +14 -0
- package/models/packages/react/core/index.d.ts +12 -0
- package/models/packages/react/core/internal/hydration.d.ts +12 -0
- package/models/packages/react/core/internal/i18n/default.d.ts +99 -0
- package/models/packages/react/core/internal/i18n/en-US.d.ts +99 -0
- package/models/packages/react/core/internal/i18n/index.d.ts +18 -0
- package/models/packages/react/core/internal/i18n/locales.d.ts +7 -0
- package/models/packages/react/core/internal/i18n/types.d.ts +47 -0
- package/models/packages/react/core/internal/raf-timeout.d.ts +2 -0
- package/models/packages/react/core/internal/react19-compat.d.ts +15 -0
- package/models/packages/react/core/lib/export.d.ts +21 -0
- package/models/packages/react/core/lib/index.d.ts +4 -0
- package/models/packages/react/core/lib/utils.d.ts +10 -0
- package/models/packages/react/core/stores/breadcrumb.d.ts +14 -0
- package/models/packages/react/core/stores/index.d.ts +2 -0
- package/models/packages/react/core/stores/language.d.ts +3 -0
- package/models/packages/react/core/types/baseType.d.ts +21 -0
- package/models/packages/react/forms/DataTable/ActionBtn.d.ts +7 -0
- package/models/packages/react/forms/DataTable/index.d.ts +34 -0
- package/models/packages/react/forms/Date/dropdownPositioning.d.ts +2 -0
- package/models/packages/react/forms/Date/index.d.ts +5 -0
- package/models/packages/react/forms/Date/locales.d.ts +30 -0
- package/models/packages/react/forms/Form/FormItem.d.ts +19 -0
- package/models/packages/react/forms/Form/SchemaForm/data.d.ts +40 -0
- package/models/packages/react/forms/Form/SchemaForm/index.d.ts +60 -0
- package/models/packages/react/forms/Form/index.d.ts +5 -0
- package/models/packages/react/forms/Input/index.d.ts +1 -0
- package/models/packages/react/forms/InputNumber/InputNumber.d.ts +25 -0
- package/models/packages/react/forms/InputNumber/index.d.ts +1 -0
- package/models/packages/react/forms/MultiSelect/MultiSelect.d.ts +26 -0
- package/models/packages/react/forms/MultiSelect/index.d.ts +1 -0
- package/models/packages/react/forms/Pagination/Pagination.d.ts +15 -0
- package/models/packages/react/forms/Pagination/index.d.ts +1 -0
- package/models/packages/react/forms/Radio/index.d.ts +2 -0
- package/models/packages/react/forms/Search/Search.d.ts +13 -0
- package/models/packages/react/forms/Search/index.d.ts +1 -0
- package/models/packages/react/forms/Select/Select.d.ts +32 -0
- package/models/packages/react/forms/Select/dropdownPositioning.d.ts +2 -0
- package/models/packages/react/forms/Select/index.d.ts +1 -0
- package/models/packages/react/forms/Switch/index.d.ts +1 -0
- package/models/packages/react/forms/TableSearch/TableSearch.d.ts +30 -0
- package/models/packages/react/forms/TableSearch/index.d.ts +2 -0
- package/models/packages/react/forms/TableSearch/lang.d.ts +16 -0
- package/models/packages/react/forms/Textarea/index.d.ts +1 -0
- package/models/packages/react/forms/TreeSelect/index.d.ts +1 -0
- package/models/packages/react/forms/Upload/index.d.ts +2 -0
- package/models/packages/react/forms/index.d.ts +16 -0
- package/models/packages/react/forms/table/index.d.ts +1 -0
- package/models/packages/react/i18n/I18nContext.d.ts +6 -0
- package/models/packages/react/i18n/I18nProvider.d.ts +6 -0
- package/models/packages/react/i18n/getUiReactLocale.d.ts +202 -0
- package/models/packages/react/i18n/index.d.ts +5 -0
- package/models/packages/react/i18n/legacy.d.ts +9 -0
- package/models/packages/react/i18n/locales/en-US.d.ts +1 -0
- package/models/packages/react/i18n/locales/zh-CN.d.ts +1 -0
- package/models/packages/react/i18n/useI18n.d.ts +2 -0
- package/models/packages/react/i18n/useI18nState.d.ts +3 -0
- package/models/packages/react/index.d.ts +6 -0
- package/models/packages/react/overlays/Dialog/index.d.ts +1 -0
- package/models/packages/react/overlays/Drawer/Drawer.d.ts +23 -0
- package/models/packages/react/overlays/Drawer/index.d.ts +2 -0
- package/models/packages/react/overlays/Dropdown/Dropdown.d.ts +34 -0
- package/models/packages/react/overlays/Dropdown/index.d.ts +1 -0
- package/models/packages/react/overlays/DropdownMenu/index.d.ts +8 -0
- package/models/packages/react/overlays/Message/index.d.ts +2 -0
- package/models/packages/react/overlays/Modal/Modal.d.ts +28 -0
- package/models/packages/react/overlays/Modal/ModalManager.d.ts +47 -0
- package/models/packages/react/overlays/Modal/index.d.ts +4 -0
- package/models/packages/react/overlays/Overlay/Overlay.d.ts +23 -0
- package/models/packages/react/overlays/Overlay/focusTypes.d.ts +8 -0
- package/models/packages/react/overlays/Overlay/index.d.ts +3 -0
- package/models/packages/react/overlays/Overlay/overlayStack.d.ts +16 -0
- package/models/packages/react/overlays/Popover/index.d.ts +1 -0
- package/models/packages/react/overlays/Popup/Popup.d.ts +26 -0
- package/models/packages/react/overlays/Popup/index.d.ts +1 -0
- package/models/packages/react/overlays/Tooltip/index.d.ts +1 -0
- package/models/packages/react/overlays/index.d.ts +10 -0
- package/models/packages/react/ui/components/ImagePreview/PreviewImage.d.ts +1 -1
- package/models/packages/react/ui/components/index.d.ts +3 -33
- package/models/packages/react/ui/i18n/useI18n.d.ts +6 -6
- package/package.json +129 -22
- package/ssr/STREAMING_BOOTSTRAP.md +360 -0
- package/types/app/ai/agent/agent-run.dto.d.ts +7 -0
- package/types/app/ai/agent/agent-scanner.service.d.ts +16 -0
- package/types/app/ai/agent/agent.interface.d.ts +13 -0
- package/types/app/ai/agent/agent.module.d.ts +2 -0
- package/types/app/ai/ai-config.module.d.ts +4 -0
- package/types/app/ai/ai-config.service.d.ts +14 -0
- package/types/app/ai/ai.controller.d.ts +3 -0
- package/types/app/ai/ai.module.d.ts +4 -0
- package/types/app/ai/contracts/index.d.ts +129 -0
- package/types/app/ai/declaration-paths.d.ts +3 -0
- package/types/app/ai/eval/assertions.d.ts +26 -0
- package/types/app/ai/guardrail/guardrail.interface.d.ts +10 -0
- package/types/app/ai/guardrail/guardrail.module.d.ts +2 -0
- package/types/app/ai/guardrail/guardrail.service.d.ts +11 -0
- package/types/app/ai/guardrail/internal/load-guardrail-config.d.ts +4 -0
- package/types/app/ai/index.d.ts +9 -0
- package/types/app/ai/mcp/internal/load-mcp-config.d.ts +7 -0
- package/types/app/ai/mcp/internal/read-sse-response.d.ts +2 -0
- package/types/app/ai/mcp/internal/stdio-process.d.ts +5 -0
- package/types/app/ai/mcp/mcp-registry.service.d.ts +13 -0
- package/types/app/ai/mcp/mcp.client.d.ts +44 -0
- package/types/app/ai/mcp/mcp.loader.d.ts +26 -0
- package/types/app/ai/mcp/mcp.module.d.ts +14 -0
- package/types/app/ai/mcp/mcp.types.d.ts +51 -0
- package/types/app/ai/memory/checkpoint.service.d.ts +15 -0
- package/types/app/ai/memory/internal/load-memory-config.d.ts +9 -0
- package/types/app/ai/memory/memory.module.d.ts +2 -0
- package/types/app/ai/memory/thread.service.d.ts +34 -0
- package/types/app/ai/models/chat-sse.d.ts +5 -0
- package/types/app/ai/models/chat.d.ts +22 -0
- package/types/app/ai/models/http.d.ts +20 -0
- package/types/app/ai/models/image.d.ts +69 -0
- package/types/app/ai/models/video.d.ts +99 -0
- package/types/app/ai/nest-service-provider.d.ts +6 -0
- package/types/app/ai/rag/chunker.d.ts +14 -0
- package/types/app/ai/rag/internal/load-embedding-config.d.ts +11 -0
- package/types/app/ai/rag/internal/load-rag-config.d.ts +16 -0
- package/types/app/ai/rag/rag.interface.d.ts +57 -0
- package/types/app/ai/rag/rag.module.d.ts +2 -0
- package/types/app/ai/rag/retriever.service.d.ts +18 -0
- package/types/app/ai/retention/conversation-retention.service.d.ts +19 -0
- package/types/app/ai/retention/retention-policy.d.ts +5 -0
- package/types/app/ai/runtime/ai-runtime-startup.validator.d.ts +10 -0
- package/types/app/ai/runtime/ai-runtime.d.ts +46 -0
- package/types/app/ai/runtime/internal/agent-run-context.d.ts +16 -0
- package/types/app/ai/runtime/internal/compact-tool-result.d.ts +21 -0
- package/types/app/ai/runtime/internal/context-compaction.service.d.ts +33 -0
- package/types/app/ai/runtime/internal/declaration-snapshot.d.ts +8 -0
- package/types/app/ai/runtime/internal/load-llm-config.d.ts +26 -0
- package/types/app/ai/runtime/internal/load-runtime-config.d.ts +13 -0
- package/types/app/ai/runtime/internal/owned-runtime-resources.d.ts +5 -0
- package/types/app/ai/runtime/internal/request-budget.d.ts +44 -0
- package/types/app/ai/runtime/internal/run-event-queue.d.ts +11 -0
- package/types/app/ai/runtime/langchain/langchain-planner.service.d.ts +49 -0
- package/types/app/ai/runtime/langchain/skill-tool.adapter.d.ts +9 -0
- package/types/app/ai/runtime/langgraph/agent.graph.d.ts +130 -0
- package/types/app/ai/runtime/langgraph/agent.state.d.ts +43 -0
- package/types/app/ai/runtime/langgraph/langgraph-orchestrator.service.d.ts +104 -0
- package/types/app/ai/runtime/runtime.module.d.ts +7 -0
- package/types/app/ai/runtime/thread-execution-coordinator.d.ts +21 -0
- package/types/app/ai/skill/skill-scanner.service.d.ts +16 -0
- package/types/app/ai/skill/skill.interface.d.ts +9 -0
- package/types/app/ai/skill/skill.module.d.ts +2 -0
- package/types/app/ai/snapshot-data.d.ts +1 -0
- package/types/app/ai/store/internal/archive-id.d.ts +1 -0
- package/types/app/ai/store/internal/create-vector-store.d.ts +4 -0
- package/types/app/ai/store/internal/load-store-config.d.ts +22 -0
- package/types/app/ai/store/internal/load-thread-state-store.d.ts +4 -0
- package/types/app/ai/store/reference/file-memory.store.d.ts +33 -0
- package/types/app/ai/store/reference/file-trace.store.d.ts +14 -0
- package/types/app/ai/store/reference/file-vector.store.d.ts +12 -0
- package/types/app/ai/store/reference/qdrant-vector.store.d.ts +9 -0
- package/types/app/ai/store/store.interface.d.ts +141 -0
- package/types/app/ai/store/store.module.d.ts +2 -0
- package/types/app/ai/tool/builtin/index.d.ts +6 -0
- package/types/app/ai/tool/builtin/invoke-agent.tool.d.ts +11 -0
- package/types/app/ai/tool/builtin/retrieve.tool.d.ts +8 -0
- package/types/app/ai/tool/executor.service.d.ts +14 -0
- package/types/app/ai/tool/tool-registry.service.d.ts +13 -0
- package/types/app/ai/tool/tool.interface.d.ts +33 -0
- package/types/app/ai/tool/tool.module.d.ts +9 -0
- package/types/app/ai/trace/trace.service.d.ts +32 -0
- package/types/app/csr/controller.d.ts +3 -0
- package/types/app/csr/types.d.ts +10 -0
- package/types/app/extends/$fetch.d.ts +1 -3
- package/types/app/extends/crypto.d.ts +3 -5
- package/types/app/extends/db.d.ts +5 -3
- package/types/app/extends/logger.d.ts +16 -10
- package/types/app/frontend-development.d.ts +14 -0
- package/types/app/html/browser-options.d.ts +3 -0
- package/types/app/html/shell.d.ts +37 -10
- package/types/app/http/api-signing.d.ts +16 -0
- package/types/app/http/body-parser.middleware.d.ts +13 -0
- package/types/app/http/compression.middleware.d.ts +7 -0
- package/types/app/http/context.d.ts +11 -0
- package/types/app/http/controller.d.ts +7 -0
- package/types/app/http/csp-nonce.d.ts +3 -0
- package/types/app/http/error-response.d.ts +4 -0
- package/types/app/http/errors.d.ts +25 -0
- package/types/app/http/exception-filter.d.ts +11 -0
- package/types/app/http/request-body-parser-policy.d.ts +8 -0
- package/types/app/http/request-data.d.ts +9 -0
- package/types/app/http/request-schema.pipe.d.ts +18 -0
- package/types/app/http/response.d.ts +10 -0
- package/types/app/http/response.interceptor.d.ts +5 -0
- package/types/app/http/security.guard.d.ts +14 -0
- package/types/app/project/controller.d.ts +3 -0
- package/types/app/project/service.d.ts +19 -0
- package/types/app/providers/csr.d.ts +21 -0
- package/types/app/providers/foundation.d.ts +8 -0
- package/types/app/ssr/artifacts.d.ts +28 -0
- package/types/app/ssr/controller.d.ts +3 -0
- package/types/app/ssr/html.d.ts +37 -10
- package/types/app/ssr/session.d.ts +44 -0
- package/types/app/ssr/stream.d.ts +5 -0
- package/types/app/ssr/streaming-request-cache.d.ts +10 -0
- package/types/app/ssr/types.d.ts +70 -0
- package/types/app/static-assets.middleware.d.ts +10 -0
- package/types/app/template-core.module.d.ts +12 -0
- package/types/app/utils/i18n.d.ts +7 -4
- package/types/bundler/buildFE.d.ts +4 -1
- package/types/bundler/buildSSR.d.ts +3 -2
- package/types/bundler/dev-session.d.ts +23 -0
- package/types/bundler/dev.d.ts +4 -1
- package/types/bundler/feSharedConfig.d.ts +3 -1
- package/types/bundler/index.d.ts +4 -0
- package/types/bundler/prod.d.ts +2 -1
- package/types/bundler/state.d.ts +16 -5
- package/types/bundler/utils.d.ts +18 -18
- package/types/config/config.default.d.ts +19 -3
- package/types/index.d.ts +48 -29
- package/types/packages/common/ssr/hydration.d.ts +13 -0
- package/types/packages/core/bootstrap.d.ts +5 -0
- package/types/packages/core/config-service.d.ts +13 -0
- package/types/packages/core/duplicate-route-checking-adapter.d.ts +23 -0
- package/types/packages/core/index.d.ts +8 -6
- package/types/packages/core/legacy-factory-diagnostics.d.ts +2 -0
- package/types/packages/core/loader/model.d.ts +14 -10
- package/types/packages/core/paths.d.ts +0 -14
- package/types/packages/core/resource-lifecycle.d.ts +7 -0
- package/types/packages/core/startup.d.ts +111 -0
- package/types/packages/core/tokens.d.ts +8 -0
- package/types/scripts/vite-build/types.d.ts +3 -0
- package/types/ssrSharedData/outputPaths.d.ts +2 -2
- package/.skills/tc-generator/reference/project-template/app/controller/product.js +0 -73
- package/.skills/tc-generator/reference/project-template/app/router/product.js +0 -9
- package/cjs/app/controller/base.js +0 -1
- package/cjs/app/controller/project.js +0 -1
- package/cjs/app/controller/ssr.js +0 -1
- package/cjs/app/controller/view.js +0 -1
- package/cjs/app/extends/generateErrorMessage.js +0 -1
- package/cjs/app/extends/localCacheHtmlEtag.js +0 -1
- package/cjs/app/extends/parsingParamsOnUrl.js +0 -1
- package/cjs/app/extends/render-view.js +0 -1
- package/cjs/app/middleware.js +0 -1
- package/cjs/app/middlewares/api-params-verify.js +0 -1
- package/cjs/app/middlewares/api-sign-verify.js +0 -1
- package/cjs/app/middlewares/error-handle.js +0 -1
- package/cjs/app/middlewares/project-handler.js +0 -1
- package/cjs/app/middlewares/request-parameter-parsing.js +0 -1
- package/cjs/app/router/project.js +0 -1
- package/cjs/app/router/ssr.js +0 -1
- package/cjs/app/router/view.js +0 -1
- package/cjs/app/router-schema/project.js +0 -1
- package/cjs/app/service/base.js +0 -1
- package/cjs/app/service/project.js +0 -1
- package/cjs/packages/core/env.js +0 -1
- package/cjs/packages/core/loader/config.js +0 -1
- package/cjs/packages/core/loader/controller.js +0 -1
- package/cjs/packages/core/loader/extend.js +0 -1
- package/cjs/packages/core/loader/merge.js +0 -1
- package/cjs/packages/core/loader/middleware.js +0 -1
- package/cjs/packages/core/loader/router-schema.js +0 -1
- package/cjs/packages/core/loader/router.js +0 -1
- package/cjs/packages/core/loader/service.js +0 -1
- package/esm/_virtual/_rolldown/runtime.js +0 -7
- package/esm/app/controller/base.js +0 -26
- package/esm/app/controller/project.js +0 -58
- package/esm/app/controller/ssr.js +0 -215
- package/esm/app/controller/view.js +0 -43
- package/esm/app/extends/generateErrorMessage.js +0 -7
- package/esm/app/extends/localCacheHtmlEtag.js +0 -41
- package/esm/app/extends/parsingParamsOnUrl.js +0 -14
- package/esm/app/extends/render-view.js +0 -18
- package/esm/app/middleware.js +0 -31
- package/esm/app/middlewares/api-params-verify.js +0 -56
- package/esm/app/middlewares/api-sign-verify.js +0 -16
- package/esm/app/middlewares/error-handle.js +0 -25
- package/esm/app/middlewares/project-handler.js +0 -16
- package/esm/app/middlewares/request-parameter-parsing.js +0 -18
- package/esm/app/router/project.js +0 -7
- package/esm/app/router/ssr.js +0 -8
- package/esm/app/router/view.js +0 -8
- package/esm/app/router-schema/project.js +0 -15
- package/esm/app/service/base.js +0 -14
- package/esm/app/service/project.js +0 -23
- package/esm/packages/core/env.js +0 -24
- package/esm/packages/core/loader/config.js +0 -29
- package/esm/packages/core/loader/controller.js +0 -15
- package/esm/packages/core/loader/extend.js +0 -32
- package/esm/packages/core/loader/merge.js +0 -7
- package/esm/packages/core/loader/middleware.js +0 -15
- package/esm/packages/core/loader/router-schema.js +0 -26
- package/esm/packages/core/loader/router.js +0 -45
- package/esm/packages/core/loader/service.js +0 -15
- package/fe/_virtual/_rolldown/runtime.js +0 -13
- package/fe/packages/react/hooks/index.d.ts +0 -11
- package/fe/packages/react/hooks/index.js +0 -10
- package/fe/packages/react/hooks/useBreadcrumb.d.ts +0 -9
- package/fe/packages/react/hooks/useBreadcrumb.js +0 -5
- package/fe/packages/react/hooks/useExecuteOnce.js +0 -47
- package/fe/packages/react/hooks/useHydrationData.d.ts +0 -2
- package/fe/packages/react/hooks/useHydrationData.js +0 -23
- package/fe/packages/react/hooks/useInit.js +0 -11
- package/fe/packages/react/hooks/useLanguage.d.ts +0 -1
- package/fe/packages/react/hooks/useLanguage.js +0 -8
- package/fe/packages/react/hooks/usePagination.js +0 -30
- package/fe/packages/react/hooks/useRefState.js +0 -45
- package/fe/packages/react/hooks/useSSR.js +0 -46
- package/fe/packages/react/hooks/useWatch.js +0 -60
- package/fe/packages/react/ui/components/Button/Button.js +0 -88
- package/fe/packages/react/ui/components/Button/SubmitButton.d.ts +0 -8
- package/fe/packages/react/ui/components/Button/SubmitButton.js +0 -30
- package/fe/packages/react/ui/components/Card/Card.js +0 -31
- package/fe/packages/react/ui/components/Checkbox/Checkbox.js +0 -52
- package/fe/packages/react/ui/components/ConfirmDialog/ConfirmDialog.js +0 -41
- package/fe/packages/react/ui/components/DataTable/ActionBtn.d.ts +0 -7
- package/fe/packages/react/ui/components/DataTable/ActionBtn.js +0 -116
- package/fe/packages/react/ui/components/DataTable/dataTableWidth.js +0 -33
- package/fe/packages/react/ui/components/Date/Calendar.js +0 -351
- package/fe/packages/react/ui/components/Date/Date.js +0 -210
- package/fe/packages/react/ui/components/Date/DateTestPage.d.ts +0 -1
- package/fe/packages/react/ui/components/Date/DateTestPage.js +0 -24
- package/fe/packages/react/ui/components/Date/LocaleContext.js +0 -36
- package/fe/packages/react/ui/components/Date/LocaleProvider.js +0 -22
- package/fe/packages/react/ui/components/Date/TimePicker.js +0 -136
- package/fe/packages/react/ui/components/Date/data.js +0 -7
- package/fe/packages/react/ui/components/Date/dateLocaleStore.js +0 -14
- package/fe/packages/react/ui/components/Date/dropdownPositioning.d.ts +0 -2
- package/fe/packages/react/ui/components/Date/dropdownPositioning.js +0 -12
- package/fe/packages/react/ui/components/Date/locales.d.ts +0 -30
- package/fe/packages/react/ui/components/Date/locales.js +0 -56
- package/fe/packages/react/ui/components/Drawer/Drawer.d.ts +0 -22
- package/fe/packages/react/ui/components/Drawer/Drawer.js +0 -151
- package/fe/packages/react/ui/components/Dropdown/Dropdown.d.ts +0 -24
- package/fe/packages/react/ui/components/Dropdown/Dropdown.js +0 -105
- package/fe/packages/react/ui/components/Form/Form.js +0 -15
- package/fe/packages/react/ui/components/Form/FormItem.d.ts +0 -19
- package/fe/packages/react/ui/components/Form/FormItem.js +0 -60
- package/fe/packages/react/ui/components/Form/SchemaForm/data.d.ts +0 -40
- package/fe/packages/react/ui/components/Form/SchemaForm/data.js +0 -15
- package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.js +0 -4
- package/fe/packages/react/ui/components/Form/SchemaForm/index.d.ts +0 -60
- package/fe/packages/react/ui/components/Form/SchemaForm/index.js +0 -119
- package/fe/packages/react/ui/components/Input/Input.js +0 -146
- package/fe/packages/react/ui/components/InputNumber/InputNumber.d.ts +0 -25
- package/fe/packages/react/ui/components/InputNumber/InputNumber.js +0 -207
- package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.js +0 -45
- package/fe/packages/react/ui/components/Label/Label.d.ts +0 -21
- package/fe/packages/react/ui/components/Label/Label.js +0 -58
- package/fe/packages/react/ui/components/Layout/Layout.js +0 -33
- package/fe/packages/react/ui/components/Loading/Loading.js +0 -48
- package/fe/packages/react/ui/components/Menu/Menu.js +0 -147
- package/fe/packages/react/ui/components/Menu/MenuContext.js +0 -88
- package/fe/packages/react/ui/components/Menu/MenuItem.js +0 -78
- package/fe/packages/react/ui/components/Menu/SubMenu.js +0 -207
- package/fe/packages/react/ui/components/Menu/utils.js +0 -8
- package/fe/packages/react/ui/components/Message/Message.js +0 -76
- package/fe/packages/react/ui/components/Message/MessageManager.js +0 -104
- package/fe/packages/react/ui/components/Message/data.js +0 -4
- package/fe/packages/react/ui/components/Modal/Modal.d.ts +0 -20
- package/fe/packages/react/ui/components/Modal/Modal.js +0 -59
- package/fe/packages/react/ui/components/Modal/ModalManager.d.ts +0 -46
- package/fe/packages/react/ui/components/Modal/ModalManager.js +0 -106
- package/fe/packages/react/ui/components/Notification/Notification.js +0 -56
- package/fe/packages/react/ui/components/Pagination/Pagination.d.ts +0 -10
- package/fe/packages/react/ui/components/Pagination/Pagination.js +0 -115
- package/fe/packages/react/ui/components/Popup/Popup.d.ts +0 -25
- package/fe/packages/react/ui/components/Popup/Popup.js +0 -91
- package/fe/packages/react/ui/components/Radio/Radio.js +0 -36
- package/fe/packages/react/ui/components/Radio/RadioGroup.js +0 -33
- package/fe/packages/react/ui/components/Search/Search.d.ts +0 -13
- package/fe/packages/react/ui/components/Search/Search.js +0 -24
- package/fe/packages/react/ui/components/Select/Select.d.ts +0 -21
- package/fe/packages/react/ui/components/Select/Select.js +0 -282
- package/fe/packages/react/ui/components/Select/dropdownPositioning.d.ts +0 -2
- package/fe/packages/react/ui/components/Select/dropdownPositioning.js +0 -16
- package/fe/packages/react/ui/components/Skeleton/Skeleton.js +0 -101
- package/fe/packages/react/ui/components/Switch/Switch.js +0 -28
- package/fe/packages/react/ui/components/TableSearch/TableSearch.d.ts +0 -30
- package/fe/packages/react/ui/components/TableSearch/TableSearch.js +0 -166
- package/fe/packages/react/ui/components/TableSearch/lang.d.ts +0 -16
- package/fe/packages/react/ui/components/TableSearch/lang.js +0 -25
- package/fe/packages/react/ui/components/TableSearch/tableSearchLocaleStore.js +0 -10
- package/fe/packages/react/ui/components/Textarea/Textarea.js +0 -58
- package/fe/packages/react/ui/components/Tooltip/Tooltip.js +0 -77
- package/fe/packages/react/ui/components/TreeSelect/TreeSelect.js +0 -190
- package/fe/packages/react/ui/components/Upload/ImageUpload.js +0 -101
- package/fe/packages/react/ui/components/Upload/Upload.js +0 -29
- package/fe/packages/react/ui/components/breadcrumb/breadcrumb.js +0 -155
- package/fe/packages/react/ui/components/hooks/useDropdownPositioning.js +0 -121
- package/fe/packages/react/ui/components/hooks/useInputController.js +0 -39
- package/fe/packages/react/ui/components/table/table.js +0 -166
- package/fe/packages/react/ui/components/testPage/DemoSection.d.ts +0 -10
- package/fe/packages/react/ui/components/testPage/DemoSection.js +0 -73
- package/fe/packages/react/ui/components/testPage/MenuTestPage.js +0 -24
- package/fe/packages/react/ui/components/testPage/demoRegistry.d.ts +0 -4
- package/fe/packages/react/ui/components/testPage/demoRegistry.js +0 -217
- package/fe/packages/react/ui/components/testPage/demos/core/BreadcrumbDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/BreadcrumbDemo.js +0 -44
- package/fe/packages/react/ui/components/testPage/demos/core/BreadcrumbDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ButtonDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ButtonDemo.js +0 -85
- package/fe/packages/react/ui/components/testPage/demos/core/ButtonDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/CardDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/CardDemo.js +0 -52
- package/fe/packages/react/ui/components/testPage/demos/core/CardDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/CheckboxDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/CheckboxDemo.js +0 -41
- package/fe/packages/react/ui/components/testPage/demos/core/CheckboxDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ConfirmDialogDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ConfirmDialogDemo.js +0 -35
- package/fe/packages/react/ui/components/testPage/demos/core/ConfirmDialogDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo.js +0 -273
- package/fe/packages/react/ui/components/testPage/demos/core/DataTableDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/DrawerDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/DrawerDemo.js +0 -105
- package/fe/packages/react/ui/components/testPage/demos/core/DrawerDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/DropdownDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/DropdownDemo.js +0 -48
- package/fe/packages/react/ui/components/testPage/demos/core/DropdownDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/FormDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/FormDemo.js +0 -56
- package/fe/packages/react/ui/components/testPage/demos/core/FormDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ImageUploadDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ImageUploadDemo.js +0 -26
- package/fe/packages/react/ui/components/testPage/demos/core/ImageUploadDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/InputDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/InputDemo.js +0 -55
- package/fe/packages/react/ui/components/testPage/demos/core/InputDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/InputNumberDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/InputNumberDemo.js +0 -65
- package/fe/packages/react/ui/components/testPage/demos/core/InputNumberDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/LabelDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/LabelDemo.js +0 -33
- package/fe/packages/react/ui/components/testPage/demos/core/LabelDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/LayoutDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/LayoutDemo.js +0 -64
- package/fe/packages/react/ui/components/testPage/demos/core/LayoutDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/LoadingDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/LoadingDemo.js +0 -32
- package/fe/packages/react/ui/components/testPage/demos/core/LoadingDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/MessageDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/MessageDemo.js +0 -44
- package/fe/packages/react/ui/components/testPage/demos/core/MessageDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ModalDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ModalDemo.js +0 -61
- package/fe/packages/react/ui/components/testPage/demos/core/ModalDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/NotificationDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/NotificationDemo.js +0 -50
- package/fe/packages/react/ui/components/testPage/demos/core/NotificationDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/PaginationDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/PaginationDemo.js +0 -39
- package/fe/packages/react/ui/components/testPage/demos/core/PaginationDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/PreviewImageDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/PreviewImageDemo.js +0 -22
- package/fe/packages/react/ui/components/testPage/demos/core/PreviewImageDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/RadioDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/RadioDemo.js +0 -129
- package/fe/packages/react/ui/components/testPage/demos/core/RadioDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SchemaFormDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SchemaFormDemo.js +0 -52
- package/fe/packages/react/ui/components/testPage/demos/core/SchemaFormDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SearchDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SearchDemo.js +0 -52
- package/fe/packages/react/ui/components/testPage/demos/core/SearchDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SelectDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SelectDemo.js +0 -73
- package/fe/packages/react/ui/components/testPage/demos/core/SelectDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SkeletonDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SkeletonDemo.js +0 -46
- package/fe/packages/react/ui/components/testPage/demos/core/SkeletonDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/SwitchDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/SwitchDemo.js +0 -36
- package/fe/packages/react/ui/components/testPage/demos/core/SwitchDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TableDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TableDemo.js +0 -64
- package/fe/packages/react/ui/components/testPage/demos/core/TableDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TableSearchDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TableSearchDemo.js +0 -74
- package/fe/packages/react/ui/components/testPage/demos/core/TableSearchDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TabsDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TabsDemo.js +0 -56
- package/fe/packages/react/ui/components/testPage/demos/core/TabsDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TextareaDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TextareaDemo.js +0 -30
- package/fe/packages/react/ui/components/testPage/demos/core/TextareaDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/ThemeSwitcher.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/ThemeSwitcher.js +0 -96
- package/fe/packages/react/ui/components/testPage/demos/core/ThemeSwitcher2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TooltipDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TooltipDemo.js +0 -29
- package/fe/packages/react/ui/components/testPage/demos/core/TooltipDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/core/TreeSelectDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/core/TreeSelectDemo.js +0 -66
- package/fe/packages/react/ui/components/testPage/demos/core/TreeSelectDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateBasicDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateBasicDemo.js +0 -31
- package/fe/packages/react/ui/components/testPage/demos/date/DateBasicDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateControlledDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateControlledDemo.js +0 -67
- package/fe/packages/react/ui/components/testPage/demos/date/DateControlledDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDateDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDateDemo.js +0 -36
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDateDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDemo.js +0 -35
- package/fe/packages/react/ui/components/testPage/demos/date/DateDisabledDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateFormatDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateFormatDemo.js +0 -35
- package/fe/packages/react/ui/components/testPage/demos/date/DateFormatDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateRangeDemo.d.ts +0 -6
- package/fe/packages/react/ui/components/testPage/demos/date/DateRangeDemo.js +0 -76
- package/fe/packages/react/ui/components/testPage/demos/date/DateRangeDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/date/DateTimeDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/date/DateTimeDemo.js +0 -60
- package/fe/packages/react/ui/components/testPage/demos/date/DateTimeDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuAccordionDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuAccordionDemo.js +0 -78
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuAccordionDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuClickTriggerDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuClickTriggerDemo.js +0 -79
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuClickTriggerDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedDemo.js +0 -82
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedNoIconDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedNoIconDemo.js +0 -44
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuCollapsedNoIconDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuJsxDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuJsxDemo.js +0 -64
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuJsxDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuLeftMultipleDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuLeftMultipleDemo.js +0 -81
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuLeftMultipleDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuPopupDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuPopupDemo.js +0 -56
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuPopupDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuStateDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuStateDemo.js +0 -67
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuStateDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuTopDemo.d.ts +0 -7
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuTopDemo.js +0 -55
- package/fe/packages/react/ui/components/testPage/demos/menu/MenuTopDemo2.js +0 -4
- package/fe/packages/react/ui/components/testPage/index.d.ts +0 -2
- package/fe/packages/react/ui/components/testPage/index.js +0 -45
- package/fe/packages/react/ui/components/testPage/types.d.ts +0 -17
- package/fe/packages/react/ui/lib/createStoreHook.js +0 -9
- package/fe/packages/react/ui/lib/export.d.ts +0 -21
- package/fe/packages/react/ui/lib/export.js +0 -112
- package/fe/packages/react/ui/lib/utils.d.ts +0 -9
- package/fe/packages/react/ui/lib/utils.js +0 -64
- package/fe/packages/react/ui/stores/breadcrumb.d.ts +0 -14
- package/fe/packages/react/ui/stores/breadcrumb.js +0 -52
- package/fe/packages/react/ui/stores/language.d.ts +0 -3
- package/fe/packages/react/ui/stores/language.js +0 -4
- package/models/packages/react/hooks/useBreadcrumb.d.ts +0 -9
- package/models/packages/react/hooks/useLanguage.d.ts +0 -1
- package/models/packages/react/ui/components/Button/SubmitButton.d.ts +0 -8
- package/models/packages/react/ui/components/DataTable/ActionBtn.d.ts +0 -7
- package/models/packages/react/ui/components/DataTable/index.d.ts +0 -32
- package/models/packages/react/ui/components/Date/dropdownPositioning.d.ts +0 -2
- package/models/packages/react/ui/components/Date/locales.d.ts +0 -30
- package/models/packages/react/ui/components/Drawer/Drawer.d.ts +0 -22
- package/models/packages/react/ui/components/Dropdown/Dropdown.d.ts +0 -24
- package/models/packages/react/ui/components/Form/FormItem.d.ts +0 -19
- package/models/packages/react/ui/components/Form/SchemaForm/data.d.ts +0 -40
- package/models/packages/react/ui/components/Form/SchemaForm/index.d.ts +0 -60
- package/models/packages/react/ui/components/Form/index.d.ts +0 -4
- package/models/packages/react/ui/components/InputNumber/InputNumber.d.ts +0 -25
- package/models/packages/react/ui/components/Label/Label.d.ts +0 -21
- package/models/packages/react/ui/components/Modal/Modal.d.ts +0 -20
- package/models/packages/react/ui/components/Modal/ModalManager.d.ts +0 -46
- package/models/packages/react/ui/components/Modal/index.d.ts +0 -3
- package/models/packages/react/ui/components/Overlay/Overlay.d.ts +0 -19
- package/models/packages/react/ui/components/Overlay/index.d.ts +0 -2
- package/models/packages/react/ui/components/Pagination/Pagination.d.ts +0 -10
- package/models/packages/react/ui/components/Popup/Popup.d.ts +0 -25
- package/models/packages/react/ui/components/Search/Search.d.ts +0 -13
- package/models/packages/react/ui/components/Select/Select.d.ts +0 -21
- package/models/packages/react/ui/components/Select/dropdownPositioning.d.ts +0 -2
- package/models/packages/react/ui/components/TableSearch/TableSearch.d.ts +0 -30
- package/models/packages/react/ui/components/TableSearch/lang.d.ts +0 -16
- package/models/packages/react/ui/i18n/I18nProvider.d.ts +0 -12
- package/models/packages/react/ui/i18n/index.d.ts +0 -3
- package/models/packages/react/ui/index.d.ts +0 -4
- package/models/packages/react/ui/lib/export.d.ts +0 -21
- package/models/packages/react/ui/lib/utils.d.ts +0 -9
- package/models/packages/react/ui/stores/breadcrumb.d.ts +0 -14
- package/models/packages/react/ui/stores/language.d.ts +0 -3
- package/types/app/controller/base.d.ts +0 -12
- package/types/app/controller/project.d.ts +0 -22
- package/types/app/controller/ssr.d.ts +0 -14
- package/types/app/controller/view.d.ts +0 -8
- package/types/app/extends/generateErrorMessage.d.ts +0 -7
- package/types/app/extends/localCacheHtmlEtag.d.ts +0 -10
- package/types/app/extends/parsingParamsOnUrl.d.ts +0 -2
- package/types/app/extends/render-view.d.ts +0 -7
- package/types/app/middleware.d.ts +0 -3
- package/types/app/middlewares/api-params-verify.d.ts +0 -4
- package/types/app/middlewares/api-sign-verify.d.ts +0 -4
- package/types/app/middlewares/error-handle.d.ts +0 -4
- package/types/app/middlewares/project-handler.d.ts +0 -4
- package/types/app/middlewares/request-parameter-parsing.d.ts +0 -7
- package/types/app/router/project.d.ts +0 -4
- package/types/app/router/ssr.d.ts +0 -6
- package/types/app/router/view.d.ts +0 -3
- package/types/app/router-schema/project.d.ts +0 -3
- package/types/app/service/base.d.ts +0 -9
- package/types/app/service/project.d.ts +0 -57
- package/types/app/type.d.ts +0 -35
- package/types/app/typings.d.ts +0 -50
- package/types/packages/core/env.d.ts +0 -15
- package/types/packages/core/loader/config.d.ts +0 -9
- package/types/packages/core/loader/controller.d.ts +0 -17
- package/types/packages/core/loader/extend.d.ts +0 -8
- package/types/packages/core/loader/merge.d.ts +0 -3
- package/types/packages/core/loader/middleware.d.ts +0 -11
- package/types/packages/core/loader/router-schema.d.ts +0 -18
- package/types/packages/core/loader/router.d.ts +0 -8
- package/types/packages/core/loader/service.d.ts +0 -17
- package/types/packages/core/types.d.ts +0 -158
- /package/cjs/app/{type.js → ai/agent/agent-run.dto.js} +0 -0
- /package/cjs/app/{typings.js → ai/agent/agent.interface.js} +0 -0
- /package/{fe/packages/react/ui/types → cjs/app/ai/contracts}/index.js +0 -0
- /package/cjs/{packages/core/types.js → app/ai/guardrail/guardrail.interface.js} +0 -0
- /package/{esm/app/type.js → cjs/app/ai/skill/skill.interface.js} +0 -0
- /package/{esm/app/typings.js → cjs/app/ai/tool/tool.interface.js} +0 -0
- /package/{esm/packages/core → cjs/app/csr}/types.js +0 -0
- /package/{fe/packages/react/ui/components/testPage → cjs/app/ssr}/types.js +0 -0
- /package/{fe/packages/react/ui/components/Menu/menuTypes.js → esm/app/ai/agent/agent-run.dto.js} +0 -0
- /package/fe/packages/react/{ui/assets → assets}/table/no-result.svg +0 -0
- /package/fe/packages/react/{ui/components → core}/Button/Button.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Button/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Card/Card.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Card/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Checkbox/Checkbox.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Checkbox/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Label/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Layout/Layout.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Layout/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Loading/Loading.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Loading/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/Skeleton/Skeleton.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/Skeleton/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/breadcrumb/breadcrumb.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/breadcrumb/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/hooks/useDropdownPositioning.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useExecuteOnce.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useInit.d.ts +0 -0
- /package/fe/packages/react/{ui/components → core}/hooks/useInputController.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/usePagination.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useRefState.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useSSR.d.ts +0 -0
- /package/fe/packages/react/{hooks → core/hooks}/useWatch.d.ts +0 -0
- /package/fe/packages/react/{ui → core}/lib/createStoreHook.d.ts +0 -0
- /package/fe/packages/react/{ui/components/DataTable → core/lib}/dataTableWidth.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/core}/types/baseType.d.ts +0 -0
- /package/fe/packages/react/{ui → core}/types/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/testPage → dev/preview}/MenuTestPage.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/Calendar.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/Date.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/LocaleContext.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/LocaleProvider.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/TimePicker.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/data.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Date/dateLocaleStore.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Date/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/Form.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/SchemaForm/defaultComponentsMap.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/useForm.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Form/useForm.js +0 -0
- /package/fe/packages/react/{ui/components → forms}/Input/Input.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Input/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/InputNumber/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/InputNumber/inputNumberUtils.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Pagination/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Radio/Radio.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Radio/RadioGroup.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Radio/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Search/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Select/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Switch/Switch.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Switch/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/TableSearch/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/TableSearch/tableSearchLocaleStore.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Textarea/Textarea.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Textarea/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/TreeSelect/TreeSelect.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/TreeSelect/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Upload/ImageUpload.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/Upload/Upload.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/Upload/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/forms}/table/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → forms}/table/table.d.ts +0 -0
- /package/fe/packages/react/{ui/components/ConfirmDialog → overlays/Dialog}/ConfirmDialog.d.ts +0 -0
- /package/{models/packages/react/ui/components/ConfirmDialog → fe/packages/react/overlays/Dialog}/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Drawer/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Dropdown/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/Menu.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuContext.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuItem.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/SubMenu.d.ts +0 -0
- /package/{models/packages/react/ui/components/Menu → fe/packages/react/overlays/DropdownMenu}/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/menuTypes.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Menu → overlays/DropdownMenu}/utils.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Message/Message.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Message/MessageManager.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Message/data.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Message/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components/Notification → overlays/Popover}/Notification.d.ts +0 -0
- /package/{models/packages/react/ui/components/Notification → fe/packages/react/overlays/Popover}/index.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Popup/index.d.ts +0 -0
- /package/fe/packages/react/{ui/components → overlays}/Tooltip/Tooltip.d.ts +0 -0
- /package/{models/packages/react/ui/components → fe/packages/react/overlays}/Tooltip/index.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Button/Button.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Card/Card.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Checkbox/Checkbox.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Layout/Layout.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Loading/Loading.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/Skeleton/Skeleton.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/breadcrumb/breadcrumb.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/hooks/useDropdownPositioning.d.ts +0 -0
- /package/models/packages/react/{hooks → core/hooks}/useExecuteOnce.d.ts +0 -0
- /package/models/packages/react/{ui/components → core}/hooks/useInputController.d.ts +0 -0
- /package/models/packages/react/{ui → core}/lib/createStoreHook.d.ts +0 -0
- /package/models/packages/react/{ui/components/DataTable → core/lib}/dataTableWidth.d.ts +0 -0
- /package/models/packages/react/{ui → core}/types/index.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/Calendar.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/Date.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/LocaleContext.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/LocaleProvider.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/TimePicker.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/data.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Date/dateLocaleStore.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Form/Form.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Form/useForm.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Input/Input.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/InputNumber/inputNumberUtils.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Radio/Radio.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Radio/RadioGroup.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Switch/Switch.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/TableSearch/tableSearchLocaleStore.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Textarea/Textarea.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/TreeSelect/TreeSelect.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Upload/ImageUpload.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/Upload/Upload.d.ts +0 -0
- /package/models/packages/react/{ui/components → forms}/table/table.d.ts +0 -0
- /package/models/packages/react/{ui/components/ConfirmDialog → overlays/Dialog}/ConfirmDialog.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/Menu.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuContext.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/MenuItem.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/SubMenu.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/menuTypes.d.ts +0 -0
- /package/models/packages/react/{ui/components/Menu → overlays/DropdownMenu}/utils.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Message/Message.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Message/MessageManager.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Message/data.d.ts +0 -0
- /package/models/packages/react/{ui/components/Notification → overlays/Popover}/Notification.d.ts +0 -0
- /package/models/packages/react/{ui/components → overlays}/Tooltip/Tooltip.d.ts +0 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { cn } from "../../core/lib/utils.js";
|
|
2
|
+
import { useInputController } from "../../core/hooks/useInputController.js";
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Eye, EyeOff, X } from "lucide-react";
|
|
6
|
+
//#region packages/react/forms/Input/Input.tsx
|
|
7
|
+
var Input = forwardRef(({ className, inputClassName, type, value: controlledValue, onChange, defaultValue, allowClear, disabled, addonAfter, ...props }, ref) => {
|
|
8
|
+
const isFileInput = type === "file";
|
|
9
|
+
const isPasswordInput = type === "password";
|
|
10
|
+
const { setInternalValue, setIsFocused, setRefs, controllerRef, isControlledRef, isFocused, value, hasValue } = useInputController({
|
|
11
|
+
defaultValue,
|
|
12
|
+
controlledValue,
|
|
13
|
+
ref
|
|
14
|
+
});
|
|
15
|
+
const [innerType, setInnerType] = useState(type);
|
|
16
|
+
const isMountedRef = useRef(false);
|
|
17
|
+
const currentType = isPasswordInput ? innerType ?? "password" : type;
|
|
18
|
+
const isPasswordVisible = currentType === "text";
|
|
19
|
+
const removePasswordValueAttribute = useCallback(() => {
|
|
20
|
+
if (!isPasswordInput) return;
|
|
21
|
+
Promise.resolve().then(() => {
|
|
22
|
+
if (!isMountedRef.current) return;
|
|
23
|
+
const input = controllerRef.current;
|
|
24
|
+
if (input?.getAttribute("type") === "password" && input.hasAttribute("value")) {
|
|
25
|
+
const currentValue = input.value;
|
|
26
|
+
input.removeAttribute("value");
|
|
27
|
+
input.value = currentValue;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}, [controllerRef, isPasswordInput]);
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
isMountedRef.current = true;
|
|
33
|
+
return () => {
|
|
34
|
+
isMountedRef.current = false;
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
setInnerType(type);
|
|
39
|
+
}, [type]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
removePasswordValueAttribute();
|
|
42
|
+
}, [
|
|
43
|
+
currentType,
|
|
44
|
+
removePasswordValueAttribute,
|
|
45
|
+
value
|
|
46
|
+
]);
|
|
47
|
+
const handleChange = useCallback((e) => {
|
|
48
|
+
const newValue = e.target.value;
|
|
49
|
+
removePasswordValueAttribute();
|
|
50
|
+
if (!isFileInput && !isControlledRef.current) setInternalValue(newValue);
|
|
51
|
+
onChange?.(newValue, e);
|
|
52
|
+
}, [
|
|
53
|
+
isFileInput,
|
|
54
|
+
isControlledRef,
|
|
55
|
+
onChange,
|
|
56
|
+
removePasswordValueAttribute,
|
|
57
|
+
setInternalValue
|
|
58
|
+
]);
|
|
59
|
+
const handleClear = useCallback((e) => {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
e.stopPropagation();
|
|
62
|
+
if (!isControlledRef.current) setInternalValue("");
|
|
63
|
+
onChange?.("", {
|
|
64
|
+
target: { value: "" },
|
|
65
|
+
currentTarget: { value: "" }
|
|
66
|
+
});
|
|
67
|
+
controllerRef.current?.focus();
|
|
68
|
+
}, [
|
|
69
|
+
controllerRef,
|
|
70
|
+
isControlledRef,
|
|
71
|
+
onChange,
|
|
72
|
+
setInternalValue
|
|
73
|
+
]);
|
|
74
|
+
const handleTogglePassword = useCallback((e) => {
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
if (isPasswordVisible) removePasswordValueAttribute();
|
|
78
|
+
setInnerType((current) => current === "password" ? "text" : "password");
|
|
79
|
+
}, [isPasswordVisible, removePasswordValueAttribute]);
|
|
80
|
+
const clearIcon = useMemo(() => {
|
|
81
|
+
if (allowClear) if (typeof allowClear === "boolean") return /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: cn("w-5 h-5 rounded-full", "bg-muted hover:bg-muted/80", "text-foreground", "transition-colors", "flex items-center justify-center", "focus:outline-none"),
|
|
83
|
+
children: /* @__PURE__ */ jsx(X, { size: 12 })
|
|
84
|
+
});
|
|
85
|
+
else return allowClear.clearIcon;
|
|
86
|
+
}, [allowClear]);
|
|
87
|
+
const showClearIcon = !isPasswordInput && hasValue && clearIcon && !disabled;
|
|
88
|
+
const showPasswordToggle = isPasswordInput && !disabled;
|
|
89
|
+
const rightAccessoryCount = Number(Boolean(showClearIcon)) + Number(showPasswordToggle) + Number(Boolean(addonAfter));
|
|
90
|
+
const hasRightAccessories = rightAccessoryCount > 0;
|
|
91
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
92
|
+
className: cn("tc-ui-input relative w-full", className),
|
|
93
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
94
|
+
type: currentType,
|
|
95
|
+
ref: setRefs,
|
|
96
|
+
...!isFileInput && { value },
|
|
97
|
+
onChange: handleChange,
|
|
98
|
+
className: cn("flex h-10 w-full rounded-lg px-3 py-0 text-sm", "border transition-colors duration-200", "placeholder:text-muted-foreground", "focus:outline-none", rightAccessoryCount === 1 && "pr-10", rightAccessoryCount === 2 && "pr-20", rightAccessoryCount >= 3 && "pr-28", disabled ? "cursor-not-allowed bg-muted border-border text-muted-foreground" : "bg-background", !disabled && !isFocused && "border-border", !disabled && isFocused && "border-theme ring-2 ring-theme/25", inputClassName),
|
|
99
|
+
onFocus: (e) => {
|
|
100
|
+
if (!disabled) {
|
|
101
|
+
removePasswordValueAttribute();
|
|
102
|
+
setIsFocused(true);
|
|
103
|
+
props.onFocus?.(e);
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
onBlur: (e) => {
|
|
107
|
+
if (!disabled) {
|
|
108
|
+
removePasswordValueAttribute();
|
|
109
|
+
setIsFocused(false);
|
|
110
|
+
props.onBlur?.(e);
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
disabled,
|
|
114
|
+
...props
|
|
115
|
+
}), hasRightAccessories && /* @__PURE__ */ jsxs("div", {
|
|
116
|
+
className: "absolute right-1.5 top-1/2 flex -translate-y-1/2 items-center gap-1",
|
|
117
|
+
children: [
|
|
118
|
+
showClearIcon && /* @__PURE__ */ jsx("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
121
|
+
onClick: handleClear,
|
|
122
|
+
"aria-label": "Clear input",
|
|
123
|
+
title: "Clear input",
|
|
124
|
+
className: "flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-foreground/8",
|
|
125
|
+
children: clearIcon
|
|
126
|
+
}),
|
|
127
|
+
showPasswordToggle && /* @__PURE__ */ jsx("button", {
|
|
128
|
+
type: "button",
|
|
129
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
130
|
+
onClick: handleTogglePassword,
|
|
131
|
+
"aria-label": isPasswordVisible ? "Hide password" : "Show password",
|
|
132
|
+
title: isPasswordVisible ? "Hide password" : "Show password",
|
|
133
|
+
className: "flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-foreground/8 hover:text-foreground",
|
|
134
|
+
children: isPasswordVisible ? /* @__PURE__ */ jsx(EyeOff, { size: 16 }) : /* @__PURE__ */ jsx(Eye, { size: 16 })
|
|
135
|
+
}),
|
|
136
|
+
addonAfter && /* @__PURE__ */ jsx("div", {
|
|
137
|
+
className: "flex h-7 items-center text-muted-foreground",
|
|
138
|
+
children: addonAfter
|
|
139
|
+
})
|
|
140
|
+
]
|
|
141
|
+
})]
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
Input.displayName = "Input";
|
|
145
|
+
//#endregion
|
|
146
|
+
export { Input };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ChangeEvent, InputHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
import { type InputNumberConstraints } from "./inputNumberUtils";
|
|
3
|
+
export type InputNumberProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'defaultValue' | 'onChange' | 'step' | 'type' | 'value'> & InputNumberConstraints & {
|
|
4
|
+
value?: number;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
onChange?: (value: number | undefined, e: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
allowClear?: boolean | {
|
|
8
|
+
clearIcon: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
addonAfter?: ReactNode;
|
|
11
|
+
allowStep?: boolean;
|
|
12
|
+
inputClassName?: string;
|
|
13
|
+
};
|
|
14
|
+
declare const InputNumber: import("react").ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "step"> & InputNumberConstraints & {
|
|
15
|
+
value?: number;
|
|
16
|
+
defaultValue?: number;
|
|
17
|
+
onChange?: (value: number | undefined, e: ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
+
allowClear?: boolean | {
|
|
19
|
+
clearIcon: ReactNode;
|
|
20
|
+
};
|
|
21
|
+
addonAfter?: ReactNode;
|
|
22
|
+
allowStep?: boolean;
|
|
23
|
+
inputClassName?: string;
|
|
24
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
25
|
+
export { InputNumber };
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { cn } from "../../core/lib/utils.js";
|
|
2
|
+
import { formatNumber, isValidNumberInput, normalizeNumber, parseInputNumber, shouldSyncDisplayValue, stepValue } from "./inputNumberUtils.js";
|
|
3
|
+
import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { ChevronDown, ChevronUp, X } from "lucide-react";
|
|
6
|
+
//#region packages/react/forms/InputNumber/InputNumber.tsx
|
|
7
|
+
var formatDisplayValue = (value, constraints) => typeof value === "number" ? formatNumber(value, constraints) : "";
|
|
8
|
+
var getBlurValue = (rawValue) => {
|
|
9
|
+
if (rawValue === "" || rawValue === "-" || rawValue === "." || rawValue === "-.") return;
|
|
10
|
+
const normalizedRawValue = rawValue.endsWith(".") ? rawValue.slice(0, -1) : rawValue;
|
|
11
|
+
const parsedValue = Number(normalizedRawValue);
|
|
12
|
+
return Number.isFinite(parsedValue) ? parsedValue : void 0;
|
|
13
|
+
};
|
|
14
|
+
var InputNumber = forwardRef(({ className, inputClassName, value: controlledValue, onChange, defaultValue, allowClear, addonAfter, allowStep = false, disabled, min, max, precision, step, inputMode = "decimal", ...props }, ref) => {
|
|
15
|
+
const constraints = useMemo(() => ({
|
|
16
|
+
min,
|
|
17
|
+
max,
|
|
18
|
+
precision,
|
|
19
|
+
step
|
|
20
|
+
}), [
|
|
21
|
+
max,
|
|
22
|
+
min,
|
|
23
|
+
precision,
|
|
24
|
+
step
|
|
25
|
+
]);
|
|
26
|
+
const isControlled = controlledValue !== void 0;
|
|
27
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
28
|
+
const currentValue = isControlled ? controlledValue : internalValue;
|
|
29
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
30
|
+
const [displayValue, setDisplayValue] = useState(() => formatDisplayValue(currentValue, constraints));
|
|
31
|
+
const inputRef = useRef(null);
|
|
32
|
+
const setRefs = useCallback((node) => {
|
|
33
|
+
inputRef.current = node;
|
|
34
|
+
if (typeof ref === "function") ref(node);
|
|
35
|
+
else if (ref) ref.current = node;
|
|
36
|
+
}, [ref]);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!shouldSyncDisplayValue({
|
|
39
|
+
isFocused,
|
|
40
|
+
displayValue,
|
|
41
|
+
currentValue
|
|
42
|
+
})) return;
|
|
43
|
+
const nextDisplayValue = formatDisplayValue(currentValue, constraints);
|
|
44
|
+
if (nextDisplayValue !== displayValue) setDisplayValue(nextDisplayValue);
|
|
45
|
+
}, [
|
|
46
|
+
constraints,
|
|
47
|
+
currentValue,
|
|
48
|
+
displayValue,
|
|
49
|
+
isFocused
|
|
50
|
+
]);
|
|
51
|
+
const emitChange = useCallback((nextValue, e, forceNotify = false) => {
|
|
52
|
+
if (!isControlled) setInternalValue(nextValue);
|
|
53
|
+
if (forceNotify || !Object.is(currentValue, nextValue)) onChange?.(nextValue, e);
|
|
54
|
+
}, [
|
|
55
|
+
currentValue,
|
|
56
|
+
isControlled,
|
|
57
|
+
onChange
|
|
58
|
+
]);
|
|
59
|
+
const createSyntheticChangeEvent = useCallback((value) => {
|
|
60
|
+
const target = inputRef.current;
|
|
61
|
+
if (target) target.value = value;
|
|
62
|
+
return {
|
|
63
|
+
target: { value },
|
|
64
|
+
currentTarget: { value }
|
|
65
|
+
};
|
|
66
|
+
}, []);
|
|
67
|
+
const handleChange = useCallback((e) => {
|
|
68
|
+
const nextDisplayValue = e.target.value;
|
|
69
|
+
if (!isValidNumberInput(nextDisplayValue)) return;
|
|
70
|
+
setDisplayValue(nextDisplayValue);
|
|
71
|
+
const parsedValue = parseInputNumber(nextDisplayValue);
|
|
72
|
+
if (parsedValue.kind === "empty") {
|
|
73
|
+
emitChange(void 0, e);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (parsedValue.kind === "number") emitChange(parsedValue.value, e);
|
|
77
|
+
}, [emitChange]);
|
|
78
|
+
const handleBlur = useCallback((e) => {
|
|
79
|
+
setIsFocused(false);
|
|
80
|
+
const nextValue = getBlurValue(displayValue);
|
|
81
|
+
if (nextValue === void 0) {
|
|
82
|
+
const syntheticEvent = createSyntheticChangeEvent("");
|
|
83
|
+
setDisplayValue("");
|
|
84
|
+
emitChange(void 0, syntheticEvent);
|
|
85
|
+
props.onBlur?.(e);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const normalizedValue = normalizeNumber(nextValue, constraints);
|
|
89
|
+
const nextDisplayValue = formatDisplayValue(normalizedValue, constraints);
|
|
90
|
+
const syntheticEvent = createSyntheticChangeEvent(nextDisplayValue);
|
|
91
|
+
setDisplayValue(nextDisplayValue);
|
|
92
|
+
emitChange(normalizedValue, syntheticEvent);
|
|
93
|
+
props.onBlur?.(e);
|
|
94
|
+
}, [
|
|
95
|
+
constraints,
|
|
96
|
+
createSyntheticChangeEvent,
|
|
97
|
+
displayValue,
|
|
98
|
+
emitChange,
|
|
99
|
+
props
|
|
100
|
+
]);
|
|
101
|
+
const handleFocus = useCallback((e) => {
|
|
102
|
+
if (disabled) return;
|
|
103
|
+
setIsFocused(true);
|
|
104
|
+
props.onFocus?.(e);
|
|
105
|
+
}, [disabled, props]);
|
|
106
|
+
const clearIcon = useMemo(() => {
|
|
107
|
+
if (!allowClear) return;
|
|
108
|
+
if (typeof allowClear === "boolean") return /* @__PURE__ */ jsx("span", {
|
|
109
|
+
className: cn("h-6 w-6 rounded-md", "text-muted-foreground", "flex items-center justify-center", "transition-colors hover:bg-foreground/8 hover:text-foreground"),
|
|
110
|
+
children: /* @__PURE__ */ jsx(X, { size: 12 })
|
|
111
|
+
});
|
|
112
|
+
return allowClear.clearIcon;
|
|
113
|
+
}, [allowClear]);
|
|
114
|
+
const showClearIcon = displayValue.length > 0 && clearIcon && !disabled;
|
|
115
|
+
const hasRightAccessories = showClearIcon || addonAfter || allowStep;
|
|
116
|
+
const currentParsedValue = parseInputNumber(displayValue);
|
|
117
|
+
const stepBaseValue = currentParsedValue.kind === "number" ? currentParsedValue.value : currentValue;
|
|
118
|
+
const normalizedCurrentStepValue = typeof stepBaseValue === "number" ? normalizeNumber(stepBaseValue, constraints) : void 0;
|
|
119
|
+
const canStep = useCallback((direction) => {
|
|
120
|
+
if (disabled) return false;
|
|
121
|
+
const nextValue = stepValue(stepBaseValue, direction, constraints);
|
|
122
|
+
return !Object.is(nextValue, normalizedCurrentStepValue);
|
|
123
|
+
}, [
|
|
124
|
+
constraints,
|
|
125
|
+
disabled,
|
|
126
|
+
normalizedCurrentStepValue,
|
|
127
|
+
stepBaseValue
|
|
128
|
+
]);
|
|
129
|
+
const handleStep = useCallback((direction) => {
|
|
130
|
+
const nextValue = stepValue(stepBaseValue, direction, constraints);
|
|
131
|
+
const nextDisplayValue = formatDisplayValue(nextValue, constraints);
|
|
132
|
+
const syntheticEvent = createSyntheticChangeEvent(nextDisplayValue);
|
|
133
|
+
setDisplayValue(nextDisplayValue);
|
|
134
|
+
emitChange(nextValue, syntheticEvent, true);
|
|
135
|
+
inputRef.current?.focus();
|
|
136
|
+
}, [
|
|
137
|
+
constraints,
|
|
138
|
+
createSyntheticChangeEvent,
|
|
139
|
+
emitChange,
|
|
140
|
+
stepBaseValue
|
|
141
|
+
]);
|
|
142
|
+
const handleClear = useCallback((e) => {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
e.stopPropagation();
|
|
145
|
+
const syntheticEvent = createSyntheticChangeEvent("");
|
|
146
|
+
setDisplayValue("");
|
|
147
|
+
emitChange(void 0, syntheticEvent, true);
|
|
148
|
+
inputRef.current?.focus();
|
|
149
|
+
}, [createSyntheticChangeEvent, emitChange]);
|
|
150
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
151
|
+
className: cn("tc-ui-input-number relative w-full", className),
|
|
152
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
153
|
+
ref: setRefs,
|
|
154
|
+
type: "text",
|
|
155
|
+
value: displayValue,
|
|
156
|
+
onChange: handleChange,
|
|
157
|
+
inputMode,
|
|
158
|
+
className: cn("flex h-10 w-full rounded-lg px-3 py-0 text-sm", "border transition-colors duration-200", "placeholder:text-muted-foreground", "focus:outline-none", showClearIcon && !allowStep && !addonAfter && "pr-10", allowStep && !showClearIcon && !addonAfter && "pr-12", allowStep && showClearIcon && !addonAfter && "pr-20", addonAfter && !allowStep && "pr-16", allowStep && addonAfter && "pr-28", disabled ? "cursor-not-allowed bg-muted border-border text-muted-foreground" : "bg-background", !disabled && !isFocused && "border-border", !disabled && isFocused && "border-theme ring-2 ring-theme/25", inputClassName),
|
|
159
|
+
onFocus: handleFocus,
|
|
160
|
+
onBlur: handleBlur,
|
|
161
|
+
disabled,
|
|
162
|
+
...props
|
|
163
|
+
}), hasRightAccessories && /* @__PURE__ */ jsxs("div", {
|
|
164
|
+
className: "absolute right-1.5 top-1/2 flex -translate-y-1/2 items-center gap-1",
|
|
165
|
+
children: [
|
|
166
|
+
showClearIcon && /* @__PURE__ */ jsx("button", {
|
|
167
|
+
type: "button",
|
|
168
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
169
|
+
onClick: handleClear,
|
|
170
|
+
"aria-label": "Clear number",
|
|
171
|
+
title: "Clear number",
|
|
172
|
+
className: "flex h-7 w-7 items-center justify-center rounded-md transition-colors hover:bg-foreground/8",
|
|
173
|
+
children: clearIcon
|
|
174
|
+
}),
|
|
175
|
+
addonAfter && /* @__PURE__ */ jsx("div", {
|
|
176
|
+
className: "flex h-7 items-center text-muted-foreground",
|
|
177
|
+
children: addonAfter
|
|
178
|
+
}),
|
|
179
|
+
allowStep && /* @__PURE__ */ jsxs("div", {
|
|
180
|
+
className: "flex h-8 w-6 flex-col overflow-hidden rounded-md border border-border/60 bg-muted/30 text-muted-foreground",
|
|
181
|
+
children: [/* @__PURE__ */ jsx("button", {
|
|
182
|
+
type: "button",
|
|
183
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
184
|
+
onClick: () => handleStep("up"),
|
|
185
|
+
disabled: !canStep("up"),
|
|
186
|
+
"aria-label": "Increase value",
|
|
187
|
+
title: "Increase value",
|
|
188
|
+
className: cn("flex h-4 w-full items-center justify-center transition-colors", "border-b border-border/50", "disabled:cursor-not-allowed disabled:text-muted-foreground/45", !disabled && canStep("up") && "hover:bg-foreground/8 hover:text-foreground"),
|
|
189
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { size: 12 })
|
|
190
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
191
|
+
type: "button",
|
|
192
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
193
|
+
onClick: () => handleStep("down"),
|
|
194
|
+
disabled: !canStep("down"),
|
|
195
|
+
"aria-label": "Decrease value",
|
|
196
|
+
title: "Decrease value",
|
|
197
|
+
className: cn("flex h-4 w-full items-center justify-center transition-colors", "disabled:cursor-not-allowed disabled:text-muted-foreground/45", !disabled && canStep("down") && "hover:bg-foreground/8 hover:text-foreground"),
|
|
198
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { size: 12 })
|
|
199
|
+
})]
|
|
200
|
+
})
|
|
201
|
+
]
|
|
202
|
+
})]
|
|
203
|
+
});
|
|
204
|
+
});
|
|
205
|
+
InputNumber.displayName = "InputNumber";
|
|
206
|
+
//#endregion
|
|
207
|
+
export { InputNumber };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region packages/react/forms/InputNumber/inputNumberUtils.ts
|
|
2
|
+
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
3
|
+
var isValidNumberInput = (value) => /^-?\d*(\.\d*)?$/.test(value);
|
|
4
|
+
var clampValue = (value, constraints) => {
|
|
5
|
+
let nextValue = value;
|
|
6
|
+
if (isFiniteNumber(constraints.min)) nextValue = Math.max(nextValue, constraints.min);
|
|
7
|
+
if (isFiniteNumber(constraints.max)) nextValue = Math.min(nextValue, constraints.max);
|
|
8
|
+
return nextValue;
|
|
9
|
+
};
|
|
10
|
+
var applyPrecision = (value, precision) => {
|
|
11
|
+
if (typeof precision !== "number" || precision < 0) return value;
|
|
12
|
+
return Number(value.toFixed(precision));
|
|
13
|
+
};
|
|
14
|
+
var normalizeNumber = (value, constraints) => {
|
|
15
|
+
return clampValue(applyPrecision(value, constraints.precision), constraints);
|
|
16
|
+
};
|
|
17
|
+
var formatNumber = (value, constraints) => {
|
|
18
|
+
const normalized = normalizeNumber(value, constraints);
|
|
19
|
+
if (typeof constraints.precision === "number" && constraints.precision >= 0) return normalized.toFixed(constraints.precision);
|
|
20
|
+
return String(normalized);
|
|
21
|
+
};
|
|
22
|
+
var parseInputNumber = (value) => {
|
|
23
|
+
if (value === "") return { kind: "empty" };
|
|
24
|
+
if (value === "-" || value === "." || value === "-." || /^-?\d+\.$/.test(value)) return { kind: "incomplete" };
|
|
25
|
+
if (!isValidNumberInput(value)) return { kind: "invalid" };
|
|
26
|
+
const parsedValue = Number(value);
|
|
27
|
+
if (!Number.isFinite(parsedValue)) return { kind: "invalid" };
|
|
28
|
+
return {
|
|
29
|
+
kind: "number",
|
|
30
|
+
value: parsedValue
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
var shouldSyncDisplayValue = ({ isFocused, displayValue, currentValue }) => {
|
|
34
|
+
if (!isFocused) return true;
|
|
35
|
+
const parsedDisplayValue = parseInputNumber(displayValue);
|
|
36
|
+
if (parsedDisplayValue.kind === "incomplete" || parsedDisplayValue.kind === "invalid") return false;
|
|
37
|
+
if (parsedDisplayValue.kind === "empty") return currentValue !== void 0;
|
|
38
|
+
return !Object.is(parsedDisplayValue.value, currentValue);
|
|
39
|
+
};
|
|
40
|
+
var stepValue = (currentValue, direction, constraints) => {
|
|
41
|
+
const step = constraints.step && constraints.step > 0 ? constraints.step : 1;
|
|
42
|
+
return normalizeNumber((isFiniteNumber(currentValue) ? currentValue : 0) + (direction === "up" ? step : -step), constraints);
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { applyPrecision, clampValue, formatNumber, isValidNumberInput, normalizeNumber, parseInputNumber, shouldSyncDisplayValue, stepValue };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { SelectOption } from "../Select";
|
|
3
|
+
export type MultiSelectOption = SelectOption;
|
|
4
|
+
export interface MultiSelectOptionGroup {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
options: MultiSelectOption[];
|
|
7
|
+
}
|
|
8
|
+
export type MultiSelectOptions = Array<MultiSelectOption | MultiSelectOptionGroup>;
|
|
9
|
+
export interface MultiSelectProps {
|
|
10
|
+
options: MultiSelectOptions;
|
|
11
|
+
value?: Array<string | number>;
|
|
12
|
+
defaultValue?: Array<string | number>;
|
|
13
|
+
onChange?: (value: Array<string | number>) => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
searchable?: boolean;
|
|
18
|
+
onSearch?: (value: string) => void;
|
|
19
|
+
maxTagCount?: number | 'responsive';
|
|
20
|
+
clearable?: boolean;
|
|
21
|
+
getPopupContainer?: 'parent' | (() => HTMLElement);
|
|
22
|
+
id?: string;
|
|
23
|
+
'aria-label'?: string;
|
|
24
|
+
'aria-labelledby'?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function MultiSelect({ options, value: controlledValue, defaultValue, onChange, placeholder, className, disabled, searchable, onSearch, maxTagCount, clearable, getPopupContainer, id, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { useI18n } from "../../i18n/useI18n.js";
|
|
2
|
+
import "../../i18n/index.js";
|
|
3
|
+
import { cn } from "../../core/lib/utils.js";
|
|
4
|
+
import { Input } from "../Input/Input.js";
|
|
5
|
+
import "../Input/index.js";
|
|
6
|
+
import { Popup } from "../../overlays/Popup/Popup.js";
|
|
7
|
+
import "../../overlays/Popup/index.js";
|
|
8
|
+
import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { X } from "lucide-react";
|
|
11
|
+
//#region packages/react/forms/MultiSelect/MultiSelect.tsx
|
|
12
|
+
var isGroup = (option) => "options" in option;
|
|
13
|
+
function MultiSelect({ options, value: controlledValue, defaultValue = [], onChange, placeholder, className, disabled, searchable = true, onSearch, maxTagCount, clearable = true, getPopupContainer, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy }) {
|
|
14
|
+
const t = useI18n();
|
|
15
|
+
const rootRef = useRef(null);
|
|
16
|
+
const anchorRef = useRef(null);
|
|
17
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
18
|
+
const [internalValue, setInternalValue] = useState(defaultValue);
|
|
19
|
+
const [searchTerm, setSearchTerm] = useState("");
|
|
20
|
+
const [responsiveTagCount, setResponsiveTagCount] = useState();
|
|
21
|
+
const tagMeasureRef = useRef(null);
|
|
22
|
+
const listboxId = `${useId()}-listbox`;
|
|
23
|
+
const selectedValues = controlledValue ?? internalValue;
|
|
24
|
+
const selectedValueSet = new Set(selectedValues);
|
|
25
|
+
const flattenedOptions = useMemo(() => options.flatMap((option) => isGroup(option) ? option.options : [option]), [options]);
|
|
26
|
+
const filteredGroups = useMemo(() => {
|
|
27
|
+
if (onSearch || !searchTerm.trim()) return options;
|
|
28
|
+
const term = searchTerm.trim().toLowerCase();
|
|
29
|
+
return options.map((option) => {
|
|
30
|
+
if (isGroup(option)) return {
|
|
31
|
+
...option,
|
|
32
|
+
options: option.options.filter((item) => String(item.searchText ?? item.label ?? "").toLowerCase().includes(term))
|
|
33
|
+
};
|
|
34
|
+
return String(option.searchText ?? option.label ?? "").toLowerCase().includes(term) ? option : null;
|
|
35
|
+
}).filter((option) => option !== null && (isGroup(option) ? option.options.length > 0 : true));
|
|
36
|
+
}, [
|
|
37
|
+
onSearch,
|
|
38
|
+
options,
|
|
39
|
+
searchTerm
|
|
40
|
+
]);
|
|
41
|
+
const selectedOptions = selectedValues.map((value) => flattenedOptions.find((option) => option.value === value)).filter((option) => option !== void 0);
|
|
42
|
+
const measureResponsiveTags = useCallback(() => {
|
|
43
|
+
if (maxTagCount !== "responsive") return;
|
|
44
|
+
const availableWidth = rootRef.current?.getBoundingClientRect().width ?? 0;
|
|
45
|
+
const tagWidths = Array.from(tagMeasureRef.current?.querySelectorAll("[data-multi-select-measure]") ?? []).map((element) => element.getBoundingClientRect().width);
|
|
46
|
+
const clearButtonWidth = clearable && selectedOptions.length > 0 && !disabled ? 28 : 0;
|
|
47
|
+
const gap = 4;
|
|
48
|
+
let usedWidth = clearButtonWidth;
|
|
49
|
+
let visibleCount = 0;
|
|
50
|
+
for (let index = 0; index < tagWidths.length; index += 1) {
|
|
51
|
+
const tagWidth = tagWidths[index] ?? 0;
|
|
52
|
+
const nextWidth = usedWidth + tagWidth + (visibleCount > 0 ? gap : 0);
|
|
53
|
+
if (nextWidth + (tagWidths.length - index - 1 > 0 ? 36 : 0) > availableWidth && visibleCount > 0) break;
|
|
54
|
+
usedWidth = nextWidth;
|
|
55
|
+
visibleCount += 1;
|
|
56
|
+
}
|
|
57
|
+
setResponsiveTagCount(visibleCount);
|
|
58
|
+
}, [
|
|
59
|
+
clearable,
|
|
60
|
+
disabled,
|
|
61
|
+
maxTagCount,
|
|
62
|
+
selectedOptions.length
|
|
63
|
+
]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (maxTagCount !== "responsive" || typeof ResizeObserver === "undefined") return;
|
|
66
|
+
const element = rootRef.current;
|
|
67
|
+
if (!element) return;
|
|
68
|
+
const update = () => measureResponsiveTags();
|
|
69
|
+
update();
|
|
70
|
+
const observer = new ResizeObserver(update);
|
|
71
|
+
observer.observe(element);
|
|
72
|
+
return () => observer.disconnect();
|
|
73
|
+
}, [maxTagCount, measureResponsiveTags]);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
measureResponsiveTags();
|
|
76
|
+
}, [measureResponsiveTags, selectedOptions]);
|
|
77
|
+
const visibleTagCount = maxTagCount === "responsive" ? responsiveTagCount : maxTagCount;
|
|
78
|
+
const visibleOptions = visibleTagCount === void 0 ? selectedOptions : selectedOptions.slice(0, visibleTagCount);
|
|
79
|
+
const hiddenTagCount = selectedOptions.length - visibleOptions.length;
|
|
80
|
+
const popupContainer = isOpen && getPopupContainer === "parent" ? rootRef.current?.parentElement ?? void 0 : isOpen && typeof document !== "undefined" && typeof getPopupContainer === "function" ? getPopupContainer() : void 0;
|
|
81
|
+
const updateValue = (nextValue) => {
|
|
82
|
+
if (controlledValue === void 0) setInternalValue(nextValue);
|
|
83
|
+
onChange?.(nextValue);
|
|
84
|
+
};
|
|
85
|
+
const toggleOption = (option) => {
|
|
86
|
+
updateValue(selectedValueSet.has(option.value) ? selectedValues.filter((value) => value !== option.value) : [...selectedValues, option.value]);
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
89
|
+
ref: rootRef,
|
|
90
|
+
className: cn("tc-ui-multi-select relative w-full", className),
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsxs("div", {
|
|
93
|
+
ref: anchorRef,
|
|
94
|
+
id,
|
|
95
|
+
role: "combobox",
|
|
96
|
+
"aria-label": ariaLabel,
|
|
97
|
+
"aria-labelledby": ariaLabelledBy,
|
|
98
|
+
"aria-expanded": isOpen,
|
|
99
|
+
"aria-controls": listboxId,
|
|
100
|
+
"aria-haspopup": "listbox",
|
|
101
|
+
"aria-disabled": disabled || void 0,
|
|
102
|
+
tabIndex: disabled ? -1 : 0,
|
|
103
|
+
onClick: () => !disabled && setIsOpen(true),
|
|
104
|
+
onKeyDown: (event) => {
|
|
105
|
+
if (disabled) return;
|
|
106
|
+
if (event.key === "Enter" || event.key === " " || event.key === "ArrowDown") {
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
setIsOpen(true);
|
|
109
|
+
} else if (event.key === "Escape") {
|
|
110
|
+
event.preventDefault();
|
|
111
|
+
setIsOpen(false);
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
className: cn("flex min-h-10 w-full flex-wrap items-center gap-1 rounded-lg border bg-background", "px-2 py-1 text-sm", disabled ? "cursor-not-allowed bg-muted" : "cursor-pointer", isOpen ? "border-theme ring-2 ring-theme/25" : "border-border"),
|
|
115
|
+
children: [
|
|
116
|
+
visibleOptions.length > 0 ? visibleOptions.map((option) => /* @__PURE__ */ jsxs("span", {
|
|
117
|
+
className: "inline-flex items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs",
|
|
118
|
+
children: [option.label, /* @__PURE__ */ jsx("button", {
|
|
119
|
+
type: "button",
|
|
120
|
+
disabled,
|
|
121
|
+
"aria-label": t("components.multiSelect.removeOption", { label: typeof option.label === "string" ? option.label : String(option.value) }),
|
|
122
|
+
className: cn("text-muted-foreground hover:text-foreground", "disabled:cursor-not-allowed disabled:opacity-60"),
|
|
123
|
+
onClick: (event) => {
|
|
124
|
+
event.stopPropagation();
|
|
125
|
+
if (!disabled) toggleOption(option);
|
|
126
|
+
},
|
|
127
|
+
children: /* @__PURE__ */ jsx(X, { size: 12 })
|
|
128
|
+
})]
|
|
129
|
+
}, option.value)) : /* @__PURE__ */ jsx("span", {
|
|
130
|
+
className: "min-h-5 flex-1 px-1 text-left text-muted-foreground",
|
|
131
|
+
children: placeholder ?? t("components.select.empty")
|
|
132
|
+
}),
|
|
133
|
+
hiddenTagCount > 0 && /* @__PURE__ */ jsxs("span", {
|
|
134
|
+
className: "px-1 text-xs text-muted-foreground",
|
|
135
|
+
children: ["+", hiddenTagCount]
|
|
136
|
+
}),
|
|
137
|
+
clearable && selectedOptions.length > 0 && !disabled && /* @__PURE__ */ jsx("button", {
|
|
138
|
+
type: "button",
|
|
139
|
+
"aria-label": t("components.multiSelect.clear"),
|
|
140
|
+
className: "ml-auto p-1 text-muted-foreground hover:text-foreground",
|
|
141
|
+
onClick: (event) => {
|
|
142
|
+
event.stopPropagation();
|
|
143
|
+
updateValue([]);
|
|
144
|
+
},
|
|
145
|
+
children: /* @__PURE__ */ jsx(X, { size: 14 })
|
|
146
|
+
})
|
|
147
|
+
]
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ jsxs(Popup, {
|
|
150
|
+
open: isOpen,
|
|
151
|
+
anchorRef,
|
|
152
|
+
onOpenChange: setIsOpen,
|
|
153
|
+
container: popupContainer,
|
|
154
|
+
matchAnchorWidth: true,
|
|
155
|
+
className: "max-h-60 overflow-auto p-1",
|
|
156
|
+
children: [searchable && /* @__PURE__ */ jsx(Input, {
|
|
157
|
+
autoFocus: true,
|
|
158
|
+
value: searchTerm,
|
|
159
|
+
onChange: (nextValue) => {
|
|
160
|
+
setSearchTerm(nextValue);
|
|
161
|
+
onSearch?.(nextValue);
|
|
162
|
+
},
|
|
163
|
+
onClick: (event) => event.stopPropagation(),
|
|
164
|
+
placeholder: t("components.multiSelect.search"),
|
|
165
|
+
className: "mb-1",
|
|
166
|
+
inputClassName: "h-8",
|
|
167
|
+
"aria-label": t("components.multiSelect.searchOptions")
|
|
168
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
169
|
+
id: listboxId,
|
|
170
|
+
role: "listbox",
|
|
171
|
+
"aria-multiselectable": "true",
|
|
172
|
+
children: [filteredGroups.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
173
|
+
className: "px-3 py-2 text-center text-sm text-muted-foreground",
|
|
174
|
+
children: t("components.select.empty")
|
|
175
|
+
}), filteredGroups.map((entry, index) => {
|
|
176
|
+
if (!isGroup(entry)) return /* @__PURE__ */ jsx(OptionRow, {
|
|
177
|
+
option: entry,
|
|
178
|
+
selected: selectedValueSet.has(entry.value),
|
|
179
|
+
onToggle: toggleOption
|
|
180
|
+
}, entry.value);
|
|
181
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
|
|
182
|
+
className: "px-3 py-1 text-xs font-medium text-muted-foreground",
|
|
183
|
+
children: entry.label
|
|
184
|
+
}), entry.options.map((option) => /* @__PURE__ */ jsx(OptionRow, {
|
|
185
|
+
option,
|
|
186
|
+
selected: selectedValueSet.has(option.value),
|
|
187
|
+
onToggle: toggleOption
|
|
188
|
+
}, option.value))] }, `group-${index}`);
|
|
189
|
+
})]
|
|
190
|
+
})]
|
|
191
|
+
}),
|
|
192
|
+
maxTagCount === "responsive" && /* @__PURE__ */ jsx("div", {
|
|
193
|
+
ref: tagMeasureRef,
|
|
194
|
+
"aria-hidden": "true",
|
|
195
|
+
className: "pointer-events-none absolute -z-10 whitespace-nowrap opacity-0",
|
|
196
|
+
children: selectedOptions.map((option) => /* @__PURE__ */ jsxs("span", {
|
|
197
|
+
"data-multi-select-measure": true,
|
|
198
|
+
className: "mr-1 inline-flex items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs",
|
|
199
|
+
children: [option.label, /* @__PURE__ */ jsx(X, { size: 12 })]
|
|
200
|
+
}, option.value))
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
function OptionRow({ option, selected, onToggle }) {
|
|
206
|
+
return /* @__PURE__ */ jsx("div", {
|
|
207
|
+
role: "option",
|
|
208
|
+
"aria-selected": selected,
|
|
209
|
+
"aria-disabled": option.disabled || void 0,
|
|
210
|
+
onClick: () => {
|
|
211
|
+
if (!option.disabled) onToggle(option);
|
|
212
|
+
},
|
|
213
|
+
className: cn("rounded-md px-3 py-2 text-sm", option.disabled ? "cursor-not-allowed text-muted-foreground/60" : "cursor-pointer hover:bg-foreground/8", selected && !option.disabled && "bg-theme/12"),
|
|
214
|
+
children: option.label
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
export { MultiSelect };
|