@woosmap/ui 4.36.2 → 4.36.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
|
@@ -241,19 +241,16 @@ export default class LanguageSelect extends Component {
|
|
|
241
241
|
};
|
|
242
242
|
|
|
243
243
|
onChange = (newValue, actionMeta) => {
|
|
244
|
-
const { minimumLength, isMulti } = this.props;
|
|
244
|
+
const { minimumLength, isMulti, onChange } = this.props;
|
|
245
245
|
const newLanguages = newValue;
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
break;
|
|
253
|
-
default:
|
|
254
|
-
break;
|
|
246
|
+
if (
|
|
247
|
+
(actionMeta.action === 'remove-value' || actionMeta.action === 'pop-value') &&
|
|
248
|
+
newValue.length < minimumLength &&
|
|
249
|
+
isMulti
|
|
250
|
+
) {
|
|
251
|
+
return;
|
|
255
252
|
}
|
|
256
|
-
|
|
253
|
+
if (onChange !== null) onChange(newValue);
|
|
257
254
|
this.setState({ languages: newLanguages });
|
|
258
255
|
};
|
|
259
256
|
|
|
@@ -265,7 +262,7 @@ export default class LanguageSelect extends Component {
|
|
|
265
262
|
return (
|
|
266
263
|
<Select
|
|
267
264
|
isMulti={isMulti}
|
|
268
|
-
className="select__item"
|
|
265
|
+
className="select__item select__item--language"
|
|
269
266
|
classNamePrefix="select"
|
|
270
267
|
options={this.getOptions()}
|
|
271
268
|
components={{ MultiValueLabel, MultiValueRemove, Option }}
|
|
@@ -324,7 +321,7 @@ LanguageSelect.propTypes = {
|
|
|
324
321
|
isMulti: PropTypes.bool,
|
|
325
322
|
placeholder: PropTypes.string,
|
|
326
323
|
value: PropTypes.string,
|
|
327
|
-
defaultValue: PropTypes.
|
|
324
|
+
defaultValue: PropTypes.arrayOf(PropTypes.oneOf(languageOptions.map((x) => x.value))),
|
|
328
325
|
minimumLength: PropTypes.number,
|
|
329
326
|
onChange: PropTypes.func,
|
|
330
327
|
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
|