@commercetools-uikit/multiline-text-field 16.0.0 → 16.1.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.
|
@@ -50,35 +50,24 @@ var MultilineTextInput__default = /*#__PURE__*/_interopDefault(MultilineTextInpu
|
|
|
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('multiline-text-field-');
|
|
60
57
|
const sequentialErrorsId = utils.createSequentialId('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 MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
69
63
|
_inherits(MultilineTextField, _Component);
|
|
70
|
-
|
|
71
64
|
var _super = _createSuper(MultilineTextField);
|
|
72
|
-
|
|
73
65
|
function MultilineTextField() {
|
|
74
66
|
var _this;
|
|
75
|
-
|
|
76
67
|
_classCallCheck(this, MultilineTextField);
|
|
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 MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
87
76
|
};
|
|
88
77
|
return _this;
|
|
89
78
|
}
|
|
90
|
-
|
|
91
79
|
_createClass(MultilineTextField, [{
|
|
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.isReadOnly) {
|
|
97
84
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.onChange === 'function', 'MultilineField: "onChange" is required when field is not read only.') : void 0;
|
|
98
85
|
}
|
|
99
|
-
|
|
100
86
|
if (this.props.hint) {
|
|
101
87
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof this.props.hint === 'string' || /*#__PURE__*/react.isValidElement(this.props.hint), 'MultilineField: "hint" should be string or ReactNode if `hintIcon` is present') : 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, {
|
|
@@ -153,19 +138,15 @@ let MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
153
138
|
return errors;
|
|
154
139
|
}
|
|
155
140
|
}]);
|
|
156
|
-
|
|
157
141
|
return MultilineTextField;
|
|
158
142
|
}(react.Component);
|
|
159
|
-
|
|
160
143
|
MultilineTextField.displayName = 'MultilineTextField';
|
|
161
144
|
MultilineTextField.defaultProps = {
|
|
162
145
|
horizontalConstraint: 'scale'
|
|
163
146
|
};
|
|
164
|
-
|
|
165
147
|
MultilineTextField.getDerivedStateFromProps = (props, state) => ({
|
|
166
148
|
id: utils.getFieldId(props, state, sequentialId)
|
|
167
149
|
});
|
|
168
|
-
|
|
169
150
|
MultilineTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
170
151
|
id: _pt__default["default"].string,
|
|
171
152
|
horizontalConstraint: _pt__default["default"].oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
@@ -194,7 +175,7 @@ MultilineTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
194
175
|
var MultilineTextField$1 = MultilineTextField;
|
|
195
176
|
|
|
196
177
|
// NOTE: This string will be replaced on build time with the package version.
|
|
197
|
-
var version = "16.
|
|
178
|
+
var version = "16.1.1";
|
|
198
179
|
|
|
199
180
|
exports["default"] = MultilineTextField$1;
|
|
200
181
|
exports.version = version;
|
|
@@ -49,35 +49,24 @@ var MultilineTextInput__default = /*#__PURE__*/_interopDefault(MultilineTextInpu
|
|
|
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('multiline-text-field-');
|
|
59
56
|
const sequentialErrorsId = utils.createSequentialId('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 MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
68
62
|
_inherits(MultilineTextField, _Component);
|
|
69
|
-
|
|
70
63
|
var _super = _createSuper(MultilineTextField);
|
|
71
|
-
|
|
72
64
|
function MultilineTextField() {
|
|
73
65
|
var _this;
|
|
74
|
-
|
|
75
66
|
_classCallCheck(this, MultilineTextField);
|
|
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 MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
86
75
|
};
|
|
87
76
|
return _this;
|
|
88
77
|
}
|
|
89
|
-
|
|
90
78
|
_createClass(MultilineTextField, [{
|
|
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.isReadOnly) ;
|
|
96
|
-
|
|
97
83
|
if (this.props.hint) ;
|
|
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, {
|
|
@@ -148,24 +133,20 @@ let MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
148
133
|
return errors;
|
|
149
134
|
}
|
|
150
135
|
}]);
|
|
151
|
-
|
|
152
136
|
return MultilineTextField;
|
|
153
137
|
}(react.Component);
|
|
154
|
-
|
|
155
138
|
MultilineTextField.displayName = 'MultilineTextField';
|
|
156
139
|
MultilineTextField.defaultProps = {
|
|
157
140
|
horizontalConstraint: 'scale'
|
|
158
141
|
};
|
|
159
|
-
|
|
160
142
|
MultilineTextField.getDerivedStateFromProps = (props, state) => ({
|
|
161
143
|
id: utils.getFieldId(props, state, sequentialId)
|
|
162
144
|
});
|
|
163
|
-
|
|
164
145
|
MultilineTextField.propTypes = {};
|
|
165
146
|
var MultilineTextField$1 = MultilineTextField;
|
|
166
147
|
|
|
167
148
|
// NOTE: This string will be replaced on build time with the package version.
|
|
168
|
-
var version = "16.
|
|
149
|
+
var version = "16.1.1";
|
|
169
150
|
|
|
170
151
|
exports["default"] = MultilineTextField$1;
|
|
171
152
|
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('multiline-text-field-');
|
|
36
33
|
const sequentialErrorsId = createSequentialId('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 MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
45
39
|
_inherits(MultilineTextField, _Component);
|
|
46
|
-
|
|
47
40
|
var _super = _createSuper(MultilineTextField);
|
|
48
|
-
|
|
49
41
|
function MultilineTextField() {
|
|
50
42
|
var _this;
|
|
51
|
-
|
|
52
43
|
_classCallCheck(this, MultilineTextField);
|
|
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 MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
63
52
|
};
|
|
64
53
|
return _this;
|
|
65
54
|
}
|
|
66
|
-
|
|
67
55
|
_createClass(MultilineTextField, [{
|
|
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.isReadOnly) {
|
|
73
60
|
process.env.NODE_ENV !== "production" ? warning(typeof this.props.onChange === 'function', 'MultilineField: "onChange" is required when field is not read only.') : void 0;
|
|
74
61
|
}
|
|
75
|
-
|
|
76
62
|
if (this.props.hint) {
|
|
77
63
|
process.env.NODE_ENV !== "production" ? warning(typeof this.props.hint === 'string' || /*#__PURE__*/isValidElement(this.props.hint), 'MultilineField: "hint" should be string or ReactNode if `hintIcon` is present') : void 0;
|
|
78
64
|
}
|
|
79
|
-
|
|
80
65
|
return jsx(Constraints.Horizontal, {
|
|
81
66
|
max: this.props.horizontalConstraint,
|
|
82
67
|
children: jsxs(Spacings.Stack, {
|
|
@@ -129,19 +114,15 @@ let MultilineTextField = /*#__PURE__*/function (_Component) {
|
|
|
129
114
|
return errors;
|
|
130
115
|
}
|
|
131
116
|
}]);
|
|
132
|
-
|
|
133
117
|
return MultilineTextField;
|
|
134
118
|
}(Component);
|
|
135
|
-
|
|
136
119
|
MultilineTextField.displayName = 'MultilineTextField';
|
|
137
120
|
MultilineTextField.defaultProps = {
|
|
138
121
|
horizontalConstraint: 'scale'
|
|
139
122
|
};
|
|
140
|
-
|
|
141
123
|
MultilineTextField.getDerivedStateFromProps = (props, state) => ({
|
|
142
124
|
id: getFieldId(props, state, sequentialId)
|
|
143
125
|
});
|
|
144
|
-
|
|
145
126
|
MultilineTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
146
127
|
id: _pt.string,
|
|
147
128
|
horizontalConstraint: _pt.oneOf([6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 'scale', 'auto']),
|
|
@@ -170,6 +151,6 @@ MultilineTextField.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
|
170
151
|
var MultilineTextField$1 = MultilineTextField;
|
|
171
152
|
|
|
172
153
|
// NOTE: This string will be replaced on build time with the package version.
|
|
173
|
-
var version = "16.
|
|
154
|
+
var version = "16.1.1";
|
|
174
155
|
|
|
175
156
|
export { MultilineTextField$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/multiline-text-field",
|
|
3
3
|
"description": "A controlled text input component for multi-line strings with validation states and a label.",
|
|
4
|
-
"version": "16.
|
|
4
|
+
"version": "16.1.1",
|
|
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/multiline-text-input": "16.
|
|
29
|
-
"@commercetools-uikit/spacings": "16.
|
|
30
|
-
"@commercetools-uikit/utils": "16.
|
|
24
|
+
"@commercetools-uikit/constraints": "16.1.1",
|
|
25
|
+
"@commercetools-uikit/design-system": "16.1.1",
|
|
26
|
+
"@commercetools-uikit/field-errors": "16.1.1",
|
|
27
|
+
"@commercetools-uikit/field-label": "16.1.1",
|
|
28
|
+
"@commercetools-uikit/multiline-text-input": "16.1.1",
|
|
29
|
+
"@commercetools-uikit/spacings": "16.1.1",
|
|
30
|
+
"@commercetools-uikit/utils": "16.1.1",
|
|
31
31
|
"@emotion/react": "^11.10.5",
|
|
32
32
|
"@emotion/styled": "^11.10.5",
|
|
33
33
|
"prop-types": "15.8.1",
|