@xaypay/tui 0.0.98 → 0.0.100

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
@@ -816,14 +816,42 @@ const Input = ({
816
816
  change(`${maxNumSize}`);
817
817
  }
818
818
  }
819
- if (floatToFix && floatToFix > 0 && !Number.isInteger(parseFloat(currentValue))) {
819
+ if (floatToFix && floatToFix > 0) {
820
820
  const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
821
821
  const int = floatNumParts[0];
822
822
  const float = floatNumParts[1];
823
- if (float && float.length > floatToFix) {
824
- setInnerValue(`${int}.${float.substr(0, floatToFix)}`);
825
- if (change) {
826
- change(`${int}.${float.substr(0, floatToFix)}`);
823
+ if (float) {
824
+ if (float[0] === '0' || float[0] !== '0') {
825
+ if (float[1] === undefined) {
826
+ setInnerValue(`${int}.${float[0]}`);
827
+ if (change) {
828
+ change(`${int}.${float[0]}`);
829
+ }
830
+ } else if (float[1] === '0') {
831
+ if (float[2] === undefined || float[2] === '0') {
832
+ setInnerValue(`${int}.${float[0]}`);
833
+ if (change) {
834
+ change(`${int}.${float[0]}`);
835
+ }
836
+ } else if (float[2] !== undefined && float[2] !== '0') {
837
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
838
+ if (change) {
839
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
840
+ }
841
+ }
842
+ } else if (float[1] !== undefined && float[1] !== '0') {
843
+ if (float[2] === undefined || float[2] === '0') {
844
+ setInnerValue(`${int}.${float[0]}${float[1]}`);
845
+ if (change) {
846
+ change(`${int}.${float[0]}${float[1]}`);
847
+ }
848
+ } else if (float[2] !== undefined && float[2] !== '0') {
849
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
850
+ if (change) {
851
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
852
+ }
853
+ }
854
+ }
827
855
  }
828
856
  }
829
857
  } else if (floatToFix === 0) {
@@ -877,18 +905,24 @@ const Input = ({
877
905
  } else {
878
906
  setInnerValue(value);
879
907
  if (type === 'tel') {
880
- if (!phoneNumberRegex.test(value)) {
881
- if (value === '') {
882
- setInnerErrorMessage('');
883
- } else {
884
- telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
885
- }
908
+ // TODO: discussion
909
+ // if (!phoneNumberRegex.test(value)) {
910
+ // if (value === '') {
911
+ // setInnerErrorMessage('');
912
+ // } else {
913
+ // telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
914
+ // }
915
+ // } else {
916
+ // if (value.length < 8) {
917
+ // telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
918
+ // } else if (value.length > 8) {
919
+ // setInnerValue(value.substr(0, 8));
920
+ // }
921
+ // }
922
+ if (value.length <= 8) {
923
+ setInnerValue(value);
886
924
  } else {
887
- if (value.length < 8) {
888
- telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
889
- } else if (value.length > 8) {
890
- setInnerValue(value.substr(0, 8));
891
- }
925
+ setInnerValue(value.substr(0, 8));
892
926
  }
893
927
  }
894
928
  if (type === 'number') {
@@ -912,14 +946,51 @@ const Input = ({
912
946
  change(`${maxNumSize}`);
913
947
  }
914
948
  }
915
- if (floatToFix && floatToFix > 0 && !Number.isInteger(parseFloat(value))) {
949
+ if (floatToFix && floatToFix > 0) {
916
950
  const floatNumParts = typeof value === 'string' ? value.split('.') : value;
917
951
  const int = floatNumParts[0];
918
952
  const float = floatNumParts[1];
919
- if (float && float.length > floatToFix) {
920
- setInnerValue(`${int}.${float.substr(0, floatToFix)}`);
953
+ if (float) {
954
+ if (float[0] === '0' || float[0] !== '0') {
955
+ if (float[1] === undefined) {
956
+ setInnerValue(`${int}.${float[0]}`);
957
+ if (change) {
958
+ change(`${int}.${float[0]}`);
959
+ }
960
+ } else if (float[1] === '0') {
961
+ if (float[2] === undefined || float[2] === '0') {
962
+ setInnerValue(`${int}.${float[0]}`);
963
+ if (change) {
964
+ change(`${int}.${float[0]}`);
965
+ }
966
+ } else if (float[2] !== undefined && float[2] !== '0') {
967
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
968
+ if (change) {
969
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
970
+ }
971
+ }
972
+ } else if (float[1] !== undefined && float[1] !== '0') {
973
+ if (float[2] === undefined || float[2] === '0') {
974
+ setInnerValue(`${int}.${float[0]}${float[1]}`);
975
+ if (change) {
976
+ change(`${int}.${float[0]}${float[1]}`);
977
+ }
978
+ } else if (float[2] !== undefined && float[2] !== '0') {
979
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
980
+ if (change) {
981
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
982
+ }
983
+ }
984
+ }
985
+ }
986
+ }
987
+ } else if (floatToFix === 0) {
988
+ const floatNumParts = typeof value === 'string' ? value.split('.') : value;
989
+ const int = floatNumParts[0];
990
+ if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
991
+ setInnerValue(`${int}`);
921
992
  if (change) {
922
- change(`${int}.${float.substr(0, floatToFix)}`);
993
+ change(`${int}`);
923
994
  }
924
995
  }
925
996
  }
@@ -1296,11 +1367,12 @@ const SvgArrow = ({
1296
1367
  fill: fillColor ? fillColor : '#3C393E'
1297
1368
  }));
1298
1369
 
1299
- var css_248z$a = ".select-module_select-content__GCMDX{-webkit-appearance:none;display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;-webkit-appearance:none;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:99999999999}.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;box-sizing:content-box;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}}";
1300
- var styles$8 = {"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"};
1370
+ var css_248z$a = ".select-module_select-content__GCMDX{-webkit-appearance:none;display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;-webkit-appearance:none;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:99999999999}.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;box-sizing:content-box;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}.select-module_ellipsis__uNgol{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
1371
+ var styles$8 = {"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","ellipsis":"select-module_ellipsis__uNgol"};
1301
1372
  styleInject(css_248z$a);
1302
1373
 
1303
1374
  const Select = ({
1375
+ dots,
1304
1376
  options,
1305
1377
  multiple,
1306
1378
  disabled,
@@ -1551,17 +1623,18 @@ const Select = ({
1551
1623
  onClick: disabled ? _ => _ : _ => handleSelectItem(option),
1552
1624
  onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
1553
1625
  onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
1554
- className: `${styles$8['select-content-bottom-row']}`,
1626
+ className: `${styles$8['select-content-bottom-row']} ${dots || configStyles.SELECT.dots ? styles$8['ellipsis'] : ''}`,
1555
1627
  style: {
1628
+ overflowWrap: !dots && !configStyles.SELECT.dots ? 'anywhere' : 'break-word',
1556
1629
  color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
1557
1630
  cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
1558
1631
  padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
1559
1632
  fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
1560
1633
  boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
1561
- minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
1634
+ minHeight: !dots && !configStyles.SELECT.dots ? 'auto' : optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
1562
1635
  fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
1563
- lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
1564
- marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
1636
+ lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
1637
+ marginBottom: !dots && !configStyles.SELECT.dots ? '10px' : optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
1565
1638
  backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
1566
1639
  }
1567
1640
  }, multiple && multipleCheckbox ? /*#__PURE__*/React__default.createElement(SingleCheckbox, {
@@ -1578,6 +1651,7 @@ const Select = ({
1578
1651
  }, errorMessage) : '');
1579
1652
  };
1580
1653
  Select.propTypes = {
1654
+ dots: PropTypes.bool,
1581
1655
  options: PropTypes.array,
1582
1656
  multiple: PropTypes.bool,
1583
1657
  onChange: PropTypes.func,
@@ -1898,7 +1972,7 @@ const createToast = ({
1898
1972
  toastParentBlock = document.createElement('div');
1899
1973
  toastParentBlock.style.position = 'fixed';
1900
1974
  toastParentBlock.style.display = 'flex';
1901
- toastParentBlock.style.zIndex = 99999;
1975
+ toastParentBlock.style.zIndex = 9999999999999999999999999;
1902
1976
  toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
1903
1977
  toastParentBlock.setAttribute('id', styles$7[position]);
1904
1978
  toastParentBlock.appendChild(toastBlock);
package/dist/index.js CHANGED
@@ -846,14 +846,42 @@ const Input = ({
846
846
  change(`${maxNumSize}`);
847
847
  }
848
848
  }
849
- if (floatToFix && floatToFix > 0 && !Number.isInteger(parseFloat(currentValue))) {
849
+ if (floatToFix && floatToFix > 0) {
850
850
  const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
851
851
  const int = floatNumParts[0];
852
852
  const float = floatNumParts[1];
853
- if (float && float.length > floatToFix) {
854
- setInnerValue(`${int}.${float.substr(0, floatToFix)}`);
855
- if (change) {
856
- change(`${int}.${float.substr(0, floatToFix)}`);
853
+ if (float) {
854
+ if (float[0] === '0' || float[0] !== '0') {
855
+ if (float[1] === undefined) {
856
+ setInnerValue(`${int}.${float[0]}`);
857
+ if (change) {
858
+ change(`${int}.${float[0]}`);
859
+ }
860
+ } else if (float[1] === '0') {
861
+ if (float[2] === undefined || float[2] === '0') {
862
+ setInnerValue(`${int}.${float[0]}`);
863
+ if (change) {
864
+ change(`${int}.${float[0]}`);
865
+ }
866
+ } else if (float[2] !== undefined && float[2] !== '0') {
867
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
868
+ if (change) {
869
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
870
+ }
871
+ }
872
+ } else if (float[1] !== undefined && float[1] !== '0') {
873
+ if (float[2] === undefined || float[2] === '0') {
874
+ setInnerValue(`${int}.${float[0]}${float[1]}`);
875
+ if (change) {
876
+ change(`${int}.${float[0]}${float[1]}`);
877
+ }
878
+ } else if (float[2] !== undefined && float[2] !== '0') {
879
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
880
+ if (change) {
881
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
882
+ }
883
+ }
884
+ }
857
885
  }
858
886
  }
859
887
  } else if (floatToFix === 0) {
@@ -907,18 +935,24 @@ const Input = ({
907
935
  } else {
908
936
  setInnerValue(value);
909
937
  if (type === 'tel') {
910
- if (!phoneNumberRegex.test(value)) {
911
- if (value === '') {
912
- setInnerErrorMessage('');
913
- } else {
914
- telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
915
- }
938
+ // TODO: discussion
939
+ // if (!phoneNumberRegex.test(value)) {
940
+ // if (value === '') {
941
+ // setInnerErrorMessage('');
942
+ // } else {
943
+ // telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
944
+ // }
945
+ // } else {
946
+ // if (value.length < 8) {
947
+ // telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
948
+ // } else if (value.length > 8) {
949
+ // setInnerValue(value.substr(0, 8));
950
+ // }
951
+ // }
952
+ if (value.length <= 8) {
953
+ setInnerValue(value);
916
954
  } else {
917
- if (value.length < 8) {
918
- telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
919
- } else if (value.length > 8) {
920
- setInnerValue(value.substr(0, 8));
921
- }
955
+ setInnerValue(value.substr(0, 8));
922
956
  }
923
957
  }
924
958
  if (type === 'number') {
@@ -942,14 +976,51 @@ const Input = ({
942
976
  change(`${maxNumSize}`);
943
977
  }
944
978
  }
945
- if (floatToFix && floatToFix > 0 && !Number.isInteger(parseFloat(value))) {
979
+ if (floatToFix && floatToFix > 0) {
946
980
  const floatNumParts = typeof value === 'string' ? value.split('.') : value;
947
981
  const int = floatNumParts[0];
948
982
  const float = floatNumParts[1];
949
- if (float && float.length > floatToFix) {
950
- setInnerValue(`${int}.${float.substr(0, floatToFix)}`);
983
+ if (float) {
984
+ if (float[0] === '0' || float[0] !== '0') {
985
+ if (float[1] === undefined) {
986
+ setInnerValue(`${int}.${float[0]}`);
987
+ if (change) {
988
+ change(`${int}.${float[0]}`);
989
+ }
990
+ } else if (float[1] === '0') {
991
+ if (float[2] === undefined || float[2] === '0') {
992
+ setInnerValue(`${int}.${float[0]}`);
993
+ if (change) {
994
+ change(`${int}.${float[0]}`);
995
+ }
996
+ } else if (float[2] !== undefined && float[2] !== '0') {
997
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
998
+ if (change) {
999
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
1000
+ }
1001
+ }
1002
+ } else if (float[1] !== undefined && float[1] !== '0') {
1003
+ if (float[2] === undefined || float[2] === '0') {
1004
+ setInnerValue(`${int}.${float[0]}${float[1]}`);
1005
+ if (change) {
1006
+ change(`${int}.${float[0]}${float[1]}`);
1007
+ }
1008
+ } else if (float[2] !== undefined && float[2] !== '0') {
1009
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
1010
+ if (change) {
1011
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
1012
+ }
1013
+ }
1014
+ }
1015
+ }
1016
+ }
1017
+ } else if (floatToFix === 0) {
1018
+ const floatNumParts = typeof value === 'string' ? value.split('.') : value;
1019
+ const int = floatNumParts[0];
1020
+ if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
1021
+ setInnerValue(`${int}`);
951
1022
  if (change) {
952
- change(`${int}.${float.substr(0, floatToFix)}`);
1023
+ change(`${int}`);
953
1024
  }
954
1025
  }
955
1026
  }
@@ -1326,11 +1397,12 @@ const SvgArrow = ({
1326
1397
  fill: fillColor ? fillColor : '#3C393E'
1327
1398
  }));
1328
1399
 
1329
- var css_248z$a = ".select-module_select-content__GCMDX{-webkit-appearance:none;display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;-webkit-appearance:none;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:99999999999}.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;box-sizing:content-box;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}}";
1330
- var styles$8 = {"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"};
1400
+ var css_248z$a = ".select-module_select-content__GCMDX{-webkit-appearance:none;display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{align-items:center;-webkit-appearance:none;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:99999999999}.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;box-sizing:content-box;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}.select-module_ellipsis__uNgol{display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes select-module_select-show__391hQ{to{max-height:234px}}";
1401
+ var styles$8 = {"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","ellipsis":"select-module_ellipsis__uNgol"};
1331
1402
  styleInject(css_248z$a);
1332
1403
 
1333
1404
  const Select = ({
1405
+ dots,
1334
1406
  options,
1335
1407
  multiple,
1336
1408
  disabled,
@@ -1581,17 +1653,18 @@ const Select = ({
1581
1653
  onClick: disabled ? _ => _ : _ => handleSelectItem(option),
1582
1654
  onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
1583
1655
  onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
1584
- className: `${styles$8['select-content-bottom-row']}`,
1656
+ className: `${styles$8['select-content-bottom-row']} ${dots || configStyles.SELECT.dots ? styles$8['ellipsis'] : ''}`,
1585
1657
  style: {
1658
+ overflowWrap: !dots && !configStyles.SELECT.dots ? 'anywhere' : 'break-word',
1586
1659
  color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
1587
1660
  cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
1588
1661
  padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
1589
1662
  fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
1590
1663
  boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
1591
- minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
1664
+ minHeight: !dots && !configStyles.SELECT.dots ? 'auto' : optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
1592
1665
  fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
1593
- lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
1594
- marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
1666
+ lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
1667
+ marginBottom: !dots && !configStyles.SELECT.dots ? '10px' : optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
1595
1668
  backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
1596
1669
  }
1597
1670
  }, multiple && multipleCheckbox ? /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
@@ -1608,6 +1681,7 @@ const Select = ({
1608
1681
  }, errorMessage) : '');
1609
1682
  };
1610
1683
  Select.propTypes = {
1684
+ dots: PropTypes__default["default"].bool,
1611
1685
  options: PropTypes__default["default"].array,
1612
1686
  multiple: PropTypes__default["default"].bool,
1613
1687
  onChange: PropTypes__default["default"].func,
@@ -1928,7 +2002,7 @@ const createToast = ({
1928
2002
  toastParentBlock = document.createElement('div');
1929
2003
  toastParentBlock.style.position = 'fixed';
1930
2004
  toastParentBlock.style.display = 'flex';
1931
- toastParentBlock.style.zIndex = 99999;
2005
+ toastParentBlock.style.zIndex = 9999999999999999999999999;
1932
2006
  toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
1933
2007
  toastParentBlock.setAttribute('id', styles$7[position]);
1934
2008
  toastParentBlock.appendChild(toastBlock);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.0.98",
3
+ "version": "0.0.100",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -156,17 +156,45 @@ export const Input = ({
156
156
  change(`${maxNumSize}`);
157
157
  }
158
158
  }
159
- if (floatToFix && floatToFix > 0 && !Number.isInteger(parseFloat(currentValue))) {
159
+ if (floatToFix && floatToFix > 0) {
160
160
  const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
161
161
  const int = floatNumParts[0];
162
162
  const float = floatNumParts[1];
163
163
 
164
- if (float && float.length > floatToFix) {
165
- setInnerValue(`${int}.${float.substr(0, floatToFix)}`);
166
- if (change) {
167
- change(`${int}.${float.substr(0, floatToFix)}`);
164
+ if (float) {
165
+ if (float[0] === '0' || float[0] !== '0') {
166
+ if (float[1] === undefined) {
167
+ setInnerValue(`${int}.${float[0]}`);
168
+ if (change) {
169
+ change(`${int}.${float[0]}`);
170
+ }
171
+ } else if (float[1] === '0') {
172
+ if (float[2] === undefined || float[2] === '0') {
173
+ setInnerValue(`${int}.${float[0]}`);
174
+ if (change) {
175
+ change(`${int}.${float[0]}`);
176
+ }
177
+ } else if (float[2] !== undefined && float[2] !== '0') {
178
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
179
+ if (change) {
180
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
181
+ }
182
+ }
183
+ } else if (float[1] !== undefined && float[1] !== '0') {
184
+ if (float[2] === undefined || float[2] === '0') {
185
+ setInnerValue(`${int}.${float[0]}${float[1]}`);
186
+ if (change) {
187
+ change(`${int}.${float[0]}${float[1]}`);
188
+ }
189
+ } else if (float[2] !== undefined && float[2] !== '0') {
190
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
191
+ if (change) {
192
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
193
+ }
194
+ }
195
+ }
168
196
  }
169
- }
197
+ }
170
198
  } else if (floatToFix === 0) {
171
199
  const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
172
200
  const int = floatNumParts[0];
@@ -226,20 +254,26 @@ export const Input = ({
226
254
  } else {
227
255
  setInnerValue(value);
228
256
  if (type === 'tel') {
229
- if (!phoneNumberRegex.test(value)) {
230
- if (value === '') {
231
- setInnerErrorMessage('');
232
- } else {
233
- telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
234
- }
257
+ // TODO: discussion
258
+ // if (!phoneNumberRegex.test(value)) {
259
+ // if (value === '') {
260
+ // setInnerErrorMessage('');
261
+ // } else {
262
+ // telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
263
+ // }
264
+ // } else {
265
+ // if (value.length < 8) {
266
+ // telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
267
+ // } else if (value.length > 8) {
268
+ // setInnerValue(value.substr(0, 8));
269
+ // }
270
+ // }
271
+ if (value.length <= 8) {
272
+ setInnerValue(value);
235
273
  } else {
236
- if (value.length < 8) {
237
- telErrorMessage ? setInnerErrorMessage(telErrorMessage) : setInnerErrorMessage(configStyles.INPUT.telErrorMessage);
238
- } else if (value.length > 8) {
239
- setInnerValue(value.substr(0, 8));
240
- }
274
+ setInnerValue(value.substr(0, 8));
241
275
  }
242
- }
276
+ }
243
277
 
244
278
  if (type === 'number') {
245
279
  const regNum = /^\d+(\.)?(\d+)?$/;
@@ -262,17 +296,54 @@ export const Input = ({
262
296
  change(`${maxNumSize}`);
263
297
  }
264
298
  }
265
- if (floatToFix && floatToFix > 0 && !Number.isInteger(parseFloat(value))) {
299
+ if (floatToFix && floatToFix > 0) {
266
300
  const floatNumParts = typeof value === 'string' ? value.split('.') : value;
267
301
  const int = floatNumParts[0];
268
302
  const float = floatNumParts[1];
269
303
 
270
- if (float && float.length > floatToFix) {
271
- setInnerValue(`${int}.${float.substr(0, floatToFix)}`);
304
+ if (float) {
305
+ if (float[0] === '0' || float[0] !== '0') {
306
+ if (float[1] === undefined) {
307
+ setInnerValue(`${int}.${float[0]}`);
308
+ if (change) {
309
+ change(`${int}.${float[0]}`);
310
+ }
311
+ } else if (float[1] === '0') {
312
+ if (float[2] === undefined || float[2] === '0') {
313
+ setInnerValue(`${int}.${float[0]}`);
314
+ if (change) {
315
+ change(`${int}.${float[0]}`);
316
+ }
317
+ } else if (float[2] !== undefined && float[2] !== '0') {
318
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
319
+ if (change) {
320
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
321
+ }
322
+ }
323
+ } else if (float[1] !== undefined && float[1] !== '0') {
324
+ if (float[2] === undefined || float[2] === '0') {
325
+ setInnerValue(`${int}.${float[0]}${float[1]}`);
326
+ if (change) {
327
+ change(`${int}.${float[0]}${float[1]}`);
328
+ }
329
+ } else if (float[2] !== undefined && float[2] !== '0') {
330
+ setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
331
+ if (change) {
332
+ change(`${int}.${float[0]}${float[1]}${float[2]}`);
333
+ }
334
+ }
335
+ }
336
+ }
337
+ }
338
+ } else if (floatToFix === 0) {
339
+ const floatNumParts = typeof value === 'string' ? value.split('.') : value;
340
+ const int = floatNumParts[0];
341
+ if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
342
+ setInnerValue(`${int}`);
272
343
  if (change) {
273
- change(`${int}.${float.substr(0, floatToFix)}`);
344
+ change(`${int}`);
274
345
  }
275
- }
346
+ }
276
347
  }
277
348
  if (value === '') {
278
349
  setInnerValue('');
@@ -12,7 +12,7 @@ export default {
12
12
  };
13
13
 
14
14
  const Template = (args) => {
15
- const [newVal, setNewVal] = useState('');
15
+ const [newVal, setNewVal] = useState('5.0100');
16
16
  const handleChange = (val) => {
17
17
  setNewVal(val);
18
18
  };
@@ -10,6 +10,7 @@ import ReactCloseIcon from '../icon/CloseIcon';
10
10
  import styles from './select.module.css';
11
11
 
12
12
  export const Select = ({
13
+ dots,
13
14
  options,
14
15
  multiple,
15
16
  disabled,
@@ -158,7 +159,7 @@ export const Select = ({
158
159
  }
159
160
  }
160
161
  return true;
161
- }
162
+ };
162
163
 
163
164
  useEffect(() => {
164
165
  if(opened){
@@ -317,22 +318,24 @@ export const Select = ({
317
318
  onClick={disabled ? _ => _ : _ => handleSelectItem(option)}
318
319
  onMouseEnter={disabled ? _ => _ : e => handleMouseEnterOption(e)}
319
320
  onMouseLeave={disabled ? _ => _ : e => handleMouseLeaveOption(e)}
320
- className={`${styles['select-content-bottom-row']}`}
321
+ className={`${styles['select-content-bottom-row']} ${dots || configStyles.SELECT.dots ? styles['ellipsis'] : ''}`}
321
322
  style={{
323
+ overflowWrap: !dots && !configStyles.SELECT.dots ? 'anywhere' : 'break-word',
322
324
  color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
323
325
  cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
324
326
  padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
325
327
  fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
326
328
  boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
327
- minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
329
+ minHeight: !dots && !configStyles.SELECT.dots ? 'auto' : optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
328
330
  fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
329
- lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
330
- marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
331
+ lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
332
+ marginBottom: !dots && !configStyles.SELECT.dots ? '10px' : optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
331
333
  backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor,
332
334
  }}
333
335
  >
334
336
  {multiple && multipleCheckbox ? <SingleCheckbox checked={option.checked} /> : ''}
335
337
  {option[keyNames.name]}
338
+
336
339
  </div>
337
340
  })
338
341
  }
@@ -362,6 +365,7 @@ export const Select = ({
362
365
  };
363
366
 
364
367
  Select.propTypes = {
368
+ dots: PropTypes.bool,
365
369
  options: PropTypes.array,
366
370
  multiple: PropTypes.bool,
367
371
  onChange: PropTypes.func,
@@ -79,6 +79,13 @@
79
79
  margin-bottom: 0px;
80
80
  }
81
81
 
82
+ .ellipsis {
83
+ display: inline-block;
84
+ white-space: nowrap;
85
+ overflow: hidden;
86
+ text-overflow: ellipsis;
87
+ }
88
+
82
89
  @keyframes select-show {
83
90
  100% {
84
91
  max-height: 234px;
@@ -52,7 +52,7 @@ const createToast = ({
52
52
  toastParentBlock = document.createElement('div');
53
53
  toastParentBlock.style.position = 'fixed';
54
54
  toastParentBlock.style.display = 'flex';
55
- toastParentBlock.style.zIndex = 99999;
55
+ toastParentBlock.style.zIndex = 9999999999999999999999999;
56
56
  toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
57
57
  toastParentBlock.setAttribute('id', styles[position]);
58
58
  toastParentBlock.appendChild(toastBlock);
@@ -325,6 +325,7 @@ import StackAlt from './assets/stackalt.svg';
325
325
 
326
326
  ```
327
327
  {
328
+ dots: false, // for options, cut text and add dots
328
329
  marginTop: '10px', // for error message postion from top
329
330
  labelWeight: '500', // for label font weight
330
331
  labelColor: '#3C393E', // for label color
package/tui.config.js CHANGED
@@ -181,6 +181,7 @@ module.exports = {
181
181
  },
182
182
  // default properties for <Select /> component
183
183
  SELECT: {
184
+ dots: false, // for options, cut text and add dots
184
185
  showCloseIcon: true, // for select reset icon, when prop exist or true is show, otherwise is hide
185
186
  marginTop: '10px', // for error message postion from top
186
187
  labelWeight: '500', // for label font weight