@xaypay/tui 0.0.59 → 0.0.60
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 +113 -39
- package/dist/index.js +113 -38
- package/package.json +1 -1
- package/src/assets/icons/checkbox-checked.svg +3 -0
- package/src/assets/icons/checkbox-unchecked.svg +3 -0
- package/src/components/file/index.js +1 -8
- package/src/components/input/index.js +10 -1
- package/src/components/select/index.js +91 -25
- package/src/components/select/select.stories.js +11 -3
- package/src/components/selectCheckbox/index.js +20 -0
- package/src/components/selectCheckbox/selectCheckbox.stories.js +10 -0
- package/src/components/typography/index.js +0 -6
- package/src/index.js +2 -1
- package/src/stories/changelog.stories.mdx +14 -1
- package/src/stories/configuration.stories.mdx +7 -22
- package/tui.config.js +6 -21
package/dist/index.es.js
CHANGED
|
@@ -97,12 +97,6 @@ const File = ({
|
|
|
97
97
|
setFileName('no selected file');
|
|
98
98
|
document.querySelector(`.${name}`).value = "";
|
|
99
99
|
};
|
|
100
|
-
useEffect(() => {
|
|
101
|
-
return () => {
|
|
102
|
-
setError('');
|
|
103
|
-
setImage(null);
|
|
104
|
-
};
|
|
105
|
-
}, []);
|
|
106
100
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("p", {
|
|
107
101
|
className: `${styles$b['file-form-title']} ile-form-title-rem`
|
|
108
102
|
}, label, " ", required && /*#__PURE__*/React.createElement("sup", {
|
|
@@ -404,8 +398,6 @@ const Typography = ({
|
|
|
404
398
|
radius,
|
|
405
399
|
border,
|
|
406
400
|
cursor,
|
|
407
|
-
margin,
|
|
408
|
-
padding,
|
|
409
401
|
variant,
|
|
410
402
|
onClick,
|
|
411
403
|
children,
|
|
@@ -442,9 +434,7 @@ const Typography = ({
|
|
|
442
434
|
cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
|
|
443
435
|
borderRadius: radius ? radius : configStyles.TYPOGRAPHY.radius,
|
|
444
436
|
fontSize: size ? size : configStyles.TYPOGRAPHY['size' + variant],
|
|
445
|
-
margin: margin ? margin : configStyles.TYPOGRAPHY['margin' + variant],
|
|
446
437
|
fontWeight: weight ? weight : configStyles.TYPOGRAPHY['weight' + variant],
|
|
447
|
-
padding: padding ? padding : configStyles.TYPOGRAPHY['padding' + variant],
|
|
448
438
|
textShadow: textShadow ? textShadow : configStyles.TYPOGRAPHY.textShadow,
|
|
449
439
|
textAlign: textAlign ? textAlign : configStyles.TYPOGRAPHY['textAlign' + variant],
|
|
450
440
|
fontStyle: fontStyle ? fontStyle : configStyles.TYPOGRAPHY['fontStyle' + variant],
|
|
@@ -470,9 +460,7 @@ Typography.propTypes = {
|
|
|
470
460
|
weight: PropTypes.string,
|
|
471
461
|
border: PropTypes.string,
|
|
472
462
|
cursor: PropTypes.string,
|
|
473
|
-
margin: PropTypes.string,
|
|
474
463
|
radius: PropTypes.string,
|
|
475
|
-
padding: PropTypes.string,
|
|
476
464
|
textAlign: PropTypes.string,
|
|
477
465
|
className: PropTypes.string,
|
|
478
466
|
fontStyle: PropTypes.string,
|
|
@@ -599,6 +587,7 @@ const Input = ({
|
|
|
599
587
|
errorZindex,
|
|
600
588
|
errorBottom,
|
|
601
589
|
labelWeight,
|
|
590
|
+
phoneDisplay,
|
|
602
591
|
errorMessage,
|
|
603
592
|
autoComplete,
|
|
604
593
|
labelDisplay,
|
|
@@ -606,10 +595,12 @@ const Input = ({
|
|
|
606
595
|
boxShadowHover,
|
|
607
596
|
errorClassName,
|
|
608
597
|
errorAnimation,
|
|
598
|
+
phoneAlignItems,
|
|
609
599
|
errorLineHeight,
|
|
610
600
|
labelLineHeight,
|
|
611
601
|
backgroundColor,
|
|
612
602
|
labelMarginBottom,
|
|
603
|
+
phoneJustifyContent,
|
|
613
604
|
errorAnimationDuration,
|
|
614
605
|
...props
|
|
615
606
|
}) => {
|
|
@@ -691,8 +682,11 @@ const Input = ({
|
|
|
691
682
|
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
692
683
|
borderTopLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
693
684
|
borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
694
|
-
|
|
695
|
-
|
|
685
|
+
display: phoneDisplay ? phoneDisplay : configStyles.INPUT.phoneDisplay,
|
|
686
|
+
alignItems: phoneAlignItems ? phoneAlignItems : configStyles.INPUT.phoneAlignItems,
|
|
687
|
+
color: errorMessage && errorColor ? errorColor : color ? color : configStyles.INPUT.color,
|
|
688
|
+
justifyContent: phoneJustifyContent ? phoneJustifyContent : configStyles.INPUT.phoneJustifyContent,
|
|
689
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
696
690
|
}
|
|
697
691
|
}, "+374") : '', /*#__PURE__*/React.createElement("input", _extends({}, props, {
|
|
698
692
|
value: value,
|
|
@@ -773,6 +767,7 @@ Input.propTypes = {
|
|
|
773
767
|
errorBottom: PropTypes.string,
|
|
774
768
|
labelWeight: PropTypes.string,
|
|
775
769
|
errorMessage: PropTypes.string,
|
|
770
|
+
phoneDisplay: PropTypes.string,
|
|
776
771
|
autoComplete: PropTypes.string,
|
|
777
772
|
errorAnimation: PropTypes.bool,
|
|
778
773
|
labelDisplay: PropTypes.string,
|
|
@@ -780,9 +775,11 @@ Input.propTypes = {
|
|
|
780
775
|
boxShadowHover: PropTypes.string,
|
|
781
776
|
errorClassName: PropTypes.string,
|
|
782
777
|
backgroundColor: PropTypes.string,
|
|
778
|
+
phoneAlignItems: PropTypes.string,
|
|
783
779
|
errorLineHeight: PropTypes.string,
|
|
784
780
|
labelLineHeight: PropTypes.string,
|
|
785
781
|
labelMarginBottom: PropTypes.string,
|
|
782
|
+
phoneJustifyContent: PropTypes.string,
|
|
786
783
|
errorAnimationDuration: PropTypes.string,
|
|
787
784
|
leftIcon: PropTypes.arrayOf(PropTypes.element),
|
|
788
785
|
rightIcon: PropTypes.arrayOf(PropTypes.element),
|
|
@@ -940,6 +937,27 @@ Button.propTypes = {
|
|
|
940
937
|
disabledBackgroundColor: PropTypes.string
|
|
941
938
|
};
|
|
942
939
|
|
|
940
|
+
var ReactCheckbox = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M3.2 0H12.8C14.5673 0 16 1.43269 16 3.2V12.8C16 14.5673 14.5673 16 12.8 16H3.2C1.43269 16 0 14.5673 0 12.8V3.2C0 1.43269 1.43269 0 3.2 0ZM3.2 1.6C2.31634 1.6 1.6 2.31634 1.6 3.2V12.8C1.6 13.6837 2.31634 14.4 3.2 14.4H12.8C13.6837 14.4 14.4 13.6837 14.4 12.8V3.2C14.4 2.31634 13.6837 1.6 12.8 1.6H3.2Z\" fill=\"#D1D1D1\"/>\n</svg>";
|
|
941
|
+
|
|
942
|
+
var ReactCheckboxChecked = "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.8 0H3.2C1.43269 0 0 1.43269 0 3.2V12.8C0 14.5673 1.43269 16 3.2 16H12.8C14.5673 16 16 14.5673 16 12.8V3.2C16 1.43269 14.5673 0 12.8 0ZM6.84979 10.9662C6.9178 10.9887 6.99067 11 7.0684 11C7.14613 11 7.219 10.9887 7.28701 10.9662C7.35502 10.944 7.41818 10.906 7.47647 10.8523L12.8397 5.91275C12.9466 5.81432 13 5.68671 13 5.52993C13 5.37351 12.9466 5.24609 12.8397 5.14765C12.7328 5.04922 12.5945 5 12.4246 5C12.2544 5 12.1158 5.04922 12.009 5.14765L7.0684 9.69799L4.98433 7.77852C4.87745 7.68009 4.74143 7.63087 4.57625 7.63087C4.41108 7.63087 4.27506 7.68009 4.16818 7.77852C4.06131 7.87696 4.00534 8.00438 4.00029 8.1608C3.99563 8.31758 4.04673 8.44519 4.15361 8.54362L6.66033 10.8523C6.71863 10.906 6.78178 10.944 6.84979 10.9662Z\" fill=\"#00236A\"/>\n</svg>";
|
|
943
|
+
|
|
944
|
+
const SelectCheckbox = ({
|
|
945
|
+
checked
|
|
946
|
+
}) => {
|
|
947
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
948
|
+
style: {
|
|
949
|
+
marginRight: '9px'
|
|
950
|
+
}
|
|
951
|
+
}, checked ? /*#__PURE__*/React.createElement("img", {
|
|
952
|
+
src: ReactCheckboxChecked
|
|
953
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
954
|
+
src: ReactCheckbox
|
|
955
|
+
}));
|
|
956
|
+
};
|
|
957
|
+
SelectCheckbox.propTypes = {
|
|
958
|
+
checked: PropTypes.bool
|
|
959
|
+
};
|
|
960
|
+
|
|
943
961
|
var ReactArrowIcon = "<svg width=\"15\" height=\"9\" viewBox=\"0 0 15 9\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M7.9878 8.00003C7.75456 8.00049 7.52851 7.91911 7.34892 7.77003L1.3594 2.77003C1.15554 2.60029 1.02734 2.35638 1.003 2.09196C0.978666 1.82753 1.06019 1.56425 1.22963 1.36003C1.39907 1.15581 1.64255 1.02739 1.90652 1.00301C2.17048 0.978631 2.4333 1.06029 2.63716 1.23003L7.9878 5.71003L13.3384 1.39003C13.4405 1.30697 13.558 1.24493 13.6842 1.2075C13.8103 1.17007 13.9425 1.15798 14.0733 1.17192C14.2041 1.18586 14.3309 1.22555 14.4463 1.28873C14.5618 1.3519 14.6636 1.4373 14.746 1.54003C14.8374 1.64285 14.9066 1.76348 14.9493 1.89435C14.9921 2.02523 15.0073 2.16353 14.9942 2.30059C14.9811 2.43765 14.9399 2.57053 14.8731 2.69088C14.8063 2.81124 14.7155 2.91649 14.6062 3.00003L8.6167 7.83003C8.43194 7.95555 8.21051 8.0154 7.9878 8.00003Z\" fill=\"#3C393E\"/>\n</svg>";
|
|
944
962
|
|
|
945
963
|
var ReactCloseIcon = "<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M12.4253 0.241029L12.431 0.236144C12.6129 0.0804082 12.8468 -0.00097097 13.0861 0.00827014C13.3253 0.0175112 13.5523 0.116692 13.7216 0.285992C13.8909 0.455292 13.9901 0.682241 13.9993 0.921488C14.0085 1.16074 13.9272 1.39466 13.7714 1.57651L13.7665 1.58222L8.38622 6.96254L13.7665 12.3429L13.7714 12.3486C13.9272 12.5304 14.0085 12.7643 13.9993 13.0036C13.9901 13.2428 13.8909 13.4698 13.7216 13.6391C13.5523 13.8084 13.3253 13.9076 13.0861 13.9168C12.8468 13.926 12.6129 13.8447 12.431 13.6889L12.4253 13.684L7.04493 8.30363L1.66742 13.6738C1.58315 13.7705 1.48016 13.8492 1.36462 13.9051C1.24669 13.9622 1.11823 13.9942 0.987309 13.9993C0.85639 14.0043 0.72584 13.9823 0.603852 13.9345C0.481865 13.8867 0.371073 13.8142 0.27843 13.7216C0.185788 13.6289 0.113295 13.5181 0.0655034 13.3961C0.0177115 13.2742 -0.00434842 13.1436 0.000708381 13.0127C0.00576522 12.8818 0.0378304 12.7533 0.0948891 12.6354C0.150805 12.5198 0.229542 12.4168 0.326326 12.3325L5.70384 6.96235L0.323475 1.57461L0.318633 1.56895C0.162897 1.3871 0.0815178 1.15317 0.0907589 0.913926C0.1 0.674678 0.199181 0.447729 0.36848 0.27843C0.53778 0.10913 0.76473 0.00995005 1.00398 0.000708956C1.24322 -0.00853214 1.47715 0.0728459 1.659 0.228582L1.66476 0.233511L7.04512 5.62125L12.4253 0.241029Z\" fill=\"#3C393E\"/>\n</svg>";
|
|
@@ -949,8 +967,9 @@ var styles$5 = {"select-content":"select-module_select-content__GCMDX","select-c
|
|
|
949
967
|
styleInject(css_248z$5);
|
|
950
968
|
|
|
951
969
|
const Select = ({
|
|
970
|
+
options,
|
|
971
|
+
multiple,
|
|
952
972
|
disabled,
|
|
953
|
-
jsonData,
|
|
954
973
|
required,
|
|
955
974
|
onChange,
|
|
956
975
|
keyNames,
|
|
@@ -960,6 +979,7 @@ const Select = ({
|
|
|
960
979
|
closeIcon,
|
|
961
980
|
errorMessage,
|
|
962
981
|
defaultOption,
|
|
982
|
+
multipleCheckbox,
|
|
963
983
|
label,
|
|
964
984
|
labelColor,
|
|
965
985
|
labelWeight,
|
|
@@ -973,7 +993,7 @@ const Select = ({
|
|
|
973
993
|
errorColor,
|
|
974
994
|
selectedColor,
|
|
975
995
|
selectedRadius,
|
|
976
|
-
|
|
996
|
+
selectedMinHeight,
|
|
977
997
|
selectedBorder,
|
|
978
998
|
selectedPadding,
|
|
979
999
|
selectedFontSize,
|
|
@@ -999,11 +1019,11 @@ const Select = ({
|
|
|
999
1019
|
optionItemBackgroudColor,
|
|
1000
1020
|
optionItemBackgroudColorHover
|
|
1001
1021
|
}) => {
|
|
1002
|
-
const options = jsonData.length ? JSON.parse(jsonData) : [];
|
|
1003
1022
|
const ref = useRef();
|
|
1004
1023
|
const [opened, setOpened] = useState(false);
|
|
1005
1024
|
const [isHover, setIsHover] = useState(false);
|
|
1006
|
-
const [newSelected, setNewSelected] = useState(
|
|
1025
|
+
const [newSelected, setNewSelected] = useState([]);
|
|
1026
|
+
const [existOptions, setExistOptions] = useState([]);
|
|
1007
1027
|
const configStyles = compereConfigs();
|
|
1008
1028
|
const classProps = classnames(className);
|
|
1009
1029
|
const handleOpenClose = () => {
|
|
@@ -1011,13 +1031,37 @@ const Select = ({
|
|
|
1011
1031
|
};
|
|
1012
1032
|
const handleClearSelect = e => {
|
|
1013
1033
|
onChange({});
|
|
1014
|
-
setNewSelected(
|
|
1034
|
+
setNewSelected([]);
|
|
1035
|
+
const clearedOptions = existOptions && existOptions.length > 0 && existOptions.map(item => {
|
|
1036
|
+
item.checked = false;
|
|
1037
|
+
return item;
|
|
1038
|
+
});
|
|
1039
|
+
setExistOptions(clearedOptions);
|
|
1015
1040
|
e.stopPropagation();
|
|
1016
1041
|
};
|
|
1017
1042
|
const handleSelectItem = option => {
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1043
|
+
const checkedOption = {
|
|
1044
|
+
...option
|
|
1045
|
+
};
|
|
1046
|
+
delete checkedOption.checked;
|
|
1047
|
+
onChange(checkedOption);
|
|
1048
|
+
if (!multiple) {
|
|
1049
|
+
setOpened(!opened);
|
|
1050
|
+
setNewSelected([option]);
|
|
1051
|
+
} else {
|
|
1052
|
+
const indexOfObject = newSelected.findIndex(obj => {
|
|
1053
|
+
return obj.value === option.value;
|
|
1054
|
+
});
|
|
1055
|
+
if (indexOfObject === -1) {
|
|
1056
|
+
option.checked = true;
|
|
1057
|
+
setNewSelected(prev => {
|
|
1058
|
+
return [...prev, option];
|
|
1059
|
+
});
|
|
1060
|
+
} else {
|
|
1061
|
+
option.checked = false;
|
|
1062
|
+
setNewSelected([...newSelected.slice(0, indexOfObject), ...newSelected.slice(indexOfObject + 1)]);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1021
1065
|
};
|
|
1022
1066
|
const handleMouseEnter = () => {
|
|
1023
1067
|
setIsHover(true);
|
|
@@ -1033,10 +1077,6 @@ const Select = ({
|
|
|
1033
1077
|
e.target.style.color = optionItemColor ? optionItemColor : configStyles.SELECT.optionItemColor;
|
|
1034
1078
|
e.target.style.backgroundColor = optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor;
|
|
1035
1079
|
};
|
|
1036
|
-
useEffect(() => {
|
|
1037
|
-
const parseSelectedData = selected.length !== 0 ? JSON.parse(selected) : {};
|
|
1038
|
-
setNewSelected(parseSelectedData);
|
|
1039
|
-
}, [selected]);
|
|
1040
1080
|
useEffect(() => {
|
|
1041
1081
|
if (opened) {
|
|
1042
1082
|
const checkIfClickedOutside = e => {
|
|
@@ -1050,6 +1090,25 @@ const Select = ({
|
|
|
1050
1090
|
};
|
|
1051
1091
|
}
|
|
1052
1092
|
}, [opened]);
|
|
1093
|
+
useEffect(() => {
|
|
1094
|
+
selected && selected.length > 0 && setNewSelected(selected);
|
|
1095
|
+
if (!multiple) {
|
|
1096
|
+
options && options.length > 0 && setExistOptions(options);
|
|
1097
|
+
} else {
|
|
1098
|
+
const modifiedOptions = options && options.length > 0 && options.map((item, index) => {
|
|
1099
|
+
item.checked = false;
|
|
1100
|
+
if (selected && selected.length > 0) {
|
|
1101
|
+
selected.map(innerItem => {
|
|
1102
|
+
if (innerItem.value === item.value) {
|
|
1103
|
+
item.checked = true;
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
return item;
|
|
1108
|
+
});
|
|
1109
|
+
setExistOptions(modifiedOptions);
|
|
1110
|
+
}
|
|
1111
|
+
}, [options, multiple, selected]);
|
|
1053
1112
|
return /*#__PURE__*/React.createElement("div", {
|
|
1054
1113
|
className: classProps
|
|
1055
1114
|
}, label ? /*#__PURE__*/React.createElement("label", {
|
|
@@ -1073,7 +1132,7 @@ const Select = ({
|
|
|
1073
1132
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1074
1133
|
style: {
|
|
1075
1134
|
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.SELECT.cursor,
|
|
1076
|
-
|
|
1135
|
+
minHeight: selectedMinHeight ? selectedMinHeight : configStyles.SELECT.selectedMinHeight,
|
|
1077
1136
|
border: selectedBorder ? selectedBorder : configStyles.SELECT.selectedBorder,
|
|
1078
1137
|
padding: selectedPadding ? selectedPadding : configStyles.SELECT.selectedPadding,
|
|
1079
1138
|
borderRadius: selectedRadius ? selectedRadius : configStyles.SELECT.selectedRadius,
|
|
@@ -1085,19 +1144,30 @@ const Select = ({
|
|
|
1085
1144
|
borderColor: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : selectedBorderColor ? selectedBorderColor : configStyles.SELECT.selectedBorderColor
|
|
1086
1145
|
},
|
|
1087
1146
|
onClick: disabled ? _ => _ : _ => handleOpenClose(),
|
|
1088
|
-
onMouseEnter: disabled ? _ => _ : handleMouseEnter,
|
|
1089
|
-
onMouseLeave: disabled ? _ => _ : handleMouseLeave,
|
|
1147
|
+
onMouseEnter: disabled ? _ => _ : _ => handleMouseEnter(),
|
|
1148
|
+
onMouseLeave: disabled ? _ => _ : _ => handleMouseLeave(),
|
|
1090
1149
|
className: `${styles$5['select-content-top']}`
|
|
1091
1150
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1092
1151
|
className: `${styles$5['select-content-top-text']}`,
|
|
1093
1152
|
style: {
|
|
1094
1153
|
color: errorMessage ? errorColor ? errorColor : configStyles.SELECT.errorColor : isHover ? selectedHoverColor ? selectedHoverColor : configStyles.SELECT.selectedHoverColor : selectedColor ? selectedColor : configStyles.SELECT.selectedColor
|
|
1095
1154
|
}
|
|
1096
|
-
}, newSelected && newSelected[keyNames.name] ? newSelected[keyNames.name] :
|
|
1155
|
+
}, !multiple && newSelected && newSelected[0] && newSelected[0][keyNames.name] ? newSelected[0][keyNames.name] : newSelected && newSelected.length > 0 ? newSelected.map((_, index) => {
|
|
1156
|
+
if (newSelected[index][keyNames.name]) {
|
|
1157
|
+
if (index > 0) {
|
|
1158
|
+
return ', ' + newSelected[index][keyNames.name];
|
|
1159
|
+
} else {
|
|
1160
|
+
return newSelected[index][keyNames.name];
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}) : defaultOption ? defaultOption : ''), /*#__PURE__*/React.createElement("div", {
|
|
1097
1164
|
className: `${styles$5['select-content-top-icon']}`
|
|
1098
|
-
},
|
|
1165
|
+
}, multiple && newSelected.length > 1 && /*#__PURE__*/React.createElement("span", null, newSelected.length), newSelected && newSelected.length > 0 && /*#__PURE__*/React.createElement("div", {
|
|
1099
1166
|
className: `${styles$5['close-icon']}`,
|
|
1100
|
-
onClick: disabled ? _ => _ : handleClearSelect
|
|
1167
|
+
onClick: disabled ? _ => _ : handleClearSelect,
|
|
1168
|
+
style: {
|
|
1169
|
+
marginLeft: multiple && newSelected.length > 1 ? '17px' : '0px'
|
|
1170
|
+
}
|
|
1101
1171
|
}, closeIcon ? closeIcon : /*#__PURE__*/React.createElement("img", {
|
|
1102
1172
|
src: ReactCloseIcon,
|
|
1103
1173
|
alt: "icon"
|
|
@@ -1114,12 +1184,12 @@ const Select = ({
|
|
|
1114
1184
|
boxShadow: optionsBoxShadow ? optionsBoxShadow : configStyles.SELECT.optionsBoxShadow,
|
|
1115
1185
|
borderRadius: optionsBorderRadius ? optionsBorderRadius : configStyles.SELECT.optionsBorderRadius,
|
|
1116
1186
|
backgroundColor: optionsBackgroundColor ? optionsBackgroundColor : configStyles.SELECT.optionsBackgroundColor,
|
|
1117
|
-
top: parseFloat(
|
|
1187
|
+
top: parseFloat(selectedMinHeight ? selectedMinHeight.substring(0, selectedMinHeight.length - 2) : configStyles.SELECT.selectedMinHeight.substring(0, configStyles.SELECT.selectedMinHeight.length - 2)) + 6 + 'px'
|
|
1118
1188
|
},
|
|
1119
1189
|
className: `${styles$5['select-content-bottom']}`
|
|
1120
1190
|
}, /*#__PURE__*/React.createElement("div", {
|
|
1121
1191
|
className: `${styles$5['select-content-bottom-inner']}`
|
|
1122
|
-
},
|
|
1192
|
+
}, existOptions && existOptions.length > 0 && existOptions.map((option, i) => {
|
|
1123
1193
|
return /*#__PURE__*/React.createElement("div", {
|
|
1124
1194
|
key: i,
|
|
1125
1195
|
disabled: true,
|
|
@@ -1140,7 +1210,9 @@ const Select = ({
|
|
|
1140
1210
|
marginBottom: optionItemMarginBottom ? optionItemMarginBottom : configStyles.SELECT.optionItemMarginBottom,
|
|
1141
1211
|
backgroundColor: optionItemBackgroudColor ? optionItemBackgroudColor : configStyles.SELECT.optionItemBackgroudColor
|
|
1142
1212
|
}
|
|
1143
|
-
},
|
|
1213
|
+
}, multiple && multipleCheckbox ? /*#__PURE__*/React.createElement(SelectCheckbox, {
|
|
1214
|
+
checked: option.checked
|
|
1215
|
+
}) : '', option[keyNames.name]);
|
|
1144
1216
|
}))) : null)), errorMessage ? /*#__PURE__*/React.createElement("span", {
|
|
1145
1217
|
style: {
|
|
1146
1218
|
color: errorColor ? errorColor : configStyles.SELECT.errorColor,
|
|
@@ -1149,17 +1221,19 @@ const Select = ({
|
|
|
1149
1221
|
}, errorMessage) : '');
|
|
1150
1222
|
};
|
|
1151
1223
|
Select.propTypes = {
|
|
1224
|
+
options: PropTypes.array,
|
|
1225
|
+
multiple: PropTypes.bool,
|
|
1152
1226
|
onChange: PropTypes.func,
|
|
1153
1227
|
required: PropTypes.bool,
|
|
1154
1228
|
disabled: PropTypes.bool,
|
|
1155
|
-
selected: PropTypes.
|
|
1156
|
-
jsonData: PropTypes.string,
|
|
1229
|
+
selected: PropTypes.array,
|
|
1157
1230
|
keyNames: PropTypes.object,
|
|
1158
1231
|
className: PropTypes.string,
|
|
1159
1232
|
arrowIcon: PropTypes.element,
|
|
1160
1233
|
closeIcon: PropTypes.element,
|
|
1161
1234
|
errorMessage: PropTypes.string,
|
|
1162
1235
|
defaultOption: PropTypes.string,
|
|
1236
|
+
multipleCheckbox: PropTypes.bool,
|
|
1163
1237
|
label: PropTypes.string,
|
|
1164
1238
|
labelColor: PropTypes.string,
|
|
1165
1239
|
labelWeight: PropTypes.string,
|
|
@@ -1174,7 +1248,7 @@ Select.propTypes = {
|
|
|
1174
1248
|
selectedColor: PropTypes.string,
|
|
1175
1249
|
selectedBorder: PropTypes.string,
|
|
1176
1250
|
selectedRadius: PropTypes.string,
|
|
1177
|
-
|
|
1251
|
+
selectedMinHeight: PropTypes.string,
|
|
1178
1252
|
selectedPadding: PropTypes.string,
|
|
1179
1253
|
selectedFontSize: PropTypes.string,
|
|
1180
1254
|
selectedBoxSizing: PropTypes.string,
|
|
@@ -1695,4 +1769,4 @@ Autocomplate.defaultProps = {
|
|
|
1695
1769
|
required: false
|
|
1696
1770
|
};
|
|
1697
1771
|
|
|
1698
|
-
export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, Pagination, Radio, Select, Stepper, Table, Tooltip, Typography, TypographyType };
|
|
1772
|
+
export { Autocomplate, Button, Captcha, Checkbox, File, Input, InputTypes, Modal, Pagination, Radio, Select, SelectCheckbox, Stepper, Table, Tooltip, Typography, TypographyType };
|