@integry/sdk 4.6.39 → 4.6.41

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.
@@ -0,0 +1,455 @@
1
+ .functionFieldContainer {
2
+ margin-bottom: 1rem;
3
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
4
+ Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
5
+ }
6
+
7
+ .functionFieldLabel {
8
+ display: block;
9
+ margin-bottom: 0.5rem;
10
+ font-size: 13px;
11
+ }
12
+
13
+ .functionFieldAddBtn {
14
+ padding: 5px 10px;
15
+ background-color: white;
16
+ border: 1px solid #d1d5db;
17
+ border-radius: 0.375rem;
18
+ font-size: 0.875rem;
19
+ font-weight: 500;
20
+ color: #374151;
21
+ cursor: pointer;
22
+
23
+ &:hover {
24
+ background-color: #f3f4f6;
25
+ }
26
+ }
27
+
28
+ .functionFieldSummary {
29
+ border: 1px solid #e5e7eb;
30
+ border-radius: 0.375rem;
31
+ padding: 0.75rem;
32
+ background-color: #f9fafb;
33
+ }
34
+
35
+ .functionFieldSelected {
36
+ display: flex;
37
+ justify-content: space-between;
38
+ align-items: center;
39
+ }
40
+
41
+ .functionFieldName {
42
+ font-weight: 500;
43
+ color: #1f2937;
44
+ }
45
+
46
+ .functionFieldEditBtn {
47
+ background-color: transparent;
48
+ border: none;
49
+ color: #6b7280;
50
+ cursor: pointer;
51
+ font-size: 0.875rem;
52
+ padding: 0.25rem 0.5rem;
53
+ border-radius: 0.25rem;
54
+
55
+ &:hover {
56
+ background-color: #e5e7eb;
57
+ color: #1f2937;
58
+ }
59
+ }
60
+
61
+ .functionFieldOverlay {
62
+ position: fixed;
63
+ top: 0;
64
+ left: 0;
65
+ right: 0;
66
+ bottom: 0;
67
+ background-color: rgba(0, 0, 0, 0.5);
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ z-index: 1000;
72
+ }
73
+
74
+ .functionFieldModal {
75
+ background-color: white;
76
+ border-radius: 0.5rem;
77
+ box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
78
+ 0 10px 10px -5px rgba(0, 0, 0, 0.04);
79
+ width: 100%;
80
+ max-width: 600px;
81
+ max-height: 90vh;
82
+ overflow-y: auto;
83
+ }
84
+
85
+ .functionFieldModalHeader {
86
+ padding: 1.25rem 1.5rem;
87
+ border-bottom: 1px solid #e5e7eb;
88
+ position: relative;
89
+ }
90
+
91
+ .functionFieldModalTitle {
92
+ margin: 0;
93
+ font-size: 1.25rem;
94
+ font-weight: 600;
95
+ color: #111827;
96
+ }
97
+
98
+ .functionFieldModalDescription {
99
+ margin: 0.5rem 0 0;
100
+ font-size: 0.875rem;
101
+ color: #6b7280;
102
+ }
103
+
104
+ .functionFieldCloseBtn {
105
+ position: absolute;
106
+ top: 1rem;
107
+ right: 1.5rem;
108
+ background: transparent;
109
+ border: none;
110
+ font-size: 1.5rem;
111
+ line-height: 1;
112
+ color: #6b7280;
113
+ cursor: pointer;
114
+ }
115
+
116
+ .functionFieldModalBody {
117
+ padding: 1.5rem;
118
+ padding-bottom: 0.5rem;
119
+ }
120
+
121
+ .functionFieldFormGroup {
122
+ margin-bottom: 1.25rem;
123
+ }
124
+
125
+ .functionFieldInlineGroup {
126
+ display: block;
127
+ align-items: center;
128
+ margin-bottom: 1.25rem;
129
+ }
130
+
131
+ .functionFieldInlineLabel {
132
+ font-weight: 500;
133
+ color: #374151;
134
+ font-size: 0.875rem;
135
+ margin-right: 1rem;
136
+ }
137
+
138
+ .functionFieldInlineSelect {
139
+ flex: 1;
140
+ padding: 0.5rem 0.75rem;
141
+ border: 1px solid #d1d5db;
142
+ border-radius: 0.375rem;
143
+ font-size: 0.875rem;
144
+ line-height: 1.5;
145
+ color: #1f2937;
146
+ appearance: none;
147
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
148
+ background-position: right 0.5rem center;
149
+ background-repeat: no-repeat;
150
+ background-size: 1.5em 1.5em;
151
+ padding-right: 2.5rem;
152
+
153
+ &:focus {
154
+ outline: none;
155
+ border-color: #4250f0;
156
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
157
+ }
158
+ }
159
+
160
+ .functionFieldFormLabel {
161
+ display: block;
162
+ margin-bottom: 0.5rem;
163
+ font-weight: 500;
164
+ color: #374151;
165
+ font-size: 0.875rem;
166
+ }
167
+
168
+ .functionFieldRequired {
169
+ color: #ef4444;
170
+ margin-left: 0.25rem;
171
+ }
172
+
173
+ .functionFieldInput {
174
+ width: 100%;
175
+ padding: 0.5rem 0.75rem;
176
+ border: 1px solid #d1d5db;
177
+ border-radius: 0.375rem;
178
+ font-size: 0.875rem;
179
+ line-height: 1.5;
180
+ color: #1f2937;
181
+
182
+ &:focus {
183
+ outline: none;
184
+ border-color: #4250f0;
185
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
186
+ }
187
+ }
188
+
189
+ .functionFieldTextarea {
190
+ min-height: 100px;
191
+ resize: vertical;
192
+ }
193
+
194
+ .functionFieldSelect {
195
+ appearance: none;
196
+ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
197
+ background-position: right 0.5rem center;
198
+ background-repeat: no-repeat;
199
+ background-size: 1.5em 1.5em;
200
+ padding-right: 2.5rem;
201
+ }
202
+
203
+ .functionFieldCheckbox {
204
+ width: auto;
205
+ margin-right: 0.5rem;
206
+ }
207
+
208
+ .functionFieldConfig {
209
+ min-height: 358px;
210
+ }
211
+
212
+ .functionFieldConfigTitle {
213
+ margin: 0 0 0.5rem;
214
+ font-size: 1rem;
215
+ font-weight: 600;
216
+ color: #111827;
217
+ }
218
+
219
+ .functionFieldConfigDescription {
220
+ margin: 0 0 1.5rem;
221
+ font-size: 0.875rem;
222
+ color: #6b7280;
223
+ }
224
+
225
+ .functionFieldDescription {
226
+ color: var(--black-and-grey-draft-and-tooltip-desc, #999);
227
+ font-family: Inter;
228
+ font-size: 12px;
229
+ font-style: normal;
230
+ font-weight: 400;
231
+ line-height: normal;
232
+ margin-bottom: 15px;
233
+ margin-top: 5px;
234
+ }
235
+
236
+ .functionFieldModalFooter {
237
+ display: flex;
238
+ justify-content: flex-end;
239
+ padding: 1.25rem 1.5rem;
240
+ border-top: 1px solid #e5e7eb;
241
+ gap: 0.75rem;
242
+ }
243
+
244
+ .functionFieldCancelBtn {
245
+ padding: 0.5rem 1rem;
246
+ background-color: white;
247
+ border: 1px solid #d1d5db;
248
+ border-radius: 0.375rem;
249
+ font-size: 0.875rem;
250
+ font-weight: 500;
251
+ color: #374151;
252
+ cursor: pointer;
253
+
254
+ &:hover {
255
+ background-color: #f3f4f6;
256
+ }
257
+ }
258
+
259
+ .functionFieldSaveBtn {
260
+ padding: 0.5rem 1rem;
261
+ background-color: #4250f0;
262
+ border: 1px solid transparent;
263
+ border-radius: 0.375rem;
264
+ font-size: 0.875rem;
265
+ font-weight: 500;
266
+ color: white;
267
+ cursor: pointer;
268
+
269
+ &:hover {
270
+ background-color: #2563eb;
271
+ }
272
+
273
+ &:disabled {
274
+ opacity: 0.5;
275
+ cursor: not-allowed;
276
+ }
277
+ }
278
+
279
+ .functionFieldTabs {
280
+ display: flex;
281
+ border-bottom: 1px solid #e5e7eb;
282
+ margin-bottom: 1rem;
283
+ .disabled {
284
+ opacity: 0.5;
285
+ cursor: not-allowed;
286
+ }
287
+ }
288
+
289
+ .functionFieldTab {
290
+ padding: 0.75rem 1rem;
291
+ font-size: 0.875rem;
292
+ font-weight: 500;
293
+ color: #6b7280;
294
+ background: transparent;
295
+ border: none;
296
+ border-bottom: 2px solid transparent;
297
+ cursor: pointer;
298
+ transition: all 0.2s;
299
+
300
+ &:hover {
301
+ color: #1f2937;
302
+ }
303
+ }
304
+
305
+ .functionFieldTabActive {
306
+ color: #4250f0;
307
+ border-bottom: 2px solid #4250f0;
308
+ }
309
+
310
+ .functionFieldTabContent {
311
+ padding: 1rem 0;
312
+ padding-bottom: 0px;
313
+ .loader {
314
+ display: flex;
315
+ justify-content: center;
316
+ min-height: 100px;
317
+ }
318
+ }
319
+
320
+ .functionFieldAuthPlaceholder {
321
+ padding: 1.5rem;
322
+ background-color: #f9fafb;
323
+ border: 1px dashed #d1d5db;
324
+ border-radius: 0.375rem;
325
+ text-align: center;
326
+ color: #6b7280;
327
+ }
328
+
329
+ .functionFieldTabFooter {
330
+ display: flex;
331
+ justify-content: flex-end;
332
+ margin-top: 1.5rem;
333
+ }
334
+
335
+ .functionFieldNextBtn,
336
+ .functionFieldBackBtn {
337
+ padding: 0.5rem 1rem;
338
+ font-size: 0.875rem;
339
+ font-weight: 500;
340
+ border-radius: 0.375rem;
341
+ cursor: pointer;
342
+ }
343
+
344
+ .functionFieldNextBtn {
345
+ background-color: #4250f0;
346
+ color: white;
347
+ border: 1px solid transparent;
348
+
349
+ &:hover {
350
+ background-color: #2563eb;
351
+ }
352
+ }
353
+
354
+ .functionFieldBackBtn {
355
+ background-color: white;
356
+ color: #374151;
357
+ border: 1px solid #d1d5db;
358
+ margin-right: 0.75rem;
359
+
360
+ &:hover {
361
+ background-color: #f3f4f6;
362
+ }
363
+ }
364
+
365
+ [class^='styles-module_functionFieldModalBody_'] {
366
+ [class^='styles-module_tagMenu_'] {
367
+ padding: 12px 0 !important;
368
+ }
369
+ [class^='styles-module_functionFormWrap_'] {
370
+ padding: 0px;
371
+ [class^='styles-module_functionFormContainer_'] {
372
+ min-height: auto;
373
+ }
374
+ [class^='styles-module_btnSubmit_'] {
375
+ display: none;
376
+ }
377
+ }
378
+ [class^='styles-module_functionHeader_'] {
379
+ display: none;
380
+ }
381
+ }
382
+
383
+ .functionFieldSelected {
384
+ display: flex;
385
+ justify-content: space-between;
386
+ align-items: center;
387
+ }
388
+
389
+ .functionFieldInfo {
390
+ display: flex;
391
+ align-items: center;
392
+ gap: 0.75rem;
393
+ }
394
+
395
+ .functionFieldAppIcon {
396
+ width: 24px;
397
+ height: 24px;
398
+ border-radius: 4px;
399
+ object-fit: contain;
400
+ }
401
+
402
+ .functionFieldNameContainer {
403
+ display: flex;
404
+ flex-direction: column;
405
+ }
406
+
407
+ .functionFieldName {
408
+ font-weight: 500;
409
+ color: #1f2937;
410
+ font-size: 0.875rem;
411
+ }
412
+
413
+ .functionFieldAppName {
414
+ font-size: 0.75rem;
415
+ color: #6b7280;
416
+ }
417
+
418
+ .functionFieldActions {
419
+ display: flex;
420
+ align-items: center;
421
+ gap: 0.5rem;
422
+ }
423
+
424
+ .functionFieldDeleteBtn {
425
+ background-color: transparent;
426
+ border: none;
427
+ color: #6b7280;
428
+ cursor: pointer;
429
+ padding: 0.25rem;
430
+ border-radius: 0.25rem;
431
+ display: flex;
432
+ align-items: center;
433
+ justify-content: center;
434
+
435
+ &:hover {
436
+ background-color: #fee2e2;
437
+ color: #ef4444;
438
+ }
439
+ }
440
+
441
+ .functionFieldEditBtn {
442
+ background-color: #4250f0;
443
+ border: none;
444
+ color: white;
445
+ cursor: pointer;
446
+ font-size: 0.75rem;
447
+ padding: 0.3rem 0.75rem;
448
+ border-radius: 0.25rem;
449
+ font-weight: 500;
450
+
451
+ &:hover {
452
+ background-color: #2563eb;
453
+ color: white;
454
+ }
455
+ }
@@ -1,3 +1,4 @@
1
1
  import { ObjectField, ObjectFieldProps } from './ObjectField';
2
+ import { FunctionField, FunctionFieldProps } from './FunctionField';
2
3
 
3
- export { ObjectField, ObjectFieldProps };
4
+ export { ObjectField, ObjectFieldProps, FunctionField, FunctionFieldProps };
@@ -27,10 +27,9 @@ import DynamicField from '@/features/common/DynamicField';
27
27
  import SectionField from '@/features/common/SectionField';
28
28
  import { TimeInput } from '@/components/TimeInput';
29
29
  import NewMappingUI from '@/features/common/NewMappingUI';
30
- import { ObjectField } from '@/components/form';
30
+ import { ObjectField, FunctionField } from '@/components/form';
31
31
  import { areParentValuesValid, getFieldLabelTags } from '@/utils/stepUtils';
32
32
  import ConfigureFieldWrapper from '@/components/ConfigureFieldWrapper';
33
- import { notEmpty } from '@/types/utils';
34
33
  import {
35
34
  JSONToActivityOutputData,
36
35
  JSONToDynamicFieldData,
@@ -1369,9 +1368,15 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
1369
1368
  const uiField = el.ui_field;
1370
1369
  const uiFieldSourceURL =
1371
1370
  uiField?.data_source?.url || '';
1372
- if (el.data_type === 'OBJECT') {
1371
+ if (
1372
+ el.data_type === 'OBJECT' &&
1373
+ el.type !== 'FUNCTION_FIELD'
1374
+ ) {
1373
1375
  fieldType = 'OBJECT';
1374
- } else if (el.data_type === 'OBJECT[]') {
1376
+ } else if (
1377
+ el.data_type === 'OBJECT[]' &&
1378
+ el.type !== 'FUNCTION_FIELD'
1379
+ ) {
1375
1380
  fieldType = 'OBJECT[]';
1376
1381
  }
1377
1382
 
@@ -2119,6 +2124,43 @@ class ActionForm extends Component<ActionFormPropsType, ActionFormStateType> {
2119
2124
  textContent=${el.default_value}
2120
2125
  />`;
2121
2126
 
2127
+ case 'FUNCTION_FIELD':
2128
+ return html`
2129
+ <${FunctionField}
2130
+ field=${el}
2131
+ name="${el.activity_field?.machine_name ||
2132
+ 'function_field'}"
2133
+ description=${elDescription}
2134
+ label="${el.title}"
2135
+ value=${el.default_value}
2136
+ apiHandler=${this.props.apiHandler}
2137
+ isArray=${!!(el.data_type === 'OBJECT[]')}
2138
+ onChange=${(
2139
+ val: string,
2140
+ passesRegexTest?: boolean,
2141
+ ) => {
2142
+ if (this.props.onFieldChangeCallback) {
2143
+ this.props.onFieldChangeCallback(
2144
+ el.activity_field?.machine_name || '',
2145
+ val,
2146
+ );
2147
+ } else {
2148
+ setStepFieldData({
2149
+ stepId: `${step.id}`,
2150
+ fieldId: `${el.id}`,
2151
+ value: this.getFieldValFromActivityOutputRaw(
2152
+ this.props.activityOutputData,
2153
+ val,
2154
+ ),
2155
+ isRequired: el.is_required,
2156
+ passesRegexTest,
2157
+ });
2158
+ this.props.verifyStepValidity(step.id);
2159
+ }
2160
+ }}
2161
+ />
2162
+ `;
2163
+
2122
2164
  default:
2123
2165
  // return html``;
2124
2166
  return html` <div