@xaypay/tui 0.0.97 → 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 +136 -83
- package/dist/index.js +135 -83
- package/package.json +1 -1
- package/src/components/input/index.js +76 -11
- package/src/components/input/input.module.css +5 -0
- package/src/components/input/input.stories.js +1 -1
- package/src/components/modal/index.js +8 -0
- package/src/components/newAutocomplete/index.js +9 -3
- package/src/components/pagination/index.js +96 -88
- 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/index.js +0 -1
- package/src/stories/configuration.stories.mdx +1 -0
- package/tui.config.js +1 -0
- package/src/components/chart/chart.module.css +0 -0
- package/src/components/chart/chart.stories.js +0 -16
- package/src/components/chart/index.js +0 -42
package/dist/index.js
CHANGED
|
@@ -96,9 +96,9 @@ function styleInject(css, ref) {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
var css_248z$
|
|
99
|
+
var css_248z$f = ".file-module_file-form__l13d5{align-items:center;background:#fbfbfb;border:2px dashed;border-radius:6px;cursor:pointer;display:flex;flex-direction:column;height:190px;justify-content:space-between;overflow:hidden;padding:4px 0;position:relative;width:100%}.file-module_file-form-wrap__qY--B:before{background:rgba(60,57,62,.4);border-radius:6px;content:\"\";height:100%;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .24s;width:100%;z-index:1}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover:before{opacity:1;pointer-events:unset}.file-module_file-form-wrap__qY--B.file-module_active__L1gPt:hover .file-module_delete-upload-icon__PWN66{opacity:1}.file-module_file-form-inner-upload__tq3Dn{align-items:center;display:flex;flex-direction:column;justify-content:space-between;padding-bottom:16px;padding-top:48px}.file-module_file-form-inner-upload__tq3Dn>img{display:block;margin-bottom:14px}.file-module_upload-info__a8GFs{margin-bottom:40px;max-width:150px;text-align:center}.file-module_upload-info-txt__l11uN{color:#0da574}.file-module_file-form__l13d5.file-module_default__t7KU0{border-color:#d1d1d1}.file-module_file-form__l13d5.file-module_error__H-M4Z{border-color:#e00!important}.file-module_file-form__l13d5.file-module_accept__WTW6V{border-color:#00236a}.file-module_delete-upload-icon__PWN66{align-items:center;background:#fff;border-radius:6px;cursor:pointer;display:flex;height:26px;justify-content:center;opacity:0;position:absolute;right:10px;top:10px;transition:opacity .24s;width:26px;z-index:11}.file-module_delete-upload-icon__PWN66>i{color:#00236a;font-size:16px}.file-module_upload-file-content__QHMjn{align-items:center;display:flex;height:100%;justify-content:center;max-height:190px;overflow:hidden;position:relative;width:100%}.file-module_upload-file-content__QHMjn>img{display:block;height:auto;max-height:95%;object-fit:contain;width:27.8rem}.file-module_file-form-title__zWTSB{margin-bottom:10px;max-width:390px;word-break:break-all}.file-module_file-form-wrap__qY--B{position:relative;transform:translateZ(0)}";
|
|
100
100
|
var styles$c = {"file-form-wrap":"file-module_file-form-wrap__qY--B","file-form":"file-module_file-form__l13d5","active":"file-module_active__L1gPt","delete-upload-icon":"file-module_delete-upload-icon__PWN66","file-form-inner-upload":"file-module_file-form-inner-upload__tq3Dn","upload-info":"file-module_upload-info__a8GFs","upload-info-txt":"file-module_upload-info-txt__l11uN","default":"file-module_default__t7KU0","error":"file-module_error__H-M4Z","accept":"file-module_accept__WTW6V","upload-file-content":"file-module_upload-file-content__QHMjn","file-form-title":"file-module_file-form-title__zWTSB"};
|
|
101
|
-
styleInject(css_248z$
|
|
101
|
+
styleInject(css_248z$f);
|
|
102
102
|
|
|
103
103
|
const File = ({
|
|
104
104
|
name,
|
|
@@ -220,63 +220,6 @@ File.defaultProps = {
|
|
|
220
220
|
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf']
|
|
221
221
|
};
|
|
222
222
|
|
|
223
|
-
const _ = require('lodash');
|
|
224
|
-
const compereConfigs = () => {
|
|
225
|
-
let projectConfig = {};
|
|
226
|
-
let packageConfig = {};
|
|
227
|
-
try {
|
|
228
|
-
packageConfig = require('../tui.config.js');
|
|
229
|
-
} catch (e) {
|
|
230
|
-
try {
|
|
231
|
-
packageConfig = require('../../tui.config.js');
|
|
232
|
-
} catch (err) {
|
|
233
|
-
packageConfig = {};
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
try {
|
|
237
|
-
projectConfig = require('../../../../tui.config.js');
|
|
238
|
-
} catch (error) {
|
|
239
|
-
projectConfig = {};
|
|
240
|
-
// console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
return _.merge(packageConfig, projectConfig);
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
var css_248z$f = "";
|
|
247
|
-
styleInject(css_248z$f);
|
|
248
|
-
|
|
249
|
-
const Chart = ({
|
|
250
|
-
width,
|
|
251
|
-
height
|
|
252
|
-
}) => {
|
|
253
|
-
compereConfigs();
|
|
254
|
-
React.useEffect(() => {
|
|
255
|
-
const canvas = document.getElementById('myChart');
|
|
256
|
-
// const canvas = canvasRef.current;
|
|
257
|
-
const ctx = canvas.getContext('2d');
|
|
258
|
-
const data = [10, 20, 30, 15, 25];
|
|
259
|
-
const barWidth = 40;
|
|
260
|
-
const chartHeight = 200;
|
|
261
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
262
|
-
data.forEach((value, index) => {
|
|
263
|
-
const x = index * (barWidth + 10);
|
|
264
|
-
const y = chartHeight - value;
|
|
265
|
-
ctx.fillStyle = 'blue';
|
|
266
|
-
ctx.fillRect(x, y, barWidth, value);
|
|
267
|
-
});
|
|
268
|
-
}, []);
|
|
269
|
-
return /*#__PURE__*/React__default["default"].createElement("canvas", {
|
|
270
|
-
id: "myChart",
|
|
271
|
-
width: width,
|
|
272
|
-
height: height
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
Chart.propTypes = {
|
|
276
|
-
width: PropTypes__default["default"].number,
|
|
277
|
-
height: PropTypes__default["default"].number
|
|
278
|
-
};
|
|
279
|
-
|
|
280
223
|
const SvgCheckboxUnchecked = ({
|
|
281
224
|
title,
|
|
282
225
|
titleId,
|
|
@@ -358,6 +301,29 @@ SingleCheckbox.propTypes = {
|
|
|
358
301
|
var css_248z$e = ".table-module_sorting-arrows__BaN-G:after{content:\"▲\";font-size:11px;position:absolute;right:0;top:calc(50% - 12px)}.table-module_sorting-arrows__BaN-G:before{bottom:calc(50% - 12px);content:\"▼\";font-size:11px;position:absolute;right:0}.table-module_td-span__XHo6k{cursor:pointer;display:inline-block;position:relative}.table-module_td-span__XHo6k>svg{left:0;position:absolute;top:0;z-index:-1}";
|
|
359
302
|
styleInject(css_248z$e);
|
|
360
303
|
|
|
304
|
+
const _ = require('lodash');
|
|
305
|
+
const compereConfigs = () => {
|
|
306
|
+
let projectConfig = {};
|
|
307
|
+
let packageConfig = {};
|
|
308
|
+
try {
|
|
309
|
+
packageConfig = require('../tui.config.js');
|
|
310
|
+
} catch (e) {
|
|
311
|
+
try {
|
|
312
|
+
packageConfig = require('../../tui.config.js');
|
|
313
|
+
} catch (err) {
|
|
314
|
+
packageConfig = {};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
projectConfig = require('../../../../tui.config.js');
|
|
319
|
+
} catch (error) {
|
|
320
|
+
projectConfig = {};
|
|
321
|
+
// console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
return _.merge(packageConfig, projectConfig);
|
|
325
|
+
};
|
|
326
|
+
|
|
361
327
|
({
|
|
362
328
|
dataBody: PropTypes__default["default"].array,
|
|
363
329
|
dataHeader: PropTypes__default["default"].array,
|
|
@@ -520,6 +486,11 @@ const Modal = ({
|
|
|
520
486
|
}
|
|
521
487
|
}
|
|
522
488
|
};
|
|
489
|
+
const handleESC = e => {
|
|
490
|
+
if (e.key === 'Escape') {
|
|
491
|
+
handleCloseModal();
|
|
492
|
+
}
|
|
493
|
+
};
|
|
523
494
|
React.useEffect(() => {
|
|
524
495
|
if (type === 'images') {
|
|
525
496
|
if (data) {
|
|
@@ -545,9 +516,11 @@ const Modal = ({
|
|
|
545
516
|
}
|
|
546
517
|
}, [selected]);
|
|
547
518
|
React.useEffect(() => {
|
|
519
|
+
document.addEventListener('keydown', handleESC, false);
|
|
548
520
|
return () => {
|
|
549
521
|
setSelect(0);
|
|
550
522
|
setInnerData([]);
|
|
523
|
+
document.removeEventListener('keydown', handleESC, false);
|
|
551
524
|
};
|
|
552
525
|
}, []);
|
|
553
526
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -732,7 +705,7 @@ Modal.defaultProps = {
|
|
|
732
705
|
type: 'content'
|
|
733
706
|
};
|
|
734
707
|
|
|
735
|
-
var css_248z$c = ".input-module_input-wrap__NunrE{position:relative;width:100%}.input-module_input-content__kP7lZ{-webkit-appearance:none;display:flex;width:100%}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background-color:inherit!important}.input-module_error-message-show__OrVSo{animation-fill-mode:forwards;animation-name:input-module_error-show__9MP6k}.input-module_inp-num__vH7HL::-webkit-inner-spin-button,.input-module_inp-num__vH7HL::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-module_inp-num__vH7HL[type=number]{-moz-appearance:textfield}@keyframes input-module_error-show__9MP6k{to{bottom:-20px;transform:scaleX(1);-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);-o-transform:scaleX(1)}}";
|
|
708
|
+
var css_248z$c = ".input-module_input-wrap__NunrE{position:relative;width:100%}.input-module_input-content__kP7lZ{-webkit-appearance:none;display:flex;width:100%}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background-color:inherit!important}input::-ms-clear,input::-ms-reveal{display:none}.input-module_error-message-show__OrVSo{animation-fill-mode:forwards;animation-name:input-module_error-show__9MP6k}.input-module_inp-num__vH7HL::-webkit-inner-spin-button,.input-module_inp-num__vH7HL::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input-module_inp-num__vH7HL[type=number]{-moz-appearance:textfield}@keyframes input-module_error-show__9MP6k{to{bottom:-20px;transform:scaleX(1);-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);-o-transform:scaleX(1)}}";
|
|
736
709
|
var styles$a = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","error-message-show":"input-module_error-message-show__OrVSo","error-show":"input-module_error-show__9MP6k","inp-num":"input-module_inp-num__vH7HL"};
|
|
737
710
|
styleInject(css_248z$c);
|
|
738
711
|
|
|
@@ -873,14 +846,42 @@ const Input = ({
|
|
|
873
846
|
change(`${maxNumSize}`);
|
|
874
847
|
}
|
|
875
848
|
}
|
|
876
|
-
if (floatToFix && floatToFix > 0
|
|
849
|
+
if (floatToFix && floatToFix > 0) {
|
|
877
850
|
const floatNumParts = typeof currentValue === 'string' ? currentValue.split('.') : currentValue;
|
|
878
851
|
const int = floatNumParts[0];
|
|
879
852
|
const float = floatNumParts[1];
|
|
880
|
-
if (float
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
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
|
+
}
|
|
884
885
|
}
|
|
885
886
|
}
|
|
886
887
|
} else if (floatToFix === 0) {
|
|
@@ -969,14 +970,51 @@ const Input = ({
|
|
|
969
970
|
change(`${maxNumSize}`);
|
|
970
971
|
}
|
|
971
972
|
}
|
|
972
|
-
if (floatToFix && floatToFix > 0
|
|
973
|
+
if (floatToFix && floatToFix > 0) {
|
|
973
974
|
const floatNumParts = typeof value === 'string' ? value.split('.') : value;
|
|
974
975
|
const int = floatNumParts[0];
|
|
975
976
|
const float = floatNumParts[1];
|
|
976
|
-
if (float
|
|
977
|
-
|
|
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}`);
|
|
978
1016
|
if (change) {
|
|
979
|
-
change(`${int}
|
|
1017
|
+
change(`${int}`);
|
|
980
1018
|
}
|
|
981
1019
|
}
|
|
982
1020
|
}
|
|
@@ -1353,11 +1391,12 @@ const SvgArrow = ({
|
|
|
1353
1391
|
fill: fillColor ? fillColor : '#3C393E'
|
|
1354
1392
|
}));
|
|
1355
1393
|
|
|
1356
|
-
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}}";
|
|
1357
|
-
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"};
|
|
1358
1396
|
styleInject(css_248z$a);
|
|
1359
1397
|
|
|
1360
1398
|
const Select = ({
|
|
1399
|
+
dots,
|
|
1361
1400
|
options,
|
|
1362
1401
|
multiple,
|
|
1363
1402
|
disabled,
|
|
@@ -1608,17 +1647,18 @@ const Select = ({
|
|
|
1608
1647
|
onClick: disabled ? _ => _ : _ => handleSelectItem(option),
|
|
1609
1648
|
onMouseEnter: disabled ? _ => _ : e => handleMouseEnterOption(e),
|
|
1610
1649
|
onMouseLeave: disabled ? _ => _ : e => handleMouseLeaveOption(e),
|
|
1611
|
-
className: `${styles$8['select-content-bottom-row']}`,
|
|
1650
|
+
className: `${styles$8['select-content-bottom-row']} ${dots || configStyles.SELECT.dots ? styles$8['ellipsis'] : ''}`,
|
|
1612
1651
|
style: {
|
|
1652
|
+
overflowWrap: !dots && !configStyles.SELECT.dots ? 'anywhere' : 'break-word',
|
|
1613
1653
|
color: optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor,
|
|
1614
1654
|
cursor: optionItemCursor ? optionItemCursor : configStyles.SELECT.optionItemCursor,
|
|
1615
1655
|
padding: optionItemPadding ? optionItemPadding : configStyles.SELECT.optionItemPadding,
|
|
1616
1656
|
fontSize: optionItemFontSize ? optionItemFontSize : configStyles.SELECT.optionItemFontSize,
|
|
1617
1657
|
boxSizing: optionItemBoxSizing ? optionItemBoxSizing : configStyles.SELECT.optionItemBoxSizing,
|
|
1618
|
-
minHeight: optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1658
|
+
minHeight: !dots && !configStyles.SELECT.dots ? 'auto' : optionItemMinHeight ? optionItemMinHeight : configStyles.SELECT.optionItemMinHeight,
|
|
1619
1659
|
fontWeight: optionItemFontWeight ? optionItemFontWeight : configStyles.SELECT.optionItemFontWeight,
|
|
1620
|
-
lineHeight: optionItemLineHeight ? optionItemLineHeight : configStyles.SELECT.optionItemLineHeight,
|
|
1621
|
-
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,
|
|
1622
1662
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
|
|
1623
1663
|
}
|
|
1624
1664
|
}, multiple && multipleCheckbox ? /*#__PURE__*/React__default["default"].createElement(SingleCheckbox, {
|
|
@@ -1635,6 +1675,7 @@ const Select = ({
|
|
|
1635
1675
|
}, errorMessage) : '');
|
|
1636
1676
|
};
|
|
1637
1677
|
Select.propTypes = {
|
|
1678
|
+
dots: PropTypes__default["default"].bool,
|
|
1638
1679
|
options: PropTypes__default["default"].array,
|
|
1639
1680
|
multiple: PropTypes__default["default"].bool,
|
|
1640
1681
|
onChange: PropTypes__default["default"].func,
|
|
@@ -1955,7 +1996,7 @@ const createToast = ({
|
|
|
1955
1996
|
toastParentBlock = document.createElement('div');
|
|
1956
1997
|
toastParentBlock.style.position = 'fixed';
|
|
1957
1998
|
toastParentBlock.style.display = 'flex';
|
|
1958
|
-
toastParentBlock.style.zIndex =
|
|
1999
|
+
toastParentBlock.style.zIndex = 9999999999999999999999999;
|
|
1959
2000
|
toastParentBlock.style.flexDirection = position === 'top-left' || position === 'top-right' || position === 'top-center' ? 'column-reverse' : 'column';
|
|
1960
2001
|
toastParentBlock.setAttribute('id', styles$7[position]);
|
|
1961
2002
|
toastParentBlock.appendChild(toastBlock);
|
|
@@ -3708,14 +3749,21 @@ const Pagination = ({
|
|
|
3708
3749
|
}
|
|
3709
3750
|
};
|
|
3710
3751
|
let lastPage = paginationRange[paginationRange.length - 1];
|
|
3711
|
-
return /*#__PURE__*/React__default["default"].createElement("
|
|
3752
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3753
|
+
style: {
|
|
3754
|
+
display: 'flex',
|
|
3755
|
+
margin: '0 auto',
|
|
3756
|
+
alignItems: 'center',
|
|
3757
|
+
justifyContent: 'center'
|
|
3758
|
+
}
|
|
3759
|
+
}, /*#__PURE__*/React__default["default"].createElement("ul", {
|
|
3712
3760
|
className: classProps
|
|
3713
3761
|
}, /*#__PURE__*/React__default["default"].createElement("button", {
|
|
3714
3762
|
style: {
|
|
3715
3763
|
transform: 'rotate(180deg)'
|
|
3716
3764
|
},
|
|
3717
3765
|
onClick: onPrevious,
|
|
3718
|
-
disabled:
|
|
3766
|
+
disabled: currentPageNumber === 1 ? true : false,
|
|
3719
3767
|
className: `${styles$2["pagination-btn"]} pagination-btn-rem`
|
|
3720
3768
|
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null)), paginationRange.map((pageNumber, id) => {
|
|
3721
3769
|
if (pageNumber === Dots) {
|
|
@@ -3747,7 +3795,7 @@ const Pagination = ({
|
|
|
3747
3795
|
onClick: onNext,
|
|
3748
3796
|
disabled: currentPageNumber === lastPage ? true : false,
|
|
3749
3797
|
className: `${styles$2["pagination-btn"]} pagination-btn-rem`
|
|
3750
|
-
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null)), goTo && /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
3798
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgNextarrow, null))), goTo && /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
3751
3799
|
onKeyDown: handleKeyDown,
|
|
3752
3800
|
onInput: handleChangeInput,
|
|
3753
3801
|
type: "number",
|
|
@@ -4005,6 +4053,7 @@ const NewAutocomplete = ({
|
|
|
4005
4053
|
const [show, setShow] = React.useState(false);
|
|
4006
4054
|
const [isHover, setIsHover] = React.useState(false);
|
|
4007
4055
|
const [isFocus, setIsFocus] = React.useState(false);
|
|
4056
|
+
const [innerError, setInnerError] = React.useState('');
|
|
4008
4057
|
const [innerValue, setInnerValue] = React.useState('');
|
|
4009
4058
|
const [innerOptions, setInnerOptions] = React.useState([]);
|
|
4010
4059
|
const configStyles = compereConfigs();
|
|
@@ -4040,6 +4089,7 @@ const NewAutocomplete = ({
|
|
|
4040
4089
|
const value = e.target.value;
|
|
4041
4090
|
const currentId = e.target.id;
|
|
4042
4091
|
value.length > 0 ? setShow(true) : setShow(false);
|
|
4092
|
+
setInnerError('');
|
|
4043
4093
|
setInnerValue(value);
|
|
4044
4094
|
if (value.length >= searchCount) {
|
|
4045
4095
|
change({
|
|
@@ -4105,7 +4155,7 @@ const NewAutocomplete = ({
|
|
|
4105
4155
|
backgroundColor: contentBottomRowBackgroundColor ? contentBottomRowBackgroundColor : configStyles.NEWAUTOCOMPLETE.contentBottomRowBackgroundColor
|
|
4106
4156
|
}
|
|
4107
4157
|
}, item[keyNames.name]);
|
|
4108
|
-
}))) : innerOptions.length <= 0 ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4158
|
+
}))) : innerOptions.length <= 0 ? innerError ? '' : /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4109
4159
|
style: {
|
|
4110
4160
|
position: 'absolute',
|
|
4111
4161
|
zIndex: '9999999999',
|
|
@@ -4146,6 +4196,9 @@ const NewAutocomplete = ({
|
|
|
4146
4196
|
setInnerValue('');
|
|
4147
4197
|
}
|
|
4148
4198
|
}, [selected]);
|
|
4199
|
+
React.useEffect(() => {
|
|
4200
|
+
setInnerError(errorMessage);
|
|
4201
|
+
}, [errorMessage]);
|
|
4149
4202
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
4150
4203
|
style: {
|
|
4151
4204
|
color: labelColor ? labelColor : configStyles.NEWAUTOCOMPLETE.labelColor,
|
|
@@ -4199,7 +4252,7 @@ const NewAutocomplete = ({
|
|
|
4199
4252
|
flexDirection: contentTopDirection ? contentTopDirection : configStyles.NEWAUTOCOMPLETE.contentTopDirection,
|
|
4200
4253
|
boxShadow: errorMessage ? errorColor ? `0 0 0 2px ${errorColor}` : `0 0 0 2px ${configStyles.NEWAUTOCOMPLETE.errorColor}` : isFocus ? contentTopBorderActive ? contentTopBorderActive : configStyles.NEWAUTOCOMPLETE.contentTopBorderActive : isHover ? contentTopBorderHover ? contentTopBorderHover : configStyles.NEWAUTOCOMPLETE.contentTopBorderHover : contentTopBorder ? contentTopBorder : configStyles.NEWAUTOCOMPLETE.contentTopBorder
|
|
4201
4254
|
}
|
|
4202
|
-
}, props)),
|
|
4255
|
+
}, props)), innerError ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4203
4256
|
style: {
|
|
4204
4257
|
left: '0px',
|
|
4205
4258
|
position: 'absolute',
|
|
@@ -4208,7 +4261,7 @@ const NewAutocomplete = ({
|
|
|
4208
4261
|
top: marginTop ? `calc(100% + ${marginTop})` : `calc(100% + ${configStyles.INPUT.marginTop})`,
|
|
4209
4262
|
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth
|
|
4210
4263
|
}
|
|
4211
|
-
},
|
|
4264
|
+
}, innerError) : '', optionList));
|
|
4212
4265
|
};
|
|
4213
4266
|
NewAutocomplete.propTypes = {
|
|
4214
4267
|
label: PropTypes__default["default"].string,
|
|
@@ -4293,7 +4346,6 @@ NewAutocomplete.defaultProps = {
|
|
|
4293
4346
|
exports.Autocomplate = Autocomplate;
|
|
4294
4347
|
exports.Button = Button;
|
|
4295
4348
|
exports.Captcha = Captcha;
|
|
4296
|
-
exports.Chart = Chart;
|
|
4297
4349
|
exports.Checkbox = Checkbox;
|
|
4298
4350
|
exports.File = File;
|
|
4299
4351
|
exports.Input = Input;
|
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('');
|
|
@@ -71,6 +71,12 @@ export const Modal = ({
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
+
const handleESC = (e) => {
|
|
75
|
+
if (e.key === 'Escape') {
|
|
76
|
+
handleCloseModal();
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
74
80
|
useEffect(() => {
|
|
75
81
|
if (type === 'images') {
|
|
76
82
|
if (data) {
|
|
@@ -98,9 +104,11 @@ export const Modal = ({
|
|
|
98
104
|
}, [selected]);
|
|
99
105
|
|
|
100
106
|
useEffect(() => {
|
|
107
|
+
document.addEventListener('keydown', handleESC, false);
|
|
101
108
|
return () => {
|
|
102
109
|
setSelect(0);
|
|
103
110
|
setInnerData([]);
|
|
111
|
+
document.removeEventListener('keydown', handleESC, false);
|
|
104
112
|
}
|
|
105
113
|
}, []);
|
|
106
114
|
|
|
@@ -87,6 +87,7 @@ export const NewAutocomplete = ({
|
|
|
87
87
|
const [show, setShow] = useState(false);
|
|
88
88
|
const [isHover, setIsHover] = useState(false);
|
|
89
89
|
const [isFocus, setIsFocus] = useState(false);
|
|
90
|
+
const [innerError, setInnerError] = useState('');
|
|
90
91
|
const [innerValue, setInnerValue] = useState('');
|
|
91
92
|
const [innerOptions, setInnerOptions] = useState([]);
|
|
92
93
|
const configStyles = compereConfigs();
|
|
@@ -131,6 +132,7 @@ export const NewAutocomplete = ({
|
|
|
131
132
|
const value = e.target.value;
|
|
132
133
|
const currentId = e.target.id;
|
|
133
134
|
value.length > 0 ? setShow(true) : setShow(false);
|
|
135
|
+
setInnerError('');
|
|
134
136
|
setInnerValue(value);
|
|
135
137
|
if (value.length >= searchCount) {
|
|
136
138
|
change({ name: value, id: currentId });
|
|
@@ -218,7 +220,7 @@ export const NewAutocomplete = ({
|
|
|
218
220
|
</div>
|
|
219
221
|
: innerOptions.length <= 0
|
|
220
222
|
?
|
|
221
|
-
|
|
223
|
+
innerError ? '' : <span
|
|
222
224
|
style={{
|
|
223
225
|
position: 'absolute',
|
|
224
226
|
zIndex: '9999999999',
|
|
@@ -276,6 +278,10 @@ export const NewAutocomplete = ({
|
|
|
276
278
|
setInnerValue('');
|
|
277
279
|
}
|
|
278
280
|
}, [selected]);
|
|
281
|
+
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
setInnerError(errorMessage);
|
|
284
|
+
}, [errorMessage]);
|
|
279
285
|
|
|
280
286
|
return (
|
|
281
287
|
<>
|
|
@@ -351,7 +357,7 @@ export const NewAutocomplete = ({
|
|
|
351
357
|
/>
|
|
352
358
|
|
|
353
359
|
{
|
|
354
|
-
|
|
360
|
+
innerError
|
|
355
361
|
? <span
|
|
356
362
|
style={{
|
|
357
363
|
left: '0px',
|
|
@@ -362,7 +368,7 @@ export const NewAutocomplete = ({
|
|
|
362
368
|
maxWidth: contentTopMaxWidth ? contentTopMaxWidth : configStyles.NEWAUTOCOMPLETE.contentTopMaxWidth,
|
|
363
369
|
}}
|
|
364
370
|
>
|
|
365
|
-
{
|
|
371
|
+
{innerError}
|
|
366
372
|
</span>
|
|
367
373
|
: ''
|
|
368
374
|
}
|