@commercetools-frontend-extensions/export-resources-modal 3.6.0 → 3.7.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.
|
@@ -42,11 +42,14 @@ var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/i
|
|
|
42
42
|
var sdk = require('@commercetools-frontend/sdk');
|
|
43
43
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
44
44
|
var constants = require('@commercetools-frontend/constants');
|
|
45
|
+
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
45
46
|
var _styled = require('@emotion/styled/base');
|
|
46
47
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
47
48
|
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
49
|
+
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
50
|
+
var throttle = require('lodash/throttle');
|
|
51
|
+
var react = require('@emotion/react');
|
|
48
52
|
var PropTypes = require('prop-types');
|
|
49
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
50
53
|
var formik = require('formik');
|
|
51
54
|
|
|
52
55
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
@@ -77,6 +80,8 @@ var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesI
|
|
|
77
80
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
78
81
|
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
79
82
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
83
|
+
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
84
|
+
var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
80
85
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
81
86
|
|
|
82
87
|
function getBold(msg) {
|
|
@@ -230,6 +235,31 @@ var messages = reactIntl.defineMessages({
|
|
|
230
235
|
id: 'ExportResourcesModal.unexpectedError',
|
|
231
236
|
description: 'Generic notification message when starting export process fails',
|
|
232
237
|
defaultMessage: 'An error occurred while starting the export process. Please try again or contact support if the problem persists.'
|
|
238
|
+
},
|
|
239
|
+
searchForFields: {
|
|
240
|
+
id: 'ExportResourcesModal.searchForFields',
|
|
241
|
+
description: 'Placeholder for "Search for fields" search input',
|
|
242
|
+
defaultMessage: 'Search for fields'
|
|
243
|
+
},
|
|
244
|
+
thereAreNoResults: {
|
|
245
|
+
id: 'ExportResourcesModal.thereAreNoResults',
|
|
246
|
+
description: 'No search results message',
|
|
247
|
+
defaultMessage: 'There are no results that match your search.'
|
|
248
|
+
},
|
|
249
|
+
suggestions: {
|
|
250
|
+
id: 'ExportResourcesModal.suggestions',
|
|
251
|
+
description: 'In Export fields selection - Suggestions message',
|
|
252
|
+
defaultMessage: 'Suggestions:'
|
|
253
|
+
},
|
|
254
|
+
checkTheSpelling: {
|
|
255
|
+
id: 'ExportResourcesModal.checkTheSpelling',
|
|
256
|
+
description: 'In Export fields selection - Check the spelling message',
|
|
257
|
+
defaultMessage: 'Check the spelling.'
|
|
258
|
+
},
|
|
259
|
+
searchByEnteringTheExactFieldName: {
|
|
260
|
+
id: 'ExportResourcesModal.searchByEnteringTheExactFieldName',
|
|
261
|
+
description: 'In Export fields selection - Search by entering the exact field name message',
|
|
262
|
+
defaultMessage: 'Try searching by entering the exact field name.'
|
|
233
263
|
}
|
|
234
264
|
});
|
|
235
265
|
|
|
@@ -827,29 +857,50 @@ const ExportFileSettingsStep = () => {
|
|
|
827
857
|
});
|
|
828
858
|
};
|
|
829
859
|
|
|
860
|
+
var _ref = {
|
|
861
|
+
name: "ti75j2",
|
|
862
|
+
styles: "margin:0"
|
|
863
|
+
} ;
|
|
864
|
+
const NoSearchResults = () => {
|
|
865
|
+
return jsxRuntime.jsxs(uiKit.Card, {
|
|
866
|
+
insetScale: "xl",
|
|
867
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
868
|
+
scale: "s",
|
|
869
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
870
|
+
fontWeight: "medium",
|
|
871
|
+
intlMessage: messages.thereAreNoResults
|
|
872
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
873
|
+
intlMessage: messages.suggestions
|
|
874
|
+
})]
|
|
875
|
+
}), jsxRuntime.jsxs("ul", {
|
|
876
|
+
css: _ref,
|
|
877
|
+
children: [jsxRuntime.jsx("li", {
|
|
878
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
879
|
+
intlMessage: messages.checkTheSpelling
|
|
880
|
+
})
|
|
881
|
+
}), jsxRuntime.jsx("li", {
|
|
882
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
883
|
+
intlMessage: messages.searchByEnteringTheExactFieldName
|
|
884
|
+
})
|
|
885
|
+
})]
|
|
886
|
+
})]
|
|
887
|
+
});
|
|
888
|
+
};
|
|
889
|
+
|
|
830
890
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
831
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
832
|
-
const
|
|
891
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context22, _context23; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context22 = ownKeys$1(Object(t), !0)).call(_context22, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context23 = ownKeys$1(Object(t))).call(_context23, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
892
|
+
const StyledGroupCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
833
893
|
target: "e1ocu3bb1"
|
|
834
|
-
} )("height:100%;
|
|
835
|
-
|
|
836
|
-
return isTopRow ? uiKit.designTokens.borderForCardWhenRaised : 'none';
|
|
837
|
-
}, ";border-radius:", _ref2 => {
|
|
838
|
-
let isTopRow = _ref2.isTopRow;
|
|
839
|
-
return isTopRow ? '4px 0px 0px 0px' : '0px 0px 0px 4px';
|
|
840
|
-
}, ";" + ("" ));
|
|
841
|
-
const StyledCardRight = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
894
|
+
} )("border-right:", uiKit.designTokens.borderWidth1, " solid ", uiKit.designTokens.colorNeutral90, ";background-color:", uiKit.designTokens.colorNeutral98, ";height:100%;border-radius:0;", props => props.showTopBorder && /*#__PURE__*/react.css("border-top:", uiKit.designTokens.borderWidth1, " solid ", uiKit.designTokens.colorNeutral90, ";" + ("" ), "" ), ";" + ("" ));
|
|
895
|
+
const StyledFieldsCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
842
896
|
target: "e1ocu3bb0"
|
|
843
|
-
} )("
|
|
844
|
-
let isTopRow = _ref3.isTopRow;
|
|
845
|
-
return isTopRow ? uiKit.designTokens.borderForCardWhenRaised : 'none';
|
|
846
|
-
}, ";border-radius:", _ref4 => {
|
|
847
|
-
let isTopRow = _ref4.isTopRow;
|
|
848
|
-
return isTopRow ? '0px 4px 0px 0px' : '0px 0px 4px 0px';
|
|
849
|
-
}, ";" + ("" ));
|
|
897
|
+
} )("border-radius:0;", props => props.showTopBorder && /*#__PURE__*/react.css("border-top:", uiKit.designTokens.borderWidth1, " solid ", uiKit.designTokens.colorNeutral90, ";" + ("" ), "" ), ";" + ("" ));
|
|
850
898
|
const ExportFieldsSelectionStep = () => {
|
|
851
|
-
var _formik$values$custom;
|
|
852
899
|
const intl = reactIntl.useIntl();
|
|
900
|
+
const _React$useState = React__default["default"].useState(''),
|
|
901
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
902
|
+
fieldSearchTerm = _React$useState2[0],
|
|
903
|
+
setFieldSearchTerm = _React$useState2[1];
|
|
853
904
|
const _useExportResourcesCo = useExportResourcesContext(),
|
|
854
905
|
formik = _useExportResourcesCo.formik,
|
|
855
906
|
setCurrentStep = _useExportResourcesCo.setCurrentStep,
|
|
@@ -877,6 +928,33 @@ const ExportFieldsSelectionStep = () => {
|
|
|
877
928
|
const isAtLeastOneCustomFieldChecked = React__default["default"].useMemo(() => {
|
|
878
929
|
return _someInstanceProperty__default["default"](allCustomFields).call(allCustomFields, field => field.isChecked);
|
|
879
930
|
}, [allCustomFields]);
|
|
931
|
+
const filteredGeneralFields = React__default["default"].useMemo(() => {
|
|
932
|
+
var _context4;
|
|
933
|
+
return _filterInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](formik).fields).call(_context4, field => {
|
|
934
|
+
var _context5;
|
|
935
|
+
return _includesInstanceProperty__default["default"](_context5 = field.label.toLowerCase()).call(_context5, _trimInstanceProperty__default["default"](fieldSearchTerm).call(fieldSearchTerm).toLowerCase());
|
|
936
|
+
});
|
|
937
|
+
}, [_valuesInstanceProperty__default["default"](formik).fields, fieldSearchTerm]);
|
|
938
|
+
const filteredCustomFields = React__default["default"].useMemo(() => {
|
|
939
|
+
var _context6, _context7;
|
|
940
|
+
return _filterInstanceProperty__default["default"](_context6 = _mapInstanceProperty__default["default"](_context7 = _valuesInstanceProperty__default["default"](formik).customFields).call(_context7, customType => {
|
|
941
|
+
var _context8, _context9;
|
|
942
|
+
return _objectSpread$1(_objectSpread$1({}, customType), {}, {
|
|
943
|
+
fields: _includesInstanceProperty__default["default"](_context8 = customType.type.label.toLowerCase()).call(_context8, _trimInstanceProperty__default["default"](fieldSearchTerm).call(fieldSearchTerm).toLowerCase()) ? customType.fields : _filterInstanceProperty__default["default"](_context9 = customType.fields).call(_context9, field => {
|
|
944
|
+
var _context10;
|
|
945
|
+
return _includesInstanceProperty__default["default"](_context10 = field.label.toLowerCase()).call(_context10, _trimInstanceProperty__default["default"](fieldSearchTerm).call(fieldSearchTerm).toLowerCase());
|
|
946
|
+
})
|
|
947
|
+
});
|
|
948
|
+
})).call(_context6, customType => customType.fields.length > 0);
|
|
949
|
+
}, [_valuesInstanceProperty__default["default"](formik).customFields, fieldSearchTerm]);
|
|
950
|
+
const onSearchChange = React__default["default"].useCallback(event => {
|
|
951
|
+
setFieldSearchTerm(event.target.value);
|
|
952
|
+
}, [setFieldSearchTerm]);
|
|
953
|
+
const hasResults = filteredGeneralFields.length > 0 || filteredCustomFields.length > 0;
|
|
954
|
+
const onSearchChangeThrottled = React__default["default"].useMemo(() => throttle__default["default"](onSearchChange, 300), [onSearchChange]);
|
|
955
|
+
const onSearchReset = () => {
|
|
956
|
+
setFieldSearchTerm('');
|
|
957
|
+
};
|
|
880
958
|
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
881
959
|
isOpen: true,
|
|
882
960
|
title: intl.formatMessage(messages.modalTitle, {
|
|
@@ -903,112 +981,128 @@ const ExportFieldsSelectionStep = () => {
|
|
|
903
981
|
intlMessage: messages.fieldDefinitions,
|
|
904
982
|
to: FIELD_DEFINITIONS_URLS[resourceType]
|
|
905
983
|
})]
|
|
906
|
-
}), jsxRuntime.
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
fields: _valuesInstanceProperty__default["default"](formik).fields,
|
|
933
|
-
setFieldValue: formik.setFieldValue
|
|
984
|
+
}), jsxRuntime.jsx(uiKit.SearchTextInput, {
|
|
985
|
+
placeholder: intl.formatMessage(messages.searchForFields),
|
|
986
|
+
value: fieldSearchTerm,
|
|
987
|
+
onChange: onSearchChangeThrottled,
|
|
988
|
+
onReset: onSearchReset
|
|
989
|
+
}), !hasResults && jsxRuntime.jsx(NoSearchResults, {}), hasResults && jsxRuntime.jsx(uiKit.Card, {
|
|
990
|
+
insetScale: "none",
|
|
991
|
+
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
992
|
+
gridAutoFlow: "row",
|
|
993
|
+
gridTemplateColumns: "".concat(uiKit.designTokens.constraint5, " auto"),
|
|
994
|
+
children: [filteredGeneralFields.length > 0 && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
995
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
996
|
+
children: jsxRuntime.jsx(StyledGroupCard, {
|
|
997
|
+
type: "flat",
|
|
998
|
+
insetScale: "l",
|
|
999
|
+
children: jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1000
|
+
isIndeterminate: !areAllGeneralFieldsChecked && isAtLeastOneGeneralFieldChecked,
|
|
1001
|
+
isChecked: areAllGeneralFieldsChecked,
|
|
1002
|
+
onChange: e => {
|
|
1003
|
+
var _context11;
|
|
1004
|
+
formik.setFieldValue('fields', _mapInstanceProperty__default["default"](_context11 = _valuesInstanceProperty__default["default"](formik).fields).call(_context11, field => _objectSpread$1(_objectSpread$1({}, field), {}, {
|
|
1005
|
+
isChecked: field.isRequired ? true : e.target.checked
|
|
1006
|
+
})));
|
|
1007
|
+
},
|
|
1008
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.allGeneralFields))
|
|
1009
|
+
})
|
|
934
1010
|
})
|
|
935
|
-
})
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
1011
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1012
|
+
children: jsxRuntime.jsx(StyledFieldsCard, {
|
|
1013
|
+
type: "flat",
|
|
1014
|
+
insetScale: "l",
|
|
1015
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
1016
|
+
scale: "s",
|
|
1017
|
+
children: jsxRuntime.jsx(GeneralFieldsSelection, {
|
|
1018
|
+
fields: filteredGeneralFields,
|
|
1019
|
+
formik: formik
|
|
1020
|
+
})
|
|
1021
|
+
})
|
|
1022
|
+
})
|
|
1023
|
+
})]
|
|
1024
|
+
}), filteredCustomFields.length > 0 && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1025
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1026
|
+
children: jsxRuntime.jsx(StyledGroupCard, {
|
|
1027
|
+
type: "flat",
|
|
1028
|
+
insetScale: "l",
|
|
1029
|
+
showTopBorder: filteredGeneralFields.length > 0,
|
|
1030
|
+
children: jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1031
|
+
isIndeterminate: !areAllCustomFieldsChecked && isAtLeastOneCustomFieldChecked,
|
|
1032
|
+
isChecked: areAllCustomFieldsChecked,
|
|
1033
|
+
onChange: e => {
|
|
1034
|
+
var _context12;
|
|
1035
|
+
formik.setFieldValue('customFields', _mapInstanceProperty__default["default"](_context12 = _valuesInstanceProperty__default["default"](formik).customFields).call(_context12, customType => {
|
|
1036
|
+
var _context13;
|
|
1037
|
+
return _objectSpread$1(_objectSpread$1({}, customType), {}, {
|
|
1038
|
+
fields: _mapInstanceProperty__default["default"](_context13 = customType.fields).call(_context13, field => _objectSpread$1(_objectSpread$1({}, field), {}, {
|
|
1039
|
+
isChecked: e.target.checked
|
|
1040
|
+
}))
|
|
1041
|
+
});
|
|
1042
|
+
}));
|
|
1043
|
+
},
|
|
1044
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.allCustomFields))
|
|
1045
|
+
})
|
|
956
1046
|
})
|
|
957
|
-
})
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1047
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1048
|
+
children: jsxRuntime.jsx(StyledFieldsCard, {
|
|
1049
|
+
type: "flat",
|
|
1050
|
+
insetScale: "l",
|
|
1051
|
+
showTopBorder: filteredGeneralFields.length > 0,
|
|
1052
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1053
|
+
scale: "s",
|
|
1054
|
+
children: [jsxRuntime.jsxs(uiKit.CheckboxInput, {
|
|
1055
|
+
isReadOnly: true,
|
|
1056
|
+
onChange: () => {},
|
|
1057
|
+
isChecked: isAtLeastOneCustomFieldChecked,
|
|
1058
|
+
children: [jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$1({}, messages.customTypeKeyAndTypeId)), ' ', "*"]
|
|
1059
|
+
}), jsxRuntime.jsx(CustomFieldsSelection, {
|
|
1060
|
+
customFields: filteredCustomFields,
|
|
1061
|
+
formik: formik
|
|
1062
|
+
})]
|
|
1063
|
+
})
|
|
972
1064
|
})
|
|
973
|
-
})
|
|
1065
|
+
})]
|
|
974
1066
|
})]
|
|
975
|
-
})
|
|
1067
|
+
})
|
|
976
1068
|
})]
|
|
977
1069
|
})
|
|
978
1070
|
})
|
|
979
1071
|
});
|
|
980
1072
|
};
|
|
981
|
-
const GeneralFieldsSelection =
|
|
982
|
-
let fields =
|
|
983
|
-
|
|
1073
|
+
const GeneralFieldsSelection = _ref => {
|
|
1074
|
+
let fields = _ref.fields,
|
|
1075
|
+
formik = _ref.formik;
|
|
984
1076
|
return _mapInstanceProperty__default["default"](fields).call(fields, field => jsxRuntime.jsxs(uiKit.CheckboxInput, {
|
|
985
1077
|
isChecked: field.isChecked,
|
|
986
1078
|
isReadOnly: field.isRequired,
|
|
987
1079
|
onChange: e => {
|
|
988
|
-
|
|
1080
|
+
var _context14;
|
|
1081
|
+
formik.setFieldValue('fields', _mapInstanceProperty__default["default"](_context14 = _valuesInstanceProperty__default["default"](formik).fields).call(_context14, _field => field.name === _field.name ? _objectSpread$1(_objectSpread$1({}, _field), {}, {
|
|
989
1082
|
isChecked: e.target.checked
|
|
990
1083
|
}) : _field));
|
|
991
1084
|
},
|
|
992
1085
|
children: [field.label, " ", field.isRequired && '*']
|
|
993
1086
|
}, field.name));
|
|
994
1087
|
};
|
|
995
|
-
const CustomFieldsSelection =
|
|
996
|
-
let customFields =
|
|
997
|
-
|
|
1088
|
+
const CustomFieldsSelection = _ref2 => {
|
|
1089
|
+
let customFields = _ref2.customFields,
|
|
1090
|
+
formik = _ref2.formik;
|
|
998
1091
|
return _mapInstanceProperty__default["default"](customFields).call(customFields, customType => {
|
|
999
|
-
var
|
|
1000
|
-
const areAllFieldsChecked = _everyInstanceProperty__default["default"](
|
|
1001
|
-
const isAtLeastOneFieldChecked = _someInstanceProperty__default["default"](
|
|
1092
|
+
var _context15, _context16, _context19;
|
|
1093
|
+
const areAllFieldsChecked = _everyInstanceProperty__default["default"](_context15 = customType.fields).call(_context15, field => field.isChecked);
|
|
1094
|
+
const isAtLeastOneFieldChecked = _someInstanceProperty__default["default"](_context16 = customType.fields).call(_context16, field => field.isChecked);
|
|
1002
1095
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1003
1096
|
scale: "s",
|
|
1004
1097
|
children: [jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1005
1098
|
isIndeterminate: !areAllFieldsChecked && isAtLeastOneFieldChecked,
|
|
1006
1099
|
isChecked: areAllFieldsChecked,
|
|
1007
1100
|
onChange: e => {
|
|
1008
|
-
|
|
1009
|
-
|
|
1101
|
+
var _context17;
|
|
1102
|
+
formik.setFieldValue('customFields', _mapInstanceProperty__default["default"](_context17 = _valuesInstanceProperty__default["default"](formik).customFields).call(_context17, _customType => {
|
|
1103
|
+
var _context18;
|
|
1010
1104
|
return _customType.type.key === customType.type.key ? _objectSpread$1(_objectSpread$1({}, _customType), {}, {
|
|
1011
|
-
fields: _mapInstanceProperty__default["default"](
|
|
1105
|
+
fields: _mapInstanceProperty__default["default"](_context18 = _customType.fields).call(_context18, field => _objectSpread$1(_objectSpread$1({}, field), {}, {
|
|
1012
1106
|
isChecked: e.target.checked
|
|
1013
1107
|
}))
|
|
1014
1108
|
}) : _customType;
|
|
@@ -1021,13 +1115,14 @@ const CustomFieldsSelection = _ref6 => {
|
|
|
1021
1115
|
scale: "l",
|
|
1022
1116
|
children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
1023
1117
|
scale: "s",
|
|
1024
|
-
children: _mapInstanceProperty__default["default"](
|
|
1118
|
+
children: _mapInstanceProperty__default["default"](_context19 = customType.fields).call(_context19, field => jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1025
1119
|
isChecked: field.isChecked,
|
|
1026
1120
|
onChange: e => {
|
|
1027
|
-
|
|
1028
|
-
|
|
1121
|
+
var _context20;
|
|
1122
|
+
formik.setFieldValue('customFields', _mapInstanceProperty__default["default"](_context20 = _valuesInstanceProperty__default["default"](formik).customFields).call(_context20, _customType => {
|
|
1123
|
+
var _context21;
|
|
1029
1124
|
return _customType.type.key === customType.type.key ? _objectSpread$1(_objectSpread$1({}, _customType), {}, {
|
|
1030
|
-
fields: _mapInstanceProperty__default["default"](
|
|
1125
|
+
fields: _mapInstanceProperty__default["default"](_context21 = _customType.fields).call(_context21, _field => _field.name === field.name ? _objectSpread$1(_objectSpread$1({}, _field), {}, {
|
|
1031
1126
|
isChecked: e.target.checked
|
|
1032
1127
|
}) : _field)
|
|
1033
1128
|
}) : _customType;
|