@woosmap/ui 4.31.2 → 4.31.3
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/package.json
CHANGED
|
@@ -239,19 +239,16 @@ export default class LanguageSelect extends Component {
|
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
onChange = (newValue, actionMeta) => {
|
|
242
|
-
const { minimumLength, isMulti } = this.props;
|
|
242
|
+
const { minimumLength, isMulti, onChange } = this.props;
|
|
243
243
|
const newLanguages = newValue;
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
break;
|
|
251
|
-
default:
|
|
252
|
-
break;
|
|
244
|
+
if (
|
|
245
|
+
(actionMeta.action === 'remove-value' || actionMeta.action === 'pop-value') &&
|
|
246
|
+
newValue.length < minimumLength &&
|
|
247
|
+
isMulti
|
|
248
|
+
) {
|
|
249
|
+
return;
|
|
253
250
|
}
|
|
254
|
-
|
|
251
|
+
if (onChange !== null) onChange(newValue);
|
|
255
252
|
this.setState({ languages: newLanguages });
|
|
256
253
|
};
|
|
257
254
|
|
|
@@ -263,7 +260,7 @@ export default class LanguageSelect extends Component {
|
|
|
263
260
|
return (
|
|
264
261
|
<Select
|
|
265
262
|
isMulti={isMulti}
|
|
266
|
-
className="select__item"
|
|
263
|
+
className="select__item select__item--language"
|
|
267
264
|
classNamePrefix="select"
|
|
268
265
|
options={this.getOptions()}
|
|
269
266
|
components={{ MultiValueLabel, MultiValueRemove, Option }}
|
|
@@ -322,7 +319,7 @@ LanguageSelect.propTypes = {
|
|
|
322
319
|
isMulti: PropTypes.bool,
|
|
323
320
|
placeholder: PropTypes.string,
|
|
324
321
|
value: PropTypes.string,
|
|
325
|
-
defaultValue: PropTypes.
|
|
322
|
+
defaultValue: PropTypes.oneOf(languageOptions.map((x) => x.value)),
|
|
326
323
|
minimumLength: PropTypes.number,
|
|
327
324
|
onChange: PropTypes.func,
|
|
328
325
|
className: PropTypes.string,
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
fill $secondary
|
|
34
34
|
&__value-container
|
|
35
35
|
padding-left 1rem !important
|
|
36
|
+
.select__item--language &
|
|
37
|
+
overflow-y auto !important
|
|
38
|
+
max-height 7rem
|
|
36
39
|
&__single-value
|
|
37
40
|
color $secondary !important
|
|
38
41
|
&__indicator
|
|
@@ -84,6 +87,8 @@
|
|
|
84
87
|
&__label
|
|
85
88
|
padding-right .2rem !important
|
|
86
89
|
color $light !important
|
|
90
|
+
&:only-child
|
|
91
|
+
margin-right .3rem !important
|
|
87
92
|
&__remove
|
|
88
93
|
cursor pointer
|
|
89
94
|
svg
|