@origen-ui/admin-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +17 -0
- package/bin/og-admin.mjs +131 -0
- package/package.json +28 -0
- package/templates/current/clean/.codebuddy/AGENTS.md +18 -0
- package/templates/current/clean/.codebuddy/rules/01-feature-architecture.md +12 -0
- package/templates/current/clean/.codebuddy/rules/02-vue-typescript.md +12 -0
- package/templates/current/clean/.codebuddy/rules/03-component-policy.md +30 -0
- package/templates/current/clean/.codebuddy/rules/04-api-auth-router.md +12 -0
- package/templates/current/clean/.codebuddy/rules/05-style.md +12 -0
- package/templates/current/clean/.codebuddy/rules/06-quality.md +12 -0
- package/templates/current/clean/.codebuddy/skills/build-admin-feature/SKILL.md +17 -0
- package/templates/current/clean/.codebuddy/skills/style-og-origen-ui/SKILL.md +14 -0
- package/templates/current/clean/.codebuddy/skills/use-og-dialog/SKILL.md +15 -0
- package/templates/current/clean/.codebuddy/skills/use-og-editor/SKILL.md +28 -0
- package/templates/current/clean/.codebuddy/skills/use-og-form/SKILL.md +15 -0
- package/templates/current/clean/.codebuddy/skills/use-og-form-table/SKILL.md +28 -0
- package/templates/current/clean/.codebuddy/skills/use-og-http/SKILL.md +16 -0
- package/templates/current/clean/.codebuddy/skills/use-og-router-tabs/SKILL.md +14 -0
- package/templates/current/clean/.codebuddy/skills/use-og-search/SKILL.md +17 -0
- package/templates/current/clean/.codebuddy/skills/use-og-table/SKILL.md +19 -0
- package/templates/current/clean/.codebuddy/skills/use-og-upload/SKILL.md +28 -0
- package/templates/current/clean/.codex/AGENTS.md +15 -0
- package/templates/current/clean/.codex/rules/01-feature-architecture.md +6 -0
- package/templates/current/clean/.codex/rules/02-vue-typescript.md +6 -0
- package/templates/current/clean/.codex/rules/03-component-policy.md +24 -0
- package/templates/current/clean/.codex/rules/04-api-auth-router.md +6 -0
- package/templates/current/clean/.codex/rules/05-style.md +6 -0
- package/templates/current/clean/.codex/rules/06-quality.md +6 -0
- package/templates/current/clean/.codex/skills/build-admin-feature/SKILL.md +14 -0
- package/templates/current/clean/.codex/skills/build-admin-feature/references/component-selection.md +25 -0
- package/templates/current/clean/.codex/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/clean/.codex/skills/style-og-origen-ui/agents/openai.yaml +4 -0
- package/templates/current/clean/.codex/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/clean/.codex/skills/use-og-dialog/agents/openai.yaml +4 -0
- package/templates/current/clean/.codex/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/clean/.codex/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/clean/.codex/skills/use-og-form-table/SKILL.md +25 -0
- package/templates/current/clean/.codex/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/clean/.codex/skills/use-og-http/agents/openai.yaml +4 -0
- package/templates/current/clean/.codex/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/clean/.codex/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/clean/.codex/skills/use-og-table/SKILL.md +16 -0
- package/templates/current/clean/.codex/skills/use-og-upload/SKILL.md +25 -0
- package/templates/current/clean/.cursor/AGENTS.md +18 -0
- package/templates/current/clean/.cursor/rules/01-feature-architecture.mdc +12 -0
- package/templates/current/clean/.cursor/rules/02-vue-typescript.mdc +12 -0
- package/templates/current/clean/.cursor/rules/03-component-policy.mdc +30 -0
- package/templates/current/clean/.cursor/rules/04-api-auth-router.mdc +12 -0
- package/templates/current/clean/.cursor/rules/05-style.mdc +12 -0
- package/templates/current/clean/.cursor/rules/06-quality.mdc +12 -0
- package/templates/current/clean/.cursor/skills/build-admin-feature/SKILL.md +14 -0
- package/templates/current/clean/.cursor/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/clean/.cursor/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/clean/.cursor/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/clean/.cursor/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/clean/.cursor/skills/use-og-form-table/SKILL.md +25 -0
- package/templates/current/clean/.cursor/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/clean/.cursor/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/clean/.cursor/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/clean/.cursor/skills/use-og-table/SKILL.md +16 -0
- package/templates/current/clean/.cursor/skills/use-og-upload/SKILL.md +25 -0
- package/templates/current/clean/.env.example +7 -0
- package/templates/current/clean/.env.production.example +31 -0
- package/templates/current/clean/.qoder/AGENTS.md +15 -0
- package/templates/current/clean/.qoder/rules/01-feature-architecture.md +12 -0
- package/templates/current/clean/.qoder/rules/02-vue-typescript.md +12 -0
- package/templates/current/clean/.qoder/rules/03-component-policy.md +30 -0
- package/templates/current/clean/.qoder/rules/04-api-auth-router.md +12 -0
- package/templates/current/clean/.qoder/rules/05-style.md +12 -0
- package/templates/current/clean/.qoder/rules/06-quality.md +12 -0
- package/templates/current/clean/.qoder/skills/build-admin-feature/SKILL.md +14 -0
- package/templates/current/clean/.qoder/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/clean/.qoder/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/clean/.qoder/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/clean/.qoder/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/clean/.qoder/skills/use-og-form-table/SKILL.md +25 -0
- package/templates/current/clean/.qoder/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/clean/.qoder/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/clean/.qoder/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/clean/.qoder/skills/use-og-table/SKILL.md +16 -0
- package/templates/current/clean/.qoder/skills/use-og-upload/SKILL.md +25 -0
- package/templates/current/clean/AGENTS.md +16 -0
- package/templates/current/clean/README.md +116 -0
- package/templates/current/clean/component-catalog.json +765 -0
- package/templates/current/clean/e2e/admin-shell.spec.ts +150 -0
- package/templates/current/clean/e2e/demo-shell.spec.ts +328 -0
- package/templates/current/clean/evals/component-selection.json +29 -0
- package/templates/current/clean/gitignore +3 -0
- package/templates/current/clean/index.html +13 -0
- package/templates/current/clean/openapi.json +1623 -0
- package/templates/current/clean/package.json +65 -0
- package/templates/current/clean/playwright.config.ts +31 -0
- package/templates/current/clean/playwright.demo.config.ts +25 -0
- package/templates/current/clean/recipes/README.md +7 -0
- package/templates/current/clean/recipes/remote-crud-dialog-form.json +15 -0
- package/templates/current/clean/recipes/remote-crud-dialog-form.vue +66 -0
- package/templates/current/clean/scaffold.lock.json +12 -0
- package/templates/current/clean/scripts/check-admin-bundle.mjs +214 -0
- package/templates/current/clean/scripts/check-admin-scaffold.mjs +168 -0
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +26 -0
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +26 -0
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +26 -0
- package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +32 -0
- package/templates/current/clean/scripts/clean-overlay/src/main.ts +91 -0
- package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +25 -0
- package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +47 -0
- package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +63 -0
- package/templates/current/clean/scripts/demo-api.ts +797 -0
- package/templates/current/clean/scripts/generate-api.ts +27 -0
- package/templates/current/clean/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +38 -0
- package/templates/current/clean/scripts/remove-examples.mjs +54 -0
- package/templates/current/clean/src/App.vue +67 -0
- package/templates/current/clean/src/api/client.spec.ts +66 -0
- package/templates/current/clean/src/api/client.ts +72 -0
- package/templates/current/clean/src/api/generated/data-contracts.ts +268 -0
- package/templates/current/clean/src/api/generated/http-client.ts +266 -0
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +147 -0
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +53 -0
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +66 -0
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +171 -0
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +181 -0
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +169 -0
- package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +170 -0
- package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +98 -0
- package/templates/current/clean/src/api/http-adapter.spec.ts +33 -0
- package/templates/current/clean/src/api/http-adapter.ts +83 -0
- package/templates/current/clean/src/api/index.ts +41 -0
- package/templates/current/clean/src/app/createAdminUi.spec.ts +110 -0
- package/templates/current/clean/src/app/createAdminUi.ts +78 -0
- package/templates/current/clean/src/app/menu.spec.ts +255 -0
- package/templates/current/clean/src/app/menu.ts +268 -0
- package/templates/current/clean/src/app/menuTypes.ts +17 -0
- package/templates/current/clean/src/app/origenUiLocale.spec.ts +14 -0
- package/templates/current/clean/src/app/origenUiLocale.ts +65 -0
- package/templates/current/clean/src/app/permission.ts +9 -0
- package/templates/current/clean/src/app/runtimeConfig.ts +77 -0
- package/templates/current/clean/src/demo-api.spec.ts +167 -0
- package/templates/current/clean/src/env.d.ts +14 -0
- package/templates/current/clean/src/features/appearance/components/ThemePanel.vue +200 -0
- package/templates/current/clean/src/features/appearance/composables/useTheme.ts +17 -0
- package/templates/current/clean/src/features/appearance/store/theme.ts +140 -0
- package/templates/current/clean/src/features/auth/pages/Login.vue +159 -0
- package/templates/current/clean/src/features/auth/store/auth.spec.ts +131 -0
- package/templates/current/clean/src/features/auth/store/auth.ts +210 -0
- package/templates/current/clean/src/features/errors/pages/Forbidden.vue +26 -0
- package/templates/current/clean/src/features/errors/pages/NotFound.vue +26 -0
- package/templates/current/clean/src/features/errors/pages/ServerError.vue +26 -0
- package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +32 -0
- package/templates/current/clean/src/features/security/components/DevtoolsProtectionOverlay.vue +56 -0
- package/templates/current/clean/src/features/security/devtoolsProtection.spec.ts +211 -0
- package/templates/current/clean/src/features/security/devtoolsProtection.ts +242 -0
- package/templates/current/clean/src/features/shell/components/AdminWatermark.spec.ts +90 -0
- package/templates/current/clean/src/features/shell/components/AdminWatermark.vue +47 -0
- package/templates/current/clean/src/features/shell/components/RouteProgress.vue +68 -0
- package/templates/current/clean/src/features/shell/composables/useRouteProgress.spec.ts +95 -0
- package/templates/current/clean/src/features/shell/composables/useRouteProgress.ts +52 -0
- package/templates/current/clean/src/features/shell/store/sidebar.ts +55 -0
- package/templates/current/clean/src/features/system/access/api/admin-repository.ts +279 -0
- package/templates/current/clean/src/features/system/access/api/rbac.spec.ts +72 -0
- package/templates/current/clean/src/features/system/access/api/rbac.ts +272 -0
- package/templates/current/clean/src/features/system/access/composables/useAuthorizationRefresh.ts +15 -0
- package/templates/current/clean/src/features/workspace/pages/Empty.vue +18 -0
- package/templates/current/clean/src/features/workspace/pages/Profile.vue +183 -0
- package/templates/current/clean/src/layouts/AdminLayout.vue +61 -0
- package/templates/current/clean/src/layouts/BreadcrumbBar.vue +27 -0
- package/templates/current/clean/src/layouts/SideMenu.vue +119 -0
- package/templates/current/clean/src/layouts/TopBar.vue +301 -0
- package/templates/current/clean/src/layouts/WorkspaceTabs.vue +44 -0
- package/templates/current/clean/src/layouts/topBarMenuSearch.spec.ts +31 -0
- package/templates/current/clean/src/layouts/topBarMenuSearch.ts +21 -0
- package/templates/current/clean/src/locales/en-US.ts +55 -0
- package/templates/current/clean/src/locales/index.ts +119 -0
- package/templates/current/clean/src/locales/messages.spec.ts +23 -0
- package/templates/current/clean/src/locales/zh-CN.ts +55 -0
- package/templates/current/clean/src/locales/zh-TW.ts +44 -0
- package/templates/current/clean/src/main.ts +91 -0
- package/templates/current/clean/src/router/bootstrap.ts +76 -0
- package/templates/current/clean/src/router/componentRegistry.ts +25 -0
- package/templates/current/clean/src/router/dynamicRoutes.spec.ts +47 -0
- package/templates/current/clean/src/router/dynamicRoutes.ts +162 -0
- package/templates/current/clean/src/router/guards.ts +5 -0
- package/templates/current/clean/src/router/queryEncryption.spec.ts +82 -0
- package/templates/current/clean/src/router/queryEncryption.ts +133 -0
- package/templates/current/clean/src/router/routeQuery.spec.ts +11 -0
- package/templates/current/clean/src/router/routeQuery.ts +3 -0
- package/templates/current/clean/src/router/runtimeErrorRecovery.spec.ts +161 -0
- package/templates/current/clean/src/router/runtimeErrorRecovery.ts +108 -0
- package/templates/current/clean/src/router/staticRoutes.ts +63 -0
- package/templates/current/clean/src/router/useRouteQueryDefaults.spec.ts +90 -0
- package/templates/current/clean/src/router/useRouteQueryDefaults.ts +51 -0
- package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +19 -0
- package/templates/current/clean/src/store/index.ts +3 -0
- package/templates/current/clean/src/styles/element/index.scss +33 -0
- package/templates/current/clean/src/styles/index.css +39 -0
- package/templates/current/clean/src/styles/layout.css +115 -0
- package/templates/current/clean/src/styles/shell.css +196 -0
- package/templates/current/clean/src/styles/source-package-style-compat.css +1 -0
- package/templates/current/clean/src/templates/og-form.ts +48 -0
- package/templates/current/clean/src/templates/og-table.ts +212 -0
- package/templates/current/clean/src/templates/router.ts +51 -0
- package/templates/current/clean/src/templates/templates.spec.ts +90 -0
- package/templates/current/clean/src/theme/index.ts +7 -0
- package/templates/current/clean/src/utils/__tests__/color-mix.spec.ts +39 -0
- package/templates/current/clean/src/utils/color-mix.ts +76 -0
- package/templates/current/clean/src/utils/permissions.ts +6 -0
- package/templates/current/clean/tsconfig.json +40 -0
- package/templates/current/clean/tsconfig.node.json +9 -0
- package/templates/current/clean/vite.build-policy.ts +405 -0
- package/templates/current/clean/vite.config.ts +37 -0
- package/templates/current/examples/.codebuddy/AGENTS.md +18 -0
- package/templates/current/examples/.codebuddy/rules/01-feature-architecture.md +12 -0
- package/templates/current/examples/.codebuddy/rules/02-vue-typescript.md +12 -0
- package/templates/current/examples/.codebuddy/rules/03-component-policy.md +30 -0
- package/templates/current/examples/.codebuddy/rules/04-api-auth-router.md +12 -0
- package/templates/current/examples/.codebuddy/rules/05-style.md +12 -0
- package/templates/current/examples/.codebuddy/rules/06-quality.md +12 -0
- package/templates/current/examples/.codebuddy/skills/build-admin-feature/SKILL.md +17 -0
- package/templates/current/examples/.codebuddy/skills/style-og-origen-ui/SKILL.md +14 -0
- package/templates/current/examples/.codebuddy/skills/use-og-dialog/SKILL.md +15 -0
- package/templates/current/examples/.codebuddy/skills/use-og-editor/SKILL.md +28 -0
- package/templates/current/examples/.codebuddy/skills/use-og-form/SKILL.md +15 -0
- package/templates/current/examples/.codebuddy/skills/use-og-form-table/SKILL.md +28 -0
- package/templates/current/examples/.codebuddy/skills/use-og-http/SKILL.md +16 -0
- package/templates/current/examples/.codebuddy/skills/use-og-router-tabs/SKILL.md +14 -0
- package/templates/current/examples/.codebuddy/skills/use-og-search/SKILL.md +17 -0
- package/templates/current/examples/.codebuddy/skills/use-og-table/SKILL.md +19 -0
- package/templates/current/examples/.codebuddy/skills/use-og-upload/SKILL.md +28 -0
- package/templates/current/examples/.codex/AGENTS.md +15 -0
- package/templates/current/examples/.codex/rules/01-feature-architecture.md +6 -0
- package/templates/current/examples/.codex/rules/02-vue-typescript.md +6 -0
- package/templates/current/examples/.codex/rules/03-component-policy.md +24 -0
- package/templates/current/examples/.codex/rules/04-api-auth-router.md +6 -0
- package/templates/current/examples/.codex/rules/05-style.md +6 -0
- package/templates/current/examples/.codex/rules/06-quality.md +6 -0
- package/templates/current/examples/.codex/skills/build-admin-feature/SKILL.md +14 -0
- package/templates/current/examples/.codex/skills/build-admin-feature/references/component-selection.md +25 -0
- package/templates/current/examples/.codex/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.codex/skills/style-og-origen-ui/agents/openai.yaml +4 -0
- package/templates/current/examples/.codex/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.codex/skills/use-og-dialog/agents/openai.yaml +4 -0
- package/templates/current/examples/.codex/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.codex/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.codex/skills/use-og-form-table/SKILL.md +25 -0
- package/templates/current/examples/.codex/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.codex/skills/use-og-http/agents/openai.yaml +4 -0
- package/templates/current/examples/.codex/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.codex/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.codex/skills/use-og-table/SKILL.md +16 -0
- package/templates/current/examples/.codex/skills/use-og-upload/SKILL.md +25 -0
- package/templates/current/examples/.cursor/AGENTS.md +18 -0
- package/templates/current/examples/.cursor/rules/01-feature-architecture.mdc +12 -0
- package/templates/current/examples/.cursor/rules/02-vue-typescript.mdc +12 -0
- package/templates/current/examples/.cursor/rules/03-component-policy.mdc +30 -0
- package/templates/current/examples/.cursor/rules/04-api-auth-router.mdc +12 -0
- package/templates/current/examples/.cursor/rules/05-style.mdc +12 -0
- package/templates/current/examples/.cursor/rules/06-quality.mdc +12 -0
- package/templates/current/examples/.cursor/skills/build-admin-feature/SKILL.md +14 -0
- package/templates/current/examples/.cursor/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.cursor/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.cursor/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.cursor/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.cursor/skills/use-og-form-table/SKILL.md +25 -0
- package/templates/current/examples/.cursor/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.cursor/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.cursor/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.cursor/skills/use-og-table/SKILL.md +16 -0
- package/templates/current/examples/.cursor/skills/use-og-upload/SKILL.md +25 -0
- package/templates/current/examples/.env.example +7 -0
- package/templates/current/examples/.env.production.example +31 -0
- package/templates/current/examples/.qoder/AGENTS.md +15 -0
- package/templates/current/examples/.qoder/rules/01-feature-architecture.md +12 -0
- package/templates/current/examples/.qoder/rules/02-vue-typescript.md +12 -0
- package/templates/current/examples/.qoder/rules/03-component-policy.md +30 -0
- package/templates/current/examples/.qoder/rules/04-api-auth-router.md +12 -0
- package/templates/current/examples/.qoder/rules/05-style.md +12 -0
- package/templates/current/examples/.qoder/rules/06-quality.md +12 -0
- package/templates/current/examples/.qoder/skills/build-admin-feature/SKILL.md +14 -0
- package/templates/current/examples/.qoder/skills/style-og-origen-ui/SKILL.md +11 -0
- package/templates/current/examples/.qoder/skills/use-og-dialog/SKILL.md +12 -0
- package/templates/current/examples/.qoder/skills/use-og-editor/SKILL.md +25 -0
- package/templates/current/examples/.qoder/skills/use-og-form/SKILL.md +12 -0
- package/templates/current/examples/.qoder/skills/use-og-form-table/SKILL.md +25 -0
- package/templates/current/examples/.qoder/skills/use-og-http/SKILL.md +13 -0
- package/templates/current/examples/.qoder/skills/use-og-router-tabs/SKILL.md +11 -0
- package/templates/current/examples/.qoder/skills/use-og-search/SKILL.md +14 -0
- package/templates/current/examples/.qoder/skills/use-og-table/SKILL.md +16 -0
- package/templates/current/examples/.qoder/skills/use-og-upload/SKILL.md +25 -0
- package/templates/current/examples/AGENTS.md +16 -0
- package/templates/current/examples/README.md +116 -0
- package/templates/current/examples/component-catalog.json +765 -0
- package/templates/current/examples/e2e/admin-shell.spec.ts +150 -0
- package/templates/current/examples/e2e/demo-shell.spec.ts +328 -0
- package/templates/current/examples/evals/component-selection.json +29 -0
- package/templates/current/examples/gitignore +3 -0
- package/templates/current/examples/index.html +13 -0
- package/templates/current/examples/openapi.json +1623 -0
- package/templates/current/examples/package.json +65 -0
- package/templates/current/examples/playwright.config.ts +31 -0
- package/templates/current/examples/playwright.demo.config.ts +25 -0
- package/templates/current/examples/recipes/README.md +7 -0
- package/templates/current/examples/recipes/remote-crud-dialog-form.json +15 -0
- package/templates/current/examples/recipes/remote-crud-dialog-form.vue +66 -0
- package/templates/current/examples/scaffold.lock.json +12 -0
- package/templates/current/examples/scripts/check-admin-bundle.mjs +214 -0
- package/templates/current/examples/scripts/check-admin-scaffold.mjs +168 -0
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +26 -0
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +26 -0
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +26 -0
- package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +32 -0
- package/templates/current/examples/scripts/clean-overlay/src/main.ts +91 -0
- package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +25 -0
- package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +47 -0
- package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +63 -0
- package/templates/current/examples/scripts/demo-api.ts +797 -0
- package/templates/current/examples/scripts/generate-api.ts +27 -0
- package/templates/current/examples/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +38 -0
- package/templates/current/examples/scripts/remove-examples.mjs +54 -0
- package/templates/current/examples/src/App.vue +67 -0
- package/templates/current/examples/src/api/client.spec.ts +66 -0
- package/templates/current/examples/src/api/client.ts +72 -0
- package/templates/current/examples/src/api/generated/data-contracts.ts +268 -0
- package/templates/current/examples/src/api/generated/http-client.ts +266 -0
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +147 -0
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +53 -0
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +66 -0
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +171 -0
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +181 -0
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +169 -0
- package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +170 -0
- package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +98 -0
- package/templates/current/examples/src/api/http-adapter.spec.ts +33 -0
- package/templates/current/examples/src/api/http-adapter.ts +83 -0
- package/templates/current/examples/src/api/index.ts +41 -0
- package/templates/current/examples/src/app/createAdminUi.spec.ts +110 -0
- package/templates/current/examples/src/app/createAdminUi.ts +78 -0
- package/templates/current/examples/src/app/menu.spec.ts +255 -0
- package/templates/current/examples/src/app/menu.ts +268 -0
- package/templates/current/examples/src/app/menuTypes.ts +17 -0
- package/templates/current/examples/src/app/origenUiLocale.spec.ts +14 -0
- package/templates/current/examples/src/app/origenUiLocale.ts +65 -0
- package/templates/current/examples/src/app/permission.ts +9 -0
- package/templates/current/examples/src/app/runtimeConfig.ts +77 -0
- package/templates/current/examples/src/demo-api.spec.ts +167 -0
- package/templates/current/examples/src/env.d.ts +14 -0
- package/templates/current/examples/src/features/appearance/components/ThemePanel.vue +200 -0
- package/templates/current/examples/src/features/appearance/composables/useTheme.ts +17 -0
- package/templates/current/examples/src/features/appearance/store/theme.ts +140 -0
- package/templates/current/examples/src/features/auth/pages/Login.vue +159 -0
- package/templates/current/examples/src/features/auth/store/auth.spec.ts +131 -0
- package/templates/current/examples/src/features/auth/store/auth.ts +210 -0
- package/templates/current/examples/src/features/errors/pages/Forbidden.vue +26 -0
- package/templates/current/examples/src/features/errors/pages/NotFound.vue +26 -0
- package/templates/current/examples/src/features/errors/pages/ServerError.vue +26 -0
- package/templates/current/examples/src/features/errors/pages/error-pages.spec.ts +32 -0
- package/templates/current/examples/src/features/feature-composables.spec.ts +208 -0
- package/templates/current/examples/src/features/security/components/DevtoolsProtectionOverlay.vue +56 -0
- package/templates/current/examples/src/features/security/devtoolsProtection.spec.ts +211 -0
- package/templates/current/examples/src/features/security/devtoolsProtection.ts +242 -0
- package/templates/current/examples/src/features/shell/components/AdminWatermark.spec.ts +90 -0
- package/templates/current/examples/src/features/shell/components/AdminWatermark.vue +47 -0
- package/templates/current/examples/src/features/shell/components/RouteProgress.vue +68 -0
- package/templates/current/examples/src/features/shell/composables/useRouteProgress.spec.ts +95 -0
- package/templates/current/examples/src/features/shell/composables/useRouteProgress.ts +52 -0
- package/templates/current/examples/src/features/shell/store/sidebar.ts +55 -0
- package/templates/current/examples/src/features/system/access/api/admin-repository.ts +279 -0
- package/templates/current/examples/src/features/system/access/api/rbac.spec.ts +72 -0
- package/templates/current/examples/src/features/system/access/api/rbac.ts +272 -0
- package/templates/current/examples/src/features/system/access/composables/useAuthorizationRefresh.ts +15 -0
- package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +117 -0
- package/templates/current/examples/src/features/system/audit/pages/AuditList.vue +20 -0
- package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +189 -0
- package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +327 -0
- package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +49 -0
- package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +112 -0
- package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +198 -0
- package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +45 -0
- package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +101 -0
- package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +233 -0
- package/templates/current/examples/src/features/system/users/pages/UserList.vue +49 -0
- package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +32 -0
- package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +297 -0
- package/templates/current/examples/src/features/workspace/pages/Empty.vue +18 -0
- package/templates/current/examples/src/features/workspace/pages/Profile.vue +183 -0
- package/templates/current/examples/src/layouts/AdminLayout.vue +61 -0
- package/templates/current/examples/src/layouts/BreadcrumbBar.vue +27 -0
- package/templates/current/examples/src/layouts/SideMenu.vue +119 -0
- package/templates/current/examples/src/layouts/TopBar.vue +301 -0
- package/templates/current/examples/src/layouts/WorkspaceTabs.vue +44 -0
- package/templates/current/examples/src/layouts/topBarMenuSearch.spec.ts +31 -0
- package/templates/current/examples/src/layouts/topBarMenuSearch.ts +21 -0
- package/templates/current/examples/src/locales/en-US.ts +55 -0
- package/templates/current/examples/src/locales/index.ts +119 -0
- package/templates/current/examples/src/locales/messages.spec.ts +23 -0
- package/templates/current/examples/src/locales/zh-CN.ts +55 -0
- package/templates/current/examples/src/locales/zh-TW.ts +44 -0
- package/templates/current/examples/src/main.ts +91 -0
- package/templates/current/examples/src/router/bootstrap.ts +76 -0
- package/templates/current/examples/src/router/componentRegistry.ts +83 -0
- package/templates/current/examples/src/router/dynamicRoutes.spec.ts +109 -0
- package/templates/current/examples/src/router/dynamicRoutes.ts +162 -0
- package/templates/current/examples/src/router/guards.ts +5 -0
- package/templates/current/examples/src/router/queryEncryption.spec.ts +82 -0
- package/templates/current/examples/src/router/queryEncryption.ts +133 -0
- package/templates/current/examples/src/router/routeQuery.spec.ts +11 -0
- package/templates/current/examples/src/router/routeQuery.ts +3 -0
- package/templates/current/examples/src/router/runtimeErrorRecovery.spec.ts +161 -0
- package/templates/current/examples/src/router/runtimeErrorRecovery.ts +108 -0
- package/templates/current/examples/src/router/staticRoutes.ts +63 -0
- package/templates/current/examples/src/router/useRouteQueryDefaults.spec.ts +90 -0
- package/templates/current/examples/src/router/useRouteQueryDefaults.ts +51 -0
- package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +19 -0
- package/templates/current/examples/src/store/index.ts +3 -0
- package/templates/current/examples/src/styles/element/index.scss +33 -0
- package/templates/current/examples/src/styles/index.css +39 -0
- package/templates/current/examples/src/styles/layout.css +115 -0
- package/templates/current/examples/src/styles/shell.css +196 -0
- package/templates/current/examples/src/styles/source-package-style-compat.css +1 -0
- package/templates/current/examples/src/templates/og-form.ts +48 -0
- package/templates/current/examples/src/templates/og-table.ts +212 -0
- package/templates/current/examples/src/templates/router.ts +51 -0
- package/templates/current/examples/src/templates/templates.spec.ts +90 -0
- package/templates/current/examples/src/theme/index.ts +7 -0
- package/templates/current/examples/src/utils/__tests__/color-mix.spec.ts +39 -0
- package/templates/current/examples/src/utils/color-mix.ts +76 -0
- package/templates/current/examples/src/utils/permissions.ts +6 -0
- package/templates/current/examples/tsconfig.json +40 -0
- package/templates/current/examples/tsconfig.node.json +9 -0
- package/templates/current/examples/vite.build-policy.ts +405 -0
- package/templates/current/examples/vite.config.ts +37 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
2
|
+
|
|
3
|
+
const Forbidden = () => import('../features/errors/pages/Forbidden.vue')
|
|
4
|
+
const NotFound = () => import('../features/errors/pages/NotFound.vue')
|
|
5
|
+
const ServerError = () => import('../features/errors/pages/ServerError.vue')
|
|
6
|
+
const Login = () => import('../features/auth/pages/Login.vue')
|
|
7
|
+
const Profile = () => import('../features/workspace/pages/Profile.vue')
|
|
8
|
+
|
|
9
|
+
const hiddenPublic = {
|
|
10
|
+
public: true,
|
|
11
|
+
menu: { hidden: true },
|
|
12
|
+
breadcrumb: { hidden: true },
|
|
13
|
+
tab: { hidden: true },
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const staticRoutes: RouteRecordRaw[] = [
|
|
17
|
+
{
|
|
18
|
+
path: '/',
|
|
19
|
+
name: 'root',
|
|
20
|
+
redirect: '/workspace',
|
|
21
|
+
meta: {
|
|
22
|
+
adapter: { menu: { hidden: true }, breadcrumb: { hidden: true }, tab: { hidden: true } },
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
path: '/login',
|
|
27
|
+
name: 'login',
|
|
28
|
+
component: Login,
|
|
29
|
+
meta: { adapter: { title: '登录', ...hiddenPublic } },
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
path: '/profile',
|
|
33
|
+
name: 'profile',
|
|
34
|
+
component: Profile,
|
|
35
|
+
meta: {
|
|
36
|
+
adapter: {
|
|
37
|
+
title: '个人资料',
|
|
38
|
+
icon: 'profile',
|
|
39
|
+
menu: { order: 20 },
|
|
40
|
+
breadcrumb: { label: '个人资料' },
|
|
41
|
+
cache: { enabled: true, name: 'ProfilePage' },
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
path: '/403',
|
|
47
|
+
name: '403',
|
|
48
|
+
component: Forbidden,
|
|
49
|
+
meta: { adapter: { title: '无权访问', ...hiddenPublic } },
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
path: '/404',
|
|
53
|
+
name: '404',
|
|
54
|
+
component: NotFound,
|
|
55
|
+
meta: { adapter: { title: '页面不存在', ...hiddenPublic } },
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
path: '/500',
|
|
59
|
+
name: '500',
|
|
60
|
+
component: ServerError,
|
|
61
|
+
meta: { adapter: { title: '服务异常', ...hiddenPublic } },
|
|
62
|
+
},
|
|
63
|
+
]
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils'
|
|
2
|
+
import { describe, expect, it } from 'vitest'
|
|
3
|
+
import { defineComponent, h, KeepAlive, nextTick, type VNode } from 'vue'
|
|
4
|
+
import { createMemoryHistory, createRouter, RouterView } from 'vue-router'
|
|
5
|
+
import { routeStatus } from './routeQuery'
|
|
6
|
+
import { useRouteQueryDefaults } from './useRouteQueryDefaults'
|
|
7
|
+
|
|
8
|
+
interface Query {
|
|
9
|
+
status?: 'active' | 'suspended'
|
|
10
|
+
team?: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function routeTeam(value: unknown): string | undefined {
|
|
14
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const Harness = defineComponent({
|
|
18
|
+
name: 'Harness',
|
|
19
|
+
setup() {
|
|
20
|
+
return useRouteQueryDefaults<Query>({ status: routeStatus, team: routeTeam })
|
|
21
|
+
},
|
|
22
|
+
render() {
|
|
23
|
+
return h('output', { 'data-defaults': JSON.stringify(this.queryDefaults) })
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const Other = defineComponent({
|
|
28
|
+
name: 'Other',
|
|
29
|
+
render: () => h('output', { 'data-page': 'other' }),
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
describe('useRouteQueryDefaults', () => {
|
|
33
|
+
it('snapshots defaults on mount and does not follow later route.query changes', async () => {
|
|
34
|
+
const router = createRouter({
|
|
35
|
+
history: createMemoryHistory(),
|
|
36
|
+
routes: [{ path: '/users', component: Harness }],
|
|
37
|
+
})
|
|
38
|
+
await router.push({ path: '/users', query: { status: 'active', team: 'growth' } })
|
|
39
|
+
await router.isReady()
|
|
40
|
+
const wrapper = mount(RouterView, { global: { plugins: [router] } })
|
|
41
|
+
|
|
42
|
+
expect(wrapper.get('output').attributes('data-defaults')).toBe(
|
|
43
|
+
JSON.stringify({ status: 'active', team: 'growth' }),
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
// 挂载后 route.query 变化(页签切换的等价场景)不应更新快照,避免触发 OgTable 重置
|
|
47
|
+
await router.push({ path: '/users', query: { status: 'suspended' } })
|
|
48
|
+
await nextTick()
|
|
49
|
+
expect(wrapper.get('output').attributes('data-defaults')).toBe(
|
|
50
|
+
JSON.stringify({ status: 'active', team: 'growth' }),
|
|
51
|
+
)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('re-snapshots the current route query when the page is reactivated', async () => {
|
|
55
|
+
const Host = defineComponent({
|
|
56
|
+
name: 'Host',
|
|
57
|
+
setup: () => () =>
|
|
58
|
+
h(RouterView, null, {
|
|
59
|
+
default: ({ Component }: { Component: VNode }) =>
|
|
60
|
+
h(KeepAlive, { include: ['Harness'] }, [h(Component)]),
|
|
61
|
+
}),
|
|
62
|
+
})
|
|
63
|
+
const router = createRouter({
|
|
64
|
+
history: createMemoryHistory(),
|
|
65
|
+
routes: [
|
|
66
|
+
{ path: '/users', component: Harness },
|
|
67
|
+
{ path: '/other', component: Other },
|
|
68
|
+
],
|
|
69
|
+
})
|
|
70
|
+
await router.push({ path: '/users', query: { status: 'active' } })
|
|
71
|
+
await router.isReady()
|
|
72
|
+
const wrapper = mount(Host, { global: { plugins: [router] } })
|
|
73
|
+
|
|
74
|
+
expect(wrapper.get('output').attributes('data-defaults')).toBe(
|
|
75
|
+
JSON.stringify({ status: 'active' }),
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
// 切到其他页签:Harness 被 KeepAlive 缓存,快照保持不变
|
|
79
|
+
await router.push('/other')
|
|
80
|
+
await nextTick()
|
|
81
|
+
expect(wrapper.get('output').attributes('data-page')).toBe('other')
|
|
82
|
+
|
|
83
|
+
// 切回并携带新的 URL query:onActivated 重新取快照
|
|
84
|
+
await router.push({ path: '/users', query: { status: 'suspended', team: 'growth' } })
|
|
85
|
+
await nextTick()
|
|
86
|
+
expect(wrapper.get('output').attributes('data-defaults')).toBe(
|
|
87
|
+
JSON.stringify({ status: 'suspended', team: 'growth' }),
|
|
88
|
+
)
|
|
89
|
+
})
|
|
90
|
+
})
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { onActivated, onMounted, ref } from 'vue'
|
|
2
|
+
import { useRoute } from 'vue-router'
|
|
3
|
+
|
|
4
|
+
type RouteQueryKey<TQuery extends object> = Extract<keyof TQuery, string>
|
|
5
|
+
|
|
6
|
+
export type RouteQueryParser<TValue> = (value: unknown) => TValue | undefined
|
|
7
|
+
|
|
8
|
+
export type RouteQueryParsers<TQuery extends object> = Partial<{
|
|
9
|
+
[TKey in RouteQueryKey<TQuery>]: RouteQueryParser<Exclude<TQuery[TKey], undefined>>
|
|
10
|
+
}>
|
|
11
|
+
|
|
12
|
+
function resolveRouteDefaults<TQuery extends object>(
|
|
13
|
+
query: Record<string, unknown>,
|
|
14
|
+
parsers: RouteQueryParsers<TQuery>,
|
|
15
|
+
): Partial<TQuery> {
|
|
16
|
+
const defaults: Partial<TQuery> = {}
|
|
17
|
+
|
|
18
|
+
for (const key of Object.keys(parsers) as RouteQueryKey<TQuery>[]) {
|
|
19
|
+
const parser = parsers[key]
|
|
20
|
+
if (!parser) continue
|
|
21
|
+
|
|
22
|
+
const value = parser(query[key])
|
|
23
|
+
if (value !== undefined) Object.assign(defaults, { [key]: value })
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return defaults
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Parses allowlisted route values into table query defaults.
|
|
31
|
+
*
|
|
32
|
+
* The defaults are snapshotted when the page is entered (mount or KeepAlive
|
|
33
|
+
* reactivation), not reactively bound to `route.query`. While a cached tab is
|
|
34
|
+
* deactivated, `route.query` changes (e.g. switching to another tab) must not
|
|
35
|
+
* trigger `OgTable`'s `queryDefaults` watcher and wipe the search state.
|
|
36
|
+
* Re-entering the page (fresh navigation, e.g. from the menu) re-snapshots the
|
|
37
|
+
* current URL query so deep links still work.
|
|
38
|
+
*/
|
|
39
|
+
export function useRouteQueryDefaults<TQuery extends object>(parsers: RouteQueryParsers<TQuery>) {
|
|
40
|
+
const route = useRoute()
|
|
41
|
+
const queryDefaults = ref<Partial<TQuery>>(resolveRouteDefaults(route.query, parsers))
|
|
42
|
+
|
|
43
|
+
function sync(): void {
|
|
44
|
+
queryDefaults.value = resolveRouteDefaults(route.query, parsers)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
onMounted(sync)
|
|
48
|
+
onActivated(sync)
|
|
49
|
+
|
|
50
|
+
return { queryDefaults }
|
|
51
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { routeStatus } from './routeQuery'
|
|
2
|
+
import { type RouteQueryParsers, useRouteQueryDefaults } from './useRouteQueryDefaults'
|
|
3
|
+
|
|
4
|
+
interface Query {
|
|
5
|
+
status?: 'active' | 'suspended'
|
|
6
|
+
team?: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const parsers: RouteQueryParsers<Query> = {
|
|
10
|
+
status: routeStatus,
|
|
11
|
+
team: (value) => (typeof value === 'string' ? value : undefined),
|
|
12
|
+
}
|
|
13
|
+
useRouteQueryDefaults(parsers)
|
|
14
|
+
|
|
15
|
+
// @ts-expect-error route mappings must target a declared query field
|
|
16
|
+
useRouteQueryDefaults<Query>({ missing: routeStatus })
|
|
17
|
+
|
|
18
|
+
// @ts-expect-error parser output must match its query field type
|
|
19
|
+
useRouteQueryDefaults<Query>({ status: (value) => (value === 'pending' ? 'pending' : undefined) })
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// apps/admin/src/styles/element/index.scss
|
|
2
|
+
// 风格 A(Linear/Vercel)Element Plus 主题入口
|
|
3
|
+
// 只覆盖 @forward 公开变量,派生色由 SCSS mix-color 自动算
|
|
4
|
+
// 注:Element Plus 变量是 $border-color,不是 $border
|
|
5
|
+
@forward 'element-plus/theme-chalk/src/common/var.scss' with (
|
|
6
|
+
$colors: (
|
|
7
|
+
'primary': (
|
|
8
|
+
'base': #5e6ad2,
|
|
9
|
+
),
|
|
10
|
+
),
|
|
11
|
+
$border-color: (
|
|
12
|
+
'': #e2e8f0,
|
|
13
|
+
'light': #f1f5f9,
|
|
14
|
+
'lighter': #f8fafc,
|
|
15
|
+
'extra-light': #ffffff,
|
|
16
|
+
'dark': #cbd5e1,
|
|
17
|
+
'darker': #475569,
|
|
18
|
+
),
|
|
19
|
+
$border-radius: (
|
|
20
|
+
'base': 8px,
|
|
21
|
+
'small': 4px,
|
|
22
|
+
'round': 9999px,
|
|
23
|
+
),
|
|
24
|
+
$font-family: (
|
|
25
|
+
'': (
|
|
26
|
+
'Inter',
|
|
27
|
+
'PingFang SC',
|
|
28
|
+
'Microsoft YaHei',
|
|
29
|
+
system-ui,
|
|
30
|
+
sans-serif,
|
|
31
|
+
),
|
|
32
|
+
)
|
|
33
|
+
);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
color-scheme: light;
|
|
3
|
+
font-family:
|
|
4
|
+
'Inter', 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans CN', system-ui, sans-serif;
|
|
5
|
+
color: var(--el-text-color-primary);
|
|
6
|
+
background: var(--og-page-bg);
|
|
7
|
+
font-synthesis: none;
|
|
8
|
+
text-rendering: optimizeLegibility;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
:root.dark {
|
|
12
|
+
color-scheme: dark;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
* {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
html,
|
|
20
|
+
body,
|
|
21
|
+
#app {
|
|
22
|
+
min-width: 320px;
|
|
23
|
+
min-height: 100%;
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
min-height: 100vh;
|
|
29
|
+
background: var(--og-page-bg);
|
|
30
|
+
font-family:
|
|
31
|
+
'Inter', 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans CN', system-ui, sans-serif;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
button,
|
|
35
|
+
input,
|
|
36
|
+
textarea,
|
|
37
|
+
select {
|
|
38
|
+
font: inherit;
|
|
39
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
.admin-shell {
|
|
2
|
+
min-height: 100vh;
|
|
3
|
+
background: var(--og-page-bg);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.admin-shell__body {
|
|
7
|
+
display: grid;
|
|
8
|
+
grid-template-columns: var(--og-sidebar-width) minmax(0, 1fr);
|
|
9
|
+
min-height: calc(100vh - var(--og-topbar-height));
|
|
10
|
+
transition: grid-template-columns 0.2s ease;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.admin-shell__body.is-collapsed {
|
|
14
|
+
grid-template-columns: var(--og-sidebar-width-collapsed) minmax(0, 1fr);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.admin-shell__sidebar {
|
|
18
|
+
background: var(--og-sidebar-bg);
|
|
19
|
+
border-right: 1px solid var(--el-border-color);
|
|
20
|
+
overflow: hidden;
|
|
21
|
+
position: sticky;
|
|
22
|
+
top: var(--og-topbar-height);
|
|
23
|
+
align-self: start;
|
|
24
|
+
height: calc(100vh - var(--og-topbar-height));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.admin-shell__main {
|
|
28
|
+
min-width: 0;
|
|
29
|
+
min-height: calc(100vh - var(--og-topbar-height));
|
|
30
|
+
background: var(--og-page-bg);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.admin-shell__content {
|
|
34
|
+
width: 100%;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
padding: 12px 14px 20px;
|
|
37
|
+
background: var(--og-page-bg);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.table-page {
|
|
41
|
+
display: grid;
|
|
42
|
+
gap: 12px;
|
|
43
|
+
min-width: 0;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media (min-width: 861px) and (min-height: 720px) {
|
|
47
|
+
.admin-shell {
|
|
48
|
+
height: 100vh;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.admin-shell__body {
|
|
53
|
+
height: calc(100vh - var(--og-topbar-height));
|
|
54
|
+
min-height: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.admin-shell__main {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
height: 100%;
|
|
61
|
+
min-height: 0;
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.admin-shell__content {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex: 1;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
min-height: 0;
|
|
70
|
+
overflow: auto;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.admin-shell__route-view {
|
|
74
|
+
display: flex;
|
|
75
|
+
flex: 1;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
min-height: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.admin-shell__route-view > .table-page {
|
|
81
|
+
flex: 1;
|
|
82
|
+
grid-template-rows: minmax(0, 1fr);
|
|
83
|
+
min-height: 0;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.table-page > .table {
|
|
87
|
+
min-width: 0;
|
|
88
|
+
min-height: 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@media (max-width: 860px) {
|
|
93
|
+
.admin-shell__body,
|
|
94
|
+
.admin-shell__body.is-collapsed {
|
|
95
|
+
display: block;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.admin-shell__sidebar {
|
|
99
|
+
display: none;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.admin-shell__main {
|
|
103
|
+
min-height: calc(100vh - var(--og-topbar-height));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.admin-shell__content {
|
|
107
|
+
padding: 12px 12px 18px;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
@media (max-width: 620px) {
|
|
112
|
+
.admin-shell__content {
|
|
113
|
+
padding: 10px 10px 16px;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/* apps/admin/src/styles/shell.css
|
|
2
|
+
风格 A(Linear/Vercel)的 shell / 卡片 / 表格 / KPI 应用层主题。
|
|
3
|
+
影响范围:sidebar / topbar / page body / KPI 卡 / 用户列表卡
|
|
4
|
+
不影响 Element Plus 组件(由 element/index.scss 接管)。*/
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--og-page-bg: #f8fafc;
|
|
8
|
+
--og-surface: #ffffff;
|
|
9
|
+
--og-surface-muted: #f1f5f9;
|
|
10
|
+
--og-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.06);
|
|
11
|
+
--og-shadow-card-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.12);
|
|
12
|
+
--og-shadow-topbar: 0 1px 0 rgba(15, 23, 42, 0.04);
|
|
13
|
+
|
|
14
|
+
--og-sidebar-width: 240px;
|
|
15
|
+
--og-sidebar-width-collapsed: 64px;
|
|
16
|
+
--og-topbar-height: 56px;
|
|
17
|
+
|
|
18
|
+
--og-sidebar-bg: #ffffff;
|
|
19
|
+
--og-sidebar-text: #475569;
|
|
20
|
+
--og-sidebar-text-active: #0f172a;
|
|
21
|
+
--og-sidebar-text-muted: #94a3b8;
|
|
22
|
+
--og-sidebar-hover-bg: #f1f5f9;
|
|
23
|
+
--og-sidebar-active-bg: var(--el-color-primary-light-9);
|
|
24
|
+
|
|
25
|
+
--og-topbar-bg: #ffffff;
|
|
26
|
+
--og-workspace-tabs-bg: #f5f6f8;
|
|
27
|
+
--og-workspace-tabs-active-bg: #ffffff;
|
|
28
|
+
--og-workspace-divider: #dde2e8;
|
|
29
|
+
--og-workspace-surface: #ffffff;
|
|
30
|
+
--og-primary-soft: var(--el-color-primary-light-9);
|
|
31
|
+
--og-primary-text: var(--el-color-primary-dark-2);
|
|
32
|
+
--og-text-muted: #64748b;
|
|
33
|
+
--og-scrollbar-thumb: #cbd5e1;
|
|
34
|
+
|
|
35
|
+
--og-success: #10b981;
|
|
36
|
+
--og-warn: #f59e0b;
|
|
37
|
+
--og-danger: #ef4444;
|
|
38
|
+
|
|
39
|
+
--og-radius: 8px;
|
|
40
|
+
--og-radius-sm: 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
html,
|
|
44
|
+
body {
|
|
45
|
+
font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.og-mono {
|
|
49
|
+
font-family: 'JetBrains Mono', ui-monospace, monospace;
|
|
50
|
+
font-variant-numeric: tabular-nums;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.og-card {
|
|
54
|
+
background: var(--og-surface);
|
|
55
|
+
border: 1px solid var(--el-border-color);
|
|
56
|
+
border-radius: var(--og-radius);
|
|
57
|
+
box-shadow: var(--og-shadow-card);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.og-kpi {
|
|
61
|
+
background: var(--og-surface);
|
|
62
|
+
border: 1px solid var(--el-border-color);
|
|
63
|
+
border-radius: var(--og-radius);
|
|
64
|
+
box-shadow: var(--og-shadow-card);
|
|
65
|
+
padding: 20px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.og-kpi__label {
|
|
69
|
+
font-size: 11px;
|
|
70
|
+
font-weight: 500;
|
|
71
|
+
color: var(--og-sidebar-text-muted);
|
|
72
|
+
text-transform: uppercase;
|
|
73
|
+
letter-spacing: 0.06em;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.og-kpi__num {
|
|
77
|
+
font-size: 28px;
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
letter-spacing: -0.02em;
|
|
80
|
+
font-variant-numeric: tabular-nums;
|
|
81
|
+
margin-top: 8px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.og-chip {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
border-radius: 9999px;
|
|
88
|
+
padding: 2px 10px;
|
|
89
|
+
font-size: 12px;
|
|
90
|
+
font-weight: 500;
|
|
91
|
+
line-height: 18px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.og-chip--success {
|
|
95
|
+
background: #ecfdf5;
|
|
96
|
+
color: #047857;
|
|
97
|
+
}
|
|
98
|
+
.og-chip--warn {
|
|
99
|
+
background: #fffbeb;
|
|
100
|
+
color: #b45309;
|
|
101
|
+
}
|
|
102
|
+
.og-chip--danger {
|
|
103
|
+
background: #fef2f2;
|
|
104
|
+
color: #b91c1c;
|
|
105
|
+
}
|
|
106
|
+
.og-chip--primary {
|
|
107
|
+
background: var(--og-primary-soft);
|
|
108
|
+
color: var(--og-primary-text);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/* 暗色模式 — 应用层 og-* 变量重写
|
|
112
|
+
与 :root.light 共用 base 变量名,selectors cascade 后覆盖值。 */
|
|
113
|
+
:root.dark {
|
|
114
|
+
--og-page-bg: #09090b;
|
|
115
|
+
--og-surface: #161619;
|
|
116
|
+
--og-surface-muted: #1a1a1e;
|
|
117
|
+
--og-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.62);
|
|
118
|
+
--og-shadow-card-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.72);
|
|
119
|
+
--og-shadow-topbar: 0 1px 0 rgba(0, 0, 0, 0.78);
|
|
120
|
+
|
|
121
|
+
--og-sidebar-bg: #0d0d0f;
|
|
122
|
+
--og-sidebar-text: #b5b5bd;
|
|
123
|
+
--og-sidebar-text-active: #f5f5f7;
|
|
124
|
+
--og-sidebar-text-muted: #777780;
|
|
125
|
+
--og-sidebar-hover-bg: #17171a;
|
|
126
|
+
--og-sidebar-active-bg: color-mix(in srgb, var(--el-color-primary) 18%, transparent);
|
|
127
|
+
|
|
128
|
+
--og-topbar-bg: #0d0d0f;
|
|
129
|
+
--og-workspace-tabs-bg: #121214;
|
|
130
|
+
--og-workspace-tabs-active-bg: #161619;
|
|
131
|
+
--og-workspace-divider: #242429;
|
|
132
|
+
--og-workspace-surface: #121214;
|
|
133
|
+
--og-primary-soft: color-mix(in srgb, var(--el-color-primary) 18%, transparent);
|
|
134
|
+
--og-primary-text: var(--el-color-primary-dark-2);
|
|
135
|
+
--og-text-muted: #9b9ba3;
|
|
136
|
+
--og-scrollbar-thumb: #2b2b31;
|
|
137
|
+
|
|
138
|
+
--el-bg-color-page: #09090b;
|
|
139
|
+
--el-bg-color: #121214;
|
|
140
|
+
--el-bg-color-overlay: #161619;
|
|
141
|
+
--el-fill-color-blank: #121214;
|
|
142
|
+
--el-fill-color-extra-light: #161619;
|
|
143
|
+
--el-fill-color-lighter: #1a1a1e;
|
|
144
|
+
--el-fill-color-light: #202025;
|
|
145
|
+
--el-fill-color: #25252b;
|
|
146
|
+
--el-fill-color-dark: #2c2c33;
|
|
147
|
+
--el-fill-color-darker: #34343c;
|
|
148
|
+
--el-border-color-extra-light: #242429;
|
|
149
|
+
--el-border-color-lighter: #2b2b31;
|
|
150
|
+
--el-border-color-light: #33333a;
|
|
151
|
+
--el-border-color: #3a3a43;
|
|
152
|
+
--el-border-color-dark: #474750;
|
|
153
|
+
--el-border-color-darker: #54545f;
|
|
154
|
+
--el-text-color-primary: #f5f5f7;
|
|
155
|
+
--el-text-color-regular: #d3d3d8;
|
|
156
|
+
--el-text-color-secondary: #9b9ba3;
|
|
157
|
+
--el-text-color-placeholder: #72727a;
|
|
158
|
+
--el-text-color-disabled: #55555c;
|
|
159
|
+
--el-box-shadow: 0 12px 32px 4px rgba(0, 0, 0, 0.58), 0 8px 20px rgba(0, 0, 0, 0.74);
|
|
160
|
+
--el-box-shadow-light: 0 0 12px rgba(0, 0, 0, 0.68);
|
|
161
|
+
--el-box-shadow-lighter: 0 0 6px rgba(0, 0, 0, 0.62);
|
|
162
|
+
--el-box-shadow-dark:
|
|
163
|
+
0 16px 48px 16px rgba(0, 0, 0, 0.74), 0 12px 32px rgba(0, 0, 0, 0.88), 0 8px 16px -8px #000;
|
|
164
|
+
--el-mask-color: rgba(0, 0, 0, 0.72);
|
|
165
|
+
--el-mask-color-extra-light: rgba(0, 0, 0, 0.45);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:root.dark .og-card,
|
|
169
|
+
:root.dark .og-kpi {
|
|
170
|
+
background: var(--og-surface);
|
|
171
|
+
border-color: var(--el-border-color);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/* Element Plus sets this variable again on each dark card. Keep cards within
|
|
175
|
+
the same ink-black surface hierarchy instead of falling back to its default. */
|
|
176
|
+
:root.dark .el-card {
|
|
177
|
+
--el-card-bg-color: var(--el-bg-color-overlay);
|
|
178
|
+
--el-fill-color-blank: var(--el-card-bg-color);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
:root.dark .og-chip--success {
|
|
182
|
+
background: rgba(16, 185, 129, 0.18);
|
|
183
|
+
color: #6ee7b7;
|
|
184
|
+
}
|
|
185
|
+
:root.dark .og-chip--warn {
|
|
186
|
+
background: rgba(245, 158, 11, 0.18);
|
|
187
|
+
color: #fcd34d;
|
|
188
|
+
}
|
|
189
|
+
:root.dark .og-chip--danger {
|
|
190
|
+
background: rgba(239, 68, 68, 0.18);
|
|
191
|
+
color: #fca5a5;
|
|
192
|
+
}
|
|
193
|
+
:root.dark .og-chip--primary {
|
|
194
|
+
background: var(--og-primary-soft);
|
|
195
|
+
color: var(--og-primary-text);
|
|
196
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* Source-package development compiles component SFC styles directly. */
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { OgFormPermissions, OgFormSchema } from '@origen-ui/form/core'
|
|
2
|
+
import type { PermissionChecker } from '@origen-ui/shared'
|
|
3
|
+
|
|
4
|
+
export interface OgFormTemplateOptions<TModel extends object, TSubmit extends object = TModel> {
|
|
5
|
+
schema: OgFormSchema<TModel>
|
|
6
|
+
permissions: PermissionChecker
|
|
7
|
+
transformSubmit?: (model: Record<string, unknown>) => TSubmit
|
|
8
|
+
validateSubmit?: (model: TSubmit) => void | Promise<void>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface OgFormTemplate<TModel extends object, TSubmit extends object = TModel> {
|
|
12
|
+
schema: OgFormSchema<TModel>
|
|
13
|
+
permissions: OgFormPermissions
|
|
14
|
+
modelTransform?: (model: Record<string, unknown>) => TSubmit
|
|
15
|
+
submit: (model: Record<string, unknown>, signal?: AbortSignal) => Promise<TSubmit>
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function assertNotAborted(signal?: AbortSignal): void {
|
|
19
|
+
if (signal?.aborted) throw new DOMException('Request aborted', 'AbortError')
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Local schema convention: schema.sections fields declare permission/linkage/optionsApi; this
|
|
24
|
+
* helper only wires the checker and keeps submit conversion/validation explicit.
|
|
25
|
+
*/
|
|
26
|
+
export function createOgFormTemplate<TModel extends object, TSubmit extends object = TModel>(
|
|
27
|
+
options: OgFormTemplateOptions<TModel, TSubmit>,
|
|
28
|
+
): OgFormTemplate<TModel, TSubmit> {
|
|
29
|
+
const transform =
|
|
30
|
+
options.transformSubmit ?? ((model: Record<string, unknown>) => model as TSubmit)
|
|
31
|
+
return {
|
|
32
|
+
schema: {
|
|
33
|
+
sections: options.schema.sections.map((section) => ({
|
|
34
|
+
...section,
|
|
35
|
+
fields: [...section.fields],
|
|
36
|
+
})),
|
|
37
|
+
},
|
|
38
|
+
permissions: { has: options.permissions },
|
|
39
|
+
modelTransform: transform,
|
|
40
|
+
async submit(model, signal) {
|
|
41
|
+
assertNotAborted(signal)
|
|
42
|
+
const submitModel = transform(model)
|
|
43
|
+
await options.validateSubmit?.(submitModel)
|
|
44
|
+
assertNotAborted(signal)
|
|
45
|
+
return submitModel
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
}
|