impaktapps-ui-builder 1.0.64-alpha.112 → 1.0.64-alpha.114
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/impaktapps-ui-builder.es.js +18 -29
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +12 -12
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +29 -29
package/package.json
CHANGED
|
@@ -321,6 +321,18 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
321
321
|
elements = buildBasicUiSchema(config)
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
+
const getCommonProperties = (cellElem, sizeMap) => {
|
|
325
|
+
return {
|
|
326
|
+
accessorKey: cellElem.name,
|
|
327
|
+
type: cellElem.type === "ColumnGroup" ? "ColumnGroup" : cellElem.columnFormat,
|
|
328
|
+
header: cellElem.label || cellElem.name,
|
|
329
|
+
size: sizeMap[cellElem.name] || 180,
|
|
330
|
+
enableColumnFilter: cellElem.enableFilter === "No" ? false : true,
|
|
331
|
+
columnFilterModeOptions: cellElem.filteringOptions,
|
|
332
|
+
enableSorting: cellElem.enableSorting === "No" ? false : true,
|
|
333
|
+
columnKey: cellElem.columnKey
|
|
334
|
+
}
|
|
335
|
+
}
|
|
324
336
|
if (config?.elements) {
|
|
325
337
|
if (config?.type === "LeaderBoard") {
|
|
326
338
|
return elements;
|
|
@@ -333,25 +345,12 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
333
345
|
});
|
|
334
346
|
}
|
|
335
347
|
elements.elements = config.elements.map((cellElem, elemInd) => {
|
|
336
|
-
|
|
348
|
+
return {
|
|
337
349
|
accessorKey: cellElem.name,
|
|
338
|
-
type: cellElem.type === "ColumnGroup" ? "ColumnGroup" : cellElem.columnFormat,
|
|
339
350
|
header: cellElem.label || cellElem.name,
|
|
340
351
|
size: sizeMap[cellElem.name] || 180,
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
enableSorting: cellElem.enableSorting === "No" ? false : true,
|
|
344
|
-
columnKey: cellElem.columnKey
|
|
345
|
-
}
|
|
346
|
-
if (cellElem.type) {
|
|
347
|
-
const tableElem = {
|
|
348
|
-
widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
|
|
349
|
-
...commonProperties,
|
|
350
|
-
...(cellElem.type === "ColumnGroup" ? buildUiSchema(cellElem, store) : {})
|
|
351
|
-
}
|
|
352
|
-
return tableElem
|
|
353
|
-
} else {
|
|
354
|
-
return { ...commonProperties }
|
|
352
|
+
type: cellElem.columnFormat,
|
|
353
|
+
elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => getCommonProperties(childCellElem, sizeMap)) : []
|
|
355
354
|
}
|
|
356
355
|
})
|
|
357
356
|
} else if (config.type == "Table") {
|
|
@@ -366,16 +365,16 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
366
365
|
const tableActionElement = [];
|
|
367
366
|
const rowElements = []
|
|
368
367
|
config.elements.filter((cellElem, elemInd) => {
|
|
369
|
-
const commonProperties = {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
368
|
+
// const commonProperties = {
|
|
369
|
+
// accessorKey: cellElem.name,
|
|
370
|
+
// type: cellElem.type === "ColumnGroup" ? "ColumnGroup" : cellElem.columnFormat,
|
|
371
|
+
// header: cellElem.label || cellElem.name,
|
|
372
|
+
// size: sizeMap[cellElem.name] || 180,
|
|
373
|
+
// enableColumnFilter: cellElem.enableFilter === "No" ? false : true,
|
|
374
|
+
// columnFilterModeOptions: cellElem.filteringOptions,
|
|
375
|
+
// enableSorting: cellElem.enableSorting === "No" ? false : true,
|
|
376
|
+
// columnKey: cellElem.columnKey
|
|
377
|
+
// }
|
|
379
378
|
if (cellElem.type) {
|
|
380
379
|
if (cellElem.elementType == "action") {
|
|
381
380
|
const actionElem = buildUiSchema(cellElem, store);
|
|
@@ -389,12 +388,13 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
389
388
|
}
|
|
390
389
|
const tableElem = {
|
|
391
390
|
widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
|
|
392
|
-
|
|
393
|
-
...(cellElem
|
|
391
|
+
elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => getCommonProperties(childCellElem, sizeMap)) : [],
|
|
392
|
+
...getCommonProperties(cellElem, sizeMap)
|
|
393
|
+
|
|
394
394
|
}
|
|
395
395
|
rowElements.push(tableElem)
|
|
396
396
|
} else {
|
|
397
|
-
rowElements.push({ ...
|
|
397
|
+
rowElements.push({ ...getCommonProperties(cellElem, sizeMap) })
|
|
398
398
|
}
|
|
399
399
|
|
|
400
400
|
})
|