@xaypay/tui 0.0.69 → 0.0.71
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 +1323 -294
- package/dist/index.js +1323 -292
- package/package.json +3 -2
- package/src/assets/range-arrow-default.svg +19 -0
- package/src/assets/range-arrow-error.svg +19 -0
- package/src/assets/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 +146 -56
- package/src/components/file/file.module.css +1 -1
- package/src/components/file/index.js +10 -8
- package/src/components/icon/Arrow.js +2 -2
- package/src/components/icon/CaptchaArrowDown.js +19 -0
- package/src/components/icon/CaptchaArrowUp.js +19 -0
- package/src/components/icon/CheckboxChecked.js +2 -2
- package/src/components/icon/CheckboxUnchecked.js +2 -2
- package/src/components/icon/CloseIcon.js +2 -2
- package/src/components/icon/DeleteComponent.js +20 -0
- package/src/components/icon/Dots.js +6 -6
- package/src/components/icon/ListItemDelete.js +19 -0
- package/src/components/icon/ListItemJpg.js +21 -0
- package/src/components/icon/ListItemPdf.js +21 -0
- package/src/components/icon/Nextarrow.js +19 -0
- package/src/components/icon/PDF.js +19 -0
- package/src/components/icon/RangeArrowDefault.js +54 -0
- package/src/components/icon/RangeArrowError.js +54 -0
- package/src/components/icon/RangeArrowSuccess.js +54 -0
- package/src/components/icon/RemoveFile.js +20 -0
- package/src/components/icon/ToasterClose.js +2 -2
- package/src/components/icon/ToasterError.js +2 -2
- package/src/components/icon/ToasterInfo.js +2 -2
- package/src/components/icon/ToasterSuccess.js +2 -2
- package/src/components/icon/ToasterWarning.js +2 -2
- package/src/components/icon/Tooltip.js +2 -2
- package/src/components/icon/Upload.js +25 -0
- package/src/components/icon/index.js +1 -10
- package/src/components/input/index.js +36 -31
- package/src/components/newAutocomplete/NewAutocomplete.stories.js +50 -0
- package/src/components/newAutocomplete/index.js +407 -0
- package/src/components/newFile/index.js +463 -0
- package/src/components/newFile/newFile.stories.js +41 -0
- package/src/components/pagination/index.js +5 -5
- package/src/components/textarea/index.js +63 -27
- package/src/components/textarea/textarea.stories.js +3 -3
- package/src/components/toaster/Toast.js +1 -1
- package/src/components/tooltip/index.js +2 -2
- package/src/index.js +3 -1
- package/src/stories/configuration.stories.mdx +87 -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 +120 -21
- package/src/assets/icons/arrow.svg +0 -3
- package/src/assets/icons/checkbox-checked.svg +0 -3
- package/src/assets/icons/checkbox-unchecked.svg +0 -3
- package/src/assets/icons/close-icon.svg +0 -3
- package/src/assets/icons/dots.svg +0 -3
- package/src/assets/icons/nextarrow.svg +0 -3
- package/src/assets/icons/toaster-close.svg +0 -3
- package/src/assets/icons/toaster-error.svg +0 -3
- package/src/assets/icons/toaster-info.svg +0 -3
- package/src/assets/icons/toaster-success.svg +0 -3
- package/src/assets/icons/toaster-warning.svg +0 -3
- package/src/assets/icons/tooltip.svg +0 -3
- package/src/assets/upload.svg +0 -4
- 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/src/components/icon/NextArrow.js +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaypay/tui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.71",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"lodash": "^4.17.21",
|
|
62
|
-
"react-icons": "^4.7.1"
|
|
62
|
+
"react-icons": "^4.7.1",
|
|
63
|
+
"uuid": "^9.0.0"
|
|
63
64
|
},
|
|
64
65
|
"bin": "./cli-command.js"
|
|
65
66
|
}
|
|
@@ -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/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/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/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,159 @@
|
|
|
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
|
+
const roundedRange = Math.ceil(range / 5) * 5;
|
|
37
|
+
setRangeNumber(Math.min(roundedRange, 100));
|
|
38
|
+
}
|
|
39
|
+
}, [range, getRange]);
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<>
|
|
43
|
+
{
|
|
44
|
+
label && <p
|
|
45
|
+
style={{
|
|
46
|
+
fontSize: size ? size : configStyles.Captcha.size,
|
|
47
|
+
color: color ? color : configStyles.Captcha.color
|
|
48
|
+
}}
|
|
49
|
+
>{ label }</p>
|
|
50
|
+
}
|
|
51
|
+
<div
|
|
52
|
+
style={{
|
|
53
|
+
width: '100%',
|
|
54
|
+
height: '76px',
|
|
55
|
+
maxWidth: '400px',
|
|
56
|
+
position: 'relative',
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
<div
|
|
60
|
+
style={{
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
top: '0px',
|
|
63
|
+
height: '15px',
|
|
64
|
+
left: `calc(${rangeNumber}% - 6px)`,
|
|
65
|
+
}}
|
|
66
|
+
>
|
|
67
|
+
<SvgCaptchaArrowDown />
|
|
68
|
+
</div>
|
|
69
|
+
<div
|
|
70
|
+
style={{
|
|
71
|
+
position: 'absolute',
|
|
72
|
+
display: 'flex',
|
|
73
|
+
top: '23px',
|
|
74
|
+
left: '0px',
|
|
75
|
+
width: '100%',
|
|
76
|
+
height: '30px',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
zIndex: 1
|
|
79
|
+
}}
|
|
80
|
+
className={styles['start-point']}
|
|
81
|
+
>
|
|
82
|
+
<div
|
|
83
|
+
style={{
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
top: '13px',
|
|
86
|
+
right: '0px',
|
|
87
|
+
width: '100%',
|
|
88
|
+
height: '4px',
|
|
89
|
+
borderRadius: '2px',
|
|
90
|
+
backgroundColor: '#EEEEEE',
|
|
91
|
+
borderRadius: '10px',
|
|
92
|
+
zIndex: -2
|
|
93
|
+
}}
|
|
94
|
+
></div>
|
|
95
|
+
<input
|
|
96
|
+
min={0}
|
|
97
|
+
step={5}
|
|
98
|
+
max={100}
|
|
99
|
+
type='range'
|
|
100
|
+
value={rangeProgress}
|
|
101
|
+
style={{
|
|
102
|
+
height: '4px',
|
|
103
|
+
width: '100%',
|
|
104
|
+
borderRadius: '2px',
|
|
105
|
+
cursor: 'pointer',
|
|
106
|
+
backgroundColor: 'transparent'
|
|
107
|
+
}}
|
|
108
|
+
className={`
|
|
109
|
+
${styles['range']}
|
|
110
|
+
${
|
|
111
|
+
+rangeProgress === rangeNumber ?
|
|
112
|
+
styles['range-success'] :
|
|
113
|
+
+rangeProgress !== rangeNumber && +rangeProgress > 0 ?
|
|
114
|
+
styles['range-error'] :
|
|
115
|
+
styles['range-default']
|
|
116
|
+
}
|
|
117
|
+
`}
|
|
118
|
+
onInput={handleRange}
|
|
119
|
+
/>
|
|
120
|
+
<div
|
|
121
|
+
style={{
|
|
122
|
+
position: 'absolute',
|
|
123
|
+
top: '13px',
|
|
124
|
+
left: '0px',
|
|
125
|
+
width: rangeProgress + '%',
|
|
126
|
+
height: '4px',
|
|
127
|
+
borderRadius: '2px',
|
|
128
|
+
backgroundColor:
|
|
129
|
+
+rangeProgress === rangeNumber ?
|
|
130
|
+
'#0DA574' :
|
|
131
|
+
+rangeProgress !== rangeNumber && +rangeProgress > 0 ?
|
|
132
|
+
'#EE0000' :
|
|
133
|
+
'transparent' ,
|
|
134
|
+
borderRadius: '2px',
|
|
135
|
+
zIndex: -1
|
|
136
|
+
}}
|
|
137
|
+
></div>
|
|
138
|
+
</div>
|
|
139
|
+
<div
|
|
140
|
+
style={{
|
|
141
|
+
position: 'absolute',
|
|
142
|
+
bottom: '0px',
|
|
143
|
+
height: '15px',
|
|
144
|
+
left: `calc(${rangeNumber}% - 6px)`,
|
|
145
|
+
transform: 'translate(-50% -50%)'
|
|
146
|
+
}}
|
|
147
|
+
>
|
|
148
|
+
<SvgCaptchaArrowUp />
|
|
149
|
+
</div>
|
|
150
|
+
</div>
|
|
151
|
+
</>
|
|
152
|
+
);
|
|
59
153
|
};
|
|
60
154
|
|
|
61
155
|
Captcha.propTypes = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
156
|
+
label: PropTypes.string,
|
|
157
|
+
range: PropTypes.number.isRequired,
|
|
158
|
+
getRange: PropTypes.func.isRequired
|
|
65
159
|
};
|
|
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});
|
|
@@ -69,8 +70,7 @@ export const File = ({
|
|
|
69
70
|
</p>
|
|
70
71
|
<div className={classnames(`${styles['file-form-wrap']} file-form-wrap-rem`,image ? styles['active'] : '')}>
|
|
71
72
|
<div
|
|
72
|
-
|
|
73
|
-
className={`${styles['file-form']} file-form-rem ${errorMessage ? styles['error'] : '' }`}
|
|
73
|
+
className={`${styles['file-form']} file-form-rem ${error || errorMessage ? styles['error'] : '' }`}
|
|
74
74
|
onClick={() => document.querySelector(`.${name}`).click()}
|
|
75
75
|
>
|
|
76
76
|
<input
|
|
@@ -83,7 +83,9 @@ export const File = ({
|
|
|
83
83
|
{
|
|
84
84
|
image ?
|
|
85
85
|
<div className={`${styles['upload-file-content']} upload-file-content-rem`}>
|
|
86
|
-
|
|
86
|
+
{
|
|
87
|
+
image === 'pdf' ? <PDF /> : <img src={image} alt={fileName} />
|
|
88
|
+
}
|
|
87
89
|
</div> :
|
|
88
90
|
<div className={`${styles['file-form-inner-upload']} ile-form-inner-upload-rem`}>
|
|
89
91
|
<img src="../../assets/upload.svg" alt="" />
|
|
@@ -106,7 +108,7 @@ export const File = ({
|
|
|
106
108
|
}
|
|
107
109
|
|
|
108
110
|
{
|
|
109
|
-
|
|
111
|
+
error || errorMessage ? <span style={{ color: 'red' }}>{error || errorMessage}</span> : null
|
|
110
112
|
}
|
|
111
113
|
</div>
|
|
112
114
|
</>
|
|
@@ -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,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const SvgDeleteComponent = ({ title, titleId, ...props }) => (
|
|
3
|
+
<svg
|
|
4
|
+
width="26"
|
|
5
|
+
height="26"
|
|
6
|
+
viewBox="0 0 26 26"
|
|
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
|
+
<rect x={0.5} y={0.5} width={25} height={25} rx={5.5} stroke="#D1D1D1" />
|
|
14
|
+
<path
|
|
15
|
+
d="M13 4c.822 0 1.611.296 2.206.826s.95 1.255.99 2.024l.005.15h4c.204 0 .4.073.548.205.148.13.238.31.25.501a.72.72 0 0 1-.185.525.817.817 0 0 1-.52.264l-.093.005h-.68l-.943 10.915a2.75 2.75 0 0 1-.957 1.84 3.114 3.114 0 0 1-2.034.745h-5.173c-.754 0-1.48-.266-2.034-.745a2.75 2.75 0 0 1-.957-1.84L6.478 8.5H5.8a.831.831 0 0 1-.531-.19.736.736 0 0 1-.263-.472L5 7.75c0-.184.072-.361.202-.498a.818.818 0 0 1 .504-.247L5.8 7h4c0-.796.337-1.559.938-2.121A3.312 3.312 0 0 1 13 4Zm-1.8 6.938a.623.623 0 0 0-.394.138.553.553 0 0 0-.2.348l-.006.076v6l.006.076c.02.135.09.258.2.348.11.09.25.138.394.138.145 0 .285-.049.395-.138.109-.09.18-.213.2-.348l.005-.076v-6l-.005-.076a.553.553 0 0 0-.2-.348.624.624 0 0 0-.395-.139Zm3.6 0a.623.623 0 0 0-.394.138.553.553 0 0 0-.2.348l-.005.076v6l.005.076c.02.135.091.258.2.348.11.09.25.138.394.138.145 0 .286-.049.395-.138.11-.09.18-.213.2-.348l.006-.076v-6l-.006-.076a.553.553 0 0 0-.2-.348.624.624 0 0 0-.395-.139ZM13 5.5a1.66 1.66 0 0 0-1.088.4c-.296.257-.477.61-.508.987L11.4 7h3.2l-.003-.112a1.465 1.465 0 0 0-.508-.988A1.66 1.66 0 0 0 13 5.5Z"
|
|
16
|
+
fill="#E00"
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
export default SvgDeleteComponent;
|