@sparrowengg/integrations-templates-frontend 1.9.66 → 1.9.68
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/dist/cjs/commons/icons/arrow.js +1 -17
- package/dist/cjs/commons/icons/arrow.js.map +1 -1
- package/dist/cjs/integration-template/components/dashboard.js +305 -175
- package/dist/cjs/integration-template/components/dashboard.js.map +1 -1
- package/dist/cjs/single-mapping/components/mapping.js +31 -14
- package/dist/cjs/single-mapping/components/mapping.js.map +1 -1
- package/dist/cjs/single-mapping/index.js +248 -88
- package/dist/cjs/single-mapping/index.js.map +1 -1
- package/dist/es/commons/icons/arrow.js +1 -17
- package/dist/es/commons/icons/arrow.js.map +1 -1
- package/dist/es/integration-template/components/dashboard.js +305 -175
- package/dist/es/integration-template/components/dashboard.js.map +1 -1
- package/dist/es/single-mapping/components/mapping.js +31 -14
- package/dist/es/single-mapping/components/mapping.js.map +1 -1
- package/dist/es/single-mapping/index.js +248 -88
- package/dist/es/single-mapping/index.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/package.json +1 -1
|
@@ -13,12 +13,11 @@ var iconButton = require('../node_modules/@sparrowengg/twigs-react/dist/es/butto
|
|
|
13
13
|
var arrowLeft = require('../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/arrow-left.js');
|
|
14
14
|
var heading = require('../node_modules/@sparrowengg/twigs-react/dist/es/heading/heading.js');
|
|
15
15
|
var button = require('../node_modules/@sparrowengg/twigs-react/dist/es/button/button.js');
|
|
16
|
-
var chevronRight = require('../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/chevron-right.js');
|
|
17
16
|
var text = require('../node_modules/@sparrowengg/twigs-react/dist/es/text/text.js');
|
|
17
|
+
var tooltip = require('../node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js');
|
|
18
18
|
var dropdown = require('../node_modules/@sparrowengg/twigs-react/dist/es/dropdown/dropdown.js');
|
|
19
19
|
var input = require('../node_modules/@sparrowengg/twigs-react/dist/es/input/input.js');
|
|
20
20
|
var chevronDown = require('../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/chevron-down.js');
|
|
21
|
-
var tooltip = require('../node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js');
|
|
22
21
|
var calendar = require('../node_modules/@sparrowengg/twigs-react/dist/es/calendar/calendar.js');
|
|
23
22
|
var radio = require('../node_modules/@sparrowengg/twigs-react/dist/es/radio/radio.js');
|
|
24
23
|
var formLabel = require('../node_modules/@sparrowengg/twigs-react/dist/es/form-label/form-label.js');
|
|
@@ -58,7 +57,7 @@ const SingleMapping = ({
|
|
|
58
57
|
apiURL = index.surveySparrowURL,
|
|
59
58
|
surveyDetails,
|
|
60
59
|
importResponse,
|
|
61
|
-
|
|
60
|
+
hasExistingMapping,
|
|
62
61
|
onSaveHandler,
|
|
63
62
|
editField,
|
|
64
63
|
previousMappingHandler
|
|
@@ -70,13 +69,9 @@ const SingleMapping = ({
|
|
|
70
69
|
expressions: [],
|
|
71
70
|
property: []
|
|
72
71
|
});
|
|
73
|
-
const [previousMapping, setPreviousMapping] = React.useState(
|
|
74
|
-
hasPreviousMapping != null ? hasPreviousMapping : false
|
|
75
|
-
);
|
|
76
72
|
React.useEffect(() => {
|
|
77
73
|
if (!!(editField == null ? void 0 : editField.id)) {
|
|
78
74
|
navigateMappingPage(true);
|
|
79
|
-
setPreviousMapping(true);
|
|
80
75
|
}
|
|
81
76
|
}, []);
|
|
82
77
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -100,7 +95,7 @@ const SingleMapping = ({
|
|
|
100
95
|
configuration.onSaveHandler();
|
|
101
96
|
},
|
|
102
97
|
isMappingPage,
|
|
103
|
-
|
|
98
|
+
hasExistingMapping,
|
|
104
99
|
navigateConfigPage: () => navigateMappingPage(false),
|
|
105
100
|
previousMappingHandler,
|
|
106
101
|
onSaveHandler: () => {
|
|
@@ -147,7 +142,7 @@ const SingleMapping = ({
|
|
|
147
142
|
const MappingHeader = ({
|
|
148
143
|
editField,
|
|
149
144
|
importResponse,
|
|
150
|
-
|
|
145
|
+
hasExistingMapping,
|
|
151
146
|
ssMappingData,
|
|
152
147
|
isMappingPage,
|
|
153
148
|
navigateConfigPage,
|
|
@@ -174,6 +169,15 @@ const MappingHeader = ({
|
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
171
|
};
|
|
172
|
+
const isMappingPageDisabled = () => {
|
|
173
|
+
var _a, _b, _c, _d;
|
|
174
|
+
const isAllFieldsDisabled = (_a = Object.values((configuration == null ? void 0 : configuration.configurationFields) || {})) == null ? void 0 : _a.some((field) => (field == null ? void 0 : field.value) === null || (field == null ? void 0 : field.value) === void 0);
|
|
175
|
+
if ((_c = (_b = configuration == null ? void 0 : configuration.configurationFields) == null ? void 0 : _b.find((field) => (field == null ? void 0 : field.id) === "responseImportSettings")) == null ? void 0 : _c.value) {
|
|
176
|
+
return isAllFieldsDisabled || !((_d = configuration == null ? void 0 : configuration.configuredFields) == null ? void 0 : _d.responseImportType);
|
|
177
|
+
} else {
|
|
178
|
+
return isAllFieldsDisabled;
|
|
179
|
+
}
|
|
180
|
+
};
|
|
177
181
|
return /* @__PURE__ */ React.createElement(
|
|
178
182
|
flex.Flex,
|
|
179
183
|
{
|
|
@@ -189,7 +193,7 @@ const MappingHeader = ({
|
|
|
189
193
|
{
|
|
190
194
|
gap: "$6",
|
|
191
195
|
alignItems: "center",
|
|
192
|
-
css: { visibility:
|
|
196
|
+
css: { visibility: hasExistingMapping ? "visible" : "hidden" }
|
|
193
197
|
},
|
|
194
198
|
/* @__PURE__ */ React.createElement(
|
|
195
199
|
iconButton.IconButton,
|
|
@@ -226,15 +230,25 @@ const MappingHeader = ({
|
|
|
226
230
|
/* @__PURE__ */ React.createElement(
|
|
227
231
|
button.Button,
|
|
228
232
|
{
|
|
229
|
-
|
|
233
|
+
disabled: isMappingPageDisabled(),
|
|
234
|
+
css: { color: isMappingPage ? "$neutral900" : "$neutral800", cursor: isMappingPageDisabled() ? "not-allowed" : "pointer" },
|
|
230
235
|
color: "default",
|
|
231
236
|
variant: "ghost",
|
|
237
|
+
onClick: () => {
|
|
238
|
+
if (isMappingPage) {
|
|
239
|
+
onSaveHandler();
|
|
240
|
+
} else {
|
|
241
|
+
saveConfiguration();
|
|
242
|
+
}
|
|
243
|
+
},
|
|
232
244
|
size: "md"
|
|
233
245
|
},
|
|
234
246
|
"Mapping"
|
|
235
247
|
)
|
|
236
248
|
),
|
|
237
|
-
/* @__PURE__ */ React.createElement(
|
|
249
|
+
/* @__PURE__ */ React.createElement(flex.Flex, { justifyContent: "center", css: {
|
|
250
|
+
width: "180px"
|
|
251
|
+
} }, /* @__PURE__ */ React.createElement(
|
|
238
252
|
button.Button,
|
|
239
253
|
{
|
|
240
254
|
size: "lg",
|
|
@@ -245,11 +259,10 @@ const MappingHeader = ({
|
|
|
245
259
|
} else {
|
|
246
260
|
saveConfiguration();
|
|
247
261
|
}
|
|
248
|
-
}
|
|
249
|
-
rightIcon: /* @__PURE__ */ React.createElement(chevronRight.ChevronRightIcon, null)
|
|
262
|
+
}
|
|
250
263
|
},
|
|
251
264
|
isMappingPage ? (editField == null ? void 0 : editField.id) ? "Update Mapping" : "Save Mapping" : "Continue, Mapping"
|
|
252
|
-
)
|
|
265
|
+
))
|
|
253
266
|
);
|
|
254
267
|
};
|
|
255
268
|
const ConfigurationSetup = ({
|
|
@@ -257,7 +270,19 @@ const ConfigurationSetup = ({
|
|
|
257
270
|
surveyName
|
|
258
271
|
}) => {
|
|
259
272
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
|
|
260
|
-
return /* @__PURE__ */ React.createElement(box.Box, { css: { maxWidth: 488, width: "100%" } }, /* @__PURE__ */ React.createElement(heading.Heading, { size: "h5" }, "Event Details"), /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React.createElement(
|
|
273
|
+
return /* @__PURE__ */ React.createElement(box.Box, { css: { maxWidth: 488, width: "100%" } }, /* @__PURE__ */ React.createElement(heading.Heading, { size: "h5" }, "Event Details"), /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React.createElement(tooltip.Tooltip, { content: (surveyName == null ? void 0 : surveyName.length) > 30 ? surveyName : "", css: {
|
|
274
|
+
zIndex: "9999999 !important",
|
|
275
|
+
fontFamily: "DM Sans !important"
|
|
276
|
+
} }, /* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(
|
|
277
|
+
text.Text,
|
|
278
|
+
{
|
|
279
|
+
size: "sm",
|
|
280
|
+
weight: "medium",
|
|
281
|
+
truncate: true,
|
|
282
|
+
css: { color: "$neutral800", maxWidth: "270px" }
|
|
283
|
+
},
|
|
284
|
+
surveyName
|
|
285
|
+
)))), /* @__PURE__ */ React.createElement(
|
|
261
286
|
flex.Flex,
|
|
262
287
|
{
|
|
263
288
|
flexDirection: "column",
|
|
@@ -270,11 +295,49 @@ const ConfigurationSetup = ({
|
|
|
270
295
|
}
|
|
271
296
|
},
|
|
272
297
|
(_a = configuration.configurationFields) == null ? void 0 : _a.map((field) => {
|
|
273
|
-
return /* @__PURE__ */ React.createElement(
|
|
298
|
+
return /* @__PURE__ */ React.createElement(
|
|
299
|
+
Configuration,
|
|
300
|
+
{
|
|
301
|
+
field,
|
|
302
|
+
configuredFields: configuration.configuredFields
|
|
303
|
+
}
|
|
304
|
+
);
|
|
274
305
|
}),
|
|
275
|
-
configuration.importOptions.showImportOptions && /* @__PURE__ */ React.createElement(
|
|
276
|
-
|
|
277
|
-
|
|
306
|
+
configuration.importOptions.showImportOptions && /* @__PURE__ */ React.createElement(
|
|
307
|
+
flex.Flex,
|
|
308
|
+
{
|
|
309
|
+
gap: "$2",
|
|
310
|
+
flexDirection: "column",
|
|
311
|
+
css: {
|
|
312
|
+
marginTop: "-4px !important"
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
/* @__PURE__ */ React.createElement(
|
|
316
|
+
CustomDropdown,
|
|
317
|
+
{
|
|
318
|
+
data: configuration.importOptions.options,
|
|
319
|
+
value: (_c = (_b = configuration == null ? void 0 : configuration.configuredFields) == null ? void 0 : _b.responseImportType) == null ? void 0 : _c.value,
|
|
320
|
+
onChangeHandler: configuration.importOptions.onChangeHandler
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
),
|
|
324
|
+
((_f = (_e = (_d = configuration.configuredFields) == null ? void 0 : _d.responseImportType) == null ? void 0 : _e.value) == null ? void 0 : _f.type) === "date" && /* @__PURE__ */ React.createElement(
|
|
325
|
+
text.Text,
|
|
326
|
+
{
|
|
327
|
+
size: "sm",
|
|
328
|
+
weight: "regular",
|
|
329
|
+
css: { color: "$neutral600", marginTop: "-$6" }
|
|
330
|
+
},
|
|
331
|
+
`Existing responses from ${(_i = (_h = (_g = configuration.configuredFields) == null ? void 0 : _g.responseImportType) == null ? void 0 : _h.value) == null ? void 0 : _i.value} will be imported`
|
|
332
|
+
),
|
|
333
|
+
configuration.importOptions.excludeResponse && ((_l = (_k = (_j = configuration.configuredFields) == null ? void 0 : _j.responseImportType) == null ? void 0 : _k.value) == null ? void 0 : _l.type) === "dateRange" && /* @__PURE__ */ React.createElement(
|
|
334
|
+
Configuration,
|
|
335
|
+
{
|
|
336
|
+
field: configuration.importOptions.excludeResponse,
|
|
337
|
+
configuredFields: configuration.configuredFields,
|
|
338
|
+
responseImportType: (_p = (_o = (_n = (_m = configuration.configuredFields) == null ? void 0 : _m.responseImportType) == null ? void 0 : _n.value) == null ? void 0 : _o.value) == null ? void 0 : _p.label
|
|
339
|
+
}
|
|
340
|
+
)
|
|
278
341
|
));
|
|
279
342
|
};
|
|
280
343
|
const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
@@ -322,7 +385,8 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
322
385
|
{
|
|
323
386
|
content: option.tooltip || "",
|
|
324
387
|
css: {
|
|
325
|
-
zIndex: "9999999 !important"
|
|
388
|
+
zIndex: "9999999 !important",
|
|
389
|
+
fontFamily: "DM Sans !important"
|
|
326
390
|
}
|
|
327
391
|
},
|
|
328
392
|
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(
|
|
@@ -330,7 +394,8 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
330
394
|
{
|
|
331
395
|
disabled: option == null ? void 0 : option.disabled,
|
|
332
396
|
css: {
|
|
333
|
-
cursor: (option == null ? void 0 : option.disabled) ? "not-allowed !important" : "pointer !important"
|
|
397
|
+
cursor: (option == null ? void 0 : option.disabled) ? "not-allowed !important" : "pointer !important",
|
|
398
|
+
background: (value == null ? void 0 : value.type) === option.type ? "#4A9CA626 !important" : "transparent !important"
|
|
334
399
|
},
|
|
335
400
|
onClick: () => onChangeHandler({
|
|
336
401
|
id: "responseImportType",
|
|
@@ -350,8 +415,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
350
415
|
flex.Flex,
|
|
351
416
|
{
|
|
352
417
|
justifyContent: "center",
|
|
353
|
-
flexDirection: "column"
|
|
354
|
-
gap: "$2"
|
|
418
|
+
flexDirection: "column"
|
|
355
419
|
},
|
|
356
420
|
/* @__PURE__ */ React.createElement(
|
|
357
421
|
text.Text,
|
|
@@ -365,9 +429,9 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
365
429
|
/* @__PURE__ */ React.createElement(
|
|
366
430
|
text.Text,
|
|
367
431
|
{
|
|
368
|
-
size: "
|
|
369
|
-
weight: "
|
|
370
|
-
css: { color: "$
|
|
432
|
+
size: "xs",
|
|
433
|
+
weight: "regular",
|
|
434
|
+
css: { color: "$neutral700" }
|
|
371
435
|
},
|
|
372
436
|
option.description
|
|
373
437
|
)
|
|
@@ -381,10 +445,11 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
381
445
|
{
|
|
382
446
|
content: option.tooltip || "",
|
|
383
447
|
css: {
|
|
448
|
+
fontFamily: "DM Sans !important",
|
|
384
449
|
zIndex: "9999999 !important"
|
|
385
450
|
}
|
|
386
451
|
},
|
|
387
|
-
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuSub, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuSubTrigger, { disabled: option == null ? void 0 : option.disabled, css: { cursor: (option == null ? void 0 : option.disabled) ? "not-allowed !important" : "pointer !important" } }, " ", /* @__PURE__ */ React.createElement(
|
|
452
|
+
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuSub, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuSubTrigger, { disabled: option == null ? void 0 : option.disabled, css: { cursor: (option == null ? void 0 : option.disabled) ? "not-allowed !important" : "pointer !important", background: (value == null ? void 0 : value.type) === option.type ? "#4A9CA626 !important" : "transparent !important" } }, " ", /* @__PURE__ */ React.createElement(
|
|
388
453
|
flex.Flex,
|
|
389
454
|
{
|
|
390
455
|
justifyContent: "space-between",
|
|
@@ -398,8 +463,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
398
463
|
{
|
|
399
464
|
css: { cursor: "pointer" },
|
|
400
465
|
justifyContent: "center",
|
|
401
|
-
flexDirection: "column"
|
|
402
|
-
gap: "$2"
|
|
466
|
+
flexDirection: "column"
|
|
403
467
|
},
|
|
404
468
|
/* @__PURE__ */ React.createElement(
|
|
405
469
|
text.Text,
|
|
@@ -413,9 +477,9 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
413
477
|
/* @__PURE__ */ React.createElement(
|
|
414
478
|
text.Text,
|
|
415
479
|
{
|
|
416
|
-
size: "
|
|
417
|
-
weight: "
|
|
418
|
-
css: { color: "$
|
|
480
|
+
size: "xs",
|
|
481
|
+
weight: "regular",
|
|
482
|
+
css: { color: "$neutral700" }
|
|
419
483
|
},
|
|
420
484
|
option.description
|
|
421
485
|
)
|
|
@@ -505,7 +569,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
505
569
|
));
|
|
506
570
|
};
|
|
507
571
|
const Configuration = ({ field, configuredFields, responseImportType = null }) => {
|
|
508
|
-
var _a, _b;
|
|
572
|
+
var _a, _b, _c, _d;
|
|
509
573
|
let fieldValue = null;
|
|
510
574
|
fieldValue = (_b = (_a = configuredFields == null ? void 0 : configuredFields[field.id]) == null ? void 0 : _a.value) != null ? _b : null;
|
|
511
575
|
const [error, setError] = React.useState({
|
|
@@ -515,8 +579,10 @@ const Configuration = ({ field, configuredFields, responseImportType = null }) =
|
|
|
515
579
|
});
|
|
516
580
|
switch (field.fieldType) {
|
|
517
581
|
case "switch":
|
|
518
|
-
return /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$
|
|
519
|
-
marginBlockStart: "$12"
|
|
582
|
+
return /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$4", alignItems: "center", css: {
|
|
583
|
+
marginBlockStart: "$12",
|
|
584
|
+
borderTop: "$borderWidths$xs solid $neutral200",
|
|
585
|
+
paddingTop: "$16"
|
|
520
586
|
} }, /* @__PURE__ */ React.createElement(
|
|
521
587
|
_switch.Switch,
|
|
522
588
|
{
|
|
@@ -528,58 +594,152 @@ const Configuration = ({ field, configuredFields, responseImportType = null }) =
|
|
|
528
594
|
value
|
|
529
595
|
})
|
|
530
596
|
}
|
|
531
|
-
), /* @__PURE__ */ React.createElement(text.Text, { size: "
|
|
597
|
+
), /* @__PURE__ */ React.createElement(text.Text, { size: "md", weight: "regular", css: { color: "$neutral900" } }, field.label));
|
|
532
598
|
case "checkbox":
|
|
533
599
|
return /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", alignItems: "start", gap: "$4" }, /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$4", alignItems: "center" }, /* @__PURE__ */ React.createElement(checkbox.Checkbox, { disabled: field == null ? void 0 : field.disabled, checked: !!fieldValue, onChange: (value) => field.onChangeHandler({
|
|
534
600
|
id: field.id,
|
|
535
601
|
value
|
|
536
602
|
}) }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm", weight: "regular", css: { color: "$neutral900" } }, field.label)), /* @__PURE__ */ React.createElement(text.Text, { size: "sm", weight: "regular", css: { color: "$neutral500" } }, field.value ? field.ifChecked() : field.ifUnchecked(responseImportType)));
|
|
537
603
|
case "input":
|
|
538
|
-
return /* @__PURE__ */ React.createElement(
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
604
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, (field == null ? void 0 : field.id) === "spreadsheet" ? /* @__PURE__ */ React.createElement(React.Fragment, null, ((_c = configuredFields == null ? void 0 : configuredFields.action) == null ? void 0 : _c.value) ? /* @__PURE__ */ React.createElement(
|
|
605
|
+
box.Box,
|
|
606
|
+
{
|
|
607
|
+
className: "dm-sans",
|
|
608
|
+
css: {
|
|
609
|
+
label: {
|
|
610
|
+
fontSize: "$xs !important"
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
/* @__PURE__ */ React.createElement(
|
|
615
|
+
formInput.FormInput,
|
|
616
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
617
|
+
disabled: field == null ? void 0 : field.disabled
|
|
618
|
+
}, error.id === field.id && {
|
|
619
|
+
error: error.errorMessage,
|
|
620
|
+
errorBorder: error.error
|
|
621
|
+
}), {
|
|
622
|
+
label: field.label,
|
|
623
|
+
value: typeof fieldValue === "object" ? "" : fieldValue || "",
|
|
624
|
+
size: "lg"
|
|
625
|
+
}), field.pattern && {
|
|
626
|
+
pattern: field.pattern
|
|
627
|
+
}), {
|
|
628
|
+
onChange: (event) => {
|
|
629
|
+
if (field == null ? void 0 : field.pattern) {
|
|
630
|
+
const pattern = new RegExp(field.pattern);
|
|
631
|
+
if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
|
|
632
|
+
setError({
|
|
633
|
+
errorMessage: field.errorMessage,
|
|
634
|
+
error: true,
|
|
635
|
+
id: field.id
|
|
636
|
+
});
|
|
637
|
+
} else {
|
|
638
|
+
setError({
|
|
639
|
+
errorMessage: "",
|
|
640
|
+
error: false,
|
|
641
|
+
id: null
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
field.onChangeHandler({
|
|
645
|
+
id: field.id,
|
|
646
|
+
value: event.currentTarget.value
|
|
560
647
|
});
|
|
561
648
|
} else {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
id: null
|
|
649
|
+
field.onChangeHandler({
|
|
650
|
+
id: field.id,
|
|
651
|
+
value: event.currentTarget.value
|
|
566
652
|
});
|
|
567
653
|
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
654
|
+
}
|
|
655
|
+
})
|
|
656
|
+
)
|
|
657
|
+
) : null) : /* @__PURE__ */ React.createElement(
|
|
658
|
+
box.Box,
|
|
659
|
+
{
|
|
660
|
+
className: "dm-sans",
|
|
661
|
+
css: {
|
|
662
|
+
label: {
|
|
663
|
+
fontSize: "$xs !important"
|
|
577
664
|
}
|
|
578
665
|
}
|
|
579
|
-
}
|
|
580
|
-
|
|
666
|
+
},
|
|
667
|
+
/* @__PURE__ */ React.createElement(
|
|
668
|
+
formInput.FormInput,
|
|
669
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
670
|
+
disabled: field == null ? void 0 : field.disabled
|
|
671
|
+
}, error.id === field.id && {
|
|
672
|
+
error: error.errorMessage,
|
|
673
|
+
errorBorder: error.error
|
|
674
|
+
}), {
|
|
675
|
+
label: field.label,
|
|
676
|
+
value: typeof fieldValue === "object" ? "" : fieldValue || "",
|
|
677
|
+
size: "lg"
|
|
678
|
+
}), field.pattern && {
|
|
679
|
+
pattern: field.pattern
|
|
680
|
+
}), {
|
|
681
|
+
onChange: (event) => {
|
|
682
|
+
if (field == null ? void 0 : field.pattern) {
|
|
683
|
+
const pattern = new RegExp(field.pattern);
|
|
684
|
+
if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
|
|
685
|
+
setError({
|
|
686
|
+
errorMessage: field.errorMessage,
|
|
687
|
+
error: true,
|
|
688
|
+
id: field.id
|
|
689
|
+
});
|
|
690
|
+
} else {
|
|
691
|
+
setError({
|
|
692
|
+
errorMessage: "",
|
|
693
|
+
error: false,
|
|
694
|
+
id: null
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
field.onChangeHandler({
|
|
698
|
+
id: field.id,
|
|
699
|
+
value: event.currentTarget.value
|
|
700
|
+
});
|
|
701
|
+
} else {
|
|
702
|
+
field.onChangeHandler({
|
|
703
|
+
id: field.id,
|
|
704
|
+
value: event.currentTarget.value
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
})
|
|
709
|
+
)
|
|
710
|
+
));
|
|
581
711
|
default:
|
|
582
|
-
return /* @__PURE__ */ React.createElement(
|
|
712
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, field.id === "spreadsheet" ? /* @__PURE__ */ React.createElement(React.Fragment, null, ((_d = configuredFields == null ? void 0 : configuredFields.action) == null ? void 0 : _d.value) ? /* @__PURE__ */ React.createElement(
|
|
713
|
+
flex.Flex,
|
|
714
|
+
{
|
|
715
|
+
gap: "$2",
|
|
716
|
+
flexDirection: "column",
|
|
717
|
+
css: {
|
|
718
|
+
cursor: "pointer !important",
|
|
719
|
+
".twigs-select__indicator": {
|
|
720
|
+
width: "14px !important",
|
|
721
|
+
color: "#848484 !important"
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
/* @__PURE__ */ React.createElement(formLabel.FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
|
|
726
|
+
/* @__PURE__ */ React.createElement(CustomAddNewSelect, { field })
|
|
727
|
+
) : null) : /* @__PURE__ */ React.createElement(
|
|
728
|
+
flex.Flex,
|
|
729
|
+
{
|
|
730
|
+
gap: "$2",
|
|
731
|
+
flexDirection: "column",
|
|
732
|
+
css: {
|
|
733
|
+
cursor: "pointer !important",
|
|
734
|
+
".twigs-select__indicator": {
|
|
735
|
+
width: "14px !important",
|
|
736
|
+
color: "#848484 !important"
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
},
|
|
740
|
+
/* @__PURE__ */ React.createElement(formLabel.FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
|
|
741
|
+
/* @__PURE__ */ React.createElement(CustomAddNewSelect, { field })
|
|
742
|
+
));
|
|
583
743
|
}
|
|
584
744
|
};
|
|
585
745
|
const CustomAddNewSelect = ({ field }) => {
|
|
@@ -589,6 +749,9 @@ const CustomAddNewSelect = ({ field }) => {
|
|
|
589
749
|
isDisabled: field == null ? void 0 : field.disabled,
|
|
590
750
|
placeholder: "",
|
|
591
751
|
size: "lg",
|
|
752
|
+
css: {
|
|
753
|
+
cursor: "pointer"
|
|
754
|
+
},
|
|
592
755
|
components: {
|
|
593
756
|
Option: CustomShareOption,
|
|
594
757
|
SingleValue: CustomSingleValue
|
|
@@ -596,7 +759,8 @@ const CustomAddNewSelect = ({ field }) => {
|
|
|
596
759
|
styles: {
|
|
597
760
|
singleValue: (provided, state) => __spreadProps(__spreadValues({}, provided), {
|
|
598
761
|
display: "flex",
|
|
599
|
-
alignItems: "center"
|
|
762
|
+
alignItems: "center",
|
|
763
|
+
cursor: "pointer"
|
|
600
764
|
})
|
|
601
765
|
},
|
|
602
766
|
value: field.value,
|
|
@@ -614,19 +778,15 @@ const CustomAddNewSelect = ({ field }) => {
|
|
|
614
778
|
const CustomShareOption = (props) => {
|
|
615
779
|
if (props.data.value === "ADD_NEW") {
|
|
616
780
|
return /* @__PURE__ */ React.createElement(tooltip.Tooltip, { content: props.data.tooltip || "", css: {
|
|
617
|
-
zIndex: 999999999
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
leftIcon: /* @__PURE__ */ React.createElement(plus.PlusIcon, { size: 16 })
|
|
625
|
-
},
|
|
626
|
-
"Add New"
|
|
627
|
-
)))));
|
|
781
|
+
zIndex: 999999999,
|
|
782
|
+
fontFamily: "DM Sans !important"
|
|
783
|
+
} }, /* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(flex.Flex, { justifyContent: "center", alignItems: "center", css: { cursor: "pointer", zIndex: 999999999 } }, /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$2", alignItems: "center", css: {
|
|
784
|
+
color: "$primary500",
|
|
785
|
+
fontSize: "$sm",
|
|
786
|
+
fontWeight: "$7"
|
|
787
|
+
} }, /* @__PURE__ */ React.createElement(plus.PlusIcon, { size: 16, color: "#4A9CA6" }), "Add Account")))));
|
|
628
788
|
} else {
|
|
629
|
-
return /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(flex.Flex, { css: { cursor: "pointer" }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, props.label)));
|
|
789
|
+
return /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(flex.Flex, { css: { cursor: "pointer", zIndex: 999999999 }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, props.label)));
|
|
630
790
|
}
|
|
631
791
|
};
|
|
632
792
|
const CustomSingleValue = (props) => {
|