@xaypay/tui 0.0.69 → 0.0.70
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 +595 -166
- package/dist/index.js +596 -166
- package/package.json +1 -1
- package/src/assets/icons/range-arrow-default.svg +19 -0
- package/src/assets/icons/range-arrow-error.svg +19 -0
- package/src/assets/icons/range-arrow-success.svg +19 -0
- package/src/components/captcha/captcha.module.css +61 -62
- package/src/components/captcha/captcha.stories.js +5 -4
- package/src/components/captcha/index.js +143 -56
- package/src/components/file/file.module.css +1 -1
- package/src/components/file/index.js +8 -5
- package/src/components/icon/CaptchaArrowDown.js +19 -0
- package/src/components/icon/CaptchaArrowUp.js +19 -0
- package/src/components/icon/PDF.js +19 -0
- package/src/components/icon/index.js +15 -10
- package/src/components/newAutocomplete/NewAutocomplete.stories.js +50 -0
- package/src/components/newAutocomplete/index.js +407 -0
- package/src/index.js +2 -1
- package/src/stories/configuration.stories.mdx +86 -0
- package/src/stories/static/captcha-usage.png +0 -0
- package/src/stories/static/new-autocomplete-usage.png +0 -0
- package/src/stories/usage.stories.mdx +10 -3
- package/tui.config.js +98 -22
- package/src/components/captcha/blue.png +0 -0
- package/src/components/captcha/green.png +0 -0
- package/src/components/captcha/red.png +0 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
|
|
4
|
+
import { keyframes, css } from 'styled-components';
|
|
5
|
+
|
|
6
|
+
import { compereConfigs } from './../../utils';
|
|
7
|
+
|
|
8
|
+
export const NewAutocomplete = ({
|
|
9
|
+
label,
|
|
10
|
+
options,
|
|
11
|
+
getItem,
|
|
12
|
+
required,
|
|
13
|
+
disabled,
|
|
14
|
+
errorSize,
|
|
15
|
+
labelSize,
|
|
16
|
+
errorColor,
|
|
17
|
+
labelColor,
|
|
18
|
+
labelWeight,
|
|
19
|
+
searchCount,
|
|
20
|
+
placeHolder,
|
|
21
|
+
errorMessage,
|
|
22
|
+
autoComplete,
|
|
23
|
+
labelDisplay,
|
|
24
|
+
contentDisplay,
|
|
25
|
+
contentTopSize,
|
|
26
|
+
contentPosition,
|
|
27
|
+
contentTopColor,
|
|
28
|
+
labelLineHeight,
|
|
29
|
+
contentDirection,
|
|
30
|
+
contentTopWeight,
|
|
31
|
+
contentTopRadius,
|
|
32
|
+
contentTopHeight,
|
|
33
|
+
contentTopBorder,
|
|
34
|
+
labelMarginBottom,
|
|
35
|
+
contentTopDisplay,
|
|
36
|
+
contentTopPadding,
|
|
37
|
+
contentBottomLeft,
|
|
38
|
+
showOptionDuration,
|
|
39
|
+
labelRequiredColor,
|
|
40
|
+
contentTopMaxWidth,
|
|
41
|
+
labelTextTransform,
|
|
42
|
+
contentBottomWidth,
|
|
43
|
+
contentBottomZindex,
|
|
44
|
+
contentBottomRadius,
|
|
45
|
+
contentTopDirection,
|
|
46
|
+
contentTopBoxSizing,
|
|
47
|
+
contentTopLineHeight,
|
|
48
|
+
contentTopBorderColor,
|
|
49
|
+
contentBottomMaxWidth,
|
|
50
|
+
contentBottomOverflow,
|
|
51
|
+
contentBottomPosition,
|
|
52
|
+
contentBottomRowColor,
|
|
53
|
+
contentBottomMinHeight,
|
|
54
|
+
contentBottomBoxShadow,
|
|
55
|
+
contentBottomRowHeight,
|
|
56
|
+
contentBottomRowCursor,
|
|
57
|
+
contentBottomRowDisplay,
|
|
58
|
+
contentBottomRowPadding,
|
|
59
|
+
contentBottomRowFontSize,
|
|
60
|
+
contentBottomRowBoxSizing,
|
|
61
|
+
contentBottomInnerDisplay,
|
|
62
|
+
contentBottomRowFontWeight,
|
|
63
|
+
contentBottomRowLineHeight,
|
|
64
|
+
contentBottomRowAlignItems,
|
|
65
|
+
contentBottomRowTransition,
|
|
66
|
+
contentBottomRowHoverColor,
|
|
67
|
+
contentTopBorderHoverColor,
|
|
68
|
+
contentTopBorderActiveColor,
|
|
69
|
+
contentBottomInnerOverflowY,
|
|
70
|
+
contentBottomInnerOverflowX,
|
|
71
|
+
contentBottomInnerMaxHeight,
|
|
72
|
+
contentBottomInnerDirection,
|
|
73
|
+
contentBottomBackgroundColor,
|
|
74
|
+
contentBottomRowMarginBottom,
|
|
75
|
+
contentBottomRowBackgroundColor,
|
|
76
|
+
contentBottomRowHoverBackgroundColor,
|
|
77
|
+
...props
|
|
78
|
+
}) => {
|
|
79
|
+
const [show, setShow] = useState(false);
|
|
80
|
+
const [isHover, setIsHover] = useState(false);
|
|
81
|
+
const [isFocus, setIsFocus] = useState(false);
|
|
82
|
+
const [innerValue, setInnerValue] = useState('');
|
|
83
|
+
const configStyles = compereConfigs();
|
|
84
|
+
|
|
85
|
+
const showOption = keyframes`
|
|
86
|
+
100% {
|
|
87
|
+
max-height: 400px;
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
const animation = _ => css`
|
|
92
|
+
${showOption} ${showOptionDuration ? showOptionDuration : configStyles.NEWAUTOCOMPLETE.showOptionDuration} linear forwards
|
|
93
|
+
`;
|
|
94
|
+
|
|
95
|
+
const handleMouseEnter = () => {
|
|
96
|
+
setIsHover(true);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const handleMouseLeave = () => {
|
|
100
|
+
setIsHover(false);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const handleRowMouseEnter = (e) => {
|
|
104
|
+
e.target.style.color = contentBottomRowHoverColor ? contentBottomRowHoverColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowHoverColor;
|
|
105
|
+
e.target.style.backgroundColor = contentBottomRowHoverBackgroundColor ? contentBottomRowHoverBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowHoverBackgroundColor;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const handleRowMouseLeave = (e) => {
|
|
109
|
+
e.target.style.color = contentBottomRowColor ? contentBottomRowColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowColor;
|
|
110
|
+
e.target.style.backgroundColor = contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const handleFocus = () => {
|
|
114
|
+
setIsFocus(true);
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const handleBlur = () => {
|
|
118
|
+
setIsFocus(false);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const handleChange = (e) => {
|
|
122
|
+
const value = e.target.value;
|
|
123
|
+
value.length > 0 ? setShow(true) : setShow(false);
|
|
124
|
+
setInnerValue(value);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const handleClick = (selectedValue) => {
|
|
128
|
+
setShow(false);
|
|
129
|
+
getItem(selectedValue);
|
|
130
|
+
setInnerValue(selectedValue.value);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const optionList = (
|
|
134
|
+
<>
|
|
135
|
+
{
|
|
136
|
+
show && options && options.length > 0 && <div
|
|
137
|
+
style={{
|
|
138
|
+
left: contentBottomLeft ? contentBottomLeft : configStyles.NEWAUTOCOMPLETE.contentBottomLeft,
|
|
139
|
+
width: contentBottomWidth ? contentBottomWidth : configStyles.NEWAUTOCOMPLETE.contentBottomWidth,
|
|
140
|
+
zIndex: contentBottomZindex ? contentBottomZindex : configStyles.NEWAUTOCOMPLETE.contentBottomZindex,
|
|
141
|
+
borderRadius: contentBottomRadius ? contentBottomRadius : configStyles.NEWAUTOCOMPLETE.contentBottomRadius,
|
|
142
|
+
maxWidth: contentBottomMaxWidth ? contentBottomMaxWidth : configStyles.NEWAUTOCOMPLETE.contentBottomMaxWidth,
|
|
143
|
+
overflow: contentBottomOverflow ? contentBottomOverflow : configStyles.NEWAUTOCOMPLETE.contentBottomOverflow,
|
|
144
|
+
position: contentBottomPosition ? contentBottomPosition : configStyles.NEWAUTOCOMPLETE.contentBottomPosition,
|
|
145
|
+
minHeight: contentBottomMinHeight ? contentBottomMinHeight : configStyles.NEWAUTOCOMPLETE.contentBottomMinHeight,
|
|
146
|
+
boxShadow: contentBottomBoxShadow ? contentBottomBoxShadow : configStyles.NEWAUTOCOMPLETE.contentBottomBoxShadow,
|
|
147
|
+
backgroundColor: contentBottomBackgroundColor ? contentBottomBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomBackgroundColor,
|
|
148
|
+
top: contentTopHeight ?
|
|
149
|
+
contentTopHeight.includes('rem') ?
|
|
150
|
+
parseFloat(contentTopHeight.substr(0, contentTopHeight.length - 3)) + 0.6 + 'rem' :
|
|
151
|
+
parseFloat(contentTopHeight.substr(0, contentTopHeight.length - 2)) + 6 + 'px'
|
|
152
|
+
: configStyles.NEWAUTOCOMPLETE.contentTopHeight.includes('rem') ?
|
|
153
|
+
parseFloat(configStyles.NEWAUTOCOMPLETE.contentTopHeight.substr(0, configStyles.NEWAUTOCOMPLETE.contentTopHeight.length - 3)) + 0.6 + 'rem' :
|
|
154
|
+
parseFloat(configStyles.NEWAUTOCOMPLETE.contentTopHeight.substr(0, configStyles.NEWAUTOCOMPLETE.contentTopHeight.length - 2)) + 6 + 'px',
|
|
155
|
+
animation
|
|
156
|
+
}}
|
|
157
|
+
>
|
|
158
|
+
<div
|
|
159
|
+
style={{
|
|
160
|
+
display: contentBottomInnerDisplay ? contentBottomInnerDisplay : configStyles.NEWAUTOCOMPLETE.contentBottomInnerDisplay,
|
|
161
|
+
overflowY: contentBottomInnerOverflowY ? contentBottomInnerOverflowY : configStyles.NEWAUTOCOMPLETE.contentBottomInnerOverflowY,
|
|
162
|
+
overflowX: contentBottomInnerOverflowX ? contentBottomInnerOverflowX : configStyles.NEWAUTOCOMPLETE.contentBottomInnerOverflowX,
|
|
163
|
+
maxHeight: contentBottomInnerMaxHeight ? contentBottomInnerMaxHeight : configStyles.NEWAUTOCOMPLETE.contentBottomInnerMaxHeight,
|
|
164
|
+
flexDirection: contentBottomInnerDirection ? contentBottomInnerDirection : configStyles.NEWAUTOCOMPLETE.contentBottomInnerDirection
|
|
165
|
+
}}
|
|
166
|
+
>
|
|
167
|
+
{
|
|
168
|
+
innerValue.length >= searchCount ?
|
|
169
|
+
options.filter(item => item.value.includes(innerValue)).length > 0 ?
|
|
170
|
+
options.filter(item => item.value.includes(innerValue)).map((item, index) => {
|
|
171
|
+
return (
|
|
172
|
+
<p
|
|
173
|
+
key={`${item}_${index}`}
|
|
174
|
+
onMouseEnter={handleRowMouseEnter}
|
|
175
|
+
onMouseLeave={handleRowMouseLeave}
|
|
176
|
+
onClick={() => handleClick(item)}
|
|
177
|
+
style={{
|
|
178
|
+
flexShrink: 0,
|
|
179
|
+
color: contentBottomRowColor ? contentBottomRowColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowColor,
|
|
180
|
+
height: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
181
|
+
cursor: contentBottomRowCursor ? contentBottomRowCursor : configStyles.NEWAUTOCOMPLETE.contentBottomRowCursor,
|
|
182
|
+
display: contentBottomRowDisplay ? contentBottomRowDisplay : configStyles.NEWAUTOCOMPLETE.contentBottomRowDisplay,
|
|
183
|
+
padding: contentBottomRowPadding ? contentBottomRowPadding : configStyles.NEWAUTOCOMPLETE.contentBottomRowPadding,
|
|
184
|
+
fontSize: contentBottomRowFontSize ? contentBottomRowFontSize : configStyles.NEWAUTOCOMPLETE.contentBottomRowFontSize,
|
|
185
|
+
boxSizing: contentBottomRowBoxSizing ? contentBottomRowBoxSizing : configStyles.NEWAUTOCOMPLETE.contentBottomRowBoxSizing,
|
|
186
|
+
fontWeight: contentBottomRowFontWeight ? contentBottomRowFontWeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowFontWeight,
|
|
187
|
+
lineHeight: contentBottomRowLineHeight ? contentBottomRowLineHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowLineHeight,
|
|
188
|
+
alignItems: contentBottomRowAlignItems ? contentBottomRowAlignItems : configStyles.NEWAUTOCOMPLETE.contentBottomRowAlignItems,
|
|
189
|
+
transition: contentBottomRowTransition ? contentBottomRowTransition : configStyles.NEWAUTOCOMPLETE.contentBottomRowTransition,
|
|
190
|
+
marginBottom: contentBottomRowMarginBottom ? contentBottomRowMarginBottom : configStyles.NEWAUTOCOMPLETE.contentBottomRowMarginBottom,
|
|
191
|
+
backgroundColor: contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor
|
|
192
|
+
}}
|
|
193
|
+
>
|
|
194
|
+
{item.value}
|
|
195
|
+
</p>
|
|
196
|
+
)
|
|
197
|
+
}) : <p
|
|
198
|
+
style={{
|
|
199
|
+
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
200
|
+
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
201
|
+
height: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
202
|
+
padding: contentBottomRowPadding ? contentBottomRowPadding : configStyles.NEWAUTOCOMPLETE.contentBottomRowPadding,
|
|
203
|
+
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight
|
|
204
|
+
}}
|
|
205
|
+
>Նման տվյալ առկա չէ</p>
|
|
206
|
+
: <p
|
|
207
|
+
style={{
|
|
208
|
+
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
209
|
+
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
210
|
+
height: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
211
|
+
padding: contentBottomRowPadding ? contentBottomRowPadding : configStyles.NEWAUTOCOMPLETE.contentBottomRowPadding,
|
|
212
|
+
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight
|
|
213
|
+
}}
|
|
214
|
+
>
|
|
215
|
+
{innerValue.length < searchCount && `Լրացնել առնվազն ${searchCount} նիշ`}
|
|
216
|
+
</p>
|
|
217
|
+
}
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
}
|
|
221
|
+
</>
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
useEffect(() => {
|
|
225
|
+
if (!options) {
|
|
226
|
+
alert('Please add array of options');
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if (options.length === 0) {
|
|
230
|
+
alert('Please fill options array');
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
options && options.length > 0 && options.map(item => {
|
|
234
|
+
if (!item.hasOwnProperty('value')) {
|
|
235
|
+
alert('Please add value property in items of options array');
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
if (!getItem) {
|
|
240
|
+
alert('Please add getItem function for get choosen item from autocomplete');
|
|
241
|
+
}
|
|
242
|
+
}, [options, getItem]);
|
|
243
|
+
|
|
244
|
+
return (
|
|
245
|
+
<>
|
|
246
|
+
{
|
|
247
|
+
label
|
|
248
|
+
? <label
|
|
249
|
+
style={{
|
|
250
|
+
color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
|
|
251
|
+
fontSize: labelSize ? labelSize : configStyles.NEWAUTOCOMPLETE.labelSize,
|
|
252
|
+
display: labelDisplay ? labelDisplay : configStyles.NEWAUTOCOMPLETE.labelDisplay,
|
|
253
|
+
fontWeight: labelWeight ? labelWeight : configStyles.NEWAUTOCOMPLETE.labelWeight,
|
|
254
|
+
lineHeight: labelLineHeight ? labelLineHeight : configStyles.NEWAUTOCOMPLETE.labelLineHeight,
|
|
255
|
+
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.NEWAUTOCOMPLETE.labelMarginBottom,
|
|
256
|
+
textTransform: labelTextTransform ? labelTextTransform : configStyles.NEWAUTOCOMPLETE.labelTextTransform
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
{label}
|
|
260
|
+
{
|
|
261
|
+
required && <sup
|
|
262
|
+
style={{
|
|
263
|
+
color: labelRequiredColor ? labelRequiredColor : configStyles.NEWAUTOCOMPLETE.labelRequiredColor
|
|
264
|
+
}}
|
|
265
|
+
>*</sup>
|
|
266
|
+
}
|
|
267
|
+
</label>
|
|
268
|
+
: ''
|
|
269
|
+
}
|
|
270
|
+
<div
|
|
271
|
+
style={{
|
|
272
|
+
display: contentDisplay ? contentDisplay : configStyles.NEWAUTOCOMPLETE.contentDisplay,
|
|
273
|
+
position: contentPosition ? contentPosition : configStyles.NEWAUTOCOMPLETE.contentPosition,
|
|
274
|
+
flexDirection: contentDirection ? contentDirection : configStyles.NEWAUTOCOMPLETE.contentDirection
|
|
275
|
+
}}
|
|
276
|
+
>
|
|
277
|
+
<input
|
|
278
|
+
type='text'
|
|
279
|
+
value={innerValue}
|
|
280
|
+
disabled={disabled}
|
|
281
|
+
onBlur={handleBlur}
|
|
282
|
+
onFocus={handleFocus}
|
|
283
|
+
onInput={handleChange}
|
|
284
|
+
placeholder={placeHolder ? placeHolder : ''}
|
|
285
|
+
autoComplete={autoComplete ? autoComplete : configStyles.NEWAUTOCOMPLETE.autoComplete}
|
|
286
|
+
onMouseEnter={handleMouseEnter}
|
|
287
|
+
onMouseLeave={handleMouseLeave}
|
|
288
|
+
style={{
|
|
289
|
+
transition: 'all 240ms',
|
|
290
|
+
cursor: disabled ? 'not-allowed' : 'auto',
|
|
291
|
+
color: contentTopColor ? contentTopColor : configStyles.NEWAUTOCOMPLETE.contentTopColor,
|
|
292
|
+
fontSize: contentTopSize ? contentTopSize : configStyles.NEWAUTOCOMPLETE.contentTopSize,
|
|
293
|
+
height: contentTopHeight ? contentTopHeight : configStyles.NEWAUTOCOMPLETE.contentTopHeight,
|
|
294
|
+
border: contentTopBorder ? contentTopBorder : configStyles.NEWAUTOCOMPLETE.contentTopBorder,
|
|
295
|
+
padding: contentTopPadding ? contentTopPadding : configStyles.NEWAUTOCOMPLETE.contentTopPadding,
|
|
296
|
+
display: contentTopDisplay ? contentTopDisplay : configStyles.NEWAUTOCOMPLETE.contentTopDisplay,
|
|
297
|
+
fontWeight: contentTopWeight ? contentTopWeight : configStyles.NEWAUTOCOMPLETE.contentTopWeight,
|
|
298
|
+
borderRadius: contentTopRadius ? contentTopRadius : configStyles.NEWAUTOCOMPLETE.contentTopRadius,
|
|
299
|
+
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth,
|
|
300
|
+
boxSizing: contentTopBoxSizing ? contentTopBoxSizing : configStyles.NEWAUTOCOMPLETE.contentTopBoxSizing,
|
|
301
|
+
lineHeight: contentTopLineHeight ? contentTopLineHeight : configStyles.NEWAUTOCOMPLETE.contentTopLineHeight,
|
|
302
|
+
flexDirection: contentTopDirection ? contentTopDirection : configStyles.NEWAUTOCOMPLETE.contentTopDirection,
|
|
303
|
+
borderColor:
|
|
304
|
+
errorMessage ? errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor :
|
|
305
|
+
isFocus ? contentTopBorderActiveColor ? contentTopBorderActiveColor : configStyles.NEWAUTOCOMPLETE.contentTopBorderActiveColor :
|
|
306
|
+
isHover ? contentTopBorderHoverColor ? contentTopBorderHoverColor : configStyles.NEWAUTOCOMPLETE.contentTopBorderHoverColor :
|
|
307
|
+
contentTopBorderColor ? contentTopBorderColor : configStyles.NEWAUTOCOMPLETE.contentTopBorderColor,
|
|
308
|
+
}}
|
|
309
|
+
{...props}
|
|
310
|
+
/>
|
|
311
|
+
|
|
312
|
+
{
|
|
313
|
+
errorMessage
|
|
314
|
+
? <span
|
|
315
|
+
style={{
|
|
316
|
+
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
317
|
+
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize
|
|
318
|
+
}}
|
|
319
|
+
>
|
|
320
|
+
{errorMessage}
|
|
321
|
+
</span>
|
|
322
|
+
: ''
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
{
|
|
326
|
+
optionList
|
|
327
|
+
}
|
|
328
|
+
</div>
|
|
329
|
+
</>
|
|
330
|
+
);
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
NewAutocomplete.propTypes = {
|
|
334
|
+
label: PropTypes.string,
|
|
335
|
+
required: PropTypes.bool,
|
|
336
|
+
disabled: PropTypes.bool,
|
|
337
|
+
errorSize: PropTypes.string,
|
|
338
|
+
labelSize: PropTypes.string,
|
|
339
|
+
errorColor: PropTypes.string,
|
|
340
|
+
labelColor: PropTypes.string,
|
|
341
|
+
searchCount: PropTypes.number,
|
|
342
|
+
placeHolder: PropTypes.string,
|
|
343
|
+
labelWeight: PropTypes.number,
|
|
344
|
+
errorMessage: PropTypes.string,
|
|
345
|
+
labelDisplay: PropTypes.string,
|
|
346
|
+
autoComplete: PropTypes.string,
|
|
347
|
+
contentDisplay: PropTypes.string,
|
|
348
|
+
contentTopSize: PropTypes.string,
|
|
349
|
+
contentPosition: PropTypes.string,
|
|
350
|
+
labelLineHeight: PropTypes.string,
|
|
351
|
+
contentTopColor: PropTypes.string,
|
|
352
|
+
contentDirection: PropTypes.string,
|
|
353
|
+
contentTopWeight: PropTypes.number,
|
|
354
|
+
contentTopRadius: PropTypes.string,
|
|
355
|
+
contentTopHeight: PropTypes.string,
|
|
356
|
+
contentTopBorder: PropTypes.string,
|
|
357
|
+
getItem: PropTypes.func.isRequired,
|
|
358
|
+
contentTopDisplay: PropTypes.string,
|
|
359
|
+
contentTopPadding: PropTypes.string,
|
|
360
|
+
contentBottomLeft: PropTypes.string,
|
|
361
|
+
options: PropTypes.array.isRequired,
|
|
362
|
+
labelMarginBottom: PropTypes.string,
|
|
363
|
+
labelRequiredColor: PropTypes.string,
|
|
364
|
+
labelTextTransform: PropTypes.string,
|
|
365
|
+
showOptionDuration: PropTypes.string,
|
|
366
|
+
contentTopMaxWidth: PropTypes.string,
|
|
367
|
+
contentBottomWidth: PropTypes.string,
|
|
368
|
+
contentTopDirection: PropTypes.string,
|
|
369
|
+
contentTopBoxSizing: PropTypes.string,
|
|
370
|
+
contentBottomZindex: PropTypes.number,
|
|
371
|
+
contentBottomRadius: PropTypes.string,
|
|
372
|
+
contentTopLineHeight: PropTypes.string,
|
|
373
|
+
contentTopBorderColor: PropTypes.string,
|
|
374
|
+
contentBottomRowColor: PropTypes.string,
|
|
375
|
+
contentBottomMaxWidth: PropTypes.string,
|
|
376
|
+
contentBottomOverflow: PropTypes.string,
|
|
377
|
+
contentBottomPosition: PropTypes.string,
|
|
378
|
+
contentBottomMinHeight: PropTypes.string,
|
|
379
|
+
contentBottomBoxShadow: PropTypes.string,
|
|
380
|
+
contentBottomRowHeight: PropTypes.string,
|
|
381
|
+
contentBottomRowCursor: PropTypes.string,
|
|
382
|
+
contentBottomRowDisplay: PropTypes.string,
|
|
383
|
+
contentBottomRowPadding: PropTypes.string,
|
|
384
|
+
contentBottomRowFontSize: PropTypes.string,
|
|
385
|
+
contentBottomRowBoxSizing: PropTypes.string,
|
|
386
|
+
contentBottomInnerDisplay: PropTypes.string,
|
|
387
|
+
contentBottomRowFontWeight: PropTypes.number,
|
|
388
|
+
contentBottomRowLineHeight: PropTypes.string,
|
|
389
|
+
contentBottomRowAlignItems: PropTypes.string,
|
|
390
|
+
contentBottomRowTransition: PropTypes.string,
|
|
391
|
+
contentBottomRowHoverColor: PropTypes.string,
|
|
392
|
+
contentTopBorderHoverColor: PropTypes.string,
|
|
393
|
+
contentTopBorderActiveColor: PropTypes.string,
|
|
394
|
+
contentBottomInnerOverflowY: PropTypes.string,
|
|
395
|
+
contentBottomInnerOverflowX: PropTypes.string,
|
|
396
|
+
contentBottomInnerMaxHeight: PropTypes.string,
|
|
397
|
+
contentBottomInnerDirection: PropTypes.string,
|
|
398
|
+
contentBottomRowMarginBottom: PropTypes.string,
|
|
399
|
+
contentBottomBackgroundColor: PropTypes.string,
|
|
400
|
+
contentBottomRowBackgroundColor: PropTypes.string,
|
|
401
|
+
contentBottomRowHoverBackgroundColor: PropTypes.string,
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
NewAutocomplete.defaultProps = {
|
|
405
|
+
searchCount: 3,
|
|
406
|
+
disabled: false
|
|
407
|
+
};
|
package/src/index.js
CHANGED
|
@@ -10,9 +10,10 @@ export * from './components/tooltip';
|
|
|
10
10
|
export * from './components/captcha';
|
|
11
11
|
export * from './components/stepper';
|
|
12
12
|
export * from './components/checkbox';
|
|
13
|
+
export * from './components/textarea';
|
|
13
14
|
export * from './components/icon/Icon';
|
|
14
15
|
export * from './components/typography';
|
|
15
16
|
export * from './components/pagination';
|
|
16
17
|
export * from './components/autocomplate';
|
|
17
18
|
export * from './components/singleCheckbox';
|
|
18
|
-
export * from './components/
|
|
19
|
+
export * from './components/newAutocomplete';
|
|
@@ -432,4 +432,90 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
432
432
|
borderFocusColor: '#00236A', // for boredr color when focus action is happaning
|
|
433
433
|
labelRequiredColor: '#ee0000', // for label required mark color
|
|
434
434
|
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
### New AutoComplete
|
|
438
|
+
|
|
439
|
+
```
|
|
440
|
+
{
|
|
441
|
+
labelWeight: 500, // for label font weight
|
|
442
|
+
labelSize: '16px', // for label font size
|
|
443
|
+
labelColor: '#3c393e', // for label color
|
|
444
|
+
labelDisplay: 'block', // for label display
|
|
445
|
+
labelLineHeight: '22px', // for label line height
|
|
446
|
+
labelMarginBottom: '6px', // for label margin bottom
|
|
447
|
+
labelTextTransform: 'none', // for label text transform
|
|
448
|
+
labelRequiredColor: '#ee0000', // for label required mark color
|
|
449
|
+
|
|
450
|
+
searchCount: 3, // for autocomplete show result logic
|
|
451
|
+
errorSize: '16px', // for error font size
|
|
452
|
+
autoComplete: 'off', // for off auto fill functionality ( browser specific, maybe will not work )
|
|
453
|
+
errorColor: '#ee0000', // for error color
|
|
454
|
+
|
|
455
|
+
contentDisplay: 'flex', // for autocomplete parent block display
|
|
456
|
+
contentDirection: 'column', // for autocomplete parent block flex direction
|
|
457
|
+
contentPosition: 'relative', // for autocomplete parent block position
|
|
458
|
+
showOptionDuration: '640ms', // for autocomplete parent block animation duration
|
|
459
|
+
|
|
460
|
+
contentTopWeight: 500, // for autocomplate top block font weight
|
|
461
|
+
contentTopSize: '16px', // for autocomplate top block font size
|
|
462
|
+
contentTopRadius: '6px', // for autocomplate top block border radius
|
|
463
|
+
contentTopHeight: '46px', // for autocomplate top block height
|
|
464
|
+
contentTopDisplay: 'flex', // for autocomplate top block display
|
|
465
|
+
contentTopDirection: 'row', // for autocomplate top block flex direction
|
|
466
|
+
contentTopColor: '#3C393E', // for autocomplate top block color
|
|
467
|
+
contentTopMaxWidth: '400px', // for autocomplate top block max width
|
|
468
|
+
contentTopLineHeight: '22px', // for autocomplate top block line height
|
|
469
|
+
contentTopPadding: '0px 15px', // for autocomplate top block padding
|
|
470
|
+
contentTopBorder: '2px solid', // for autocomplate top block border
|
|
471
|
+
contentTopBorderColor: '#D1D1D1', // for autocomplate top block border color
|
|
472
|
+
contentTopBoxSizing: 'border-box', // for autocomplate top block box sizing
|
|
473
|
+
contentTopBorderHoverColor: '#3C393E', // for autocomplate top block border hover color
|
|
474
|
+
contentTopBorderActiveColor: '#00236A', // for autocomplate top block border active color
|
|
475
|
+
|
|
476
|
+
contentBottomZindex: 1, // for autocomplete bottom block z-index
|
|
477
|
+
contentBottomLeft: '0px', // for autocomplete bottom block left
|
|
478
|
+
contentBottomRadius: '6px', // for autocomplete bottom block border radius
|
|
479
|
+
contentBottomWidth: '100%', // for autocomplete bottom block width
|
|
480
|
+
contentBottomMinHeight: '0px', // for autocomplete bottom block minimal height
|
|
481
|
+
contentBottomMaxWidth: '400px', // for autocomplete bottom block maximum width
|
|
482
|
+
contentBottomOverflow: 'hidden', // for autocomplete bottom block overflow
|
|
483
|
+
contentBottomPosition: 'absolute', // for autocomplete bottom block position
|
|
484
|
+
contentBottomBackgroundColor: '#FBFBFB', // for autocomplete bottom block background color
|
|
485
|
+
contentBottomBoxShadow: '0 0 10px rgba(60, 57, 62, 0.08)', // for autocomplete bottom block box shadow
|
|
486
|
+
|
|
487
|
+
contentBottomInnerDisplay: 'flex', // for autocomplete bottom block inner display
|
|
488
|
+
contentBottomInnerOverflowY: 'auto', // for autocomplete bottom block inner overflow y
|
|
489
|
+
contentBottomInnerMaxHeight: '234px', // for autocomplete bottom block inner maximum height
|
|
490
|
+
contentBottomInnerOverflowX: 'hidden', // for autocomplete bottom block inner overflow x
|
|
491
|
+
contentBottomInnerDirection: 'column', // for autocomplete bottom block inner flex direction
|
|
492
|
+
|
|
493
|
+
contentBottomRowHeight: '46px', // for autocomplete bottom block inner row height
|
|
494
|
+
contentBottomRowDisplay: 'flex', // for autocomplete bottom block inner row display
|
|
495
|
+
contentBottomRowFontWeight: 500, // for autocomplete bottom block inner row font weight
|
|
496
|
+
contentBottomRowColor: '#3C393E', // for autocomplete bottom block inner row color
|
|
497
|
+
contentBottomRowFontSize: '16px', // for autocomplete bottom block inner row font size
|
|
498
|
+
contentBottomRowCursor: 'pointer', // for autocomplete bottom block inner row cursor
|
|
499
|
+
contentBottomRowLineHeight: '22px', // for autocomplete bottom block inner row line height
|
|
500
|
+
contentBottomRowMarginBottom: '2px', // for autocomplete bottom block inner row margin bottom
|
|
501
|
+
contentBottomRowPadding: '0px 15px', // for autocomplete bottom block inner row padding
|
|
502
|
+
contentBottomRowAlignItems: 'center', // for autocomplete bottom block inner row align items ( flex )
|
|
503
|
+
contentBottomRowHoverColor: '#00236A', // for autocomplete bottom block inner row hove color
|
|
504
|
+
contentBottomRowBoxSizing: 'border-box', // for autocomplete bottom block inner row box sizing
|
|
505
|
+
contentBottomRowTransition: 'all 240ms', // for autocomplete bottom block inner row transition
|
|
506
|
+
contentBottomRowBackgroundColor: '#ffffff', // for autocomplete bottom block inner row background color
|
|
507
|
+
contentBottomRowHoverBackgroundColor: 'initial', // for autocomplete bottom block inner row hover background color
|
|
508
|
+
}
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Captcha
|
|
512
|
+
|
|
513
|
+
```
|
|
514
|
+
{
|
|
515
|
+
size: '16px', // for captcha label font size (configurable from config.js)
|
|
516
|
+
color: '#3C393E', // for captcha label color (configurable from config.js)
|
|
517
|
+
label: 'for example. Captcha', // for captcha label (add itself on each component)
|
|
518
|
+
range: 'for example. 72', // for captcha range (add itself on each component)
|
|
519
|
+
getRange: 'is must be function', // for captcha get current range (add itself on each component)
|
|
520
|
+
}
|
|
435
521
|
```
|
|
Binary file
|
|
Binary file
|
|
@@ -8,12 +8,14 @@ import Plugin from './assets/plugin.svg';
|
|
|
8
8
|
import Repo from './assets/repo.svg';
|
|
9
9
|
import StackAlt from './assets/stackalt.svg';
|
|
10
10
|
|
|
11
|
+
import captcha from './static/captcha-usage.png';
|
|
11
12
|
import buttonImage from './static/button-usage.png';
|
|
12
13
|
import selectImage from './static/select-usage.png';
|
|
13
|
-
import inputTooltipImage from './static/input-tooltip-usage.png';
|
|
14
|
-
import toasterImage from './static/toaster-container-usage.png';
|
|
15
14
|
import toastImage from './static/toaster-usage.png';
|
|
16
15
|
import textareaImage from './static/textarea-usage.png';
|
|
16
|
+
import toasterImage from './static/toaster-container-usage.png';
|
|
17
|
+
import inputTooltipImage from './static/input-tooltip-usage.png';
|
|
18
|
+
import newAutocompleteImage from './static/new-autocomplete-usage.png';
|
|
17
19
|
|
|
18
20
|
<Meta title="Intro/Usage" />
|
|
19
21
|
|
|
@@ -148,5 +150,10 @@ import textareaImage from './static/textarea-usage.png';
|
|
|
148
150
|
<img src={toastImage} alt="toaster image" />
|
|
149
151
|
|
|
150
152
|
### Textarea
|
|
151
|
-
|
|
152
153
|
<img src={textareaImage} alt="textarea image" />
|
|
154
|
+
|
|
155
|
+
### NewAutocomplete
|
|
156
|
+
<img src={newAutocompleteImage} alt="autocomplete image" />
|
|
157
|
+
|
|
158
|
+
### Captcha
|
|
159
|
+
<img src={captcha} alt="captcha image" />
|