@hexure/ui 1.14.5 → 1.14.7
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 +256 -23
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/CustomSelect/CustomSelect.d.ts +39 -0
- package/dist/cjs/types/components/CustomSelect/index.d.ts +2 -0
- package/dist/cjs/types/components/Select/Select.d.ts +1 -0
- package/dist/esm/index.js +256 -23
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/CustomSelect/CustomSelect.d.ts +39 -0
- package/dist/esm/types/components/CustomSelect/index.d.ts +2 -0
- package/dist/esm/types/components/Select/Select.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- /package/dist/cjs/types/components/{Multiselect → MultiSelect}/MultiSelect.d.ts +0 -0
- /package/dist/cjs/types/components/{Multiselect → MultiSelect}/index.d.ts +0 -0
- /package/dist/esm/types/components/{Multiselect → MultiSelect}/MultiSelect.d.ts +0 -0
- /package/dist/esm/types/components/{Multiselect → MultiSelect}/index.d.ts +0 -0
package/dist/cjs/index.js
CHANGED
|
@@ -2691,7 +2691,7 @@ const q = ({
|
|
|
2691
2691
|
});
|
|
2692
2692
|
});
|
|
2693
2693
|
|
|
2694
|
-
const Wrapper$
|
|
2694
|
+
const Wrapper$i = styled.div(props => ({
|
|
2695
2695
|
display: 'inline-block',
|
|
2696
2696
|
position: 'relative',
|
|
2697
2697
|
height: props.$height || '16px',
|
|
@@ -2739,7 +2739,7 @@ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, d
|
|
|
2739
2739
|
const [show_content, toggleContent] = React.useState(false);
|
|
2740
2740
|
const baseId = dataItemid || `tooltip-${Math.random().toString(36).slice(2, 9)}`;
|
|
2741
2741
|
if (auto) {
|
|
2742
|
-
return (React.createElement(Wrapper$
|
|
2742
|
+
return (React.createElement(Wrapper$i, { "data-itemid": `${baseId}-wrapper` },
|
|
2743
2743
|
React.createElement("style", null, `
|
|
2744
2744
|
.custom-tooltip-arrow {
|
|
2745
2745
|
box-shadow: 1px 1px 0 0 #0193D7; /* top border for arrow (matches border) */
|
|
@@ -2764,7 +2764,7 @@ const Tooltip = ({ children, position = 'right-top', width = '240px', trigger, d
|
|
|
2764
2764
|
React.createElement(TooltipPortal, null,
|
|
2765
2765
|
React.createElement(M, { className: 'custom-tooltip', classNameArrow: 'custom-tooltip-arrow', "data-itemid": `${baseId}-content`, id: `${baseId}-auto-tooltip-data-html`, render: () => React.createElement("p", { "data-itemid": `${baseId}-text` }, children) }))));
|
|
2766
2766
|
}
|
|
2767
|
-
return (React.createElement(Wrapper$
|
|
2767
|
+
return (React.createElement(Wrapper$i, { "$height": height, "data-itemid": `${baseId}-wrapper`, onMouseEnter: toggleContent.bind(null, true), onMouseLeave: toggleContent.bind(null, false) },
|
|
2768
2768
|
trigger || React.createElement(StyledIcon$6, { "data-itemid": `${baseId}-icon`, path: js.mdiInformationOutline }),
|
|
2769
2769
|
show_content ? (React.createElement(Content$3, { "$position": position, "$width": width, "data-itemid": `${baseId}-content` }, children && (React.createElement(Copy, { "data-itemid": `${baseId}-text`, type: 'small' }, children)))) : null));
|
|
2770
2770
|
};
|
|
@@ -2992,7 +2992,7 @@ Heading.defaultProps = {
|
|
|
2992
2992
|
type: 'primary',
|
|
2993
2993
|
};
|
|
2994
2994
|
|
|
2995
|
-
const Wrapper$
|
|
2995
|
+
const Wrapper$h = styled.div `
|
|
2996
2996
|
position: fixed;
|
|
2997
2997
|
top: 0;
|
|
2998
2998
|
right: 0;
|
|
@@ -3017,7 +3017,7 @@ const Buttons$1 = styled.div `
|
|
|
3017
3017
|
const ActionDialog = (_a) => {
|
|
3018
3018
|
var { description, title, primaryButton, secondaryButton, tertiaryButton, style = {}, dataItemid } = _a, accessibleProps = __rest(_a, ["description", "title", "primaryButton", "secondaryButton", "tertiaryButton", "style", "dataItemid"]);
|
|
3019
3019
|
const baseId = dataItemid || 'action-dialog';
|
|
3020
|
-
return (React.createElement(Wrapper$
|
|
3020
|
+
return (React.createElement(Wrapper$h, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
3021
3021
|
React.createElement(Container$5, { "$customStyle": style, "data-itemid": `${baseId}-container`, open: true },
|
|
3022
3022
|
title ? (React.createElement(Heading, { "data-itemid": `${baseId}-title`, margin: '0px 0px 20px 0px', type: 'secondary' }, title)) : null,
|
|
3023
3023
|
description ? (React.createElement(Copy, { align: 'center', "data-itemid": `${baseId}-description` }, description)) : null,
|
|
@@ -3027,7 +3027,7 @@ const ActionDialog = (_a) => {
|
|
|
3027
3027
|
primaryButton ? (React.createElement(Button, Object.assign({}, primaryButton, { "data-itemid": primaryButton.children || `${baseId}-${primaryButton.children}`, dataItemid: primaryButton.children || `${baseId}-${primaryButton.children}`, format: primaryButton.format || 'primary' }))) : null)) : null)));
|
|
3028
3028
|
};
|
|
3029
3029
|
|
|
3030
|
-
const Wrapper$
|
|
3030
|
+
const Wrapper$g = styled.div `
|
|
3031
3031
|
border: 1px solid #f1f1f1;
|
|
3032
3032
|
border-radius: 4px;
|
|
3033
3033
|
border-left-width: 4px;
|
|
@@ -3072,7 +3072,7 @@ const Alert = (_a) => {
|
|
|
3072
3072
|
icon: js.mdiCheckboxMarkedCircleOutline,
|
|
3073
3073
|
},
|
|
3074
3074
|
};
|
|
3075
|
-
return (React.createElement(Wrapper$
|
|
3075
|
+
return (React.createElement(Wrapper$g, Object.assign({}, accessibleProps, { "$small": small, "data-itemid": `${baseId}-wrapper`, style: { borderLeftColor: type_mapping[type].color } }),
|
|
3076
3076
|
React.createElement(StyledIcon$4, { color: type_mapping[type].color, "data-itemid": `${baseId}-icon`, path: type_mapping[type].icon, size: small ? '20px' : '30px' }),
|
|
3077
3077
|
React.createElement("div", { "data-itemid": `${baseId}-content` },
|
|
3078
3078
|
title && !small ? (React.createElement(Heading, { bold: true, "data-itemid": `${baseId}-title`, margin: '2px 0 0 0', type: 'tertiary' }, title)) : null,
|
|
@@ -3157,7 +3157,7 @@ const AppHeader = ({ logoUrl, buttons = [], dataItemid }) => {
|
|
|
3157
3157
|
React.createElement(Buttons, { "data-itemid": `${baseId}-buttons` }, buttons.map((b, i) => (React.createElement(Button, Object.assign({ key: i }, b, { "data-itemid": `${baseId}-button-${i}` })))))));
|
|
3158
3158
|
};
|
|
3159
3159
|
|
|
3160
|
-
const Wrapper$
|
|
3160
|
+
const Wrapper$f = styled.div `
|
|
3161
3161
|
display: inline-block;
|
|
3162
3162
|
border-radius: 4px;
|
|
3163
3163
|
padding: 4px 6px;
|
|
@@ -3194,7 +3194,7 @@ const Remove$1 = styled.div `
|
|
|
3194
3194
|
const Tag = (_a) => {
|
|
3195
3195
|
var { children, color = 'PRIMARY', removable, onClick, dataItemid, rotate, dataSectionName } = _a, accessibleProps = __rest(_a, ["children", "color", "removable", "onClick", "dataItemid", "rotate", "dataSectionName"]);
|
|
3196
3196
|
const baseId = dataItemid || 'tag';
|
|
3197
|
-
return (React.createElement(Wrapper$
|
|
3197
|
+
return (React.createElement(Wrapper$f, Object.assign({ "$color": color, "$removable": removable, "$rotate": rotate, onClick: onClick }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
3198
3198
|
React.createElement(Content$2, { "data-itemid": `${baseId}-content`, "data-section-name": dataSectionName },
|
|
3199
3199
|
React.createElement(Label$4, { "$color": color, "data-itemid": `${baseId}-label` }, children),
|
|
3200
3200
|
removable ? (React.createElement(Remove$1, { "data-itemid": `${baseId}-remove` },
|
|
@@ -3330,7 +3330,7 @@ const AppMenu = ({ menu, isCollapsed, footerTag, defaultWidth = '280px', dataIte
|
|
|
3330
3330
|
}, small: true, type: 'button' }))));
|
|
3331
3331
|
};
|
|
3332
3332
|
|
|
3333
|
-
const Wrapper$
|
|
3333
|
+
const Wrapper$e = styled.div `
|
|
3334
3334
|
border: 1px solid ${props => props.theme.PRIMARY_COLOR.Hex};
|
|
3335
3335
|
border-radius: 8px;
|
|
3336
3336
|
box-sizing: border-box;
|
|
@@ -3339,7 +3339,7 @@ const Wrapper$d = styled.div `
|
|
|
3339
3339
|
justify-content: space-between;
|
|
3340
3340
|
padding: 16px 20px;
|
|
3341
3341
|
`;
|
|
3342
|
-
Wrapper$
|
|
3342
|
+
Wrapper$e.defaultProps = { theme: EditableTheme };
|
|
3343
3343
|
const Left = styled.div `
|
|
3344
3344
|
box-sizing: border-box;
|
|
3345
3345
|
display: flex;
|
|
@@ -3401,7 +3401,7 @@ const ErrorMsg = styled.span `
|
|
|
3401
3401
|
const BulkActionBar = (_a) => {
|
|
3402
3402
|
var { actions = [], errorMsg, onClear, selectedCount = 0, dataItemid } = _a, accessibleProps = __rest(_a, ["actions", "errorMsg", "onClear", "selectedCount", "dataItemid"]);
|
|
3403
3403
|
const baseId = dataItemid || 'bulk-action-bar';
|
|
3404
|
-
return (React.createElement(Wrapper$
|
|
3404
|
+
return (React.createElement(Wrapper$e, Object.assign({}, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
3405
3405
|
React.createElement(Left, { "data-itemid": `${baseId}-left` },
|
|
3406
3406
|
React.createElement(Info$1, { "data-itemid": `${baseId}-info` },
|
|
3407
3407
|
React.createElement(Selected, { "data-itemid": `${baseId}-selected` },
|
|
@@ -3414,7 +3414,7 @@ const BulkActionBar = (_a) => {
|
|
|
3414
3414
|
React.createElement(ErrorMsg, { "data-itemid": `${baseId}-error-msg` }, errorMsg))) : null));
|
|
3415
3415
|
};
|
|
3416
3416
|
|
|
3417
|
-
const Wrapper$
|
|
3417
|
+
const Wrapper$d = styled.div `
|
|
3418
3418
|
background: #fff;
|
|
3419
3419
|
border-radius: 8px;
|
|
3420
3420
|
box-shadow: 0px 10px 30px -15px rgba(0, 0, 0, 0.2);
|
|
@@ -3461,7 +3461,7 @@ Title$1.defaultProps = {
|
|
|
3461
3461
|
const MoreMenu = (_a) => {
|
|
3462
3462
|
var { maxHeight, menuItems = [], dataItemid } = _a, accessibleProps = __rest(_a, ["maxHeight", "menuItems", "dataItemid"]);
|
|
3463
3463
|
const baseId = dataItemid || 'more-menu';
|
|
3464
|
-
return (React.createElement(Wrapper$
|
|
3464
|
+
return (React.createElement(Wrapper$d, Object.assign({ "$maxHeight": maxHeight }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }), menuItems.map((item, i) => {
|
|
3465
3465
|
var _a;
|
|
3466
3466
|
const itemId = `${baseId}`;
|
|
3467
3467
|
return (React.createElement(MenuItem, { className: item === null || item === void 0 ? void 0 : item.className, "data-itemid": `${itemId}-menu-item`, key: i, onClick: item.onClick },
|
|
@@ -3557,7 +3557,7 @@ const ButtonMenu = ({ disabled, label, maxHeight, menuItems, small, position = '
|
|
|
3557
3557
|
showMenu && (React.createElement(StyledMoreMenu, { "$left": menuPosition.left, "$menuWidth": menuWidth, "$top": menuPosition.top, dataItemid: `${baseId}-more-menu`, maxHeight: maxHeight, menuItems: menuItems }))));
|
|
3558
3558
|
};
|
|
3559
3559
|
|
|
3560
|
-
const Wrapper$
|
|
3560
|
+
const Wrapper$c = styled.label `
|
|
3561
3561
|
border-radius: 4px;
|
|
3562
3562
|
padding: 4px 0px 4px 6px;
|
|
3563
3563
|
margin-left: -6px;
|
|
@@ -3573,7 +3573,7 @@ const Wrapper$b = styled.label `
|
|
|
3573
3573
|
background: ${props => `rgba(${props.theme.PRIMARY_COLOR.Rgb}, 0.05)`};
|
|
3574
3574
|
}
|
|
3575
3575
|
`;
|
|
3576
|
-
Wrapper$
|
|
3576
|
+
Wrapper$c.defaultProps = { theme: EditableTheme };
|
|
3577
3577
|
const Input$2 = styled.input `
|
|
3578
3578
|
font-size: 20px;
|
|
3579
3579
|
margin: 0px;
|
|
@@ -3600,7 +3600,7 @@ const Input$2 = styled.input `
|
|
|
3600
3600
|
display: block;
|
|
3601
3601
|
}
|
|
3602
3602
|
`;
|
|
3603
|
-
const getBackgroundColor$
|
|
3603
|
+
const getBackgroundColor$4 = (props) => {
|
|
3604
3604
|
if (props.$isWarningError) {
|
|
3605
3605
|
return '#fcf1c9';
|
|
3606
3606
|
}
|
|
@@ -3611,7 +3611,7 @@ const getBackgroundColor$3 = (props) => {
|
|
|
3611
3611
|
return '#ffffff';
|
|
3612
3612
|
}
|
|
3613
3613
|
};
|
|
3614
|
-
const getBorderColor$
|
|
3614
|
+
const getBorderColor$4 = (props) => {
|
|
3615
3615
|
if (props.$isWarningError) {
|
|
3616
3616
|
return 'Orange';
|
|
3617
3617
|
}
|
|
@@ -3629,8 +3629,8 @@ const Check$1 = styled.span `
|
|
|
3629
3629
|
background-color: #fff;
|
|
3630
3630
|
border-width: 2px;
|
|
3631
3631
|
border-style: solid;
|
|
3632
|
-
border-color: ${props => getBorderColor$
|
|
3633
|
-
background-color: ${props => getBackgroundColor$
|
|
3632
|
+
border-color: ${props => getBorderColor$4(props)};
|
|
3633
|
+
background-color: ${props => getBackgroundColor$4(props)};
|
|
3634
3634
|
box-sizing: border-box;
|
|
3635
3635
|
position: relative;
|
|
3636
3636
|
&:after {
|
|
@@ -3661,7 +3661,7 @@ const Label$3 = styled.span `
|
|
|
3661
3661
|
const Checkbox = (_a) => {
|
|
3662
3662
|
var { children, color, disabled, checked, onChange, invalid, tooltip, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, dataSectionName, isLabelBold = false } = _a, accessibleProps = __rest(_a, ["children", "color", "disabled", "checked", "onChange", "invalid", "tooltip", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "dataSectionName", "isLabelBold"]);
|
|
3663
3663
|
const baseId = dataItemid || 'checkbox';
|
|
3664
|
-
return (React.createElement(Wrapper$
|
|
3664
|
+
return (React.createElement(Wrapper$c, Object.assign({ "$disabled": disabled }, accessibleProps, { "data-itemid": `${baseId}-wrapper` }),
|
|
3665
3665
|
React.createElement(Input$2, { "$invalid": invalid, checked: checked, "data-itemid": `${baseId}-input`, "data-section-name": dataSectionName, disabled: disabled, name: accessibleProps.name, onChange: disabled ? undefined : onChange, tabIndex: disabled ? -1 : tabIndex, type: 'checkbox' }),
|
|
3666
3666
|
React.createElement(Check$1, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "data-itemid": `${baseId}-check` }),
|
|
3667
3667
|
children ? (React.createElement(Label$3, { "$isLabelBold": isLabelBold, color: color, "data-itemid": `${baseId}-label` },
|
|
@@ -3717,6 +3717,233 @@ const Checklist = (_a) => {
|
|
|
3717
3717
|
}))));
|
|
3718
3718
|
};
|
|
3719
3719
|
|
|
3720
|
+
const getBackgroundColor$3 = (props) => {
|
|
3721
|
+
if (props.$isWarningError) {
|
|
3722
|
+
return '#fcf1c9';
|
|
3723
|
+
}
|
|
3724
|
+
else if (props.$invalid && props.$isInvalidRedBackground) {
|
|
3725
|
+
return '#ffe5e5';
|
|
3726
|
+
}
|
|
3727
|
+
else {
|
|
3728
|
+
return props.$readOnly ? '#f5f5f5' : '#ffffff';
|
|
3729
|
+
}
|
|
3730
|
+
};
|
|
3731
|
+
const getBorderColor$3 = (props) => {
|
|
3732
|
+
if (props.$isWarningError) {
|
|
3733
|
+
return 'Orange';
|
|
3734
|
+
}
|
|
3735
|
+
else if (props.$invalid) {
|
|
3736
|
+
return Colors.RED.Hex;
|
|
3737
|
+
}
|
|
3738
|
+
else {
|
|
3739
|
+
return '#cccccc';
|
|
3740
|
+
}
|
|
3741
|
+
};
|
|
3742
|
+
const Wrapper$b = styled.div `
|
|
3743
|
+
border-radius: 4px;
|
|
3744
|
+
height: 40px;
|
|
3745
|
+
background-color: ${props => (props.$readOnly ? '#f5f5f5' : '#ffffff')};
|
|
3746
|
+
position: relative;
|
|
3747
|
+
cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
|
|
3748
|
+
border-width: 1px;
|
|
3749
|
+
border-style: solid;
|
|
3750
|
+
border-color: ${props => getBorderColor$3(props)};
|
|
3751
|
+
background-color: ${props => getBackgroundColor$3(props)};
|
|
3752
|
+
border-radius: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.borderRadius) || '4px'};
|
|
3753
|
+
flex-grow: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.flexGrow) || 0};
|
|
3754
|
+
box-sizing: border-box;
|
|
3755
|
+
padding: 10px 0px;
|
|
3756
|
+
display: flex;
|
|
3757
|
+
align-items: center;
|
|
3758
|
+
width: ${({ $style }) => ($style === null || $style === void 0 ? void 0 : $style.width) || 'auto'};
|
|
3759
|
+
|
|
3760
|
+
&:focus-within {
|
|
3761
|
+
border-color: ${props => (props.$readOnly ? '#cccccc' : props.theme.PRIMARY_COLOR.Hex)};
|
|
3762
|
+
}
|
|
3763
|
+
`;
|
|
3764
|
+
Wrapper$b.defaultProps = { theme: EditableTheme };
|
|
3765
|
+
const Trigger$2 = styled.div `
|
|
3766
|
+
appearance: none;
|
|
3767
|
+
box-shadow: none;
|
|
3768
|
+
outline: none;
|
|
3769
|
+
border: none;
|
|
3770
|
+
color: ${props => (props.$searchableOpen ? 'transparent' : Colors.BLACK.Hex)};
|
|
3771
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3772
|
+
font-weight: 400;
|
|
3773
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3774
|
+
line-height: normal;
|
|
3775
|
+
background-color: transparent;
|
|
3776
|
+
background-image: none;
|
|
3777
|
+
width: 100%;
|
|
3778
|
+
box-sizing: border-box;
|
|
3779
|
+
padding: 0px 30px 0px 10px;
|
|
3780
|
+
box-sizing: border-box;
|
|
3781
|
+
position: relative;
|
|
3782
|
+
z-index: 2;
|
|
3783
|
+
cursor: ${props => (props.$readOnly ? 'default' : 'pointer')};
|
|
3784
|
+
user-select: none;
|
|
3785
|
+
overflow: hidden;
|
|
3786
|
+
text-overflow: ellipsis;
|
|
3787
|
+
white-space: nowrap;
|
|
3788
|
+
`;
|
|
3789
|
+
const IconWrapper$3 = styled(Icon) `
|
|
3790
|
+
position: absolute;
|
|
3791
|
+
right: 9px;
|
|
3792
|
+
z-index: 1;
|
|
3793
|
+
transition: transform 0.2s ease;
|
|
3794
|
+
transform: ${props => (props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)')};
|
|
3795
|
+
pointer-events: none;
|
|
3796
|
+
`;
|
|
3797
|
+
const SearchInput$2 = styled.input `
|
|
3798
|
+
position: absolute;
|
|
3799
|
+
left: 0;
|
|
3800
|
+
top: 0;
|
|
3801
|
+
z-index: 999;
|
|
3802
|
+
width: 100%;
|
|
3803
|
+
height: 100%;
|
|
3804
|
+
border: none;
|
|
3805
|
+
outline: none;
|
|
3806
|
+
background-color: transparent;
|
|
3807
|
+
color: ${Colors.BLACK.Hex};
|
|
3808
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3809
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3810
|
+
font-weight: 400;
|
|
3811
|
+
line-height: normal;
|
|
3812
|
+
padding: 0px 30px 0px 10px;
|
|
3813
|
+
box-sizing: border-box;
|
|
3814
|
+
overflow: hidden;
|
|
3815
|
+
white-space: nowrap;
|
|
3816
|
+
pointer-events: ${props => (props.$isOpen ? 'auto' : 'none')};
|
|
3817
|
+
opacity: ${props => (props.$isOpen ? 1 : 0)};
|
|
3818
|
+
|
|
3819
|
+
&::placeholder {
|
|
3820
|
+
color: #999999;
|
|
3821
|
+
opacity: 1;
|
|
3822
|
+
}
|
|
3823
|
+
`;
|
|
3824
|
+
const DropdownContainer = styled.div `
|
|
3825
|
+
position: absolute;
|
|
3826
|
+
top: 100%;
|
|
3827
|
+
left: 0;
|
|
3828
|
+
right: 0;
|
|
3829
|
+
margin-top: 4px;
|
|
3830
|
+
background: white;
|
|
3831
|
+
border: 1px solid #cccccc;
|
|
3832
|
+
border-radius: 4px;
|
|
3833
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
3834
|
+
max-height: 300px;
|
|
3835
|
+
overflow-y: auto;
|
|
3836
|
+
overflow-x: hidden;
|
|
3837
|
+
z-index: 1000;
|
|
3838
|
+
display: ${props => (props.$isOpen ? 'block' : 'none')};
|
|
3839
|
+
`;
|
|
3840
|
+
const OptionGroupLabel = styled.div `
|
|
3841
|
+
padding: 6px 10px;
|
|
3842
|
+
font-weight: 600;
|
|
3843
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3844
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3845
|
+
color: ${Colors.BLACK.Hex};
|
|
3846
|
+
`;
|
|
3847
|
+
const OptionItem = styled.span `
|
|
3848
|
+
display: block;
|
|
3849
|
+
padding: 8px 10px;
|
|
3850
|
+
padding-left: ${props => (props.$isGrouped ? '20px' : '10px')};
|
|
3851
|
+
font-size: ${FontSizes.DEFAULT};
|
|
3852
|
+
font-family: ${FontStyles.DEFAULT};
|
|
3853
|
+
color: ${props => props.$color || Colors.BLACK.Hex};
|
|
3854
|
+
cursor: ${props => (props.$disabled ? 'not-allowed' : 'pointer')};
|
|
3855
|
+
opacity: ${props => (props.$disabled ? 0.5 : 1)};
|
|
3856
|
+
background-color: ${props => (props.$isSelected ? '#e8f4fd' : 'transparent')};
|
|
3857
|
+
user-select: none;
|
|
3858
|
+
line-height: 1.3em;
|
|
3859
|
+
overflow-x: hidden;
|
|
3860
|
+
margin-right: 5px;
|
|
3861
|
+
|
|
3862
|
+
&:hover {
|
|
3863
|
+
background-color: ${props => (props.$disabled ? 'transparent' : '#f5f5f5')};
|
|
3864
|
+
}
|
|
3865
|
+
`;
|
|
3866
|
+
const CustomSelect = (_a) => {
|
|
3867
|
+
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, innerRef = null } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "innerRef"]);
|
|
3868
|
+
const [searchTerm, setSearchTerm] = React.useState('');
|
|
3869
|
+
const [value, setValue] = React.useState(propValue || '');
|
|
3870
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
3871
|
+
const wrapperRef = React.useRef(null);
|
|
3872
|
+
const baseId = dataItemid || 'custom-select';
|
|
3873
|
+
// Update the value when the prop changes
|
|
3874
|
+
React.useEffect(() => {
|
|
3875
|
+
setValue(propValue || '');
|
|
3876
|
+
}, [propValue]);
|
|
3877
|
+
// Close dropdown when clicking outside
|
|
3878
|
+
React.useEffect(() => {
|
|
3879
|
+
const handleClickOutside = (event) => {
|
|
3880
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
3881
|
+
setIsOpen(false);
|
|
3882
|
+
}
|
|
3883
|
+
};
|
|
3884
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
3885
|
+
return () => {
|
|
3886
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
3887
|
+
};
|
|
3888
|
+
}, []);
|
|
3889
|
+
const handleSearch = (event) => {
|
|
3890
|
+
setSearchTerm(event.target.value);
|
|
3891
|
+
setIsOpen(true);
|
|
3892
|
+
};
|
|
3893
|
+
const handleToggle = () => {
|
|
3894
|
+
if (!readOnly) {
|
|
3895
|
+
setIsOpen(!isOpen);
|
|
3896
|
+
}
|
|
3897
|
+
};
|
|
3898
|
+
const handleOptionClick = (optionValue, disabled) => {
|
|
3899
|
+
if (disabled || readOnly)
|
|
3900
|
+
return;
|
|
3901
|
+
setValue(optionValue.toString());
|
|
3902
|
+
setIsOpen(false);
|
|
3903
|
+
setSearchTerm('');
|
|
3904
|
+
if (onChange) {
|
|
3905
|
+
onChange(optionValue);
|
|
3906
|
+
}
|
|
3907
|
+
};
|
|
3908
|
+
const getSelectedLabel = () => {
|
|
3909
|
+
if (!value || value === '')
|
|
3910
|
+
return placeholder;
|
|
3911
|
+
// Check in options
|
|
3912
|
+
if (options) {
|
|
3913
|
+
const found = options.find(opt => opt.value.toString() === value.toString());
|
|
3914
|
+
if (found)
|
|
3915
|
+
return found.label || found.value;
|
|
3916
|
+
}
|
|
3917
|
+
// Check in optionGroups
|
|
3918
|
+
if (optionGroups) {
|
|
3919
|
+
for (const group of optionGroups) {
|
|
3920
|
+
const found = group.options.find(opt => opt.value.toString() === value.toString());
|
|
3921
|
+
if (found)
|
|
3922
|
+
return found.label || found.value;
|
|
3923
|
+
}
|
|
3924
|
+
}
|
|
3925
|
+
return value;
|
|
3926
|
+
};
|
|
3927
|
+
const filteredOptions = searchable
|
|
3928
|
+
? 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()); })
|
|
3929
|
+
: options;
|
|
3930
|
+
const filteredOptionGroups = searchable
|
|
3931
|
+
? 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()); }) })))
|
|
3932
|
+
: optionGroups;
|
|
3933
|
+
return (React.createElement(Wrapper$b, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "$readOnly": readOnly, "$style": style, "data-itemid": `${baseId}-wrapper`, ref: wrapperRef, style: style },
|
|
3934
|
+
searchable && (React.createElement(SearchInput$2, Object.assign({ "$isOpen": isOpen, autoFocus: isOpen, "data-itemid": `${baseId}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
|
|
3935
|
+
React.createElement(Trigger$2, Object.assign({ "$readOnly": readOnly, "$searchableOpen": searchable && isOpen, "data-itemid": `${baseId}-trigger`, id: `${baseId}-trigger`, onClick: handleToggle, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex }, accessibleProps), getSelectedLabel()),
|
|
3936
|
+
React.createElement(IconWrapper$3, { "$isOpen": isOpen, color: Colors.BLACK.Hex, "data-itemid": `${baseId}-icon`, path: js.mdiChevronDown, size: '22px' }),
|
|
3937
|
+
React.createElement(DropdownContainer, { "$isOpen": isOpen, "data-itemid": `${baseId}-dropdown` },
|
|
3938
|
+
!value && placeholder && (React.createElement(OptionItem, { "$disabled": true, "$isSelected": false, "data-itemid": `${baseId}-placeholder` }, placeholder)),
|
|
3939
|
+
filteredOptionGroups &&
|
|
3940
|
+
filteredOptionGroups.map((group, i) => (React.createElement("div", { "data-itemid": `${baseId}-optgroup-${i}`, key: i },
|
|
3941
|
+
React.createElement(OptionGroupLabel, null, group.label || `Group ${i}`),
|
|
3942
|
+
group.options.map((option, j) => (React.createElement(OptionItem, { "$color": option.color, "$disabled": option.disabled, "$isGrouped": true, "$isSelected": !!(value && value !== '' && value.toString() === option.value.toString()), "data-itemid": `${baseId}-option-${i}-${j}`, key: j, onClick: () => handleOptionClick(option.value, option.disabled) }, option.label || option.value)))))),
|
|
3943
|
+
filteredOptions &&
|
|
3944
|
+
filteredOptions.map((option, i) => (React.createElement(OptionItem, { "$color": option.color, "$disabled": option.disabled, "$isSelected": !!(value && value !== '' && value.toString() === option.value.toString()), "data-itemid": `${baseId}-option-${i}`, key: i, onClick: () => handleOptionClick(option.value, option.disabled) }, option.label || option.value))))));
|
|
3945
|
+
};
|
|
3946
|
+
|
|
3720
3947
|
const getBackgroundColor$2 = (props) => {
|
|
3721
3948
|
if (props.$isWarningError) {
|
|
3722
3949
|
return '#fcf1c9';
|
|
@@ -3804,7 +4031,7 @@ const SearchInput$1 = styled.input `
|
|
|
3804
4031
|
white-space: nowrap;
|
|
3805
4032
|
`;
|
|
3806
4033
|
const Select = (_a) => {
|
|
3807
|
-
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, innerRef = null } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "innerRef"]);
|
|
4034
|
+
var { options, optionGroups, placeholder = '--Select-One--', readOnly, invalid, searchable = false, value: propValue, onChange, style, tabIndex, dataItemid, isInvalidRedBackground = false, isWarningError = false, innerRef = null, isCustomSelect = false } = _a, accessibleProps = __rest(_a, ["options", "optionGroups", "placeholder", "readOnly", "invalid", "searchable", "value", "onChange", "style", "tabIndex", "dataItemid", "isInvalidRedBackground", "isWarningError", "innerRef", "isCustomSelect"]);
|
|
3808
4035
|
const [searchTerm, setSearchTerm] = React.useState('');
|
|
3809
4036
|
const [value, setValue] = React.useState(propValue || '');
|
|
3810
4037
|
const baseId = dataItemid || 'select';
|
|
@@ -3827,6 +4054,9 @@ const Select = (_a) => {
|
|
|
3827
4054
|
const filteredOptionGroups = searchable
|
|
3828
4055
|
? 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()); }) })))
|
|
3829
4056
|
: optionGroups;
|
|
4057
|
+
if (isCustomSelect) {
|
|
4058
|
+
return (React.createElement(CustomSelect, Object.assign({ dataItemid: dataItemid, innerRef: innerRef, invalid: invalid, isInvalidRedBackground: isInvalidRedBackground, isWarningError: isWarningError, onChange: onChange, optionGroups: optionGroups, options: options, placeholder: placeholder, readOnly: readOnly, searchable: searchable, style: style, tabIndex: tabIndex, value: propValue }, accessibleProps)));
|
|
4059
|
+
}
|
|
3830
4060
|
return (React.createElement(Wrapper$a, { "$invalid": invalid, "$isInvalidRedBackground": isInvalidRedBackground, "$isWarningError": isWarningError, "$readOnly": readOnly, "$style": style, "data-itemid": `${baseId}-wrapper`, style: style },
|
|
3831
4061
|
searchable && (React.createElement(SearchInput$1, Object.assign({ "data-itemid": `${baseId}-search-input`, onChange: handleSearch, placeholder: placeholder, tabIndex: readOnly ? -1 : tabIndex, type: 'text', value: searchTerm }, accessibleProps))),
|
|
3832
4062
|
React.createElement(Trigger$1, Object.assign({ "data-itemid": `${baseId}-trigger`, disabled: readOnly, id: `${baseId}-trigger`, name: baseId, onChange: handleChange, placeholder: placeholder, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: value }, accessibleProps),
|
|
@@ -3998,6 +4228,9 @@ const ButtonBarNote = styled.div `
|
|
|
3998
4228
|
display: flex;
|
|
3999
4229
|
gap: 10px;
|
|
4000
4230
|
`;
|
|
4231
|
+
const HeaderWrapper = styled.div `
|
|
4232
|
+
word-break: break-all;
|
|
4233
|
+
`;
|
|
4001
4234
|
const Drawer = (_a) => {
|
|
4002
4235
|
var { children, description, title, onClose, primaryButton, position = 'fixed', secondaryButton, tertiaryButton, scrim = 'dark', width, dataItemid, bottomNotes } = _a, accessibleProps = __rest(_a, ["children", "description", "title", "onClose", "primaryButton", "position", "secondaryButton", "tertiaryButton", "scrim", "width", "dataItemid", "bottomNotes"]);
|
|
4003
4236
|
React.useEffect(() => {
|
|
@@ -4014,7 +4247,7 @@ const Drawer = (_a) => {
|
|
|
4014
4247
|
return (React.createElement(React.Fragment, null,
|
|
4015
4248
|
React.createElement(Container$3, Object.assign({}, accessibleProps, { "$position": position, "$width": width, "data-itemid": `${baseId}-container` }),
|
|
4016
4249
|
React.createElement(Header$2, { "data-itemid": `${baseId}-header` },
|
|
4017
|
-
React.createElement(
|
|
4250
|
+
React.createElement(HeaderWrapper, { "data-itemid": `${baseId}-header-content` },
|
|
4018
4251
|
title ? (React.createElement(Heading, { dataItemid: `${baseId}-title`, type: 'secondary' }, title)) : null,
|
|
4019
4252
|
description ? (React.createElement(Copy, { color: 'GRAY', "data-itemid": `${baseId}-description` }, description)) : null),
|
|
4020
4253
|
React.createElement(Close$1, { "data-itemid": `${baseId}-close`, onClick: onClose },
|