@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.js
CHANGED
|
@@ -167,8 +167,7 @@ const File = ({
|
|
|
167
167
|
}, "*")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
168
168
|
className: classnames__default["default"](`${styles$c['file-form-wrap']} file-form-wrap-rem`, image ? styles$c['active'] : '')
|
|
169
169
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
170
|
-
|
|
171
|
-
className: `${styles$c['file-form']} file-form-rem ${errorMessage ? styles$c['error'] : ''}`,
|
|
170
|
+
className: `${styles$c['file-form']} file-form-rem ${error || errorMessage ? styles$c['error'] : ''}`,
|
|
172
171
|
onClick: () => document.querySelector(`.${name}`).click()
|
|
173
172
|
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
174
173
|
hidden: true,
|
|
@@ -197,11 +196,11 @@ const File = ({
|
|
|
197
196
|
onClick: handleRemoveFile
|
|
198
197
|
}, /*#__PURE__*/React__default["default"].createElement("i", {
|
|
199
198
|
className: "icon-delete"
|
|
200
|
-
})),
|
|
199
|
+
})), error || errorMessage ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
201
200
|
style: {
|
|
202
201
|
color: 'red'
|
|
203
202
|
}
|
|
204
|
-
},
|
|
203
|
+
}, error || errorMessage) : null));
|
|
205
204
|
};
|
|
206
205
|
File.propTypes = {
|
|
207
206
|
label: PropTypes__default["default"].string,
|
|
@@ -605,6 +604,9 @@ const InputTypes = {
|
|
|
605
604
|
TEXT: "text",
|
|
606
605
|
PASSWORD: "password"
|
|
607
606
|
};
|
|
607
|
+
const P = styled__default["default"].p`
|
|
608
|
+
animation: ${props => props.errorAnimation ? props.animation : 'none'};
|
|
609
|
+
`;
|
|
608
610
|
const Input = ({
|
|
609
611
|
type,
|
|
610
612
|
size,
|
|
@@ -616,12 +618,12 @@ const Input = ({
|
|
|
616
618
|
regexp,
|
|
617
619
|
height,
|
|
618
620
|
radius,
|
|
621
|
+
change,
|
|
619
622
|
padding,
|
|
620
623
|
tooltip,
|
|
621
624
|
leftIcon,
|
|
622
625
|
required,
|
|
623
626
|
disabled,
|
|
624
|
-
onChange,
|
|
625
627
|
transform,
|
|
626
628
|
iconWidth,
|
|
627
629
|
rightIcon,
|
|
@@ -657,7 +659,7 @@ const Input = ({
|
|
|
657
659
|
errorAnimationDuration,
|
|
658
660
|
...props
|
|
659
661
|
}) => {
|
|
660
|
-
const phoneNumberRegex = /^\d
|
|
662
|
+
const phoneNumberRegex = /^\d+$/;
|
|
661
663
|
const [show, setShow] = React.useState(false);
|
|
662
664
|
const [isHover, setIsHover] = React.useState(false);
|
|
663
665
|
const [innerValue, setInnerValue] = React.useState('');
|
|
@@ -678,35 +680,41 @@ const Input = ({
|
|
|
678
680
|
const animation = _ => styled.css`
|
|
679
681
|
${errorShow} ${errorAnimationDuration ? errorAnimationDuration : configStyles.INPUT.errorAnimationDuration} forwards
|
|
680
682
|
`;
|
|
681
|
-
const P = styled__default["default"].p`
|
|
682
|
-
animation: ${errorAnimation ? animation : 'none'};
|
|
683
|
-
`;
|
|
684
683
|
const handleChange = event => {
|
|
685
684
|
const currentValue = event.target.value;
|
|
686
685
|
setInnerValue(currentValue);
|
|
686
|
+
if (change) {
|
|
687
|
+
change(currentValue);
|
|
688
|
+
}
|
|
687
689
|
if (type === 'tel') {
|
|
688
|
-
if (currentValue
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (!phoneNumberRegex.test(currentValue) && telErrorMessage) {
|
|
692
|
-
setInnerErrorMessage(telErrorMessage);
|
|
690
|
+
if (!phoneNumberRegex.test(currentValue)) {
|
|
691
|
+
telErrorMessage && setInnerErrorMessage(telErrorMessage);
|
|
692
|
+
setInnerValue('');
|
|
693
693
|
} else {
|
|
694
694
|
setInnerErrorMessage('');
|
|
695
|
+
if (currentValue.length > 8) {
|
|
696
|
+
setInnerValue(currentValue.substr(0, 8));
|
|
697
|
+
if (change) {
|
|
698
|
+
change(currentValue.substr(0, 8));
|
|
699
|
+
}
|
|
700
|
+
} else {
|
|
701
|
+
setInnerValue(currentValue);
|
|
702
|
+
if (change) {
|
|
703
|
+
change(currentValue);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
695
706
|
}
|
|
696
707
|
}
|
|
697
708
|
if (maxLength && currentValue.length > maxLength && type !== 'tel') {
|
|
698
709
|
setInnerValue(currentValue.substr(0, maxLength));
|
|
710
|
+
if (change) {
|
|
711
|
+
change(currentValue.substr(0, maxLength));
|
|
712
|
+
}
|
|
699
713
|
}
|
|
700
714
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
701
715
|
!regexp.test(currentValue) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
onChange(currentValue);
|
|
705
|
-
if (type === 'tel' && currentValue.length > 8) {
|
|
706
|
-
onChange(currentValue.substr(0, 8));
|
|
707
|
-
}
|
|
708
|
-
if (maxLength && currentValue.length > maxLength && type !== 'tel') {
|
|
709
|
-
onChange(currentValue.substr(0, maxLength));
|
|
716
|
+
if (change) {
|
|
717
|
+
change(currentValue);
|
|
710
718
|
}
|
|
711
719
|
}
|
|
712
720
|
};
|
|
@@ -717,16 +725,24 @@ const Input = ({
|
|
|
717
725
|
setIsHover(false);
|
|
718
726
|
};
|
|
719
727
|
React.useEffect(() => {
|
|
728
|
+
if (errorMessage) {
|
|
729
|
+
setInnerErrorMessage(errorMessage);
|
|
730
|
+
} else {
|
|
731
|
+
setInnerErrorMessage('');
|
|
732
|
+
}
|
|
720
733
|
if (value !== undefined && value !== null) {
|
|
721
734
|
setInnerValue(value);
|
|
722
735
|
if (type === 'tel') {
|
|
723
|
-
if (value
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
if (!phoneNumberRegex.test(value) && telErrorMessage) {
|
|
727
|
-
setInnerErrorMessage(telErrorMessage);
|
|
736
|
+
if (!phoneNumberRegex.test(value)) {
|
|
737
|
+
telErrorMessage && setInnerErrorMessage(telErrorMessage);
|
|
738
|
+
setInnerValue('');
|
|
728
739
|
} else {
|
|
729
740
|
setInnerErrorMessage('');
|
|
741
|
+
if (value.length > 8) {
|
|
742
|
+
setInnerValue(value.substr(0, 8));
|
|
743
|
+
} else {
|
|
744
|
+
setInnerValue(value);
|
|
745
|
+
}
|
|
730
746
|
}
|
|
731
747
|
}
|
|
732
748
|
if (maxLength && value.length > maxLength && type !== 'tel') {
|
|
@@ -736,11 +752,6 @@ const Input = ({
|
|
|
736
752
|
!regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
|
|
737
753
|
}
|
|
738
754
|
}
|
|
739
|
-
if (errorMessage) {
|
|
740
|
-
setInnerErrorMessage(errorMessage);
|
|
741
|
-
} else {
|
|
742
|
-
setInnerErrorMessage('');
|
|
743
|
-
}
|
|
744
755
|
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage]);
|
|
745
756
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
746
757
|
className: `${styles$8["input-wrap"]}`
|
|
@@ -833,7 +844,10 @@ const Input = ({
|
|
|
833
844
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
834
845
|
}
|
|
835
846
|
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', innerErrorMessage ? /*#__PURE__*/React__default["default"].createElement(P, {
|
|
847
|
+
errorAnimation: errorAnimation,
|
|
848
|
+
animation: animation,
|
|
836
849
|
style: {
|
|
850
|
+
margin: '0px',
|
|
837
851
|
left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
|
|
838
852
|
color: errorColor ? errorColor : configStyles.INPUT.errorColor,
|
|
839
853
|
fontSize: errorSize ? errorSize : configStyles.INPUT.errorSize,
|
|
@@ -848,11 +862,11 @@ const Input = ({
|
|
|
848
862
|
};
|
|
849
863
|
Input.propTypes = {
|
|
850
864
|
name: PropTypes__default["default"].string,
|
|
865
|
+
change: PropTypes__default["default"].func,
|
|
851
866
|
color: PropTypes__default["default"].string,
|
|
852
867
|
value: PropTypes__default["default"].string,
|
|
853
868
|
width: PropTypes__default["default"].string,
|
|
854
869
|
label: PropTypes__default["default"].string,
|
|
855
|
-
onChange: PropTypes__default["default"].func,
|
|
856
870
|
required: PropTypes__default["default"].bool,
|
|
857
871
|
disabled: PropTypes__default["default"].bool,
|
|
858
872
|
height: PropTypes__default["default"].string,
|
|
@@ -1054,8 +1068,8 @@ const SvgCheckboxUnchecked = ({
|
|
|
1054
1068
|
titleId,
|
|
1055
1069
|
...props
|
|
1056
1070
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1057
|
-
width: "
|
|
1058
|
-
height: "
|
|
1071
|
+
width: "16",
|
|
1072
|
+
height: "16",
|
|
1059
1073
|
viewBox: "0 0 16 16",
|
|
1060
1074
|
fill: "none",
|
|
1061
1075
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1074,8 +1088,8 @@ const SvgCheckboxChecked = ({
|
|
|
1074
1088
|
titleId,
|
|
1075
1089
|
...props
|
|
1076
1090
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1077
|
-
width: "
|
|
1078
|
-
height: "
|
|
1091
|
+
width: "16",
|
|
1092
|
+
height: "16",
|
|
1079
1093
|
viewBox: "0 0 16 16",
|
|
1080
1094
|
fill: "none",
|
|
1081
1095
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1107,8 +1121,8 @@ const SvgArrow = ({
|
|
|
1107
1121
|
titleId,
|
|
1108
1122
|
...props
|
|
1109
1123
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1110
|
-
width: "
|
|
1111
|
-
height: "
|
|
1124
|
+
width: "15",
|
|
1125
|
+
height: "9",
|
|
1112
1126
|
viewBox: "0 0 15 9",
|
|
1113
1127
|
fill: "none",
|
|
1114
1128
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1125,8 +1139,8 @@ const SvgCloseIcon = ({
|
|
|
1125
1139
|
titleId,
|
|
1126
1140
|
...props
|
|
1127
1141
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1128
|
-
width: "
|
|
1129
|
-
height: "
|
|
1142
|
+
width: "14",
|
|
1143
|
+
height: "14",
|
|
1130
1144
|
viewBox: "0 0 14 14",
|
|
1131
1145
|
fill: "none",
|
|
1132
1146
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1459,8 +1473,8 @@ const SvgToasterInfo = ({
|
|
|
1459
1473
|
titleId,
|
|
1460
1474
|
...props
|
|
1461
1475
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1462
|
-
width: "
|
|
1463
|
-
height: "
|
|
1476
|
+
width: "24",
|
|
1477
|
+
height: "24",
|
|
1464
1478
|
viewBox: "0 0 24 24",
|
|
1465
1479
|
fill: "none",
|
|
1466
1480
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1477,8 +1491,8 @@ const SvgToasterError = ({
|
|
|
1477
1491
|
titleId,
|
|
1478
1492
|
...props
|
|
1479
1493
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1480
|
-
width: "
|
|
1481
|
-
height: "
|
|
1494
|
+
width: "24",
|
|
1495
|
+
height: "24",
|
|
1482
1496
|
viewBox: "0 0 24 24",
|
|
1483
1497
|
fill: "none",
|
|
1484
1498
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1495,8 +1509,8 @@ const SvgToasterClose = ({
|
|
|
1495
1509
|
titleId,
|
|
1496
1510
|
...props
|
|
1497
1511
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1498
|
-
width: "
|
|
1499
|
-
height: "
|
|
1512
|
+
width: "18",
|
|
1513
|
+
height: "18",
|
|
1500
1514
|
viewBox: "0 0 18 18",
|
|
1501
1515
|
fill: "none",
|
|
1502
1516
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1513,8 +1527,8 @@ const SvgToasterWarning = ({
|
|
|
1513
1527
|
titleId,
|
|
1514
1528
|
...props
|
|
1515
1529
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1516
|
-
width: "
|
|
1517
|
-
height: "
|
|
1530
|
+
width: "24",
|
|
1531
|
+
height: "24",
|
|
1518
1532
|
viewBox: "0 0 24 21",
|
|
1519
1533
|
fill: "none",
|
|
1520
1534
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1531,8 +1545,8 @@ const SvgToasterSuccess = ({
|
|
|
1531
1545
|
titleId,
|
|
1532
1546
|
...props
|
|
1533
1547
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1534
|
-
width: "
|
|
1535
|
-
height: "
|
|
1548
|
+
width: "24",
|
|
1549
|
+
height: "24",
|
|
1536
1550
|
viewBox: "0 0 24 24",
|
|
1537
1551
|
fill: "none",
|
|
1538
1552
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1631,12 +1645,12 @@ const Toast = ({
|
|
|
1631
1645
|
}
|
|
1632
1646
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
1633
1647
|
style: {
|
|
1648
|
+
margin: '0px',
|
|
1634
1649
|
fontWeight: 600,
|
|
1635
1650
|
color: '#3C393E',
|
|
1636
1651
|
fontSize: '16px',
|
|
1637
1652
|
lineHeight: '22px',
|
|
1638
|
-
fontStyle: 'normal'
|
|
1639
|
-
fontFamily: ''
|
|
1653
|
+
fontStyle: 'normal'
|
|
1640
1654
|
}
|
|
1641
1655
|
}, title ? title.length > 25 ? title.substr(0, 25) + '...' : title : ''), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1642
1656
|
style: {
|
|
@@ -1800,7 +1814,23 @@ const Toaster = () => {
|
|
|
1800
1814
|
});
|
|
1801
1815
|
};
|
|
1802
1816
|
|
|
1803
|
-
|
|
1817
|
+
const SvgTooltip = ({
|
|
1818
|
+
title,
|
|
1819
|
+
titleId,
|
|
1820
|
+
...props
|
|
1821
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1822
|
+
width: "16",
|
|
1823
|
+
height: "16",
|
|
1824
|
+
viewBox: "0 0 16 16",
|
|
1825
|
+
fill: "none",
|
|
1826
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1827
|
+
"aria-labelledby": titleId
|
|
1828
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
1829
|
+
id: titleId
|
|
1830
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
1831
|
+
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",
|
|
1832
|
+
fill: "#D1D1D1"
|
|
1833
|
+
}));
|
|
1804
1834
|
|
|
1805
1835
|
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}";
|
|
1806
1836
|
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"};
|
|
@@ -1876,9 +1906,7 @@ const Tooltip = ({
|
|
|
1876
1906
|
cursor: 'pointer'
|
|
1877
1907
|
},
|
|
1878
1908
|
onClick: handleShow
|
|
1879
|
-
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/React__default["default"].createElement(
|
|
1880
|
-
src: ReactInfoIcon
|
|
1881
|
-
})));
|
|
1909
|
+
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/React__default["default"].createElement(SvgTooltip, null)));
|
|
1882
1910
|
};
|
|
1883
1911
|
Tooltip.propTypes = {
|
|
1884
1912
|
type: PropTypes__default["default"].string,
|
|
@@ -1936,7 +1964,7 @@ const SvgCaptchaArrowDown = ({
|
|
|
1936
1964
|
fill: "#00236A"
|
|
1937
1965
|
}));
|
|
1938
1966
|
|
|
1939
|
-
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/
|
|
1967
|
+
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}";
|
|
1940
1968
|
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"};
|
|
1941
1969
|
styleInject(css_248z$4);
|
|
1942
1970
|
|
|
@@ -1962,12 +1990,13 @@ const Captcha = ({
|
|
|
1962
1990
|
if (!getRange) {
|
|
1963
1991
|
alert('Please add getRange property on Captcha component');
|
|
1964
1992
|
}
|
|
1965
|
-
if (range
|
|
1993
|
+
if (range >= 100) {
|
|
1966
1994
|
setRangeNumber(100);
|
|
1967
|
-
} else if (range
|
|
1995
|
+
} else if (range <= 0) {
|
|
1968
1996
|
setRangeNumber(0);
|
|
1969
1997
|
} else {
|
|
1970
|
-
|
|
1998
|
+
const roundedRange = Math.ceil(range / 5) * 5;
|
|
1999
|
+
setRangeNumber(Math.min(roundedRange, 100));
|
|
1971
2000
|
}
|
|
1972
2001
|
}, [range, getRange]);
|
|
1973
2002
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
@@ -2015,6 +2044,7 @@ const Captcha = ({
|
|
|
2015
2044
|
}
|
|
2016
2045
|
}), /*#__PURE__*/React__default["default"].createElement("input", {
|
|
2017
2046
|
min: 0,
|
|
2047
|
+
step: 5,
|
|
2018
2048
|
max: 100,
|
|
2019
2049
|
type: "range",
|
|
2020
2050
|
value: rangeProgress,
|
|
@@ -2027,7 +2057,7 @@ const Captcha = ({
|
|
|
2027
2057
|
},
|
|
2028
2058
|
className: `
|
|
2029
2059
|
${styles$3['range']}
|
|
2030
|
-
${rangeProgress
|
|
2060
|
+
${+rangeProgress === rangeNumber ? styles$3['range-success'] : +rangeProgress !== rangeNumber && +rangeProgress > 0 ? styles$3['range-error'] : styles$3['range-default']}
|
|
2031
2061
|
`,
|
|
2032
2062
|
onInput: handleRange
|
|
2033
2063
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2038,7 +2068,7 @@ const Captcha = ({
|
|
|
2038
2068
|
width: rangeProgress + '%',
|
|
2039
2069
|
height: '4px',
|
|
2040
2070
|
borderRadius: '2px',
|
|
2041
|
-
backgroundColor: rangeProgress
|
|
2071
|
+
backgroundColor: +rangeProgress === rangeNumber ? '#0DA574' : +rangeProgress !== rangeNumber && +rangeProgress > 0 ? '#EE0000' : 'transparent',
|
|
2042
2072
|
borderRadius: '2px',
|
|
2043
2073
|
zIndex: -1
|
|
2044
2074
|
}
|
|
@@ -2047,7 +2077,8 @@ const Captcha = ({
|
|
|
2047
2077
|
position: 'absolute',
|
|
2048
2078
|
bottom: '0px',
|
|
2049
2079
|
height: '15px',
|
|
2050
|
-
left: `calc(${rangeNumber}% - 6px)
|
|
2080
|
+
left: `calc(${rangeNumber}% - 6px)`,
|
|
2081
|
+
transform: 'translate(-50% -50%)'
|
|
2051
2082
|
}
|
|
2052
2083
|
}, /*#__PURE__*/React__default["default"].createElement(SvgCaptchaArrowUp, null))));
|
|
2053
2084
|
};
|
|
@@ -2090,6 +2121,797 @@ Stepper.propTypes = {
|
|
|
2090
2121
|
activeSteps: PropTypes__default["default"].number
|
|
2091
2122
|
};
|
|
2092
2123
|
|
|
2124
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
2125
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
2126
|
+
// generators (like Math.random()).
|
|
2127
|
+
var getRandomValues;
|
|
2128
|
+
var rnds8 = new Uint8Array(16);
|
|
2129
|
+
function rng() {
|
|
2130
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
2131
|
+
if (!getRandomValues) {
|
|
2132
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
2133
|
+
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
2134
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
2135
|
+
|
|
2136
|
+
if (!getRandomValues) {
|
|
2137
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
return getRandomValues(rnds8);
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
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;
|
|
2145
|
+
|
|
2146
|
+
function validate(uuid) {
|
|
2147
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
/**
|
|
2151
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
2152
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
2153
|
+
*/
|
|
2154
|
+
|
|
2155
|
+
var byteToHex = [];
|
|
2156
|
+
|
|
2157
|
+
for (var i = 0; i < 256; ++i) {
|
|
2158
|
+
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
function stringify(arr) {
|
|
2162
|
+
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2163
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
2164
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
2165
|
+
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
|
|
2166
|
+
// of the following:
|
|
2167
|
+
// - One or more input array values don't map to a hex octet (leading to
|
|
2168
|
+
// "undefined" in the uuid)
|
|
2169
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
|
2170
|
+
|
|
2171
|
+
if (!validate(uuid)) {
|
|
2172
|
+
throw TypeError('Stringified UUID is invalid');
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
return uuid;
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
function v4(options, buf, offset) {
|
|
2179
|
+
options = options || {};
|
|
2180
|
+
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
2181
|
+
|
|
2182
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
2183
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
2184
|
+
|
|
2185
|
+
if (buf) {
|
|
2186
|
+
offset = offset || 0;
|
|
2187
|
+
|
|
2188
|
+
for (var i = 0; i < 16; ++i) {
|
|
2189
|
+
buf[offset + i] = rnds[i];
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
return buf;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
return stringify(rnds);
|
|
2196
|
+
}
|
|
2197
|
+
|
|
2198
|
+
const SvgListItemPdf = ({
|
|
2199
|
+
title,
|
|
2200
|
+
titleId,
|
|
2201
|
+
...props
|
|
2202
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2203
|
+
width: "32",
|
|
2204
|
+
height: "42",
|
|
2205
|
+
viewBox: "0 0 32 42",
|
|
2206
|
+
fill: "none",
|
|
2207
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2208
|
+
"aria-labelledby": titleId
|
|
2209
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2210
|
+
id: titleId
|
|
2211
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2212
|
+
fillRule: "evenodd",
|
|
2213
|
+
clipRule: "evenodd",
|
|
2214
|
+
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",
|
|
2215
|
+
fill: "#051942"
|
|
2216
|
+
}));
|
|
2217
|
+
|
|
2218
|
+
const SvgListItemJpg = ({
|
|
2219
|
+
title,
|
|
2220
|
+
titleId,
|
|
2221
|
+
...props
|
|
2222
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2223
|
+
width: "32",
|
|
2224
|
+
height: "42",
|
|
2225
|
+
viewBox: "0 0 32 42",
|
|
2226
|
+
fill: "none",
|
|
2227
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2228
|
+
"aria-labelledby": titleId
|
|
2229
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2230
|
+
id: titleId
|
|
2231
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2232
|
+
fillRule: "evenodd",
|
|
2233
|
+
clipRule: "evenodd",
|
|
2234
|
+
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",
|
|
2235
|
+
fill: "#051942"
|
|
2236
|
+
}));
|
|
2237
|
+
|
|
2238
|
+
const SvgListItemPng = ({
|
|
2239
|
+
title,
|
|
2240
|
+
titleId,
|
|
2241
|
+
...props
|
|
2242
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2243
|
+
width: "32",
|
|
2244
|
+
height: "42",
|
|
2245
|
+
viewBox: "0 0 32 42",
|
|
2246
|
+
fill: "none",
|
|
2247
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2248
|
+
"aria-labelledby": titleId
|
|
2249
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2250
|
+
id: titleId
|
|
2251
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2252
|
+
fillRule: "evenodd",
|
|
2253
|
+
clipRule: "evenodd",
|
|
2254
|
+
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",
|
|
2255
|
+
fill: "#051942"
|
|
2256
|
+
}));
|
|
2257
|
+
|
|
2258
|
+
const SvgListItemJpeg = ({
|
|
2259
|
+
title,
|
|
2260
|
+
titleId,
|
|
2261
|
+
...props
|
|
2262
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2263
|
+
width: "33",
|
|
2264
|
+
height: "42",
|
|
2265
|
+
viewBox: "0 0 33 42",
|
|
2266
|
+
fill: "none",
|
|
2267
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2268
|
+
"aria-labelledby": titleId
|
|
2269
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2270
|
+
id: titleId
|
|
2271
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2272
|
+
fillRule: "evenodd",
|
|
2273
|
+
clipRule: "evenodd",
|
|
2274
|
+
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",
|
|
2275
|
+
fill: "#051942"
|
|
2276
|
+
}));
|
|
2277
|
+
|
|
2278
|
+
const SvgListItemDelete = ({
|
|
2279
|
+
title,
|
|
2280
|
+
titleId,
|
|
2281
|
+
...props
|
|
2282
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2283
|
+
width: "22",
|
|
2284
|
+
height: "22",
|
|
2285
|
+
viewBox: "0 0 22 22",
|
|
2286
|
+
fill: "none",
|
|
2287
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2288
|
+
"aria-labelledby": titleId
|
|
2289
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2290
|
+
id: titleId
|
|
2291
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2292
|
+
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",
|
|
2293
|
+
fill: "#051942"
|
|
2294
|
+
}));
|
|
2295
|
+
|
|
2296
|
+
const FileItem = /*#__PURE__*/React__default["default"].memo(({
|
|
2297
|
+
size,
|
|
2298
|
+
name,
|
|
2299
|
+
uuid,
|
|
2300
|
+
check,
|
|
2301
|
+
radius,
|
|
2302
|
+
status,
|
|
2303
|
+
removeFile,
|
|
2304
|
+
fileFormat,
|
|
2305
|
+
progressColor,
|
|
2306
|
+
listItemHeight,
|
|
2307
|
+
listItemPadding,
|
|
2308
|
+
progressFontSize,
|
|
2309
|
+
listItemErrorSize,
|
|
2310
|
+
listItemErrorColor,
|
|
2311
|
+
progressTrackColor,
|
|
2312
|
+
progressFailedColor,
|
|
2313
|
+
progressSuccessColor,
|
|
2314
|
+
progressLoadingColor,
|
|
2315
|
+
listItemBackgroundColor,
|
|
2316
|
+
listItemBackgroundErrorColor
|
|
2317
|
+
}) => {
|
|
2318
|
+
const [i, setI] = React.useState(_ => _);
|
|
2319
|
+
const [t, setT] = React.useState(_ => _);
|
|
2320
|
+
const [progress, setProgress] = React.useState(7);
|
|
2321
|
+
const handleRemoveItem = id => {
|
|
2322
|
+
removeFile(id);
|
|
2323
|
+
};
|
|
2324
|
+
React.useEffect(() => {
|
|
2325
|
+
let time = Math.floor(Math.random() * (1100 - 900 + 1)) + 900;
|
|
2326
|
+
let fileSizeInMB = Math.round(size / (1024 * 1024));
|
|
2327
|
+
if (fileSizeInMB > 5) {
|
|
2328
|
+
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];
|
|
2329
|
+
const index = Math.min(Math.floor((size - 1) / 15), times.length - 1);
|
|
2330
|
+
time = times[index];
|
|
2331
|
+
}
|
|
2332
|
+
setI(setInterval(() => {
|
|
2333
|
+
setProgress(prev => {
|
|
2334
|
+
return prev += 7;
|
|
2335
|
+
});
|
|
2336
|
+
}, time));
|
|
2337
|
+
return () => {
|
|
2338
|
+
setI(_ => _);
|
|
2339
|
+
clearTimeout(t);
|
|
2340
|
+
clearInterval(i);
|
|
2341
|
+
};
|
|
2342
|
+
}, []);
|
|
2343
|
+
React.useEffect(() => {
|
|
2344
|
+
if (progress > 84) {
|
|
2345
|
+
clearInterval(i);
|
|
2346
|
+
}
|
|
2347
|
+
}, [progress]);
|
|
2348
|
+
React.useEffect(() => {
|
|
2349
|
+
if (status === 'success') {
|
|
2350
|
+
setProgress(100);
|
|
2351
|
+
clearInterval(i);
|
|
2352
|
+
}
|
|
2353
|
+
if (status === 'failed') {
|
|
2354
|
+
setProgress(0);
|
|
2355
|
+
clearInterval(i);
|
|
2356
|
+
}
|
|
2357
|
+
}, [status]);
|
|
2358
|
+
React.useEffect(() => {
|
|
2359
|
+
if (check !== '') {
|
|
2360
|
+
setT(setTimeout(() => {
|
|
2361
|
+
removeFile(uuid);
|
|
2362
|
+
}, 3500));
|
|
2363
|
+
}
|
|
2364
|
+
}, [check]);
|
|
2365
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2366
|
+
style: {
|
|
2367
|
+
width: '100%',
|
|
2368
|
+
display: 'flex',
|
|
2369
|
+
marginTop: '6px',
|
|
2370
|
+
alignItems: 'center',
|
|
2371
|
+
borderRadius: radius,
|
|
2372
|
+
height: listItemHeight,
|
|
2373
|
+
boxSizing: 'border-box',
|
|
2374
|
+
padding: listItemPadding,
|
|
2375
|
+
flexDirection: check !== '' ? 'column' : 'row',
|
|
2376
|
+
justifyContent: check !== '' ? 'space-around' : 'space-between',
|
|
2377
|
+
backgroundColor: check !== '' ? listItemBackgroundErrorColor : listItemBackgroundColor
|
|
2378
|
+
}
|
|
2379
|
+
}, check !== '' ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2380
|
+
style: {
|
|
2381
|
+
margin: '0px',
|
|
2382
|
+
color: listItemErrorColor,
|
|
2383
|
+
fontSize: listItemErrorSize
|
|
2384
|
+
}
|
|
2385
|
+
}, name), /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2386
|
+
style: {
|
|
2387
|
+
margin: '0px',
|
|
2388
|
+
color: listItemErrorColor,
|
|
2389
|
+
fontSize: listItemErrorSize
|
|
2390
|
+
}
|
|
2391
|
+
}, check)) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2392
|
+
style: {
|
|
2393
|
+
width: '32px'
|
|
2394
|
+
}
|
|
2395
|
+
}, fileFormat === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgListItemPdf, null) : fileFormat === 'jpg' ? /*#__PURE__*/React__default["default"].createElement(SvgListItemJpg, null) : fileFormat === 'png' ? /*#__PURE__*/React__default["default"].createElement(SvgListItemPng, null) : fileFormat === 'jpeg' ? /*#__PURE__*/React__default["default"].createElement(SvgListItemJpeg, null) : ''), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2396
|
+
style: {
|
|
2397
|
+
position: 'relative',
|
|
2398
|
+
display: 'flex',
|
|
2399
|
+
height: '40px',
|
|
2400
|
+
margin: '0px 14px',
|
|
2401
|
+
alignItems: 'flex-end',
|
|
2402
|
+
width: 'calc(100% - 82px)'
|
|
2403
|
+
}
|
|
2404
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2405
|
+
style: {
|
|
2406
|
+
width: '100%',
|
|
2407
|
+
height: '100%',
|
|
2408
|
+
display: 'flex',
|
|
2409
|
+
paddingTop: '5px',
|
|
2410
|
+
color: progressColor,
|
|
2411
|
+
boxSizing: 'border-box',
|
|
2412
|
+
alignItems: 'flex-start',
|
|
2413
|
+
fontSize: progressFontSize,
|
|
2414
|
+
justifyContent: 'space-between'
|
|
2415
|
+
}
|
|
2416
|
+
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2417
|
+
style: {
|
|
2418
|
+
margin: '0px',
|
|
2419
|
+
overflow: 'hidden',
|
|
2420
|
+
whiteSpace: 'nowrap',
|
|
2421
|
+
textOverflow: 'ellipsis',
|
|
2422
|
+
maxWidth: 'calc(100% - 56px)'
|
|
2423
|
+
}
|
|
2424
|
+
}, name), /*#__PURE__*/React__default["default"].createElement("span", null, progress, " %")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2425
|
+
style: {
|
|
2426
|
+
position: 'absolute',
|
|
2427
|
+
left: '0px',
|
|
2428
|
+
bottom: '5px',
|
|
2429
|
+
width: '100%',
|
|
2430
|
+
height: '4px',
|
|
2431
|
+
borderRadius: '10px',
|
|
2432
|
+
backgroundColor: progressTrackColor
|
|
2433
|
+
}
|
|
2434
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2435
|
+
style: {
|
|
2436
|
+
height: '100%',
|
|
2437
|
+
borderRadius: '10px',
|
|
2438
|
+
width: status === 'failed' ? '100%' : progress + '%',
|
|
2439
|
+
backgroundColor: status === 'success' ? progressSuccessColor : status === 'failed' ? progressFailedColor : progressLoadingColor
|
|
2440
|
+
}
|
|
2441
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2442
|
+
style: {
|
|
2443
|
+
width: '22px',
|
|
2444
|
+
cursor: 'pointer'
|
|
2445
|
+
},
|
|
2446
|
+
onClick: () => handleRemoveItem(uuid)
|
|
2447
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgListItemDelete, null))));
|
|
2448
|
+
});
|
|
2449
|
+
|
|
2450
|
+
const SvgUpload = ({
|
|
2451
|
+
title,
|
|
2452
|
+
titleId,
|
|
2453
|
+
...props
|
|
2454
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2455
|
+
width: "51",
|
|
2456
|
+
height: "35",
|
|
2457
|
+
viewBox: "0 0 51 35",
|
|
2458
|
+
fill: "none",
|
|
2459
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2460
|
+
"aria-labelledby": titleId
|
|
2461
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2462
|
+
id: titleId
|
|
2463
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2464
|
+
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",
|
|
2465
|
+
fill: "#D1D1D1"
|
|
2466
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2467
|
+
fillRule: "evenodd",
|
|
2468
|
+
clipRule: "evenodd",
|
|
2469
|
+
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",
|
|
2470
|
+
fill: "#0DA574"
|
|
2471
|
+
}));
|
|
2472
|
+
|
|
2473
|
+
const SvgRemoveFile = ({
|
|
2474
|
+
title,
|
|
2475
|
+
titleId,
|
|
2476
|
+
...props
|
|
2477
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2478
|
+
width: "26",
|
|
2479
|
+
height: "26",
|
|
2480
|
+
viewBox: "0 0 26 26",
|
|
2481
|
+
fill: "none",
|
|
2482
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2483
|
+
"aria-labelledby": titleId
|
|
2484
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2485
|
+
id: titleId
|
|
2486
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2487
|
+
width: 26,
|
|
2488
|
+
height: 26,
|
|
2489
|
+
rx: 6,
|
|
2490
|
+
fill: "#FBFBFB"
|
|
2491
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2492
|
+
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",
|
|
2493
|
+
fill: "#00236A"
|
|
2494
|
+
}));
|
|
2495
|
+
|
|
2496
|
+
const SvgDeleteComponent = ({
|
|
2497
|
+
title,
|
|
2498
|
+
titleId,
|
|
2499
|
+
...props
|
|
2500
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2501
|
+
width: "26",
|
|
2502
|
+
height: "26",
|
|
2503
|
+
viewBox: "0 0 26 26",
|
|
2504
|
+
fill: "none",
|
|
2505
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2506
|
+
"aria-labelledby": titleId
|
|
2507
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2508
|
+
id: titleId
|
|
2509
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2510
|
+
x: 0.5,
|
|
2511
|
+
y: 0.5,
|
|
2512
|
+
width: 25,
|
|
2513
|
+
height: 25,
|
|
2514
|
+
rx: 5.5,
|
|
2515
|
+
stroke: "#D1D1D1"
|
|
2516
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2517
|
+
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",
|
|
2518
|
+
fill: "#E00"
|
|
2519
|
+
}));
|
|
2520
|
+
|
|
2521
|
+
const NewFile = ({
|
|
2522
|
+
or,
|
|
2523
|
+
size,
|
|
2524
|
+
name,
|
|
2525
|
+
color,
|
|
2526
|
+
label,
|
|
2527
|
+
width,
|
|
2528
|
+
weight,
|
|
2529
|
+
height,
|
|
2530
|
+
radius,
|
|
2531
|
+
change,
|
|
2532
|
+
border,
|
|
2533
|
+
upload,
|
|
2534
|
+
maxSize,
|
|
2535
|
+
disabled,
|
|
2536
|
+
multiple,
|
|
2537
|
+
required,
|
|
2538
|
+
errorSize,
|
|
2539
|
+
labelSize,
|
|
2540
|
+
removeFile,
|
|
2541
|
+
labelColor,
|
|
2542
|
+
errorColor,
|
|
2543
|
+
filesArray,
|
|
2544
|
+
putFileHere,
|
|
2545
|
+
borderColor,
|
|
2546
|
+
uploadColor,
|
|
2547
|
+
defaultData,
|
|
2548
|
+
errorMessage,
|
|
2549
|
+
fileSizeText,
|
|
2550
|
+
progressColor,
|
|
2551
|
+
fileExtensions,
|
|
2552
|
+
listItemHeight,
|
|
2553
|
+
backgroundColor,
|
|
2554
|
+
deleteComponent,
|
|
2555
|
+
listItemPadding,
|
|
2556
|
+
progressFontSize,
|
|
2557
|
+
borderHoverColor,
|
|
2558
|
+
listItemErrorSize,
|
|
2559
|
+
progressTrackColor,
|
|
2560
|
+
fileAreaImageWidth,
|
|
2561
|
+
listItemErrorColor,
|
|
2562
|
+
labelRequiredColor,
|
|
2563
|
+
progressFailedColor,
|
|
2564
|
+
fileAreaImageHeight,
|
|
2565
|
+
progressSuccessColor,
|
|
2566
|
+
progressLoadingColor,
|
|
2567
|
+
hiddenBackgroundColor,
|
|
2568
|
+
extentionsRowMarginTop,
|
|
2569
|
+
listItemBackgroundColor,
|
|
2570
|
+
listItemBackgroundErrorColor
|
|
2571
|
+
}) => {
|
|
2572
|
+
const ref = React.useRef(null);
|
|
2573
|
+
const inpRef = React.useRef(null);
|
|
2574
|
+
const memoizedItems = React.useMemo(() => filesArray, [filesArray]);
|
|
2575
|
+
const [error, setError] = React.useState('');
|
|
2576
|
+
const [isHover, setIsHover] = React.useState(false);
|
|
2577
|
+
const [singleFile, setSingleFile] = React.useState(null);
|
|
2578
|
+
const [image, setImage] = React.useState(!multiple ? defaultData ? defaultData.type !== 'application/pdf' ? defaultData.url : 'pdf' : null : null);
|
|
2579
|
+
const configStyles = compereConfigs();
|
|
2580
|
+
const handleRemoveComponent = () => {
|
|
2581
|
+
const node = ReactDOM__default["default"].findDOMNode(ref.current);
|
|
2582
|
+
const parent = node.parentNode;
|
|
2583
|
+
parent.removeChild(node);
|
|
2584
|
+
};
|
|
2585
|
+
const handleRemoveFile = () => {
|
|
2586
|
+
setImage(null);
|
|
2587
|
+
removeFile(singleFile);
|
|
2588
|
+
};
|
|
2589
|
+
const handleChange = e => {
|
|
2590
|
+
const file = e.target.files;
|
|
2591
|
+
if (multiple) {
|
|
2592
|
+
setError('');
|
|
2593
|
+
setImage(null);
|
|
2594
|
+
for (let ix = 0; ix < file.length; ix++) {
|
|
2595
|
+
if (file[ix]) {
|
|
2596
|
+
if (file[ix].size <= maxSize * Math.pow(2, 20)) {
|
|
2597
|
+
if (fileExtensions.includes(file[ix].type.split('/')[1])) {
|
|
2598
|
+
change({
|
|
2599
|
+
id: '',
|
|
2600
|
+
check: '',
|
|
2601
|
+
status: '',
|
|
2602
|
+
file: file[ix],
|
|
2603
|
+
uuid: v4()
|
|
2604
|
+
});
|
|
2605
|
+
} else {
|
|
2606
|
+
change({
|
|
2607
|
+
file: file[ix],
|
|
2608
|
+
uuid: v4(),
|
|
2609
|
+
check: 'ֆայլի սխալ ֆորմատ'
|
|
2610
|
+
});
|
|
2611
|
+
}
|
|
2612
|
+
} else {
|
|
2613
|
+
change({
|
|
2614
|
+
file: file[ix],
|
|
2615
|
+
uuid: v4(),
|
|
2616
|
+
check: 'առավելագույն ծավալ'
|
|
2617
|
+
});
|
|
2618
|
+
}
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
if (file.length === 0 && memoizedItems.length === 0) {
|
|
2622
|
+
setError('Ֆայլը ընտրված չէ');
|
|
2623
|
+
}
|
|
2624
|
+
} else {
|
|
2625
|
+
if (file[0]) {
|
|
2626
|
+
if (file[0].size <= maxSize * Math.pow(2, 20)) {
|
|
2627
|
+
if (fileExtensions.includes(file[0].type.split('/')[1])) {
|
|
2628
|
+
setError('');
|
|
2629
|
+
change(file);
|
|
2630
|
+
setSingleFile(file);
|
|
2631
|
+
if (file[0].type === 'application/pdf') {
|
|
2632
|
+
setImage('pdf');
|
|
2633
|
+
} else {
|
|
2634
|
+
setImage(URL.createObjectURL(file[0]));
|
|
2635
|
+
}
|
|
2636
|
+
} else {
|
|
2637
|
+
setImage(null);
|
|
2638
|
+
setError('ֆայլի սխալ ֆորմատ');
|
|
2639
|
+
}
|
|
2640
|
+
} else {
|
|
2641
|
+
setImage(null);
|
|
2642
|
+
setError('առավելագույն ծավալ');
|
|
2643
|
+
}
|
|
2644
|
+
}
|
|
2645
|
+
if (file.length === 0) {
|
|
2646
|
+
setImage(null);
|
|
2647
|
+
setError('Ֆայլը ընտրված չէ');
|
|
2648
|
+
}
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2651
|
+
const handleClick = () => {
|
|
2652
|
+
if (!image) {
|
|
2653
|
+
inpRef.current.click();
|
|
2654
|
+
}
|
|
2655
|
+
};
|
|
2656
|
+
const handleDrop = e => {
|
|
2657
|
+
if (!disabled) {
|
|
2658
|
+
e.preventDefault();
|
|
2659
|
+
handleChange({
|
|
2660
|
+
target: {
|
|
2661
|
+
files: e.dataTransfer.files
|
|
2662
|
+
}
|
|
2663
|
+
});
|
|
2664
|
+
}
|
|
2665
|
+
};
|
|
2666
|
+
const handleDragOver = e => {
|
|
2667
|
+
if (!disabled) {
|
|
2668
|
+
e.preventDefault();
|
|
2669
|
+
}
|
|
2670
|
+
};
|
|
2671
|
+
const handleMouseEnter = () => {
|
|
2672
|
+
setIsHover(true);
|
|
2673
|
+
};
|
|
2674
|
+
const handleMouseLeave = () => {
|
|
2675
|
+
setIsHover(false);
|
|
2676
|
+
};
|
|
2677
|
+
const handleStopPropagation = e => {
|
|
2678
|
+
e.stopPropagation();
|
|
2679
|
+
};
|
|
2680
|
+
React.useEffect(() => {
|
|
2681
|
+
if (!multiple && defaultData) {
|
|
2682
|
+
if (!defaultData.type) {
|
|
2683
|
+
alert('Please add type in defaultData prop');
|
|
2684
|
+
}
|
|
2685
|
+
if (!defaultData.url) {
|
|
2686
|
+
alert('Please add url in defaultData prop');
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
if (multiple && !filesArray) {
|
|
2690
|
+
alert('In multiple mode, you should add filesArray prop for drawing files');
|
|
2691
|
+
}
|
|
2692
|
+
if (multiple) {
|
|
2693
|
+
setSingleFile(null);
|
|
2694
|
+
}
|
|
2695
|
+
}, [multiple, filesArray && filesArray.length, defaultData]);
|
|
2696
|
+
React.useEffect(() => {
|
|
2697
|
+
if (errorMessage) {
|
|
2698
|
+
setError(errorMessage);
|
|
2699
|
+
} else {
|
|
2700
|
+
setError('');
|
|
2701
|
+
}
|
|
2702
|
+
}, [errorMessage]);
|
|
2703
|
+
React.useEffect(() => {
|
|
2704
|
+
if (!change) {
|
|
2705
|
+
alert('Please add change prop on File component');
|
|
2706
|
+
}
|
|
2707
|
+
if (!removeFile) {
|
|
2708
|
+
alert('Please add removeFile prop on File component');
|
|
2709
|
+
}
|
|
2710
|
+
}, [change, removeFile]);
|
|
2711
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2712
|
+
ref: ref,
|
|
2713
|
+
style: {
|
|
2714
|
+
width: width ? width : configStyles.File.width
|
|
2715
|
+
}
|
|
2716
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2717
|
+
style: {
|
|
2718
|
+
display: 'flex',
|
|
2719
|
+
marginBottom: '6px',
|
|
2720
|
+
alignItems: 'center',
|
|
2721
|
+
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2722
|
+
}
|
|
2723
|
+
}, label && /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2724
|
+
style: {
|
|
2725
|
+
color: labelColor ? labelColor : configStyles.File.labelColor,
|
|
2726
|
+
fontSize: labelSize ? labelSize : configStyles.File.labelSize
|
|
2727
|
+
}
|
|
2728
|
+
}, label, required && /*#__PURE__*/React__default["default"].createElement("sup", {
|
|
2729
|
+
style: {
|
|
2730
|
+
color: labelRequiredColor ? labelRequiredColor : configStyles.File.labelRequiredColor
|
|
2731
|
+
}
|
|
2732
|
+
}, "*")), deleteComponent && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2733
|
+
style: {
|
|
2734
|
+
cursor: 'pointer'
|
|
2735
|
+
},
|
|
2736
|
+
onClick: handleRemoveComponent
|
|
2737
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgDeleteComponent, null))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2738
|
+
style: {
|
|
2739
|
+
width: '100%',
|
|
2740
|
+
display: 'flex',
|
|
2741
|
+
alignItems: 'center',
|
|
2742
|
+
position: 'relative',
|
|
2743
|
+
boxSizing: 'border-box',
|
|
2744
|
+
justifyContent: 'center',
|
|
2745
|
+
cursor: !disabled ? 'pointer' : 'not-allowed',
|
|
2746
|
+
height: height ? height : configStyles.File.height,
|
|
2747
|
+
border: border ? border : configStyles.File.border,
|
|
2748
|
+
borderRadius: radius ? radius : configStyles.File.radius,
|
|
2749
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.File.backgroundColor,
|
|
2750
|
+
borderColor: error ? errorColor ? errorColor : configStyles.File.errorColor : disabled ? borderColor ? borderColor : configStyles.File.borderColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.File.borderHoverColor : borderColor ? borderColor : configStyles.File.borderColor
|
|
2751
|
+
},
|
|
2752
|
+
onDrop: handleDrop,
|
|
2753
|
+
onClick: handleClick,
|
|
2754
|
+
onDragOver: handleDragOver,
|
|
2755
|
+
onMouseEnter: handleMouseEnter,
|
|
2756
|
+
onMouseLeave: handleMouseLeave
|
|
2757
|
+
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
2758
|
+
hidden: true,
|
|
2759
|
+
name: name,
|
|
2760
|
+
type: "file",
|
|
2761
|
+
ref: inpRef,
|
|
2762
|
+
disabled: disabled,
|
|
2763
|
+
multiple: multiple,
|
|
2764
|
+
onChange: handleChange
|
|
2765
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2766
|
+
style: {
|
|
2767
|
+
width: '100%',
|
|
2768
|
+
height: '100%',
|
|
2769
|
+
display: 'flex',
|
|
2770
|
+
textAlign: 'center',
|
|
2771
|
+
alignItems: 'center',
|
|
2772
|
+
flexDirection: 'column',
|
|
2773
|
+
justifyContent: 'center',
|
|
2774
|
+
color: color ? color : configStyles.File.color,
|
|
2775
|
+
fontSize: size ? size : configStyles.File.size,
|
|
2776
|
+
fontWeight: weight ? weight : configStyles.File.weight
|
|
2777
|
+
}
|
|
2778
|
+
}, !multiple && image ? image === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgPdf, null) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
2779
|
+
src: image,
|
|
2780
|
+
style: {
|
|
2781
|
+
display: 'block',
|
|
2782
|
+
maxWidth: '100%',
|
|
2783
|
+
maxHeight: '95%',
|
|
2784
|
+
objectFit: 'contain',
|
|
2785
|
+
width: fileAreaImageWidth ? fileAreaImageWidth : configStyles.File.fileAreaImageWidth,
|
|
2786
|
+
height: fileAreaImageHeight ? fileAreaImageHeight : configStyles.File.fileAreaImageHeight
|
|
2787
|
+
},
|
|
2788
|
+
alt: "file preview"
|
|
2789
|
+
}) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(SvgUpload, null)), /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2790
|
+
style: {
|
|
2791
|
+
margin: '0px'
|
|
2792
|
+
}
|
|
2793
|
+
}, putFileHere ? putFileHere : configStyles.File.putFileHere, /*#__PURE__*/React__default["default"].createElement("br", null), or ? or : configStyles.File.or, " ", /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2794
|
+
style: {
|
|
2795
|
+
color: uploadColor ? uploadColor : configStyles.File.uploadColor
|
|
2796
|
+
}
|
|
2797
|
+
}, upload ? upload : configStyles.File.upload))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2798
|
+
style: {
|
|
2799
|
+
marginTop: extentionsRowMarginTop ? extentionsRowMarginTop : configStyles.File.extentionsRowMarginTop
|
|
2800
|
+
}
|
|
2801
|
+
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2802
|
+
style: {
|
|
2803
|
+
margin: '0px'
|
|
2804
|
+
}
|
|
2805
|
+
}, fileSizeText ? fileSizeText : configStyles.File.fileSizeText, " ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )")))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2806
|
+
style: {
|
|
2807
|
+
position: 'absolute',
|
|
2808
|
+
top: '0px',
|
|
2809
|
+
left: '0px',
|
|
2810
|
+
zIndex: '1',
|
|
2811
|
+
width: '100%',
|
|
2812
|
+
height: '100%',
|
|
2813
|
+
padding: '10px',
|
|
2814
|
+
cursor: 'default',
|
|
2815
|
+
boxSizing: 'border-box',
|
|
2816
|
+
alignItems: 'flex-start',
|
|
2817
|
+
justifyContent: 'flex-end',
|
|
2818
|
+
borderRadius: radius ? radius : configStyles.File.radius,
|
|
2819
|
+
display: !multiple && !disabled && image && !error && isHover ? 'flex' : 'none',
|
|
2820
|
+
backgroundColor: hiddenBackgroundColor ? hiddenBackgroundColor : configStyles.File.hiddenBackgroundColor
|
|
2821
|
+
},
|
|
2822
|
+
onClick: handleStopPropagation
|
|
2823
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2824
|
+
style: {
|
|
2825
|
+
cursor: 'pointer'
|
|
2826
|
+
},
|
|
2827
|
+
onClick: handleRemoveFile
|
|
2828
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgRemoveFile, null)))), error ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2829
|
+
style: {
|
|
2830
|
+
marginTop: '6px',
|
|
2831
|
+
display: 'inline-block',
|
|
2832
|
+
color: errorColor ? errorColor : configStyles.File.errorColor,
|
|
2833
|
+
fontSize: errorSize ? errorSize : configStyles.File.errorSize
|
|
2834
|
+
}
|
|
2835
|
+
}, error) : '', multiple && memoizedItems && memoizedItems.length > 0 && memoizedItems.map(item => {
|
|
2836
|
+
return /*#__PURE__*/React__default["default"].createElement(FileItem, {
|
|
2837
|
+
key: item.uuid,
|
|
2838
|
+
uuid: item.uuid,
|
|
2839
|
+
check: item.check,
|
|
2840
|
+
status: item.status,
|
|
2841
|
+
size: item.file.size,
|
|
2842
|
+
name: item.file.name,
|
|
2843
|
+
removeFile: removeFile,
|
|
2844
|
+
radius: radius ? radius : configStyles.File.radius,
|
|
2845
|
+
fileFormat: item.file.type.split('/')[1].toLowerCase(),
|
|
2846
|
+
progressColor: progressColor ? progressColor : configStyles.File.progressColor,
|
|
2847
|
+
listItemHeight: listItemHeight ? listItemHeight : configStyles.File.listItemHeight,
|
|
2848
|
+
listItemPadding: listItemPadding ? listItemPadding : configStyles.File.listItemPadding,
|
|
2849
|
+
progressFontSize: progressFontSize ? progressFontSize : configStyles.File.progressFontSize,
|
|
2850
|
+
listItemErrorSize: listItemErrorSize ? listItemErrorSize : configStyles.File.listItemErrorSize,
|
|
2851
|
+
listItemErrorColor: listItemErrorColor ? listItemErrorColor : configStyles.File.listItemErrorColor,
|
|
2852
|
+
progressTrackColor: progressTrackColor ? progressTrackColor : configStyles.File.progressTrackColor,
|
|
2853
|
+
progressFailedColor: progressFailedColor ? progressFailedColor : configStyles.File.progressFailedColor,
|
|
2854
|
+
progressSuccessColor: progressSuccessColor ? progressSuccessColor : configStyles.File.progressSuccessColor,
|
|
2855
|
+
progressLoadingColor: progressLoadingColor ? progressLoadingColor : configStyles.File.progressLoadingColor,
|
|
2856
|
+
listItemBackgroundColor: listItemBackgroundColor ? listItemBackgroundColor : configStyles.File.listItemBackgroundColor,
|
|
2857
|
+
listItemBackgroundErrorColor: listItemBackgroundErrorColor ? listItemBackgroundErrorColor : configStyles.File.listItemBackgroundErrorColor
|
|
2858
|
+
});
|
|
2859
|
+
}));
|
|
2860
|
+
};
|
|
2861
|
+
NewFile.propTypes = {
|
|
2862
|
+
or: PropTypes__default["default"].string,
|
|
2863
|
+
size: PropTypes__default["default"].string,
|
|
2864
|
+
label: PropTypes__default["default"].string,
|
|
2865
|
+
width: PropTypes__default["default"].string,
|
|
2866
|
+
color: PropTypes__default["default"].string,
|
|
2867
|
+
height: PropTypes__default["default"].string,
|
|
2868
|
+
disabled: PropTypes__default["default"].bool,
|
|
2869
|
+
radius: PropTypes__default["default"].string,
|
|
2870
|
+
border: PropTypes__default["default"].string,
|
|
2871
|
+
required: PropTypes__default["default"].bool,
|
|
2872
|
+
upload: PropTypes__default["default"].string,
|
|
2873
|
+
weight: PropTypes__default["default"].number,
|
|
2874
|
+
maxSize: PropTypes__default["default"].number,
|
|
2875
|
+
errorSize: PropTypes__default["default"].string,
|
|
2876
|
+
labelSize: PropTypes__default["default"].string,
|
|
2877
|
+
labelColor: PropTypes__default["default"].string,
|
|
2878
|
+
errorColor: PropTypes__default["default"].string,
|
|
2879
|
+
putFileHere: PropTypes__default["default"].string,
|
|
2880
|
+
borderColor: PropTypes__default["default"].string,
|
|
2881
|
+
uploadColor: PropTypes__default["default"].string,
|
|
2882
|
+
defaultData: PropTypes__default["default"].object,
|
|
2883
|
+
errorMessage: PropTypes__default["default"].string,
|
|
2884
|
+
fileSizeText: PropTypes__default["default"].string,
|
|
2885
|
+
progressColor: PropTypes__default["default"].string,
|
|
2886
|
+
deleteComponent: PropTypes__default["default"].bool,
|
|
2887
|
+
listItemHeight: PropTypes__default["default"].string,
|
|
2888
|
+
backgroundColor: PropTypes__default["default"].string,
|
|
2889
|
+
change: PropTypes__default["default"].func.isRequired,
|
|
2890
|
+
listItemPadding: PropTypes__default["default"].string,
|
|
2891
|
+
progressFontSize: PropTypes__default["default"].string,
|
|
2892
|
+
borderHoverColor: PropTypes__default["default"].string,
|
|
2893
|
+
listItemErrorSize: PropTypes__default["default"].string,
|
|
2894
|
+
labelRequiredColor: PropTypes__default["default"].string,
|
|
2895
|
+
progressTrackColor: PropTypes__default["default"].string,
|
|
2896
|
+
fileAreaImageWidth: PropTypes__default["default"].string,
|
|
2897
|
+
listItemErrorColor: PropTypes__default["default"].string,
|
|
2898
|
+
removeFile: PropTypes__default["default"].func.isRequired,
|
|
2899
|
+
fileAreaImageHeight: PropTypes__default["default"].string,
|
|
2900
|
+
progressFailedColor: PropTypes__default["default"].string,
|
|
2901
|
+
progressSuccessColor: PropTypes__default["default"].string,
|
|
2902
|
+
progressLoadingColor: PropTypes__default["default"].string,
|
|
2903
|
+
hiddenBackgroundColor: PropTypes__default["default"].string,
|
|
2904
|
+
extentionsRowMarginTop: PropTypes__default["default"].string,
|
|
2905
|
+
listItemBackgroundColor: PropTypes__default["default"].string,
|
|
2906
|
+
listItemBackgroundErrorColor: PropTypes__default["default"].string,
|
|
2907
|
+
filesArray: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
|
|
2908
|
+
fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
|
|
2909
|
+
};
|
|
2910
|
+
NewFile.defaultProps = {
|
|
2911
|
+
maxSize: 50,
|
|
2912
|
+
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
|
|
2913
|
+
};
|
|
2914
|
+
|
|
2093
2915
|
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}";
|
|
2094
2916
|
styleInject(css_248z$2);
|
|
2095
2917
|
|
|
@@ -2112,18 +2934,24 @@ const Textarea = ({
|
|
|
2112
2934
|
boxSizing,
|
|
2113
2935
|
maxLength,
|
|
2114
2936
|
labelSize,
|
|
2937
|
+
errorSize,
|
|
2115
2938
|
labelColor,
|
|
2939
|
+
errorColor,
|
|
2116
2940
|
borderColor,
|
|
2117
2941
|
labelWeight,
|
|
2118
2942
|
placeholder,
|
|
2119
2943
|
labelDisplay,
|
|
2944
|
+
errorMesaage,
|
|
2120
2945
|
backgroundColor,
|
|
2121
2946
|
borderFocusColor,
|
|
2122
2947
|
borderHoverColor,
|
|
2948
|
+
showCharacterCount,
|
|
2123
2949
|
labelRequiredColor
|
|
2124
2950
|
}) => {
|
|
2951
|
+
const [error, setError] = React.useState('');
|
|
2125
2952
|
const [isHover, setIsHover] = React.useState(false);
|
|
2126
2953
|
const [isFocus, setIsFocus] = React.useState(false);
|
|
2954
|
+
const [innerValue, setInnerValue] = React.useState('');
|
|
2127
2955
|
const configStyles = compereConfigs();
|
|
2128
2956
|
const handleMouseEnter = () => {
|
|
2129
2957
|
setIsHover(true);
|
|
@@ -2137,6 +2965,25 @@ const Textarea = ({
|
|
|
2137
2965
|
const handleBlur = () => {
|
|
2138
2966
|
setIsFocus(false);
|
|
2139
2967
|
};
|
|
2968
|
+
const handleChange = e => {
|
|
2969
|
+
const value = e.target.value;
|
|
2970
|
+
onChange(value);
|
|
2971
|
+
if (maxLength) {
|
|
2972
|
+
if (value.length > maxLength) {
|
|
2973
|
+
onChange(value.substr(0, maxLength));
|
|
2974
|
+
setError('Նիշերի քանակը գերազանցում է');
|
|
2975
|
+
} else {
|
|
2976
|
+
setError('');
|
|
2977
|
+
}
|
|
2978
|
+
} else {
|
|
2979
|
+
if (value.length > configStyles.TEXTAREA.maxLength) {
|
|
2980
|
+
setError('Նիշերի քանակը գերազանցում է');
|
|
2981
|
+
onChange(value.substr(0, configStyles.TEXTAREA.maxLength));
|
|
2982
|
+
} else {
|
|
2983
|
+
setError('');
|
|
2984
|
+
}
|
|
2985
|
+
}
|
|
2986
|
+
};
|
|
2140
2987
|
React.useEffect(() => {
|
|
2141
2988
|
if (value === undefined) {
|
|
2142
2989
|
alert('Please add value prop on Textarea component');
|
|
@@ -2144,8 +2991,26 @@ const Textarea = ({
|
|
|
2144
2991
|
if (!onChange) {
|
|
2145
2992
|
alert('Please add onChange function on Textarea component');
|
|
2146
2993
|
}
|
|
2994
|
+
setInnerValue(value);
|
|
2147
2995
|
}, [value, onChange]);
|
|
2148
|
-
|
|
2996
|
+
React.useEffect(() => {
|
|
2997
|
+
if (errorMesaage) {
|
|
2998
|
+
setError(errorMesaage);
|
|
2999
|
+
} else {
|
|
3000
|
+
setError('');
|
|
3001
|
+
}
|
|
3002
|
+
}, [errorMesaage]);
|
|
3003
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3004
|
+
style: {
|
|
3005
|
+
width: width ? width : configStyles.TEXTAREA.width
|
|
3006
|
+
}
|
|
3007
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3008
|
+
style: {
|
|
3009
|
+
display: 'flex',
|
|
3010
|
+
alignItems: 'center',
|
|
3011
|
+
justifyContent: label ? 'space-between' : 'flex-end'
|
|
3012
|
+
}
|
|
3013
|
+
}, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2149
3014
|
style: {
|
|
2150
3015
|
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
2151
3016
|
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize,
|
|
@@ -2156,12 +3021,17 @@ const Textarea = ({
|
|
|
2156
3021
|
style: {
|
|
2157
3022
|
color: labelRequiredColor ? labelRequiredColor : configStyles.TEXTAREA.labelRequiredColor
|
|
2158
3023
|
}
|
|
2159
|
-
}, "*")) : '', /*#__PURE__*/React__default["default"].createElement("
|
|
3024
|
+
}, "*")) : '', showCharacterCount && maxLength && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2160
3025
|
style: {
|
|
3026
|
+
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
3027
|
+
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize
|
|
3028
|
+
}
|
|
3029
|
+
}, maxLength - value.length, " \u0576\u056B\u0577")), /*#__PURE__*/React__default["default"].createElement("textarea", {
|
|
3030
|
+
style: {
|
|
3031
|
+
width: '100%',
|
|
2161
3032
|
outline: 'none',
|
|
2162
3033
|
overflow: 'auto',
|
|
2163
3034
|
fontSize: size ? size : configStyles.TEXTAREA.size,
|
|
2164
|
-
width: width ? width : configStyles.TEXTAREA.width,
|
|
2165
3035
|
height: height ? height : configStyles.TEXTAREA.height,
|
|
2166
3036
|
border: border ? border : configStyles.TEXTAREA.border,
|
|
2167
3037
|
padding: padding ? padding : configStyles.TEXTAREA.padding,
|
|
@@ -2172,17 +3042,24 @@ const Textarea = ({
|
|
|
2172
3042
|
maxHeight: maxHeight ? maxHeight : configStyles.TEXTAREA.maxHeight,
|
|
2173
3043
|
boxSizing: boxSizing ? boxSizing : configStyles.TEXTAREA.boxSizing,
|
|
2174
3044
|
backgroundColor: backgroundColor ? backgroundColor : configStyles.TEXTAREA.backgroundColor,
|
|
2175
|
-
borderColor: isFocus ? borderFocusColor ? borderFocusColor : configStyles.TEXTAREA.borderFocusColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.TEXTAREA.borderHoverColor : borderColor ? borderColor : configStyles.TEXTAREA.borderColor,
|
|
3045
|
+
borderColor: error ? errorColor ? errorColor : configStyles.TEXTAREA.errorColor : isFocus ? borderFocusColor ? borderFocusColor : configStyles.TEXTAREA.borderFocusColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.TEXTAREA.borderHoverColor : borderColor ? borderColor : configStyles.TEXTAREA.borderColor,
|
|
2176
3046
|
resize: resize ? resize : configStyles.TEXTAREA.resize
|
|
2177
3047
|
},
|
|
3048
|
+
value: innerValue,
|
|
2178
3049
|
onBlur: handleBlur,
|
|
2179
|
-
onChange: onChange,
|
|
2180
3050
|
onFocus: handleFocus,
|
|
3051
|
+
onChange: handleChange,
|
|
2181
3052
|
placeholder: placeholder,
|
|
2182
3053
|
onMouseEnter: handleMouseEnter,
|
|
2183
|
-
onMouseLeave: handleMouseLeave
|
|
2184
|
-
|
|
2185
|
-
|
|
3054
|
+
onMouseLeave: handleMouseLeave
|
|
3055
|
+
}), error ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3056
|
+
style: {
|
|
3057
|
+
marginTop: '6px',
|
|
3058
|
+
display: 'inline-block',
|
|
3059
|
+
fontSize: errorSize ? errorSize : configStyles.TEXTAREA.errorSize,
|
|
3060
|
+
color: errorColor ? errorColor : configStyles.TEXTAREA.errorColor
|
|
3061
|
+
}
|
|
3062
|
+
}, error) : '');
|
|
2186
3063
|
};
|
|
2187
3064
|
Textarea.propTypes = {
|
|
2188
3065
|
size: PropTypes__default["default"].string,
|
|
@@ -2207,6 +3084,7 @@ Textarea.propTypes = {
|
|
|
2207
3084
|
placeholder: PropTypes__default["default"].string,
|
|
2208
3085
|
labelDisplay: PropTypes__default["default"].string,
|
|
2209
3086
|
backgroundColor: PropTypes__default["default"].string,
|
|
3087
|
+
showCharacterCount: PropTypes__default["default"].bool,
|
|
2210
3088
|
value: PropTypes__default["default"].string.isRequired,
|
|
2211
3089
|
borderFocusColor: PropTypes__default["default"].string,
|
|
2212
3090
|
borderHoverColor: PropTypes__default["default"].string,
|
|
@@ -2220,7 +3098,7 @@ styleInject(css_248z$1);
|
|
|
2220
3098
|
|
|
2221
3099
|
// import styles from "./pagination.module.scss";
|
|
2222
3100
|
|
|
2223
|
-
const Dots
|
|
3101
|
+
const Dots = "...";
|
|
2224
3102
|
const range = (start, end) => {
|
|
2225
3103
|
const length = end - start + 1;
|
|
2226
3104
|
return Array.from({
|
|
@@ -2250,29 +3128,29 @@ const PaginationRange = ({
|
|
|
2250
3128
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
2251
3129
|
let leftItemCount = currentPageNumber === 4 && lastPageIndex > 7 ? 4 + siblingCountNumber : 3 + siblingCountNumber;
|
|
2252
3130
|
let leftRange = range(1, leftItemCount);
|
|
2253
|
-
return [...leftRange, Dots
|
|
3131
|
+
return [...leftRange, Dots, totalPageCount];
|
|
2254
3132
|
}
|
|
2255
3133
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
2256
3134
|
let rightItemCount = 0;
|
|
2257
3135
|
currentPageNumber === lastPageIndex - 3 && lastPageIndex > 7 ? rightItemCount = 4 + siblingCountNumber : rightItemCount = 3 + siblingCountNumber;
|
|
2258
3136
|
let rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
|
|
2259
|
-
return [firstPageIndex, Dots
|
|
3137
|
+
return [firstPageIndex, Dots, ...rightRange];
|
|
2260
3138
|
}
|
|
2261
3139
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
2262
3140
|
let middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
2263
|
-
return [firstPageIndex, Dots
|
|
3141
|
+
return [firstPageIndex, Dots, ...middleRange, Dots, lastPageIndex];
|
|
2264
3142
|
}
|
|
2265
3143
|
}, [currentTotalCount, offset, siblingCountNumber, currentPageNumber]);
|
|
2266
3144
|
return paginationRange;
|
|
2267
3145
|
};
|
|
2268
3146
|
|
|
2269
|
-
const
|
|
3147
|
+
const SvgDots = ({
|
|
2270
3148
|
title,
|
|
2271
3149
|
titleId,
|
|
2272
3150
|
...props
|
|
2273
3151
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2274
|
-
width: "
|
|
2275
|
-
height: "
|
|
3152
|
+
width: "11",
|
|
3153
|
+
height: "3",
|
|
2276
3154
|
viewBox: "0 0 11 3",
|
|
2277
3155
|
fill: "none",
|
|
2278
3156
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2280,17 +3158,17 @@ const Dots = ({
|
|
|
2280
3158
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2281
3159
|
id: titleId
|
|
2282
3160
|
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2283
|
-
d: "
|
|
3161
|
+
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",
|
|
2284
3162
|
fill: "#3C393E"
|
|
2285
3163
|
}));
|
|
2286
3164
|
|
|
2287
|
-
const
|
|
3165
|
+
const SvgNextarrow = ({
|
|
2288
3166
|
title,
|
|
2289
3167
|
titleId,
|
|
2290
3168
|
...props
|
|
2291
3169
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2292
|
-
width: "
|
|
2293
|
-
height: "
|
|
3170
|
+
width: "6",
|
|
3171
|
+
height: "12",
|
|
2294
3172
|
viewBox: "0 0 6 12",
|
|
2295
3173
|
fill: "none",
|
|
2296
3174
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2298,7 +3176,7 @@ const SvgNextArrow = ({
|
|
|
2298
3176
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2299
3177
|
id: titleId
|
|
2300
3178
|
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2301
|
-
d: "
|
|
3179
|
+
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",
|
|
2302
3180
|
fill: "#3C393E"
|
|
2303
3181
|
}));
|
|
2304
3182
|
|
|
@@ -2362,8 +3240,8 @@ const Pagination = ({
|
|
|
2362
3240
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
2363
3241
|
onClick: onPrevious,
|
|
2364
3242
|
disabled: currentPage === 1 ? true : false
|
|
2365
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
2366
|
-
if (pageNumber === Dots
|
|
3243
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null)), paginationRange.map((pageNumber, id) => {
|
|
3244
|
+
if (pageNumber === Dots) {
|
|
2367
3245
|
let currentPageIndex = paginationRange.indexOf(currentPageNumber);
|
|
2368
3246
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
2369
3247
|
key: id,
|
|
@@ -2372,16 +3250,16 @@ const Pagination = ({
|
|
|
2372
3250
|
disabled: currentPageIndex === 0 ? true : false
|
|
2373
3251
|
}, id < currentPageIndex ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2374
3252
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
2375
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
3253
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgDots, null)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2376
3254
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`,
|
|
2377
3255
|
style: {
|
|
2378
3256
|
transform: 'rotate(180deg)'
|
|
2379
3257
|
}
|
|
2380
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
3258
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2381
3259
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
2382
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
3260
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgDots, null)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2383
3261
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
|
|
2384
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
3262
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null))));
|
|
2385
3263
|
}
|
|
2386
3264
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
2387
3265
|
onClick: () => onPageChange(pageNumber),
|
|
@@ -2392,7 +3270,7 @@ const Pagination = ({
|
|
|
2392
3270
|
onClick: onNext,
|
|
2393
3271
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
2394
3272
|
disabled: currentPageNumber === lastPage ? true : false
|
|
2395
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
3273
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null)));
|
|
2396
3274
|
};
|
|
2397
3275
|
Pagination.propTypes = {
|
|
2398
3276
|
offset: PropTypes__default["default"].number,
|
|
@@ -2544,6 +3422,7 @@ Autocomplate.defaultProps = {
|
|
|
2544
3422
|
|
|
2545
3423
|
const NewAutocomplete = ({
|
|
2546
3424
|
label,
|
|
3425
|
+
change,
|
|
2547
3426
|
options,
|
|
2548
3427
|
getItem,
|
|
2549
3428
|
required,
|
|
@@ -2617,6 +3496,7 @@ const NewAutocomplete = ({
|
|
|
2617
3496
|
const [isHover, setIsHover] = React.useState(false);
|
|
2618
3497
|
const [isFocus, setIsFocus] = React.useState(false);
|
|
2619
3498
|
const [innerValue, setInnerValue] = React.useState('');
|
|
3499
|
+
const [innerOptions, setInnerOptions] = React.useState([]);
|
|
2620
3500
|
const configStyles = compereConfigs();
|
|
2621
3501
|
const showOption = styled.keyframes`
|
|
2622
3502
|
100% {
|
|
@@ -2650,13 +3530,18 @@ const NewAutocomplete = ({
|
|
|
2650
3530
|
const value = e.target.value;
|
|
2651
3531
|
value.length > 0 ? setShow(true) : setShow(false);
|
|
2652
3532
|
setInnerValue(value);
|
|
3533
|
+
if (value.length >= searchCount) {
|
|
3534
|
+
change(value);
|
|
3535
|
+
} else {
|
|
3536
|
+
change('');
|
|
3537
|
+
}
|
|
2653
3538
|
};
|
|
2654
3539
|
const handleClick = selectedValue => {
|
|
2655
3540
|
setShow(false);
|
|
2656
3541
|
getItem(selectedValue);
|
|
2657
|
-
setInnerValue(selectedValue.
|
|
3542
|
+
setInnerValue(selectedValue.name);
|
|
2658
3543
|
};
|
|
2659
|
-
const optionList = /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, show &&
|
|
3544
|
+
const optionList = /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, show && innerOptions ? innerOptions.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2660
3545
|
style: {
|
|
2661
3546
|
left: contentBottomLeft ? contentBottomLeft : configStyles.NEWAUTOCOMPLETE.contentBottomLeft,
|
|
2662
3547
|
width: contentBottomWidth ? contentBottomWidth : configStyles.NEWAUTOCOMPLETE.contentBottomWidth,
|
|
@@ -2679,9 +3564,9 @@ const NewAutocomplete = ({
|
|
|
2679
3564
|
maxHeight: contentBottomInnerMaxHeight ? contentBottomInnerMaxHeight : configStyles.NEWAUTOCOMPLETE.contentBottomInnerMaxHeight,
|
|
2680
3565
|
flexDirection: contentBottomInnerDirection ? contentBottomInnerDirection : configStyles.NEWAUTOCOMPLETE.contentBottomInnerDirection
|
|
2681
3566
|
}
|
|
2682
|
-
},
|
|
3567
|
+
}, innerOptions.map(item => {
|
|
2683
3568
|
return /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2684
|
-
key:
|
|
3569
|
+
key: item.id,
|
|
2685
3570
|
onMouseEnter: handleRowMouseEnter,
|
|
2686
3571
|
onMouseLeave: handleRowMouseLeave,
|
|
2687
3572
|
onClick: () => handleClick(item),
|
|
@@ -2701,40 +3586,37 @@ const NewAutocomplete = ({
|
|
|
2701
3586
|
marginBottom: contentBottomRowMarginBottom ? contentBottomRowMarginBottom : configStyles.NEWAUTOCOMPLETE.contentBottomRowMarginBottom,
|
|
2702
3587
|
backgroundColor: contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor
|
|
2703
3588
|
}
|
|
2704
|
-
}, item.
|
|
2705
|
-
}) : /*#__PURE__*/React__default["default"].createElement("p", {
|
|
3589
|
+
}, item.name);
|
|
3590
|
+
}))) : innerOptions.length <= 0 ? /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2706
3591
|
style: {
|
|
3592
|
+
margin: '0px',
|
|
2707
3593
|
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
2708
3594
|
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
2709
3595
|
height: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
2710
3596
|
padding: contentBottomRowPadding ? contentBottomRowPadding : configStyles.NEWAUTOCOMPLETE.contentBottomRowPadding,
|
|
2711
|
-
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight
|
|
3597
|
+
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
3598
|
+
backgroundColor: contentBottomBackgroundColor ? contentBottomBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomBackgroundColor
|
|
2712
3599
|
}
|
|
2713
|
-
},
|
|
2714
|
-
style: {
|
|
2715
|
-
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
2716
|
-
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
2717
|
-
height: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight,
|
|
2718
|
-
padding: contentBottomRowPadding ? contentBottomRowPadding : configStyles.NEWAUTOCOMPLETE.contentBottomRowPadding,
|
|
2719
|
-
lineHeight: contentBottomRowHeight ? contentBottomRowHeight : configStyles.NEWAUTOCOMPLETE.contentBottomRowHeight
|
|
2720
|
-
}
|
|
2721
|
-
}, innerValue.length < searchCount && `Լրացնել առնվազն ${searchCount} նիշ`))));
|
|
3600
|
+
}, innerValue.length >= searchCount ? 'Նման տվյալ առկա չէ' : `Լրացնել առնվազն ${searchCount} նիշ`) : '' : '');
|
|
2722
3601
|
React.useEffect(() => {
|
|
2723
|
-
if (
|
|
2724
|
-
alert('Please add
|
|
2725
|
-
}
|
|
2726
|
-
if (options.length === 0) {
|
|
2727
|
-
alert('Please fill options array');
|
|
3602
|
+
if (options === undefined) {
|
|
3603
|
+
alert('Please add options prop');
|
|
2728
3604
|
}
|
|
2729
3605
|
options && options.length > 0 && options.map(item => {
|
|
2730
|
-
if (!item.hasOwnProperty('
|
|
2731
|
-
alert('Please add
|
|
3606
|
+
if (!item.hasOwnProperty('name')) {
|
|
3607
|
+
alert('Please add name property in items of options array');
|
|
2732
3608
|
}
|
|
2733
3609
|
});
|
|
2734
3610
|
if (!getItem) {
|
|
2735
3611
|
alert('Please add getItem function for get choosen item from autocomplete');
|
|
2736
3612
|
}
|
|
2737
|
-
|
|
3613
|
+
options && setInnerOptions(options);
|
|
3614
|
+
}, [options, options.length, getItem]);
|
|
3615
|
+
React.useEffect(() => {
|
|
3616
|
+
if (!change) {
|
|
3617
|
+
alert('Please add change prop on New Autocomplete component');
|
|
3618
|
+
}
|
|
3619
|
+
}, [change]);
|
|
2738
3620
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2739
3621
|
style: {
|
|
2740
3622
|
color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
|
|
@@ -2742,6 +3624,7 @@ const NewAutocomplete = ({
|
|
|
2742
3624
|
display: labelDisplay ? labelDisplay : configStyles.NEWAUTOCOMPLETE.labelDisplay,
|
|
2743
3625
|
fontWeight: labelWeight ? labelWeight : configStyles.NEWAUTOCOMPLETE.labelWeight,
|
|
2744
3626
|
lineHeight: labelLineHeight ? labelLineHeight : configStyles.NEWAUTOCOMPLETE.labelLineHeight,
|
|
3627
|
+
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth,
|
|
2745
3628
|
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.NEWAUTOCOMPLETE.labelMarginBottom,
|
|
2746
3629
|
textTransform: labelTextTransform ? labelTextTransform : configStyles.NEWAUTOCOMPLETE.labelTextTransform
|
|
2747
3630
|
}
|
|
@@ -2753,7 +3636,8 @@ const NewAutocomplete = ({
|
|
|
2753
3636
|
style: {
|
|
2754
3637
|
display: contentDisplay ? contentDisplay : configStyles.NEWAUTOCOMPLETE.contentDisplay,
|
|
2755
3638
|
position: contentPosition ? contentPosition : configStyles.NEWAUTOCOMPLETE.contentPosition,
|
|
2756
|
-
flexDirection: contentDirection ? contentDirection : configStyles.NEWAUTOCOMPLETE.contentDirection
|
|
3639
|
+
flexDirection: contentDirection ? contentDirection : configStyles.NEWAUTOCOMPLETE.contentDirection,
|
|
3640
|
+
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth
|
|
2757
3641
|
}
|
|
2758
3642
|
}, /*#__PURE__*/React__default["default"].createElement("input", _extends({
|
|
2759
3643
|
type: "text",
|
|
@@ -2762,11 +3646,12 @@ const NewAutocomplete = ({
|
|
|
2762
3646
|
onBlur: handleBlur,
|
|
2763
3647
|
onFocus: handleFocus,
|
|
2764
3648
|
onInput: handleChange,
|
|
2765
|
-
placeholder: placeHolder ? placeHolder : '',
|
|
2766
|
-
autoComplete: autoComplete ? autoComplete : configStyles.NEWAUTOCOMPLETE.autoComplete,
|
|
2767
3649
|
onMouseEnter: handleMouseEnter,
|
|
2768
3650
|
onMouseLeave: handleMouseLeave,
|
|
3651
|
+
placeholder: placeHolder ? placeHolder : '',
|
|
3652
|
+
autoComplete: autoComplete ? autoComplete : configStyles.NEWAUTOCOMPLETE.autoComplete,
|
|
2769
3653
|
style: {
|
|
3654
|
+
maxWidth: '100%',
|
|
2770
3655
|
transition: 'all 240ms',
|
|
2771
3656
|
cursor: disabled ? 'not-allowed' : 'auto',
|
|
2772
3657
|
color: contentTopColor ? contentTopColor : configStyles.NEWAUTOCOMPLETE.contentTopColor,
|
|
@@ -2777,7 +3662,6 @@ const NewAutocomplete = ({
|
|
|
2777
3662
|
display: contentTopDisplay ? contentTopDisplay : configStyles.NEWAUTOCOMPLETE.contentTopDisplay,
|
|
2778
3663
|
fontWeight: contentTopWeight ? contentTopWeight : configStyles.NEWAUTOCOMPLETE.contentTopWeight,
|
|
2779
3664
|
borderRadius: contentTopRadius ? contentTopRadius : configStyles.NEWAUTOCOMPLETE.contentTopRadius,
|
|
2780
|
-
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth,
|
|
2781
3665
|
boxSizing: contentTopBoxSizing ? contentTopBoxSizing : configStyles.NEWAUTOCOMPLETE.contentTopBoxSizing,
|
|
2782
3666
|
lineHeight: contentTopLineHeight ? contentTopLineHeight : configStyles.NEWAUTOCOMPLETE.contentTopLineHeight,
|
|
2783
3667
|
flexDirection: contentTopDirection ? contentTopDirection : configStyles.NEWAUTOCOMPLETE.contentTopDirection,
|
|
@@ -2785,8 +3669,11 @@ const NewAutocomplete = ({
|
|
|
2785
3669
|
}
|
|
2786
3670
|
}, props)), errorMessage ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2787
3671
|
style: {
|
|
3672
|
+
margin: '0px',
|
|
3673
|
+
display: 'inline-block',
|
|
2788
3674
|
color: errorColor ? errorColor : configStyles.NEWAUTOCOMPLETE.errorColor,
|
|
2789
|
-
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize
|
|
3675
|
+
fontSize: errorSize ? errorSize : configStyles.NEWAUTOCOMPLETE.errorSize,
|
|
3676
|
+
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth
|
|
2790
3677
|
}
|
|
2791
3678
|
}, errorMessage) : '', optionList));
|
|
2792
3679
|
};
|
|
@@ -2809,6 +3696,7 @@ NewAutocomplete.propTypes = {
|
|
|
2809
3696
|
contentPosition: PropTypes__default["default"].string,
|
|
2810
3697
|
labelLineHeight: PropTypes__default["default"].string,
|
|
2811
3698
|
contentTopColor: PropTypes__default["default"].string,
|
|
3699
|
+
change: PropTypes__default["default"].func.isRequired,
|
|
2812
3700
|
contentDirection: PropTypes__default["default"].string,
|
|
2813
3701
|
contentTopWeight: PropTypes__default["default"].number,
|
|
2814
3702
|
contentTopRadius: PropTypes__default["default"].string,
|
|
@@ -2874,6 +3762,7 @@ exports.Input = Input;
|
|
|
2874
3762
|
exports.InputTypes = InputTypes;
|
|
2875
3763
|
exports.Modal = Modal;
|
|
2876
3764
|
exports.NewAutocomplete = NewAutocomplete;
|
|
3765
|
+
exports.NewFile = NewFile;
|
|
2877
3766
|
exports.Pagination = Pagination;
|
|
2878
3767
|
exports.Radio = Radio;
|
|
2879
3768
|
exports.Select = Select;
|