@bigbinary/neeto-form-frontend 2.2.0-beta4 → 3.0.1
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 +29 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +16 -14
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
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
|
}
|
|
@@ -3088,8 +3091,7 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
3088
3091
|
showActionBlock = _ref$showActionBlock === void 0 ? false : _ref$showActionBlock,
|
|
3089
3092
|
submitButtonProps = _ref.submitButtonProps,
|
|
3090
3093
|
cancelButtonProps = _ref.cancelButtonProps,
|
|
3091
|
-
|
|
3092
|
-
questionKinds = _ref$questionKinds === void 0 ? [] : _ref$questionKinds,
|
|
3094
|
+
questionKinds = _ref.questionKinds,
|
|
3093
3095
|
_ref$isKindAlreadyAct = _ref.isKindAlreadyActive,
|
|
3094
3096
|
isKindAlreadyActive = _ref$isKindAlreadyAct === void 0 ? isQuestionKindAlreadyActive : _ref$isKindAlreadyAct,
|
|
3095
3097
|
_ref$getActiveKindDet = _ref.getActiveKindDetails,
|
|
@@ -3219,7 +3221,7 @@ var BuildForm = function BuildForm(_ref) {
|
|
|
3219
3221
|
submitButtonProps: submitButtonProps
|
|
3220
3222
|
})), {}, {
|
|
3221
3223
|
formId: id,
|
|
3222
|
-
questionKinds:
|
|
3224
|
+
questionKinds: isNil(questionKinds) ? defaultQuestionKinds : questionKinds,
|
|
3223
3225
|
onChange: function onChange(event) {
|
|
3224
3226
|
if (isEmpty(errors)) return;
|
|
3225
3227
|
setFieldError(event.target.name);
|
|
@@ -14204,7 +14206,7 @@ var ExternalForm = function ExternalForm(_ref) {
|
|
|
14204
14206
|
case 17:
|
|
14205
14207
|
data = _context.sent;
|
|
14206
14208
|
queryClient.invalidateQueries({
|
|
14207
|
-
queryKey: [QUERY_KEYS.
|
|
14209
|
+
queryKey: [QUERY_KEYS.SUBMISSION, formId, submissionId]
|
|
14208
14210
|
});
|
|
14209
14211
|
_context.next = 30;
|
|
14210
14212
|
break;
|