impaktapps-ui-builder 0.0.382-alpha.327 → 0.0.382-alpha.329

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": "0.0.382-alpha.327",
3
+ "version": "0.0.382-alpha.329",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -105,12 +105,12 @@ export default (funcParams: funcParamsProps) => {
105
105
  serviceHolder: this, eventGroups
106
106
  })
107
107
  },
108
- // onClick: async function () {
109
- // await this.callHandler("onClick")
110
- // },
111
108
  onClick: async function () {
112
- handleButtonClick();
109
+ await this.callHandler("onClick")
113
110
  },
111
+ // onClick: async function () {
112
+ // handleButtonClick();
113
+ // },
114
114
  onFileDownload: async function () {
115
115
  await this.callHandler("onDownload")
116
116
  },
@@ -213,19 +213,25 @@ export default (funcParams: funcParamsProps) => {
213
213
  // },
214
214
  callHandler: async function (eventType: string, functionParameters?: any) {
215
215
  const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
216
+
217
+ // Create a throttled version of executeEvents inside callHandler
218
+ const throttledExecuteEvents = throttle(async (eventConfig) => {
219
+ executeEventsParameters.store.functionParameters = functionParameters;
220
+ await executeEvents({
221
+ ...executeEventsParameters,
222
+ config: eventConfig,
223
+ componentName: path,
224
+ });
225
+ }, 1000); // Adjust the delay as needed
226
+
216
227
  if (eventGroups?.[eventType]?.[path] !== undefined) {
217
228
  for (const eventConfig of eventGroups?.[eventType]?.[path]) {
218
- executeEventsParameters.store.functionParameters = functionParameters;
219
-
220
- // Throttle the execution of the executeEvents function
221
- await throttledExecuteEvents({
222
- ...executeEventsParameters,
223
- config: eventConfig,
224
- componentName: path,
225
- });
229
+ // Use the throttled function for each eventConfig
230
+ await throttledExecuteEvents(eventConfig);
226
231
  }
227
232
  }
228
233
  },
234
+
229
235
  downloadFile: downloadFile,
230
236
  download:doDownload,
231
237
  };