create-react-admin-template 0.0.0-stage → 0.1.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/README.md +46 -2
- package/bin/create.mjs +5 -0
- package/package.json +22 -4
- package/template/.dockerignore +12 -0
- package/template/.editorconfig +12 -0
- package/template/.env +14 -0
- package/template/.env.development +5 -0
- package/template/.env.production +2 -0
- package/template/.env.test +5 -0
- package/template/.github/workflows/ci.yml +40 -0
- package/template/.gitlab-ci.yml +208 -0
- package/template/.husky/commit-msg +1 -0
- package/template/.husky/pre-commit +1 -0
- package/template/.nvmrc +1 -0
- package/template/.prettierignore +11 -0
- package/template/.prettierrc +47 -0
- package/template/Dockerfile +16 -0
- package/template/README.md +372 -0
- package/template/build/advancedTable.ts +103 -0
- package/template/build/environment.ts +150 -0
- package/template/commitlint.config.js +32 -0
- package/template/components.json +21 -0
- package/template/deploy/README.md +132 -0
- package/template/deploy/host-nginx/react-admin-api.conf +14 -0
- package/template/deploy/host-nginx/react-admin-web.conf +8 -0
- package/template/deploy/nginx.conf +38 -0
- package/template/docs/activity-status.md +217 -0
- package/template/docs/audit-logs.md +158 -0
- package/template/docs/authentication-adapters.md +219 -0
- package/template/docs/browser-security.md +58 -0
- package/template/docs/bundle-budgets.md +65 -0
- package/template/docs/component-source-governance.md +99 -0
- package/template/docs/data-masking.md +169 -0
- package/template/docs/enterprise-scaffold.md +208 -0
- package/template/docs/feature-data-template.md +227 -0
- package/template/docs/feature-flags.md +169 -0
- package/template/docs/file-capabilities.md +196 -0
- package/template/docs/locale-and-i18n.md +132 -0
- package/template/docs/mutation-idempotency.md +24 -0
- package/template/docs/optional-editors.md +203 -0
- package/template/docs/page-feedback.md +83 -0
- package/template/docs/query-data-conventions.md +178 -0
- package/template/docs/realtime-collaboration.md +140 -0
- package/template/docs/reporting-printing-templates.md +156 -0
- package/template/docs/scaffold-capability-roadmap.md +226 -0
- package/template/docs/scaffold-guide.md +443 -0
- package/template/docs/template-changelog.md +30 -0
- package/template/docs/template-versioning.md +26 -0
- package/template/docs/tenant-workspace-context.md +147 -0
- package/template/docs/unsaved-changes.md +58 -0
- package/template/docs/white-label.md +102 -0
- package/template/eslint.config.js +697 -0
- package/template/gitignore +39 -0
- package/template/index.html +26 -0
- package/template/knip.config.ts +42 -0
- package/template/lint-staged.config.js +8 -0
- package/template/package.json +133 -0
- package/template/pnpm-lock.yaml +8694 -0
- package/template/public/favicon.ico +0 -0
- package/template/public/logo.svg +1 -0
- package/template/public/runtime-config.json +49 -0
- package/template/scaffold.template.json +5 -0
- package/template/src/Application.tsx +114 -0
- package/template/src/api/ApiError.ts +33 -0
- package/template/src/api/activity/ActivityProvider.tsx +167 -0
- package/template/src/api/activity/access.ts +13 -0
- package/template/src/api/activity/errors.ts +17 -0
- package/template/src/api/activity/index.ts +67 -0
- package/template/src/api/activity/model.ts +227 -0
- package/template/src/api/activity/query.ts +163 -0
- package/template/src/api/activity/source.ts +16 -0
- package/template/src/api/activity/subscription.ts +292 -0
- package/template/src/api/activity/transports.ts +271 -0
- package/template/src/api/activity/types.ts +402 -0
- package/template/src/api/authClient.ts +134 -0
- package/template/src/api/authSession.ts +307 -0
- package/template/src/api/clients/configureApiClient.ts +62 -0
- package/template/src/api/clients/httpStatus.ts +4 -0
- package/template/src/api/config/services.json +7 -0
- package/template/src/api/demoAuthClient.ts +46 -0
- package/template/src/api/enums/EnumCatalogProvider.tsx +169 -0
- package/template/src/api/enums/EnumDictionary.ts +55 -0
- package/template/src/api/enums/access.ts +130 -0
- package/template/src/api/enums/catalog.ts +216 -0
- package/template/src/api/enums/errors.ts +21 -0
- package/template/src/api/enums/index.ts +48 -0
- package/template/src/api/enums/query.ts +82 -0
- package/template/src/api/enums/scope.ts +58 -0
- package/template/src/api/enums/types.ts +251 -0
- package/template/src/api/hooks/error.ts +198 -0
- package/template/src/api/hooks/index.ts +4 -0
- package/template/src/api/hooks/request.ts +99 -0
- package/template/src/api/hooks/requestId.ts +65 -0
- package/template/src/api/hooks/response.ts +22 -0
- package/template/src/api/hooks/types.ts +20 -0
- package/template/src/api/idempotency/index.ts +1 -0
- package/template/src/api/idempotency/key.ts +23 -0
- package/template/src/api/index.ts +14 -0
- package/template/src/api/metadata/MetadataProvider.tsx +37 -0
- package/template/src/api/metadata/index.ts +2 -0
- package/template/src/api/metadata/types.ts +30 -0
- package/template/src/api/parameters/GlobalParameterProvider.tsx +210 -0
- package/template/src/api/parameters/access.ts +117 -0
- package/template/src/api/parameters/catalog.ts +170 -0
- package/template/src/api/parameters/errors.ts +21 -0
- package/template/src/api/parameters/index.ts +53 -0
- package/template/src/api/parameters/query.ts +84 -0
- package/template/src/api/parameters/scope.ts +58 -0
- package/template/src/api/parameters/types.ts +214 -0
- package/template/src/api/query/index.ts +13 -0
- package/template/src/api/query/keys.ts +155 -0
- package/template/src/api/query/mutation.ts +48 -0
- package/template/src/api/query/react.ts +36 -0
- package/template/src/api/query/scope.ts +38 -0
- package/template/src/api/query/types.ts +147 -0
- package/template/src/api/types.ts +144 -0
- package/template/src/application/types.ts +52 -0
- package/template/src/auditLogs/errors.ts +17 -0
- package/template/src/auditLogs/export.ts +85 -0
- package/template/src/auditLogs/index.ts +54 -0
- package/template/src/auditLogs/model.ts +526 -0
- package/template/src/auditLogs/query.ts +113 -0
- package/template/src/auditLogs/react.ts +36 -0
- package/template/src/auditLogs/source.ts +51 -0
- package/template/src/auditLogs/types.ts +357 -0
- package/template/src/authentication/controller.ts +351 -0
- package/template/src/authentication/index.ts +8 -0
- package/template/src/authentication/redirect.ts +72 -0
- package/template/src/authentication/types.ts +300 -0
- package/template/src/bootstrap.tsx +96 -0
- package/template/src/components/AppDataTable/AppDataTable.tsx +74 -0
- package/template/src/components/AppDataTable/index.ts +2 -0
- package/template/src/components/AppDataTable/types.ts +27 -0
- package/template/src/components/AppDialog/AppConfirmDialog.tsx +44 -0
- package/template/src/components/AppDialog/AppDialog.tsx +113 -0
- package/template/src/components/AppDialog/index.ts +3 -0
- package/template/src/components/AppDialog/messages.tsx +22 -0
- package/template/src/components/AppDialog/types.ts +53 -0
- package/template/src/components/AppPageForm/AppPageForm.tsx +21 -0
- package/template/src/components/AppPageForm/PageForm.tsx +765 -0
- package/template/src/components/AppPageForm/SOURCE.md +26 -0
- package/template/src/components/AppPageForm/config.ts +253 -0
- package/template/src/components/AppPageForm/controller.ts +580 -0
- package/template/src/components/AppPageForm/index.ts +2 -0
- package/template/src/components/AppPageForm/messages.ts +90 -0
- package/template/src/components/AppPageForm/optionUtils.ts +91 -0
- package/template/src/components/AppPageForm/options.ts +397 -0
- package/template/src/components/AppPageForm/query.ts +44 -0
- package/template/src/components/AppPageForm/style.css +119 -0
- package/template/src/components/AppPageForm/types.ts +632 -0
- package/template/src/components/AppPageForm/validation.ts +233 -0
- package/template/src/components/AppTable/AppTable.tsx +26 -0
- package/template/src/components/AppTable/SOURCE.md +72 -0
- package/template/src/components/AppTable/cell/customCell/TableCellLayer.tsx +73 -0
- package/template/src/components/AppTable/cell/customCell/actions/ActionDropdownCell.tsx +104 -0
- package/template/src/components/AppTable/cell/customCell/cellLayer.ts +358 -0
- package/template/src/components/AppTable/cell/customCell/componentProps.ts +30 -0
- package/template/src/components/AppTable/cell/customCell/date/TemporalPickerEditor.tsx +54 -0
- package/template/src/components/AppTable/cell/customCell/index.ts +2 -0
- package/template/src/components/AppTable/cell/customCell/select/SelectCellEditor.tsx +225 -0
- package/template/src/components/AppTable/cell/customCell/tableCellLayer.css +20 -0
- package/template/src/components/AppTable/cell/customCell/tooltip/TooltipCell.tsx +45 -0
- package/template/src/components/AppTable/cell/customCell/types.ts +63 -0
- package/template/src/components/AppTable/cell/customCell/useCellLayerLifecycle.ts +111 -0
- package/template/src/components/AppTable/cell/frameworkCell/TableCellComponentLayer.tsx +40 -0
- package/template/src/components/AppTable/cell/frameworkCell/cellComponentSession.ts +203 -0
- package/template/src/components/AppTable/cell/frameworkCell/index.ts +3 -0
- package/template/src/components/AppTable/cell/index.ts +2 -0
- package/template/src/components/AppTable/columns/TableColumnEditor.tsx +257 -0
- package/template/src/components/AppTable/columns/index.ts +1 -0
- package/template/src/components/AppTable/columns/useTableColumnPreferenceActions.ts +85 -0
- package/template/src/components/AppTable/config/defaults.ts +46 -0
- package/template/src/components/AppTable/config/index.ts +2 -0
- package/template/src/components/AppTable/config/license.ts +39 -0
- package/template/src/components/AppTable/config/resolver.ts +25 -0
- package/template/src/components/AppTable/config/types.ts +377 -0
- package/template/src/components/AppTable/engine/bottom/index.ts +1 -0
- package/template/src/components/AppTable/engine/bottom/types.ts +14 -0
- package/template/src/components/AppTable/engine/cell/constants.ts +32 -0
- package/template/src/components/AppTable/engine/cell/customCell/actions/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/actions/renderer.ts +162 -0
- package/template/src/components/AppTable/engine/cell/customCell/date/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/date/renderer.ts +116 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/editorBounds.ts +57 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/editorTrigger.ts +46 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/index.ts +3 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/layerEditor.ts +244 -0
- package/template/src/components/AppTable/engine/cell/customCell/index.ts +7 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/columnRenderer.ts +245 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/confirmInput.ts +57 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/display.ts +78 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/index.ts +3 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/itemList.ts +60 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/links.ts +131 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/selection.ts +41 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/shared.ts +71 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/step.ts +37 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/switch.ts +45 -0
- package/template/src/components/AppTable/engine/cell/customCell/select/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/select/renderer.ts +33 -0
- package/template/src/components/AppTable/engine/cell/customCell/tooltip/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/tooltip/tooltip.ts +94 -0
- package/template/src/components/AppTable/engine/cell/customCell/types.ts +82 -0
- package/template/src/components/AppTable/engine/cell/formatting.ts +355 -0
- package/template/src/components/AppTable/engine/cell/formula.ts +145 -0
- package/template/src/components/AppTable/engine/cell/index.ts +7 -0
- package/template/src/components/AppTable/engine/cell/multiSelect.ts +96 -0
- package/template/src/components/AppTable/engine/cell/options.ts +339 -0
- package/template/src/components/AppTable/engine/cell/types.ts +53 -0
- package/template/src/components/AppTable/engine/columns/column.ts +430 -0
- package/template/src/components/AppTable/engine/columns/config/columns.ts +33 -0
- package/template/src/components/AppTable/engine/columns/config/index.ts +4 -0
- package/template/src/components/AppTable/engine/columns/config/mutation.ts +138 -0
- package/template/src/components/AppTable/engine/columns/config/temporal.ts +11 -0
- package/template/src/components/AppTable/engine/columns/config/validation.ts +106 -0
- package/template/src/components/AppTable/engine/columns/constants.ts +6 -0
- package/template/src/components/AppTable/engine/columns/gridColumns.ts +332 -0
- package/template/src/components/AppTable/engine/columns/index.ts +4 -0
- package/template/src/components/AppTable/engine/columns/rendererPolicies.ts +129 -0
- package/template/src/components/AppTable/engine/component/resolver.ts +272 -0
- package/template/src/components/AppTable/engine/component/types.ts +384 -0
- package/template/src/components/AppTable/engine/config/constants.ts +33 -0
- package/template/src/components/AppTable/engine/config/grid/compiler.ts +65 -0
- package/template/src/components/AppTable/engine/config/grid/defaults.ts +82 -0
- package/template/src/components/AppTable/engine/config/grid/ownership.ts +35 -0
- package/template/src/components/AppTable/engine/config/grid/runtimeDelta.ts +34 -0
- package/template/src/components/AppTable/engine/config/grid/types.ts +30 -0
- package/template/src/components/AppTable/engine/pagination/config.ts +75 -0
- package/template/src/components/AppTable/engine/pagination/constants.ts +5 -0
- package/template/src/components/AppTable/engine/pagination/index.ts +3 -0
- package/template/src/components/AppTable/engine/pagination/types.ts +70 -0
- package/template/src/components/AppTable/engine/preference/index.ts +2 -0
- package/template/src/components/AppTable/engine/preference/preference.ts +535 -0
- package/template/src/components/AppTable/engine/preference/types.ts +28 -0
- package/template/src/components/AppTable/engine/right/index.ts +1 -0
- package/template/src/components/AppTable/engine/right/types.ts +18 -0
- package/template/src/components/AppTable/engine/search/config.ts +64 -0
- package/template/src/components/AppTable/engine/search/constants.ts +8 -0
- package/template/src/components/AppTable/engine/search/index.ts +7 -0
- package/template/src/components/AppTable/engine/search/localQuery.ts +145 -0
- package/template/src/components/AppTable/engine/search/query.ts +203 -0
- package/template/src/components/AppTable/engine/search/remoteQuery.ts +99 -0
- package/template/src/components/AppTable/engine/search/searchInteraction.ts +46 -0
- package/template/src/components/AppTable/engine/search/types.ts +155 -0
- package/template/src/components/AppTable/engine/selection/config.ts +13 -0
- package/template/src/components/AppTable/engine/selection/index.ts +4 -0
- package/template/src/components/AppTable/engine/selection/selection.ts +357 -0
- package/template/src/components/AppTable/engine/selection/selectionHeader.ts +88 -0
- package/template/src/components/AppTable/engine/selection/types.ts +66 -0
- package/template/src/components/AppTable/engine/shared/action.ts +11 -0
- package/template/src/components/AppTable/engine/shared/constants.ts +2 -0
- package/template/src/components/AppTable/engine/shared/decimal.ts +114 -0
- package/template/src/components/AppTable/engine/shared/feedback.ts +62 -0
- package/template/src/components/AppTable/engine/shared/index.ts +13 -0
- package/template/src/components/AppTable/engine/shared/interaction.ts +55 -0
- package/template/src/components/AppTable/engine/shared/messages.ts +161 -0
- package/template/src/components/AppTable/engine/shared/row.ts +32 -0
- package/template/src/components/AppTable/engine/shared/scheduler.ts +17 -0
- package/template/src/components/AppTable/engine/shared/tableKey.ts +31 -0
- package/template/src/components/AppTable/engine/shared/theme.ts +196 -0
- package/template/src/components/AppTable/engine/shared/treeRows.ts +155 -0
- package/template/src/components/AppTable/engine/shared/types.ts +58 -0
- package/template/src/components/AppTable/engine/shared/valueSnapshot.ts +46 -0
- package/template/src/components/AppTable/engine/summary/config/export.ts +117 -0
- package/template/src/components/AppTable/engine/summary/config/index.ts +3 -0
- package/template/src/components/AppTable/engine/summary/config/summary.ts +62 -0
- package/template/src/components/AppTable/engine/summary/config/types.ts +93 -0
- package/template/src/components/AppTable/engine/summary/constants.ts +13 -0
- package/template/src/components/AppTable/engine/summary/excelJs.ts +133 -0
- package/template/src/components/AppTable/engine/summary/export.ts +311 -0
- package/template/src/components/AppTable/engine/summary/index.ts +6 -0
- package/template/src/components/AppTable/engine/summary/selectionSum.ts +92 -0
- package/template/src/components/AppTable/engine/summary/summary.ts +457 -0
- package/template/src/components/AppTable/engine/table/clipboard/index.ts +1 -0
- package/template/src/components/AppTable/engine/table/clipboard/transfer.ts +9 -0
- package/template/src/components/AppTable/engine/table/controller/TableController.ts +802 -0
- package/template/src/components/AppTable/engine/table/controller/errors.ts +106 -0
- package/template/src/components/AppTable/engine/table/controller/index.ts +4 -0
- package/template/src/components/AppTable/engine/table/controller/latestAbortableTask.ts +33 -0
- package/template/src/components/AppTable/engine/table/controller/tableDataReplacement.ts +60 -0
- package/template/src/components/AppTable/engine/table/controller/tableDomainConfiguration.ts +94 -0
- package/template/src/components/AppTable/engine/table/controller/tableEditingCommands.ts +163 -0
- package/template/src/components/AppTable/engine/table/controller/tableGridHost.ts +324 -0
- package/template/src/components/AppTable/engine/table/controller/tableIdentity.ts +68 -0
- package/template/src/components/AppTable/engine/table/controller/tableMutationPipeline.ts +79 -0
- package/template/src/components/AppTable/engine/table/controller/tableQueryCoordinator.ts +187 -0
- package/template/src/components/AppTable/engine/table/controller/tableReportingCoordinator.ts +143 -0
- package/template/src/components/AppTable/engine/table/controller/tableSaveCoordinator.ts +227 -0
- package/template/src/components/AppTable/engine/table/controller/tableSaveValidation.ts +29 -0
- package/template/src/components/AppTable/engine/table/controller/tableSnapshot.ts +58 -0
- package/template/src/components/AppTable/engine/table/controller/types.ts +202 -0
- package/template/src/components/AppTable/engine/table/editing/baselineStore.ts +134 -0
- package/template/src/components/AppTable/engine/table/editing/changeSet.ts +492 -0
- package/template/src/components/AppTable/engine/table/editing/changeSetSettlement.ts +633 -0
- package/template/src/components/AppTable/engine/table/editing/commitResultIndex.ts +75 -0
- package/template/src/components/AppTable/engine/table/editing/constants.ts +15 -0
- package/template/src/components/AppTable/engine/table/editing/dirtyCellIndex.ts +96 -0
- package/template/src/components/AppTable/engine/table/editing/index.ts +6 -0
- package/template/src/components/AppTable/engine/table/editing/mutation.ts +173 -0
- package/template/src/components/AppTable/engine/table/editing/rowKey.ts +10 -0
- package/template/src/components/AppTable/engine/table/editing/types.ts +404 -0
- package/template/src/components/AppTable/engine/table/editing/validation.ts +452 -0
- package/template/src/components/AppTable/engine/table/grid/cellMeta.ts +90 -0
- package/template/src/components/AppTable/engine/table/grid/handsontable.ts +25 -0
- package/template/src/components/AppTable/engine/table/grid/handsontableExtensions.d.ts +26 -0
- package/template/src/components/AppTable/engine/table/grid/index.ts +5 -0
- package/template/src/components/AppTable/engine/table/grid/moduleRegistry.ts +39 -0
- package/template/src/components/AppTable/engine/table/grid/runtime.ts +31 -0
- package/template/src/components/AppTable/engine/table/grid/types.ts +25 -0
- package/template/src/components/AppTable/engine/table/hooks/fixedEndHooks.ts +44 -0
- package/template/src/components/AppTable/engine/table/hooks/gridHooks.ts +108 -0
- package/template/src/components/AppTable/engine/table/hooks/headerHooks.ts +103 -0
- package/template/src/components/AppTable/engine/table/hooks/index.ts +3 -0
- package/template/src/components/AppTable/engine/table/index.ts +6 -0
- package/template/src/components/AppTable/engine/table/layout/constants.ts +2 -0
- package/template/src/components/AppTable/engine/table/layout/dropdownMenu.ts +89 -0
- package/template/src/components/AppTable/engine/table/layout/fixedColumns.ts +44 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlay.ts +90 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlayAccessibility.ts +104 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlayRenderer.ts +690 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlaySignature.ts +58 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndRuntime.ts +137 -0
- package/template/src/components/AppTable/engine/table/layout/handsontableDomAdapter.ts +40 -0
- package/template/src/components/AppTable/engine/table/layout/height.ts +72 -0
- package/template/src/components/AppTable/engine/table/layout/index.ts +14 -0
- package/template/src/components/AppTable/engine/table/layout/layoutScheduler.ts +60 -0
- package/template/src/components/AppTable/engine/table/layout/mergeCells.ts +146 -0
- package/template/src/components/AppTable/engine/table/layout/nestedHeaders.ts +271 -0
- package/template/src/components/AppTable/engine/table/layout/types.ts +10 -0
- package/template/src/components/AppTable/engine/toolbar/index.ts +1 -0
- package/template/src/components/AppTable/engine/toolbar/types.ts +56 -0
- package/template/src/components/AppTable/index.ts +11 -0
- package/template/src/components/AppTable/messages.ts +256 -0
- package/template/src/components/AppTable/pagination/TablePaginationBar.tsx +193 -0
- package/template/src/components/AppTable/pagination/index.ts +1 -0
- package/template/src/components/AppTable/pagination/paginationItems.ts +56 -0
- package/template/src/components/AppTable/preference/index.ts +1 -0
- package/template/src/components/AppTable/preference/useTablePreference.ts +208 -0
- package/template/src/components/AppTable/reporting/index.ts +1 -0
- package/template/src/components/AppTable/reporting/useTableReporting.ts +342 -0
- package/template/src/components/AppTable/search/TableSearchBar.tsx +301 -0
- package/template/src/components/AppTable/search/TableSearchConditionEditor.tsx +254 -0
- package/template/src/components/AppTable/search/TableSearchField.tsx +338 -0
- package/template/src/components/AppTable/search/TableSearchFields.tsx +65 -0
- package/template/src/components/AppTable/search/constants.ts +9 -0
- package/template/src/components/AppTable/search/index.ts +3 -0
- package/template/src/components/AppTable/search/tableSearchBar.css +164 -0
- package/template/src/components/AppTable/search/types.ts +7 -0
- package/template/src/components/AppTable/search/useTableQuery.ts +373 -0
- package/template/src/components/AppTable/selection/index.ts +1 -0
- package/template/src/components/AppTable/selection/useTableSelection.ts +188 -0
- package/template/src/components/AppTable/sensitiveData.tsx +41 -0
- package/template/src/components/AppTable/shared/styles.ts +2 -0
- package/template/src/components/AppTable/styles/index.css +6 -0
- package/template/src/components/AppTable/styles/tableComponent.css +297 -0
- package/template/src/components/AppTable/styles/theme.css +133 -0
- package/template/src/components/AppTable/table/components/TableComponent.tsx +567 -0
- package/template/src/components/AppTable/table/components/TableErrorFeedback.tsx +36 -0
- package/template/src/components/AppTable/table/components/TableGridViewport.tsx +85 -0
- package/template/src/components/AppTable/table/components/index.ts +2 -0
- package/template/src/components/AppTable/table/components/types.ts +90 -0
- package/template/src/components/AppTable/table/controller/configuration.ts +89 -0
- package/template/src/components/AppTable/table/controller/index.ts +2 -0
- package/template/src/components/AppTable/table/controller/useTableController.ts +155 -0
- package/template/src/components/AppTable/table/controller/useTableLifecycle.ts +97 -0
- package/template/src/components/AppTable/table/grid/index.ts +1 -0
- package/template/src/components/AppTable/table/grid/useTableGrid.ts +857 -0
- package/template/src/components/AppTable/table/grid/useTableGridRuntimeSettings.ts +49 -0
- package/template/src/components/AppTable/table/index.ts +4 -0
- package/template/src/components/AppTable/table/layout/TablePanels.tsx +389 -0
- package/template/src/components/AppTable/table/layout/index.ts +7 -0
- package/template/src/components/AppTable/table/layout/types.ts +3 -0
- package/template/src/components/AppTable/table/layout/useResizablePanel.ts +213 -0
- package/template/src/components/AppTable/table/layout/useTableAdaptiveHeight.ts +238 -0
- package/template/src/components/AppTable/table/layout/useTablePanels.ts +329 -0
- package/template/src/components/AppTable/table/layout/useTableTheme.ts +123 -0
- package/template/src/components/AppTable/toolbar/TableToolbar.tsx +336 -0
- package/template/src/components/AppTable/toolbar/index.ts +1 -0
- package/template/src/components/BrandLogo/BrandLogo.tsx +41 -0
- package/template/src/components/BrandLogo/index.ts +1 -0
- package/template/src/components/Can/Can.tsx +19 -0
- package/template/src/components/Can/index.ts +7 -0
- package/template/src/components/Can/types.ts +41 -0
- package/template/src/components/EnumBadge/EnumBadge.tsx +44 -0
- package/template/src/components/EnumBadge/index.ts +2 -0
- package/template/src/components/EnumBadge/types.ts +16 -0
- package/template/src/components/EnumText/EnumText.tsx +33 -0
- package/template/src/components/EnumText/index.ts +2 -0
- package/template/src/components/EnumText/types.ts +13 -0
- package/template/src/components/FilePreview/FilePreview.tsx +120 -0
- package/template/src/components/FilePreview/index.ts +11 -0
- package/template/src/components/FilePreview/preview.ts +88 -0
- package/template/src/components/FilePreview/types.ts +91 -0
- package/template/src/components/FileUpload/FileUpload.tsx +172 -0
- package/template/src/components/FileUpload/index.ts +2 -0
- package/template/src/components/FileUpload/types.ts +32 -0
- package/template/src/components/JsonEditor/JsonEditor.tsx +103 -0
- package/template/src/components/JsonEditor/index.ts +1 -0
- package/template/src/components/JsonEditor/types.ts +14 -0
- package/template/src/components/PageFeedback/PageFeedback.tsx +194 -0
- package/template/src/components/PageFeedback/index.ts +10 -0
- package/template/src/components/PageFeedback/types.ts +31 -0
- package/template/src/components/PasswordInput/PasswordInput.tsx +50 -0
- package/template/src/components/PasswordInput/index.ts +1 -0
- package/template/src/components/RouteDialog/RouteDialog.tsx +20 -0
- package/template/src/components/RouteDialog/index.ts +2 -0
- package/template/src/components/RouteDialog/types.ts +8 -0
- package/template/src/components/RouteDialog/useRouteDialogNavigation.ts +30 -0
- package/template/src/components/SensitiveData/SensitiveData.tsx +337 -0
- package/template/src/components/SensitiveData/index.ts +2 -0
- package/template/src/components/SensitiveData/types.ts +31 -0
- package/template/src/components/StatusBadge/StatusBadge.tsx +28 -0
- package/template/src/components/StatusBadge/index.ts +2 -0
- package/template/src/components/StatusBadge/statusBadgeStyles.ts +30 -0
- package/template/src/components/StatusBadge/types.ts +7 -0
- package/template/src/components/layout/AppHeader/AppHeader.tsx +57 -0
- package/template/src/components/layout/AppHeader/HeaderSearch.tsx +160 -0
- package/template/src/components/layout/AppHeader/HeaderUserMenu.tsx +59 -0
- package/template/src/components/layout/AppHeader/ThemeControls.tsx +44 -0
- package/template/src/components/layout/AppHeader/index.ts +1 -0
- package/template/src/components/layout/AppHeader/themeOptions.ts +13 -0
- package/template/src/components/layout/AppSidebar.tsx +268 -0
- package/template/src/components/layout/PageContainer.tsx +16 -0
- package/template/src/components/ui/avatar.tsx +108 -0
- package/template/src/components/ui/badge.tsx +47 -0
- package/template/src/components/ui/button.tsx +63 -0
- package/template/src/components/ui/card.tsx +60 -0
- package/template/src/components/ui/checkbox.tsx +31 -0
- package/template/src/components/ui/collapsible.tsx +33 -0
- package/template/src/components/ui/command.tsx +181 -0
- package/template/src/components/ui/dialog.tsx +157 -0
- package/template/src/components/ui/dropdown-menu.tsx +254 -0
- package/template/src/components/ui/form.tsx +141 -0
- package/template/src/components/ui/input.tsx +20 -0
- package/template/src/components/ui/label.tsx +23 -0
- package/template/src/components/ui/pagination.tsx +127 -0
- package/template/src/components/ui/popover.tsx +41 -0
- package/template/src/components/ui/select.tsx +187 -0
- package/template/src/components/ui/separator.tsx +25 -0
- package/template/src/components/ui/sheet.tsx +142 -0
- package/template/src/components/ui/sidebar.tsx +878 -0
- package/template/src/components/ui/skeleton.tsx +13 -0
- package/template/src/components/ui/sonner.tsx +33 -0
- package/template/src/components/ui/tooltip.tsx +54 -0
- package/template/src/config/RuntimeConfigErrorPage.tsx +48 -0
- package/template/src/config/appConfig.ts +126 -0
- package/template/src/config/buildInfo.ts +8 -0
- package/template/src/config/observabilityAdapter.ts +8 -0
- package/template/src/config/runtimeConfig.ts +360 -0
- package/template/src/config/types.ts +195 -0
- package/template/src/context/ThemeProvider.tsx +84 -0
- package/template/src/context/UnsavedChangesProvider.tsx +123 -0
- package/template/src/context/applicationScope.ts +39 -0
- package/template/src/context/types.ts +41 -0
- package/template/src/dataMasking/index.ts +14 -0
- package/template/src/dataMasking/masking.ts +139 -0
- package/template/src/dataMasking/types.ts +144 -0
- package/template/src/featureFlags/FeatureFlagProvider.tsx +143 -0
- package/template/src/featureFlags/FeatureGate.tsx +12 -0
- package/template/src/featureFlags/catalog.ts +140 -0
- package/template/src/featureFlags/errors.ts +17 -0
- package/template/src/featureFlags/index.ts +43 -0
- package/template/src/featureFlags/query.ts +103 -0
- package/template/src/featureFlags/registry.ts +149 -0
- package/template/src/featureFlags/scope.ts +27 -0
- package/template/src/featureFlags/types.ts +241 -0
- package/template/src/features/auth/AuthLayout.tsx +17 -0
- package/template/src/features/auth/index.ts +2 -0
- package/template/src/features/auth/signIn/components/UserAuthForm.tsx +121 -0
- package/template/src/features/auth/signIn/index.tsx +71 -0
- package/template/src/features/auth/signIn/messages.ts +37 -0
- package/template/src/features/auth/signIn/types.ts +4 -0
- package/template/src/features/errors/ForbiddenError.tsx +34 -0
- package/template/src/features/errors/GeneralError.tsx +46 -0
- package/template/src/features/errors/MaintenanceError.tsx +31 -0
- package/template/src/features/errors/NotFoundError.tsx +34 -0
- package/template/src/features/errors/RouteError.tsx +72 -0
- package/template/src/features/errors/UnauthorizedError.tsx +34 -0
- package/template/src/features/errors/index.ts +6 -0
- package/template/src/features/errors/messages.ts +56 -0
- package/template/src/features/home/index.tsx +107 -0
- package/template/src/features/home/messages.ts +59 -0
- package/template/src/features/showcase/AccessShowcasePage.tsx +284 -0
- package/template/src/features/showcase/AdvancedTableDemo.tsx +120 -0
- package/template/src/features/showcase/FeedbackShowcasePage.tsx +142 -0
- package/template/src/features/showcase/FileShowcasePage.tsx +110 -0
- package/template/src/features/showcase/FormShowcasePage.tsx +156 -0
- package/template/src/features/showcase/MetadataShowcasePage.tsx +241 -0
- package/template/src/features/showcase/ShowcasePageHeader.tsx +24 -0
- package/template/src/features/showcase/TableShowcasePage.tsx +436 -0
- package/template/src/features/showcase/accessMessages.ts +67 -0
- package/template/src/features/showcase/index.ts +6 -0
- package/template/src/features/showcase/messages.ts +192 -0
- package/template/src/files/download.ts +82 -0
- package/template/src/files/errors.ts +15 -0
- package/template/src/files/filename.ts +61 -0
- package/template/src/files/index.ts +38 -0
- package/template/src/files/types.ts +299 -0
- package/template/src/files/useFileTask.ts +153 -0
- package/template/src/files/useFileUpload.ts +117 -0
- package/template/src/files/validation.ts +109 -0
- package/template/src/layouts/AppLayout.tsx +37 -0
- package/template/src/lib/accessControl.ts +42 -0
- package/template/src/lib/navigationRedirect.ts +26 -0
- package/template/src/lib/utils.ts +6 -0
- package/template/src/locale/LocaleProvider.tsx +37 -0
- package/template/src/locale/context.ts +15 -0
- package/template/src/locale/formatters.ts +123 -0
- package/template/src/locale/hooks.ts +35 -0
- package/template/src/locale/index.ts +17 -0
- package/template/src/locale/messages.ts +151 -0
- package/template/src/locale/types.ts +167 -0
- package/template/src/main.tsx +5 -0
- package/template/src/observability/browser.ts +37 -0
- package/template/src/observability/consoleAdapter.ts +18 -0
- package/template/src/observability/index.ts +26 -0
- package/template/src/observability/observer.ts +118 -0
- package/template/src/observability/redaction.ts +85 -0
- package/template/src/observability/types.ts +119 -0
- package/template/src/optionalEditors/controller.ts +327 -0
- package/template/src/optionalEditors/errors.ts +21 -0
- package/template/src/optionalEditors/index.ts +35 -0
- package/template/src/optionalEditors/model.ts +253 -0
- package/template/src/optionalEditors/react.ts +89 -0
- package/template/src/optionalEditors/types.ts +254 -0
- package/template/src/permissions/index.ts +3 -0
- package/template/src/permissions/types.ts +5 -0
- package/template/src/permissions/usePermission.ts +16 -0
- package/template/src/realtimeCollaboration/controller.ts +355 -0
- package/template/src/realtimeCollaboration/errors.ts +20 -0
- package/template/src/realtimeCollaboration/index.ts +39 -0
- package/template/src/realtimeCollaboration/model.ts +212 -0
- package/template/src/realtimeCollaboration/react.ts +72 -0
- package/template/src/realtimeCollaboration/types.ts +251 -0
- package/template/src/reporting/errors.ts +21 -0
- package/template/src/reporting/generation.ts +87 -0
- package/template/src/reporting/index.ts +42 -0
- package/template/src/reporting/model.ts +373 -0
- package/template/src/reporting/print.ts +16 -0
- package/template/src/reporting/query.ts +50 -0
- package/template/src/reporting/react.ts +17 -0
- package/template/src/reporting/source.ts +13 -0
- package/template/src/reporting/types.ts +219 -0
- package/template/src/router/RootRouteLayout.tsx +11 -0
- package/template/src/router/authLifecycle.ts +39 -0
- package/template/src/router/config.ts +293 -0
- package/template/src/router/interceptors.ts +48 -0
- package/template/src/router/lazyRouteComponents.ts +78 -0
- package/template/src/router/messages.ts +48 -0
- package/template/src/router/navigation.ts +167 -0
- package/template/src/router/router.ts +66 -0
- package/template/src/router/searchSchemas.ts +9 -0
- package/template/src/router/types.ts +76 -0
- package/template/src/stores/authSessionStorage.ts +27 -0
- package/template/src/stores/authStore.ts +165 -0
- package/template/src/stores/types.ts +36 -0
- package/template/src/stores/uiPreferenceStore.ts +34 -0
- package/template/src/styles/index.css +141 -0
- package/template/src/styles/theme.css +213 -0
- package/template/src/tenantWorkspace/TenantWorkspaceProvider.tsx +102 -0
- package/template/src/tenantWorkspace/index.ts +33 -0
- package/template/src/tenantWorkspace/store.ts +184 -0
- package/template/src/tenantWorkspace/switch.ts +206 -0
- package/template/src/tenantWorkspace/types.ts +155 -0
- package/template/src/vite-env.d.ts +20 -0
- package/template/stylelint.config.js +28 -0
- package/template/tests/integration/Application.test.tsx +269 -0
- package/template/tests/integration/layout/AppHeader.test.tsx +182 -0
- package/template/tests/integration/layout/AppSidebar.test.tsx +121 -0
- package/template/tests/integration/layout/__screenshots__/AppHeader.test.tsx/AppHeader-command-search-hides-the-duplicate-header-trigger-when-the-desktop-sidebar-collapses-1.png +0 -0
- package/template/tests/integration/router/__screenshots__/config.test.ts/route-tree-authentication-boundaries-exposes-only-scaffold-navigation-metadata-1.png +0 -0
- package/template/tests/integration/router/config.test.ts +123 -0
- package/template/tests/integration/router/interceptors.test.ts +100 -0
- package/template/tests/setup/accessibility.ts +25 -0
- package/template/tests/setup/runtimeConfig.ts +3 -0
- package/template/tests/unit/api/ApiError.test.ts +25 -0
- package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-clears-the-session-if-a-refresh-identity-loses-administrator-access-1.png +0 -0
- package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-creates-a-session-from-the-generated-login-response-for-an-admin-1.png +0 -0
- package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-rejects-and-revokes-the-generated-login-result-for-an-ordinary-user-1.png +0 -0
- package/template/tests/unit/api/activity/ActivityProvider.test.tsx +131 -0
- package/template/tests/unit/api/activity/__screenshots__/transports.test.ts/activity-transport-adapters-polls-sequentially-and-advances-the-last-event-ID-1.png +0 -0
- package/template/tests/unit/api/activity/modelAndQuery.test.ts +144 -0
- package/template/tests/unit/api/activity/subscription.test.ts +103 -0
- package/template/tests/unit/api/activity/transports.test.ts +145 -0
- package/template/tests/unit/api/authClient.test.ts +110 -0
- package/template/tests/unit/api/authSession.test.ts +289 -0
- package/template/tests/unit/api/clients/configureApiClient.test.ts +198 -0
- package/template/tests/unit/api/demoAuthClient.test.ts +47 -0
- package/template/tests/unit/api/enums/access.test.ts +107 -0
- package/template/tests/unit/api/enums/catalog.test.ts +200 -0
- package/template/tests/unit/api/enums/query.test.ts +110 -0
- package/template/tests/unit/api/enums/useEnum.test.tsx +98 -0
- package/template/tests/unit/api/enums/useEnumCatalog.test.tsx +68 -0
- package/template/tests/unit/api/hooks/error.test.ts +168 -0
- package/template/tests/unit/api/hooks/request.test.ts +170 -0
- package/template/tests/unit/api/hooks/response.test.ts +46 -0
- package/template/tests/unit/api/metadata/MetadataProvider.test.tsx +102 -0
- package/template/tests/unit/api/parameters/catalog.test.ts +147 -0
- package/template/tests/unit/api/parameters/query.test.ts +78 -0
- package/template/tests/unit/api/parameters/useGlobalParameter.test.tsx +89 -0
- package/template/tests/unit/api/query/queryPolicy.test.ts +245 -0
- package/template/tests/unit/api/query/useAppQueryScope.test.tsx +74 -0
- package/template/tests/unit/auditLogs/auditLogHooks.test.tsx +194 -0
- package/template/tests/unit/auditLogs/auditLogs.test.ts +199 -0
- package/template/tests/unit/authentication/__screenshots__/authentication.test.ts/authentication-controller-completes-Step-up-callbacks-without-creating-a-second-login-result-1.png +0 -0
- package/template/tests/unit/authentication/__screenshots__/authentication.test.ts/authentication-controller-moves-from-challenge-to-completion-without-retaining-tokens-in-snapshot-1.png +0 -0
- package/template/tests/unit/authentication/authentication.test.ts +376 -0
- package/template/tests/unit/components/AppDialog.test.tsx +225 -0
- package/template/tests/unit/components/AppTable.test.tsx +129 -0
- package/template/tests/unit/components/AppTableLayoutTransition.test.ts +118 -0
- package/template/tests/unit/components/AppTableLocalization.test.ts +58 -0
- package/template/tests/unit/components/AppTableSensitiveData.test.ts +35 -0
- package/template/tests/unit/components/AppTableUpgrade.test.tsx +179 -0
- package/template/tests/unit/components/AppTableUpgradeCore.test.ts +258 -0
- package/template/tests/unit/components/BrandLogo.test.tsx +24 -0
- package/template/tests/unit/components/Can.test.tsx +80 -0
- package/template/tests/unit/components/Dialog.test.tsx +56 -0
- package/template/tests/unit/components/EnumPresentation.test.tsx +64 -0
- package/template/tests/unit/components/FilePreviewEngine.test.ts +51 -0
- package/template/tests/unit/components/JsonEditor.test.tsx +47 -0
- package/template/tests/unit/components/LocalizedSharedComponents.test.tsx +36 -0
- package/template/tests/unit/components/OverlayLayer.test.tsx +151 -0
- package/template/tests/unit/components/PageFeedback.test.tsx +143 -0
- package/template/tests/unit/components/PageForm.test.tsx +272 -0
- package/template/tests/unit/components/PageFormCore.test.ts +74 -0
- package/template/tests/unit/components/PasswordInput.test.tsx +105 -0
- package/template/tests/unit/components/ScaffoldComponents.test.tsx +64 -0
- package/template/tests/unit/components/SensitiveData.test.tsx +151 -0
- package/template/tests/unit/components/StatusBadge.test.tsx +36 -0
- package/template/tests/unit/components/TableComponent.test.tsx +644 -0
- package/template/tests/unit/components/TableCore.test.ts +145 -0
- package/template/tests/unit/components/ThemeAccessibility.test.tsx +27 -0
- package/template/tests/unit/components/__screenshots__/BatchOperationDialog.test.tsx/confirms-a-batch-action-and-presents-partial-failure-details-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/PageForm.test.tsx/PageForm-writes-uploaded-values-through-the-public-file-field-and-resets-dirty-state-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/PasswordInput.test.tsx/PasswordInput-toggles-the-password-visibility-when-the-show-password-button-is-clicked-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-pins-trailing-action-columns-and-removes-their-header-menu-by-default-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-renders-shadcn-components-through-cellComponent-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-renders-the-toolbar-without-a-bottom-divider-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-resyncs-adaptive-height-after-a-column-resize-changes-wrapped-row-height-1.png +0 -0
- package/template/tests/unit/config/RuntimeConfigErrorPage.test.tsx +23 -0
- package/template/tests/unit/config/appConfig.test.ts +98 -0
- package/template/tests/unit/config/appTableContracts.test.mjs +120 -0
- package/template/tests/unit/config/bundleBudget.test.mjs +190 -0
- package/template/tests/unit/config/componentGovernance.test.mjs +156 -0
- package/template/tests/unit/config/deployConfig.test.mjs +211 -0
- package/template/tests/unit/config/eslintConfig.test.mjs +101 -0
- package/template/tests/unit/config/featureBoundaries.test.mjs +126 -0
- package/template/tests/unit/config/npmPackage.test.mjs +37 -0
- package/template/tests/unit/config/releaseArtifact.test.mjs +105 -0
- package/template/tests/unit/config/runtimeConfig.test.ts +225 -0
- package/template/tests/unit/config/scaffoldCheck.test.mjs +53 -0
- package/template/tests/unit/config/scaffoldFeature.test.mjs +177 -0
- package/template/tests/unit/config/scaffoldInit.test.mjs +218 -0
- package/template/tests/unit/config/scaffoldProject.test.mjs +378 -0
- package/template/tests/unit/config/scaffoldTransaction.test.mjs +77 -0
- package/template/tests/unit/config/viteConfig.test.mjs +371 -0
- package/template/tests/unit/context/ThemeProvider.test.tsx +108 -0
- package/template/tests/unit/context/UnsavedChangesProvider.test.tsx +94 -0
- package/template/tests/unit/context/__screenshots__/ThemeProvider.test.tsx/ThemeProvider-uses-the-neutral-black-palette-for-the-app-and-scoped-table-theme-1.png +0 -0
- package/template/tests/unit/context/applicationScope.test.ts +62 -0
- package/template/tests/unit/dataMasking/dataMasking.test.ts +95 -0
- package/template/tests/unit/featureFlags/featureFlags.test.ts +169 -0
- package/template/tests/unit/featureFlags/useFeatureFlag.test.tsx +108 -0
- package/template/tests/unit/features/FeatureLocalization.test.tsx +54 -0
- package/template/tests/unit/features/RouteError.test.tsx +40 -0
- package/template/tests/unit/features/auth/signIn/UserAuthForm.test.tsx +79 -0
- package/template/tests/unit/features/auth/signIn/__screenshots__/UserAuthForm.test.tsx/UserAuthForm-passes-validated-values-to-onSubmit-1.png +0 -0
- package/template/tests/unit/features/auth/signIn/__screenshots__/UserAuthForm.test.tsx/UserAuthForm-shows-validation-messages-when-submitting-an-empty-form-1.png +0 -0
- package/template/tests/unit/files/fileHooks.test.tsx +130 -0
- package/template/tests/unit/files/files.test.ts +112 -0
- package/template/tests/unit/lib/accessControl.test.ts +69 -0
- package/template/tests/unit/locale/locale.test.tsx +90 -0
- package/template/tests/unit/observability/browser.test.ts +48 -0
- package/template/tests/unit/observability/observer.test.ts +115 -0
- package/template/tests/unit/optionalEditors/__screenshots__/useOptionalEditor.test.tsx/useOptionalEditor-fails-permission-precheck-before-loading-the-project-SDK-1.png +0 -0
- package/template/tests/unit/optionalEditors/__screenshots__/useOptionalEditor.test.tsx/useOptionalEditor-mounts-a-route-scoped-SDK-into-the-dedicated-host-with-permission-1.png +0 -0
- package/template/tests/unit/optionalEditors/optionalEditors.test.ts +313 -0
- package/template/tests/unit/optionalEditors/useOptionalEditor.test.tsx +141 -0
- package/template/tests/unit/realtimeCollaboration/collaboration.test.ts +240 -0
- package/template/tests/unit/realtimeCollaboration/useRealtimeCollaboration.test.tsx +115 -0
- package/template/tests/unit/reporting/reporting.test.ts +195 -0
- package/template/tests/unit/reporting/reportingHooks.test.tsx +203 -0
- package/template/tests/unit/router/authLifecycle.test.ts +55 -0
- package/template/tests/unit/router/navigation.test.ts +55 -0
- package/template/tests/unit/router/redirects.test.ts +22 -0
- package/template/tests/unit/scaffoldFeatureTemplate/featureTemplate.test.ts +42 -0
- package/template/tests/unit/scaffoldFeatureTemplate/publicContract.test.ts +28 -0
- package/template/tests/unit/scaffoldFeatureTemplate/queries.test.tsx +289 -0
- package/template/tests/unit/stores/authStore.test.ts +128 -0
- package/template/tests/unit/stores/uiPreferenceStore.test.ts +56 -0
- package/template/tests/unit/tenantWorkspace/tenantWorkspace.test.tsx +261 -0
- package/template/tools/bundle/budgets.json +48 -0
- package/template/tools/bundle/check.mjs +307 -0
- package/template/tools/component-governance/check.mjs +703 -0
- package/template/tools/component-governance/manifest.json +112 -0
- package/template/tools/deployment/browser-smoke.mjs +76 -0
- package/template/tools/deployment/browser-smoke.sh +141 -0
- package/template/tools/openapi/generate.mjs +268 -0
- package/template/tools/openapi/templates/README.md +14 -0
- package/template/tools/openapi/templates/base/README.md +7 -0
- package/template/tools/openapi/templates/base/data-contracts.eta +44 -0
- package/template/tools/openapi/templates/base/http-client.eta +3 -0
- package/template/tools/openapi/templates/base/http-clients/axios-http-client.eta +132 -0
- package/template/tools/openapi/templates/base/http-clients/fetch-http-client.eta +220 -0
- package/template/tools/openapi/templates/base/route-docs.eta +31 -0
- package/template/tools/openapi/templates/base/route-name.eta +43 -0
- package/template/tools/openapi/templates/base/route-type.eta +22 -0
- package/template/tools/openapi/templates/default/README.md +7 -0
- package/template/tools/openapi/templates/default/api.eta +67 -0
- package/template/tools/openapi/templates/default/http-client.eta +137 -0
- package/template/tools/openapi/templates/default/procedure-call.eta +99 -0
- package/template/tools/openapi/templates/default/route-docs.eta +40 -0
- package/template/tools/openapi/templates/default/route-types.eta +28 -0
- package/template/tools/openapi/templates/modular/README.md +7 -0
- package/template/tools/openapi/templates/modular/api.eta +28 -0
- package/template/tools/openapi/templates/modular/procedure-call.eta +99 -0
- package/template/tools/openapi/templates/modular/route-types.eta +18 -0
- package/template/tools/release/artifact.mjs +258 -0
- package/template/tools/scaffold/add-capability.mjs +409 -0
- package/template/tools/scaffold/capability-catalog.json +163 -0
- package/template/tools/scaffold/check.mjs +326 -0
- package/template/tools/scaffold/create-feature.mjs +444 -0
- package/template/tools/scaffold/create-project.mjs +482 -0
- package/template/tools/scaffold/init.example.json +64 -0
- package/template/tools/scaffold/init.mjs +419 -0
- package/template/tools/scaffold/lockfile.mjs +193 -0
- package/template/tools/scaffold/templates/feature/index.ts +19 -0
- package/template/tools/scaffold/templates/feature/model.ts +142 -0
- package/template/tools/scaffold/templates/feature/queries.ts +154 -0
- package/template/tools/scaffold/templates/feature/repository.ts +206 -0
- package/template/tools/scaffold/templates/feature/types.ts +168 -0
- package/template/tools/scaffold/workspace-transaction.mjs +111 -0
- package/template/tsconfig.app.json +31 -0
- package/template/tsconfig.json +12 -0
- package/template/tsconfig.node.json +24 -0
- package/template/vite.config.ts +121 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Outlet } from '@tanstack/react-router'
|
|
2
|
+
import { UnsavedChangesProvider } from '@/context/UnsavedChangesProvider'
|
|
3
|
+
|
|
4
|
+
/** 为全部路由分支安装一次跨组件未保存内容保护。 */
|
|
5
|
+
export function RootRouteLayout() {
|
|
6
|
+
return (
|
|
7
|
+
<UnsavedChangesProvider>
|
|
8
|
+
<Outlet />
|
|
9
|
+
</UnsavedChangesProvider>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
interface IAuthStateSnapshot {
|
|
2
|
+
bIsAuthenticated: boolean
|
|
3
|
+
nSessionGeneration: number
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface IAuthLifecycleEffects {
|
|
7
|
+
fnClearQueryCache: () => void
|
|
8
|
+
fnInvalidateRouter: () => void
|
|
9
|
+
fnNavigateToSignIn: () => void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 统一处理认证会话结束后的跨模块副作用。
|
|
14
|
+
*
|
|
15
|
+
* Zustand Store 只持有认证状态;路由跳转和请求缓存清理由应用层在状态边沿触发,
|
|
16
|
+
* 避免 API、页头和侧栏各自维护一套退出逻辑。
|
|
17
|
+
*/
|
|
18
|
+
export function fnHandleAuthSessionTransition(
|
|
19
|
+
objCurrentState: IAuthStateSnapshot,
|
|
20
|
+
objPreviousState: IAuthStateSnapshot,
|
|
21
|
+
{
|
|
22
|
+
fnClearQueryCache,
|
|
23
|
+
fnInvalidateRouter,
|
|
24
|
+
fnNavigateToSignIn,
|
|
25
|
+
}: IAuthLifecycleEffects
|
|
26
|
+
) {
|
|
27
|
+
const bSessionChanged =
|
|
28
|
+
objCurrentState.nSessionGeneration !== objPreviousState.nSessionGeneration
|
|
29
|
+
const bSessionEnded =
|
|
30
|
+
objPreviousState.bIsAuthenticated && !objCurrentState.bIsAuthenticated
|
|
31
|
+
|
|
32
|
+
if (bSessionChanged) {
|
|
33
|
+
fnClearQueryCache()
|
|
34
|
+
fnInvalidateRouter()
|
|
35
|
+
}
|
|
36
|
+
if (bSessionEnded) fnNavigateToSignIn()
|
|
37
|
+
|
|
38
|
+
return bSessionChanged || bSessionEnded
|
|
39
|
+
}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Outlet,
|
|
3
|
+
createRootRouteWithContext,
|
|
4
|
+
createRoute,
|
|
5
|
+
redirect,
|
|
6
|
+
} from '@tanstack/react-router'
|
|
7
|
+
import { objAppConfig } from '@/config/appConfig'
|
|
8
|
+
import {
|
|
9
|
+
CircleAlert,
|
|
10
|
+
FileUp,
|
|
11
|
+
FileQuestion,
|
|
12
|
+
House,
|
|
13
|
+
KeyRound,
|
|
14
|
+
ListChecks,
|
|
15
|
+
MessageSquareMore,
|
|
16
|
+
PanelsTopLeft,
|
|
17
|
+
ServerCrash,
|
|
18
|
+
ShieldCheck,
|
|
19
|
+
ShieldX,
|
|
20
|
+
SlidersHorizontal,
|
|
21
|
+
TableProperties,
|
|
22
|
+
Wrench,
|
|
23
|
+
} from 'lucide-react'
|
|
24
|
+
import { RootRouteLayout } from './RootRouteLayout'
|
|
25
|
+
import { fnInterceptRoute } from './interceptors'
|
|
26
|
+
import {
|
|
27
|
+
AuthLayout,
|
|
28
|
+
AccessShowcasePage,
|
|
29
|
+
AppLayout,
|
|
30
|
+
ForbiddenError,
|
|
31
|
+
FeedbackShowcasePage,
|
|
32
|
+
FileShowcasePage,
|
|
33
|
+
FormShowcasePage,
|
|
34
|
+
GeneralError,
|
|
35
|
+
Home,
|
|
36
|
+
MaintenanceError,
|
|
37
|
+
MetadataShowcasePage,
|
|
38
|
+
NotFoundError,
|
|
39
|
+
RouteError,
|
|
40
|
+
SignIn,
|
|
41
|
+
TableShowcasePage,
|
|
42
|
+
UnauthorizedError,
|
|
43
|
+
} from './lazyRouteComponents'
|
|
44
|
+
import { fnValidateSignInSearch } from './searchSchemas'
|
|
45
|
+
import type { IRouterContext } from './types'
|
|
46
|
+
|
|
47
|
+
const objRootRoute = createRootRouteWithContext<IRouterContext>()({
|
|
48
|
+
component: RootRouteLayout,
|
|
49
|
+
notFoundComponent: NotFoundError,
|
|
50
|
+
errorComponent: RouteError,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const objIndexRoute = createRoute({
|
|
54
|
+
getParentRoute: () => objRootRoute,
|
|
55
|
+
path: '/',
|
|
56
|
+
beforeLoad: (objOptions) => fnInterceptRoute(objOptions, 'entry'),
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const objGuestRoute = createRoute({
|
|
60
|
+
getParentRoute: () => objRootRoute,
|
|
61
|
+
id: '_guest',
|
|
62
|
+
beforeLoad: (objOptions) => fnInterceptRoute(objOptions, 'guest'),
|
|
63
|
+
component: AuthLayout,
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const objSignInRoute = createRoute({
|
|
67
|
+
getParentRoute: () => objGuestRoute,
|
|
68
|
+
path: 'sign-in',
|
|
69
|
+
validateSearch: fnValidateSignInSearch,
|
|
70
|
+
component: SignIn,
|
|
71
|
+
staticData: {
|
|
72
|
+
strTitle: 'route.signIn.title',
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const objSignUpRoute = createRoute({
|
|
77
|
+
getParentRoute: () => objGuestRoute,
|
|
78
|
+
path: 'sign-up',
|
|
79
|
+
beforeLoad: () => {
|
|
80
|
+
throw redirect({ to: '/sign-in', replace: true })
|
|
81
|
+
},
|
|
82
|
+
staticData: {
|
|
83
|
+
strTitle: 'route.signUp.title',
|
|
84
|
+
},
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
const objAppRoute = createRoute({
|
|
88
|
+
getParentRoute: () => objRootRoute,
|
|
89
|
+
id: '_app',
|
|
90
|
+
beforeLoad: (objOptions) => fnInterceptRoute(objOptions, 'authenticated'),
|
|
91
|
+
component: AppLayout,
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
const objHomeRoute = createRoute({
|
|
95
|
+
getParentRoute: () => objAppRoute,
|
|
96
|
+
path: 'dashboard',
|
|
97
|
+
component: Home,
|
|
98
|
+
staticData: {
|
|
99
|
+
strTitle: 'route.home.title',
|
|
100
|
+
Icon: House,
|
|
101
|
+
strNavigationGroup: 'route.group.workspace',
|
|
102
|
+
nNavigationGroupOrder: 10,
|
|
103
|
+
nNavigationOrder: 10,
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
const objShowcaseRoute = createRoute({
|
|
108
|
+
getParentRoute: () => objAppRoute,
|
|
109
|
+
path: 'showcase',
|
|
110
|
+
component: Outlet,
|
|
111
|
+
staticData: {
|
|
112
|
+
strTitle: 'route.showcase.title',
|
|
113
|
+
Icon: PanelsTopLeft,
|
|
114
|
+
strNavigationGroup: 'route.group.showcase',
|
|
115
|
+
nNavigationGroupOrder: 20,
|
|
116
|
+
nNavigationOrder: 10,
|
|
117
|
+
},
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
const objShowcaseIndexRoute = createRoute({
|
|
121
|
+
getParentRoute: () => objShowcaseRoute,
|
|
122
|
+
path: '/',
|
|
123
|
+
beforeLoad: () => {
|
|
124
|
+
throw redirect({ to: '/showcase/table', replace: true })
|
|
125
|
+
},
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
const objAccessShowcaseRoute = createRoute({
|
|
129
|
+
getParentRoute: () => objShowcaseRoute,
|
|
130
|
+
path: 'access',
|
|
131
|
+
component: AccessShowcasePage,
|
|
132
|
+
staticData: {
|
|
133
|
+
strTitle: 'route.showcase.access',
|
|
134
|
+
Icon: ShieldCheck,
|
|
135
|
+
nNavigationOrder: 5,
|
|
136
|
+
strPermission: 'showcase:access',
|
|
137
|
+
},
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
const objTableShowcaseRoute = createRoute({
|
|
141
|
+
getParentRoute: () => objShowcaseRoute,
|
|
142
|
+
path: 'table',
|
|
143
|
+
component: TableShowcasePage,
|
|
144
|
+
staticData: {
|
|
145
|
+
strTitle: 'route.showcase.table',
|
|
146
|
+
Icon: TableProperties,
|
|
147
|
+
nNavigationOrder: 10,
|
|
148
|
+
},
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
const objFormShowcaseRoute = createRoute({
|
|
152
|
+
getParentRoute: () => objShowcaseRoute,
|
|
153
|
+
path: 'form',
|
|
154
|
+
component: FormShowcasePage,
|
|
155
|
+
staticData: {
|
|
156
|
+
strTitle: 'route.showcase.form',
|
|
157
|
+
Icon: ListChecks,
|
|
158
|
+
nNavigationOrder: 20,
|
|
159
|
+
},
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
const objMetadataShowcaseRoute = createRoute({
|
|
163
|
+
getParentRoute: () => objShowcaseRoute,
|
|
164
|
+
path: 'metadata',
|
|
165
|
+
component: MetadataShowcasePage,
|
|
166
|
+
staticData: {
|
|
167
|
+
strTitle: 'route.showcase.metadata',
|
|
168
|
+
Icon: SlidersHorizontal,
|
|
169
|
+
nNavigationOrder: 30,
|
|
170
|
+
},
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
const objFileShowcaseRoute = createRoute({
|
|
174
|
+
getParentRoute: () => objShowcaseRoute,
|
|
175
|
+
path: 'files',
|
|
176
|
+
component: FileShowcasePage,
|
|
177
|
+
staticData: {
|
|
178
|
+
strTitle: 'route.showcase.files',
|
|
179
|
+
Icon: FileUp,
|
|
180
|
+
nNavigationOrder: 40,
|
|
181
|
+
},
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
const objFeedbackShowcaseRoute = createRoute({
|
|
185
|
+
getParentRoute: () => objShowcaseRoute,
|
|
186
|
+
path: 'feedback',
|
|
187
|
+
component: FeedbackShowcasePage,
|
|
188
|
+
staticData: {
|
|
189
|
+
strTitle: 'route.showcase.feedback',
|
|
190
|
+
Icon: MessageSquareMore,
|
|
191
|
+
nNavigationOrder: 50,
|
|
192
|
+
},
|
|
193
|
+
})
|
|
194
|
+
|
|
195
|
+
const objErrorsRoute = createRoute({
|
|
196
|
+
getParentRoute: () => objRootRoute,
|
|
197
|
+
path: 'errors',
|
|
198
|
+
beforeLoad: (objOptions) => fnInterceptRoute(objOptions, 'authenticated'),
|
|
199
|
+
component: Outlet,
|
|
200
|
+
staticData: {
|
|
201
|
+
strTitle: 'route.error.title',
|
|
202
|
+
Icon: CircleAlert,
|
|
203
|
+
strNavigationGroup: 'route.group.system',
|
|
204
|
+
nNavigationGroupOrder: 20,
|
|
205
|
+
nNavigationOrder: 10,
|
|
206
|
+
bShowInSidebar: false,
|
|
207
|
+
},
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
const objUnauthorizedRoute = createRoute({
|
|
211
|
+
getParentRoute: () => objErrorsRoute,
|
|
212
|
+
path: '401',
|
|
213
|
+
component: UnauthorizedError,
|
|
214
|
+
staticData: {
|
|
215
|
+
strTitle: 'route.error.unauthorized',
|
|
216
|
+
Icon: KeyRound,
|
|
217
|
+
nNavigationOrder: 10,
|
|
218
|
+
},
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
const objForbiddenRoute = createRoute({
|
|
222
|
+
getParentRoute: () => objErrorsRoute,
|
|
223
|
+
path: '403',
|
|
224
|
+
component: ForbiddenError,
|
|
225
|
+
staticData: {
|
|
226
|
+
strTitle: 'route.error.forbidden',
|
|
227
|
+
Icon: ShieldX,
|
|
228
|
+
nNavigationOrder: 20,
|
|
229
|
+
},
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
const objNotFoundRoute = createRoute({
|
|
233
|
+
getParentRoute: () => objErrorsRoute,
|
|
234
|
+
path: '404',
|
|
235
|
+
component: NotFoundError,
|
|
236
|
+
staticData: {
|
|
237
|
+
strTitle: 'route.error.notFound',
|
|
238
|
+
Icon: FileQuestion,
|
|
239
|
+
nNavigationOrder: 30,
|
|
240
|
+
},
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
const objInternalServerErrorRoute = createRoute({
|
|
244
|
+
getParentRoute: () => objErrorsRoute,
|
|
245
|
+
path: '500',
|
|
246
|
+
component: GeneralError,
|
|
247
|
+
staticData: {
|
|
248
|
+
strTitle: 'route.error.general',
|
|
249
|
+
Icon: ServerCrash,
|
|
250
|
+
nNavigationOrder: 40,
|
|
251
|
+
},
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
const objMaintenanceRoute = createRoute({
|
|
255
|
+
getParentRoute: () => objErrorsRoute,
|
|
256
|
+
path: '503',
|
|
257
|
+
component: MaintenanceError,
|
|
258
|
+
staticData: {
|
|
259
|
+
strTitle: 'route.error.maintenance',
|
|
260
|
+
Icon: Wrench,
|
|
261
|
+
nNavigationOrder: 50,
|
|
262
|
+
},
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
const arrAuthenticatedRoutes = [
|
|
266
|
+
objHomeRoute,
|
|
267
|
+
...(objAppConfig.runtime.strMode === 'demo'
|
|
268
|
+
? [
|
|
269
|
+
objShowcaseRoute.addChildren([
|
|
270
|
+
objShowcaseIndexRoute,
|
|
271
|
+
objAccessShowcaseRoute,
|
|
272
|
+
objTableShowcaseRoute,
|
|
273
|
+
objFormShowcaseRoute,
|
|
274
|
+
objMetadataShowcaseRoute,
|
|
275
|
+
objFileShowcaseRoute,
|
|
276
|
+
objFeedbackShowcaseRoute,
|
|
277
|
+
]),
|
|
278
|
+
]
|
|
279
|
+
: []),
|
|
280
|
+
]
|
|
281
|
+
|
|
282
|
+
export const objRouteTree = objRootRoute.addChildren([
|
|
283
|
+
objIndexRoute,
|
|
284
|
+
objGuestRoute.addChildren([objSignInRoute, objSignUpRoute]),
|
|
285
|
+
objAppRoute.addChildren(arrAuthenticatedRoutes),
|
|
286
|
+
objErrorsRoute.addChildren([
|
|
287
|
+
objUnauthorizedRoute,
|
|
288
|
+
objForbiddenRoute,
|
|
289
|
+
objNotFoundRoute,
|
|
290
|
+
objInternalServerErrorRoute,
|
|
291
|
+
objMaintenanceRoute,
|
|
292
|
+
]),
|
|
293
|
+
])
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { redirect } from '@tanstack/react-router'
|
|
2
|
+
import {
|
|
3
|
+
fnParseInternalRedirect,
|
|
4
|
+
strDefaultAuthenticatedPath,
|
|
5
|
+
} from '@/lib/navigationRedirect'
|
|
6
|
+
import type { IRouterContext } from './types'
|
|
7
|
+
|
|
8
|
+
type TRouteAccessMode = 'entry' | 'guest' | 'authenticated'
|
|
9
|
+
|
|
10
|
+
interface IRouteInterceptorOptions {
|
|
11
|
+
context: Pick<IRouterContext, 'objAuth'>
|
|
12
|
+
location: { href: string }
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function fnInterceptRoute(
|
|
16
|
+
{ context: objContext, location: objLocation }: IRouteInterceptorOptions,
|
|
17
|
+
strAccessMode: TRouteAccessMode,
|
|
18
|
+
strPermission?: string
|
|
19
|
+
) {
|
|
20
|
+
const bIsAuthenticated = objContext.objAuth.fnIsAuthenticated()
|
|
21
|
+
|
|
22
|
+
if (strAccessMode === 'entry') {
|
|
23
|
+
throw redirect({
|
|
24
|
+
to: bIsAuthenticated ? strDefaultAuthenticatedPath : '/sign-in',
|
|
25
|
+
replace: true,
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (strAccessMode === 'guest') {
|
|
30
|
+
if (bIsAuthenticated) {
|
|
31
|
+
throw redirect({ to: strDefaultAuthenticatedPath, replace: true })
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (!bIsAuthenticated) {
|
|
38
|
+
throw redirect({
|
|
39
|
+
to: '/sign-in',
|
|
40
|
+
search: { redirect: fnParseInternalRedirect(objLocation.href) },
|
|
41
|
+
replace: true,
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (strPermission && !objContext.objAuth.fnHasPermission(strPermission)) {
|
|
46
|
+
throw redirect({ to: '/errors/403', replace: true })
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { lazyRouteComponent } from '@tanstack/react-router'
|
|
2
|
+
|
|
3
|
+
export const AppLayout = lazyRouteComponent(
|
|
4
|
+
() => import('@/layouts/AppLayout'),
|
|
5
|
+
'AppLayout'
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
export const SignIn = lazyRouteComponent(
|
|
9
|
+
() => import('@/features/auth'),
|
|
10
|
+
'SignIn'
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
export const AuthLayout = lazyRouteComponent(
|
|
14
|
+
() => import('@/features/auth'),
|
|
15
|
+
'AuthLayout'
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
export const Home = lazyRouteComponent(() => import('@/features/home'), 'Home')
|
|
19
|
+
|
|
20
|
+
export const AccessShowcasePage = lazyRouteComponent(
|
|
21
|
+
() => import('@/features/showcase'),
|
|
22
|
+
'AccessShowcasePage'
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export const TableShowcasePage = lazyRouteComponent(
|
|
26
|
+
() => import('@/features/showcase'),
|
|
27
|
+
'TableShowcasePage'
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
export const FormShowcasePage = lazyRouteComponent(
|
|
31
|
+
() => import('@/features/showcase'),
|
|
32
|
+
'FormShowcasePage'
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
export const MetadataShowcasePage = lazyRouteComponent(
|
|
36
|
+
() => import('@/features/showcase'),
|
|
37
|
+
'MetadataShowcasePage'
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
export const FileShowcasePage = lazyRouteComponent(
|
|
41
|
+
() => import('@/features/showcase'),
|
|
42
|
+
'FileShowcasePage'
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
export const FeedbackShowcasePage = lazyRouteComponent(
|
|
46
|
+
() => import('@/features/showcase'),
|
|
47
|
+
'FeedbackShowcasePage'
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
export const UnauthorizedError = lazyRouteComponent(
|
|
51
|
+
() => import('@/features/errors'),
|
|
52
|
+
'UnauthorizedError'
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
export const ForbiddenError = lazyRouteComponent(
|
|
56
|
+
() => import('@/features/errors'),
|
|
57
|
+
'ForbiddenError'
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
export const NotFoundError = lazyRouteComponent(
|
|
61
|
+
() => import('@/features/errors'),
|
|
62
|
+
'NotFoundError'
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
export const GeneralError = lazyRouteComponent(
|
|
66
|
+
() => import('@/features/errors'),
|
|
67
|
+
'GeneralError'
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
export const RouteError = lazyRouteComponent(
|
|
71
|
+
() => import('@/features/errors'),
|
|
72
|
+
'RouteError'
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
export const MaintenanceError = lazyRouteComponent(
|
|
76
|
+
() => import('@/features/errors'),
|
|
77
|
+
'MaintenanceError'
|
|
78
|
+
)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { fnDefineLocaleMessages } from '@/locale'
|
|
2
|
+
import type { TRouteMessageKey } from './types'
|
|
3
|
+
|
|
4
|
+
/** 路由标题和导航分组的完整中英文语言包。 */
|
|
5
|
+
export const objRouteMessages = fnDefineLocaleMessages<TRouteMessageKey>({
|
|
6
|
+
'en-US': {
|
|
7
|
+
'route.error.forbidden': 'Forbidden',
|
|
8
|
+
'route.error.general': 'Server error',
|
|
9
|
+
'route.error.maintenance': 'Maintenance',
|
|
10
|
+
'route.error.notFound': 'Page not found',
|
|
11
|
+
'route.error.title': 'Error pages',
|
|
12
|
+
'route.error.unauthorized': 'Sign-in required',
|
|
13
|
+
'route.group.system': 'System',
|
|
14
|
+
'route.group.showcase': 'Live demos',
|
|
15
|
+
'route.group.workspace': 'Workspace',
|
|
16
|
+
'route.home.title': 'Home',
|
|
17
|
+
'route.showcase.access': 'Identity and access',
|
|
18
|
+
'route.showcase.feedback': 'Dialogs and feedback',
|
|
19
|
+
'route.showcase.files': 'Upload and preview',
|
|
20
|
+
'route.showcase.form': 'PageForm scenarios',
|
|
21
|
+
'route.showcase.metadata': 'Enums and parameters',
|
|
22
|
+
'route.showcase.table': 'Table scenarios',
|
|
23
|
+
'route.showcase.title': 'Feature demos',
|
|
24
|
+
'route.signIn.title': 'Sign in',
|
|
25
|
+
'route.signUp.title': 'Sign up',
|
|
26
|
+
},
|
|
27
|
+
'zh-CN': {
|
|
28
|
+
'route.error.forbidden': '无权访问',
|
|
29
|
+
'route.error.general': '服务器错误',
|
|
30
|
+
'route.error.maintenance': '系统维护',
|
|
31
|
+
'route.error.notFound': '页面不存在',
|
|
32
|
+
'route.error.title': '错误页面',
|
|
33
|
+
'route.error.unauthorized': '未登录',
|
|
34
|
+
'route.group.system': '系统页面',
|
|
35
|
+
'route.group.showcase': '功能演示',
|
|
36
|
+
'route.group.workspace': '工作台',
|
|
37
|
+
'route.home.title': '首页',
|
|
38
|
+
'route.showcase.access': '身份、会话与权限',
|
|
39
|
+
'route.showcase.feedback': '弹窗与反馈',
|
|
40
|
+
'route.showcase.files': '上传与预览',
|
|
41
|
+
'route.showcase.form': 'PageForm 场景',
|
|
42
|
+
'route.showcase.metadata': '枚举与参数',
|
|
43
|
+
'route.showcase.table': '表格业务场景',
|
|
44
|
+
'route.showcase.title': '功能演示',
|
|
45
|
+
'route.signIn.title': '登录',
|
|
46
|
+
'route.signUp.title': '注册',
|
|
47
|
+
},
|
|
48
|
+
})
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { RegisteredRouter } from '@tanstack/react-router'
|
|
2
|
+
import type {
|
|
3
|
+
INavigationCatalogEntry,
|
|
4
|
+
INavigationCatalogGroup,
|
|
5
|
+
TRouteMessageKey,
|
|
6
|
+
} from './types'
|
|
7
|
+
|
|
8
|
+
type TAppRoute =
|
|
9
|
+
RegisteredRouter['routesById'][keyof RegisteredRouter['routesById']]
|
|
10
|
+
|
|
11
|
+
function fnGetParentRouteId(strRouteId: string) {
|
|
12
|
+
const nLastSeparatorIndex = strRouteId.lastIndexOf('/')
|
|
13
|
+
return nLastSeparatorIndex > 0
|
|
14
|
+
? strRouteId.slice(0, nLastSeparatorIndex)
|
|
15
|
+
: undefined
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function fnGetNavigationOrder(objRoute: TAppRoute) {
|
|
19
|
+
return (
|
|
20
|
+
objRoute.options.staticData?.nNavigationOrder ?? Number.MAX_SAFE_INTEGER
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function fnCompareNavigationEntries(
|
|
25
|
+
objLeft: INavigationCatalogEntry,
|
|
26
|
+
objRight: INavigationCatalogEntry,
|
|
27
|
+
fnCompare: (strLeft: string, strRight: string) => number
|
|
28
|
+
) {
|
|
29
|
+
return objLeft.nOrder === objRight.nOrder
|
|
30
|
+
? fnCompare(objLeft.strTitle, objRight.strTitle)
|
|
31
|
+
: objLeft.nOrder - objRight.nOrder
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** 判断路由是否满足导航目录的基础展示契约。 */
|
|
35
|
+
function fnIsNavigationRouteVisible(
|
|
36
|
+
objRoute: TAppRoute,
|
|
37
|
+
fnHasPermission: (strPermission?: string) => boolean
|
|
38
|
+
) {
|
|
39
|
+
const objStaticData = objRoute.options.staticData
|
|
40
|
+
|
|
41
|
+
return Boolean(
|
|
42
|
+
objStaticData?.bShowInSidebar !== false &&
|
|
43
|
+
objStaticData?.strTitle &&
|
|
44
|
+
objStaticData.Icon &&
|
|
45
|
+
fnHasPermission(objStaticData.strPermission)
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** 读取一个父路由下满足同一权限和可见性规则的直接子路由。 */
|
|
50
|
+
function fnGetVisibleNavigationChildren(
|
|
51
|
+
objRouter: RegisteredRouter,
|
|
52
|
+
objRoute: TAppRoute,
|
|
53
|
+
fnHasPermission: (strPermission?: string) => boolean
|
|
54
|
+
) {
|
|
55
|
+
return Object.values(objRouter.routesById).filter(
|
|
56
|
+
(objChildRoute) =>
|
|
57
|
+
fnGetParentRouteId(objChildRoute.id) === objRoute.id &&
|
|
58
|
+
fnIsNavigationRouteVisible(objChildRoute, fnHasPermission)
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function fnCreateNavigationEntry(
|
|
63
|
+
objRouter: RegisteredRouter,
|
|
64
|
+
objRoute: TAppRoute,
|
|
65
|
+
fnHasPermission: (strPermission?: string) => boolean,
|
|
66
|
+
fnCompare: (strLeft: string, strRight: string) => number,
|
|
67
|
+
fnTranslateRoute: (strKey: TRouteMessageKey) => string
|
|
68
|
+
): INavigationCatalogEntry | null {
|
|
69
|
+
const objStaticData = objRoute.options.staticData
|
|
70
|
+
if (
|
|
71
|
+
!objStaticData?.strTitle ||
|
|
72
|
+
!fnIsNavigationRouteVisible(objRoute, fnHasPermission)
|
|
73
|
+
) {
|
|
74
|
+
return null
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const arrChildren = fnGetVisibleNavigationChildren(
|
|
78
|
+
objRouter,
|
|
79
|
+
objRoute,
|
|
80
|
+
fnHasPermission
|
|
81
|
+
)
|
|
82
|
+
.map((objChildRoute) =>
|
|
83
|
+
fnCreateNavigationEntry(
|
|
84
|
+
objRouter,
|
|
85
|
+
objChildRoute,
|
|
86
|
+
fnHasPermission,
|
|
87
|
+
fnCompare,
|
|
88
|
+
fnTranslateRoute
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
.filter((objEntry): objEntry is INavigationCatalogEntry =>
|
|
92
|
+
Boolean(objEntry)
|
|
93
|
+
)
|
|
94
|
+
.sort((objLeft, objRight) =>
|
|
95
|
+
fnCompareNavigationEntries(objLeft, objRight, fnCompare)
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
if (Array.isArray(objRoute.children) && arrChildren.length === 0) return null
|
|
99
|
+
|
|
100
|
+
return Object.freeze({
|
|
101
|
+
arrChildren: Object.freeze(arrChildren),
|
|
102
|
+
nOrder: fnGetNavigationOrder(objRoute),
|
|
103
|
+
objRoute,
|
|
104
|
+
strTitle: fnTranslateRoute(objStaticData.strTitle),
|
|
105
|
+
})
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/** 从 Route metadata 创建侧栏、搜索和面包屑共用的稳定导航目录。 */
|
|
109
|
+
export function fnCreateNavigationCatalog(
|
|
110
|
+
objRouter: RegisteredRouter,
|
|
111
|
+
fnHasPermission: (strPermission?: string) => boolean,
|
|
112
|
+
fnCompare: (strLeft: string, strRight: string) => number,
|
|
113
|
+
fnTranslateRoute: (strKey: TRouteMessageKey) => string
|
|
114
|
+
): readonly INavigationCatalogGroup[] {
|
|
115
|
+
const objGroups = new Map<TRouteMessageKey, INavigationCatalogGroup>()
|
|
116
|
+
|
|
117
|
+
Object.values(objRouter.routesById).forEach((objRoute) => {
|
|
118
|
+
const objStaticData = objRoute.options.staticData
|
|
119
|
+
const strGroupKey = objStaticData?.strNavigationGroup
|
|
120
|
+
if (!strGroupKey) return
|
|
121
|
+
|
|
122
|
+
const objEntry = fnCreateNavigationEntry(
|
|
123
|
+
objRouter,
|
|
124
|
+
objRoute,
|
|
125
|
+
fnHasPermission,
|
|
126
|
+
fnCompare,
|
|
127
|
+
fnTranslateRoute
|
|
128
|
+
)
|
|
129
|
+
if (!objEntry) return
|
|
130
|
+
|
|
131
|
+
const objCurrentGroup = objGroups.get(strGroupKey)
|
|
132
|
+
objGroups.set(
|
|
133
|
+
strGroupKey,
|
|
134
|
+
Object.freeze({
|
|
135
|
+
arrEntries: Object.freeze([
|
|
136
|
+
...(objCurrentGroup?.arrEntries ?? []),
|
|
137
|
+
objEntry,
|
|
138
|
+
]),
|
|
139
|
+
nOrder:
|
|
140
|
+
objCurrentGroup?.nOrder ??
|
|
141
|
+
objStaticData.nNavigationGroupOrder ??
|
|
142
|
+
Number.MAX_SAFE_INTEGER,
|
|
143
|
+
strKey: strGroupKey,
|
|
144
|
+
strTitle: fnTranslateRoute(strGroupKey),
|
|
145
|
+
})
|
|
146
|
+
)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
return Object.freeze(
|
|
150
|
+
Array.from(objGroups.values())
|
|
151
|
+
.map((objGroup) =>
|
|
152
|
+
Object.freeze({
|
|
153
|
+
...objGroup,
|
|
154
|
+
arrEntries: Object.freeze(
|
|
155
|
+
[...objGroup.arrEntries].sort((objLeft, objRight) =>
|
|
156
|
+
fnCompareNavigationEntries(objLeft, objRight, fnCompare)
|
|
157
|
+
)
|
|
158
|
+
),
|
|
159
|
+
})
|
|
160
|
+
)
|
|
161
|
+
.sort((objLeft, objRight) =>
|
|
162
|
+
objLeft.nOrder === objRight.nOrder
|
|
163
|
+
? fnCompare(objLeft.strTitle, objRight.strTitle)
|
|
164
|
+
: objLeft.nOrder - objRight.nOrder
|
|
165
|
+
)
|
|
166
|
+
)
|
|
167
|
+
}
|