@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
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_d_1946_21917)">
|
|
3
|
+
<circle cx="22" cy="23" r="15" fill="#00236A"/>
|
|
4
|
+
<circle cx="22" cy="23" r="16" stroke="white" stroke-width="2"/>
|
|
5
|
+
</g>
|
|
6
|
+
<path d="M25.9976 23.011C25.9981 23.2442 25.9168 23.4703 25.7678 23.6499L20.7703 29.6394C20.6007 29.8432 20.3569 29.9714 20.0926 29.9958C19.8283 30.0201 19.5652 29.9386 19.3611 29.7692C19.157 29.5997 19.0286 29.3562 19.0042 29.0923C18.9799 28.8283 19.0615 28.5655 19.2311 28.3616L23.7088 23.011L19.391 17.6603C19.308 17.5582 19.246 17.4407 19.2086 17.3146C19.1712 17.1885 19.1591 17.0562 19.173 16.9254C19.187 16.7946 19.2267 16.6679 19.2898 16.5525C19.3529 16.437 19.4383 16.3352 19.541 16.2528C19.6437 16.1614 19.7643 16.0921 19.8951 16.0494C20.0259 16.0067 20.1641 15.9914 20.3011 16.0046C20.4381 16.0177 20.5709 16.0589 20.6912 16.1257C20.8115 16.1924 20.9167 16.2833 21.0002 16.3926L25.8277 22.3821C25.9532 22.5668 26.013 22.7883 25.9976 23.011Z" fill="white"/>
|
|
7
|
+
<defs>
|
|
8
|
+
<filter id="filter0_d_1946_21917" x="0" y="0" width="46" height="46" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
9
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
10
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
11
|
+
<feOffset dx="1"/>
|
|
12
|
+
<feGaussianBlur stdDeviation="3"/>
|
|
13
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
14
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.235289 0 0 0 0 0.222535 0 0 0 0 0.241667 0 0 0 0.15 0"/>
|
|
15
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1946_21917"/>
|
|
16
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1946_21917" result="shape"/>
|
|
17
|
+
</filter>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_d_1946_21948)">
|
|
3
|
+
<circle cx="22" cy="23" r="15" fill="#EE0000"/>
|
|
4
|
+
<circle cx="22" cy="23" r="16" stroke="white" stroke-width="2"/>
|
|
5
|
+
</g>
|
|
6
|
+
<path d="M25.9976 23.011C25.9981 23.2442 25.9168 23.4703 25.7678 23.6499L20.7703 29.6394C20.6007 29.8432 20.3569 29.9714 20.0926 29.9958C19.8283 30.0201 19.5652 29.9386 19.3611 29.7692C19.157 29.5997 19.0286 29.3562 19.0042 29.0923C18.9799 28.8283 19.0615 28.5655 19.2311 28.3616L23.7088 23.011L19.391 17.6603C19.308 17.5582 19.246 17.4407 19.2086 17.3146C19.1712 17.1885 19.1591 17.0562 19.173 16.9254C19.187 16.7946 19.2267 16.6679 19.2898 16.5525C19.3529 16.437 19.4383 16.3352 19.541 16.2528C19.6437 16.1614 19.7643 16.0921 19.8951 16.0494C20.0259 16.0067 20.1641 15.9914 20.3011 16.0046C20.4381 16.0177 20.5709 16.0589 20.6912 16.1257C20.8115 16.1924 20.9167 16.2833 21.0002 16.3926L25.8277 22.3821C25.9532 22.5668 26.013 22.7883 25.9976 23.011Z" fill="white"/>
|
|
7
|
+
<defs>
|
|
8
|
+
<filter id="filter0_d_1946_21948" x="0" y="0" width="46" height="46" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
9
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
10
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
11
|
+
<feOffset dx="1"/>
|
|
12
|
+
<feGaussianBlur stdDeviation="3"/>
|
|
13
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
14
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.235289 0 0 0 0 0.222535 0 0 0 0 0.241667 0 0 0 0.15 0"/>
|
|
15
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1946_21948"/>
|
|
16
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1946_21948" result="shape"/>
|
|
17
|
+
</filter>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g filter="url(#filter0_d_1946_21947)">
|
|
3
|
+
<circle cx="22" cy="23" r="15" fill="#0DA574"/>
|
|
4
|
+
<circle cx="22" cy="23" r="16" stroke="white" stroke-width="2"/>
|
|
5
|
+
</g>
|
|
6
|
+
<path d="M25.9976 23.011C25.9981 23.2442 25.9168 23.4703 25.7678 23.6499L20.7703 29.6394C20.6007 29.8432 20.3569 29.9714 20.0926 29.9958C19.8283 30.0201 19.5652 29.9386 19.3611 29.7692C19.157 29.5997 19.0286 29.3562 19.0042 29.0923C18.9799 28.8283 19.0615 28.5655 19.2311 28.3616L23.7088 23.011L19.391 17.6603C19.308 17.5582 19.246 17.4407 19.2086 17.3146C19.1712 17.1885 19.1591 17.0562 19.173 16.9254C19.187 16.7946 19.2267 16.6679 19.2898 16.5525C19.3529 16.437 19.4383 16.3352 19.541 16.2528C19.6437 16.1614 19.7643 16.0921 19.8951 16.0494C20.0259 16.0067 20.1641 15.9914 20.3011 16.0046C20.4381 16.0177 20.5709 16.0589 20.6912 16.1257C20.8115 16.1924 20.9167 16.2833 21.0002 16.3926L25.8277 22.3821C25.9532 22.5668 26.013 22.7883 25.9976 23.011Z" fill="white"/>
|
|
7
|
+
<defs>
|
|
8
|
+
<filter id="filter0_d_1946_21947" x="0" y="0" width="46" height="46" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
|
|
9
|
+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
|
|
10
|
+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
|
|
11
|
+
<feOffset dx="1"/>
|
|
12
|
+
<feGaussianBlur stdDeviation="3"/>
|
|
13
|
+
<feComposite in2="hardAlpha" operator="out"/>
|
|
14
|
+
<feColorMatrix type="matrix" values="0 0 0 0 0.235289 0 0 0 0 0.222535 0 0 0 0 0.241667 0 0 0 0.15 0"/>
|
|
15
|
+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1946_21947"/>
|
|
16
|
+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1946_21947" result="shape"/>
|
|
17
|
+
</filter>
|
|
18
|
+
</defs>
|
|
19
|
+
</svg>
|
|
@@ -1,75 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
.start-point::after {
|
|
2
|
+
content: '';
|
|
3
|
+
position: absolute;
|
|
4
|
+
top: 7.5px;
|
|
5
|
+
left: 0px;
|
|
6
|
+
width: 10px;
|
|
7
|
+
height: 10px;
|
|
8
|
+
border: 2px solid #ffffff;
|
|
9
|
+
border-radius: 6px;
|
|
10
|
+
-webkit-border-radius: 6px;
|
|
11
|
+
-moz-border-radius: 6px;
|
|
12
|
+
-ms-border-radius: 6px;
|
|
13
|
+
-o-border-radius: 6px;
|
|
14
|
+
background-color: #D1D1D1;
|
|
15
|
+
z-index: -1;
|
|
11
16
|
}
|
|
12
17
|
|
|
13
|
-
.
|
|
18
|
+
.range {
|
|
19
|
+
margin: 0px;
|
|
14
20
|
-webkit-appearance: none;
|
|
15
|
-
width: 100%;
|
|
16
|
-
height: 4px;
|
|
17
|
-
border-radius: 2px;
|
|
18
|
-
outline: none;
|
|
19
|
-
position: absolute;
|
|
20
|
-
background: #EEEEEE;
|
|
21
|
-
top: 0;
|
|
22
|
-
bottom: 0;
|
|
23
|
-
margin: auto 0;
|
|
24
|
-
left: 0;
|
|
25
21
|
}
|
|
26
22
|
|
|
27
|
-
.
|
|
23
|
+
.range::-webkit-slider-runnable-track {
|
|
24
|
+
width: 100%;
|
|
28
25
|
-webkit-appearance: none;
|
|
29
|
-
width: 30px;
|
|
30
|
-
height: 30px;
|
|
31
|
-
z-index: 3;
|
|
32
|
-
position: relative;
|
|
33
26
|
}
|
|
34
27
|
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
28
|
+
.range-default::-webkit-slider-thumb {
|
|
29
|
+
width: 34px;
|
|
30
|
+
height: 34px;
|
|
31
|
+
cursor: ew-resize;
|
|
32
|
+
border-radius: 17px;
|
|
33
|
+
-webkit-border-radius: 17px;
|
|
34
|
+
-moz-border-radius: 17px;
|
|
35
|
+
-ms-border-radius: 17px;
|
|
36
|
+
-o-border-radius: 17px;
|
|
37
|
+
-webkit-appearance: none;
|
|
38
|
+
background-position: -5px;
|
|
39
|
+
background-size: 46px 46px;
|
|
40
|
+
background-repeat: no-repeat;
|
|
41
|
+
background-image: url('./../../assets/icons/range-arrow-default.svg');
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
border-radius:
|
|
51
|
-
border:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
44
|
+
.range-error::-webkit-slider-thumb {
|
|
45
|
+
width: 34px;
|
|
46
|
+
height: 34px;
|
|
47
|
+
cursor: ew-resize;
|
|
48
|
+
border-radius: 17px;
|
|
49
|
+
-webkit-border-radius: 17px;
|
|
50
|
+
-moz-border-radius: 17px;
|
|
51
|
+
-ms-border-radius: 17px;
|
|
52
|
+
-o-border-radius: 17px;
|
|
53
|
+
-webkit-appearance: none;
|
|
54
|
+
background-position: -5px;
|
|
55
|
+
background-size: 46px 46px;
|
|
56
|
+
background-repeat: no-repeat;
|
|
57
|
+
background-image: url('./../../assets/icons/range-arrow-error.svg');
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
.
|
|
61
|
-
width:
|
|
62
|
-
height:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
.range-success::-webkit-slider-thumb {
|
|
61
|
+
width: 34px;
|
|
62
|
+
height: 34px;
|
|
63
|
+
cursor: ew-resize;
|
|
64
|
+
border-radius: 17px;
|
|
65
|
+
-webkit-border-radius: 17px;
|
|
66
|
+
-moz-border-radius: 17px;
|
|
67
|
+
-ms-border-radius: 17px;
|
|
68
|
+
-o-border-radius: 17px;
|
|
69
|
+
-webkit-appearance: none;
|
|
70
|
+
background-position: -5px;
|
|
71
|
+
background-size: 46px 46px;
|
|
72
|
+
background-repeat: no-repeat;
|
|
73
|
+
background-image: url('./../../assets/icons/range-arrow-success.svg');
|
|
69
74
|
}
|
|
70
|
-
|
|
71
|
-
.range {
|
|
72
|
-
color: blue;
|
|
73
|
-
margin-bottom: 15px;
|
|
74
|
-
margin-top: 15px;
|
|
75
|
-
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Captcha
|
|
2
|
+
import { Captcha } from './index';
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
component: Captcha,
|
|
6
6
|
title: 'Components/Captcha',
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
const Template = (args) => <Captcha
|
|
9
|
+
const Template = (args) => <Captcha label='Captcha' {...args}>Default</Captcha>;
|
|
10
10
|
|
|
11
11
|
export const Default = Template.bind({});
|
|
12
12
|
Default.args = {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
range: 72,
|
|
14
|
+
getRange: (range) => {
|
|
15
|
+
console.log('Range is ' + range);
|
|
15
16
|
}
|
|
16
17
|
};
|
|
@@ -1,69 +1,156 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styles from './captcha.module.css';
|
|
4
|
-
import Icon from '../icon/Icon';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let rangeElement = document.getElementsByClassName(styles.range);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
for (let element of rangeElement) {
|
|
13
|
-
element.style.marginLeft = `${range + 60}%`;
|
|
14
|
-
element.style.color = data;
|
|
15
|
-
}
|
|
16
|
-
}, [range, data])
|
|
4
|
+
import { compereConfigs } from './../../utils';
|
|
5
|
+
|
|
6
|
+
import SvgCaptchaArrowUp from './../icon/CaptchaArrowUp';
|
|
7
|
+
import SvgCaptchaArrowDown from './../icon/CaptchaArrowDown';
|
|
17
8
|
|
|
18
|
-
|
|
19
|
-
setData(rangeCount == event.target.value ? 'green' : 'indianred');
|
|
20
|
-
let selector = document.getElementsByClassName(styles.selector);
|
|
21
|
-
let selectBtn = document.getElementsByClassName(styles.selectBtn);
|
|
22
|
-
let progressBar = document.getElementsByClassName(styles.progressBar);
|
|
9
|
+
import styles from './captcha.module.css';
|
|
23
10
|
|
|
24
|
-
|
|
25
|
-
progressBar[0].style.width = event.target.value + '%';
|
|
11
|
+
export const Captcha = ({ size, color, range, label, getRange }) => {
|
|
26
12
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
else {
|
|
31
|
-
selectBtn[0].style.background = "red";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
13
|
+
const [rangeNumber, setRangeNumber] = useState(0);
|
|
14
|
+
const [rangeProgress, setRangeProgress] = useState(0);
|
|
34
15
|
|
|
35
|
-
|
|
36
|
-
setRight(rangeCount == e.target.value ? true : false);
|
|
37
|
-
}
|
|
16
|
+
const configStyles = compereConfigs();
|
|
38
17
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<i className='icon-vector-down'></i>
|
|
45
|
-
</div>
|
|
46
|
-
<input type='range' className={styles.slider} onClick={right ? onclick : null} onInput={sliderInput} onMouseUp={sliderChange} />
|
|
47
|
-
<div className={styles.selector} >
|
|
48
|
-
<div className={styles.selectBtn}></div>
|
|
49
|
-
</div>
|
|
50
|
-
<div className={styles.progressBar}></div>
|
|
51
|
-
<div className={styles.range} >
|
|
52
|
-
{/*<Icon className='icon-vector-up'/>*/}
|
|
53
|
-
<i className='icon-vector-up'></i>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
18
|
+
const handleRange = (e) => {
|
|
19
|
+
const value = e.target.value;
|
|
20
|
+
getRange(value);
|
|
21
|
+
setRangeProgress(value);
|
|
22
|
+
};
|
|
56
23
|
|
|
57
|
-
|
|
58
|
-
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (range === undefined || range === null) {
|
|
26
|
+
alert('Please add range property on Captcha component');
|
|
27
|
+
}
|
|
28
|
+
if (!getRange) {
|
|
29
|
+
alert('Please add getRange property on Captcha component');
|
|
30
|
+
}
|
|
31
|
+
if (range > 100) {
|
|
32
|
+
setRangeNumber(100);
|
|
33
|
+
} else if (range < 0) {
|
|
34
|
+
setRangeNumber(0);
|
|
35
|
+
} else {
|
|
36
|
+
setRangeNumber(range);
|
|
37
|
+
}
|
|
38
|
+
}, [range, getRange]);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
{
|
|
43
|
+
label && <p
|
|
44
|
+
style={{
|
|
45
|
+
fontSize: size ? size : configStyles.Captcha.size,
|
|
46
|
+
color: color ? color : configStyles.Captcha.color
|
|
47
|
+
}}
|
|
48
|
+
>{ label }</p>
|
|
49
|
+
}
|
|
50
|
+
<div
|
|
51
|
+
style={{
|
|
52
|
+
width: '100%',
|
|
53
|
+
height: '76px',
|
|
54
|
+
maxWidth: '400px',
|
|
55
|
+
position: 'relative',
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<div
|
|
59
|
+
style={{
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
top: '0px',
|
|
62
|
+
height: '15px',
|
|
63
|
+
left: `calc(${rangeNumber}% - 6px)`,
|
|
64
|
+
}}
|
|
65
|
+
>
|
|
66
|
+
<SvgCaptchaArrowDown />
|
|
67
|
+
</div>
|
|
68
|
+
<div
|
|
69
|
+
style={{
|
|
70
|
+
position: 'absolute',
|
|
71
|
+
display: 'flex',
|
|
72
|
+
top: '23px',
|
|
73
|
+
left: '0px',
|
|
74
|
+
width: '100%',
|
|
75
|
+
height: '30px',
|
|
76
|
+
alignItems: 'center',
|
|
77
|
+
zIndex: 1
|
|
78
|
+
}}
|
|
79
|
+
className={styles['start-point']}
|
|
80
|
+
>
|
|
81
|
+
<div
|
|
82
|
+
style={{
|
|
83
|
+
position: 'absolute',
|
|
84
|
+
top: '13px',
|
|
85
|
+
right: '0px',
|
|
86
|
+
width: '100%',
|
|
87
|
+
height: '4px',
|
|
88
|
+
borderRadius: '2px',
|
|
89
|
+
backgroundColor: '#EEEEEE',
|
|
90
|
+
borderRadius: '10px',
|
|
91
|
+
zIndex: -2
|
|
92
|
+
}}
|
|
93
|
+
></div>
|
|
94
|
+
<input
|
|
95
|
+
min={0}
|
|
96
|
+
max={100}
|
|
97
|
+
type='range'
|
|
98
|
+
value={rangeProgress}
|
|
99
|
+
style={{
|
|
100
|
+
height: '4px',
|
|
101
|
+
width: '100%',
|
|
102
|
+
borderRadius: '2px',
|
|
103
|
+
cursor: 'pointer',
|
|
104
|
+
backgroundColor: 'transparent'
|
|
105
|
+
}}
|
|
106
|
+
className={`
|
|
107
|
+
${styles['range']}
|
|
108
|
+
${
|
|
109
|
+
rangeProgress >= rangeNumber ?
|
|
110
|
+
styles['range-success'] :
|
|
111
|
+
rangeProgress < rangeNumber && rangeProgress > 0 ?
|
|
112
|
+
styles['range-error'] :
|
|
113
|
+
styles['range-default']
|
|
114
|
+
}
|
|
115
|
+
`}
|
|
116
|
+
onInput={handleRange}
|
|
117
|
+
/>
|
|
118
|
+
<div
|
|
119
|
+
style={{
|
|
120
|
+
position: 'absolute',
|
|
121
|
+
top: '13px',
|
|
122
|
+
left: '0px',
|
|
123
|
+
width: rangeProgress + '%',
|
|
124
|
+
height: '4px',
|
|
125
|
+
borderRadius: '2px',
|
|
126
|
+
backgroundColor:
|
|
127
|
+
rangeProgress >= rangeNumber ?
|
|
128
|
+
'#0DA574' :
|
|
129
|
+
rangeProgress < rangeNumber && rangeProgress > 0 ?
|
|
130
|
+
'#EE0000' :
|
|
131
|
+
'transparent' ,
|
|
132
|
+
borderRadius: '2px',
|
|
133
|
+
zIndex: -1
|
|
134
|
+
}}
|
|
135
|
+
></div>
|
|
136
|
+
</div>
|
|
137
|
+
<div
|
|
138
|
+
style={{
|
|
139
|
+
position: 'absolute',
|
|
140
|
+
bottom: '0px',
|
|
141
|
+
height: '15px',
|
|
142
|
+
left: `calc(${rangeNumber}% - 6px)`,
|
|
143
|
+
}}
|
|
144
|
+
>
|
|
145
|
+
<SvgCaptchaArrowUp />
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</>
|
|
149
|
+
);
|
|
59
150
|
};
|
|
60
151
|
|
|
61
152
|
Captcha.propTypes = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
153
|
+
label: PropTypes.string,
|
|
154
|
+
range: PropTypes.number.isRequired,
|
|
155
|
+
getRange: PropTypes.func.isRequired
|
|
65
156
|
};
|
|
66
|
-
|
|
67
|
-
Captcha.defaultProps = {
|
|
68
|
-
onclick: undefined
|
|
69
|
-
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import classnames from "classnames";
|
|
4
|
+
|
|
5
|
+
import PDF from './../icon/PDF';
|
|
6
|
+
|
|
4
7
|
import styles from "./file.module.css";
|
|
5
|
-
import Icon from '../icon/Icon';
|
|
6
|
-
import pdfImage from './../../assets/pdf.svg';
|
|
7
8
|
|
|
8
9
|
export const File = ({
|
|
9
10
|
name,
|
|
@@ -18,9 +19,9 @@ export const File = ({
|
|
|
18
19
|
fileExtensions,
|
|
19
20
|
...props
|
|
20
21
|
}) => {
|
|
21
|
-
const [image, setImage] = useState(defaultData ? defaultData.type != 'application/pdf' ? defaultData.url : pdfImage : null);
|
|
22
22
|
const [error, setError] = useState('');
|
|
23
23
|
const [fileName, setFileName] = useState('no selected file');
|
|
24
|
+
const [image, setImage] = useState(defaultData ? defaultData.type != 'application/pdf' ? defaultData.url : 'pdf' : null);
|
|
24
25
|
|
|
25
26
|
const handleCheckFile = (e) => {
|
|
26
27
|
const file = e.target.files;
|
|
@@ -31,7 +32,7 @@ export const File = ({
|
|
|
31
32
|
if (file[0].type === 'application/pdf') {
|
|
32
33
|
setError('');
|
|
33
34
|
onChange({file});
|
|
34
|
-
setImage(
|
|
35
|
+
setImage('pdf');
|
|
35
36
|
} else {
|
|
36
37
|
setError('');
|
|
37
38
|
onChange({file});
|
|
@@ -83,7 +84,9 @@ export const File = ({
|
|
|
83
84
|
{
|
|
84
85
|
image ?
|
|
85
86
|
<div className={`${styles['upload-file-content']} upload-file-content-rem`}>
|
|
86
|
-
|
|
87
|
+
{
|
|
88
|
+
image === 'pdf' ? <PDF /> : <img src={image} alt={fileName} />
|
|
89
|
+
}
|
|
87
90
|
</div> :
|
|
88
91
|
<div className={`${styles['file-form-inner-upload']} ile-form-inner-upload-rem`}>
|
|
89
92
|
<img src="../../assets/upload.svg" alt="" />
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgCaptchaArrowDown = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="12"
|
|
5
|
+
height="15"
|
|
6
|
+
viewBox="0 0 12 15"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
d="M6 0.00146537C5.77271 0.00146539 5.55473 0.0936418 5.39402 0.257718C5.2333 0.421795 5.14301 0.64433 5.14301 0.876368L5.14301 11.013L1.46482 7.25615C1.38514 7.17481 1.29055 7.11028 1.18644 7.06626C1.08233 7.02224 0.970753 6.99958 0.85807 6.99958C0.745386 6.99958 0.633807 7.02224 0.529701 7.06626C0.425595 7.11028 0.331002 7.17481 0.251322 7.25616C0.171643 7.3375 0.108438 7.43407 0.0653156 7.54035C0.0221934 7.64663 -5.45598e-07 7.76055 -5.35541e-07 7.87559C-5.25484e-07 7.99063 0.0221934 8.10454 0.0653157 8.21082C0.108438 8.3171 0.171643 8.41367 0.251322 8.49502L5.39325 13.7444C5.47286 13.8259 5.56743 13.8905 5.67155 13.9347C5.77566 13.9788 5.88728 14.0015 6 14.0015C6.11272 14.0015 6.22434 13.9788 6.32846 13.9347C6.43257 13.8905 6.52714 13.8259 6.60675 13.7444L11.7487 8.49502C11.9096 8.33073 12 8.10792 12 7.87559C12 7.64325 11.9096 7.42044 11.7487 7.25615C11.5878 7.09187 11.3695 6.99958 11.1419 6.99958C10.9144 6.99958 10.6961 7.09187 10.5352 7.25615L6.85699 11.013L6.85699 0.876368C6.85699 0.64433 6.7667 0.421794 6.60598 0.257718C6.44526 0.0936418 6.22729 0.00146535 6 0.00146537Z"
|
|
15
|
+
fill="#00236A"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
export default SvgCaptchaArrowDown;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgCaptchaArrowUp = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="12"
|
|
5
|
+
height="15"
|
|
6
|
+
viewBox="0 0 12 15"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
d="M6 14.9988C6.22729 14.9988 6.44527 14.9066 6.60598 14.7425C6.7667 14.5785 6.85699 14.3559 6.85699 14.1239L6.85699 3.98726L10.5352 7.74409C10.6149 7.82543 10.7095 7.88996 10.8136 7.93398C10.9177 7.97801 11.0292 8.00067 11.1419 8.00067C11.2546 8.00067 11.3662 7.97801 11.4703 7.93398C11.5744 7.88996 11.669 7.82543 11.7487 7.74409C11.8284 7.66274 11.8916 7.56617 11.9347 7.45989C11.9778 7.35361 12 7.2397 12 7.12466C12 7.00962 11.9778 6.89571 11.9347 6.78943C11.8916 6.68314 11.8284 6.58657 11.7487 6.50523L6.60675 1.25581C6.52714 1.17434 6.43257 1.1097 6.32845 1.06559C6.22434 1.02148 6.11272 0.998779 6 0.998779C5.88728 0.998779 5.77566 1.02148 5.67154 1.06559C5.56743 1.1097 5.47286 1.17434 5.39325 1.25581L0.251323 6.50523C0.0904038 6.66951 0 6.89233 0 7.12466C0 7.35699 0.0904038 7.57981 0.251323 7.74409C0.412243 7.90837 0.630497 8.00067 0.858071 8.00067C1.08565 8.00067 1.3039 7.90837 1.46482 7.74409L5.14301 3.98726L5.14301 14.1239C5.14301 14.3559 5.2333 14.5785 5.39402 14.7425C5.55473 14.9066 5.77271 14.9988 6 14.9988Z"
|
|
15
|
+
fill="#00236A"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
export default SvgCaptchaArrowUp;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgPdf = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="40"
|
|
5
|
+
height="52"
|
|
6
|
+
viewBox="0 0 40 52"
|
|
7
|
+
fill="none"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-labelledby={titleId}
|
|
10
|
+
{...props}
|
|
11
|
+
>
|
|
12
|
+
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<path
|
|
14
|
+
d="M39.1304 13.1106V36.2849V36.2853C39.394 36.4388 39.6133 36.6599 39.7659 36.9263C39.9189 37.1931 39.9992 37.4956 40 37.8037V47.5932C39.9984 48.7614 39.54 49.8816 38.7252 50.7079C37.91 51.5337 36.8048 51.9984 35.6522 52H4.34783C3.19523 51.9984 2.09005 51.5338 1.27483 50.7079C0.460015 49.8816 0.0015528 48.7614 0 47.5932V34.7817C0.000775155 34.4736 0.0815204 34.1714 0.234087 33.9051C0.386643 33.6383 0.605983 33.4176 0.869565 33.2641V3.52545C0.869565 2.5906 1.23602 1.69387 1.8882 1.03245C2.54072 0.371431 3.42547 0 4.34783 0H26.1953L39.1304 13.1106ZM13.872 45.3893C14.6037 45.4385 15.3293 45.2261 15.9225 44.7893C16.4303 44.3463 16.7036 43.6872 16.6605 43.0096C16.671 42.6272 16.598 42.2471 16.4478 41.8965C16.3154 41.6026 16.1136 41.3464 15.8597 41.1509C15.5976 40.9542 15.2991 40.8137 14.9816 40.7385C14.6225 40.6512 14.2541 40.6083 13.8849 40.6115H11.0258V48.4741H12.6849V45.3893H13.872ZM22.6954 47.4563C23.0149 47.1041 23.2498 46.6815 23.3814 46.2224C23.5347 45.6809 23.6084 45.1195 23.5999 44.5564C23.6065 44.008 23.5362 43.4614 23.3918 42.933C23.2672 42.477 23.0475 42.0532 22.7474 41.6904C22.4465 41.3379 22.0669 41.064 21.6398 40.8917C21.1305 40.6934 20.5882 40.5982 20.0432 40.6116H17.506V48.4821H20.0642C21.0475 48.5494 22.0103 48.1743 22.6954 47.4563ZM26.1252 42.05H29.4956L29.4956 40.6115H24.4661V48.4804L26.1287 48.4808V45.1068L28.6505 45.0962L28.64 43.6577H26.1252V42.05ZM18.3352 36.0407H37.3911L37.3908 14.3567H28.4428C27.5205 14.3567 26.6358 13.9852 25.9836 13.3238C25.331 12.6628 24.9646 11.7661 24.9646 10.8312V1.76186H4.34743C3.88625 1.76186 3.4437 1.94758 3.11762 2.27808C2.79153 2.60859 2.6083 3.05715 2.6083 3.52458V33.0185H14.9392C15.4408 33.0185 15.9179 33.238 16.2482 33.6205L18.3352 36.0407ZM6.08594 13.7151C6.08594 13.2283 6.48054 12.8337 6.9673 12.8337H20.6043C21.0911 12.8337 21.4857 13.2283 21.4857 13.7151C21.4857 14.2019 21.0911 14.5965 20.6043 14.5965H6.9673C6.48054 14.5965 6.08594 14.2019 6.08594 13.7151ZM18.5137 25.3369C18.5137 24.8502 18.9083 24.4556 19.395 24.4556H33.0321C33.5188 24.4556 33.9134 24.8502 33.9134 25.3369C33.9134 25.8237 33.5188 26.2183 33.0321 26.2183H19.395C18.9083 26.2183 18.5137 25.8237 18.5137 25.3369ZM6.9673 16.7056C6.48054 16.7056 6.08594 17.1002 6.08594 17.5869C6.08594 18.0737 6.48054 18.4683 6.9673 18.4683H33.0307C33.5174 18.4683 33.912 18.0737 33.912 17.5869C33.912 17.1002 33.5174 16.7056 33.0307 16.7056H6.9673ZM6.08594 21.4618C6.08594 20.975 6.48054 20.5804 6.9673 20.5804H33.0307C33.5174 20.5804 33.912 20.975 33.912 21.4618C33.912 21.9486 33.5174 22.3432 33.0307 22.3432H6.9673C6.48054 22.3432 6.08594 21.9486 6.08594 21.4618ZM21.4704 42.6691C21.1241 42.239 20.5919 42.0085 20.0457 42.0521H19.166V47.0441H20.0251C20.352 47.0567 20.6773 46.9886 20.9727 46.8469C21.213 46.7226 21.4156 46.5345 21.5589 46.3032C21.7076 46.0577 21.8089 45.7862 21.8582 45.5029C21.9164 45.1846 21.9455 44.8615 21.9451 44.5377C21.951 44.1698 21.9106 43.8023 21.8252 43.4446C21.758 43.1653 21.6373 42.9016 21.4704 42.6691ZM13.7445 42.0508C14.085 42.0213 14.4258 42.1008 14.7193 42.2782C14.8136 42.3518 14.8858 42.4501 14.9282 42.5627C14.9825 42.7134 15.0077 42.8731 15.0019 43.0333C15.0093 43.1969 14.9728 43.3594 14.8967 43.5039C14.8311 43.6211 14.7352 43.7175 14.6195 43.7832C14.4961 43.8525 14.361 43.8981 14.2212 43.9182C14.0636 43.9426 13.9041 43.9548 13.7445 43.9544H12.6855V42.0508H13.7445Z"
|
|
15
|
+
fill="#00236A"
|
|
16
|
+
/>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
export default SvgPdf;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export { default as
|
|
2
|
-
export { default as
|
|
3
|
-
export { default as
|
|
4
|
-
export { default as
|
|
5
|
-
export { default as
|
|
6
|
-
export { default as
|
|
7
|
-
export { default as
|
|
8
|
-
export { default as
|
|
9
|
-
export { default as
|
|
10
|
-
export { default as
|
|
1
|
+
export { default as Pdf } from './PDF';
|
|
2
|
+
export { default as Dots } from './Dots';
|
|
3
|
+
export { default as Arrow } from './Arrow';
|
|
4
|
+
export { default as Tooltip } from './Tooltip';
|
|
5
|
+
export { default as NextArrow } from './NextArrow';
|
|
6
|
+
export { default as CloseIcon } from './CloseIcon';
|
|
7
|
+
export { default as HeartFilled } from './HeartFilled';
|
|
8
|
+
export { default as ToasterInfo } from './ToasterInfo';
|
|
9
|
+
export { default as HeartOutline } from './HeartOutline';
|
|
10
|
+
export { default as ToasterClose } from './ToasterClose';
|
|
11
|
+
export { default as ToasterError } from './ToasterError';
|
|
12
|
+
export { default as ToasterSuccess } from './ToasterSuccess';
|
|
13
|
+
export { default as ToasterWarning } from './ToasterWarning';
|
|
14
|
+
export { default as CheckboxChecked } from './CheckboxChecked';
|
|
15
|
+
export { default as CheckboxUnchecked } from './CheckboxUnchecked';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NewAutocomplete } from './index';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
component: NewAutocomplete,
|
|
6
|
+
title: 'Components/NewAutocomplete',
|
|
7
|
+
argTypes: {
|
|
8
|
+
options: {
|
|
9
|
+
control: 'array'
|
|
10
|
+
},
|
|
11
|
+
getItem: {
|
|
12
|
+
control: 'function'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const Template = (args) => {
|
|
18
|
+
const handleClick = (selected) => {
|
|
19
|
+
console.log(selected, 'selected');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return <NewAutocomplete {...args} getItem={handleClick} />
|
|
23
|
+
};
|
|
24
|
+
export const Default = Template.bind({});
|
|
25
|
+
Default.args = {
|
|
26
|
+
searchCount: 3,
|
|
27
|
+
options: [
|
|
28
|
+
{"bbb":"0", "value":"dfsag"},
|
|
29
|
+
{"bbb":"1", "value":"asdfgh"},
|
|
30
|
+
{"bbb":"2", "value":"ghjjjh"},
|
|
31
|
+
{"bbb":"3", "value":"qwembm"},
|
|
32
|
+
{"bbb":"4", "value":"ertmbn"},
|
|
33
|
+
{"bbb":"5", "value":"tyuvxvc"},
|
|
34
|
+
{"bbb":"6", "value":"uiozcvx"},
|
|
35
|
+
{"bbb":"7", "value":"jkljhdfg"},
|
|
36
|
+
{"bbb":"8", "value":"asdfghcxvbcb"},
|
|
37
|
+
{"bbb":"9", "value":"asdfghcxvkbcb"},
|
|
38
|
+
{"bbb":"10", "value":"asdfghcxkkvbcb"},
|
|
39
|
+
{"bbb":"11", "value":"asdfghcxvmmmbcb"},
|
|
40
|
+
{"bbb":"12", "value":"asdfghcxkhjvbcb"},
|
|
41
|
+
{"bbb":"13", "value":"asdfghcxhjkvbcsb"},
|
|
42
|
+
{"bbb":"14", "value":"asdfghcxvbzxccxzcb"},
|
|
43
|
+
{"bbb":"15", "value":"asdfghcxjklljklvbcb"},
|
|
44
|
+
{"bbb":"16", "value":"asdfghcxvbljkljkljkcb"},
|
|
45
|
+
{"bbb":"17", "value":"asdfghcxljkljkljkljvbcb"},
|
|
46
|
+
{"bbb":"18", "value":"asdfghcxiouiouiouiouovbcb"},
|
|
47
|
+
{"bbb":"19", "value":"asdfghcuoiouiouiouiouxvbcb"},
|
|
48
|
+
{"bbb":"20", "value":"asdfghcuiouiouioiouiouixvbcb"}
|
|
49
|
+
]
|
|
50
|
+
}
|