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,690 @@
|
|
|
1
|
+
import type Handsontable from 'handsontable'
|
|
2
|
+
import type { CellProperties } from 'handsontable'
|
|
3
|
+
import {
|
|
4
|
+
TABLE_FIXED_END_BOUNDARY_CLASS,
|
|
5
|
+
TABLE_FIXED_END_CLASS,
|
|
6
|
+
} from './fixedEndOverlay'
|
|
7
|
+
import type { FixedEndSemanticReconciler } from './fixedEndOverlayAccessibility'
|
|
8
|
+
import { buildTableFixedEndOverlayLayoutKey } from './fixedEndOverlaySignature'
|
|
9
|
+
import { readHandsontableFixedEndDom } from './handsontableDomAdapter'
|
|
10
|
+
|
|
11
|
+
interface CachedOverlayRow {
|
|
12
|
+
tr: HTMLTableRowElement
|
|
13
|
+
cells: HTMLTableCellElement[]
|
|
14
|
+
signatures: Array<readonly unknown[]>
|
|
15
|
+
columnsKey: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface OverlaySectionCache {
|
|
19
|
+
rows: Map<number, CachedOverlayRow>
|
|
20
|
+
pool: CachedOverlayRow[]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface FixedEndOverlayElements {
|
|
24
|
+
root: HTMLDivElement
|
|
25
|
+
headerTable: HTMLTableElement
|
|
26
|
+
headerRow: HTMLTableRowElement
|
|
27
|
+
headerKey: string
|
|
28
|
+
body: HTMLDivElement
|
|
29
|
+
bodyTable: HTMLTableElement
|
|
30
|
+
bodyRows: HTMLTableSectionElement
|
|
31
|
+
bodyCache: OverlaySectionCache
|
|
32
|
+
footer: HTMLDivElement
|
|
33
|
+
footerTable: HTMLTableElement
|
|
34
|
+
footerRows: HTMLTableSectionElement
|
|
35
|
+
footerCache: OverlaySectionCache
|
|
36
|
+
widthsKey: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface VisibleOverlayRow {
|
|
40
|
+
visualRow: number
|
|
41
|
+
rect: DOMRect
|
|
42
|
+
currentRow: boolean
|
|
43
|
+
borderTopWidth: string
|
|
44
|
+
borderBottomWidth: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface CachedBorderWidths {
|
|
48
|
+
borderTopWidth: string
|
|
49
|
+
borderBottomWidth: string
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const TABLE_FIXED_END_BORDER_STYLE_CACHE_LIMIT = 256
|
|
53
|
+
|
|
54
|
+
const cacheBorderWidths = (
|
|
55
|
+
cache: Map<string, CachedBorderWidths>,
|
|
56
|
+
key: string,
|
|
57
|
+
value: CachedBorderWidths
|
|
58
|
+
) => {
|
|
59
|
+
if (
|
|
60
|
+
!cache.has(key) &&
|
|
61
|
+
cache.size >= TABLE_FIXED_END_BORDER_STYLE_CACHE_LIMIT
|
|
62
|
+
) {
|
|
63
|
+
const oldestKey = cache.keys().next().value
|
|
64
|
+
if (oldestKey !== undefined) cache.delete(oldestKey)
|
|
65
|
+
}
|
|
66
|
+
cache.set(key, value)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface TableFixedEndOverlayOptions {
|
|
70
|
+
getContainer: () => HTMLElement | undefined
|
|
71
|
+
getFixedColumnsEnd: () => number
|
|
72
|
+
getInstance: () => Handsontable | null | undefined
|
|
73
|
+
getDataRevision: () => number
|
|
74
|
+
semantics: FixedEndSemanticReconciler
|
|
75
|
+
ariaLabel: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const syncColumnWidths = (
|
|
79
|
+
table: HTMLTableElement,
|
|
80
|
+
widths: readonly number[]
|
|
81
|
+
) => {
|
|
82
|
+
let group = table.querySelector('colgroup')
|
|
83
|
+
if (!group) {
|
|
84
|
+
group = document.createElement('colgroup')
|
|
85
|
+
table.prepend(group)
|
|
86
|
+
}
|
|
87
|
+
while (group.children.length < widths.length) {
|
|
88
|
+
group.append(document.createElement('col'))
|
|
89
|
+
}
|
|
90
|
+
while (group.children.length > widths.length) group.lastElementChild?.remove()
|
|
91
|
+
widths.forEach((width, index) => {
|
|
92
|
+
const col = group.children[index] as HTMLTableColElement
|
|
93
|
+
col.style.width = `${width}px`
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const createOverlayHeaderLabel = (text: string) => {
|
|
98
|
+
const label = document.createElement('span')
|
|
99
|
+
label.className = 'table-component__fixed-end-overlay-header-label'
|
|
100
|
+
label.textContent = text
|
|
101
|
+
Object.assign(label.style, {
|
|
102
|
+
display: 'flex',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
justifyContent: 'center',
|
|
105
|
+
width: '100%',
|
|
106
|
+
height: '100%',
|
|
107
|
+
})
|
|
108
|
+
return label
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const createBorderStyleKey = (cell: HTMLElement, row: HTMLTableRowElement) => {
|
|
112
|
+
const documentRoot = cell.ownerDocument.documentElement
|
|
113
|
+
const themeRoot = cell.closest<HTMLElement>('.handsontable')
|
|
114
|
+
const componentRoot = cell.closest<HTMLElement>('.table-component')
|
|
115
|
+
return [
|
|
116
|
+
documentRoot.className,
|
|
117
|
+
documentRoot.style.cssText,
|
|
118
|
+
cell.ownerDocument.body?.className,
|
|
119
|
+
cell.ownerDocument.body?.style.cssText,
|
|
120
|
+
themeRoot?.className,
|
|
121
|
+
themeRoot?.style.cssText,
|
|
122
|
+
componentRoot?.className,
|
|
123
|
+
componentRoot?.style.cssText,
|
|
124
|
+
row.className,
|
|
125
|
+
row.sectionRowIndex,
|
|
126
|
+
row.matches(':first-child'),
|
|
127
|
+
row.matches(':last-child'),
|
|
128
|
+
cell.className,
|
|
129
|
+
cell.style.borderTopWidth,
|
|
130
|
+
cell.style.borderBottomWidth,
|
|
131
|
+
].join('\u0000')
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const resolveHeaderBorderBottomWidth = (
|
|
135
|
+
headerRow: HTMLTableRowElement | undefined,
|
|
136
|
+
cache: Map<string, CachedBorderWidths>
|
|
137
|
+
) => {
|
|
138
|
+
const sourceCell = Array.from(headerRow?.cells ?? []).find(
|
|
139
|
+
(cell) => !cell.classList.contains('hiddenHeader')
|
|
140
|
+
)
|
|
141
|
+
if (!sourceCell) return '0px'
|
|
142
|
+
const key = createBorderStyleKey(sourceCell, headerRow!)
|
|
143
|
+
const cached = cache.get(key)
|
|
144
|
+
if (cached) return cached.borderBottomWidth
|
|
145
|
+
const style =
|
|
146
|
+
sourceCell.ownerDocument.defaultView?.getComputedStyle(sourceCell)
|
|
147
|
+
const resolved = {
|
|
148
|
+
borderTopWidth: style?.borderTopWidth || '0px',
|
|
149
|
+
borderBottomWidth: style?.borderBottomWidth || '0px',
|
|
150
|
+
}
|
|
151
|
+
cacheBorderWidths(cache, key, resolved)
|
|
152
|
+
return resolved.borderBottomWidth
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const resolveRowBlockBorderWidths = (
|
|
156
|
+
row: HTMLTableRowElement,
|
|
157
|
+
cache: Map<string, CachedBorderWidths>
|
|
158
|
+
) => {
|
|
159
|
+
const sourceCell = Array.from(row.cells).find(
|
|
160
|
+
(cell) => cell.tagName === 'TD' && !cell.classList.contains('hiddenHeader')
|
|
161
|
+
)
|
|
162
|
+
if (!sourceCell) {
|
|
163
|
+
return { borderTopWidth: '0px', borderBottomWidth: '0px' }
|
|
164
|
+
}
|
|
165
|
+
const key = createBorderStyleKey(sourceCell, row)
|
|
166
|
+
const cached = cache.get(key)
|
|
167
|
+
if (cached) return cached
|
|
168
|
+
const style =
|
|
169
|
+
sourceCell.ownerDocument.defaultView?.getComputedStyle(sourceCell)
|
|
170
|
+
const resolved = {
|
|
171
|
+
borderTopWidth: style?.borderTopWidth || '0px',
|
|
172
|
+
borderBottomWidth: style?.borderBottomWidth || '0px',
|
|
173
|
+
}
|
|
174
|
+
cacheBorderWidths(cache, key, resolved)
|
|
175
|
+
return resolved
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
const resolveVisualRow = (row: HTMLTableRowElement) => {
|
|
179
|
+
const ariaIndex = Number(row.getAttribute('aria-rowindex'))
|
|
180
|
+
return Number.isFinite(ariaIndex) ? ariaIndex - 2 : -1
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const resolveCellSignature = (
|
|
184
|
+
hot: Handsontable,
|
|
185
|
+
row: number,
|
|
186
|
+
column: number,
|
|
187
|
+
width: number,
|
|
188
|
+
dataRevision: number
|
|
189
|
+
) => {
|
|
190
|
+
const meta = hot.getCellMeta(row, column) as CellProperties & {
|
|
191
|
+
className?: string
|
|
192
|
+
tableError?: unknown
|
|
193
|
+
}
|
|
194
|
+
const value = hot.getDataAtCell(row, column)
|
|
195
|
+
const renderer = hot.getCellRenderer(meta)
|
|
196
|
+
return {
|
|
197
|
+
meta,
|
|
198
|
+
renderer,
|
|
199
|
+
value,
|
|
200
|
+
width,
|
|
201
|
+
signature: [
|
|
202
|
+
// visualRow 会在排序/筛选后复用;物理行和数据版本共同保证业务回调不会保留旧 row。
|
|
203
|
+
hot.toPhysicalRow(row),
|
|
204
|
+
dataRevision,
|
|
205
|
+
value,
|
|
206
|
+
meta.className,
|
|
207
|
+
meta.tableError,
|
|
208
|
+
width,
|
|
209
|
+
renderer,
|
|
210
|
+
] as const,
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const signaturesEqual = (
|
|
215
|
+
left: readonly unknown[] | undefined,
|
|
216
|
+
right: readonly unknown[]
|
|
217
|
+
) =>
|
|
218
|
+
Boolean(
|
|
219
|
+
left &&
|
|
220
|
+
left.length === right.length &&
|
|
221
|
+
left.every((value, index) => Object.is(value, right[index]))
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
const renderOverlayCell = (
|
|
225
|
+
hot: Handsontable,
|
|
226
|
+
td: HTMLTableCellElement,
|
|
227
|
+
row: number,
|
|
228
|
+
column: number,
|
|
229
|
+
meta: CellProperties & { className?: string; tableError?: unknown },
|
|
230
|
+
renderer: ReturnType<Handsontable['getCellRenderer']>,
|
|
231
|
+
value: unknown,
|
|
232
|
+
width: number,
|
|
233
|
+
boundary: boolean,
|
|
234
|
+
height: number,
|
|
235
|
+
currentRow: boolean
|
|
236
|
+
) => {
|
|
237
|
+
// 行节点长期复用,先清理上一个 visual row 遗留的样式和语义。
|
|
238
|
+
td.removeAttribute('class')
|
|
239
|
+
td.removeAttribute('style')
|
|
240
|
+
td.removeAttribute('title')
|
|
241
|
+
renderer(hot, td, row, column, hot.colToProp(column), value, meta)
|
|
242
|
+
// overlay 是固定尾列在横向虚拟窗口外的唯一可见语义代理。
|
|
243
|
+
if (meta.className)
|
|
244
|
+
td.classList.add(...meta.className.split(/\s+/).filter(Boolean))
|
|
245
|
+
td.classList.add(TABLE_FIXED_END_CLASS)
|
|
246
|
+
td.classList.toggle(TABLE_FIXED_END_BOUNDARY_CLASS, boundary)
|
|
247
|
+
td.classList.toggle('table-component__current-row', currentRow)
|
|
248
|
+
Object.assign(td.style, {
|
|
249
|
+
position: 'static',
|
|
250
|
+
width: `${width}px`,
|
|
251
|
+
minWidth: `${width}px`,
|
|
252
|
+
maxWidth: `${width}px`,
|
|
253
|
+
height: `${height}px`,
|
|
254
|
+
})
|
|
255
|
+
td.tabIndex = -1
|
|
256
|
+
td.setAttribute('role', 'gridcell')
|
|
257
|
+
td.setAttribute('aria-colindex', String(column + 2))
|
|
258
|
+
td.dataset.visualRow = String(row)
|
|
259
|
+
td.dataset.visualColumn = String(column)
|
|
260
|
+
if (meta.tableError !== undefined) {
|
|
261
|
+
td.title =
|
|
262
|
+
typeof meta.tableError === 'string'
|
|
263
|
+
? meta.tableError
|
|
264
|
+
: meta.tableError instanceof Error
|
|
265
|
+
? meta.tableError.message
|
|
266
|
+
: String(meta.tableError)
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const syncRows = (
|
|
271
|
+
cache: OverlaySectionCache,
|
|
272
|
+
tbody: HTMLTableSectionElement,
|
|
273
|
+
hot: Handsontable,
|
|
274
|
+
rows: readonly VisibleOverlayRow[],
|
|
275
|
+
columns: readonly number[],
|
|
276
|
+
widths: readonly number[],
|
|
277
|
+
dataRevision: number
|
|
278
|
+
) => {
|
|
279
|
+
const columnsKey = columns.join(',')
|
|
280
|
+
const activeRows = new Set(rows.map(({ visualRow }) => visualRow))
|
|
281
|
+
cache.rows.forEach((entry, visualRow) => {
|
|
282
|
+
if (activeRows.has(visualRow)) return
|
|
283
|
+
entry.tr.remove()
|
|
284
|
+
cache.rows.delete(visualRow)
|
|
285
|
+
cache.pool.push(entry)
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
rows.forEach((visibleRow) => {
|
|
289
|
+
const { visualRow, rect, currentRow } = visibleRow
|
|
290
|
+
let entry = cache.rows.get(visualRow)
|
|
291
|
+
if (!entry) {
|
|
292
|
+
entry = cache.pool.pop() ?? {
|
|
293
|
+
tr: document.createElement('tr'),
|
|
294
|
+
cells: [],
|
|
295
|
+
signatures: [],
|
|
296
|
+
columnsKey: '',
|
|
297
|
+
}
|
|
298
|
+
// DOM 槽位可跨 visualRow 复用,业务闭包和签名必须重新生成。
|
|
299
|
+
entry.signatures = []
|
|
300
|
+
cache.rows.set(visualRow, entry)
|
|
301
|
+
}
|
|
302
|
+
if (entry.columnsKey !== columnsKey) {
|
|
303
|
+
entry.tr.replaceChildren()
|
|
304
|
+
entry.cells = []
|
|
305
|
+
entry.signatures = []
|
|
306
|
+
entry.columnsKey = columnsKey
|
|
307
|
+
}
|
|
308
|
+
entry.tr.style.height = `${rect.height}px`
|
|
309
|
+
entry.tr.setAttribute('role', 'row')
|
|
310
|
+
entry.tr.setAttribute('aria-rowindex', String(visualRow + 2))
|
|
311
|
+
|
|
312
|
+
columns.forEach((column, index) => {
|
|
313
|
+
let td = entry!.cells[index]
|
|
314
|
+
if (!td) {
|
|
315
|
+
td = document.createElement('td')
|
|
316
|
+
entry!.cells[index] = td
|
|
317
|
+
entry!.tr.append(td)
|
|
318
|
+
}
|
|
319
|
+
const { meta, renderer, value, width, signature } = resolveCellSignature(
|
|
320
|
+
hot,
|
|
321
|
+
visualRow,
|
|
322
|
+
column,
|
|
323
|
+
widths[index] ?? hot.getColWidth(column),
|
|
324
|
+
dataRevision
|
|
325
|
+
)
|
|
326
|
+
if (!signaturesEqual(entry!.signatures[index], signature)) {
|
|
327
|
+
renderOverlayCell(
|
|
328
|
+
hot,
|
|
329
|
+
td,
|
|
330
|
+
visualRow,
|
|
331
|
+
column,
|
|
332
|
+
meta,
|
|
333
|
+
renderer,
|
|
334
|
+
value,
|
|
335
|
+
width,
|
|
336
|
+
index === 0,
|
|
337
|
+
rect.height,
|
|
338
|
+
currentRow
|
|
339
|
+
)
|
|
340
|
+
entry!.signatures[index] = signature
|
|
341
|
+
} else {
|
|
342
|
+
td.classList.toggle('table-component__current-row', currentRow)
|
|
343
|
+
if (td.style.height !== `${rect.height}px`)
|
|
344
|
+
td.style.height = `${rect.height}px`
|
|
345
|
+
}
|
|
346
|
+
// Handsontable 会根据纵向滚动位置切换首个可见数据行的上边框。
|
|
347
|
+
// overlay 的第一条 DOM 行不一定是数据首行,必须镜像源单元格的块向边框,
|
|
348
|
+
// 否则会与 clone 表头边框叠成两条线。
|
|
349
|
+
td.style.borderTopWidth = visibleRow.borderTopWidth
|
|
350
|
+
td.style.borderBottomWidth = visibleRow.borderBottomWidth
|
|
351
|
+
})
|
|
352
|
+
})
|
|
353
|
+
// append 会按新的视觉顺序移动已有 tr,不销毁其子树。
|
|
354
|
+
tbody.append(...rows.map(({ visualRow }) => cache.rows.get(visualRow)!.tr))
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/** 只绘制当前纵向窗口中的固定尾列,并复用行/单元格 DOM。 */
|
|
358
|
+
export const createTableFixedEndOverlay = ({
|
|
359
|
+
getContainer,
|
|
360
|
+
getFixedColumnsEnd,
|
|
361
|
+
getInstance,
|
|
362
|
+
getDataRevision,
|
|
363
|
+
semantics,
|
|
364
|
+
ariaLabel,
|
|
365
|
+
}: TableFixedEndOverlayOptions) => {
|
|
366
|
+
let elements: FixedEndOverlayElements | undefined
|
|
367
|
+
let lastLayoutKey = ''
|
|
368
|
+
let lastSemanticColumnsKey = ''
|
|
369
|
+
let lastSemanticHeader: HTMLElement | undefined
|
|
370
|
+
let lastSemanticBottom: HTMLElement | null | undefined
|
|
371
|
+
const borderWidthsByStyle = new Map<string, CachedBorderWidths>()
|
|
372
|
+
|
|
373
|
+
const destroy = () => {
|
|
374
|
+
semantics.setActive(false)
|
|
375
|
+
elements?.root.remove()
|
|
376
|
+
elements = undefined
|
|
377
|
+
lastLayoutKey = ''
|
|
378
|
+
lastSemanticColumnsKey = ''
|
|
379
|
+
lastSemanticHeader = undefined
|
|
380
|
+
lastSemanticBottom = undefined
|
|
381
|
+
borderWidthsByStyle.clear()
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const ensureElements = () => {
|
|
385
|
+
const host = getContainer()
|
|
386
|
+
if (!host) return
|
|
387
|
+
if (elements?.root.isConnected) return elements
|
|
388
|
+
const themeRoot = host.querySelector<HTMLElement>('.handsontable') ?? host
|
|
389
|
+
const root = document.createElement('div')
|
|
390
|
+
root.className = 'table-component__fixed-end-overlay'
|
|
391
|
+
root.setAttribute('role', 'region')
|
|
392
|
+
root.setAttribute('aria-label', ariaLabel)
|
|
393
|
+
const headerTable = document.createElement('table')
|
|
394
|
+
headerTable.className = 'table-component__fixed-end-overlay-header'
|
|
395
|
+
const thead = document.createElement('thead')
|
|
396
|
+
const headerRow = document.createElement('tr')
|
|
397
|
+
thead.append(headerRow)
|
|
398
|
+
headerTable.append(thead)
|
|
399
|
+
const body = document.createElement('div')
|
|
400
|
+
body.className = 'table-component__fixed-end-overlay-body'
|
|
401
|
+
const bodyTable = document.createElement('table')
|
|
402
|
+
const bodyRows = document.createElement('tbody')
|
|
403
|
+
bodyTable.append(bodyRows)
|
|
404
|
+
body.append(bodyTable)
|
|
405
|
+
const footer = document.createElement('div')
|
|
406
|
+
footer.className = 'table-component__fixed-end-overlay-footer'
|
|
407
|
+
const footerTable = document.createElement('table')
|
|
408
|
+
const footerRows = document.createElement('tbody')
|
|
409
|
+
footerTable.append(footerRows)
|
|
410
|
+
footer.append(footerTable)
|
|
411
|
+
root.append(headerTable, body, footer)
|
|
412
|
+
root.addEventListener('mousedown', (event) => {
|
|
413
|
+
if (event.defaultPrevented) return
|
|
414
|
+
const cell =
|
|
415
|
+
event.target instanceof Element
|
|
416
|
+
? event.target.closest<HTMLTableCellElement>('td[data-visual-row]')
|
|
417
|
+
: null
|
|
418
|
+
if (!cell || !root.contains(cell)) return
|
|
419
|
+
const row = Number(cell.dataset.visualRow)
|
|
420
|
+
const column = Number(cell.dataset.visualColumn)
|
|
421
|
+
if (Number.isInteger(row) && Number.isInteger(column)) {
|
|
422
|
+
getInstance()?.selectCell(row, column, row, column, false)
|
|
423
|
+
}
|
|
424
|
+
})
|
|
425
|
+
themeRoot.append(root)
|
|
426
|
+
elements = {
|
|
427
|
+
root,
|
|
428
|
+
headerTable,
|
|
429
|
+
headerRow,
|
|
430
|
+
headerKey: '',
|
|
431
|
+
body,
|
|
432
|
+
bodyTable,
|
|
433
|
+
bodyRows,
|
|
434
|
+
bodyCache: { rows: new Map(), pool: [] },
|
|
435
|
+
footer,
|
|
436
|
+
footerTable,
|
|
437
|
+
footerRows,
|
|
438
|
+
footerCache: { rows: new Map(), pool: [] },
|
|
439
|
+
widthsKey: '',
|
|
440
|
+
}
|
|
441
|
+
return elements
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
const render = () => {
|
|
445
|
+
const host = getContainer()
|
|
446
|
+
const hot = getInstance()
|
|
447
|
+
const {
|
|
448
|
+
holder,
|
|
449
|
+
headerClone,
|
|
450
|
+
headerRow,
|
|
451
|
+
bottomClone,
|
|
452
|
+
masterRows,
|
|
453
|
+
bottomRows,
|
|
454
|
+
} = readHandsontableFixedEndDom(host)
|
|
455
|
+
if (!host || !hot || !holder || !headerClone || masterRows.length === 0) {
|
|
456
|
+
// HOT 重建或版本选择器失配时不能继续展示带旧业务闭包的操作层。
|
|
457
|
+
destroy()
|
|
458
|
+
return
|
|
459
|
+
}
|
|
460
|
+
const overlay = ensureElements()
|
|
461
|
+
if (!overlay) return
|
|
462
|
+
semantics.pruneDisconnected()
|
|
463
|
+
|
|
464
|
+
const totalColumns = hot.countCols()
|
|
465
|
+
const fixedColumnsEnd = getFixedColumnsEnd()
|
|
466
|
+
const firstFixedColumn = Math.max(0, totalColumns - fixedColumnsEnd)
|
|
467
|
+
const columns = Array.from(
|
|
468
|
+
{ length: totalColumns - firstFixedColumn },
|
|
469
|
+
(_, index) => firstFixedColumn + index
|
|
470
|
+
)
|
|
471
|
+
const widths = columns.map((column) => hot.getColWidth(column))
|
|
472
|
+
const semanticColumnsKey = columns.join(',')
|
|
473
|
+
const requiresSemanticReconcile =
|
|
474
|
+
!semantics.active ||
|
|
475
|
+
semanticColumnsKey !== lastSemanticColumnsKey ||
|
|
476
|
+
headerClone !== lastSemanticHeader ||
|
|
477
|
+
bottomClone !== lastSemanticBottom
|
|
478
|
+
semantics.setActive(true)
|
|
479
|
+
// 首次启用或 HOT 重建 clone 时全量去重;滚动复用的 td 由 afterRenderer 增量
|
|
480
|
+
// 更新,避免每个纵向滚动帧再次 querySelectorAll 整个可见窗口。
|
|
481
|
+
if (requiresSemanticReconcile) {
|
|
482
|
+
semantics.reconcile(
|
|
483
|
+
overlay.root,
|
|
484
|
+
[headerClone, ...masterRows, ...(bottomClone ? [bottomClone] : [])],
|
|
485
|
+
columns
|
|
486
|
+
)
|
|
487
|
+
lastSemanticColumnsKey = semanticColumnsKey
|
|
488
|
+
lastSemanticHeader = headerClone
|
|
489
|
+
lastSemanticBottom = bottomClone
|
|
490
|
+
}
|
|
491
|
+
const width = widths.reduce((sum, value) => sum + value, 0)
|
|
492
|
+
const layoutKey = buildTableFixedEndOverlayLayoutKey({
|
|
493
|
+
hot,
|
|
494
|
+
holder,
|
|
495
|
+
rows: masterRows,
|
|
496
|
+
bottomRows,
|
|
497
|
+
columns,
|
|
498
|
+
widths,
|
|
499
|
+
fixedColumnsEnd,
|
|
500
|
+
dataRevision: getDataRevision(),
|
|
501
|
+
})
|
|
502
|
+
if (elements?.root.isConnected && layoutKey === lastLayoutKey) return
|
|
503
|
+
lastLayoutKey = layoutKey
|
|
504
|
+
const overlayOffsetParent =
|
|
505
|
+
overlay.root.offsetParent instanceof HTMLElement
|
|
506
|
+
? overlay.root.offsetParent
|
|
507
|
+
: host
|
|
508
|
+
|
|
509
|
+
// 先完成全部布局读取,再集中写样式和 DOM,避免滚动帧中的强制回流。
|
|
510
|
+
const overlayOffsetParentRect = overlayOffsetParent.getBoundingClientRect()
|
|
511
|
+
const holderRect = holder.getBoundingClientRect()
|
|
512
|
+
const headerRect = headerClone.getBoundingClientRect()
|
|
513
|
+
const headerBorderBottomWidth = resolveHeaderBorderBottomWidth(
|
|
514
|
+
headerRow,
|
|
515
|
+
borderWidthsByStyle
|
|
516
|
+
)
|
|
517
|
+
const bottomRect = bottomClone?.getBoundingClientRect()
|
|
518
|
+
const measuredMasterRows = masterRows.map((row) => ({
|
|
519
|
+
row,
|
|
520
|
+
rect: row.getBoundingClientRect(),
|
|
521
|
+
...resolveRowBlockBorderWidths(row, borderWidthsByStyle),
|
|
522
|
+
}))
|
|
523
|
+
const measuredBottomRows = bottomRows.map((row) => ({
|
|
524
|
+
row,
|
|
525
|
+
rect: row.getBoundingClientRect(),
|
|
526
|
+
...resolveRowBlockBorderWidths(row, borderWidthsByStyle),
|
|
527
|
+
}))
|
|
528
|
+
const holderScaleX = holder.offsetWidth
|
|
529
|
+
? holderRect.width / holder.offsetWidth
|
|
530
|
+
: 1
|
|
531
|
+
const holderViewportLeft =
|
|
532
|
+
holderRect.left + holder.clientLeft * holderScaleX
|
|
533
|
+
const holderViewportRight =
|
|
534
|
+
holderRect.left + (holder.clientLeft + holder.clientWidth) * holderScaleX
|
|
535
|
+
const rtl = hot.isRtl()
|
|
536
|
+
const headerHeight = Math.max(
|
|
537
|
+
0,
|
|
538
|
+
Math.min(holderRect.height, headerRect.bottom - holderRect.top)
|
|
539
|
+
)
|
|
540
|
+
const activeBottomRect =
|
|
541
|
+
bottomRows.length > 0 &&
|
|
542
|
+
bottomRect &&
|
|
543
|
+
bottomRect.height > 0 &&
|
|
544
|
+
bottomRect.top > holderRect.top + headerHeight
|
|
545
|
+
? bottomRect
|
|
546
|
+
: undefined
|
|
547
|
+
// 固定尾列只是主表已渲染内容的视觉代理,不能用 holder 的完整视口高度
|
|
548
|
+
// 作为自身高度。数据不足一屏时,Handsontable 会保留空白视口;若 overlay
|
|
549
|
+
// 继续铺到 holder 底部,其表格边框就会把这段空白错误画成额外数据区。
|
|
550
|
+
// 数据溢出时,虚拟窗口中的末行会自然到达(或越过)视口底部,因此统一
|
|
551
|
+
// 以真实 DOM 内容底部裁剪即可,不需要再估算逻辑行高或滚动高度。
|
|
552
|
+
const renderedContentBottom = [
|
|
553
|
+
headerRect.bottom,
|
|
554
|
+
...measuredMasterRows.map(({ rect }) => rect.bottom),
|
|
555
|
+
...measuredBottomRows.map(({ rect }) => rect.bottom),
|
|
556
|
+
].reduce((maximum, bottom) => Math.max(maximum, bottom), holderRect.top)
|
|
557
|
+
const overlayBottom = Math.max(
|
|
558
|
+
holderRect.top + headerHeight,
|
|
559
|
+
Math.min(holderRect.bottom, renderedContentBottom)
|
|
560
|
+
)
|
|
561
|
+
const dataBottom = activeBottomRect
|
|
562
|
+
? Math.min(overlayBottom, activeBottomRect.top)
|
|
563
|
+
: overlayBottom
|
|
564
|
+
const footerBottom = overlayBottom
|
|
565
|
+
const footerHeight = Math.max(0, footerBottom - dataBottom)
|
|
566
|
+
const overlayHeight = Math.max(headerHeight, footerBottom - holderRect.top)
|
|
567
|
+
const toVisibleRow = ({
|
|
568
|
+
row,
|
|
569
|
+
rect,
|
|
570
|
+
borderTopWidth,
|
|
571
|
+
borderBottomWidth,
|
|
572
|
+
}: {
|
|
573
|
+
row: HTMLTableRowElement
|
|
574
|
+
rect: DOMRect
|
|
575
|
+
borderTopWidth: string
|
|
576
|
+
borderBottomWidth: string
|
|
577
|
+
}): VisibleOverlayRow => ({
|
|
578
|
+
visualRow: resolveVisualRow(row),
|
|
579
|
+
rect,
|
|
580
|
+
currentRow: Boolean(row.querySelector('td.table-component__current-row')),
|
|
581
|
+
borderTopWidth,
|
|
582
|
+
borderBottomWidth,
|
|
583
|
+
})
|
|
584
|
+
const visibleRows = measuredMasterRows
|
|
585
|
+
.filter(
|
|
586
|
+
({ rect }) =>
|
|
587
|
+
rect.bottom > holderRect.top + headerHeight && rect.top < dataBottom
|
|
588
|
+
)
|
|
589
|
+
.map(toVisibleRow)
|
|
590
|
+
.filter(({ visualRow }) => visualRow >= 0 && visualRow < hot.countRows())
|
|
591
|
+
const visibleBottomRows = measuredBottomRows
|
|
592
|
+
.filter(({ rect }) => rect.bottom > dataBottom && rect.top < footerBottom)
|
|
593
|
+
.map(toVisibleRow)
|
|
594
|
+
.filter(({ visualRow }) => visualRow >= 0 && visualRow < hot.countRows())
|
|
595
|
+
|
|
596
|
+
Object.assign(overlay.root.style, {
|
|
597
|
+
top: `${holderRect.top - overlayOffsetParentRect.top}px`,
|
|
598
|
+
insetInlineEnd: `${Math.max(
|
|
599
|
+
0,
|
|
600
|
+
rtl
|
|
601
|
+
? holderViewportLeft - overlayOffsetParentRect.left
|
|
602
|
+
: overlayOffsetParentRect.right - holderViewportRight
|
|
603
|
+
)}px`,
|
|
604
|
+
direction: rtl ? 'rtl' : 'ltr',
|
|
605
|
+
width: `${width}px`,
|
|
606
|
+
height: `${overlayHeight}px`,
|
|
607
|
+
})
|
|
608
|
+
overlay.headerTable.style.width = `${width}px`
|
|
609
|
+
overlay.headerTable.style.height = `${headerHeight}px`
|
|
610
|
+
overlay.body.style.top = `${headerHeight}px`
|
|
611
|
+
overlay.body.style.bottom = `${footerHeight}px`
|
|
612
|
+
Object.assign(overlay.footer.style, {
|
|
613
|
+
top: `${dataBottom - holderRect.top}px`,
|
|
614
|
+
height: `${footerHeight}px`,
|
|
615
|
+
display: footerHeight > 0 ? '' : 'none',
|
|
616
|
+
})
|
|
617
|
+
|
|
618
|
+
const widthsKey = widths.join(',')
|
|
619
|
+
if (overlay.widthsKey !== widthsKey) {
|
|
620
|
+
syncColumnWidths(overlay.headerTable, widths)
|
|
621
|
+
syncColumnWidths(overlay.bodyTable, widths)
|
|
622
|
+
syncColumnWidths(overlay.footerTable, widths)
|
|
623
|
+
overlay.widthsKey = widthsKey
|
|
624
|
+
}
|
|
625
|
+
const headerKey = `${headerHeight}|${headerBorderBottomWidth}|${columns
|
|
626
|
+
.map((column, index) => {
|
|
627
|
+
const label = hot.getColHeader(column)
|
|
628
|
+
const text = Array.isArray(label)
|
|
629
|
+
? String(label.at(-1) ?? '')
|
|
630
|
+
: String(label ?? '')
|
|
631
|
+
return `${column}:${widths[index]}:${text}`
|
|
632
|
+
})
|
|
633
|
+
.join('|')}`
|
|
634
|
+
if (overlay.headerKey !== headerKey) {
|
|
635
|
+
overlay.headerRow.replaceChildren(
|
|
636
|
+
...columns.map((column, index) => {
|
|
637
|
+
const th = document.createElement('th')
|
|
638
|
+
const label = hot.getColHeader(column)
|
|
639
|
+
const text = Array.isArray(label)
|
|
640
|
+
? String(label.at(-1) ?? '')
|
|
641
|
+
: String(label ?? '')
|
|
642
|
+
th.append(createOverlayHeaderLabel(text))
|
|
643
|
+
th.classList.add(TABLE_FIXED_END_CLASS)
|
|
644
|
+
th.classList.toggle(TABLE_FIXED_END_BOUNDARY_CLASS, index === 0)
|
|
645
|
+
Object.assign(th.style, {
|
|
646
|
+
position: 'static',
|
|
647
|
+
width: `${widths[index]}px`,
|
|
648
|
+
height: `${headerHeight}px`,
|
|
649
|
+
borderBottomWidth: headerBorderBottomWidth,
|
|
650
|
+
})
|
|
651
|
+
th.setAttribute('role', 'columnheader')
|
|
652
|
+
th.setAttribute('aria-colindex', String(column + 2))
|
|
653
|
+
return th
|
|
654
|
+
})
|
|
655
|
+
)
|
|
656
|
+
overlay.headerKey = headerKey
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
overlay.bodyTable.style.width = `${width}px`
|
|
660
|
+
overlay.bodyTable.style.top = visibleRows[0]
|
|
661
|
+
? `${visibleRows[0].rect.top - holderRect.top - headerHeight}px`
|
|
662
|
+
: '0px'
|
|
663
|
+
const dataRevision = getDataRevision()
|
|
664
|
+
syncRows(
|
|
665
|
+
overlay.bodyCache,
|
|
666
|
+
overlay.bodyRows,
|
|
667
|
+
hot,
|
|
668
|
+
visibleRows,
|
|
669
|
+
columns,
|
|
670
|
+
widths,
|
|
671
|
+
dataRevision
|
|
672
|
+
)
|
|
673
|
+
|
|
674
|
+
overlay.footerTable.style.width = `${width}px`
|
|
675
|
+
overlay.footerTable.style.top = visibleBottomRows[0]
|
|
676
|
+
? `${visibleBottomRows[0].rect.top - dataBottom}px`
|
|
677
|
+
: '0px'
|
|
678
|
+
syncRows(
|
|
679
|
+
overlay.footerCache,
|
|
680
|
+
overlay.footerRows,
|
|
681
|
+
hot,
|
|
682
|
+
visibleBottomRows,
|
|
683
|
+
columns,
|
|
684
|
+
widths,
|
|
685
|
+
dataRevision
|
|
686
|
+
)
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
return { render, destroy }
|
|
690
|
+
}
|