@xaypay/tui 0.0.70 → 0.0.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +685 -85
- package/dist/index.js +685 -84
- package/package.json +3 -2
- 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/ListItemJpg.js +21 -0
- package/src/components/icon/ListItemPdf.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 +1 -15
- package/src/components/input/index.js +36 -31
- package/src/components/newFile/index.js +463 -0
- package/src/components/newFile/newFile.stories.js +41 -0
- package/src/components/pagination/index.js +5 -5
- package/src/components/textarea/index.js +63 -27
- package/src/components/textarea/textarea.stories.js +3 -3
- package/src/components/toaster/Toast.js +1 -1
- package/src/components/tooltip/index.js +2 -2
- package/src/index.js +1 -0
- package/src/stories/configuration.stories.mdx +1 -0
- package/tui.config.js +23 -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/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,
|
|
@@ -657,7 +656,7 @@ const Input = ({
|
|
|
657
656
|
errorAnimationDuration,
|
|
658
657
|
...props
|
|
659
658
|
}) => {
|
|
660
|
-
const phoneNumberRegex = /^\d
|
|
659
|
+
const phoneNumberRegex = /^\d+$/;
|
|
661
660
|
const [show, setShow] = React.useState(false);
|
|
662
661
|
const [isHover, setIsHover] = React.useState(false);
|
|
663
662
|
const [innerValue, setInnerValue] = React.useState('');
|
|
@@ -685,28 +684,34 @@ const Input = ({
|
|
|
685
684
|
const currentValue = event.target.value;
|
|
686
685
|
setInnerValue(currentValue);
|
|
687
686
|
if (type === 'tel') {
|
|
688
|
-
if (currentValue
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
if (!phoneNumberRegex.test(currentValue) && telErrorMessage) {
|
|
692
|
-
setInnerErrorMessage(telErrorMessage);
|
|
687
|
+
if (!phoneNumberRegex.test(currentValue)) {
|
|
688
|
+
telErrorMessage && setInnerErrorMessage(telErrorMessage);
|
|
689
|
+
setInnerValue('');
|
|
693
690
|
} else {
|
|
694
691
|
setInnerErrorMessage('');
|
|
692
|
+
if (currentValue.length > 8) {
|
|
693
|
+
setInnerValue(currentValue.substr(0, 8));
|
|
694
|
+
if (onChange) {
|
|
695
|
+
onChange(currentValue.substr(0, 8));
|
|
696
|
+
}
|
|
697
|
+
} else {
|
|
698
|
+
setInnerValue(currentValue);
|
|
699
|
+
if (onChange) {
|
|
700
|
+
onChange(currentValue);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
695
703
|
}
|
|
696
704
|
}
|
|
697
705
|
if (maxLength && currentValue.length > maxLength && type !== 'tel') {
|
|
698
706
|
setInnerValue(currentValue.substr(0, maxLength));
|
|
707
|
+
if (onChange) {
|
|
708
|
+
onChange(currentValue.substr(0, maxLength));
|
|
709
|
+
}
|
|
699
710
|
}
|
|
700
711
|
if (regexp && regexpErrorMessage && !maxLength && type !== 'tel') {
|
|
701
712
|
!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));
|
|
713
|
+
if (onChange) {
|
|
714
|
+
onChange(currentValue);
|
|
710
715
|
}
|
|
711
716
|
}
|
|
712
717
|
};
|
|
@@ -717,16 +722,24 @@ const Input = ({
|
|
|
717
722
|
setIsHover(false);
|
|
718
723
|
};
|
|
719
724
|
React.useEffect(() => {
|
|
725
|
+
if (errorMessage) {
|
|
726
|
+
setInnerErrorMessage(errorMessage);
|
|
727
|
+
} else {
|
|
728
|
+
setInnerErrorMessage('');
|
|
729
|
+
}
|
|
720
730
|
if (value !== undefined && value !== null) {
|
|
721
731
|
setInnerValue(value);
|
|
722
732
|
if (type === 'tel') {
|
|
723
|
-
if (
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
if (!phoneNumberRegex.test(value) && telErrorMessage) {
|
|
727
|
-
setInnerErrorMessage(telErrorMessage);
|
|
733
|
+
if (!phoneNumberRegex.test(currentValue)) {
|
|
734
|
+
telErrorMessage && setInnerErrorMessage(telErrorMessage);
|
|
735
|
+
setInnerValue('');
|
|
728
736
|
} else {
|
|
729
737
|
setInnerErrorMessage('');
|
|
738
|
+
if (value.length > 8) {
|
|
739
|
+
setInnerValue(value.substr(0, 8));
|
|
740
|
+
} else {
|
|
741
|
+
setInnerValue(value);
|
|
742
|
+
}
|
|
730
743
|
}
|
|
731
744
|
}
|
|
732
745
|
if (maxLength && value.length > maxLength && type !== 'tel') {
|
|
@@ -736,11 +749,6 @@ const Input = ({
|
|
|
736
749
|
!regexp.test(value) ? setInnerErrorMessage(regexpErrorMessage) : setInnerErrorMessage('');
|
|
737
750
|
}
|
|
738
751
|
}
|
|
739
|
-
if (errorMessage) {
|
|
740
|
-
setInnerErrorMessage(errorMessage);
|
|
741
|
-
} else {
|
|
742
|
-
setInnerErrorMessage('');
|
|
743
|
-
}
|
|
744
752
|
}, [type, value, regexp, maxLength, errorMessage, regexpErrorMessage]);
|
|
745
753
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
746
754
|
className: `${styles$8["input-wrap"]}`
|
|
@@ -1054,8 +1062,8 @@ const SvgCheckboxUnchecked = ({
|
|
|
1054
1062
|
titleId,
|
|
1055
1063
|
...props
|
|
1056
1064
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1057
|
-
width: "
|
|
1058
|
-
height: "
|
|
1065
|
+
width: "16",
|
|
1066
|
+
height: "16",
|
|
1059
1067
|
viewBox: "0 0 16 16",
|
|
1060
1068
|
fill: "none",
|
|
1061
1069
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1074,8 +1082,8 @@ const SvgCheckboxChecked = ({
|
|
|
1074
1082
|
titleId,
|
|
1075
1083
|
...props
|
|
1076
1084
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1077
|
-
width: "
|
|
1078
|
-
height: "
|
|
1085
|
+
width: "16",
|
|
1086
|
+
height: "16",
|
|
1079
1087
|
viewBox: "0 0 16 16",
|
|
1080
1088
|
fill: "none",
|
|
1081
1089
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1107,8 +1115,8 @@ const SvgArrow = ({
|
|
|
1107
1115
|
titleId,
|
|
1108
1116
|
...props
|
|
1109
1117
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1110
|
-
width: "
|
|
1111
|
-
height: "
|
|
1118
|
+
width: "15",
|
|
1119
|
+
height: "9",
|
|
1112
1120
|
viewBox: "0 0 15 9",
|
|
1113
1121
|
fill: "none",
|
|
1114
1122
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1125,8 +1133,8 @@ const SvgCloseIcon = ({
|
|
|
1125
1133
|
titleId,
|
|
1126
1134
|
...props
|
|
1127
1135
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1128
|
-
width: "
|
|
1129
|
-
height: "
|
|
1136
|
+
width: "14",
|
|
1137
|
+
height: "14",
|
|
1130
1138
|
viewBox: "0 0 14 14",
|
|
1131
1139
|
fill: "none",
|
|
1132
1140
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1459,8 +1467,8 @@ const SvgToasterInfo = ({
|
|
|
1459
1467
|
titleId,
|
|
1460
1468
|
...props
|
|
1461
1469
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1462
|
-
width: "
|
|
1463
|
-
height: "
|
|
1470
|
+
width: "24",
|
|
1471
|
+
height: "24",
|
|
1464
1472
|
viewBox: "0 0 24 24",
|
|
1465
1473
|
fill: "none",
|
|
1466
1474
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1477,8 +1485,8 @@ const SvgToasterError = ({
|
|
|
1477
1485
|
titleId,
|
|
1478
1486
|
...props
|
|
1479
1487
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1480
|
-
width: "
|
|
1481
|
-
height: "
|
|
1488
|
+
width: "24",
|
|
1489
|
+
height: "24",
|
|
1482
1490
|
viewBox: "0 0 24 24",
|
|
1483
1491
|
fill: "none",
|
|
1484
1492
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1495,8 +1503,8 @@ const SvgToasterClose = ({
|
|
|
1495
1503
|
titleId,
|
|
1496
1504
|
...props
|
|
1497
1505
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1498
|
-
width: "
|
|
1499
|
-
height: "
|
|
1506
|
+
width: "18",
|
|
1507
|
+
height: "18",
|
|
1500
1508
|
viewBox: "0 0 18 18",
|
|
1501
1509
|
fill: "none",
|
|
1502
1510
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1513,8 +1521,8 @@ const SvgToasterWarning = ({
|
|
|
1513
1521
|
titleId,
|
|
1514
1522
|
...props
|
|
1515
1523
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1516
|
-
width: "
|
|
1517
|
-
height: "
|
|
1524
|
+
width: "24",
|
|
1525
|
+
height: "24",
|
|
1518
1526
|
viewBox: "0 0 24 21",
|
|
1519
1527
|
fill: "none",
|
|
1520
1528
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1531,8 +1539,8 @@ const SvgToasterSuccess = ({
|
|
|
1531
1539
|
titleId,
|
|
1532
1540
|
...props
|
|
1533
1541
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1534
|
-
width: "
|
|
1535
|
-
height: "
|
|
1542
|
+
width: "24",
|
|
1543
|
+
height: "24",
|
|
1536
1544
|
viewBox: "0 0 24 24",
|
|
1537
1545
|
fill: "none",
|
|
1538
1546
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1631,12 +1639,12 @@ const Toast = ({
|
|
|
1631
1639
|
}
|
|
1632
1640
|
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
1633
1641
|
style: {
|
|
1642
|
+
margin: '0px',
|
|
1634
1643
|
fontWeight: 600,
|
|
1635
1644
|
color: '#3C393E',
|
|
1636
1645
|
fontSize: '16px',
|
|
1637
1646
|
lineHeight: '22px',
|
|
1638
|
-
fontStyle: 'normal'
|
|
1639
|
-
fontFamily: ''
|
|
1647
|
+
fontStyle: 'normal'
|
|
1640
1648
|
}
|
|
1641
1649
|
}, title ? title.length > 25 ? title.substr(0, 25) + '...' : title : ''), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1642
1650
|
style: {
|
|
@@ -1800,7 +1808,23 @@ const Toaster = () => {
|
|
|
1800
1808
|
});
|
|
1801
1809
|
};
|
|
1802
1810
|
|
|
1803
|
-
|
|
1811
|
+
const SvgTooltip = ({
|
|
1812
|
+
title,
|
|
1813
|
+
titleId,
|
|
1814
|
+
...props
|
|
1815
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
1816
|
+
width: "16",
|
|
1817
|
+
height: "16",
|
|
1818
|
+
viewBox: "0 0 16 16",
|
|
1819
|
+
fill: "none",
|
|
1820
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1821
|
+
"aria-labelledby": titleId
|
|
1822
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
1823
|
+
id: titleId
|
|
1824
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
1825
|
+
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",
|
|
1826
|
+
fill: "#D1D1D1"
|
|
1827
|
+
}));
|
|
1804
1828
|
|
|
1805
1829
|
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
1830
|
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 +1900,7 @@ const Tooltip = ({
|
|
|
1876
1900
|
cursor: 'pointer'
|
|
1877
1901
|
},
|
|
1878
1902
|
onClick: handleShow
|
|
1879
|
-
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/React__default["default"].createElement(
|
|
1880
|
-
src: ReactInfoIcon
|
|
1881
|
-
})));
|
|
1903
|
+
}, tooltipIcon ? tooltipIcon : /*#__PURE__*/React__default["default"].createElement(SvgTooltip, null)));
|
|
1882
1904
|
};
|
|
1883
1905
|
Tooltip.propTypes = {
|
|
1884
1906
|
type: PropTypes__default["default"].string,
|
|
@@ -1936,7 +1958,7 @@ const SvgCaptchaArrowDown = ({
|
|
|
1936
1958
|
fill: "#00236A"
|
|
1937
1959
|
}));
|
|
1938
1960
|
|
|
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/
|
|
1961
|
+
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
1962
|
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
1963
|
styleInject(css_248z$4);
|
|
1942
1964
|
|
|
@@ -1962,12 +1984,13 @@ const Captcha = ({
|
|
|
1962
1984
|
if (!getRange) {
|
|
1963
1985
|
alert('Please add getRange property on Captcha component');
|
|
1964
1986
|
}
|
|
1965
|
-
if (range
|
|
1987
|
+
if (range >= 100) {
|
|
1966
1988
|
setRangeNumber(100);
|
|
1967
|
-
} else if (range
|
|
1989
|
+
} else if (range <= 0) {
|
|
1968
1990
|
setRangeNumber(0);
|
|
1969
1991
|
} else {
|
|
1970
|
-
|
|
1992
|
+
const roundedRange = Math.ceil(range / 5) * 5;
|
|
1993
|
+
setRangeNumber(Math.min(roundedRange, 100));
|
|
1971
1994
|
}
|
|
1972
1995
|
}, [range, getRange]);
|
|
1973
1996
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
@@ -2015,6 +2038,7 @@ const Captcha = ({
|
|
|
2015
2038
|
}
|
|
2016
2039
|
}), /*#__PURE__*/React__default["default"].createElement("input", {
|
|
2017
2040
|
min: 0,
|
|
2041
|
+
step: 5,
|
|
2018
2042
|
max: 100,
|
|
2019
2043
|
type: "range",
|
|
2020
2044
|
value: rangeProgress,
|
|
@@ -2027,7 +2051,7 @@ const Captcha = ({
|
|
|
2027
2051
|
},
|
|
2028
2052
|
className: `
|
|
2029
2053
|
${styles$3['range']}
|
|
2030
|
-
${rangeProgress
|
|
2054
|
+
${+rangeProgress === rangeNumber ? styles$3['range-success'] : +rangeProgress !== rangeNumber && +rangeProgress > 0 ? styles$3['range-error'] : styles$3['range-default']}
|
|
2031
2055
|
`,
|
|
2032
2056
|
onInput: handleRange
|
|
2033
2057
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -2038,7 +2062,7 @@ const Captcha = ({
|
|
|
2038
2062
|
width: rangeProgress + '%',
|
|
2039
2063
|
height: '4px',
|
|
2040
2064
|
borderRadius: '2px',
|
|
2041
|
-
backgroundColor: rangeProgress
|
|
2065
|
+
backgroundColor: +rangeProgress === rangeNumber ? '#0DA574' : +rangeProgress !== rangeNumber && +rangeProgress > 0 ? '#EE0000' : 'transparent',
|
|
2042
2066
|
borderRadius: '2px',
|
|
2043
2067
|
zIndex: -1
|
|
2044
2068
|
}
|
|
@@ -2047,7 +2071,8 @@ const Captcha = ({
|
|
|
2047
2071
|
position: 'absolute',
|
|
2048
2072
|
bottom: '0px',
|
|
2049
2073
|
height: '15px',
|
|
2050
|
-
left: `calc(${rangeNumber}% - 6px)
|
|
2074
|
+
left: `calc(${rangeNumber}% - 6px)`,
|
|
2075
|
+
transform: 'translate(-50% -50%)'
|
|
2051
2076
|
}
|
|
2052
2077
|
}, /*#__PURE__*/React__default["default"].createElement(SvgCaptchaArrowUp, null))));
|
|
2053
2078
|
};
|
|
@@ -2090,6 +2115,549 @@ Stepper.propTypes = {
|
|
|
2090
2115
|
activeSteps: PropTypes__default["default"].number
|
|
2091
2116
|
};
|
|
2092
2117
|
|
|
2118
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
2119
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
2120
|
+
// generators (like Math.random()).
|
|
2121
|
+
var getRandomValues;
|
|
2122
|
+
var rnds8 = new Uint8Array(16);
|
|
2123
|
+
function rng() {
|
|
2124
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
2125
|
+
if (!getRandomValues) {
|
|
2126
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
2127
|
+
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
2128
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
2129
|
+
|
|
2130
|
+
if (!getRandomValues) {
|
|
2131
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
2132
|
+
}
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
return getRandomValues(rnds8);
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
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;
|
|
2139
|
+
|
|
2140
|
+
function validate(uuid) {
|
|
2141
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
/**
|
|
2145
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
2146
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
2147
|
+
*/
|
|
2148
|
+
|
|
2149
|
+
var byteToHex = [];
|
|
2150
|
+
|
|
2151
|
+
for (var i = 0; i < 256; ++i) {
|
|
2152
|
+
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
function stringify(arr) {
|
|
2156
|
+
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2157
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
2158
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
2159
|
+
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
|
|
2160
|
+
// of the following:
|
|
2161
|
+
// - One or more input array values don't map to a hex octet (leading to
|
|
2162
|
+
// "undefined" in the uuid)
|
|
2163
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
|
2164
|
+
|
|
2165
|
+
if (!validate(uuid)) {
|
|
2166
|
+
throw TypeError('Stringified UUID is invalid');
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
return uuid;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2172
|
+
function v4(options, buf, offset) {
|
|
2173
|
+
options = options || {};
|
|
2174
|
+
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
2175
|
+
|
|
2176
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
2177
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
2178
|
+
|
|
2179
|
+
if (buf) {
|
|
2180
|
+
offset = offset || 0;
|
|
2181
|
+
|
|
2182
|
+
for (var i = 0; i < 16; ++i) {
|
|
2183
|
+
buf[offset + i] = rnds[i];
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2186
|
+
return buf;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
return stringify(rnds);
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
const SvgUpload = ({
|
|
2193
|
+
title,
|
|
2194
|
+
titleId,
|
|
2195
|
+
...props
|
|
2196
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2197
|
+
width: "51",
|
|
2198
|
+
height: "35",
|
|
2199
|
+
viewBox: "0 0 51 35",
|
|
2200
|
+
fill: "none",
|
|
2201
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2202
|
+
"aria-labelledby": titleId
|
|
2203
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2204
|
+
id: titleId
|
|
2205
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2206
|
+
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",
|
|
2207
|
+
fill: "#D1D1D1"
|
|
2208
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2209
|
+
fillRule: "evenodd",
|
|
2210
|
+
clipRule: "evenodd",
|
|
2211
|
+
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",
|
|
2212
|
+
fill: "#0DA574"
|
|
2213
|
+
}));
|
|
2214
|
+
|
|
2215
|
+
const SvgRemoveFile = ({
|
|
2216
|
+
title,
|
|
2217
|
+
titleId,
|
|
2218
|
+
...props
|
|
2219
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2220
|
+
width: "26",
|
|
2221
|
+
height: "26",
|
|
2222
|
+
viewBox: "0 0 26 26",
|
|
2223
|
+
fill: "none",
|
|
2224
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2225
|
+
"aria-labelledby": titleId
|
|
2226
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2227
|
+
id: titleId
|
|
2228
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2229
|
+
width: 26,
|
|
2230
|
+
height: 26,
|
|
2231
|
+
rx: 6,
|
|
2232
|
+
fill: "#FBFBFB"
|
|
2233
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2234
|
+
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",
|
|
2235
|
+
fill: "#00236A"
|
|
2236
|
+
}));
|
|
2237
|
+
|
|
2238
|
+
const SvgListItemPdf = ({
|
|
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.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",
|
|
2255
|
+
fill: "#051942"
|
|
2256
|
+
}));
|
|
2257
|
+
|
|
2258
|
+
const SvgListItemJpg = ({
|
|
2259
|
+
title,
|
|
2260
|
+
titleId,
|
|
2261
|
+
...props
|
|
2262
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2263
|
+
width: "32",
|
|
2264
|
+
height: "42",
|
|
2265
|
+
viewBox: "0 0 32 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: "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",
|
|
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 SvgDeleteComponent = ({
|
|
2297
|
+
title,
|
|
2298
|
+
titleId,
|
|
2299
|
+
...props
|
|
2300
|
+
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2301
|
+
width: "26",
|
|
2302
|
+
height: "26",
|
|
2303
|
+
viewBox: "0 0 26 26",
|
|
2304
|
+
fill: "none",
|
|
2305
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2306
|
+
"aria-labelledby": titleId
|
|
2307
|
+
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2308
|
+
id: titleId
|
|
2309
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("rect", {
|
|
2310
|
+
x: 0.5,
|
|
2311
|
+
y: 0.5,
|
|
2312
|
+
width: 25,
|
|
2313
|
+
height: 25,
|
|
2314
|
+
rx: 5.5,
|
|
2315
|
+
stroke: "#D1D1D1"
|
|
2316
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
2317
|
+
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",
|
|
2318
|
+
fill: "#E00"
|
|
2319
|
+
}));
|
|
2320
|
+
|
|
2321
|
+
const NewFile = ({
|
|
2322
|
+
size,
|
|
2323
|
+
name,
|
|
2324
|
+
color,
|
|
2325
|
+
label,
|
|
2326
|
+
width,
|
|
2327
|
+
weight,
|
|
2328
|
+
height,
|
|
2329
|
+
radius,
|
|
2330
|
+
change,
|
|
2331
|
+
border,
|
|
2332
|
+
maxSize,
|
|
2333
|
+
disabled,
|
|
2334
|
+
multiple,
|
|
2335
|
+
required,
|
|
2336
|
+
errorSize,
|
|
2337
|
+
labelSize,
|
|
2338
|
+
labelColor,
|
|
2339
|
+
errorColor,
|
|
2340
|
+
filesArray,
|
|
2341
|
+
borderColor,
|
|
2342
|
+
uploadColor,
|
|
2343
|
+
defaultData,
|
|
2344
|
+
errorMessage,
|
|
2345
|
+
fileExtensions,
|
|
2346
|
+
backgroundColor,
|
|
2347
|
+
deleteComponent,
|
|
2348
|
+
borderHoverColor,
|
|
2349
|
+
progressTrackColor,
|
|
2350
|
+
labelRequiredColor,
|
|
2351
|
+
hiddenBackgroundColor,
|
|
2352
|
+
extentionsRowMarginTop,
|
|
2353
|
+
listItemBackgroundColor
|
|
2354
|
+
}) => {
|
|
2355
|
+
const ref = React.useRef(null);
|
|
2356
|
+
const inpRef = React.useRef(null);
|
|
2357
|
+
const [error, setError] = React.useState('');
|
|
2358
|
+
const [image, setImage] = React.useState('');
|
|
2359
|
+
const [progress, setProgress] = React.useState(5);
|
|
2360
|
+
const [isHover, setIsHover] = React.useState(false);
|
|
2361
|
+
const [multipleFiles, setMultipleFiles] = React.useState([]);
|
|
2362
|
+
const configStyles = compereConfigs();
|
|
2363
|
+
const handleRemoveComponent = () => {
|
|
2364
|
+
const node = ReactDOM__default["default"].findDOMNode(ref.current);
|
|
2365
|
+
const parent = node.parentNode;
|
|
2366
|
+
parent.removeChild(node);
|
|
2367
|
+
};
|
|
2368
|
+
const handleRemoveFile = () => {
|
|
2369
|
+
if (!multiple) {
|
|
2370
|
+
setImage('');
|
|
2371
|
+
onChange(null);
|
|
2372
|
+
}
|
|
2373
|
+
};
|
|
2374
|
+
const handleChange = e => {
|
|
2375
|
+
const file = e.target.files;
|
|
2376
|
+
if (file[0]) {
|
|
2377
|
+
if (file[0].size <= maxSize * Math.pow(2, 20)) {
|
|
2378
|
+
if (fileExtensions.includes(file[0].type.split('/')[1])) {
|
|
2379
|
+
setError('');
|
|
2380
|
+
if (multiple) {
|
|
2381
|
+
change({
|
|
2382
|
+
uuid: v4(),
|
|
2383
|
+
file: file[0]
|
|
2384
|
+
});
|
|
2385
|
+
} else {
|
|
2386
|
+
change({
|
|
2387
|
+
file
|
|
2388
|
+
});
|
|
2389
|
+
if (file[0].type === 'application/pdf') {
|
|
2390
|
+
setImage('pdf');
|
|
2391
|
+
} else {
|
|
2392
|
+
setImage(URL.createObjectURL(file[0]));
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
} else {
|
|
2396
|
+
setImage('');
|
|
2397
|
+
setError('ֆայլի սխալ ֆորմատ');
|
|
2398
|
+
}
|
|
2399
|
+
} else {
|
|
2400
|
+
setImage('');
|
|
2401
|
+
setError('առավելագույն ծավալ');
|
|
2402
|
+
}
|
|
2403
|
+
} else {
|
|
2404
|
+
// TODO:
|
|
2405
|
+
if (!multiple || multiple && filesArray && filesArray.length === 0) {
|
|
2406
|
+
setImage('');
|
|
2407
|
+
setError('Ֆայլը ընտրված չէ');
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
};
|
|
2411
|
+
const handleClick = () => {
|
|
2412
|
+
if (!image) {
|
|
2413
|
+
inpRef.current.click();
|
|
2414
|
+
}
|
|
2415
|
+
};
|
|
2416
|
+
const handleMouseEnter = () => {
|
|
2417
|
+
setIsHover(true);
|
|
2418
|
+
};
|
|
2419
|
+
const handleMouseLeave = () => {
|
|
2420
|
+
setIsHover(false);
|
|
2421
|
+
};
|
|
2422
|
+
const handleStopPropagation = e => {
|
|
2423
|
+
e.stopPropagation();
|
|
2424
|
+
};
|
|
2425
|
+
React.useEffect(() => {
|
|
2426
|
+
if (!multiple && defaultData) {
|
|
2427
|
+
if (defaultData.type && defaultData.type !== 'application/pdf') {
|
|
2428
|
+
setImage(defaultData.url);
|
|
2429
|
+
} else {
|
|
2430
|
+
setImage('pdf');
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
if (multiple && !filesArray) {
|
|
2434
|
+
alert('In multiple mode, you should add filesArray prop for drawing files');
|
|
2435
|
+
}
|
|
2436
|
+
if (filesArray) {
|
|
2437
|
+
setMultipleFiles(filesArray);
|
|
2438
|
+
}
|
|
2439
|
+
}, [multiple, filesArray && filesArray.length, defaultData]);
|
|
2440
|
+
React.useEffect(() => {
|
|
2441
|
+
if (errorMessage) {
|
|
2442
|
+
setError(errorMessage);
|
|
2443
|
+
} else {
|
|
2444
|
+
setError('');
|
|
2445
|
+
}
|
|
2446
|
+
}, [errorMessage]);
|
|
2447
|
+
React.useEffect(() => {
|
|
2448
|
+
if (!change) {
|
|
2449
|
+
alert('Please add change prop on File component');
|
|
2450
|
+
}
|
|
2451
|
+
}, [change]);
|
|
2452
|
+
console.log(multipleFiles, 'multipleFiles');
|
|
2453
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2454
|
+
ref: ref,
|
|
2455
|
+
style: {
|
|
2456
|
+
width: width ? width : configStyles.File.width
|
|
2457
|
+
}
|
|
2458
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2459
|
+
style: {
|
|
2460
|
+
display: 'flex',
|
|
2461
|
+
marginBottom: '6px',
|
|
2462
|
+
alignItems: 'center',
|
|
2463
|
+
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2464
|
+
}
|
|
2465
|
+
}, label && /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2466
|
+
style: {
|
|
2467
|
+
color: labelColor ? labelColor : configStyles.File.labelColor,
|
|
2468
|
+
fontSize: labelSize ? labelSize : configStyles.File.labelSize
|
|
2469
|
+
}
|
|
2470
|
+
}, label, required && /*#__PURE__*/React__default["default"].createElement("sup", {
|
|
2471
|
+
style: {
|
|
2472
|
+
color: labelRequiredColor ? labelRequiredColor : configStyles.File.labelRequiredColor
|
|
2473
|
+
}
|
|
2474
|
+
}, "*")), deleteComponent && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2475
|
+
style: {
|
|
2476
|
+
cursor: 'pointer'
|
|
2477
|
+
},
|
|
2478
|
+
onClick: handleRemoveComponent
|
|
2479
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgDeleteComponent, null))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2480
|
+
style: {
|
|
2481
|
+
width: '100%',
|
|
2482
|
+
display: 'flex',
|
|
2483
|
+
alignItems: 'center',
|
|
2484
|
+
position: 'relative',
|
|
2485
|
+
boxSizing: 'border-box',
|
|
2486
|
+
justifyContent: 'center',
|
|
2487
|
+
cursor: !disabled ? 'pointer' : 'not-allowed',
|
|
2488
|
+
height: height ? height : configStyles.File.height,
|
|
2489
|
+
border: border ? border : configStyles.File.border,
|
|
2490
|
+
borderRadius: radius ? radius : configStyles.File.radius,
|
|
2491
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.File.backgroundColor,
|
|
2492
|
+
borderColor: error ? errorColor ? errorColor : configStyles.File.errorColor : disabled ? borderColor ? borderColor : configStyles.File.borderColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.File.borderHoverColor : borderColor ? borderColor : configStyles.File.borderColor
|
|
2493
|
+
},
|
|
2494
|
+
onClick: handleClick,
|
|
2495
|
+
onMouseEnter: handleMouseEnter,
|
|
2496
|
+
onMouseLeave: handleMouseLeave
|
|
2497
|
+
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
2498
|
+
hidden: true,
|
|
2499
|
+
name: name,
|
|
2500
|
+
type: "file",
|
|
2501
|
+
ref: inpRef,
|
|
2502
|
+
disabled: disabled,
|
|
2503
|
+
onChange: handleChange
|
|
2504
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2505
|
+
style: {
|
|
2506
|
+
width: '100%',
|
|
2507
|
+
height: '100%',
|
|
2508
|
+
display: 'flex',
|
|
2509
|
+
textAlign: 'center',
|
|
2510
|
+
alignItems: 'center',
|
|
2511
|
+
flexDirection: 'column',
|
|
2512
|
+
justifyContent: 'center',
|
|
2513
|
+
color: color ? color : configStyles.File.color,
|
|
2514
|
+
fontSize: size ? size : configStyles.File.size,
|
|
2515
|
+
fontWeight: weight ? weight : configStyles.File.weight
|
|
2516
|
+
}
|
|
2517
|
+
}, !multiple && image ? image === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(PDF, null) : /*#__PURE__*/React__default["default"].createElement("img", {
|
|
2518
|
+
src: image,
|
|
2519
|
+
style: {
|
|
2520
|
+
maxHeight: '100%'
|
|
2521
|
+
},
|
|
2522
|
+
alt: "file preview"
|
|
2523
|
+
}) : /*#__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", {
|
|
2524
|
+
style: {
|
|
2525
|
+
margin: '0px'
|
|
2526
|
+
}
|
|
2527
|
+
}, "\u054F\u0565\u0572\u0561\u0564\u0580\u0565\u056C \u0586\u0561\u0575\u056C\u0568 \u0561\u0575\u057D\u057F\u0565\u0572", /*#__PURE__*/React__default["default"].createElement("br", null), "\u056F\u0561\u0574 ", /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2528
|
+
style: {
|
|
2529
|
+
color: uploadColor ? uploadColor : configStyles.File.uploadColor
|
|
2530
|
+
}
|
|
2531
|
+
}, "\u0532\u0565\u057C\u0576\u0565\u056C"))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2532
|
+
style: {
|
|
2533
|
+
marginTop: extentionsRowMarginTop ? extentionsRowMarginTop : configStyles.File.extentionsRowMarginTop
|
|
2534
|
+
}
|
|
2535
|
+
}, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2536
|
+
style: {
|
|
2537
|
+
margin: '0px'
|
|
2538
|
+
}
|
|
2539
|
+
}, "\u0531\u057C\u0561\u057E\u0565\u056C\u0561\u0563\u0578\u0582\u0575\u0576\u0568 ", maxSize, "\u0544\u0532 ( ", fileExtensions.toString().split(',').join(', '), " )")))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2540
|
+
style: {
|
|
2541
|
+
position: 'absolute',
|
|
2542
|
+
top: '0px',
|
|
2543
|
+
left: '0px',
|
|
2544
|
+
zIndex: '1',
|
|
2545
|
+
width: '100%',
|
|
2546
|
+
height: '100%',
|
|
2547
|
+
padding: '10px',
|
|
2548
|
+
cursor: 'default',
|
|
2549
|
+
boxSizing: 'border-box',
|
|
2550
|
+
alignItems: 'flex-start',
|
|
2551
|
+
justifyContent: 'flex-end',
|
|
2552
|
+
borderRadius: radius ? radius : configStyles.File.radius,
|
|
2553
|
+
display: !multiple && !disabled && image && !error && isHover ? 'flex' : 'none',
|
|
2554
|
+
backgroundColor: hiddenBackgroundColor ? hiddenBackgroundColor : configStyles.File.hiddenBackgroundColor
|
|
2555
|
+
},
|
|
2556
|
+
onClick: handleStopPropagation
|
|
2557
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2558
|
+
style: {
|
|
2559
|
+
cursor: 'pointer'
|
|
2560
|
+
},
|
|
2561
|
+
onClick: handleRemoveFile
|
|
2562
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgRemoveFile, null)))), error ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2563
|
+
style: {
|
|
2564
|
+
marginTop: '6px',
|
|
2565
|
+
display: 'inline-block',
|
|
2566
|
+
color: errorColor ? errorColor : configStyles.File.errorColor,
|
|
2567
|
+
fontSize: errorSize ? errorSize : configStyles.File.errorSize
|
|
2568
|
+
}
|
|
2569
|
+
}, error) : '', multiple && multipleFiles && multipleFiles.length > 0 && multipleFiles.map((item, index) => {
|
|
2570
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2571
|
+
key: `${item.file.name}_${index}`,
|
|
2572
|
+
style: {
|
|
2573
|
+
display: 'flex',
|
|
2574
|
+
width: '100%',
|
|
2575
|
+
height: '70px',
|
|
2576
|
+
marginTop: '6px',
|
|
2577
|
+
alignItems: 'center',
|
|
2578
|
+
padding: '14px 20px',
|
|
2579
|
+
boxSizing: 'border-box',
|
|
2580
|
+
justifyContent: 'space-between',
|
|
2581
|
+
borderRadius: radius ? radius : configStyles.File.radius,
|
|
2582
|
+
backgroundColor: listItemBackgroundColor ? listItemBackgroundColor : configStyles.File.listItemBackgroundColor
|
|
2583
|
+
}
|
|
2584
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2585
|
+
style: {
|
|
2586
|
+
width: '32px'
|
|
2587
|
+
}
|
|
2588
|
+
}, item.file.type.split('/')[1].toLowerCase() === 'pdf' ? /*#__PURE__*/React__default["default"].createElement(SvgListItemPdf, null) : item.file.type.split('/')[1].toLowerCase() === 'jpeg' ? /*#__PURE__*/React__default["default"].createElement(SvgListItemJpg, null) : ''), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2589
|
+
style: {
|
|
2590
|
+
position: 'relative',
|
|
2591
|
+
display: 'flex',
|
|
2592
|
+
height: '40px',
|
|
2593
|
+
margin: '0px 14px',
|
|
2594
|
+
alignItems: 'flex-end',
|
|
2595
|
+
width: 'calc(100% - 82px)'
|
|
2596
|
+
}
|
|
2597
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("p", {
|
|
2598
|
+
className: "new"
|
|
2599
|
+
}, item.file.name)), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2600
|
+
style: {
|
|
2601
|
+
position: 'absolute',
|
|
2602
|
+
left: '0px',
|
|
2603
|
+
bottom: '5px',
|
|
2604
|
+
width: '100%',
|
|
2605
|
+
height: '4px',
|
|
2606
|
+
borderRadius: '10px',
|
|
2607
|
+
backgroundColor: progressTrackColor ? progressTrackColor : configStyles.File.progressTrackColor
|
|
2608
|
+
}
|
|
2609
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2610
|
+
style: {
|
|
2611
|
+
width: progress + '%',
|
|
2612
|
+
height: '100%',
|
|
2613
|
+
borderRadius: '10px',
|
|
2614
|
+
backgroundColor: 'green'
|
|
2615
|
+
}
|
|
2616
|
+
}))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2617
|
+
style: {
|
|
2618
|
+
width: '22px',
|
|
2619
|
+
cursor: 'pointer'
|
|
2620
|
+
}
|
|
2621
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgListItemDelete, null)));
|
|
2622
|
+
}));
|
|
2623
|
+
};
|
|
2624
|
+
NewFile.propTypes = {
|
|
2625
|
+
size: PropTypes__default["default"].string,
|
|
2626
|
+
label: PropTypes__default["default"].string,
|
|
2627
|
+
width: PropTypes__default["default"].string,
|
|
2628
|
+
color: PropTypes__default["default"].string,
|
|
2629
|
+
height: PropTypes__default["default"].string,
|
|
2630
|
+
disabled: PropTypes__default["default"].bool,
|
|
2631
|
+
radius: PropTypes__default["default"].string,
|
|
2632
|
+
border: PropTypes__default["default"].string,
|
|
2633
|
+
required: PropTypes__default["default"].bool,
|
|
2634
|
+
weight: PropTypes__default["default"].number,
|
|
2635
|
+
maxSize: PropTypes__default["default"].number,
|
|
2636
|
+
errorSize: PropTypes__default["default"].string,
|
|
2637
|
+
labelSize: PropTypes__default["default"].string,
|
|
2638
|
+
labelColor: PropTypes__default["default"].string,
|
|
2639
|
+
errorColor: PropTypes__default["default"].string,
|
|
2640
|
+
borderColor: PropTypes__default["default"].string,
|
|
2641
|
+
uploadColor: PropTypes__default["default"].string,
|
|
2642
|
+
defaultData: PropTypes__default["default"].object,
|
|
2643
|
+
errorMessage: PropTypes__default["default"].string,
|
|
2644
|
+
deleteComponent: PropTypes__default["default"].bool,
|
|
2645
|
+
backgroundColor: PropTypes__default["default"].string,
|
|
2646
|
+
change: PropTypes__default["default"].func.isRequired,
|
|
2647
|
+
borderHoverColor: PropTypes__default["default"].string,
|
|
2648
|
+
labelRequiredColor: PropTypes__default["default"].string,
|
|
2649
|
+
progressTrackColor: PropTypes__default["default"].string,
|
|
2650
|
+
hiddenBackgroundColor: PropTypes__default["default"].string,
|
|
2651
|
+
extentionsRowMarginTop: PropTypes__default["default"].string,
|
|
2652
|
+
listItemBackgroundColor: PropTypes__default["default"].string,
|
|
2653
|
+
filesArray: PropTypes__default["default"].arrayOf(PropTypes__default["default"].object),
|
|
2654
|
+
fileExtensions: PropTypes__default["default"].arrayOf(PropTypes__default["default"].string)
|
|
2655
|
+
};
|
|
2656
|
+
NewFile.defaultProps = {
|
|
2657
|
+
maxSize: 5,
|
|
2658
|
+
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
|
|
2659
|
+
};
|
|
2660
|
+
|
|
2093
2661
|
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
2662
|
styleInject(css_248z$2);
|
|
2095
2663
|
|
|
@@ -2120,10 +2688,12 @@ const Textarea = ({
|
|
|
2120
2688
|
backgroundColor,
|
|
2121
2689
|
borderFocusColor,
|
|
2122
2690
|
borderHoverColor,
|
|
2691
|
+
showCharacterCount,
|
|
2123
2692
|
labelRequiredColor
|
|
2124
2693
|
}) => {
|
|
2125
2694
|
const [isHover, setIsHover] = React.useState(false);
|
|
2126
2695
|
const [isFocus, setIsFocus] = React.useState(false);
|
|
2696
|
+
const [innerValue, setInnerValue] = React.useState('');
|
|
2127
2697
|
const configStyles = compereConfigs();
|
|
2128
2698
|
const handleMouseEnter = () => {
|
|
2129
2699
|
setIsHover(true);
|
|
@@ -2137,6 +2707,19 @@ const Textarea = ({
|
|
|
2137
2707
|
const handleBlur = () => {
|
|
2138
2708
|
setIsFocus(false);
|
|
2139
2709
|
};
|
|
2710
|
+
const handleChange = e => {
|
|
2711
|
+
const value = e.target.value;
|
|
2712
|
+
onChange(value);
|
|
2713
|
+
if (maxLength) {
|
|
2714
|
+
if (value.length > maxLength) {
|
|
2715
|
+
onChange(value.substr(0, maxLength));
|
|
2716
|
+
}
|
|
2717
|
+
} else {
|
|
2718
|
+
if (value.length > configStyles.TEXTAREA.maxLength) {
|
|
2719
|
+
onChange(value.substr(0, configStyles.TEXTAREA.maxLength));
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
};
|
|
2140
2723
|
React.useEffect(() => {
|
|
2141
2724
|
if (value === undefined) {
|
|
2142
2725
|
alert('Please add value prop on Textarea component');
|
|
@@ -2144,8 +2727,19 @@ const Textarea = ({
|
|
|
2144
2727
|
if (!onChange) {
|
|
2145
2728
|
alert('Please add onChange function on Textarea component');
|
|
2146
2729
|
}
|
|
2730
|
+
setInnerValue(value);
|
|
2147
2731
|
}, [value, onChange]);
|
|
2148
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
2732
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2733
|
+
style: {
|
|
2734
|
+
width: width ? width : configStyles.TEXTAREA.width
|
|
2735
|
+
}
|
|
2736
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2737
|
+
style: {
|
|
2738
|
+
display: 'flex',
|
|
2739
|
+
alignItems: 'center',
|
|
2740
|
+
justifyContent: label ? 'space-between' : 'flex-end'
|
|
2741
|
+
}
|
|
2742
|
+
}, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
2149
2743
|
style: {
|
|
2150
2744
|
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
2151
2745
|
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize,
|
|
@@ -2156,12 +2750,17 @@ const Textarea = ({
|
|
|
2156
2750
|
style: {
|
|
2157
2751
|
color: labelRequiredColor ? labelRequiredColor : configStyles.TEXTAREA.labelRequiredColor
|
|
2158
2752
|
}
|
|
2159
|
-
}, "*")) : '', /*#__PURE__*/React__default["default"].createElement("
|
|
2753
|
+
}, "*")) : '', showCharacterCount && maxLength && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2754
|
+
style: {
|
|
2755
|
+
color: labelColor ? labelColor : configStyles.TEXTAREA.labelColor,
|
|
2756
|
+
fontSize: labelSize ? labelSize : configStyles.TEXTAREA.labelSize
|
|
2757
|
+
}
|
|
2758
|
+
}, maxLength - value.length, " \u0576\u056B\u0577")), /*#__PURE__*/React__default["default"].createElement("textarea", {
|
|
2160
2759
|
style: {
|
|
2760
|
+
width: '100%',
|
|
2161
2761
|
outline: 'none',
|
|
2162
2762
|
overflow: 'auto',
|
|
2163
2763
|
fontSize: size ? size : configStyles.TEXTAREA.size,
|
|
2164
|
-
width: width ? width : configStyles.TEXTAREA.width,
|
|
2165
2764
|
height: height ? height : configStyles.TEXTAREA.height,
|
|
2166
2765
|
border: border ? border : configStyles.TEXTAREA.border,
|
|
2167
2766
|
padding: padding ? padding : configStyles.TEXTAREA.padding,
|
|
@@ -2175,13 +2774,13 @@ const Textarea = ({
|
|
|
2175
2774
|
borderColor: isFocus ? borderFocusColor ? borderFocusColor : configStyles.TEXTAREA.borderFocusColor : isHover ? borderHoverColor ? borderHoverColor : configStyles.TEXTAREA.borderHoverColor : borderColor ? borderColor : configStyles.TEXTAREA.borderColor,
|
|
2176
2775
|
resize: resize ? resize : configStyles.TEXTAREA.resize
|
|
2177
2776
|
},
|
|
2777
|
+
value: innerValue,
|
|
2178
2778
|
onBlur: handleBlur,
|
|
2179
|
-
onChange: onChange,
|
|
2180
2779
|
onFocus: handleFocus,
|
|
2780
|
+
onChange: handleChange,
|
|
2181
2781
|
placeholder: placeholder,
|
|
2182
2782
|
onMouseEnter: handleMouseEnter,
|
|
2183
|
-
onMouseLeave: handleMouseLeave
|
|
2184
|
-
value: maxLength ? value.length > maxLength ? value.substr(0, maxLength) : value : configStyles.TEXTAREA.maxLength ? value.length > configStyles.TEXTAREA.maxLength ? value.substr(0, configStyles.TEXTAREA.maxLength) : value : value
|
|
2783
|
+
onMouseLeave: handleMouseLeave
|
|
2185
2784
|
}));
|
|
2186
2785
|
};
|
|
2187
2786
|
Textarea.propTypes = {
|
|
@@ -2207,6 +2806,7 @@ Textarea.propTypes = {
|
|
|
2207
2806
|
placeholder: PropTypes__default["default"].string,
|
|
2208
2807
|
labelDisplay: PropTypes__default["default"].string,
|
|
2209
2808
|
backgroundColor: PropTypes__default["default"].string,
|
|
2809
|
+
showCharacterCount: PropTypes__default["default"].bool,
|
|
2210
2810
|
value: PropTypes__default["default"].string.isRequired,
|
|
2211
2811
|
borderFocusColor: PropTypes__default["default"].string,
|
|
2212
2812
|
borderHoverColor: PropTypes__default["default"].string,
|
|
@@ -2220,7 +2820,7 @@ styleInject(css_248z$1);
|
|
|
2220
2820
|
|
|
2221
2821
|
// import styles from "./pagination.module.scss";
|
|
2222
2822
|
|
|
2223
|
-
const Dots
|
|
2823
|
+
const Dots = "...";
|
|
2224
2824
|
const range = (start, end) => {
|
|
2225
2825
|
const length = end - start + 1;
|
|
2226
2826
|
return Array.from({
|
|
@@ -2250,29 +2850,29 @@ const PaginationRange = ({
|
|
|
2250
2850
|
if (!shouldShowLeftDots && shouldShowRightDots) {
|
|
2251
2851
|
let leftItemCount = currentPageNumber === 4 && lastPageIndex > 7 ? 4 + siblingCountNumber : 3 + siblingCountNumber;
|
|
2252
2852
|
let leftRange = range(1, leftItemCount);
|
|
2253
|
-
return [...leftRange, Dots
|
|
2853
|
+
return [...leftRange, Dots, totalPageCount];
|
|
2254
2854
|
}
|
|
2255
2855
|
if (shouldShowLeftDots && !shouldShowRightDots) {
|
|
2256
2856
|
let rightItemCount = 0;
|
|
2257
2857
|
currentPageNumber === lastPageIndex - 3 && lastPageIndex > 7 ? rightItemCount = 4 + siblingCountNumber : rightItemCount = 3 + siblingCountNumber;
|
|
2258
2858
|
let rightRange = range(totalPageCount - rightItemCount + 1, totalPageCount);
|
|
2259
|
-
return [firstPageIndex, Dots
|
|
2859
|
+
return [firstPageIndex, Dots, ...rightRange];
|
|
2260
2860
|
}
|
|
2261
2861
|
if (shouldShowLeftDots && shouldShowRightDots) {
|
|
2262
2862
|
let middleRange = range(leftSiblingIndex, rightSiblingIndex);
|
|
2263
|
-
return [firstPageIndex, Dots
|
|
2863
|
+
return [firstPageIndex, Dots, ...middleRange, Dots, lastPageIndex];
|
|
2264
2864
|
}
|
|
2265
2865
|
}, [currentTotalCount, offset, siblingCountNumber, currentPageNumber]);
|
|
2266
2866
|
return paginationRange;
|
|
2267
2867
|
};
|
|
2268
2868
|
|
|
2269
|
-
const
|
|
2869
|
+
const SvgDots = ({
|
|
2270
2870
|
title,
|
|
2271
2871
|
titleId,
|
|
2272
2872
|
...props
|
|
2273
2873
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2274
|
-
width: "
|
|
2275
|
-
height: "
|
|
2874
|
+
width: "11",
|
|
2875
|
+
height: "3",
|
|
2276
2876
|
viewBox: "0 0 11 3",
|
|
2277
2877
|
fill: "none",
|
|
2278
2878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2280,17 +2880,17 @@ const Dots = ({
|
|
|
2280
2880
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2281
2881
|
id: titleId
|
|
2282
2882
|
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2283
|
-
d: "
|
|
2883
|
+
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
2884
|
fill: "#3C393E"
|
|
2285
2885
|
}));
|
|
2286
2886
|
|
|
2287
|
-
const
|
|
2887
|
+
const SvgNextarrow = ({
|
|
2288
2888
|
title,
|
|
2289
2889
|
titleId,
|
|
2290
2890
|
...props
|
|
2291
2891
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
2292
|
-
width: "
|
|
2293
|
-
height: "
|
|
2892
|
+
width: "6",
|
|
2893
|
+
height: "12",
|
|
2294
2894
|
viewBox: "0 0 6 12",
|
|
2295
2895
|
fill: "none",
|
|
2296
2896
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -2298,7 +2898,7 @@ const SvgNextArrow = ({
|
|
|
2298
2898
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
2299
2899
|
id: titleId
|
|
2300
2900
|
}, title) : null, /*#__PURE__*/React__namespace.createElement("path", {
|
|
2301
|
-
d: "
|
|
2901
|
+
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
2902
|
fill: "#3C393E"
|
|
2303
2903
|
}));
|
|
2304
2904
|
|
|
@@ -2362,8 +2962,8 @@ const Pagination = ({
|
|
|
2362
2962
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
2363
2963
|
onClick: onPrevious,
|
|
2364
2964
|
disabled: currentPage === 1 ? true : false
|
|
2365
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
2366
|
-
if (pageNumber === Dots
|
|
2965
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null)), paginationRange.map((pageNumber, id) => {
|
|
2966
|
+
if (pageNumber === Dots) {
|
|
2367
2967
|
let currentPageIndex = paginationRange.indexOf(currentPageNumber);
|
|
2368
2968
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
2369
2969
|
key: id,
|
|
@@ -2372,16 +2972,16 @@ const Pagination = ({
|
|
|
2372
2972
|
disabled: currentPageIndex === 0 ? true : false
|
|
2373
2973
|
}, id < currentPageIndex ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2374
2974
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
2375
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
2975
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgDots, null)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2376
2976
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`,
|
|
2377
2977
|
style: {
|
|
2378
2978
|
transform: 'rotate(180deg)'
|
|
2379
2979
|
}
|
|
2380
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
2980
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2381
2981
|
className: `${styles$1["pagination-jump-next-txt"]} pagination-jump-next-txt-rem`
|
|
2382
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
2982
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgDots, null)), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2383
2983
|
className: `${styles$1["pagination-jump-next-arrow"]} pagination-jump-next-arrow-rem`
|
|
2384
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
2984
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null))));
|
|
2385
2985
|
}
|
|
2386
2986
|
return /*#__PURE__*/React__default["default"].createElement("li", {
|
|
2387
2987
|
onClick: () => onPageChange(pageNumber),
|
|
@@ -2392,7 +2992,7 @@ const Pagination = ({
|
|
|
2392
2992
|
onClick: onNext,
|
|
2393
2993
|
className: `${styles$1["pagination-btn"]} pagination-btn-rem`,
|
|
2394
2994
|
disabled: currentPageNumber === lastPage ? true : false
|
|
2395
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
|
2995
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null)));
|
|
2396
2996
|
};
|
|
2397
2997
|
Pagination.propTypes = {
|
|
2398
2998
|
offset: PropTypes__default["default"].number,
|
|
@@ -2874,6 +3474,7 @@ exports.Input = Input;
|
|
|
2874
3474
|
exports.InputTypes = InputTypes;
|
|
2875
3475
|
exports.Modal = Modal;
|
|
2876
3476
|
exports.NewAutocomplete = NewAutocomplete;
|
|
3477
|
+
exports.NewFile = NewFile;
|
|
2877
3478
|
exports.Pagination = Pagination;
|
|
2878
3479
|
exports.Radio = Radio;
|
|
2879
3480
|
exports.Select = Select;
|