@xaypay/tui 0.1.10 → 0.2.0
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/.prettierignore +1 -0
- package/dist/index.es.js +89 -189
- package/dist/index.js +90 -189
- package/package.json +47 -45
- package/rollup.config.mjs +36 -0
- package/tui.config.js +106 -114
- package/vite.config.mjs +82 -0
package/.prettierignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src/utils/index.js
|
package/dist/index.es.js
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import React__default, { useState, useEffect, forwardRef, useRef, useMemo, useImperativeHandle, createRef } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
+
import _ from 'lodash';
|
|
5
6
|
import styled, { keyframes, css } from 'styled-components';
|
|
6
7
|
import ReactDOM from 'react-dom';
|
|
7
8
|
|
|
@@ -436,37 +437,39 @@ const FileItem = /*#__PURE__*/React__default.memo(({
|
|
|
436
437
|
}, iconDelItem ? iconDelItem : /*#__PURE__*/React__default.createElement(SvgListItemDelete, null))));
|
|
437
438
|
});
|
|
438
439
|
|
|
439
|
-
|
|
440
|
+
async function getPProps(type) {
|
|
441
|
+
let packageResult;
|
|
442
|
+
let projectResult;
|
|
443
|
+
const packageImportConfig = await import.meta.glob('../../tui.config.js');
|
|
444
|
+
const projectImportConfig = await import.meta.glob('../../../../tui.config.js');
|
|
445
|
+
if (packageImportConfig['../../tui.config.js']) {
|
|
446
|
+
packageResult = packageImportConfig['../../tui.config.js']().then(module => module.default);
|
|
447
|
+
}
|
|
448
|
+
if (projectImportConfig['../../../../tui.config.js']) {
|
|
449
|
+
projectResult = projectImportConfig['../../../../tui.config.js']().then(module => module.default);
|
|
450
|
+
}
|
|
451
|
+
return type === true ? packageResult : projectResult;
|
|
452
|
+
}
|
|
453
|
+
|
|
440
454
|
let projectConfig = {};
|
|
441
455
|
let packageConfig = {};
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
} catch (e) {
|
|
456
|
+
async function getProps(type) {
|
|
457
|
+
let props;
|
|
445
458
|
try {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
459
|
+
const newProps = await getPProps(type);
|
|
460
|
+
props = _.merge(type === true ? packageConfig : projectConfig, newProps);
|
|
461
|
+
} catch (error) {
|
|
462
|
+
console.error('Error in getProps:', error);
|
|
449
463
|
}
|
|
464
|
+
return props;
|
|
450
465
|
}
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
projectConfig = {};
|
|
455
|
-
// console.log(error, 'Project: if you want to use custom styles, create tui.config.js file in your project root');
|
|
456
|
-
}
|
|
457
|
-
const merge = _.merge(packageConfig.default, projectConfig.default);
|
|
466
|
+
packageConfig = getProps(true);
|
|
467
|
+
packageConfig = getProps();
|
|
468
|
+
const merge = _.merge(packageConfig, projectConfig);
|
|
458
469
|
const hasOwnerProperty = (object, property) => {
|
|
459
470
|
return Object.prototype.hasOwnProperty.call(object, property);
|
|
460
471
|
};
|
|
461
472
|
|
|
462
|
-
const vertical = {
|
|
463
|
-
top: 'top',
|
|
464
|
-
bottom: 'bottom'
|
|
465
|
-
};
|
|
466
|
-
const horizontal = {
|
|
467
|
-
left: 'left',
|
|
468
|
-
right: 'right'
|
|
469
|
-
};
|
|
470
473
|
const Button = ({
|
|
471
474
|
icon,
|
|
472
475
|
size,
|
|
@@ -498,20 +501,6 @@ const Button = ({
|
|
|
498
501
|
btnIconMarginRight,
|
|
499
502
|
backgroundHoverColor,
|
|
500
503
|
disabledBackgroundColor,
|
|
501
|
-
title,
|
|
502
|
-
titleSize,
|
|
503
|
-
titleFont,
|
|
504
|
-
titleWidth,
|
|
505
|
-
titleStyle,
|
|
506
|
-
titleColor,
|
|
507
|
-
titleRadius,
|
|
508
|
-
titleWeight,
|
|
509
|
-
titlePadding,
|
|
510
|
-
titleBackgroundColor,
|
|
511
|
-
titleVerticalDistance,
|
|
512
|
-
titleVerticalPosition,
|
|
513
|
-
titleHorizontalDistance,
|
|
514
|
-
titleHorizontalPosition,
|
|
515
504
|
...props
|
|
516
505
|
}) => {
|
|
517
506
|
const [isHover, setIsHover] = useState(false);
|
|
@@ -522,75 +511,45 @@ const Button = ({
|
|
|
522
511
|
const handleMouseLeave = () => {
|
|
523
512
|
setIsHover(false);
|
|
524
513
|
};
|
|
525
|
-
const buttonTemplate = () => {
|
|
526
|
-
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
527
|
-
style: {
|
|
528
|
-
display: 'flex',
|
|
529
|
-
outline: 'none',
|
|
530
|
-
alignItems: 'center',
|
|
531
|
-
justifyContent: 'center',
|
|
532
|
-
fontSize: size ?? merge.BUTTON.font.size,
|
|
533
|
-
fontStyle: style ?? merge.BUTTON.font.style,
|
|
534
|
-
fontFamily: font ?? merge.BUTTON.font.family,
|
|
535
|
-
height: height ?? merge.BUTTON.height,
|
|
536
|
-
fontWeight: weight ?? merge.BUTTON.font.weight,
|
|
537
|
-
padding: padding ?? merge.BUTTON.padding,
|
|
538
|
-
borderRadius: radius ?? merge.BUTTON.radius,
|
|
539
|
-
boxSizing: boxSizing ?? merge.BUTTON.box.sizing,
|
|
540
|
-
transition: transition ?? merge.BUTTON.transition,
|
|
541
|
-
border: outline ? 'none' : border ?? merge.BUTTON.border,
|
|
542
|
-
width: contentWidth ? title ? '100%' : 'auto' : width ?? merge.BUTTON.width,
|
|
543
|
-
cursor: disabled ? 'not-allowed' : cursor ?? merge.BUTTON.cursor,
|
|
544
|
-
textTransform: textTransform ?? merge.BUTTON.text.transform,
|
|
545
|
-
backgroundColor: (outline || !outline) && disabled ? disabledBackgroundColor ? disabledBackgroundColor : merge.BUTTON.colors.disabledBackground : outline && !disabled ? isHover ? backgroundColor ? backgroundColor : merge.BUTTON.colors.background : '#ffffff' : !outline && !disabled && isHover ? backgroundHoverColor ? backgroundHoverColor : merge.BUTTON.colors.backgroundHover : backgroundColor ? backgroundColor : merge.BUTTON.colors.background,
|
|
546
|
-
boxShadow: outline ? disabled ? `inset 0 0 0 2px ${disabledLineColor ? disabledLineColor : merge.BUTTON.colors.disabledLine}` : `inset 0 0 0 2px ${backgroundColor ? backgroundColor : merge.BUTTON.colors.background}` : 'none',
|
|
547
|
-
color: (outline || !outline) && disabled ? disabledColor ? disabledColor : merge.BUTTON.colors.disabled : outline && !disabled ? isHover ? color ? color : merge.BUTTON.color : backgroundColor ? backgroundColor : merge.BUTTON.colors.background : !outline && !disabled && isHover ? hoverColor ? hoverColor : merge.BUTTON.text.colors.hover : color ? color : merge.BUTTON.color
|
|
548
|
-
},
|
|
549
|
-
type: type ?? merge.BUTTON.type,
|
|
550
|
-
disabled: disabled ?? merge.BUTTON.disabled,
|
|
551
|
-
onClick: disabled ? _ => _ : type !== 'submit' ? onClick ? onClick : () => alert('Add click event handler on Button component') : _ => _,
|
|
552
|
-
onMouseEnter: handleMouseEnter,
|
|
553
|
-
onMouseLeave: handleMouseLeave,
|
|
554
|
-
className: classProps
|
|
555
|
-
}, props), isHover && hoverIcon ? hoverIcon : icon ?? null, ' ', label && /*#__PURE__*/React__default.createElement("span", {
|
|
556
|
-
style: {
|
|
557
|
-
marginLeft: icon ? btnIconMarginRight ? btnIconMarginRight : merge.BUTTON.icon.marginRight : '0px'
|
|
558
|
-
}
|
|
559
|
-
}, label), ' ', !icon && !label && 'Add icon or label prop on Button component');
|
|
560
|
-
};
|
|
561
514
|
useEffect(() => {
|
|
562
515
|
if (!label && !icon) {
|
|
563
516
|
alert('Add icon or label props on Button component');
|
|
564
517
|
}
|
|
565
518
|
}, []);
|
|
566
|
-
return
|
|
519
|
+
return /*#__PURE__*/React__default.createElement("button", _extends({
|
|
567
520
|
style: {
|
|
568
|
-
|
|
521
|
+
display: 'flex',
|
|
522
|
+
outline: 'none',
|
|
523
|
+
alignItems: 'center',
|
|
524
|
+
justifyContent: 'center',
|
|
525
|
+
fontSize: size ?? merge.BUTTON.font.size,
|
|
526
|
+
fontStyle: style ?? merge.BUTTON.font.style,
|
|
527
|
+
fontFamily: font ?? merge.BUTTON.font.family,
|
|
569
528
|
height: height ?? merge.BUTTON.height,
|
|
570
|
-
|
|
529
|
+
fontWeight: weight ?? merge.BUTTON.font.weight,
|
|
530
|
+
padding: padding ?? merge.BUTTON.padding,
|
|
531
|
+
borderRadius: radius ?? merge.BUTTON.radius,
|
|
532
|
+
boxSizing: boxSizing ?? merge.BUTTON.box.sizing,
|
|
533
|
+
transition: transition ?? merge.BUTTON.transition,
|
|
534
|
+
border: outline ? 'none' : border ?? merge.BUTTON.border,
|
|
535
|
+
width: contentWidth ? 'auto' : width ?? merge.BUTTON.width,
|
|
536
|
+
cursor: disabled ? 'not-allowed' : cursor ?? merge.BUTTON.cursor,
|
|
537
|
+
textTransform: textTransform ?? merge.BUTTON.text.transform,
|
|
538
|
+
backgroundColor: (outline || !outline) && disabled ? disabledBackgroundColor ? disabledBackgroundColor : merge.BUTTON.colors.disabledBackground : outline && !disabled ? isHover ? backgroundColor ? backgroundColor : merge.BUTTON.colors.background : '#ffffff' : !outline && !disabled && isHover ? backgroundHoverColor ? backgroundHoverColor : merge.BUTTON.colors.backgroundHover : backgroundColor ? backgroundColor : merge.BUTTON.colors.background,
|
|
539
|
+
boxShadow: outline ? disabled ? `inset 0 0 0 2px ${disabledLineColor ? disabledLineColor : merge.BUTTON.colors.disabledLine}` : `inset 0 0 0 2px ${backgroundColor ? backgroundColor : merge.BUTTON.colors.background}` : 'none',
|
|
540
|
+
color: (outline || !outline) && disabled ? disabledColor ? disabledColor : merge.BUTTON.colors.disabled : outline && !disabled ? isHover ? color ? color : merge.BUTTON.color : backgroundColor ? backgroundColor : merge.BUTTON.colors.background : !outline && !disabled && isHover ? hoverColor ? hoverColor : merge.BUTTON.text.colors.hover : color ? color : merge.BUTTON.color
|
|
571
541
|
},
|
|
542
|
+
type: type ?? merge.BUTTON.type,
|
|
543
|
+
disabled: disabled ?? merge.BUTTON.disabled,
|
|
544
|
+
onClick: disabled ? _ => _ : type !== 'submit' ? onClick ? onClick : () => alert('Add click event handler on Button component') : _ => _,
|
|
545
|
+
onMouseEnter: handleMouseEnter,
|
|
546
|
+
onMouseLeave: handleMouseLeave,
|
|
572
547
|
className: classProps
|
|
573
|
-
},
|
|
548
|
+
}, props), isHover && hoverIcon ? hoverIcon : icon ?? null, ' ', label && /*#__PURE__*/React__default.createElement("span", {
|
|
574
549
|
style: {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
left: titleHorizontalPosition === 'right' ? `calc(100% + ${titleHorizontalDistance})` : '',
|
|
579
|
-
right: titleHorizontalPosition === 'left' ? `calc(100% + ${titleHorizontalDistance})` : '',
|
|
580
|
-
bottom: titleVerticalPosition === 'top' ? `calc(100% + ${titleVerticalDistance})` : '',
|
|
581
|
-
color: titleColor ?? merge.BUTTON.title.color,
|
|
582
|
-
fontSize: titleSize ?? merge.BUTTON.title.font.size,
|
|
583
|
-
fontStyle: titleStyle ?? merge.BUTTON.title.font.style,
|
|
584
|
-
fontFamily: titleFont ?? merge.BUTTON.title.font.family,
|
|
585
|
-
fontWeight: titleWeight ?? merge.BUTTON.title.font.weight,
|
|
586
|
-
width: titleWidth ?? merge.BUTTON.title.width,
|
|
587
|
-
padding: titlePadding ?? merge.BUTTON.title.padding,
|
|
588
|
-
backgroundColor: titleBackgroundColor ?? merge.BUTTON.title.colors.background,
|
|
589
|
-
borderRadius: titleRadius ?? merge.BUTTON.title.radius
|
|
590
|
-
},
|
|
591
|
-
onMouseEnter: handleMouseEnter,
|
|
592
|
-
onMouseLeave: handleMouseLeave
|
|
593
|
-
}, title) : '') : buttonTemplate();
|
|
550
|
+
marginLeft: icon ? btnIconMarginRight ? btnIconMarginRight : merge.BUTTON.icon.marginRight : '0px'
|
|
551
|
+
}
|
|
552
|
+
}, label), ' ', !icon && !label && 'Add icon or label prop on Button component');
|
|
594
553
|
};
|
|
595
554
|
Button.propTypes = {
|
|
596
555
|
type: PropTypes.string,
|
|
@@ -599,6 +558,7 @@ Button.propTypes = {
|
|
|
599
558
|
weight: PropTypes.string,
|
|
600
559
|
font: PropTypes.string,
|
|
601
560
|
icon: PropTypes.element,
|
|
561
|
+
hoverIcon: PropTypes.element,
|
|
602
562
|
color: PropTypes.string,
|
|
603
563
|
width: PropTypes.string,
|
|
604
564
|
outline: PropTypes.bool,
|
|
@@ -612,7 +572,6 @@ Button.propTypes = {
|
|
|
612
572
|
padding: PropTypes.string,
|
|
613
573
|
boxSizing: PropTypes.string,
|
|
614
574
|
className: PropTypes.string,
|
|
615
|
-
hoverIcon: PropTypes.element,
|
|
616
575
|
hoverColor: PropTypes.string,
|
|
617
576
|
transition: PropTypes.string,
|
|
618
577
|
contentWidth: PropTypes.bool,
|
|
@@ -622,27 +581,7 @@ Button.propTypes = {
|
|
|
622
581
|
disabledLineColor: PropTypes.string,
|
|
623
582
|
btnIconMarginRight: PropTypes.string,
|
|
624
583
|
backgroundHoverColor: PropTypes.string,
|
|
625
|
-
disabledBackgroundColor: PropTypes.string
|
|
626
|
-
title: PropTypes.string,
|
|
627
|
-
titleFont: PropTypes.string,
|
|
628
|
-
titleSize: PropTypes.string,
|
|
629
|
-
titleColor: PropTypes.string,
|
|
630
|
-
titleWidth: PropTypes.string,
|
|
631
|
-
titleStyle: PropTypes.string,
|
|
632
|
-
titleWeight: PropTypes.string,
|
|
633
|
-
titleRadius: PropTypes.string,
|
|
634
|
-
titlePadding: PropTypes.string,
|
|
635
|
-
titleBackgroundColor: PropTypes.string,
|
|
636
|
-
titleVerticalDistance: PropTypes.string,
|
|
637
|
-
titleHorizontalDistance: PropTypes.string,
|
|
638
|
-
titleVerticalPosition: PropTypes.oneOf(Object.values(vertical)),
|
|
639
|
-
titleHorizontalPosition: PropTypes.oneOf(Object.values(horizontal))
|
|
640
|
-
};
|
|
641
|
-
Button.defaultProps = {
|
|
642
|
-
titleVerticalDistance: '4px',
|
|
643
|
-
titleVerticalPosition: 'top',
|
|
644
|
-
titleHorizontalPosition: 'left',
|
|
645
|
-
titleHorizontalDistance: '10px'
|
|
584
|
+
disabledBackgroundColor: PropTypes.string
|
|
646
585
|
};
|
|
647
586
|
|
|
648
587
|
const SvgPdf = ({
|
|
@@ -773,8 +712,6 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
773
712
|
borderStyle,
|
|
774
713
|
borderColor,
|
|
775
714
|
upload,
|
|
776
|
-
preview,
|
|
777
|
-
maxSize,
|
|
778
715
|
maxWidth,
|
|
779
716
|
disabled,
|
|
780
717
|
multiple,
|
|
@@ -823,7 +760,6 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
823
760
|
uploadBtnHoverColor,
|
|
824
761
|
uploadBtnBackgroundColor,
|
|
825
762
|
uploadBtnBackgroundColorHover,
|
|
826
|
-
fileExtensions,
|
|
827
763
|
listItemHeight,
|
|
828
764
|
backgroundColor,
|
|
829
765
|
deleteComponent,
|
|
@@ -842,7 +778,6 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
842
778
|
progressTrackColor,
|
|
843
779
|
fileAreaImageWidth,
|
|
844
780
|
listItemErrorColor,
|
|
845
|
-
timeForRemoveError,
|
|
846
781
|
progressFailedColor,
|
|
847
782
|
fileAreaImageHeight,
|
|
848
783
|
progressSuccessColor,
|
|
@@ -852,7 +787,11 @@ const File = /*#__PURE__*/forwardRef(({
|
|
|
852
787
|
extentionsRowMarginTop,
|
|
853
788
|
listItemBackgroundColor,
|
|
854
789
|
listItemBackgroundErrorColor,
|
|
855
|
-
maxCHoosenLengthErrorHideTime
|
|
790
|
+
maxCHoosenLengthErrorHideTime,
|
|
791
|
+
maxSize = 10,
|
|
792
|
+
preview = true,
|
|
793
|
+
timeForRemoveError = 5000,
|
|
794
|
+
fileExtensions = ['jpg', 'jpeg', 'png', 'pdf', 'heic']
|
|
856
795
|
}, ref) => {
|
|
857
796
|
const inpRef = useRef(null);
|
|
858
797
|
const memoizedItems = useMemo(() => filesArray, [filesArray]);
|
|
@@ -1360,12 +1299,6 @@ File.propTypes = {
|
|
|
1360
1299
|
filesArray: PropTypes.arrayOf(PropTypes.object),
|
|
1361
1300
|
fileExtensions: PropTypes.arrayOf(PropTypes.string)
|
|
1362
1301
|
};
|
|
1363
|
-
File.defaultProps = {
|
|
1364
|
-
maxSize: 10,
|
|
1365
|
-
preview: true,
|
|
1366
|
-
timeForRemoveError: 5000,
|
|
1367
|
-
fileExtensions: ['jpg', 'jpeg', 'png', 'pdf', 'heic']
|
|
1368
|
-
};
|
|
1369
1302
|
|
|
1370
1303
|
const SvgCheckboxUnchecked = ({
|
|
1371
1304
|
title,
|
|
@@ -2494,8 +2427,8 @@ const Table = ({
|
|
|
2494
2427
|
key: `${item}_${index}`,
|
|
2495
2428
|
style: {
|
|
2496
2429
|
backgroundColor: tableRowBGColor ?? merge.TABLE.body.row.colors.background,
|
|
2497
|
-
borderColor: hideBorder ? 'transparent' : merge.TABLE.body.row.borderColor,
|
|
2498
2430
|
borderBottom: index === body.length - 1 ? 'none' : tBodyRowBorder ? tBodyRowBorder : merge.TABLE.body.row.border,
|
|
2431
|
+
borderColor: hideBorder ? 'transparent' : merge.TABLE.body.row.borderColor,
|
|
2499
2432
|
boxShadow: (tableRowItem ? tableRowItem : merge.TABLE.body.row.asItem) ? tableRowBoxShadow ? tableRowBoxShadow : merge.TABLE.body.row.box.shadow : 'none'
|
|
2500
2433
|
}
|
|
2501
2434
|
}, Object.values(item).map((innerItem, innerIndex) => {
|
|
@@ -2683,7 +2616,6 @@ const SvgCloseSlide = ({
|
|
|
2683
2616
|
}));
|
|
2684
2617
|
|
|
2685
2618
|
const Modal = ({
|
|
2686
|
-
type,
|
|
2687
2619
|
data,
|
|
2688
2620
|
width,
|
|
2689
2621
|
radius,
|
|
@@ -2723,7 +2655,8 @@ const Modal = ({
|
|
|
2723
2655
|
imageWrapHeight,
|
|
2724
2656
|
grayDecorHeight,
|
|
2725
2657
|
layerBackgroundColor,
|
|
2726
|
-
closeAreaBackgroundColor
|
|
2658
|
+
closeAreaBackgroundColor,
|
|
2659
|
+
type = 'content'
|
|
2727
2660
|
}) => {
|
|
2728
2661
|
const [select, setSelect] = useState(0);
|
|
2729
2662
|
const [isHover, setIsHover] = useState(false);
|
|
@@ -3024,9 +2957,6 @@ Modal.propTypes = {
|
|
|
3024
2957
|
layerBackgroundColor: PropTypes.string,
|
|
3025
2958
|
closeAreaBackgroundColor: PropTypes.string
|
|
3026
2959
|
};
|
|
3027
|
-
Modal.defaultProps = {
|
|
3028
|
-
type: 'content'
|
|
3029
|
-
};
|
|
3030
2960
|
|
|
3031
2961
|
const handleCheckTypeTel = (val, prevVal) => {
|
|
3032
2962
|
const phoneNumberRegex = /^\d{0,8}$/;
|
|
@@ -3329,7 +3259,6 @@ const P = styled.span`
|
|
|
3329
3259
|
animation: ${true};
|
|
3330
3260
|
`;
|
|
3331
3261
|
const Input = ({
|
|
3332
|
-
type,
|
|
3333
3262
|
size,
|
|
3334
3263
|
name,
|
|
3335
3264
|
style,
|
|
@@ -3389,13 +3318,13 @@ const Input = ({
|
|
|
3389
3318
|
telBorderRightStyle,
|
|
3390
3319
|
telBorderRightColor,
|
|
3391
3320
|
backgroundDisableColor,
|
|
3392
|
-
telBorderRightColorHover
|
|
3321
|
+
telBorderRightColorHover,
|
|
3322
|
+
type = 'text'
|
|
3393
3323
|
}) => {
|
|
3394
3324
|
const [show, setShow] = useState(false);
|
|
3395
3325
|
const [isHover, setIsHover] = useState(false);
|
|
3396
3326
|
const [innerErrorMessage, setInnerErrorMessage] = useState('');
|
|
3397
3327
|
const inpStyles = {
|
|
3398
|
-
color: color ?? merge.INPUT.color,
|
|
3399
3328
|
width: width ?? merge.INPUT.width,
|
|
3400
3329
|
cursor: disabled ? 'not-allowed' : 'auto',
|
|
3401
3330
|
height: height ?? merge.INPUT.height,
|
|
@@ -3405,6 +3334,7 @@ const Input = ({
|
|
|
3405
3334
|
fontWeight: weight ?? merge.INPUT.font.weight,
|
|
3406
3335
|
fontFamily: family ?? merge.INPUT.font.family,
|
|
3407
3336
|
boxSizing: boxSizing ?? merge.INPUT.box.sizing,
|
|
3337
|
+
color: innerErrorMessage && errorColor ? errorColor : color ? color : merge.INPUT.color,
|
|
3408
3338
|
backgroundColor: disabled ? backgroundDisableColor ? backgroundDisableColor : merge.INPUT.colors.backgroundDisable : backgroundColor ? backgroundColor : merge.INPUT.colors.background
|
|
3409
3339
|
};
|
|
3410
3340
|
const uuid = v4();
|
|
@@ -3629,9 +3559,6 @@ Input.propTypes = {
|
|
|
3629
3559
|
type: PropTypes.oneOf(Object.values(InputTypes)),
|
|
3630
3560
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.object])
|
|
3631
3561
|
};
|
|
3632
|
-
Input.defaultProps = {
|
|
3633
|
-
type: 'text'
|
|
3634
|
-
};
|
|
3635
3562
|
|
|
3636
3563
|
const RadioDirectionMode = {
|
|
3637
3564
|
VERTICAL: 'vertical',
|
|
@@ -3643,7 +3570,6 @@ const Radio = ({
|
|
|
3643
3570
|
getData,
|
|
3644
3571
|
selected,
|
|
3645
3572
|
keyNames,
|
|
3646
|
-
diraction,
|
|
3647
3573
|
className,
|
|
3648
3574
|
borderSize,
|
|
3649
3575
|
labelColor,
|
|
@@ -3657,7 +3583,8 @@ const Radio = ({
|
|
|
3657
3583
|
radioMarginRight,
|
|
3658
3584
|
borderActiveColor,
|
|
3659
3585
|
radioItemMarginRight,
|
|
3660
|
-
radioItemMarginBottom
|
|
3586
|
+
radioItemMarginBottom,
|
|
3587
|
+
diraction = 'vertical'
|
|
3661
3588
|
}) => {
|
|
3662
3589
|
const classProps = classnames(className ?? merge.RADIO.className);
|
|
3663
3590
|
const [innerData, setInnerData] = useState([]);
|
|
@@ -3800,9 +3727,6 @@ Radio.propTypes = {
|
|
|
3800
3727
|
diraction: PropTypes.oneOf(Object.values(RadioDirectionMode)),
|
|
3801
3728
|
data: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object])
|
|
3802
3729
|
};
|
|
3803
|
-
Radio.defaultProps = {
|
|
3804
|
-
diraction: 'vertical'
|
|
3805
|
-
};
|
|
3806
3730
|
|
|
3807
3731
|
const SvgArrow = ({
|
|
3808
3732
|
title,
|
|
@@ -4048,7 +3972,7 @@ const Select = ({
|
|
|
4048
3972
|
whiteSpace: disabled ? 'pre-wrap' : 'nowrap',
|
|
4049
3973
|
overflow: 'hidden',
|
|
4050
3974
|
textOverflow: 'ellipsis',
|
|
4051
|
-
color: isHover ? selectedHoverColor ? selectedHoverColor : merge.SELECT.selected.colors.hover : selectedColor ? selectedColor : merge.SELECT.selected.color
|
|
3975
|
+
color: errorMessage ? errorColor ? errorColor : merge.SELECT.error.color : isHover ? selectedHoverColor ? selectedHoverColor : merge.SELECT.selected.colors.hover : selectedColor ? selectedColor : merge.SELECT.selected.color
|
|
4052
3976
|
}
|
|
4053
3977
|
}, !multiple && newSelected && newSelected[0] && newSelected[0][keyNames.name] ? newSelected[0][keyNames.name] : newSelected && newSelected.length > 0 ? newSelected.map((_, index) => {
|
|
4054
3978
|
if (newSelected[index][keyNames.name]) {
|
|
@@ -4324,12 +4248,12 @@ const ToasterPosition = {
|
|
|
4324
4248
|
const Toast = ({
|
|
4325
4249
|
type,
|
|
4326
4250
|
icon,
|
|
4327
|
-
title,
|
|
4328
|
-
timer,
|
|
4329
|
-
position,
|
|
4330
4251
|
closeIcon,
|
|
4331
4252
|
removeToast,
|
|
4332
|
-
description
|
|
4253
|
+
description,
|
|
4254
|
+
timer = 5000,
|
|
4255
|
+
position = 'top-right',
|
|
4256
|
+
title = 'toaster title'
|
|
4333
4257
|
}) => {
|
|
4334
4258
|
let timeoutCall;
|
|
4335
4259
|
let timeoutClick;
|
|
@@ -4427,11 +4351,6 @@ Toast.propTypes = {
|
|
|
4427
4351
|
position: PropTypes.oneOf(Object.values(ToasterPosition)),
|
|
4428
4352
|
type: PropTypes.oneOf(Object.values(ToasterType)).isRequired
|
|
4429
4353
|
};
|
|
4430
|
-
Toast.defaultProps = {
|
|
4431
|
-
timer: 5000,
|
|
4432
|
-
position: 'top-right',
|
|
4433
|
-
title: 'toaster title'
|
|
4434
|
-
};
|
|
4435
4354
|
|
|
4436
4355
|
let toastify;
|
|
4437
4356
|
let path = window.location.href;
|
|
@@ -4475,7 +4394,8 @@ const createToast = ({
|
|
|
4475
4394
|
description,
|
|
4476
4395
|
removeToast
|
|
4477
4396
|
});
|
|
4478
|
-
ReactDOM.
|
|
4397
|
+
const root = ReactDOM.createRoot(toastBlock);
|
|
4398
|
+
root.render(newElem);
|
|
4479
4399
|
if (!document.getElementById(styles$5[position]) || document.getElementById(styles$5[position]) == null) {
|
|
4480
4400
|
toastParentBlock = document.createElement('div');
|
|
4481
4401
|
toastParentBlock.style.position = 'fixed';
|
|
@@ -4612,7 +4532,6 @@ var styles$4 = {"tooltip-block":"tooltip-module_tooltip-block__v8U9u","tooltip":
|
|
|
4612
4532
|
styleInject(css_248z$5);
|
|
4613
4533
|
|
|
4614
4534
|
const Tooltip = ({
|
|
4615
|
-
type,
|
|
4616
4535
|
text,
|
|
4617
4536
|
width,
|
|
4618
4537
|
color,
|
|
@@ -4627,7 +4546,8 @@ const Tooltip = ({
|
|
|
4627
4546
|
tooltipWidth,
|
|
4628
4547
|
tooltipRadius,
|
|
4629
4548
|
backgroundColor,
|
|
4630
|
-
tooltipBackgroundColor
|
|
4549
|
+
tooltipBackgroundColor,
|
|
4550
|
+
type = 'top'
|
|
4631
4551
|
}) => {
|
|
4632
4552
|
const tooltipRef = /*#__PURE__*/createRef(null);
|
|
4633
4553
|
const classProps = classnames(styles$4['tooltip-block'], className ?? merge.TOOLTIP.className);
|
|
@@ -4704,9 +4624,6 @@ Tooltip.propTypes = {
|
|
|
4704
4624
|
backgroundColor: PropTypes.string,
|
|
4705
4625
|
tooltipBackgroundColor: PropTypes.string
|
|
4706
4626
|
};
|
|
4707
|
-
Tooltip.defaultProps = {
|
|
4708
|
-
type: 'top'
|
|
4709
|
-
};
|
|
4710
4627
|
|
|
4711
4628
|
const SvgCaptchaArrowUp = ({
|
|
4712
4629
|
title,
|
|
@@ -4917,13 +4834,13 @@ const Checkbox = ({
|
|
|
4917
4834
|
getData,
|
|
4918
4835
|
keyNames,
|
|
4919
4836
|
className,
|
|
4920
|
-
direction,
|
|
4921
4837
|
checkedColor,
|
|
4922
4838
|
unCheckedColor,
|
|
4923
4839
|
checkedIcon,
|
|
4924
4840
|
unCheckedIcon,
|
|
4925
4841
|
labelMarginLeft,
|
|
4926
|
-
checkBoxMarginBottom
|
|
4842
|
+
checkBoxMarginBottom,
|
|
4843
|
+
direction = 'vertical'
|
|
4927
4844
|
}) => {
|
|
4928
4845
|
const classProps = classnames(className ?? merge.CHECKBOX.className);
|
|
4929
4846
|
const [innerData, setInnerData] = useState([]);
|
|
@@ -5008,9 +4925,6 @@ Checkbox.propTypes = {
|
|
|
5008
4925
|
direction: PropTypes.oneOf(Object.values(DirectionMode)),
|
|
5009
4926
|
data: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object])
|
|
5010
4927
|
};
|
|
5011
|
-
Checkbox.defaultProps = {
|
|
5012
|
-
direction: 'vertical'
|
|
5013
|
-
};
|
|
5014
4928
|
|
|
5015
4929
|
var css_248z$2 = "textarea{-webkit-appearance:none}textarea::-webkit-scrollbar{width:6px}textarea::-webkit-scrollbar-track{background:#eee}textarea::-webkit-scrollbar-thumb,textarea::-webkit-scrollbar-track{border-radius:3px;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px}textarea::-webkit-scrollbar-thumb{background:#d1d1d1}";
|
|
5016
4930
|
styleInject(css_248z$2);
|
|
@@ -5060,7 +4974,7 @@ const Textarea = ({
|
|
|
5060
4974
|
borderHoverColor,
|
|
5061
4975
|
labelMarginBottom,
|
|
5062
4976
|
showCharacterCount,
|
|
5063
|
-
characterCountPosition
|
|
4977
|
+
characterCountPosition = 'top'
|
|
5064
4978
|
}) => {
|
|
5065
4979
|
const classProps = classnames(className ?? merge.TEXTAREA.className);
|
|
5066
4980
|
const [error, setError] = useState('');
|
|
@@ -5232,9 +5146,6 @@ Textarea.propTypes = {
|
|
|
5232
5146
|
onChange: PropTypes.func.isRequired,
|
|
5233
5147
|
characterCountPosition: PropTypes.oneOf(Object.values(PositionSide))
|
|
5234
5148
|
};
|
|
5235
|
-
Textarea.defaultProps = {
|
|
5236
|
-
characterCountPosition: 'top'
|
|
5237
|
-
};
|
|
5238
5149
|
|
|
5239
5150
|
const TypographyType = {
|
|
5240
5151
|
p: 'p',
|
|
@@ -5253,7 +5164,6 @@ const Typography = ({
|
|
|
5253
5164
|
radius,
|
|
5254
5165
|
border,
|
|
5255
5166
|
cursor,
|
|
5256
|
-
variant,
|
|
5257
5167
|
onClick,
|
|
5258
5168
|
children,
|
|
5259
5169
|
textAlign,
|
|
@@ -5266,6 +5176,7 @@ const Typography = ({
|
|
|
5266
5176
|
textTransform,
|
|
5267
5177
|
textDecoration,
|
|
5268
5178
|
backgroundColor,
|
|
5179
|
+
variant = 'p',
|
|
5269
5180
|
...props
|
|
5270
5181
|
}) => {
|
|
5271
5182
|
const classProps = classnames(className ?? merge.TYPOGRAPHY.className);
|
|
@@ -5327,9 +5238,6 @@ Typography.propTypes = {
|
|
|
5327
5238
|
variant: PropTypes.oneOf(Object.values(TypographyType)),
|
|
5328
5239
|
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
|
5329
5240
|
};
|
|
5330
|
-
Typography.defaultProps = {
|
|
5331
|
-
variant: 'p'
|
|
5332
|
-
};
|
|
5333
5241
|
|
|
5334
5242
|
var css_248z$1 = ".pagination-module_listItem__b1-WN:focus{background-color:#4caf50;color:#fff}.pagination-module_listItem__b1-WN:hover:not(.pagination-module_active__KwBDp){background-color:#ddd}.pagination-module_pagination-bar__MrtYT>ul{display:flex;flex-direction:row;flex-wrap:nowrap;gap:8px;justify-content:center}.pagination-module_pagination-btn__w8Yh8{border:none;border-radius:6px;outline:none}.pagination-module_pagination-btn__w8Yh8,.pagination-module_pagination-item__t3emS,.pagination-module_pagination-jump-next__LAb9Z{align-items:center;background-color:#fff;box-shadow:0 0 0 1px #eee;cursor:pointer;display:flex;height:34px;justify-content:center;width:34px}.pagination-module_pagination-item__t3emS,.pagination-module_pagination-jump-next__LAb9Z{border-radius:6px;flex:0 0 auto;font-size:13px;line-height:16px;position:relative;transition:background-color .24s}.pagination-module_pagination-item__t3emS:hover{background-color:#eee}.pagination-module_pagination-item__t3emS.pagination-module_selected__EXzCA{background-color:#00236a;color:#fff}.pagination-module_pagination-jump-next-arrow__aEVD8,.pagination-module_pagination-jump-next-txt__e7nFj{align-items:center;bottom:0;display:flex;font-size:12px;justify-content:center;left:0;line-height:14px;margin:auto;position:absolute;right:0;top:0;transition:opacity .24s,color .24s}.pagination-module_pagination-jump-next-arrow__aEVD8{opacity:0}.pagination-module_pagination-jump-next__LAb9Z:hover .pagination-module_pagination-jump-next-arrow__aEVD8{opacity:1}.pagination-module_pagination-jump-next__LAb9Z:hover .pagination-module_pagination-jump-next-txt__e7nFj{opacity:0}i{color:#3c393e;font-size:12px;line-height:12px}input::-webkit-inner-spin-button,input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}";
|
|
5335
5243
|
var styles$1 = {"listItem":"pagination-module_listItem__b1-WN","active":"pagination-module_active__KwBDp","pagination-bar":"pagination-module_pagination-bar__MrtYT","pagination-btn":"pagination-module_pagination-btn__w8Yh8","pagination-item":"pagination-module_pagination-item__t3emS","pagination-jump-next":"pagination-module_pagination-jump-next__LAb9Z","selected":"pagination-module_selected__EXzCA","pagination-jump-next-txt":"pagination-module_pagination-jump-next-txt__e7nFj","pagination-jump-next-arrow":"pagination-module_pagination-jump-next-arrow__aEVD8"};
|
|
@@ -5416,7 +5324,7 @@ const SvgNextarrow = ({
|
|
|
5416
5324
|
|
|
5417
5325
|
const Pagination = ({
|
|
5418
5326
|
goTo,
|
|
5419
|
-
offset,
|
|
5327
|
+
offset = 2,
|
|
5420
5328
|
onChange,
|
|
5421
5329
|
className,
|
|
5422
5330
|
totalCount,
|
|
@@ -5575,9 +5483,6 @@ Pagination.propTypes = {
|
|
|
5575
5483
|
className: PropTypes.string,
|
|
5576
5484
|
currentPage: PropTypes.number
|
|
5577
5485
|
};
|
|
5578
|
-
Pagination.defaultProps = {
|
|
5579
|
-
offset: 2
|
|
5580
|
-
};
|
|
5581
5486
|
|
|
5582
5487
|
var css_248z = ".autocomplete-module_auto-complete__oUOv9{appearance:none!important;-webkit-appearance:none!important}";
|
|
5583
5488
|
var styles = {"auto-complete":"autocomplete-module_auto-complete__oUOv9"};
|
|
@@ -5588,9 +5493,7 @@ const Autocomplete = ({
|
|
|
5588
5493
|
change,
|
|
5589
5494
|
options,
|
|
5590
5495
|
getItem,
|
|
5591
|
-
keyNames,
|
|
5592
5496
|
required,
|
|
5593
|
-
disabled,
|
|
5594
5497
|
selected,
|
|
5595
5498
|
className,
|
|
5596
5499
|
errorSize,
|
|
@@ -5603,7 +5506,6 @@ const Autocomplete = ({
|
|
|
5603
5506
|
errorColor,
|
|
5604
5507
|
labelColor,
|
|
5605
5508
|
labelWeight,
|
|
5606
|
-
searchCount,
|
|
5607
5509
|
placeHolder,
|
|
5608
5510
|
errorMessage,
|
|
5609
5511
|
autoComplete,
|
|
@@ -5665,6 +5567,12 @@ const Autocomplete = ({
|
|
|
5665
5567
|
contentBottomRowBackgroundColor,
|
|
5666
5568
|
contentBottomRowHoverBackgroundColor,
|
|
5667
5569
|
backgroundDisableColor,
|
|
5570
|
+
searchCount = 3,
|
|
5571
|
+
disabled = false,
|
|
5572
|
+
keyNames = {
|
|
5573
|
+
name: 'name',
|
|
5574
|
+
id: 'id'
|
|
5575
|
+
},
|
|
5668
5576
|
...props
|
|
5669
5577
|
}) => {
|
|
5670
5578
|
const [id, setId] = useState('');
|
|
@@ -5968,13 +5876,5 @@ Autocomplete.propTypes = {
|
|
|
5968
5876
|
contentBottomRowHoverBackgroundColor: PropTypes.string,
|
|
5969
5877
|
backgroundDisableColor: PropTypes.string
|
|
5970
5878
|
};
|
|
5971
|
-
Autocomplete.defaultProps = {
|
|
5972
|
-
searchCount: 3,
|
|
5973
|
-
disabled: false,
|
|
5974
|
-
keyNames: {
|
|
5975
|
-
name: 'name',
|
|
5976
|
-
id: 'id'
|
|
5977
|
-
}
|
|
5978
|
-
};
|
|
5979
5879
|
|
|
5980
5880
|
export { Autocomplete, Button, Captcha, Checkbox, DirectionMode, File, Input, InputTypes, Modal, Pagination, PositionSide, Radio, RadioDirectionMode, Select, Stepper, Table, Textarea, Toaster, Tooltip, Typography, TypographyType, toast };
|