impaktapps-ui-builder 1.0.125 → 1.0.129

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.
@@ -22,7 +22,7 @@ declare const _default: (funcParams: funcParamsProps) => {
22
22
  onRowMovement: (paginationValues: any) => Promise<any>;
23
23
  onPaginationChange: (paginationValues: any) => Promise<any>;
24
24
  getSelectOptions: (param: any) => Promise<any>;
25
- onChange: () => Promise<void>;
25
+ onChange: () => void;
26
26
  callExecuteEvents: (paramValue: any, apiBody: any, eventType: string) => Promise<any>;
27
27
  onBack: (functionParameters: any) => Promise<void>;
28
28
  onNext: (functionParameters: any) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.125",
3
+ "version": "1.0.129",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -77,8 +77,5 @@ 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
- }
83
80
  return table;
84
81
  };
@@ -487,11 +487,6 @@ 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
- ]),
495
490
  buildWrapper("Tree Table Properties", [
496
491
  getRadioInputField("enableRowMovement", "Row Rearrangement", ["YES", "NO"]),
497
492
  getRadioInputField("enableExpanding", "Row Expanding", ["YES", "NO"]),
@@ -94,14 +94,6 @@ 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
- },
105
97
  layout: {
106
98
  type: "array",
107
99
  items: {
@@ -63,7 +63,8 @@ export function refreshPage(type: string, store: any) {
63
63
  }
64
64
  const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
65
65
  UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Events", "Validation"];
66
- UiSchema.elements[0].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
66
+ UiSchema. elements[0].elements[0].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
67
+
67
68
  }
68
69
 
69
70
  // Get Widget Type of parent
@@ -183,28 +183,39 @@ export default (funcParams: funcParamsProps) => {
183
183
  return response?.data;
184
184
  }
185
185
  },
186
- onChange: async function () {
187
- if (eventGroups.onChange) {
188
- const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
189
- Promise.all(ChangeEventsKeysArray.map(async (componentName: string) => {
190
- if (
191
- funcParams.store?.formData[componentName] !== funcParams.store.newData[componentName] &&
192
- funcParams.store?.newData[componentName] !== undefined
193
- ) {
194
- for (const eventConfig of eventGroups.onChange[componentName]) {
195
- await executeEvents({
196
- ...executeEventsParameters,
197
- config: eventConfig,
198
- componentName,
199
- formDataHolder
200
- })
201
- if (eventConfig.Handler === "refresh") {
202
- funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
203
- }
186
+ onChange: function () {
187
+ if (!eventGroups.onChange) return;
188
+
189
+ const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
190
+
191
+ const promises = ChangeEventsKeysArray.flatMap((componentName: string) => {
192
+ if (
193
+ funcParams.store?.formData[componentName] === funcParams.store.newData[componentName] ||
194
+ funcParams.store?.newData[componentName] === undefined
195
+ ) {
196
+ return [];
197
+ }
198
+
199
+ return eventGroups.onChange[componentName].map(eventConfig =>
200
+ Promise.resolve(
201
+ executeEvents({
202
+ ...executeEventsParameters,
203
+ config: eventConfig,
204
+ componentName,
205
+ formDataHolder
206
+ })
207
+ ).then(() => {
208
+ if (!isEmpty(formDataHolder)) {
209
+ funcParams.store.setFormdata(pre => ({
210
+ ...pre,
211
+ ...formDataHolder
212
+ }));
204
213
  }
205
- }
206
- }))
207
- }
214
+ })
215
+ );
216
+ });
217
+
218
+ Promise.allSettled(promises);
208
219
  },
209
220
  callExecuteEvents: async function (paramValue, apiBody, eventType: string) {
210
221
  let LastCallResponse = undefined;
@@ -250,28 +261,33 @@ export default (funcParams: funcParamsProps) => {
250
261
  }
251
262
  },
252
263
  callHandler: function (eventType: string, functionParameters?: any) {
253
- const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
254
- if (eventGroups?.[eventType]?.[path] !== undefined) {
255
- (eventGroups?.[eventType]?.[path].map((eventConfig) => {
256
- executeEventsParameters.store.functionParameters = functionParameters
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
- })
264
+ const path =
265
+ funcParams.dynamicData?.tableButtonPath ||
266
+ funcParams.dynamicData.path.split(".").pop();
267
+
268
+ if (!eventGroups?.[eventType]?.[path]) return;
269
+
270
+ const promises = eventGroups[eventType][path].map(eventConfig => {
271
+ executeEventsParameters.store.functionParameters = functionParameters;
272
+
273
+ return Promise.resolve(
274
+ executeEvents({
275
+ ...executeEventsParameters,
276
+ config: eventConfig,
277
+ componentName: path,
278
+ formDataHolder
279
+ })
280
+ ).then(() => {
281
+ if (!isEmpty(formDataHolder)) {
282
+ funcParams.store.setFormdata(pre => ({
283
+ ...pre,
284
+ ...formDataHolder
285
+ }));
272
286
  }
273
- }))
274
- }
287
+ });
288
+ });
289
+
290
+ Promise.allSettled(promises);
275
291
  },
276
292
  downloadFile: downloadFile,
277
293
  downloadFileFromUrl: downloadFileFromUrl,