@contember/create 2.1.0-alpha.3 → 2.1.0-alpha.35
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/dist/development/run.cjs +6 -4
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js +6 -4
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs +37 -23
- package/dist/development/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js +37 -23
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs +1 -0
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js +1 -0
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +28 -12
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +28 -12
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs +22 -0
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -0
- package/dist/development/src/lib/packageManagerDetector.js +22 -0
- package/dist/development/src/lib/packageManagerDetector.js.map +1 -0
- package/dist/development/src/lib/version.cjs.map +1 -1
- package/dist/development/src/lib/version.js.map +1 -1
- package/dist/development/src/paths.cjs.map +1 -1
- package/dist/development/src/paths.js.map +1 -1
- package/dist/production/run.cjs +6 -4
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js +6 -4
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs +37 -23
- package/dist/production/src/commands/WorkspaceCreateCommand.cjs.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js +37 -23
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs +1 -0
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js +1 -0
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +28 -12
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +28 -12
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs +22 -0
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -0
- package/dist/production/src/lib/packageManagerDetector.js +22 -0
- package/dist/production/src/lib/packageManagerDetector.js.map +1 -0
- package/dist/production/src/lib/version.cjs.map +1 -1
- package/dist/production/src/lib/version.js.map +1 -1
- package/dist/production/src/paths.cjs.map +1 -1
- package/dist/production/src/paths.js.map +1 -1
- package/dist/types/commands/WorkspaceCreateCommand.d.ts +4 -2
- package/dist/types/commands/WorkspaceCreateCommand.d.ts.map +1 -1
- package/dist/types/lib/FileSystem.d.ts +1 -0
- package/dist/types/lib/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/dist/types/lib/packageManagerDetector.d.ts +3 -0
- package/dist/types/lib/packageManagerDetector.d.ts.map +1 -0
- package/package.json +15 -6
- package/resources/templates/{template-workspace → default}/.github/workflows/deploy.yaml +1 -1
- package/resources/templates/default/.gitignore.dist +154 -0
- package/resources/templates/default/README.md +98 -0
- package/resources/templates/{template-workspace → default}/admin/.env.development +1 -0
- package/resources/templates/default/admin/.env.production +6 -0
- package/resources/templates/{template-workspace → default}/admin/app/components/layout.tsx +7 -3
- package/resources/templates/default/admin/app/components/navigation.tsx +85 -0
- package/resources/templates/{template-workspace → default}/admin/app/index.tsx +4 -4
- package/resources/templates/default/admin/app/pages/tenant.tsx +160 -0
- package/resources/templates/default/admin/entrypoint/components/layout.tsx +14 -0
- package/resources/templates/default/admin/entrypoint/components/logged-in.tsx +47 -0
- package/resources/templates/default/admin/entrypoint/components/login.tsx +103 -0
- package/resources/templates/default/admin/entrypoint/config.ts +35 -0
- package/resources/templates/default/admin/entrypoint/contexts/login.tsx +18 -0
- package/resources/templates/default/admin/entrypoint/index.tsx +12 -0
- package/resources/templates/default/admin/entrypoint/login-entrypoint.tsx +24 -0
- package/resources/templates/default/admin/entrypoint/pages/index.tsx +48 -0
- package/resources/templates/default/admin/entrypoint/pages/magicLink.tsx +56 -0
- package/resources/templates/default/admin/entrypoint/pages/magicLinkSent.tsx +63 -0
- package/resources/templates/default/admin/entrypoint/pages/passwordReset.tsx +44 -0
- package/resources/templates/default/admin/entrypoint/pages/resetRequest.tsx +35 -0
- package/resources/templates/default/admin/entrypoint/pages/resetRequestSuccess.tsx +34 -0
- package/resources/templates/default/admin/index.css +94 -0
- package/resources/templates/{template-workspace → default}/admin/index.html +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/binding/binding.tsx +0 -2
- package/resources/templates/{template-workspace → default}/admin/lib/binding/hooks.tsx +14 -8
- package/resources/templates/default/admin/lib/binding/identity.tsx +51 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/navigation-guard-dialog.tsx +12 -8
- package/resources/templates/{template-workspace → default}/admin/lib/binding/persist.tsx +7 -5
- package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/block-repeater.tsx +14 -16
- package/resources/templates/{template-workspace → default}/admin/lib/board/board.tsx +61 -47
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/back-button.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/cells.tsx +49 -35
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-header.tsx +47 -38
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/columns.tsx +128 -105
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +63 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/empty.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/boolean.tsx +1 -4
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/common.tsx +14 -14
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/date.tsx +35 -21
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/defined.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/enum.tsx +24 -30
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/mobile.tsx +2 -3
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/number.tsx +0 -3
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/relation.tsx +36 -30
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/labels.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/loader.tsx +2 -7
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/pagination.tsx +33 -38
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/table.tsx +8 -6
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/tiles.tsx +10 -5
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/toolbar.tsx +10 -7
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/ui.tsx +12 -15
- package/resources/templates/{template-workspace → default}/admin/lib/dev/login-panel.tsx +23 -16
- package/resources/templates/{template-workspace → default}/admin/lib/dict.ts +17 -5
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +159 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/block-editor.tsx +22 -10
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/baseEditorPlugins.tsx +0 -2
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +205 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-block-toolbar.tsx +3 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-canvas.tsx +6 -4
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-editable-canvas.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/editor-inline-toolbar.tsx +5 -2
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/AnchorRenderer.tsx +18 -16
- package/resources/templates/default/admin/lib/editor/common/elements/BlockElement.tsx +60 -0
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableCellElementRenderer.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -7
- package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +1 -5
- package/resources/templates/{template-workspace → default}/admin/lib/editor/editor-block.tsx +17 -10
- package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text-view.tsx +11 -6
- package/resources/templates/{template-workspace → default}/admin/lib/editor/rich-text.tsx +6 -7
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +57 -0
- package/resources/templates/default/admin/lib/form/container.tsx +72 -0
- package/resources/templates/{template-workspace → default}/admin/lib/form/inputs.tsx +14 -12
- package/resources/templates/{template-workspace → default}/admin/lib/form/select.tsx +93 -51
- package/resources/templates/{template-workspace → default}/admin/lib/form/ui.tsx +1 -1
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +221 -0
- package/resources/templates/{template-workspace → default}/admin/lib/form/upload.tsx +61 -62
- package/resources/templates/{template-workspace → default}/admin/lib/labels/enum-labels.ts +6 -3
- package/resources/templates/{template-workspace → default}/admin/lib/labels/field-labels.ts +4 -2
- package/resources/templates/{template-workspace → default}/admin/lib/layout/layout-boxed.tsx +39 -29
- package/resources/templates/{template-workspace → default}/admin/lib/layout/slots.tsx +1 -4
- package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +10 -4
- package/resources/templates/{template-workspace → default}/admin/lib/repeater/repeater.tsx +24 -15
- package/resources/templates/{template-workspace → default}/admin/lib/select/create-new.tsx +0 -3
- package/resources/templates/{template-workspace → default}/admin/lib/select/filter.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/select/list.tsx +33 -28
- package/resources/templates/default/admin/lib/select/multi-select.tsx +92 -0
- package/resources/templates/default/admin/lib/select/select.tsx +109 -0
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +138 -0
- package/resources/templates/{template-workspace → default}/admin/lib/select/ui.tsx +13 -11
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/change-my-password.tsx +21 -8
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/common.tsx +21 -12
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/create-api-key.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/invite.tsx +12 -7
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/login.tsx +26 -7
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/memberships-control.tsx +32 -20
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset-request.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/password-reset.tsx +21 -8
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin-init.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/passwordless-signin.tsx +25 -12
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/update-project-member.tsx +3 -4
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInviteUser.tsx +2 -3
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/api-key-list.tsx +5 -3
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-delete-dialog.tsx +13 -2
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/member-list.tsx +17 -11
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/person-list.tsx +6 -4
- package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/otp-setup.tsx +86 -59
- package/resources/templates/default/admin/lib/toast/toast.tsx +113 -0
- package/resources/templates/{template-workspace → default}/admin/lib/toast/toaster.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/alert-dialog.tsx +4 -3
- package/resources/templates/default/admin/lib/ui/button.tsx +30 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/card.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/ui/dimension.tsx +9 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/dropdown.tsx +18 -15
- package/resources/templates/default/admin/lib/ui/input.tsx +68 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/loader.tsx +1 -1
- package/resources/templates/{template-workspace → default}/admin/lib/ui/menu.tsx +3 -11
- package/resources/templates/{template-workspace → default}/admin/lib/ui/overlay.tsx +11 -9
- package/resources/templates/{template-workspace → default}/admin/lib/ui/popover.tsx +2 -2
- package/resources/templates/{template-workspace → default}/admin/lib/ui/property-list.tsx +5 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/scroll-area.tsx +11 -11
- package/resources/templates/{template-workspace → default}/admin/lib/ui/select.tsx +4 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sheet.tsx +9 -8
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sidebar.tsx +53 -42
- package/resources/templates/{template-workspace → default}/admin/lib/ui/sortable.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/switch.tsx +11 -0
- package/resources/templates/{template-workspace → default}/admin/lib/ui/table.tsx +3 -3
- package/resources/templates/{template-workspace → default}/admin/lib/ui/textarea.tsx +10 -7
- package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle-group.tsx +9 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/toggle.tsx +3 -5
- package/resources/templates/{template-workspace → default}/admin/lib/ui/tooltip.tsx +4 -3
- package/resources/templates/{template-workspace → default}/admin/lib/upload/dropzone.tsx +14 -10
- package/resources/templates/{template-workspace → default}/admin/lib/upload/repeater.tsx +0 -1
- package/resources/templates/{template-workspace → default}/admin/lib/upload/ui.tsx +4 -8
- package/resources/templates/{template-workspace → default}/admin/lib/upload/upload-progress.tsx +28 -12
- package/resources/templates/{template-workspace → default}/admin/lib/upload/view.tsx +130 -68
- package/resources/templates/{template-workspace → default}/admin/lib/utils/createComponentOpenHooks.tsx +10 -6
- package/resources/templates/{template-workspace → default}/admin/lib/utils/uic.tsx +24 -14
- package/resources/templates/{template-workspace → default}/admin/lib/utils/use-mobile.ts +1 -3
- package/resources/templates/{template-workspace → default}/admin/package.json +6 -4
- package/resources/templates/default/admin/sentry.ts +26 -0
- package/resources/templates/{template-workspace → default}/admin/tsconfig.json +1 -9
- package/resources/templates/default/admin/vite-env.d.ts +12 -0
- package/resources/templates/default/admin/vite.config.ts +11 -0
- package/resources/templates/default/api/README.md +87 -0
- package/resources/templates/{template-workspace → default}/biome.json +1 -1
- package/resources/templates/default/client/README.md +285 -0
- package/resources/templates/{template-workspace → default}/contember.template.yaml +5 -0
- package/resources/templates/{template-workspace → default}/package.json +1 -1
- package/resources/templates/default/scripts/generate-client.sh +7 -0
- package/resources/templates/default/scripts/update-ui-lib.sh +344 -0
- package/src/commands/WorkspaceCreateCommand.ts +41 -25
- package/src/lib/FileSystem.ts +1 -0
- package/src/lib/TemplateInstaller.ts +32 -12
- package/src/lib/packageManagerDetector.ts +24 -0
- package/src/run.ts +8 -7
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/resources/templates/template-workspace/.gitignore.dist +0 -3
- package/resources/templates/template-workspace/admin/app/components/navigation.tsx +0 -1
- package/resources/templates/template-workspace/admin/index.css +0 -53
- package/resources/templates/template-workspace/admin/index.tsx +0 -268
- package/resources/templates/template-workspace/admin/lib/binding/identity.tsx +0 -50
- package/resources/templates/template-workspace/admin/lib/datagrid/elements.tsx +0 -48
- package/resources/templates/template-workspace/admin/lib/dimensions/dimensions.tsx +0 -135
- package/resources/templates/template-workspace/admin/lib/editor/common/buttons.tsx +0 -83
- package/resources/templates/template-workspace/admin/lib/editor/common/elements/BlockElement.tsx +0 -48
- package/resources/templates/template-workspace/admin/lib/editor/sortable-block.tsx +0 -51
- package/resources/templates/template-workspace/admin/lib/form/container.tsx +0 -59
- package/resources/templates/template-workspace/admin/lib/form/upload-repeaters.tsx +0 -188
- package/resources/templates/template-workspace/admin/lib/select/multi-select.tsx +0 -96
- package/resources/templates/template-workspace/admin/lib/select/select.tsx +0 -104
- package/resources/templates/template-workspace/admin/lib/select/sortable-select.tsx +0 -136
- package/resources/templates/template-workspace/admin/lib/toast/toast.tsx +0 -112
- package/resources/templates/template-workspace/admin/lib/ui/button.tsx +0 -29
- package/resources/templates/template-workspace/admin/lib/ui/input.tsx +0 -69
- package/resources/templates/template-workspace/admin/lib/ui/switch.tsx +0 -9
- package/resources/templates/template-workspace/admin/postcss.config.js +0 -6
- package/resources/templates/template-workspace/admin/tailwind.config.js +0 -73
- package/resources/templates/template-workspace/admin/vite-env.d.ts +0 -7
- package/resources/templates/template-workspace/scripts/generate-client.sh +0 -8
- package/resources/templates/{template-workspace → default}/.github/scripts/setup-actions-variables.sh +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/components/logo.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/config.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/index.html +0 -0
- package/resources/templates/{template-workspace → default}/admin/app/pages/index.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/delete.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/binding/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/block-repeater/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/board/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/buttons/link-back-button.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/column-leaf.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/export.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/index.ts +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/text.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/grid.tsx +0 -0
- package/resources/templates/{template-workspace → default}/admin/lib/datagrid/index.ts +21 -21
- /package/resources/templates/{template-workspace → default}/admin/lib/datagrid/layout-switcher.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dev/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dev/todo.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/dimensions/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/HorizontalRuleRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ListItemRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/OrderedListRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ParagraphRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/ScrollTargetRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/elements/UnorderedListRenderer.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/common/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/editor/plugins.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/error-boundary.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/errors/use-error-formatter.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/field/formatted-field.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/field/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/form/labels.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/formatting/formatting.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/formatting/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/images/formatImageResizeUrl.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/images/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/labels/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/layout/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/layout/layout.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/outdated-application-dialog/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/repeater/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/highlight.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/select/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/forms/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/hooks/useInvite.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/listing/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/tenant/otp/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/toast/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/avatar.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/collapsible.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/divider.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/label.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/progress.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/separator.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/ui/skeleton.tsx +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/upload/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/cn.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/lib/utils/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/admin/public/favicon.png +0 -0
- /package/resources/templates/{template-workspace → default}/api/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/api/migrations/.gitkeep +0 -0
- /package/resources/templates/{template-workspace → default}/api/model/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/api/package.json +0 -0
- /package/resources/templates/{template-workspace → default}/api/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/client/package.json +0 -0
- /package/resources/templates/{template-workspace → default}/client/src/index.ts +0 -0
- /package/resources/templates/{template-workspace → default}/client/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/docker-compose.yaml +0 -0
- /package/resources/templates/{template-workspace → default}/tsconfig.json +0 -0
- /package/resources/templates/{template-workspace → default}/tsconfig.settings.json +0 -0
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/common.tsx
RENAMED
|
@@ -10,23 +10,23 @@ import { dict } from '../../dict'
|
|
|
10
10
|
export const DataGridNullFilter = ({ name }: {
|
|
11
11
|
name?: string
|
|
12
12
|
}) => {
|
|
13
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
14
13
|
name ??= useDataViewFilterName()
|
|
15
14
|
const [nullFilter, setNullFilter] = useDataViewNullFilter(name)
|
|
16
15
|
const toggleExcludeNull = useCallback(() => setNullFilter('toggleExclude'), [setNullFilter])
|
|
17
16
|
const toggleIncludeNull = useCallback(() => setNullFilter('toggleInclude'), [setNullFilter])
|
|
18
17
|
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<DataGridFilterSelectItemUI
|
|
21
|
+
onExclude={toggleExcludeNull}
|
|
22
|
+
onInclude={toggleIncludeNull}
|
|
23
|
+
isExcluded={nullFilter === 'exclude'}
|
|
24
|
+
isIncluded={nullFilter === 'include'}
|
|
25
|
+
>
|
|
26
|
+
<span className={'italic'}>
|
|
27
|
+
{dict.datagrid.na}
|
|
28
|
+
</span>
|
|
29
|
+
</DataGridFilterSelectItemUI>
|
|
30
|
+
</>
|
|
31
|
+
)
|
|
31
32
|
}
|
|
32
|
-
|
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/date.tsx
RENAMED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ReactNode, useId } from 'react'
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
DataViewDateFilter,
|
|
5
|
+
DataViewDateFilterInput,
|
|
6
|
+
DataViewDateFilterProps,
|
|
7
|
+
DataViewDateFilterResetTrigger,
|
|
8
|
+
DataViewNullFilterTrigger,
|
|
9
|
+
DateRangeFilterArtifacts,
|
|
10
|
+
useDataViewFilter,
|
|
11
|
+
useDataViewFilterName,
|
|
12
|
+
} from '@contember/react-dataview'
|
|
4
13
|
import { Component } from '@contember/interface'
|
|
5
14
|
import { Popover, PopoverContent, PopoverTrigger } from '../../ui/popover'
|
|
6
15
|
import { DataGridActiveFilterUI, DataGridFilterSelectTriggerUI, DataGridSingleFilterUI } from '../ui'
|
|
@@ -66,10 +75,8 @@ const DataGridDateFilterRange = () => {
|
|
|
66
75
|
return `≤ ${endFormatted}`
|
|
67
76
|
}
|
|
68
77
|
return undefined
|
|
69
|
-
|
|
70
78
|
}
|
|
71
79
|
|
|
72
|
-
|
|
73
80
|
const DataGridDateFilterList = () => (
|
|
74
81
|
<>
|
|
75
82
|
<DataViewDateFilterResetTrigger>
|
|
@@ -105,7 +112,6 @@ const DataGridDateFilterSelect = ({ label, ranges = defaultRanges }: {
|
|
|
105
112
|
label?: ReactNode
|
|
106
113
|
ranges?: DataGridPredefinedDateRange[]
|
|
107
114
|
}) => {
|
|
108
|
-
|
|
109
115
|
return (
|
|
110
116
|
<Popover>
|
|
111
117
|
<PopoverTrigger asChild>
|
|
@@ -113,11 +119,11 @@ const DataGridDateFilterSelect = ({ label, ranges = defaultRanges }: {
|
|
|
113
119
|
</PopoverTrigger>
|
|
114
120
|
<PopoverContent className="p-0">
|
|
115
121
|
<div className="flex">
|
|
116
|
-
{ranges?.length > 0 &&
|
|
117
|
-
|
|
118
|
-
<DataGridRangeFilter start={start} end={end} label={label} key={`${start}-${end}`} />
|
|
119
|
-
|
|
120
|
-
|
|
122
|
+
{ranges?.length > 0 && (
|
|
123
|
+
<div className="flex flex-col gap-2 bg-gray-50 p-4 border-r border-gray-200">
|
|
124
|
+
{ranges.map(({ start, end, label }) => <DataGridRangeFilter start={start} end={end} label={label} key={`${start}-${end}`} />)}
|
|
125
|
+
</div>
|
|
126
|
+
)}
|
|
121
127
|
<DataGridDateFilterControls layout={ranges?.length > 0 ? 'column' : 'row'} />
|
|
122
128
|
</div>
|
|
123
129
|
</PopoverContent>
|
|
@@ -125,18 +131,24 @@ const DataGridDateFilterSelect = ({ label, ranges = defaultRanges }: {
|
|
|
125
131
|
)
|
|
126
132
|
}
|
|
127
133
|
|
|
128
|
-
|
|
129
134
|
const DataGridRangeFilter = ({ start, end, label }: DataGridPredefinedDateRange) => {
|
|
130
135
|
const name = useDataViewFilterName()
|
|
131
136
|
const [filter, setFilter] = useDataViewFilter<DateRangeFilterArtifacts>(name)
|
|
132
137
|
const isActive = filter?.start === start && filter?.end === end
|
|
133
138
|
return (
|
|
134
|
-
<Button
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
<Button
|
|
140
|
+
variant="outline"
|
|
141
|
+
size="sm"
|
|
142
|
+
className={isActive ? 'shadow-inner bg-gray-100' : ''}
|
|
143
|
+
onClick={() => {
|
|
144
|
+
setFilter({
|
|
145
|
+
start,
|
|
146
|
+
end,
|
|
147
|
+
})
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{label}
|
|
151
|
+
</Button>
|
|
140
152
|
)
|
|
141
153
|
}
|
|
142
154
|
|
|
@@ -154,8 +166,9 @@ export const DataGridDateFilterControls = ({ layout }: { layout?: 'row' | 'colum
|
|
|
154
166
|
{dict.datagrid.dateStart}:
|
|
155
167
|
</Label>
|
|
156
168
|
<DataViewDateFilterResetTrigger type="start">
|
|
157
|
-
<span className="text-sm text-gray-500 cursor-pointer hover:bg-gray-100 rounded p-0.5"
|
|
158
|
-
className="w-3 h-3"
|
|
169
|
+
<span className="text-sm text-gray-500 cursor-pointer hover:bg-gray-100 rounded-sm p-0.5">
|
|
170
|
+
<XIcon className="w-3 h-3" />
|
|
171
|
+
</span>
|
|
159
172
|
</DataViewDateFilterResetTrigger>
|
|
160
173
|
</div>
|
|
161
174
|
<DataViewDateFilterInput type={'start'}>
|
|
@@ -168,8 +181,9 @@ export const DataGridDateFilterControls = ({ layout }: { layout?: 'row' | 'colum
|
|
|
168
181
|
{dict.datagrid.dateEnd}:
|
|
169
182
|
</Label>
|
|
170
183
|
<DataViewDateFilterResetTrigger type="end">
|
|
171
|
-
<span className="text-sm text-gray-500 cursor-pointer hover:bg-gray-100 rounded p-0.5"
|
|
172
|
-
className="w-3 h-3"
|
|
184
|
+
<span className="text-sm text-gray-500 cursor-pointer hover:bg-gray-100 rounded-sm p-0.5">
|
|
185
|
+
<XIcon className="w-3 h-3" />
|
|
186
|
+
</span>
|
|
173
187
|
</DataViewDateFilterResetTrigger>
|
|
174
188
|
</div>
|
|
175
189
|
<DataViewDateFilterInput type={'end'}>
|
|
@@ -177,7 +191,7 @@ export const DataGridDateFilterControls = ({ layout }: { layout?: 'row' | 'colum
|
|
|
177
191
|
</DataViewDateFilterInput>
|
|
178
192
|
</div>
|
|
179
193
|
</div>
|
|
180
|
-
<div className="mt-auto p-2 border-t">
|
|
194
|
+
<div className="mt-auto p-2 border-t border-gray-200">
|
|
181
195
|
<DataGridNullFilter />
|
|
182
196
|
</div>
|
|
183
197
|
</div>
|
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/enum.tsx
RENAMED
|
@@ -49,18 +49,16 @@ export type DataGridEnumFilterProps =
|
|
|
49
49
|
* <DataGridEnumFilter field={'status'} />
|
|
50
50
|
* ```
|
|
51
51
|
*/
|
|
52
|
-
export const DataGridEnumFilter = Component(({ options, label, ...props }: DataGridEnumFilterProps) =>
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
))
|
|
63
|
-
|
|
52
|
+
export const DataGridEnumFilter = Component(({ options, label, ...props }: DataGridEnumFilterProps) => (
|
|
53
|
+
<DataViewEnumFilter {...props}>
|
|
54
|
+
<DataGridFilterMobileHiding>
|
|
55
|
+
<DataGridSingleFilterUI>
|
|
56
|
+
<DataGridEnumFilterSelect options={options} label={label ?? <DataViewFieldLabel field={props.field} />} />
|
|
57
|
+
<DataGridEnumFilterList options={options} />
|
|
58
|
+
</DataGridSingleFilterUI>
|
|
59
|
+
</DataGridFilterMobileHiding>
|
|
60
|
+
</DataViewEnumFilter>
|
|
61
|
+
))
|
|
64
62
|
|
|
65
63
|
/**
|
|
66
64
|
* Props for {@link DataGridEnumListFilter}.
|
|
@@ -72,7 +70,6 @@ export type DataGridEnumListFilterProps =
|
|
|
72
70
|
label?: ReactNode
|
|
73
71
|
}
|
|
74
72
|
|
|
75
|
-
|
|
76
73
|
/**
|
|
77
74
|
* Enum list filter for DataGrid with default UI.
|
|
78
75
|
*
|
|
@@ -84,18 +81,16 @@ export type DataGridEnumListFilterProps =
|
|
|
84
81
|
* <DataGridEnumFilter field={'status'} />
|
|
85
82
|
* ```
|
|
86
83
|
*/
|
|
87
|
-
export const DataGridEnumListFilter = Component(({ options, label, ...props }: DataGridEnumListFilterProps) =>
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
))
|
|
98
|
-
|
|
84
|
+
export const DataGridEnumListFilter = Component(({ options, label, ...props }: DataGridEnumListFilterProps) => (
|
|
85
|
+
<DataViewEnumListFilter {...props}>
|
|
86
|
+
<DataGridFilterMobileHiding>
|
|
87
|
+
<DataGridSingleFilterUI>
|
|
88
|
+
<DataGridEnumFilterSelect options={options} label={label ?? <DataViewFieldLabel field={props.field} />} />
|
|
89
|
+
<DataGridEnumFilterList options={options} />
|
|
90
|
+
</DataGridSingleFilterUI>
|
|
91
|
+
</DataGridFilterMobileHiding>
|
|
92
|
+
</DataViewEnumListFilter>
|
|
93
|
+
))
|
|
99
94
|
|
|
100
95
|
/**
|
|
101
96
|
* Props for {@link DataGridEnumFieldTooltip}.
|
|
@@ -108,7 +103,9 @@ export type DataGridEnumFieldTooltipProps = Omit<DataViewEnumFilterProps, 'child
|
|
|
108
103
|
* ## Props {@link DataGridEnumFieldTooltipProps}
|
|
109
104
|
* field, label, ?name, ?options
|
|
110
105
|
*/
|
|
111
|
-
export const DataGridEnumFieldTooltip = (
|
|
106
|
+
export const DataGridEnumFieldTooltip = (
|
|
107
|
+
{ children, actions, value, ...props }: DataGridEnumFieldTooltipProps & { children: ReactNode; value: string; actions?: ReactNode },
|
|
108
|
+
) => (
|
|
112
109
|
<DataViewEnumFilter {...props}>
|
|
113
110
|
<TooltipProvider>
|
|
114
111
|
<Tooltip>
|
|
@@ -131,7 +128,6 @@ export const DataGridEnumFieldTooltip = ({ children, actions, value, ...props }:
|
|
|
131
128
|
</DataViewEnumFilter>
|
|
132
129
|
)
|
|
133
130
|
|
|
134
|
-
|
|
135
131
|
const DataGridEnumFilterList = ({ options }: {
|
|
136
132
|
options?: Record<string, ReactNode>
|
|
137
133
|
}) => {
|
|
@@ -159,7 +155,6 @@ const DataGridEnumFilterSelectItem = ({ value, children, filterFactory }: {
|
|
|
159
155
|
children: ReactNode
|
|
160
156
|
filterFactory: (value: string) => UseDataViewEnumFilter
|
|
161
157
|
}) => {
|
|
162
|
-
|
|
163
158
|
const [current, setFilter] = filterFactory(value)
|
|
164
159
|
const include = useCallback(() => setFilter('toggleInclude'), [setFilter])
|
|
165
160
|
const exclude = useCallback(() => setFilter('toggleExclude'), [setFilter])
|
|
@@ -171,9 +166,8 @@ const DataGridEnumFilterSelectItem = ({ value, children, filterFactory }: {
|
|
|
171
166
|
{children}
|
|
172
167
|
</DataGridFilterSelectItemUI>
|
|
173
168
|
)
|
|
174
|
-
|
|
175
169
|
}
|
|
176
|
-
const DataGridEnumFilterSelect = ({
|
|
170
|
+
const DataGridEnumFilterSelect = ({ options, label }: {
|
|
177
171
|
options?: Record<string, ReactNode>
|
|
178
172
|
label?: ReactNode
|
|
179
173
|
}) => {
|
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/mobile.tsx
RENAMED
|
@@ -4,10 +4,9 @@ import { createContext, ReactNode, useContext } from 'react'
|
|
|
4
4
|
|
|
5
5
|
export const DataGridShowFiltersContext = createContext(true)
|
|
6
6
|
|
|
7
|
-
export const DataGridFilterMobileHiding = ({ name,
|
|
8
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
7
|
+
export const DataGridFilterMobileHiding = ({ name, children }: { name?: string; children: ReactNode }) => {
|
|
9
8
|
name ??= useDataViewFilterName()
|
|
10
|
-
const [
|
|
9
|
+
const [, , { isEmpty }] = useDataViewFilter(name)
|
|
11
10
|
const isActive = !isEmpty
|
|
12
11
|
const alwaysShow = useContext(DataGridShowFiltersContext)
|
|
13
12
|
return (
|
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/number.tsx
RENAMED
|
@@ -50,7 +50,6 @@ export const DataGridNumberFilter = Component(({ label, ...props }: DataGridNumb
|
|
|
50
50
|
</DataViewNumberFilter>
|
|
51
51
|
))
|
|
52
52
|
|
|
53
|
-
|
|
54
53
|
const DataGridNumberFilterRange = () => {
|
|
55
54
|
const [artifact] = useDataViewFilter<NumberRangeFilterArtifacts>(useDataViewFilterName())
|
|
56
55
|
if (!artifact) {
|
|
@@ -68,7 +67,6 @@ const DataGridNumberFilterRange = () => {
|
|
|
68
67
|
return null
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
|
|
72
70
|
const DataGridNumberFilterList = () => (
|
|
73
71
|
<>
|
|
74
72
|
<DataViewNumberFilterResetTrigger>
|
|
@@ -85,7 +83,6 @@ const DataGridNumberFilterList = () => (
|
|
|
85
83
|
</>
|
|
86
84
|
)
|
|
87
85
|
|
|
88
|
-
|
|
89
86
|
const DataGridNumberFilterSelect = ({ label }: {
|
|
90
87
|
label?: ReactNode
|
|
91
88
|
}) => (
|
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/filters/relation.tsx
RENAMED
|
@@ -87,7 +87,7 @@ export type DataGridHasManyFilterProps =
|
|
|
87
87
|
* ```
|
|
88
88
|
*/
|
|
89
89
|
export const DataGridHasManyFilter = Component(({ label, children, ...props }: DataGridHasManyFilterProps) => (
|
|
90
|
-
<DataViewHasManyFilter {...props}
|
|
90
|
+
<DataViewHasManyFilter {...props}>
|
|
91
91
|
<DataGridFilterMobileHiding>
|
|
92
92
|
<DataGridRelationFilterInner label={label ?? <DataViewHasManyLabel field={props.field} />}>
|
|
93
93
|
{children}
|
|
@@ -144,16 +144,18 @@ export type DataGridHasOneTooltipProps =
|
|
|
144
144
|
* </HasOne>
|
|
145
145
|
* ```
|
|
146
146
|
*/
|
|
147
|
-
export const DataGridHasOneTooltip = Component<DataGridHasOneTooltipProps>(({ children, actions, ...props }) => (
|
|
148
|
-
|
|
149
|
-
<
|
|
147
|
+
export const DataGridHasOneTooltip = Component<DataGridHasOneTooltipProps>(({ children, actions, ...props }) => (
|
|
148
|
+
<>
|
|
149
|
+
<DataViewHasOneFilter {...props as DataViewHasOneFilterProps}>
|
|
150
|
+
<DataGridRelationFieldTooltipInner actions={actions}>
|
|
151
|
+
{children}
|
|
152
|
+
</DataGridRelationFieldTooltipInner>
|
|
153
|
+
</DataViewHasOneFilter>
|
|
154
|
+
<StaticRender>
|
|
150
155
|
{children}
|
|
151
|
-
</
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
{children}
|
|
155
|
-
</StaticRender>
|
|
156
|
-
</>))
|
|
156
|
+
</StaticRender>
|
|
157
|
+
</>
|
|
158
|
+
))
|
|
157
159
|
|
|
158
160
|
/**
|
|
159
161
|
* Props for {@link DataGridHasManyTooltip}.
|
|
@@ -179,7 +181,7 @@ export type DataGridHasManyTooltipProps =
|
|
|
179
181
|
* ```tsx
|
|
180
182
|
* <HasMany field="tags">
|
|
181
183
|
* <DataGridHasManyTooltip field={'tags'}>
|
|
182
|
-
* <button className="text-sm border rounded px-2 py-1">
|
|
184
|
+
* <button className="text-sm border border-gray-200 rounded-sm px-2 py-1">
|
|
183
185
|
* <Field field="name" />
|
|
184
186
|
* </button>
|
|
185
187
|
* </DataGridHasManyTooltip>
|
|
@@ -187,16 +189,18 @@ export type DataGridHasManyTooltipProps =
|
|
|
187
189
|
* ```
|
|
188
190
|
*/
|
|
189
191
|
export const DataGridHasManyTooltip = Component<DataGridHasManyTooltipProps>(({ children, actions, ...props }) => {
|
|
190
|
-
return (
|
|
191
|
-
|
|
192
|
-
<
|
|
192
|
+
return (
|
|
193
|
+
<>
|
|
194
|
+
<DataViewHasManyFilter {...props as DataViewHasManyFilterProps}>
|
|
195
|
+
<DataGridRelationFieldTooltipInner actions={actions}>
|
|
196
|
+
{children}
|
|
197
|
+
</DataGridRelationFieldTooltipInner>
|
|
198
|
+
</DataViewHasManyFilter>
|
|
199
|
+
<StaticRender>
|
|
193
200
|
{children}
|
|
194
|
-
</
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
{children}
|
|
198
|
-
</StaticRender>
|
|
199
|
-
</>)
|
|
201
|
+
</StaticRender>
|
|
202
|
+
</>
|
|
203
|
+
)
|
|
200
204
|
})
|
|
201
205
|
|
|
202
206
|
const DataGridRelationFieldTooltipInner = Component(({ children, actions }: { children: ReactNode; actions?: ReactNode }) => (
|
|
@@ -242,7 +246,9 @@ export const DataGridRelationFilteredItemsList = ({ children }: {
|
|
|
242
246
|
</>
|
|
243
247
|
)
|
|
244
248
|
|
|
245
|
-
const [, useFilterFactory, FilterFactoryContextProvider] = createRequiredContext<(value: EntityId) => UseDataViewRelationFilterResult>(
|
|
249
|
+
const [, useFilterFactory, FilterFactoryContextProvider] = createRequiredContext<(value: EntityId) => UseDataViewRelationFilterResult>(
|
|
250
|
+
'FilterFactoryContext',
|
|
251
|
+
)
|
|
246
252
|
|
|
247
253
|
type DataGridRelationFilterSelectItemProps = {
|
|
248
254
|
children: ReactNode
|
|
@@ -268,7 +274,6 @@ const DataGridRelationFilterSelectItem = forwardRef<HTMLButtonElement, DataGridR
|
|
|
268
274
|
)
|
|
269
275
|
})
|
|
270
276
|
|
|
271
|
-
|
|
272
277
|
const DataGridRelationFilterSelect = ({ children, queryField, label }: {
|
|
273
278
|
queryField?: DataViewUnionFilterFields
|
|
274
279
|
children: ReactNode
|
|
@@ -315,12 +320,13 @@ type DataGridRelationFilterControlsInnerProps = {
|
|
|
315
320
|
children: ReactNode
|
|
316
321
|
}
|
|
317
322
|
const DataGridRelationFilterControlsInner = Component<DataGridRelationFilterControlsInnerProps>(({ children }) => {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
323
|
+
return (
|
|
324
|
+
<>
|
|
325
|
+
<SelectListInner filterToolbar={<SelectDefaultFilter />}>
|
|
326
|
+
<DataGridRelationFilterSelectItem>
|
|
327
|
+
{children}
|
|
328
|
+
</DataGridRelationFilterSelectItem>
|
|
329
|
+
</SelectListInner>
|
|
330
|
+
</>
|
|
331
|
+
)
|
|
326
332
|
})
|
|
@@ -42,11 +42,6 @@ export const DataGridLoader = ({ children }: { children: ReactNode }) => (
|
|
|
42
42
|
</>
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
+
const DataGridOverlayLoader = () => <Loader position={'absolute'} />
|
|
45
46
|
|
|
46
|
-
const
|
|
47
|
-
<Loader position={'absolute'} />
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
const DataGridInitialLoader = () => (
|
|
51
|
-
<Loader position={'static'} />
|
|
52
|
-
)
|
|
47
|
+
const DataGridInitialLoader = () => <Loader position={'static'} />
|
package/resources/templates/{template-workspace → default}/admin/lib/datagrid/pagination.tsx
RENAMED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DataViewChangePageTrigger,
|
|
3
|
-
DataViewPagingStateView,
|
|
4
|
-
DataViewSetItemsPerPageTrigger,
|
|
5
|
-
} from '@contember/react-dataview'
|
|
1
|
+
import { DataViewChangePageTrigger, DataViewPagingStateView, DataViewSetItemsPerPageTrigger } from '@contember/react-dataview'
|
|
6
2
|
import { DropdownMenu } from '@radix-ui/react-dropdown-menu'
|
|
7
|
-
import {
|
|
8
|
-
ChevronDownIcon,
|
|
9
|
-
ChevronLeftIcon,
|
|
10
|
-
ChevronRightIcon,
|
|
11
|
-
ChevronsLeftIcon,
|
|
12
|
-
ChevronsRightIcon,
|
|
13
|
-
Loader2Icon,
|
|
14
|
-
} from 'lucide-react'
|
|
3
|
+
import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronsLeftIcon, ChevronsRightIcon, Loader2Icon } from 'lucide-react'
|
|
15
4
|
import { FC } from 'react'
|
|
16
5
|
import { dict, dictFormat } from '../dict'
|
|
17
6
|
import { Button } from '../ui/button'
|
|
@@ -22,7 +11,7 @@ const PaginationWrapper = uic('div', {
|
|
|
22
11
|
baseClass: 'flex gap-6 lg:gap-8 items-center justify-between mt-4 pb-4',
|
|
23
12
|
variants: {
|
|
24
13
|
sticky: {
|
|
25
|
-
true: 'sticky bottom-0 z-50 bg-
|
|
14
|
+
true: 'sticky bottom-0 z-50 bg-background pt-4 border-t border-gray-200',
|
|
26
15
|
},
|
|
27
16
|
},
|
|
28
17
|
})
|
|
@@ -42,29 +31,37 @@ interface DataGridPaginationProps {
|
|
|
42
31
|
export const DataGridPagination: FC<DataGridPaginationProps> = ({ sticky }) => (
|
|
43
32
|
<PaginationWrapper sticky={sticky}>
|
|
44
33
|
<div>
|
|
45
|
-
<DataViewPagingStateView
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
34
|
+
<DataViewPagingStateView
|
|
35
|
+
render={it => (
|
|
36
|
+
<>
|
|
37
|
+
<div className="flex gap-2 items-center">
|
|
38
|
+
<div className="font-normal text-sm text-gray-500">
|
|
39
|
+
{it.totalCount === undefined
|
|
40
|
+
? <Loader2Icon className="animate-spin h-3 w-3 inline-block" />
|
|
41
|
+
: dictFormat(dict.datagrid.pageRowsCount, {
|
|
42
|
+
totalCount: it.totalCount.toString(),
|
|
43
|
+
})}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</>
|
|
47
|
+
)}
|
|
48
|
+
/>
|
|
56
49
|
</div>
|
|
57
50
|
<div className="flex items-center space-x-2">
|
|
58
|
-
<DataViewPagingStateView
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
<DataViewPagingStateView
|
|
52
|
+
render={it => (
|
|
53
|
+
<>
|
|
54
|
+
<div className="flex gap-2 items-center">
|
|
55
|
+
<div className="text-sm">
|
|
56
|
+
{dictFormat(it.pagesCount !== undefined ? dict.datagrid.pageInfo : dict.datagrid.pageInfoShort, {
|
|
57
|
+
page: (it.pageIndex + 1).toString(),
|
|
58
|
+
pagesCount: it.pagesCount?.toString() ?? '',
|
|
59
|
+
})}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
</>
|
|
63
|
+
)}
|
|
64
|
+
/>
|
|
68
65
|
<DataViewChangePageTrigger page="first">
|
|
69
66
|
<Button
|
|
70
67
|
variant="outline"
|
|
@@ -105,12 +102,10 @@ export const DataGridPagination: FC<DataGridPaginationProps> = ({ sticky }) => (
|
|
|
105
102
|
</PaginationWrapper>
|
|
106
103
|
)
|
|
107
104
|
|
|
108
|
-
|
|
109
105
|
export const DataGridPerPageSelector = () => (
|
|
110
106
|
<div>
|
|
111
107
|
<p className="text-gray-400 text-xs font-semibold mb-1">{dict.datagrid.paginationRowsPerPage}</p>
|
|
112
|
-
<DropdownMenu
|
|
113
|
-
>
|
|
108
|
+
<DropdownMenu>
|
|
114
109
|
<DropdownMenuTrigger asChild>
|
|
115
110
|
<Button
|
|
116
111
|
variant="outline"
|
|
@@ -30,12 +30,14 @@ export const DataGridTable = Component<DataViewTableProps>(({ children }) => {
|
|
|
30
30
|
return (
|
|
31
31
|
<DataViewLayout
|
|
32
32
|
name="table"
|
|
33
|
-
label={
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
label={
|
|
34
|
+
<>
|
|
35
|
+
<SheetIcon className="w-3 h-3" />
|
|
36
|
+
<span>{dict.datagrid.showTable}</span>
|
|
37
|
+
</>
|
|
38
|
+
}
|
|
37
39
|
>
|
|
38
|
-
<div className="relative rounded-md border overflow-y-auto">
|
|
40
|
+
<div className="relative rounded-md border border-gray-200 overflow-y-auto">
|
|
39
41
|
<DataGridTableRenderer>
|
|
40
42
|
{children}
|
|
41
43
|
</DataGridTableRenderer>
|
|
@@ -81,7 +83,7 @@ const DataGridTableRenderer = Component<DataViewTableProps>(({ children }, env)
|
|
|
81
83
|
return <>{children}</>
|
|
82
84
|
})
|
|
83
85
|
|
|
84
|
-
const columnLeaf = new Leaf(node => node.props, DataGridColumnLeaf)
|
|
86
|
+
const columnLeaf = new Leaf(node => node.props as DataGridColumnLeafProps, DataGridColumnLeaf)
|
|
85
87
|
|
|
86
88
|
const datagridColumnsAnalyzer = new ChildrenAnalyzer<
|
|
87
89
|
DataGridColumnLeafProps,
|
|
@@ -23,12 +23,17 @@ export interface DataGridTilesProps {
|
|
|
23
23
|
* </DataGridTiles>
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export const DataGridTiles = Component<
|
|
26
|
+
export const DataGridTiles = Component<DataGridTilesProps>(({ children, className }) => {
|
|
27
27
|
return (
|
|
28
|
-
<DataViewLayout
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
<DataViewLayout
|
|
29
|
+
name={'grid'}
|
|
30
|
+
label={
|
|
31
|
+
<>
|
|
32
|
+
<LayoutGridIcon className={'w-3 h-3'} />
|
|
33
|
+
<span>{dict.datagrid.showGrid}</span>
|
|
34
|
+
</>
|
|
35
|
+
}
|
|
36
|
+
>
|
|
32
37
|
<div className={cn('grid grid-cols-2 md:grid-cols-4 gap-4', className)}>
|
|
33
38
|
<DataViewEachRow>
|
|
34
39
|
{children}
|
|
@@ -70,7 +70,6 @@ export const DataGridToolbar = Component<DataGridToolbarProps>(({ children, stic
|
|
|
70
70
|
<DataGridToolbarVisibleElements />
|
|
71
71
|
<DataGridPerPageSelector />
|
|
72
72
|
</div>
|
|
73
|
-
|
|
74
73
|
</PopoverContent>
|
|
75
74
|
</Popover>
|
|
76
75
|
|
|
@@ -83,13 +82,17 @@ export const DataGridToolbar = Component<DataGridToolbarProps>(({ children, stic
|
|
|
83
82
|
</div>
|
|
84
83
|
|
|
85
84
|
<div className="flex flex-1 flex-wrap gap-2">
|
|
86
|
-
{children ??
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
{children ?? (
|
|
86
|
+
<>
|
|
87
|
+
<DataGridQueryFilter />
|
|
88
|
+
</>
|
|
89
|
+
)}
|
|
89
90
|
</div>
|
|
90
91
|
</DataGridToolbarUI>
|
|
91
92
|
</DataGridShowFiltersContext.Provider>
|
|
92
93
|
)
|
|
93
|
-
}, ({ children }) =>
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
}, ({ children }) => (
|
|
95
|
+
<>
|
|
96
|
+
{children}
|
|
97
|
+
</>
|
|
98
|
+
))
|