@xaypay/tui 0.0.98 → 0.0.99
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 +84 -16
- package/dist/index.js +84 -16
- package/package.json +1 -1
- package/src/components/input/index.js +76 -11
- package/src/components/input/input.stories.js +1 -1
- package/src/components/select/index.js +9 -5
- package/src/components/select/select.module.css +7 -0
- package/src/components/toaster/index.js +1 -1
- package/src/stories/configuration.stories.mdx +1 -0
- package/tui.config.js +1 -0
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
|
|
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
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
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) {
|
|
@@ -912,14 +940,51 @@ const Input = ({
|
|
|
912
940
|
change(`${maxNumSize}`);
|
|
913
941
|
}
|
|
914
942
|
}
|
|
915
|
-
if (floatToFix && floatToFix > 0
|
|
943
|
+
if (floatToFix && floatToFix > 0) {
|
|
916
944
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
917
945
|
const int = floatNumParts[0];
|
|
918
946
|
const float = floatNumParts[1];
|
|
919
|
-
if (float
|
|
920
|
-
|
|
947
|
+
if (float) {
|
|
948
|
+
if (float[0] === '0' || float[0] !== '0') {
|
|
949
|
+
if (float[1] === undefined) {
|
|
950
|
+
setInnerValue(`${int}.${float[0]}`);
|
|
951
|
+
if (change) {
|
|
952
|
+
change(`${int}.${float[0]}`);
|
|
953
|
+
}
|
|
954
|
+
} else if (float[1] === '0') {
|
|
955
|
+
if (float[2] === undefined || float[2] === '0') {
|
|
956
|
+
setInnerValue(`${int}.${float[0]}`);
|
|
957
|
+
if (change) {
|
|
958
|
+
change(`${int}.${float[0]}`);
|
|
959
|
+
}
|
|
960
|
+
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
961
|
+
setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
962
|
+
if (change) {
|
|
963
|
+
change(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
} else if (float[1] !== undefined && float[1] !== '0') {
|
|
967
|
+
if (float[2] === undefined || float[2] === '0') {
|
|
968
|
+
setInnerValue(`${int}.${float[0]}${float[1]}`);
|
|
969
|
+
if (change) {
|
|
970
|
+
change(`${int}.${float[0]}${float[1]}`);
|
|
971
|
+
}
|
|
972
|
+
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
973
|
+
setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
974
|
+
if (change) {
|
|
975
|
+
change(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
} else if (floatToFix === 0) {
|
|
982
|
+
const floatNumParts = typeof value === 'string' ? currentValue.split('.') : value;
|
|
983
|
+
const int = floatNumParts[0];
|
|
984
|
+
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
985
|
+
setInnerValue(`${int}`);
|
|
921
986
|
if (change) {
|
|
922
|
-
change(`${int}
|
|
987
|
+
change(`${int}`);
|
|
923
988
|
}
|
|
924
989
|
}
|
|
925
990
|
}
|
|
@@ -1296,11 +1361,12 @@ const SvgArrow = ({
|
|
|
1296
1361
|
fill: fillColor ? fillColor : '#3C393E'
|
|
1297
1362
|
}));
|
|
1298
1363
|
|
|
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"};
|
|
1364
|
+
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}}";
|
|
1365
|
+
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
1366
|
styleInject(css_248z$a);
|
|
1302
1367
|
|
|
1303
1368
|
const Select = ({
|
|
1369
|
+
dots,
|
|
1304
1370
|
options,
|
|
1305
1371
|
multiple,
|
|
1306
1372
|
disabled,
|
|
@@ -1551,17 +1617,18 @@ const Select = ({
|
|
|
1551
1617
|
onClick: disabled ? _ => _ : _ => handleSelectItem(option),
|
|
1552
1618
|
onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
|
|
1553
1619
|
onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
|
|
1554
|
-
className: `${styles$8['select-content-bottom-row']}`,
|
|
1620
|
+
className: `${styles$8['select-content-bottom-row']} ${dots || configStyles.SELECT.dots ? styles$8['ellipsis'] : ''}`,
|
|
1555
1621
|
style: {
|
|
1622
|
+
overflowWrap: !dots && !configStyles.SELECT.dots ? 'anywhere' : 'break-word',
|
|
1556
1623
|
color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
|
|
1557
1624
|
cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
|
|
1558
1625
|
padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
|
|
1559
1626
|
fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
|
|
1560
1627
|
boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
|
|
1561
|
-
minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1628
|
+
minHeight: !dots && !configStyles.SELECT.dots ? 'auto' : optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1562
1629
|
fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
|
|
1563
|
-
lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
1564
|
-
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1630
|
+
lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
1631
|
+
marginBottom: !dots && !configStyles.SELECT.dots ? '10px' : optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1565
1632
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
|
|
1566
1633
|
}
|
|
1567
1634
|
}, multiple && multipleCheckbox ? /*#__PURE__*/React__default.createElement(SingleCheckbox, {
|
|
@@ -1578,6 +1645,7 @@ const Select = ({
|
|
|
1578
1645
|
}, errorMessage) : '');
|
|
1579
1646
|
};
|
|
1580
1647
|
Select.propTypes = {
|
|
1648
|
+
dots: PropTypes.bool,
|
|
1581
1649
|
options: PropTypes.array,
|
|
1582
1650
|
multiple: PropTypes.bool,
|
|
1583
1651
|
onChange: PropTypes.func,
|
|
@@ -1898,7 +1966,7 @@ const createToast = ({
|
|
|
1898
1966
|
toastParentBlock = document.createElement('div');
|
|
1899
1967
|
toastParentBlock.style.position = 'fixed';
|
|
1900
1968
|
toastParentBlock.style.display = 'flex';
|
|
1901
|
-
toastParentBlock.style.zIndex =
|
|
1969
|
+
toastParentBlock.style.zIndex = 9999999999999999999999999;
|
|
1902
1970
|
toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
|
|
1903
1971
|
toastParentBlock.setAttribute('id', styles$7[position]);
|
|
1904
1972
|
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
|
|
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
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
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) {
|
|
@@ -942,14 +970,51 @@ const Input = ({
|
|
|
942
970
|
change(`${maxNumSize}`);
|
|
943
971
|
}
|
|
944
972
|
}
|
|
945
|
-
if (floatToFix && floatToFix > 0
|
|
973
|
+
if (floatToFix && floatToFix > 0) {
|
|
946
974
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
947
975
|
const int = floatNumParts[0];
|
|
948
976
|
const float = floatNumParts[1];
|
|
949
|
-
if (float
|
|
950
|
-
|
|
977
|
+
if (float) {
|
|
978
|
+
if (float[0] === '0' || float[0] !== '0') {
|
|
979
|
+
if (float[1] === undefined) {
|
|
980
|
+
setInnerValue(`${int}.${float[0]}`);
|
|
981
|
+
if (change) {
|
|
982
|
+
change(`${int}.${float[0]}`);
|
|
983
|
+
}
|
|
984
|
+
} else if (float[1] === '0') {
|
|
985
|
+
if (float[2] === undefined || float[2] === '0') {
|
|
986
|
+
setInnerValue(`${int}.${float[0]}`);
|
|
987
|
+
if (change) {
|
|
988
|
+
change(`${int}.${float[0]}`);
|
|
989
|
+
}
|
|
990
|
+
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
991
|
+
setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
992
|
+
if (change) {
|
|
993
|
+
change(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
} else if (float[1] !== undefined && float[1] !== '0') {
|
|
997
|
+
if (float[2] === undefined || float[2] === '0') {
|
|
998
|
+
setInnerValue(`${int}.${float[0]}${float[1]}`);
|
|
999
|
+
if (change) {
|
|
1000
|
+
change(`${int}.${float[0]}${float[1]}`);
|
|
1001
|
+
}
|
|
1002
|
+
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
1003
|
+
setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
1004
|
+
if (change) {
|
|
1005
|
+
change(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
} else if (floatToFix === 0) {
|
|
1012
|
+
const floatNumParts = typeof value === 'string' ? currentValue.split('.') : value;
|
|
1013
|
+
const int = floatNumParts[0];
|
|
1014
|
+
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
1015
|
+
setInnerValue(`${int}`);
|
|
951
1016
|
if (change) {
|
|
952
|
-
change(`${int}
|
|
1017
|
+
change(`${int}`);
|
|
953
1018
|
}
|
|
954
1019
|
}
|
|
955
1020
|
}
|
|
@@ -1326,11 +1391,12 @@ const SvgArrow = ({
|
|
|
1326
1391
|
fill: fillColor ? fillColor : '#3C393E'
|
|
1327
1392
|
}));
|
|
1328
1393
|
|
|
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"};
|
|
1394
|
+
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}}";
|
|
1395
|
+
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
1396
|
styleInject(css_248z$a);
|
|
1332
1397
|
|
|
1333
1398
|
const Select = ({
|
|
1399
|
+
dots,
|
|
1334
1400
|
options,
|
|
1335
1401
|
multiple,
|
|
1336
1402
|
disabled,
|
|
@@ -1581,17 +1647,18 @@ const Select = ({
|
|
|
1581
1647
|
onClick: disabled ? _ => _ : _ => handleSelectItem(option),
|
|
1582
1648
|
onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
|
|
1583
1649
|
onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
|
|
1584
|
-
className: `${styles$8['select-content-bottom-row']}`,
|
|
1650
|
+
className: `${styles$8['select-content-bottom-row']} ${dots || configStyles.SELECT.dots ? styles$8['ellipsis'] : ''}`,
|
|
1585
1651
|
style: {
|
|
1652
|
+
overflowWrap: !dots && !configStyles.SELECT.dots ? 'anywhere' : 'break-word',
|
|
1586
1653
|
color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
|
|
1587
1654
|
cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
|
|
1588
1655
|
padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
|
|
1589
1656
|
fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
|
|
1590
1657
|
boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
|
|
1591
|
-
minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1658
|
+
minHeight: !dots && !configStyles.SELECT.dots ? 'auto' : optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1592
1659
|
fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
|
|
1593
|
-
lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
1594
|
-
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1660
|
+
lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
1661
|
+
marginBottom: !dots && !configStyles.SELECT.dots ? '10px' : optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1595
1662
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
|
|
1596
1663
|
}
|
|
1597
1664
|
}, multiple && multipleCheckbox ? /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
|
|
@@ -1608,6 +1675,7 @@ const Select = ({
|
|
|
1608
1675
|
}, errorMessage) : '');
|
|
1609
1676
|
};
|
|
1610
1677
|
Select.propTypes = {
|
|
1678
|
+
dots: PropTypes__default["default"].bool,
|
|
1611
1679
|
options: PropTypes__default["default"].array,
|
|
1612
1680
|
multiple: PropTypes__default["default"].bool,
|
|
1613
1681
|
onChange: PropTypes__default["default"].func,
|
|
@@ -1928,7 +1996,7 @@ const createToast = ({
|
|
|
1928
1996
|
toastParentBlock = document.createElement('div');
|
|
1929
1997
|
toastParentBlock.style.position = 'fixed';
|
|
1930
1998
|
toastParentBlock.style.display = 'flex';
|
|
1931
|
-
toastParentBlock.style.zIndex =
|
|
1999
|
+
toastParentBlock.style.zIndex = 9999999999999999999999999;
|
|
1932
2000
|
toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
|
|
1933
2001
|
toastParentBlock.setAttribute('id', styles$7[position]);
|
|
1934
2002
|
toastParentBlock.appendChild(toastBlock);
|
package/package.json
CHANGED
|
@@ -156,17 +156,45 @@ export const Input = ({
|
|
|
156
156
|
change(`${maxNumSize}`);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
if (floatToFix && floatToFix > 0
|
|
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
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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];
|
|
@@ -262,17 +290,54 @@ export const Input = ({
|
|
|
262
290
|
change(`${maxNumSize}`);
|
|
263
291
|
}
|
|
264
292
|
}
|
|
265
|
-
if (floatToFix && floatToFix > 0
|
|
293
|
+
if (floatToFix && floatToFix > 0) {
|
|
266
294
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
267
295
|
const int = floatNumParts[0];
|
|
268
296
|
const float = floatNumParts[1];
|
|
269
297
|
|
|
270
|
-
if (float
|
|
271
|
-
|
|
298
|
+
if (float) {
|
|
299
|
+
if (float[0] === '0' || float[0] !== '0') {
|
|
300
|
+
if (float[1] === undefined) {
|
|
301
|
+
setInnerValue(`${int}.${float[0]}`);
|
|
302
|
+
if (change) {
|
|
303
|
+
change(`${int}.${float[0]}`);
|
|
304
|
+
}
|
|
305
|
+
} else if (float[1] === '0') {
|
|
306
|
+
if (float[2] === undefined || float[2] === '0') {
|
|
307
|
+
setInnerValue(`${int}.${float[0]}`);
|
|
308
|
+
if (change) {
|
|
309
|
+
change(`${int}.${float[0]}`);
|
|
310
|
+
}
|
|
311
|
+
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
312
|
+
setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
313
|
+
if (change) {
|
|
314
|
+
change(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
} else if (float[1] !== undefined && float[1] !== '0') {
|
|
318
|
+
if (float[2] === undefined || float[2] === '0') {
|
|
319
|
+
setInnerValue(`${int}.${float[0]}${float[1]}`);
|
|
320
|
+
if (change) {
|
|
321
|
+
change(`${int}.${float[0]}${float[1]}`);
|
|
322
|
+
}
|
|
323
|
+
} else if (float[2] !== undefined && float[2] !== '0') {
|
|
324
|
+
setInnerValue(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
325
|
+
if (change) {
|
|
326
|
+
change(`${int}.${float[0]}${float[1]}${float[2]}`);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
} else if (floatToFix === 0) {
|
|
333
|
+
const floatNumParts = typeof value === 'string' ? currentValue.split('.') : value;
|
|
334
|
+
const int = floatNumParts[0];
|
|
335
|
+
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
336
|
+
setInnerValue(`${int}`);
|
|
272
337
|
if (change) {
|
|
273
|
-
change(`${int}
|
|
338
|
+
change(`${int}`);
|
|
274
339
|
}
|
|
275
|
-
}
|
|
340
|
+
}
|
|
276
341
|
}
|
|
277
342
|
if (value === '') {
|
|
278
343
|
setInnerValue('');
|
|
@@ -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,
|
|
@@ -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 =
|
|
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
|