@configuratorware/configurator-admingui 1.56.2 → 1.56.5
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/App/Api.js +12 -8
- package/App/Config/app.js +3 -3
- package/App/Data.js +11 -9
- package/App/ErrorBoundary.js +9 -7
- package/App/Main.js +11 -9
- package/App/Reducers/Api/Actions.js +1 -0
- package/App/Reducers/Entity/Actions.js +4 -4
- package/App/Services/WindowCommunication.js +2 -1
- package/App/TestHelpers.js +13 -9
- package/App/i18n.js +3 -3
- package/App/index.js +8 -6
- package/App/initServices.js +4 -2
- package/Components/CallToActionField.js +30 -19
- package/Components/CopyPaste.js +10 -8
- package/Components/DefaultForm.js +8 -6
- package/Components/DefaultList.js +20 -17
- package/Components/DefaultScreen.js +9 -7
- package/Components/Form.js +15 -12
- package/Components/FormFragments/AttributeValueChip.js +17 -16
- package/Components/FormFragments/AutoComplete.js +18 -16
- package/Components/FormFragments/AutocompleteEntity.js +16 -14
- package/Components/FormFragments/Chip.js +15 -14
- package/Components/FormFragments/DynSourceInput.js +9 -7
- package/Components/FormFragments/File.js +4 -4
- package/Components/FormFragments/InlineAddButton.js +14 -12
- package/Components/FormFragments/InputArray.js +18 -16
- package/Components/FormFragments/IntlInput.js +17 -13
- package/Components/FormFragments/NestedDataComponent.js +15 -13
- package/Components/FormFragments/SetInput.js +10 -8
- package/Components/FormFragments/SimpleNestedData.js +8 -6
- package/Components/FormFragments/SimpleTable.js +13 -11
- package/Components/FormFragments/Tabs.js +15 -13
- package/Components/FormFragments/TwoSideSelect.js +17 -13
- package/Components/GeneralFragments/ConfigurationEditor.js +35 -24
- package/Components/GeneralFragments/ConfiguratorOverlay.js +8 -6
- package/Components/GeneralFragments/Image.js +10 -8
- package/Components/GeneralFragments/MiniPopup.js +11 -9
- package/Components/LicenseInfo.js +8 -6
- package/Components/List.js +17 -15
- package/Components/ListColumnFilter.js +15 -13
- package/Components/Menu.js +11 -9
- package/Components/ModalContainer.js +9 -7
- package/Components/OrderList.js +14 -12
- package/Components/Pagination.js +14 -12
- package/Components/SearchBar.js +11 -9
- package/Components/TranslateComponent.js +14 -11
- package/Screens/ApiKeys/Containers/Edit.js +26 -15
- package/Screens/Attribute/__tests/AttributeScreen.js +1 -1
- package/Screens/AttributeValue/__tests/AttributeValueScreen.js +1 -1
- package/Screens/Channel/__tests/ChannelScreen.js +1 -1
- package/Screens/ColorPalettes/Components/DefaultColorSwitch.js +9 -7
- package/Screens/ColorPalettes/Reducers/Reducer.js +1 -0
- package/Screens/ConfigurationTypeEditor/Screen.js +8 -6
- package/Screens/ConfigurationWorkflowStatus/Containers/List.js +14 -10
- package/Screens/ConfigurationWorkflowStatus/Screen.js +8 -6
- package/Screens/Creator/Components/BaseConfigurationEditor.js +15 -11
- package/Screens/Creator/Components/CheckData/ApiCalls.js +17 -6
- package/Screens/Creator/Components/CheckData/CheckData.js +39 -30
- package/Screens/Creator/Components/CheckData/Translations.js +5 -5
- package/Screens/Creator/Components/ComponentEditor.js +27 -19
- package/Screens/Creator/Components/OptionclassificationEditor.js +49 -39
- package/Screens/Creator/Components/Rules/Containers/Edit.js +17 -12
- package/Screens/Creator/Components/Rules/Containers/RuleForms/AdditionalOption.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/AttributeValueGroupAutoSwitch.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/DefaultOption.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/ItemAttributeMatch.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/ItemAttributeMaxSum.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionClassificationMaxAmount.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionClassificationMinAmount.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionDependency.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionExclusion.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/OptionMaxAmount.js +8 -6
- package/Screens/Creator/Components/Rules/Containers/RuleForms/RuleForm.js +9 -7
- package/Screens/Creator/Components/Rules/index.js +8 -6
- package/Screens/Creator/Components/VisualizationAndMediaData/ApiCalls.js +18 -7
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/ImageEditTools.js +75 -64
- package/Screens/Creator/Components/VisualizationAndMediaData/Components/PathStructure.js +1 -1
- package/Screens/Creator/Components/VisualizationAndMediaData/VisualizationAndMediaData.js +181 -164
- package/Screens/Creator/Containers/Edit.js +19 -15
- package/Screens/Creator/Reducers/ConfigurationActions.js +49 -39
- package/Screens/Demo/Screen.js +10 -8
- package/Screens/Designer/Components/DesignDataTransfer.js +67 -54
- package/Screens/Designer/Components/TemplateDefaultList.js +27 -25
- package/Screens/Designer/Components/TemplateList.js +14 -12
- package/Screens/Designer/Containers/Edit.js +37 -26
- package/Screens/Designer/SubScreens/DesignAreas/Components/ColorPalettes.js +22 -18
- package/Screens/Designer/SubScreens/DesignAreas/Components/FormArray.js +15 -13
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/MaskEditorCanvas.js +27 -19
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/MaskEditorField.js +25 -17
- package/Screens/Designer/SubScreens/DesignAreas/Components/MaskEditorField/withFileUpload.js +27 -19
- package/Screens/Designer/SubScreens/DesignAreas/Containers/FormProductionMethods.js +20 -18
- package/Screens/Designer/SubScreens/DesignAreas/Utils/getMaskSrcByType.js +2 -1
- package/Screens/Designer/SubScreens/Designviews/Reducers/Actions.js +19 -8
- package/Screens/Designer/SubScreens/Visualization/ApiCalls.js +28 -14
- package/Screens/Designer/SubScreens/Visualization/Components/AreaEditor.js +58 -44
- package/Screens/Designer/SubScreens/Visualization/Components/ExpansionContainer.js +9 -7
- package/Screens/Designer/SubScreens/Visualization/Components/Three2DEditor.js +83 -62
- package/Screens/Designer/SubScreens/Visualization/Components/VisualizationContainer.js +10 -8
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/Edit.js +116 -99
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/VisualizationUtils.js +29 -21
- package/Screens/Designer/SubScreens/Visualization/Containers/List.js +8 -6
- package/Screens/Finder/Reducers/Actions.js +22 -13
- package/Screens/Font/Reducers/Actions.js +4 -3
- package/Screens/ImageGallery/Containers/Edit.js +8 -6
- package/Screens/ImageGallery/Containers/List.js +36 -23
- package/Screens/ImageGallery/ImageTags/TagsEditorPopup.js +8 -6
- package/Screens/ImageGallery/Reducers/Actions.js +1 -0
- package/Screens/Inspirations/Reducers/Actions.js +18 -7
- package/Screens/Item/ApiCalls.js +19 -8
- package/Screens/Item/Components/AttributeEditorPopup.js +8 -6
- package/Screens/Item/Components/CopyCreatorItemDialog.js +26 -15
- package/Screens/Item/Components/ExportCreatorItemDialog.js +26 -15
- package/Screens/Item/Components/Images/ItemImageUploadDialog.js +31 -22
- package/Screens/Item/Components/ImportItemDialog.js +29 -21
- package/Screens/Item/Components/ListItemStatusEditor.js +25 -14
- package/Screens/Item/Components/Variants/VariantsAutocomplete.js +64 -53
- package/Screens/Item/Components/Variants/VariantsEditor.js +28 -26
- package/Screens/Item/Components/Variants/VariantsEditorDialog.js +8 -6
- package/Screens/Item/Components/Variants/VariantsEditorPopup.js +24 -14
- package/Screens/Item/Components/Variants/VariantsSelection.js +13 -11
- package/Screens/Item/Components/Variants/VariantsSortFilter.js +18 -16
- package/Screens/Item/Containers/Edit.js +31 -21
- package/Screens/Item/DataStructures/Prices/ActionHelpers.js +4 -4
- package/Screens/Login/Screen.js +15 -12
- package/Screens/Login/__tests/LoginScreen.js +2 -2
- package/Screens/ProductionView/Components/ConfigurationDataSheet.js +8 -6
- package/Screens/ProductionView/Containers/List.js +11 -8
- package/Screens/ReceiveOfferRequests/Components/ConfigurationDataSheet.js +8 -6
- package/Screens/ReceiveOfferRequests/Containers/List.js +8 -6
- package/Screens/Savedconfigurations/Components/ConfigurationDataSheet.js +8 -6
- package/Screens/Savedconfigurations/Containers/List.js +15 -10
- package/Screens/Setting/Containers/Edit.js +8 -6
- package/Screens/TranslationFileHandling/Containers/Edit.js +57 -45
- package/Screens/User/__tests/UserScreen.js +1 -1
- package/UIComponents/AutoComplete.js +12 -10
- package/UIComponents/ChipInput.js +14 -12
- package/UIComponents/IconMenu.js +12 -10
- package/UIComponents/InlineHelp/index.js +8 -6
- package/UIComponents/Pagination.js +12 -10
- package/UIComponents/SelectField.js +8 -6
- package/UIComponents/Table/Table.js +15 -13
- package/UIComponents/Table/TableBody.js +8 -6
- package/UIComponents/Table/TableHead.js +8 -6
- package/UIComponents/Table/TableRow.js +8 -6
- package/Utils/Async/Deferred.js +4 -2
- package/Utils/Async/newestRequest.js +23 -14
- package/Utils/Decorators/Observable.js +2 -1
- package/Utils/FunDraw/createMask.js +17 -7
- package/Utils/FunDraw/funDraw.js +71 -54
- package/Utils/FunDraw/movableObject.js +21 -12
- package/Utils/HOCs/AsyncProps.js +24 -16
- package/Utils/HOCs/LocalState.js +11 -9
- package/Utils/Request/lazyFetch.js +46 -38
- package/default.js +1 -1
- package/dev.js +1 -1
- package/package.json +3 -3
package/App/Api.js
CHANGED
|
@@ -10,13 +10,13 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
10
10
|
var _network = _interopRequireDefault(require("./Config/network"));
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
12
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
13
|
-
function
|
|
13
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
14
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
15
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
14
16
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
15
17
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
18
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
19
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
18
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
19
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
20
20
|
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; }
|
|
21
21
|
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; }
|
|
22
22
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -53,7 +53,7 @@ var Api = exports.Api = /*#__PURE__*/function () {
|
|
|
53
53
|
function Api() {
|
|
54
54
|
_classCallCheck(this, Api);
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
_createClass(Api, null, [{
|
|
57
57
|
key: "request",
|
|
58
58
|
value:
|
|
59
59
|
/**
|
|
@@ -132,6 +132,7 @@ var Api = exports.Api = /*#__PURE__*/function () {
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}]);
|
|
135
|
+
return Api;
|
|
135
136
|
}();
|
|
136
137
|
/**
|
|
137
138
|
* A simple function to match a Cancel error
|
|
@@ -160,7 +161,7 @@ var ObjectFormData = exports.ObjectFormData = /*#__PURE__*/function () {
|
|
|
160
161
|
});
|
|
161
162
|
return data;
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
+
_createClass(ObjectFormData, null, [{
|
|
164
165
|
key: "getSource",
|
|
165
166
|
value: function getSource(formData) {
|
|
166
167
|
if (!(formData instanceof FormData)) {
|
|
@@ -172,6 +173,7 @@ var ObjectFormData = exports.ObjectFormData = /*#__PURE__*/function () {
|
|
|
172
173
|
throw new Error('No source stored for FormData!');
|
|
173
174
|
}
|
|
174
175
|
}]);
|
|
176
|
+
return ObjectFormData;
|
|
175
177
|
}();
|
|
176
178
|
/**
|
|
177
179
|
* Simulating Api calls by returning a single promise
|
|
@@ -179,12 +181,13 @@ var ObjectFormData = exports.ObjectFormData = /*#__PURE__*/function () {
|
|
|
179
181
|
* - the requsetMappings must be populated first by calling addRequestMapping()
|
|
180
182
|
*/
|
|
181
183
|
var ApiSimulator = exports.ApiSimulator = /*#__PURE__*/function (_Api) {
|
|
184
|
+
_inherits(ApiSimulator, _Api);
|
|
185
|
+
var _super = _createSuper(ApiSimulator);
|
|
182
186
|
function ApiSimulator() {
|
|
183
187
|
_classCallCheck(this, ApiSimulator);
|
|
184
|
-
return
|
|
188
|
+
return _super.apply(this, arguments);
|
|
185
189
|
}
|
|
186
|
-
|
|
187
|
-
return _createClass(ApiSimulator, null, [{
|
|
190
|
+
_createClass(ApiSimulator, null, [{
|
|
188
191
|
key: "addRequestMapping",
|
|
189
192
|
value:
|
|
190
193
|
/**
|
|
@@ -237,6 +240,7 @@ var ApiSimulator = exports.ApiSimulator = /*#__PURE__*/function (_Api) {
|
|
|
237
240
|
Api.request = ApiSimulator.request;
|
|
238
241
|
}
|
|
239
242
|
}]);
|
|
243
|
+
return ApiSimulator;
|
|
240
244
|
}(Api);
|
|
241
245
|
_defineProperty(ApiSimulator, "requestMappings", []);
|
|
242
246
|
var _default = exports["default"] = Api;
|
package/App/Config/app.js
CHANGED
|
@@ -16,11 +16,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
16
16
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
17
17
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
18
18
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
19
|
-
var
|
|
19
|
+
var flattenFeatures = function flattenFeatures(featuresRoot) {
|
|
20
20
|
var features = [];
|
|
21
21
|
featuresRoot.forEach(function (feature) {
|
|
22
22
|
if (feature.items instanceof Array) {
|
|
23
|
-
var sub =
|
|
23
|
+
var sub = flattenFeatures(feature.items);
|
|
24
24
|
for (var si = 0; si < sub.length; si++) {
|
|
25
25
|
features.push(sub[si]);
|
|
26
26
|
}
|
|
@@ -32,7 +32,7 @@ var _flattenFeatures = function flattenFeatures(featuresRoot) {
|
|
|
32
32
|
return features;
|
|
33
33
|
};
|
|
34
34
|
var getFlattenedFeatures = exports.getFlattenedFeatures = function getFlattenedFeatures() {
|
|
35
|
-
return
|
|
35
|
+
return flattenFeatures(config.features);
|
|
36
36
|
};
|
|
37
37
|
var isFeatureAvailable = exports.isFeatureAvailable = function isFeatureAvailable(featureName) {
|
|
38
38
|
var ff = getFlattenedFeatures();
|
package/App/Data.js
CHANGED
|
@@ -95,7 +95,7 @@ var Data = exports["default"] = /*#__PURE__*/function () {
|
|
|
95
95
|
this.init(dataObject, mutate);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
_createClass(Data, [{
|
|
99
99
|
key: "value",
|
|
100
100
|
get: function get() {
|
|
101
101
|
return this.getData();
|
|
@@ -285,6 +285,7 @@ var Data = exports["default"] = /*#__PURE__*/function () {
|
|
|
285
285
|
return data;
|
|
286
286
|
}
|
|
287
287
|
}]);
|
|
288
|
+
return Data;
|
|
288
289
|
}();
|
|
289
290
|
_defineProperty(Data, "EventTypes", {
|
|
290
291
|
init: 'init',
|
|
@@ -301,7 +302,7 @@ var DataValidator = exports.DataValidator = /*#__PURE__*/function () {
|
|
|
301
302
|
_classCallCheck(this, DataValidator);
|
|
302
303
|
this.setDataObject(dataObject, mutate);
|
|
303
304
|
}
|
|
304
|
-
|
|
305
|
+
_createClass(DataValidator, [{
|
|
305
306
|
key: "setDataObject",
|
|
306
307
|
value: function setDataObject(dataObject) {
|
|
307
308
|
var mutate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
@@ -334,7 +335,7 @@ var DataValidator = exports.DataValidator = /*#__PURE__*/function () {
|
|
|
334
335
|
var valueObject = options.valueObject,
|
|
335
336
|
idx = options.idx,
|
|
336
337
|
dataArr = options.dataArr;
|
|
337
|
-
isValid =
|
|
338
|
+
isValid = validateDataObject(this._data, valueObject, idx, dataArr, options) && isValid;
|
|
338
339
|
this._validation.isDone = true;
|
|
339
340
|
return isValid;
|
|
340
341
|
}
|
|
@@ -352,9 +353,10 @@ var DataValidator = exports.DataValidator = /*#__PURE__*/function () {
|
|
|
352
353
|
if (!this._validation.isDone) {
|
|
353
354
|
this.validate();
|
|
354
355
|
}
|
|
355
|
-
return
|
|
356
|
+
return getErrorsFromValidatedDataObject(this._data);
|
|
356
357
|
}
|
|
357
358
|
}]);
|
|
359
|
+
return DataValidator;
|
|
358
360
|
}();
|
|
359
361
|
var prepareConstraints = function prepareConstraints() {
|
|
360
362
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -401,7 +403,7 @@ var validateField = function validateField(prop, valueToValidate, idx, dataArr,
|
|
|
401
403
|
}
|
|
402
404
|
return valid;
|
|
403
405
|
};
|
|
404
|
-
var
|
|
406
|
+
var validateDataObject = exports.validateDataObject = function validateDataObject(dataObject, valueObject, idx, dataArr, validationOptions) {
|
|
405
407
|
var valid = true;
|
|
406
408
|
var _loop2 = function _loop2() {
|
|
407
409
|
var prop = dataObject[p];
|
|
@@ -418,12 +420,12 @@ var _validateDataObject = exports.validateDataObject = function validateDataObje
|
|
|
418
420
|
if (prop.schema) {
|
|
419
421
|
if (_lodash["default"].isArray(prop.value)) {
|
|
420
422
|
prop.value.forEach(function (value, idx) {
|
|
421
|
-
valid =
|
|
423
|
+
valid = validateDataObject(prop.schema, value, idx, prop.value, validationOptions) && valid;
|
|
422
424
|
});
|
|
423
425
|
} else if (prop.value === null) {
|
|
424
426
|
// skip validation, if the value is null
|
|
425
427
|
} else {
|
|
426
|
-
valid =
|
|
428
|
+
valid = validateDataObject(prop.schema, prop.value, null, null, validationOptions) && valid;
|
|
427
429
|
}
|
|
428
430
|
}
|
|
429
431
|
};
|
|
@@ -432,7 +434,7 @@ var _validateDataObject = exports.validateDataObject = function validateDataObje
|
|
|
432
434
|
}
|
|
433
435
|
return valid;
|
|
434
436
|
};
|
|
435
|
-
var
|
|
437
|
+
var getErrorsFromValidatedDataObject = exports.getErrorsFromValidatedDataObject = function getErrorsFromValidatedDataObject(dataObject) {
|
|
436
438
|
var errors = [];
|
|
437
439
|
for (var p in dataObject) {
|
|
438
440
|
var prop = dataObject[p];
|
|
@@ -443,7 +445,7 @@ var _getErrorsFromValidatedDataObject = exports.getErrorsFromValidatedDataObject
|
|
|
443
445
|
});
|
|
444
446
|
}
|
|
445
447
|
if (prop.schema) {
|
|
446
|
-
errors = errors.concat(
|
|
448
|
+
errors = errors.concat(getErrorsFromValidatedDataObject(prop.schema));
|
|
447
449
|
}
|
|
448
450
|
}
|
|
449
451
|
return errors;
|
package/App/ErrorBoundary.js
CHANGED
|
@@ -10,13 +10,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
10
10
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
11
11
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
12
12
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
13
|
-
function
|
|
13
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
14
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
15
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
14
16
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
15
17
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
16
18
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
19
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
18
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
19
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
20
20
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
21
21
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
22
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -46,11 +46,13 @@ var styles = {
|
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
48
|
var ErrorBoundary = exports["default"] = /*#__PURE__*/function (_React$Component) {
|
|
49
|
+
_inherits(ErrorBoundary, _React$Component);
|
|
50
|
+
var _super = _createSuper(ErrorBoundary);
|
|
49
51
|
function ErrorBoundary(props) {
|
|
50
52
|
var _this;
|
|
51
53
|
_classCallCheck(this, ErrorBoundary);
|
|
52
|
-
_this =
|
|
53
|
-
_defineProperty(_this, "reload", function () {
|
|
54
|
+
_this = _super.call(this, props);
|
|
55
|
+
_defineProperty(_assertThisInitialized(_this), "reload", function () {
|
|
54
56
|
location.reload();
|
|
55
57
|
});
|
|
56
58
|
_this.state = {
|
|
@@ -60,8 +62,7 @@ var ErrorBoundary = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
60
62
|
};
|
|
61
63
|
return _this;
|
|
62
64
|
}
|
|
63
|
-
|
|
64
|
-
return _createClass(ErrorBoundary, [{
|
|
65
|
+
_createClass(ErrorBoundary, [{
|
|
65
66
|
key: "componentDidCatch",
|
|
66
67
|
value: function componentDidCatch(error, info) {
|
|
67
68
|
this.setState({
|
|
@@ -96,4 +97,5 @@ var ErrorBoundary = exports["default"] = /*#__PURE__*/function (_React$Component
|
|
|
96
97
|
return this.props.children;
|
|
97
98
|
}
|
|
98
99
|
}]);
|
|
100
|
+
return ErrorBoundary;
|
|
99
101
|
}(_react["default"].Component);
|
package/App/Main.js
CHANGED
|
@@ -34,13 +34,13 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
34
34
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
35
35
|
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
36
36
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
37
|
-
function
|
|
37
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
38
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
39
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
38
40
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
39
41
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
40
42
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
41
43
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
42
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
43
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
44
44
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
45
45
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
46
46
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -72,21 +72,23 @@ var RightButtons = (0, _withStyles["default"])(styles)(function (_ref) {
|
|
|
72
72
|
* - renders the main content in a wrapper
|
|
73
73
|
*/
|
|
74
74
|
var Main = /*#__PURE__*/function (_Component) {
|
|
75
|
+
_inherits(Main, _Component);
|
|
76
|
+
var _super = _createSuper(Main);
|
|
75
77
|
function Main(props) {
|
|
76
78
|
var _this;
|
|
77
79
|
_classCallCheck(this, Main);
|
|
78
|
-
_this =
|
|
79
|
-
_defineProperty(_this, "handleClose", function () {
|
|
80
|
+
_this = _super.call(this, props);
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "handleClose", function () {
|
|
80
82
|
return _this.setState({
|
|
81
83
|
open: false
|
|
82
84
|
});
|
|
83
85
|
});
|
|
84
|
-
_defineProperty(_this, "handleToggle", function () {
|
|
86
|
+
_defineProperty(_assertThisInitialized(_this), "handleToggle", function () {
|
|
85
87
|
return _this.setState({
|
|
86
88
|
open: !_this.state.open
|
|
87
89
|
});
|
|
88
90
|
});
|
|
89
|
-
_defineProperty(_this, "goHome", function () {
|
|
91
|
+
_defineProperty(_assertThisInitialized(_this), "goHome", function () {
|
|
90
92
|
return _reactRouter.browserHistory.push(window.basePath);
|
|
91
93
|
});
|
|
92
94
|
_this.state = {
|
|
@@ -96,8 +98,7 @@ var Main = /*#__PURE__*/function (_Component) {
|
|
|
96
98
|
};
|
|
97
99
|
return _this;
|
|
98
100
|
}
|
|
99
|
-
|
|
100
|
-
return _createClass(Main, [{
|
|
101
|
+
_createClass(Main, [{
|
|
101
102
|
key: "componentDidMount",
|
|
102
103
|
value: function componentDidMount() {
|
|
103
104
|
if (process.env.NODE_ENV === 'production') {
|
|
@@ -270,5 +271,6 @@ var Main = /*#__PURE__*/function (_Component) {
|
|
|
270
271
|
}, this.props.children));
|
|
271
272
|
}
|
|
272
273
|
}]);
|
|
274
|
+
return Main;
|
|
273
275
|
}(_react.Component);
|
|
274
276
|
var _default = exports["default"] = Main;
|
|
@@ -139,6 +139,7 @@ var shouldFetchData = function shouldFetchData(state, key, source) {
|
|
|
139
139
|
}
|
|
140
140
|
return true; // reload is ok for now (otherwise if something changes must reload the page)
|
|
141
141
|
};
|
|
142
|
+
|
|
142
143
|
var fetchDataIfNeeded = exports.fetchDataIfNeeded = function fetchDataIfNeeded(source, key) {
|
|
143
144
|
return function (dispatch, getState) {
|
|
144
145
|
var state = getState();
|
|
@@ -259,7 +259,7 @@ var generateDefaultActions = exports.generateDefaultActions = function generateD
|
|
|
259
259
|
errors: errors
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
|
-
var
|
|
262
|
+
var apiStateHandler = function apiStateHandler(apiAction) {
|
|
263
263
|
var hideDetailsAfterSave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
264
264
|
return function (dispatch, getState) {
|
|
265
265
|
switch (apiAction && apiAction.type) {
|
|
@@ -286,7 +286,7 @@ var generateDefaultActions = exports.generateDefaultActions = function generateD
|
|
|
286
286
|
// the data should be re-fetched in the original way to make sure it is correct
|
|
287
287
|
// (since the response for the post request can contain the previous version)
|
|
288
288
|
source.source && (0, _Helpers.dispatchFetchData)(dispatch)(dataKey, source.source).then(function (result) {
|
|
289
|
-
dispatch(
|
|
289
|
+
dispatch(apiStateHandler(result));
|
|
290
290
|
});
|
|
291
291
|
} else if (hideDetailsAfterSave) {
|
|
292
292
|
dispatch(releaseUnsavedEntity());
|
|
@@ -382,7 +382,7 @@ var generateDefaultActions = exports.generateDefaultActions = function generateD
|
|
|
382
382
|
dispatch(mountNext(true));
|
|
383
383
|
var detailsURL = ctx.getDetailsURL instanceof Function ? ctx.getDetailsURL(params, url) : url + '/' + params.id;
|
|
384
384
|
return Promise.all([(0, _Helpers.dispatchFetchData)(dispatch)(dataKey, detailsURL), dispatch(loadDependencies())]).then(function (results) {
|
|
385
|
-
var success = dispatch(
|
|
385
|
+
var success = dispatch(apiStateHandler(results[0]));
|
|
386
386
|
if (success && results && results[0] && results[0].type !== _Actions.NETWORK_ERROR) {
|
|
387
387
|
showDetailsWhenLoaded && dispatch(showDetails(true));
|
|
388
388
|
} else if (!results || !results[0]) {
|
|
@@ -454,7 +454,7 @@ var generateDefaultActions = exports.generateDefaultActions = function generateD
|
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
p.then(function (s) {
|
|
457
|
-
return dispatch(
|
|
457
|
+
return dispatch(apiStateHandler(s, hideDetails));
|
|
458
458
|
});
|
|
459
459
|
return p;
|
|
460
460
|
};
|
|
@@ -42,7 +42,7 @@ var WindowCommunication = exports["default"] = /*#__PURE__*/function () {
|
|
|
42
42
|
});
|
|
43
43
|
window.addEventListener('message', this.receiveMessage, false);
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
_createClass(WindowCommunication, [{
|
|
46
46
|
key: "addMessageListener",
|
|
47
47
|
value: function addMessageListener(method, callback) {
|
|
48
48
|
this.listeners.push({
|
|
@@ -52,4 +52,5 @@ var WindowCommunication = exports["default"] = /*#__PURE__*/function () {
|
|
|
52
52
|
return this;
|
|
53
53
|
}
|
|
54
54
|
}]);
|
|
55
|
+
return WindowCommunication;
|
|
55
56
|
}();
|
package/App/TestHelpers.js
CHANGED
|
@@ -16,13 +16,13 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
16
16
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
17
17
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
18
18
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
-
function
|
|
19
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
20
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
21
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
20
22
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
21
23
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
22
24
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23
25
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
24
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
25
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
26
26
|
var theme = (0, _styles.createMuiTheme)({
|
|
27
27
|
palette: {
|
|
28
28
|
primary: _blue["default"]
|
|
@@ -30,12 +30,13 @@ var theme = (0, _styles.createMuiTheme)({
|
|
|
30
30
|
});
|
|
31
31
|
var withThemeProvider = exports.withThemeProvider = function withThemeProvider(TestComponent) {
|
|
32
32
|
var Test = /*#__PURE__*/function (_React$Component) {
|
|
33
|
+
_inherits(Test, _React$Component);
|
|
34
|
+
var _super = _createSuper(Test);
|
|
33
35
|
function Test() {
|
|
34
36
|
_classCallCheck(this, Test);
|
|
35
|
-
return
|
|
37
|
+
return _super.apply(this, arguments);
|
|
36
38
|
}
|
|
37
|
-
|
|
38
|
-
return _createClass(Test, [{
|
|
39
|
+
_createClass(Test, [{
|
|
39
40
|
key: "render",
|
|
40
41
|
value: function render() {
|
|
41
42
|
return /*#__PURE__*/_react["default"].createElement(_styles.MuiThemeProvider, {
|
|
@@ -43,6 +44,7 @@ var withThemeProvider = exports.withThemeProvider = function withThemeProvider(T
|
|
|
43
44
|
}, /*#__PURE__*/_react["default"].createElement(TestComponent, null));
|
|
44
45
|
}
|
|
45
46
|
}]);
|
|
47
|
+
return Test;
|
|
46
48
|
}(_react["default"].Component);
|
|
47
49
|
return Test;
|
|
48
50
|
};
|
|
@@ -50,12 +52,13 @@ var _configureStore = (0, _Store.configureStore)(),
|
|
|
50
52
|
store = exports.store = _configureStore.store;
|
|
51
53
|
var withStoreProvider = exports.withStoreProvider = function withStoreProvider(TestComponent) {
|
|
52
54
|
var Test = /*#__PURE__*/function (_React$Component2) {
|
|
55
|
+
_inherits(Test, _React$Component2);
|
|
56
|
+
var _super2 = _createSuper(Test);
|
|
53
57
|
function Test() {
|
|
54
58
|
_classCallCheck(this, Test);
|
|
55
|
-
return
|
|
59
|
+
return _super2.apply(this, arguments);
|
|
56
60
|
}
|
|
57
|
-
|
|
58
|
-
return _createClass(Test, [{
|
|
61
|
+
_createClass(Test, [{
|
|
59
62
|
key: "render",
|
|
60
63
|
value: function render() {
|
|
61
64
|
return /*#__PURE__*/_react["default"].createElement(_reactRedux.Provider, {
|
|
@@ -63,6 +66,7 @@ var withStoreProvider = exports.withStoreProvider = function withStoreProvider(T
|
|
|
63
66
|
}, /*#__PURE__*/_react["default"].createElement(TestComponent, null));
|
|
64
67
|
}
|
|
65
68
|
}]);
|
|
69
|
+
return Test;
|
|
66
70
|
}(_react["default"].Component);
|
|
67
71
|
return Test;
|
|
68
72
|
};
|
package/App/i18n.js
CHANGED
|
@@ -150,13 +150,13 @@ var getLocale = exports.getLocale = function getLocale() {
|
|
|
150
150
|
* @return {*}
|
|
151
151
|
* @constructor
|
|
152
152
|
*/
|
|
153
|
-
var
|
|
153
|
+
var T = exports.T = function T(value) {
|
|
154
154
|
var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
155
155
|
if (_typeof(value) === 'object' && typeof value.children === 'string') {
|
|
156
156
|
var _value = value,
|
|
157
157
|
children = _value.children,
|
|
158
158
|
_otherProps = _objectWithoutProperties(_value, _excluded);
|
|
159
|
-
return
|
|
159
|
+
return T(children, _otherProps);
|
|
160
160
|
}
|
|
161
161
|
var escapeDot = props.escapeDot,
|
|
162
162
|
interpolate = props.interpolate,
|
|
@@ -171,7 +171,7 @@ var _T = exports.T = function T(value) {
|
|
|
171
171
|
if (parts.length > 1) {
|
|
172
172
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, parts.map(function (str) {
|
|
173
173
|
var key = str.replace(/^{([^}]+)}$/, '$1');
|
|
174
|
-
return key === str ? str :
|
|
174
|
+
return key === str ? str : T(key, props);
|
|
175
175
|
}));
|
|
176
176
|
}
|
|
177
177
|
}
|
package/App/index.js
CHANGED
|
@@ -19,20 +19,21 @@ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o =
|
|
|
19
19
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
20
20
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
21
21
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
22
|
-
function
|
|
22
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
23
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
24
|
+
function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
|
|
23
25
|
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
24
26
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
25
27
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
26
28
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
27
|
-
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
28
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
29
29
|
var App = exports.App = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
_inherits(App, _React$Component);
|
|
31
|
+
var _super = _createSuper(App);
|
|
30
32
|
function App() {
|
|
31
33
|
_classCallCheck(this, App);
|
|
32
|
-
return
|
|
34
|
+
return _super.apply(this, arguments);
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
return _createClass(App, [{
|
|
36
|
+
_createClass(App, [{
|
|
36
37
|
key: "render",
|
|
37
38
|
value: function render() {
|
|
38
39
|
var _this$props = this.props,
|
|
@@ -47,5 +48,6 @@ var App = exports.App = /*#__PURE__*/function (_React$Component) {
|
|
|
47
48
|
}, children)));
|
|
48
49
|
}
|
|
49
50
|
}]);
|
|
51
|
+
return App;
|
|
50
52
|
}(_react["default"].Component);
|
|
51
53
|
var _default = exports["default"] = App;
|
package/App/initServices.js
CHANGED
|
@@ -20,7 +20,7 @@ var ServiceStore = exports.ServiceStore = /*#__PURE__*/function () {
|
|
|
20
20
|
function ServiceStore() {
|
|
21
21
|
_classCallCheck(this, ServiceStore);
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
_createClass(ServiceStore, null, [{
|
|
24
24
|
key: "get",
|
|
25
25
|
value: function get(serviceName) {
|
|
26
26
|
if (serviceName in ServiceStore.repository) {
|
|
@@ -37,6 +37,7 @@ var ServiceStore = exports.ServiceStore = /*#__PURE__*/function () {
|
|
|
37
37
|
ServiceStore.repository[serviceName] = instance;
|
|
38
38
|
}
|
|
39
39
|
}]);
|
|
40
|
+
return ServiceStore;
|
|
40
41
|
}();
|
|
41
42
|
_defineProperty(ServiceStore, "services", _objectSpread({}, _Services["default"]));
|
|
42
43
|
_defineProperty(ServiceStore, "repository", {});
|
|
@@ -53,12 +54,13 @@ var ReduxStoreService = /*#__PURE__*/function () {
|
|
|
53
54
|
});
|
|
54
55
|
this.reduxStore = reduxStore;
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
+
_createClass(ReduxStoreService, [{
|
|
57
58
|
key: "state",
|
|
58
59
|
get: function get() {
|
|
59
60
|
return this.reduxStore.getState();
|
|
60
61
|
}
|
|
61
62
|
}]);
|
|
63
|
+
return ReduxStoreService;
|
|
62
64
|
}();
|
|
63
65
|
var initReduxStoreService = exports.initReduxStoreService = (0, _lodash.once)(function (reduxStore) {
|
|
64
66
|
ServiceStore.addServiceInstance('ReduxStore', new ReduxStoreService(reduxStore));
|