@commercetools-uikit/localized-multiline-text-field 16.0.0 → 16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -50,35 +50,24 @@ var LocalizedMultilineTextInput__default = /*#__PURE__*/_interopDefault(Localize
|
|
|
50
50
|
var FieldErrors__default = /*#__PURE__*/_interopDefault(FieldErrors);
|
|
51
51
|
|
|
52
52
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
53
|
-
|
|
54
53
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
55
|
-
|
|
56
54
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
57
|
-
|
|
58
55
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
59
56
|
const sequentialId = utils.createSequentialId('localized-multiline-text-field-');
|
|
60
57
|
const sequentialErrorsId = utils.createSequentialId('localized-multiline-text-field-error-')();
|
|
61
|
-
|
|
62
58
|
const hasErrors = errors => {
|
|
63
59
|
var _context;
|
|
64
|
-
|
|
65
60
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
66
61
|
};
|
|
67
|
-
|
|
68
62
|
let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
69
63
|
_inherits(LocalizedMultilineTextField, _Component);
|
|
70
|
-
|
|
71
64
|
var _super = _createSuper(LocalizedMultilineTextField);
|
|
72
|
-
|
|
73
65
|
function LocalizedMultilineTextField() {
|
|
74
66
|
var _this;
|
|
75
|
-
|
|
76
67
|
_classCallCheck(this, LocalizedMultilineTextField);
|
|
77
|
-
|
|
78
68
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
79
69
|
args[_key] = arguments[_key];
|
|
80
70
|
}
|
|
81
|
-
|
|
82
71
|
_this = _super.call(this, ...args);
|
|
83
72
|
_this.state = {
|
|
84
73
|
// We generate an id in case no id is provided by the parent to attach the
|
|
@@ -87,18 +76,15 @@ let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
87
76
|
};
|
|
88
77
|
return _this;
|
|
89
78
|
}
|
|
90
|
-
|
|
91
79
|
_createClass(LocalizedMultilineTextField, [{
|
|
92
80
|
key: "render",
|
|
93
81
|
value: function render() {
|
|
94
82
|
if (!this.props.isReadOnly) {
|
|
95
83
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.onChange === 'function', 'LocalizedMultilineTextField: `onChange` is required when field is not read only.') : void 0;
|
|
96
84
|
}
|
|
97
|
-
|
|
98
85
|
if (this.props.hintIcon) {
|
|
99
86
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.hint === 'string' || /*#__PURE__*/react.isValidElement(this.props.hint), 'LocalizedMultilineTextField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
|
|
100
87
|
}
|
|
101
|
-
|
|
102
88
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
103
89
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
104
90
|
max: this.props.horizontalConstraint,
|
|
@@ -157,19 +143,15 @@ let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
157
143
|
return errors;
|
|
158
144
|
}
|
|
159
145
|
}]);
|
|
160
|
-
|
|
161
146
|
return LocalizedMultilineTextField;
|
|
162
147
|
}(react.Component);
|
|
163
|
-
|
|
164
148
|
LocalizedMultilineTextField.displayName = 'LocalizedMultilineTextField';
|
|
165
149
|
LocalizedMultilineTextField.defaultProps = {
|
|
166
150
|
horizontalConstraint: 'scale'
|
|
167
151
|
};
|
|
168
|
-
|
|
169
152
|
LocalizedMultilineTextField.getDerivedStateFromProps = (props, state) => ({
|
|
170
153
|
id: utils.getFieldId(props, state, sequentialId)
|
|
171
154
|
});
|
|
172
|
-
|
|
173
155
|
LocalizedMultilineTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
174
156
|
id: _pt__default["default"].string,
|
|
175
157
|
horizontalConstraint: _pt__default["default"].oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
@@ -200,7 +182,7 @@ LocalizedMultilineTextField.propTypes = process.env.NODE_ENV !== "production" ?
|
|
|
200
182
|
var LocalizedMultilineTextField$1 = LocalizedMultilineTextField;
|
|
201
183
|
|
|
202
184
|
// NOTE: This string will be replaced on build time with the package version.
|
|
203
|
-
var version = "16.
|
|
185
|
+
var version = "16.1.0";
|
|
204
186
|
|
|
205
187
|
exports["default"] = LocalizedMultilineTextField$1;
|
|
206
188
|
exports.version = version;
|
|
@@ -49,35 +49,24 @@ var LocalizedMultilineTextInput__default = /*#__PURE__*/_interopDefault(Localize
|
|
|
49
49
|
var FieldErrors__default = /*#__PURE__*/_interopDefault(FieldErrors);
|
|
50
50
|
|
|
51
51
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys__default["default"](object); if (_Object$getOwnPropertySymbols__default["default"]) { var symbols = _Object$getOwnPropertySymbols__default["default"](object); enumerableOnly && (symbols = _filterInstanceProperty__default["default"](symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor__default["default"](object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
52
|
-
|
|
53
52
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](target, _Object$getOwnPropertyDescriptors__default["default"](source)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty__default["default"](target, key, _Object$getOwnPropertyDescriptor__default["default"](source, key)); }); } return target; }
|
|
54
|
-
|
|
55
53
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct__default["default"](Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
56
|
-
|
|
57
54
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct__default["default"]) return false; if (_Reflect$construct__default["default"].sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
58
55
|
const sequentialId = utils.createSequentialId('localized-multiline-text-field-');
|
|
59
56
|
const sequentialErrorsId = utils.createSequentialId('localized-multiline-text-field-error-')();
|
|
60
|
-
|
|
61
57
|
const hasErrors = errors => {
|
|
62
58
|
var _context;
|
|
63
|
-
|
|
64
59
|
return errors && _someInstanceProperty__default["default"](_context = _Object$values__default["default"](errors)).call(_context, Boolean);
|
|
65
60
|
};
|
|
66
|
-
|
|
67
61
|
let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
68
62
|
_inherits(LocalizedMultilineTextField, _Component);
|
|
69
|
-
|
|
70
63
|
var _super = _createSuper(LocalizedMultilineTextField);
|
|
71
|
-
|
|
72
64
|
function LocalizedMultilineTextField() {
|
|
73
65
|
var _this;
|
|
74
|
-
|
|
75
66
|
_classCallCheck(this, LocalizedMultilineTextField);
|
|
76
|
-
|
|
77
67
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
78
68
|
args[_key] = arguments[_key];
|
|
79
69
|
}
|
|
80
|
-
|
|
81
70
|
_this = _super.call(this, ...args);
|
|
82
71
|
_this.state = {
|
|
83
72
|
// We generate an id in case no id is provided by the parent to attach the
|
|
@@ -86,14 +75,11 @@ let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
86
75
|
};
|
|
87
76
|
return _this;
|
|
88
77
|
}
|
|
89
|
-
|
|
90
78
|
_createClass(LocalizedMultilineTextField, [{
|
|
91
79
|
key: "render",
|
|
92
80
|
value: function render() {
|
|
93
81
|
if (!this.props.isReadOnly) ;
|
|
94
|
-
|
|
95
82
|
if (this.props.hintIcon) ;
|
|
96
|
-
|
|
97
83
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
98
84
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
99
85
|
max: this.props.horizontalConstraint,
|
|
@@ -152,24 +138,20 @@ let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
152
138
|
return errors;
|
|
153
139
|
}
|
|
154
140
|
}]);
|
|
155
|
-
|
|
156
141
|
return LocalizedMultilineTextField;
|
|
157
142
|
}(react.Component);
|
|
158
|
-
|
|
159
143
|
LocalizedMultilineTextField.displayName = 'LocalizedMultilineTextField';
|
|
160
144
|
LocalizedMultilineTextField.defaultProps = {
|
|
161
145
|
horizontalConstraint: 'scale'
|
|
162
146
|
};
|
|
163
|
-
|
|
164
147
|
LocalizedMultilineTextField.getDerivedStateFromProps = (props, state) => ({
|
|
165
148
|
id: utils.getFieldId(props, state, sequentialId)
|
|
166
149
|
});
|
|
167
|
-
|
|
168
150
|
LocalizedMultilineTextField.propTypes = {};
|
|
169
151
|
var LocalizedMultilineTextField$1 = LocalizedMultilineTextField;
|
|
170
152
|
|
|
171
153
|
// NOTE: This string will be replaced on build time with the package version.
|
|
172
|
-
var version = "16.
|
|
154
|
+
var version = "16.1.0";
|
|
173
155
|
|
|
174
156
|
exports["default"] = LocalizedMultilineTextField$1;
|
|
175
157
|
exports.version = version;
|
|
@@ -26,35 +26,24 @@ import FieldErrors from '@commercetools-uikit/field-errors';
|
|
|
26
26
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
27
27
|
|
|
28
28
|
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
29
|
-
|
|
30
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
31
|
-
|
|
32
30
|
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); }; }
|
|
33
|
-
|
|
34
31
|
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; } }
|
|
35
32
|
const sequentialId = createSequentialId('localized-multiline-text-field-');
|
|
36
33
|
const sequentialErrorsId = createSequentialId('localized-multiline-text-field-error-')();
|
|
37
|
-
|
|
38
34
|
const hasErrors = errors => {
|
|
39
35
|
var _context;
|
|
40
|
-
|
|
41
36
|
return errors && _someInstanceProperty(_context = _Object$values(errors)).call(_context, Boolean);
|
|
42
37
|
};
|
|
43
|
-
|
|
44
38
|
let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
45
39
|
_inherits(LocalizedMultilineTextField, _Component);
|
|
46
|
-
|
|
47
40
|
var _super = _createSuper(LocalizedMultilineTextField);
|
|
48
|
-
|
|
49
41
|
function LocalizedMultilineTextField() {
|
|
50
42
|
var _this;
|
|
51
|
-
|
|
52
43
|
_classCallCheck(this, LocalizedMultilineTextField);
|
|
53
|
-
|
|
54
44
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
55
45
|
args[_key] = arguments[_key];
|
|
56
46
|
}
|
|
57
|
-
|
|
58
47
|
_this = _super.call(this, ...args);
|
|
59
48
|
_this.state = {
|
|
60
49
|
// We generate an id in case no id is provided by the parent to attach the
|
|
@@ -63,18 +52,15 @@ let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
63
52
|
};
|
|
64
53
|
return _this;
|
|
65
54
|
}
|
|
66
|
-
|
|
67
55
|
_createClass(LocalizedMultilineTextField, [{
|
|
68
56
|
key: "render",
|
|
69
57
|
value: function render() {
|
|
70
58
|
if (!this.props.isReadOnly) {
|
|
71
59
|
process.env.NODE_ENV !== "production" ? warning(typeof this.props.onChange === 'function', 'LocalizedMultilineTextField: `onChange` is required when field is not read only.') : void 0;
|
|
72
60
|
}
|
|
73
|
-
|
|
74
61
|
if (this.props.hintIcon) {
|
|
75
62
|
process.env.NODE_ENV !== "production" ? warning(typeof this.props.hint === 'string' || /*#__PURE__*/isValidElement(this.props.hint), 'LocalizedMultilineTextField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
|
|
76
63
|
}
|
|
77
|
-
|
|
78
64
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
79
65
|
return jsx(Constraints.Horizontal, {
|
|
80
66
|
max: this.props.horizontalConstraint,
|
|
@@ -133,19 +119,15 @@ let LocalizedMultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
133
119
|
return errors;
|
|
134
120
|
}
|
|
135
121
|
}]);
|
|
136
|
-
|
|
137
122
|
return LocalizedMultilineTextField;
|
|
138
123
|
}(Component);
|
|
139
|
-
|
|
140
124
|
LocalizedMultilineTextField.displayName = 'LocalizedMultilineTextField';
|
|
141
125
|
LocalizedMultilineTextField.defaultProps = {
|
|
142
126
|
horizontalConstraint: 'scale'
|
|
143
127
|
};
|
|
144
|
-
|
|
145
128
|
LocalizedMultilineTextField.getDerivedStateFromProps = (props, state) => ({
|
|
146
129
|
id: getFieldId(props, state, sequentialId)
|
|
147
130
|
});
|
|
148
|
-
|
|
149
131
|
LocalizedMultilineTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
150
132
|
id: _pt.string,
|
|
151
133
|
horizontalConstraint: _pt.oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
@@ -176,6 +158,6 @@ LocalizedMultilineTextField.propTypes = process.env.NODE_ENV !== "production" ?
|
|
|
176
158
|
var LocalizedMultilineTextField$1 = LocalizedMultilineTextField;
|
|
177
159
|
|
|
178
160
|
// NOTE: This string will be replaced on build time with the package version.
|
|
179
|
-
var version = "16.
|
|
161
|
+
var version = "16.1.0";
|
|
180
162
|
|
|
181
163
|
export { LocalizedMultilineTextField$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/localized-multiline-text-field",
|
|
3
3
|
"description": "A controlled text input component for localized multi-line strings with validation states.",
|
|
4
|
-
"version": "16.
|
|
4
|
+
"version": "16.1.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/constraints": "16.
|
|
25
|
-
"@commercetools-uikit/design-system": "16.
|
|
26
|
-
"@commercetools-uikit/field-errors": "16.
|
|
27
|
-
"@commercetools-uikit/field-label": "16.
|
|
28
|
-
"@commercetools-uikit/localized-multiline-text-input": "16.
|
|
29
|
-
"@commercetools-uikit/spacings": "16.
|
|
30
|
-
"@commercetools-uikit/utils": "16.
|
|
24
|
+
"@commercetools-uikit/constraints": "16.1.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "16.1.0",
|
|
26
|
+
"@commercetools-uikit/field-errors": "16.1.0",
|
|
27
|
+
"@commercetools-uikit/field-label": "16.1.0",
|
|
28
|
+
"@commercetools-uikit/localized-multiline-text-input": "16.1.0",
|
|
29
|
+
"@commercetools-uikit/spacings": "16.1.0",
|
|
30
|
+
"@commercetools-uikit/utils": "16.1.0",
|
|
31
31
|
"@emotion/react": "^11.10.5",
|
|
32
32
|
"@emotion/styled": "^11.10.5",
|
|
33
33
|
"prop-types": "15.8.1",
|