@bigbinary/neeto-form-frontend 3.12.0 → 3.12.2
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/README.md +2 -0
- package/app/javascript/src/translations/en.json +2 -2
- package/dist/BuildForm.js +1 -2
- package/dist/BuildForm.js.map +1 -1
- package/dist/ExternalForm.js +2 -3
- package/dist/ExternalForm.js.map +1 -1
- package/dist/Submission.js +170 -155
- package/dist/Submission.js.map +1 -1
- package/dist/UrlBuilder.js +2 -3
- package/dist/UrlBuilder.js.map +1 -1
- package/dist/cjs/BuildForm.js +3 -4
- package/dist/cjs/BuildForm.js.map +1 -1
- package/dist/cjs/ExternalForm.js +2 -3
- package/dist/cjs/ExternalForm.js.map +1 -1
- package/dist/cjs/Submission.js +168 -153
- package/dist/cjs/Submission.js.map +1 -1
- package/dist/cjs/UrlBuilder.js +12 -13
- package/dist/cjs/UrlBuilder.js.map +1 -1
- package/dist/cjs/index.js +2 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/{constants-DdGn1rF4.js → constants-Cg0HQXNC.js} +335 -4
- package/dist/constants-Cg0HQXNC.js.map +1 -0
- package/dist/{constants-CIKOBOUZ.js → constants-DojODK3U.js} +363 -8
- package/dist/constants-DojODK3U.js.map +1 -0
- package/dist/index.js +2 -4
- package/dist/index.js.map +1 -1
- package/dist/{utils-DbT-aQHP.js → utils-CWpYc-_S.js} +2 -3
- package/dist/{utils-DbT-aQHP.js.map → utils-CWpYc-_S.js.map} +1 -1
- package/dist/{utils-F-H352VB.js → utils-DE2Rc41X.js} +6 -7
- package/dist/{utils-F-H352VB.js.map → utils-DE2Rc41X.js.map} +1 -1
- package/package.json +5 -5
- package/types.d.ts +1 -1
- package/dist/constants-Byuu9IoS.js +0 -339
- package/dist/constants-Byuu9IoS.js.map +0 -1
- package/dist/constants-CIKOBOUZ.js.map +0 -1
- package/dist/constants-CN0KQk0z.js +0 -369
- package/dist/constants-CN0KQk0z.js.map +0 -1
- package/dist/constants-DdGn1rF4.js.map +0 -1
package/dist/cjs/Submission.js
CHANGED
|
@@ -2,22 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var classnames = require('classnames');
|
|
5
|
+
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
6
|
+
var Typography = require('@bigbinary/neetoui/Typography');
|
|
7
|
+
var constants = require('../constants-CkGU4abB.js');
|
|
5
8
|
var i18next = require('i18next');
|
|
6
9
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
7
10
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
8
11
|
var EditorContent = require('@bigbinary/neeto-editor/EditorContent');
|
|
9
12
|
var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
|
|
10
|
-
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
11
13
|
var PhoneNumber = require('@bigbinary/neeto-molecules/PhoneNumber');
|
|
12
|
-
var Typography = require('@bigbinary/neetoui/Typography');
|
|
13
14
|
var ramda = require('ramda');
|
|
14
|
-
var server = require('react-dom/server');
|
|
15
15
|
var React$2 = require('react');
|
|
16
|
-
var constants = require('../constants-CN0KQk0z.js');
|
|
17
|
-
var constants$1 = require('../constants-CkGU4abB.js');
|
|
18
16
|
var jsxRuntime = require('react/jsx-runtime');
|
|
19
|
-
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
20
17
|
require('@babel/runtime/helpers/toConsumableArray');
|
|
18
|
+
require('@babel/runtime/helpers/objectWithoutProperties');
|
|
21
19
|
require('@tanstack/react-query');
|
|
22
20
|
require('@bigbinary/neeto-commons-frontend/constants');
|
|
23
21
|
require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
@@ -2548,57 +2546,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
2548
2546
|
|
|
2549
2547
|
var _default = dist.default = _Linkify2.default;
|
|
2550
2548
|
|
|
2551
|
-
var filterAdditionalGuestResponses = neetoCist.removeBy({
|
|
2552
|
-
kind: constants.QUESTION_KIND.ADDITIONAL_GUESTS.value,
|
|
2553
|
-
value: neetoCist.isNotPresent
|
|
2554
|
-
});
|
|
2555
|
-
var transformNameResponses = function transformNameResponses(response, shouldSplitResponses) {
|
|
2556
|
-
var isSplitMode = response.isSplitMode,
|
|
2557
|
-
fullNameLabel = response.fullNameLabel,
|
|
2558
|
-
firstNameLabel = response.firstNameLabel,
|
|
2559
|
-
lastNameLabel = response.lastNameLabel,
|
|
2560
|
-
_response$value = response.value,
|
|
2561
|
-
_response$value2 = _response$value === void 0 ? {} : _response$value,
|
|
2562
|
-
_response$value2$full = _response$value2.fullName,
|
|
2563
|
-
fullName = _response$value2$full === void 0 ? "" : _response$value2$full,
|
|
2564
|
-
_response$value2$firs = _response$value2.firstName,
|
|
2565
|
-
firstName = _response$value2$firs === void 0 ? "" : _response$value2$firs,
|
|
2566
|
-
_response$value2$last = _response$value2.lastName,
|
|
2567
|
-
lastName = _response$value2$last === void 0 ? "" : _response$value2$last;
|
|
2568
|
-
if (isSplitMode && shouldSplitResponses) {
|
|
2569
|
-
return [ramda.mergeLeft({
|
|
2570
|
-
value: firstName,
|
|
2571
|
-
label: firstNameLabel
|
|
2572
|
-
}, response), ramda.mergeLeft({
|
|
2573
|
-
value: lastName,
|
|
2574
|
-
label: lastNameLabel
|
|
2575
|
-
}, response)];
|
|
2576
|
-
}
|
|
2577
|
-
return ramda.mergeLeft({
|
|
2578
|
-
value: fullName,
|
|
2579
|
-
label: fullNameLabel
|
|
2580
|
-
}, response);
|
|
2581
|
-
};
|
|
2582
|
-
var linkifyDecorator = function linkifyDecorator(decoratedHref, decoratedText, key) {
|
|
2583
|
-
return /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
2584
|
-
className: "neeto-ui-text-accent-800 hover:neeto-ui-text-accent-800",
|
|
2585
|
-
href: decoratedHref,
|
|
2586
|
-
rel: "noreferrer",
|
|
2587
|
-
target: "_blank",
|
|
2588
|
-
children: decoratedText
|
|
2589
|
-
}, key);
|
|
2590
|
-
};
|
|
2591
|
-
var normalizeResponses = function normalizeResponses(responses, omitKinds, shouldSplitNameResponses) {
|
|
2592
|
-
var filteredResponses = neetoCist.removeBy({
|
|
2593
|
-
kind: ramda.includes(ramda.__, omitKinds)
|
|
2594
|
-
}, responses);
|
|
2595
|
-
return neetoCist.modifyBy({
|
|
2596
|
-
kind: constants$1.QUESTION_TYPES.NAME
|
|
2597
|
-
}, function (response) {
|
|
2598
|
-
return transformNameResponses(response, shouldSplitNameResponses);
|
|
2599
|
-
}, filterAdditionalGuestResponses(filteredResponses));
|
|
2600
|
-
};
|
|
2601
|
-
|
|
2602
2549
|
var FileUpload = function FileUpload(_ref) {
|
|
2603
2550
|
var files = _ref.files;
|
|
2604
2551
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -2620,103 +2567,84 @@ var FileUpload = function FileUpload(_ref) {
|
|
|
2620
2567
|
});
|
|
2621
2568
|
};
|
|
2622
2569
|
|
|
2623
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2624
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2625
|
-
var
|
|
2570
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2571
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2572
|
+
var LinkifiedText = function LinkifiedText(_ref) {
|
|
2626
2573
|
var value = _ref.value,
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
children: i18next.t("neetoForm.common.unanswered")
|
|
2630
|
-
});
|
|
2631
|
-
if (kind === constants.QUESTION_KIND.DATE.value) {
|
|
2632
|
-
return value && utils.dateFormat.date(value);
|
|
2633
|
-
}
|
|
2634
|
-
if (kind === constants.QUESTION_KIND.ADDITIONAL_GUESTS.value) {
|
|
2635
|
-
return value === null || value === void 0 ? void 0 : value.join(", ");
|
|
2636
|
-
}
|
|
2637
|
-
if (kind === constants.QUESTION_KIND.CONDITION.value) {
|
|
2638
|
-
return (value === null || value === void 0 ? void 0 : value.toLowerCase()) === "true" ? i18next.t("neetoForm.common.yes") : i18next.t("neetoForm.common.no");
|
|
2639
|
-
}
|
|
2640
|
-
return value;
|
|
2641
|
-
};
|
|
2642
|
-
var getEditorContent = function getEditorContent(value) {
|
|
2643
|
-
if (typeof value !== "string") {
|
|
2644
|
-
return server.renderToString(value);
|
|
2645
|
-
}
|
|
2646
|
-
return value;
|
|
2647
|
-
};
|
|
2648
|
-
var LinkifiedText = function LinkifiedText(_ref2) {
|
|
2649
|
-
var kind = _ref2.kind,
|
|
2650
|
-
value = _ref2.value,
|
|
2651
|
-
answerProps = _ref2.answerProps;
|
|
2652
|
-
return /*#__PURE__*/jsxRuntime.jsx(Typography, _objectSpread(_objectSpread({
|
|
2574
|
+
answerProps = _ref.answerProps;
|
|
2575
|
+
return /*#__PURE__*/jsxRuntime.jsx(Typography, _objectSpread$1(_objectSpread$1({
|
|
2653
2576
|
className: "whitespace-pre-line",
|
|
2654
2577
|
weight: "semibold"
|
|
2655
2578
|
}, answerProps), {}, {
|
|
2656
2579
|
children: /*#__PURE__*/jsxRuntime.jsx(_default, {
|
|
2657
2580
|
componentDecorator: linkifyDecorator,
|
|
2658
|
-
children:
|
|
2659
|
-
value: value,
|
|
2660
|
-
kind: kind
|
|
2661
|
-
})
|
|
2581
|
+
children: value
|
|
2662
2582
|
})
|
|
2663
2583
|
}));
|
|
2664
2584
|
};
|
|
2665
|
-
var
|
|
2666
|
-
var
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
|
|
2711
|
-
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2585
|
+
var normalizeName = function normalizeName(normalizedResponses, response) {
|
|
2586
|
+
var isSplitMode = response.isSplitMode,
|
|
2587
|
+
fullNameLabel = response.fullNameLabel,
|
|
2588
|
+
firstNameLabel = response.firstNameLabel,
|
|
2589
|
+
lastNameLabel = response.lastNameLabel,
|
|
2590
|
+
_response$value = response.value,
|
|
2591
|
+
_response$value2 = _response$value === void 0 ? {
|
|
2592
|
+
fullName: "",
|
|
2593
|
+
firstName: "",
|
|
2594
|
+
lastName: ""
|
|
2595
|
+
} : _response$value,
|
|
2596
|
+
_response$value2$full = _response$value2.fullName,
|
|
2597
|
+
fullName = _response$value2$full === void 0 ? "" : _response$value2$full,
|
|
2598
|
+
_response$value2$firs = _response$value2.firstName,
|
|
2599
|
+
firstName = _response$value2$firs === void 0 ? "" : _response$value2$firs,
|
|
2600
|
+
_response$value2$last = _response$value2.lastName,
|
|
2601
|
+
lastName = _response$value2$last === void 0 ? "" : _response$value2$last;
|
|
2602
|
+
if (isSplitMode) {
|
|
2603
|
+
normalizedResponses.push({
|
|
2604
|
+
value: firstName,
|
|
2605
|
+
label: firstNameLabel
|
|
2606
|
+
});
|
|
2607
|
+
normalizedResponses.push({
|
|
2608
|
+
value: lastName,
|
|
2609
|
+
label: lastNameLabel
|
|
2610
|
+
});
|
|
2611
|
+
} else {
|
|
2612
|
+
normalizedResponses.push({
|
|
2613
|
+
value: fullName,
|
|
2614
|
+
label: fullNameLabel
|
|
2615
|
+
});
|
|
2616
|
+
}
|
|
2617
|
+
};
|
|
2618
|
+
var normalizeResponses = function normalizeResponses(_ref2) {
|
|
2619
|
+
var responses = _ref2.responses,
|
|
2620
|
+
omitKinds = _ref2.omitKinds,
|
|
2621
|
+
answerProps = _ref2.answerProps;
|
|
2622
|
+
var normalizedResponses = [];
|
|
2623
|
+
responses.forEach(function (response) {
|
|
2624
|
+
var kind = response.kind;
|
|
2625
|
+
var label = response.label;
|
|
2626
|
+
var value = response.value;
|
|
2627
|
+
if (omitKinds.includes(kind)) return;
|
|
2628
|
+
|
|
2629
|
+
// Name field doesn't have "label"
|
|
2630
|
+
if (kind !== constants.QUESTION_TYPES.name && ramda.isEmpty(value)) {
|
|
2631
|
+
normalizedResponses.push({
|
|
2632
|
+
label: label,
|
|
2633
|
+
value: /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
2634
|
+
children: i18next.t("neetoForm.common.unanswered")
|
|
2635
|
+
})
|
|
2636
|
+
});
|
|
2637
|
+
return;
|
|
2638
|
+
}
|
|
2639
|
+
if (kind === constants.QUESTION_TYPES.NAME) {
|
|
2640
|
+
normalizeName(normalizedResponses, response);
|
|
2641
|
+
} else if (kind === constants.QUESTION_TYPES.EMAIL) {
|
|
2642
|
+
normalizedResponses.push({
|
|
2643
|
+
label: label,
|
|
2644
|
+
value: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2716
2645
|
className: "flex items-center gap-2",
|
|
2717
2646
|
children: [/*#__PURE__*/jsxRuntime.jsx(LinkifiedText, {
|
|
2718
2647
|
answerProps: answerProps,
|
|
2719
|
-
kind: kind,
|
|
2720
2648
|
value: value
|
|
2721
2649
|
}), /*#__PURE__*/jsxRuntime.jsx(CopyToClipboardButton, {
|
|
2722
2650
|
value: value,
|
|
@@ -2725,15 +2653,103 @@ var Submission = function Submission(_ref3) {
|
|
|
2725
2653
|
size: "small",
|
|
2726
2654
|
style: "text"
|
|
2727
2655
|
})]
|
|
2728
|
-
})
|
|
2729
|
-
|
|
2730
|
-
|
|
2656
|
+
})
|
|
2657
|
+
});
|
|
2658
|
+
} else if (kind === constants.QUESTION_TYPES.ADDITIONAL_GUESTS) {
|
|
2659
|
+
if (neetoCist.isNotPresent(value)) return;
|
|
2660
|
+
normalizedResponses.push({
|
|
2661
|
+
label: label,
|
|
2662
|
+
value: value.join(", ")
|
|
2663
|
+
});
|
|
2664
|
+
} else if (kind === constants.QUESTION_TYPES.FILE_UPLOAD) {
|
|
2665
|
+
normalizedResponses.push({
|
|
2666
|
+
label: label,
|
|
2667
|
+
value: /*#__PURE__*/jsxRuntime.jsx(FileUpload, {
|
|
2668
|
+
files: value
|
|
2669
|
+
})
|
|
2670
|
+
});
|
|
2671
|
+
} else if (kind === constants.QUESTION_TYPES.DATE) {
|
|
2672
|
+
normalizedResponses.push({
|
|
2673
|
+
label: label,
|
|
2674
|
+
value: utils.dateFormat.date(value)
|
|
2675
|
+
});
|
|
2676
|
+
} else if ([constants.QUESTION_TYPES.PHONE, constants.QUESTION_TYPES.SMS_REMINDER].includes(kind)) {
|
|
2677
|
+
normalizedResponses.push({
|
|
2678
|
+
label: label,
|
|
2679
|
+
value: /*#__PURE__*/jsxRuntime.jsx(PhoneNumber.PhoneNumber, {
|
|
2680
|
+
value: value,
|
|
2681
|
+
showEmoji: true
|
|
2682
|
+
})
|
|
2683
|
+
});
|
|
2684
|
+
} else if (kind === constants.QUESTION_TYPES.RICH_TEXT) {
|
|
2685
|
+
// TODO test when rich text field is empty
|
|
2686
|
+
normalizedResponses.push({
|
|
2687
|
+
label: label,
|
|
2688
|
+
value: /*#__PURE__*/jsxRuntime.jsx(EditorContent, {
|
|
2689
|
+
content: value
|
|
2690
|
+
})
|
|
2691
|
+
});
|
|
2692
|
+
} else if (kind === constants.QUESTION_TYPES.CONDITION) {
|
|
2693
|
+
normalizedResponses.push({
|
|
2694
|
+
label: label,
|
|
2695
|
+
value: value.toLowerCase() === "true" ? i18next.t("neetoForm.common.yes") : i18next.t("neetoForm.common.no")
|
|
2696
|
+
});
|
|
2697
|
+
} else {
|
|
2698
|
+
normalizedResponses.push({
|
|
2699
|
+
label: label,
|
|
2700
|
+
value: /*#__PURE__*/jsxRuntime.jsx(LinkifiedText, {
|
|
2731
2701
|
answerProps: answerProps,
|
|
2732
|
-
kind: kind,
|
|
2733
2702
|
value: value
|
|
2734
|
-
})
|
|
2703
|
+
})
|
|
2704
|
+
});
|
|
2735
2705
|
}
|
|
2736
|
-
};
|
|
2706
|
+
});
|
|
2707
|
+
return normalizedResponses;
|
|
2708
|
+
};
|
|
2709
|
+
var linkifyDecorator = function linkifyDecorator(decoratedHref, decoratedText, key) {
|
|
2710
|
+
return /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
2711
|
+
className: "neeto-ui-text-accent-800 hover:neeto-ui-text-accent-800",
|
|
2712
|
+
href: decoratedHref,
|
|
2713
|
+
rel: "noreferrer",
|
|
2714
|
+
target: "_blank",
|
|
2715
|
+
children: decoratedText
|
|
2716
|
+
}, key);
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
2720
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2721
|
+
var Submission = function Submission(_ref) {
|
|
2722
|
+
var _ref$formId = _ref.formId,
|
|
2723
|
+
formId = _ref$formId === void 0 ? "" : _ref$formId,
|
|
2724
|
+
_ref$submissionId = _ref.submissionId,
|
|
2725
|
+
submissionId = _ref$submissionId === void 0 ? "" : _ref$submissionId,
|
|
2726
|
+
_ref$className = _ref.className,
|
|
2727
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
|
2728
|
+
_ref$fetchPublicSubmi = _ref.fetchPublicSubmission,
|
|
2729
|
+
fetchPublicSubmission = _ref$fetchPublicSubmi === void 0 ? true : _ref$fetchPublicSubmi,
|
|
2730
|
+
_ref$questionLabelPro = _ref.questionLabelProps,
|
|
2731
|
+
questionLabelProps = _ref$questionLabelPro === void 0 ? {} : _ref$questionLabelPro,
|
|
2732
|
+
_ref$answerProps = _ref.answerProps,
|
|
2733
|
+
answerProps = _ref$answerProps === void 0 ? {} : _ref$answerProps,
|
|
2734
|
+
_ref$omitKinds = _ref.omitKinds,
|
|
2735
|
+
omitKinds = _ref$omitKinds === void 0 ? [] : _ref$omitKinds;
|
|
2736
|
+
var _useSubmission = constants.useSubmission({
|
|
2737
|
+
formId: formId,
|
|
2738
|
+
submissionId: submissionId,
|
|
2739
|
+
fetchPublicSubmission: fetchPublicSubmission,
|
|
2740
|
+
enabled: !!(formId && submissionId)
|
|
2741
|
+
}),
|
|
2742
|
+
_useSubmission$data = _useSubmission.data,
|
|
2743
|
+
_useSubmission$data2 = _useSubmission$data === void 0 ? {
|
|
2744
|
+
responses: []
|
|
2745
|
+
} : _useSubmission$data,
|
|
2746
|
+
responses = _useSubmission$data2.responses,
|
|
2747
|
+
isLoading = _useSubmission.isLoading;
|
|
2748
|
+
var normalizedResponses = normalizeResponses({
|
|
2749
|
+
responses: responses,
|
|
2750
|
+
omitKinds: omitKinds,
|
|
2751
|
+
answerProps: answerProps
|
|
2752
|
+
});
|
|
2737
2753
|
if (isLoading) {
|
|
2738
2754
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2739
2755
|
className: "flex h-full w-full items-center justify-center",
|
|
@@ -2742,10 +2758,9 @@ var Submission = function Submission(_ref3) {
|
|
|
2742
2758
|
}
|
|
2743
2759
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2744
2760
|
className: classnames("mx-auto flex h-full w-full flex-col items-start", _defineProperty({}, className, className)),
|
|
2745
|
-
children: normalizedResponses.
|
|
2746
|
-
var
|
|
2747
|
-
|
|
2748
|
-
value = _ref4.value;
|
|
2761
|
+
children: normalizedResponses.map(function (_ref2) {
|
|
2762
|
+
var label = _ref2.label,
|
|
2763
|
+
value = _ref2.value;
|
|
2749
2764
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
2750
2765
|
className: "mb-4",
|
|
2751
2766
|
children: [/*#__PURE__*/jsxRuntime.jsx(Typography, _objectSpread(_objectSpread({
|
|
@@ -2753,7 +2768,7 @@ var Submission = function Submission(_ref3) {
|
|
|
2753
2768
|
weight: "light"
|
|
2754
2769
|
}, questionLabelProps), {}, {
|
|
2755
2770
|
children: label
|
|
2756
|
-
})),
|
|
2771
|
+
})), value]
|
|
2757
2772
|
}, label);
|
|
2758
2773
|
})
|
|
2759
2774
|
});
|