@xaypay/tui 0.0.56 → 0.0.57
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/dist/index.es.js +242 -118
- package/dist/index.js +241 -119
- package/package.json +4 -4
- package/src/assets/icons/arrow.svg +3 -0
- package/src/assets/icons/close-icon.svg +3 -0
- package/src/components/file/index.js +7 -0
- package/src/components/input/index.js +3 -3
- package/src/components/select/index.js +252 -103
- package/src/components/select/select.module.css +43 -80
- package/src/components/select/select.stories.js +1 -2
- package/src/components/tooltip/index.js +3 -3
- package/src/components/typography/index.js +20 -33
- package/src/components/typography/typography.stories.js +1 -1
- package/src/stories/configuration.stories.mdx +56 -8
- package/src/stories/static/input-tooltip-usage.png +0 -0
- package/src/stories/usage.stories.mdx +4 -0
- package/src/utils/index.js +1 -6
- package/tui.config.js +52 -8
- package/src/components/multiselect/index.js +0 -96
- package/src/components/multiselect/multiselect.module.css +0 -137
- package/src/components/multiselect/multiselect.stories.js +0 -20
|
@@ -1,50 +1,116 @@
|
|
|
1
1
|
import React, {useEffect, useState, useRef} from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
-
import
|
|
5
|
-
import Icon from '../icon/Icon'
|
|
6
|
-
|
|
4
|
+
import { compereConfigs } from "./../../utils";
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
PRIMARY: 'select-primary',
|
|
11
|
-
SUCCESS: 'select-success',
|
|
12
|
-
INFO: 'select-info',
|
|
13
|
-
WARNING: 'select-warning',
|
|
14
|
-
DANGER: 'select-danger',
|
|
15
|
-
LINK: 'select-link'
|
|
16
|
-
};
|
|
6
|
+
import ReactArrowIcon from './../../assets/icons/arrow.svg';
|
|
7
|
+
import ReactCloseIcon from './../../assets/icons/close-icon.svg';
|
|
17
8
|
|
|
18
|
-
|
|
19
|
-
SMALL: 'small',
|
|
20
|
-
MEDIUM: 'medium',
|
|
21
|
-
LARGE: 'large'
|
|
22
|
-
};
|
|
9
|
+
import styles from './select.module.css';
|
|
23
10
|
|
|
24
11
|
export const Select = ({
|
|
25
|
-
theme,
|
|
26
|
-
size,
|
|
27
|
-
className,
|
|
28
12
|
disabled,
|
|
29
|
-
label,
|
|
30
13
|
jsonData,
|
|
31
|
-
eMessage,
|
|
32
14
|
required,
|
|
33
|
-
defaultOption,
|
|
34
15
|
onChange,
|
|
35
16
|
keyNames,
|
|
36
|
-
selected
|
|
37
|
-
|
|
17
|
+
selected,
|
|
18
|
+
className,
|
|
19
|
+
arrowIcon,
|
|
20
|
+
closeIcon,
|
|
21
|
+
errorMessage,
|
|
22
|
+
defaultOption,
|
|
23
|
+
|
|
24
|
+
label,
|
|
25
|
+
labelColor,
|
|
26
|
+
labelWeight,
|
|
27
|
+
labelDisplay,
|
|
28
|
+
labelFontSize,
|
|
29
|
+
labelLineHeight,
|
|
30
|
+
labelMarginBottom,
|
|
31
|
+
labelTextTransform,
|
|
38
32
|
|
|
33
|
+
cursor,
|
|
34
|
+
errorSize,
|
|
35
|
+
errorColor,
|
|
36
|
+
selectedColor,
|
|
37
|
+
selectedRadius,
|
|
38
|
+
selectedHeight,
|
|
39
|
+
selectedBorder,
|
|
40
|
+
selectedPadding,
|
|
41
|
+
selectedFontSize,
|
|
42
|
+
selectedBoxSizing,
|
|
43
|
+
selectedFontWeight,
|
|
44
|
+
selectedLineHeight,
|
|
45
|
+
selectedHoverColor,
|
|
46
|
+
selectedTransition,
|
|
47
|
+
selectedBorderColor,
|
|
48
|
+
|
|
49
|
+
optionsBoxShadow,
|
|
50
|
+
optionsBorderRadius,
|
|
51
|
+
optionsBackgroundColor,
|
|
52
|
+
|
|
53
|
+
optionItemColor,
|
|
54
|
+
optionItemCursor,
|
|
55
|
+
optionItemPadding,
|
|
56
|
+
optionItemFontSize,
|
|
57
|
+
optionItemMinHeight,
|
|
58
|
+
optionItemBoxSizing,
|
|
59
|
+
optionItemFontWeight,
|
|
60
|
+
optionItemLineHeight,
|
|
61
|
+
optionItemColorHover,
|
|
62
|
+
optionItemMarginBottom,
|
|
63
|
+
optionItemBackgroudColor,
|
|
64
|
+
optionItemBackgroudColorHover,
|
|
65
|
+
}) => {
|
|
39
66
|
const options = jsonData.length ? JSON.parse(jsonData) : [];
|
|
40
67
|
const ref = useRef();
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
68
|
+
|
|
69
|
+
const [opened, setOpened] = useState(false);
|
|
70
|
+
const [isHover, setIsHover] = useState(false);
|
|
71
|
+
const [newSelected, setNewSelected] = useState({});
|
|
72
|
+
|
|
73
|
+
const configStyles = compereConfigs();
|
|
74
|
+
const classProps = classnames(
|
|
75
|
+
className
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const handleOpenClose = () => {
|
|
79
|
+
setOpened(!opened);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const handleClearSelect = (e) => {
|
|
83
|
+
onChange({});
|
|
84
|
+
setNewSelected({})
|
|
85
|
+
e.stopPropagation();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const handleSelectItem = (option) => {
|
|
89
|
+
onChange(option);
|
|
90
|
+
setOpened(!opened);
|
|
91
|
+
setNewSelected(option);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const handleMouseEnter = () => {
|
|
95
|
+
setIsHover(true);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const handleMouseLeave = () => {
|
|
99
|
+
setIsHover(false);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const handleMouseEnterOption = (e) => {
|
|
103
|
+
e.target.style.color = optionItemColorHover ? optionItemColorHover : configStyles.SELECT.optionItemColorHover;
|
|
104
|
+
e.target.style.backgroundColor = optionItemBackgroudColorHover ? optionItemBackgroudColorHover : configStyles.SELECT.optionItemBackgroudColorHover;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const handleMouseLeaveOption = (e) => {
|
|
108
|
+
e.target.style.color = optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor
|
|
109
|
+
e.target.style.backgroundColor = optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor;
|
|
110
|
+
};
|
|
44
111
|
|
|
45
112
|
useEffect(()=>{
|
|
46
|
-
const parseSelectedData =
|
|
47
|
-
selected.length !== 0 ? JSON.parse(selected) : {};
|
|
113
|
+
const parseSelectedData = selected.length !== 0 ? JSON.parse(selected) : {};
|
|
48
114
|
setNewSelected(parseSelectedData);
|
|
49
115
|
},[selected])
|
|
50
116
|
|
|
@@ -61,106 +127,189 @@ export const Select = ({
|
|
|
61
127
|
}
|
|
62
128
|
}
|
|
63
129
|
}, [opened]);
|
|
64
|
-
|
|
65
|
-
const classProps = classnames(
|
|
66
|
-
styles[theme],
|
|
67
|
-
styles[size],
|
|
68
|
-
{
|
|
69
|
-
[styles.disabled]: disabled,
|
|
70
|
-
[styles.required]: required,
|
|
71
|
-
},
|
|
72
|
-
className
|
|
73
|
-
);
|
|
74
130
|
|
|
75
131
|
return (
|
|
76
|
-
<div>
|
|
77
|
-
{
|
|
78
|
-
|
|
79
|
-
|
|
132
|
+
<div className={classProps}>
|
|
133
|
+
{
|
|
134
|
+
label ?
|
|
135
|
+
<label
|
|
136
|
+
style={{
|
|
137
|
+
color: labelColor ? labelColor : configStyles.SELECT.labelColor,
|
|
138
|
+
fontWeight: labelWeight ? labelWeight : configStyles.SELECT.labelWeight,
|
|
139
|
+
display: labelDisplay ? labelDisplay : configStyles.SELECT.labelDisplay,
|
|
140
|
+
fontSize: labelFontSize ? labelFontSize : configStyles.SELECT.labelFontSize,
|
|
141
|
+
lineHeight: labelLineHeight ? labelLineHeight : configStyles.SELECT.labelLineHeight,
|
|
142
|
+
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.SELECT.labelMarginBottom,
|
|
143
|
+
textTransform: labelTextTransform ? labelTextTransform : configStyles.SELECT.labelTextTransform
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
{label}
|
|
147
|
+
{required && <sup style={{color: "#ee0000"}}>*</sup>}
|
|
148
|
+
</label> : ""
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
<div ref={ref}>
|
|
152
|
+
<div className={styles['select-content']}>
|
|
80
153
|
<div
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
154
|
+
style={{
|
|
155
|
+
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.SELECT.cursor,
|
|
156
|
+
height: selectedHeight ? selectedHeight : configStyles.SELECT.selectedHeight,
|
|
157
|
+
border: selectedBorder ? selectedBorder : configStyles.SELECT.selectedBorder,
|
|
158
|
+
padding: selectedPadding ? selectedPadding : configStyles.SELECT.selectedPadding,
|
|
159
|
+
borderRadius: selectedRadius ? selectedRadius : configStyles.SELECT.selectedRadius,
|
|
160
|
+
fontSize: selectedFontSize ? selectedFontSize : configStyles.SELECT.selectedFontSize,
|
|
161
|
+
boxSizing: selectedBoxSizing ? selectedBoxSizing : configStyles.SELECT.selectedBoxSizing,
|
|
162
|
+
fontWeight: selectedFontWeight ? selectedFontWeight : configStyles.SELECT.selectedFontWeight,
|
|
163
|
+
lineHeight: selectedLineHeight ? selectedLineHeight : configStyles.SELECT.selectedLineHeight,
|
|
164
|
+
transition: selectedTransition ? selectedTransition : configStyles.SELECT.selectedTransition,
|
|
165
|
+
borderColor: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : selectedBorderColor ? selectedBorderColor : configStyles.SELECT.selectedBorderColor
|
|
84
166
|
}}
|
|
167
|
+
onClick={disabled ? _ => _ : _ => handleOpenClose()}
|
|
168
|
+
onMouseEnter={disabled ? _ => _ : handleMouseEnter}
|
|
169
|
+
onMouseLeave={disabled ? _ => _ : handleMouseLeave}
|
|
170
|
+
className={`${styles['select-content-top']}`}
|
|
85
171
|
>
|
|
86
|
-
<div
|
|
87
|
-
|
|
172
|
+
<div
|
|
173
|
+
className={`${styles['select-content-top-text']}`}
|
|
174
|
+
style={{
|
|
175
|
+
color: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : isHover ? selectedHoverColor ? selectedHoverColor : configStyles.SELECT.selectedHoverColor : selectedColor ? selectedColor : configStyles.SELECT.selectedColor,
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
{newSelected && newSelected[keyNames.name] ? newSelected[keyNames.name] : defaultOption}
|
|
179
|
+
</div>
|
|
180
|
+
<div className={`${styles['select-content-top-icon']}`}>
|
|
88
181
|
|
|
89
182
|
{Object.keys(newSelected).length > 0 &&
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}/>
|
|
183
|
+
<div
|
|
184
|
+
className={`${styles['close-icon']}`}
|
|
185
|
+
onClick={disabled ? _ => _ : handleClearSelect}
|
|
186
|
+
>
|
|
187
|
+
{ closeIcon ? closeIcon : <img src={ReactCloseIcon} alt="icon" /> }
|
|
188
|
+
</div>
|
|
97
189
|
}
|
|
98
|
-
<i className={opened ? 'icon-icon-up' : 'icon-icon-down'}/>
|
|
99
190
|
|
|
191
|
+
<div
|
|
192
|
+
style={{
|
|
193
|
+
transform: opened ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
194
|
+
}}
|
|
195
|
+
className={`${styles['arrow-icon']}`}>
|
|
196
|
+
{arrowIcon ? arrowIcon : <img src={ReactArrowIcon} alt="icon"/>}
|
|
197
|
+
</div>
|
|
100
198
|
</div>
|
|
101
199
|
</div>
|
|
102
200
|
{
|
|
103
201
|
opened && !disabled ?
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
202
|
+
<div
|
|
203
|
+
style={{
|
|
204
|
+
boxShadow: optionsBoxShadow ? optionsBoxShadow : configStyles.SELECT.optionsBoxShadow,
|
|
205
|
+
borderRadius: optionsBorderRadius ? optionsBorderRadius : configStyles.SELECT.optionsBorderRadius,
|
|
206
|
+
backgroundColor: optionsBackgroundColor ? optionsBackgroundColor : configStyles.SELECT.optionsBackgroundColor,
|
|
207
|
+
top: parseFloat( selectedHeight ? selectedHeight.substring(0, selectedHeight.length - 2) : configStyles.SELECT.selectedHeight.substring(0, configStyles.SELECT.selectedHeight.length - 2)) + 6 + 'px'
|
|
208
|
+
}}
|
|
209
|
+
className={`${styles['select-content-bottom']}`}
|
|
210
|
+
>
|
|
211
|
+
<div className={`${styles['select-content-bottom-inner']}`}>
|
|
212
|
+
{
|
|
213
|
+
options.map((option, i) => {
|
|
214
|
+
return <div
|
|
215
|
+
key={i}
|
|
216
|
+
disabled={true}
|
|
217
|
+
defaultValue={option[keyNames.id]}
|
|
218
|
+
onClick={disabled ? _ => _ : _ => handleSelectItem(option)}
|
|
219
|
+
onMouseEnter={disabled ? _ => _ : e => handleMouseEnterOption(e)}
|
|
220
|
+
onMouseLeave={disabled ? _ => _ : e => handleMouseLeaveOption(e)}
|
|
221
|
+
className={`${styles['select-content-bottom-row']}`}
|
|
222
|
+
style={{
|
|
223
|
+
color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
|
|
224
|
+
cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
|
|
225
|
+
padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
|
|
226
|
+
fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
|
|
227
|
+
boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
|
|
228
|
+
minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
229
|
+
fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
|
|
230
|
+
lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
231
|
+
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
232
|
+
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor,
|
|
233
|
+
}}
|
|
234
|
+
>
|
|
133
235
|
{option[keyNames.name]}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</div>
|
|
236
|
+
</div>
|
|
237
|
+
})
|
|
238
|
+
}
|
|
138
239
|
</div>
|
|
139
|
-
: null
|
|
240
|
+
</div> : null
|
|
140
241
|
}
|
|
141
242
|
</div>
|
|
142
243
|
</div>
|
|
143
|
-
|
|
244
|
+
|
|
245
|
+
{
|
|
246
|
+
errorMessage ?
|
|
247
|
+
<span
|
|
248
|
+
style={{
|
|
249
|
+
color: errorColor ? errorColor : configStyles.SELECT.errorColor,
|
|
250
|
+
fontSize: errorSize ? errorSize : configStyles.SELECT.errorSize
|
|
251
|
+
}}
|
|
252
|
+
>
|
|
253
|
+
{errorMessage}
|
|
254
|
+
</span>
|
|
255
|
+
: ''
|
|
256
|
+
}
|
|
144
257
|
</div>
|
|
145
258
|
);
|
|
146
259
|
};
|
|
147
260
|
|
|
148
261
|
Select.propTypes = {
|
|
149
|
-
theme: PropTypes.oneOf(Object.values(SelectTheme)),
|
|
150
|
-
size: PropTypes.oneOf(Object.values(SelectSize)),
|
|
151
|
-
label: PropTypes.string,
|
|
152
|
-
eMessage: PropTypes.string,
|
|
153
|
-
defaultOption: PropTypes.string,
|
|
154
262
|
onChange: PropTypes.func,
|
|
155
263
|
required: PropTypes.bool,
|
|
156
264
|
disabled: PropTypes.bool,
|
|
157
|
-
className: PropTypes.string,
|
|
158
265
|
selected: PropTypes.string,
|
|
159
266
|
jsonData: PropTypes.string,
|
|
160
267
|
keyNames: PropTypes.object,
|
|
161
|
-
|
|
268
|
+
className: PropTypes.string,
|
|
269
|
+
arrowIcon: PropTypes.element,
|
|
270
|
+
closeIcon: PropTypes.element,
|
|
271
|
+
errorMessage: PropTypes.string,
|
|
272
|
+
defaultOption: PropTypes.string,
|
|
273
|
+
|
|
274
|
+
label: PropTypes.string,
|
|
275
|
+
labelColor: PropTypes.string,
|
|
276
|
+
labelWeight: PropTypes.string,
|
|
277
|
+
labelDisplay: PropTypes.string,
|
|
278
|
+
labelFontSize: PropTypes.string,
|
|
279
|
+
labelLineHeight: PropTypes.string,
|
|
280
|
+
labelMarginBottom: PropTypes.string,
|
|
281
|
+
labelTextTransform: PropTypes.string,
|
|
162
282
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
283
|
+
cursor: PropTypes.string,
|
|
284
|
+
errorSize: PropTypes.string,
|
|
285
|
+
errorColor: PropTypes.string,
|
|
286
|
+
selectedColor: PropTypes.string,
|
|
287
|
+
selectedBorder: PropTypes.string,
|
|
288
|
+
selectedRadius: PropTypes.string,
|
|
289
|
+
selectedHeight: PropTypes.string,
|
|
290
|
+
selectedPadding: PropTypes.string,
|
|
291
|
+
selectedFontSize: PropTypes.string,
|
|
292
|
+
selectedBoxSizing: PropTypes.string,
|
|
293
|
+
selectedHoverColor: PropTypes.string,
|
|
294
|
+
selectedFontWeight: PropTypes.string,
|
|
295
|
+
selectedLineHeight: PropTypes.string,
|
|
296
|
+
selectedTransition: PropTypes.string,
|
|
297
|
+
selectedBorderColor: PropTypes.string,
|
|
298
|
+
|
|
299
|
+
optionsBoxShadow: PropTypes.string,
|
|
300
|
+
optionsBorderRadius: PropTypes.string,
|
|
301
|
+
optionsBackgroundColor: PropTypes.string,
|
|
302
|
+
|
|
303
|
+
optionItemColor: PropTypes.string,
|
|
304
|
+
optionItemCursor: PropTypes.string,
|
|
305
|
+
optionItemPadding: PropTypes.string,
|
|
306
|
+
optionItemFontSize: PropTypes.string,
|
|
307
|
+
optionItemMinHeight: PropTypes.string,
|
|
308
|
+
optionItemBoxSizing: PropTypes.string,
|
|
309
|
+
optionItemFontWeight: PropTypes.string,
|
|
310
|
+
optionItemColorHover: PropTypes.string,
|
|
311
|
+
optionItemLineHeight: PropTypes.string,
|
|
312
|
+
optionItemMarginBottom: PropTypes.string,
|
|
313
|
+
optionItemBackgroudColor: PropTypes.string,
|
|
314
|
+
optionItemBackgroudColorHover: PropTypes.string,
|
|
315
|
+
};
|
|
@@ -1,53 +1,28 @@
|
|
|
1
|
-
.select-title {
|
|
2
|
-
display: block;
|
|
3
|
-
text-transform: none;
|
|
4
|
-
font-size: 16px;
|
|
5
|
-
color: #3C393E;
|
|
6
|
-
line-height: 22px;
|
|
7
|
-
font-weight: 500;
|
|
8
|
-
margin-bottom: 6px;
|
|
9
|
-
}
|
|
10
1
|
.select-content {
|
|
11
2
|
display: flex;
|
|
12
3
|
flex-direction: column;
|
|
13
4
|
position: relative;
|
|
14
5
|
}
|
|
6
|
+
|
|
15
7
|
.select-content-top {
|
|
16
8
|
display: flex;
|
|
17
9
|
flex-direction: row;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
font-size: 16px;
|
|
22
|
-
color: #3C393E;
|
|
23
|
-
line-height: 22px;
|
|
24
|
-
font-weight: 500;
|
|
25
|
-
border: 2px solid #D1D1D1;
|
|
26
|
-
border-radius: 6px;
|
|
27
|
-
transition: border-color 240ms;
|
|
28
|
-
box-sizing: border-box;
|
|
29
|
-
cursor: pointer;
|
|
30
|
-
}
|
|
31
|
-
.select-content-top.active {
|
|
32
|
-
border-color: #00236A;
|
|
33
|
-
}
|
|
34
|
-
.select-content-top:hover {
|
|
35
|
-
border-color: #3C393E;
|
|
10
|
+
flex-wrap: nowrap;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: space-between;
|
|
36
13
|
}
|
|
14
|
+
|
|
37
15
|
.select-content-bottom {
|
|
38
16
|
position: absolute;
|
|
39
17
|
width: 100%;
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
left: 0px;
|
|
19
|
+
z-index: 1;
|
|
20
|
+
max-height: 0;
|
|
42
21
|
overflow: hidden;
|
|
43
|
-
max-width: 400px;
|
|
44
|
-
background: #FBFBFB;
|
|
45
|
-
box-shadow: 0 0 10px rgba(60, 57, 62, 0.08);
|
|
46
|
-
border-radius: 6px;
|
|
47
22
|
animation: select-show 640ms linear forwards;
|
|
48
|
-
|
|
49
|
-
z-index: 1;
|
|
23
|
+
-webkit-animation: select-show 640ms linear forwards;
|
|
50
24
|
}
|
|
25
|
+
|
|
51
26
|
.select-content-bottom-inner {
|
|
52
27
|
display: flex;
|
|
53
28
|
flex-direction: column;
|
|
@@ -55,66 +30,54 @@
|
|
|
55
30
|
overflow-x: hidden;
|
|
56
31
|
max-height: 234px;
|
|
57
32
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
max-height: 400px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
.select-content-top-text {
|
|
64
|
-
flex: 1;
|
|
33
|
+
|
|
34
|
+
.select-content-top-icon {
|
|
65
35
|
display: flex;
|
|
66
|
-
flex
|
|
67
|
-
flex-wrap: nowrap;
|
|
36
|
+
flex: 0 0 auto;
|
|
68
37
|
align-items: center;
|
|
69
|
-
}
|
|
70
|
-
.select-content-top-icon {
|
|
71
38
|
padding: 0 5px 0 20px;
|
|
72
39
|
box-sizing: border-box;
|
|
73
40
|
}
|
|
74
|
-
|
|
41
|
+
|
|
42
|
+
.select-content-top-icon > div {
|
|
75
43
|
display: flex;
|
|
44
|
+
width: 14px;
|
|
45
|
+
height: 14px;
|
|
76
46
|
align-items: center;
|
|
77
|
-
|
|
47
|
+
justify-content: center;
|
|
78
48
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
.select-content-top-icon > i:not(:last-child){
|
|
84
|
-
padding: 0 8px;
|
|
49
|
+
|
|
50
|
+
.close-icon {
|
|
51
|
+
padding-right: 9px;
|
|
85
52
|
border-right: 1px solid #EEEEEE;
|
|
86
|
-
margin-right: 8px;
|
|
87
|
-
height: 22px;
|
|
88
|
-
display: flex;
|
|
89
|
-
align-items: center;
|
|
90
53
|
}
|
|
54
|
+
|
|
55
|
+
.arrow-icon{
|
|
56
|
+
margin-left: 9px;
|
|
57
|
+
transform-origin: center;
|
|
58
|
+
transition: all 640ms ease;
|
|
59
|
+
-webkit-transition: all 640ms ease;
|
|
60
|
+
-moz-transition: all 640ms ease;
|
|
61
|
+
-ms-transition: all 640ms ease;
|
|
62
|
+
-o-transition: all 640ms ease;
|
|
63
|
+
}
|
|
64
|
+
|
|
91
65
|
.select-content-bottom-row {
|
|
92
66
|
display: flex;
|
|
93
67
|
align-items: center;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
line-height: 22px;
|
|
100
|
-
font-weight: 500;
|
|
101
|
-
margin-bottom: 2px;
|
|
102
|
-
box-sizing: border-box;
|
|
103
|
-
transition: background 240ms, color 240ms;
|
|
104
|
-
cursor: pointer;
|
|
105
|
-
}
|
|
106
|
-
.select-content-bottom-row:last-child {
|
|
107
|
-
margin-bottom: 0;
|
|
108
|
-
}
|
|
109
|
-
.select-content-bottom-row:hover {
|
|
110
|
-
background: unset;
|
|
111
|
-
color: #00236A;;
|
|
68
|
+
transition: background-color 240ms, color 240ms;
|
|
69
|
+
-webkit-transition: background-color 240ms, color 240ms;
|
|
70
|
+
-moz-transition: background-color 240ms, color 240ms;
|
|
71
|
+
-ms-transition: background-color 240ms, color 240ms;
|
|
72
|
+
-o-transition: background-color 240ms, color 240ms;
|
|
112
73
|
}
|
|
113
74
|
|
|
114
|
-
.
|
|
115
|
-
|
|
75
|
+
.select-content-bottom-row:last-child {
|
|
76
|
+
margin-bottom: 0px;
|
|
116
77
|
}
|
|
117
78
|
|
|
118
|
-
|
|
119
|
-
|
|
79
|
+
@keyframes select-show {
|
|
80
|
+
100% {
|
|
81
|
+
max-height: 234px;
|
|
82
|
+
}
|
|
120
83
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select
|
|
1
|
+
import { Select } from ".";
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
component: Select,
|
|
@@ -9,7 +9,6 @@ const Template = (args) => <Select label='' {...args} >Default</Select>;
|
|
|
9
9
|
|
|
10
10
|
export const Default = Template.bind({});
|
|
11
11
|
Default.args = {
|
|
12
|
-
theme: SelectTheme.DEFAULT,
|
|
13
12
|
label: 'վարչական շրջան',
|
|
14
13
|
jsonData: '[{"bbb":"0", "value":"Արաբկիր"}, {"bbb":"1", "value":"Կենտրոն"}, {"bbb":"2", "value":"Մալաթիա"}]',
|
|
15
14
|
onChange: (newValue)=> {
|
|
@@ -95,7 +95,7 @@ export const Tooltip = ({
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
<div style={{cursor: 'pointer'}} onClick={handleShow}>
|
|
98
|
-
{tooltipIcon
|
|
98
|
+
{tooltipIcon ? tooltipIcon : <img src={ReactInfoIcon} />}
|
|
99
99
|
</div>
|
|
100
100
|
</div>
|
|
101
101
|
);
|
|
@@ -111,11 +111,11 @@ Tooltip.propTypes = {
|
|
|
111
111
|
className: PropTypes.string,
|
|
112
112
|
fontFamily: PropTypes.string,
|
|
113
113
|
tooltipWidth: PropTypes.string,
|
|
114
|
+
tooltipIcon: PropTypes.element,
|
|
114
115
|
tooltipRadius: PropTypes.string,
|
|
115
116
|
text: PropTypes.string.isRequired,
|
|
116
117
|
backgroundColor: PropTypes.string,
|
|
117
|
-
tooltipBackgroundColor: PropTypes.string
|
|
118
|
-
tooltipIcon: PropTypes.arrayOf(PropTypes.element)
|
|
118
|
+
tooltipBackgroundColor: PropTypes.string
|
|
119
119
|
};
|
|
120
120
|
|
|
121
121
|
Tooltip.defaultProps = {
|