@sparrowengg/integrations-templates-frontend 1.9.69 → 1.9.71
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/components/confirmation-modal.js +51 -37
- package/dist/cjs/commons/components/confirmation-modal.js.map +1 -1
- package/dist/cjs/commons/components/edit-confirmation.js +76 -0
- package/dist/cjs/commons/components/edit-confirmation.js.map +1 -0
- package/dist/cjs/commons/icons/sync.js +1 -90
- package/dist/cjs/commons/icons/sync.js.map +1 -1
- package/dist/cjs/integration-template/components/dashboard.js +24 -20
- package/dist/cjs/integration-template/components/dashboard.js.map +1 -1
- package/dist/cjs/single-mapping/components/mapping.js +4 -1
- package/dist/cjs/single-mapping/components/mapping.js.map +1 -1
- package/dist/cjs/single-mapping/index.js +345 -142
- package/dist/cjs/single-mapping/index.js.map +1 -1
- package/dist/es/commons/components/confirmation-modal.js +51 -37
- package/dist/es/commons/components/confirmation-modal.js.map +1 -1
- package/dist/es/commons/components/edit-confirmation.js +72 -0
- package/dist/es/commons/components/edit-confirmation.js.map +1 -0
- package/dist/es/commons/icons/sync.js +1 -90
- package/dist/es/commons/icons/sync.js.map +1 -1
- package/dist/es/integration-template/components/dashboard.js +24 -20
- package/dist/es/integration-template/components/dashboard.js.map +1 -1
- package/dist/es/node_modules/@sparrowengg/twigs-react/dist/es/alert-dialog/alert-dialog.js +1 -1
- package/dist/es/single-mapping/components/mapping.js +4 -1
- package/dist/es/single-mapping/components/mapping.js.map +1 -1
- package/dist/es/single-mapping/index.js +345 -142
- package/dist/es/single-mapping/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var string = require('../node_modules/@internationalized/date/dist/string.js');
|
|
4
|
+
var editConfirmation = require('../commons/components/edit-confirmation.js');
|
|
4
5
|
var React = require('react');
|
|
5
6
|
var arrow = require('../commons/icons/arrow.js');
|
|
6
7
|
var mapping = require('./components/mapping.js');
|
|
@@ -69,11 +70,26 @@ const SingleMapping = ({
|
|
|
69
70
|
expressions: [],
|
|
70
71
|
property: []
|
|
71
72
|
});
|
|
73
|
+
const [isEditConfirmationOpen, setIsEditConfirmationOpen] = React.useState(false);
|
|
74
|
+
const [originalMappingData, setOriginalMappingData] = React.useState(null);
|
|
75
|
+
const [originalConfigurationFields, setOriginalConfigurationFields] = React.useState(null);
|
|
76
|
+
const [originalConfiguredFields, setOriginalConfiguredFields] = React.useState(null);
|
|
72
77
|
React.useEffect(() => {
|
|
73
78
|
if (!!(editField == null ? void 0 : editField.id)) {
|
|
74
79
|
navigateMappingPage(true);
|
|
80
|
+
setOriginalMappingData(JSON.parse(JSON.stringify(ssMappingData)));
|
|
81
|
+
setOriginalConfigurationFields(JSON.parse(JSON.stringify(configuration.configurationFields)));
|
|
82
|
+
setOriginalConfiguredFields(JSON.parse(JSON.stringify(configuration.configuredFields)));
|
|
75
83
|
}
|
|
76
84
|
}, []);
|
|
85
|
+
const hasFieldsChanged = () => {
|
|
86
|
+
if (!(editField == null ? void 0 : editField.id) || !originalMappingData)
|
|
87
|
+
return true;
|
|
88
|
+
const mappingDataChanged = JSON.stringify(ssMappingData) !== JSON.stringify(originalMappingData);
|
|
89
|
+
const configFieldsChanged = JSON.stringify(configuration.configurationFields) !== JSON.stringify(originalConfigurationFields);
|
|
90
|
+
const configuredFieldsChanged = JSON.stringify(configuration.configuredFields) !== JSON.stringify(originalConfiguredFields);
|
|
91
|
+
return mappingDataChanged || configFieldsChanged || configuredFieldsChanged;
|
|
92
|
+
};
|
|
77
93
|
return /* @__PURE__ */ React.createElement(
|
|
78
94
|
themeProvider.ThemeProvider,
|
|
79
95
|
{
|
|
@@ -87,10 +103,13 @@ const SingleMapping = ({
|
|
|
87
103
|
/* @__PURE__ */ React.createElement(box.Box, { css: { width: "100%" } }, /* @__PURE__ */ React.createElement(
|
|
88
104
|
MappingHeader,
|
|
89
105
|
{
|
|
106
|
+
isEditConfirmationOpen,
|
|
107
|
+
setIsEditConfirmationOpen,
|
|
90
108
|
editField,
|
|
91
109
|
importResponse,
|
|
92
110
|
ssMappingData,
|
|
93
111
|
configuration,
|
|
112
|
+
hasFieldsChanged,
|
|
94
113
|
saveConfiguration: () => {
|
|
95
114
|
configuration.onSaveHandler();
|
|
96
115
|
},
|
|
@@ -140,6 +159,7 @@ const SingleMapping = ({
|
|
|
140
159
|
);
|
|
141
160
|
};
|
|
142
161
|
const MappingHeader = ({
|
|
162
|
+
isEditConfirmationOpen,
|
|
143
163
|
editField,
|
|
144
164
|
importResponse,
|
|
145
165
|
hasExistingMapping,
|
|
@@ -149,20 +169,35 @@ const MappingHeader = ({
|
|
|
149
169
|
onSaveHandler,
|
|
150
170
|
previousMappingHandler,
|
|
151
171
|
saveConfiguration,
|
|
152
|
-
configuration
|
|
172
|
+
configuration,
|
|
173
|
+
setIsEditConfirmationOpen,
|
|
174
|
+
hasFieldsChanged
|
|
153
175
|
}) => {
|
|
154
176
|
const isButtonDisabled = () => {
|
|
155
177
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
156
178
|
if (isMappingPage) {
|
|
179
|
+
if ((editField == null ? void 0 : editField.id) && !hasFieldsChanged()) {
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
157
182
|
if ((importResponse == null ? void 0 : importResponse.value.ImportMethod) === "SEND_ALL_DATA") {
|
|
158
183
|
return !(((_a = ssMappingData == null ? void 0 : ssMappingData.questions) == null ? void 0 : _a.length) || ((_b = ssMappingData == null ? void 0 : ssMappingData.variables) == null ? void 0 : _b.length) || ((_c = ssMappingData == null ? void 0 : ssMappingData.contactProperties) == null ? void 0 : _c.length) || ((_d = ssMappingData == null ? void 0 : ssMappingData.expressions) == null ? void 0 : _d.length) || ((_e = ssMappingData == null ? void 0 : ssMappingData.property) == null ? void 0 : _e.length));
|
|
159
184
|
} else {
|
|
160
|
-
const isMappingDisabled = ssMappingData.questions.some((question) => question.isEnabled) || ssMappingData.variables.some((variable) => variable.isEnabled) || ssMappingData.contactProperties.some(
|
|
185
|
+
const isMappingDisabled = ssMappingData.questions.some((question) => question.isEnabled) || ssMappingData.variables.some((variable) => variable.isEnabled) || ssMappingData.contactProperties.some(
|
|
186
|
+
(property) => property.isEnabled
|
|
187
|
+
) || ssMappingData.expressions.some(
|
|
188
|
+
(expression) => expression.isEnabled
|
|
189
|
+
) || ssMappingData.property.some((property) => property.isEnabled);
|
|
161
190
|
return !isMappingDisabled;
|
|
162
191
|
}
|
|
163
192
|
} else {
|
|
164
|
-
const isAllFieldsDisabled = (_f = Object.values(
|
|
165
|
-
|
|
193
|
+
const isAllFieldsDisabled = (_f = Object.values(
|
|
194
|
+
(configuration == null ? void 0 : configuration.configurationFields) || {}
|
|
195
|
+
)) == null ? void 0 : _f.some(
|
|
196
|
+
(field) => (field == null ? void 0 : field.value) === null || (field == null ? void 0 : field.value) === void 0
|
|
197
|
+
);
|
|
198
|
+
if ((_h = (_g = configuration == null ? void 0 : configuration.configurationFields) == null ? void 0 : _g.find(
|
|
199
|
+
(field) => (field == null ? void 0 : field.id) === "responseImportSettings"
|
|
200
|
+
)) == null ? void 0 : _h.value) {
|
|
166
201
|
return isAllFieldsDisabled || !((_i = configuration == null ? void 0 : configuration.configuredFields) == null ? void 0 : _i.responseImportType);
|
|
167
202
|
} else {
|
|
168
203
|
return isAllFieldsDisabled;
|
|
@@ -171,8 +206,14 @@ const MappingHeader = ({
|
|
|
171
206
|
};
|
|
172
207
|
const isMappingPageDisabled = () => {
|
|
173
208
|
var _a, _b, _c, _d;
|
|
174
|
-
const isAllFieldsDisabled = (_a = Object.values(
|
|
175
|
-
|
|
209
|
+
const isAllFieldsDisabled = (_a = Object.values(
|
|
210
|
+
(configuration == null ? void 0 : configuration.configurationFields) || {}
|
|
211
|
+
)) == null ? void 0 : _a.some(
|
|
212
|
+
(field) => (field == null ? void 0 : field.value) === null || (field == null ? void 0 : field.value) === void 0
|
|
213
|
+
);
|
|
214
|
+
if ((_c = (_b = configuration == null ? void 0 : configuration.configurationFields) == null ? void 0 : _b.find(
|
|
215
|
+
(field) => (field == null ? void 0 : field.id) === "responseImportSettings"
|
|
216
|
+
)) == null ? void 0 : _c.value) {
|
|
176
217
|
return isAllFieldsDisabled || !((_d = configuration == null ? void 0 : configuration.configuredFields) == null ? void 0 : _d.responseImportType);
|
|
177
218
|
} else {
|
|
178
219
|
return isAllFieldsDisabled;
|
|
@@ -231,7 +272,10 @@ const MappingHeader = ({
|
|
|
231
272
|
button.Button,
|
|
232
273
|
{
|
|
233
274
|
disabled: isMappingPageDisabled(),
|
|
234
|
-
css: {
|
|
275
|
+
css: {
|
|
276
|
+
color: isMappingPage ? "$neutral900" : "$neutral800",
|
|
277
|
+
cursor: isMappingPageDisabled() ? "not-allowed" : "pointer"
|
|
278
|
+
},
|
|
235
279
|
color: "default",
|
|
236
280
|
variant: "ghost",
|
|
237
281
|
onClick: () => {
|
|
@@ -246,23 +290,48 @@ const MappingHeader = ({
|
|
|
246
290
|
"Mapping"
|
|
247
291
|
)
|
|
248
292
|
),
|
|
249
|
-
/* @__PURE__ */ React.createElement(
|
|
250
|
-
|
|
251
|
-
} }, /* @__PURE__ */ React.createElement(
|
|
252
|
-
button.Button,
|
|
293
|
+
/* @__PURE__ */ React.createElement(
|
|
294
|
+
flex.Flex,
|
|
253
295
|
{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (isMappingPage) {
|
|
258
|
-
onSaveHandler();
|
|
259
|
-
} else {
|
|
260
|
-
saveConfiguration();
|
|
261
|
-
}
|
|
296
|
+
justifyContent: "end",
|
|
297
|
+
css: {
|
|
298
|
+
width: "180px"
|
|
262
299
|
}
|
|
263
300
|
},
|
|
264
|
-
|
|
265
|
-
|
|
301
|
+
/* @__PURE__ */ React.createElement(
|
|
302
|
+
button.Button,
|
|
303
|
+
{
|
|
304
|
+
size: "lg",
|
|
305
|
+
disabled: isButtonDisabled(),
|
|
306
|
+
onClick: () => {
|
|
307
|
+
if (isMappingPage) {
|
|
308
|
+
if (editField == null ? void 0 : editField.id) {
|
|
309
|
+
setIsEditConfirmationOpen(true);
|
|
310
|
+
} else {
|
|
311
|
+
onSaveHandler();
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
saveConfiguration();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
isMappingPage ? (editField == null ? void 0 : editField.id) ? "Update Mapping" : "Save Mapping" : "Continue, Mapping"
|
|
319
|
+
)
|
|
320
|
+
),
|
|
321
|
+
isEditConfirmationOpen && /* @__PURE__ */ React.createElement(
|
|
322
|
+
editConfirmation.default,
|
|
323
|
+
{
|
|
324
|
+
name: "Are you sure?",
|
|
325
|
+
description: "Saving this updated mapping properties will generate new sheet with the revised mapping.",
|
|
326
|
+
onConfirm: async () => {
|
|
327
|
+
await onSaveHandler();
|
|
328
|
+
setIsEditConfirmationOpen(false);
|
|
329
|
+
},
|
|
330
|
+
onCancel: () => {
|
|
331
|
+
setIsEditConfirmationOpen(false);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
)
|
|
266
335
|
);
|
|
267
336
|
};
|
|
268
337
|
const ConfigurationSetup = ({
|
|
@@ -270,19 +339,26 @@ const ConfigurationSetup = ({
|
|
|
270
339
|
surveyName
|
|
271
340
|
}) => {
|
|
272
341
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
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(
|
|
274
|
-
|
|
275
|
-
fontFamily: "DM Sans !important"
|
|
276
|
-
} }, /* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(
|
|
277
|
-
text.Text,
|
|
342
|
+
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(
|
|
343
|
+
tooltip.Tooltip,
|
|
278
344
|
{
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
345
|
+
content: (surveyName == null ? void 0 : surveyName.length) > 25 ? surveyName : "",
|
|
346
|
+
css: {
|
|
347
|
+
zIndex: "9999999 !important",
|
|
348
|
+
fontFamily: "DM Sans !important"
|
|
349
|
+
}
|
|
283
350
|
},
|
|
284
|
-
|
|
285
|
-
|
|
351
|
+
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(
|
|
352
|
+
text.Text,
|
|
353
|
+
{
|
|
354
|
+
size: "sm",
|
|
355
|
+
weight: "medium",
|
|
356
|
+
truncate: true,
|
|
357
|
+
css: { color: "$neutral800", maxWidth: "270px" }
|
|
358
|
+
},
|
|
359
|
+
surveyName
|
|
360
|
+
))
|
|
361
|
+
)), /* @__PURE__ */ React.createElement(
|
|
286
362
|
flex.Flex,
|
|
287
363
|
{
|
|
288
364
|
flexDirection: "column",
|
|
@@ -355,7 +431,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
355
431
|
input.Input,
|
|
356
432
|
{
|
|
357
433
|
size: "lg",
|
|
358
|
-
rightIcon: /* @__PURE__ */ React.createElement(chevronDown.ChevronDownIcon, { size: 30 }),
|
|
434
|
+
rightIcon: /* @__PURE__ */ React.createElement(chevronDown.ChevronDownIcon, { size: 30, color: "#6A6A6A" }),
|
|
359
435
|
placeholder: "Choose",
|
|
360
436
|
value: (value == null ? void 0 : value.type) === "date" ? `${value == null ? void 0 : value.label} > ${value == null ? void 0 : value.value}` : (value == null ? void 0 : value.type) === "dateRange" ? `${value == null ? void 0 : value.label} - ${((_c = value == null ? void 0 : value.value) == null ? void 0 : _c.type) === "custom" ? `${(_d = value == null ? void 0 : value.value) == null ? void 0 : _d.value} days` : (_e = value == null ? void 0 : value.value) == null ? void 0 : _e.label}` : value == null ? void 0 : value.label,
|
|
361
437
|
css: {
|
|
@@ -370,7 +446,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
370
446
|
css: {
|
|
371
447
|
width: "488px",
|
|
372
448
|
marginBlockStart: "$2",
|
|
373
|
-
|
|
449
|
+
p: {
|
|
374
450
|
margin: "0px !important"
|
|
375
451
|
},
|
|
376
452
|
zIndex: "99 !important"
|
|
@@ -411,31 +487,23 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
411
487
|
width: "100%"
|
|
412
488
|
}
|
|
413
489
|
},
|
|
414
|
-
/* @__PURE__ */ React.createElement(
|
|
415
|
-
|
|
490
|
+
/* @__PURE__ */ React.createElement(flex.Flex, { justifyContent: "center", flexDirection: "column" }, /* @__PURE__ */ React.createElement(
|
|
491
|
+
text.Text,
|
|
416
492
|
{
|
|
417
|
-
|
|
418
|
-
|
|
493
|
+
size: "sm",
|
|
494
|
+
weight: "regular",
|
|
495
|
+
css: { color: "$neutral900" }
|
|
419
496
|
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
text.Text,
|
|
431
|
-
{
|
|
432
|
-
size: "xs",
|
|
433
|
-
weight: "regular",
|
|
434
|
-
css: { color: "$neutral700" }
|
|
435
|
-
},
|
|
436
|
-
option.description
|
|
437
|
-
)
|
|
438
|
-
)
|
|
497
|
+
option.label
|
|
498
|
+
), /* @__PURE__ */ React.createElement(
|
|
499
|
+
text.Text,
|
|
500
|
+
{
|
|
501
|
+
size: "xs",
|
|
502
|
+
weight: "regular",
|
|
503
|
+
css: { color: "$neutral700" }
|
|
504
|
+
},
|
|
505
|
+
option.description
|
|
506
|
+
))
|
|
439
507
|
)
|
|
440
508
|
))
|
|
441
509
|
);
|
|
@@ -449,42 +517,53 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
449
517
|
zIndex: "9999999 !important"
|
|
450
518
|
}
|
|
451
519
|
},
|
|
452
|
-
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuSub, null, /* @__PURE__ */ React.createElement(
|
|
453
|
-
|
|
520
|
+
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(dropdown.DropdownMenuSub, null, /* @__PURE__ */ React.createElement(
|
|
521
|
+
dropdown.DropdownMenuSubTrigger,
|
|
454
522
|
{
|
|
455
|
-
|
|
456
|
-
alignItems: "center",
|
|
523
|
+
disabled: option == null ? void 0 : option.disabled,
|
|
457
524
|
css: {
|
|
458
|
-
|
|
525
|
+
cursor: (option == null ? void 0 : option.disabled) ? "not-allowed !important" : "pointer !important",
|
|
526
|
+
background: (value == null ? void 0 : value.type) === option.type ? "#4A9CA626 !important" : "transparent !important"
|
|
459
527
|
}
|
|
460
528
|
},
|
|
529
|
+
" ",
|
|
461
530
|
/* @__PURE__ */ React.createElement(
|
|
462
531
|
flex.Flex,
|
|
463
532
|
{
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
533
|
+
justifyContent: "space-between",
|
|
534
|
+
alignItems: "center",
|
|
535
|
+
css: {
|
|
536
|
+
width: "100%"
|
|
537
|
+
}
|
|
467
538
|
},
|
|
468
539
|
/* @__PURE__ */ React.createElement(
|
|
469
|
-
|
|
470
|
-
{
|
|
471
|
-
size: "sm",
|
|
472
|
-
weight: "regular",
|
|
473
|
-
css: { color: "$neutral900" }
|
|
474
|
-
},
|
|
475
|
-
option.label
|
|
476
|
-
),
|
|
477
|
-
/* @__PURE__ */ React.createElement(
|
|
478
|
-
text.Text,
|
|
540
|
+
flex.Flex,
|
|
479
541
|
{
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
542
|
+
css: { cursor: "pointer" },
|
|
543
|
+
justifyContent: "center",
|
|
544
|
+
flexDirection: "column"
|
|
483
545
|
},
|
|
484
|
-
|
|
546
|
+
/* @__PURE__ */ React.createElement(
|
|
547
|
+
text.Text,
|
|
548
|
+
{
|
|
549
|
+
size: "sm",
|
|
550
|
+
weight: "regular",
|
|
551
|
+
css: { color: "$neutral900" }
|
|
552
|
+
},
|
|
553
|
+
option.label
|
|
554
|
+
),
|
|
555
|
+
/* @__PURE__ */ React.createElement(
|
|
556
|
+
text.Text,
|
|
557
|
+
{
|
|
558
|
+
size: "xs",
|
|
559
|
+
weight: "regular",
|
|
560
|
+
css: { color: "$neutral700" }
|
|
561
|
+
},
|
|
562
|
+
option.description
|
|
563
|
+
)
|
|
485
564
|
)
|
|
486
565
|
)
|
|
487
|
-
)
|
|
566
|
+
), /* @__PURE__ */ React.createElement(
|
|
488
567
|
dropdown.DropdownMenuSubContent,
|
|
489
568
|
{
|
|
490
569
|
sideOffset: 10,
|
|
@@ -498,7 +577,7 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
498
577
|
}, option.type === "date" && {
|
|
499
578
|
border: "none !important"
|
|
500
579
|
}), {
|
|
501
|
-
|
|
580
|
+
p: {
|
|
502
581
|
margin: "0px !important"
|
|
503
582
|
},
|
|
504
583
|
marginBlockEnd: "$10 !important"
|
|
@@ -512,63 +591,139 @@ const CustomDropdown = ({ data, onChangeHandler, value }) => {
|
|
|
512
591
|
size: "md",
|
|
513
592
|
value: date,
|
|
514
593
|
onChange: setDate
|
|
515
|
-
}, (option == null ? void 0 : option.minValue) && {
|
|
594
|
+
}, (option == null ? void 0 : option.minValue) && {
|
|
595
|
+
minValue: string.parseDate(option == null ? void 0 : option.minValue)
|
|
596
|
+
}), (option == null ? void 0 : option.maxValue) && {
|
|
597
|
+
maxValue: string.parseDate(option == null ? void 0 : option.maxValue)
|
|
598
|
+
}), {
|
|
516
599
|
footerAction: () => {
|
|
517
600
|
onChangeHandler({
|
|
518
601
|
id: "responseImportType",
|
|
519
602
|
value: __spreadProps(__spreadValues({}, option), {
|
|
520
|
-
value: dayjs_min.default(date.toString()).format(
|
|
603
|
+
value: dayjs_min.default(date.toString()).format(
|
|
604
|
+
"MMM D, YYYY"
|
|
605
|
+
)
|
|
521
606
|
})
|
|
522
607
|
});
|
|
523
608
|
setOpen(false);
|
|
524
609
|
}
|
|
525
610
|
})
|
|
526
611
|
),
|
|
527
|
-
option.type === "dateRange" && /* @__PURE__ */ React.createElement(
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
612
|
+
option.type === "dateRange" && /* @__PURE__ */ React.createElement(
|
|
613
|
+
flex.Flex,
|
|
614
|
+
{
|
|
615
|
+
css: {
|
|
616
|
+
paddingInline: "$4 !important",
|
|
617
|
+
paddingBlock: "$8 !important"
|
|
618
|
+
},
|
|
619
|
+
flexDirection: "column",
|
|
620
|
+
gap: "$4"
|
|
621
|
+
},
|
|
622
|
+
/* @__PURE__ */ React.createElement(
|
|
623
|
+
radio.RadioGroup,
|
|
624
|
+
{
|
|
625
|
+
defaultValue: value == null ? void 0 : value.value,
|
|
626
|
+
onChange: (value2) => {
|
|
627
|
+
var _a3;
|
|
628
|
+
onChangeHandler({
|
|
629
|
+
id: "responseImportType",
|
|
630
|
+
value: __spreadProps(__spreadValues({}, option), {
|
|
631
|
+
value: {
|
|
632
|
+
type: value2,
|
|
633
|
+
value: value2,
|
|
634
|
+
label: (_a3 = index.dynamicDateOptions.find(
|
|
635
|
+
(option2) => option2.value === value2
|
|
636
|
+
)) == null ? void 0 : _a3.label
|
|
637
|
+
}
|
|
638
|
+
})
|
|
639
|
+
});
|
|
539
640
|
}
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
641
|
+
},
|
|
642
|
+
index.dynamicDateOptions.map((option2) => /* @__PURE__ */ React.createElement(
|
|
643
|
+
box.Box,
|
|
644
|
+
{
|
|
645
|
+
css: {
|
|
646
|
+
padding: "$4 !important"
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
/* @__PURE__ */ React.createElement(radio.Radio, { value: option2.value }, " ", option2.label, " ")
|
|
650
|
+
))
|
|
651
|
+
),
|
|
652
|
+
((_a2 = value == null ? void 0 : value.value) == null ? void 0 : _a2.type) === "custom" && /* @__PURE__ */ React.createElement(
|
|
653
|
+
box.Box,
|
|
654
|
+
{
|
|
655
|
+
css: {
|
|
656
|
+
paddingRight: "$4 !important",
|
|
657
|
+
position: "relative"
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
/* @__PURE__ */ React.createElement(
|
|
661
|
+
input.Input,
|
|
662
|
+
{
|
|
663
|
+
size: "md",
|
|
664
|
+
variant: "filled",
|
|
558
665
|
value: days,
|
|
559
|
-
|
|
666
|
+
onChange: (e) => setDays(e.target.value)
|
|
560
667
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
668
|
+
),
|
|
669
|
+
/* @__PURE__ */ React.createElement(
|
|
670
|
+
text.Text,
|
|
671
|
+
{
|
|
672
|
+
css: {
|
|
673
|
+
position: "absolute",
|
|
674
|
+
right: "$8",
|
|
675
|
+
top: "$3"
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
"Days"
|
|
679
|
+
)
|
|
680
|
+
),
|
|
681
|
+
/* @__PURE__ */ React.createElement(
|
|
682
|
+
flex.Flex,
|
|
683
|
+
{
|
|
684
|
+
justifyContent: "space-between",
|
|
685
|
+
css: {
|
|
686
|
+
borderBlockStart: "$borderWidths$xs, solid, $neutral200 !important",
|
|
687
|
+
padding: "$8"
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
/* @__PURE__ */ React.createElement(button.Button, { size: "sm", variant: "ghost", color: "secondary" }, "Cancel"),
|
|
691
|
+
/* @__PURE__ */ React.createElement(
|
|
692
|
+
button.Button,
|
|
693
|
+
{
|
|
694
|
+
size: "sm",
|
|
695
|
+
variant: "ghost",
|
|
696
|
+
color: "primary",
|
|
697
|
+
onClick: () => {
|
|
698
|
+
var _a3, _b2;
|
|
699
|
+
onChangeHandler({
|
|
700
|
+
id: "responseImportType",
|
|
701
|
+
value: __spreadProps(__spreadValues({}, option), {
|
|
702
|
+
value: {
|
|
703
|
+
type: (_a3 = value == null ? void 0 : value.value) == null ? void 0 : _a3.type,
|
|
704
|
+
value: days,
|
|
705
|
+
label: (_b2 = value == null ? void 0 : value.value) == null ? void 0 : _b2.label
|
|
706
|
+
}
|
|
707
|
+
})
|
|
708
|
+
});
|
|
709
|
+
setOpen(false);
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
"Apply"
|
|
713
|
+
)
|
|
714
|
+
)
|
|
715
|
+
)
|
|
565
716
|
)))
|
|
566
717
|
);
|
|
567
718
|
}
|
|
568
719
|
})
|
|
569
720
|
));
|
|
570
721
|
};
|
|
571
|
-
const Configuration = ({
|
|
722
|
+
const Configuration = ({
|
|
723
|
+
field,
|
|
724
|
+
configuredFields,
|
|
725
|
+
responseImportType = null
|
|
726
|
+
}) => {
|
|
572
727
|
var _a, _b, _c, _d;
|
|
573
728
|
let fieldValue = null;
|
|
574
729
|
fieldValue = (_b = (_a = configuredFields == null ? void 0 : configuredFields[field.id]) == null ? void 0 : _a.value) != null ? _b : null;
|
|
@@ -579,27 +734,43 @@ const Configuration = ({ field, configuredFields, responseImportType = null }) =
|
|
|
579
734
|
});
|
|
580
735
|
switch (field.fieldType) {
|
|
581
736
|
case "switch":
|
|
582
|
-
return /* @__PURE__ */ React.createElement(
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
737
|
+
return /* @__PURE__ */ React.createElement(
|
|
738
|
+
flex.Flex,
|
|
739
|
+
{
|
|
740
|
+
gap: "$4",
|
|
741
|
+
alignItems: "center",
|
|
742
|
+
css: {
|
|
743
|
+
marginBlockStart: "$12",
|
|
744
|
+
borderTop: "$borderWidths$xs solid $neutral200",
|
|
745
|
+
paddingTop: "$16"
|
|
746
|
+
}
|
|
747
|
+
},
|
|
748
|
+
/* @__PURE__ */ React.createElement(
|
|
749
|
+
_switch.Switch,
|
|
750
|
+
{
|
|
751
|
+
disabled: field == null ? void 0 : field.disabled,
|
|
752
|
+
size: "sm",
|
|
753
|
+
checked: field == null ? void 0 : field.value,
|
|
754
|
+
onChange: (value) => field.onChangeHandler({
|
|
755
|
+
id: field.id,
|
|
756
|
+
value
|
|
757
|
+
})
|
|
758
|
+
}
|
|
759
|
+
),
|
|
760
|
+
/* @__PURE__ */ React.createElement(text.Text, { size: "md", weight: "regular", css: { color: "$neutral900" } }, field.label)
|
|
761
|
+
);
|
|
762
|
+
case "checkbox":
|
|
763
|
+
return /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", alignItems: "start", gap: "$4" }, /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$4", alignItems: "center" }, /* @__PURE__ */ React.createElement(
|
|
764
|
+
checkbox.Checkbox,
|
|
588
765
|
{
|
|
589
766
|
disabled: field == null ? void 0 : field.disabled,
|
|
590
|
-
|
|
591
|
-
checked: field == null ? void 0 : field.value,
|
|
767
|
+
checked: !!fieldValue,
|
|
592
768
|
onChange: (value) => field.onChangeHandler({
|
|
593
769
|
id: field.id,
|
|
594
770
|
value
|
|
595
771
|
})
|
|
596
772
|
}
|
|
597
|
-
), /* @__PURE__ */ React.createElement(text.Text, { size: "
|
|
598
|
-
case "checkbox":
|
|
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({
|
|
600
|
-
id: field.id,
|
|
601
|
-
value
|
|
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)));
|
|
773
|
+
), /* @__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)));
|
|
603
774
|
case "input":
|
|
604
775
|
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
776
|
box.Box,
|
|
@@ -777,16 +948,48 @@ const CustomAddNewSelect = ({ field }) => {
|
|
|
777
948
|
};
|
|
778
949
|
const CustomShareOption = (props) => {
|
|
779
950
|
if (props.data.value === "ADD_NEW") {
|
|
780
|
-
return /* @__PURE__ */ React.createElement(
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
951
|
+
return /* @__PURE__ */ React.createElement(
|
|
952
|
+
tooltip.Tooltip,
|
|
953
|
+
{
|
|
954
|
+
content: props.data.tooltip || "",
|
|
955
|
+
css: {
|
|
956
|
+
zIndex: 999999999,
|
|
957
|
+
fontFamily: "DM Sans !important"
|
|
958
|
+
}
|
|
959
|
+
},
|
|
960
|
+
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(
|
|
961
|
+
flex.Flex,
|
|
962
|
+
{
|
|
963
|
+
justifyContent: "center",
|
|
964
|
+
alignItems: "center",
|
|
965
|
+
css: { cursor: "pointer", zIndex: 999999999 }
|
|
966
|
+
},
|
|
967
|
+
/* @__PURE__ */ React.createElement(
|
|
968
|
+
flex.Flex,
|
|
969
|
+
{
|
|
970
|
+
gap: "$2",
|
|
971
|
+
alignItems: "center",
|
|
972
|
+
css: {
|
|
973
|
+
color: "$primary500",
|
|
974
|
+
fontSize: "$sm",
|
|
975
|
+
fontWeight: "$7"
|
|
976
|
+
}
|
|
977
|
+
},
|
|
978
|
+
/* @__PURE__ */ React.createElement(plus.PlusIcon, { size: 16, color: "#4A9CA6" }),
|
|
979
|
+
"Add Account"
|
|
980
|
+
)
|
|
981
|
+
)))
|
|
982
|
+
);
|
|
788
983
|
} else {
|
|
789
|
-
return /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(
|
|
984
|
+
return /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(
|
|
985
|
+
flex.Flex,
|
|
986
|
+
{
|
|
987
|
+
css: { cursor: "pointer", zIndex: 999999999 },
|
|
988
|
+
alignItems: "center",
|
|
989
|
+
gap: "$2"
|
|
990
|
+
},
|
|
991
|
+
/* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, props.label)
|
|
992
|
+
));
|
|
790
993
|
}
|
|
791
994
|
};
|
|
792
995
|
const CustomSingleValue = (props) => {
|