impaktapps-ui-builder 0.0.101-alpha.260 → 0.0.101-alpha.262
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 +35 -9
- 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 +27 -11
- 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,56 @@ 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
|
+
const rowElements = []
|
|
351
|
+
config.elements.filter((cellElem, elemInd) => {
|
|
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) {
|
|
361
|
-
|
|
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
|
+
|
|
374
|
+
rowElements.push({
|
|
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
|
-
|
|
366
|
-
}
|
|
378
|
+
|
|
379
|
+
})
|
|
367
380
|
} else {
|
|
368
|
-
|
|
381
|
+
rowElements.push(commonProperties)
|
|
369
382
|
}
|
|
370
|
-
|
|
383
|
+
|
|
371
384
|
})
|
|
385
|
+
elements.elements = rowElements;
|
|
386
|
+
elements.config.main.action = tableActionElement;
|
|
387
|
+
elements.config.main.headerIcons = tableHeaderElements;
|
|
372
388
|
}
|
|
373
|
-
|
|
389
|
+
|
|
374
390
|
else if (config.type == "Array") {
|
|
375
391
|
elements.options.detail.elements = config.elements.map((e: any, elemInd: number) => {
|
|
376
392
|
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") ) {
|