@comet/admin-generator 8.11.0-canary-20251215080607 → 8.11.0-canary-20251215081232
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.
|
@@ -310,6 +310,9 @@ export type GridConfig<T extends {
|
|
|
310
310
|
*/
|
|
311
311
|
scopeAsProp?: boolean;
|
|
312
312
|
density?: "comfortable" | "compact" | "standard";
|
|
313
|
+
crudContextMenu?: {
|
|
314
|
+
deleteText?: string;
|
|
315
|
+
};
|
|
313
316
|
};
|
|
314
317
|
export type GeneratorConfig<T extends {
|
|
315
318
|
__typename?: string;
|
|
@@ -140,7 +140,7 @@ const getValueOptionsLabelData = (messageId, label) => {
|
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
142
|
function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntrospection, }, config) {
|
|
143
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
143
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
144
144
|
const gqlType = config.gqlType;
|
|
145
145
|
if (!gqlType) {
|
|
146
146
|
throw new Error("gqlType is required in grid config");
|
|
@@ -335,10 +335,10 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
|
|
|
335
335
|
if (!schemaEntity)
|
|
336
336
|
throw new Error("didn't find entity in schema types");
|
|
337
337
|
const actionsColumnConfig = config.columns.find((column) => column.type === "actions");
|
|
338
|
-
const
|
|
338
|
+
const _k = actionsColumnConfig !== null && actionsColumnConfig !== void 0 ? actionsColumnConfig : {}, { component: actionsColumnComponent, type: actionsColumnType, headerName: actionsColumnHeaderName, pinned: actionsColumnPinned = "right", width: actionsColumnWidth = defaultActionsColumnWidth, visible: actionsColumnVisible = undefined,
|
|
339
339
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
340
|
-
queryFields: actionsColumnQueryFields = [] } =
|
|
341
|
-
restActionsColumnConfig = __rest(
|
|
340
|
+
queryFields: actionsColumnQueryFields = [] } = _k, // not needed here, but needs to be removed from restActionsColumnConfig because it's directly used in to generate component props in tsCodeRecordToString
|
|
341
|
+
restActionsColumnConfig = __rest(_k, ["component", "type", "headerName", "pinned", "width", "visible", "queryFields"]);
|
|
342
342
|
if (actionsColumnComponent) {
|
|
343
343
|
if (!(0, runtimeTypeGuards_1.isGeneratorConfigImport)(actionsColumnComponent)) {
|
|
344
344
|
throw new Error("Unsupported actionsColumnComponent, only imports are supported");
|
|
@@ -789,6 +789,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
|
|
|
789
789
|
`
|
|
790
790
|
: ""}
|
|
791
791
|
refetchQueries={[${instanceGqlTypePlural}Query]}
|
|
792
|
+
${((_h = config.crudContextMenu) === null || _h === void 0 ? void 0 : _h.deleteText) ? `messagesMapping={{ delete: <FormattedMessage id="${instanceGqlType}.crudContextMenu.delete" defaultMessage="${config.crudContextMenu.deleteText}" /> }}` : ""}
|
|
792
793
|
/>
|
|
793
794
|
`
|
|
794
795
|
: ""}
|
|
@@ -830,7 +831,7 @@ function generateGrid({ exportName, baseOutputFilename, targetDirectory, gqlIntr
|
|
|
830
831
|
});
|
|
831
832
|
const rowCount = useBufferedRowCount(data?.${gridQuery}.totalCount);
|
|
832
833
|
if (error) throw error;
|
|
833
|
-
const rows = ${!allowRowReordering ? `data?.${gridQuery}.nodes` : generateRowReorderingRows(gridQuery, fieldList, (
|
|
834
|
+
const rows = ${!allowRowReordering ? `data?.${gridQuery}.nodes` : generateRowReorderingRows(gridQuery, fieldList, (_j = config.rowReordering) === null || _j === void 0 ? void 0 : _j.dragPreviewField)} ?? [];
|
|
834
835
|
|
|
835
836
|
${generateGridExportApi(config.excelExport, gqlTypePlural, instanceGqlTypePlural, gridQuery, gqlArgs)}
|
|
836
837
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@comet/admin-generator",
|
|
3
|
-
"version": "8.11.0-canary-
|
|
3
|
+
"version": "8.11.0-canary-20251215081232",
|
|
4
4
|
"description": "Comet Admin Generator CLI tool",
|
|
5
5
|
"repository": {
|
|
6
6
|
"directory": "packages/admin/admin-generator",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"rimraf": "^6.1.2",
|
|
49
49
|
"ts-jest": "^29.4.0",
|
|
50
50
|
"typescript": "5.9.3",
|
|
51
|
-
"@comet/admin": "8.11.0-canary-
|
|
52
|
-
"@comet/admin
|
|
53
|
-
"@comet/
|
|
54
|
-
"@comet/eslint-config": "8.11.0-canary-
|
|
51
|
+
"@comet/admin": "8.11.0-canary-20251215081232",
|
|
52
|
+
"@comet/cms-admin": "8.11.0-canary-20251215081232",
|
|
53
|
+
"@comet/admin-icons": "8.11.0-canary-20251215081232",
|
|
54
|
+
"@comet/eslint-config": "8.11.0-canary-20251215081232"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=22.0.0"
|