@comet/admin-generator 9.0.0-beta.1 → 9.0.0-beta.3

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.
@@ -20529,7 +20529,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20529
20529
  },
20530
20530
  {
20531
20531
  name: "GridToolbarQuickFilter",
20532
- importPath: muiXGridVariant.package
20532
+ importPath: "@comet/admin"
20533
20533
  },
20534
20534
  {
20535
20535
  name: "GridRowOrderChangeParams",
@@ -20824,7 +20824,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20824
20824
  }
20825
20825
  const { gridPropsTypeCode, gridPropsParamsCode } = generateGridPropsCode(props);
20826
20826
  const gridToolbarComponentName = `${gqlTypePlural}GridToolbar`;
20827
- const dataGridRemoteParameters = config.initialSort || config.queryParamsPrefix || config.initialFilter ? `{${config.initialSort ? ` initialSort: [${config.initialSort.map((item) => {
20827
+ const dataGridRemoteParameters = config.initialSort || config.queryParamsPrefix || config.initialFilter || config.initialPageSize ? `{${config.initialSort ? ` initialSort: [${config.initialSort.map((item) => {
20828
20828
  return `{field: "${item.field}", sort: "${item.sort}"}`;
20829
20829
  }).join(",\n")} ], ` : ""}
20830
20830
  ${config.initialFilter ? `initialFilter:{ ${config.initialFilter.linkOperator ? `linkOperator: GridLogicOperator.${config.initialFilter.linkOperator === "or" ? "Or" : "And"},` : ""}
@@ -20832,6 +20832,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20832
20832
  return `{ field: "${item.field}", operator: "${item.operator}", value: ${JSON.stringify(item.value)} }`;
20833
20833
  }).join(",\n")} ],},` : ""}
20834
20834
  ${config.queryParamsPrefix ? `queryParamsPrefix: "${config.queryParamsPrefix}",` : ""}
20835
+ ${config.initialPageSize ? `pageSize: ${config.initialPageSize},` : ""}
20835
20836
  }` : "";
20836
20837
  return {
20837
20838
  code: `import {
@@ -20922,7 +20923,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20922
20923
  export function ${gqlTypePlural}Grid(${gridPropsParamsCode}) {
20923
20924
  ${showCrudContextMenuInActionsColumn ? "const client = useApolloClient();" : ""}
20924
20925
  const intl = useIntl();
20925
- const dataGridProps = { ...${hasPaging ? "useDataGridRemote" : "useDataGridUrlState"}(${dataGridRemoteParameters}), ...usePersistentColumnState("${gqlTypePlural}Grid")${config.selectionProps === "multiSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: true, keepNonExistentRowsSelected: true` : config.selectionProps === "singleSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: false, keepNonExistentRowsSelected: false, disableRowSelectionOnClick: false` : ``} };
20926
+ const dataGridProps = { ...${hasPaging ? "useDataGridRemote" : "useDataGridUrlState"}(${dataGridRemoteParameters}), ...usePersistentColumnState("${gqlTypePlural}Grid")${config.selectionProps === "multiSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: true, keepNonExistentRowsSelected: true, disableRowSelectionExcludeModel: true` : config.selectionProps === "singleSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: false, keepNonExistentRowsSelected: false, disableRowSelectionOnClick: false, disableRowSelectionExcludeModel: true` : ``} };
20926
20927
  ${useScopeFromContext ? `const { scope } = useContentScope();` : ""}
20927
20928
  ${gridNeedsTheme ? `const theme = useTheme();` : ""}
20928
20929
  ${showEditInActionsColumn ? `const stackSwitchApi = useStackSwitchApi();` : ""}
@@ -21089,6 +21090,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
21089
21090
  hideFooterPagination` : ""}
21090
21091
  ${config.density ? `density="${config.density}"` : ""}
21091
21092
  ${showEditInActionsColumn ? `onRowClick={handleRowClick}` : forwardRowAction ? `onRowClick={onRowClick}` : ""}
21093
+ showToolbar
21092
21094
  />
21093
21095
  );
21094
21096
  }
package/dist/index.d.mts CHANGED
@@ -333,6 +333,7 @@ type GridConfig<T extends {
333
333
  deleteType?: "delete" | "remove";
334
334
  deleteText?: string;
335
335
  };
336
+ initialPageSize?: number;
336
337
  };
337
338
  type GeneratorConfig<T extends {
338
339
  __typename?: string;
package/dist/index.mjs CHANGED
@@ -20529,7 +20529,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20529
20529
  },
20530
20530
  {
20531
20531
  name: "GridToolbarQuickFilter",
20532
- importPath: muiXGridVariant.package
20532
+ importPath: "@comet/admin"
20533
20533
  },
20534
20534
  {
20535
20535
  name: "GridRowOrderChangeParams",
@@ -20824,7 +20824,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20824
20824
  }
20825
20825
  const { gridPropsTypeCode, gridPropsParamsCode } = generateGridPropsCode(props);
20826
20826
  const gridToolbarComponentName = `${gqlTypePlural}GridToolbar`;
