@xaypay/tui 0.0.56 → 0.0.58

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", {
@@ -364,11 +370,13 @@ const compereConfigs = () => {
364
370
  let packageConfig = {};
365
371
  try {
366
372
  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');
373
+ } catch (e) {
374
+ try {
375
+ packageConfig = require('../../tui.config.js');
376
+ } catch (err) {
377
+ packageConfig = {};
378
+ }
370
379
  }
371
-
372
380
  try {
373
381
  projectConfig = require('../../../../tui.config.js');
374
382
  } catch (error) {
@@ -399,7 +407,6 @@ const Typography = ({
399
407
  margin,
400
408
  padding,
401
409
  variant,
402
- bgColor,
403
410
  onClick,
404
411
  children,
405
412
  textAlign,
@@ -411,45 +418,18 @@ const Typography = ({
411
418
  fontFamily,
412
419
  textTransform,
413
420
  textDecoration,
421
+ backgroundColor,
414
422
  ...props
415
423
  }) => {
416
424
  const configStyles = compereConfigs();
417
425
  const classProps = classnames(className);
418
426
  const [isHover, setIsHover] = useState(false);
419
427
  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
428
  useEffect(() => {
439
429
  if (!Object.values(TypographyType).includes(variant)) {
440
430
  setValidVariant(true);
441
431
  }
442
432
  }, [variant]);
443
- useEffect(() => {
444
- if (color) {
445
- setStyle(prev => {
446
- return {
447
- ...prev,
448
- color: color
449
- };
450
- });
451
- }
452
- }, [color]);
453
433
  const handleMouseEnter = () => {
454
434
  setIsHover(true);
455
435
  };
@@ -457,7 +437,24 @@ const Typography = ({
457
437
  setIsHover(false);
458
438
  };
459
439
  const tagT = /*#__PURE__*/React.createElement(variant, {
460
- style,
440
+ style: {
441
+ border: border ? border : configStyles.TYPOGRAPHY.border,
442
+ cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
443
+ borderRadius: radius ? radius : configStyles.TYPOGRAPHY.radius,
444
+ fontSize: size ? size : configStyles.TYPOGRAPHY['size' + variant],
445
+ margin: margin ? margin : configStyles.TYPOGRAPHY['margin' + variant],
446
+ fontWeight: weight ? weight : configStyles.TYPOGRAPHY['weight' + variant],
447
+ padding: padding ? padding : configStyles.TYPOGRAPHY['padding' + variant],
448
+ textShadow: textShadow ? textShadow : configStyles.TYPOGRAPHY.textShadow,
449
+ textAlign: textAlign ? textAlign : configStyles.TYPOGRAPHY['textAlign' + variant],
450
+ fontStyle: fontStyle ? fontStyle : configStyles.TYPOGRAPHY['fontStyle' + variant],
451
+ lineHeight: lineHeight ? lineHeight : configStyles.TYPOGRAPHY['lineHeight' + variant],
452
+ fontFamily: fontFamily ? fontFamily : configStyles.TYPOGRAPHY['fontFamily' + variant],
453
+ textTransform: textTransform ? textTransform : configStyles.TYPOGRAPHY['textTransform' + variant],
454
+ textDecoration: textDecoration ? textDecoration : configStyles.TYPOGRAPHY['textDecoration' + variant],
455
+ backgroundColor: backgroundColor ? backgroundColor : configStyles.TYPOGRAPHY['backgroundColor' + variant],
456
+ color: isHover ? colorHover ? colorHover : configStyles.TYPOGRAPHY['colorHover' + variant] : color ? color : configStyles.TYPOGRAPHY['color' + variant]
457
+ },
461
458
  ...props,
462
459
  className: classProps,
463
460
  onClick: onClick ? onClick : _ => _,
@@ -475,7 +472,6 @@ Typography.propTypes = {
475
472
  cursor: PropTypes.string,
476
473
  margin: PropTypes.string,
477
474
  radius: PropTypes.string,
478
- bgColor: PropTypes.string,
479
475
  padding: PropTypes.string,
480
476
  textAlign: PropTypes.string,
481
477
  className: PropTypes.string,
@@ -486,6 +482,7 @@ Typography.propTypes = {
486
482
  colorHover: PropTypes.string,
487
483
  textTransform: PropTypes.string,
488
484
  textDecoration: PropTypes.string,
485
+ backgroundColor: PropTypes.string,
489
486
  variant: PropTypes.oneOf(Object.values(TypographyType))
490
487
  };
491
488
  Typography.defaultProps = {
@@ -665,6 +662,7 @@ const Input = ({
665
662
  }, "*")) : '', /*#__PURE__*/React.createElement("div", {
666
663
  className: `${styles$7["input-content"]}`,
667
664
  style: {
665
+ width: width ? width : configStyles.INPUT.width,
668
666
  borderRadius: radius ? radius : configStyles.INPUT.radius,
669
667
  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
668
  },
@@ -732,7 +730,7 @@ const Input = ({
732
730
  borderBottomRightRadius: radius ? radius : configStyles.INPUT.radius,
733
731
  backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
734
732
  }
735
- }, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip && tooltip.length > 0 ? tooltip[0] : '', errorMessage ? /*#__PURE__*/React.createElement(P, {
733
+ }, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? tooltip : '', errorMessage ? /*#__PURE__*/React.createElement(P, {
736
734
  style: {
737
735
  left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
738
736
  color: errorColor ? errorColor : configStyles.INPUT.errorColor,
@@ -759,6 +757,7 @@ Input.propTypes = {
759
757
  radius: PropTypes.string,
760
758
  padding: PropTypes.string,
761
759
  fontSize: PropTypes.string,
760
+ tooltip: PropTypes.element,
762
761
  transform: PropTypes.string,
763
762
  className: PropTypes.string,
764
763
  iconWidth: PropTypes.string,
@@ -785,7 +784,6 @@ Input.propTypes = {
785
784
  labelLineHeight: PropTypes.string,
786
785
  labelMarginBottom: PropTypes.string,
787
786
  errorAnimationDuration: PropTypes.string,
788
- tooltip: PropTypes.arrayOf(PropTypes.element),
789
787
  leftIcon: PropTypes.arrayOf(PropTypes.element),
790
788
  rightIcon: PropTypes.arrayOf(PropTypes.element),
791
789
  type: PropTypes.oneOf(Object.values(InputTypes))
@@ -942,42 +940,99 @@ Button.propTypes = {
942
940
  disabledBackgroundColor: PropTypes.string
943
941
  };
944
942
 
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"};
943
+ 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>";
944
+
945
+ 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>";
946
+
947
+ 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}}";
948
+ 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
949
  styleInject(css_248z$5);
948
950
 
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
951
  const Select = ({
964
- theme,
965
- size,
966
- className,
967
952
  disabled,
968
- label,
969
953
  jsonData,
970
- eMessage,
971
954
  required,
972
- defaultOption,
973
955
  onChange,
974
956
  keyNames,
975
- selected
957
+ selected,
958
+ className,
959
+ arrowIcon,
960
+ closeIcon,
961
+ errorMessage,
962
+ defaultOption,
963
+ label,
964
+ labelColor,
965
+ labelWeight,
966
+ labelDisplay,
967
+ labelFontSize,
968
+ labelLineHeight,
969
+ labelMarginBottom,
970
+ labelTextTransform,
971
+ cursor,
972
+ errorSize,
973
+ errorColor,
974
+ selectedColor,
975
+ selectedRadius,
976
+ selectedHeight,
977
+ selectedBorder,
978
+ selectedPadding,
979
+ selectedFontSize,
980
+ selectedBoxSizing,
981
+ selectedFontWeight,
982
+ selectedLineHeight,
983
+ selectedHoverColor,
984
+ selectedTransition,
985
+ selectedBorderColor,
986
+ optionsBoxShadow,
987
+ optionsBorderRadius,
988
+ optionsBackgroundColor,
989
+ optionItemColor,
990
+ optionItemCursor,
991
+ optionItemPadding,
992
+ optionItemFontSize,
993
+ optionItemMinHeight,
994
+ optionItemBoxSizing,
995
+ optionItemFontWeight,
996
+ optionItemLineHeight,
997
+ optionItemColorHover,
998
+ optionItemMarginBottom,
999
+ optionItemBackgroudColor,
1000
+ optionItemBackgroudColorHover
976
1001
  }) => {
977
1002
  const options = jsonData.length ? JSON.parse(jsonData) : [];
978
1003
  const ref = useRef();
979
- let [opened, setOpened] = useState(false);
980
- let [newSelected, setNewSelected] = useState({});
1004
+ const [opened, setOpened] = useState(false);
1005
+ const [isHover, setIsHover] = useState(false);
1006
+ const [newSelected, setNewSelected] = useState({});
1007
+ const configStyles = compereConfigs();
1008
+ const classProps = classnames(className);
1009
+ const handleOpenClose = () => {
1010
+ setOpened(!opened);
1011
+ };
1012
+ const handleClearSelect = e => {
1013
+ onChange({});
1014
+ setNewSelected({});
1015
+ e.stopPropagation();
1016
+ };
1017
+ const handleSelectItem = option => {
1018
+ onChange(option);
1019
+ setOpened(!opened);
1020
+ setNewSelected(option);
1021
+ };
1022
+ const handleMouseEnter = () => {
1023
+ setIsHover(true);
1024
+ };
1025
+ const handleMouseLeave = () => {
1026
+ setIsHover(false);
1027
+ };
1028
+ const handleMouseEnterOption = e => {
1029
+ e.target.style.color = optionItemColorHover ? optionItemColorHover : configStyles.SELECT.optionItemColorHover;
1030
+ e.target.style.backgroundColor = optionItemBackgroudColorHover ? optionItemBackgroudColorHover : configStyles.SELECT.optionItemBackgroudColorHover;
1031
+ };
1032
+ const handleMouseLeaveOption = e => {
1033
+ e.target.style.color = optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor;
1034
+ e.target.style.backgroundColor = optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor;
1035
+ };
981
1036
  useEffect(() => {
982
1037
  const parseSelectedData = selected.length !== 0 ? JSON.parse(selected) : {};
983
1038
  setNewSelected(parseSelectedData);
@@ -995,77 +1050,154 @@ const Select = ({
995
1050
  };
996
1051
  }
997
1052
  }, [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", {
1053
+ return /*#__PURE__*/React.createElement("div", {
1054
+ className: classProps
1055
+ }, label ? /*#__PURE__*/React.createElement("label", {
1056
+ style: {
1057
+ color: labelColor ? labelColor : configStyles.SELECT.labelColor,
1058
+ fontWeight: labelWeight ? labelWeight : configStyles.SELECT.labelWeight,
1059
+ display: labelDisplay ? labelDisplay : configStyles.SELECT.labelDisplay,
1060
+ fontSize: labelFontSize ? labelFontSize : configStyles.SELECT.labelFontSize,
1061
+ lineHeight: labelLineHeight ? labelLineHeight : configStyles.SELECT.labelLineHeight,
1062
+ marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.SELECT.labelMarginBottom,
1063
+ textTransform: labelTextTransform ? labelTextTransform : configStyles.SELECT.labelTextTransform
1064
+ }
1065
+ }, label, required && /*#__PURE__*/React.createElement("sup", {
1005
1066
  style: {
1006
1067
  color: "#ee0000"
1007
1068
  }
1008
1069
  }, "*")) : "", /*#__PURE__*/React.createElement("div", {
1009
- className: `${styles$5['select-wrap']} select-wrap-rem`,
1010
1070
  ref: ref
1011
1071
  }, /*#__PURE__*/React.createElement("div", {
1012
- className: styles$5['select-content'],
1013
- id: styles$5.selector
1072
+ className: styles$5['select-content']
1014
1073
  }, /*#__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
- }
1074
+ style: {
1075
+ cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.SELECT.cursor,
1076
+ height: selectedHeight ? selectedHeight : configStyles.SELECT.selectedHeight,
1077
+ border: selectedBorder ? selectedBorder : configStyles.SELECT.selectedBorder,
1078
+ padding: selectedPadding ? selectedPadding : configStyles.SELECT.selectedPadding,
1079
+ borderRadius: selectedRadius ? selectedRadius : configStyles.SELECT.selectedRadius,
1080
+ fontSize: selectedFontSize ? selectedFontSize : configStyles.SELECT.selectedFontSize,
1081
+ boxSizing: selectedBoxSizing ? selectedBoxSizing : configStyles.SELECT.selectedBoxSizing,
1082
+ fontWeight: selectedFontWeight ? selectedFontWeight : configStyles.SELECT.selectedFontWeight,
1083
+ lineHeight: selectedLineHeight ? selectedLineHeight : configStyles.SELECT.selectedLineHeight,
1084
+ transition: selectedTransition ? selectedTransition : configStyles.SELECT.selectedTransition,
1085
+ borderColor: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : selectedBorderColor ? selectedBorderColor : configStyles.SELECT.selectedBorderColor
1086
+ },
1087
+ onClick: disabled ? _ => _ : _ => handleOpenClose(),
1088
+ onMouseEnter: disabled ? _ => _ : handleMouseEnter,
1089
+ onMouseLeave: disabled ? _ => _ : handleMouseLeave,
1090
+ className: `${styles$5['select-content-top']}`
1019
1091
  }, /*#__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();
1092
+ className: `${styles$5['select-content-top-text']}`,
1093
+ style: {
1094
+ color: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : isHover ? selectedHoverColor ? selectedHoverColor : configStyles.SELECT.selectedHoverColor : selectedColor ? selectedColor : configStyles.SELECT.selectedColor
1029
1095
  }
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`
1096
+ }, newSelected && newSelected[keyNames.name] ? newSelected[keyNames.name] : defaultOption), /*#__PURE__*/React.createElement("div", {
1097
+ className: `${styles$5['select-content-top-icon']}`
1098
+ }, Object.keys(newSelected).length > 0 && /*#__PURE__*/React.createElement("div", {
1099
+ className: `${styles$5['close-icon']}`,
1100
+ onClick: disabled ? _ => _ : handleClearSelect
1101
+ }, closeIcon ? closeIcon : /*#__PURE__*/React.createElement("img", {
1102
+ src: ReactCloseIcon,
1103
+ alt: "icon"
1104
+ })), /*#__PURE__*/React.createElement("div", {
1105
+ style: {
1106
+ transform: opened ? 'rotate(180deg)' : 'rotate(0deg)'
1107
+ },
1108
+ className: `${styles$5['arrow-icon']}`
1109
+ }, arrowIcon ? arrowIcon : /*#__PURE__*/React.createElement("img", {
1110
+ src: ReactArrowIcon,
1111
+ alt: "icon"
1112
+ })))), opened && !disabled ? /*#__PURE__*/React.createElement("div", {
1113
+ style: {
1114
+ boxShadow: optionsBoxShadow ? optionsBoxShadow : configStyles.SELECT.optionsBoxShadow,
1115
+ borderRadius: optionsBorderRadius ? optionsBorderRadius : configStyles.SELECT.optionsBorderRadius,
1116
+ backgroundColor: optionsBackgroundColor ? optionsBackgroundColor : configStyles.SELECT.optionsBackgroundColor,
1117
+ top: parseFloat(selectedHeight ? selectedHeight.substring(0, selectedHeight.length - 2) : configStyles.SELECT.selectedHeight.substring(0, configStyles.SELECT.selectedHeight.length - 2)) + 6 + 'px'
1118
+ },
1119
+ className: `${styles$5['select-content-bottom']}`
1034
1120
  }, /*#__PURE__*/React.createElement("div", {
1035
- className: `${styles$5['select-content-bottom-inner']} select-content-bottom-inner-rem`
1121
+ className: `${styles$5['select-content-bottom-inner']}`
1036
1122
  }, options.map((option, i) => {
1037
1123
  return /*#__PURE__*/React.createElement("div", {
1038
1124
  key: i,
1039
- className: `${styles$5['select-content-bottom-row']} select-content-bottom-row-rem`,
1040
1125
  disabled: true,
1041
- onClick: () => {
1042
- setNewSelected(option);
1043
- onChange(option);
1044
- setOpened(!opened);
1045
- },
1046
- defaultValue: option[keyNames.id]
1126
+ defaultValue: option[keyNames.id],
1127
+ onClick: disabled ? _ => _ : _ => handleSelectItem(option),
1128
+ onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
1129
+ onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
1130
+ className: `${styles$5['select-content-bottom-row']}`,
1131
+ style: {
1132
+ color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
1133
+ cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
1134
+ padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
1135
+ fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
1136
+ boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
1137
+ minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
1138
+ fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
1139
+ lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
1140
+ marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
1141
+ backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
1142
+ }
1047
1143
  }, option[keyNames.name]);
1048
- }))) : null)), eMessage ? /*#__PURE__*/React.createElement("span", {
1049
- className: styles$5.eMessage
1050
- }, eMessage) : null);
1144
+ }))) : null)), errorMessage ? /*#__PURE__*/React.createElement("span", {
1145
+ style: {
1146
+ color: errorColor ? errorColor : configStyles.SELECT.errorColor,
1147
+ fontSize: errorSize ? errorSize : configStyles.SELECT.errorSize
1148
+ }
1149
+ }, errorMessage) : '');
1051
1150
  };
1052
1151
  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
1152
  onChange: PropTypes.func,
1059
1153
  required: PropTypes.bool,
1060
1154
  disabled: PropTypes.bool,
1061
- className: PropTypes.string,
1062
1155
  selected: PropTypes.string,
1063
1156
  jsonData: PropTypes.string,
1064
- keyNames: PropTypes.object
1065
- };
1066
- Select.defaultProps = {
1067
- size: 'medium',
1068
- required: false
1157
+ keyNames: PropTypes.object,
1158
+ className: PropTypes.string,
1159
+ arrowIcon: PropTypes.element,
1160
+ closeIcon: PropTypes.element,
1161
+ errorMessage: PropTypes.string,
1162
+ defaultOption: PropTypes.string,
1163
+ label: PropTypes.string,
1164
+ labelColor: PropTypes.string,
1165
+ labelWeight: PropTypes.string,
1166
+ labelDisplay: PropTypes.string,
1167
+ labelFontSize: PropTypes.string,
1168
+ labelLineHeight: PropTypes.string,
1169
+ labelMarginBottom: PropTypes.string,
1170
+ labelTextTransform: PropTypes.string,
1171
+ cursor: PropTypes.string,
1172
+ errorSize: PropTypes.string,
1173
+ errorColor: PropTypes.string,
1174
+ selectedColor: PropTypes.string,
1175
+ selectedBorder: PropTypes.string,
1176
+ selectedRadius: PropTypes.string,
1177
+ selectedHeight: PropTypes.string,
1178
+ selectedPadding: PropTypes.string,
1179
+ selectedFontSize: PropTypes.string,
1180
+ selectedBoxSizing: PropTypes.string,
1181
+ selectedHoverColor: PropTypes.string,
1182
+ selectedFontWeight: PropTypes.string,
1183
+ selectedLineHeight: PropTypes.string,
1184
+ selectedTransition: PropTypes.string,
1185
+ selectedBorderColor: PropTypes.string,
1186
+ optionsBoxShadow: PropTypes.string,
1187
+ optionsBorderRadius: PropTypes.string,
1188
+ optionsBackgroundColor: PropTypes.string,
1189
+ optionItemColor: PropTypes.string,
1190
+ optionItemCursor: PropTypes.string,
1191
+ optionItemPadding: PropTypes.string,
1192
+ optionItemFontSize: PropTypes.string,
1193
+ optionItemMinHeight: PropTypes.string,
1194
+ optionItemBoxSizing: PropTypes.string,
1195
+ optionItemFontWeight: PropTypes.string,
1196
+ optionItemColorHover: PropTypes.string,
1197
+ optionItemLineHeight: PropTypes.string,
1198
+ optionItemMarginBottom: PropTypes.string,
1199
+ optionItemBackgroudColor: PropTypes.string,
1200
+ optionItemBackgroudColorHover: PropTypes.string
1069
1201
  };
1070
1202
 
1071
1203
  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 +1276,7 @@ const Tooltip = ({
1144
1276
  cursor: 'pointer'
1145
1277
  },
1146
1278
  onClick: handleShow
1147
- }, tooltipIcon && tooltipIcon[0] ? tooltipIcon[0] : /*#__PURE__*/React.createElement("img", {
1279
+ }, tooltipIcon ? tooltipIcon : /*#__PURE__*/React.createElement("img", {
1148
1280
  src: ReactInfoIcon
1149
1281
  })));
1150
1282
  };
@@ -1158,11 +1290,11 @@ Tooltip.propTypes = {
1158
1290
  className: PropTypes.string,
1159
1291
  fontFamily: PropTypes.string,
1160
1292
  tooltipWidth: PropTypes.string,
1293
+ tooltipIcon: PropTypes.element,
1161
1294
  tooltipRadius: PropTypes.string,
1162
1295
  text: PropTypes.string.isRequired,
1163
1296
  backgroundColor: PropTypes.string,
1164
- tooltipBackgroundColor: PropTypes.string,
1165
- tooltipIcon: PropTypes.arrayOf(PropTypes.element)
1297
+ tooltipBackgroundColor: PropTypes.string
1166
1298
  };
1167
1299
  Tooltip.defaultProps = {
1168
1300
  type: 'top'
@@ -1563,4 +1695,4 @@ Autocomplate.defaultProps = {
1563
1695
  required: false
1564
1696
  };
1565
1697
 
1566
- export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, Pagination, Radio, Select, SelectSize, SelectTheme, Stepper, Table, Tooltip, Typography, TypographyType };
1698
+ export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, Pagination, Radio, Select, Stepper, Table, Tooltip, Typography, TypographyType };