@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.js
CHANGED
|
@@ -41,13 +41,16 @@ import Input from '@bigbinary/neetoui/formik/Input';
|
|
|
41
41
|
import * as yup from 'yup';
|
|
42
42
|
import Checkbox$1 from '@bigbinary/neetoui/formik/Checkbox';
|
|
43
43
|
import Checkbox from '@bigbinary/neetoui/Checkbox';
|
|
44
|
-
import
|
|
44
|
+
import Delete from '@bigbinary/neeto-icons/Delete';
|
|
45
|
+
import Plus from '@bigbinary/neeto-icons/Plus';
|
|
45
46
|
import Label from '@bigbinary/neetoui/Label';
|
|
46
47
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
47
48
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
48
49
|
import useHotkeys from '@bigbinary/neeto-hotkeys';
|
|
49
50
|
import Toastr from '@bigbinary/neetoui/Toastr';
|
|
50
51
|
import Spinner$2 from '@bigbinary/neetoui/Spinner';
|
|
52
|
+
import Close from '@bigbinary/neeto-icons/Close';
|
|
53
|
+
import Check from '@bigbinary/neeto-icons/Check';
|
|
51
54
|
import dayjs from 'dayjs';
|
|
52
55
|
import { parsePhoneNumber } from 'libphonenumber-js';
|
|
53
56
|
import EditorContent from '@bigbinary/neeto-editor/EditorContent';
|
|
@@ -61,6 +64,7 @@ import DatePicker from '@bigbinary/neetoui/DatePicker';
|
|
|
61
64
|
import path$1 from 'path';
|
|
62
65
|
import Input$1 from '@bigbinary/neetoui/Input';
|
|
63
66
|
import { DirectUpload } from '@rails/activestorage';
|
|
67
|
+
import FileGeneric from '@bigbinary/neeto-icons/FileGeneric';
|
|
64
68
|
import Select$1 from '@bigbinary/neetoui/Select';
|
|
65
69
|
import Radio from '@bigbinary/neetoui/Radio';
|
|
66
70
|
import Textarea$1 from '@bigbinary/neetoui/Textarea';
|
|
@@ -613,7 +617,8 @@ var useCreateForm = function useCreateForm(options) {
|
|
|
613
617
|
return forms && [].concat(_toConsumableArray$1(forms), [form]);
|
|
614
618
|
});
|
|
615
619
|
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, form.id, language], form);
|
|
616
|
-
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(form.id), language], form)
|
|
620
|
+
queryClient.setQueryData([QUERY_KEYS.QUESTIONS, "preview/".concat(form.id), language], form);
|
|
621
|
+
queryClient.invalidateQueries({
|
|
617
622
|
queryKey: [QUERY_KEYS.FORMS]
|
|
618
623
|
});
|
|
619
624
|
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options, form);
|
|
@@ -823,25 +828,23 @@ var useUpdateSubmission = function useUpdateSubmission(options) {
|
|
|
823
828
|
return useMutation(_objectSpread$z(_objectSpread$z({
|
|
824
829
|
mutationFn: function mutationFn(_ref13) {
|
|
825
830
|
var formId = _ref13.formId,
|
|
826
|
-
submissionId = _ref13.submissionId,
|
|
827
831
|
values = _ref13.values;
|
|
828
|
-
return neetoFormApi.updatePublicSubmission(formId,
|
|
832
|
+
return neetoFormApi.updatePublicSubmission(formId, values);
|
|
829
833
|
}
|
|
830
834
|
}, options), {}, {
|
|
831
835
|
onSuccess: function onSuccess() {
|
|
836
|
+
var _data$submission3;
|
|
832
837
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
833
838
|
args[_key6] = arguments[_key6];
|
|
834
839
|
}
|
|
835
840
|
var data = args[0],
|
|
836
|
-
|
|
837
|
-
formId = _args$.formId,
|
|
838
|
-
submissionId = _args$.submissionId;
|
|
841
|
+
formId = args[1].formId;
|
|
839
842
|
queryClient.invalidateQueries({
|
|
840
|
-
queryKey: [QUERY_KEYS.SUBMISSIONS, formId]
|
|
843
|
+
queryKey: [[QUERY_KEYS.SUBMISSIONS, formId]]
|
|
841
844
|
});
|
|
842
|
-
queryClient.setQueryData([QUERY_KEYS.SUBMISSION, formId,
|
|
845
|
+
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);
|
|
843
846
|
queryClient.invalidateQueries({
|
|
844
|
-
queryKey: [QUERY_KEYS.SUBMISSION, formId,
|
|
847
|
+
queryKey: [[QUERY_KEYS.SUBMISSION, formId, data.submission.id]]
|
|
845
848
|
});
|
|
846
849
|
options.onSuccess && options.onSuccess.apply(options, args);
|
|
847
850
|
}
|
|
@@ -14204,7 +14207,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
14204
14207
|
case 17:
|
|
14205
14208
|
data = _context.sent;
|
|
14206
14209
|
queryClient.invalidateQueries({
|
|
14207
|
-
queryKey: [QUERY_KEYS.
|
|
14210
|
+
queryKey: [QUERY_KEYS.SUBMISSION, formId, submissionId]
|
|
14208
14211
|
});
|
|
14209
14212
|
_context.next = 30;
|
|
14210
14213
|
break;
|
|
@@ -14317,6 +14320,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
14317
14320
|
var _useForm = useForm({
|
|
14318
14321
|
formId: formId,
|
|
14319
14322
|
language: language,
|
|
14323
|
+
preview: preview,
|
|
14320
14324
|
enabled: !preview
|
|
14321
14325
|
}),
|
|
14322
14326
|
_useForm$data = _useForm.data,
|