@xaypay/tui 0.0.100 → 0.0.102
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 +45 -36
- package/dist/index.js +45 -36
- package/package.json +1 -1
- package/src/components/icon/Next.js +4 -5
- package/src/components/icon/Prev.js +4 -5
- package/src/components/input/index.js +26 -20
- package/src/components/select/index.js +3 -4
- package/src/components/toaster/index.js +1 -1
- package/src/stories/configuration.stories.mdx +1 -0
- package/tui.config.js +1 -1
package/dist/index.es.js
CHANGED
|
@@ -323,7 +323,6 @@ styleInject(css_248z$d);
|
|
|
323
323
|
const SvgNext = ({
|
|
324
324
|
title,
|
|
325
325
|
titleId,
|
|
326
|
-
fillColor,
|
|
327
326
|
...props
|
|
328
327
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
329
328
|
width: "24",
|
|
@@ -334,17 +333,19 @@ const SvgNext = ({
|
|
|
334
333
|
"aria-labelledby": titleId
|
|
335
334
|
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
336
335
|
id: titleId
|
|
337
|
-
}, title) : null, /*#__PURE__*/React.createElement("
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
fill:
|
|
336
|
+
}, title) : null, /*#__PURE__*/React.createElement("circle", {
|
|
337
|
+
cx: 12,
|
|
338
|
+
cy: 12,
|
|
339
|
+
r: 12,
|
|
340
|
+
fill: "#fff"
|
|
341
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
342
|
+
d: "M15.598 12.01c0 .2-.07.393-.197.547l-4.284 5.134a.858.858 0 0 1-1.319-1.095l3.838-4.587-3.7-4.586a.855.855 0 0 1 .128-1.206.857.857 0 0 1 1.25.12l4.138 5.133a.855.855 0 0 1 .146.54Z",
|
|
343
|
+
fill: "#3C393E"
|
|
342
344
|
}));
|
|
343
345
|
|
|
344
346
|
const SvgPrev = ({
|
|
345
347
|
title,
|
|
346
348
|
titleId,
|
|
347
|
-
fillColor,
|
|
348
349
|
...props
|
|
349
350
|
}) => /*#__PURE__*/React.createElement("svg", _extends({
|
|
350
351
|
width: "24",
|
|
@@ -355,11 +356,15 @@ const SvgPrev = ({
|
|
|
355
356
|
"aria-labelledby": titleId
|
|
356
357
|
}, props), title ? /*#__PURE__*/React.createElement("title", {
|
|
357
358
|
id: titleId
|
|
358
|
-
}, title) : null, /*#__PURE__*/React.createElement("
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
359
|
+
}, title) : null, /*#__PURE__*/React.createElement("circle", {
|
|
360
|
+
cx: 12,
|
|
361
|
+
cy: 12,
|
|
362
|
+
r: 12,
|
|
363
|
+
transform: "rotate(180 12 12)",
|
|
364
|
+
fill: "#fff"
|
|
365
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
366
|
+
d: "M8.402 11.99c0-.2.07-.393.197-.547l4.284-5.134a.858.858 0 0 1 1.319 1.095l-3.838 4.587 3.7 4.586a.856.856 0 0 1-.128 1.206.856.856 0 0 1-1.25-.12L8.547 12.53a.855.855 0 0 1-.146-.54Z",
|
|
367
|
+
fill: "#3C393E"
|
|
363
368
|
}));
|
|
364
369
|
|
|
365
370
|
const SvgCloseIcon = ({
|
|
@@ -796,14 +801,7 @@ const Input = ({
|
|
|
796
801
|
}
|
|
797
802
|
}
|
|
798
803
|
if (type === 'number') {
|
|
799
|
-
const regNum = /^\d+(\.)?(\d+)
|
|
800
|
-
if (!regNum.test(currentValue)) {
|
|
801
|
-
const newStr = currentValue.replace(/[^\d+]/g, '');
|
|
802
|
-
setInnerValue(newStr);
|
|
803
|
-
if (change) {
|
|
804
|
-
change(newStr);
|
|
805
|
-
}
|
|
806
|
-
}
|
|
804
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
807
805
|
if (minNumSize && currentValue < minNumSize) {
|
|
808
806
|
setInnerValue(`${minNumSize}`);
|
|
809
807
|
if (change) {
|
|
@@ -816,7 +814,7 @@ const Input = ({
|
|
|
816
814
|
change(`${maxNumSize}`);
|
|
817
815
|
}
|
|
818
816
|
}
|
|
819
|
-
if (floatToFix
|
|
817
|
+
if (floatToFix > 0) {
|
|
820
818
|
const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
|
|
821
819
|
const int = floatNumParts[0];
|
|
822
820
|
const float = floatNumParts[1];
|
|
@@ -854,7 +852,7 @@ const Input = ({
|
|
|
854
852
|
}
|
|
855
853
|
}
|
|
856
854
|
}
|
|
857
|
-
} else
|
|
855
|
+
} else {
|
|
858
856
|
const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
|
|
859
857
|
const int = floatNumParts[0];
|
|
860
858
|
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
@@ -864,6 +862,15 @@ const Input = ({
|
|
|
864
862
|
}
|
|
865
863
|
}
|
|
866
864
|
}
|
|
865
|
+
if (!regNum.test(currentValue)) {
|
|
866
|
+
const newStr = currentValue.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
867
|
+
return b + c.replace(/\./g, '');
|
|
868
|
+
});
|
|
869
|
+
setInnerValue(newStr);
|
|
870
|
+
if (change) {
|
|
871
|
+
change(newStr);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
867
874
|
if (currentValue === '') {
|
|
868
875
|
setInnerValue('');
|
|
869
876
|
if (change) {
|
|
@@ -926,14 +933,7 @@ const Input = ({
|
|
|
926
933
|
}
|
|
927
934
|
}
|
|
928
935
|
if (type === 'number') {
|
|
929
|
-
const regNum = /^\d+(\.)?(\d+)
|
|
930
|
-
if (!regNum.test(value)) {
|
|
931
|
-
const newStr = value.replace(/[^\d+]/g, '');
|
|
932
|
-
setInnerValue(newStr);
|
|
933
|
-
if (change) {
|
|
934
|
-
change(newStr);
|
|
935
|
-
}
|
|
936
|
-
}
|
|
936
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
937
937
|
if (minNumSize && value < minNumSize) {
|
|
938
938
|
setInnerValue(`${minNumSize}`);
|
|
939
939
|
if (change) {
|
|
@@ -946,7 +946,7 @@ const Input = ({
|
|
|
946
946
|
change(`${maxNumSize}`);
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
if (floatToFix
|
|
949
|
+
if (floatToFix > 0) {
|
|
950
950
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
951
951
|
const int = floatNumParts[0];
|
|
952
952
|
const float = floatNumParts[1];
|
|
@@ -984,7 +984,7 @@ const Input = ({
|
|
|
984
984
|
}
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
|
-
} else
|
|
987
|
+
} else {
|
|
988
988
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
989
989
|
const int = floatNumParts[0];
|
|
990
990
|
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
@@ -994,6 +994,15 @@ const Input = ({
|
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
}
|
|
997
|
+
if (!regNum.test(value)) {
|
|
998
|
+
const newStr = value.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
999
|
+
return b + c.replace(/\./g, '');
|
|
1000
|
+
});
|
|
1001
|
+
setInnerValue(newStr);
|
|
1002
|
+
if (change) {
|
|
1003
|
+
change(newStr);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
997
1006
|
if (value === '') {
|
|
998
1007
|
setInnerValue('');
|
|
999
1008
|
if (change) {
|
|
@@ -1594,7 +1603,7 @@ const Select = ({
|
|
|
1594
1603
|
}
|
|
1595
1604
|
}) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default.createElement("div", {
|
|
1596
1605
|
className: `${styles$8['select-content-top-icon']}`
|
|
1597
|
-
}, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default.createElement("span", null, newSelected.length), (showCloseIcon ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
1606
|
+
}, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default.createElement("span", null, newSelected.length), (showCloseIcon === true || showCloseIcon === false ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default.createElement("div", {
|
|
1598
1607
|
className: `${styles$8['close-icon']}`,
|
|
1599
1608
|
onClick: disabled ? _ => _ : handleClearSelect,
|
|
1600
1609
|
style: {
|
|
@@ -1631,10 +1640,10 @@ const Select = ({
|
|
|
1631
1640
|
padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
|
|
1632
1641
|
fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
|
|
1633
1642
|
boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
|
|
1634
|
-
minHeight:
|
|
1643
|
+
minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1635
1644
|
fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
|
|
1636
1645
|
lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
1637
|
-
marginBottom:
|
|
1646
|
+
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1638
1647
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
|
|
1639
1648
|
}
|
|
1640
1649
|
}, multiple && multipleCheckbox ? /*#__PURE__*/React__default.createElement(SingleCheckbox, {
|
|
@@ -1972,7 +1981,7 @@ const createToast = ({
|
|
|
1972
1981
|
toastParentBlock = document.createElement('div');
|
|
1973
1982
|
toastParentBlock.style.position = 'fixed';
|
|
1974
1983
|
toastParentBlock.style.display = 'flex';
|
|
1975
|
-
toastParentBlock.style.zIndex =
|
|
1984
|
+
toastParentBlock.style.zIndex = 999999999999;
|
|
1976
1985
|
toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
|
|
1977
1986
|
toastParentBlock.setAttribute('id', styles$7[position]);
|
|
1978
1987
|
toastParentBlock.appendChild(toastBlock);
|
package/dist/index.js
CHANGED
|
@@ -353,7 +353,6 @@ styleInject(css_248z$d);
|
|
|
353
353
|
const SvgNext = ({
|
|
354
354
|
title,
|
|
355
355
|
titleId,
|
|
356
|
-
fillColor,
|
|
357
356
|
...props
|
|
358
357
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
359
358
|
width: "24",
|
|
@@ -364,17 +363,19 @@ const SvgNext = ({
|
|
|
364
363
|
"aria-labelledby": titleId
|
|
365
364
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
366
365
|
id: titleId
|
|
367
|
-
}, title) : null, /*#__PURE__*/React__namespace.createElement("
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
fill:
|
|
366
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
367
|
+
cx: 12,
|
|
368
|
+
cy: 12,
|
|
369
|
+
r: 12,
|
|
370
|
+
fill: "#fff"
|
|
371
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
372
|
+
d: "M15.598 12.01c0 .2-.07.393-.197.547l-4.284 5.134a.858.858 0 0 1-1.319-1.095l3.838-4.587-3.7-4.586a.855.855 0 0 1 .128-1.206.857.857 0 0 1 1.25.12l4.138 5.133a.855.855 0 0 1 .146.54Z",
|
|
373
|
+
fill: "#3C393E"
|
|
372
374
|
}));
|
|
373
375
|
|
|
374
376
|
const SvgPrev = ({
|
|
375
377
|
title,
|
|
376
378
|
titleId,
|
|
377
|
-
fillColor,
|
|
378
379
|
...props
|
|
379
380
|
}) => /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
380
381
|
width: "24",
|
|
@@ -385,11 +386,15 @@ const SvgPrev = ({
|
|
|
385
386
|
"aria-labelledby": titleId
|
|
386
387
|
}, props), title ? /*#__PURE__*/React__namespace.createElement("title", {
|
|
387
388
|
id: titleId
|
|
388
|
-
}, title) : null, /*#__PURE__*/React__namespace.createElement("
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
}, title) : null, /*#__PURE__*/React__namespace.createElement("circle", {
|
|
390
|
+
cx: 12,
|
|
391
|
+
cy: 12,
|
|
392
|
+
r: 12,
|
|
393
|
+
transform: "rotate(180 12 12)",
|
|
394
|
+
fill: "#fff"
|
|
395
|
+
}), /*#__PURE__*/React__namespace.createElement("path", {
|
|
396
|
+
d: "M8.402 11.99c0-.2.07-.393.197-.547l4.284-5.134a.858.858 0 0 1 1.319 1.095l-3.838 4.587 3.7 4.586a.856.856 0 0 1-.128 1.206.856.856 0 0 1-1.25-.12L8.547 12.53a.855.855 0 0 1-.146-.54Z",
|
|
397
|
+
fill: "#3C393E"
|
|
393
398
|
}));
|
|
394
399
|
|
|
395
400
|
const SvgCloseIcon = ({
|
|
@@ -826,14 +831,7 @@ const Input = ({
|
|
|
826
831
|
}
|
|
827
832
|
}
|
|
828
833
|
if (type === 'number') {
|
|
829
|
-
const regNum = /^\d+(\.)?(\d+)
|
|
830
|
-
if (!regNum.test(currentValue)) {
|
|
831
|
-
const newStr = currentValue.replace(/[^\d+]/g, '');
|
|
832
|
-
setInnerValue(newStr);
|
|
833
|
-
if (change) {
|
|
834
|
-
change(newStr);
|
|
835
|
-
}
|
|
836
|
-
}
|
|
834
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
837
835
|
if (minNumSize && currentValue < minNumSize) {
|
|
838
836
|
setInnerValue(`${minNumSize}`);
|
|
839
837
|
if (change) {
|
|
@@ -846,7 +844,7 @@ const Input = ({
|
|
|
846
844
|
change(`${maxNumSize}`);
|
|
847
845
|
}
|
|
848
846
|
}
|
|
849
|
-
if (floatToFix
|
|
847
|
+
if (floatToFix > 0) {
|
|
850
848
|
const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
|
|
851
849
|
const int = floatNumParts[0];
|
|
852
850
|
const float = floatNumParts[1];
|
|
@@ -884,7 +882,7 @@ const Input = ({
|
|
|
884
882
|
}
|
|
885
883
|
}
|
|
886
884
|
}
|
|
887
|
-
} else
|
|
885
|
+
} else {
|
|
888
886
|
const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
|
|
889
887
|
const int = floatNumParts[0];
|
|
890
888
|
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
@@ -894,6 +892,15 @@ const Input = ({
|
|
|
894
892
|
}
|
|
895
893
|
}
|
|
896
894
|
}
|
|
895
|
+
if (!regNum.test(currentValue)) {
|
|
896
|
+
const newStr = currentValue.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
897
|
+
return b + c.replace(/\./g, '');
|
|
898
|
+
});
|
|
899
|
+
setInnerValue(newStr);
|
|
900
|
+
if (change) {
|
|
901
|
+
change(newStr);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
897
904
|
if (currentValue === '') {
|
|
898
905
|
setInnerValue('');
|
|
899
906
|
if (change) {
|
|
@@ -956,14 +963,7 @@ const Input = ({
|
|
|
956
963
|
}
|
|
957
964
|
}
|
|
958
965
|
if (type === 'number') {
|
|
959
|
-
const regNum = /^\d+(\.)?(\d+)
|
|
960
|
-
if (!regNum.test(value)) {
|
|
961
|
-
const newStr = value.replace(/[^\d+]/g, '');
|
|
962
|
-
setInnerValue(newStr);
|
|
963
|
-
if (change) {
|
|
964
|
-
change(newStr);
|
|
965
|
-
}
|
|
966
|
-
}
|
|
966
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
967
967
|
if (minNumSize && value < minNumSize) {
|
|
968
968
|
setInnerValue(`${minNumSize}`);
|
|
969
969
|
if (change) {
|
|
@@ -976,7 +976,7 @@ const Input = ({
|
|
|
976
976
|
change(`${maxNumSize}`);
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
if (floatToFix
|
|
979
|
+
if (floatToFix > 0) {
|
|
980
980
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
981
981
|
const int = floatNumParts[0];
|
|
982
982
|
const float = floatNumParts[1];
|
|
@@ -1014,7 +1014,7 @@ const Input = ({
|
|
|
1014
1014
|
}
|
|
1015
1015
|
}
|
|
1016
1016
|
}
|
|
1017
|
-
} else
|
|
1017
|
+
} else {
|
|
1018
1018
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
1019
1019
|
const int = floatNumParts[0];
|
|
1020
1020
|
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
@@ -1024,6 +1024,15 @@ const Input = ({
|
|
|
1024
1024
|
}
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
|
+
if (!regNum.test(value)) {
|
|
1028
|
+
const newStr = value.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
1029
|
+
return b + c.replace(/\./g, '');
|
|
1030
|
+
});
|
|
1031
|
+
setInnerValue(newStr);
|
|
1032
|
+
if (change) {
|
|
1033
|
+
change(newStr);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1027
1036
|
if (value === '') {
|
|
1028
1037
|
setInnerValue('');
|
|
1029
1038
|
if (change) {
|
|
@@ -1624,7 +1633,7 @@ const Select = ({
|
|
|
1624
1633
|
}
|
|
1625
1634
|
}) : defaultOption ? defaultOption : ''), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1626
1635
|
className: `${styles$8['select-content-top-icon']}`
|
|
1627
|
-
}, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default["default"].createElement("span", null, newSelected.length), (showCloseIcon ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1636
|
+
}, !disabled && multiple && newSelected.length > 1 && /*#__PURE__*/React__default["default"].createElement("span", null, newSelected.length), (showCloseIcon === true || showCloseIcon === false ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1628
1637
|
className: `${styles$8['close-icon']}`,
|
|
1629
1638
|
onClick: disabled ? _ => _ : handleClearSelect,
|
|
1630
1639
|
style: {
|
|
@@ -1661,10 +1670,10 @@ const Select = ({
|
|
|
1661
1670
|
padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
|
|
1662
1671
|
fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
|
|
1663
1672
|
boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
|
|
1664
|
-
minHeight:
|
|
1673
|
+
minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1665
1674
|
fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
|
|
1666
1675
|
lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
1667
|
-
marginBottom:
|
|
1676
|
+
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1668
1677
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
|
|
1669
1678
|
}
|
|
1670
1679
|
}, multiple && multipleCheckbox ? /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
|
|
@@ -2002,7 +2011,7 @@ const createToast = ({
|
|
|
2002
2011
|
toastParentBlock = document.createElement('div');
|
|
2003
2012
|
toastParentBlock.style.position = 'fixed';
|
|
2004
2013
|
toastParentBlock.style.display = 'flex';
|
|
2005
|
-
toastParentBlock.style.zIndex =
|
|
2014
|
+
toastParentBlock.style.zIndex = 999999999999;
|
|
2006
2015
|
toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
|
|
2007
2016
|
toastParentBlock.setAttribute('id', styles$7[position]);
|
|
2008
2017
|
toastParentBlock.appendChild(toastBlock);
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
const SvgNext = ({ title, titleId,
|
|
2
|
+
const SvgNext = ({ title, titleId, ...props }) => (
|
|
3
3
|
<svg
|
|
4
4
|
width="24"
|
|
5
5
|
height="24"
|
|
@@ -10,11 +10,10 @@ const SvgNext = ({ title, titleId, fillColor, ...props }) => (
|
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
12
|
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<circle cx={12} cy={12} r={12} fill="#fff" />
|
|
13
14
|
<path
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
d="M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12Zm3.4-11.443a.854.854 0 0 0 .198-.548.855.855 0 0 0-.146-.539l-4.137-5.134a.857.857 0 0 0-1.251-.12.856.856 0 0 0-.129 1.207l3.701 4.586-3.838 4.587a.856.856 0 0 0 .739 1.4.858.858 0 0 0 .58-.305l4.284-5.134Z"
|
|
17
|
-
fill={fillColor ? fillColor : '#fff'}
|
|
15
|
+
d="M15.598 12.01c0 .2-.07.393-.197.547l-4.284 5.134a.858.858 0 0 1-1.319-1.095l3.838-4.587-3.7-4.586a.855.855 0 0 1 .128-1.206.857.857 0 0 1 1.25.12l4.138 5.133a.855.855 0 0 1 .146.54Z"
|
|
16
|
+
fill="#3C393E"
|
|
18
17
|
/>
|
|
19
18
|
</svg>
|
|
20
19
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
const SvgPrev = ({ title, titleId,
|
|
2
|
+
const SvgPrev = ({ title, titleId, ...props }) => (
|
|
3
3
|
<svg
|
|
4
4
|
width="24"
|
|
5
5
|
height="24"
|
|
@@ -10,11 +10,10 @@ const SvgPrev = ({ title, titleId, fillColor, ...props }) => (
|
|
|
10
10
|
{...props}
|
|
11
11
|
>
|
|
12
12
|
{title ? <title id={titleId}>{title}</title> : null}
|
|
13
|
+
<circle cx={12} cy={12} r={12} transform="rotate(180 12 12)" fill="#fff" />
|
|
13
14
|
<path
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
d="M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0ZM8.6 11.443a.855.855 0 0 0-.198.548c-.013.19.038.38.146.539l4.137 5.133a.857.857 0 0 0 1.251.12.856.856 0 0 0 .129-1.206l-3.701-4.586 3.838-4.587a.856.856 0 0 0-.739-1.4.858.858 0 0 0-.58.305l-4.284 5.134Z"
|
|
17
|
-
fill={fillColor ? fillColor : '#fff'}
|
|
15
|
+
d="M8.402 11.99c0-.2.07-.393.197-.547l4.284-5.134a.858.858 0 0 1 1.319 1.095l-3.838 4.587 3.7 4.586a.856.856 0 0 1-.128 1.206.856.856 0 0 1-1.25-.12L8.547 12.53a.855.855 0 0 1-.146-.54Z"
|
|
16
|
+
fill="#3C393E"
|
|
18
17
|
/>
|
|
19
18
|
</svg>
|
|
20
19
|
);
|
|
@@ -136,14 +136,8 @@ export const Input = ({
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
if (type === 'number') {
|
|
139
|
-
const regNum = /^\d+(\.)?(\d+)
|
|
140
|
-
|
|
141
|
-
const newStr = currentValue.replace(/[^\d+]/g, '');
|
|
142
|
-
setInnerValue(newStr);
|
|
143
|
-
if (change) {
|
|
144
|
-
change(newStr);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
139
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
140
|
+
|
|
147
141
|
if (minNumSize && currentValue < minNumSize) {
|
|
148
142
|
setInnerValue(`${minNumSize}`);
|
|
149
143
|
if (change) {
|
|
@@ -156,7 +150,7 @@ export const Input = ({
|
|
|
156
150
|
change(`${maxNumSize}`);
|
|
157
151
|
}
|
|
158
152
|
}
|
|
159
|
-
if (floatToFix
|
|
153
|
+
if (floatToFix > 0) {
|
|
160
154
|
const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
|
|
161
155
|
const int = floatNumParts[0];
|
|
162
156
|
const float = floatNumParts[1];
|
|
@@ -195,7 +189,7 @@ export const Input = ({
|
|
|
195
189
|
}
|
|
196
190
|
}
|
|
197
191
|
}
|
|
198
|
-
} else
|
|
192
|
+
} else {
|
|
199
193
|
const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
|
|
200
194
|
const int = floatNumParts[0];
|
|
201
195
|
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
@@ -206,6 +200,15 @@ export const Input = ({
|
|
|
206
200
|
}
|
|
207
201
|
}
|
|
208
202
|
|
|
203
|
+
if (!regNum.test(currentValue)) {
|
|
204
|
+
const newStr = currentValue.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
205
|
+
return b + c.replace(/\./g, '');
|
|
206
|
+
});
|
|
207
|
+
setInnerValue(newStr);
|
|
208
|
+
if (change) {
|
|
209
|
+
change(newStr);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
209
212
|
if (currentValue === '') {
|
|
210
213
|
setInnerValue('');
|
|
211
214
|
if (change) {
|
|
@@ -276,14 +279,8 @@ export const Input = ({
|
|
|
276
279
|
}
|
|
277
280
|
|
|
278
281
|
if (type === 'number') {
|
|
279
|
-
const regNum = /^\d+(\.)?(\d+)
|
|
280
|
-
|
|
281
|
-
const newStr = value.replace(/[^\d+]/g, '');
|
|
282
|
-
setInnerValue(newStr);
|
|
283
|
-
if (change) {
|
|
284
|
-
change(newStr);
|
|
285
|
-
}
|
|
286
|
-
}
|
|
282
|
+
const regNum = floatToFix && floatToFix >= 0 ? /^\d+(\.)?(\d+)?$/ : /^\d+$/;
|
|
283
|
+
|
|
287
284
|
if (minNumSize && value < minNumSize) {
|
|
288
285
|
setInnerValue(`${minNumSize}`);
|
|
289
286
|
if (change) {
|
|
@@ -296,7 +293,7 @@ export const Input = ({
|
|
|
296
293
|
change(`${maxNumSize}`);
|
|
297
294
|
}
|
|
298
295
|
}
|
|
299
|
-
if (floatToFix
|
|
296
|
+
if (floatToFix > 0) {
|
|
300
297
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
301
298
|
const int = floatNumParts[0];
|
|
302
299
|
const float = floatNumParts[1];
|
|
@@ -335,7 +332,7 @@ export const Input = ({
|
|
|
335
332
|
}
|
|
336
333
|
}
|
|
337
334
|
}
|
|
338
|
-
} else
|
|
335
|
+
} else {
|
|
339
336
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
340
337
|
const int = floatNumParts[0];
|
|
341
338
|
if (floatNumParts && floatNumParts.length > 0 && floatToFix === 0) {
|
|
@@ -345,6 +342,15 @@ export const Input = ({
|
|
|
345
342
|
}
|
|
346
343
|
}
|
|
347
344
|
}
|
|
345
|
+
if (!regNum.test(value)) {
|
|
346
|
+
const newStr = value.replace(/[^0-9.]/g, '').replace(/^([^.]*\.)(.*)$/, function (_, b, c) {
|
|
347
|
+
return b + c.replace(/\./g, '');
|
|
348
|
+
});
|
|
349
|
+
setInnerValue(newStr);
|
|
350
|
+
if (change) {
|
|
351
|
+
change(newStr);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
348
354
|
if (value === '') {
|
|
349
355
|
setInnerValue('');
|
|
350
356
|
if (change) {
|
|
@@ -270,7 +270,7 @@ export const Select = ({
|
|
|
270
270
|
!disabled && multiple && newSelected.length > 1 && <span>{newSelected.length}</span>
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
{(showCloseIcon ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 &&
|
|
273
|
+
{(showCloseIcon === true || showCloseIcon === false ? showCloseIcon : configStyles.SELECT.showCloseIcon) && !disabled && newSelected && newSelected.length > 0 &&
|
|
274
274
|
<div
|
|
275
275
|
className={`${styles['close-icon']}`}
|
|
276
276
|
onClick={disabled ? _ => _ : handleClearSelect}
|
|
@@ -326,16 +326,15 @@ export const Select = ({
|
|
|
326
326
|
padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
|
|
327
327
|
fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
|
|
328
328
|
boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
|
|
329
|
-
minHeight:
|
|
329
|
+
minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
330
330
|
fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
|
|
331
331
|
lineHeight: dots || configStyles.SELECT.dots ? '46px' : optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
332
|
-
marginBottom:
|
|
332
|
+
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
333
333
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor,
|
|
334
334
|
}}
|
|
335
335
|
>
|
|
336
336
|
{multiple && multipleCheckbox ? <SingleCheckbox checked={option.checked} /> : ''}
|
|
337
337
|
{option[keyNames.name]}
|
|
338
|
-
|
|
339
338
|
</div>
|
|
340
339
|
})
|
|
341
340
|
}
|
|
@@ -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 = 999999999999;
|
|
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);
|
|
@@ -326,6 +326,7 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
326
326
|
```
|
|
327
327
|
{
|
|
328
328
|
dots: false, // for options, cut text and add dots
|
|
329
|
+
showCloseIcon: false, // for select reset icon, when prop exist or true is show, otherwise is hide
|
|
329
330
|
marginTop: '10px', // for error message postion from top
|
|
330
331
|
labelWeight: '500', // for label font weight
|
|
331
332
|
labelColor: '#3C393E', // for label color
|
package/tui.config.js
CHANGED
|
@@ -217,7 +217,7 @@ module.exports = {
|
|
|
217
217
|
optionItemCursor: 'pointer', // for option cursor
|
|
218
218
|
optionItemMinHeight: '46px', // for option min height
|
|
219
219
|
optionItemFontWeight: '500', // for option font weight
|
|
220
|
-
optionItemLineHeight: '
|
|
220
|
+
optionItemLineHeight: '25px', // for option line height
|
|
221
221
|
optionItemPadding: '0px 15px', // for option padding
|
|
222
222
|
optionItemMarginBottom: '2px', // for option margin bottom
|
|
223
223
|
optionItemColorHover: '#00236A', // for option color ( when hover )
|