@xaypay/tui 0.0.56 → 0.0.57

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 CHANGED
@@ -97,6 +97,12 @@ const File = ({
97
97
  setFileName('no selected file');
98
98
  document.querySelector(`.${name}`).value = "";
99
99
  };
100
+ useEffect(() => {
101
+ return () => {
102
+ setError('');
103
+ setImage(null);
104
+ };
105
+ }, []);
100
106
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
101
107
  className: `${styles$b['file-form-title']} ile-form-title-rem`
102
108
  }, label, " ", required && /*#__PURE__*/React.createElement("sup", {
@@ -362,13 +368,7 @@ const _ = require('lodash');
362
368
  const compereConfigs = () => {
363
369
  let projectConfig = {};
364
370
  let packageConfig = {};
365
- try {
366
- packageConfig = require('../tui.config.js');
367
- } catch (error) {
368
- packageConfig = require('../../tui.config.js');
369
- // console.log(error, 'Package: tui.config.js file is not define');
370
- }
371
-
371
+ packageConfig = require(process.env.STORYBOOK_PATH);
372
372
  try {
373
373
  projectConfig = require('../../../../tui.config.js');
374
374
  } catch (error) {
@@ -399,7 +399,6 @@ const Typography = ({
399
399
  margin,
400
400
  padding,
401
401
  variant,
402
- bgColor,
403
402
  onClick,
404
403
  children,
405
404
  textAlign,
@@ -411,45 +410,18 @@ const Typography = ({
411
410
  fontFamily,
412
411
  textTransform,
413
412
  textDecoration,
413
+ backgroundColor,
414
414
  ...props
415
415
  }) => {
416
416
  const configStyles = compereConfigs();
417
417
  const classProps = classnames(className);
418
418
  const [isHover, setIsHover] = useState(false);
419
419
  const [validVariant, setValidVariant] = useState(false);
420
- const [style, setStyle] = useState({
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]
437
- });
438
420
  useEffect(() => {
439
421
  if (!Object.values(TypographyType).includes(variant)) {
440
422
  setValidVariant(true);
441
423
  }
442
424
  }, [variant]);
443
- useEffect(() => {
444
- if (color) {
445
- setStyle(prev => {
446
- return {
447
- ...prev,
448
- color: color
449
- };
450
- });
451
- }
452
- }, [color]);
453
425
  const handleMouseEnter = () => {
454
426
  setIsHover(true);
455
427
  };
@@ -457,7 +429,24 @@ const Typography = ({
457
429
  setIsHover(false);
458
430
  };
459
431
  const tagT = /*#__PURE__*/React.createElement(variant, {
460
- style,
432
+ style: {
433
+ border: border ? border : configStyles.TYPOGRAPHY.border,
434
+ cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
435
+ borderRadius: radius ? radius : configStyles.TYPOGRAPHY.radius,
436
+ fontSize: size ? size : configStyles.TYPOGRAPHY['size' + variant],
437
+ margin: margin ? margin : configStyles.TYPOGRAPHY['margin' + variant],
438
+ fontWeight: weight ? weight : configStyles.TYPOGRAPHY['weight' + variant],
439
+ padding: padding ? padding : configStyles.TYPOGRAPHY['padding' + variant],
440
+ textShadow: textShadow ? textShadow : configStyles.TYPOGRAPHY.textShadow,
441
+ textAlign: textAlign ? textAlign : configStyles.TYPOGRAPHY['textAlign' + variant],
442
+ fontStyle: fontStyle ? fontStyle : configStyles.TYPOGRAPHY['fontStyle' + variant],
443
+ lineHeight: lineHeight ? lineHeight : configStyles.TYPOGRAPHY['lineHeight' + variant],
444
+ fontFamily: fontFamily ? fontFamily : configStyles.TYPOGRAPHY['fontFamily' + variant],
445
+ textTransform: textTransform ? textTransform : configStyles.TYPOGRAPHY['textTransform' + variant],
446
+ textDecoration: textDecoration ? textDecoration : configStyles.TYPOGRAPHY['textDecoration' + variant],
447
+ backgroundColor: backgroundColor ? backgroundColor : configStyles.TYPOGRAPHY['backgroundColor' + variant],
448
+ color: isHover ? colorHover ? colorHover : configStyles.TYPOGRAPHY['colorHover' + variant] : color ? color : configStyles.TYPOGRAPHY['color' + variant]
449
+ },
461
450
  ...props,
462
451
  className: classProps,
463
452
  onClick: onClick ? onClick : _ => _,
@@ -475,7 +464,6 @@ Typography.propTypes = {
475
464
  cursor: PropTypes.string,
476
465
  margin: PropTypes.string,
477
466
  radius: PropTypes.string,
478
- bgColor: PropTypes.string,
479
467
  padding: PropTypes.string,
480
468
  textAlign: PropTypes.string,
481
469
  className: PropTypes.string,
@@ -486,6 +474,7 @@ Typography.propTypes = {
486
474
  colorHover: PropTypes.string,
487
475
  textTransform: PropTypes.string,
488
476
  textDecoration: PropTypes.string,
477
+ backgroundColor: PropTypes.string,
489
478
  variant: PropTypes.oneOf(Object.values(TypographyType))
490
479
  };
491
480
  Typography.defaultProps = {
@@ -665,6 +654,7 @@ const Input = ({
665
654
  }, "*")) : '', /*#__PURE__*/React.createElement("div", {
666
655
  className: `${styles$7["input-content"]}`,
667
656
  style: {
657
+ width: width ? width : configStyles.INPUT.width,
668
658
  borderRadius: radius ? radius : configStyles.INPUT.radius,
669
659
  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
670
660
  },
@@ -732,7 +722,7 @@ const Input = ({
732
722
  borderBottomRightRadius: radius ? radius : configStyles.INPUT.radius,
733
723
  backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
734
724
  }
735
- }, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip && tooltip.length > 0 ? tooltip[0] : '', errorMessage ? /*#__PURE__*/React.createElement(P, {
725
+ }, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', errorMessage ? /*#__PURE__*/React.createElement(P, {
736
726
  style: {
737
727
  left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
738
728
  color: errorColor ? errorColor : configStyles.INPUT.errorColor,
@@ -759,6 +749,7 @@ Input.propTypes = {
759
749
  radius: PropTypes.string,
760
750
  padding: PropTypes.string,
761
751
  fontSize: PropTypes.string,
752
+ tooltip: PropTypes.element,
762
753
  transform: PropTypes.string,
763
754
  className: PropTypes.string,
764
755
  iconWidth: PropTypes.string,
@@ -785,7 +776,6 @@ Input.propTypes = {
785
776
  labelLineHeight: PropTypes.string,
786
777
  labelMarginBottom: PropTypes.string,
787
778
  errorAnimationDuration: PropTypes.string,
788
- tooltip: PropTypes.arrayOf(PropTypes.element),
789
779
  leftIcon: PropTypes.arrayOf(PropTypes.element),
790
780
  rightIcon: PropTypes.arrayOf(PropTypes.element),
791
781
  type: PropTypes.oneOf(Object.values(InputTypes))
@@ -942,42 +932,99 @@ Button.propTypes = {
942
932
  disabledBackgroundColor: PropTypes.string
943
933
  };
944
934
 
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}";
946
- var styles$5 = {"select-title":"select-module_select-title__c8bR7","select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","active":"select-module_active__v2Dce","select-content-bottom":"select-module_select-content-bottom__ueZCR","select-show":"select-module_select-show__391hQ","select-content-bottom-inner":"select-module_select-content-bottom-inner__NWy2X","select-content-top-text":"select-module_select-content-top-text__euajq","select-content-top-icon":"select-module_select-content-top-icon__MBrGK","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L","error-message":"select-module_error-message__-ac6X","eMessage":"select-module_eMessage__Mm-F7"};
935
+ var ReactArrowIcon = "<svg width=\"15\" height=\"9\" viewBox=\"0 0 15 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.9878 8.00003C7.75456 8.00049 7.52851 7.91911 7.34892 7.77003L1.3594 2.77003C1.15554 2.60029 1.02734 2.35638 1.003 2.09196C0.978666 1.82753 1.06019 1.56425 1.22963 1.36003C1.39907 1.15581 1.64255 1.02739 1.90652 1.00301C2.17048 0.978631 2.4333 1.06029 2.63716 1.23003L7.9878 5.71003L13.3384 1.39003C13.4405 1.30697 13.558 1.24493 13.6842 1.2075C13.8103 1.17007 13.9425 1.15798 14.0733 1.17192C14.2041 1.18586 14.3309 1.22555 14.4463 1.28873C14.5618 1.3519 14.6636 1.4373 14.746 1.54003C14.8374 1.64285 14.9066 1.76348 14.9493 1.89435C14.9921 2.02523 15.0073 2.16353 14.9942 2.30059C14.9811 2.43765 14.9399 2.57053 14.8731 2.69088C14.8063 2.81124 14.7155 2.91649 14.6062 3.00003L8.6167 7.83003C8.43194 7.95555 8.21051 8.0154 7.9878 8.00003Z\" fill=\"#3C393E\"/>\n</svg>";
936
+
937
+ var ReactCloseIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12.4253 0.241029L12.431 0.236144C12.6129 0.0804082 12.8468 -0.00097097 13.0861 0.00827014C13.3253 0.0175112 13.5523 0.116692 13.7216 0.285992C13.8909 0.455292 13.9901 0.682241 13.9993 0.921488C14.0085 1.16074 13.9272 1.39466 13.7714 1.57651L13.7665 1.58222L8.38622 6.96254L13.7665 12.3429L13.7714 12.3486C13.9272 12.5304 14.0085 12.7643 13.9993 13.0036C13.9901 13.2428 13.8909 13.4698 13.7216 13.6391C13.5523 13.8084 13.3253 13.9076 13.0861 13.9168C12.8468 13.926 12.6129 13.8447 12.431 13.6889L12.4253 13.684L7.04493 8.30363L1.66742 13.6738C1.58315 13.7705 1.48016 13.8492 1.36462 13.9051C1.24669 13.9622 1.11823 13.9942 0.987309 13.9993C0.85639 14.0043 0.72584 13.9823 0.603852 13.9345C0.481865 13.8867 0.371073 13.8142 0.27843 13.7216C0.185788 13.6289 0.113295 13.5181 0.0655034 13.3961C0.0177115 13.2742 -0.00434842 13.1436 0.000708381 13.0127C0.00576522 12.8818 0.0378304 12.7533 0.0948891 12.6354C0.150805 12.5198 0.229542 12.4168 0.326326 12.3325L5.70384 6.96235L0.323475 1.57461L0.318633 1.56895C0.162897 1.3871 0.0815178 1.15317 0.0907589 0.913926C0.1 0.674678 0.199181 0.447729 0.36848 0.27843C0.53778 0.10913 0.76473 0.00995005 1.00398 0.000708956C1.24322 -0.00853214 1.47715 0.0728459 1.659 0.228582L1.66476 0.233511L7.04512 5.62125L12.4253 0.241029Z\" fill=\"#3C393E\"/>\n</svg>";
938
+
939
+ var css_248z$5 = ".select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;display:flex;flex-direction:row;flex-wrap:nowrap;justify-content:space-between}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;-webkit-animation:select-module_select-show__391hQ .64s linear forwards;left:0;max-height:0;overflow:hidden;position:absolute;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}.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>div{align-items:center;display:flex;height:14px;justify-content:center;width:14px}.select-module_close-icon__SFNaJ{border-right:1px solid #eee;padding-right:9px}.select-module_arrow-icon__rjHt-{margin-left:9px;transform-origin:center;transition:all .64s ease;-webkit-transition:all .64s ease;-moz-transition:all .64s ease;-ms-transition:all .64s ease;-o-transition:all .64s ease}.select-module_select-content-bottom-row__eKq5L{align-items:center;display:flex;transition:background-color .24s,color .24s;-webkit-transition:background-color .24s,color .24s;-moz-transition:background-color .24s,color .24s;-ms-transition:background-color .24s,color .24s;-o-transition:background-color .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
940
+ var styles$5 = {"select-content":"select-module_select-content__GCMDX","select-content-top":"select-module_select-content-top__Aw-fB","select-content-bottom":"select-module_select-content-bottom__ueZCR","select-show":"select-module_select-show__391hQ","select-content-bottom-inner":"select-module_select-content-bottom-inner__NWy2X","select-content-top-icon":"select-module_select-content-top-icon__MBrGK","close-icon":"select-module_close-icon__SFNaJ","arrow-icon":"select-module_arrow-icon__rjHt-","select-content-bottom-row":"select-module_select-content-bottom-row__eKq5L"};
947
941
  styleInject(css_248z$5);
948
942
 
949
- const SelectTheme = {
950
- DEFAULT: 'select-default',
951
- PRIMARY: 'select-primary',
952
- SUCCESS: 'select-success',
953
- INFO: 'select-info',
954
- WARNING: 'select-warning',
955
- DANGER: 'select-danger',
956
- LINK: 'select-link'
957
- };
958
- const SelectSize = {
959
- SMALL: 'small',
960
- MEDIUM: 'medium',
961
- LARGE: 'large'
962
- };
963
943
  const Select = ({
964
- theme,
965
- size,
966
- className,
967
944
  disabled,
968
- label,
969
945
  jsonData,
970
- eMessage,
971
946
  required,
972
- defaultOption,
973
947
  onChange,
974
948
  keyNames,
975
- selected
949
+ selected,
950
+ className,
951
+ arrowIcon,
952
+ closeIcon,
953
+ errorMessage,
954
+ defaultOption,
955
+ label,
956
+ labelColor,
957
+ labelWeight,
958
+ labelDisplay,
959
+ labelFontSize,
960
+ labelLineHeight,
961
+ labelMarginBottom,
962
+ labelTextTransform,
963
+ cursor,
964
+ errorSize,
965
+ errorColor,
966
+ selectedColor,
967
+ selectedRadius,
968
+ selectedHeight,
969
+ selectedBorder,
970
+ selectedPadding,
971
+ selectedFontSize,
972
+ selectedBoxSizing,
973
+ selectedFontWeight,
974
+ selectedLineHeight,
975
+ selectedHoverColor,
976
+ selectedTransition,
977
+ selectedBorderColor,
978
+ optionsBoxShadow,
979
+ optionsBorderRadius,
980
+ optionsBackgroundColor,
981
+ optionItemColor,
982
+ optionItemCursor,
983
+ optionItemPadding,
984
+ optionItemFontSize,
985
+ optionItemMinHeight,
986
+ optionItemBoxSizing,
987
+ optionItemFontWeight,
988
+ optionItemLineHeight,
989
+ optionItemColorHover,
990
+ optionItemMarginBottom,
991
+ optionItemBackgroudColor,
992
+ optionItemBackgroudColorHover
976
993
  }) => {
977
994
  const options = jsonData.length ? JSON.parse(jsonData) : [];
978
995
  const ref = useRef();
979
- let [opened, setOpened] = useState(false);
980
- let [newSelected, setNewSelected] = useState({});
996
+ const [opened, setOpened] = useState(false);
997
+ const [isHover, setIsHover] = useState(false);
998
+ const [newSelected, setNewSelected] = useState({});
999
+ const configStyles = compereConfigs();
1000
+ const classProps = classnames(className);
1001
+ const handleOpenClose = () => {
1002
+ setOpened(!opened);
1003
+ };
1004
+ const handleClearSelect = e => {
1005
+ onChange({});
1006
+ setNewSelected({});
1007
+ e.stopPropagation();
1008
+ };
1009
+ const handleSelectItem = option => {
1010
+ onChange(option);
1011
+ setOpened(!opened);
1012
+ setNewSelected(option);
1013
+ };
1014
+ const handleMouseEnter = () => {
1015
+ setIsHover(true);
1016
+ };
1017
+ const handleMouseLeave = () => {
1018
+ setIsHover(false);
1019
+ };
1020
+ const handleMouseEnterOption = e => {
1021
+ e.target.style.color = optionItemColorHover ? optionItemColorHover : configStyles.SELECT.optionItemColorHover;
1022
+ e.target.style.backgroundColor = optionItemBackgroudColorHover ? optionItemBackgroudColorHover : configStyles.SELECT.optionItemBackgroudColorHover;
1023
+ };
1024
+ const handleMouseLeaveOption = e => {
1025
+ e.target.style.color = optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor;
1026
+ e.target.style.backgroundColor = optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor;
1027
+ };
981
1028
  useEffect(() => {
982
1029
  const parseSelectedData = selected.length !== 0 ? JSON.parse(selected) : {};
983
1030
  setNewSelected(parseSelectedData);
@@ -995,77 +1042,154 @@ const Select = ({
995
1042
  };
996
1043
  }
997
1044
  }, [opened]);
998
- classnames(styles$5[theme], styles$5[size], {
999
- [styles$5.disabled]: disabled,
1000
- [styles$5.required]: required
1001
- }, className);
1002
- return /*#__PURE__*/React.createElement("div", null, label ? /*#__PURE__*/React.createElement("label", {
1003
- className: `${styles$5['select-title']} select-title-rem`
1004
- }, label, " ", required && /*#__PURE__*/React.createElement("sup", {
1045
+ return /*#__PURE__*/React.createElement("div", {
1046
+ className: classProps
1047
+ }, label ? /*#__PURE__*/React.createElement("label", {
1048
+ style: {
1049
+ color: labelColor ? labelColor : configStyles.SELECT.labelColor,
1050
+ fontWeight: labelWeight ? labelWeight : configStyles.SELECT.labelWeight,
1051
+ display: labelDisplay ? labelDisplay : configStyles.SELECT.labelDisplay,
1052
+ fontSize: labelFontSize ? labelFontSize : configStyles.SELECT.labelFontSize,
1053
+ lineHeight: labelLineHeight ? labelLineHeight : configStyles.SELECT.labelLineHeight,
1054
+ marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.SELECT.labelMarginBottom,
1055
+ textTransform: labelTextTransform ? labelTextTransform : configStyles.SELECT.labelTextTransform
1056
+ }
1057
+ }, label, required && /*#__PURE__*/React.createElement("sup", {
1005
1058
  style: {
1006
1059
  color: "#ee0000"
1007
1060
  }
1008
1061
  }, "*")) : "", /*#__PURE__*/React.createElement("div", {
1009
- className: `${styles$5['select-wrap']} select-wrap-rem`,
1010
1062
  ref: ref
1011
1063
  }, /*#__PURE__*/React.createElement("div", {
1012
- className: styles$5['select-content'],
1013
- id: styles$5.selector
1064
+ className: styles$5['select-content']
1014
1065
  }, /*#__PURE__*/React.createElement("div", {
1015
- className: `${styles$5['select-content-top']} select-content-top-rem ${eMessage ? styles$5['error-message'] : ''}`,
1016
- onClick: () => {
1017
- setOpened(!opened);
1018
- }
1066
+ style: {
1067
+ cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.SELECT.cursor,
1068
+ height: selectedHeight ? selectedHeight : configStyles.SELECT.selectedHeight,
1069
+ border: selectedBorder ? selectedBorder : configStyles.SELECT.selectedBorder,
1070
+ padding: selectedPadding ? selectedPadding : configStyles.SELECT.selectedPadding,
1071
+ borderRadius: selectedRadius ? selectedRadius : configStyles.SELECT.selectedRadius,
1072
+ fontSize: selectedFontSize ? selectedFontSize : configStyles.SELECT.selectedFontSize,
1073
+ boxSizing: selectedBoxSizing ? selectedBoxSizing : configStyles.SELECT.selectedBoxSizing,
1074
+ fontWeight: selectedFontWeight ? selectedFontWeight : configStyles.SELECT.selectedFontWeight,
1075
+ lineHeight: selectedLineHeight ? selectedLineHeight : configStyles.SELECT.selectedLineHeight,
1076
+ transition: selectedTransition ? selectedTransition : configStyles.SELECT.selectedTransition,
1077
+ borderColor: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : selectedBorderColor ? selectedBorderColor : configStyles.SELECT.selectedBorderColor
1078
+ },
1079
+ onClick: disabled ? _ => _ : _ => handleOpenClose(),
1080
+ onMouseEnter: disabled ? _ => _ : handleMouseEnter,
1081
+ onMouseLeave: disabled ? _ => _ : handleMouseLeave,
1082
+ className: `${styles$5['select-content-top']}`
1019
1083
  }, /*#__PURE__*/React.createElement("div", {
1020
- className: `${styles$5['select-content-top-text']} select-content-top-text-rem`
1021
- }, newSelected && newSelected[keyNames.name] ? newSelected[keyNames.name] : defaultOption), /*#__PURE__*/React.createElement("div", {
1022
- className: `${styles$5['select-content-top-icon']} select-content-top-icon-rem`
1023
- }, Object.keys(newSelected).length > 0 && /*#__PURE__*/React.createElement("i", {
1024
- className: "icon-close",
1025
- onClick: e => {
1026
- setNewSelected({});
1027
- onChange({});
1028
- e.stopPropagation();
1084
+ className: `${styles$5['select-content-top-text']}`,
1085
+ style: {
1086
+ color: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : isHover ? selectedHoverColor ? selectedHoverColor : configStyles.SELECT.selectedHoverColor : selectedColor ? selectedColor : configStyles.SELECT.selectedColor
1029
1087
  }
1030
- }), /*#__PURE__*/React.createElement("i", {
1031
- className: opened ? 'icon-icon-up' : 'icon-icon-down'
1032
- }))), opened && !disabled ? /*#__PURE__*/React.createElement("div", {
1033
- className: `${styles$5['select-content-bottom']} select-content-bottom-rem`
1088
+ }, newSelected && newSelected[keyNames.name] ? newSelected[keyNames.name] : defaultOption), /*#__PURE__*/React.createElement("div", {
1089
+ className: `${styles$5['select-content-top-icon']}`
1090
+ }, Object.keys(newSelected).length > 0 && /*#__PURE__*/React.createElement("div", {
1091
+ className: `${styles$5['close-icon']}`,
1092
+ onClick: disabled ? _ => _ : handleClearSelect
1093
+ }, closeIcon ? closeIcon : /*#__PURE__*/React.createElement("img", {
1094
+ src: ReactCloseIcon,
1095
+ alt: "icon"
1096
+ })), /*#__PURE__*/React.createElement("div", {
1097
+ style: {
1098
+ transform: opened ? 'rotate(180deg)' : 'rotate(0deg)'
1099
+ },
1100
+ className: `${styles$5['arrow-icon']}`
1101
+ }, arrowIcon ? arrowIcon : /*#__PURE__*/React.createElement("img", {
1102
+ src: ReactArrowIcon,
1103
+ alt: "icon"
1104
+ })))), opened && !disabled ? /*#__PURE__*/React.createElement("div", {
1105
+ style: {
1106
+ boxShadow: optionsBoxShadow ? optionsBoxShadow : configStyles.SELECT.optionsBoxShadow,
1107
+ borderRadius: optionsBorderRadius ? optionsBorderRadius : configStyles.SELECT.optionsBorderRadius,
1108
+ backgroundColor: optionsBackgroundColor ? optionsBackgroundColor : configStyles.SELECT.optionsBackgroundColor,
1109
+ top: parseFloat(selectedHeight ? selectedHeight.substring(0, selectedHeight.length - 2) : configStyles.SELECT.selectedHeight.substring(0, configStyles.SELECT.selectedHeight.length - 2)) + 6 + 'px'
1110
+ },
1111
+ className: `${styles$5['select-content-bottom']}`
1034
1112
  }, /*#__PURE__*/React.createElement("div", {
1035
- className: `${styles$5['select-content-bottom-inner']} select-content-bottom-inner-rem`
1113
+ className: `${styles$5['select-content-bottom-inner']}`
1036
1114
  }, options.map((option, i) => {
1037
1115
  return /*#__PURE__*/React.createElement("div", {
1038
1116
  key: i,
1039
- className: `${styles$5['select-content-bottom-row']} select-content-bottom-row-rem`,
1040
1117
  disabled: true,
1041
- onClick: () => {
1042
- setNewSelected(option);
1043
- onChange(option);
1044
- setOpened(!opened);
1045
- },
1046
- defaultValue: option[keyNames.id]
1118
+ defaultValue: option[keyNames.id],
1119
+ onClick: disabled ? _ => _ : _ => handleSelectItem(option),
1120
+ onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
1121
+ onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
1122
+ className: `${styles$5['select-content-bottom-row']}`,
1123
+ style: {
1124
+ color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
1125
+ cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
1126
+ padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
1127
+ fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
1128
+ boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
1129
+ minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
1130
+ fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
1131
+ lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
1132
+ marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
1133
+ backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
1134
+ }
1047
1135
  }, option[keyNames.name]);
1048
- }))) : null)), eMessage ? /*#__PURE__*/React.createElement("span", {
1049
- className: styles$5.eMessage
1050
- }, eMessage) : null);
1136
+ }))) : null)), errorMessage ? /*#__PURE__*/React.createElement("span", {
1137
+ style: {
1138
+ color: errorColor ? errorColor : configStyles.SELECT.errorColor,
1139
+ fontSize: errorSize ? errorSize : configStyles.SELECT.errorSize
1140
+ }
1141
+ }, errorMessage) : '');
1051
1142
  };
1052
1143
  Select.propTypes = {
1053
- theme: PropTypes.oneOf(Object.values(SelectTheme)),
1054
- size: PropTypes.oneOf(Object.values(SelectSize)),
1055
- label: PropTypes.string,
1056
- eMessage: PropTypes.string,
1057
- defaultOption: PropTypes.string,
1058
1144
  onChange: PropTypes.func,
1059
1145
  required: PropTypes.bool,
1060
1146
  disabled: PropTypes.bool,
1061
- className: PropTypes.string,
1062
1147
  selected: PropTypes.string,
1063
1148
  jsonData: PropTypes.string,
1064
- keyNames: PropTypes.object
1065
- };
1066
- Select.defaultProps = {
1067
- size: 'medium',
1068
- required: false
1149
+ keyNames: PropTypes.object,
1150
+ className: PropTypes.string,
1151
+ arrowIcon: PropTypes.element,
1152
+ closeIcon: PropTypes.element,
1153
+ errorMessage: PropTypes.string,
1154
+ defaultOption: PropTypes.string,
1155
+ label: PropTypes.string,
1156
+ labelColor: PropTypes.string,
1157
+ labelWeight: PropTypes.string,
1158
+ labelDisplay: PropTypes.string,
1159
+ labelFontSize: PropTypes.string,
1160
+ labelLineHeight: PropTypes.string,
1161
+ labelMarginBottom: PropTypes.string,
1162
+ labelTextTransform: PropTypes.string,
1163
+ cursor: PropTypes.string,
1164
+ errorSize: PropTypes.string,
1165
+ errorColor: PropTypes.string,
1166
+ selectedColor: PropTypes.string,
1167
+ selectedBorder: PropTypes.string,
1168
+ selectedRadius: PropTypes.string,
1169
+ selectedHeight: PropTypes.string,
1170
+ selectedPadding: PropTypes.string,
1171
+ selectedFontSize: PropTypes.string,
1172
+ selectedBoxSizing: PropTypes.string,
1173
+ selectedHoverColor: PropTypes.string,
1174
+ selectedFontWeight: PropTypes.string,
1175
+ selectedLineHeight: PropTypes.string,
1176
+ selectedTransition: PropTypes.string,
1177
+ selectedBorderColor: PropTypes.string,
1178
+ optionsBoxShadow: PropTypes.string,
1179
+ optionsBorderRadius: PropTypes.string,
1180
+ optionsBackgroundColor: PropTypes.string,
1181
+ optionItemColor: PropTypes.string,
1182
+ optionItemCursor: PropTypes.string,
1183
+ optionItemPadding: PropTypes.string,
1184
+ optionItemFontSize: PropTypes.string,
1185
+ optionItemMinHeight: PropTypes.string,
1186
+ optionItemBoxSizing: PropTypes.string,
1187
+ optionItemFontWeight: PropTypes.string,
1188
+ optionItemColorHover: PropTypes.string,
1189
+ optionItemLineHeight: PropTypes.string,
1190
+ optionItemMarginBottom: PropTypes.string,
1191
+ optionItemBackgroudColor: PropTypes.string,
1192
+ optionItemBackgroudColorHover: PropTypes.string
1069
1193
  };
1070
1194
 
1071
1195
  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>";
@@ -1144,7 +1268,7 @@ const Tooltip = ({
1144
1268
  cursor: 'pointer'
1145
1269
  },
1146
1270
  onClick: handleShow
1147
- }, tooltipIcon && tooltipIcon[0] ? tooltipIcon[0] : /*#__PURE__*/React.createElement("img", {
1271
+ }, tooltipIcon ? tooltipIcon : /*#__PURE__*/React.createElement("img", {
1148
1272
  src: ReactInfoIcon
1149
1273
  })));
1150
1274
  };
@@ -1158,11 +1282,11 @@ Tooltip.propTypes = {
1158
1282
  className: PropTypes.string,
1159
1283
  fontFamily: PropTypes.string,
1160
1284
  tooltipWidth: PropTypes.string,
1285
+ tooltipIcon: PropTypes.element,
1161
1286
  tooltipRadius: PropTypes.string,
1162
1287
  text: PropTypes.string.isRequired,
1163
1288
  backgroundColor: PropTypes.string,
1164
- tooltipBackgroundColor: PropTypes.string,
1165
- tooltipIcon: PropTypes.arrayOf(PropTypes.element)
1289
+ tooltipBackgroundColor: PropTypes.string
1166
1290
  };
1167
1291
  Tooltip.defaultProps = {
1168
1292
  type: 'top'
@@ -1563,4 +1687,4 @@ Autocomplate.defaultProps = {
1563
1687
  required: false
1564
1688
  };
1565
1689
 
1566
- export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, Pagination, Radio, Select, SelectSize, SelectTheme, Stepper, Table, Tooltip, Typography, TypographyType };
1690
+ export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, Pagination, Radio, Select, Stepper, Table, Tooltip, Typography, TypographyType };