impaktapps-ui-builder 0.0.101-alpha.260 → 0.0.101-alpha.261
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 +30 -6
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +6 -6
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +23 -8
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +8 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +10 -7
package/package.json
CHANGED
|
@@ -337,40 +337,55 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
337
337
|
elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : []
|
|
338
338
|
}
|
|
339
339
|
})
|
|
340
|
-
}
|
|
340
|
+
} else if (config.type == "Table") {
|
|
341
341
|
const sizeMap = {}
|
|
342
|
-
|
|
342
|
+
|
|
343
343
|
if (config.sizeHolder) {
|
|
344
344
|
config.sizeHolder.map((e, i) => {
|
|
345
345
|
sizeMap[e.keyName] = e.value
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
const tableHeaderElements = [];
|
|
349
|
+
const tableActionElement = [];
|
|
350
|
+
elements.elements = config.elements.filter((cellElem, elemInd) => {
|
|
351
|
+
|
|
350
352
|
const commonProperties = {
|
|
351
353
|
accessorKey: cellElem.name,
|
|
352
354
|
type: cellElem.columnFormat,
|
|
353
355
|
header: cellElem.label || cellElem.name,
|
|
354
356
|
size: sizeMap[cellElem.name] || 180,
|
|
355
|
-
enableColumnFilter: cellElem.enableFilter === "No"?false:true,
|
|
357
|
+
enableColumnFilter: cellElem.enableFilter === "No" ? false : true,
|
|
356
358
|
columnFilterModeOptions: cellElem.filteringOptions,
|
|
357
359
|
enableSorting: cellElem.enableSorting === "No" ? false : true,
|
|
358
360
|
columnKey: cellElem.columnKey
|
|
359
361
|
}
|
|
360
362
|
if (cellElem.type) {
|
|
363
|
+
if (cellElem.elementType == "action") {
|
|
364
|
+
const actionElem = buildUiSchema(cellElem, store);
|
|
365
|
+
tableActionElement.push(actionElem);
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
if (cellElem.elementType == "tableHeader") {
|
|
369
|
+
const headerElem = buildUiSchema(cellElem, store);
|
|
370
|
+
tableHeaderElements.push(headerElem);
|
|
371
|
+
return false;
|
|
372
|
+
}
|
|
373
|
+
|
|
361
374
|
return {
|
|
362
375
|
widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
|
|
363
376
|
elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : [],
|
|
364
377
|
...commonProperties
|
|
365
|
-
|
|
378
|
+
|
|
366
379
|
}
|
|
367
380
|
} else {
|
|
368
381
|
return commonProperties
|
|
369
382
|
}
|
|
370
|
-
|
|
383
|
+
|
|
371
384
|
})
|
|
385
|
+
elements.config.main.action = tableActionElement;
|
|
386
|
+
elements.config.main.headerIcons = tableHeaderElements;
|
|
372
387
|
}
|
|
373
|
-
|
|
388
|
+
|
|
374
389
|
else if (config.type == "Array") {
|
|
375
390
|
elements.options.detail.elements = config.elements.map((e: any, elemInd: number) => {
|
|
376
391
|
return buildUiSchema(e, store)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//headerIcons //action //elements
|
|
1
2
|
export const ComponentSchema: any = {
|
|
2
3
|
type: "object",
|
|
3
4
|
properties: {
|
|
@@ -43,6 +44,13 @@ export const ComponentSchema: any = {
|
|
|
43
44
|
{ title: "Thought of the day", const: "Thought" }
|
|
44
45
|
]
|
|
45
46
|
},
|
|
47
|
+
elementType: {
|
|
48
|
+
oneOf: [
|
|
49
|
+
{ title: "Table Action Element", const: "action" },
|
|
50
|
+
{ title: "Table Header Element", const: "tableHeader" },
|
|
51
|
+
{ title: "Table Element", const: "element" },
|
|
52
|
+
]
|
|
53
|
+
},
|
|
46
54
|
columnFormat: {
|
|
47
55
|
oneOf: [
|
|
48
56
|
{ title: "Date Column", const: "date" },
|
|
@@ -143,16 +143,19 @@ export function refreshPage(type: string, store: any) {
|
|
|
143
143
|
},
|
|
144
144
|
},
|
|
145
145
|
UiSchema.elements[0].elements[0].elements[9] =
|
|
146
|
-
|
|
146
|
+
{
|
|
147
147
|
type: "Control",
|
|
148
|
-
scope: "#/properties/
|
|
149
|
-
config: {
|
|
150
|
-
layout: { xs: 0, sm: 0, md: 4, lg: 0 },
|
|
151
|
-
},
|
|
148
|
+
scope: "#/properties/elementType",
|
|
152
149
|
options: {
|
|
153
|
-
widget: "
|
|
150
|
+
widget: "SelectInputField",
|
|
154
151
|
},
|
|
155
|
-
|
|
152
|
+
config: {
|
|
153
|
+
layout: { xs: 6, sm: 6, md: 4, lg: 3 },
|
|
154
|
+
main: {
|
|
155
|
+
label: "Element Type",
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
}
|
|
156
159
|
}
|
|
157
160
|
|
|
158
161
|
if (sessionStorage.getItem("copiedConfig") ) {
|