@contember/create 2.1.0-alpha.30 → 2.1.0-alpha.36
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.map +1 -1
- package/dist/development/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/development/src/lib/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/FileSystem.js.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.cjs +4 -7
- package/dist/development/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/development/src/lib/TemplateInstaller.js +4 -7
- package/dist/development/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/development/src/lib/packageManagerDetector.js.map +1 -1
- 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.map +1 -1
- package/dist/production/src/commands/WorkspaceCreateCommand.js.map +1 -1
- package/dist/production/src/lib/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/FileSystem.js.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.cjs +4 -7
- package/dist/production/src/lib/TemplateInstaller.cjs.map +1 -1
- package/dist/production/src/lib/TemplateInstaller.js +4 -7
- package/dist/production/src/lib/TemplateInstaller.js.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.cjs.map +1 -1
- package/dist/production/src/lib/packageManagerDetector.js.map +1 -1
- 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.map +1 -1
- package/dist/types/lib/TemplateInstaller.d.ts.map +1 -1
- package/package.json +12 -7
- package/resources/templates/default/.github/workflows/deploy.yaml +1 -1
- package/resources/templates/default/admin/.env.production +6 -0
- package/resources/templates/default/admin/app/pages/tenant.tsx +2 -2
- package/resources/templates/default/admin/lib/binding/binding.tsx +0 -2
- package/resources/templates/default/admin/lib/binding/hooks.tsx +14 -8
- package/resources/templates/default/admin/lib/binding/identity.tsx +31 -30
- package/resources/templates/default/admin/lib/binding/navigation-guard-dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/block-repeater/block-repeater.tsx +10 -12
- package/resources/templates/default/admin/lib/board/board.tsx +59 -45
- package/resources/templates/default/admin/lib/buttons/back-button.tsx +1 -1
- package/resources/templates/default/admin/lib/datagrid/cells.tsx +49 -35
- package/resources/templates/default/admin/lib/datagrid/column-header.tsx +47 -38
- package/resources/templates/default/admin/lib/datagrid/columns.tsx +128 -105
- package/resources/templates/default/admin/lib/datagrid/elements.tsx +8 -4
- package/resources/templates/default/admin/lib/datagrid/filters/boolean.tsx +1 -4
- package/resources/templates/default/admin/lib/datagrid/filters/common.tsx +14 -14
- package/resources/templates/default/admin/lib/datagrid/filters/date.tsx +34 -20
- package/resources/templates/default/admin/lib/datagrid/filters/defined.tsx +0 -1
- package/resources/templates/default/admin/lib/datagrid/filters/enum.tsx +24 -30
- package/resources/templates/default/admin/lib/datagrid/filters/mobile.tsx +2 -3
- package/resources/templates/default/admin/lib/datagrid/filters/number.tsx +0 -3
- package/resources/templates/default/admin/lib/datagrid/filters/relation.tsx +35 -29
- package/resources/templates/default/admin/lib/datagrid/index.ts +21 -21
- package/resources/templates/default/admin/lib/datagrid/labels.tsx +0 -1
- package/resources/templates/default/admin/lib/datagrid/loader.tsx +2 -7
- package/resources/templates/default/admin/lib/datagrid/pagination.tsx +32 -37
- package/resources/templates/default/admin/lib/datagrid/table.tsx +7 -5
- package/resources/templates/default/admin/lib/datagrid/tiles.tsx +10 -5
- package/resources/templates/default/admin/lib/datagrid/toolbar.tsx +10 -7
- package/resources/templates/default/admin/lib/datagrid/ui.tsx +10 -13
- package/resources/templates/default/admin/lib/dev/login-panel.tsx +23 -16
- package/resources/templates/default/admin/lib/dict.ts +14 -4
- package/resources/templates/default/admin/lib/dimensions/dimensions.tsx +20 -8
- package/resources/templates/default/admin/lib/editor/block-editor.tsx +22 -10
- package/resources/templates/default/admin/lib/editor/common/baseEditorPlugins.tsx +0 -2
- package/resources/templates/default/admin/lib/editor/common/buttons.tsx +155 -33
- package/resources/templates/default/admin/lib/editor/common/editor-block-toolbar.tsx +3 -1
- package/resources/templates/default/admin/lib/editor/common/editor-canvas.tsx +5 -3
- package/resources/templates/default/admin/lib/editor/common/editor-editable-canvas.tsx +0 -1
- package/resources/templates/default/admin/lib/editor/common/editor-inline-toolbar.tsx +4 -1
- package/resources/templates/default/admin/lib/editor/common/elements/AnchorRenderer.tsx +18 -16
- package/resources/templates/default/admin/lib/editor/common/elements/BlockElement.tsx +46 -34
- package/resources/templates/default/admin/lib/editor/common/elements/HeadingRenderer.tsx +1 -1
- package/resources/templates/default/admin/lib/editor/common/elements/TableElementRenderer.tsx +2 -7
- package/resources/templates/default/admin/lib/editor/common/elements/TableRowElementRenderer.tsx +1 -5
- package/resources/templates/default/admin/lib/editor/editor-block.tsx +16 -9
- package/resources/templates/default/admin/lib/editor/rich-text-view.tsx +11 -6
- package/resources/templates/default/admin/lib/editor/rich-text.tsx +6 -7
- package/resources/templates/default/admin/lib/editor/sortable-block.tsx +31 -25
- package/resources/templates/default/admin/lib/form/container.tsx +20 -14
- package/resources/templates/default/admin/lib/form/inputs.tsx +10 -6
- package/resources/templates/default/admin/lib/form/select.tsx +74 -42
- package/resources/templates/default/admin/lib/form/upload-repeaters.tsx +56 -56
- package/resources/templates/default/admin/lib/form/upload.tsx +61 -65
- package/resources/templates/default/admin/lib/labels/enum-labels.ts +6 -3
- package/resources/templates/default/admin/lib/labels/field-labels.ts +4 -2
- package/resources/templates/default/admin/lib/layout/layout-boxed.tsx +36 -26
- package/resources/templates/default/admin/lib/layout/slots.tsx +1 -4
- package/resources/templates/default/admin/lib/outdated-application-dialog/outdated-application-dialog.tsx +10 -4
- package/resources/templates/default/admin/lib/repeater/repeater.tsx +21 -12
- package/resources/templates/default/admin/lib/select/create-new.tsx +0 -3
- package/resources/templates/default/admin/lib/select/filter.tsx +0 -1
- package/resources/templates/default/admin/lib/select/list.tsx +33 -28
- package/resources/templates/default/admin/lib/select/multi-select.tsx +66 -70
- package/resources/templates/default/admin/lib/select/select.tsx +77 -72
- package/resources/templates/default/admin/lib/select/sortable-select.tsx +84 -82
- package/resources/templates/default/admin/lib/select/ui.tsx +7 -5
- package/resources/templates/default/admin/lib/tenant/forms/change-my-password.tsx +21 -8
- package/resources/templates/default/admin/lib/tenant/forms/common.tsx +21 -12
- package/resources/templates/default/admin/lib/tenant/forms/create-api-key.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/invite.tsx +12 -7
- package/resources/templates/default/admin/lib/tenant/forms/login.tsx +26 -7
- package/resources/templates/default/admin/lib/tenant/forms/memberships-control.tsx +31 -19
- package/resources/templates/default/admin/lib/tenant/forms/password-reset-request.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/password-reset.tsx +21 -8
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin-init.tsx +9 -5
- package/resources/templates/default/admin/lib/tenant/forms/passwordless-signin.tsx +25 -12
- package/resources/templates/default/admin/lib/tenant/forms/update-project-member.tsx +3 -4
- package/resources/templates/default/admin/lib/tenant/hooks/useInviteUser.tsx +2 -3
- package/resources/templates/default/admin/lib/tenant/listing/api-key-list.tsx +5 -3
- package/resources/templates/default/admin/lib/tenant/listing/member-delete-dialog.tsx +13 -2
- package/resources/templates/default/admin/lib/tenant/listing/member-list.tsx +17 -11
- package/resources/templates/default/admin/lib/tenant/listing/person-list.tsx +6 -4
- package/resources/templates/default/admin/lib/tenant/otp/otp-setup.tsx +86 -59
- package/resources/templates/default/admin/lib/toast/toast.tsx +24 -22
- package/resources/templates/default/admin/lib/toast/toaster.tsx +0 -1
- package/resources/templates/default/admin/lib/ui/alert-dialog.tsx +4 -3
- package/resources/templates/default/admin/lib/ui/button.tsx +2 -1
- package/resources/templates/default/admin/lib/ui/dialog.tsx +12 -8
- package/resources/templates/default/admin/lib/ui/dropdown.tsx +17 -14
- package/resources/templates/default/admin/lib/ui/loader.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/menu.tsx +3 -11
- package/resources/templates/default/admin/lib/ui/overlay.tsx +11 -9
- package/resources/templates/default/admin/lib/ui/popover.tsx +1 -1
- package/resources/templates/default/admin/lib/ui/property-list.tsx +2 -2
- package/resources/templates/default/admin/lib/ui/scroll-area.tsx +11 -11
- package/resources/templates/default/admin/lib/ui/select.tsx +1 -2
- package/resources/templates/default/admin/lib/ui/sheet.tsx +6 -5
- package/resources/templates/default/admin/lib/ui/sidebar.tsx +41 -30
- package/resources/templates/default/admin/lib/ui/switch.tsx +5 -3
- package/resources/templates/default/admin/lib/ui/textarea.tsx +7 -4
- package/resources/templates/default/admin/lib/ui/toggle-group.tsx +9 -5
- package/resources/templates/default/admin/lib/ui/toggle.tsx +3 -4
- package/resources/templates/default/admin/lib/ui/tooltip.tsx +2 -1
- package/resources/templates/default/admin/lib/upload/dropzone.tsx +14 -10
- package/resources/templates/default/admin/lib/upload/repeater.tsx +0 -1
- package/resources/templates/default/admin/lib/upload/ui.tsx +0 -4
- package/resources/templates/default/admin/lib/upload/upload-progress.tsx +27 -11
- package/resources/templates/default/admin/lib/upload/view.tsx +129 -67
- package/resources/templates/default/admin/lib/utils/createComponentOpenHooks.tsx +10 -6
- package/resources/templates/default/admin/lib/utils/uic.tsx +24 -14
- package/resources/templates/default/admin/lib/utils/use-mobile.ts +1 -3
- package/resources/templates/default/admin/package.json +2 -3
- package/resources/templates/default/admin/vite.config.ts +1 -1
- package/src/commands/WorkspaceCreateCommand.ts +0 -1
- package/src/lib/TemplateInstaller.ts +3 -6
- package/src/run.ts +8 -7
- package/dist/types/tsconfig.tsbuildinfo +0 -1
- package/resources/templates/default/admin/postcss.config.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageManagerDetector.js","sources":["../../../../../packages/create/src/lib/packageManagerDetector.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { join } from 'node:path'\n\nexport type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun'\n\nexport const detectPackageManager = (): PackageManager => {\n\tconst userAgent = process.env.npm_config_user_agent\n\n\tif (userAgent) {\n\t\tif (userAgent.startsWith('yarn/')) return 'yarn'\n\t\tif (userAgent.startsWith('pnpm/')) return 'pnpm'\n\t\tif (userAgent.startsWith('npm/')) return 'npm'\n\t\tif (userAgent.startsWith('bun/')) return 'bun'\n\t}\n\n\tconst cwd = process.cwd()\n\tif (existsSync(join(cwd, 'yarn.lock'))) return 'yarn'\n\tif (existsSync(join(cwd, 'pnpm-lock.yaml'))) return 'pnpm'\n\tif (existsSync(join(cwd, 'package-lock.json'))) return 'npm'\n\tif (existsSync(join(cwd, 'bun.lockb'))) return 'bun'\n\tif (existsSync(join(cwd, 'bun.lock'))) return 'bun'\n\n\treturn 'npm'\n}\n"],"names":[],"mappings":";;AAKO,MAAM,uBAAuB,MAAsB;
|
|
1
|
+
{"version":3,"file":"packageManagerDetector.js","sources":["../../../../../packages/create/src/lib/packageManagerDetector.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { join } from 'node:path'\n\nexport type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun'\n\nexport const detectPackageManager = (): PackageManager => {\n\tconst userAgent = process.env.npm_config_user_agent\n\n\tif (userAgent) {\n\t\tif (userAgent.startsWith('yarn/')) return 'yarn'\n\t\tif (userAgent.startsWith('pnpm/')) return 'pnpm'\n\t\tif (userAgent.startsWith('npm/')) return 'npm'\n\t\tif (userAgent.startsWith('bun/')) return 'bun'\n\t}\n\n\tconst cwd = process.cwd()\n\tif (existsSync(join(cwd, 'yarn.lock'))) return 'yarn'\n\tif (existsSync(join(cwd, 'pnpm-lock.yaml'))) return 'pnpm'\n\tif (existsSync(join(cwd, 'package-lock.json'))) return 'npm'\n\tif (existsSync(join(cwd, 'bun.lockb'))) return 'bun'\n\tif (existsSync(join(cwd, 'bun.lock'))) return 'bun'\n\n\treturn 'npm'\n}\n"],"names":[],"mappings":";;AAKO,MAAM,uBAAuB,MAAsB;AACzD,QAAM,YAAY,QAAQ,IAAI;AAE9B,MAAI,WAAW;AACd,QAAI,UAAU,WAAW,OAAO,EAAG,QAAO;AAC1C,QAAI,UAAU,WAAW,OAAO,EAAG,QAAO;AAC1C,QAAI,UAAU,WAAW,MAAM,EAAG,QAAO;AACzC,QAAI,UAAU,WAAW,MAAM,EAAG,QAAO;AAAA,EAC1C;AAEA,QAAM,MAAM,QAAQ,IAAA;AACpB,MAAI,WAAW,KAAK,KAAK,WAAW,CAAC,EAAG,QAAO;AAC/C,MAAI,WAAW,KAAK,KAAK,gBAAgB,CAAC,EAAG,QAAO;AACpD,MAAI,WAAW,KAAK,KAAK,mBAAmB,CAAC,EAAG,QAAO;AACvD,MAAI,WAAW,KAAK,KAAK,WAAW,CAAC,EAAG,QAAO;AAC/C,MAAI,WAAW,KAAK,KAAK,UAAU,CAAC,EAAG,QAAO;AAE9C,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.cjs","sources":["../../../../../packages/create/src/lib/version.ts"],"sourcesContent":["import { join } from 'node:path'\nimport fs from 'node:fs/promises'\nimport { packageRoot } from '../paths'\n\nexport const getPackageVersion = async () => {\n\treturn JSON.parse(await fs.readFile(join(packageRoot, 'package.json'), 'utf-8')).version\n}\n"],"names":["join","packageRoot"],"mappings":";;;;;AAIO,MAAM,oBAAoB,YAAY;
|
|
1
|
+
{"version":3,"file":"version.cjs","sources":["../../../../../packages/create/src/lib/version.ts"],"sourcesContent":["import { join } from 'node:path'\nimport fs from 'node:fs/promises'\nimport { packageRoot } from '../paths'\n\nexport const getPackageVersion = async () => {\n\treturn JSON.parse(await fs.readFile(join(packageRoot, 'package.json'), 'utf-8')).version\n}\n"],"names":["join","packageRoot"],"mappings":";;;;;AAIO,MAAM,oBAAoB,YAAY;AAC5C,SAAO,KAAK,MAAM,MAAM,GAAG,SAASA,eAAKC,MAAAA,aAAa,cAAc,GAAG,OAAO,CAAC,EAAE;AAClF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../../../packages/create/src/lib/version.ts"],"sourcesContent":["import { join } from 'node:path'\nimport fs from 'node:fs/promises'\nimport { packageRoot } from '../paths'\n\nexport const getPackageVersion = async () => {\n\treturn JSON.parse(await fs.readFile(join(packageRoot, 'package.json'), 'utf-8')).version\n}\n"],"names":["fs"],"mappings":";;;AAIO,MAAM,oBAAoB,YAAY;
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../../../packages/create/src/lib/version.ts"],"sourcesContent":["import { join } from 'node:path'\nimport fs from 'node:fs/promises'\nimport { packageRoot } from '../paths'\n\nexport const getPackageVersion = async () => {\n\treturn JSON.parse(await fs.readFile(join(packageRoot, 'package.json'), 'utf-8')).version\n}\n"],"names":["fs"],"mappings":";;;AAIO,MAAM,oBAAoB,YAAY;AAC5C,SAAO,KAAK,MAAM,MAAMA,YAAG,SAAS,KAAK,aAAa,cAAc,GAAG,OAAO,CAAC,EAAE;AAClF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.cjs","sources":["../../../../packages/create/src/paths.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const resourcesDir = join(packageRoot, './resources')\n"],"names":["dirname","fileURLToPath","findPackageRoot","join"],"mappings":";;;;;;AAIA,MAAM,kBAAkBA,
|
|
1
|
+
{"version":3,"file":"paths.cjs","sources":["../../../../packages/create/src/paths.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const resourcesDir = join(packageRoot, './resources')\n"],"names":["dirname","fileURLToPath","findPackageRoot","join"],"mappings":";;;;;;AAIA,MAAM,kBAAkBA,UAAAA,QAAQC,uBAAc,OAAA,aAAA,cAAA,QAAA,KAAA,EAAA,cAAA,UAAA,EAAA,OAAA,0BAAA,uBAAA,QAAA,YAAA,MAAA,YAAA,uBAAA,OAAA,IAAA,IAAA,wBAAA,SAAA,OAAA,EAAA,IAAe,CAAC;AACvD,MAAM,cAAc,QAAQ,IAAI,8BAA8BC,UAAAA,gBAAgB,eAAe;AAC7F,MAAM,eAAeC,UAAAA,KAAK,aAAa,aAAa;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","sources":["../../../../packages/create/src/paths.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const resourcesDir = join(packageRoot, './resources')\n"],"names":[],"mappings":";;;AAIA,MAAM,kBAAkB,QAAQ,cAAc,YAAY,GAAG,CAAC;AACvD,MAAM,cAAc,QAAQ,IAAI,8BAA8B,gBAAgB,eAAe;
|
|
1
|
+
{"version":3,"file":"paths.js","sources":["../../../../packages/create/src/paths.ts"],"sourcesContent":["import { findPackageRoot } from '@contember/cli-common'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nconst currentFilePath = dirname(fileURLToPath(import.meta.url))\nexport const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)\nexport const resourcesDir = join(packageRoot, './resources')\n"],"names":[],"mappings":";;;AAIA,MAAM,kBAAkB,QAAQ,cAAc,YAAY,GAAG,CAAC;AACvD,MAAM,cAAc,QAAQ,IAAI,8BAA8B,gBAAgB,eAAe;AAC7F,MAAM,eAAe,KAAK,aAAa,aAAa;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceCreateCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/WorkspaceCreateCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAI5D,KAAK,IAAI,GAAG;IACX,WAAW,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,OAAO,GAAG;IACd,QAAQ,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEhE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,iBAAiB;IAKtD,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAM7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkspaceCreateCommand.d.ts","sourceRoot":"","sources":["../../../src/commands/WorkspaceCreateCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAG5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAI5D,KAAK,IAAI,GAAG;IACX,WAAW,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,KAAK,OAAO,GAAG;IACd,QAAQ,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,sBAAuB,SAAQ,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IAEhE,OAAO,CAAC,QAAQ,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,iBAAiB;IAKtD,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAI;cAM7D,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAcnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateInstaller.d.ts","sourceRoot":"","sources":["../../../src/lib/TemplateInstaller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"TemplateInstaller.d.ts","sourceRoot":"","sources":["../../../src/lib/TemplateInstaller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAIzC,qBAAa,iBAAiB;IAI5B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,EAAE;IAJpB,OAAO,CAAC,cAAc,CAAwB;gBAG5B,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,UAAU;IAOhC,eAAe,GACd,UAAU,MAAM,EAChB,WAAW,MAAM,EACjB,YAAW,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,mBAkFtC;IAED,OAAO,CAAC,kBAAkB,CAIzB;IAED,OAAO,CAAC,QAAQ,CAGf;CACD"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/create",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.36",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"bin": "dist/production/run.js",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@contember/cli-common": "
|
|
8
|
-
"chalk": "
|
|
9
|
-
"degit": "
|
|
10
|
-
"fs-extra": "
|
|
11
|
-
"js-yaml": "
|
|
7
|
+
"@contember/cli-common": "workspace:*",
|
|
8
|
+
"chalk": "catalog:",
|
|
9
|
+
"degit": "catalog:",
|
|
10
|
+
"fs-extra": "catalog:",
|
|
11
|
+
"js-yaml": "catalog:"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"pre-build": "rm -rf rm ./resources/templates/default/admin/lib && cp -r ../react-ui-lib/src ./resources/templates/default/admin/lib && rm ./resources/templates/default/admin/lib/index.ts ./resources/templates/default/admin/lib/tsconfig.json"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@types/degit": "
|
|
18
|
+
"@types/degit": "catalog:"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/contember/contember.git",
|
|
23
|
+
"directory": "packages/create"
|
|
19
24
|
}
|
|
20
25
|
}
|
|
@@ -64,7 +64,7 @@ export const Security = () => {
|
|
|
64
64
|
export const Members = () => {
|
|
65
65
|
const projectSlug = useProjectSlug()!
|
|
66
66
|
const showToast = useShowToast()
|
|
67
|
-
const memberListController = useRef<MemberListController>()
|
|
67
|
+
const memberListController = useRef<MemberListController>(undefined)
|
|
68
68
|
|
|
69
69
|
return (
|
|
70
70
|
<>
|
|
@@ -110,7 +110,7 @@ export const Members = () => {
|
|
|
110
110
|
export const ApiKeys = () => {
|
|
111
111
|
const projectSlug = useProjectSlug()!
|
|
112
112
|
const showToast = useShowToast()
|
|
113
|
-
const memberListController = useRef<MemberListController>()
|
|
113
|
+
const memberListController = useRef<MemberListController>(undefined)
|
|
114
114
|
|
|
115
115
|
return (
|
|
116
116
|
<>
|
|
@@ -29,7 +29,6 @@ export interface BindingStateRendererProps {
|
|
|
29
29
|
children?: ReactNode
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
32
|
function BindingStateRenderer({ accessorTreeState, children }: BindingStateRendererProps) {
|
|
34
33
|
useEffect(() => {
|
|
35
34
|
if (accessorTreeState.name === 'error' && accessorTreeState.error.type === 'unauthorized') {
|
|
@@ -55,4 +54,3 @@ function BindingStateRenderer({ accessorTreeState, children }: BindingStateRende
|
|
|
55
54
|
|
|
56
55
|
return <>{children}</>
|
|
57
56
|
}
|
|
58
|
-
|
|
@@ -14,7 +14,6 @@ export const usePersistWithFeedback = () => {
|
|
|
14
14
|
}, [onPersistSuccess, triggerPersist])
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
export const usePersistFeedbackHandlers = () => {
|
|
19
18
|
return {
|
|
20
19
|
onPersistSuccess: usePersistSuccessHandler(),
|
|
@@ -32,15 +31,18 @@ export const usePersistErrorHandler = () => {
|
|
|
32
31
|
title={dict.persist.invalidInputError}
|
|
33
32
|
children={<ul>{errorList.map((it, i) => <li key={i}>{it}</li>)}</ul>}
|
|
34
33
|
details={result.response?.errorMessage}
|
|
35
|
-
/>,
|
|
34
|
+
/>,
|
|
35
|
+
{
|
|
36
36
|
type: 'error',
|
|
37
|
-
}
|
|
37
|
+
},
|
|
38
|
+
)
|
|
38
39
|
} else if (result.type === 'invalidResponse') {
|
|
39
40
|
showToast(
|
|
40
41
|
<ToastContent
|
|
41
42
|
title={dict.persist.invalidResponseError}
|
|
42
43
|
children={dict.persist.invalidResponseErrorDetails}
|
|
43
|
-
/>,
|
|
44
|
+
/>,
|
|
45
|
+
{
|
|
44
46
|
type: 'error',
|
|
45
47
|
},
|
|
46
48
|
)
|
|
@@ -55,16 +57,20 @@ export const usePersistSuccessHandler = () => {
|
|
|
55
57
|
showToast(
|
|
56
58
|
<ToastContent
|
|
57
59
|
title={dict.persist.success}
|
|
58
|
-
/>,
|
|
60
|
+
/>,
|
|
61
|
+
{
|
|
59
62
|
type: 'success',
|
|
60
|
-
}
|
|
63
|
+
},
|
|
64
|
+
)
|
|
61
65
|
if (result.type === 'justSuccess' && result.afterPersistError) {
|
|
62
66
|
showToast(
|
|
63
67
|
<ToastContent
|
|
64
68
|
title={dict.persist.afterPersistError}
|
|
65
|
-
/>,
|
|
69
|
+
/>,
|
|
70
|
+
{
|
|
66
71
|
type: 'warning',
|
|
67
|
-
}
|
|
72
|
+
},
|
|
73
|
+
)
|
|
68
74
|
}
|
|
69
75
|
}, [showToast])
|
|
70
76
|
}
|
|
@@ -9,36 +9,37 @@ import { useEffect } from 'react'
|
|
|
9
9
|
export const IdentityLoader = ({ children }: {
|
|
10
10
|
children: React.ReactNode
|
|
11
11
|
}) => {
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
<IdentityState state={['loading']}>
|
|
15
|
+
<Loader />
|
|
16
|
+
</IdentityState>
|
|
17
|
+
<IdentityState state={['none', 'cleared']}>
|
|
18
|
+
<Redirect />
|
|
19
|
+
</IdentityState>
|
|
20
|
+
<IdentityState state={'failed'}>
|
|
21
|
+
<div className="flex justify-center items-center h-screen bg-gray-100">
|
|
22
|
+
<Card className="w-72">
|
|
23
|
+
<CardContent className="flex flex-col items-center gap-2">
|
|
24
|
+
<CircleAlert className="h-12 w-12 text-destructive" />
|
|
25
|
+
<p className="text-center text-lg text-gray-600">
|
|
26
|
+
{dict.identityLoader.fail}
|
|
27
|
+
</p>
|
|
28
|
+
<div className="flex gap-2">
|
|
29
|
+
<Button onClick={() => window.location.reload()} variant="secondary">Try reload</Button>
|
|
30
|
+
<LogoutTrigger>
|
|
31
|
+
<Button>Login again</Button>
|
|
32
|
+
</LogoutTrigger>
|
|
33
|
+
</div>
|
|
34
|
+
</CardContent>
|
|
35
|
+
</Card>
|
|
36
|
+
</div>
|
|
37
|
+
</IdentityState>
|
|
38
|
+
<IdentityState state={'success'}>
|
|
39
|
+
{children}
|
|
40
|
+
</IdentityState>
|
|
41
|
+
</>
|
|
42
|
+
)
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const Redirect = () => {
|
|
@@ -8,12 +8,13 @@ import { SaveIcon } from 'lucide-react'
|
|
|
8
8
|
export const NavigationGuardDialog = () => {
|
|
9
9
|
const [resolver, setResolver] = useState<((value: BlockNavigationOnDirtyStateResult) => void) | null>(null)
|
|
10
10
|
|
|
11
|
-
const handler = useCallback(() =>
|
|
12
|
-
|
|
13
|
-
setResolver(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
const handler = useCallback(() =>
|
|
12
|
+
new Promise<BlockNavigationOnDirtyStateResult>(resolve => {
|
|
13
|
+
setResolver(() => (value: BlockNavigationOnDirtyStateResult) => {
|
|
14
|
+
setResolver(null)
|
|
15
|
+
resolve(value)
|
|
16
|
+
})
|
|
17
|
+
}), [])
|
|
17
18
|
|
|
18
19
|
useBlockNavigationOnDirtyState(handler, usePersistFeedbackHandlers())
|
|
19
20
|
|
|
@@ -27,8 +28,11 @@ export const NavigationGuardDialog = () => {
|
|
|
27
28
|
<SaveIcon className="w-4 h-4 mr-2" />
|
|
28
29
|
Save
|
|
29
30
|
</Button>
|
|
30
|
-
<Button
|
|
31
|
-
|
|
31
|
+
<Button
|
|
32
|
+
onClick={() => resolver?.('discard')}
|
|
33
|
+
variant="outline"
|
|
34
|
+
className="border-destructive/50 text-destructive hover:bg-red-100 hover:text-destructive"
|
|
35
|
+
>
|
|
32
36
|
Don't save
|
|
33
37
|
</Button>
|
|
34
38
|
<AlertDialogCancel onClick={() => resolver?.('cancel')} className="border-gray-500">Cancel</AlertDialogCancel>
|
|
@@ -49,8 +49,7 @@ const BlockRepeaterContentWrapperUI = uic('div', {
|
|
|
49
49
|
baseClass: 'flex flex-col gap-2',
|
|
50
50
|
})
|
|
51
51
|
|
|
52
|
-
export type DefaultBlockRepeaterProps =
|
|
53
|
-
& BlockRepeaterProps
|
|
52
|
+
export type DefaultBlockRepeaterProps = BlockRepeaterProps
|
|
54
53
|
|
|
55
54
|
const [BlockRepeaterEditModeContext, useBlockRepeaterEditMode] = createRequiredContext<boolean>('BlockRepeaterEditMode')
|
|
56
55
|
|
|
@@ -94,7 +93,7 @@ const [BlockRepeaterEditModeContext, useBlockRepeaterEditMode] = createRequiredC
|
|
|
94
93
|
export const DefaultBlockRepeater = Component<DefaultBlockRepeaterProps>(({ children, ...props }) => {
|
|
95
94
|
const [editMode, setEditMode] = useState(false)
|
|
96
95
|
return (
|
|
97
|
-
<BlockRepeater {...props}>
|
|
96
|
+
<BlockRepeater {...props as BlockRepeaterProps}>
|
|
98
97
|
<StaticRender>
|
|
99
98
|
{children}
|
|
100
99
|
</StaticRender>
|
|
@@ -160,7 +159,6 @@ const BlockRepeaterSortable = Component<{
|
|
|
160
159
|
<BlockRepeaterContent />
|
|
161
160
|
</BlockRepeaterDragOverlayUI>
|
|
162
161
|
</RepeaterSortableDragOverlay>
|
|
163
|
-
|
|
164
162
|
</BlockRepeaterItemsWrapperUI>
|
|
165
163
|
</RepeaterSortable>
|
|
166
164
|
)
|
|
@@ -186,7 +184,6 @@ const BlockRepeaterAddButtons = ({ index }: { index?: RepeaterAddItemIndex }) =>
|
|
|
186
184
|
)
|
|
187
185
|
}
|
|
188
186
|
|
|
189
|
-
|
|
190
187
|
const BlockRepeaterContent = () => {
|
|
191
188
|
const entity = useEntity()
|
|
192
189
|
const block = useBlockRepeaterCurrentBlock()
|
|
@@ -205,15 +202,16 @@ const BlockRepeaterContent = () => {
|
|
|
205
202
|
</div>
|
|
206
203
|
)
|
|
207
204
|
}
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
{
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
205
|
+
return (
|
|
206
|
+
<>
|
|
207
|
+
<div className="p-4 cursor-pointer hover:bg-gray-50 " onClick={() => setEditEntity(true)}>
|
|
208
|
+
{children}
|
|
209
|
+
</div>
|
|
210
|
+
<BlockRepeaterEditSheetInner open={editEntity} setOpen={setEditEntity} />
|
|
211
|
+
</>
|
|
212
|
+
)
|
|
214
213
|
}
|
|
215
214
|
|
|
216
|
-
|
|
217
215
|
const BlockRepeaterAddItemBefore = ({ sortableBy }: { sortableBy: DefaultBlockRepeaterProps['sortableBy'] }) => {
|
|
218
216
|
const entity = useEntity()
|
|
219
217
|
const order = sortableBy ? entity.getField<number>(sortableBy).value : null
|
|
@@ -30,7 +30,8 @@ export const BoardCardUI = uic('div', {
|
|
|
30
30
|
baseClass: 'rounded-sm border border-gray-200 bg-card text-card-foreground shadow-xs p-4 relative hover:shadow-md transition-all duration-200',
|
|
31
31
|
})
|
|
32
32
|
export const BoardColumnUI = uic('div', {
|
|
33
|
-
baseClass:
|
|
33
|
+
baseClass:
|
|
34
|
+
'rounded-lg border border-gray-200 bg-card text-card-foreground shadow-md relative min-w-48 data-[sortable-over="item"]:bg-yellow-100 hover:shadow-lg transition-all duration-200',
|
|
34
35
|
})
|
|
35
36
|
export const BoardDragOverlayUI = uic('div', {
|
|
36
37
|
baseClass: 'rounded-sm border border-gray-200 border-gray-300 p-4 relative bg-gray-100/60 backdrop-blur-xs',
|
|
@@ -121,17 +122,19 @@ export const BoardSortableColumn = Component<{
|
|
|
121
122
|
</div>
|
|
122
123
|
</BoardSortableEachColumn>
|
|
123
124
|
|
|
124
|
-
{nullColumnHeader &&
|
|
125
|
-
<
|
|
126
|
-
<
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
125
|
+
{nullColumnHeader && (
|
|
126
|
+
<BoardSortableNullColumn>
|
|
127
|
+
<BoardSortableNode>
|
|
128
|
+
<BoardColumnUI>
|
|
129
|
+
<BoardColumnHeaderUI>
|
|
130
|
+
{nullColumnHeader}
|
|
131
|
+
</BoardColumnHeaderUI>
|
|
132
|
+
{children}
|
|
133
|
+
{columnFooter}
|
|
134
|
+
</BoardColumnUI>
|
|
135
|
+
</BoardSortableNode>
|
|
136
|
+
</BoardSortableNullColumn>
|
|
137
|
+
)}
|
|
135
138
|
</>
|
|
136
139
|
))
|
|
137
140
|
export const BoardNonSortableColumn = Component<{
|
|
@@ -151,19 +154,20 @@ export const BoardNonSortableColumn = Component<{
|
|
|
151
154
|
</BoardColumnUI>
|
|
152
155
|
</BoardEachColumn>
|
|
153
156
|
|
|
154
|
-
{nullColumnHeader &&
|
|
155
|
-
<
|
|
156
|
-
<
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
{nullColumnHeader && (
|
|
158
|
+
<BoardNullColumn>
|
|
159
|
+
<BoardColumnUI>
|
|
160
|
+
<BoardColumnHeaderUI>
|
|
161
|
+
{nullColumnHeader}
|
|
162
|
+
</BoardColumnHeaderUI>
|
|
163
|
+
{children}
|
|
164
|
+
{columnFooter}
|
|
165
|
+
</BoardColumnUI>
|
|
166
|
+
</BoardNullColumn>
|
|
167
|
+
)}
|
|
163
168
|
</>
|
|
164
169
|
))
|
|
165
170
|
|
|
166
|
-
|
|
167
171
|
export type DefaultBoardProps =
|
|
168
172
|
& {
|
|
169
173
|
columnHeader: ReactNode
|
|
@@ -179,7 +183,7 @@ export const DefaultBoard = Component<DefaultBoardProps>(({ columnHeader, nullCo
|
|
|
179
183
|
const anySortable = itemsSortable || columnsSortable
|
|
180
184
|
if (!anySortable) {
|
|
181
185
|
return (
|
|
182
|
-
<Board {...props}>
|
|
186
|
+
<Board {...props as BoardProps}>
|
|
183
187
|
<BoardWrapperUI>
|
|
184
188
|
<BoardNonSortableColumn
|
|
185
189
|
columnHeader={columnHeader}
|
|
@@ -197,7 +201,7 @@ export const DefaultBoard = Component<DefaultBoardProps>(({ columnHeader, nullCo
|
|
|
197
201
|
const ItemsComponent = itemsSortable ? BoardSortableItems : BoardNonSortableItems
|
|
198
202
|
|
|
199
203
|
return (
|
|
200
|
-
<Board {...props}>
|
|
204
|
+
<Board {...props as BoardProps}>
|
|
201
205
|
<BoardSortable>
|
|
202
206
|
<BoardWrapperUI>
|
|
203
207
|
<BoardSortableColumn
|
|
@@ -212,29 +216,39 @@ export const DefaultBoard = Component<DefaultBoardProps>(({ columnHeader, nullCo
|
|
|
212
216
|
</BoardSortableColumn>
|
|
213
217
|
</BoardWrapperUI>
|
|
214
218
|
|
|
215
|
-
{columnsSortable
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
219
|
+
{columnsSortable
|
|
220
|
+
? (
|
|
221
|
+
<BoardSortableColumnDragOverlay>
|
|
222
|
+
<BoardDragOverlayUI>
|
|
223
|
+
{columnHeader}
|
|
224
|
+
</BoardDragOverlayUI>
|
|
225
|
+
</BoardSortableColumnDragOverlay>
|
|
226
|
+
)
|
|
227
|
+
: null}
|
|
228
|
+
|
|
229
|
+
{itemsSortable
|
|
230
|
+
? (
|
|
231
|
+
<BoardSortableItemDragOverlay>
|
|
232
|
+
<BoardDragOverlayUI>
|
|
233
|
+
{children}
|
|
234
|
+
</BoardDragOverlayUI>
|
|
235
|
+
</BoardSortableItemDragOverlay>
|
|
236
|
+
)
|
|
237
|
+
: null}
|
|
226
238
|
</BoardSortable>
|
|
227
239
|
</Board>
|
|
228
240
|
)
|
|
229
241
|
}, ({ children, columnHeader, nullColumnHeader, ...props }) => {
|
|
230
|
-
return
|
|
231
|
-
|
|
232
|
-
<
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
242
|
+
return (
|
|
243
|
+
<>
|
|
244
|
+
<Board {...props as BoardProps}>
|
|
245
|
+
<BoardItem>
|
|
246
|
+
{children}
|
|
247
|
+
</BoardItem>
|
|
248
|
+
<BoardColumn>
|
|
249
|
+
{columnHeader}
|
|
250
|
+
</BoardColumn>
|
|
251
|
+
</Board>
|
|
252
|
+
</>
|
|
253
|
+
)
|
|
240
254
|
})
|
|
@@ -18,9 +18,8 @@ import { useEnumOptionsFormatter } from '../labels'
|
|
|
18
18
|
* Props for {@link DataGridHasOneCell}.
|
|
19
19
|
*/
|
|
20
20
|
export type DataGridHasOneCellProps = {
|
|
21
|
-
|
|
22
21
|
/**
|
|
23
|
-
|
|
22
|
+
* Has-one field to be displayed.
|
|
24
23
|
*/
|
|
25
24
|
field: SugaredRelativeSingleEntity['field']
|
|
26
25
|
|
|
@@ -127,22 +126,30 @@ export type DataGridEnumCellProps = {
|
|
|
127
126
|
* Renders a cell with an enum value.
|
|
128
127
|
* Contains a tooltip with filter actions.
|
|
129
128
|
*/
|
|
130
|
-
export const DataGridEnumCell = Component(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
129
|
+
export const DataGridEnumCell = Component(
|
|
130
|
+
({ field, options, filterName, tooltipActions }: DataGridEnumCellProps) => {
|
|
131
|
+
const enumOptionsProvider = useEnumOptionsFormatter()
|
|
132
|
+
return (
|
|
133
|
+
<FieldView<string>
|
|
134
|
+
field={field}
|
|
135
|
+
render={it => {
|
|
136
|
+
const resolvedOptions = options ?? enumOptionsProvider(it.schema.enumName!)
|
|
137
|
+
return it.value
|
|
138
|
+
? (
|
|
139
|
+
<DataGridEnumFieldTooltip value={it.value} field={field} name={filterName} actions={tooltipActions}>
|
|
140
|
+
<DataGridTooltipLabel>
|
|
141
|
+
{resolvedOptions[it.value]}
|
|
142
|
+
</DataGridTooltipLabel>
|
|
143
|
+
</DataGridEnumFieldTooltip>
|
|
144
|
+
)
|
|
145
|
+
: null
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
)
|
|
149
|
+
},
|
|
150
|
+
({ field }) => <Field field={field} />,
|
|
151
|
+
'DataGridEnumCell',
|
|
152
|
+
)
|
|
146
153
|
|
|
147
154
|
/**
|
|
148
155
|
* Props for {@link DataGridEnumListCell}.
|
|
@@ -172,20 +179,27 @@ export type DataGridEnumListCellProps = {
|
|
|
172
179
|
* Renders a cell with an enum list.
|
|
173
180
|
* Contains a tooltip with filter actions.
|
|
174
181
|
*/
|
|
175
|
-
export const DataGridEnumListCell = Component(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
<
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
182
|
+
export const DataGridEnumListCell = Component(
|
|
183
|
+
({ field, options, filterName, tooltipActions }: DataGridEnumListCellProps) => {
|
|
184
|
+
const enumOptionsProvider = useEnumOptionsFormatter()
|
|
185
|
+
return (
|
|
186
|
+
<div className={'flex flex-wrap gap-2'}>
|
|
187
|
+
<FieldView<string[]>
|
|
188
|
+
field={field}
|
|
189
|
+
render={it => {
|
|
190
|
+
const resolvedOptions = options ?? enumOptionsProvider(it.schema.enumName!)
|
|
191
|
+
return it.value?.map(value => (
|
|
192
|
+
<DataGridEnumFieldTooltip key={value} value={value} field={field} name={filterName} actions={tooltipActions}>
|
|
193
|
+
<DataGridTooltipLabel>
|
|
194
|
+
{resolvedOptions[value]}
|
|
195
|
+
</DataGridTooltipLabel>
|
|
196
|
+
</DataGridEnumFieldTooltip>
|
|
197
|
+
)) ?? null
|
|
198
|
+
}}
|
|
199
|
+
/>
|
|
200
|
+
</div>
|
|
201
|
+
)
|
|
202
|
+
},
|
|
203
|
+
({ field }) => <Field field={field} />,
|
|
204
|
+
'DataGridEnumListCell',
|
|
205
|
+
)
|