@xaypay/tui 0.0.55 → 0.0.56
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 +85 -74
- package/dist/index.js +85 -74
- package/package.json +2 -1
- package/rollup.config.js +2 -0
- package/src/components/autocomplate/index.js +22 -17
- package/src/components/button/index.js +8 -8
- package/src/components/input/index.js +14 -18
- package/src/components/table/index.js +1 -1
- package/src/components/tooltip/index.js +37 -34
- package/src/components/tooltip/tooltip.module.css +2 -2
- package/src/components/tooltip/tooltip.stories.js +3 -2
- package/src/components/typography/index.js +6 -2
- package/src/stories/Introduction.stories.mdx +10 -0
- package/src/stories/configuration.stories.mdx +20 -3
- package/src/stories/static/button-usage.png +0 -0
- package/src/stories/usage.stories.mdx +128 -0
- package/src/utils/index.js +1 -0
- package/tui.config.js +15 -5
package/dist/index.es.js
CHANGED
|
@@ -365,8 +365,10 @@ const compereConfigs = () => {
|
|
|
365
365
|
try {
|
|
366
366
|
packageConfig = require('../tui.config.js');
|
|
367
367
|
} catch (error) {
|
|
368
|
+
packageConfig = require('../../tui.config.js');
|
|
368
369
|
// console.log(error, 'Package: tui.config.js file is not define');
|
|
369
370
|
}
|
|
371
|
+
|
|
370
372
|
try {
|
|
371
373
|
projectConfig = require('../../../../tui.config.js');
|
|
372
374
|
} catch (error) {
|
|
@@ -484,7 +486,10 @@ Typography.propTypes = {
|
|
|
484
486
|
colorHover: PropTypes.string,
|
|
485
487
|
textTransform: PropTypes.string,
|
|
486
488
|
textDecoration: PropTypes.string,
|
|
487
|
-
variant: PropTypes.oneOf(Object.values(TypographyType))
|
|
489
|
+
variant: PropTypes.oneOf(Object.values(TypographyType))
|
|
490
|
+
};
|
|
491
|
+
Typography.defaultProps = {
|
|
492
|
+
variant: 'p'
|
|
488
493
|
};
|
|
489
494
|
|
|
490
495
|
const Modal = ({
|
|
@@ -613,19 +618,9 @@ const Input = ({
|
|
|
613
618
|
}) => {
|
|
614
619
|
const [show, setShow] = useState(false);
|
|
615
620
|
const [isHover, setIsHover] = useState(false);
|
|
616
|
-
const [tooltipStatus, setTooltipStatus] = useState(false);
|
|
617
621
|
const random = Math.floor(Math.random() * 1000 + 1);
|
|
618
622
|
const configStyles = compereConfigs();
|
|
619
623
|
const classProps = classnames(className ? className : configStyles.INPUT.className);
|
|
620
|
-
const handleChange = event => {
|
|
621
|
-
onChange ? onChange(event.target.value) : _ => _;
|
|
622
|
-
};
|
|
623
|
-
const handleMouseEnter = () => {
|
|
624
|
-
setIsHover(true);
|
|
625
|
-
};
|
|
626
|
-
const handleMouseLeave = () => {
|
|
627
|
-
setIsHover(false);
|
|
628
|
-
};
|
|
629
624
|
const errorShow = keyframes`
|
|
630
625
|
100% {
|
|
631
626
|
bottom: '-20px';
|
|
@@ -642,6 +637,15 @@ const Input = ({
|
|
|
642
637
|
const P = styled.p`
|
|
643
638
|
animation: ${errorAnimation ? animation : 'none'};
|
|
644
639
|
`;
|
|
640
|
+
const handleChange = event => {
|
|
641
|
+
onChange ? onChange(event.target.value) : _ => _;
|
|
642
|
+
};
|
|
643
|
+
const handleMouseEnter = () => {
|
|
644
|
+
setIsHover(true);
|
|
645
|
+
};
|
|
646
|
+
const handleMouseLeave = () => {
|
|
647
|
+
setIsHover(false);
|
|
648
|
+
};
|
|
645
649
|
return /*#__PURE__*/React.createElement("div", {
|
|
646
650
|
className: `${styles$7["input-wrap"]}`
|
|
647
651
|
}, label ? /*#__PURE__*/React.createElement("label", {
|
|
@@ -728,10 +732,7 @@ const Input = ({
|
|
|
728
732
|
borderBottomRightRadius: radius ? radius : configStyles.INPUT.radius,
|
|
729
733
|
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
730
734
|
}
|
|
731
|
-
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? /*#__PURE__*/React.createElement(
|
|
732
|
-
variant: "p",
|
|
733
|
-
onClick: () => setTooltipStatus(!tooltipStatus)
|
|
734
|
-
}, "\u24D8") : null, tooltipStatus ? /*#__PURE__*/React.createElement("p", null, tooltip) : null, errorMessage ? /*#__PURE__*/React.createElement(P, {
|
|
735
|
+
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip && tooltip.length > 0 ? tooltip[0] : '', errorMessage ? /*#__PURE__*/React.createElement(P, {
|
|
735
736
|
style: {
|
|
736
737
|
left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
|
|
737
738
|
color: errorColor ? errorColor : configStyles.INPUT.errorColor,
|
|
@@ -758,7 +759,6 @@ Input.propTypes = {
|
|
|
758
759
|
radius: PropTypes.string,
|
|
759
760
|
padding: PropTypes.string,
|
|
760
761
|
fontSize: PropTypes.string,
|
|
761
|
-
tooltip: PropTypes.element,
|
|
762
762
|
transform: PropTypes.string,
|
|
763
763
|
className: PropTypes.string,
|
|
764
764
|
iconWidth: PropTypes.string,
|
|
@@ -785,6 +785,7 @@ Input.propTypes = {
|
|
|
785
785
|
labelLineHeight: PropTypes.string,
|
|
786
786
|
labelMarginBottom: PropTypes.string,
|
|
787
787
|
errorAnimationDuration: PropTypes.string,
|
|
788
|
+
tooltip: PropTypes.arrayOf(PropTypes.element),
|
|
788
789
|
leftIcon: PropTypes.arrayOf(PropTypes.element),
|
|
789
790
|
rightIcon: PropTypes.arrayOf(PropTypes.element),
|
|
790
791
|
type: PropTypes.oneOf(Object.values(InputTypes))
|
|
@@ -861,7 +862,6 @@ const Button = ({
|
|
|
861
862
|
radius,
|
|
862
863
|
outline,
|
|
863
864
|
padding,
|
|
864
|
-
bgColor,
|
|
865
865
|
onClick,
|
|
866
866
|
disabled,
|
|
867
867
|
className,
|
|
@@ -870,8 +870,9 @@ const Button = ({
|
|
|
870
870
|
contentWidth,
|
|
871
871
|
disabledColor,
|
|
872
872
|
textTransform,
|
|
873
|
-
|
|
873
|
+
backgroundColor,
|
|
874
874
|
disabledLineColor,
|
|
875
|
+
disabledBackgroundColor,
|
|
875
876
|
...props
|
|
876
877
|
}) => {
|
|
877
878
|
const [isHover, setIsHover] = useState(false);
|
|
@@ -902,9 +903,9 @@ const Button = ({
|
|
|
902
903
|
width: contentWidth ? 'auto' : width ? width : configStyles.BUTTON.width,
|
|
903
904
|
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.BUTTON.cursor,
|
|
904
905
|
textTransform: textTransform ? textTransform : configStyles.BUTTON.textTransform,
|
|
905
|
-
backgroundColor: (outline || !outline) && disabled ?
|
|
906
|
-
boxShadow: outline ? disabled ? `inset 0 0 0 2px ${disabledLineColor ? disabledLineColor : configStyles.BUTTON.disabledLineColor}` : `inset 0 0 0 2px ${
|
|
907
|
-
color: (outline || !outline) && disabled ? disabledColor ? disabledColor : configStyles.BUTTON.disabledColor : outline && !disabled ? isHover ? color ? color : configStyles.BUTTON.color :
|
|
906
|
+
backgroundColor: (outline || !outline) && disabled ? disabledBackgroundColor ? disabledBackgroundColor : configStyles.BUTTON.disabledBackgroundColor : outline && !disabled ? isHover ? backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor : '#ffffff' : backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor,
|
|
907
|
+
boxShadow: outline ? disabled ? `inset 0 0 0 2px ${disabledLineColor ? disabledLineColor : configStyles.BUTTON.disabledLineColor}` : `inset 0 0 0 2px ${backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor}` : 'none',
|
|
908
|
+
color: (outline || !outline) && disabled ? disabledColor ? disabledColor : configStyles.BUTTON.disabledColor : outline && !disabled ? isHover ? color ? color : configStyles.BUTTON.color : backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor : color ? color : configStyles.BUTTON.color
|
|
908
909
|
},
|
|
909
910
|
type: type ? type : configStyles.BUTTON.type,
|
|
910
911
|
disabled: disabled ? disabled : configStyles.BUTTON.disabled,
|
|
@@ -929,16 +930,16 @@ Button.propTypes = {
|
|
|
929
930
|
disabled: PropTypes.bool,
|
|
930
931
|
radius: PropTypes.string,
|
|
931
932
|
padding: PropTypes.string,
|
|
932
|
-
bgColor: PropTypes.string,
|
|
933
933
|
boxSizing: PropTypes.string,
|
|
934
934
|
className: PropTypes.string,
|
|
935
935
|
transition: PropTypes.string,
|
|
936
936
|
contentWidth: PropTypes.bool,
|
|
937
937
|
textTransform: PropTypes.string,
|
|
938
938
|
disabledColor: PropTypes.string,
|
|
939
|
-
|
|
939
|
+
backgroundColor: PropTypes.string,
|
|
940
940
|
label: PropTypes.string.isRequired,
|
|
941
|
-
disabledLineColor: PropTypes.string
|
|
941
|
+
disabledLineColor: PropTypes.string,
|
|
942
|
+
disabledBackgroundColor: PropTypes.string
|
|
942
943
|
};
|
|
943
944
|
|
|
944
945
|
var css_248z$5 = ".select-module_select-title__c8bR7{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:none}.select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{border:2px solid #d1d1d1;border-radius:6px;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;flex-direction:row;font-size:16px;font-weight:500;height:46px;line-height:22px;max-width:400px;padding:0 15px;transition:border-color .24s}.select-module_select-content-top__Aw-fB.select-module_active__v2Dce{border-color:#00236a}.select-module_select-content-top__Aw-fB:hover{border-color:#3c393e}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;background:#fbfbfb;border-radius:6px;box-shadow:0 0 10px rgba(60,57,62,.08);left:0;max-height:0;max-width:400px;overflow:hidden;position:absolute;top:52px;width:100%;z-index:1}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}@keyframes select-module_select-show__391hQ{to{max-height:400px}}.select-module_select-content-top-text__euajq{align-items:center;display:flex;flex:1;flex-direction:row;flex-wrap:nowrap}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>i{color:#3c393e;font-size:12px!important}.select-module_select-content-top-icon__MBrGK>i:not(:last-child){align-items:center;border-right:1px solid #eee;display:flex;height:22px;margin-right:8px;padding:0 8px}.select-module_select-content-bottom-row__eKq5L{align-items:center;background:#fff;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;font-size:16px;font-weight:500;line-height:22px;margin-bottom:2px;min-height:46px;padding:0 15px;transition:background .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}.select-module_select-content-bottom-row__eKq5L:hover{background:unset;color:#00236a}.select-module_error-message__-ac6X{border:2px solid #e00!important}.select-module_eMessage__Mm-F7{color:#e00}";
|
|
@@ -1067,7 +1068,9 @@ Select.defaultProps = {
|
|
|
1067
1068
|
required: false
|
|
1068
1069
|
};
|
|
1069
1070
|
|
|
1070
|
-
var
|
|
1071
|
+
var ReactInfoIcon = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M8 0C3.58214 0 0 3.58214 0 8C0 12.4179 3.58214 16 8 16C12.4179 16 16 12.4179 16 8C16 3.58214 12.4179 0 8 0ZM8.57143 11.8571C8.57143 11.9357 8.50714 12 8.42857 12H7.57143C7.49286 12 7.42857 11.9357 7.42857 11.8571V7C7.42857 6.92143 7.49286 6.85714 7.57143 6.85714H8.42857C8.50714 6.85714 8.57143 6.92143 8.57143 7V11.8571ZM8 5.71429C7.7757 5.70971 7.56213 5.61739 7.40513 5.45714C7.24812 5.2969 7.16018 5.08149 7.16018 4.85714C7.16018 4.6328 7.24812 4.41739 7.40513 4.25714C7.56213 4.0969 7.7757 4.00458 8 4C8.2243 4.00458 8.43787 4.0969 8.59488 4.25714C8.75189 4.41739 8.83982 4.6328 8.83982 4.85714C8.83982 5.08149 8.75189 5.2969 8.59488 5.45714C8.43787 5.61739 8.2243 5.70971 8 5.71429Z\" fill=\"#D1D1D1\"/>\n</svg>";
|
|
1072
|
+
|
|
1073
|
+
var css_248z$4 = ".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}";
|
|
1071
1074
|
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"};
|
|
1072
1075
|
styleInject(css_248z$4);
|
|
1073
1076
|
|
|
@@ -1076,58 +1079,57 @@ const Tooltip = ({
|
|
|
1076
1079
|
text,
|
|
1077
1080
|
width,
|
|
1078
1081
|
color,
|
|
1079
|
-
tIcon,
|
|
1080
1082
|
height,
|
|
1081
|
-
|
|
1083
|
+
radius,
|
|
1082
1084
|
fontSize,
|
|
1083
|
-
tBgColor,
|
|
1084
1085
|
className,
|
|
1085
1086
|
fontFamily,
|
|
1086
|
-
|
|
1087
|
-
|
|
1087
|
+
tooltipIcon,
|
|
1088
|
+
tooltipWidth,
|
|
1089
|
+
tooltipRadius,
|
|
1090
|
+
backgroundColor,
|
|
1091
|
+
tooltipBackgroundColor
|
|
1088
1092
|
}) => {
|
|
1089
1093
|
const tooltipRef = /*#__PURE__*/createRef(null);
|
|
1090
|
-
const [
|
|
1091
|
-
const [
|
|
1094
|
+
const [checkTooltipWidth, setCheckTooltipWidth] = useState(0);
|
|
1095
|
+
const [checkTooltipHeight, setCheckTooltipHeight] = useState(0);
|
|
1092
1096
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
1093
1097
|
const configStyles = compereConfigs();
|
|
1094
1098
|
const classProps = classnames(styles$4['tooltip'], className);
|
|
1095
|
-
useEffect(_ => {
|
|
1096
|
-
if (!type && !text) {
|
|
1097
|
-
alert('Add type and text on tooltip');
|
|
1098
|
-
} else if (!type) {
|
|
1099
|
-
alert('Add type on tooltip');
|
|
1100
|
-
} else if (!text) {
|
|
1101
|
-
alert('Add text on tooltip');
|
|
1102
|
-
}
|
|
1103
|
-
tooltipRef.current && tooltipRef.current.clientWidth && tooltipRef.current.clientWidth > 0 && setTooltipWidth(tooltipRef.current.clientWidth);
|
|
1104
|
-
tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setTooltipHeight(tooltipRef.current.clientHeight);
|
|
1105
|
-
}, [type, text, tooltipWidth, tooltipRef]);
|
|
1106
1099
|
const handleShow = () => {
|
|
1107
1100
|
setShowTooltip(!showTooltip);
|
|
1108
1101
|
};
|
|
1102
|
+
useEffect(_ => {
|
|
1103
|
+
if (!text) {
|
|
1104
|
+
alert('Add text on tooltip');
|
|
1105
|
+
}
|
|
1106
|
+
tooltipRef.current && tooltipRef.current.clientWidth && tooltipRef.current.clientWidth > 0 && setCheckTooltipWidth(tooltipRef.current.clientWidth);
|
|
1107
|
+
tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setCheckTooltipHeight(tooltipRef.current.clientHeight);
|
|
1108
|
+
}, [text, tooltipRef, checkTooltipWidth, checkTooltipHeight]);
|
|
1109
1109
|
return /*#__PURE__*/React.createElement("div", {
|
|
1110
1110
|
className: `${styles$4['tooltip-block']}`,
|
|
1111
1111
|
style: {
|
|
1112
1112
|
width: width ? width : configStyles.TOOLTIP.width,
|
|
1113
1113
|
height: height ? height : configStyles.TOOLTIP.height,
|
|
1114
|
-
|
|
1114
|
+
borderRadius: radius ? radius : configStyles.TOOLTIP.radius,
|
|
1115
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.TOOLTIP.backgroundColor
|
|
1115
1116
|
}
|
|
1116
1117
|
}, showTooltip ? /*#__PURE__*/React.createElement("div", {
|
|
1117
1118
|
ref: tooltipRef,
|
|
1118
1119
|
className: classProps,
|
|
1119
1120
|
style: {
|
|
1120
|
-
|
|
1121
|
-
borderRadius:
|
|
1122
|
-
|
|
1123
|
-
|
|
1121
|
+
width: tooltipWidth ? tooltipWidth : configStyles.TOOLTIP.tooltipWidth,
|
|
1122
|
+
borderRadius: tooltipRadius ? tooltipRadius : configStyles.TOOLTIP.tooltipRadius,
|
|
1123
|
+
backgroundColor: tooltipBackgroundColor ? tooltipBackgroundColor : configStyles.TOOLTIP.tooltipBackgroundColor,
|
|
1124
|
+
top: type === 'top' ? `calc(-${checkTooltipHeight + 7}px)` : type === 'bottom' ? 'calc(100% + 7px)' : type === 'left' || type === 'right' ? `calc(50% - ${checkTooltipHeight / 2}px)` : '0px',
|
|
1125
|
+
left: type === 'top' || type === 'bottom' ? `calc(50% - ${checkTooltipWidth / 2}px)` : type === 'left' ? `-${checkTooltipWidth + 7}px` : type === 'right' ? 'calc(100% + 7px)' : '0px'
|
|
1124
1126
|
}
|
|
1125
1127
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1126
1128
|
className: `${styles$4['tooltip-rel']}`
|
|
1127
1129
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1128
1130
|
className: `${styles$4['tooltip-decor']}`,
|
|
1129
1131
|
style: {
|
|
1130
|
-
backgroundColor:
|
|
1132
|
+
backgroundColor: tooltipBackgroundColor ? tooltipBackgroundColor : configStyles.TOOLTIP.tooltipBackgroundColor,
|
|
1131
1133
|
left: type === 'top' || type === 'bottom' ? 'calc(50% - 5px)' : type === 'right' ? '-15px' : type === 'left' ? 'calc(100% + 5px)' : '0px',
|
|
1132
1134
|
top: type === 'top' ? 'calc(100% + 5px)' : type === 'bottom' ? '-15px' : type === 'right' || type === 'left' ? 'calc(50% - 5px)' : '0px'
|
|
1133
1135
|
}
|
|
@@ -1135,7 +1137,6 @@ const Tooltip = ({
|
|
|
1135
1137
|
style: {
|
|
1136
1138
|
color: color ? color : configStyles.TOOLTIP.color,
|
|
1137
1139
|
fontSize: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
|
|
1138
|
-
lineHeight: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
|
|
1139
1140
|
fontFamily: fontFamily ? fontFamily : configStyles.TOOLTIP.fontFamily
|
|
1140
1141
|
}
|
|
1141
1142
|
}, text))) : '', /*#__PURE__*/React.createElement("div", {
|
|
@@ -1143,22 +1144,28 @@ const Tooltip = ({
|
|
|
1143
1144
|
cursor: 'pointer'
|
|
1144
1145
|
},
|
|
1145
1146
|
onClick: handleShow
|
|
1146
|
-
}
|
|
1147
|
+
}, tooltipIcon && tooltipIcon[0] ? tooltipIcon[0] : /*#__PURE__*/React.createElement("img", {
|
|
1148
|
+
src: ReactInfoIcon
|
|
1149
|
+
})));
|
|
1147
1150
|
};
|
|
1148
1151
|
Tooltip.propTypes = {
|
|
1152
|
+
type: PropTypes.string,
|
|
1149
1153
|
width: PropTypes.string,
|
|
1150
1154
|
color: PropTypes.string,
|
|
1151
|
-
tIcon: PropTypes.element,
|
|
1152
1155
|
height: PropTypes.string,
|
|
1153
|
-
|
|
1154
|
-
tBgColor: PropTypes.string,
|
|
1156
|
+
radius: PropTypes.string,
|
|
1155
1157
|
fontSize: PropTypes.string,
|
|
1156
1158
|
className: PropTypes.string,
|
|
1157
1159
|
fontFamily: PropTypes.string,
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1160
|
+
tooltipWidth: PropTypes.string,
|
|
1161
|
+
tooltipRadius: PropTypes.string,
|
|
1162
|
+
text: PropTypes.string.isRequired,
|
|
1163
|
+
backgroundColor: PropTypes.string,
|
|
1164
|
+
tooltipBackgroundColor: PropTypes.string,
|
|
1165
|
+
tooltipIcon: PropTypes.arrayOf(PropTypes.element)
|
|
1166
|
+
};
|
|
1167
|
+
Tooltip.defaultProps = {
|
|
1168
|
+
type: 'top'
|
|
1162
1169
|
};
|
|
1163
1170
|
|
|
1164
1171
|
var css_248z$3 = "*{margin:0;padding:0}.captcha-module_main__Ys3EH{height:74px;max-width:400px;position:relative;width:100%}.captcha-module_slider__KLYny{-webkit-appearance:none;background:#eee;border-radius:2px;bottom:0;height:4px;left:0;margin:auto 0;outline:none;position:absolute;top:0;width:100%}.captcha-module_slider__KLYny::-webkit-slider-thumb{-webkit-appearance:none;height:30px;position:relative;width:30px;z-index:3}.captcha-module_selector__JFhb4{left:0;z-index:2}.captcha-module_selectBtn__GP1iH,.captcha-module_selector__JFhb4{bottom:0;height:30px;margin:auto 0;position:absolute;top:0;width:30px}.captcha-module_selectBtn__GP1iH{background:#00236a;border:2px solid #fff;border-radius:50%;box-shadow:1px 0 6px rgba(60,57,62,.15);cursor:pointer}.captcha-module_progressBar__mhdtM{background:red;bottom:0;height:4px;left:0;margin:auto 0;position:absolute;top:0;width:auto}.captcha-module_range__k24I2{color:blue;margin-bottom:15px;margin-top:15px}";
|
|
@@ -1428,20 +1435,22 @@ var styles = {"autocomplate-content":"autocomplate-module_autocomplate-content__
|
|
|
1428
1435
|
styleInject(css_248z);
|
|
1429
1436
|
|
|
1430
1437
|
const Autocomplate = ({
|
|
1431
|
-
className,
|
|
1432
1438
|
label,
|
|
1439
|
+
value,
|
|
1433
1440
|
required,
|
|
1434
1441
|
disabled,
|
|
1435
|
-
|
|
1436
|
-
jsonSelectedOptionsData,
|
|
1442
|
+
keyNames,
|
|
1437
1443
|
onChange,
|
|
1438
|
-
|
|
1444
|
+
className,
|
|
1439
1445
|
searchCount,
|
|
1440
1446
|
placeHolder,
|
|
1441
|
-
keyNames,
|
|
1442
1447
|
errorMesage,
|
|
1448
|
+
autoComplete,
|
|
1449
|
+
jsonOptionsData,
|
|
1450
|
+
jsonSelectedOptionsData,
|
|
1443
1451
|
...props
|
|
1444
1452
|
}) => {
|
|
1453
|
+
const configStyles = compereConfigs();
|
|
1445
1454
|
classnames(styles.searchBox, className);
|
|
1446
1455
|
const parseSelectedOptionsData = jsonSelectedOptionsData ? JSON.parse(jsonSelectedOptionsData) : {
|
|
1447
1456
|
name: '',
|
|
@@ -1452,10 +1461,6 @@ const Autocomplate = ({
|
|
|
1452
1461
|
const [activeOption, setActiveOption] = useState(0);
|
|
1453
1462
|
const [showOptions, setShowOptions] = useState(false);
|
|
1454
1463
|
const parseOptionsData = jsonOptionsData ? JSON.parse(jsonOptionsData) : [];
|
|
1455
|
-
useEffect(() => {
|
|
1456
|
-
setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name]);
|
|
1457
|
-
setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id]);
|
|
1458
|
-
}, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]]);
|
|
1459
1464
|
const handleChange = e => {
|
|
1460
1465
|
const currentInputValue = e.currentTarget.value;
|
|
1461
1466
|
setInputId(null);
|
|
@@ -1511,6 +1516,10 @@ const Autocomplate = ({
|
|
|
1511
1516
|
}, inputValue.length < searchCount ? `Լրացնել առնվազն ${searchCount} նիշ` : 'Նման տվյալ առկա չէ'))));
|
|
1512
1517
|
}
|
|
1513
1518
|
}
|
|
1519
|
+
useEffect(() => {
|
|
1520
|
+
setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name]);
|
|
1521
|
+
setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id]);
|
|
1522
|
+
}, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]]);
|
|
1514
1523
|
return /*#__PURE__*/React.createElement(React.Fragment, null, label ? /*#__PURE__*/React.createElement("label", {
|
|
1515
1524
|
className: `${styles['autocomplate-title']} autocomplate-title-rem`
|
|
1516
1525
|
}, label, " ", required && /*#__PURE__*/React.createElement("sup", {
|
|
@@ -1522,6 +1531,7 @@ const Autocomplate = ({
|
|
|
1522
1531
|
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
1523
1532
|
id: inputId,
|
|
1524
1533
|
type: "text",
|
|
1534
|
+
autoComplete: autoComplete ? autoComplete : configStyles.INPUT.autoComplete,
|
|
1525
1535
|
className: `${styles['autocomplate-content-top']} autocomplate-content-top-rem ${errorMesage ? styles.errorBorder : ''}`,
|
|
1526
1536
|
disabled: disabled,
|
|
1527
1537
|
onChange: handleChange,
|
|
@@ -1535,18 +1545,19 @@ const Autocomplate = ({
|
|
|
1535
1545
|
}, errorMesage) : null, optionList));
|
|
1536
1546
|
};
|
|
1537
1547
|
Autocomplate.propTypes = {
|
|
1538
|
-
className: PropTypes.string,
|
|
1539
1548
|
label: PropTypes.string,
|
|
1540
|
-
placeHolder: PropTypes.string,
|
|
1541
|
-
required: PropTypes.bool,
|
|
1542
1549
|
disabled: PropTypes.bool,
|
|
1543
|
-
|
|
1544
|
-
jsonSelectedOptionsData: PropTypes.string,
|
|
1550
|
+
required: PropTypes.bool,
|
|
1545
1551
|
onChange: PropTypes.func,
|
|
1546
1552
|
value: PropTypes.string,
|
|
1547
|
-
searchCount: PropTypes.number,
|
|
1548
1553
|
keyNames: PropTypes.object,
|
|
1549
|
-
|
|
1554
|
+
className: PropTypes.string,
|
|
1555
|
+
searchCount: PropTypes.number,
|
|
1556
|
+
errorMesage: PropTypes.string,
|
|
1557
|
+
placeHolder: PropTypes.string,
|
|
1558
|
+
autoComplete: PropTypes.string,
|
|
1559
|
+
jsonOptionsData: PropTypes.string,
|
|
1560
|
+
jsonSelectedOptionsData: PropTypes.string
|
|
1550
1561
|
};
|
|
1551
1562
|
Autocomplate.defaultProps = {
|
|
1552
1563
|
required: false
|