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,233 @@
|
|
|
1
|
+
import { resolvePageFormConfig } from './config'
|
|
2
|
+
import type {
|
|
3
|
+
IFormItem,
|
|
4
|
+
IFormProp,
|
|
5
|
+
PageFormMode,
|
|
6
|
+
PageFormRecord,
|
|
7
|
+
PageFormRule,
|
|
8
|
+
PageFormValidateFactory,
|
|
9
|
+
PageFormValidationIssue,
|
|
10
|
+
PageFormValidationResult,
|
|
11
|
+
ResolvedIFormItem,
|
|
12
|
+
IPageFormMessages,
|
|
13
|
+
} from './types'
|
|
14
|
+
|
|
15
|
+
const isEmptyPageFormValue = (value: unknown) =>
|
|
16
|
+
value === undefined ||
|
|
17
|
+
value === null ||
|
|
18
|
+
value === '' ||
|
|
19
|
+
(Array.isArray(value) && value.length === 0)
|
|
20
|
+
|
|
21
|
+
const decimalPlaces = (value: unknown) => {
|
|
22
|
+
const source = String(value).trim().toLowerCase()
|
|
23
|
+
const match = source.match(/^[+-]?(\d+)(?:\.(\d*))?(?:e([+-]?\d+))?$/)
|
|
24
|
+
if (!match) return 0
|
|
25
|
+
const fractionLength = match[2]?.length ?? 0
|
|
26
|
+
const exponent = Number(match[3] ?? 0)
|
|
27
|
+
return Math.max(0, fractionLength - exponent)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const issue = <TModel extends PageFormRecord>(
|
|
31
|
+
item: ResolvedIFormItem<TModel>,
|
|
32
|
+
code: string,
|
|
33
|
+
message: string
|
|
34
|
+
): PageFormValidationIssue => ({ prop: item.prop, code, message })
|
|
35
|
+
|
|
36
|
+
const validatePageFormValue = <TModel extends PageFormRecord>(
|
|
37
|
+
value: unknown,
|
|
38
|
+
item: ResolvedIFormItem<TModel>,
|
|
39
|
+
messages: IPageFormMessages
|
|
40
|
+
): PageFormValidationIssue | undefined => {
|
|
41
|
+
const label = item.label || messages.strFieldFallback
|
|
42
|
+
if (item.required && isEmptyPageFormValue(value)) {
|
|
43
|
+
return issue(item, 'required', messages.fnRequired(label))
|
|
44
|
+
}
|
|
45
|
+
if (isEmptyPageFormValue(value)) return
|
|
46
|
+
|
|
47
|
+
const source = String(value)
|
|
48
|
+
const numeric = Number(value)
|
|
49
|
+
const needsNumber =
|
|
50
|
+
item.isNumber ||
|
|
51
|
+
item.isPositiveNumber ||
|
|
52
|
+
item.isPositiveInt ||
|
|
53
|
+
item.decimalsLimit !== undefined
|
|
54
|
+
if (needsNumber && (!source.trim() || !Number.isFinite(numeric))) {
|
|
55
|
+
return issue(item, 'isNumber', messages.fnNumber(label))
|
|
56
|
+
}
|
|
57
|
+
if (item.isPositiveNumber && numeric <= 0) {
|
|
58
|
+
return issue(item, 'isPositiveNumber', messages.fnPositiveNumber(label))
|
|
59
|
+
}
|
|
60
|
+
if (item.isPositiveInt && (!Number.isInteger(numeric) || numeric <= 0)) {
|
|
61
|
+
return issue(item, 'isPositiveInt', messages.fnPositiveInt(label))
|
|
62
|
+
}
|
|
63
|
+
if (item.isEmail && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(source)) {
|
|
64
|
+
return issue(item, 'isEmail', messages.fnInvalidFormat(label))
|
|
65
|
+
}
|
|
66
|
+
if (item.isPhone && !/^1[3-9]\d{9}$/.test(source)) {
|
|
67
|
+
return issue(item, 'isPhone', messages.fnInvalidFormat(label))
|
|
68
|
+
}
|
|
69
|
+
if (item.notChinese && /[\u3400-\u9fff]/u.test(source)) {
|
|
70
|
+
return issue(item, 'notChinese', messages.fnNoChinese(label))
|
|
71
|
+
}
|
|
72
|
+
if (
|
|
73
|
+
item.lengthGreaterThan !== undefined &&
|
|
74
|
+
source.length <= item.lengthGreaterThan
|
|
75
|
+
) {
|
|
76
|
+
return issue(
|
|
77
|
+
item,
|
|
78
|
+
'lengthGreaterThan',
|
|
79
|
+
messages.fnLengthGreaterThan(item.lengthGreaterThan, label)
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
if (
|
|
83
|
+
item.decimalsLimit !== undefined &&
|
|
84
|
+
item.decimalsLimit >= 0 &&
|
|
85
|
+
decimalPlaces(value) > item.decimalsLimit
|
|
86
|
+
) {
|
|
87
|
+
return issue(
|
|
88
|
+
item,
|
|
89
|
+
'decimalsLimit',
|
|
90
|
+
messages.fnDecimalsLimit(item.decimalsLimit, label)
|
|
91
|
+
)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const validatorRule = (
|
|
96
|
+
predicate: (value: unknown) => boolean,
|
|
97
|
+
message: string
|
|
98
|
+
): PageFormRule => ({
|
|
99
|
+
trigger: ['blur', 'change'],
|
|
100
|
+
validator: (_rule, value, callback) =>
|
|
101
|
+
predicate(value) || isEmptyPageFormValue(value)
|
|
102
|
+
? callback()
|
|
103
|
+
: callback(new Error(message)),
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
const createPageFormValidate = (
|
|
107
|
+
messages: IPageFormMessages
|
|
108
|
+
): PageFormValidateFactory => ({
|
|
109
|
+
required: () => ({ required: true, message: messages.fnRequired() }),
|
|
110
|
+
isNumber: () =>
|
|
111
|
+
validatorRule(
|
|
112
|
+
(value) => Number.isFinite(Number(value)),
|
|
113
|
+
messages.fnNumber()
|
|
114
|
+
),
|
|
115
|
+
isPositiveNumber: () =>
|
|
116
|
+
validatorRule((value) => Number(value) > 0, messages.fnPositiveNumber()),
|
|
117
|
+
isPositiveInt: () =>
|
|
118
|
+
validatorRule(
|
|
119
|
+
(value) => Number.isInteger(Number(value)) && Number(value) > 0,
|
|
120
|
+
messages.fnPositiveInt()
|
|
121
|
+
),
|
|
122
|
+
isEmail: () =>
|
|
123
|
+
validatorRule(
|
|
124
|
+
(value) => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(value)),
|
|
125
|
+
messages.fnInvalidEmail()
|
|
126
|
+
),
|
|
127
|
+
isPhone: () =>
|
|
128
|
+
validatorRule(
|
|
129
|
+
(value) => /^1[3-9]\d{9}$/.test(String(value)),
|
|
130
|
+
messages.fnInvalidPhone()
|
|
131
|
+
),
|
|
132
|
+
notChinese: () =>
|
|
133
|
+
validatorRule(
|
|
134
|
+
(value) => !/[\u3400-\u9fff]/u.test(String(value)),
|
|
135
|
+
messages.fnNoChinese()
|
|
136
|
+
),
|
|
137
|
+
lengthGreaterThan: (length) =>
|
|
138
|
+
validatorRule(
|
|
139
|
+
(value) => String(value).length > length,
|
|
140
|
+
messages.fnLengthGreaterThan(length)
|
|
141
|
+
),
|
|
142
|
+
decimalsLimit: (places) =>
|
|
143
|
+
validatorRule(
|
|
144
|
+
(value) => decimalPlaces(value) <= places,
|
|
145
|
+
messages.fnDecimalsLimit(places)
|
|
146
|
+
),
|
|
147
|
+
maxValue: (maximum) =>
|
|
148
|
+
validatorRule(
|
|
149
|
+
(value) => Number(value) <= maximum,
|
|
150
|
+
messages.fnMaxValue(maximum)
|
|
151
|
+
),
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
const resolvePageFormRules = <TModel extends PageFormRecord>(
|
|
155
|
+
item: ResolvedIFormItem<TModel>,
|
|
156
|
+
messages: IPageFormMessages
|
|
157
|
+
) => item.rules?.(createPageFormValidate(messages)) ?? []
|
|
158
|
+
|
|
159
|
+
const runPageFormRule = async (
|
|
160
|
+
rule: PageFormRule,
|
|
161
|
+
value: unknown,
|
|
162
|
+
messages: IPageFormMessages
|
|
163
|
+
): Promise<string | undefined> => {
|
|
164
|
+
if (rule.required && isEmptyPageFormValue(value)) {
|
|
165
|
+
return rule.message ?? messages.fnRequired()
|
|
166
|
+
}
|
|
167
|
+
const validator = rule.validator
|
|
168
|
+
if (!validator) return
|
|
169
|
+
|
|
170
|
+
return new Promise<string | undefined>((resolve) => {
|
|
171
|
+
let settled = false
|
|
172
|
+
const finish = (error?: unknown) => {
|
|
173
|
+
if (settled) return
|
|
174
|
+
settled = true
|
|
175
|
+
resolve(
|
|
176
|
+
error instanceof Error
|
|
177
|
+
? error.message
|
|
178
|
+
: error === undefined
|
|
179
|
+
? undefined
|
|
180
|
+
: String(error)
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
const callbackMode = validator.length >= 3
|
|
186
|
+
const returned = validator(rule, value, finish)
|
|
187
|
+
if (returned && typeof returned.then === 'function') {
|
|
188
|
+
returned.then(() => {
|
|
189
|
+
if (!callbackMode) finish()
|
|
190
|
+
}, finish)
|
|
191
|
+
} else if (!callbackMode) {
|
|
192
|
+
finish()
|
|
193
|
+
}
|
|
194
|
+
} catch (error) {
|
|
195
|
+
finish(error)
|
|
196
|
+
}
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
export const validatePageForm = async <TModel extends PageFormRecord>(
|
|
201
|
+
model: TModel,
|
|
202
|
+
config: IFormProp<TModel>,
|
|
203
|
+
formType: PageFormMode,
|
|
204
|
+
signal: AbortSignal,
|
|
205
|
+
patches?: ReadonlyMap<string, Partial<Omit<IFormItem<TModel>, 'prop'>>>,
|
|
206
|
+
dependencies: Readonly<Record<string, unknown>> = {}
|
|
207
|
+
): Promise<PageFormValidationResult> => {
|
|
208
|
+
const resolved = resolvePageFormConfig(
|
|
209
|
+
config,
|
|
210
|
+
{ model, formType, dependencies },
|
|
211
|
+
patches
|
|
212
|
+
)
|
|
213
|
+
const issues: PageFormValidationIssue[] = []
|
|
214
|
+
for (const item of resolved.formItems) {
|
|
215
|
+
if (signal.aborted) throw signal.reason
|
|
216
|
+
if (!item.vIf) continue
|
|
217
|
+
const value = (model as Record<string, unknown>)[item.prop]
|
|
218
|
+
const builtInIssue = validatePageFormValue(value, item, resolved.messages)
|
|
219
|
+
if (builtInIssue) {
|
|
220
|
+
issues.push(builtInIssue)
|
|
221
|
+
continue
|
|
222
|
+
}
|
|
223
|
+
for (const rule of resolvePageFormRules(item, resolved.messages)) {
|
|
224
|
+
const message = await runPageFormRule(rule, value, resolved.messages)
|
|
225
|
+
if (signal.aborted) throw signal.reason
|
|
226
|
+
if (message) {
|
|
227
|
+
issues.push(issue(item, 'rules', message))
|
|
228
|
+
break
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return { valid: issues.length === 0, issues, firstIssue: issues[0] }
|
|
233
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
import type { TableConfiguration } from './config'
|
|
3
|
+
import { fnResolveAdvancedTableLicense } from './config/license'
|
|
4
|
+
import type { TableRow } from './engine/shared/types'
|
|
5
|
+
import { TableComponent, type ITableComponentProps } from './table'
|
|
6
|
+
|
|
7
|
+
export function AppTable<T extends TableRow = TableRow>({
|
|
8
|
+
config: objConfig,
|
|
9
|
+
...objProps
|
|
10
|
+
}: ITableComponentProps<T>) {
|
|
11
|
+
const objLicensedConfig = useMemo<TableConfiguration<T>>(
|
|
12
|
+
() => ({
|
|
13
|
+
...objConfig,
|
|
14
|
+
runtime: {
|
|
15
|
+
...objConfig.runtime,
|
|
16
|
+
licenseKey: fnResolveAdvancedTableLicense({
|
|
17
|
+
bProduction: import.meta.env.PROD,
|
|
18
|
+
strKey: import.meta.env.VITE_HANDSONTABLE_LICENSE_KEY,
|
|
19
|
+
}),
|
|
20
|
+
},
|
|
21
|
+
}),
|
|
22
|
+
[objConfig]
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
return <TableComponent {...objProps} config={objLicensedConfig} />
|
|
26
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Table source snapshot
|
|
2
|
+
|
|
3
|
+
来源仓库、固定 revision、导入日期、同步范围和再分发状态只记录在
|
|
4
|
+
[`tools/component-governance/manifest.json`](../../../tools/component-governance/manifest.json),
|
|
5
|
+
避免文档与构建门禁各自保存一份版本事实。
|
|
6
|
+
|
|
7
|
+
The snapshot intentionally excludes the Vue adapter, examples, publishing
|
|
8
|
+
configuration, and repository tooling. The original package split has been
|
|
9
|
+
reorganized for application ownership: framework-independent behavior lives in
|
|
10
|
+
`engine/`; React capabilities are grouped directly by table domain (`table/`,
|
|
11
|
+
`search/`, `selection/`, `toolbar/`, and related directories); shared
|
|
12
|
+
configuration and styles live in `config/` and `styles/`. Application Features
|
|
13
|
+
must import the public `AppTable` boundary instead of these implementation
|
|
14
|
+
directories.
|
|
15
|
+
The upstream React package's copied shadcn primitives and `cn` helper are also
|
|
16
|
+
excluded; the table implementation uses the application's shared `components/ui` and
|
|
17
|
+
`lib/utils` implementations.
|
|
18
|
+
|
|
19
|
+
The source repository did not contain a `LICENSE` or `NOTICE` file at the
|
|
20
|
+
recorded commit. Treat this snapshot as internal company code until ownership
|
|
21
|
+
and redistribution terms are documented. Handsontable retains its own license
|
|
22
|
+
requirements and production key policy. The release gate is recorded in
|
|
23
|
+
[`docs/component-source-governance.md`](../../../docs/component-source-governance.md).
|
|
24
|
+
|
|
25
|
+
同步前执行:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm components:diff -- \
|
|
29
|
+
--component AppTable \
|
|
30
|
+
--source-root /absolute/path/to/table-component
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
完成选择性移植和评审后才更新清单,并执行 `pnpm components:check` 与清单列出的回归
|
|
34
|
+
命令。
|
|
35
|
+
|
|
36
|
+
## 本轮选择性同步
|
|
37
|
+
|
|
38
|
+
已合并 StrictMode 单元格会话生命周期、框架单元格增量更新、配置差量更新、首次远程查询
|
|
39
|
+
高度收敛、统一固定尾列 overlay、边框与重复无障碍语义修复,以及布局动画后的最终测量。
|
|
40
|
+
本地筛选/排序、CSV/XLSX 导出和大选区求和使用可取消的分片任务。
|
|
41
|
+
|
|
42
|
+
继续保留全局 Locale 和单表文案覆盖、敏感列、未保存离开保护、许可证注入以及现有公共
|
|
43
|
+
入口。新密度菜单提供紧凑、标准、舒适三个明确选项,并持久化选择;偏好加载完成前禁用。
|
|
44
|
+
没有复制 Vue、示例、发布工具、上游 shadcn primitives 或包专用 `base.css`,应用已有全局
|
|
45
|
+
Tailwind Preflight。未恢复本地裁剪的无用受管配置 builder;补回运行时真正需要的配置差量
|
|
46
|
+
比较和异步求和依赖。
|
|
47
|
+
|
|
48
|
+
## 高度与交互迁移
|
|
49
|
+
|
|
50
|
+
- `table.height` 统一为 `'content' | 'fill' | number`,`TableHeight` 可从公共入口导入。
|
|
51
|
+
默认 `content`:内容少时收缩,内容超出父容器时内部滚动;`fill` 填满父容器可用高度。
|
|
52
|
+
- 移除 `table.maxHeight` 和任意 CSS 高度字符串。把 CSS 高度/最大高度放到父容器,再选择
|
|
53
|
+
`content` 或 `fill`。原来的 `height: '100%'` 对应 `height: 'fill'`。
|
|
54
|
+
- 数字高度继续支持,但不超过父容器可用空间。行高由 Handsontable 测量,仍支持通过
|
|
55
|
+
`table.settings.rowHeights` 或 `minRowHeights` 显式覆盖。
|
|
56
|
+
- 侧栏等宿主布局动画可传入瞬态 `layoutTransitioning`:动画期间为 `true`,结束或取消时
|
|
57
|
+
恢复 `false`。该信号不会进入业务配置或偏好;尺寸稳定后合并刷新并重新测量换行行高。
|
|
58
|
+
- 固定尾列现在只使用 Core overlay;不要再依赖原生 `fixedColumnsEnd` 设置或旧 sticky
|
|
59
|
+
DOM 标记判断是否固定。通过可见尾列、操作可用性和唯一可访问语义验证行为。
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
<div className='h-[480px] min-h-0'>
|
|
63
|
+
<AppTable
|
|
64
|
+
tableKey='orders'
|
|
65
|
+
config={{ ...objConfig, table: { ...objConfig.table, height: 'content' } }}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
本项目现有业务表格使用数字高度,无需迁移业务配置。验证覆盖公共入口、Locale、
|
|
71
|
+
StrictMode、密度持久化、首次查询、高度策略、布局收敛与取消、稳定本地排序、CSV/XLSX
|
|
72
|
+
安全导出及选区任务竞态;测试路径统一记录在来源清单中。
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useSyncExternalStore } from 'react'
|
|
2
|
+
import { createPortal } from 'react-dom'
|
|
3
|
+
import { ActionDropdownCell } from './actions/ActionDropdownCell'
|
|
4
|
+
import { TemporalPickerEditor } from './date/TemporalPickerEditor'
|
|
5
|
+
import { SelectCellEditor } from './select/SelectCellEditor'
|
|
6
|
+
import './tableCellLayer.css'
|
|
7
|
+
import { TooltipCell } from './tooltip/TooltipCell'
|
|
8
|
+
import type { ITableCellLayerSession } from './types'
|
|
9
|
+
import { useCellLayerLifecycle } from './useCellLayerLifecycle'
|
|
10
|
+
|
|
11
|
+
interface ITableCellLayerProps {
|
|
12
|
+
objLayer: ITableCellLayerSession
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** 一张表只渲染一个 React Portal,承载全部复杂单元格交互。 */
|
|
16
|
+
export function TableCellLayer({ objLayer }: ITableCellLayerProps) {
|
|
17
|
+
const objSnapshot = useSyncExternalStore(
|
|
18
|
+
objLayer.subscribe,
|
|
19
|
+
objLayer.getSnapshot,
|
|
20
|
+
objLayer.getSnapshot
|
|
21
|
+
)
|
|
22
|
+
useCellLayerLifecycle(objLayer, objSnapshot)
|
|
23
|
+
|
|
24
|
+
if (typeof document === 'undefined') return null
|
|
25
|
+
const objEditorRect = objSnapshot.editor.rect
|
|
26
|
+
|
|
27
|
+
return createPortal(
|
|
28
|
+
<>
|
|
29
|
+
{objSnapshot.editor.visible && objEditorRect ? (
|
|
30
|
+
<div
|
|
31
|
+
data-table-cell-layer='editor'
|
|
32
|
+
className='table-cell-layer__editor hgw-table-theme hgw-table-portal'
|
|
33
|
+
style={{
|
|
34
|
+
top: objEditorRect.top,
|
|
35
|
+
left: objEditorRect.left,
|
|
36
|
+
width: objEditorRect.width,
|
|
37
|
+
height: objEditorRect.height,
|
|
38
|
+
}}
|
|
39
|
+
onMouseDown={(objEvent) => objEvent.stopPropagation()}
|
|
40
|
+
onClick={(objEvent) => objEvent.stopPropagation()}
|
|
41
|
+
>
|
|
42
|
+
{objSnapshot.editor.type === 'select' ? (
|
|
43
|
+
<SelectCellEditor
|
|
44
|
+
key={objSnapshot.editor.nSessionId}
|
|
45
|
+
objLayer={objLayer}
|
|
46
|
+
objEditor={objSnapshot.editor}
|
|
47
|
+
/>
|
|
48
|
+
) : (
|
|
49
|
+
<TemporalPickerEditor
|
|
50
|
+
key={objSnapshot.editor.nSessionId}
|
|
51
|
+
objLayer={objLayer}
|
|
52
|
+
objEditor={objSnapshot.editor}
|
|
53
|
+
/>
|
|
54
|
+
)}
|
|
55
|
+
</div>
|
|
56
|
+
) : null}
|
|
57
|
+
|
|
58
|
+
<div
|
|
59
|
+
data-table-cell-layer='menu'
|
|
60
|
+
className='hgw-table-theme hgw-table-portal'
|
|
61
|
+
>
|
|
62
|
+
<ActionDropdownCell objLayer={objLayer} />
|
|
63
|
+
</div>
|
|
64
|
+
<div
|
|
65
|
+
data-table-cell-layer='tooltip'
|
|
66
|
+
className='hgw-table-theme hgw-table-portal'
|
|
67
|
+
>
|
|
68
|
+
<TooltipCell objLayer={objLayer} />
|
|
69
|
+
</div>
|
|
70
|
+
</>,
|
|
71
|
+
document.body
|
|
72
|
+
)
|
|
73
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { cn } from '@/lib/utils'
|
|
2
|
+
import {
|
|
3
|
+
DropdownMenu,
|
|
4
|
+
DropdownMenuContent,
|
|
5
|
+
DropdownMenuItem,
|
|
6
|
+
DropdownMenuTrigger,
|
|
7
|
+
} from '@/components/ui/dropdown-menu'
|
|
8
|
+
import type {
|
|
9
|
+
TableAction,
|
|
10
|
+
TableCellContext,
|
|
11
|
+
} from '@/components/AppTable/engine/cell/types'
|
|
12
|
+
import { runTableAction } from '@/components/AppTable/engine/shared/action'
|
|
13
|
+
import type { ITableCellLayerSession } from '../types'
|
|
14
|
+
|
|
15
|
+
interface IActionDropdownCellProps {
|
|
16
|
+
objLayer: ITableCellLayerSession
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function fnResolveActionValue<TValue>(
|
|
20
|
+
objValue: TValue | ((objContext: TableCellContext) => TValue) | undefined,
|
|
21
|
+
objContext: TableCellContext
|
|
22
|
+
) {
|
|
23
|
+
return typeof objValue === 'function'
|
|
24
|
+
? (objValue as (objResolvedContext: TableCellContext) => TValue)(objContext)
|
|
25
|
+
: objValue
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function ActionDropdownCell({ objLayer }: IActionDropdownCellProps) {
|
|
29
|
+
const objMenu = objLayer.getSnapshot().menu
|
|
30
|
+
if (!objMenu.visible || !objMenu.anchor || !objMenu.context) return null
|
|
31
|
+
const objRect = objMenu.anchor.getBoundingClientRect()
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<DropdownMenu
|
|
35
|
+
open
|
|
36
|
+
onOpenChange={(bOpen) => {
|
|
37
|
+
if (!bOpen) objLayer.adapter.close()
|
|
38
|
+
}}
|
|
39
|
+
>
|
|
40
|
+
<DropdownMenuTrigger asChild>
|
|
41
|
+
<button
|
|
42
|
+
type='button'
|
|
43
|
+
tabIndex={-1}
|
|
44
|
+
aria-hidden='true'
|
|
45
|
+
className='pointer-events-none fixed opacity-0'
|
|
46
|
+
style={{
|
|
47
|
+
top: objRect.top,
|
|
48
|
+
left: objRect.left,
|
|
49
|
+
width: objRect.width,
|
|
50
|
+
height: objRect.height,
|
|
51
|
+
}}
|
|
52
|
+
/>
|
|
53
|
+
</DropdownMenuTrigger>
|
|
54
|
+
<DropdownMenuContent
|
|
55
|
+
data-table-cell-layer='menu-content'
|
|
56
|
+
align='start'
|
|
57
|
+
side='bottom'
|
|
58
|
+
collisionPadding={8}
|
|
59
|
+
className='z-(--z-index-table-cell-menu) min-w-40'
|
|
60
|
+
onCloseAutoFocus={(objEvent) => objEvent.preventDefault()}
|
|
61
|
+
>
|
|
62
|
+
{objMenu.actions.map((objAction: TableAction) => {
|
|
63
|
+
const strLabel =
|
|
64
|
+
fnResolveActionValue(objAction.label, objMenu.context!) ?? ''
|
|
65
|
+
const strTitle = fnResolveActionValue(
|
|
66
|
+
objAction.title,
|
|
67
|
+
objMenu.context!
|
|
68
|
+
)
|
|
69
|
+
const bDisabled = Boolean(
|
|
70
|
+
fnResolveActionValue(objAction.disabled, objMenu.context!)
|
|
71
|
+
)
|
|
72
|
+
return (
|
|
73
|
+
<DropdownMenuItem
|
|
74
|
+
key={objAction.key}
|
|
75
|
+
title={strTitle}
|
|
76
|
+
disabled={bDisabled}
|
|
77
|
+
variant={objAction.type === 'danger' ? 'destructive' : 'default'}
|
|
78
|
+
className={cn(
|
|
79
|
+
objAction.type === 'success' && 'text-emerald-600',
|
|
80
|
+
objAction.type === 'warning' && 'text-amber-600',
|
|
81
|
+
objAction.type === 'info' && 'text-muted-foreground',
|
|
82
|
+
objAction.size === 'small' && 'text-xs',
|
|
83
|
+
objAction.size === 'large' && 'text-base',
|
|
84
|
+
objAction.className
|
|
85
|
+
)}
|
|
86
|
+
onSelect={() => {
|
|
87
|
+
objLayer.adapter.close()
|
|
88
|
+
runTableAction(
|
|
89
|
+
() => objAction.onClick(objMenu.context!),
|
|
90
|
+
(objError) => objLayer.adapter.reportActionError(objError)
|
|
91
|
+
)
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
{objAction.icon ? (
|
|
95
|
+
<i className={objAction.icon} aria-hidden='true' />
|
|
96
|
+
) : null}
|
|
97
|
+
<span>{strLabel}</span>
|
|
98
|
+
</DropdownMenuItem>
|
|
99
|
+
)
|
|
100
|
+
})}
|
|
101
|
+
</DropdownMenuContent>
|
|
102
|
+
</DropdownMenu>
|
|
103
|
+
)
|
|
104
|
+
}
|