@woosmap/ui 4.36.3 → 4.36.4
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 +1 -1
- package/src/components/Input/Input.stories.js +1 -1
- package/src/components/Select/LanguageSelect.js +3 -4
- package/src/components/Select/Select.js +12 -4
- package/src/components/Select/Select.stories.js +1 -1
- package/src/styles/console/input.styl +16 -6
- package/src/styles/console/select.styl +11 -1
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ const Template = (args) => {
|
|
|
12
12
|
const { placeholder, label, hideLabel, checked } = args;
|
|
13
13
|
return (
|
|
14
14
|
<div className="mbib--large">
|
|
15
|
-
<Input placeholder={placeholder} hideLabel={hideLabel} icon="search"
|
|
15
|
+
<Input placeholder={placeholder} disabled hideLabel={hideLabel} icon="search" />
|
|
16
16
|
<Input placeholder={placeholder} hideLabel={hideLabel} icon="search" size="large" isFilter isNoBorder />
|
|
17
17
|
<Input placeholder={placeholder} hideLabel={hideLabel} icon="search" size="small" isFilter isNoBorder />
|
|
18
18
|
<Input placeholder={placeholder} label={label} hideLabel={hideLabel} size="large" />
|
|
@@ -240,17 +240,16 @@ export default class LanguageSelect extends Component {
|
|
|
240
240
|
return languageOptions;
|
|
241
241
|
};
|
|
242
242
|
|
|
243
|
-
onChange = (
|
|
243
|
+
onChange = (newLanguages, actionMeta) => {
|
|
244
244
|
const { minimumLength, isMulti, onChange } = this.props;
|
|
245
|
-
const newLanguages = newValue;
|
|
246
245
|
if (
|
|
247
246
|
(actionMeta.action === 'remove-value' || actionMeta.action === 'pop-value') &&
|
|
248
|
-
|
|
247
|
+
newLanguages.length < minimumLength &&
|
|
249
248
|
isMulti
|
|
250
249
|
) {
|
|
251
250
|
return;
|
|
252
251
|
}
|
|
253
|
-
if (onChange !== null) onChange(
|
|
252
|
+
if (onChange !== null) onChange(newLanguages);
|
|
254
253
|
this.setState({ languages: newLanguages });
|
|
255
254
|
};
|
|
256
255
|
|
|
@@ -33,14 +33,20 @@ export default class Select extends Component {
|
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
render() {
|
|
36
|
-
const { size, className, error, label, hideLabel, icon, ...rest } = this.props;
|
|
36
|
+
const { size, className, error, label, hideLabel, icon, disabled, ...rest } = this.props;
|
|
37
37
|
const errorComponent = error ? <span className="select__error">{error}</span> : null;
|
|
38
|
-
const classesContainer = cl(
|
|
38
|
+
const classesContainer = cl(
|
|
39
|
+
'select',
|
|
40
|
+
{ 'select--iconed': icon },
|
|
41
|
+
`select--${size}`,
|
|
42
|
+
disabled && 'select--disabled',
|
|
43
|
+
className
|
|
44
|
+
);
|
|
39
45
|
return (
|
|
40
46
|
<div className={classesContainer}>
|
|
41
47
|
<div className="select__line">
|
|
42
48
|
{hideLabel ? (
|
|
43
|
-
this.renderInput({ error, size, ...rest })
|
|
49
|
+
this.renderInput({ error, size, isDisabled: disabled, ...rest })
|
|
44
50
|
) : (
|
|
45
51
|
<>
|
|
46
52
|
{label && (
|
|
@@ -48,7 +54,7 @@ export default class Select extends Component {
|
|
|
48
54
|
{label}
|
|
49
55
|
</label>
|
|
50
56
|
)}
|
|
51
|
-
{this.renderInput({ error, size, ...rest })}
|
|
57
|
+
{this.renderInput({ error, size, isDisabled: disabled, ...rest })}
|
|
52
58
|
</>
|
|
53
59
|
)}
|
|
54
60
|
{icon}
|
|
@@ -68,6 +74,7 @@ Select.defaultProps = {
|
|
|
68
74
|
error: null,
|
|
69
75
|
isCreatable: false,
|
|
70
76
|
color: undefined,
|
|
77
|
+
disabled: false,
|
|
71
78
|
};
|
|
72
79
|
Select.propTypes = {
|
|
73
80
|
className: PropTypes.string,
|
|
@@ -77,5 +84,6 @@ Select.propTypes = {
|
|
|
77
84
|
hideLabel: PropTypes.bool,
|
|
78
85
|
icon: PropTypes.string,
|
|
79
86
|
isCreatable: PropTypes.bool,
|
|
87
|
+
disabled: PropTypes.bool,
|
|
80
88
|
color: PropTypes.oneOf(['bleu', 'mauve', 'green', 'grey', 'orange', 'red', 'white', undefined, '']),
|
|
81
89
|
};
|
|
@@ -108,12 +108,6 @@ input
|
|
|
108
108
|
position relative
|
|
109
109
|
.input__label
|
|
110
110
|
cursor pointer
|
|
111
|
-
&--disabled
|
|
112
|
-
.input
|
|
113
|
-
&__item
|
|
114
|
-
&__label
|
|
115
|
-
cursor default !important
|
|
116
|
-
opacity .4
|
|
117
111
|
&__line
|
|
118
112
|
.input--checkbox &
|
|
119
113
|
.input--radio &
|
|
@@ -201,6 +195,22 @@ input
|
|
|
201
195
|
line-height revert
|
|
202
196
|
&[type=number]
|
|
203
197
|
-moz-appearance textfield
|
|
198
|
+
&--disabled
|
|
199
|
+
&:not([type=button]):not([type=checkbox]):not([type=radio])
|
|
200
|
+
.icon
|
|
201
|
+
opacity .4
|
|
202
|
+
.input
|
|
203
|
+
&__item
|
|
204
|
+
&__label
|
|
205
|
+
cursor default !important
|
|
206
|
+
opacity .4
|
|
207
|
+
&:focus
|
|
208
|
+
&:hover
|
|
209
|
+
.icon
|
|
210
|
+
stroke $inputBorderColor !important
|
|
211
|
+
.input
|
|
212
|
+
&__item
|
|
213
|
+
border-color $inputBorderColor !important
|
|
204
214
|
input::-webkit-outer-spin-button
|
|
205
215
|
input::-webkit-inner-spin-button
|
|
206
216
|
-webkit-appearance none
|
|
@@ -21,6 +21,10 @@ select
|
|
|
21
21
|
border-radius .6rem !important
|
|
22
22
|
&:not(.select__control--is-focused):not(.asyncselect__control--is-focused)
|
|
23
23
|
border-color $inputBorderColor !important
|
|
24
|
+
.select--is-disabled &
|
|
25
|
+
border-color $inputBorderColor !important
|
|
26
|
+
background-color #ffffff !important
|
|
27
|
+
opacity .4
|
|
24
28
|
.error > &
|
|
25
29
|
border-color $error !important
|
|
26
30
|
&--is-focused
|
|
@@ -85,7 +89,8 @@ select
|
|
|
85
89
|
.select__item--red &
|
|
86
90
|
background-color $labelRed !important
|
|
87
91
|
&--is-disabled
|
|
88
|
-
|
|
92
|
+
cursor default !important
|
|
93
|
+
opacity .4
|
|
89
94
|
&__label
|
|
90
95
|
&__remove
|
|
91
96
|
border-radius .4rem !important
|
|
@@ -101,6 +106,11 @@ select
|
|
|
101
106
|
cursor pointer
|
|
102
107
|
svg
|
|
103
108
|
fill $light !important
|
|
109
|
+
&--disabled
|
|
110
|
+
.select
|
|
111
|
+
&__label
|
|
112
|
+
cursor default !important
|
|
113
|
+
opacity .4
|
|
104
114
|
&--small
|
|
105
115
|
.select
|
|
106
116
|
.asyncselect
|