@sparrowengg/integrations-templates-frontend 1.9.84-beta.6 → 1.9.84-beta.8
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/mapping/index.js +418 -20
- package/dist/cjs/mapping/index.js.map +1 -1
- package/dist/es/mapping/index.js +418 -20
- package/dist/es/mapping/index.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ var arrow = require('../commons/icons/arrow.js');
|
|
|
5
5
|
var mapping = require('./components/mapping.js');
|
|
6
6
|
var index = require('../commons/constants/index.js');
|
|
7
7
|
var draftModal = require('../commons/components/draftModal.js');
|
|
8
|
+
require('../node_modules/dayjs/dayjs.min.js');
|
|
8
9
|
var themeProvider = require('../node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js');
|
|
9
10
|
var box = require('../node_modules/@sparrowengg/twigs-react/dist/es/box/box.js');
|
|
10
11
|
var flex = require('../node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js');
|
|
@@ -16,7 +17,34 @@ var button = require('../node_modules/@sparrowengg/twigs-react/dist/es/button/bu
|
|
|
16
17
|
var chevronRight = require('../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/chevron-right.js');
|
|
17
18
|
var iconButton = require('../node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js');
|
|
18
19
|
var arrowLeft = require('../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/arrow-left.js');
|
|
20
|
+
var tooltip = require('../node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js');
|
|
21
|
+
var formInput = require('../node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js');
|
|
22
|
+
var checkbox = require('../node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js');
|
|
23
|
+
var _switch = require('../node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js');
|
|
24
|
+
var indexA301f526_esm = require('../node_modules/react-select/dist/index-a301f526.esm.js');
|
|
25
|
+
var plus = require('../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/plus.js');
|
|
26
|
+
var chip = require('../node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js');
|
|
27
|
+
var tickCircleFill = require('../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/tick-circle-fill.js');
|
|
19
28
|
|
|
29
|
+
var __defProp = Object.defineProperty;
|
|
30
|
+
var __defProps = Object.defineProperties;
|
|
31
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
32
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
33
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
34
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
35
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
36
|
+
var __spreadValues = (a, b) => {
|
|
37
|
+
for (var prop in b || (b = {}))
|
|
38
|
+
if (__hasOwnProp.call(b, prop))
|
|
39
|
+
__defNormalProp(a, prop, b[prop]);
|
|
40
|
+
if (__getOwnPropSymbols)
|
|
41
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
42
|
+
if (__propIsEnum.call(b, prop))
|
|
43
|
+
__defNormalProp(a, prop, b[prop]);
|
|
44
|
+
}
|
|
45
|
+
return a;
|
|
46
|
+
};
|
|
47
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
48
|
const Mapping = ({
|
|
21
49
|
havingTypeDropdown,
|
|
22
50
|
onSaveMappingLoader,
|
|
@@ -43,7 +71,9 @@ const Mapping = ({
|
|
|
43
71
|
draftHandler,
|
|
44
72
|
configuration
|
|
45
73
|
}) => {
|
|
46
|
-
const [previousMapping, setPreviousMapping] = React.useState(
|
|
74
|
+
const [previousMapping, setPreviousMapping] = React.useState(
|
|
75
|
+
hasPreviousMapping != null ? hasPreviousMapping : false
|
|
76
|
+
);
|
|
47
77
|
React.useEffect(() => {
|
|
48
78
|
if (!!(editField == null ? void 0 : editField.id)) {
|
|
49
79
|
setFields(editField.fieldValues);
|
|
@@ -86,7 +116,8 @@ const Mapping = ({
|
|
|
86
116
|
events,
|
|
87
117
|
actions,
|
|
88
118
|
navigateMappingPage,
|
|
89
|
-
configuration
|
|
119
|
+
configuration,
|
|
120
|
+
editFieldId: editField == null ? void 0 : editField.id
|
|
90
121
|
}
|
|
91
122
|
) : /* @__PURE__ */ React.createElement(
|
|
92
123
|
mapping.Mapping,
|
|
@@ -114,9 +145,9 @@ const EventSetup = ({
|
|
|
114
145
|
events,
|
|
115
146
|
actions,
|
|
116
147
|
navigateMappingPage,
|
|
117
|
-
configuration
|
|
148
|
+
configuration,
|
|
149
|
+
editFieldId
|
|
118
150
|
}) => {
|
|
119
|
-
console.log("configuration", configuration);
|
|
120
151
|
React.useEffect(() => {
|
|
121
152
|
if (actions == null ? void 0 : actions.value) {
|
|
122
153
|
actions == null ? void 0 : actions.onChangeHandler(actions == null ? void 0 : actions.value);
|
|
@@ -132,13 +163,22 @@ const EventSetup = ({
|
|
|
132
163
|
alignItems: "center",
|
|
133
164
|
justifyContent: "center"
|
|
134
165
|
},
|
|
135
|
-
/* @__PURE__ */ React.createElement(box.Box, { css: { width: 488 } },
|
|
166
|
+
/* @__PURE__ */ React.createElement(box.Box, { css: { width: 488 } }, configuration.hasConfiguration ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
167
|
+
ConfigurationSetup,
|
|
168
|
+
{
|
|
169
|
+
configuration,
|
|
170
|
+
surveyName: surveyDetails.surveyName,
|
|
171
|
+
editField: editFieldId
|
|
172
|
+
}
|
|
173
|
+
)) : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(heading.Heading, { size: "h5" }, configuration == null ? void 0 : configuration.title), /* @__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(text.Text, { size: "sm", weight: "medium", css: { color: "$neutral800" } }, surveyDetails.surveyName)), /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", gap: "$8", css: { marginTop: "$16" } }, (accounts == null ? void 0 : accounts.hasAccounts) && /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React.createElement(formLabel.FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Account"), /* @__PURE__ */ React.createElement(
|
|
136
174
|
select.Select,
|
|
137
175
|
{
|
|
138
176
|
value: accounts.value,
|
|
139
177
|
options: accounts.options,
|
|
140
178
|
placeholder: "",
|
|
141
|
-
onChange: (value) => accounts.onChangeHandler(
|
|
179
|
+
onChange: (value) => accounts.onChangeHandler(
|
|
180
|
+
value
|
|
181
|
+
),
|
|
142
182
|
size: "lg"
|
|
143
183
|
}
|
|
144
184
|
)), (events == null ? void 0 : events.hasEvents) && /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React.createElement(formLabel.FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Object"), /* @__PURE__ */ React.createElement(
|
|
@@ -147,7 +187,9 @@ const EventSetup = ({
|
|
|
147
187
|
options: events.options,
|
|
148
188
|
value: events == null ? void 0 : events.value,
|
|
149
189
|
placeholder: "",
|
|
150
|
-
onChange: (value) => events.onChangeHandler(
|
|
190
|
+
onChange: (value) => events.onChangeHandler(
|
|
191
|
+
value
|
|
192
|
+
),
|
|
151
193
|
size: "lg"
|
|
152
194
|
}
|
|
153
195
|
)), (actions == null ? void 0 : actions.hasActions) && /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React.createElement(formLabel.FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Action"), /* @__PURE__ */ React.createElement(
|
|
@@ -157,13 +199,15 @@ const EventSetup = ({
|
|
|
157
199
|
options: actions.options,
|
|
158
200
|
value: actions == null ? void 0 : actions.value,
|
|
159
201
|
placeholder: "",
|
|
160
|
-
onChange: (value) => actions.onChangeHandler(
|
|
202
|
+
onChange: (value) => actions.onChangeHandler(
|
|
203
|
+
value
|
|
204
|
+
)
|
|
161
205
|
}
|
|
162
|
-
))), /* @__PURE__ */ React.createElement(
|
|
206
|
+
)))), /* @__PURE__ */ React.createElement(
|
|
163
207
|
button.Button,
|
|
164
208
|
{
|
|
165
209
|
size: "lg",
|
|
166
|
-
disabled: !actions.value || !events.value,
|
|
210
|
+
disabled: configuration.hasConfiguration ? false : !(actions == null ? void 0 : actions.value) || !(events == null ? void 0 : events.value),
|
|
167
211
|
rightIcon: /* @__PURE__ */ React.createElement(chevronRight.ChevronRightIcon, null),
|
|
168
212
|
css: { marginTop: "$16" },
|
|
169
213
|
onClick: () => navigateMappingPage()
|
|
@@ -188,7 +232,7 @@ const MappingHeader = ({
|
|
|
188
232
|
editFieldId,
|
|
189
233
|
draftHandler
|
|
190
234
|
}) => {
|
|
191
|
-
const isDisabled = !actions.value || !events.value;
|
|
235
|
+
const isDisabled = !(actions == null ? void 0 : actions.value) || !(events == null ? void 0 : events.value);
|
|
192
236
|
const [isDraftModalOpen, setIsDraftModalOpen] = React.useState(false);
|
|
193
237
|
const isAllEssentialMapped = (fields2) => {
|
|
194
238
|
let status = true;
|
|
@@ -221,14 +265,21 @@ const MappingHeader = ({
|
|
|
221
265
|
padding: "$8 $12"
|
|
222
266
|
}
|
|
223
267
|
},
|
|
224
|
-
isDraftModalOpen && /* @__PURE__ */ React.createElement(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
268
|
+
isDraftModalOpen && /* @__PURE__ */ React.createElement(
|
|
269
|
+
draftModal.default,
|
|
270
|
+
{
|
|
271
|
+
onSaveHandler: async () => {
|
|
272
|
+
await draftHandler("MAPPING", editFieldId == null ? void 0 : editFieldId.toString());
|
|
273
|
+
setIsDraftModalOpen(false);
|
|
274
|
+
await previousMappingHandler();
|
|
275
|
+
},
|
|
276
|
+
onCloseHandler: () => setIsDraftModalOpen(false),
|
|
277
|
+
onCancel: async () => {
|
|
278
|
+
await previousMappingHandler();
|
|
279
|
+
setIsDraftModalOpen(false);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
),
|
|
232
283
|
/* @__PURE__ */ React.createElement(
|
|
233
284
|
flex.Flex,
|
|
234
285
|
{
|
|
@@ -236,7 +287,15 @@ const MappingHeader = ({
|
|
|
236
287
|
alignItems: "center",
|
|
237
288
|
css: { visibility: hasPreviousMapping ? "visible" : "hidden" }
|
|
238
289
|
},
|
|
239
|
-
/* @__PURE__ */ React.createElement(
|
|
290
|
+
/* @__PURE__ */ React.createElement(
|
|
291
|
+
iconButton.IconButton,
|
|
292
|
+
{
|
|
293
|
+
onClick: () => previousMappingHandler(),
|
|
294
|
+
color: "default",
|
|
295
|
+
icon: /* @__PURE__ */ React.createElement(arrowLeft.ArrowLeftIcon, null),
|
|
296
|
+
size: "lg"
|
|
297
|
+
}
|
|
298
|
+
),
|
|
240
299
|
/* @__PURE__ */ React.createElement(heading.Heading, { size: "h6" }, editFieldId ? "Edit Mapping" : "New Mapping")
|
|
241
300
|
),
|
|
242
301
|
/* @__PURE__ */ React.createElement(
|
|
@@ -286,6 +345,345 @@ const MappingHeader = ({
|
|
|
286
345
|
)
|
|
287
346
|
);
|
|
288
347
|
};
|
|
348
|
+
const ConfigurationSetup = ({
|
|
349
|
+
configuration,
|
|
350
|
+
surveyName,
|
|
351
|
+
editField
|
|
352
|
+
}) => {
|
|
353
|
+
var _a;
|
|
354
|
+
return /* @__PURE__ */ React.createElement(box.Box, { css: { maxWidth: 488, width: "100%" } }, /* @__PURE__ */ React.createElement(heading.Heading, { size: "h5" }, configuration == null ? void 0 : configuration.title), /* @__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(
|
|
355
|
+
tooltip.Tooltip,
|
|
356
|
+
{
|
|
357
|
+
content: (surveyName == null ? void 0 : surveyName.length) > 25 ? surveyName : "",
|
|
358
|
+
css: {
|
|
359
|
+
zIndex: "9999999 !important",
|
|
360
|
+
fontFamily: "DM Sans !important"
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(
|
|
364
|
+
text.Text,
|
|
365
|
+
{
|
|
366
|
+
size: "sm",
|
|
367
|
+
weight: "medium",
|
|
368
|
+
truncate: true,
|
|
369
|
+
css: { color: "$neutral800", maxWidth: "270px" }
|
|
370
|
+
},
|
|
371
|
+
surveyName
|
|
372
|
+
))
|
|
373
|
+
)), /* @__PURE__ */ React.createElement(
|
|
374
|
+
flex.Flex,
|
|
375
|
+
{
|
|
376
|
+
flexDirection: "column",
|
|
377
|
+
gap: "$8",
|
|
378
|
+
css: {
|
|
379
|
+
marginTop: "$12",
|
|
380
|
+
"& label": {
|
|
381
|
+
color: "$neutral800"
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
(_a = configuration.configurationFields) == null ? void 0 : _a.map((field) => {
|
|
386
|
+
return /* @__PURE__ */ React.createElement(
|
|
387
|
+
Configuration,
|
|
388
|
+
{
|
|
389
|
+
field,
|
|
390
|
+
configuredFields: configuration.configuredFields
|
|
391
|
+
}
|
|
392
|
+
);
|
|
393
|
+
})
|
|
394
|
+
));
|
|
395
|
+
};
|
|
396
|
+
const Configuration = ({
|
|
397
|
+
field,
|
|
398
|
+
configuredFields,
|
|
399
|
+
responseImportType = null
|
|
400
|
+
}) => {
|
|
401
|
+
var _a, _b, _c, _d;
|
|
402
|
+
let fieldValue = null;
|
|
403
|
+
fieldValue = (_b = (_a = configuredFields == null ? void 0 : configuredFields[field.id]) == null ? void 0 : _a.value) != null ? _b : null;
|
|
404
|
+
const [error, setError] = React.useState({
|
|
405
|
+
errorMessage: "",
|
|
406
|
+
error: false,
|
|
407
|
+
id: null
|
|
408
|
+
});
|
|
409
|
+
switch (field.fieldType) {
|
|
410
|
+
case "switch":
|
|
411
|
+
return /* @__PURE__ */ React.createElement(
|
|
412
|
+
flex.Flex,
|
|
413
|
+
{
|
|
414
|
+
gap: "$4",
|
|
415
|
+
alignItems: "center",
|
|
416
|
+
css: {
|
|
417
|
+
marginBlockStart: "$12",
|
|
418
|
+
borderTop: "$borderWidths$xs solid $neutral200",
|
|
419
|
+
paddingTop: "$16"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
/* @__PURE__ */ React.createElement(
|
|
423
|
+
_switch.Switch,
|
|
424
|
+
{
|
|
425
|
+
disabled: field == null ? void 0 : field.disabled,
|
|
426
|
+
size: "sm",
|
|
427
|
+
checked: field == null ? void 0 : field.value,
|
|
428
|
+
onChange: (value) => field.onChangeHandler({
|
|
429
|
+
id: field.id,
|
|
430
|
+
value
|
|
431
|
+
})
|
|
432
|
+
}
|
|
433
|
+
),
|
|
434
|
+
/* @__PURE__ */ React.createElement(text.Text, { size: "md", weight: "regular", css: { color: "$neutral900" } }, field.label)
|
|
435
|
+
);
|
|
436
|
+
case "checkbox":
|
|
437
|
+
return /* @__PURE__ */ React.createElement(flex.Flex, { flexDirection: "column", alignItems: "start", gap: "$4" }, /* @__PURE__ */ React.createElement(flex.Flex, { gap: "$4", alignItems: "center" }, /* @__PURE__ */ React.createElement(
|
|
438
|
+
checkbox.Checkbox,
|
|
439
|
+
{
|
|
440
|
+
disabled: field == null ? void 0 : field.disabled,
|
|
441
|
+
checked: !!fieldValue,
|
|
442
|
+
onChange: (value) => field.onChangeHandler({
|
|
443
|
+
id: field.id,
|
|
444
|
+
value
|
|
445
|
+
})
|
|
446
|
+
}
|
|
447
|
+
), /* @__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)));
|
|
448
|
+
case "input":
|
|
449
|
+
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(
|
|
450
|
+
box.Box,
|
|
451
|
+
{
|
|
452
|
+
className: "dm-sans",
|
|
453
|
+
css: {
|
|
454
|
+
label: {
|
|
455
|
+
fontSize: "$xs !important"
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
/* @__PURE__ */ React.createElement(
|
|
460
|
+
formInput.FormInput,
|
|
461
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
462
|
+
disabled: field == null ? void 0 : field.disabled
|
|
463
|
+
}, error.id === field.id && {
|
|
464
|
+
error: error.errorMessage,
|
|
465
|
+
errorBorder: error.error
|
|
466
|
+
}), {
|
|
467
|
+
label: field.label,
|
|
468
|
+
value: typeof fieldValue === "object" ? "" : fieldValue || "",
|
|
469
|
+
size: "lg"
|
|
470
|
+
}), field.pattern && {
|
|
471
|
+
pattern: field.pattern
|
|
472
|
+
}), {
|
|
473
|
+
onChange: (event) => {
|
|
474
|
+
if (field == null ? void 0 : field.pattern) {
|
|
475
|
+
const pattern = new RegExp(field.pattern);
|
|
476
|
+
if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
|
|
477
|
+
setError({
|
|
478
|
+
errorMessage: field.errorMessage,
|
|
479
|
+
error: true,
|
|
480
|
+
id: field.id
|
|
481
|
+
});
|
|
482
|
+
} else {
|
|
483
|
+
setError({
|
|
484
|
+
errorMessage: "",
|
|
485
|
+
error: false,
|
|
486
|
+
id: null
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
field.onChangeHandler({
|
|
490
|
+
id: field.id,
|
|
491
|
+
value: event.currentTarget.value
|
|
492
|
+
});
|
|
493
|
+
} else {
|
|
494
|
+
field.onChangeHandler({
|
|
495
|
+
id: field.id,
|
|
496
|
+
value: event.currentTarget.value
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
})
|
|
501
|
+
)
|
|
502
|
+
) : null) : /* @__PURE__ */ React.createElement(
|
|
503
|
+
box.Box,
|
|
504
|
+
{
|
|
505
|
+
className: "dm-sans",
|
|
506
|
+
css: {
|
|
507
|
+
label: {
|
|
508
|
+
fontSize: "$xs !important"
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
/* @__PURE__ */ React.createElement(
|
|
513
|
+
formInput.FormInput,
|
|
514
|
+
__spreadProps(__spreadValues(__spreadProps(__spreadValues({
|
|
515
|
+
disabled: field == null ? void 0 : field.disabled
|
|
516
|
+
}, error.id === field.id && {
|
|
517
|
+
error: error.errorMessage,
|
|
518
|
+
errorBorder: error.error
|
|
519
|
+
}), {
|
|
520
|
+
label: field.label,
|
|
521
|
+
value: typeof fieldValue === "object" ? "" : fieldValue || "",
|
|
522
|
+
size: "lg"
|
|
523
|
+
}), field.pattern && {
|
|
524
|
+
pattern: field.pattern
|
|
525
|
+
}), {
|
|
526
|
+
onChange: (event) => {
|
|
527
|
+
if (field == null ? void 0 : field.pattern) {
|
|
528
|
+
const pattern = new RegExp(field.pattern);
|
|
529
|
+
if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
|
|
530
|
+
setError({
|
|
531
|
+
errorMessage: field.errorMessage,
|
|
532
|
+
error: true,
|
|
533
|
+
id: field.id
|
|
534
|
+
});
|
|
535
|
+
} else {
|
|
536
|
+
setError({
|
|
537
|
+
errorMessage: "",
|
|
538
|
+
error: false,
|
|
539
|
+
id: null
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
field.onChangeHandler({
|
|
543
|
+
id: field.id,
|
|
544
|
+
value: event.currentTarget.value
|
|
545
|
+
});
|
|
546
|
+
} else {
|
|
547
|
+
field.onChangeHandler({
|
|
548
|
+
id: field.id,
|
|
549
|
+
value: event.currentTarget.value
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
})
|
|
554
|
+
)
|
|
555
|
+
));
|
|
556
|
+
default:
|
|
557
|
+
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(
|
|
558
|
+
flex.Flex,
|
|
559
|
+
{
|
|
560
|
+
gap: "$2",
|
|
561
|
+
flexDirection: "column",
|
|
562
|
+
css: {
|
|
563
|
+
cursor: "pointer !important",
|
|
564
|
+
".twigs-select__indicator": {
|
|
565
|
+
width: "14px !important",
|
|
566
|
+
color: "#848484 !important"
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
/* @__PURE__ */ React.createElement(formLabel.FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
|
|
571
|
+
/* @__PURE__ */ React.createElement(CustomAddNewSelect, { field })
|
|
572
|
+
) : null) : /* @__PURE__ */ React.createElement(
|
|
573
|
+
flex.Flex,
|
|
574
|
+
{
|
|
575
|
+
gap: "$2",
|
|
576
|
+
flexDirection: "column",
|
|
577
|
+
css: {
|
|
578
|
+
cursor: "pointer !important",
|
|
579
|
+
".twigs-select__indicator": {
|
|
580
|
+
width: "14px !important",
|
|
581
|
+
color: "#848484 !important"
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
/* @__PURE__ */ React.createElement(formLabel.FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
|
|
586
|
+
/* @__PURE__ */ React.createElement(CustomAddNewSelect, { field })
|
|
587
|
+
));
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
const CustomAddNewSelect = ({ field }) => {
|
|
591
|
+
return /* @__PURE__ */ React.createElement(
|
|
592
|
+
select.Select,
|
|
593
|
+
{
|
|
594
|
+
isDisabled: field == null ? void 0 : field.disabled,
|
|
595
|
+
placeholder: "",
|
|
596
|
+
size: "lg",
|
|
597
|
+
css: {
|
|
598
|
+
cursor: "pointer"
|
|
599
|
+
},
|
|
600
|
+
components: {
|
|
601
|
+
Option: CustomShareOption,
|
|
602
|
+
SingleValue: CustomSingleValue
|
|
603
|
+
},
|
|
604
|
+
styles: {
|
|
605
|
+
singleValue: (provided, state) => __spreadProps(__spreadValues({}, provided), {
|
|
606
|
+
display: "flex",
|
|
607
|
+
alignItems: "center",
|
|
608
|
+
cursor: "pointer"
|
|
609
|
+
})
|
|
610
|
+
},
|
|
611
|
+
value: field.value,
|
|
612
|
+
onChange: (value) => {
|
|
613
|
+
var _a;
|
|
614
|
+
field.onChangeHandler({
|
|
615
|
+
id: (_a = field == null ? void 0 : field.id) != null ? _a : field == null ? void 0 : field.label,
|
|
616
|
+
value
|
|
617
|
+
});
|
|
618
|
+
},
|
|
619
|
+
options: field.options
|
|
620
|
+
}
|
|
621
|
+
);
|
|
622
|
+
};
|
|
623
|
+
const CustomShareOption = (props) => {
|
|
624
|
+
if (props.data.value === "ADD_NEW") {
|
|
625
|
+
return /* @__PURE__ */ React.createElement(
|
|
626
|
+
tooltip.Tooltip,
|
|
627
|
+
{
|
|
628
|
+
content: props.data.tooltip || "",
|
|
629
|
+
css: {
|
|
630
|
+
zIndex: 999999999,
|
|
631
|
+
fontFamily: "DM Sans !important"
|
|
632
|
+
}
|
|
633
|
+
},
|
|
634
|
+
/* @__PURE__ */ React.createElement(box.Box, null, /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(
|
|
635
|
+
flex.Flex,
|
|
636
|
+
{
|
|
637
|
+
justifyContent: "center",
|
|
638
|
+
alignItems: "center",
|
|
639
|
+
css: { cursor: "pointer", zIndex: 999999999 }
|
|
640
|
+
},
|
|
641
|
+
/* @__PURE__ */ React.createElement(
|
|
642
|
+
flex.Flex,
|
|
643
|
+
{
|
|
644
|
+
gap: "$2",
|
|
645
|
+
alignItems: "center",
|
|
646
|
+
css: {
|
|
647
|
+
color: "$primary500",
|
|
648
|
+
fontSize: "$sm",
|
|
649
|
+
fontWeight: "$7"
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
/* @__PURE__ */ React.createElement(plus.PlusIcon, { size: 16, color: "#4A9CA6" }),
|
|
653
|
+
"Add Account"
|
|
654
|
+
)
|
|
655
|
+
)))
|
|
656
|
+
);
|
|
657
|
+
} else {
|
|
658
|
+
return /* @__PURE__ */ React.createElement(indexA301f526_esm.c.Option, __spreadValues({}, props), /* @__PURE__ */ React.createElement(
|
|
659
|
+
flex.Flex,
|
|
660
|
+
{
|
|
661
|
+
css: { cursor: "pointer", zIndex: 999999999 },
|
|
662
|
+
alignItems: "center",
|
|
663
|
+
justifyContent: "space-between",
|
|
664
|
+
gap: "$2"
|
|
665
|
+
},
|
|
666
|
+
/* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, props.label),
|
|
667
|
+
" ",
|
|
668
|
+
props.data.isAddonAccount && /* @__PURE__ */ React.createElement(
|
|
669
|
+
chip.Chip,
|
|
670
|
+
{
|
|
671
|
+
color: "primary",
|
|
672
|
+
size: "sm",
|
|
673
|
+
leftElement: /* @__PURE__ */ React.createElement(tickCircleFill.TickCircleFillIcon, null)
|
|
674
|
+
},
|
|
675
|
+
"In Use (Add-on)"
|
|
676
|
+
)
|
|
677
|
+
));
|
|
678
|
+
}
|
|
679
|
+
};
|
|
680
|
+
const CustomSingleValue = (props) => {
|
|
681
|
+
if (props.data.value === "ADD_NEW") {
|
|
682
|
+
return /* @__PURE__ */ React.createElement(indexA301f526_esm.c.SingleValue, __spreadValues({}, props), /* @__PURE__ */ React.createElement(flex.Flex, { css: { cursor: "pointer" }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(plus.PlusIcon, { size: 16 }), /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, props.data.label)));
|
|
683
|
+
} else {
|
|
684
|
+
return /* @__PURE__ */ React.createElement(indexA301f526_esm.c.SingleValue, __spreadValues({}, props), /* @__PURE__ */ React.createElement(flex.Flex, { css: { cursor: "pointer" }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React.createElement(text.Text, { size: "sm" }, props.data.label)));
|
|
685
|
+
}
|
|
686
|
+
};
|
|
289
687
|
|
|
290
688
|
exports.Mapping = Mapping;
|
|
291
689
|
//# sourceMappingURL=index.js.map
|