impaktapps-ui-builder 1.0.124 → 1.0.125-testL.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.124",
3
+ "version": "1.0.125-testL.2",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -77,5 +77,8 @@ export const buildTable = (config: any, componentScope: string) => {
77
77
  if (config.maxPageSize) {
78
78
  table.config.main.maxPageSize = config.maxPageSize
79
79
  }
80
+ if(config.initialDensity){
81
+ table.config.main.initialDensity = config.initialDensity
82
+ }
80
83
  return table;
81
84
  };
@@ -274,7 +274,17 @@ const buildUiSchema = (config: any, store?: any) => {
274
274
 
275
275
  if (config?.elements) {
276
276
  if (config?.type === "LeaderBoard") {
277
- return elements;
277
+ const rowElements = []
278
+ config.elements.filter((cellElem, elemInd) => {
279
+ const commonProperties = {
280
+ accessorKey: cellElem.name,
281
+ type: cellElem.type === "ColumnGroup" ? "ColumnGroup" : cellElem.columnFormat,
282
+ header: cellElem.label || cellElem.name,
283
+ columnKey: cellElem.columnKey
284
+ }
285
+ rowElements.push({ ...commonProperties })
286
+ })
287
+ elements.elements = rowElements;
278
288
  }
279
289
  else if (config.type == "ColumnGroup") {
280
290
  const sizeMap = {}
@@ -487,6 +487,11 @@ export const buildPropertiesSection = function (type: String) {
487
487
  { label: "100", value: 100 },
488
488
  { label: "500", value: 500 }
489
489
  ]),
490
+ getSelectField("initialDensity", "Initial Toggle Density", [
491
+ { label: "Compact", value: "compact" },
492
+ { label: "Comfortable", value: "comfortable" },
493
+ { label: "Spacious", value: "spacious" }
494
+ ]),
490
495
  buildWrapper("Tree Table Properties", [
491
496
  getRadioInputField("enableRowMovement", "Row Rearrangement", ["YES", "NO"]),
492
497
  getRadioInputField("enableExpanding", "Row Expanding", ["YES", "NO"]),
@@ -94,6 +94,14 @@ export const ComponentSchema: any = {
94
94
  { title: "500", const: 500 }
95
95
  ]
96
96
  },
97
+ initialDensity:{
98
+ type: "string",
99
+ oneOf: [
100
+ { title: "Compact", const: "compact" },
101
+ { title: "Comfortable", const: "comfortable" },
102
+ { title: "Spacious", const: "spacious" }
103
+ ]
104
+ },
97
105
  layout: {
98
106
  type: "array",
99
107
  items: {
@@ -163,6 +163,22 @@ export function refreshPage(type: string, store: any) {
163
163
  },
164
164
  }
165
165
  }
166
+ if(parentObj?.type === "LeaderBoard"){
167
+ UiSchema.elements[0].elements[0].elements[4] =
168
+ {
169
+ type: "Control",
170
+ scope: "#/properties/columnFormat",
171
+ options: {
172
+ widget: "SelectInputField",
173
+ },
174
+ config: {
175
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
176
+ main: {
177
+ label: "Column Format",
178
+ },
179
+ },
180
+ };
181
+ }
166
182
 
167
183
  if (sessionStorage.getItem("copiedConfig") ) {
168
184
  this.ElementPathSetter(UiSchema);
@@ -196,11 +196,11 @@ export default (funcParams: funcParamsProps) => {
196
196
  ...executeEventsParameters,
197
197
  config: eventConfig,
198
198
  componentName,
199
- formDataHolder:formDataHolder
199
+ formDataHolder
200
200
  })
201
- }
202
- if (!isEmpty(formDataHolder)) {
203
- funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
201
+ if (eventConfig.Handler === "refresh") {
202
+ funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
203
+ }
204
204
  }
205
205
  }
206
206
  }))
@@ -252,16 +252,23 @@ export default (funcParams: funcParamsProps) => {
252
252
  callHandler: function (eventType: string, functionParameters?: any) {
253
253
  const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
254
254
  if (eventGroups?.[eventType]?.[path] !== undefined) {
255
- (eventGroups?.[eventType]?.[path].map(async (eventConfig) => {
255
+ (eventGroups?.[eventType]?.[path].map((eventConfig) => {
256
256
  executeEventsParameters.store.functionParameters = functionParameters
257
- await executeEvents({
258
- ...executeEventsParameters,
259
- config: eventConfig,
260
- componentName: path,
261
- formDataHolder: formDataHolder
262
- })
263
- if (!isEmpty(formDataHolder)) {
264
- funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
257
+ if (eventConfig.Handler === "refresh") {
258
+ executeEvents({
259
+ ...executeEventsParameters,
260
+ config: eventConfig,
261
+ componentName: path,
262
+ formDataHolder: formDataHolder
263
+ }).then((res) => {
264
+ funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
265
+ });
266
+ } else {
267
+ executeEvents({
268
+ ...executeEventsParameters,
269
+ config: eventConfig,
270
+ componentName: path
271
+ })
265
272
  }
266
273
  }))
267
274
  }