@bigbinary/neeto-form-frontend 2.2.0-beta3 → 3.0.0
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/index.cjs.js +28 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.cjs.js
CHANGED
|
@@ -44,13 +44,16 @@ var Input = require('@bigbinary/neetoui/formik/Input');
|
|
|
44
44
|
var yup = require('yup');
|
|
45
45
|
var Checkbox$1 = require('@bigbinary/neetoui/formik/Checkbox');
|
|
46
46
|
var Checkbox = require('@bigbinary/neetoui/Checkbox');
|
|
47
|
-
var
|
|
47
|
+
var Delete = require('@bigbinary/neeto-icons/Delete');
|
|
48
|
+
var Plus = require('@bigbinary/neeto-icons/Plus');
|
|
48
49
|
var Label = require('@bigbinary/neetoui/Label');
|
|
49
50
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
50
51
|
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
51
52
|
var useHotkeys = require('@bigbinary/neeto-hotkeys');
|
|
52
53
|
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
53
54
|
var Spinner$2 = require('@bigbinary/neetoui/Spinner');
|
|
55
|
+
var Close = require('@bigbinary/neeto-icons/Close');
|
|
56
|
+
var Check = require('@bigbinary/neeto-icons/Check');
|
|
54
57
|
var dayjs = require('dayjs');
|
|
55
58
|
var libphonenumberJs = require('libphonenumber-js');
|
|
56
59
|
var EditorContent = require('@bigbinary/neeto-editor/EditorContent');
|
|
@@ -64,6 +67,7 @@ var DatePicker = require('@bigbinary/neetoui/DatePicker');
|
|
|
64
67
|
var path = require('path');
|
|
65
68
|
var Input$1 = require('@bigbinary/neetoui/Input');
|
|
66
69
|
var activestorage = require('@rails/activestorage');
|
|
70
|
+
var FileGeneric = require('@bigbinary/neeto-icons/FileGeneric');
|
|
67
71
|
var Select$1 = require('@bigbinary/neetoui/Select');
|
|
68
72
|
var Radio = require('@bigbinary/neetoui/Radio');
|
|
69
73
|
var Textarea$1 = require('@bigbinary/neetoui/Textarea');
|
|
@@ -118,12 +122,16 @@ var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
|
118
122
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
119
123
|
var Checkbox__default$1 = /*#__PURE__*/_interopDefaultLegacy(Checkbox$1);
|
|
120
124
|
var Checkbox__default = /*#__PURE__*/_interopDefaultLegacy(Checkbox);
|
|
125
|
+
var Delete__default = /*#__PURE__*/_interopDefaultLegacy(Delete);
|
|
126
|
+
var Plus__default = /*#__PURE__*/_interopDefaultLegacy(Plus);
|
|
121
127
|
var Label__default = /*#__PURE__*/_interopDefaultLegacy(Label);
|
|
122
128
|
var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator);
|
|
123
129
|
var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
|
|
124
130
|
var useHotkeys__default = /*#__PURE__*/_interopDefaultLegacy(useHotkeys);
|
|
125
131
|
var Toastr__default = /*#__PURE__*/_interopDefaultLegacy(Toastr);
|
|
126
132
|
var Spinner__default = /*#__PURE__*/_interopDefaultLegacy(Spinner$2);
|
|
133
|
+
var Close__default = /*#__PURE__*/_interopDefaultLegacy(Close);
|
|
134
|
+
var Check__default = /*#__PURE__*/_interopDefaultLegacy(Check);
|
|
127
135
|
var dayjs__default = /*#__PURE__*/_interopDefaultLegacy(dayjs);
|
|
128
136
|
var EditorContent__default = /*#__PURE__*/_interopDefaultLegacy(EditorContent);
|
|
129
137
|
var NeetoUIMultiEmailInput__default = /*#__PURE__*/_interopDefaultLegacy(NeetoUIMultiEmailInput);
|
|
@@ -134,6 +142,7 @@ var weekOfYear__default = /*#__PURE__*/_interopDefaultLegacy(weekOfYear);
|
|
|
134
142
|
var DatePicker__default = /*#__PURE__*/_interopDefaultLegacy(DatePicker);
|
|
135
143
|
var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
|
|
136
144
|
var Input__default$1 = /*#__PURE__*/_interopDefaultLegacy(Input$1);
|
|
145
|
+
var FileGeneric__default = /*#__PURE__*/_interopDefaultLegacy(FileGeneric);
|
|
137
146
|
var Select__default$1 = /*#__PURE__*/_interopDefaultLegacy(Select$1);
|
|
138
147
|
var Radio__default = /*#__PURE__*/_interopDefaultLegacy(Radio);
|
|
139
148
|
var Textarea__default$1 = /*#__PURE__*/_interopDefaultLegacy(Textarea$1);
|
|
@@ -685,7 +694,8 @@ var useCreateForm = function useCreateForm(options) {
|
|
|
685
694
|
return forms && [].concat(_toConsumableArray__default["default"](forms), [form]);
|
|
686
695
|
});
|
|
687
696
|
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, form.id, language], form);
|
|
688
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(form.id), language], form)
|
|
697
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(form.id), language], form);
|
|
698
|
+
queryClient.invalidateQueries({
|
|
689
699
|
queryKey: [QUERY_KEYS.FORMS]
|
|
690
700
|
});
|
|
691
701
|
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options, form);
|
|
@@ -895,25 +905,23 @@ var useUpdateSubmission = function useUpdateSubmission(options) {
|
|
|
895
905
|
return reactQuery.useMutation(_objectSpread$z(_objectSpread$z({
|
|
896
906
|
mutationFn: function mutationFn(_ref13) {
|
|
897
907
|
var formId = _ref13.formId,
|
|
898
|
-
submissionId = _ref13.submissionId,
|
|
899
908
|
values = _ref13.values;
|
|
900
|
-
return neetoFormApi.updatePublicSubmission(formId,
|
|
909
|
+
return neetoFormApi.updatePublicSubmission(formId, values);
|
|
901
910
|
}
|
|
902
911
|
}, options), {}, {
|
|
903
912
|
onSuccess: function onSuccess() {
|
|
913
|
+
var _data$submission3;
|
|
904
914
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
905
915
|
args[_key6] = arguments[_key6];
|
|
906
916
|
}
|
|
907
917
|
var data = args[0],
|
|
908
|
-
|
|
909
|
-
formId = _args$.formId,
|
|
910
|
-
submissionId = _args$.submissionId;
|
|
918
|
+
formId = args[1].formId;
|
|
911
919
|
queryClient.invalidateQueries({
|
|
912
|
-
queryKey: [QUERY_KEYS.SUBMISSIONS, formId]
|
|
920
|
+
queryKey: [[QUERY_KEYS.SUBMISSIONS, formId]]
|
|
913
921
|
});
|
|
914
|
-
queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId,
|
|
922
|
+
queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId, data === null || data === void 0 || (_data$submission3 = data.submission) === null || _data$submission3 === void 0 ? void 0 : _data$submission3.id], data === null || data === void 0 ? void 0 : data.submission);
|
|
915
923
|
queryClient.invalidateQueries({
|
|
916
|
-
queryKey: [QUERY_KEYS.SUBMISSION, formId,
|
|
924
|
+
queryKey: [[QUERY_KEYS.SUBMISSION, formId, data.submission.id]]
|
|
917
925
|
});
|
|
918
926
|
options.onSuccess && options.onSuccess.apply(options, args);
|
|
919
927
|
}
|
|
@@ -2674,7 +2682,7 @@ var Options = function Options(_ref) {
|
|
|
2674
2682
|
})
|
|
2675
2683
|
}), !freezeOptions && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
2676
2684
|
"data-cy": "neeto-form-engine-delete-option-button",
|
|
2677
|
-
icon:
|
|
2685
|
+
icon: Delete__default["default"],
|
|
2678
2686
|
size: "small",
|
|
2679
2687
|
style: "text",
|
|
2680
2688
|
className: classnames__default["default"]({
|
|
@@ -2694,7 +2702,7 @@ var Options = function Options(_ref) {
|
|
|
2694
2702
|
className: "mt-3 w-full",
|
|
2695
2703
|
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
2696
2704
|
"data-cy": "neeto-form-engine-add-option-button",
|
|
2697
|
-
icon:
|
|
2705
|
+
icon: Plus__default["default"],
|
|
2698
2706
|
iconPosition: "left",
|
|
2699
2707
|
size: "small",
|
|
2700
2708
|
style: "text",
|
|
@@ -2897,7 +2905,7 @@ var AddQuestion = reactUtils.withT(function (_ref) {
|
|
|
2897
2905
|
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
2898
2906
|
"data-cy": "neeto-form-engine-add-question",
|
|
2899
2907
|
disabled: isDisabled,
|
|
2900
|
-
icon:
|
|
2908
|
+
icon: Plus__default["default"],
|
|
2901
2909
|
iconPosition: "left",
|
|
2902
2910
|
label: t("neetoForm.questions.common.primaryPanel.addQuestion"),
|
|
2903
2911
|
style: "link",
|
|
@@ -3362,7 +3370,7 @@ var ButtonLoader = function ButtonLoader() {
|
|
|
3362
3370
|
var Success$2 = function Success() {
|
|
3363
3371
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
3364
3372
|
className: "neeto-form-engine-button__success",
|
|
3365
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3373
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Check__default["default"], {})
|
|
3366
3374
|
});
|
|
3367
3375
|
};
|
|
3368
3376
|
|
|
@@ -3401,7 +3409,7 @@ var Callout = function Callout(_ref) {
|
|
|
3401
3409
|
children: [neetoCist.isPresent(onClose) && /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
3402
3410
|
className: "neeto-form-engine-callout__close",
|
|
3403
3411
|
onClick: onClose,
|
|
3404
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
3412
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Close__default["default"], {
|
|
3405
3413
|
size: 16
|
|
3406
3414
|
})
|
|
3407
3415
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -13371,7 +13379,7 @@ var FilePreview = reactUtils.withT(function (_ref) {
|
|
|
13371
13379
|
invisible: isUploading
|
|
13372
13380
|
}),
|
|
13373
13381
|
href: file.url,
|
|
13374
|
-
icon:
|
|
13382
|
+
icon: FileGeneric__default["default"],
|
|
13375
13383
|
iconSize: 24,
|
|
13376
13384
|
rel: "noreferrer",
|
|
13377
13385
|
size: "large",
|
|
@@ -13403,12 +13411,12 @@ var FilePreview = reactUtils.withT(function (_ref) {
|
|
|
13403
13411
|
className: classnames__default["default"]("neeto-form-engine-file-upload__success-indicator", {
|
|
13404
13412
|
"neeto-form-engine-file-upload__success-indicator--active": file.url
|
|
13405
13413
|
}),
|
|
13406
|
-
children: file.url && /*#__PURE__*/jsxRuntime.jsx(
|
|
13414
|
+
children: file.url && /*#__PURE__*/jsxRuntime.jsx(Check__default["default"], {})
|
|
13407
13415
|
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
13408
13416
|
type: "button",
|
|
13409
13417
|
className: classnames__default["default"]("neeto-form-engine-file-upload__button--red neeto-form-engine-file-upload__remove-button"),
|
|
13410
13418
|
onClick: cancel,
|
|
13411
|
-
children: /*#__PURE__*/jsxRuntime.jsx(
|
|
13419
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Close__default["default"], {})
|
|
13412
13420
|
})]
|
|
13413
13421
|
})]
|
|
13414
13422
|
}, file.url);
|
|
@@ -14276,7 +14284,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
14276
14284
|
case 17:
|
|
14277
14285
|
data = _context.sent;
|
|
14278
14286
|
queryClient.invalidateQueries({
|
|
14279
|
-
queryKey: [QUERY_KEYS.
|
|
14287
|
+
queryKey: [QUERY_KEYS.SUBMISSION, formId, submissionId]
|
|
14280
14288
|
});
|
|
14281
14289
|
_context.next = 30;
|
|
14282
14290
|
break;
|
|
@@ -14389,6 +14397,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
14389
14397
|
var _useForm = useForm({
|
|
14390
14398
|
formId: formId,
|
|
14391
14399
|
language: language,
|
|
14400
|
+
preview: preview,
|
|
14392
14401
|
enabled: !preview
|
|
14393
14402
|
}),
|
|
14394
14403
|
_useForm$data = _useForm.data,
|