impaktapps-ui-builder 1.0.119 → 1.0.121

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.119",
3
+ "version": "1.0.121",
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
  };
@@ -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: {
@@ -193,7 +193,7 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
193
193
  }
194
194
  }
195
195
  else {
196
- if (handlerResponse?.data) {
196
+ if (handlerResponse) {
197
197
  formDataHolder[componentName] = handlerResponse.data
198
198
  }
199
199
  }
@@ -72,7 +72,10 @@ export default (funcParams: funcParamsProps) => {
72
72
  return {
73
73
  setPage: async function () {
74
74
  funcParams.store.setAdditionalErrors([]);
75
- funcParams.store.setFormdata(funcParams?.initFormData() || {});
75
+ funcParams.store.setFormdata((pre) => ({
76
+ ...pre,
77
+ ...(funcParams?.initFormData())
78
+ }));
76
79
  funcParams.store.setSchema({ type: "object", properties: {} });
77
80
  funcParams.store.newData = {};
78
81
  eventGroups = {};
@@ -192,23 +195,14 @@ export default (funcParams: funcParamsProps) => {
192
195
  funcParams.store?.newData[componentName] !== undefined
193
196
  ) {
194
197
  for (const eventConfig of eventGroups.onChange[componentName]) {
195
-
198
+ await executeEvents({
199
+ ...executeEventsParameters,
200
+ config: eventConfig,
201
+ componentName,
202
+ formDataHolder
203
+ })
196
204
  if (eventConfig.Handler === "refresh") {
197
- await executeEvents({
198
- ...executeEventsParameters,
199
- config: eventConfig,
200
- componentName,
201
- formDataHolder: formDataHolder
202
- })
203
- if (!isEmpty(formDataHolder)) {
204
- funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
205
- }
206
- } else {
207
- await executeEvents({
208
- ...executeEventsParameters,
209
- config: eventConfig,
210
- componentName,
211
- })
205
+ funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
212
206
  }
213
207
  }
214
208
  }
@@ -261,16 +255,23 @@ export default (funcParams: funcParamsProps) => {
261
255
  callHandler: function (eventType: string, functionParameters?: any) {
262
256
  const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
263
257
  if (eventGroups?.[eventType]?.[path] !== undefined) {
264
- (eventGroups?.[eventType]?.[path].map(async (eventConfig) => {
258
+ (eventGroups?.[eventType]?.[path].map((eventConfig) => {
265
259
  executeEventsParameters.store.functionParameters = functionParameters
266
- await executeEvents({
267
- ...executeEventsParameters,
268
- config: eventConfig,
269
- componentName: path,
270
- formDataHolder: formDataHolder
271
- })
272
- if (!isEmpty(formDataHolder)) {
273
- funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
260
+ if (eventConfig.Handler === "refresh") {
261
+ executeEvents({
262
+ ...executeEventsParameters,
263
+ config: eventConfig,
264
+ componentName: path,
265
+ formDataHolder: formDataHolder
266
+ }).then((res) => {
267
+ funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
268
+ });
269
+ } else {
270
+ executeEvents({
271
+ ...executeEventsParameters,
272
+ config: eventConfig,
273
+ componentName: path
274
+ })
274
275
  }
275
276
  }))
276
277
  }