@integry/sdk 4.5.45 → 4.5.46

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": "@integry/sdk",
3
- "version": "4.5.45",
3
+ "version": "4.5.46",
4
4
  "description": "Integry SDK",
5
5
  "main": "dist/umd/index.umd.js",
6
6
  "module": "dist/esm/index.csm.js",
@@ -21,7 +21,7 @@ interface ObjectFieldProps {
21
21
  parentFieldId?: string,
22
22
  index?: number,
23
23
  ) => void;
24
- onChangeInFlow?: (val: string) => void;
24
+ onChangeInFlow?: (val: any) => void;
25
25
  apiHandler: any;
26
26
  isArray?: boolean; // New prop to check if the input is an array
27
27
  activityOutputData: any;
@@ -38,6 +38,7 @@ interface FieldDetails {
38
38
  title: string;
39
39
  description_for_users: string;
40
40
  is_required: boolean;
41
+ machine_name?: string;
41
42
  ui: {
42
43
  placeholder: string;
43
44
  regex?: string;
@@ -68,6 +69,7 @@ const transformTemplateFieldsToProperties = (templateFields: any[]) => {
68
69
  title: tf.title,
69
70
  description_for_users: tf.description,
70
71
  is_required: tf.is_required,
72
+ machine_name: tf?.activity_field?.machine_name || '',
71
73
  ui: {
72
74
  placeholder: tf.placeholder,
73
75
  regex: tf.regex || '',
@@ -145,18 +147,20 @@ const ObjectField = (props: ObjectFieldProps) => {
145
147
  fieldId: string,
146
148
  value: any,
147
149
  dataType: string,
150
+ machine_name?: string,
148
151
  ) => {
149
152
  const updatedObjectArray = [...objectArray];
150
- updatedObjectArray[index][fieldId] = value;
153
+ const isFlow = !field.properties && !!field.template_fields;
154
+ const updatedObjectArrayKey = (isFlow && machine_name) || fieldId;
155
+ updatedObjectArray[index][updatedObjectArrayKey] = value;
151
156
 
152
157
  // Update the state with the modified object array
153
158
  setObjectArray(updatedObjectArray);
154
159
 
155
160
  // Optionally trigger the parent change handler
156
- const isFlow = !field.properties && !!field.template_fields;
157
161
  if (isArray) {
158
162
  if (isFlow && onChangeInFlow) {
159
- onChangeInFlow(value);
163
+ onChangeInFlow(updatedObjectArray);
160
164
  } else {
161
165
  onChange(
162
166
  fieldId,
@@ -251,6 +255,7 @@ const ObjectField = (props: ObjectFieldProps) => {
251
255
  fieldName,
252
256
  valueReceived,
253
257
  fieldDetails.meta.ui.ui_field?.type || 'TEXTFIELD',
258
+ fieldDetails.meta.machine_name,
254
259
  );
255
260
  }}
256
261
  regex=${fieldDetails.meta.ui.regex || getRegex(fieldDetails)}
@@ -280,6 +285,7 @@ const ObjectField = (props: ObjectFieldProps) => {
280
285
  fieldName,
281
286
  val,
282
287
  fieldDetails.meta.ui.ui_field?.type || 'TEXTAREA',
288
+ fieldDetails.meta.machine_name,
283
289
  )}
284
290
  placeholder="${placeholder}"
285
291
  isRequired="${fieldDetails.meta.is_required}"
@@ -307,6 +313,7 @@ const ObjectField = (props: ObjectFieldProps) => {
307
313
  fieldName,
308
314
  val,
309
315
  fieldDetails.meta.ui.ui_field?.type || 'CHECKBOX',
316
+ fieldDetails.meta.machine_name,
310
317
  )}
311
318
  />
312
319
  `}
@@ -329,6 +336,7 @@ const ObjectField = (props: ObjectFieldProps) => {
329
336
  fieldName,
330
337
  val,
331
338
  fieldDetails.meta.ui.ui_field?.type || 'DYNAMIC_DROPDOWN',
339
+ fieldDetails.meta.machine_name,
332
340
  )}
333
341
  />
334
342
  `}