@configuratorware/configurator-admingui 1.56.2 → 1.56.4
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
|
@@ -8,7 +8,7 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
var _i18n = require("../../App/i18n");
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
var
|
|
11
|
+
var _AutoComplete = _interopRequireWildcard(require("../../UIComponents/AutoComplete"));
|
|
12
12
|
var _InlineAddButton = require("./InlineAddButton");
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -16,29 +16,31 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
16
16
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
17
17
|
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); } }
|
|
18
18
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
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
|
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; }
|
|
27
27
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
28
28
|
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); }
|
|
29
29
|
var AutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
_inherits(AutoComplete, _React$Component);
|
|
31
|
+
var _super = _createSuper(AutoComplete);
|
|
30
32
|
function AutoComplete() {
|
|
31
33
|
var _this;
|
|
32
34
|
_classCallCheck(this, AutoComplete);
|
|
33
35
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
34
36
|
args[_key] = arguments[_key];
|
|
35
37
|
}
|
|
36
|
-
_this =
|
|
37
|
-
_defineProperty(_this, "element", /*#__PURE__*/_react["default"].createRef());
|
|
38
|
-
_defineProperty(_this, "state", {
|
|
38
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "element", /*#__PURE__*/_react["default"].createRef());
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
39
41
|
searchText: ''
|
|
40
42
|
});
|
|
41
|
-
_defineProperty(_this, "onUpdateInput", function (searchText) {
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "onUpdateInput", function (searchText) {
|
|
42
44
|
if (_lodash["default"].isString(searchText)) {
|
|
43
45
|
_this.setState({
|
|
44
46
|
searchText: searchText
|
|
@@ -75,7 +77,7 @@ var AutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
});
|
|
78
|
-
_defineProperty(_this, "onNewRequest", function (chosenRequest) {
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "onNewRequest", function (chosenRequest) {
|
|
79
81
|
var _this$props3 = _this.props,
|
|
80
82
|
pick = _this$props3.pick,
|
|
81
83
|
onChangePick = _this$props3.onChangePick,
|
|
@@ -87,7 +89,7 @@ var AutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
87
89
|
onChange(name, _this.mapSelectedData(chosenRequest));
|
|
88
90
|
}
|
|
89
91
|
});
|
|
90
|
-
_defineProperty(_this, "onBlur", function () {
|
|
92
|
+
_defineProperty(_assertThisInitialized(_this), "onBlur", function () {
|
|
91
93
|
// when the text is removed, trigger the change event with null value
|
|
92
94
|
if (!_this.state.searchText && _this.props.value) {
|
|
93
95
|
var _this$props4 = _this.props,
|
|
@@ -98,14 +100,13 @@ var AutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
98
100
|
var onBlur = _this.props.onBlur;
|
|
99
101
|
onBlur && onBlur();
|
|
100
102
|
});
|
|
101
|
-
_defineProperty(_this, "onFocus", function () {
|
|
103
|
+
_defineProperty(_assertThisInitialized(_this), "onFocus", function () {
|
|
102
104
|
var onFocus = _this.props.onFocus;
|
|
103
105
|
onFocus && onFocus();
|
|
104
106
|
});
|
|
105
107
|
return _this;
|
|
106
108
|
}
|
|
107
|
-
|
|
108
|
-
return _createClass(AutoComplete, [{
|
|
109
|
+
_createClass(AutoComplete, [{
|
|
109
110
|
key: "componentDidMount",
|
|
110
111
|
value: function componentDidMount() {
|
|
111
112
|
this.initSearchText(this.props.value);
|
|
@@ -204,7 +205,7 @@ var AutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
204
205
|
error = _this$props7.error;
|
|
205
206
|
var onBlur = this.onBlur,
|
|
206
207
|
onFocus = this.onFocus;
|
|
207
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
208
|
+
return /*#__PURE__*/_react["default"].createElement(_AutoComplete["default"], {
|
|
208
209
|
ref: this.element,
|
|
209
210
|
floatingLabelText: label,
|
|
210
211
|
dataSource: source,
|
|
@@ -217,15 +218,16 @@ var AutoComplete = /*#__PURE__*/function (_React$Component) {
|
|
|
217
218
|
maxSearchResults: maxSearchResults,
|
|
218
219
|
onFocus: onFocus,
|
|
219
220
|
onBlur: onBlur,
|
|
220
|
-
filter: autoLoad === false ?
|
|
221
|
+
filter: autoLoad === false ? _AutoComplete.Filters.defaultFilter : _AutoComplete.Filters.fuzzyFilter,
|
|
221
222
|
placeholder: placeholder && (0, _i18n.t)(placeholder),
|
|
222
223
|
error: error
|
|
223
224
|
});
|
|
224
225
|
}
|
|
225
226
|
}]);
|
|
227
|
+
return AutoComplete;
|
|
226
228
|
}(_react["default"].Component);
|
|
227
229
|
_defineProperty(AutoComplete, "propTypes", {
|
|
228
|
-
sourceConfig:
|
|
230
|
+
sourceConfig: _AutoComplete.propTypes.dataSourceConfig,
|
|
229
231
|
value: _propTypes["default"].string,
|
|
230
232
|
getSearchText: _propTypes["default"].func,
|
|
231
233
|
source: _propTypes["default"].array,
|
|
@@ -18,25 +18,27 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
19
|
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); } }
|
|
20
20
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
-
function
|
|
21
|
+
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); }
|
|
22
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
23
|
+
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); }; }
|
|
22
24
|
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); }
|
|
23
25
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
24
26
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
27
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
26
|
-
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); }
|
|
27
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
28
28
|
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; }
|
|
29
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
30
30
|
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); }
|
|
31
31
|
var AutocompleteEntity = /*#__PURE__*/function (_React$Component) {
|
|
32
|
+
_inherits(AutocompleteEntity, _React$Component);
|
|
33
|
+
var _super = _createSuper(AutocompleteEntity);
|
|
32
34
|
function AutocompleteEntity() {
|
|
33
35
|
var _this;
|
|
34
36
|
_classCallCheck(this, AutocompleteEntity);
|
|
35
37
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
36
38
|
args[_key] = arguments[_key];
|
|
37
39
|
}
|
|
38
|
-
_this =
|
|
39
|
-
_defineProperty(_this, "state", {
|
|
40
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
41
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
40
42
|
searchText: ''
|
|
41
43
|
});
|
|
42
44
|
/**
|
|
@@ -44,7 +46,7 @@ var AutocompleteEntity = /*#__PURE__*/function (_React$Component) {
|
|
|
44
46
|
* @param chosenRequest
|
|
45
47
|
* @param index
|
|
46
48
|
*/
|
|
47
|
-
_defineProperty(_this, "onNewRequest", function (chosenRequest, index) {
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "onNewRequest", function (chosenRequest, index) {
|
|
48
50
|
if (chosenRequest !== null && index !== -1) {
|
|
49
51
|
_this.props.loadEntity(chosenRequest);
|
|
50
52
|
}
|
|
@@ -54,7 +56,7 @@ var AutocompleteEntity = /*#__PURE__*/function (_React$Component) {
|
|
|
54
56
|
* otherwise acts like a text field and triggers the onChange event
|
|
55
57
|
* @param searchText
|
|
56
58
|
*/
|
|
57
|
-
_defineProperty(_this, "onUpdateInput", function (searchText) {
|
|
59
|
+
_defineProperty(_assertThisInitialized(_this), "onUpdateInput", function (searchText) {
|
|
58
60
|
_this.loaded = false;
|
|
59
61
|
if (_lodash["default"].isString(searchText)) {
|
|
60
62
|
_this.setState({
|
|
@@ -77,7 +79,7 @@ var AutocompleteEntity = /*#__PURE__*/function (_React$Component) {
|
|
|
77
79
|
onChange(name, searchText);
|
|
78
80
|
}
|
|
79
81
|
});
|
|
80
|
-
_defineProperty(_this, "reloadSource", _lodash["default"].debounce(function (query) {
|
|
82
|
+
_defineProperty(_assertThisInitialized(_this), "reloadSource", _lodash["default"].debounce(function (query) {
|
|
81
83
|
if (!_this.props.autoLoad) {
|
|
82
84
|
var params = {
|
|
83
85
|
query: query
|
|
@@ -88,7 +90,7 @@ var AutocompleteEntity = /*#__PURE__*/function (_React$Component) {
|
|
|
88
90
|
_this.props.loadSource(params);
|
|
89
91
|
}
|
|
90
92
|
}, 300));
|
|
91
|
-
_defineProperty(_this, "waitIfLoading", function (fn) {
|
|
93
|
+
_defineProperty(_assertThisInitialized(_this), "waitIfLoading", function (fn) {
|
|
92
94
|
if (_this.props.loading) {
|
|
93
95
|
_this.onListLoaded = fn;
|
|
94
96
|
} else {
|
|
@@ -99,27 +101,26 @@ var AutocompleteEntity = /*#__PURE__*/function (_React$Component) {
|
|
|
99
101
|
* Act like a text field, triggers the change event with the new value
|
|
100
102
|
* @param e
|
|
101
103
|
*/
|
|
102
|
-
_defineProperty(_this, "onBlur", function () {
|
|
104
|
+
_defineProperty(_assertThisInitialized(_this), "onBlur", function () {
|
|
103
105
|
_this.waitIfLoading(function (props) {
|
|
104
106
|
_this.handle(props);
|
|
105
107
|
});
|
|
106
108
|
});
|
|
107
|
-
_defineProperty(_this, "onKeyDown", function (e) {
|
|
109
|
+
_defineProperty(_assertThisInitialized(_this), "onKeyDown", function (e) {
|
|
108
110
|
if (e.keyCode === 9 || e.keyCode === 13) {
|
|
109
111
|
_this.waitIfLoading(function (props) {
|
|
110
112
|
_this.handle(props);
|
|
111
113
|
});
|
|
112
114
|
}
|
|
113
115
|
});
|
|
114
|
-
_defineProperty(_this, "onClose", function () {
|
|
116
|
+
_defineProperty(_assertThisInitialized(_this), "onClose", function () {
|
|
115
117
|
_this.waitIfLoading(function (props) {
|
|
116
118
|
_this.handle(props);
|
|
117
119
|
});
|
|
118
120
|
});
|
|
119
121
|
return _this;
|
|
120
122
|
}
|
|
121
|
-
|
|
122
|
-
return _createClass(AutocompleteEntity, [{
|
|
123
|
+
_createClass(AutocompleteEntity, [{
|
|
123
124
|
key: "componentDidMount",
|
|
124
125
|
value: function componentDidMount() {
|
|
125
126
|
this.setState({
|
|
@@ -193,6 +194,7 @@ var AutocompleteEntity = /*#__PURE__*/function (_React$Component) {
|
|
|
193
194
|
});
|
|
194
195
|
}
|
|
195
196
|
}]);
|
|
197
|
+
return AutocompleteEntity;
|
|
196
198
|
}(_react["default"].Component);
|
|
197
199
|
_defineProperty(AutocompleteEntity, "propTypes", {
|
|
198
200
|
sourceConfig: _AutoComplete.propTypes.dataSourceConfig,
|
|
@@ -13,36 +13,37 @@ var _i18n = require("../../App/i18n");
|
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
15
15
|
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); }
|
|
16
|
-
function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); }
|
|
17
16
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
18
17
|
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); } }
|
|
19
18
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
20
|
-
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); }; }
|
|
21
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); }
|
|
22
23
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
23
24
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
25
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
25
|
-
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); }
|
|
26
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
27
26
|
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; }
|
|
28
27
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
29
28
|
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); }
|
|
30
29
|
var Chip = /*#__PURE__*/function (_React$Component) {
|
|
30
|
+
_inherits(Chip, _React$Component);
|
|
31
|
+
var _super = _createSuper(Chip);
|
|
31
32
|
function Chip() {
|
|
32
33
|
var _this;
|
|
33
34
|
_classCallCheck(this, Chip);
|
|
34
35
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
35
36
|
args[_key] = arguments[_key];
|
|
36
37
|
}
|
|
37
|
-
_this =
|
|
38
|
-
_defineProperty(_this, "state", {
|
|
38
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
39
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
39
40
|
placeholder: ''
|
|
40
41
|
});
|
|
41
|
-
_defineProperty(_this, "loadSourceDebounced", _lodash["default"].debounce(_this.loadSource, 300));
|
|
42
|
-
_defineProperty(_this, "onUpdateInput", function (query) {
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "loadSourceDebounced", _lodash["default"].debounce(_this.loadSource, 300));
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "onUpdateInput", function (query) {
|
|
43
44
|
_this.loadSourceDebounced(query);
|
|
44
45
|
});
|
|
45
|
-
_defineProperty(_this, "onRequestAdd", function (chip) {
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "onRequestAdd", function (chip) {
|
|
46
47
|
var _this$props = _this.props,
|
|
47
48
|
name = _this$props.name,
|
|
48
49
|
source = _this$props.source,
|
|
@@ -72,7 +73,7 @@ var Chip = /*#__PURE__*/function (_React$Component) {
|
|
|
72
73
|
items.push(item);
|
|
73
74
|
onChange(name, items);
|
|
74
75
|
});
|
|
75
|
-
_defineProperty(_this, "onRequestDelete", function (text, idx) {
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "onRequestDelete", function (text, idx) {
|
|
76
77
|
var _this$props2 = _this.props,
|
|
77
78
|
name = _this$props2.name,
|
|
78
79
|
onChange = _this$props2.onChange,
|
|
@@ -83,7 +84,7 @@ var Chip = /*#__PURE__*/function (_React$Component) {
|
|
|
83
84
|
onChange(name, items);
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
|
-
_defineProperty(_this, "onFocus", function (evt) {
|
|
87
|
+
_defineProperty(_assertThisInitialized(_this), "onFocus", function (evt) {
|
|
87
88
|
_this.loadInitialSource();
|
|
88
89
|
var _this$props3 = _this.props,
|
|
89
90
|
onFocus = _this$props3.onFocus,
|
|
@@ -93,7 +94,7 @@ var Chip = /*#__PURE__*/function (_React$Component) {
|
|
|
93
94
|
});
|
|
94
95
|
onFocus && onFocus(evt);
|
|
95
96
|
});
|
|
96
|
-
_defineProperty(_this, "onBlur", function (evt) {
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "onBlur", function (evt) {
|
|
97
98
|
var _this$props4 = _this.props,
|
|
98
99
|
placeholder = _this$props4.placeholder,
|
|
99
100
|
onBlur = _this$props4.onBlur;
|
|
@@ -104,8 +105,7 @@ var Chip = /*#__PURE__*/function (_React$Component) {
|
|
|
104
105
|
});
|
|
105
106
|
return _this;
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
-
return _createClass(Chip, [{
|
|
108
|
+
_createClass(Chip, [{
|
|
109
109
|
key: "loadInitialSource",
|
|
110
110
|
value: function loadInitialSource() {
|
|
111
111
|
var _this$props5 = this.props,
|
|
@@ -183,6 +183,7 @@ var Chip = /*#__PURE__*/function (_React$Component) {
|
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
}]);
|
|
186
|
+
return Chip;
|
|
186
187
|
}(_react["default"].Component);
|
|
187
188
|
_defineProperty(Chip, "propTypes", {
|
|
188
189
|
sourceConfig: _ChipInput.propTypes.dataSourceConfig
|
|
@@ -18,26 +18,28 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
19
|
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); } }
|
|
20
20
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
-
function
|
|
21
|
+
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); }
|
|
22
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
23
|
+
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); }; }
|
|
22
24
|
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); }
|
|
23
25
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
24
26
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
25
27
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
26
|
-
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); }
|
|
27
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
28
28
|
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; }
|
|
29
29
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
30
30
|
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); }
|
|
31
31
|
var dynSourceInput = function dynSourceInput(InputComponent) {
|
|
32
32
|
var DynSourceInput = /*#__PURE__*/function (_React$Component) {
|
|
33
|
+
_inherits(DynSourceInput, _React$Component);
|
|
34
|
+
var _super = _createSuper(DynSourceInput);
|
|
33
35
|
function DynSourceInput() {
|
|
34
36
|
var _this;
|
|
35
37
|
_classCallCheck(this, DynSourceInput);
|
|
36
38
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
39
|
args[_key] = arguments[_key];
|
|
38
40
|
}
|
|
39
|
-
_this =
|
|
40
|
-
_defineProperty(_this, "loadSource", function (params) {
|
|
41
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "loadSource", function (params) {
|
|
41
43
|
var _this$props = _this.props,
|
|
42
44
|
loadSource = _this$props.loadSource,
|
|
43
45
|
locale = _this$props.locale,
|
|
@@ -54,8 +56,7 @@ var dynSourceInput = function dynSourceInput(InputComponent) {
|
|
|
54
56
|
});
|
|
55
57
|
return _this;
|
|
56
58
|
}
|
|
57
|
-
|
|
58
|
-
return _createClass(DynSourceInput, [{
|
|
59
|
+
_createClass(DynSourceInput, [{
|
|
59
60
|
key: "componentWillMount",
|
|
60
61
|
value: function componentWillMount() {
|
|
61
62
|
var dynSource = this.props.dynSource;
|
|
@@ -96,6 +97,7 @@ var dynSourceInput = function dynSourceInput(InputComponent) {
|
|
|
96
97
|
})) : /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(InputComponent, props));
|
|
97
98
|
}
|
|
98
99
|
}]);
|
|
100
|
+
return DynSourceInput;
|
|
99
101
|
}(_react["default"].Component);
|
|
100
102
|
_defineProperty(DynSourceInput, "defaultProps", {
|
|
101
103
|
listKey: '',
|
|
@@ -98,7 +98,7 @@ var getFilenameFromPath = function getFilenameFromPath(path) {
|
|
|
98
98
|
var getPreviewImagePath = function getPreviewImagePath(path) {
|
|
99
99
|
return path ? _network["default"].basePath.replace(/\/$/, '') + path : '';
|
|
100
100
|
};
|
|
101
|
-
var
|
|
101
|
+
var File = function File(props) {
|
|
102
102
|
var _props$isPreviewRequi = props.isPreviewRequired,
|
|
103
103
|
isPreviewRequired = _props$isPreviewRequi === void 0 ? false : _props$isPreviewRequi,
|
|
104
104
|
_props$deleteEnabled = props.deleteEnabled,
|
|
@@ -158,7 +158,7 @@ var _File = function File(props) {
|
|
|
158
158
|
ref: dropZone
|
|
159
159
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
160
160
|
className: classes.uploader
|
|
161
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _i18n.T)(props.dropZoneLabel), props.dropZoneLabel ===
|
|
161
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, (0, _i18n.T)(props.dropZoneLabel), props.dropZoneLabel === File.defaultProps.dropZoneLabel && props.accept), /*#__PURE__*/_react["default"].createElement(_RaisedButton["default"], {
|
|
162
162
|
className: classes.button
|
|
163
163
|
}, /*#__PURE__*/_react["default"].createElement("span", null, /*#__PURE__*/_react["default"].createElement(_FolderIcon["default"], {
|
|
164
164
|
className: classes.folderIcon
|
|
@@ -200,7 +200,7 @@ var _File = function File(props) {
|
|
|
200
200
|
className: classes.warningText
|
|
201
201
|
}, props.warningMessage)));
|
|
202
202
|
};
|
|
203
|
-
|
|
203
|
+
File.defaultProps = {
|
|
204
204
|
onChange: function onChange() {},
|
|
205
205
|
isPreviewRequired: false,
|
|
206
206
|
deleteEnabled: false,
|
|
@@ -210,4 +210,4 @@ _File.defaultProps = {
|
|
|
210
210
|
dropZoneLabel: 'dragDropFile',
|
|
211
211
|
uploadButtonLabel: 'Upload file'
|
|
212
212
|
};
|
|
213
|
-
var _default = exports["default"] = (0, _styles.withStyles)(styles)(
|
|
213
|
+
var _default = exports["default"] = (0, _styles.withStyles)(styles)(File);
|
|
@@ -19,13 +19,13 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
20
|
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); } }
|
|
21
21
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
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
|
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; }
|
|
30
30
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
31
31
|
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); }
|
|
@@ -63,32 +63,34 @@ var withAddButton = exports.withAddButton = function withAddButton(Component) {
|
|
|
63
63
|
// map dispatch to props
|
|
64
64
|
function () {
|
|
65
65
|
return {};
|
|
66
|
-
})(/*#__PURE__*/function (_React$Component) {
|
|
66
|
+
})( /*#__PURE__*/function (_React$Component) {
|
|
67
|
+
_inherits(InlineAddWrapper, _React$Component);
|
|
68
|
+
var _super = _createSuper(InlineAddWrapper);
|
|
67
69
|
function InlineAddWrapper() {
|
|
68
70
|
var _this;
|
|
69
71
|
_classCallCheck(this, InlineAddWrapper);
|
|
70
72
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
71
73
|
args[_key] = arguments[_key];
|
|
72
74
|
}
|
|
73
|
-
_this =
|
|
74
|
-
_defineProperty(_this, "state", {
|
|
75
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
76
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
75
77
|
showAddButton: false
|
|
76
78
|
});
|
|
77
|
-
_defineProperty(_this, "onFocus", function () {
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "onFocus", function () {
|
|
78
80
|
if (_this.props.addButton && (realEmpty(_this.props.value) || _this.props.addButton.multiple)) {
|
|
79
81
|
_this.setState({
|
|
80
82
|
showAddButton: true
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
|
-
_defineProperty(_this, "onBlur", function () {
|
|
86
|
+
_defineProperty(_assertThisInitialized(_this), "onBlur", function () {
|
|
85
87
|
if (_this.state.showAddButton) {
|
|
86
88
|
_this.setState({
|
|
87
89
|
showAddButton: false
|
|
88
90
|
});
|
|
89
91
|
}
|
|
90
92
|
});
|
|
91
|
-
_defineProperty(_this, "onChange", function (name, value) {
|
|
93
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (name, value) {
|
|
92
94
|
var onChange = _this.props.onChange;
|
|
93
95
|
onChange(name, value);
|
|
94
96
|
if (_this.props.addButton && (realEmpty(value) || _this.props.addButton.multiple)) {
|
|
@@ -97,7 +99,7 @@ var withAddButton = exports.withAddButton = function withAddButton(Component) {
|
|
|
97
99
|
});
|
|
98
100
|
}
|
|
99
101
|
});
|
|
100
|
-
_defineProperty(_this, "onAddAction", function () {
|
|
102
|
+
_defineProperty(_assertThisInitialized(_this), "onAddAction", function () {
|
|
101
103
|
var _this$props = _this.props,
|
|
102
104
|
onAction = _this$props.onAction,
|
|
103
105
|
addButton = _this$props.addButton;
|
|
@@ -112,8 +114,7 @@ var withAddButton = exports.withAddButton = function withAddButton(Component) {
|
|
|
112
114
|
});
|
|
113
115
|
return _this;
|
|
114
116
|
}
|
|
115
|
-
|
|
116
|
-
return _createClass(InlineAddWrapper, [{
|
|
117
|
+
_createClass(InlineAddWrapper, [{
|
|
117
118
|
key: "componentWillReceiveProps",
|
|
118
119
|
value: function componentWillReceiveProps(props) {
|
|
119
120
|
if (props.selectData && props.selectData.ready && props.selectData !== this.props.selectData) {
|
|
@@ -156,5 +157,6 @@ var withAddButton = exports.withAddButton = function withAddButton(Component) {
|
|
|
156
157
|
}));
|
|
157
158
|
}
|
|
158
159
|
}]);
|
|
160
|
+
return InlineAddWrapper;
|
|
159
161
|
}(_react["default"].Component));
|
|
160
162
|
};
|
|
@@ -22,31 +22,33 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
22
22
|
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
23
23
|
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); } }
|
|
24
24
|
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
25
|
-
function
|
|
25
|
+
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); }
|
|
26
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
27
|
+
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); }; }
|
|
26
28
|
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); }
|
|
27
29
|
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
28
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
29
31
|
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
30
|
-
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); }
|
|
31
|
-
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
32
32
|
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; }
|
|
33
33
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
34
34
|
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); }
|
|
35
35
|
var InputArray = /*#__PURE__*/function (_Component) {
|
|
36
|
+
_inherits(InputArray, _Component);
|
|
37
|
+
var _super = _createSuper(InputArray);
|
|
36
38
|
function InputArray(props) {
|
|
37
39
|
var _this;
|
|
38
40
|
_classCallCheck(this, InputArray);
|
|
39
|
-
_this =
|
|
40
|
-
_defineProperty(_this, "validatorCallback", function () {
|
|
41
|
+
_this = _super.call(this, props);
|
|
42
|
+
_defineProperty(_assertThisInitialized(_this), "validatorCallback", function () {
|
|
41
43
|
if (_this.state.showEditor) {
|
|
42
44
|
return _this.setData();
|
|
43
45
|
}
|
|
44
46
|
return true;
|
|
45
47
|
});
|
|
46
|
-
_defineProperty(_this, "onRowSelection", function (rows) {
|
|
48
|
+
_defineProperty(_assertThisInitialized(_this), "onRowSelection", function (rows) {
|
|
47
49
|
var schema = _this.props.schema;
|
|
48
50
|
schema.reset({
|
|
49
|
-
active: rows.length !== 0 && _this
|
|
51
|
+
active: rows.length !== 0 && _assertThisInitialized(_this)
|
|
50
52
|
});
|
|
51
53
|
if (rows.length !== 0) {
|
|
52
54
|
var selectedRow = rows[0];
|
|
@@ -63,7 +65,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
});
|
|
66
|
-
_defineProperty(_this, "setData", function () {
|
|
68
|
+
_defineProperty(_assertThisInitialized(_this), "setData", function () {
|
|
67
69
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
68
70
|
var _options$updateOnly = options.updateOnly,
|
|
69
71
|
updateOnly = _options$updateOnly === void 0 ? false : _options$updateOnly;
|
|
@@ -116,7 +118,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
116
118
|
}
|
|
117
119
|
return false;
|
|
118
120
|
});
|
|
119
|
-
_defineProperty(_this, "onCancel", function () {
|
|
121
|
+
_defineProperty(_assertThisInitialized(_this), "onCancel", function () {
|
|
120
122
|
var schema = _this.props.schema;
|
|
121
123
|
schema.reset();
|
|
122
124
|
_this.setState({
|
|
@@ -126,7 +128,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
126
128
|
validationErrors: false
|
|
127
129
|
});
|
|
128
130
|
});
|
|
129
|
-
_defineProperty(_this, "onDelete", function (row) {
|
|
131
|
+
_defineProperty(_assertThisInitialized(_this), "onDelete", function (row) {
|
|
130
132
|
var _this$props2 = _this.props,
|
|
131
133
|
name = _this$props2.name,
|
|
132
134
|
value = _this$props2.value;
|
|
@@ -140,7 +142,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
140
142
|
validationErrors: false
|
|
141
143
|
});
|
|
142
144
|
});
|
|
143
|
-
_defineProperty(_this, "addNewItem", function () {
|
|
145
|
+
_defineProperty(_assertThisInitialized(_this), "addNewItem", function () {
|
|
144
146
|
if (_this.state.showEditor) {
|
|
145
147
|
if (!_this.setData()) {
|
|
146
148
|
return;
|
|
@@ -148,7 +150,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
148
150
|
}
|
|
149
151
|
var schema = _this.props.schema;
|
|
150
152
|
schema.reset({
|
|
151
|
-
active: _this
|
|
153
|
+
active: _assertThisInitialized(_this)
|
|
152
154
|
});
|
|
153
155
|
_this.setState(function (state) {
|
|
154
156
|
return {
|
|
@@ -158,7 +160,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
158
160
|
};
|
|
159
161
|
});
|
|
160
162
|
});
|
|
161
|
-
_defineProperty(_this, "renderAddButton", function () {
|
|
163
|
+
_defineProperty(_assertThisInitialized(_this), "renderAddButton", function () {
|
|
162
164
|
var addButtonLabel = _this.props.array.addButtonLabel || 'Add';
|
|
163
165
|
var label = _lodash["default"].isString(addButtonLabel) ? (0, _i18n.T)(addButtonLabel) : addButtonLabel;
|
|
164
166
|
return !_this.isAddingDisabled() && /*#__PURE__*/_react["default"].createElement(_RaisedButton["default"], {
|
|
@@ -167,7 +169,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
167
169
|
color: "secondary"
|
|
168
170
|
}, /*#__PURE__*/_react["default"].createElement(_AddIcon["default"], null), label);
|
|
169
171
|
});
|
|
170
|
-
_defineProperty(_this, "renderCancelButton", function () {
|
|
172
|
+
_defineProperty(_assertThisInitialized(_this), "renderCancelButton", function () {
|
|
171
173
|
var addMode = _this.state.selectedRow === false;
|
|
172
174
|
if (addMode && _this.state.showEditor) {
|
|
173
175
|
return /*#__PURE__*/_react["default"].createElement(_RaisedButton["default"], {
|
|
@@ -185,8 +187,7 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
185
187
|
};
|
|
186
188
|
return _this;
|
|
187
189
|
}
|
|
188
|
-
|
|
189
|
-
return _createClass(InputArray, [{
|
|
190
|
+
_createClass(InputArray, [{
|
|
190
191
|
key: "componentWillMount",
|
|
191
192
|
value: function componentWillMount() {
|
|
192
193
|
var _this2 = this;
|
|
@@ -291,5 +292,6 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
291
292
|
}, this.renderAddButton())));
|
|
292
293
|
}
|
|
293
294
|
}]);
|
|
295
|
+
return InputArray;
|
|
294
296
|
}(_react.Component);
|
|
295
297
|
var _default = exports["default"] = (0, _NestedDataComponent["default"])((0, _ValidatorCallbackProvider.withValidatorCallbackContext)(InputArray));
|