@configuratorware/configurator-admingui 1.38.7 → 1.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Components/Form.js +3 -0
- package/Components/FormFragments/AttributeValueChip.js +262 -0
- package/Components/FormFragments/InputArray.js +6 -4
- package/Components/FormFragments/InputWithSource.js +14 -2
- package/Components/FormFragments/Select.js +5 -3
- package/Components/FormFragments/index.js +9 -0
- package/Components/LocalizedPriceTextField.js +6 -4
- package/Components/LocalizedPriceValue.js +1 -1
- package/Screens/Attribute/Containers/Edit.js +7 -0
- package/Screens/Attribute/Reducers/Reducer.js +4 -1
- package/Screens/Attribute/Translations.js +6 -2
- package/Screens/Client/Containers/Edit.js +4 -0
- package/Screens/Client/Reducers/Reducer.js +3 -0
- package/Screens/Client/Translations.js +1 -0
- package/Screens/CurrentClient/Containers/Edit.js +4 -0
- package/Screens/CurrentClient/Reducers/Reducer.js +3 -0
- package/Screens/DefaultClient/Containers/Edit.js +4 -0
- package/Screens/DefaultClient/Reducers/Reducer.js +3 -0
- package/Screens/Designer/SubScreens/Visualization/Containers/Edit/Edit.js +17 -10
- package/Screens/ImageGallery/Containers/Edit.js +59 -0
- package/Screens/ImageGallery/Reducers/Reducer.js +36 -2
- package/Screens/Item/DataStructures/Attributes/Editor.js +3 -4
- package/Screens/Item/Translations.js +4 -2
- package/Screens/PriceTypes/Containers/Edit.js +36 -10
- package/Screens/PriceTypes/Reducers/Reducer.js +2 -2
- package/Screens/PriceTypes/Translations.js +14 -0
- package/UIComponents/ChipInput.js +29 -3
- package/package.json +3 -3
- package/scripts/cpPublic.js +32 -0
- package/src/Components/Form.js +2 -0
- package/src/Components/FormFragments/AttributeValueChip.js +140 -0
- package/src/Components/FormFragments/InputArray.js +8 -2
- package/src/Components/FormFragments/InputWithSource.js +3 -0
- package/src/Components/FormFragments/Select.js +10 -4
- package/src/Components/FormFragments/index.js +3 -0
- package/src/Components/LocalizedPriceTextField.js +5 -3
- package/src/Components/LocalizedPriceValue.js +5 -3
- package/src/Screens/Attribute/Containers/Edit.js +7 -0
- package/src/Screens/Attribute/Reducers/Reducer.js +1 -0
- package/src/Screens/Attribute/Translations.js +4 -0
- package/src/Screens/Client/Containers/Edit.js +7 -2
- package/src/Screens/Client/Reducers/Reducer.js +1 -0
- package/src/Screens/Client/Translations.js +5 -2
- package/src/Screens/CurrentClient/Containers/Edit.js +9 -4
- package/src/Screens/CurrentClient/Reducers/Reducer.js +1 -0
- package/src/Screens/DefaultClient/Containers/Edit.js +6 -1
- package/src/Screens/DefaultClient/Reducers/Reducer.js +1 -0
- package/src/Screens/Designer/SubScreens/Visualization/Containers/Edit/Edit.js +10 -3
- package/src/Screens/ImageGallery/Containers/Edit.js +46 -1
- package/src/Screens/ImageGallery/Reducers/Reducer.js +18 -1
- package/src/Screens/Item/DataStructures/Attributes/Editor.js +2 -4
- package/src/Screens/Item/Translations.js +5 -1
- package/src/Screens/PriceTypes/Containers/Edit.js +32 -9
- package/src/Screens/PriceTypes/Reducers/Reducer.js +1 -1
- package/src/Screens/PriceTypes/Translations.js +14 -0
- package/src/UIComponents/ChipInput.js +23 -0
- package/scripts/cpFavicon.js +0 -28
package/Components/Form.js
CHANGED
|
@@ -161,6 +161,9 @@ var getInputComponentByType = function getInputComponentByType(type) {
|
|
|
161
161
|
case 'hinttext':
|
|
162
162
|
return _HintText["default"];
|
|
163
163
|
|
|
164
|
+
case 'attributeValueChip':
|
|
165
|
+
return _FormFragments["default"].AttributeValueChip;
|
|
166
|
+
|
|
164
167
|
default:
|
|
165
168
|
return null;
|
|
166
169
|
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports["default"] = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _lodash = require("lodash");
|
|
13
|
+
|
|
14
|
+
var _ChipInput = _interopRequireWildcard(require("../../UIComponents/ChipInput"));
|
|
15
|
+
|
|
16
|
+
var _AutoComplete = require("../../UIComponents/AutoComplete");
|
|
17
|
+
|
|
18
|
+
var _InlineAddButton = require("./InlineAddButton");
|
|
19
|
+
|
|
20
|
+
var _i18n = require("../../App/i18n");
|
|
21
|
+
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
+
|
|
24
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
25
|
+
|
|
26
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
27
|
+
|
|
28
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
+
|
|
30
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
31
|
+
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
33
|
+
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
+
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
+
|
|
38
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
39
|
+
|
|
40
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
41
|
+
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
|
|
44
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
45
|
+
|
|
46
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
+
|
|
48
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
49
|
+
|
|
50
|
+
var AttributeValueChip = /*#__PURE__*/function (_React$Component) {
|
|
51
|
+
_inherits(AttributeValueChip, _React$Component);
|
|
52
|
+
|
|
53
|
+
var _super = _createSuper(AttributeValueChip);
|
|
54
|
+
|
|
55
|
+
function AttributeValueChip() {
|
|
56
|
+
var _this;
|
|
57
|
+
|
|
58
|
+
_classCallCheck(this, AttributeValueChip);
|
|
59
|
+
|
|
60
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
61
|
+
args[_key] = arguments[_key];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
65
|
+
|
|
66
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
67
|
+
placeholder: ''
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
_defineProperty(_assertThisInitialized(_this), "isNumericAttributeType", function () {
|
|
71
|
+
var type = (0, _lodash.get)(_this.props, 'schema._data.attributedatatype.value');
|
|
72
|
+
return type === 'integer' || type === 'number';
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
_defineProperty(_assertThisInitialized(_this), "loadSourceDebounced", (0, _lodash.debounce)(_this.loadSource, 300));
|
|
76
|
+
|
|
77
|
+
_defineProperty(_assertThisInitialized(_this), "onUpdateInput", function (query) {
|
|
78
|
+
_this.loadSourceDebounced(query);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "onRequestAdd", function (chip) {
|
|
82
|
+
var _this$props = _this.props,
|
|
83
|
+
name = _this$props.name,
|
|
84
|
+
source = _this$props.source,
|
|
85
|
+
onChange = _this$props.onChange,
|
|
86
|
+
sourceConfig = _this$props.sourceConfig,
|
|
87
|
+
single = _this$props.single,
|
|
88
|
+
value = _this$props.value;
|
|
89
|
+
|
|
90
|
+
var items = _.cloneDeep(value); // if it already in the values just return
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
if ((0, _lodash.find)(items, _defineProperty({}, sourceConfig.value, chip[sourceConfig.value]))) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var item = (0, _lodash.find)(source, _defineProperty({}, sourceConfig.value, chip[sourceConfig.value]));
|
|
98
|
+
|
|
99
|
+
if (!item) {
|
|
100
|
+
// if not found, use the first which is not in the list
|
|
101
|
+
var diff = (0, _lodash.differenceBy)(source, items, sourceConfig.value);
|
|
102
|
+
|
|
103
|
+
if (diff.length !== 0) {
|
|
104
|
+
item = diff[0];
|
|
105
|
+
} else {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (single) {
|
|
111
|
+
items.splice(0, items.length);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
items.push(item);
|
|
115
|
+
onChange(name, items);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
_defineProperty(_assertThisInitialized(_this), "onRequestDelete", function (text, idx) {
|
|
119
|
+
var _this$props2 = _this.props,
|
|
120
|
+
name = _this$props2.name,
|
|
121
|
+
onChange = _this$props2.onChange,
|
|
122
|
+
value = _this$props2.value;
|
|
123
|
+
var items = (0, _lodash.cloneDeep)(value);
|
|
124
|
+
|
|
125
|
+
if (idx > -1 && idx < items.length) {
|
|
126
|
+
items.splice(idx, 1);
|
|
127
|
+
onChange(name, items);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
_defineProperty(_assertThisInitialized(_this), "onFocus", function (evt) {
|
|
132
|
+
_this.loadInitialSource();
|
|
133
|
+
|
|
134
|
+
var placeholder = (0, _i18n.t)(_this.isNumericAttributeType() ? 'item.attributes.searchOrAddNumbericAttributeValue' : 'item.attributes.searchOrAddAttributeValue');
|
|
135
|
+
|
|
136
|
+
_this.setState({
|
|
137
|
+
placeholder: placeholder
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
var onFocus = _this.props.onFocus;
|
|
141
|
+
onFocus && onFocus(evt);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
_defineProperty(_assertThisInitialized(_this), "onBlur", function (evt) {
|
|
145
|
+
var onBlur = _this.props.onBlur;
|
|
146
|
+
|
|
147
|
+
_this.setState({
|
|
148
|
+
placeholder: null
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
onBlur && onBlur(evt);
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
_defineProperty(_assertThisInitialized(_this), "onInputEnterKey", function (evt) {
|
|
155
|
+
_this.triggerChange({
|
|
156
|
+
id: null,
|
|
157
|
+
value: evt.target.value,
|
|
158
|
+
translated_value: evt.target.value
|
|
159
|
+
});
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
return _this;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
_createClass(AttributeValueChip, [{
|
|
166
|
+
key: "loadInitialSource",
|
|
167
|
+
value: function loadInitialSource() {
|
|
168
|
+
var _this$props3 = this.props,
|
|
169
|
+
initialSourceSize = _this$props3.initialSourceSize,
|
|
170
|
+
loadSource = _this$props3.loadSource;
|
|
171
|
+
|
|
172
|
+
if (initialSourceSize) {
|
|
173
|
+
loadSource({
|
|
174
|
+
limit: initialSourceSize
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}, {
|
|
179
|
+
key: "loadSource",
|
|
180
|
+
value: function loadSource(query) {
|
|
181
|
+
var _this$props4 = this.props,
|
|
182
|
+
autoLoad = _this$props4.autoLoad,
|
|
183
|
+
loadSource = _this$props4.loadSource;
|
|
184
|
+
|
|
185
|
+
if ((0, _lodash.isString)(query) && autoLoad === false) {
|
|
186
|
+
// IMPORTANT: the filter value should be passed in the "query" get param
|
|
187
|
+
loadSource({
|
|
188
|
+
query: query
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}, {
|
|
193
|
+
key: "triggerChange",
|
|
194
|
+
value:
|
|
195
|
+
/**
|
|
196
|
+
* Called by the InlineAddButton, when the data is ready
|
|
197
|
+
* @param chip
|
|
198
|
+
*/
|
|
199
|
+
function triggerChange(chip) {
|
|
200
|
+
// no additional checks needed, just append the new value to the list
|
|
201
|
+
var _this$props5 = this.props,
|
|
202
|
+
name = _this$props5.name,
|
|
203
|
+
onChange = _this$props5.onChange,
|
|
204
|
+
sourceConfig = _this$props5.sourceConfig,
|
|
205
|
+
value = _this$props5.value;
|
|
206
|
+
|
|
207
|
+
var items = _.cloneDeep(value);
|
|
208
|
+
|
|
209
|
+
if ((0, _lodash.find)(items, _defineProperty({}, sourceConfig.value, chip[sourceConfig.value]))) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
items.push(chip);
|
|
214
|
+
onChange(name, items);
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "render",
|
|
218
|
+
value: function render() {
|
|
219
|
+
var _this$props6 = this.props,
|
|
220
|
+
value = _this$props6.value,
|
|
221
|
+
label = _this$props6.label,
|
|
222
|
+
source = _this$props6.source,
|
|
223
|
+
sourceConfig = _this$props6.sourceConfig,
|
|
224
|
+
openOnFocus = _this$props6.openOnFocus,
|
|
225
|
+
autoLoad = _this$props6.autoLoad;
|
|
226
|
+
var placeholder = this.state.placeholder;
|
|
227
|
+
var onRequestAdd = this.onRequestAdd,
|
|
228
|
+
onRequestDelete = this.onRequestDelete,
|
|
229
|
+
onUpdateInput = this.onUpdateInput,
|
|
230
|
+
onBlur = this.onBlur,
|
|
231
|
+
onFocus = this.onFocus,
|
|
232
|
+
onInputEnterKey = this.onInputEnterKey;
|
|
233
|
+
return /*#__PURE__*/_react["default"].createElement(_ChipInput["default"], {
|
|
234
|
+
floatingLabelText: label,
|
|
235
|
+
onBlur: onBlur,
|
|
236
|
+
onFocus: onFocus,
|
|
237
|
+
dataSource: source,
|
|
238
|
+
onInputValueChange: onUpdateInput,
|
|
239
|
+
dataSourceConfig: sourceConfig,
|
|
240
|
+
value: value,
|
|
241
|
+
handleChange: onRequestAdd,
|
|
242
|
+
onRequestDelete: onRequestDelete,
|
|
243
|
+
openOnFocus: openOnFocus,
|
|
244
|
+
filter: autoLoad === false ? _AutoComplete.Filters.defaultFilter : _AutoComplete.Filters.fuzzyFilter,
|
|
245
|
+
onInputEnterKey: onInputEnterKey,
|
|
246
|
+
resetOnInputEnterKey: true,
|
|
247
|
+
textFieldType: 'number',
|
|
248
|
+
placeholder: placeholder
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}]);
|
|
252
|
+
|
|
253
|
+
return AttributeValueChip;
|
|
254
|
+
}(_react["default"].Component);
|
|
255
|
+
|
|
256
|
+
_defineProperty(AttributeValueChip, "propTypes", {
|
|
257
|
+
sourceConfig: _ChipInput.propTypes.dataSourceConfig
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
var _default = (0, _InlineAddButton.withAddButton)(AttributeValueChip);
|
|
261
|
+
|
|
262
|
+
exports["default"] = _default;
|
|
@@ -196,10 +196,12 @@ var InputArray = /*#__PURE__*/function (_Component) {
|
|
|
196
196
|
active: _assertThisInitialized(_this)
|
|
197
197
|
});
|
|
198
198
|
|
|
199
|
-
_this.setState({
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
_this.setState(function (state) {
|
|
200
|
+
return {
|
|
201
|
+
selectedRow: false,
|
|
202
|
+
showEditor: !_this.isAddingDisabled(),
|
|
203
|
+
newItem: !state.newItem
|
|
204
|
+
};
|
|
203
205
|
});
|
|
204
206
|
});
|
|
205
207
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.sourceConfigPropType = exports.getInputItemKeyByConfig = exports.getInputItemParamsByConfig = exports.getInputValueByConfig = void 0;
|
|
6
|
+
exports.nullToValue = exports.valueToNull = exports.sourceConfigPropType = exports.getInputItemKeyByConfig = exports.getInputItemParamsByConfig = exports.getInputValueByConfig = void 0;
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
@@ -65,4 +65,16 @@ var sourceConfigPropType = _propTypes["default"].shape({
|
|
|
65
65
|
value: _propTypes["default"].string.isRequired
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
exports.sourceConfigPropType = sourceConfigPropType;
|
|
68
|
+
exports.sourceConfigPropType = sourceConfigPropType;
|
|
69
|
+
|
|
70
|
+
var valueToNull = function valueToNull(value) {
|
|
71
|
+
return value === 'null' ? null : value;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
exports.valueToNull = valueToNull;
|
|
75
|
+
|
|
76
|
+
var nullToValue = function nullToValue(value) {
|
|
77
|
+
return value === null ? 'null' : value;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
exports.nullToValue = nullToValue;
|
|
@@ -22,7 +22,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
22
22
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23
23
|
|
|
24
24
|
var select = function select(props) {
|
|
25
|
-
var value = (0, _InputWithSource.getInputValueByConfig)(props);
|
|
25
|
+
var value = (0, _InputWithSource.nullToValue)((0, _InputWithSource.getInputValueByConfig)(props));
|
|
26
26
|
return /*#__PURE__*/_react["default"].createElement(_SelectField["default"], {
|
|
27
27
|
style: {
|
|
28
28
|
width: '100%'
|
|
@@ -35,7 +35,7 @@ var select = function select(props) {
|
|
|
35
35
|
var selectedObj = (0, _find2["default"])(props.source, _defineProperty({}, key, event.target.value));
|
|
36
36
|
props.onChange(props.name, selectedObj);
|
|
37
37
|
} else {
|
|
38
|
-
props.onChange(props.name, event.target.value);
|
|
38
|
+
props.onChange(props.name, (0, _InputWithSource.valueToNull)(event.target.value));
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
onFocus: function onFocus() {
|
|
@@ -52,8 +52,10 @@ var select = function select(props) {
|
|
|
52
52
|
value = _getInputItemParamsBy.value,
|
|
53
53
|
text = _getInputItemParamsBy.text;
|
|
54
54
|
|
|
55
|
+
var _value = (0, _InputWithSource.nullToValue)(value);
|
|
56
|
+
|
|
55
57
|
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
56
|
-
value:
|
|
58
|
+
value: _value,
|
|
57
59
|
key: idx
|
|
58
60
|
}, text);
|
|
59
61
|
}));
|
|
@@ -87,6 +87,12 @@ Object.defineProperty(exports, "HintText", {
|
|
|
87
87
|
return _HintText["default"];
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
|
+
Object.defineProperty(exports, "AttributeValueChip", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function get() {
|
|
93
|
+
return _AttributeValueChip["default"];
|
|
94
|
+
}
|
|
95
|
+
});
|
|
90
96
|
exports["default"] = void 0;
|
|
91
97
|
|
|
92
98
|
var _Text = _interopRequireDefault(require("./Text"));
|
|
@@ -117,11 +123,14 @@ var _Value = _interopRequireDefault(require("./Value"));
|
|
|
117
123
|
|
|
118
124
|
var _HintText = _interopRequireDefault(require("./HintText"));
|
|
119
125
|
|
|
126
|
+
var _AttributeValueChip = _interopRequireDefault(require("./AttributeValueChip"));
|
|
127
|
+
|
|
120
128
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
121
129
|
|
|
122
130
|
var _default = {
|
|
123
131
|
Text: _Text["default"],
|
|
124
132
|
AutoComplete: _AutoComplete["default"],
|
|
133
|
+
AttributeValueChip: _AttributeValueChip["default"],
|
|
125
134
|
Select: _Select["default"],
|
|
126
135
|
Checkbox: _Checkbox["default"],
|
|
127
136
|
RadioGroup: _RadioGroup["default"],
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.LocalizedPriceTextField = void 0;
|
|
6
|
+
exports["default"] = exports.LocalizedPriceTextField = void 0;
|
|
7
7
|
|
|
8
8
|
var _reactRedux = require("react-redux");
|
|
9
9
|
|
|
@@ -55,7 +55,7 @@ var LocalizedPriceTextField = function LocalizedPriceTextField(_ref) {
|
|
|
55
55
|
|
|
56
56
|
var onChange = function onChange(name, value) {
|
|
57
57
|
// replace occurrences of (localized) decimal separator
|
|
58
|
-
var localizedValue = value.replace(new RegExp(altSeparator, 'g'), defaultSeparator); // remove all letters etc.
|
|
58
|
+
var localizedValue = "".concat(value).replace(new RegExp(altSeparator, 'g'), defaultSeparator); // remove all letters etc.
|
|
59
59
|
|
|
60
60
|
localizedValue = localizedValue.replace(new RegExp("[^0-9\\".concat(defaultSeparator, "]"), 'g'), ''); // remove all separators but the first one
|
|
61
61
|
|
|
@@ -63,7 +63,7 @@ var LocalizedPriceTextField = function LocalizedPriceTextField(_ref) {
|
|
|
63
63
|
props.onChange(name, localizedValue);
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
var displayValue = localeSeparator === altSeparator ? (value || '').replace(defaultSeparator, localeSeparator) : localeSeparator === defaultSeparator ? (value || '').replace(altSeparator, localeSeparator) : value;
|
|
66
|
+
var displayValue = localeSeparator === altSeparator ? "".concat(value || '').replace(defaultSeparator, localeSeparator) : localeSeparator === defaultSeparator ? "".concat(value || '').replace(altSeparator, localeSeparator) : value;
|
|
67
67
|
return /*#__PURE__*/_react["default"].createElement(_Text["default"], {
|
|
68
68
|
type: "text",
|
|
69
69
|
value: displayValue,
|
|
@@ -80,4 +80,6 @@ var LocalizedPriceTextField = function LocalizedPriceTextField(_ref) {
|
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
-
exports.LocalizedPriceTextField = LocalizedPriceTextField;
|
|
83
|
+
exports.LocalizedPriceTextField = LocalizedPriceTextField;
|
|
84
|
+
var _default = LocalizedPriceTextField;
|
|
85
|
+
exports["default"] = _default;
|
|
@@ -20,7 +20,7 @@ var LocalizedPriceValue = function LocalizedPriceValue(_ref) {
|
|
|
20
20
|
language = _ref.language,
|
|
21
21
|
defaultSeparator = _ref.defaultSeparator;
|
|
22
22
|
var localeSeparator = (0, _get["default"])(decimalSeparators, language, defaultSeparator);
|
|
23
|
-
return data && localeSeparator !== defaultSeparator ? data.replace(defaultSeparator, localeSeparator) : data;
|
|
23
|
+
return data && localeSeparator !== defaultSeparator ? "".concat(data).replace(defaultSeparator, localeSeparator) : data;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
var mapStateToProps = function mapStateToProps(_ref2) {
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _Actions = require("../Reducers/Actions");
|
|
9
9
|
|
|
10
|
+
var _i18n = require("../../../App/i18n");
|
|
11
|
+
|
|
10
12
|
var _DefaultConnectedForm = _interopRequireDefault(require("../../../Components/DefaultConnectedForm"));
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -39,6 +41,11 @@ var formFields = [{
|
|
|
39
41
|
label: 'Attribute data type',
|
|
40
42
|
type: 'select',
|
|
41
43
|
source: ['string', 'integer', 'number', 'boolean', 'text']
|
|
44
|
+
}, {
|
|
45
|
+
name: 'writeProtected',
|
|
46
|
+
label: (0, _i18n.t)('attribute.writeProtected'),
|
|
47
|
+
type: 'checkbox',
|
|
48
|
+
helperText: (0, _i18n.t)('attribute.writeProtectedInfo')
|
|
42
49
|
}];
|
|
43
50
|
|
|
44
51
|
var _default = (0, _DefaultConnectedForm["default"])(formFields, _Actions.ATTRIBUTE_REDUCER_NAME, _Actions.setFieldData, _Actions.postData);
|
|
@@ -31,7 +31,10 @@ var initialState = _objectSpread({}, (0, _Reducer.getDefaultEntityState)({
|
|
|
31
31
|
presence: true
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
|
-
texts: []
|
|
34
|
+
texts: [],
|
|
35
|
+
writeProtected: {
|
|
36
|
+
value: ''
|
|
37
|
+
}
|
|
35
38
|
}, null, _Actions.ATTRIBUTE_DATA_KEY));
|
|
36
39
|
|
|
37
40
|
var attributeData = (0, _FeatureReducers.createFeatureReducer)(_Actions.ATTRIBUTE_REDUCER_NAME, function () {
|
|
@@ -7,7 +7,9 @@ require("../../App/i18n").use({
|
|
|
7
7
|
'Attribute data type': 'Attribute data type',
|
|
8
8
|
Variants: 'Variants',
|
|
9
9
|
attribute: {
|
|
10
|
-
addButtonLabel: 'Add Attribute'
|
|
10
|
+
addButtonLabel: 'Add Attribute',
|
|
11
|
+
writeProtected: 'Write protected',
|
|
12
|
+
writeProtectedInfo: 'Attribute won’t be deleted by the importer'
|
|
11
13
|
}
|
|
12
14
|
},
|
|
13
15
|
de: {
|
|
@@ -16,7 +18,9 @@ require("../../App/i18n").use({
|
|
|
16
18
|
'Attribute data type': 'Attributdatentyp',
|
|
17
19
|
Variants: 'Varianten',
|
|
18
20
|
attribute: {
|
|
19
|
-
addButtonLabel: 'Attribute hinzufügen'
|
|
21
|
+
addButtonLabel: 'Attribute hinzufügen',
|
|
22
|
+
writeProtected: 'Schreibgeschützt',
|
|
23
|
+
writeProtectedInfo: 'Das Attribut wird beim Import nicht gelöscht'
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
}, true);
|
|
@@ -137,6 +137,10 @@ var formFields = [{
|
|
|
137
137
|
label: 'BCC E-Mail(s) receiver for request offer',
|
|
138
138
|
type: 'text',
|
|
139
139
|
helperText: (0, _i18n.t)('emailHint')
|
|
140
|
+
}, {
|
|
141
|
+
name: 'sendOfferRequestMailToCustomer',
|
|
142
|
+
label: 'Send offer request email to customer',
|
|
143
|
+
type: 'checkbox'
|
|
140
144
|
}, {
|
|
141
145
|
type: _CallToActionField.CallToActionField,
|
|
142
146
|
fields: [{
|
|
@@ -36,6 +36,7 @@ require("../../App/i18n").use({
|
|
|
36
36
|
'E-Mail sender for request offer': 'Absender E-Mail für die Angebotsanfrage',
|
|
37
37
|
'CC E-Mail(s) receiver for request offer': 'CC E-Mail(s) für die Angebotsanfrage',
|
|
38
38
|
'BCC E-Mail(s) receiver for request offer': 'BCC E-Mail(s) für die Angebotsanfrage',
|
|
39
|
+
'Send offer request email to customer': 'Angebotsanfrage per E-Mail an den Kunden senden',
|
|
39
40
|
'Client logo': 'Kunden Logo',
|
|
40
41
|
Texts: 'Texte',
|
|
41
42
|
themeColorError: 'Bitte gib einen hexadezimalen Farbwert ein (z.B. #0000ff)',
|
|
@@ -100,6 +100,10 @@ var formFields = [{
|
|
|
100
100
|
label: 'BCC E-Mail(s) receiver for request offer',
|
|
101
101
|
type: 'text',
|
|
102
102
|
helperText: (0, _i18n.t)('emailHint')
|
|
103
|
+
}, {
|
|
104
|
+
name: 'sendOfferRequestMailToCustomer',
|
|
105
|
+
label: 'Send offer request email to customer',
|
|
106
|
+
type: 'checkbox'
|
|
103
107
|
}, {
|
|
104
108
|
type: _CallToActionField.CallToActionField,
|
|
105
109
|
fields: [{
|
|
@@ -98,6 +98,10 @@ var formFields = [{
|
|
|
98
98
|
label: 'BCC E-Mail(s) receiver for request offer',
|
|
99
99
|
type: 'text',
|
|
100
100
|
helperText: (0, _i18n.t)('emailHint')
|
|
101
|
+
}, {
|
|
102
|
+
name: 'sendOfferRequestMailToCustomer',
|
|
103
|
+
label: 'Send offer request email to customer',
|
|
104
|
+
type: 'checkbox'
|
|
101
105
|
}, {
|
|
102
106
|
name: 'callToAction',
|
|
103
107
|
label: 'callToAction.callToAction',
|
|
@@ -120,6 +120,8 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
120
120
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
121
121
|
|
|
122
122
|
var styles = function styles(theme) {
|
|
123
|
+
var _visualizationRoot;
|
|
124
|
+
|
|
123
125
|
var breakPoint = {
|
|
124
126
|
max: "@media screen and (max-width:".concat(1144 + 2 * theme.spacing.unit, "px)")
|
|
125
127
|
};
|
|
@@ -127,7 +129,9 @@ var styles = function styles(theme) {
|
|
|
127
129
|
editorRoot: _defineProperty({
|
|
128
130
|
display: 'flex',
|
|
129
131
|
flexDirection: 'row',
|
|
130
|
-
|
|
132
|
+
'&.fullHeight': {
|
|
133
|
+
height: 'calc(100vh - 180px)'
|
|
134
|
+
},
|
|
131
135
|
'& > $header': _defineProperty({
|
|
132
136
|
display: 'none'
|
|
133
137
|
}, breakPoint.max, {
|
|
@@ -206,13 +210,16 @@ var styles = function styles(theme) {
|
|
|
206
210
|
advancedEditor: {
|
|
207
211
|
maxWidth: 600
|
|
208
212
|
},
|
|
209
|
-
visualizationRoot: {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
visualizationRoot: (_visualizationRoot = {
|
|
214
|
+
display: 'flex',
|
|
215
|
+
flexDirection: 'row'
|
|
216
|
+
}, _defineProperty(_visualizationRoot, breakPoint.max, {
|
|
217
|
+
flexDirection: 'column'
|
|
218
|
+
}), _defineProperty(_visualizationRoot, '& > $leftSide', _defineProperty({
|
|
219
|
+
width: '70%'
|
|
220
|
+
}, breakPoint.max, {
|
|
221
|
+
width: '100%'
|
|
222
|
+
})), _visualizationRoot),
|
|
216
223
|
visualizationContainer: {
|
|
217
224
|
width: '100%',
|
|
218
225
|
height: '39vw'
|
|
@@ -853,7 +860,7 @@ var VisualizationSettingsEdit = /*#__PURE__*/function (_Component) {
|
|
|
853
860
|
|
|
854
861
|
if (isKindOf2D(mode)) {
|
|
855
862
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
856
|
-
className:
|
|
863
|
+
className: classes.visualizationRoot
|
|
857
864
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
858
865
|
className: classes.leftSide
|
|
859
866
|
}, /*#__PURE__*/_react["default"].createElement(_VisualizationContainer["default"], {
|
|
@@ -913,7 +920,7 @@ var VisualizationSettingsEdit = /*#__PURE__*/function (_Component) {
|
|
|
913
920
|
}
|
|
914
921
|
|
|
915
922
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
916
|
-
className: classes.editorRoot
|
|
923
|
+
className: "".concat(classes.editorRoot, " ").concat(isKindOf3D(mode) ? 'fullHeight' : '')
|
|
917
924
|
}, loading && /*#__PURE__*/_react["default"].createElement(LoadingComponent, {
|
|
918
925
|
fullSize: true
|
|
919
926
|
}), isKindOf3D(mode) ? this.renderHeader3D(data) : this.renderHeader(), imageElement && /*#__PURE__*/_react["default"].createElement("div", {
|