@commercetools-uikit/localized-text-input 20.2.2 → 20.3.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.
|
@@ -104,7 +104,7 @@ const LocalizedInput = props => {
|
|
|
104
104
|
// the input name anymore.
|
|
105
105
|
//
|
|
106
106
|
event.target.language = props.language;
|
|
107
|
-
onChange
|
|
107
|
+
onChange === null || onChange === void 0 || onChange(event);
|
|
108
108
|
}, [props.language, onChange]);
|
|
109
109
|
if (!props.isReadOnly) {
|
|
110
110
|
process.env.NODE_ENV !== "production" ? utils.warning(typeof props.onChange === 'function', 'LocalizedTextInput: "onChange" is required when isReadOnly is not true') : void 0;
|
|
@@ -162,6 +162,7 @@ const LocalizedTextInput = _ref2 => {
|
|
|
162
162
|
scale: "xs",
|
|
163
163
|
children: [jsxRuntime.jsx(Stack__default["default"], {
|
|
164
164
|
children: _mapInstanceProperty__default["default"](languages).call(languages, (language, index) => {
|
|
165
|
+
var _props$errors, _props$warnings, _props$additionalInfo;
|
|
165
166
|
const isFirstLanguage = index === 0;
|
|
166
167
|
if (!isFirstLanguage && !areLanguagesExpanded) return null;
|
|
167
168
|
return jsxRuntime.jsx("div", {
|
|
@@ -190,11 +191,11 @@ const LocalizedTextInput = _ref2 => {
|
|
|
190
191
|
/* ARIA */
|
|
191
192
|
"aria-invalid": props['aria-invalid'],
|
|
192
193
|
"aria-errormessage": props['aria-errormessage']
|
|
193
|
-
})), props.errors
|
|
194
|
+
})), ((_props$errors = props.errors) === null || _props$errors === void 0 ? void 0 : _props$errors[language]) && jsxRuntime.jsx(messages.ErrorMessage, {
|
|
194
195
|
children: props.errors[language]
|
|
195
|
-
}), props.warnings
|
|
196
|
+
}), ((_props$warnings = props.warnings) === null || _props$warnings === void 0 ? void 0 : _props$warnings[language]) && jsxRuntime.jsx(messages.WarningMessage, {
|
|
196
197
|
children: props.warnings[language]
|
|
197
|
-
}), props.additionalInfo
|
|
198
|
+
}), ((_props$additionalInfo = props.additionalInfo) === null || _props$additionalInfo === void 0 ? void 0 : _props$additionalInfo[language]) && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
|
|
198
199
|
message: props.additionalInfo[language]
|
|
199
200
|
})]
|
|
200
201
|
})
|
|
@@ -220,7 +221,7 @@ LocalizedTextInput.isTouched = localizedUtils.isTouched;
|
|
|
220
221
|
var LocalizedTextInput$1 = LocalizedTextInput;
|
|
221
222
|
|
|
222
223
|
// NOTE: This string will be replaced on build time with the package version.
|
|
223
|
-
var version = "20.
|
|
224
|
+
var version = "20.3.0";
|
|
224
225
|
|
|
225
226
|
exports["default"] = LocalizedTextInput$1;
|
|
226
227
|
exports.version = version;
|
|
@@ -94,7 +94,7 @@ const LocalizedInput = props => {
|
|
|
94
94
|
// the input name anymore.
|
|
95
95
|
//
|
|
96
96
|
event.target.language = props.language;
|
|
97
|
-
onChange
|
|
97
|
+
onChange === null || onChange === void 0 || onChange(event);
|
|
98
98
|
}, [props.language, onChange]);
|
|
99
99
|
if (!props.isReadOnly) ;
|
|
100
100
|
return jsxRuntime.jsxs("div", {
|
|
@@ -146,6 +146,7 @@ const LocalizedTextInput = _ref2 => {
|
|
|
146
146
|
scale: "xs",
|
|
147
147
|
children: [jsxRuntime.jsx(Stack__default["default"], {
|
|
148
148
|
children: _mapInstanceProperty__default["default"](languages).call(languages, (language, index) => {
|
|
149
|
+
var _props$errors, _props$warnings, _props$additionalInfo;
|
|
149
150
|
const isFirstLanguage = index === 0;
|
|
150
151
|
if (!isFirstLanguage && !areLanguagesExpanded) return null;
|
|
151
152
|
return jsxRuntime.jsx("div", {
|
|
@@ -174,11 +175,11 @@ const LocalizedTextInput = _ref2 => {
|
|
|
174
175
|
/* ARIA */
|
|
175
176
|
"aria-invalid": props['aria-invalid'],
|
|
176
177
|
"aria-errormessage": props['aria-errormessage']
|
|
177
|
-
})), props.errors
|
|
178
|
+
})), ((_props$errors = props.errors) === null || _props$errors === void 0 ? void 0 : _props$errors[language]) && jsxRuntime.jsx(messages.ErrorMessage, {
|
|
178
179
|
children: props.errors[language]
|
|
179
|
-
}), props.warnings
|
|
180
|
+
}), ((_props$warnings = props.warnings) === null || _props$warnings === void 0 ? void 0 : _props$warnings[language]) && jsxRuntime.jsx(messages.WarningMessage, {
|
|
180
181
|
children: props.warnings[language]
|
|
181
|
-
}), props.additionalInfo
|
|
182
|
+
}), ((_props$additionalInfo = props.additionalInfo) === null || _props$additionalInfo === void 0 ? void 0 : _props$additionalInfo[language]) && jsxRuntime.jsx(messages.AdditionalInfoMessage, {
|
|
182
183
|
message: props.additionalInfo[language]
|
|
183
184
|
})]
|
|
184
185
|
})
|
|
@@ -204,7 +205,7 @@ LocalizedTextInput.isTouched = localizedUtils.isTouched;
|
|
|
204
205
|
var LocalizedTextInput$1 = LocalizedTextInput;
|
|
205
206
|
|
|
206
207
|
// NOTE: This string will be replaced on build time with the package version.
|
|
207
|
-
var version = "20.
|
|
208
|
+
var version = "20.3.0";
|
|
208
209
|
|
|
209
210
|
exports["default"] = LocalizedTextInput$1;
|
|
210
211
|
exports.version = version;
|
|
@@ -85,7 +85,7 @@ const LocalizedInput = props => {
|
|
|
85
85
|
// the input name anymore.
|
|
86
86
|
//
|
|
87
87
|
event.target.language = props.language;
|
|
88
|
-
onChange
|
|
88
|
+
onChange === null || onChange === void 0 || onChange(event);
|
|
89
89
|
}, [props.language, onChange]);
|
|
90
90
|
if (!props.isReadOnly) {
|
|
91
91
|
process.env.NODE_ENV !== "production" ? warning(typeof props.onChange === 'function', 'LocalizedTextInput: "onChange" is required when isReadOnly is not true') : void 0;
|
|
@@ -143,6 +143,7 @@ const LocalizedTextInput = _ref2 => {
|
|
|
143
143
|
scale: "xs",
|
|
144
144
|
children: [jsx(Stack, {
|
|
145
145
|
children: _mapInstanceProperty(languages).call(languages, (language, index) => {
|
|
146
|
+
var _props$errors, _props$warnings, _props$additionalInfo;
|
|
146
147
|
const isFirstLanguage = index === 0;
|
|
147
148
|
if (!isFirstLanguage && !areLanguagesExpanded) return null;
|
|
148
149
|
return jsx("div", {
|
|
@@ -171,11 +172,11 @@ const LocalizedTextInput = _ref2 => {
|
|
|
171
172
|
/* ARIA */
|
|
172
173
|
"aria-invalid": props['aria-invalid'],
|
|
173
174
|
"aria-errormessage": props['aria-errormessage']
|
|
174
|
-
})), props.errors
|
|
175
|
+
})), ((_props$errors = props.errors) === null || _props$errors === void 0 ? void 0 : _props$errors[language]) && jsx(ErrorMessage, {
|
|
175
176
|
children: props.errors[language]
|
|
176
|
-
}), props.warnings
|
|
177
|
+
}), ((_props$warnings = props.warnings) === null || _props$warnings === void 0 ? void 0 : _props$warnings[language]) && jsx(WarningMessage, {
|
|
177
178
|
children: props.warnings[language]
|
|
178
|
-
}), props.additionalInfo
|
|
179
|
+
}), ((_props$additionalInfo = props.additionalInfo) === null || _props$additionalInfo === void 0 ? void 0 : _props$additionalInfo[language]) && jsx(AdditionalInfoMessage, {
|
|
179
180
|
message: props.additionalInfo[language]
|
|
180
181
|
})]
|
|
181
182
|
})
|
|
@@ -201,6 +202,6 @@ LocalizedTextInput.isTouched = isTouched;
|
|
|
201
202
|
var LocalizedTextInput$1 = LocalizedTextInput;
|
|
202
203
|
|
|
203
204
|
// NOTE: This string will be replaced on build time with the package version.
|
|
204
|
-
var version = "20.
|
|
205
|
+
var version = "20.3.0";
|
|
205
206
|
|
|
206
207
|
export { LocalizedTextInput$1 as default, version };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/localized-text-input",
|
|
3
3
|
"description": "A controlled text input component for localized single-line strings with validation states.",
|
|
4
|
-
"version": "20.
|
|
4
|
+
"version": "20.3.0",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,23 +21,23 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/constraints": "20.
|
|
25
|
-
"@commercetools-uikit/design-system": "20.
|
|
26
|
-
"@commercetools-uikit/flat-button": "20.
|
|
27
|
-
"@commercetools-uikit/hooks": "20.
|
|
28
|
-
"@commercetools-uikit/icons": "20.
|
|
29
|
-
"@commercetools-uikit/input-utils": "20.
|
|
30
|
-
"@commercetools-uikit/localized-utils": "20.
|
|
31
|
-
"@commercetools-uikit/messages": "20.
|
|
32
|
-
"@commercetools-uikit/spacings-stack": "20.
|
|
33
|
-
"@commercetools-uikit/text": "20.
|
|
34
|
-
"@commercetools-uikit/text-input": "20.
|
|
35
|
-
"@commercetools-uikit/utils": "20.
|
|
24
|
+
"@commercetools-uikit/constraints": "20.3.0",
|
|
25
|
+
"@commercetools-uikit/design-system": "20.3.0",
|
|
26
|
+
"@commercetools-uikit/flat-button": "20.3.0",
|
|
27
|
+
"@commercetools-uikit/hooks": "20.3.0",
|
|
28
|
+
"@commercetools-uikit/icons": "20.3.0",
|
|
29
|
+
"@commercetools-uikit/input-utils": "20.3.0",
|
|
30
|
+
"@commercetools-uikit/localized-utils": "20.3.0",
|
|
31
|
+
"@commercetools-uikit/messages": "20.3.0",
|
|
32
|
+
"@commercetools-uikit/spacings-stack": "20.3.0",
|
|
33
|
+
"@commercetools-uikit/text": "20.3.0",
|
|
34
|
+
"@commercetools-uikit/text-input": "20.3.0",
|
|
35
|
+
"@commercetools-uikit/utils": "20.3.0",
|
|
36
36
|
"@emotion/react": "^11.10.5",
|
|
37
37
|
"@emotion/styled": "^11.10.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"react": "19.
|
|
40
|
+
"react": "19.2.0",
|
|
41
41
|
"react-intl": "^7.1.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|