20827
- const dataGridRemoteParameters = config.initialSort || config.queryParamsPrefix || config.initialFilter ? `{${config.initialSort ? ` initialSort: [${config.initialSort.map((item) => {
20827
+ const dataGridRemoteParameters = config.initialSort || config.queryParamsPrefix || config.initialFilter || config.initialPageSize ? `{${config.initialSort ? ` initialSort: [${config.initialSort.map((item) => {
20828
20828
  return `{field: "${item.field}", sort: "${item.sort}"}`;
20829
20829
  }).join(",\n")} ], ` : ""}
20830
20830
  ${config.initialFilter ? `initialFilter:{ ${config.initialFilter.linkOperator ? `linkOperator: GridLogicOperator.${config.initialFilter.linkOperator === "or" ? "Or" : "And"},` : ""}
@@ -20832,6 +20832,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20832
20832
  return `{ field: "${item.field}", operator: "${item.operator}", value: ${JSON.stringify(item.value)} }`;
20833
20833
  }).join(",\n")} ],},` : ""}
20834
20834
  ${config.queryParamsPrefix ? `queryParamsPrefix: "${config.queryParamsPrefix}",` : ""}
20835
+ ${config.initialPageSize ? `pageSize: ${config.initialPageSize},` : ""}
20835
20836
  }` : "";
20836
20837
  return {
20837
20838
  code: `import {
@@ -20922,7 +20923,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
20922
20923
  export function ${gqlTypePlural}Grid(${gridPropsParamsCode}) {
20923
20924
  ${showCrudContextMenuInActionsColumn ? "const client = useApolloClient();" : ""}
20924
20925
  const intl = useIntl();
20925
- const dataGridProps = { ...${hasPaging ? "useDataGridRemote" : "useDataGridUrlState"}(${dataGridRemoteParameters}), ...usePersistentColumnState("${gqlTypePlural}Grid")${config.selectionProps === "multiSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: true, keepNonExistentRowsSelected: true` : config.selectionProps === "singleSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: false, keepNonExistentRowsSelected: false, disableRowSelectionOnClick: false` : ``} };
20926
+ const dataGridProps = { ...${hasPaging ? "useDataGridRemote" : "useDataGridUrlState"}(${dataGridRemoteParameters}), ...usePersistentColumnState("${gqlTypePlural}Grid")${config.selectionProps === "multiSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: true, keepNonExistentRowsSelected: true, disableRowSelectionExcludeModel: true` : config.selectionProps === "singleSelect" ? `, rowSelectionModel, onRowSelectionModelChange, checkboxSelection: false, keepNonExistentRowsSelected: false, disableRowSelectionOnClick: false, disableRowSelectionExcludeModel: true` : ``} };
20926
20927
  ${useScopeFromContext ? `const { scope } = useContentScope();` : ""}
20927
20928
  ${gridNeedsTheme ? `const theme = useTheme();` : ""}
20928
20929
  ${showEditInActionsColumn ? `const stackSwitchApi = useStackSwitchApi();` : ""}
@@ -21089,6 +21090,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
21089
21090
  hideFooterPagination` : ""}
21090
21091
  ${config.density ? `density="${config.density}"` : ""}
21091
21092
  ${showEditInActionsColumn ? `onRowClick={handleRowClick}` : forwardRowAction ? `onRowClick={onRowClick}` : ""}
21093
+ showToolbar
21092
21094
  />
21093
21095
  );
21094
21096
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/admin-generator",
3
- "version": "9.0.0-beta.1",
3
+ "version": "9.0.0-beta.3",
4
4
  "description": "Comet Admin Generator CLI tool",
5
5
  "repository": {
6
6
  "directory": "packages/admin/admin-generator",
@@ -26,7 +26,7 @@
26
26
  "@graphql-tools/graphql-file-loader": "^7.5.17",
27
27
  "@graphql-tools/load": "^7.8.14",
28
28
  "@mui/material": "^7.3.7",
29
- "@mui/x-data-grid": "^7.29.8",
29
+ "@mui/x-data-grid": "^8.28.2",
30
30
  "change-case": "^4.1.2",
31
31
  "commander": "^9.5.0",
32
32
  "glob": "^11.1.0",
@@ -35,13 +35,13 @@
35
35
  "object-path": "^0.11.8",
36
36
  "pluralize": "^8.0.0",
37
37
  "typescript": "5.9.3",
38
- "@comet/admin": "9.0.0-beta.1",
39
- "@comet/admin-icons": "9.0.0-beta.1",
40
- "@comet/cms-admin": "9.0.0-beta.1"
38
+ "@comet/admin": "9.0.0-beta.3",
39
+ "@comet/admin-icons": "9.0.0-beta.3",
40
+ "@comet/cms-admin": "9.0.0-beta.3"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@apollo/client": "^3.14.1",
44
- "@types/node": "^24.12.0",
44
+ "@types/node": "^24.12.2",
45
45
  "@types/object-path": "^0.11.4",
46
46
  "@types/pluralize": "^0.0.33",
47
47
  "@types/react": "^19.2.10",
@@ -55,7 +55,7 @@
55
55
  "react-intl": "^7.1.11",
56
56
  "tsdown": "0.20.0-beta.4",
57
57
  "vitest": "^4.0.16",
58
- "@comet/eslint-config": "9.0.0-beta.1"
58
+ "@comet/eslint-config": "9.0.0-beta.3"
59
59
  },
60
60
  "peerDependencies": {
61
61
  "@apollo/client": "^3.7.0",
@@ -75,6 +75,9 @@
75
75
  "lint": "run-p lint:prettier lint:eslint lint:tsc",
76
76
  "lint:ci": "pnpm run lint",
77
77
  "lint:eslint": "eslint --max-warnings 0 src/ '**/*.json' --no-warn-ignored",
78
+ "lint:fix": "run-p lint:fix:eslint lint:fix:prettier",
79
+ "lint:fix:eslint": "pnpm run lint:eslint --fix",
80
+ "lint:fix:prettier": "pnpm run lint:prettier --write",
78
81
  "lint:prettier": "pnpm exec prettier --check '*.{ts,js,json,md,yml,yaml}'",
79
82
  "lint:tsc": "tsc",
80
83
  "test": "vitest --run",