@hexure/ui 1.13.14 → 1.13.16
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/cjs/index.js +206 -201
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/Input/Input.d.ts +2 -23
- package/dist/cjs/types/components/Modal/Modal.d.ts +2 -0
- package/dist/cjs/types/components/Select/Select.d.ts +2 -10
- package/dist/esm/index.js +206 -201
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/Input/Input.d.ts +2 -23
- package/dist/esm/types/components/Modal/Modal.d.ts +2 -0
- package/dist/esm/types/components/Select/Select.d.ts +2 -10
- package/dist/index.d.ts +6 -33
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -738,14 +738,11 @@ const MoreMenu = (_a) => {
|
|
|
738
738
|
};
|
|
739
739
|
|
|
740
740
|
const MenuWrapper = styled.div `
|
|
741
|
-
position: relative;
|
|
741
|
+
position: relative; // Ensure this is relative
|
|
742
742
|
display: inline-block;
|
|
743
743
|
`;
|
|
744
744
|
const StyledMoreMenu = styled(MoreMenu) `
|
|
745
|
-
position: fixed
|
|
746
|
-
top: ${props => props.$top};
|
|
747
|
-
left: ${props => props.$left};
|
|
748
|
-
position: fixed;
|
|
745
|
+
position: absolute; // Changed from fixed to absolute
|
|
749
746
|
top: ${props => props.$top};
|
|
750
747
|
left: ${props => props.$left};
|
|
751
748
|
width: ${props => props.$menuWidth};
|
|
@@ -778,44 +775,44 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
|
|
|
778
775
|
if (showMenu && menuWrapperRef.current) {
|
|
779
776
|
const wrapperRect = menuWrapperRef.current.getBoundingClientRect();
|
|
780
777
|
const menuWidthInt = parseInt(menuWidth, 10);
|
|
781
|
-
let top =
|
|
782
|
-
let left =
|
|
778
|
+
let top = 0;
|
|
779
|
+
let left = 0;
|
|
783
780
|
switch (position) {
|
|
784
781
|
case 'top':
|
|
785
|
-
top =
|
|
786
|
-
left =
|
|
782
|
+
top = -142; // Menu above the wrapper
|
|
783
|
+
left = 0;
|
|
787
784
|
break;
|
|
788
785
|
case 'bottom':
|
|
789
|
-
top = wrapperRect.
|
|
790
|
-
left =
|
|
786
|
+
top = wrapperRect.height; // Menu below the wrapper
|
|
787
|
+
left = 0;
|
|
791
788
|
break;
|
|
792
789
|
case 'left':
|
|
793
|
-
top =
|
|
794
|
-
left =
|
|
790
|
+
top = 0;
|
|
791
|
+
left = -menuWidthInt; // Menu to the left of the wrapper
|
|
795
792
|
break;
|
|
796
793
|
case 'right':
|
|
797
|
-
top =
|
|
798
|
-
left = wrapperRect.
|
|
794
|
+
top = 0;
|
|
795
|
+
left = wrapperRect.width; // Menu to the right of the wrapper
|
|
799
796
|
break;
|
|
800
797
|
case 'bottomLeft':
|
|
801
|
-
top = wrapperRect.
|
|
802
|
-
left = wrapperRect.
|
|
798
|
+
top = wrapperRect.height;
|
|
799
|
+
left = wrapperRect.width - menuWidthInt;
|
|
803
800
|
break;
|
|
804
801
|
case 'bottomRight':
|
|
805
|
-
top = wrapperRect.
|
|
806
|
-
left =
|
|
802
|
+
top = wrapperRect.height;
|
|
803
|
+
left = 0;
|
|
807
804
|
break;
|
|
808
805
|
case 'topRight':
|
|
809
|
-
top =
|
|
810
|
-
left = wrapperRect.
|
|
806
|
+
top = -142;
|
|
807
|
+
left = wrapperRect.width - 24;
|
|
811
808
|
break;
|
|
812
809
|
case 'topLeft':
|
|
813
|
-
top =
|
|
814
|
-
left =
|
|
810
|
+
top = -142;
|
|
811
|
+
left = -188;
|
|
815
812
|
break;
|
|
816
813
|
default:
|
|
817
|
-
top = wrapperRect.
|
|
818
|
-
left =
|
|
814
|
+
top = wrapperRect.height;
|
|
815
|
+
left = 0;
|
|
819
816
|
break;
|
|
820
817
|
}
|
|
821
818
|
setMenuPosition({ top: `${top}px`, left: `${left}px` });
|
|
@@ -1010,102 +1007,96 @@ const Checklist = (_a) => {
|
|
|
1010
1007
|
}))));
|
|
1011
1008
|
};
|
|
1012
1009
|
|
|
1013
|
-
const Wrapper$a = styled.div `
|
|
1014
|
-
border-radius: 4px;
|
|
1015
|
-
height: 40px;
|
|
1016
|
-
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
1017
|
-
position: relative;
|
|
1018
|
-
cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
|
|
1019
|
-
border-width: 1px;
|
|
1020
|
-
border-style: solid;
|
|
1021
|
-
border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
|
|
1022
|
-
border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
|
|
1023
|
-
flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
|
|
1024
|
-
box-sizing: border-box;
|
|
1025
|
-
padding: 10px 0px;
|
|
1026
|
-
display: flex;
|
|
1027
|
-
align-items: center;
|
|
1028
|
-
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1029
|
-
|
|
1030
|
-
&:focus-within {
|
|
1031
|
-
border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
|
|
1032
|
-
}
|
|
1010
|
+
const Wrapper$a = styled.div `
|
|
1011
|
+
border-radius: 4px;
|
|
1012
|
+
height: 40px;
|
|
1013
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
1014
|
+
position: relative;
|
|
1015
|
+
cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
|
|
1016
|
+
border-width: 1px;
|
|
1017
|
+
border-style: solid;
|
|
1018
|
+
border-color: ${props => (props.$invalid ? Colors.RED.Hex : '#cccccc')};
|
|
1019
|
+
border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
|
|
1020
|
+
flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
|
|
1021
|
+
box-sizing: border-box;
|
|
1022
|
+
padding: 10px 0px;
|
|
1023
|
+
display: flex;
|
|
1024
|
+
align-items: center;
|
|
1025
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
1026
|
+
|
|
1027
|
+
&:focus-within {
|
|
1028
|
+
border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
|
|
1029
|
+
}
|
|
1033
1030
|
`;
|
|
1034
1031
|
Wrapper$a.defaultProps = { theme: EditableTheme };
|
|
1035
|
-
const Trigger$1 = styled.select `
|
|
1036
|
-
appearance: none;
|
|
1037
|
-
box-shadow: none;
|
|
1038
|
-
outline: none;
|
|
1039
|
-
border: none;
|
|
1040
|
-
color: ${Colors.BLACK.Hex};
|
|
1041
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1042
|
-
font-weight: 400;
|
|
1043
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1044
|
-
line-height: 2.9em;
|
|
1045
|
-
background-color: transparent;
|
|
1046
|
-
background-image: none;
|
|
1047
|
-
width: 100%;
|
|
1048
|
-
box-sizing: border-box;
|
|
1049
|
-
padding: 0px 30px 0px 10px;
|
|
1050
|
-
box-sizing: border-box;
|
|
1051
|
-
position: relative;
|
|
1052
|
-
z-index: 2;
|
|
1032
|
+
const Trigger$1 = styled.select `
|
|
1033
|
+
appearance: none;
|
|
1034
|
+
box-shadow: none;
|
|
1035
|
+
outline: none;
|
|
1036
|
+
border: none;
|
|
1037
|
+
color: ${Colors.BLACK.Hex};
|
|
1038
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1039
|
+
font-weight: 400;
|
|
1040
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1041
|
+
line-height: 2.9em;
|
|
1042
|
+
background-color: transparent;
|
|
1043
|
+
background-image: none;
|
|
1044
|
+
width: 100%;
|
|
1045
|
+
box-sizing: border-box;
|
|
1046
|
+
padding: 0px 30px 0px 10px;
|
|
1047
|
+
box-sizing: border-box;
|
|
1048
|
+
position: relative;
|
|
1049
|
+
z-index: 2;
|
|
1053
1050
|
`;
|
|
1054
|
-
const IconWrapper$2 = styled(Icon) `
|
|
1055
|
-
position: absolute;
|
|
1056
|
-
right: 9px;
|
|
1057
|
-
z-index: 1;
|
|
1051
|
+
const IconWrapper$2 = styled(Icon) `
|
|
1052
|
+
position: absolute;
|
|
1053
|
+
right: 9px;
|
|
1054
|
+
z-index: 1;
|
|
1058
1055
|
`;
|
|
1059
|
-
const SearchInput$1 = styled.input `
|
|
1060
|
-
position: absolute;
|
|
1061
|
-
left: 2px;
|
|
1062
|
-
top: 2px;
|
|
1063
|
-
z-index: 999;
|
|
1064
|
-
width: 90%;
|
|
1065
|
-
height: 30px;
|
|
1066
|
-
border: none;
|
|
1067
|
-
outline: none;
|
|
1068
|
-
color: ${Colors.BLACK.Hex};
|
|
1069
|
-
font-family: ${FontStyles.DEFAULT};
|
|
1070
|
-
font-size: ${FontSizes.DEFAULT};
|
|
1071
|
-
font-weight: 400;
|
|
1072
|
-
line-height: 2.9em;
|
|
1073
|
-
overflow: hidden;
|
|
1074
|
-
white-space: nowrap;
|
|
1056
|
+
const SearchInput$1 = styled.input `
|
|
1057
|
+
position: absolute;
|
|
1058
|
+
left: 2px;
|
|
1059
|
+
top: 2px;
|
|
1060
|
+
z-index: 999;
|
|
1061
|
+
width: 90%;
|
|
1062
|
+
height: 30px;
|
|
1063
|
+
border: none;
|
|
1064
|
+
outline: none;
|
|
1065
|
+
color: ${Colors.BLACK.Hex};
|
|
1066
|
+
font-family: ${FontStyles.DEFAULT};
|
|
1067
|
+
font-size: ${FontSizes.DEFAULT};
|
|
1068
|
+
font-weight: 400;
|
|
1069
|
+
line-height: 2.9em;
|
|
1070
|
+
overflow: hidden;
|
|
1071
|
+
white-space: nowrap;
|
|
1075
1072
|
`;
|
|
1076
1073
|
const Select = (_a) => {
|
|
1077
|
-
var { options, optionGroups, placeholder, readOnly, invalid, searchable = false, value, onChange, style } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style"]);
|
|
1074
|
+
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style"]);
|
|
1078
1075
|
const [searchTerm, setSearchTerm] = React.useState('');
|
|
1076
|
+
const [value, setValue] = React.useState(propValue || '');
|
|
1079
1077
|
const handleSearch = (event) => {
|
|
1080
1078
|
setSearchTerm(event.target.value);
|
|
1081
1079
|
};
|
|
1082
|
-
const
|
|
1083
|
-
|
|
1080
|
+
const handleChange = (event) => {
|
|
1081
|
+
setValue(event.target.value);
|
|
1082
|
+
if (onChange) {
|
|
1083
|
+
onChange(event);
|
|
1084
|
+
}
|
|
1085
|
+
};
|
|
1086
|
+
const filteredOptions = searchable
|
|
1087
|
+
? options === null || options === void 0 ? void 0 : options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); })
|
|
1088
|
+
: options;
|
|
1089
|
+
const filteredOptionGroups = searchable
|
|
1090
|
+
? optionGroups === null || optionGroups === void 0 ? void 0 : optionGroups.map(group => (Object.assign(Object.assign({}, group), { options: group.options.filter(option => { var _a; return (_a = option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(searchTerm.toLowerCase()); }) })))
|
|
1091
|
+
: optionGroups;
|
|
1084
1092
|
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$readOnly": readOnly, "$style": style },
|
|
1085
|
-
searchable && (React.createElement(SearchInput$1, Object.assign({ onChange: handleSearch, placeholder:
|
|
1086
|
-
|
|
1087
|
-
placeholder
|
|
1093
|
+
searchable && (React.createElement(SearchInput$1, Object.assign({ onChange: handleSearch, placeholder: placeholder, type: 'text', value: searchTerm }, accessibleProps))),
|
|
1094
|
+
React.createElement(Trigger$1, Object.assign({ disabled: readOnly, onChange: handleChange, placeholder: placeholder, value: value }, accessibleProps),
|
|
1095
|
+
placeholder && !value && (React.createElement("option", { disabled: true, value: '' }, placeholder)),
|
|
1088
1096
|
filteredOptionGroups &&
|
|
1089
|
-
filteredOptionGroups.map((group, i) => {
|
|
1090
|
-
return (React.createElement("optgroup", { key: i, label: group.label || `Group ${i}` }, group.options.map((option, i) => {
|
|
1091
|
-
return (option.label && (React.createElement("option", { key: i, style: { color: option.color }, value: option.value }, option.label || option.value)));
|
|
1092
|
-
})));
|
|
1093
|
-
}),
|
|
1097
|
+
filteredOptionGroups.map((group, i) => (React.createElement("optgroup", { key: i, label: group.label || `Group ${i}` }, group.options.map((option, i) => (React.createElement("option", { key: i, style: { color: option.color }, value: option.value }, option.label || option.value)))))),
|
|
1094
1098
|
filteredOptions &&
|
|
1095
|
-
filteredOptions.map((option, i) => {
|
|
1096
|
-
return (option.label && (React.createElement("option", { key: i, style: { color: option.color }, value: option.value }, option.label || option.value)));
|
|
1097
|
-
}))) : (React.createElement(Trigger$1, Object.assign({ disabled: readOnly, onChange: onChange, placeholder: placeholder, value: value }, accessibleProps),
|
|
1098
|
-
placeholder ? (React.createElement("option", { disabled: true, value: '' }, placeholder)) : null,
|
|
1099
|
-
optionGroups &&
|
|
1100
|
-
optionGroups.map((group, i) => {
|
|
1101
|
-
return (React.createElement("optgroup", { key: i, label: group.label || `Group ${i}` }, group.options.map((option, i) => {
|
|
1102
|
-
return (React.createElement("option", { key: i, value: option.value }, option.label || option.value));
|
|
1103
|
-
})));
|
|
1104
|
-
}),
|
|
1105
|
-
options &&
|
|
1106
|
-
options.map((option, i) => {
|
|
1107
|
-
return (React.createElement("option", { key: i, value: option.value }, option.label || option.value));
|
|
1108
|
-
}))),
|
|
1099
|
+
filteredOptions.map((option, i) => (React.createElement("option", { key: i, style: { color: option.color }, value: option.value }, option.label || option.value)))),
|
|
1109
1100
|
React.createElement(IconWrapper$2, { color: Colors.BLACK.Hex, path: js.mdiChevronDown, size: '22px' })));
|
|
1110
1101
|
};
|
|
1111
1102
|
|
|
@@ -1684,7 +1675,7 @@ const StyledTextArea = styled.textarea `
|
|
|
1684
1675
|
margin: 0px;
|
|
1685
1676
|
text-indent: 0px;
|
|
1686
1677
|
--webkit-appearance: none;
|
|
1687
|
-
|
|
1678
|
+
overflow-wrap: break-word;
|
|
1688
1679
|
box-sizing: border-box;
|
|
1689
1680
|
display: block;
|
|
1690
1681
|
width: 100%;
|
|
@@ -1711,7 +1702,7 @@ const StyledSuffix = styled.div `
|
|
|
1711
1702
|
font-style: normal;
|
|
1712
1703
|
font-weight: 400;
|
|
1713
1704
|
font-size: ${FontSizes.DEFAULT};
|
|
1714
|
-
color: Colors.BLACK.Hex;
|
|
1705
|
+
color: ${Colors.BLACK.Hex};
|
|
1715
1706
|
`;
|
|
1716
1707
|
const StyledWrapper = styled.div `
|
|
1717
1708
|
display: flex;
|
|
@@ -1740,7 +1731,7 @@ const SuggestedValues = styled.div `
|
|
|
1740
1731
|
position: absolute;
|
|
1741
1732
|
right: -1px;
|
|
1742
1733
|
top: 39px;
|
|
1743
|
-
z-index:
|
|
1734
|
+
z-index: 9999;
|
|
1744
1735
|
max-height: 220px;
|
|
1745
1736
|
overflow: auto;
|
|
1746
1737
|
`;
|
|
@@ -1758,7 +1749,6 @@ const SuggestedSummary = styled.div `
|
|
|
1758
1749
|
position: sticky;
|
|
1759
1750
|
top: 0px;
|
|
1760
1751
|
`;
|
|
1761
|
-
//styles for textarea
|
|
1762
1752
|
const SuggestedValue = styled.div `
|
|
1763
1753
|
cursor: pointer;
|
|
1764
1754
|
padding: 8px 12px;
|
|
@@ -1789,6 +1779,8 @@ const Input$1 = (_a) => {
|
|
|
1789
1779
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1790
1780
|
onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, type = 'text', value = '' } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "type", "value"]);
|
|
1791
1781
|
const [show_options, setShowOptions] = React.useState(false);
|
|
1782
|
+
const [internalValue, setInternalValue] = React.useState(value);
|
|
1783
|
+
const [internalSuggestedValues, setInternalSuggestedValues] = React.useState(suggestedValues || []);
|
|
1792
1784
|
const formatCurrencyDecimal = (value) => {
|
|
1793
1785
|
const parts = value.toString().split('.');
|
|
1794
1786
|
const integerPart = parts[0];
|
|
@@ -1797,47 +1789,55 @@ const Input$1 = (_a) => {
|
|
|
1797
1789
|
return `${formattedIntegerPart}${decimalPart}`;
|
|
1798
1790
|
};
|
|
1799
1791
|
const handleInputChange = (e) => {
|
|
1792
|
+
const newValue = e.target.value;
|
|
1800
1793
|
if (format === 'currency' || format === 'currency_decimal') {
|
|
1801
|
-
e.target.value =
|
|
1794
|
+
e.target.value = newValue.replace(/[^0-9.]/g, '');
|
|
1802
1795
|
}
|
|
1803
1796
|
if (format === 'phone') {
|
|
1804
|
-
e.target.value =
|
|
1797
|
+
e.target.value = newValue.replace(/[^0-9.]/g, '').substring(0, 10);
|
|
1805
1798
|
}
|
|
1806
1799
|
if (format === 'ssn') {
|
|
1807
|
-
e.target.value =
|
|
1800
|
+
e.target.value = newValue.replace(/[^0-9]/g, '').substring(0, 9);
|
|
1808
1801
|
}
|
|
1809
1802
|
if (type === 'email') {
|
|
1810
|
-
e.target.value =
|
|
1803
|
+
e.target.value = newValue.toLowerCase();
|
|
1811
1804
|
}
|
|
1812
|
-
if (type === 'number' && max && parseInt(
|
|
1805
|
+
if (type === 'number' && max && parseInt(newValue, 10) > parseInt(max, 10)) {
|
|
1813
1806
|
e.target.value = `${max}`;
|
|
1814
1807
|
}
|
|
1815
|
-
|
|
1808
|
+
setInternalValue(e.target.value);
|
|
1809
|
+
if (onChange)
|
|
1816
1810
|
onChange(e);
|
|
1811
|
+
if (newValue === null || newValue === void 0 ? void 0 : newValue.length) {
|
|
1812
|
+
const newSuggestions = (suggestedValues || []).filter(s => s.toLowerCase().includes(newValue.toLowerCase()));
|
|
1813
|
+
setInternalSuggestedValues(newSuggestions);
|
|
1814
|
+
}
|
|
1815
|
+
else {
|
|
1816
|
+
setInternalSuggestedValues(suggestedValues || []);
|
|
1817
|
+
}
|
|
1817
1818
|
};
|
|
1818
|
-
let formatted_value =
|
|
1819
|
+
let formatted_value = internalValue;
|
|
1819
1820
|
if (format === 'phone') {
|
|
1820
|
-
formatted_value = formatAsPhone(
|
|
1821
|
+
formatted_value = formatAsPhone(internalValue);
|
|
1821
1822
|
}
|
|
1822
1823
|
if (format === 'currency') {
|
|
1823
|
-
if (`${
|
|
1824
|
-
formatted_value = Numeral(
|
|
1824
|
+
if (`${internalValue}`.length) {
|
|
1825
|
+
formatted_value = Numeral(internalValue).format('$0,0');
|
|
1825
1826
|
}
|
|
1826
1827
|
}
|
|
1827
1828
|
if (format === 'currency_decimal') {
|
|
1828
1829
|
formatted_value = formatCurrencyDecimal(formatted_value);
|
|
1830
|
+
formatted_value = formatCurrencyDecimal(formatted_value);
|
|
1829
1831
|
}
|
|
1830
1832
|
if (format === 'ssn' && type !== 'password') {
|
|
1831
|
-
formatted_value = formatAsSsn(
|
|
1833
|
+
formatted_value = formatAsSsn(internalValue);
|
|
1832
1834
|
}
|
|
1833
|
-
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!
|
|
1835
|
+
return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length },
|
|
1834
1836
|
React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, maxLength: maxLength, onBlur: readOnly
|
|
1835
1837
|
? e => e.preventDefault()
|
|
1836
1838
|
: e => {
|
|
1837
1839
|
if (onBlur)
|
|
1838
1840
|
onBlur(e);
|
|
1839
|
-
// The blur was causing issues with the suggested select event
|
|
1840
|
-
// This makes sure the select if fired before the blur
|
|
1841
1841
|
setTimeout(() => {
|
|
1842
1842
|
setShowOptions(false);
|
|
1843
1843
|
}, 100);
|
|
@@ -1851,15 +1851,13 @@ const Input$1 = (_a) => {
|
|
|
1851
1851
|
loading ? (React.createElement(Loader$1, null,
|
|
1852
1852
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1853
1853
|
showCharCount ? (React.createElement(CharacterCount, null,
|
|
1854
|
-
|
|
1855
|
-
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!
|
|
1854
|
+
internalValue.length,
|
|
1855
|
+
maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length },
|
|
1856
1856
|
React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, max: max, maxLength: maxLength, min: min, onBlur: readOnly
|
|
1857
1857
|
? e => e.preventDefault()
|
|
1858
1858
|
: e => {
|
|
1859
1859
|
if (onBlur)
|
|
1860
1860
|
onBlur(e);
|
|
1861
|
-
// The blur was causing issues with the suggested select event
|
|
1862
|
-
// This makes sure the select if fired before the blur
|
|
1863
1861
|
setTimeout(() => {
|
|
1864
1862
|
setShowOptions(false);
|
|
1865
1863
|
}, 100);
|
|
@@ -1869,22 +1867,22 @@ const Input$1 = (_a) => {
|
|
|
1869
1867
|
setShowOptions(true);
|
|
1870
1868
|
if (onFocus)
|
|
1871
1869
|
onFocus(e);
|
|
1872
|
-
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, step: step, type: type, value: format === 'currency_decimal' &&
|
|
1870
|
+
}, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, step: step, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps)),
|
|
1873
1871
|
loading ? (React.createElement(Loader$1, null,
|
|
1874
1872
|
React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: js.mdiLoading, size: '20px', spin: true }))) : null,
|
|
1875
1873
|
showCharCount ? (React.createElement(CharacterCount, null,
|
|
1876
|
-
|
|
1874
|
+
internalValue.length,
|
|
1877
1875
|
maxLength ? ` / ${maxLength}` : null)) : null,
|
|
1878
1876
|
suffix && React.createElement(StyledSuffix, null, suffix),
|
|
1879
|
-
show_options &&
|
|
1877
|
+
show_options && internalSuggestedValues.length ? (React.createElement(SuggestedValues, null,
|
|
1880
1878
|
React.createElement(SuggestedSummary, null,
|
|
1881
|
-
|
|
1879
|
+
internalSuggestedValues.length,
|
|
1882
1880
|
" Results Match \"",
|
|
1883
|
-
|
|
1881
|
+
internalValue,
|
|
1884
1882
|
"\""),
|
|
1885
|
-
|
|
1883
|
+
internalSuggestedValues.map((suggestedValue, index) => (React.createElement(SuggestedValue, { key: index, onClick: () => {
|
|
1886
1884
|
handleInputChange({ target: { value: suggestedValue } });
|
|
1887
|
-
onSuggestedSelect(
|
|
1885
|
+
onSuggestedSelect();
|
|
1888
1886
|
setShowOptions(false);
|
|
1889
1887
|
} }, suggestedValue))))) : null));
|
|
1890
1888
|
};
|
|
@@ -2002,76 +2000,76 @@ const ProgressBar = ({ steps, showStepLine = false }) => {
|
|
|
2002
2000
|
})));
|
|
2003
2001
|
};
|
|
2004
2002
|
|
|
2005
|
-
const Wrapper$6 = styled.div `
|
|
2006
|
-
position: fixed;
|
|
2007
|
-
top: 0;
|
|
2008
|
-
right: 0;
|
|
2009
|
-
bottom: 0;
|
|
2010
|
-
left: 0;
|
|
2011
|
-
z-index: 9999;
|
|
2012
|
-
background: rgba(0, 0, 0, 0.8);
|
|
2013
|
-
display: flex;
|
|
2014
|
-
align-items: center;
|
|
2015
|
-
justify-content: center;
|
|
2003
|
+
const Wrapper$6 = styled.div `
|
|
2004
|
+
position: fixed;
|
|
2005
|
+
top: 0;
|
|
2006
|
+
right: 0;
|
|
2007
|
+
bottom: 0;
|
|
2008
|
+
left: 0;
|
|
2009
|
+
z-index: 9999;
|
|
2010
|
+
background: rgba(0, 0, 0, 0.8);
|
|
2011
|
+
display: flex;
|
|
2012
|
+
align-items: center;
|
|
2013
|
+
justify-content: center;
|
|
2016
2014
|
`;
|
|
2017
|
-
const Container$1 = styled.dialog `
|
|
2018
|
-
width: ${props => (props.$fullscreen ? 'calc(100vw - 80px)' : props.$maxWidth || '900px')};
|
|
2019
|
-
max-width: calc(100vw - 80px);
|
|
2020
|
-
height: ${props => (props.$fullscreen ? 'calc(100vh - 80px)' : 'auto')};
|
|
2021
|
-
max-height: calc(100vh - 80px);
|
|
2022
|
-
border-radius: 8px;
|
|
2023
|
-
overflow: hidden;
|
|
2024
|
-
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2025
|
-
outline: none;
|
|
2026
|
-
border: none;
|
|
2027
|
-
position: relative;
|
|
2028
|
-
padding: 0px;
|
|
2029
|
-
box-sizing: border-box;
|
|
2030
|
-
display: flex;
|
|
2031
|
-
flex-direction: column;
|
|
2015
|
+
const Container$1 = styled.dialog `
|
|
2016
|
+
width: ${props => (props.$fullscreen ? 'calc(100vw - 80px)' : props.$maxWidth || '900px')};
|
|
2017
|
+
max-width: calc(100vw - 80px);
|
|
2018
|
+
height: ${props => (props.$fullscreen ? 'calc(100vh - 80px)' : 'auto')};
|
|
2019
|
+
max-height: calc(100vh - 80px);
|
|
2020
|
+
border-radius: 8px;
|
|
2021
|
+
overflow: hidden;
|
|
2022
|
+
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
2023
|
+
outline: none;
|
|
2024
|
+
border: none;
|
|
2025
|
+
position: relative;
|
|
2026
|
+
padding: 0px;
|
|
2027
|
+
box-sizing: border-box;
|
|
2028
|
+
display: flex;
|
|
2029
|
+
flex-direction: column;
|
|
2032
2030
|
`;
|
|
2033
|
-
const Header$1 = styled.div `
|
|
2034
|
-
flex-shrink: 0;
|
|
2035
|
-
padding: 20px;
|
|
2036
|
-
border-bottom: 1px solid #e7e6e6;
|
|
2037
|
-
display: flex;
|
|
2038
|
-
align-items: center;
|
|
2039
|
-
background: #ffffff;
|
|
2040
|
-
box-sizing: border-box;
|
|
2031
|
+
const Header$1 = styled.div `
|
|
2032
|
+
flex-shrink: 0;
|
|
2033
|
+
padding: 20px;
|
|
2034
|
+
border-bottom: 1px solid #e7e6e6;
|
|
2035
|
+
display: flex;
|
|
2036
|
+
align-items: center;
|
|
2037
|
+
background: #ffffff;
|
|
2038
|
+
box-sizing: border-box;
|
|
2041
2039
|
`;
|
|
2042
|
-
const Close = styled.div `
|
|
2043
|
-
margin-left: auto;
|
|
2044
|
-
display: flex;
|
|
2045
|
-
align-items: center;
|
|
2046
|
-
padding-left: 20px;
|
|
2047
|
-
cursor: pointer;
|
|
2040
|
+
const Close = styled.div `
|
|
2041
|
+
margin-left: auto;
|
|
2042
|
+
display: flex;
|
|
2043
|
+
align-items: center;
|
|
2044
|
+
padding-left: 20px;
|
|
2045
|
+
cursor: pointer;
|
|
2048
2046
|
`;
|
|
2049
|
-
const CloseMsg = styled.span `
|
|
2050
|
-
font-size: ${FontSizes.SMALL};
|
|
2051
|
-
font-weight: 400;
|
|
2052
|
-
font-family: ${FontStyles.DEFAULT};
|
|
2053
|
-
line-height: 1em;
|
|
2054
|
-
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
2047
|
+
const CloseMsg = styled.span `
|
|
2048
|
+
font-size: ${FontSizes.SMALL};
|
|
2049
|
+
font-weight: 400;
|
|
2050
|
+
font-family: ${FontStyles.DEFAULT};
|
|
2051
|
+
line-height: 1em;
|
|
2052
|
+
color: ${Colors.MEDIUM_GRAY.Hex};
|
|
2055
2053
|
`;
|
|
2056
|
-
const ContentWrapper = styled.div `
|
|
2057
|
-
overflow-x: hidden;
|
|
2058
|
-
overflow-y: auto;
|
|
2059
|
-
background: #ffffff;
|
|
2060
|
-
flex: 1;
|
|
2061
|
-
box-sizing: border-box;
|
|
2054
|
+
const ContentWrapper = styled.div `
|
|
2055
|
+
overflow-x: hidden;
|
|
2056
|
+
overflow-y: auto;
|
|
2057
|
+
background: #ffffff;
|
|
2058
|
+
flex: 1;
|
|
2059
|
+
box-sizing: border-box;
|
|
2062
2060
|
`;
|
|
2063
|
-
const ButtonBar = styled.div `
|
|
2064
|
-
flex-shrink: 0;
|
|
2065
|
-
background: #ffffff;
|
|
2066
|
-
padding: 20px;
|
|
2067
|
-
border-top: 1px solid #e7e6e6;
|
|
2068
|
-
display: flex;
|
|
2069
|
-
align-items: center;
|
|
2070
|
-
justify-self: flex-end;
|
|
2071
|
-
box-sizing: border-box;
|
|
2061
|
+
const ButtonBar = styled.div `
|
|
2062
|
+
flex-shrink: 0;
|
|
2063
|
+
background: #ffffff;
|
|
2064
|
+
padding: 20px;
|
|
2065
|
+
border-top: 1px solid #e7e6e6;
|
|
2066
|
+
display: flex;
|
|
2067
|
+
align-items: center;
|
|
2068
|
+
justify-self: flex-end;
|
|
2069
|
+
box-sizing: border-box;
|
|
2072
2070
|
`;
|
|
2073
2071
|
const Modal = (_a) => {
|
|
2074
|
-
var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton"]);
|
|
2072
|
+
var { children, title, onClose, maxWidth, fullscreen, steps, primaryButton, secondaryButton, tertiaryButton, quarternaryButton } = _a, accessibleProps = __rest(_a, ["children", "title", "onClose", "maxWidth", "fullscreen", "steps", "primaryButton", "secondaryButton", "tertiaryButton", "quarternaryButton"]);
|
|
2075
2073
|
React.useEffect(() => {
|
|
2076
2074
|
document.onkeydown = e => {
|
|
2077
2075
|
if (e.key === 'Escape') {
|
|
@@ -2091,8 +2089,15 @@ const Modal = (_a) => {
|
|
|
2091
2089
|
React.createElement(Icon, { color: Colors.BLACK.Hex, path: js.mdiClose, size: '24px' }))),
|
|
2092
2090
|
steps ? React.createElement(ProgressBar, { steps: steps }) : null,
|
|
2093
2091
|
React.createElement(ContentWrapper, null, children),
|
|
2094
|
-
primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar, null,
|
|
2095
|
-
tertiaryButton ? React.createElement(
|
|
2092
|
+
primaryButton || secondaryButton || tertiaryButton || quarternaryButton ? (React.createElement(ButtonBar, null,
|
|
2093
|
+
tertiaryButton || quarternaryButton ? (React.createElement("div", { style: {
|
|
2094
|
+
marginRight: 'auto',
|
|
2095
|
+
paddingRight: 40,
|
|
2096
|
+
display: 'flex',
|
|
2097
|
+
alignItems: 'center',
|
|
2098
|
+
} },
|
|
2099
|
+
tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { format: tertiaryButton.format || 'secondary' }))) : null,
|
|
2100
|
+
quarternaryButton ? (React.createElement(Button, Object.assign({}, quarternaryButton, { format: quarternaryButton.format || 'secondary' }))) : null)) : null,
|
|
2096
2101
|
primaryButton || secondaryButton ? (React.createElement("div", { style: {
|
|
2097
2102
|
marginLeft: 'auto',
|
|
2098
2103
|
paddingLeft: 40,
|