@xaypay/tui 0.0.70 → 0.0.72
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 +1009 -121
- package/dist/index.js +1009 -120
- package/package.json +3 -2
- package/src/components/autocomplate/autocomplate.stories.js +1 -1
- package/src/components/captcha/captcha.module.css +3 -3
- package/src/components/captcha/index.js +10 -7
- package/src/components/file/index.js +2 -3
- package/src/components/icon/Arrow.js +2 -2
- 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/ListItemJpeg.js +21 -0
- package/src/components/icon/ListItemJpg.js +21 -0
- package/src/components/icon/ListItemPdf.js +21 -0
- package/src/components/icon/ListItemPng.js +21 -0
- package/src/components/icon/Nextarrow.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 +2 -15
- package/src/components/input/index.js +49 -37
- package/src/components/input/input.stories.js +11 -5
- package/src/components/newAutocomplete/NewAutocomplete.stories.js +26 -26
- package/src/components/newAutocomplete/index.js +113 -92
- package/src/components/newFile/fileItem.js +213 -0
- package/src/components/newFile/index.js +488 -0
- package/src/components/newFile/newFile.stories.js +44 -0
- package/src/components/pagination/index.js +5 -5
- package/src/components/textarea/index.js +93 -28
- 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 +1 -0
- package/src/stories/configuration.stories.mdx +43 -0
- package/src/stories/static/autocomplete-usage.png +0 -0
- package/src/stories/static/file-single-usage.png +0 -0
- package/src/stories/static/file-usage.png +0 -0
- package/src/stories/static/input-usage.png +0 -0
- package/src/stories/static/tooltip-usage.png +0 -0
- package/src/stories/usage.stories.mdx +17 -8
- package/tui.config.js +41 -0
- 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/icon/NextArrow.js +0 -19
- package/src/stories/static/input-tooltip-usage.png +0 -0
- package/src/stories/static/new-autocomplete-usage.png +0 -0
- /package/src/assets/{icons/range-arrow-default.svg → range-arrow-default.svg} +0 -0
- /package/src/assets/{icons/range-arrow-error.svg → range-arrow-error.svg} +0 -0
- /package/src/assets/{icons/range-arrow-success.svg → range-arrow-success.svg} +0 -0
package/dist/index.es.js
CHANGED
|
@@ -137,8 +137,7 @@ const File = ({
|
|
|
137
137
|
}, "*")), /*#__PURE__*/React__default.createElement("div", {
|
|
138
138
|
className: classnames(`${styles$c['file-form-wrap']} file-form-wrap-rem`, image ? styles$c['active'] : '')
|
|
139
139
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
140
|
-
|
|
141
|
-
className: `${styles$c['file-form']} file-form-rem ${errorMessage ? styles$c['error'] : ''}`,
|
|
140
|
+
className: `${styles$c['file-form']} file-form-rem ${error || errorMessage ? styles$c['error'] : ''}`,
|
|
142
141
|
onClick: () => document.querySelector(`.${name}`).click()
|
|
143
142
|
}, /*#__PURE__*/React__default.createElement("input", {
|
|
144
143
|
hidden: true,
|
|
@@ -167,11 +166,11 @@ const File = ({
|
|
|
167
166
|
onClick: handleRemoveFile
|
|
168
167
|
}, /*#__PURE__*/React__default.createElement("i", {
|
|
169
168
|
className: "icon-delete"
|
|
170
|
-
})),
|
|
169
|
+
})), error || errorMessage ? /*#__PURE__*/React__default.createElement("span", {
|
|
171
170
|
style: {
|
|
172
171
|
color: 'red'
|
|
173
172
|
}
|
|
174
|
-
},
|
|
173
|
+
}, error || errorMessage) : null));
|
|
175
174
|
};
|
|
176
175
|
File.propTypes = {
|
|
177
176
|
label: PropTypes.string,
|
|
@@ -575,6 +574,9 @@ const InputTypes = {
|
|
|
575
574
|
TEXT: "text",
|
|
576
575
|
PASSWORD: "password"
|
|
577
576
|
};
|
|
577
|
+
const P = styled.p`
|
|
578
|
+
animation: ${props => props.errorAnimation ? props.animation : 'none'};
|
|
579
|
+
`;
|
|
578
580
|
const Input = ({
|
|
579
581
|
type,
|
|
580
582
|
size,
|
|
@@ -586,12 +588,12 @@ const Input = ({
|
|
|
586
588
|
regexp,
|
|
587
589
|
height,
|
|
588
590
|
radius,
|
|
591
|
+
change,
|
|
589
592
|
padding,
|
|
590
593
|
tooltip,
|
|
591
594
|
leftIcon,
|
|
592
595
|
required,
|
|
593
596
|
disabled,
|
|
594
|
-
onChange,
|
|
595
597
|
transform,
|
|
596
598
|
iconWidth,
|
|
597
599
|
rightIcon,
|
|
@@ -627,7 +629,7 @@ const Input = ({
|
|
|
627
629
|
errorAnimationDuration,
|
|
628
630
|
...props
|
|
629
631
|
}) => {
|
|
630
|
-
const phoneNumberRegex = /^\d
|
|
632
|
+
const phoneNumberRegex = /^\d+$/;
|
|
631
633
|
const [show, setShow] = useState(false);
|
|
632
634
|
const [isHover, setIsHover] = useState(false);
|
|
633
635
|
const [innerValue, setInnerValue] = useState('');
|
|
@@ -648,35 +650,41 @@ const Input = ({
|
|
|
648
650
|
const animation = _ => css`
|
|
649
651
|
${errorShow} ${errorAnimationDuration ? errorAnimationDuration : configStyles.INPUT.errorAnimationDuration} forwards
|
|
650
652
|
`;
|
|
651
|
-
const P = styled.p`
|
|
652
|
-
animation: ${errorAnimation ? animation : 'none'};
|
|
653
|
-
`;
|
|
654
653
|
const handleChange = event => {
|
|
655
654
|
const currentValue = event.target.value;
|
|
656
655
|
setInnerValue(currentValue);
|
|
656
|
+
if (change) {
|
|
657
|
+
change(currentValue);
|
|
658
|
+
}
|
|
657
659
|
if (type === 'tel') {
|
|
658
|
-
if (currentValue
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
if (!phoneNumberRegex.test(currentValue) && telErrorMessage) {
|
|
662
|
-
setInnerErrorMessage(telErrorMessage);
|
|
660
|
+
if (!phoneNumberRegex.test(currentValue)) {
|
|
661
|
+
telErrorMessage && setInnerErrorMessage(telErrorMessage);
|
|
662
|
+
setInnerValue('');
|
|
663
663
|
} else {
|
|
664
664
|
setInnerErrorMessage('');
|
|
665
|
+
if (currentValue.length > 8) {
|
|
666
|
+
setInnerValue(currentValue.substr(0, 8));
|
|
667
|
+
if (change) {
|
|
668
|
+
change(currentValue.substr(0, 8));
|
|
669
|
+
}
|
|
670
|
+
} else {
|
|
671
|
+
setInnerValue(currentValue);
|
|
672
|
+
if (change) {
|
|
673
|
+
change(currentValue);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
665
676
|
}
|
|
666
677
|
}
|
|
667
678
|
if (maxLength && currentValue.length > maxLength && type !== 'tel') {
|
|
668
679
|
setInnerValue(currentValue.substr(0, maxLength));
|
|
680
|
+
if (change) {
|
|
681
|
+
change(currentValue.substr(0, maxLength));
|
|
682
|
+
}
|
|
669
683
|
}
|
|
670
684
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
671
685
|
!regexp.test(currentValue) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
onChange(currentValue);
|
|
675
|
-
if (type === 'tel' && currentValue.length > 8) {
|
|
676
|
-
onChange(currentValue.substr(0, 8));
|
|
677
|
-
}
|
|
678
|
-
if (maxLength && currentValue.length > maxLength && type !== 'tel') {
|
|
679
|
-
onChange(currentValue.substr(0, maxLength));
|
|
686
|
+
if (change) {
|
|
687
|
+
change(currentValue);
|
|
680
688
|
}
|
|
681
689
|
}
|
|
682
690
|
};
|
|
@@ -687,16 +695,24 @@ const Input = ({
|
|
|
687
695
|
setIsHover(false);
|
|
688
696
|
};
|
|
689
697
|
useEffect(() => {
|
|
698
|
+
if (errorMessage) {
|
|
699
|
+
setInnerErrorMessage(errorMessage);
|
|
700
|
+
} else {
|
|
701
|
+
setInnerErrorMessage('');
|
|
702
|
+
}
|
|
690
703
|
if (value !== undefined && value !== null) {
|
|
691
704
|
setInnerValue(value);
|
|
692
705
|
if (type === 'tel') {
|
|
693
|
-
if (value
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
if (!phoneNumberRegex.test(value) && telErrorMessage) {
|
|
697
|
-
setInnerErrorMessage(telErrorMessage);
|
|
706
|
+
if (!phoneNumberRegex.test(value)) {
|
|
707
|
+
telErrorMessage && setInnerErrorMessage(telErrorMessage);
|
|
708
|
+
setInnerValue('');
|
|
698
709
|
} else {
|
|
699
710
|
setInnerErrorMessage('');
|
|
711
|
+
if (value.length > 8) {
|
|
712
|
+
setInnerValue(value.substr(0, 8));
|
|
713
|
+
} else {
|
|
714
|
+
setInnerValue(value);
|
|
715
|
+
}
|
|
700
716
|
}
|
|
701
717
|
}
|
|
702
718
|
if (maxLength && value.length > maxLength && type !== 'tel') {
|
|
@@ -706,11 +722,6 @@ const Input = ({
|
|
|
706
722
|
!regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
|
|
707
723
|
}
|
|
708
724
|
}
|
|
709
|
-
if (errorMessage) {
|
|
710
|
-
setInnerErrorMessage(errorMessage);
|
|
711
|
-
} else {
|
|
712
|
-
setInnerErrorMessage('');
|
|
713
|
-
}
|
|
714
725
|
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage]);
|
|
715
726
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
716
727
|
className: `${styles$8["input-wrap"]}`
|
|
@@ -803,7 +814,10 @@ const Input = ({
|
|
|
803
814
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
804
815
|
}
|
|
805
816
|
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', innerErrorMessage ? /*#__PURE__*/React__default.createElement(P, {
|
|
817
|
+
errorAnimation: errorAnimation,
|
|
818
|
+
animation: animation,
|
|
806
819
|
style: {
|
|
820
|
+
margin: '0px',
|
|
807
821
|
left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
|
|
808
822
|
color: errorColor ? errorColor : configStyles.INPUT.errorColor,
|
|
809
823
|
fontSize: errorSize ? errorSize : configStyles.INPUT.errorSize,
|
|
@@ -818,11 +832,11 @@ const Input = ({
|
|
|
818
832
|
};
|
|
819
833
|
Input.propTypes = {
|
|
820
834
|
name: PropTypes.string,
|
|
835
|
+
change: PropTypes.func,
|
|
821
836
|
color: PropTypes.string,
|
|
822
837
|
value: PropTypes.string,
|
|
823
838
|
width: PropTypes.string,
|
|
824
839
|
label: PropTypes.string,
|
|
825
|
-
onChange: PropTypes.func,
|
|
826
840
|
required: PropTypes.bool,
|
|
827
841
|
disabled: PropTypes.bool,
|
|
828
842
|
height: PropTypes.string,
|
|
@@ -1024,8 +1038,8 @@ const SvgCheckboxUnchecked = ({
|
|
|
1024
1038
|
titleId,
|
|
1025
1039
|
...props
|
|
1026
1040
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1027
|
-
width: "
|
|
1028
|
-
height: "
|
|
1041
|
+
width: "16",
|
|
1042
|
+
height: "16",
|
|
1029
1043
|
viewBox: "0 0 16 16",
|
|
1030
1044
|
fill: "none",
|
|
1031
1045
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1044,8 +1058,8 @@ const SvgCheckboxChecked = ({
|
|
|
1044
1058
|
titleId,
|
|
1045
1059
|
...props
|
|
1046
1060
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1047
|
-
width: "
|
|
1048
|
-
height: "
|
|
1061
|
+
width: "16",
|
|
1062
|
+
height: "16",
|
|
1049
1063
|
viewBox: "0 0 16 16",
|
|
1050
1064
|
fill: "none",
|
|
1051
1065
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1077,8 +1091,8 @@ const SvgArrow = ({
|
|
|
1077
1091
|
titleId,
|
|
1078
1092
|
...props
|
|
1079
1093
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1080
|
-
width: "
|
|
1081
|
-
height: "
|
|
1094
|
+
width: "15",
|
|
1095
|
+
height: "9",
|
|
1082
1096
|
viewBox: "0 0 15 9",
|
|
1083
1097
|
fill: "none",
|
|
1084
1098
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1095,8 +1109,8 @@ const SvgCloseIcon = ({
|
|
|
1095
1109
|
titleId,
|
|
1096
1110
|
...props
|
|
1097
1111
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1098
|
-
width: "
|
|
1099
|
-
height: "
|
|
1112
|
+
width: "14",
|
|
1113
|
+
height: "14",
|
|
1100
1114
|
viewBox: "0 0 14 14",
|
|
1101
1115
|
fill: "none",
|
|
1102
1116
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1429,8 +1443,8 @@ const SvgToasterInfo = ({
|
|
|
1429
1443
|
titleId,
|
|
1430
1444
|
...props
|
|
1431
1445
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1432
|
-
width: "
|
|
1433
|
-
height: "
|
|
1446
|
+
width: "24",
|
|
1447
|
+
height: "24",
|
|
1434
1448
|
viewBox: "0 0 24 24",
|
|
1435
1449
|
fill: "none",
|
|
1436
1450
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1447,8 +1461,8 @@ const SvgToasterError = ({
|
|
|
1447
1461
|
titleId,
|
|
1448
1462
|
...props
|
|
1449
1463
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1450
|
-
width: "
|
|
1451
|
-
height: "
|
|
1464
|
+
width: "24",
|
|
1465
|
+
height: "24",
|
|
1452
1466
|
viewBox: "0 0 24 24",
|
|
1453
1467
|
fill: "none",
|
|
1454
1468
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1465,8 +1479,8 @@ const SvgToasterClose = ({
|
|
|
1465
1479
|
titleId,
|
|
1466
1480
|
...props
|
|
1467
1481
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1468
|
-
width: "
|
|
1469
|
-
height: "
|
|
1482
|
+
width: "18",
|
|
1483
|
+
height: "18",
|
|
1470
1484
|
viewBox: "0 0 18 18",
|
|
1471
1485
|
fill: "none",
|
|
1472
1486
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1483,8 +1497,8 @@ const SvgToasterWarning = ({
|
|
|
1483
1497
|
titleId,
|
|
1484
1498
|
...props
|
|
1485
1499
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1486
|
-
width: "
|
|
1487
|
-
height: "
|
|
1500
|
+
width: "24",
|
|
1501
|
+
height: "24",
|
|
1488
1502
|
viewBox: "0 0 24 21",
|
|
1489
1503
|
fill: "none",
|
|
1490
1504
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1501,8 +1515,8 @@ const SvgToasterSuccess = ({
|
|
|
1501
1515
|
titleId,
|
|
1502
1516
|
...props
|
|
1503
1517
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1504
|
-
width: "
|
|
1505
|
-
height: "
|
|
1518
|
+
width: "24",
|
|
1519
|
+
height: "24",
|
|
1506
1520
|
viewBox: "0 0 24 24",
|
|
1507
1521
|
fill: "none",
|
|
1508
1522
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1601,12 +1615,12 @@ const Toast = ({
|
|
|
1601
1615
|
}
|
|
1602
1616
|
}, /*#__PURE__*/React__default.createElement("p", {
|
|
1603
1617
|
style: {
|
|
1618
|
+
margin: '0px',
|
|
1604
1619
|
fontWeight: 600,
|
|
1605
1620
|
color: '#3C393E',
|
|
1606
1621
|
fontSize: '16px',
|
|
1607
1622
|
lineHeight: '22px',
|
|
1608
|
-
fontStyle: 'normal'
|
|
1609
|
-
fontFamily: ''
|
|
1623
|
+
fontStyle: 'normal'
|
|
1610
1624
|
}
|
|
1611
1625
|
}, title ? title.length > 25 ? title.substr(0, 25) + '...' : title : ''), /*#__PURE__*/React__default.createElement("span", {
|
|
1612
1626
|
style: {
|
|
@@ -1770,7 +1784,23 @@ const Toaster = () => {
|
|
|
1770
1784
|
});
|
|
1771
1785
|
};
|
|
1772
1786
|
|
|
1773
|
-
|
|
1787
|
+
const SvgTooltip = ({
|
|
1788
|
+
title,
|
|
1789
|
+
titleId,
|
|
1790
|
+
...props
|
|
1791
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
1792
|
+
width: "16",
|
|
1793
|
+
height: "16",
|
|
1794
|
+
viewBox: "0 0 16 16",
|
|
1795
|
+
fill: "none",
|
|
1796
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1797
|
+
"aria-labelledby": titleId
|
|
1798
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
1799
|
+
id: titleId
|
|
1800
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
1801
|
+
d: "M8 0a8 8 0 1 0 .001 16.001A8 8 0 0 0 8 0Zm.571 11.857A.143.143 0 0 1 8.43 12H7.57a.143.143 0 0 1-.142-.143V7c0-.079.064-.143.142-.143h.858c.078 0 .142.064.142.143v4.857ZM8 5.714A.857.857 0 0 1 8 4a.857.857 0 0 1 0 1.714Z",
|
|
1802
|
+
fill: "#D1D1D1"
|
|
1803
|
+
}));
|
|
1774
1804
|
|
|
1775
1805
|
var css_248z$5 = ".tooltip-module_tooltip-block__v8U9u{align-items:center;display:flex;justify-content:center;position:relative}.tooltip-module_tooltip__emM6A{padding:10px;position:absolute;z-index:1}.tooltip-module_tooltip-rel__to9gq{align-items:center;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;-ms-border-radius:5px;-o-border-radius:5px;display:flex;height:auto;justify-content:center;min-height:10px;min-width:30px;position:relative;width:auto}.tooltip-module_tooltip-decor__qvt7t{border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-ms-border-radius:2px;-o-border-radius:2px;height:10px;position:absolute;transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);width:10px;z-index:-1}";
|
|
1776
1806
|
var styles$4 = {"tooltip-block":"tooltip-module_tooltip-block__v8U9u","tooltip":"tooltip-module_tooltip__emM6A","tooltip-rel":"tooltip-module_tooltip-rel__to9gq","tooltip-decor":"tooltip-module_tooltip-decor__qvt7t"};
|
|
@@ -1846,9 +1876,7 @@ const Tooltip = ({
|
|
|
1846
1876
|
cursor: 'pointer'
|
|
1847
1877
|
},
|
|
1848
1878
|
onClick: handleShow
|
|
1849
|
-
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/React__default.createElement(
|
|
1850
|
-
src: ReactInfoIcon
|
|
1851
|
-
})));
|
|
1879
|
+
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/React__default.createElement(SvgTooltip, null)));
|
|
1852
1880
|
};
|
|
1853
1881
|
Tooltip.propTypes = {
|
|
1854
1882
|
type: PropTypes.string,
|
|
@@ -1906,7 +1934,7 @@ const SvgCaptchaArrowDown = ({
|
|
|
1906
1934
|
fill: "#00236A"
|
|
1907
1935
|
}));
|
|
1908
1936
|
|
|
1909
|
-
var css_248z$4 = ".captcha-module_start-point__LkOqy:after{background-color:#d1d1d1;border:2px solid #fff;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-ms-border-radius:6px;-o-border-radius:6px;content:\"\";height:10px;left:0;position:absolute;top:7.5px;width:10px;z-index:-1}.captcha-module_range__k24I2{-webkit-appearance:none;margin:0}.captcha-module_range__k24I2::-webkit-slider-runnable-track{-webkit-appearance:none;width:100%}.captcha-module_range-default__-O0QD::-webkit-slider-thumb{background-image:url(../../assets/
|
|
1937
|
+
var css_248z$4 = ".captcha-module_start-point__LkOqy:after{background-color:#d1d1d1;border:2px solid #fff;border-radius:6px;-webkit-border-radius:6px;-moz-border-radius:6px;-ms-border-radius:6px;-o-border-radius:6px;content:\"\";height:10px;left:0;position:absolute;top:7.5px;width:10px;z-index:-1}.captcha-module_range__k24I2{-webkit-appearance:none;margin:0}.captcha-module_range__k24I2::-webkit-slider-runnable-track{-webkit-appearance:none;width:100%}.captcha-module_range-default__-O0QD::-webkit-slider-thumb{background-image:url(../../assets/range-arrow-default.svg)}.captcha-module_range-default__-O0QD::-webkit-slider-thumb,.captcha-module_range-error__FKMfG::-webkit-slider-thumb{-webkit-appearance:none;background-position:-5px;background-repeat:no-repeat;background-size:46px 46px;border-radius:17px;-webkit-border-radius:17px;-moz-border-radius:17px;-ms-border-radius:17px;-o-border-radius:17px;cursor:ew-resize;height:34px;width:34px}.captcha-module_range-error__FKMfG::-webkit-slider-thumb{background-image:url(../../assets/range-arrow-error.svg)}.captcha-module_range-success__VzLPq::-webkit-slider-thumb{-webkit-appearance:none;background-image:url(../../assets/range-arrow-success.svg);background-position:-5px;background-repeat:no-repeat;background-size:46px 46px;border-radius:17px;-webkit-border-radius:17px;-moz-border-radius:17px;-ms-border-radius:17px;-o-border-radius:17px;cursor:ew-resize;height:34px;width:34px}";
|
|
1910
1938
|
var styles$3 = {"start-point":"captcha-module_start-point__LkOqy","range":"captcha-module_range__k24I2","range-default":"captcha-module_range-default__-O0QD","range-error":"captcha-module_range-error__FKMfG","range-success":"captcha-module_range-success__VzLPq"};
|
|
1911
1939
|
styleInject(css_248z$4);
|
|
1912
1940
|
|
|
@@ -1932,12 +1960,13 @@ const Captcha = ({
|
|
|
1932
1960
|
if (!getRange) {
|
|
1933
1961
|
alert('Please add getRange property on Captcha component');
|
|
1934
1962
|
}
|
|
1935
|
-
if (range
|
|
1963
|
+
if (range >= 100) {
|
|
1936
1964
|
setRangeNumber(100);
|
|
1937
|
-
} else if (range
|
|
1965
|
+
} else if (range <= 0) {
|
|
1938
1966
|
setRangeNumber(0);
|
|
1939
1967
|
} else {
|
|
1940
|
-
|
|
1968
|
+
const roundedRange = Math.ceil(range / 5) * 5;
|
|
1969
|
+
setRangeNumber(Math.min(roundedRange, 100));
|
|
1941
1970
|
}
|
|
1942
1971
|
}, [range, getRange]);
|
|
1943
1972
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label && /*#__PURE__*/React__default.createElement("p", {
|
|
@@ -1985,6 +2014,7 @@ const Captcha = ({
|
|
|
1985
2014
|
}
|
|
1986
2015
|
}), /*#__PURE__*/React__default.createElement("input", {
|
|
1987
2016
|
min: 0,
|
|
2017
|
+
step: 5,
|
|
1988
2018
|
max: 100,
|
|
1989
2019
|
type: "range",
|
|
1990
2020
|
value: rangeProgress,
|
|
@@ -1997,7 +2027,7 @@ const Captcha = ({
|
|
|
1997
2027
|
},
|
|
1998
2028
|
className: `
|
|
1999
2029
|
${styles$3['range']}
|
|
2000
|
-
${rangeProgress
|
|
2030
|
+
${+rangeProgress === rangeNumber ? styles$3['range-success'] : +rangeProgress !== rangeNumber && +rangeProgress > 0 ? styles$3['range-error'] : styles$3['range-default']}
|
|
2001
2031
|
`,
|
|
2002
2032
|
onInput: handleRange
|
|
2003
2033
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -2008,7 +2038,7 @@ const Captcha = ({
|
|
|
2008
2038
|
width: rangeProgress + '%',
|
|
2009
2039
|
height: '4px',
|
|
2010
2040
|
borderRadius: '2px',
|
|
2011
|
-
backgroundColor: rangeProgress
|
|
2041
|
+
backgroundColor: +rangeProgress === rangeNumber ? '#0DA574' : +rangeProgress !== rangeNumber && +rangeProgress > 0 ? '#EE0000' : 'transparent',
|
|
2012
2042
|
borderRadius: '2px',
|
|
2013
2043
|
zIndex: -1
|
|
2014
2044
|
}
|
|
@@ -2017,7 +2047,8 @@ const Captcha = ({
|
|
|
2017
2047
|
position: 'absolute',
|
|
2018
2048
|
bottom: '0px',
|
|
2019
2049
|
height: '15px',
|
|
2020
|
-
left: `calc(${rangeNumber}% - 6px)
|
|
2050
|
+
left: `calc(${rangeNumber}% - 6px)`,
|
|
2051
|
+
transform: 'translate(-50% -50%)'
|
|
2021
2052
|
}
|
|
2022
2053
|
}, /*#__PURE__*/React__default.createElement(SvgCaptchaArrowUp, null))));
|
|
2023
2054
|
};
|
|
@@ -2060,6 +2091,797 @@ Stepper.propTypes = {
|
|
|
2060
2091
|
activeSteps: PropTypes.number
|
|
2061
2092
|
};
|
|
2062
2093
|
|
|
2094
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
2095
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
2096
|
+
// generators (like Math.random()).
|
|
2097
|
+
var getRandomValues;
|
|
2098
|
+
var rnds8 = new Uint8Array(16);
|
|
2099
|
+
function rng() {
|
|
2100
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
2101
|
+
if (!getRandomValues) {
|
|
2102
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
2103
|
+
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
2104
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
2105
|
+
|
|
2106
|
+
if (!getRandomValues) {
|
|
2107
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
|
|
2111
|
+
return getRandomValues(rnds8);
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
2115
|
+
|
|
2116
|
+
function validate(uuid) {
|
|
2117
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2120
|
+
/**
|
|
2121
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
2122
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
2123
|
+
*/
|
|
2124
|
+
|
|
2125
|
+
var byteToHex = [];
|
|
2126
|
+
|
|
2127
|
+
for (var i = 0; i < 256; ++i) {
|
|
2128
|
+
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
function stringify(arr) {
|
|
2132
|
+
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2133
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
2134
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
2135
|
+
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
2136
|
+
// of the following:
|
|
2137
|
+
// - One or more input array values don't map to a hex octet (leading to
|
|
2138
|
+
// "undefined" in the uuid)
|
|
2139
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
|
2140
|
+
|
|
2141
|
+
if (!validate(uuid)) {
|
|
2142
|
+
throw TypeError('Stringified UUID is invalid');
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
return uuid;
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
function v4(options, buf, offset) {
|
|
2149
|
+
options = options || {};
|
|
2150
|
+
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
2151
|
+
|
|
2152
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
2153
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
2154
|
+
|
|
2155
|
+
if (buf) {
|
|
2156
|
+
offset = offset || 0;
|
|
2157
|
+
|
|
2158
|
+
for (var i = 0; i < 16; ++i) {
|
|
2159
|
+
buf[offset + i] = rnds[i];
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
return buf;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
return stringify(rnds);
|
|
2166
|
+
}
|
|
2167
|
+
|
|
2168
|
+
const SvgListItemPdf = ({
|
|
2169
|
+
title,
|
|
2170
|
+
titleId,
|
|
2171
|
+
...props
|
|
2172
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2173
|
+
width: "32",
|
|
2174
|
+
height: "42",
|
|
2175
|
+
viewBox: "0 0 32 42",
|
|
2176
|
+
fill: "none",
|
|
2177
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2178
|
+
"aria-labelledby": titleId
|
|
2179
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2180
|
+
id: titleId
|
|
2181
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2182
|
+
fillRule: "evenodd",
|
|
2183
|
+
clipRule: "evenodd",
|
|
2184
|
+
d: "M31.862 10.64c.007.01.015.02.022.027l.116.108v28.328c0 .768-.306 1.505-.852 2.049a2.917 2.917 0 0 1-2.057.848H2.909a2.917 2.917 0 0 1-2.057-.848A2.891 2.891 0 0 1 0 39.103V2.897C0 2.128.306 1.392.852.848A2.917 2.917 0 0 1 2.909 0h18.27l.108.116.03.025.028.026.025.02.026.023L31.79 10.558c.02.018.037.037.052.058l.02.025Zm-1.743 29.486a1.45 1.45 0 0 0 .427-1.022v-8.77H13.95a.716.716 0 0 1-.546-.246l-1.963-2.238H1.455v11.254c.001.383.155.751.427 1.022.273.272.642.425 1.027.426h26.182a1.463 1.463 0 0 0 1.027-.426ZM4.364 17.633c0 .4.324.724.724.724h21.825a.724.724 0 1 0 0-1.448H5.088c-.4 0-.724.324-.724.724Zm23.273 3.186c0-.4-.325-.724-.724-.724H15.48a.724.724 0 0 0 0 1.448h11.432c.4 0 .724-.324.724-.724Zm-.724-5.641a.724.724 0 1 0 0-1.449H5.088a.724.724 0 1 0 0 1.449h21.825Zm-22.55-3.91c0 .4.325.723.725.723H16.52a.724.724 0 0 0 0-1.448H5.088c-.4 0-.724.324-.724.724Zm17.672-1.345c.272.27.642.423 1.027.425h6.458l-7.913-7.879V8.9c.002.384.155.752.428 1.024ZM10.43 36.013H9.103v2.385H8V32h2.43c.495 0 .916.088 1.261.264.349.172.614.413.796.72.181.305.272.654.272 1.046 0 .413-.09.768-.272 1.064a1.754 1.754 0 0 1-.796.68c-.345.16-.766.238-1.26.238Zm-1.327-3.134v2.259h1.327c.29 0 .525-.047.703-.14a.877.877 0 0 0 .391-.388c.085-.167.128-.357.128-.57 0-.203-.043-.392-.128-.568a.971.971 0 0 0-.39-.43c-.18-.109-.414-.163-.704-.163H9.103Zm6.504 5.52h-1.859V32H15.646c.425 0 .813.072 1.165.215.352.141.655.345.91.611.258.267.455.586.593.958.138.372.206.788.206 1.248v.339c0 .46-.068.876-.206 1.248a2.714 2.714 0 0 1-.593.958 2.662 2.662 0 0 1-.923.61c-.355.141-.752.211-1.191.211Zm0-.875h-.756v-4.645h.795c.285 0 .535.047.752.14.22.094.404.232.554.414a1.8 1.8 0 0 1 .342.672c.08.267.12.573.12.918v.348c0 .445-.07.829-.208 1.151-.134.322-.336.57-.606.743-.267.172-.598.259-.993.259Zm5.124-2.725v-1.92h2.975V32h-4.078v6.398h1.103v-2.724h2.61v-.875h-2.61Z",
|
|
2185
|
+
fill: "#051942"
|
|
2186
|
+
}));
|
|
2187
|
+
|
|
2188
|
+
const SvgListItemJpg = ({
|
|
2189
|
+
title,
|
|
2190
|
+
titleId,
|
|
2191
|
+
...props
|
|
2192
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2193
|
+
width: "32",
|
|
2194
|
+
height: "42",
|
|
2195
|
+
viewBox: "0 0 32 42",
|
|
2196
|
+
fill: "none",
|
|
2197
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2198
|
+
"aria-labelledby": titleId
|
|
2199
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2200
|
+
id: titleId
|
|
2201
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2202
|
+
fillRule: "evenodd",
|
|
2203
|
+
clipRule: "evenodd",
|
|
2204
|
+
d: "M31.862 10.64c.007.01.015.02.022.027l.116.108v28.328c0 .768-.306 1.505-.852 2.049a2.917 2.917 0 0 1-2.057.848H2.909a2.917 2.917 0 0 1-2.057-.848A2.891 2.891 0 0 1 0 39.103V2.897C0 2.128.306 1.392.852.848A2.917 2.917 0 0 1 2.909 0h18.27l.108.116.03.025.028.026.025.02.026.023L31.79 10.558c.02.018.037.037.052.058l.02.025Zm-1.743 29.486a1.45 1.45 0 0 0 .427-1.022v-8.77H13.95a.716.716 0 0 1-.546-.246l-1.963-2.238H1.455v11.254c.001.383.155.751.427 1.022.273.272.642.425 1.027.426h26.182a1.463 1.463 0 0 0 1.027-.426ZM4.364 17.633c0 .4.324.724.724.724h21.825a.724.724 0 1 0 0-1.448H5.088c-.4 0-.724.324-.724.724Zm23.273 3.186c0-.4-.325-.724-.724-.724H15.48a.724.724 0 0 0 0 1.448h11.432c.4 0 .724-.324.724-.724Zm-.724-5.641a.724.724 0 1 0 0-1.449H5.088a.724.724 0 1 0 0 1.449h21.825Zm-22.55-3.91c0 .4.325.723.725.723H16.52a.724.724 0 0 0 0-1.448H5.088c-.4 0-.724.324-.724.724Zm17.672-1.345c.272.27.642.423 1.027.425h6.458l-7.913-7.879V8.9c.002.384.155.752.428 1.024Zm2.071 27.737v-2.443h-2.43v.822h1.331v1.27a1.19 1.19 0 0 1-.224.175c-.094.059-.221.11-.382.154a2.579 2.579 0 0 1-.62.062c-.258 0-.489-.047-.694-.14a1.408 1.408 0 0 1-.523-.427 2.062 2.062 0 0 1-.325-.69 3.614 3.614 0 0 1-.11-.936v-.453c0-.346.032-.653.097-.923.064-.27.16-.498.285-.685.13-.188.29-.33.484-.426.193-.097.417-.146.672-.146.296 0 .536.052.72.154.188.1.332.238.431.413.103.176.172.375.207.598h1.081a2.633 2.633 0 0 0-.356-1.055 1.913 1.913 0 0 0-.8-.72c-.343-.176-.776-.264-1.3-.264-.41 0-.778.069-1.104.206a2.204 2.204 0 0 0-.826.598 2.742 2.742 0 0 0-.527.967c-.12.378-.18.809-.18 1.292v.444c0 .486.066.92.197 1.3.132.378.318.7.559.963.243.264.531.464.865.602.334.135.702.202 1.103.202.472 0 .866-.051 1.182-.154.317-.102.57-.224.76-.364a2.13 2.13 0 0 0 .427-.396Zm-13.03-1.094v-4.478h1.099v4.478c0 .425-.091.786-.273 1.085-.181.3-.429.528-.742.686-.314.158-.67.237-1.068.237-.407 0-.77-.069-1.086-.206a1.622 1.622 0 0 1-.738-.633C8.09 37.45 8 37.09 8 36.654h1.107c0 .252.04.455.12.61a.755.755 0 0 0 .342.335c.15.067.324.1.523.1a.99.99 0 0 0 .505-.127.909.909 0 0 0 .352-.382c.085-.17.127-.378.127-.624Zm4.799-.466h-1.327v2.386h-1.103v-6.398h2.43c.495 0 .916.088 1.261.264.349.172.614.413.796.72.181.305.272.654.272 1.046 0 .413-.09.768-.272 1.064a1.753 1.753 0 0 1-.796.68c-.345.159-.766.238-1.261.238Zm-1.327-3.133v2.259h1.327c.29 0 .524-.047.703-.141a.876.876 0 0 0 .391-.387c.085-.167.128-.357.128-.571 0-.202-.043-.391-.128-.567a.97.97 0 0 0-.39-.43c-.18-.109-.414-.163-.704-.163h-1.327Z",
|
|
2205
|
+
fill: "#051942"
|
|
2206
|
+
}));
|
|
2207
|
+
|
|
2208
|
+
const SvgListItemPng = ({
|
|
2209
|
+
title,
|
|
2210
|
+
titleId,
|
|
2211
|
+
...props
|
|
2212
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2213
|
+
width: "32",
|
|
2214
|
+
height: "42",
|
|
2215
|
+
viewBox: "0 0 32 42",
|
|
2216
|
+
fill: "none",
|
|
2217
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2218
|
+
"aria-labelledby": titleId
|
|
2219
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2220
|
+
id: titleId
|
|
2221
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2222
|
+
fillRule: "evenodd",
|
|
2223
|
+
clipRule: "evenodd",
|
|
2224
|
+
d: "m31.873 10.655-.011-.014c-.007-.01-.014-.018-.021-.025a.356.356 0 0 0-.052-.058L21.396.21 21.37.188l-.025-.021a.476.476 0 0 0-.029-.025l-.029-.026L21.178 0H2.91C2.138 0 1.398.305.852.848A2.891 2.891 0 0 0 0 2.897v36.206c0 .768.306 1.505.852 2.049A2.917 2.917 0 0 0 2.909 42h26.182c.771 0 1.511-.305 2.057-.848.546-.544.852-1.28.852-2.049V10.775l-.116-.108a.21.21 0 0 1-.01-.012Zm-1.327 28.449a1.45 1.45 0 0 1-.427 1.022 1.463 1.463 0 0 1-1.028.426H2.91a1.463 1.463 0 0 1-1.027-.426 1.45 1.45 0 0 1-.427-1.022V27.85h9.986l1.963 2.238a.716.716 0 0 0 .546.246h16.596v8.77ZM5.088 18.357a.724.724 0 1 1 0-1.448h21.825a.724.724 0 1 1 0 1.448H5.088Zm21.825 1.738a.724.724 0 0 1 0 1.448H15.48a.724.724 0 0 1 0-1.448h11.432Zm.724-5.641c0 .4-.325.724-.724.724H5.088a.724.724 0 1 1 0-1.449h21.825c.4 0 .724.325.724.725ZM5.088 11.99a.724.724 0 1 1 0-1.448H16.52a.724.724 0 0 1 0 1.449H5.088Zm17.974-1.643A1.451 1.451 0 0 1 21.607 8.9V2.47l7.913 7.878h-6.458ZM9.103 36.012h1.327c.495 0 .916-.079 1.261-.237.349-.158.614-.385.796-.681.181-.296.272-.65.272-1.064 0-.392-.09-.74-.272-1.046a1.85 1.85 0 0 0-.796-.72c-.345-.176-.766-.264-1.26-.264H8v6.398h1.103v-2.386Zm0-.874v-2.26h1.327c.29 0 .525.055.703.163.179.109.31.253.391.431.085.176.128.365.128.567 0 .214-.043.404-.128.571a.877.877 0 0 1-.39.387c-.18.094-.414.14-.704.14H9.103ZM13.7 32h1.09l3.292 5.106a63.566 63.566 0 0 1-.044-1.379V32h.956v6.398h-1.1l-3.303-4.9.002.044c.012.134.02.279.027.435l.018.468c.006.163.009.327.009.49v3.463H13.7V32Zm11.393 5.66v-2.443h-2.43v.822h1.332v1.27a1.19 1.19 0 0 1-.225.175c-.093.059-.22.11-.382.154a2.578 2.578 0 0 1-.62.062c-.257 0-.489-.047-.694-.14a1.408 1.408 0 0 1-.523-.427 2.062 2.062 0 0 1-.325-.69 3.614 3.614 0 0 1-.11-.936v-.453c0-.346.032-.653.097-.923.064-.27.16-.498.285-.685.13-.188.29-.33.484-.426.193-.097.417-.146.672-.146.296 0 .536.052.721.154.188.1.331.238.43.413a1.7 1.7 0 0 1 .207.598h1.081a2.633 2.633 0 0 0-.356-1.055 1.913 1.913 0 0 0-.8-.72c-.342-.176-.776-.264-1.3-.264-.41 0-.778.069-1.103.206a2.204 2.204 0 0 0-.826.598 2.742 2.742 0 0 0-.528.967c-.12.378-.18.809-.18 1.292v.444c0 .486.066.92.198 1.3.132.378.318.7.558.963.243.264.532.464.866.602.334.135.701.202 1.103.202.471 0 .865-.051 1.182-.154.316-.102.57-.224.76-.364.193-.144.335-.276.426-.396Z",
|
|
2225
|
+
fill: "#051942"
|
|
2226
|
+
}));
|
|
2227
|
+
|
|
2228
|
+
const SvgListItemJpeg = ({
|
|
2229
|
+
title,
|
|
2230
|
+
titleId,
|
|
2231
|
+
...props
|
|
2232
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2233
|
+
width: "33",
|
|
2234
|
+
height: "42",
|
|
2235
|
+
viewBox: "0 0 33 42",
|
|
2236
|
+
fill: "none",
|
|
2237
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2238
|
+
"aria-labelledby": titleId
|
|
2239
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2240
|
+
id: titleId
|
|
2241
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2242
|
+
fillRule: "evenodd",
|
|
2243
|
+
clipRule: "evenodd",
|
|
2244
|
+
d: "m32.384 10.667-.022-.026-.021-.025a.356.356 0 0 0-.052-.058L21.896.21 21.87.188l-.025-.021-.029-.026a.477.477 0 0 1-.029-.025L21.678 0H3.41c-.771 0-1.511.305-2.057.848A2.891 2.891 0 0 0 .5 2.897v36.206c0 .768.306 1.505.852 2.049A2.917 2.917 0 0 0 3.409 42h26.182c.771 0 1.511-.305 2.057-.848.546-.544.852-1.28.852-2.049V10.775l-.116-.108Zm-1.338 28.437a1.45 1.45 0 0 1-.427 1.022 1.463 1.463 0 0 1-1.028.426H3.41a1.463 1.463 0 0 1-1.027-.426 1.45 1.45 0 0 1-.427-1.022V27.85h9.986l1.963 2.238a.716.716 0 0 0 .546.246h16.596v8.77ZM5.588 18.357a.724.724 0 1 1 0-1.448h21.825a.724.724 0 1 1 0 1.448H5.588Zm21.825 1.738a.724.724 0 0 1 0 1.448H15.98a.724.724 0 0 1 0-1.448h11.432Zm.724-5.641c0 .4-.325.724-.724.724H5.588a.724.724 0 1 1 0-1.449h21.825c.4 0 .724.325.724.725ZM5.588 11.99a.724.724 0 1 1 0-1.448H17.02a.724.724 0 0 1 0 1.449H5.588Zm17.974-1.643A1.451 1.451 0 0 1 22.107 8.9V2.47l7.913 7.878h-6.458ZM8.576 32.088v4.478c0 .246-.042.454-.127.624a.91.91 0 0 1-.352.382.99.99 0 0 1-.505.128c-.2 0-.374-.034-.523-.101a.755.755 0 0 1-.343-.334c-.079-.156-.119-.36-.119-.611H5.5c0 .436.09.797.268 1.08.179.285.425.496.738.634.317.137.679.206 1.086.206.398 0 .754-.079 1.068-.237.313-.158.56-.387.742-.686.182-.299.273-.66.273-1.085v-4.478H8.576Zm3.472 4.012h1.327c.495 0 .915-.079 1.261-.237.349-.158.614-.386.796-.681.181-.296.272-.65.272-1.064 0-.392-.09-.741-.272-1.046a1.849 1.849 0 0 0-.796-.72c-.345-.176-.766-.264-1.261-.264h-2.43v6.398h1.103V36.1Zm0-.874v-2.26h1.327c.29 0 .524.055.703.163a.97.97 0 0 1 .391.431c.085.176.128.365.128.567 0 .214-.043.404-.128.571a.876.876 0 0 1-.39.387c-.18.094-.414.14-.704.14h-1.327Zm14.545.087v2.444c-.09.12-.233.252-.426.395-.19.141-.444.263-.76.365-.317.103-.71.154-1.182.154-.402 0-.77-.068-1.103-.202a2.415 2.415 0 0 1-.866-.602 2.755 2.755 0 0 1-.558-.963 3.964 3.964 0 0 1-.198-1.3v-.444c0-.484.06-.914.18-1.292.123-.381.299-.703.527-.967.229-.264.504-.463.827-.598a2.805 2.805 0 0 1 1.103-.206c.524 0 .958.088 1.3.263.346.173.613.413.8.721.188.308.307.66.356 1.055h-1.08a1.7 1.7 0 0 0-.207-.598 1.046 1.046 0 0 0-.431-.413c-.185-.102-.425-.154-.72-.154-.256 0-.48.049-.673.145a1.271 1.271 0 0 0-.483.426 2.093 2.093 0 0 0-.286.686c-.065.27-.097.577-.097.923v.452c0 .352.037.664.11.937.076.272.185.502.325.69.144.187.318.33.523.426.205.093.437.14.695.14.252 0 .458-.02.62-.061.16-.044.288-.095.381-.154.097-.062.172-.12.225-.176v-1.27h-1.332v-.822h2.43ZM16.7 32.085h3.791v.884h-2.78v1.754h2.618v.875H17.71v2.033h2.781v.884h-3.79v-6.43Z",
|
|
2245
|
+
fill: "#051942"
|
|
2246
|
+
}));
|
|
2247
|
+
|
|
2248
|
+
const SvgListItemDelete = ({
|
|
2249
|
+
title,
|
|
2250
|
+
titleId,
|
|
2251
|
+
...props
|
|
2252
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2253
|
+
width: "22",
|
|
2254
|
+
height: "22",
|
|
2255
|
+
viewBox: "0 0 22 22",
|
|
2256
|
+
fill: "none",
|
|
2257
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2258
|
+
"aria-labelledby": titleId
|
|
2259
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2260
|
+
id: titleId
|
|
2261
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2262
|
+
d: "M7.071 3.144V.786A.786.786 0 0 1 7.857 0h6.286a.786.786 0 0 1 .786.786v2.358h6.285a.786.786 0 0 1 0 1.572H.786a.786.786 0 1 1 0-1.572H7.07Zm1.572 0h4.714V1.573H8.643v1.571ZM3.143 22a.786.786 0 0 1-.786-.786V4.716h17.286v16.498a.786.786 0 0 1-.786.786H3.143Zm5.5-4.714a.786.786 0 0 0 .786-.786V8.644a.786.786 0 0 0-1.572 0V16.5a.785.785 0 0 0 .786.786Zm4.714 0a.785.785 0 0 0 .786-.786V8.644a.785.785 0 0 0-1.572 0V16.5a.785.785 0 0 0 .786.786Z",
|
|
2263
|
+
fill: "#051942"
|
|
2264
|
+
}));
|
|
2265
|
+
|
|
2266
|
+
const FileItem = /*#__PURE__*/React__default.memo(({
|
|
2267
|
+
size,
|
|
2268
|
+
name,
|
|
2269
|
+
uuid,
|
|
2270
|
+
check,
|
|
2271
|
+
radius,
|
|
2272
|
+
status,
|
|
2273
|
+
removeFile,
|
|
2274
|
+
fileFormat,
|
|
2275
|
+
progressColor,
|
|
2276
|
+
listItemHeight,
|
|
2277
|
+
listItemPadding,
|
|
2278
|
+
progressFontSize,
|
|
2279
|
+
listItemErrorSize,
|
|
2280
|
+
listItemErrorColor,
|
|
2281
|
+
progressTrackColor,
|
|
2282
|
+
progressFailedColor,
|
|
2283
|
+
progressSuccessColor,
|
|
2284
|
+
progressLoadingColor,
|
|
2285
|
+
listItemBackgroundColor,
|
|
2286
|
+
listItemBackgroundErrorColor
|
|
2287
|
+
}) => {
|
|
2288
|
+
const [i, setI] = useState(_ => _);
|
|
2289
|
+
const [t, setT] = useState(_ => _);
|
|
2290
|
+
const [progress, setProgress] = useState(7);
|
|
2291
|
+
const handleRemoveItem = id => {
|
|
2292
|
+
removeFile(id);
|
|
2293
|
+
};
|
|
2294
|
+
useEffect(() => {
|
|
2295
|
+
let time = Math.floor(Math.random() * (1100 - 900 + 1)) + 900;
|
|
2296
|
+
let fileSizeInMB = Math.round(size / (1024 * 1024));
|
|
2297
|
+
if (fileSizeInMB > 5) {
|
|
2298
|
+
const times = [Math.floor(Math.random() * (1700 - 1300 + 1)) + 1300, Math.floor(Math.random() * (3200 - 2800 + 1)) + 2800, Math.floor(Math.random() * (4700 - 4300 + 1)) + 4300, Math.floor(Math.random() * (6200 - 5800 + 1)) + 5800, Math.floor(Math.random() * (7700 - 7300 + 1)) + 7300];
|
|
2299
|
+
const index = Math.min(Math.floor((size - 1) / 15), times.length - 1);
|
|
2300
|
+
time = times[index];
|
|
2301
|
+
}
|
|
2302
|
+
setI(setInterval(() => {
|
|
2303
|
+
setProgress(prev => {
|
|
2304
|
+
return prev += 7;
|
|
2305
|
+
});
|
|
2306
|
+
}, time));
|
|
2307
|
+
return () => {
|
|
2308
|
+
setI(_ => _);
|
|
2309
|
+
clearTimeout(t);
|
|
2310
|
+
clearInterval(i);
|
|
2311
|
+
};
|
|
2312
|
+
}, []);
|
|
2313
|
+
useEffect(() => {
|
|
2314
|
+
if (progress > 84) {
|
|
2315
|
+
clearInterval(i);
|
|
2316
|
+
}
|
|
2317
|
+
}, [progress]);
|
|
2318
|
+
useEffect(() => {
|
|
2319
|
+
if (status === 'success') {
|
|
2320
|
+
setProgress(100);
|
|
2321
|
+
clearInterval(i);
|
|
2322
|
+
}
|
|
2323
|
+
if (status === 'failed') {
|
|
2324
|
+
setProgress(0);
|
|
2325
|
+
clearInterval(i);
|
|
2326
|
+
}
|
|
2327
|
+
}, [status]);
|
|
2328
|
+
useEffect(() => {
|
|
2329
|
+
if (check !== '') {
|
|
2330
|
+
setT(setTimeout(() => {
|
|
2331
|
+
removeFile(uuid);
|
|
2332
|
+
}, 3500));
|
|
2333
|
+
}
|
|
2334
|
+
}, [check]);
|
|
2335
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2336
|
+
style: {
|
|
2337
|
+
width: '100%',
|
|
2338
|
+
display: 'flex',
|
|
2339
|
+
marginTop: '6px',
|
|
2340
|
+
alignItems: 'center',
|
|
2341
|
+
borderRadius: radius,
|
|
2342
|
+
height: listItemHeight,
|
|
2343
|
+
boxSizing: 'border-box',
|
|
2344
|
+
padding: listItemPadding,
|
|
2345
|
+
flexDirection: check !== '' ? 'column' : 'row',
|
|
2346
|
+
justifyContent: check !== '' ? 'space-around' : 'space-between',
|
|
2347
|
+
backgroundColor: check !== '' ? listItemBackgroundErrorColor : listItemBackgroundColor
|
|
2348
|
+
}
|
|
2349
|
+
}, check !== '' ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
|
|
2350
|
+
style: {
|
|
2351
|
+
margin: '0px',
|
|
2352
|
+
color: listItemErrorColor,
|
|
2353
|
+
fontSize: listItemErrorSize
|
|
2354
|
+
}
|
|
2355
|
+
}, name), /*#__PURE__*/React__default.createElement("p", {
|
|
2356
|
+
style: {
|
|
2357
|
+
margin: '0px',
|
|
2358
|
+
color: listItemErrorColor,
|
|
2359
|
+
fontSize: listItemErrorSize
|
|
2360
|
+
}
|
|
2361
|
+
}, check)) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
2362
|
+
style: {
|
|
2363
|
+
width: '32px'
|
|
2364
|
+
}
|
|
2365
|
+
}, fileFormat === 'pdf' ? /*#__PURE__*/React__default.createElement(SvgListItemPdf, null) : fileFormat === 'jpg' ? /*#__PURE__*/React__default.createElement(SvgListItemJpg, null) : fileFormat === 'png' ? /*#__PURE__*/React__default.createElement(SvgListItemPng, null) : fileFormat === 'jpeg' ? /*#__PURE__*/React__default.createElement(SvgListItemJpeg, null) : ''), /*#__PURE__*/React__default.createElement("div", {
|
|
2366
|
+
style: {
|
|
2367
|
+
position: 'relative',
|
|
2368
|
+
display: 'flex',
|
|
2369
|
+
height: '40px',
|
|
2370
|
+
margin: '0px 14px',
|
|
2371
|
+
alignItems: 'flex-end',
|
|
2372
|
+
width: 'calc(100% - 82px)'
|
|
2373
|
+
}
|
|
2374
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2375
|
+
style: {
|
|
2376
|
+
width: '100%',
|
|
2377
|
+
height: '100%',
|
|
2378
|
+
display: 'flex',
|
|
2379
|
+
paddingTop: '5px',
|
|
2380
|
+
color: progressColor,
|
|
2381
|
+
boxSizing: 'border-box',
|
|
2382
|
+
alignItems: 'flex-start',
|
|
2383
|
+
fontSize: progressFontSize,
|
|
2384
|
+
justifyContent: 'space-between'
|
|
2385
|
+
}
|
|
2386
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
2387
|
+
style: {
|
|
2388
|
+
margin: '0px',
|
|
2389
|
+
overflow: 'hidden',
|
|
2390
|
+
whiteSpace: 'nowrap',
|
|
2391
|
+
textOverflow: 'ellipsis',
|
|
2392
|
+
maxWidth: 'calc(100% - 56px)'
|
|
2393
|
+
}
|
|
2394
|
+
}, name), /*#__PURE__*/React__default.createElement("span", null, progress, " %")), /*#__PURE__*/React__default.createElement("div", {
|
|
2395
|
+
style: {
|
|
2396
|
+
position: 'absolute',
|
|
2397
|
+
left: '0px',
|
|
2398
|
+
bottom: '5px',
|
|
2399
|
+
width: '100%',
|
|
2400
|
+
height: '4px',
|
|
2401
|
+
borderRadius: '10px',
|
|
2402
|
+
backgroundColor: progressTrackColor
|
|
2403
|
+
}
|
|
2404
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2405
|
+
style: {
|
|
2406
|
+
height: '100%',
|
|
2407
|
+
borderRadius: '10px',
|
|
2408
|
+
width: status === 'failed' ? '100%' : progress + '%',
|
|
2409
|
+
backgroundColor: status === 'success' ? progressSuccessColor : status === 'failed' ? progressFailedColor : progressLoadingColor
|
|
2410
|
+
}
|
|
2411
|
+
}))), /*#__PURE__*/React__default.createElement("div", {
|
|
2412
|
+
style: {
|
|
2413
|
+
width: '22px',
|
|
2414
|
+
cursor: 'pointer'
|
|
2415
|
+
},
|
|
2416
|
+
onClick: () => handleRemoveItem(uuid)
|
|
2417
|
+
}, /*#__PURE__*/React__default.createElement(SvgListItemDelete, null))));
|
|
2418
|
+
});
|
|
2419
|
+
|
|
2420
|
+
const SvgUpload = ({
|
|
2421
|
+
title,
|
|
2422
|
+
titleId,
|
|
2423
|
+
...props
|
|
2424
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2425
|
+
width: "51",
|
|
2426
|
+
height: "35",
|
|
2427
|
+
viewBox: "0 0 51 35",
|
|
2428
|
+
fill: "none",
|
|
2429
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2430
|
+
"aria-labelledby": titleId
|
|
2431
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2432
|
+
id: titleId
|
|
2433
|
+
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2434
|
+
d: "M41.54 11.842h-.017c-.23-3.225-2.902-5.772-6.167-5.772-1.08 0-2.095.28-2.979.77C30.267 2.774 26.041 0 21.167 0 14.318 0 8.742 5.483 8.534 12.326 3.758 12.708 0 16.726 0 21.63c0 5.155 4.153 9.334 9.277 9.334h22.625a10.987 10.987 0 0 1-.888-4.334c0-6.059 4.899-10.987 10.918-10.987 3.773 0 7.106 1.938 9.068 4.875-.444-4.864-4.508-8.675-9.46-8.675ZM15.654 6.975c-.072.06-.144.12-.211.185-.266.259-.512.53-.705.849-.741 1.218-.882 2.523-.72 3.927.156 1.35-1.942 1.334-2.095 0-.289-2.493.504-5.307 2.664-6.775 1.12-.763 2.164 1.052 1.067 1.814Zm-.022.015c-.047.035-.111.093 0 0Z",
|
|
2435
|
+
fill: "#D1D1D1"
|
|
2436
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2437
|
+
fillRule: "evenodd",
|
|
2438
|
+
clipRule: "evenodd",
|
|
2439
|
+
d: "M41.822 17.245c-4.864 0-8.822 3.982-8.822 8.878C33 31.018 36.958 35 41.822 35c4.864 0 8.822-3.982 8.822-8.877 0-4.896-3.959-8.878-8.822-8.878Zm-.536 13.005v-6.689l-3.067 3.22a.69.69 0 0 1-1.01 0 .777.777 0 0 1 0-1.06l4.286-4.5A.71.71 0 0 1 42 21a.684.684 0 0 1 .505.22l4.286 4.5a.777.777 0 0 1 0 1.06.69.69 0 0 1-1.01 0l-3.067-3.22v6.69c0 .414-.32.75-.714.75-.395 0-.714-.336-.714-.75Z",
|
|
2440
|
+
fill: "#0DA574"
|
|
2441
|
+
}));
|
|
2442
|
+
|
|
2443
|
+
const SvgRemoveFile = ({
|
|
2444
|
+
title,
|
|
2445
|
+
titleId,
|
|
2446
|
+
...props
|
|
2447
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2448
|
+
width: "26",
|
|
2449
|
+
height: "26",
|
|
2450
|
+
viewBox: "0 0 26 26",
|
|
2451
|
+
fill: "none",
|
|
2452
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2453
|
+
"aria-labelledby": titleId
|
|
2454
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2455
|
+
id: titleId
|
|
2456
|
+
}, title) : null, /*#__PURE__*/React.createElement("rect", {
|
|
2457
|
+
width: 26,
|
|
2458
|
+
height: 26,
|
|
2459
|
+
rx: 6,
|
|
2460
|
+
fill: "#FBFBFB"
|
|
2461
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2462
|
+
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",
|
|
2463
|
+
fill: "#00236A"
|
|
2464
|
+
}));
|
|
2465
|
+
|
|
2466
|
+
const SvgDeleteComponent = ({
|
|
2467
|
+
title,
|
|
2468
|
+
titleId,
|
|
2469
|
+
...props
|
|
2470
|
+
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2471
|
+
width: "26",
|
|
2472
|
+
height: "26",
|
|
2473
|
+
viewBox: "0 0 26 26",
|
|
2474
|
+
fill: "none",
|
|
2475
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2476
|
+
"aria-labelledby": titleId
|
|
2477
|
+
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2478
|
+
id: titleId
|
|
2479
|
+
}, title) : null, /*#__PURE__*/React.createElement("rect", {
|
|
2480
|
+
x: 0.5,
|
|
2481
|
+
y: 0.5,
|
|
2482
|
+
width: 25,
|
|
2483
|
+
height: 25,
|
|
2484
|
+
rx: 5.5,
|
|
2485
|
+
stroke: "#D1D1D1"
|
|
2486
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
2487
|
+
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",
|
|
2488
|
+
fill: "#E00"
|
|
2489
|
+
}));
|
|
2490
|
+
|
|
2491
|
+
const NewFile = ({
|
|
2492
|
+
or,
|
|
2493
|
+
size,
|
|
2494
|
+
name,
|
|
2495
|
+
color,
|
|
2496
|
+
label,
|
|
2497
|
+
width,
|
|
2498
|
+
weight,
|
|
2499
|
+
height,
|
|
2500
|
+
radius,
|
|
2501
|
+
change,
|
|
2502
|
+
border,
|
|
2503
|
+
upload,
|
|
2504
|
+
maxSize,
|
|
2505
|
+
disabled,
|
|
2506
|
+
multiple,
|
|
2507
|
+
required,
|
|
2508
|
+
errorSize,
|
|
2509
|
+
labelSize,
|
|
2510
|
+
removeFile,
|
|
2511
|
+
labelColor,
|
|
2512
|
+
errorColor,
|
|
2513
|
+
filesArray,
|
|
2514
|
+
putFileHere,
|
|
2515
|
+
borderColor,
|
|
2516
|
+
uploadColor,
|
|
2517
|
+
defaultData,
|
|
2518
|
+
errorMessage,
|
|
2519
|
+
fileSizeText,
|
|
2520
|
+
progressColor,
|
|
2521
|
+
fileExtensions,
|
|
2522
|
+
listItemHeight,
|
|
2523
|
+
backgroundColor,
|
|
2524
|
+
deleteComponent,
|
|
2525
|
+
listItemPadding,
|
|
2526
|
+
progressFontSize,
|
|
2527
|
+
borderHoverColor,
|
|
2528
|
+
listItemErrorSize,
|
|
2529
|
+
progressTrackColor,
|
|
2530
|
+
fileAreaImageWidth,
|
|
2531
|
+
listItemErrorColor,
|
|
2532
|
+
labelRequiredColor,
|
|
2533
|
+
progressFailedColor,
|
|
2534
|
+
fileAreaImageHeight,
|
|
2535
|
+
progressSuccessColor,
|
|
2536
|
+
progressLoadingColor,
|
|
2537
|
+
hiddenBackgroundColor,
|
|
2538
|
+
extentionsRowMarginTop,
|
|
2539
|
+
listItemBackgroundColor,
|
|
2540
|
+
listItemBackgroundErrorColor
|
|
2541
|
+
}) => {
|
|
2542
|
+
const ref = useRef(null);
|
|
2543
|
+
const inpRef = useRef(null);
|
|
2544
|
+
const memoizedItems = useMemo(() => filesArray, [filesArray]);
|
|
2545
|
+
const [error, setError] = useState('');
|
|
2546
|
+
const [isHover, setIsHover] = useState(false);
|
|
2547
|
+
const [singleFile, setSingleFile] = useState(null);
|
|
2548
|
+
const [image, setImage] = useState(!multiple ? defaultData ? defaultData.type !== 'application/pdf' ? defaultData.url : 'pdf' : null : null);
|
|
2549
|
+
const configStyles = compereConfigs();
|
|
2550
|
+
const handleRemoveComponent = () => {
|
|
2551
|
+
const node = ReactDOM.findDOMNode(ref.current);
|
|
2552
|
+
const parent = node.parentNode;
|
|
2553
|
+
parent.removeChild(node);
|
|
2554
|
+
};
|
|
2555
|
+
const handleRemoveFile = () => {
|
|
2556
|
+
setImage(null);
|
|
2557
|
+
removeFile(singleFile);
|
|
2558
|
+
};
|
|
2559
|
+
const handleChange = e => {
|
|
2560
|
+
const file = e.target.files;
|
|
2561
|
+
if (multiple) {
|
|
2562
|
+
setError('');
|
|
2563
|
+
setImage(null);
|
|
2564
|
+
for (let ix = 0; ix < file.length; ix++) {
|
|
2565
|
+
if (file[ix]) {
|
|
2566
|
+
if (file[ix].size <= maxSize * Math.pow(2, 20)) {
|
|
2567
|
+
if (fileExtensions.includes(file[ix].type.split('/')[1])) {
|
|
2568
|
+
change({
|
|
2569
|
+
id: '',
|
|
2570
|
+
check: '',
|
|
2571
|
+
status: '',
|
|
2572
|
+
file: file[ix],
|
|
2573
|
+
uuid: v4()
|
|
2574
|
+
});
|
|
2575
|
+
} else {
|
|
2576
|
+
change({
|
|
2577
|
+
file: file[ix],
|
|
2578
|
+
uuid: v4(),
|
|
2579
|
+
check: 'ֆայլի սխալ ֆորմատ'
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2582
|
+
} else {
|
|
2583
|
+
change({
|
|
2584
|
+
file: file[ix],
|
|
2585
|
+
uuid: v4(),
|
|
2586
|
+
check: 'առավելագույն ծավալ'
|
|
2587
|
+
});
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
if (file.length === 0 && memoizedItems.length === 0) {
|
|
2592
|
+
setError('Ֆայլը ընտրված չէ');
|
|
2593
|
+
}
|
|
2594
|
+
} else {
|
|
2595
|
+
if (file[0]) {
|
|
2596
|
+
if (file[0].size <= maxSize * Math.pow(2, 20)) {
|
|
2597
|
+
if (fileExtensions.includes(file[0].type.split('/')[1])) {
|
|
2598
|
+
setError('');
|
|
2599
|
+
change(file);
|
|
2600
|
+
setSingleFile(file);
|
|
2601
|
+
if (file[0].type === 'application/pdf') {
|
|
2602
|
+
setImage('pdf');
|
|
2603
|
+
} else {
|
|
2604
|
+
setImage(URL.createObjectURL(file[0]));
|
|
2605
|
+
}
|
|
2606
|
+
} else {
|
|
2607
|
+
setImage(null);
|
|
2608
|
+
setError('ֆայլի սխալ ֆորմատ');
|
|
2609
|
+
}
|
|
2610
|
+
} else {
|
|
2611
|
+
setImage(null);
|
|
2612
|
+
setError('առավելագույն ծավալ');
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
if (file.length === 0) {
|
|
2616
|
+
setImage(null);
|
|
2617
|
+
setError('Ֆայլը ընտրված չէ');
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
};
|
|
2621
|
+
const handleClick = () => {
|
|
2622
|
+
if (!image) {
|
|
2623
|
+
inpRef.current.click();
|
|
2624
|
+
}
|
|
2625
|
+
};
|
|
2626
|
+
const handleDrop = e => {
|
|
2627
|
+
if (!disabled) {
|
|
2628
|
+
e.preventDefault();
|
|
2629
|
+
handleChange({
|
|
2630
|
+
target: {
|
|
2631
|
+
files: e.dataTransfer.files
|
|
2632
|
+
}
|
|
2633
|
+
});
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
const handleDragOver = e => {
|
|
2637
|
+
if (!disabled) {
|
|
2638
|
+
e.preventDefault();
|
|
2639
|
+
}
|
|
2640
|
+
};
|
|
2641
|
+
const handleMouseEnter = () => {
|
|
2642
|
+
setIsHover(true);
|
|
2643
|
+
};
|
|
2644
|
+
const handleMouseLeave = () => {
|
|
2645
|
+
setIsHover(false);
|
|
2646
|
+
};
|
|
2647
|
+
const handleStopPropagation = e => {
|
|
2648
|
+
e.stopPropagation();
|
|
2649
|
+
};
|
|
2650
|
+
useEffect(() => {
|
|
2651
|
+
if (!multiple && defaultData) {
|
|
2652
|
+
if (!defaultData.type) {
|
|
2653
|
+
alert('Please add type in defaultData prop');
|
|
2654
|
+
}
|
|
2655
|
+
if (!defaultData.url) {
|
|
2656
|
+
alert('Please add url in defaultData prop');
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2659
|
+
if (multiple && !filesArray) {
|
|
2660
|
+
alert('In multiple mode, you should add filesArray prop for drawing files');
|
|
2661
|
+
}
|
|
2662
|
+
if (multiple) {
|
|
2663
|
+
setSingleFile(null);
|
|
2664
|
+
}
|
|
2665
|
+
}, [multiple, filesArray && filesArray.length, defaultData]);
|
|
2666
|
+
useEffect(() => {
|
|
2667
|
+
if (errorMessage) {
|
|
2668
|
+
setError(errorMessage);
|
|
2669
|
+
} else {
|
|
2670
|
+
setError('');
|
|
2671
|
+
}
|
|
2672
|
+
}, [errorMessage]);
|
|
2673
|
+
useEffect(() => {
|
|
2674
|
+
if (!change) {
|
|
2675
|
+
alert('Please add change prop on File component');
|
|
2676
|
+
}
|
|
2677
|
+
if (!removeFile) {
|
|
2678
|
+
alert('Please add removeFile prop on File component');
|
|
2679
|
+
}
|
|
2680
|
+
}, [change, removeFile]);
|
|
2681
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2682
|
+
ref: ref,
|
|
2683
|
+
style: {
|
|
2684
|
+
width: width ? width : configStyles.File.width
|
|
2685
|
+
}
|
|
2686
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2687
|
+
style: {
|
|
2688
|
+
display: 'flex',
|
|
2689
|
+
marginBottom: '6px',
|
|
2690
|
+
alignItems: 'center',
|
|
2691
|
+
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2692
|
+
}
|
|
2693
|
+
}, label && /*#__PURE__*/React__default.createElement("label", {
|
|
2694
|
+
style: {
|
|
2695
|
+
color: labelColor ? labelColor : configStyles.File.labelColor,
|
|
2696
|
+
fontSize: labelSize ? labelSize : configStyles.File.labelSize
|
|
2697
|
+
}
|
|
2698
|
+
}, label, required && /*#__PURE__*/React__default.createElement("sup", {
|
|
2699
|
+
style: {
|
|
2700
|
+
color: labelRequiredColor ? labelRequiredColor : configStyles.File.labelRequiredColor
|
|
2701
|
+
}
|
|
2702
|
+
}, "*")), deleteComponent && /*#__PURE__*/React__default.createElement("span", {
|
|
2703
|
+
style: {
|
|
2704
|
+
cursor: 'pointer'
|
|
2705
|
+
},
|
|
2706
|
+
onClick: handleRemoveComponent
|
|
2707
|
+
}, /*#__PURE__*/React__default.createElement(SvgDeleteComponent, null))), /*#__PURE__*/React__default.createElement("div", {
|
|
2708
|
+
style: {
|
|
2709
|
+
width: '100%',
|
|
2710
|
+
display: 'flex',
|
|
2711
|
+
alignItems: 'center',
|
|
2712
|
+
position: 'relative',
|
|
2713
|
+
boxSizing: 'border-box',
|
|
2714
|
+
justifyContent: 'center',
|
|
2715
|
+
cursor: !disabled ? 'pointer' : 'not-allowed',
|
|
2716
|
+
height: height ? height : configStyles.File.height,
|
|
2717
|
+
border: border ? border : configStyles.File.border,
|
|
2718
|
+
borderRadius: radius ? radius : configStyles.File.radius,
|
|
2719
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.File.backgroundColor,
|
|
2720
|
+
borderColor: error ? errorColor ? errorColor : configStyles.File.errorColor : disabled ? borderColor ? borderColor : configStyles.File.borderColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.File.borderHoverColor : borderColor ? borderColor : configStyles.File.borderColor
|
|
2721
|
+
},
|
|
2722
|
+
onDrop: handleDrop,
|
|
2723
|
+
onClick: handleClick,
|
|
2724
|
+
onDragOver: handleDragOver,
|
|
2725
|
+
onMouseEnter: handleMouseEnter,
|
|
2726
|
+
onMouseLeave: handleMouseLeave
|
|
2727
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
2728
|
+
hidden: true,
|
|
2729
|
+
name: name,
|
|
2730
|
+
type: "file",
|
|
2731
|
+
ref: inpRef,
|
|
2732
|
+
disabled: disabled,
|
|
2733
|
+
multiple: multiple,
|
|
2734
|
+
onChange: handleChange
|
|
2735
|
+
}), /*#__PURE__*/React__default.createElement("div", {
|
|
2736
|
+
style: {
|
|
2737
|
+
width: '100%',
|
|
2738
|
+
height: '100%',
|
|
2739
|
+
display: 'flex',
|
|
2740
|
+
textAlign: 'center',
|
|
2741
|
+
alignItems: 'center',
|
|
2742
|
+
flexDirection: 'column',
|
|
2743
|
+
justifyContent: 'center',
|
|
2744
|
+
color: color ? color : configStyles.File.color,
|
|
2745
|
+
fontSize: size ? size : configStyles.File.size,
|
|
2746
|
+
fontWeight: weight ? weight : configStyles.File.weight
|
|
2747
|
+
}
|
|
2748
|
+
}, !multiple && image ? image === 'pdf' ? /*#__PURE__*/React__default.createElement(SvgPdf, null) : /*#__PURE__*/React__default.createElement("img", {
|
|
2749
|
+
src: image,
|
|
2750
|
+
style: {
|
|
2751
|
+
display: 'block',
|
|
2752
|
+
maxWidth: '100%',
|
|
2753
|
+
maxHeight: '95%',
|
|
2754
|
+
objectFit: 'contain',
|
|
2755
|
+
width: fileAreaImageWidth ? fileAreaImageWidth : configStyles.File.fileAreaImageWidth,
|
|
2756
|
+
height: fileAreaImageHeight ? fileAreaImageHeight : configStyles.File.fileAreaImageHeight
|
|
2757
|
+
},
|
|
2758
|
+
alt: "file preview"
|
|
2759
|
+
}) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SvgUpload, null)), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("p", {
|
|
2760
|
+
style: {
|
|
2761
|
+
margin: '0px'
|
|
2762
|
+
}
|
|
2763
|
+
}, putFileHere ? putFileHere : configStyles.File.putFileHere, /*#__PURE__*/React__default.createElement("br", null), or ? or : configStyles.File.or, " ", /*#__PURE__*/React__default.createElement("span", {
|
|
2764
|
+
style: {
|
|
2765
|
+
color: uploadColor ? uploadColor : configStyles.File.uploadColor
|
|
2766
|
+
}
|
|
2767
|
+
}, upload ? upload : configStyles.File.upload))), /*#__PURE__*/React__default.createElement("div", {
|
|
2768
|
+
style: {
|
|
2769
|
+
marginTop: extentionsRowMarginTop ? extentionsRowMarginTop : configStyles.File.extentionsRowMarginTop
|
|
2770
|
+
}
|
|
2771
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
2772
|
+
style: {
|
|
2773
|
+
margin: '0px'
|
|
2774
|
+
}
|
|
2775
|
+
}, fileSizeText ? fileSizeText : configStyles.File.fileSizeText, " ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )")))), /*#__PURE__*/React__default.createElement("div", {
|
|
2776
|
+
style: {
|
|
2777
|
+
position: 'absolute',
|
|
2778
|
+
top: '0px',
|
|
2779
|
+
left: '0px',
|
|
2780
|
+
zIndex: '1',
|
|
2781
|
+
width: '100%',
|
|
2782
|
+
height: '100%',
|
|
2783
|
+
padding: '10px',
|
|
2784
|
+
cursor: 'default',
|
|
2785
|
+
boxSizing: 'border-box',
|
|
2786
|
+
alignItems: 'flex-start',
|
|
2787
|
+
justifyContent: 'flex-end',
|
|
2788
|
+
borderRadius: radius ? radius : configStyles.File.radius,
|
|
2789
|
+
display: !multiple && !disabled && image && !error && isHover ? 'flex' : 'none',
|
|
2790
|
+
backgroundColor: hiddenBackgroundColor ? hiddenBackgroundColor : configStyles.File.hiddenBackgroundColor
|
|
2791
|
+
},
|
|
2792
|
+
onClick: handleStopPropagation
|
|
2793
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2794
|
+
style: {
|
|
2795
|
+
cursor: 'pointer'
|
|
2796
|
+
},
|
|
2797
|
+
onClick: handleRemoveFile
|
|
2798
|
+
}, /*#__PURE__*/React__default.createElement(SvgRemoveFile, null)))), error ? /*#__PURE__*/React__default.createElement("span", {
|
|
2799
|
+
style: {
|
|
2800
|
+
marginTop: '6px',
|
|
2801
|
+
display: 'inline-block',
|
|
2802
|
+
color: errorColor ? errorColor : configStyles.File.errorColor,
|
|
2803
|
+
fontSize: errorSize ? errorSize : configStyles.File.errorSize
|
|
2804
|
+
}
|
|
2805
|
+
}, error) : '', multiple && memoizedItems && memoizedItems.length > 0 && memoizedItems.map(item => {
|
|
2806
|
+
return /*#__PURE__*/React__default.createElement(FileItem, {
|
|
2807
|
+
key: item.uuid,
|
|
2808
|
+
uuid: item.uuid,
|
|
2809
|
+
check: item.check,
|
|
2810
|
+
status: item.status,
|
|
2811
|
+
size: item.file.size,
|
|
2812
|
+
name: item.file.name,
|
|
2813
|
+
removeFile: removeFile,
|
|
2814
|
+
radius: radius ? radius : configStyles.File.radius,
|
|
2815
|
+
fileFormat: item.file.type.split('/')[1].toLowerCase(),
|
|
2816
|
+
progressColor: progressColor ? progressColor : configStyles.File.progressColor,
|
|
2817
|
+
listItemHeight: listItemHeight ? listItemHeight : configStyles.File.listItemHeight,
|
|
2818
|
+
listItemPadding: listItemPadding ? listItemPadding : configStyles.File.listItemPadding,
|
|
2819
|
+
progressFontSize: progressFontSize ? progressFontSize : configStyles.File.progressFontSize,
|
|
2820
|
+
listItemErrorSize: listItemErrorSize ? listItemErrorSize : configStyles.File.listItemErrorSize,
|
|
2821
|
+
listItemErrorColor: listItemErrorColor ? listItemErrorColor : configStyles.File.listItemErrorColor,
|
|
2822
|
+
progressTrackColor: progressTrackColor ? progressTrackColor : configStyles.File.progressTrackColor,
|
|
2823
|
+
progressFailedColor: progressFailedColor ? progressFailedColor : configStyles.File.progressFailedColor,
|
|
2824
|
+
progressSuccessColor: progressSuccessColor ? progressSuccessColor : configStyles.File.progressSuccessColor,
|
|
2825
|
+
progressLoadingColor: progressLoadingColor ? progressLoadingColor : configStyles.File.progressLoadingColor,
|
|
2826
|
+
listItemBackgroundColor: listItemBackgroundColor ? listItemBackgroundColor : configStyles.File.listItemBackgroundColor,
|
|
2827
|
+
listItemBackgroundErrorColor: listItemBackgroundErrorColor ? listItemBackgroundErrorColor : configStyles.File.listItemBackgroundErrorColor
|
|
2828
|
+
});
|
|
2829
|
+
}));
|
|
2830
|
+
};
|
|
2831
|
+
NewFile.propTypes = {
|
|
2832
|
+
or: PropTypes.string,
|
|
2833
|
+
size: PropTypes.string,
|
|
2834
|
+
label: PropTypes.string,
|
|
2835
|
+
width: PropTypes.string,
|
|
2836
|
+
color: PropTypes.string,
|
|
2837
|
+
height: PropTypes.string,
|
|
2838
|
+
disabled: PropTypes.bool,
|
|
2839
|
+
radius: PropTypes.string,
|
|
2840
|
+
border: PropTypes.string,
|
|
2841
|
+
required: PropTypes.bool,
|
|
2842
|
+
upload: PropTypes.string,
|
|
2843
|
+
weight: PropTypes.number,
|
|
2844
|
+
maxSize: PropTypes.number,
|
|
2845
|
+
errorSize: PropTypes.string,
|
|
2846
|
+
labelSize: PropTypes.string,
|
|
2847
|
+
labelColor: PropTypes.string,
|
|
2848
|
+
errorColor: PropTypes.string,
|
|
2849
|
+
putFileHere: PropTypes.string,
|
|
2850
|
+
borderColor: PropTypes.string,
|
|
2851
|
+
uploadColor: PropTypes.string,
|
|
2852
|
+
defaultData: PropTypes.object,
|
|
2853
|
+
errorMessage: PropTypes.string,
|
|
2854
|
+
fileSizeText: PropTypes.string,
|
|
2855
|
+
progressColor: PropTypes.string,
|
|
2856
|
+
deleteComponent: PropTypes.bool,
|
|
2857
|
+
listItemHeight: PropTypes.string,
|
|
2858
|
+
backgroundColor: PropTypes.string,
|
|
2859
|
+
change: PropTypes.func.isRequired,
|
|
2860
|
+
listItemPadding: PropTypes.string,
|
|
2861
|
+
progressFontSize: PropTypes.string,
|
|
2862
|
+
borderHoverColor: PropTypes.string,
|
|
2863
|
+
listItemErrorSize: PropTypes.string,
|
|
2864
|
+
labelRequiredColor: PropTypes.string,
|
|
2865
|
+
progressTrackColor: PropTypes.string,
|
|
2866
|
+
fileAreaImageWidth: PropTypes.string,
|
|
2867
|
+
listItemErrorColor: PropTypes.string,
|
|
2868
|
+
removeFile: PropTypes.func.isRequired,
|
|
2869
|
+
fileAreaImageHeight: PropTypes.string,
|
|
2870
|
+
progressFailedColor: PropTypes.string,
|
|
2871
|
+
progressSuccessColor: PropTypes.string,
|
|
2872
|
+
progressLoadingColor: PropTypes.string,
|
|
2873
|
+
hiddenBackgroundColor: PropTypes.string,
|
|
2874
|
+
extentionsRowMarginTop: PropTypes.string,
|
|
2875
|
+
listItemBackgroundColor: PropTypes.string,
|
|
2876
|
+
listItemBackgroundErrorColor: PropTypes.string,
|
|
2877
|
+
filesArray: PropTypes.arrayOf(PropTypes.object),
|
|
2878
|
+
fileExtensions: PropTypes.arrayOf(PropTypes.string)
|
|
2879
|
+
};
|
|
2880
|
+
NewFile.defaultProps = {
|
|
2881
|
+
maxSize: 50,
|
|
2882
|
+
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
|
|
2883
|
+
};
|
|
2884
|
+
|
|
2063
2885
|
var css_248z$2 = "textarea::-webkit-scrollbar{width:6px}textarea::-webkit-scrollbar-track{background:#eee}textarea::-webkit-scrollbar-thumb,textarea::-webkit-scrollbar-track{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px}textarea::-webkit-scrollbar-thumb{background:#d1d1d1}";
|
|
2064
2886
|
styleInject(css_248z$2);
|
|
2065
2887
|
|
|
@@ -2082,18 +2904,24 @@ const Textarea = ({
|
|
|
2082
2904
|
boxSizing,
|
|
2083
2905
|
maxLength,
|
|
2084
2906
|
labelSize,
|
|
2907
|
+
errorSize,
|
|
2085
2908
|
labelColor,
|
|
2909
|
+
errorColor,
|
|
2086
2910
|
borderColor,
|
|
2087
2911
|
labelWeight,
|
|
2088
2912
|
placeholder,
|
|
2089
2913
|
labelDisplay,
|
|
2914
|
+
errorMesaage,
|
|
2090
2915
|
backgroundColor,
|
|
2091
2916
|
borderFocusColor,
|
|
2092
2917
|
borderHoverColor,
|
|
2918
|
+
showCharacterCount,
|
|
2093
2919
|
labelRequiredColor
|
|
2094
2920
|
}) => {
|
|
2921
|
+
const [error, setError] = useState('');
|
|
2095
2922
|
const [isHover, setIsHover] = useState(false);
|
|
2096
2923
|
const [isFocus, setIsFocus] = useState(false);
|
|
2924
|
+
const [innerValue, setInnerValue] = useState('');
|
|
2097
2925
|
const configStyles = compereConfigs();
|
|
2098
2926
|
const handleMouseEnter = () => {
|
|
2099
2927
|
setIsHover(true);
|
|
@@ -2107,6 +2935,25 @@ const Textarea = ({
|
|
|
2107
2935
|
const handleBlur = () => {
|
|
2108
2936
|
setIsFocus(false);
|
|
2109
2937
|
};
|
|
2938
|
+
const handleChange = e => {
|
|
2939
|
+
const value = e.target.value;
|
|
2940
|
+
onChange(value);
|
|
2941
|
+
if (maxLength) {
|
|
2942
|
+
if (value.length > maxLength) {
|
|
2943
|
+
onChange(value.substr(0, maxLength));
|
|
2944
|
+
setError('Նիշերի քանակը գերազանցում է');
|
|
2945
|
+
} else {
|
|
2946
|
+
setError('');
|
|
2947
|
+
}
|
|
2948
|
+
} else {
|
|
2949
|
+
if (value.length > configStyles.TEXTAREA.maxLength) {
|
|
2950
|
+
setError('Նիշերի քանակը գերազանցում է');
|
|
2951
|
+
onChange(value.substr(0, configStyles.TEXTAREA.maxLength));
|
|
2952
|
+
} else {
|
|
2953
|
+
setError('');
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2956
|
+
};
|
|
2110
2957
|
useEffect(() => {
|
|
2111
2958
|
if (value === undefined) {
|
|
2112
2959
|
alert('Please add value prop on Textarea component');
|
|
@@ -2114,8 +2961,26 @@ const Textarea = ({
|
|
|
2114
2961
|
if (!onChange) {
|
|
2115
2962
|
alert('Please add onChange function on Textarea component');
|
|
2116
2963
|
}
|
|
2964
|
+
setInnerValue(value);
|
|
2117
2965
|
}, [value, onChange]);
|
|
2118
|
-
|
|
2966
|
+
useEffect(() => {
|
|
2967
|
+
if (errorMesaage) {
|
|
2968
|
+
setError(errorMesaage);
|
|
2969
|
+
} else {
|
|
2970
|
+
setError('');
|
|
2971
|
+
}
|
|
2972
|
+
}, [errorMesaage]);
|
|
2973
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
2974
|
+
style: {
|
|
2975
|
+
width: width ? width : configStyles.TEXTAREA.width
|
|
2976
|
+
}
|
|
2977
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2978
|
+
style: {
|
|
2979
|
+
display: 'flex',
|
|
2980
|
+
alignItems: 'center',
|
|
2981
|
+
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2982
|
+
}
|
|
2983
|
+
}, label ? /*#__PURE__*/React__default.createElement("label", {
|
|
2119
2984
|
style: {
|
|
2120
2985
|
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
2121
2986
|
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize,
|
|
@@ -2126,12 +2991,17 @@ const Textarea = ({
|
|
|
2126
2991
|
style: {
|
|
2127
2992
|
color: labelRequiredColor ? labelRequiredColor : configStyles.TEXTAREA.labelRequiredColor
|
|
2128
2993
|
}
|
|
2129
|
-
}, "*")) : '', /*#__PURE__*/React__default.createElement("
|
|
2994
|
+
}, "*")) : '', showCharacterCount && maxLength && /*#__PURE__*/React__default.createElement("span", {
|
|
2130
2995
|
style: {
|
|
2996
|
+
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
2997
|
+
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize
|
|
2998
|
+
}
|
|
2999
|
+
}, maxLength - value.length, " \u0576\u056B\u0577")), /*#__PURE__*/React__default.createElement("textarea", {
|
|
3000
|
+
style: {
|
|
3001
|
+
width: '100%',
|
|
2131
3002
|
outline: 'none',
|
|
2132
3003
|
overflow: 'auto',
|
|
2133
3004
|
fontSize: size ? size : configStyles.TEXTAREA.size,
|
|
2134
|
-
width: width ? width : configStyles.TEXTAREA.width,
|
|
2135
3005
|
height: height ? height : configStyles.TEXTAREA.height,
|
|
2136
3006
|
border: border ? border : configStyles.TEXTAREA.border,
|
|
2137
3007
|
padding: padding ? padding : configStyles.TEXTAREA.padding,
|
|
@@ -2142,17 +3012,24 @@ const Textarea = ({
|
|
|
2142
3012
|
maxHeight: maxHeight ? maxHeight : configStyles.TEXTAREA.maxHeight,
|
|
2143
3013
|
boxSizing: boxSizing ? boxSizing : configStyles.TEXTAREA.boxSizing,
|
|
2144
3014
|
backgroundColor: backgroundColor ? backgroundColor : configStyles.TEXTAREA.backgroundColor,
|
|
2145
|
-
borderColor: isFocus ? borderFocusColor ? borderFocusColor : configStyles.TEXTAREA.borderFocusColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.TEXTAREA.borderHoverColor : borderColor ? borderColor : configStyles.TEXTAREA.borderColor,
|
|
3015
|
+
borderColor: error ? errorColor ? errorColor : configStyles.TEXTAREA.errorColor : isFocus ? borderFocusColor ? borderFocusColor : configStyles.TEXTAREA.borderFocusColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.TEXTAREA.borderHoverColor : borderColor ? borderColor : configStyles.TEXTAREA.borderColor,
|
|
2146
3016
|
resize: resize ? resize : configStyles.TEXTAREA.resize
|
|
2147
3017
|
},
|
|
3018
|
+
value: innerValue,
|
|
2148
3019
|
onBlur: handleBlur,
|
|
2149
|
-
onChange: onChange,
|
|
2150
3020
|
onFocus: handleFocus,
|
|
3021
|
+
onChange: handleChange,
|
|
2151
3022
|
placeholder: placeholder,
|
|
2152
3023
|
onMouseEnter: handleMouseEnter,
|
|
2153
|
-
onMouseLeave: handleMouseLeave
|
|
2154
|
-
|
|
2155
|
-
|
|
3024
|
+
onMouseLeave: handleMouseLeave
|
|
3025
|
+
}), error ? /*#__PURE__*/React__default.createElement("span", {
|
|
3026
|
+
style: {
|
|
3027
|
+
marginTop: '6px',
|
|
3028
|
+
display: 'inline-block',
|
|
3029
|
+
fontSize: errorSize ? errorSize : configStyles.TEXTAREA.errorSize,
|
|
3030
|
+
color: errorColor ? errorColor : configStyles.TEXTAREA.errorColor
|
|
3031
|
+
}
|
|
3032
|
+
}, error) : '');
|
|
2156
3033
|
};
|
|
2157
3034
|
Textarea.propTypes = {
|
|
2158
3035
|
size: PropTypes.string,
|
|
@@ -2177,6 +3054,7 @@ Textarea.propTypes = {
|
|
|
2177
3054
|
placeholder: PropTypes.string,
|
|
2178
3055
|
labelDisplay: PropTypes.string,
|
|
2179
3056
|
backgroundColor: PropTypes.string,
|
|
3057
|
+
showCharacterCount: PropTypes.bool,
|
|
2180
3058
|
value: PropTypes.string.isRequired,
|
|
2181
3059
|
borderFocusColor: PropTypes.string,
|
|
2182
3060
|
borderHoverColor: PropTypes.string,
|
|
@@ -2190,7 +3068,7 @@ styleInject(css_248z$1);
|
|
|
2190
3068
|
|
|
2191
3069
|
// import styles from "./pagination.module.scss";
|
|
2192
3070
|
|
|
2193
|
-
const Dots
|
|
3071
|
+
const Dots = "...";
|
|
2194
3072
|
const range = (start, end) => {
|
|
2195
3073
|
const length = end - start + 1;
|
|
2196
3074
|
return Array.from({
|
|
@@ -2220,29 +3098,29 @@ const PaginationRange = ({
|
|
|
2220
3098
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
2221
3099
|
let leftItemCount = currentPageNumber === 4 && lastPageIndex > 7 ? 4 + siblingCountNumber : 3 + siblingCountNumber;
|
|
2222
3100
|
let leftRange = range(1, leftItemCount);
|
|
2223
|
-
return [...leftRange, Dots
|
|
3101
|
+
return [...leftRange, Dots, totalPageCount];
|
|
2224
3102
|
}
|
|
2225
3103
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
2226
3104
|
let rightItemCount = 0;
|
|
2227
3105
|
currentPageNumber === lastPageIndex - 3 && lastPageIndex > 7 ? rightItemCount = 4 + siblingCountNumber : rightItemCount = 3 + siblingCountNumber;
|
|
2228
3106
|
let rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
|
|
2229
|
-
return [firstPageIndex, Dots
|
|
3107
|
+
return [firstPageIndex, Dots, ...rightRange];
|
|
2230
3108
|
}
|
|
2231
3109
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
2232
3110
|
let middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
2233
|
-
return [firstPageIndex, Dots
|
|
3111
|
+
return [firstPageIndex, Dots, ...middleRange, Dots, lastPageIndex];
|
|
2234
3112
|
}
|
|
2235
3113
|
}, [currentTotalCount, offset, siblingCountNumber, currentPageNumber]);
|
|
2236
3114
|
return paginationRange;
|
|
2237
3115
|
};
|
|
2238
3116
|
|
|
2239
|
-
const
|
|
3117
|
+
const SvgDots = ({
|
|
2240
3118
|
title,
|
|
2241
3119
|
titleId,
|
|
2242
3120
|
...props
|
|
2243
3121
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2244
|
-
width: "
|
|
2245
|
-
height: "
|
|
3122
|
+
width: "11",
|
|
3123
|
+
height: "3",
|
|
2246
3124
|
viewBox: "0 0 11 3",
|
|
2247
3125
|
fill: "none",
|
|
2248
3126
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2250,17 +3128,17 @@ const Dots = ({
|
|
|
2250
3128
|
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2251
3129
|
id: titleId
|
|
2252
3130
|
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2253
|
-
d: "
|
|
3131
|
+
d: "M.23 1.136C.23.742.326.464.518.304c.192-.16.421-.24.688-.24.277 0 .512.08.704.24.203.16.304.438.304.832 0 .384-.101.662-.304.832-.192.17-.427.256-.704.256a1 1 0 0 1-.688-.256C.326 1.798.23 1.52.23 1.136Zm4.281 0c0-.394.096-.672.288-.832.192-.16.422-.24.688-.24.278 0 .512.08.704.24.203.16.304.438.304.832 0 .384-.101.662-.304.832-.192.17-.426.256-.704.256a1 1 0 0 1-.688-.256c-.192-.17-.288-.448-.288-.832Zm4.282 0c0-.394.096-.672.288-.832.192-.16.421-.24.688-.24.277 0 .512.08.704.24.202.16.304.438.304.832 0 .384-.102.662-.304.832-.192.17-.427.256-.704.256a1 1 0 0 1-.688-.256c-.192-.17-.288-.448-.288-.832Z",
|
|
2254
3132
|
fill: "#3C393E"
|
|
2255
3133
|
}));
|
|
2256
3134
|
|
|
2257
|
-
const
|
|
3135
|
+
const SvgNextarrow = ({
|
|
2258
3136
|
title,
|
|
2259
3137
|
titleId,
|
|
2260
3138
|
...props
|
|
2261
3139
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
2262
|
-
width: "
|
|
2263
|
-
height: "
|
|
3140
|
+
width: "6",
|
|
3141
|
+
height: "12",
|
|
2264
3142
|
viewBox: "0 0 6 12",
|
|
2265
3143
|
fill: "none",
|
|
2266
3144
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2268,7 +3146,7 @@ const SvgNextArrow = ({
|
|
|
2268
3146
|
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
2269
3147
|
id: titleId
|
|
2270
3148
|
}, title) : null, /*#__PURE__*/React.createElement("path", {
|
|
2271
|
-
d: "
|
|
3149
|
+
d: "M.851 11.998a.847.847 0 0 1-.847-.776.86.86 0 0 1 .193-.626l3.808-4.584L.333 1.419A.857.857 0 0 1 .46.213a.849.849 0 0 1 1.241.128l4.106 5.132a.859.859 0 0 1 0 1.086l-4.25 5.132a.85.85 0 0 1-.706.307Z",
|
|
2272
3150
|
fill: "#3C393E"
|
|
2273
3151
|
}));
|
|
2274
3152
|
|
|
@@ -2332,8 +3210,8 @@ const Pagination = ({
|
|
|
2332
3210
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
2333
3211
|
onClick: onPrevious,
|
|
2334
3212
|
disabled: currentPage === 1 ? true : false
|
|
2335
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
2336
|
-
if (pageNumber === Dots
|
|
3213
|
+
}, /*#__PURE__*/React__default.createElement(SvgNextarrow, null)), paginationRange.map((pageNumber, id) => {
|
|
3214
|
+
if (pageNumber === Dots) {
|
|
2337
3215
|
let currentPageIndex = paginationRange.indexOf(currentPageNumber);
|
|
2338
3216
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
2339
3217
|
key: id,
|
|
@@ -2342,16 +3220,16 @@ const Pagination = ({
|
|
|
2342
3220
|
disabled: currentPageIndex === 0 ? true : false
|
|
2343
3221
|
}, id < currentPageIndex ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
2344
3222
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
2345
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
3223
|
+
}, /*#__PURE__*/React__default.createElement(SvgDots, null)), /*#__PURE__*/React__default.createElement("span", {
|
|
2346
3224
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`,
|
|
2347
3225
|
style: {
|
|
2348
3226
|
transform: 'rotate(180deg)'
|
|
2349
3227
|
}
|
|
2350
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
3228
|
+
}, /*#__PURE__*/React__default.createElement(SvgNextarrow, null))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
2351
3229
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
2352
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
3230
|
+
}, /*#__PURE__*/React__default.createElement(SvgDots, null)), /*#__PURE__*/React__default.createElement("span", {
|
|
2353
3231
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
|
|
2354
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
3232
|
+
}, /*#__PURE__*/React__default.createElement(SvgNextarrow, null))));
|
|
2355
3233
|
}
|
|
2356
3234
|
return /*#__PURE__*/React__default.createElement("li", {
|
|
2357
3235
|
onClick: () => onPageChange(pageNumber),
|
|
@@ -2362,7 +3240,7 @@ const Pagination = ({
|
|
|
2362
3240
|
onClick: onNext,
|
|
2363
3241
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
2364
3242
|
disabled: currentPageNumber === lastPage ? true : false
|
|
2365
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
3243
|
+
}, /*#__PURE__*/React__default.createElement(SvgNextarrow, null)));
|
|
2366
3244
|
};
|
|
2367
3245
|
Pagination.propTypes = {
|
|
2368
3246
|
offset: PropTypes.number,
|
|
@@ -2514,6 +3392,7 @@ Autocomplate.defaultProps = {
|
|
|
2514
3392
|
|
|
2515
3393
|
const NewAutocomplete = ({
|
|
2516
3394
|
label,
|
|
3395
|
+
change,
|
|
2517
3396
|
options,
|
|
2518
3397
|
getItem,
|
|
2519
3398
|
required,
|
|
@@ -2587,6 +3466,7 @@ const NewAutocomplete = ({
|
|
|
2587
3466
|
const [isHover, setIsHover] = useState(false);
|
|
2588
3467
|
const [isFocus, setIsFocus] = useState(false);
|
|
2589
3468
|
const [innerValue, setInnerValue] = useState('');
|
|
3469
|
+
const [innerOptions, setInnerOptions] = useState([]);
|
|
2590
3470
|
const configStyles = compereConfigs();
|
|
2591
3471
|
const showOption = keyframes`
|
|
2592
3472
|
100% {
|
|
@@ -2620,13 +3500,18 @@ const NewAutocomplete = ({
|
|
|
2620
3500
|
const value = e.target.value;
|
|
2621
3501
|
value.length > 0 ? setShow(true) : setShow(false);
|
|
2622
3502
|
setInnerValue(value);
|
|
3503
|
+
if (value.length >= searchCount) {
|
|
3504
|
+
change(value);
|
|
3505
|
+
} else {
|
|
3506
|
+
change('');
|
|
3507
|
+
}
|
|
2623
3508
|
};
|
|
2624
3509
|
const handleClick = selectedValue => {
|
|
2625
3510
|
setShow(false);
|
|
2626
3511
|
getItem(selectedValue);
|
|
2627
|
-
setInnerValue(selectedValue.
|
|
3512
|
+
setInnerValue(selectedValue.name);
|
|
2628
3513
|
};
|
|
2629
|
-
const optionList = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, show &&
|
|
3514
|
+
const optionList = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, show && innerOptions ? innerOptions.length > 0 ? /*#__PURE__*/React__default.createElement("div", {
|
|
2630
3515
|
style: {
|
|
2631
3516
|
left: contentBottomLeft ? contentBottomLeft : configStyles.NEWAUTOCOMPLETE.contentBottomLeft,
|
|
2632
3517
|
width: contentBottomWidth ? contentBottomWidth : configStyles.NEWAUTOCOMPLETE.contentBottomWidth,
|
|
@@ -2649,9 +3534,9 @@ const NewAutocomplete = ({
|
|
|
2649
3534
|
maxHeight: contentBottomInnerMaxHeight ? contentBottomInnerMaxHeight : configStyles.NEWAUTOCOMPLETE.contentBottomInnerMaxHeight,
|
|
2650
3535
|
flexDirection: contentBottomInnerDirection ? contentBottomInnerDirection : configStyles.NEWAUTOCOMPLETE.contentBottomInnerDirection
|
|
2651
3536
|
}
|
|
2652
|
-
},
|
|
3537
|
+
}, innerOptions.map(item => {
|
|
2653
3538
|
return /*#__PURE__*/React__default.createElement("p", {
|
|
2654
|
-
key:
|
|
3539
|
+
key: item.id,
|
|
2655
3540
|
onMouseEnter: handleRowMouseEnter,
|
|
2656
3541
|
onMouseLeave: handleRowMouseLeave,
|
|
2657
3542
|
onClick: () => handleClick(item),
|
|
@@ -2671,40 +3556,37 @@ const NewAutocomplete = ({
|
|
|
2671
3556
|
marginBottom: contentBottomRowMarginBottom ? contentBottomRowMarginBottom : configStyles.NEWAUTOCOMPLETE.contentBottomRowMarginBottom,
|
|
2672
3557
|
backgroundColor: contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor
|
|
2673
3558
|
}
|
|
2674
|
-
}, item.
|
|
2675
|
-
}) : /*#__PURE__*/React__default.createElement("p", {
|
|
3559
|
+
}, item.name);
|
|
3560
|
+
}))) : innerOptions.length <= 0 ? /*#__PURE__*/React__default.createElement("p", {
|
|
2676
3561
|
style: {
|
|
3562
|
+
margin: '0px',
|
|
2677
3563
|
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
2678
3564
|
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
2679
3565
|
height: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
2680
3566
|
padding: contentBottomRowPadding ? contentBottomRowPadding : configStyles.NEWAUTOCOMPLETE.contentBottomRowPadding,
|
|
2681
|
-
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight
|
|
3567
|
+
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
3568
|
+
backgroundColor: contentBottomBackgroundColor ? contentBottomBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomBackgroundColor
|
|
2682
3569
|
}
|
|
2683
|
-
},
|
|
2684
|
-
style: {
|
|
2685
|
-
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
2686
|
-
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
2687
|
-
height: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
2688
|
-
padding: contentBottomRowPadding ? contentBottomRowPadding : configStyles.NEWAUTOCOMPLETE.contentBottomRowPadding,
|
|
2689
|
-
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight
|
|
2690
|
-
}
|
|
2691
|
-
}, innerValue.length < searchCount && `Լրացնել առնվազն ${searchCount} նիշ`))));
|
|
3570
|
+
}, innerValue.length >= searchCount ? 'Նման տվյալ առկա չէ' : `Լրացնել առնվազն ${searchCount} նիշ`) : '' : '');
|
|
2692
3571
|
useEffect(() => {
|
|
2693
|
-
if (
|
|
2694
|
-
alert('Please add
|
|
2695
|
-
}
|
|
2696
|
-
if (options.length === 0) {
|
|
2697
|
-
alert('Please fill options array');
|
|
3572
|
+
if (options === undefined) {
|
|
3573
|
+
alert('Please add options prop');
|
|
2698
3574
|
}
|
|
2699
3575
|
options && options.length > 0 && options.map(item => {
|
|
2700
|
-
if (!item.hasOwnProperty('
|
|
2701
|
-
alert('Please add
|
|
3576
|
+
if (!item.hasOwnProperty('name')) {
|
|
3577
|
+
alert('Please add name property in items of options array');
|
|
2702
3578
|
}
|
|
2703
3579
|
});
|
|
2704
3580
|
if (!getItem) {
|
|
2705
3581
|
alert('Please add getItem function for get choosen item from autocomplete');
|
|
2706
3582
|
}
|
|
2707
|
-
|
|
3583
|
+
options && setInnerOptions(options);
|
|
3584
|
+
}, [options, options.length, getItem]);
|
|
3585
|
+
useEffect(() => {
|
|
3586
|
+
if (!change) {
|
|
3587
|
+
alert('Please add change prop on New Autocomplete component');
|
|
3588
|
+
}
|
|
3589
|
+
}, [change]);
|
|
2708
3590
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, label ? /*#__PURE__*/React__default.createElement("label", {
|
|
2709
3591
|
style: {
|
|
2710
3592
|
color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
|
|
@@ -2712,6 +3594,7 @@ const NewAutocomplete = ({
|
|
|
2712
3594
|
display: labelDisplay ? labelDisplay : configStyles.NEWAUTOCOMPLETE.labelDisplay,
|
|
2713
3595
|
fontWeight: labelWeight ? labelWeight : configStyles.NEWAUTOCOMPLETE.labelWeight,
|
|
2714
3596
|
lineHeight: labelLineHeight ? labelLineHeight : configStyles.NEWAUTOCOMPLETE.labelLineHeight,
|
|
3597
|
+
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth,
|
|
2715
3598
|
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.NEWAUTOCOMPLETE.labelMarginBottom,
|
|
2716
3599
|
textTransform: labelTextTransform ? labelTextTransform : configStyles.NEWAUTOCOMPLETE.labelTextTransform
|
|
2717
3600
|
}
|
|
@@ -2723,7 +3606,8 @@ const NewAutocomplete = ({
|
|
|
2723
3606
|
style: {
|
|
2724
3607
|
display: contentDisplay ? contentDisplay : configStyles.NEWAUTOCOMPLETE.contentDisplay,
|
|
2725
3608
|
position: contentPosition ? contentPosition : configStyles.NEWAUTOCOMPLETE.contentPosition,
|
|
2726
|
-
flexDirection: contentDirection ? contentDirection : configStyles.NEWAUTOCOMPLETE.contentDirection
|
|
3609
|
+
flexDirection: contentDirection ? contentDirection : configStyles.NEWAUTOCOMPLETE.contentDirection,
|
|
3610
|
+
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth
|
|
2727
3611
|
}
|
|
2728
3612
|
}, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
2729
3613
|
type: "text",
|
|
@@ -2732,11 +3616,12 @@ const NewAutocomplete = ({
|
|
|
2732
3616
|
onBlur: handleBlur,
|
|
2733
3617
|
onFocus: handleFocus,
|
|
2734
3618
|
onInput: handleChange,
|
|
2735
|
-
placeholder: placeHolder ? placeHolder : '',
|
|
2736
|
-
autoComplete: autoComplete ? autoComplete : configStyles.NEWAUTOCOMPLETE.autoComplete,
|
|
2737
3619
|
onMouseEnter: handleMouseEnter,
|
|
2738
3620
|
onMouseLeave: handleMouseLeave,
|
|
3621
|
+
placeholder: placeHolder ? placeHolder : '',
|
|
3622
|
+
autoComplete: autoComplete ? autoComplete : configStyles.NEWAUTOCOMPLETE.autoComplete,
|
|
2739
3623
|
style: {
|
|
3624
|
+
maxWidth: '100%',
|
|
2740
3625
|
transition: 'all 240ms',
|
|
2741
3626
|
cursor: disabled ? 'not-allowed' : 'auto',
|
|
2742
3627
|
color: contentTopColor ? contentTopColor : configStyles.NEWAUTOCOMPLETE.contentTopColor,
|
|
@@ -2747,7 +3632,6 @@ const NewAutocomplete = ({
|
|
|
2747
3632
|
display: contentTopDisplay ? contentTopDisplay : configStyles.NEWAUTOCOMPLETE.contentTopDisplay,
|
|
2748
3633
|
fontWeight: contentTopWeight ? contentTopWeight : configStyles.NEWAUTOCOMPLETE.contentTopWeight,
|
|
2749
3634
|
borderRadius: contentTopRadius ? contentTopRadius : configStyles.NEWAUTOCOMPLETE.contentTopRadius,
|
|
2750
|
-
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth,
|
|
2751
3635
|
boxSizing: contentTopBoxSizing ? contentTopBoxSizing : configStyles.NEWAUTOCOMPLETE.contentTopBoxSizing,
|
|
2752
3636
|
lineHeight: contentTopLineHeight ? contentTopLineHeight : configStyles.NEWAUTOCOMPLETE.contentTopLineHeight,
|
|
2753
3637
|
flexDirection: contentTopDirection ? contentTopDirection : configStyles.NEWAUTOCOMPLETE.contentTopDirection,
|
|
@@ -2755,8 +3639,11 @@ const NewAutocomplete = ({
|
|
|
2755
3639
|
}
|
|
2756
3640
|
}, props)), errorMessage ? /*#__PURE__*/React__default.createElement("span", {
|
|
2757
3641
|
style: {
|
|
3642
|
+
margin: '0px',
|
|
3643
|
+
display: 'inline-block',
|
|
2758
3644
|
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
2759
|
-
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize
|
|
3645
|
+
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
3646
|
+
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth
|
|
2760
3647
|
}
|
|
2761
3648
|
}, errorMessage) : '', optionList));
|
|
2762
3649
|
};
|
|
@@ -2779,6 +3666,7 @@ NewAutocomplete.propTypes = {
|
|
|
2779
3666
|
contentPosition: PropTypes.string,
|
|
2780
3667
|
labelLineHeight: PropTypes.string,
|
|
2781
3668
|
contentTopColor: PropTypes.string,
|
|
3669
|
+
change: PropTypes.func.isRequired,
|
|
2782
3670
|
contentDirection: PropTypes.string,
|
|
2783
3671
|
contentTopWeight: PropTypes.number,
|
|
2784
3672
|
contentTopRadius: PropTypes.string,
|
|
@@ -2835,4 +3723,4 @@ NewAutocomplete.defaultProps = {
|
|
|
2835
3723
|
disabled: false
|
|
2836
3724
|
};
|
|
2837
3725
|
|
|
2838
|
-
export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, NewAutocomplete, Pagination, Radio, Select, SingleCheckbox, Stepper, Table, Textarea, Toaster, Tooltip, Typography, TypographyType, toast };
|
|
3726
|
+
export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, NewAutocomplete, NewFile, Pagination, Radio, Select, SingleCheckbox, Stepper, Table, Textarea, Toaster, Tooltip, Typography, TypographyType, toast };
|