@xaypay/tui 0.0.54 → 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/.storybook/main.js +27 -20
- package/cli-command.js +3 -0
- package/dist/index.es.js +250 -99
- package/dist/index.js +251 -99
- package/package.json +8 -5
- package/rollup.config.js +2 -0
- package/src/components/autocomplate/index.js +22 -17
- package/src/components/button/index.js +27 -18
- package/src/components/input/index.js +136 -40
- package/src/components/input/input.module.css +17 -15
- 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 +65 -6
- package/src/components/typography/typography.stories.js +8 -2
- package/src/stories/Introduction.stories.mdx +92 -93
- package/src/stories/changelog.stories.mdx +118 -0
- package/src/stories/configuration.stories.mdx +334 -0
- package/src/stories/documentation.stories.mdx +118 -0
- 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 +190 -52
- package/storybook-static/favicon.ico +0 -0
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, createRef, useMemo } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
|
+
import styled, { keyframes, css } from 'styled-components';
|
|
4
5
|
|
|
5
6
|
function styleInject(css, ref) {
|
|
6
7
|
if ( ref === void 0 ) ref = {};
|
|
@@ -364,8 +365,10 @@ const compereConfigs = () => {
|
|
|
364
365
|
try {
|
|
365
366
|
packageConfig = require('../tui.config.js');
|
|
366
367
|
} catch (error) {
|
|
368
|
+
packageConfig = require('../../tui.config.js');
|
|
367
369
|
// console.log(error, 'Package: tui.config.js file is not define');
|
|
368
370
|
}
|
|
371
|
+
|
|
369
372
|
try {
|
|
370
373
|
projectConfig = require('../../../../tui.config.js');
|
|
371
374
|
} catch (error) {
|
|
@@ -390,18 +393,47 @@ const Typography = ({
|
|
|
390
393
|
size,
|
|
391
394
|
color,
|
|
392
395
|
weight,
|
|
393
|
-
|
|
396
|
+
radius,
|
|
397
|
+
border,
|
|
398
|
+
cursor,
|
|
399
|
+
margin,
|
|
400
|
+
padding,
|
|
394
401
|
variant,
|
|
402
|
+
bgColor,
|
|
403
|
+
onClick,
|
|
395
404
|
children,
|
|
405
|
+
textAlign,
|
|
406
|
+
fontStyle,
|
|
396
407
|
className,
|
|
408
|
+
textShadow,
|
|
409
|
+
lineHeight,
|
|
410
|
+
colorHover,
|
|
411
|
+
fontFamily,
|
|
412
|
+
textTransform,
|
|
413
|
+
textDecoration,
|
|
397
414
|
...props
|
|
398
415
|
}) => {
|
|
399
416
|
const configStyles = compereConfigs();
|
|
400
417
|
const classProps = classnames(className);
|
|
418
|
+
const [isHover, setIsHover] = useState(false);
|
|
401
419
|
const [validVariant, setValidVariant] = useState(false);
|
|
402
420
|
const [style, setStyle] = useState({
|
|
403
|
-
|
|
404
|
-
|
|
421
|
+
border: border ? border : configStyles.TYPOGRAPHY.border,
|
|
422
|
+
cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
|
|
423
|
+
borderRadius: radius ? radius : configStyles.TYPOGRAPHY.radius,
|
|
424
|
+
fontSize: size ? size : configStyles.TYPOGRAPHY['size' + variant],
|
|
425
|
+
margin: margin ? margin : configStyles.TYPOGRAPHY['margin' + variant],
|
|
426
|
+
fontWeight: weight ? weight : configStyles.TYPOGRAPHY['weight' + variant],
|
|
427
|
+
padding: padding ? padding : configStyles.TYPOGRAPHY['padding' + variant],
|
|
428
|
+
textShadow: textShadow ? textShadow : configStyles.TYPOGRAPHY.textShadow,
|
|
429
|
+
textAlign: textAlign ? textAlign : configStyles.TYPOGRAPHY['textAlign' + variant],
|
|
430
|
+
backgroundColor: bgColor ? bgColor : configStyles.TYPOGRAPHY['bgColor' + variant],
|
|
431
|
+
fontStyle: fontStyle ? fontStyle : configStyles.TYPOGRAPHY['fontStyle' + variant],
|
|
432
|
+
lineHeight: lineHeight ? lineHeight : configStyles.TYPOGRAPHY['lineHeight' + variant],
|
|
433
|
+
fontFamily: fontFamily ? fontFamily : configStyles.TYPOGRAPHY['fontFamily' + variant],
|
|
434
|
+
textTransform: textTransform ? textTransform : configStyles.TYPOGRAPHY['textTransform' + variant],
|
|
435
|
+
textDecoration: textDecoration ? textDecoration : configStyles.TYPOGRAPHY['textDecoration' + variant],
|
|
436
|
+
color: isHover ? colorHover ? colorHover : configStyles.TYPOGRAPHY['colorHover' + variant] : color ? color : configStyles.TYPOGRAPHY['color' + variant]
|
|
405
437
|
});
|
|
406
438
|
useEffect(() => {
|
|
407
439
|
if (!Object.values(TypographyType).includes(variant)) {
|
|
@@ -418,21 +450,46 @@ const Typography = ({
|
|
|
418
450
|
});
|
|
419
451
|
}
|
|
420
452
|
}, [color]);
|
|
453
|
+
const handleMouseEnter = () => {
|
|
454
|
+
setIsHover(true);
|
|
455
|
+
};
|
|
456
|
+
const handleMouseLeave = () => {
|
|
457
|
+
setIsHover(false);
|
|
458
|
+
};
|
|
421
459
|
const tagT = /*#__PURE__*/React.createElement(variant, {
|
|
422
460
|
style,
|
|
423
461
|
...props,
|
|
424
462
|
className: classProps,
|
|
425
|
-
onClick: onClick ? onClick : _ => _
|
|
463
|
+
onClick: onClick ? onClick : _ => _,
|
|
464
|
+
onMouseEnter: handleMouseEnter,
|
|
465
|
+
onMouseLeave: handleMouseLeave
|
|
426
466
|
}, [children]);
|
|
427
467
|
return validVariant ? 'Please set Typography valid variant' : tagT;
|
|
428
468
|
};
|
|
429
469
|
Typography.propTypes = {
|
|
430
470
|
size: PropTypes.string,
|
|
431
471
|
color: PropTypes.string,
|
|
432
|
-
weight: PropTypes.string,
|
|
433
472
|
onClick: PropTypes.func,
|
|
473
|
+
weight: PropTypes.string,
|
|
474
|
+
border: PropTypes.string,
|
|
475
|
+
cursor: PropTypes.string,
|
|
476
|
+
margin: PropTypes.string,
|
|
477
|
+
radius: PropTypes.string,
|
|
478
|
+
bgColor: PropTypes.string,
|
|
479
|
+
padding: PropTypes.string,
|
|
480
|
+
textAlign: PropTypes.string,
|
|
434
481
|
className: PropTypes.string,
|
|
435
|
-
|
|
482
|
+
fontStyle: PropTypes.string,
|
|
483
|
+
lineHeight: PropTypes.string,
|
|
484
|
+
textShadow: PropTypes.string,
|
|
485
|
+
fontFamily: PropTypes.string,
|
|
486
|
+
colorHover: PropTypes.string,
|
|
487
|
+
textTransform: PropTypes.string,
|
|
488
|
+
textDecoration: PropTypes.string,
|
|
489
|
+
variant: PropTypes.oneOf(Object.values(TypographyType))
|
|
490
|
+
};
|
|
491
|
+
Typography.defaultProps = {
|
|
492
|
+
variant: 'p'
|
|
436
493
|
};
|
|
437
494
|
|
|
438
495
|
const Modal = ({
|
|
@@ -505,16 +562,18 @@ Modal.propTypes = {
|
|
|
505
562
|
data: PropTypes.array
|
|
506
563
|
};
|
|
507
564
|
|
|
508
|
-
var css_248z$7 = ".input-module_input-wrap__NunrE{width:100%}.input-module_input-content__kP7lZ{display:flex;width:100%}
|
|
509
|
-
var styles$7 = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","
|
|
565
|
+
var css_248z$7 = ".input-module_input-wrap__NunrE{position:relative;width:100%}.input-module_input-content__kP7lZ{display:flex;width:100%}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background-color:inherit!important}.input-module_error-message-show__OrVSo{animation-fill-mode:forwards;animation-name:input-module_error-show__9MP6k}@keyframes input-module_error-show__9MP6k{to{bottom:-20px;transform:scaleX(1);-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);-o-transform:scaleX(1)}}";
|
|
566
|
+
var styles$7 = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","error-message-show":"input-module_error-message-show__OrVSo","error-show":"input-module_error-show__9MP6k"};
|
|
510
567
|
styleInject(css_248z$7);
|
|
511
568
|
|
|
512
569
|
const InputTypes = {
|
|
570
|
+
TEL: 'tel',
|
|
513
571
|
TEXT: "text",
|
|
514
572
|
PASSWORD: "password"
|
|
515
573
|
};
|
|
516
574
|
const Input = ({
|
|
517
575
|
type,
|
|
576
|
+
size,
|
|
518
577
|
name,
|
|
519
578
|
color,
|
|
520
579
|
label,
|
|
@@ -522,33 +581,62 @@ const Input = ({
|
|
|
522
581
|
width,
|
|
523
582
|
height,
|
|
524
583
|
radius,
|
|
525
|
-
border,
|
|
526
584
|
padding,
|
|
527
585
|
tooltip,
|
|
528
|
-
bgColor,
|
|
529
586
|
leftIcon,
|
|
530
|
-
fontSize,
|
|
531
587
|
required,
|
|
532
588
|
disabled,
|
|
533
589
|
onChange,
|
|
590
|
+
transform,
|
|
534
591
|
iconWidth,
|
|
535
592
|
rightIcon,
|
|
536
593
|
className,
|
|
537
594
|
boxSizing,
|
|
538
595
|
boxShadow,
|
|
539
|
-
|
|
540
|
-
|
|
596
|
+
errorLeft,
|
|
597
|
+
errorSize,
|
|
598
|
+
labelSize,
|
|
599
|
+
labelColor,
|
|
600
|
+
errorColor,
|
|
541
601
|
placeholder,
|
|
602
|
+
errorZindex,
|
|
603
|
+
errorBottom,
|
|
604
|
+
labelWeight,
|
|
605
|
+
errorMessage,
|
|
542
606
|
autoComplete,
|
|
607
|
+
labelDisplay,
|
|
608
|
+
errorPosition,
|
|
543
609
|
boxShadowHover,
|
|
610
|
+
errorClassName,
|
|
611
|
+
errorAnimation,
|
|
612
|
+
errorLineHeight,
|
|
613
|
+
labelLineHeight,
|
|
614
|
+
backgroundColor,
|
|
615
|
+
labelMarginBottom,
|
|
616
|
+
errorAnimationDuration,
|
|
544
617
|
...props
|
|
545
618
|
}) => {
|
|
546
619
|
const [show, setShow] = useState(false);
|
|
547
620
|
const [isHover, setIsHover] = useState(false);
|
|
548
|
-
const [tooltipStatus, setTooltipStatus] = useState(false);
|
|
549
621
|
const random = Math.floor(Math.random() * 1000 + 1);
|
|
550
622
|
const configStyles = compereConfigs();
|
|
551
|
-
const classProps = classnames(className);
|
|
623
|
+
const classProps = classnames(className ? className : configStyles.INPUT.className);
|
|
624
|
+
const errorShow = keyframes`
|
|
625
|
+
100% {
|
|
626
|
+
bottom: '-20px';
|
|
627
|
+
transform: scale3d(1,1,1);
|
|
628
|
+
-webkit-transform: scale3d(1,1,1);
|
|
629
|
+
-moz-transform: scale3d(1,1,1);
|
|
630
|
+
-ms-transform: scale3d(1,1,1);
|
|
631
|
+
-o-transform: scale3d(1,1,1);
|
|
632
|
+
}
|
|
633
|
+
`;
|
|
634
|
+
const animation = _ => css`
|
|
635
|
+
${errorShow} ${errorAnimationDuration ? errorAnimationDuration : configStyles.INPUT.errorAnimationDuration} forwards
|
|
636
|
+
`;
|
|
637
|
+
const P = styled.p`
|
|
638
|
+
animation: ${errorAnimation ? animation : 'none'};
|
|
639
|
+
`;
|
|
552
640
|
const handleChange = event => {
|
|
553
641
|
onChange ? onChange(event.target.value) : _ => _;
|
|
554
642
|
};
|
|
@@ -561,7 +649,15 @@ const Input = ({
|
|
|
561
649
|
return /*#__PURE__*/React.createElement("div", {
|
|
562
650
|
className: `${styles$7["input-wrap"]}`
|
|
563
651
|
}, label ? /*#__PURE__*/React.createElement("label", {
|
|
564
|
-
className: `${styles$7["input-title"]}
|
|
652
|
+
className: `${styles$7["input-title"]}`,
|
|
653
|
+
style: {
|
|
654
|
+
color: labelColor ? labelColor : configStyles.INPUT.labelColor,
|
|
655
|
+
fontSize: labelSize ? labelSize : configStyles.INPUT.labelSize,
|
|
656
|
+
display: labelDisplay ? labelDisplay : configStyles.INPUT.labelDisplay,
|
|
657
|
+
fontWeight: labelWeight ? labelWeight : configStyles.INPUT.labelWeight,
|
|
658
|
+
lineHeight: labelLineHeight ? labelLineHeight : configStyles.INPUT.labelLineHeight,
|
|
659
|
+
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.INPUT.labelMarginBottom
|
|
660
|
+
}
|
|
565
661
|
}, label, " ", required && /*#__PURE__*/React.createElement("sup", {
|
|
566
662
|
style: {
|
|
567
663
|
color: "#ee0000"
|
|
@@ -570,11 +666,11 @@ const Input = ({
|
|
|
570
666
|
className: `${styles$7["input-content"]}`,
|
|
571
667
|
style: {
|
|
572
668
|
borderRadius: radius ? radius : configStyles.INPUT.radius,
|
|
573
|
-
boxShadow: isHover ? boxShadowHover ? boxShadowHover : configStyles.INPUT.boxShadowHover : boxShadow ? boxShadow : configStyles.INPUT.boxShadow
|
|
669
|
+
boxShadow: errorMessage ? errorColor ? `0 0 0 2px ${errorColor}` : `0 0 0 2px ${configStyles.INPUT.errorColor}` : isHover ? boxShadowHover ? boxShadowHover : configStyles.INPUT.boxShadowHover : boxShadow ? boxShadow : configStyles.INPUT.boxShadow
|
|
574
670
|
},
|
|
575
671
|
onMouseEnter: handleMouseEnter,
|
|
576
672
|
onMouseLeave: handleMouseLeave
|
|
577
|
-
}, leftIcon && leftIcon.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
673
|
+
}, leftIcon && leftIcon.length > 0 && type != 'tel' ? /*#__PURE__*/React.createElement("div", {
|
|
578
674
|
onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
|
|
579
675
|
onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
|
|
580
676
|
onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
|
|
@@ -586,9 +682,21 @@ const Input = ({
|
|
|
586
682
|
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
587
683
|
borderTopLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
588
684
|
borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
589
|
-
backgroundColor: disabled ? '#FBFBFB' :
|
|
685
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
590
686
|
}
|
|
591
|
-
}, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', /*#__PURE__*/React.createElement("
|
|
687
|
+
}, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', type === 'tel' ? /*#__PURE__*/React.createElement("div", {
|
|
688
|
+
style: {
|
|
689
|
+
pointerEvents: disabled ? 'none' : 'auto',
|
|
690
|
+
fontSize: size ? size : configStyles.INPUT.size,
|
|
691
|
+
height: height ? height : configStyles.INPUT.height,
|
|
692
|
+
padding: padding ? padding : configStyles.INPUT.padding,
|
|
693
|
+
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
694
|
+
borderTopLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
695
|
+
borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
696
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor,
|
|
697
|
+
color: errorMessage && errorColor ? errorColor : color ? color : configStyles.INPUT.color
|
|
698
|
+
}
|
|
699
|
+
}, "+374") : '', /*#__PURE__*/React.createElement("input", _extends({}, props, {
|
|
592
700
|
value: value,
|
|
593
701
|
className: classProps,
|
|
594
702
|
onChange: handleChange,
|
|
@@ -602,13 +710,13 @@ const Input = ({
|
|
|
602
710
|
outline: 'none',
|
|
603
711
|
pointerEvents: disabled ? 'none' : 'auto',
|
|
604
712
|
width: width ? width : configStyles.INPUT.width,
|
|
713
|
+
fontSize: size ? size : configStyles.INPUT.size,
|
|
605
714
|
height: height ? height : configStyles.INPUT.height,
|
|
606
715
|
padding: padding ? padding : configStyles.INPUT.padding,
|
|
607
716
|
borderRadius: radius ? radius : configStyles.INPUT.radius,
|
|
608
|
-
fontSize: fontSize ? fontSize : configStyles.INPUT.fontSize,
|
|
609
717
|
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
610
|
-
|
|
611
|
-
|
|
718
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor,
|
|
719
|
+
color: errorMessage && errorColor ? errorColor : color ? color : configStyles.INPUT.color
|
|
612
720
|
}
|
|
613
721
|
})), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
614
722
|
onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
|
|
@@ -616,21 +724,27 @@ const Input = ({
|
|
|
616
724
|
onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
|
|
617
725
|
style: {
|
|
618
726
|
cursor: type === 'password' ? 'pointer' : 'default',
|
|
619
|
-
border: border ? border : configStyles.INPUT.border,
|
|
620
727
|
height: height ? height : configStyles.INPUT.height,
|
|
621
728
|
padding: padding ? padding : configStyles.INPUT.padding,
|
|
622
729
|
width: iconWidth ? iconWidth : configStyles.INPUT.iconWidth,
|
|
623
730
|
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
624
731
|
borderTopRightRadius: radius ? radius : configStyles.INPUT.radius,
|
|
625
732
|
borderBottomRightRadius: radius ? radius : configStyles.INPUT.radius,
|
|
626
|
-
backgroundColor: disabled ? '#FBFBFB' :
|
|
733
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
627
734
|
}
|
|
628
|
-
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? /*#__PURE__*/React.createElement(
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
735
|
+
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip && tooltip.length > 0 ? tooltip[0] : '', errorMessage ? /*#__PURE__*/React.createElement(P, {
|
|
736
|
+
style: {
|
|
737
|
+
left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
|
|
738
|
+
color: errorColor ? errorColor : configStyles.INPUT.errorColor,
|
|
739
|
+
fontSize: errorSize ? errorSize : configStyles.INPUT.errorSize,
|
|
740
|
+
bottom: errorBottom ? errorBottom : configStyles.INPUT.errorBottom,
|
|
741
|
+
zIndex: errorZindex ? errorZindex : configStyles.INPUT.errorZindex,
|
|
742
|
+
position: errorPosition ? errorPosition : configStyles.INPUT.errorPosition,
|
|
743
|
+
lineHeight: errorLineHeight ? errorLineHeight : configStyles.INPUT.errorLineHeight,
|
|
744
|
+
transform: !errorAnimation ? 'scale3d(1,1,1)' : transform ? transform : configStyles.INPUT.transform
|
|
745
|
+
},
|
|
746
|
+
className: errorClassName ? errorClassName : configStyles.INPUT.errorClassName
|
|
747
|
+
}, errorMessage) : '');
|
|
634
748
|
};
|
|
635
749
|
Input.propTypes = {
|
|
636
750
|
name: PropTypes.string,
|
|
@@ -643,17 +757,35 @@ Input.propTypes = {
|
|
|
643
757
|
disabled: PropTypes.bool,
|
|
644
758
|
height: PropTypes.string,
|
|
645
759
|
radius: PropTypes.string,
|
|
646
|
-
|
|
760
|
+
padding: PropTypes.string,
|
|
647
761
|
fontSize: PropTypes.string,
|
|
648
|
-
|
|
762
|
+
transform: PropTypes.string,
|
|
649
763
|
className: PropTypes.string,
|
|
650
764
|
iconWidth: PropTypes.string,
|
|
651
765
|
boxSizing: PropTypes.string,
|
|
652
766
|
boxShadow: PropTypes.string,
|
|
767
|
+
errorSize: PropTypes.string,
|
|
768
|
+
errorLeft: PropTypes.string,
|
|
769
|
+
labelSize: PropTypes.string,
|
|
770
|
+
errorColor: PropTypes.string,
|
|
771
|
+
labelColor: PropTypes.string,
|
|
653
772
|
placeholder: PropTypes.string,
|
|
654
|
-
|
|
773
|
+
errorZindex: PropTypes.string,
|
|
774
|
+
errorBottom: PropTypes.string,
|
|
775
|
+
labelWeight: PropTypes.string,
|
|
776
|
+
errorMessage: PropTypes.string,
|
|
655
777
|
autoComplete: PropTypes.string,
|
|
778
|
+
errorAnimation: PropTypes.bool,
|
|
779
|
+
labelDisplay: PropTypes.string,
|
|
780
|
+
errorPosition: PropTypes.string,
|
|
656
781
|
boxShadowHover: PropTypes.string,
|
|
782
|
+
errorClassName: PropTypes.string,
|
|
783
|
+
backgroundColor: PropTypes.string,
|
|
784
|
+
errorLineHeight: PropTypes.string,
|
|
785
|
+
labelLineHeight: PropTypes.string,
|
|
786
|
+
labelMarginBottom: PropTypes.string,
|
|
787
|
+
errorAnimationDuration: PropTypes.string,
|
|
788
|
+
tooltip: PropTypes.arrayOf(PropTypes.element),
|
|
657
789
|
leftIcon: PropTypes.arrayOf(PropTypes.element),
|
|
658
790
|
rightIcon: PropTypes.arrayOf(PropTypes.element),
|
|
659
791
|
type: PropTypes.oneOf(Object.values(InputTypes))
|
|
@@ -717,27 +849,30 @@ Radio.defaultProps = {
|
|
|
717
849
|
};
|
|
718
850
|
|
|
719
851
|
const Button = ({
|
|
852
|
+
size,
|
|
720
853
|
type,
|
|
854
|
+
font,
|
|
721
855
|
color,
|
|
722
856
|
label,
|
|
723
857
|
width,
|
|
724
858
|
height,
|
|
725
859
|
cursor,
|
|
860
|
+
weight,
|
|
726
861
|
border,
|
|
862
|
+
radius,
|
|
727
863
|
outline,
|
|
728
864
|
padding,
|
|
729
865
|
onClick,
|
|
730
|
-
fontSize,
|
|
731
866
|
disabled,
|
|
732
867
|
className,
|
|
733
868
|
boxSizing,
|
|
734
869
|
transition,
|
|
735
870
|
contentWidth,
|
|
736
|
-
|
|
871
|
+
disabledColor,
|
|
872
|
+
textTransform,
|
|
737
873
|
backgroundColor,
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
disabledThemeLineColor,
|
|
874
|
+
disabledLineColor,
|
|
875
|
+
disabledBackgroundColor,
|
|
741
876
|
...props
|
|
742
877
|
}) => {
|
|
743
878
|
const [isHover, setIsHover] = useState(false);
|
|
@@ -756,18 +891,21 @@ const Button = ({
|
|
|
756
891
|
};
|
|
757
892
|
return /*#__PURE__*/React.createElement("button", _extends({
|
|
758
893
|
style: {
|
|
894
|
+
fontSize: size ? size : configStyles.BUTTON.size,
|
|
895
|
+
fontFamily: font ? font : configStyles.BUTTON.font,
|
|
759
896
|
height: height ? height : configStyles.BUTTON.height,
|
|
897
|
+
fontWeight: weight ? weight : configStyles.BUTTON.weight,
|
|
760
898
|
padding: padding ? padding : configStyles.BUTTON.padding,
|
|
761
|
-
|
|
899
|
+
borderRadius: radius ? radius : configStyles.BUTTON.radius,
|
|
762
900
|
boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
|
|
763
901
|
transition: transition ? transition : configStyles.BUTTON.transition,
|
|
764
902
|
border: outline ? 'none' : border ? border : configStyles.BUTTON.border,
|
|
765
903
|
width: contentWidth ? 'auto' : width ? width : configStyles.BUTTON.width,
|
|
766
|
-
borderRadius: borderRadius ? borderRadius : configStyles.BUTTON.borderRadius,
|
|
767
904
|
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.BUTTON.cursor,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
905
|
+
textTransform: textTransform ? textTransform : configStyles.BUTTON.textTransform,
|
|
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
|
|
771
909
|
},
|
|
772
910
|
type: type ? type : configStyles.BUTTON.type,
|
|
773
911
|
disabled: disabled ? disabled : configStyles.BUTTON.disabled,
|
|
@@ -779,26 +917,29 @@ const Button = ({
|
|
|
779
917
|
};
|
|
780
918
|
Button.propTypes = {
|
|
781
919
|
type: PropTypes.string,
|
|
920
|
+
size: PropTypes.string,
|
|
921
|
+
font: PropTypes.string,
|
|
782
922
|
color: PropTypes.string,
|
|
783
923
|
width: PropTypes.string,
|
|
784
924
|
outline: PropTypes.bool,
|
|
785
925
|
onClick: PropTypes.func,
|
|
926
|
+
weight: PropTypes.string,
|
|
786
927
|
height: PropTypes.string,
|
|
787
928
|
cursor: PropTypes.string,
|
|
788
929
|
border: PropTypes.string,
|
|
789
930
|
disabled: PropTypes.bool,
|
|
931
|
+
radius: PropTypes.string,
|
|
790
932
|
padding: PropTypes.string,
|
|
791
|
-
fontSize: PropTypes.string,
|
|
792
933
|
boxSizing: PropTypes.string,
|
|
793
934
|
className: PropTypes.string,
|
|
794
935
|
transition: PropTypes.string,
|
|
795
936
|
contentWidth: PropTypes.bool,
|
|
796
|
-
|
|
937
|
+
textTransform: PropTypes.string,
|
|
938
|
+
disabledColor: PropTypes.string,
|
|
797
939
|
backgroundColor: PropTypes.string,
|
|
798
940
|
label: PropTypes.string.isRequired,
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
disabledThemeLineColor: PropTypes.string
|
|
941
|
+
disabledLineColor: PropTypes.string,
|
|
942
|
+
disabledBackgroundColor: PropTypes.string
|
|
802
943
|
};
|
|
803
944
|
|
|
804
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}";
|
|
@@ -927,7 +1068,9 @@ Select.defaultProps = {
|
|
|
927
1068
|
required: false
|
|
928
1069
|
};
|
|
929
1070
|
|
|
930
|
-
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}";
|
|
931
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"};
|
|
932
1075
|
styleInject(css_248z$4);
|
|
933
1076
|
|
|
@@ -936,58 +1079,57 @@ const Tooltip = ({
|
|
|
936
1079
|
text,
|
|
937
1080
|
width,
|
|
938
1081
|
color,
|
|
939
|
-
tIcon,
|
|
940
1082
|
height,
|
|
941
|
-
|
|
1083
|
+
radius,
|
|
942
1084
|
fontSize,
|
|
943
|
-
tBgColor,
|
|
944
1085
|
className,
|
|
945
1086
|
fontFamily,
|
|
946
|
-
|
|
947
|
-
|
|
1087
|
+
tooltipIcon,
|
|
1088
|
+
tooltipWidth,
|
|
1089
|
+
tooltipRadius,
|
|
1090
|
+
backgroundColor,
|
|
1091
|
+
tooltipBackgroundColor
|
|
948
1092
|
}) => {
|
|
949
1093
|
const tooltipRef = /*#__PURE__*/createRef(null);
|
|
950
|
-
const [
|
|
951
|
-
const [
|
|
1094
|
+
const [checkTooltipWidth, setCheckTooltipWidth] = useState(0);
|
|
1095
|
+
const [checkTooltipHeight, setCheckTooltipHeight] = useState(0);
|
|
952
1096
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
953
1097
|
const configStyles = compereConfigs();
|
|
954
1098
|
const classProps = classnames(styles$4['tooltip'], className);
|
|
955
|
-
useEffect(_ => {
|
|
956
|
-
if (!type && !text) {
|
|
957
|
-
alert('Add type and text on tooltip');
|
|
958
|
-
} else if (!type) {
|
|
959
|
-
alert('Add type on tooltip');
|
|
960
|
-
} else if (!text) {
|
|
961
|
-
alert('Add text on tooltip');
|
|
962
|
-
}
|
|
963
|
-
tooltipRef.current && tooltipRef.current.clientWidth && tooltipRef.current.clientWidth > 0 && setTooltipWidth(tooltipRef.current.clientWidth);
|
|
964
|
-
tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setTooltipHeight(tooltipRef.current.clientHeight);
|
|
965
|
-
}, [type, text, tooltipWidth, tooltipRef]);
|
|
966
1099
|
const handleShow = () => {
|
|
967
1100
|
setShowTooltip(!showTooltip);
|
|
968
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]);
|
|
969
1109
|
return /*#__PURE__*/React.createElement("div", {
|
|
970
1110
|
className: `${styles$4['tooltip-block']}`,
|
|
971
1111
|
style: {
|
|
972
1112
|
width: width ? width : configStyles.TOOLTIP.width,
|
|
973
1113
|
height: height ? height : configStyles.TOOLTIP.height,
|
|
974
|
-
|
|
1114
|
+
borderRadius: radius ? radius : configStyles.TOOLTIP.radius,
|
|
1115
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.TOOLTIP.backgroundColor
|
|
975
1116
|
}
|
|
976
1117
|
}, showTooltip ? /*#__PURE__*/React.createElement("div", {
|
|
977
1118
|
ref: tooltipRef,
|
|
978
1119
|
className: classProps,
|
|
979
1120
|
style: {
|
|
980
|
-
|
|
981
|
-
borderRadius:
|
|
982
|
-
|
|
983
|
-
|
|
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'
|
|
984
1126
|
}
|
|
985
1127
|
}, /*#__PURE__*/React.createElement("div", {
|
|
986
1128
|
className: `${styles$4['tooltip-rel']}`
|
|
987
1129
|
}, /*#__PURE__*/React.createElement("div", {
|
|
988
1130
|
className: `${styles$4['tooltip-decor']}`,
|
|
989
1131
|
style: {
|
|
990
|
-
backgroundColor:
|
|
1132
|
+
backgroundColor: tooltipBackgroundColor ? tooltipBackgroundColor : configStyles.TOOLTIP.tooltipBackgroundColor,
|
|
991
1133
|
left: type === 'top' || type === 'bottom' ? 'calc(50% - 5px)' : type === 'right' ? '-15px' : type === 'left' ? 'calc(100% + 5px)' : '0px',
|
|
992
1134
|
top: type === 'top' ? 'calc(100% + 5px)' : type === 'bottom' ? '-15px' : type === 'right' || type === 'left' ? 'calc(50% - 5px)' : '0px'
|
|
993
1135
|
}
|
|
@@ -995,7 +1137,6 @@ const Tooltip = ({
|
|
|
995
1137
|
style: {
|
|
996
1138
|
color: color ? color : configStyles.TOOLTIP.color,
|
|
997
1139
|
fontSize: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
|
|
998
|
-
lineHeight: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
|
|
999
1140
|
fontFamily: fontFamily ? fontFamily : configStyles.TOOLTIP.fontFamily
|
|
1000
1141
|
}
|
|
1001
1142
|
}, text))) : '', /*#__PURE__*/React.createElement("div", {
|
|
@@ -1003,22 +1144,28 @@ const Tooltip = ({
|
|
|
1003
1144
|
cursor: 'pointer'
|
|
1004
1145
|
},
|
|
1005
1146
|
onClick: handleShow
|
|
1006
|
-
}
|
|
1147
|
+
}, tooltipIcon && tooltipIcon[0] ? tooltipIcon[0] : /*#__PURE__*/React.createElement("img", {
|
|
1148
|
+
src: ReactInfoIcon
|
|
1149
|
+
})));
|
|
1007
1150
|
};
|
|
1008
1151
|
Tooltip.propTypes = {
|
|
1152
|
+
type: PropTypes.string,
|
|
1009
1153
|
width: PropTypes.string,
|
|
1010
1154
|
color: PropTypes.string,
|
|
1011
|
-
tIcon: PropTypes.element,
|
|
1012
1155
|
height: PropTypes.string,
|
|
1013
|
-
|
|
1014
|
-
tBgColor: PropTypes.string,
|
|
1156
|
+
radius: PropTypes.string,
|
|
1015
1157
|
fontSize: PropTypes.string,
|
|
1016
1158
|
className: PropTypes.string,
|
|
1017
1159
|
fontFamily: PropTypes.string,
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
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'
|
|
1022
1169
|
};
|
|
1023
1170
|
|
|
1024
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}";
|
|
@@ -1288,20 +1435,22 @@ var styles = {"autocomplate-content":"autocomplate-module_autocomplate-content__
|
|
|
1288
1435
|
styleInject(css_248z);
|
|
1289
1436
|
|
|
1290
1437
|
const Autocomplate = ({
|
|
1291
|
-
className,
|
|
1292
1438
|
label,
|
|
1439
|
+
value,
|
|
1293
1440
|
required,
|
|
1294
1441
|
disabled,
|
|
1295
|
-
|
|
1296
|
-
jsonSelectedOptionsData,
|
|
1442
|
+
keyNames,
|
|
1297
1443
|
onChange,
|
|
1298
|
-
|
|
1444
|
+
className,
|
|
1299
1445
|
searchCount,
|
|
1300
1446
|
placeHolder,
|
|
1301
|
-
keyNames,
|
|
1302
1447
|
errorMesage,
|
|
1448
|
+
autoComplete,
|
|
1449
|
+
jsonOptionsData,
|
|
1450
|
+
jsonSelectedOptionsData,
|
|
1303
1451
|
...props
|
|
1304
1452
|
}) => {
|
|
1453
|
+
const configStyles = compereConfigs();
|
|
1305
1454
|
classnames(styles.searchBox, className);
|
|
1306
1455
|
const parseSelectedOptionsData = jsonSelectedOptionsData ? JSON.parse(jsonSelectedOptionsData) : {
|
|
1307
1456
|
name: '',
|
|
@@ -1312,10 +1461,6 @@ const Autocomplate = ({
|
|
|
1312
1461
|
const [activeOption, setActiveOption] = useState(0);
|
|
1313
1462
|
const [showOptions, setShowOptions] = useState(false);
|
|
1314
1463
|
const parseOptionsData = jsonOptionsData ? JSON.parse(jsonOptionsData) : [];
|
|
1315
|
-
useEffect(() => {
|
|
1316
|
-
setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name]);
|
|
1317
|
-
setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id]);
|
|
1318
|
-
}, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]]);
|
|
1319
1464
|
const handleChange = e => {
|
|
1320
1465
|
const currentInputValue = e.currentTarget.value;
|
|
1321
1466
|
setInputId(null);
|
|
@@ -1371,6 +1516,10 @@ const Autocomplate = ({
|
|
|
1371
1516
|
}, inputValue.length < searchCount ? `Լրացնել առնվազն ${searchCount} նիշ` : 'Նման տվյալ առկա չէ'))));
|
|
1372
1517
|
}
|
|
1373
1518
|
}
|
|
1519
|
+
useEffect(() => {
|
|
1520
|
+
setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name]);
|
|
1521
|
+
setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id]);
|
|
1522
|
+
}, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]]);
|
|
1374
1523
|
return /*#__PURE__*/React.createElement(React.Fragment, null, label ? /*#__PURE__*/React.createElement("label", {
|
|
1375
1524
|
className: `${styles['autocomplate-title']} autocomplate-title-rem`
|
|
1376
1525
|
}, label, " ", required && /*#__PURE__*/React.createElement("sup", {
|
|
@@ -1382,6 +1531,7 @@ const Autocomplate = ({
|
|
|
1382
1531
|
}, /*#__PURE__*/React.createElement("input", _extends({
|
|
1383
1532
|
id: inputId,
|
|
1384
1533
|
type: "text",
|
|
1534
|
+
autoComplete: autoComplete ? autoComplete : configStyles.INPUT.autoComplete,
|
|
1385
1535
|
className: `${styles['autocomplate-content-top']} autocomplate-content-top-rem ${errorMesage ? styles.errorBorder : ''}`,
|
|
1386
1536
|
disabled: disabled,
|
|
1387
1537
|
onChange: handleChange,
|
|
@@ -1395,18 +1545,19 @@ const Autocomplate = ({
|
|
|
1395
1545
|
}, errorMesage) : null, optionList));
|
|
1396
1546
|
};
|
|
1397
1547
|
Autocomplate.propTypes = {
|
|
1398
|
-
className: PropTypes.string,
|
|
1399
1548
|
label: PropTypes.string,
|
|
1400
|
-
placeHolder: PropTypes.string,
|
|
1401
|
-
required: PropTypes.bool,
|
|
1402
1549
|
disabled: PropTypes.bool,
|
|
1403
|
-
|
|
1404
|
-
jsonSelectedOptionsData: PropTypes.string,
|
|
1550
|
+
required: PropTypes.bool,
|
|
1405
1551
|
onChange: PropTypes.func,
|
|
1406
1552
|
value: PropTypes.string,
|
|
1407
|
-
searchCount: PropTypes.number,
|
|
1408
1553
|
keyNames: PropTypes.object,
|
|
1409
|
-
|
|
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
|
|
1410
1561
|
};
|
|
1411
1562
|
Autocomplate.defaultProps = {
|
|
1412
1563
|
required: false
|