@commercetools-uikit/localized-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 LocalizedTextInput__default = /*#__PURE__*/_interopDefault(LocalizedTextInpu
|
|
|
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-text-field-');
|
|
60
57
|
const sequentialErrorsId = utils.createSequentialId('localized-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 LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
69
63
|
_inherits(LocalizedTextField, _Component);
|
|
70
|
-
|
|
71
64
|
var _super = _createSuper(LocalizedTextField);
|
|
72
|
-
|
|
73
65
|
function LocalizedTextField() {
|
|
74
66
|
var _this;
|
|
75
|
-
|
|
76
67
|
_classCallCheck(this, LocalizedTextField);
|
|
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,20 +76,16 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
|
87
76
|
};
|
|
88
77
|
return _this;
|
|
89
78
|
}
|
|
90
|
-
|
|
91
79
|
_createClass(LocalizedTextField, [{
|
|
92
80
|
key: "render",
|
|
93
81
|
value: function render() {
|
|
94
82
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
95
|
-
|
|
96
83
|
if (this.props.hintIcon) {
|
|
97
84
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.hint === 'string' || /*#__PURE__*/react.isValidElement(this.props.hint), 'LocalizedTextField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
|
|
98
85
|
}
|
|
99
|
-
|
|
100
86
|
if (this.props.hideLanguageExpansionControls) {
|
|
101
87
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.defaultExpandLanguages !== 'boolean', 'LocalizedTextField: "defaultExpandLanguages" does not have any effect when "hideLanguageExpansionControls" is set.') : void 0;
|
|
102
88
|
}
|
|
103
|
-
|
|
104
89
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
105
90
|
max: this.props.horizontalConstraint,
|
|
106
91
|
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
@@ -156,19 +141,15 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
|
156
141
|
return errors;
|
|
157
142
|
}
|
|
158
143
|
}]);
|
|
159
|
-
|
|
160
144
|
return LocalizedTextField;
|
|
161
145
|
}(react.Component);
|
|
162
|
-
|
|
163
146
|
LocalizedTextField.displayName = 'LocalizedTextField';
|
|
164
147
|
LocalizedTextField.defaultProps = {
|
|
165
148
|
horizontalConstraint: 'scale'
|
|
166
149
|
};
|
|
167
|
-
|
|
168
150
|
LocalizedTextField.getDerivedStateFromProps = (props, state) => ({
|
|
169
151
|
id: utils.getFieldId(props, state, sequentialId)
|
|
170
152
|
});
|
|
171
|
-
|
|
172
153
|
LocalizedTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
173
154
|
id: _pt__default["default"].string,
|
|
174
155
|
horizontalConstraint: _pt__default["default"].oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
@@ -199,7 +180,7 @@ LocalizedTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
199
180
|
var LocalizedTextField$1 = LocalizedTextField;
|
|
200
181
|
|
|
201
182
|
// NOTE: This string will be replaced on build time with the package version.
|
|
202
|
-
var version = "16.
|
|
183
|
+
var version = "16.1.0";
|
|
203
184
|
|
|
204
185
|
exports["default"] = LocalizedTextField$1;
|
|
205
186
|
exports.version = version;
|
|
@@ -49,35 +49,24 @@ var LocalizedTextInput__default = /*#__PURE__*/_interopDefault(LocalizedTextInpu
|
|
|
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-text-field-');
|
|
59
56
|
const sequentialErrorsId = utils.createSequentialId('localized-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 LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
68
62
|
_inherits(LocalizedTextField, _Component);
|
|
69
|
-
|
|
70
63
|
var _super = _createSuper(LocalizedTextField);
|
|
71
|
-
|
|
72
64
|
function LocalizedTextField() {
|
|
73
65
|
var _this;
|
|
74
|
-
|
|
75
66
|
_classCallCheck(this, LocalizedTextField);
|
|
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,16 +75,12 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
|
86
75
|
};
|
|
87
76
|
return _this;
|
|
88
77
|
}
|
|
89
|
-
|
|
90
78
|
_createClass(LocalizedTextField, [{
|
|
91
79
|
key: "render",
|
|
92
80
|
value: function render() {
|
|
93
81
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
94
|
-
|
|
95
82
|
if (this.props.hintIcon) ;
|
|
96
|
-
|
|
97
83
|
if (this.props.hideLanguageExpansionControls) ;
|
|
98
|
-
|
|
99
84
|
return jsxRuntime.jsx(Constraints__default["default"].Horizontal, {
|
|
100
85
|
max: this.props.horizontalConstraint,
|
|
101
86
|
children: jsxRuntime.jsxs(Spacings__default["default"].Stack, {
|
|
@@ -151,24 +136,20 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
|
151
136
|
return errors;
|
|
152
137
|
}
|
|
153
138
|
}]);
|
|
154
|
-
|
|
155
139
|
return LocalizedTextField;
|
|
156
140
|
}(react.Component);
|
|
157
|
-
|
|
158
141
|
LocalizedTextField.displayName = 'LocalizedTextField';
|
|
159
142
|
LocalizedTextField.defaultProps = {
|
|
160
143
|
horizontalConstraint: 'scale'
|
|
161
144
|
};
|
|
162
|
-
|
|
163
145
|
LocalizedTextField.getDerivedStateFromProps = (props, state) => ({
|
|
164
146
|
id: utils.getFieldId(props, state, sequentialId)
|
|
165
147
|
});
|
|
166
|
-
|
|
167
148
|
LocalizedTextField.propTypes = {};
|
|
168
149
|
var LocalizedTextField$1 = LocalizedTextField;
|
|
169
150
|
|
|
170
151
|
// NOTE: This string will be replaced on build time with the package version.
|
|
171
|
-
var version = "16.
|
|
152
|
+
var version = "16.1.0";
|
|
172
153
|
|
|
173
154
|
exports["default"] = LocalizedTextField$1;
|
|
174
155
|
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-text-field-');
|
|
36
33
|
const sequentialErrorsId = createSequentialId('localized-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 LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
45
39
|
_inherits(LocalizedTextField, _Component);
|
|
46
|
-
|
|
47
40
|
var _super = _createSuper(LocalizedTextField);
|
|
48
|
-
|
|
49
41
|
function LocalizedTextField() {
|
|
50
42
|
var _this;
|
|
51
|
-
|
|
52
43
|
_classCallCheck(this, LocalizedTextField);
|
|
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,20 +52,16 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
|
63
52
|
};
|
|
64
53
|
return _this;
|
|
65
54
|
}
|
|
66
|
-
|
|
67
55
|
_createClass(LocalizedTextField, [{
|
|
68
56
|
key: "render",
|
|
69
57
|
value: function render() {
|
|
70
58
|
const hasError = this.props.touched && hasErrors(this.props.errors);
|
|
71
|
-
|
|
72
59
|
if (this.props.hintIcon) {
|
|
73
60
|
process.env.NODE_ENV !== "production" ? warning(typeof this.props.hint === 'string' || /*#__PURE__*/isValidElement(this.props.hint), 'LocalizedTextField: `hint` is required to be string or ReactNode if hintIcon is present') : void 0;
|
|
74
61
|
}
|
|
75
|
-
|
|
76
62
|
if (this.props.hideLanguageExpansionControls) {
|
|
77
63
|
process.env.NODE_ENV !== "production" ? warning(typeof this.props.defaultExpandLanguages !== 'boolean', 'LocalizedTextField: "defaultExpandLanguages" does not have any effect when "hideLanguageExpansionControls" is set.') : void 0;
|
|
78
64
|
}
|
|
79
|
-
|
|
80
65
|
return jsx(Constraints.Horizontal, {
|
|
81
66
|
max: this.props.horizontalConstraint,
|
|
82
67
|
children: jsxs(Spacings.Stack, {
|
|
@@ -132,19 +117,15 @@ let LocalizedTextField = /*#__PURE__*/function (_Component) {
|
|
|
132
117
|
return errors;
|
|
133
118
|
}
|
|
134
119
|
}]);
|
|
135
|
-
|
|
136
120
|
return LocalizedTextField;
|
|
137
121
|
}(Component);
|
|
138
|
-
|
|
139
122
|
LocalizedTextField.displayName = 'LocalizedTextField';
|
|
140
123
|
LocalizedTextField.defaultProps = {
|
|
141
124
|
horizontalConstraint: 'scale'
|
|
142
125
|
};
|
|
143
|
-
|
|
144
126
|
LocalizedTextField.getDerivedStateFromProps = (props, state) => ({
|
|
145
127
|
id: getFieldId(props, state, sequentialId)
|
|
146
128
|
});
|
|
147
|
-
|
|
148
129
|
LocalizedTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
149
130
|
id: _pt.string,
|
|
150
131
|
horizontalConstraint: _pt.oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
@@ -175,6 +156,6 @@ LocalizedTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
175
156
|
var LocalizedTextField$1 = LocalizedTextField;
|
|
176
157
|
|
|
177
158
|
// NOTE: This string will be replaced on build time with the package version.
|
|
178
|
-
var version = "16.
|
|
159
|
+
var version = "16.1.0";
|
|
179
160
|
|
|
180
161
|
export { LocalizedTextField$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/localized-text-field",
|
|
3
3
|
"description": "A controlled text input component for localized single-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-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-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",
|