@czi-sds/components 18.1.1 → 19.0.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/dist/index.cjs.d.ts +174 -113
- package/dist/index.cjs.js +461 -241
- package/dist/index.esm.d.ts +174 -113
- package/dist/index.esm.js +461 -244
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -88,7 +88,7 @@ var FontWeight;
|
|
|
88
88
|
(function (FontWeight) {
|
|
89
89
|
FontWeight[FontWeight["bold"] = 700] = "bold";
|
|
90
90
|
FontWeight[FontWeight["light"] = 300] = "light";
|
|
91
|
-
FontWeight[FontWeight["medium"] =
|
|
91
|
+
FontWeight[FontWeight["medium"] = 500] = "medium";
|
|
92
92
|
FontWeight[FontWeight["regular"] = 400] = "regular";
|
|
93
93
|
FontWeight[FontWeight["semibold"] = 600] = "semibold";
|
|
94
94
|
})(FontWeight || (FontWeight = {}));
|
|
@@ -563,7 +563,7 @@ var fontCaps = function (fontSize) {
|
|
|
563
563
|
if (!typography)
|
|
564
564
|
return null;
|
|
565
565
|
var caps = typography.styles.caps;
|
|
566
|
-
return react.css(templateObject_1$
|
|
566
|
+
return react.css(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n ", "\n text-transform: uppercase;\n "], ["\n ", "\n text-transform: uppercase;\n "])), themeToCss(caps[fontSize]));
|
|
567
567
|
};
|
|
568
568
|
};
|
|
569
569
|
var fontCapsXxs = fontCaps("xxs");
|
|
@@ -587,15 +587,15 @@ var fontHeaderXs = fontHeader("xs");
|
|
|
587
587
|
var fontHeaderXxs = fontHeader("xxs");
|
|
588
588
|
var fontHeaderXxxs = fontHeader("xxxs");
|
|
589
589
|
function themeToCss(fontTheme) {
|
|
590
|
-
return react.css(templateObject_2$
|
|
590
|
+
return react.css(templateObject_2$B || (templateObject_2$B = __makeTemplateObject(["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", ";\n font-weight: ", ";\n text-transform: ", ";\n "], ["\n font-size: ", "px;\n line-height: ", ";\n letter-spacing: ", ";\n font-weight: ", ";\n text-transform: ", ";\n "])), fontTheme.fontSize, fontTheme.lineHeight, fontTheme.letterSpacing, fontTheme.fontWeight, fontTheme.textTransform);
|
|
591
591
|
}
|
|
592
|
-
var templateObject_1$
|
|
592
|
+
var templateObject_1$U, templateObject_2$B;
|
|
593
593
|
|
|
594
|
-
var StyledAccordionDetails = styles.styled(material.AccordionDetails)(templateObject_2$
|
|
594
|
+
var StyledAccordionDetails = styles.styled(material.AccordionDetails)(templateObject_2$A || (templateObject_2$A = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyS$2, function (props) {
|
|
595
595
|
var spaces = getSpaces(props);
|
|
596
|
-
return react.css(templateObject_1$
|
|
596
|
+
return react.css(templateObject_1$T || (templateObject_1$T = __makeTemplateObject(["\n padding: ", "px;\n padding-top: ", "px;\n "], ["\n padding: ", "px;\n padding-top: ", "px;\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.m, spaces === null || spaces === void 0 ? void 0 : spaces.xxs);
|
|
597
597
|
});
|
|
598
|
-
var templateObject_1$
|
|
598
|
+
var templateObject_1$T, templateObject_2$A;
|
|
599
599
|
|
|
600
600
|
var AccordionDetails = function (props) {
|
|
601
601
|
var children = props.children;
|
|
@@ -3088,30 +3088,30 @@ function iconSize(props) {
|
|
|
3088
3088
|
var _a, _b;
|
|
3089
3089
|
var sdsSize = props.sdsSize;
|
|
3090
3090
|
var iconSizes = getIconSizes(props);
|
|
3091
|
-
return react.css(templateObject_1$
|
|
3091
|
+
return react.css(templateObject_1$S || (templateObject_1$S = __makeTemplateObject(["\n height: ", "px;\n width: ", "px;\n "], ["\n height: ", "px;\n width: ", "px;\n "])), (_a = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes[sdsSize]) === null || _a === void 0 ? void 0 : _a.height, (_b = iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes[sdsSize]) === null || _b === void 0 ? void 0 : _b.width);
|
|
3092
3092
|
}
|
|
3093
3093
|
function buttonStyle() {
|
|
3094
|
-
return react.css(templateObject_2$
|
|
3094
|
+
return react.css(templateObject_2$z || (templateObject_2$z = __makeTemplateObject(["\n color: inherit;\n "], ["\n color: inherit;\n "])));
|
|
3095
3095
|
}
|
|
3096
3096
|
function staticStyle(props) {
|
|
3097
3097
|
var _a = props.iconColor, iconColor = _a === void 0 ? "primary" : _a, _b = props.shade, shade = _b === void 0 ? 400 : _b;
|
|
3098
3098
|
var colors = getColors(props);
|
|
3099
|
-
return react.css(templateObject_3$
|
|
3099
|
+
return react.css(templateObject_3$q || (templateObject_3$q = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), colors === null || colors === void 0 ? void 0 : colors[iconColor][shade]);
|
|
3100
3100
|
}
|
|
3101
3101
|
function interactive(props) {
|
|
3102
3102
|
var colors = getColors(props);
|
|
3103
3103
|
var _a = props.iconColor, iconColor = _a === void 0 ? "primary" : _a, _b = props.shade, shade = _b === void 0 ? 400 : _b;
|
|
3104
|
-
return react.css(templateObject_4$
|
|
3104
|
+
return react.css(templateObject_4$k || (templateObject_4$k = __makeTemplateObject(["\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n\n &:disabled {\n color: ", ";\n }\n "], ["\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n\n &:disabled {\n color: ", ";\n }\n "])), colors === null || colors === void 0 ? void 0 : colors.gray[500], colors === null || colors === void 0 ? void 0 : colors.gray[600], colors === null || colors === void 0 ? void 0 : colors[iconColor][shade], colors === null || colors === void 0 ? void 0 : colors.gray[300]);
|
|
3105
3105
|
}
|
|
3106
|
-
var doNotForwardProps$
|
|
3106
|
+
var doNotForwardProps$n = ["sdsIcon", "sdsSize", "sdsType", "iconColor"];
|
|
3107
3107
|
var StyledSvgIcon = styles.styled(material.SvgIcon, {
|
|
3108
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
3108
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$n.includes(prop); },
|
|
3109
3109
|
})(templateObject_6$c || (templateObject_6$c = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3110
3110
|
var sdsType = props.sdsType;
|
|
3111
3111
|
return react.css(templateObject_5$f || (templateObject_5$f = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n "])), sdsType !== "iconButton" && iconSize(props), sdsType === "static" && staticStyle(props), sdsType === "interactive" && interactive(props), sdsType === "button" && buttonStyle());
|
|
3112
3112
|
});
|
|
3113
3113
|
var StyledIcon = styles.styled("div")(templateObject_7$9 || (templateObject_7$9 = __makeTemplateObject(["\n /* display: contents causes an element's children to appear as if they were direct children of the element's parent, ignoring the element itself. This can be useful when a wrapper element should be ignored when using CSS grid or similar layout techniques. */\n display: contents;\n"], ["\n /* display: contents causes an element's children to appear as if they were direct children of the element's parent, ignoring the element itself. This can be useful when a wrapper element should be ignored when using CSS grid or similar layout techniques. */\n display: contents;\n"])));
|
|
3114
|
-
var templateObject_1$
|
|
3114
|
+
var templateObject_1$S, templateObject_2$z, templateObject_3$q, templateObject_4$k, templateObject_5$f, templateObject_6$c, templateObject_7$9;
|
|
3115
3115
|
|
|
3116
3116
|
/**
|
|
3117
3117
|
* @see https://mui.com/material-ui/icons/#icons
|
|
@@ -3132,16 +3132,16 @@ var Icon = React.forwardRef(function Icon(_a, ref) {
|
|
|
3132
3132
|
return null;
|
|
3133
3133
|
});
|
|
3134
3134
|
|
|
3135
|
-
var StyledAccordionHeader = styles.styled(material.AccordionSummary)(templateObject_2$
|
|
3135
|
+
var StyledAccordionHeader = styles.styled(material.AccordionSummary)(templateObject_2$y || (templateObject_2$y = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontHeaderS, function (props) {
|
|
3136
3136
|
var spaces = getSpaces(props);
|
|
3137
3137
|
var colors = getColors(props);
|
|
3138
|
-
return react.css(templateObject_1$
|
|
3138
|
+
return react.css(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n padding: ", "px;\n min-height: 40px;\n align-items: flex-start;\n box-sizing: border-box;\n\n &.Mui-expanded {\n min-height: 40px;\n }\n\n .MuiAccordionSummary-content {\n margin: 0;\n flex-direction: column;\n\n &.Mui-expanded {\n margin: 0;\n }\n }\n\n .MuiAccordionSummary-expandIconWrapper {\n padding: 0px;\n margin-right: 0;\n margin-left: ", "px;\n svg {\n color: ", ";\n }\n }\n "], ["\n padding: ", "px;\n min-height: 40px;\n align-items: flex-start;\n box-sizing: border-box;\n\n &.Mui-expanded {\n min-height: 40px;\n }\n\n .MuiAccordionSummary-content {\n margin: 0;\n flex-direction: column;\n\n &.Mui-expanded {\n margin: 0;\n }\n }\n\n .MuiAccordionSummary-expandIconWrapper {\n padding: 0px;\n margin-right: 0;\n margin-left: ", "px;\n svg {\n color: ", ";\n }\n }\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.m, spaces === null || spaces === void 0 ? void 0 : spaces.m, colors === null || colors === void 0 ? void 0 : colors.gray[500]);
|
|
3139
3139
|
});
|
|
3140
|
-
var StyledSubtitle = styles.styled("p")(templateObject_4$
|
|
3140
|
+
var StyledSubtitle = styles.styled("p")(templateObject_4$j || (templateObject_4$j = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyXxs$1, function (props) {
|
|
3141
3141
|
var colors = getColors(props);
|
|
3142
|
-
return react.css(templateObject_3$
|
|
3142
|
+
return react.css(templateObject_3$p || (templateObject_3$p = __makeTemplateObject(["\n color: ", ";\n margin: 0;\n "], ["\n color: ", ";\n margin: 0;\n "])), colors === null || colors === void 0 ? void 0 : colors.gray[500]);
|
|
3143
3143
|
});
|
|
3144
|
-
var templateObject_1$
|
|
3144
|
+
var templateObject_1$R, templateObject_2$y, templateObject_3$p, templateObject_4$j;
|
|
3145
3145
|
|
|
3146
3146
|
var AccordionHeader = function (props) {
|
|
3147
3147
|
var children = props.children, id = props.id, subtitle = props.subtitle;
|
|
@@ -3153,18 +3153,18 @@ var StyledAccordion = styles.styled(material.Accordion, {
|
|
|
3153
3153
|
shouldForwardProp: function (prop) {
|
|
3154
3154
|
return !sdsPropNames$5.includes(prop.toString());
|
|
3155
3155
|
},
|
|
3156
|
-
})(templateObject_2$
|
|
3156
|
+
})(templateObject_2$x || (templateObject_2$x = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3157
3157
|
var useDivider = props.useDivider, togglePosition = props.togglePosition;
|
|
3158
3158
|
var shadows = getShadows(props);
|
|
3159
3159
|
var typography = getTypography(props);
|
|
3160
3160
|
var border = getBorders(props);
|
|
3161
|
-
return react.css(templateObject_1$
|
|
3161
|
+
return react.css(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n &.MuiAccordion-root {\n box-shadow: ", ";\n font-family: ", ";\n border-bottom: ", ";\n height: fit-content;\n\n & .MuiAccordionSummary-root {\n padding: 10px;\n min-height: 40px;\n\n &.Mui-expanded {\n min-height: unset;\n }\n\n & .MuiAccordionSummary-expandIcon,\n & .MuiAccordionSummary-expandIconWrapper {\n padding: 0;\n align-self: flex-start;\n }\n }\n\n .MuiAccordionDetails-root {\n padding: 10px;\n padding-top: 4px;\n }\n\n &:before {\n opacity: 0;\n }\n\n &.Mui-expanded {\n margin: 0;\n }\n ", "\n }\n "], ["\n &.MuiAccordion-root {\n box-shadow: ", ";\n font-family: ", ";\n border-bottom: ", ";\n height: fit-content;\n\n & .MuiAccordionSummary-root {\n padding: 10px;\n min-height: 40px;\n\n &.Mui-expanded {\n min-height: unset;\n }\n\n & .MuiAccordionSummary-expandIcon,\n & .MuiAccordionSummary-expandIconWrapper {\n padding: 0;\n align-self: flex-start;\n }\n }\n\n .MuiAccordionDetails-root {\n padding: 10px;\n padding-top: 4px;\n }\n\n &:before {\n opacity: 0;\n }\n\n &.Mui-expanded {\n margin: 0;\n }\n ", "\n }\n "])), shadows === null || shadows === void 0 ? void 0 : shadows.none, typography === null || typography === void 0 ? void 0 : typography.fontFamily, useDivider ? border === null || border === void 0 ? void 0 : border.gray[300] : "none", togglePosition === "left" && leftPosition(props));
|
|
3162
3162
|
});
|
|
3163
3163
|
var leftPosition = function (props) {
|
|
3164
3164
|
var spaces = getSpaces(props);
|
|
3165
|
-
return react.css(templateObject_3$
|
|
3165
|
+
return react.css(templateObject_3$o || (templateObject_3$o = __makeTemplateObject(["\n &.MuiAccordion-root {\n & .MuiAccordionSummary-root {\n flex-direction: row-reverse;\n\n .MuiAccordionSummary-content {\n padding-left: ", "px;\n }\n\n .MuiAccordionSummary-expandIconWrapper {\n margin: 0;\n transform: rotate(-90deg);\n align-self: flex-start;\n margin-top: ", "px;\n\n &.Mui-expanded {\n transform: rotate(0deg);\n }\n }\n }\n\n & .MuiAccordionDetails-root {\n padding-left: 30px;\n }\n }\n "], ["\n &.MuiAccordion-root {\n & .MuiAccordionSummary-root {\n flex-direction: row-reverse;\n\n .MuiAccordionSummary-content {\n padding-left: ", "px;\n }\n\n .MuiAccordionSummary-expandIconWrapper {\n margin: 0;\n transform: rotate(-90deg);\n align-self: flex-start;\n margin-top: ", "px;\n\n &.Mui-expanded {\n transform: rotate(0deg);\n }\n }\n }\n\n & .MuiAccordionDetails-root {\n padding-left: 30px;\n }\n }\n "])), spaces === null || spaces === void 0 ? void 0 : spaces.xs, spaces === null || spaces === void 0 ? void 0 : spaces.xxs);
|
|
3166
3166
|
};
|
|
3167
|
-
var templateObject_1$
|
|
3167
|
+
var templateObject_1$Q, templateObject_2$x, templateObject_3$o;
|
|
3168
3168
|
|
|
3169
3169
|
/**
|
|
3170
3170
|
* @see https://mui.com/material-ui/react-accordion/
|
|
@@ -3180,7 +3180,7 @@ var Accordion = React.forwardRef(function (props, ref) {
|
|
|
3180
3180
|
return (jsxRuntime.jsx(StyledAccordion, __assign({ square: true, useDivider: useDivider, togglePosition: togglePosition, expanded: expanded === id, onChange: handleChange(id), ref: ref }, props, { children: children })));
|
|
3181
3181
|
});
|
|
3182
3182
|
|
|
3183
|
-
var StyledAlert = styles.styled(material.Alert)(templateObject_1$
|
|
3183
|
+
var StyledAlert = styles.styled(material.Alert)(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3184
3184
|
var colors = getColors(props);
|
|
3185
3185
|
var spacings = getSpaces(props);
|
|
3186
3186
|
var shadows = getShadows(props);
|
|
@@ -3191,7 +3191,7 @@ var StyledAlert = styles.styled(material.Alert)(templateObject_1$N || (templateO
|
|
|
3191
3191
|
var backgroundColor = colors && colors[severity][100];
|
|
3192
3192
|
return "\n background-color: ".concat(backgroundColor, ";\n margin: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px 0;\n color: ").concat(defaultTheme.palette.text.primary, ";\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px\n ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px 9px;\n background-color: ").concat(alertColor, ";\n &.elevated {\n border-left: 5px solid;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.s, ";\n border-color: ").concat(borderColor, ";\n }\n .MuiAlert-icon {\n path {\n fill: ").concat(iconColor, ";\n }\n }\n ");
|
|
3193
3193
|
});
|
|
3194
|
-
var templateObject_1$
|
|
3194
|
+
var templateObject_1$P;
|
|
3195
3195
|
|
|
3196
3196
|
/**
|
|
3197
3197
|
* @see https://mui.com/material-ui/react-alert/
|
|
@@ -3204,6 +3204,7 @@ var noop = function () { };
|
|
|
3204
3204
|
var toKebabCase = function (str) {
|
|
3205
3205
|
return str.replace(/[\s_]+/g, "-").toLowerCase();
|
|
3206
3206
|
};
|
|
3207
|
+
var EMPTY_OBJECT = {};
|
|
3207
3208
|
|
|
3208
3209
|
var _a;
|
|
3209
3210
|
var SDSWarningTypes;
|
|
@@ -3265,23 +3266,23 @@ var showWarningIfFirstOccurence = function (warningType) {
|
|
|
3265
3266
|
var isOn = function (props) {
|
|
3266
3267
|
var sdsType = props.sdsType;
|
|
3267
3268
|
var colors = getColors(props);
|
|
3268
|
-
return react.css(templateObject_1$
|
|
3269
|
+
return react.css(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n ", "\n "], ["\n ", "\n "])), sdsType !== "tertiary" &&
|
|
3269
3270
|
"\n color: ".concat(sdsType === "primary" ? colors === null || colors === void 0 ? void 0 : colors.primary[600] : colors === null || colors === void 0 ? void 0 : colors.primary[400], ";\n\n &:hover {\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.primary[600], ";\n }\n "));
|
|
3270
3271
|
};
|
|
3271
3272
|
var isDisabled$1 = function (props) {
|
|
3272
3273
|
var colors = getColors(props);
|
|
3273
|
-
return react.css(templateObject_2$
|
|
3274
|
+
return react.css(templateObject_2$w || (templateObject_2$w = __makeTemplateObject(["\n color: ", ";\n "], ["\n color: ", ";\n "])), colors === null || colors === void 0 ? void 0 : colors.gray[300]);
|
|
3274
3275
|
};
|
|
3275
3276
|
var primary$2 = function (props) {
|
|
3276
3277
|
var colors = getColors(props);
|
|
3277
3278
|
var sdsSize = props.sdsSize;
|
|
3278
|
-
return react.css(templateObject_3$
|
|
3279
|
+
return react.css(templateObject_3$n || (templateObject_3$n = __makeTemplateObject(["\n color: ", ";\n\n &:hover {\n background: ", ";\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n "], ["\n color: ", ";\n\n &:hover {\n background: ", ";\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n "])), colors === null || colors === void 0 ? void 0 : colors.primary[400], colors === null || colors === void 0 ? void 0 : colors.gray[200], sdsSize === "small"
|
|
3279
3280
|
? colors === null || colors === void 0 ? void 0 : colors.primary[600]
|
|
3280
3281
|
: colors === null || colors === void 0 ? void 0 : colors.primary[400], colors === null || colors === void 0 ? void 0 : colors.primary[600]);
|
|
3281
3282
|
};
|
|
3282
3283
|
var secondary$2 = function (props) {
|
|
3283
3284
|
var colors = getColors(props);
|
|
3284
|
-
return react.css(templateObject_4$
|
|
3285
|
+
return react.css(templateObject_4$i || (templateObject_4$i = __makeTemplateObject(["\n color: ", ";\n\n &:hover,\n &:active {\n background: none;\n color: ", ";\n }\n "], ["\n color: ", ";\n\n &:hover,\n &:active {\n background: none;\n color: ", ";\n }\n "])), colors === null || colors === void 0 ? void 0 : colors.gray[500], colors === null || colors === void 0 ? void 0 : colors.primary[400]);
|
|
3285
3286
|
};
|
|
3286
3287
|
var tertiary = function (props) {
|
|
3287
3288
|
var colors = getColors(props);
|
|
@@ -3304,7 +3305,7 @@ var large = function (props) {
|
|
|
3304
3305
|
var iconSizes = getIconSizes(props);
|
|
3305
3306
|
return react.css(templateObject_8$6 || (templateObject_8$6 = __makeTemplateObject(["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "], ["\n .MuiSvgIcon-root {\n height: ", "px;\n width: ", "px;\n ", "\n }\n "])), iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xl.height, iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xl.height, sdsType === "primary" ? "margin: 5px;" : "");
|
|
3306
3307
|
};
|
|
3307
|
-
var doNotForwardProps$
|
|
3308
|
+
var doNotForwardProps$m = [
|
|
3308
3309
|
"on",
|
|
3309
3310
|
"sdsSize",
|
|
3310
3311
|
"sdsType",
|
|
@@ -3312,12 +3313,12 @@ var doNotForwardProps$k = [
|
|
|
3312
3313
|
"sdsIconProps",
|
|
3313
3314
|
];
|
|
3314
3315
|
var StyledButtonIcon$2 = styles.styled(material.IconButton, {
|
|
3315
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
3316
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$m.includes(prop); },
|
|
3316
3317
|
})(templateObject_10$1 || (templateObject_10$1 = __makeTemplateObject(["\n padding: 0;\n\n :focus-visible {\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n ", "\n"], ["\n padding: 0;\n\n :focus-visible {\n outline: 5px auto Highlight;\n outline: 5px auto -webkit-focus-ring-color;\n }\n\n ", "\n"])), function (props) {
|
|
3317
3318
|
var on = props.on, disabled = props.disabled, sdsSize = props.sdsSize, sdsType = props.sdsType;
|
|
3318
3319
|
return react.css(templateObject_9$3 || (templateObject_9$3 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), sdsType === "primary" && primary$2(props), sdsType === "secondary" && secondary$2(props), sdsType === "tertiary" && tertiary(props), on && isOn(props), disabled && isDisabled$1(props), sdsSize === "small" && small$1(props), sdsSize === "medium" && medium$1(props), sdsSize === "large" && large(props));
|
|
3319
3320
|
});
|
|
3320
|
-
var templateObject_1$
|
|
3321
|
+
var templateObject_1$O, templateObject_2$w, templateObject_3$n, templateObject_4$i, templateObject_5$e, templateObject_6$b, templateObject_7$8, templateObject_8$6, templateObject_9$3, templateObject_10$1;
|
|
3321
3322
|
|
|
3322
3323
|
var ButtonIconSizeToSdsIconSize = {
|
|
3323
3324
|
large: "xl",
|
|
@@ -3337,17 +3338,17 @@ var sdsPropNames$4 = ["sdsStyle", "sdsStage", "intent", "handleSubmit"];
|
|
|
3337
3338
|
var rounded$3 = function (props) {
|
|
3338
3339
|
var corners = getCorners(props);
|
|
3339
3340
|
var borders = getBorders(props);
|
|
3340
|
-
return react.css(templateObject_1$
|
|
3341
|
+
return react.css(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n .", " .", " {\n border-radius: ", "px;\n border: ", ";\n }\n "], ["\n .", " .", " {\n border-radius: ", "px;\n border: ", ";\n }\n "])), material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, corners === null || corners === void 0 ? void 0 : corners.l, borders === null || borders === void 0 ? void 0 : borders.gray[400]);
|
|
3341
3342
|
};
|
|
3342
3343
|
var error$3 = function (props) {
|
|
3343
3344
|
var borders = getBorders(props);
|
|
3344
3345
|
var colors = getColors(props);
|
|
3345
|
-
return react.css(templateObject_2$
|
|
3346
|
+
return react.css(templateObject_2$v || (templateObject_2$v = __makeTemplateObject(["\n .", " .", " {\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", ".", " {\n .", " {\n border: ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n "], ["\n .", " .", " {\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", ".", " {\n .", " {\n border: ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n "])), material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.error[400], material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.error[400], material.outlinedInputClasses.root, material.outlinedInputClasses.focused, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.error[400], material.inputAdornmentClasses.root, material.buttonBaseClasses.root, colors === null || colors === void 0 ? void 0 : colors.gray[500]);
|
|
3346
3347
|
};
|
|
3347
3348
|
var warning$3 = function (props) {
|
|
3348
3349
|
var borders = getBorders(props);
|
|
3349
3350
|
var colors = getColors(props);
|
|
3350
|
-
return react.css(templateObject_3$
|
|
3351
|
+
return react.css(templateObject_3$m || (templateObject_3$m = __makeTemplateObject(["\n .", " .", " {\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", ".", " {\n .", " {\n border: ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n "], ["\n .", " .", " {\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", ".", " {\n .", " {\n border: ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n "])), material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.warning[400], material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.warning[400], material.outlinedInputClasses.root, material.outlinedInputClasses.focused, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.warning[400], material.inputAdornmentClasses.root, material.buttonBaseClasses.root, colors === null || colors === void 0 ? void 0 : colors.gray[500]);
|
|
3351
3352
|
};
|
|
3352
3353
|
var userInput$2 = function (props) {
|
|
3353
3354
|
var intent = props.intent;
|
|
@@ -3359,7 +3360,7 @@ var userInput$2 = function (props) {
|
|
|
3359
3360
|
? borders === null || borders === void 0 ? void 0 : borders.warning[400]
|
|
3360
3361
|
: borders === null || borders === void 0 ? void 0 : borders.primary[400];
|
|
3361
3362
|
var color = intent === "default" ? colors === null || colors === void 0 ? void 0 : colors.primary[400] : colors === null || colors === void 0 ? void 0 : colors.gray[500];
|
|
3362
|
-
return react.css(templateObject_4$
|
|
3363
|
+
return react.css(templateObject_4$h || (templateObject_4$h = __makeTemplateObject(["\n .", " .", " {\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", " svg {\n color: ", ";\n }\n "], ["\n .", " .", " {\n border: ", ";\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", " svg {\n color: ", ";\n }\n "])), material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, border, material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, border, material.inputAdornmentClasses.root, color);
|
|
3363
3364
|
};
|
|
3364
3365
|
var disabledStyled$2 = function (props) {
|
|
3365
3366
|
var borders = getBorders(props);
|
|
@@ -3383,10 +3384,10 @@ var StyledSearchBase = styles.styled(material.TextField, {
|
|
|
3383
3384
|
return react.css(templateObject_7$7 || (templateObject_7$7 = __makeTemplateObject(["\n margin-top: ", "px;\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 120px;\n display: block;\n\n [type=\"search\"]::-webkit-search-cancel-button {\n -webkit-appearance: none;\n appearance: none;\n }\n\n & .input-search-clear-icon {\n opacity: 0;\n margin-right: ", "px;\n }\n\n .", " {\n .", " {\n border: ", ";\n }\n\n &:hover .input-search-clear-icon,\n &:focus-within .input-search-clear-icon {\n opacity: ", ";\n }\n }\n\n .", " {\n padding: ", "px ", "px;\n height: 34px;\n box-sizing: border-box;\n background-color: #fff;\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", ".", " {\n .", " {\n border: ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n margin-top: ", "px;\n margin-bottom: ", "px;\n margin-right: ", "px;\n min-width: 120px;\n display: block;\n\n [type=\"search\"]::-webkit-search-cancel-button {\n -webkit-appearance: none;\n appearance: none;\n }\n\n & .input-search-clear-icon {\n opacity: 0;\n margin-right: ", "px;\n }\n\n .", " {\n .", " {\n border: ", ";\n }\n\n &:hover .input-search-clear-icon,\n &:focus-within .input-search-clear-icon {\n opacity: ", ";\n }\n }\n\n .", " {\n padding: ", "px ", "px;\n height: 34px;\n box-sizing: border-box;\n background-color: #fff;\n }\n\n .", ":hover\n .", " {\n border: ", ";\n }\n\n .", ".", " {\n .", " {\n border: ", ";\n }\n\n .", " .", ":last-of-type {\n cursor: default;\n svg {\n color: ", ";\n }\n }\n }\n\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), spacings === null || spacings === void 0 ? void 0 : spacings.m, spacings === null || spacings === void 0 ? void 0 : spacings.m, spacings === null || spacings === void 0 ? void 0 : spacings.xl, spacings === null || spacings === void 0 ? void 0 : spacings.s, material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.gray[400], value ? 1 : 0, material.inputBaseClasses.inputSizeSmall, spacings === null || spacings === void 0 ? void 0 : spacings.xs, spacings === null || spacings === void 0 ? void 0 : spacings.l, material.outlinedInputClasses.root, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.gray[500], material.outlinedInputClasses.root, material.outlinedInputClasses.focused, material.outlinedInputClasses.notchedOutline, borders === null || borders === void 0 ? void 0 : borders.primary[400], material.inputAdornmentClasses.root, material.buttonBaseClasses.root, colors === null || colors === void 0 ? void 0 : colors.primary[400], sdsStyle === "rounded" && rounded$3(props), intent === "error" && error$3(props), intent === "warning" && warning$3(props), disabled && disabledStyled$2(props), sdsStage === "userInput" && userInput$2(props));
|
|
3384
3385
|
});
|
|
3385
3386
|
var StyledInputAdornment = styles.styled(material.InputAdornment)(templateObject_9$2 || (templateObject_9$2 = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
3386
|
-
var templateObject_1$
|
|
3387
|
+
var templateObject_1$N, templateObject_2$v, templateObject_3$m, templateObject_4$h, templateObject_5$d, templateObject_6$a, templateObject_7$7, templateObject_8$5, templateObject_9$2;
|
|
3387
3388
|
|
|
3388
3389
|
var fontBodyXs$4 = fontBody("xs");
|
|
3389
|
-
var StyledMenuItem$1 = styles.styled(material.MenuItem)(templateObject_1$
|
|
3390
|
+
var StyledMenuItem$1 = styles.styled(material.MenuItem)(templateObject_1$M || (templateObject_1$M = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3390
3391
|
var selected = props.selected;
|
|
3391
3392
|
var colors = getColors(props);
|
|
3392
3393
|
var fontWeights = getFontWeights(props);
|
|
@@ -3394,7 +3395,7 @@ var StyledMenuItem$1 = styles.styled(material.MenuItem)(templateObject_1$K || (t
|
|
|
3394
3395
|
var primary = colors === null || colors === void 0 ? void 0 : colors.primary[400];
|
|
3395
3396
|
return "\n padding: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px !important;\n min-height: unset;\n opacity: 1;\n\n &.MuiAutocomplete-option {\n min-height: unset;\n }\n \n .primary-text {\n font-weight: ").concat(selected ? fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.semibold : fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.regular, ";\n }\n\n &.MuiButtonBase-root {\n background-color: transparent;\n opacity: 1;\n\n &:hover, &.").concat(material.menuItemClasses.focusVisible, " {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[100], ";\n\n &[aria-selected=\"true\"] {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[100], ";\n }\n }\n }\n\n &.MuiMenuItem-root .MuiSvgIcon-root {\n align-self: flex-start;\n }\n\n &.MuiMenuItem-root .Mui-disabled {\n opacity: 1 !important;\n }\n\n &.MuiAutocomplete-option[aria-selected=\"true\"] {\n &:hover {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[100], " !important;\n }\n\n svg.check-icon {\n color: ").concat(selected ? primary : colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n }\n }\n\n &.MuiAutocomplete-option[aria-disabled=\"true\"] {\n opacity: 1;\n }\n\n &:hover {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[100], ";\n svg.check-icon {\n color: ").concat(selected ? primary : colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n }\n }\n\n &.Mui-selected.MuiListItem-root.MuiListItem-button {\n background-color: white;\n &:hover {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[100], ";\n }\n .primary-text {\n font-weight: ").concat(fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.semibold, ";\n }\n }\n\n &:active {\n svg.check-icon {\n color: ").concat(primary, ";\n }\n\n &:active {\n svg.check-icon {\n color: ").concat(primary, ";\n }\n\n .primary-text {\n font-weight: ").concat(fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.semibold, ";\n }\n }\n }\n ");
|
|
3396
3397
|
});
|
|
3397
|
-
var ContentWrapper = styles.styled("span")(templateObject_2$
|
|
3398
|
+
var ContentWrapper = styles.styled("span")(templateObject_2$u || (templateObject_2$u = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n width: 100%;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n width: 100%;\n"])));
|
|
3398
3399
|
var disabledStyles = function (props) {
|
|
3399
3400
|
var disabled = props.disabled;
|
|
3400
3401
|
if (!disabled)
|
|
@@ -3402,12 +3403,12 @@ var disabledStyles = function (props) {
|
|
|
3402
3403
|
var colors = getColors(props);
|
|
3403
3404
|
return "\n color: ".concat(colors === null || colors === void 0 ? void 0 : colors.gray[300], ";\n cursor: default;\n ");
|
|
3404
3405
|
};
|
|
3405
|
-
var TextWrapper = styles.styled("span")(templateObject_3$
|
|
3406
|
+
var TextWrapper = styles.styled("span")(templateObject_3$l || (templateObject_3$l = __makeTemplateObject(["\n ", "\n\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n\n ", "\n"])), fontBodyXs$4, function (props) {
|
|
3406
3407
|
var _a;
|
|
3407
3408
|
var palette = getPalette(props);
|
|
3408
3409
|
return "\n color: ".concat((_a = palette === null || palette === void 0 ? void 0 : palette.text) === null || _a === void 0 ? void 0 : _a.primary, ";\n display: flex;\n white-space: pre-wrap;\n ");
|
|
3409
3410
|
}, disabledStyles);
|
|
3410
|
-
var StyledMenuItemIcon = styles.styled("span")(templateObject_4$
|
|
3411
|
+
var StyledMenuItemIcon = styles.styled("span")(templateObject_4$g || (templateObject_4$g = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3411
3412
|
var disabled = props.disabled;
|
|
3412
3413
|
var spacings = getSpaces(props);
|
|
3413
3414
|
var iconSizes = getIconSizes(props);
|
|
@@ -3439,7 +3440,7 @@ var StyledMinus = styles.styled(iconsMaterial.Remove, {
|
|
|
3439
3440
|
var selectedColor = disabled ? colors === null || colors === void 0 ? void 0 : colors.gray[300] : colors === null || colors === void 0 ? void 0 : colors.primary[400];
|
|
3440
3441
|
return "\n color: ".concat(selected ? selectedColor : "transparent", ";\n padding: 0;\n height: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.height, "px;\n width: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.s.width, "px;\n\n &.MuiCheckbox-colorPrimary.Mui-checked:hover {\n background-color: transparent;\n }\n ");
|
|
3441
3442
|
});
|
|
3442
|
-
var templateObject_1$
|
|
3443
|
+
var templateObject_1$M, templateObject_2$u, templateObject_3$l, templateObject_4$g, templateObject_5$c, templateObject_6$9, templateObject_7$6, templateObject_8$4, templateObject_9$1;
|
|
3443
3444
|
|
|
3444
3445
|
/**
|
|
3445
3446
|
* @see https://mui.com/material-ui/react-menu/
|
|
@@ -3518,74 +3519,98 @@ var InputSearch = React.forwardRef(function InputSearch(props, ref) {
|
|
|
3518
3519
|
* (masoudmanson): This prevents the browser's default auto completion
|
|
3519
3520
|
* menu from being displayed for the InputSearch.
|
|
3520
3521
|
*/
|
|
3521
|
-
autoComplete: "
|
|
3522
|
+
autoComplete: "one-time-code" }, rest))] }));
|
|
3522
3523
|
});
|
|
3523
3524
|
|
|
3524
|
-
var doNotForwardProps$
|
|
3525
|
+
var doNotForwardProps$l = [
|
|
3525
3526
|
"count",
|
|
3526
3527
|
"keepSearchOnSelect",
|
|
3527
3528
|
"search",
|
|
3528
3529
|
"InputBaseProps",
|
|
3530
|
+
"PopperBaseProps",
|
|
3531
|
+
"onClickAway",
|
|
3529
3532
|
];
|
|
3530
|
-
var
|
|
3531
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
3532
|
-
})(templateObject_1$
|
|
3533
|
+
var StyledAutocompleteBase = styles.styled(material.Autocomplete, {
|
|
3534
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$l.includes(prop); },
|
|
3535
|
+
})(templateObject_1$L || (templateObject_1$L = __makeTemplateObject(["\n + .", "\n > .", "\n .", " {\n ", "\n }\n\n ", "\n"], ["\n + .", "\n > .", "\n .", " {\n ", "\n }\n\n ", "\n"])), material.autocompleteClasses.popper, material.autocompleteClasses.paper, material.autocompleteClasses.groupLabel, fontCapsXxxs, function (props) {
|
|
3533
3536
|
var search = props.search;
|
|
3534
3537
|
var spacings = getSpaces(props);
|
|
3535
3538
|
var colors = getColors(props);
|
|
3536
3539
|
var borders = getBorders(props);
|
|
3537
|
-
return "\n ".concat(!search && "height: 0", ";\n\n .MuiOutlinedInput-root.MuiInputBase-formControl.MuiInputBase-adornedEnd {\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px 0 0;\n\n .MuiAutocomplete-input {\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n }\n }\n\n & + .
|
|
3540
|
+
return "\n ".concat(!search && "height: 0", ";\n\n .MuiOutlinedInput-root.MuiInputBase-formControl.MuiInputBase-adornedEnd {\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px 0 0;\n\n .MuiAutocomplete-input {\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n }\n }\n\n & + .").concat(material.autocompleteClasses.popper, " > .").concat(material.autocompleteClasses.paper, " {\n .").concat(material.autocompleteClasses.listbox, " {\n max-height: 40vh;\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px 0 0;\n\n .").concat(material.autocompleteClasses.option, " {\n min-height: unset;\n\n &.").concat(material.autocompleteClasses.focused, " {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[100], ";\n }\n\n &[aria-selected=\"true\"] {\n background-color: white;\n }\n\n &[aria-disabled=\"true\"] {\n opacity: 1;\n }\n\n &[aria-selected=\"true\"].").concat(material.autocompleteClasses.focused, " {\n background-color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[100], ";\n }\n }\n\n & > li:last-child .").concat(material.autocompleteClasses.groupUl, " {\n border-bottom: none;\n margin-bottom: 0;\n padding-bottom: 0;\n }\n }\n\n .").concat(material.autocompleteClasses.groupLabel, " {\n top: 0;\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n }\n\n .").concat(material.autocompleteClasses.groupUl, " {\n position: relative;\n margin: 0 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n border-bottom: ").concat(borders === null || borders === void 0 ? void 0 : borders.gray[200], ";\n padding-bottom: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px;\n\n & li:last-of-type {\n position: relative;\n }\n }\n\n .").concat(material.autocompleteClasses.noOptions, " {\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n margin-right: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n }\n\n .").concat(material.autocompleteClasses.loading, " {\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px 0 0;\n }\n }\n ");
|
|
3538
3541
|
});
|
|
3539
3542
|
var InputBaseWrapper$1 = styles.styled("div", {
|
|
3540
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
3541
|
-
})(templateObject_2$
|
|
3543
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$l.includes(prop); },
|
|
3544
|
+
})(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3542
3545
|
var search = props.search;
|
|
3543
3546
|
if (!search) {
|
|
3544
3547
|
// (thuang): We cannot use `display: none;` here, since
|
|
3545
3548
|
// the component needs to be in the DOM to handle backdrop
|
|
3546
3549
|
// click to close the menu
|
|
3547
|
-
return "\n border: 0;\n padding: 0;\n
|
|
3550
|
+
return "\n border: 0;\n padding: 0;\n white-space: nowrap;\n clip-path: inset(100%);\n clip: rect(0 0 0 0);\n overflow: hidden;\n margin: 0;\n ";
|
|
3548
3551
|
}
|
|
3549
3552
|
});
|
|
3550
3553
|
var StyledMenuInputSearch$1 = styles.styled(InputSearch, {
|
|
3551
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
3552
|
-
})(templateObject_3$
|
|
3554
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$l.includes(prop); },
|
|
3555
|
+
})(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n margin: 0;\n .MuiInputBase-root {\n width: 100%;\n }\n /* (thuang): Works with attribute inputMode: \"none\" to hide mobile keyboard */\n caret-color: ", ";\n"], ["\n margin: 0;\n .MuiInputBase-root {\n width: 100%;\n }\n /* (thuang): Works with attribute inputMode: \"none\" to hide mobile keyboard */\n caret-color: ", ";\n"])), function (_a) {
|
|
3553
3556
|
var search = _a.search;
|
|
3554
3557
|
return (search ? "auto" : "transparent");
|
|
3555
3558
|
});
|
|
3556
|
-
var StyledPaper$
|
|
3559
|
+
var StyledPaper$3 = styles.styled(material.Paper)(templateObject_4$f || (templateObject_4$f = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3557
3560
|
var spacings = getSpaces(props);
|
|
3558
3561
|
var borders = getBorders(props);
|
|
3559
3562
|
var corners = getCorners(props);
|
|
3560
3563
|
var shadows = getShadows(props);
|
|
3561
|
-
return "\n padding: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.
|
|
3564
|
+
return "\n padding: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ;\n background-color: white;\n border: ").concat(borders === null || borders === void 0 ? void 0 : borders.gray[100], ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.m, "px;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.m, ";\n box-sizing: border-box;\n ");
|
|
3562
3565
|
});
|
|
3563
3566
|
var StyledMenuItemDetails = styles.styled("div")(templateObject_5$b || (templateObject_5$b = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontBodyXxs$1, function (props) {
|
|
3564
3567
|
var colors = getColors(props);
|
|
3565
3568
|
return "\n color: ".concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n white-space: pre-wrap;\n ");
|
|
3566
3569
|
});
|
|
3567
3570
|
var StyledMenuItemText = styles.styled("div")(templateObject_6$8 || (templateObject_6$8 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n"])));
|
|
3568
|
-
var templateObject_1$
|
|
3571
|
+
var templateObject_1$L, templateObject_2$t, templateObject_3$k, templateObject_4$f, templateObject_5$b, templateObject_6$8;
|
|
3569
3572
|
|
|
3570
|
-
var
|
|
3571
|
-
var
|
|
3572
|
-
var
|
|
3573
|
+
var AutocompleteBase = function (props) {
|
|
3574
|
+
var multiple = props.multiple, _a = props.disableCloseOnSelect, disableCloseOnSelect = _a === void 0 ? multiple : _a, _b = props.getOptionLabel, getOptionLabel = _b === void 0 ? defaultGetOptionLabel : _b, _c = props.InputBaseProps, InputBaseProps = _c === void 0 ? EMPTY_OBJECT : _c, _d = props.isOptionEqualToValue, isOptionEqualToValue = _d === void 0 ? defaultIsOptionEqualToValue : _d, _e = props.keepSearchOnSelect, keepSearchOnSelect = _e === void 0 ? false : _e, _f = props.label, label = _f === void 0 ? "Label" : _f, _g = props.loading, loading = _g === void 0 ? false : _g, _h = props.loadingText, loadingText = _h === void 0 ? "" : _h, _j = props.noOptionsText, noOptionsText = _j === void 0 ? "No options" : _j, _k = props.onInputChange, onInputChange = _k === void 0 ? noop : _k, _l = props.renderOption, renderOption = _l === void 0 ? defaultRenderOption : _l, _m = props.renderTags, renderTags = _m === void 0 ? defaultRenderTags : _m, _o = props.search, search = _o === void 0 ? false : _o, _p = props.clearOnBlur, clearOnBlur = _p === void 0 ? false : _p, _q = props.blurOnSelect, blurOnSelect = _q === void 0 ? !multiple : _q;
|
|
3575
|
+
var theme = styles.useTheme();
|
|
3576
|
+
var _r = React.useState(""), inputValue = _r[0], setInputValue = _r[1];
|
|
3577
|
+
return (jsxRuntime.jsx(StyledAutocompleteBase, __assign({ clearOnBlur: clearOnBlur, disableCloseOnSelect: disableCloseOnSelect, disablePortal: true, renderTags: renderTags, loading: loading, loadingText: loadingText, noOptionsText: noOptionsText, PaperComponent: StyledPaper$3, PopperComponent: useDefaultPopperComponent(), renderOption: renderOption, getOptionLabel: getOptionLabel, isOptionEqualToValue: isOptionEqualToValue, inputValue: inputValue, renderInput: defaultRenderInput, multiple: multiple }, props, {
|
|
3578
|
+
// (masoudmanson): For multiple options (multiple = true), setting blurOnSelect to false
|
|
3579
|
+
// keeps the dropdown open after selecting an option. This feature enhances user experience
|
|
3580
|
+
// by preventing the dropdown from closing, enabling users to select multiple options
|
|
3581
|
+
// without having to reopen the menu repeatedly.
|
|
3582
|
+
blurOnSelect: multiple ? false : blurOnSelect,
|
|
3583
|
+
// (masoudmanson): Given the necessity of maintaining consistent onBlur functionality,
|
|
3584
|
+
// and clearing the input value on blur, it's crucial to include the onBlur handler
|
|
3585
|
+
// after spreading other props. Furthermore, within the defaultOnBlur function, the
|
|
3586
|
+
// actual onBlur function is invoked for completeness.
|
|
3587
|
+
onBlur: defaultOnBlur,
|
|
3588
|
+
// (masoudmanson): To ensure component-level actions (changing the input field value)
|
|
3589
|
+
// trigger upon input changes, it's crucial to position the onInputChange handler after
|
|
3590
|
+
// spreading the other props. Furthermore, within the defaultOnInputChange function,
|
|
3591
|
+
// the provided onInputChange from props is called at the end to emit the input changes
|
|
3592
|
+
// to the user.
|
|
3593
|
+
onInputChange: defaultOnInputChange })));
|
|
3573
3594
|
/**
|
|
3574
3595
|
* (masoudmanson): Using a custom Popper or Paper with the Autocomplete
|
|
3575
|
-
* without a
|
|
3596
|
+
* without a useCallback results in scroll jumps while selecting an option!
|
|
3576
3597
|
*/
|
|
3577
|
-
|
|
3578
|
-
return
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3598
|
+
function useDefaultPopperComponent() {
|
|
3599
|
+
return React.useCallback(function (popperProps) {
|
|
3600
|
+
var _a;
|
|
3601
|
+
return (jsxRuntime.jsx(material.Popper, __assign({ modifiers: [
|
|
3602
|
+
{
|
|
3603
|
+
enabled: true,
|
|
3604
|
+
name: "offset",
|
|
3605
|
+
options: {
|
|
3606
|
+
offset: [0, (_a = theme.app) === null || _a === void 0 ? void 0 : _a.spacing.s],
|
|
3607
|
+
},
|
|
3584
3608
|
},
|
|
3585
|
-
},
|
|
3586
|
-
|
|
3587
|
-
}
|
|
3588
|
-
|
|
3609
|
+
] }, popperProps)));
|
|
3610
|
+
}, []);
|
|
3611
|
+
}
|
|
3612
|
+
function defaultRenderInput(params) {
|
|
3613
|
+
return (jsxRuntime.jsx(InputBaseWrapper$1, { search: search, children: jsxRuntime.jsx(StyledMenuInputSearch$1, __assign({ id: "location-search", label: label, placeholder: label, ref: params.InputProps.ref, search: search,
|
|
3589
3614
|
// (masoudmanson): This prevents Backspace from deselecting selected dropdown options.
|
|
3590
3615
|
onKeyDown: function (event) {
|
|
3591
3616
|
if (event.key === "Backspace") {
|
|
@@ -3600,31 +3625,35 @@ var Autocomplete = function (props) {
|
|
|
3600
3625
|
sdsType: "iconButton",
|
|
3601
3626
|
}, sdsIcon: "xMark" })), jsxRuntime.jsx(ButtonIcon, { "aria-label": "search-button", sdsType: "secondary", sdsSize: "small", sdsIconProps: {
|
|
3602
3627
|
sdsType: "interactive",
|
|
3603
|
-
}, sdsIcon: "search" })] })), inputProps: params.inputProps }) }, InputBaseProps)) }));
|
|
3604
|
-
|
|
3628
|
+
}, sdsIcon: "search" })] })), inputProps: params.inputProps }) }, InputBaseProps)) }));
|
|
3629
|
+
}
|
|
3630
|
+
function defaultOnBlur(event) {
|
|
3631
|
+
var _a;
|
|
3632
|
+
if (clearOnBlur)
|
|
3605
3633
|
setInputValue("");
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
else {
|
|
3613
|
-
setInputValue("");
|
|
3614
|
-
}
|
|
3634
|
+
(_a = props.onBlur) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
|
3635
|
+
}
|
|
3636
|
+
function defaultOnInputChange(event, value, reason) {
|
|
3637
|
+
if (!multiple) {
|
|
3638
|
+
if (reason === "input") {
|
|
3639
|
+
setInputValue(value);
|
|
3615
3640
|
}
|
|
3616
3641
|
else {
|
|
3617
|
-
|
|
3618
|
-
setInputValue("");
|
|
3619
|
-
}
|
|
3620
|
-
else if (reason === "input" ||
|
|
3621
|
-
(reason === "reset" && !keepSearchOnSelect)) {
|
|
3622
|
-
setInputValue(value);
|
|
3623
|
-
}
|
|
3642
|
+
setInputValue("");
|
|
3624
3643
|
}
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3644
|
+
}
|
|
3645
|
+
else {
|
|
3646
|
+
if (reason === "clear") {
|
|
3647
|
+
setInputValue("");
|
|
3648
|
+
}
|
|
3649
|
+
else if (reason === "input" ||
|
|
3650
|
+
(reason === "reset" && !keepSearchOnSelect)) {
|
|
3651
|
+
setInputValue(value);
|
|
3652
|
+
}
|
|
3653
|
+
}
|
|
3654
|
+
if (onInputChange)
|
|
3655
|
+
onInputChange(event, value, reason);
|
|
3656
|
+
}
|
|
3628
3657
|
function clearInput() {
|
|
3629
3658
|
setInputValue("");
|
|
3630
3659
|
/**
|
|
@@ -3660,6 +3689,206 @@ var Autocomplete = function (props) {
|
|
|
3660
3689
|
}
|
|
3661
3690
|
};
|
|
3662
3691
|
|
|
3692
|
+
var StyledColumn = styles.styled("div")(templateObject_1$K || (templateObject_1$K = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3693
|
+
var _a = props.width, width = _a === void 0 ? 280 : _a;
|
|
3694
|
+
var colors = getColors(props);
|
|
3695
|
+
var spacings = getSpaces(props);
|
|
3696
|
+
return "\n position: relative;\n width: ".concat(width, "px;\n\n &:not(:last-child) {\n border-right: solid 1px ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[200], ";\n margin-right: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n }\n\n // (masoudmanson): This code hides the relation icon of the last column\n &:last-of-type {\n .SdsAutocompleteMultiColumn-column-relation-icon {\n display: none;\n }\n }\n ");
|
|
3697
|
+
});
|
|
3698
|
+
var StyledColumnTitle = styles.styled("p")(templateObject_2$s || (templateObject_2$s = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontCapsXxxs, function (props) {
|
|
3699
|
+
var spacings = getSpaces(props);
|
|
3700
|
+
var colors = getColors(props);
|
|
3701
|
+
var typography = getTypography(props);
|
|
3702
|
+
return "\n font-family: ".concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px;\n margin: 0;\n ");
|
|
3703
|
+
});
|
|
3704
|
+
var StyledColumnIcon = styles.styled("span")(templateObject_3$j || (templateObject_3$j = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3705
|
+
var spacings = getSpaces(props);
|
|
3706
|
+
var colors = getColors(props);
|
|
3707
|
+
var iconSizes = getIconSizes(props);
|
|
3708
|
+
return "\n background-color: white;\n position: absolute;\n right: -".concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px;\n top: -2px;\n padding-bottom: 2px;\n\n svg {\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n width: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs.width, "px;\n height: ").concat(iconSizes === null || iconSizes === void 0 ? void 0 : iconSizes.xs.height, "px;\n }\n ");
|
|
3709
|
+
});
|
|
3710
|
+
var templateObject_1$K, templateObject_2$s, templateObject_3$j;
|
|
3711
|
+
|
|
3712
|
+
var AutocompleteGroup = function (props) {
|
|
3713
|
+
var autocompleteProps = props.autocompleteProps, onValueChange = props.onValueChange, propValue = props.value, multiple = props.multiple, label = props.label, InputBaseProps = props.InputBaseProps, popperOpen = props.popperOpen, inputValue = props.inputValue, PaperComponent = props.PaperComponent, rest = __rest(props, ["autocompleteProps", "onValueChange", "value", "multiple", "label", "InputBaseProps", "popperOpen", "inputValue", "PaperComponent"]);
|
|
3714
|
+
var name = autocompleteProps.name, width = autocompleteProps.width, icon = autocompleteProps.icon, propProps = autocompleteProps.props;
|
|
3715
|
+
var _a = React.useState(getInitialValue(multiple, propValue)), value = _a[0], setValue = _a[1];
|
|
3716
|
+
var _b = React.useState(getInitialValue(multiple, propValue)), pendingValue = _b[0], setPendingValue = _b[1];
|
|
3717
|
+
React.useEffect(function () {
|
|
3718
|
+
if (propValue !== undefined) {
|
|
3719
|
+
setValue(propValue);
|
|
3720
|
+
}
|
|
3721
|
+
}, [propValue]);
|
|
3722
|
+
var handleChange = React.useCallback(function (event, newValue, reason, details) {
|
|
3723
|
+
var _a;
|
|
3724
|
+
(_a = propProps === null || propProps === void 0 ? void 0 : propProps.onChange) === null || _a === void 0 ? void 0 : _a.call(propProps, event, newValue, reason, details);
|
|
3725
|
+
onValueChange(name, event, newValue, reason, details);
|
|
3726
|
+
if (multiple) {
|
|
3727
|
+
setPendingValue(newValue);
|
|
3728
|
+
}
|
|
3729
|
+
else {
|
|
3730
|
+
if (newValue &&
|
|
3731
|
+
!Array.isArray(newValue) &&
|
|
3732
|
+
Object.prototype.hasOwnProperty.call(newValue, "name")) {
|
|
3733
|
+
setValue(newValue);
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
}, [name, multiple, onValueChange, propProps]);
|
|
3737
|
+
return (jsxRuntime.jsxs(StyledColumn, { width: width, className: "SdsAutocompleteMultiColumn-column-root", children: [icon && (jsxRuntime.jsx(StyledColumnIcon, { className: "SdsAutocompleteMultiColumn-column-relation-icon", children: icon })), jsxRuntime.jsx(StyledColumnTitle, { className: "SdsAutocompleteMultiColumn-column-title", children: name }), jsxRuntime.jsx(AutocompleteBase, __assign({ label: label, InputBaseProps: InputBaseProps, open: popperOpen, multiple: multiple, inputValue: inputValue, options: autocompleteProps.options, onChange: handleChange, value: multiple ? pendingValue : value, search: false, PaperComponent: PaperComponent }, rest, autocompleteProps.props, {
|
|
3738
|
+
// (masoudmanson): groupBy option is disabled on MultiColumn dropdowns
|
|
3739
|
+
groupBy: undefined }))] }));
|
|
3740
|
+
function getInitialValue(isMultiple, customValue) {
|
|
3741
|
+
if (customValue !== undefined) {
|
|
3742
|
+
return customValue;
|
|
3743
|
+
}
|
|
3744
|
+
return isMultiple
|
|
3745
|
+
? []
|
|
3746
|
+
: null;
|
|
3747
|
+
}
|
|
3748
|
+
};
|
|
3749
|
+
|
|
3750
|
+
var doNotForwardProps$k = [
|
|
3751
|
+
"anchorEl",
|
|
3752
|
+
"count",
|
|
3753
|
+
"keepSearchOnSelect",
|
|
3754
|
+
"search",
|
|
3755
|
+
"InputBaseProps",
|
|
3756
|
+
"title",
|
|
3757
|
+
"PopperBaseProps",
|
|
3758
|
+
"onClickAway",
|
|
3759
|
+
"ClickAwayListenerProps",
|
|
3760
|
+
];
|
|
3761
|
+
var StyledPopper$2 = styles.styled(material.Popper, {
|
|
3762
|
+
shouldForwardProp: function (prop) {
|
|
3763
|
+
return !doNotForwardProps$k.includes(prop) || prop === "anchorEl";
|
|
3764
|
+
},
|
|
3765
|
+
})(templateObject_1$J || (templateObject_1$J = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3766
|
+
var borders = getBorders(props);
|
|
3767
|
+
var corners = getCorners(props);
|
|
3768
|
+
var shadows = getShadows(props);
|
|
3769
|
+
var spacings = getSpaces(props);
|
|
3770
|
+
return "\n background-color: white;\n border: ".concat(borders === null || borders === void 0 ? void 0 : borders.gray[100], ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.m, "px;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.m, ";\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n box-sizing: border-box;\n z-index: 1400;\n\n .").concat(material.autocompleteClasses.popper, ".").concat(material.autocompleteClasses.popperDisablePortal, " {\n position: relative !important;\n transform: none !important;\n \n .MuiPaper-root .").concat(material.autocompleteClasses.listbox, " {\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px 0 0;\n }\n }\n ");
|
|
3771
|
+
});
|
|
3772
|
+
var StyledPaper$2 = styles.styled(material.Paper, {
|
|
3773
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$k.includes(prop); },
|
|
3774
|
+
})(templateObject_2$r || (templateObject_2$r = __makeTemplateObject(["\n box-shadow: none;\n margin: 0;\n border-radius: 0;\n padding-top: 0;\n padding-bottom: 0;\n"], ["\n box-shadow: none;\n margin: 0;\n border-radius: 0;\n padding-top: 0;\n padding-bottom: 0;\n"])));
|
|
3775
|
+
var StyledAutocompleteGroupWrapper = styles.styled("div")(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
3776
|
+
var StyledAutocompleteInput = styles.styled(InputSearch, {
|
|
3777
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$k.includes(prop); },
|
|
3778
|
+
})(templateObject_4$e || (templateObject_4$e = __makeTemplateObject(["\n ", "\n\n margin: 0;\n .MuiInputBase-root {\n width: 100%;\n }\n /* (thuang): Works with attribute inputMode: \"none\" to hide mobile keyboard */\n caret-color: ", ";\n"], ["\n ", "\n\n margin: 0;\n .MuiInputBase-root {\n width: 100%;\n }\n /* (thuang): Works with attribute inputMode: \"none\" to hide mobile keyboard */\n caret-color: ", ";\n"])), function (_a) {
|
|
3779
|
+
var search = _a.search;
|
|
3780
|
+
return !search && "height: 0; display: none;";
|
|
3781
|
+
}, function (_a) {
|
|
3782
|
+
var search = _a.search;
|
|
3783
|
+
return (search ? "auto" : "transparent");
|
|
3784
|
+
});
|
|
3785
|
+
var templateObject_1$J, templateObject_2$r, templateObject_3$i, templateObject_4$e;
|
|
3786
|
+
|
|
3787
|
+
var AutocompleteMultiColumn = function (props) {
|
|
3788
|
+
var _a;
|
|
3789
|
+
var InputBaseProps = props.InputBaseProps, _b = props.open, open = _b === void 0 ? false : _b, _c = props.PopperPlacement, PopperPlacement = _c === void 0 ? "bottom-start" : _c, PopperBaseProps = props.PopperBaseProps, _d = props.search, search = _d === void 0 ? false : _d, _e = props.label, label = _e === void 0 ? "Search" : _e, _f = props.onClickAway, onClickAway = _f === void 0 ? defaultOnClickAway : _f, ClickAwayListenerProps = props.ClickAwayListenerProps, options = props.options, onInputChange = props.onInputChange, onBlur = props.onBlur, multiple = props.multiple, parentInitialValue = props.value, onChange = props.onChange, _g = props.PopperComponent, PopperComponent = _g === void 0 ? StyledPopper$2 : _g, rest = __rest(props, ["InputBaseProps", "open", "PopperPlacement", "PopperBaseProps", "search", "label", "onClickAway", "ClickAwayListenerProps", "options", "onInputChange", "onBlur", "multiple", "value", "onChange", "PopperComponent"]);
|
|
3790
|
+
var theme = styles.useTheme();
|
|
3791
|
+
var _h = React.useState(""), inputValue = _h[0], setInputValue = _h[1];
|
|
3792
|
+
var _j = React.useState(open), popperOpen = _j[0], setPopperOpen = _j[1];
|
|
3793
|
+
var anchorRef = React.useRef(null);
|
|
3794
|
+
var _k = React.useState(null), anchorEl = _k[0], setAnchorEl = _k[1];
|
|
3795
|
+
React.useEffect(function () {
|
|
3796
|
+
setAnchorEl(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current);
|
|
3797
|
+
}, [anchorRef]);
|
|
3798
|
+
var _l = React.useState({}), autocompleteMultiColumnValue = _l[0], setAutocompleteMultiColumnValue = _l[1];
|
|
3799
|
+
React.useEffect(function () {
|
|
3800
|
+
if (parentInitialValue !== undefined) {
|
|
3801
|
+
setAutocompleteMultiColumnValue(parentInitialValue);
|
|
3802
|
+
}
|
|
3803
|
+
}, [options, parentInitialValue]);
|
|
3804
|
+
var defaultOnValueChange = function (column, event, val, reason, details) {
|
|
3805
|
+
var _a;
|
|
3806
|
+
setAutocompleteMultiColumnValue(function (prev) {
|
|
3807
|
+
var _a;
|
|
3808
|
+
return __assign(__assign({}, prev), (_a = {}, _a[column] = val, _a));
|
|
3809
|
+
});
|
|
3810
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event, __assign(__assign({}, autocompleteMultiColumnValue), (_a = {}, _a[column] = val, _a)), reason, details);
|
|
3811
|
+
};
|
|
3812
|
+
return (jsxRuntime.jsx(material.ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(StyledAutocompleteInput, __assign({ id: "location-search", label: label, placeholder: label, value: inputValue, onChange: handleInputChange, onClick: handleInputClick, onBlur: handleInputBlur, ref: anchorRef, search: search, onKeyDown: handleInputKeyDown, InputProps: __assign(__assign({}, InputBaseProps === null || InputBaseProps === void 0 ? void 0 : InputBaseProps.ref), { endAdornment: (jsxRuntime.jsxs(StyledInputAdornment, { position: "end", children: [inputValue && (jsxRuntime.jsx(ButtonIcon, { "aria-label": "clear-button", className: "input-search-clear-icon", sdsType: "primary", sdsSize: "small", sdsIconProps: {
|
|
3813
|
+
sdsType: "iconButton",
|
|
3814
|
+
}, sdsIcon: "xMark", onClick: clearInput })), jsxRuntime.jsx(ButtonIcon, { "aria-label": "search-button", sdsType: "secondary", sdsSize: "small", sdsIconProps: {
|
|
3815
|
+
sdsType: "interactive",
|
|
3816
|
+
}, sdsIcon: "search" })] })),
|
|
3817
|
+
/**
|
|
3818
|
+
* (thuang): Works with css caret-color: "transparent" to hide
|
|
3819
|
+
* mobile keyboard
|
|
3820
|
+
*/
|
|
3821
|
+
inputMode: "text" }) }, InputBaseProps)), anchorEl && (jsxRuntime.jsx(PopperComponent, __assign({ modifiers: [
|
|
3822
|
+
{
|
|
3823
|
+
name: "offset",
|
|
3824
|
+
options: {
|
|
3825
|
+
offset: [0, (_a = theme.app) === null || _a === void 0 ? void 0 : _a.spacing.s],
|
|
3826
|
+
},
|
|
3827
|
+
},
|
|
3828
|
+
], open: popperOpen, anchorEl: anchorEl, placement: PopperPlacement, disablePortal: true }, PopperBaseProps, { children: jsxRuntime.jsx(StyledAutocompleteGroupWrapper, { className: "SdsAutocompleteMultiColumn-wrapper", children: options.map(function (autocompleteOptions) { return (jsxRuntime.jsx(AutocompleteGroup, __assign({ autocompleteProps: autocompleteOptions, onValueChange: defaultOnValueChange, value: autocompleteMultiColumnValue
|
|
3829
|
+
? autocompleteMultiColumnValue[autocompleteOptions.name]
|
|
3830
|
+
: undefined, multiple: multiple, label: label, InputBaseProps: InputBaseProps, popperOpen: popperOpen, inputValue: inputValue, PaperComponent: StyledPaper$2 }, rest), autocompleteOptions.name)); }) }) })))] }) })));
|
|
3831
|
+
function clearInput() {
|
|
3832
|
+
setInputValue("");
|
|
3833
|
+
/**
|
|
3834
|
+
* (masoudmanson): Because we are manually firing this event,
|
|
3835
|
+
* we must build a onChange event to transmit the updated value to onChange listeners.
|
|
3836
|
+
*/
|
|
3837
|
+
onInputChange === null || onInputChange === void 0 ? void 0 : onInputChange({ target: { value: "" } }, "", "clear");
|
|
3838
|
+
}
|
|
3839
|
+
function handleInputClick(_) {
|
|
3840
|
+
if (popperOpen) {
|
|
3841
|
+
setPopperOpen(false);
|
|
3842
|
+
}
|
|
3843
|
+
else {
|
|
3844
|
+
setPopperOpen(true);
|
|
3845
|
+
}
|
|
3846
|
+
}
|
|
3847
|
+
function handleInputChange(event) {
|
|
3848
|
+
setInputValue(event.target.value);
|
|
3849
|
+
if (onInputChange) {
|
|
3850
|
+
if (event.target.value === "") {
|
|
3851
|
+
onInputChange(event, "", "clear");
|
|
3852
|
+
}
|
|
3853
|
+
else {
|
|
3854
|
+
onInputChange(event, event.target.value, "input");
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
function handleInputBlur(event) {
|
|
3859
|
+
if (props.clearOnBlur)
|
|
3860
|
+
setInputValue("");
|
|
3861
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
3862
|
+
}
|
|
3863
|
+
function defaultOnClickAway() {
|
|
3864
|
+
setPopperOpen(false);
|
|
3865
|
+
}
|
|
3866
|
+
function handleInputKeyDown(event) {
|
|
3867
|
+
// (masoudmanson): This prevents Backspace from deselecting selected dropdown options.
|
|
3868
|
+
if (event.key === "Backspace") {
|
|
3869
|
+
event.stopPropagation();
|
|
3870
|
+
}
|
|
3871
|
+
}
|
|
3872
|
+
};
|
|
3873
|
+
|
|
3874
|
+
var Autocomplete = function (props) {
|
|
3875
|
+
var options = props.options, value = props.value, onChange = props.onChange, rest = __rest(props, ["options", "value", "onChange"]);
|
|
3876
|
+
// Multi-column options
|
|
3877
|
+
if (options && !!options[0] && "options" in options[0]) {
|
|
3878
|
+
if (options.length > 1) {
|
|
3879
|
+
return (jsxRuntime.jsx(AutocompleteMultiColumn, __assign({ options: options, value: value, onChange: onChange }, rest, {
|
|
3880
|
+
// (masoudmanson): groupBy option is disabled on MultiColumn dropdowns
|
|
3881
|
+
groupBy: undefined, open: true })));
|
|
3882
|
+
}
|
|
3883
|
+
else {
|
|
3884
|
+
return (jsxRuntime.jsx(AutocompleteBase, __assign({ options: options[0].options, value: value, onChange: onChange }, rest)));
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
else {
|
|
3888
|
+
return (jsxRuntime.jsx(AutocompleteBase, __assign({ options: options, onChange: onChange, value: value }, rest)));
|
|
3889
|
+
}
|
|
3890
|
+
};
|
|
3891
|
+
|
|
3663
3892
|
var Centered = styles.styled("div")(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n flex: 1 1 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n flex: 1 1 auto;\n display: flex;\n justify-content: center;\n align-items: center;\n"])));
|
|
3664
3893
|
var IconWrapper$1 = styles.styled("div")(templateObject_2$q || (templateObject_2$q = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
3665
3894
|
var iconSizes = getIconSizes(props);
|
|
@@ -3693,9 +3922,9 @@ var secondary$1 = function (props) {
|
|
|
3693
3922
|
var colors = getColors(props);
|
|
3694
3923
|
return "\n background-color: ".concat(colors === null || colors === void 0 ? void 0 : colors.info[100], ";\n color: black;\n ");
|
|
3695
3924
|
};
|
|
3696
|
-
var doNotForwardProps$
|
|
3925
|
+
var doNotForwardProps$j = ["sdsType", "textChild"];
|
|
3697
3926
|
var StyledBanner = styles.styled("div", {
|
|
3698
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
3927
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$j.includes(prop); },
|
|
3699
3928
|
})(templateObject_5$a || (templateObject_5$a = __makeTemplateObject(["\n display: flex;\n align-items: center;\n height: 40px;\n width: 100%;\n\n ", "\n\n ", "\n"], ["\n display: flex;\n align-items: center;\n height: 40px;\n width: 100%;\n\n ", "\n\n ", "\n"])), fontBodyS$2, function (props) {
|
|
3700
3929
|
var sdsType = props.sdsType;
|
|
3701
3930
|
var typography = getTypography(props);
|
|
@@ -3814,9 +4043,9 @@ var ButtonDropdown = React.forwardRef(function (props, ref) {
|
|
|
3814
4043
|
});
|
|
3815
4044
|
|
|
3816
4045
|
var fontBodyXs$3 = fontBody("xs");
|
|
3817
|
-
var doNotForwardProps$
|
|
4046
|
+
var doNotForwardProps$i = ["calloutTitle", "collapsed"];
|
|
3818
4047
|
var StyledCallout = styles.styled(material.Alert, {
|
|
3819
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4048
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$i.includes(prop); },
|
|
3820
4049
|
})(templateObject_1$G || (templateObject_1$G = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontBodyXs$3, function (props) {
|
|
3821
4050
|
var colors = getColors(props);
|
|
3822
4051
|
var spacings = getSpaces(props);
|
|
@@ -3994,7 +4223,7 @@ function mergeClass$1(_a) {
|
|
|
3994
4223
|
return propClassName ? "".concat(propClassName, " ").concat(className) : className;
|
|
3995
4224
|
}
|
|
3996
4225
|
|
|
3997
|
-
var doNotForwardProps$
|
|
4226
|
+
var doNotForwardProps$h = [
|
|
3998
4227
|
"icon",
|
|
3999
4228
|
"iconVerticalAlign",
|
|
4000
4229
|
"horizontalAlign",
|
|
@@ -4020,7 +4249,7 @@ var verticalAlignToFlexMap = {
|
|
|
4020
4249
|
top: "flex-start",
|
|
4021
4250
|
};
|
|
4022
4251
|
var StyledTableData = styles.styled("td", {
|
|
4023
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4252
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$h.includes(prop); },
|
|
4024
4253
|
})(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4025
4254
|
var _a = props.horizontalAlign, horizontalAlign = _a === void 0 ? "left" : _a, _b = props.verticalAlign, verticalAlign = _b === void 0 ? "top" : _b;
|
|
4026
4255
|
var spacings = getSpaces(props);
|
|
@@ -4036,14 +4265,14 @@ var ShouldTruncate = function () {
|
|
|
4036
4265
|
var StyledCellContent = styles.styled("div")(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\n display: flex;\n"], ["\n display: flex;\n"])));
|
|
4037
4266
|
var StyledCellContentWrapper = styles.styled("div")(templateObject_3$e || (templateObject_3$e = __makeTemplateObject(["\n width: 100%;\n"], ["\n width: 100%;\n"])));
|
|
4038
4267
|
var StyledCellIconWrapper = styles.styled("div", {
|
|
4039
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4268
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$h.includes(prop); },
|
|
4040
4269
|
})(templateObject_4$a || (templateObject_4$a = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4041
4270
|
var _a = props.iconVerticalAlign, iconVerticalAlign = _a === void 0 ? "top" : _a;
|
|
4042
4271
|
var spacings = getSpaces(props);
|
|
4043
4272
|
return "\n padding-right: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n display: flex;\n flex-direction: column;\n justify-content: ").concat(verticalAlignToFlexMap[iconVerticalAlign], ";\n ");
|
|
4044
4273
|
});
|
|
4045
4274
|
var PrimaryText = styles.styled("span", {
|
|
4046
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4275
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$h.includes(prop); },
|
|
4047
4276
|
})(templateObject_5$7 || (templateObject_5$7 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyS$2, function (props) {
|
|
4048
4277
|
var _a = props.primaryTextWrapLineCount, primaryTextWrapLineCount = _a === void 0 ? 3 : _a;
|
|
4049
4278
|
return "\n display: block;\n line-height: 20px;\n ".concat(props.shouldTextWrap
|
|
@@ -4051,7 +4280,7 @@ var PrimaryText = styles.styled("span", {
|
|
|
4051
4280
|
: ShouldTruncate(), "\n ");
|
|
4052
4281
|
});
|
|
4053
4282
|
var SecondaryText = styles.styled("span", {
|
|
4054
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4283
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$h.includes(prop); },
|
|
4055
4284
|
})(templateObject_6$5 || (templateObject_6$5 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyXxs$1, function (props) {
|
|
4056
4285
|
var _a = props.secondaryTextWrapLineCount, secondaryTextWrapLineCount = _a === void 0 ? 1 : _a;
|
|
4057
4286
|
var colors = getColors(props);
|
|
@@ -4061,7 +4290,7 @@ var SecondaryText = styles.styled("span", {
|
|
|
4061
4290
|
: ShouldTruncate(), "\n ");
|
|
4062
4291
|
});
|
|
4063
4292
|
var TertiaryText = styles.styled("span", {
|
|
4064
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4293
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$h.includes(prop); },
|
|
4065
4294
|
})(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyXxs$1, function (props) {
|
|
4066
4295
|
var _a = props.tertiaryTextWrapLineCount, tertiaryTextWrapLineCount = _a === void 0 ? 1 : _a;
|
|
4067
4296
|
var colors = getColors(props);
|
|
@@ -4084,9 +4313,9 @@ var CellBasic = React.forwardRef(function (props, ref) {
|
|
|
4084
4313
|
return (jsxRuntime.jsx(StyledTableData, __assign({ ref: ref }, props, { children: jsxRuntime.jsx(CellBasicContent, __assign({}, props)) })));
|
|
4085
4314
|
});
|
|
4086
4315
|
|
|
4087
|
-
var doNotForwardProps$
|
|
4316
|
+
var doNotForwardProps$g = ["horizontalAlign", "verticalAlign"];
|
|
4088
4317
|
var StyledCellComponentData = styles.styled("td", {
|
|
4089
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4318
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$g.includes(prop); },
|
|
4090
4319
|
})(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontBodyS$2, function (props) {
|
|
4091
4320
|
var spacings = getSpaces(props);
|
|
4092
4321
|
var _a = props.horizontalAlign, horizontalAlign = _a === void 0 ? "left" : _a, _b = props.verticalAlign, verticalAlign = _b === void 0 ? "top" : _b;
|
|
@@ -4094,13 +4323,13 @@ var StyledCellComponentData = styles.styled("td", {
|
|
|
4094
4323
|
return "\n font-family: ".concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n align-items: center;\n text-align: ").concat(horizontalAlign, ";\n vertical-align: ").concat(verticalAlign, ";\n overflow: hidden;\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n ");
|
|
4095
4324
|
});
|
|
4096
4325
|
styles.styled("span", {
|
|
4097
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4326
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$g.includes(prop); },
|
|
4098
4327
|
})(templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontHeaderS, function (props) {
|
|
4099
4328
|
var typography = getTypography(props);
|
|
4100
4329
|
return "\n line-height: 24px;\n font-family: ".concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n display: block;\n \n ");
|
|
4101
4330
|
});
|
|
4102
4331
|
styles.styled("span", {
|
|
4103
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4332
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$g.includes(prop); },
|
|
4104
4333
|
})(templateObject_3$d || (templateObject_3$d = __makeTemplateObject(["\n ", "\n ", "\n"], ["\n ", "\n ", "\n"])), fontBodyXxs$1, function (props) {
|
|
4105
4334
|
var typography = getTypography(props);
|
|
4106
4335
|
var colors = getColors(props);
|
|
@@ -4118,7 +4347,7 @@ var contentPositionMapping = {
|
|
|
4118
4347
|
left: "flex-start",
|
|
4119
4348
|
right: "flex-end",
|
|
4120
4349
|
};
|
|
4121
|
-
var doNotForwardProps$
|
|
4350
|
+
var doNotForwardProps$f = [
|
|
4122
4351
|
"active",
|
|
4123
4352
|
"horizontalAlign",
|
|
4124
4353
|
"shouldShowTooltipOnHover",
|
|
@@ -4127,7 +4356,7 @@ var doNotForwardProps$e = [
|
|
|
4127
4356
|
"hideSortIcon",
|
|
4128
4357
|
];
|
|
4129
4358
|
var StyledSortingIcon = styles.styled(ButtonIcon, {
|
|
4130
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4359
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$f.includes(prop); },
|
|
4131
4360
|
})(templateObject_1$B || (templateObject_1$B = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4132
4361
|
var _a = props.active, active = _a === void 0 ? false : _a;
|
|
4133
4362
|
var spacings = getSpaces(props);
|
|
@@ -4135,7 +4364,7 @@ var StyledSortingIcon = styles.styled(ButtonIcon, {
|
|
|
4135
4364
|
return "\n margin-left: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n margin-bottom: 2px;\n color: ").concat(active ? colors === null || colors === void 0 ? void 0 : colors.primary[400] : colors === null || colors === void 0 ? void 0 : colors.gray[400], ";\n opacity: ").concat(active ? 1 : 0, ";\n outline: none !important;\n ");
|
|
4136
4365
|
});
|
|
4137
4366
|
var StyledTableHeader$1 = styles.styled("th", {
|
|
4138
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4367
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$f.includes(prop); },
|
|
4139
4368
|
})(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontHeaderS, function (props) {
|
|
4140
4369
|
var _a = props.active, active = _a === void 0 ? false : _a, _b = props.horizontalAlign, horizontalAlign = _b === void 0 ? "left" : _b;
|
|
4141
4370
|
var spacings = getSpaces(props);
|
|
@@ -4144,7 +4373,7 @@ var StyledTableHeader$1 = styles.styled("th", {
|
|
|
4144
4373
|
return "\n color: ".concat(active ? colors === null || colors === void 0 ? void 0 : colors.primary[400] : colors === null || colors === void 0 ? void 0 : colors.gray[600], ";\n font-family: ").concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.s, "px;\n text-align: ").concat(horizontalAlign, ";\n min-width: 96px;\n width: 96px;\n cursor: pointer;\n vertical-align: bottom;\n\n & .MuiButtonBase-root {\n outline: none;\n }\n\n &:hover {\n color: ").concat(active ? colors === null || colors === void 0 ? void 0 : colors.primary[500] : "black", ";\n\n & .MuiButtonBase-root {\n color: ").concat(active ? colors === null || colors === void 0 ? void 0 : colors.primary[500] : colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n opacity: 1;\n }\n }\n ");
|
|
4145
4374
|
});
|
|
4146
4375
|
var StyledCellHeaderContainer = styles.styled("div", {
|
|
4147
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4376
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$f.includes(prop); },
|
|
4148
4377
|
})(templateObject_3$c || (templateObject_3$c = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4149
4378
|
var _a = props.horizontalAlign, horizontalAlign = _a === void 0 ? "left" : _a;
|
|
4150
4379
|
return "\n align-items: flex-end;\n width: 100%;\n display: flex;\n justify-content: ".concat(horizontalAlign ? contentPositionMapping[horizontalAlign] : "flex-start", ";\n ");
|
|
@@ -4243,9 +4472,9 @@ var statusToCss = {
|
|
|
4243
4472
|
success: success,
|
|
4244
4473
|
warning: warning$2,
|
|
4245
4474
|
};
|
|
4246
|
-
var doNotForwardProps$
|
|
4475
|
+
var doNotForwardProps$e = ["isRounded"];
|
|
4247
4476
|
var StyledChip = styles.styled(material.Chip, {
|
|
4248
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4477
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$e.includes(prop); },
|
|
4249
4478
|
})(templateObject_7$3 || (templateObject_7$3 = __makeTemplateObject(["\n border: none;\n\n ", "\n"], ["\n border: none;\n\n ", "\n"])), function (props) {
|
|
4250
4479
|
var size = props.size, status = props.status, isRounded = props.isRounded;
|
|
4251
4480
|
return react.css(templateObject_6$4 || (templateObject_6$4 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), isRounded && rounded$2(props), !isRounded && square$2(props), size === "small" && small(props), size === "medium" && medium(props), status && statusToCss[status](props));
|
|
@@ -4264,7 +4493,7 @@ var Chip = function (props) {
|
|
|
4264
4493
|
return jsxRuntime.jsx(StyledChip, __assign({}, props));
|
|
4265
4494
|
};
|
|
4266
4495
|
|
|
4267
|
-
var doNotForwardProps$
|
|
4496
|
+
var doNotForwardProps$d = [
|
|
4268
4497
|
"anchorEl",
|
|
4269
4498
|
"count",
|
|
4270
4499
|
"keepSearchOnSelect",
|
|
@@ -4274,63 +4503,70 @@ var doNotForwardProps$c = [
|
|
|
4274
4503
|
"PopperBaseProps",
|
|
4275
4504
|
"onClickAway",
|
|
4276
4505
|
"ClickAwayListenerProps",
|
|
4506
|
+
"forceOpen",
|
|
4507
|
+
"isMultiColumn",
|
|
4277
4508
|
];
|
|
4278
|
-
// export const StyledAutocomplete = styled(Autocomplete, {
|
|
4279
|
-
// shouldForwardProp: (prop: string) => !doNotForwardProps.includes(prop),
|
|
4280
|
-
// })`
|
|
4281
|
-
// ${(props: StyleProps) => {
|
|
4282
|
-
// const spacings = getSpaces(props);
|
|
4283
|
-
// return `
|
|
4284
|
-
// `;
|
|
4285
|
-
// }}
|
|
4286
|
-
// ` as typeof Autocomplete;
|
|
4287
4509
|
var StyledHeaderTitle = styles.styled("div", {
|
|
4288
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4510
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$d.includes(prop); },
|
|
4289
4511
|
})(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n ", "\n\n ", "\n"], ["\n ", "\n\n ", "\n"])), fontHeaderXs, function (props) {
|
|
4290
4512
|
var search = props.search;
|
|
4291
4513
|
var typography = getTypography(props);
|
|
4292
4514
|
var spacings = getSpaces(props);
|
|
4293
|
-
return "\n font-family: ".concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n
|
|
4515
|
+
return "\n font-family: ".concat(typography === null || typography === void 0 ? void 0 : typography.fontFamily, ";\n padding-right: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n margin-bottom: ").concat(search ? spacings === null || spacings === void 0 ? void 0 : spacings.s : spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n ");
|
|
4294
4516
|
});
|
|
4517
|
+
var StyledDropdownMenuAutocompleteWrapper = styles.styled("div")(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["\n & .", ", & .MuiPopper-root {\n position: relative !important;\n transform: none !important;\n width: 100% !important;\n box-shadow: none;\n padding: 0;\n border: none;\n\n .", ", .MuiPaper-root {\n box-shadow: none !important;\n border: none !important;\n border-radius: 0;\n margin: 0;\n padding: 0;\n }\n }\n"], ["\n & .", ", & .MuiPopper-root {\n position: relative !important;\n transform: none !important;\n width: 100% !important;\n box-shadow: none;\n padding: 0;\n border: none;\n\n .", ", .MuiPaper-root {\n box-shadow: none !important;\n border: none !important;\n border-radius: 0;\n margin: 0;\n padding: 0;\n }\n }\n"])), material.autocompleteClasses.popper, material.autocompleteClasses.paper);
|
|
4295
4518
|
var StyledPopper = styles.styled(material.Popper, {
|
|
4296
4519
|
shouldForwardProp: function (prop) {
|
|
4297
|
-
return !doNotForwardProps$
|
|
4520
|
+
return !doNotForwardProps$d.includes(prop) || prop === "anchorEl";
|
|
4298
4521
|
},
|
|
4299
|
-
})(
|
|
4522
|
+
})(templateObject_3$a || (templateObject_3$a = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4300
4523
|
var borders = getBorders(props);
|
|
4301
4524
|
var corners = getCorners(props);
|
|
4302
4525
|
var shadows = getShadows(props);
|
|
4303
|
-
|
|
4304
|
-
return "\n background-color: white;\n border: ".concat(borders === null || borders === void 0 ? void 0 : borders.gray[100], ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.m, "px;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.m, ";\n padding: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px;\n box-sizing: border-box;\n z-index: 1400;\n ");
|
|
4526
|
+
return "\n background-color: white;\n border: ".concat(borders === null || borders === void 0 ? void 0 : borders.gray[100], ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.m, "px;\n box-shadow: ").concat(shadows === null || shadows === void 0 ? void 0 : shadows.m, ";\n box-sizing: border-box;\n z-index: 1400;\n ");
|
|
4305
4527
|
});
|
|
4306
4528
|
var StyledPaper$1 = styles.styled(material.Paper, {
|
|
4307
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4308
|
-
})(
|
|
4309
|
-
var title = props.title;
|
|
4529
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$d.includes(prop); },
|
|
4530
|
+
})(templateObject_4$8 || (templateObject_4$8 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4310
4531
|
var spacings = getSpaces(props);
|
|
4311
|
-
return "\n box-shadow: none;\n
|
|
4532
|
+
return "\n box-shadow: none !important;\n border: none !important;\n border-radius: 0;\n margin: 0;\n padding: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xxs, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n\n .MuiFormControl-root.MuiTextField-root {\n margin-bottom: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n margin-right: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n }\n ");
|
|
4312
4533
|
});
|
|
4313
|
-
var StyledAutocompletePopper = styles.styled(material.Popper)(templateObject_4$8 || (templateObject_4$8 = __makeTemplateObject(["\n position: relative !important;\n transform: none !important;\n width: 100% !important;\n box-shadow: none;\n padding: 0;\n border: none;\n"], ["\n position: relative !important;\n transform: none !important;\n width: 100% !important;\n box-shadow: none;\n padding: 0;\n border: none;\n"])));
|
|
4314
4534
|
var templateObject_1$z, templateObject_2$j, templateObject_3$a, templateObject_4$8;
|
|
4315
4535
|
|
|
4536
|
+
// (masoudmanson): Represents the minimum width defined by design specifications
|
|
4537
|
+
// for the dropdownMenu's popper component
|
|
4538
|
+
var MINIMUM_DROPDOWN_MENU_POPPER_WIDTH = 160;
|
|
4539
|
+
var DEFAULT_POPPER_BASE_PROPS = {
|
|
4540
|
+
disablePortal: true,
|
|
4541
|
+
};
|
|
4316
4542
|
var DropdownMenu = function (props) {
|
|
4317
|
-
var
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4543
|
+
var _a;
|
|
4544
|
+
var theme = styles.useTheme();
|
|
4545
|
+
var anchorEl = props.anchorEl, id = props.id, InputBaseProps = props.InputBaseProps, _b = props.open, open = _b === void 0 ? false : _b, _c = props.PopperComponent, PopperComponent = _c === void 0 ? StyledPopper : _c, _d = props.PaperComponent, PaperComponent = _d === void 0 ? StyledPaper$1 : _d, _e = props.PopperPlacement, PopperPlacement = _e === void 0 ? "bottom-start" : _e, _f = props.PopperBaseProps, PopperBaseProps = _f === void 0 ? {} : _f, _g = props.search, search = _g === void 0 ? false : _g, title = props.title, _h = props.label, label = _h === void 0 ? "Search" : _h, children = props.children, options = props.options, _j = props.onClickAway, onClickAway = _j === void 0 ? noop : _j, ClickAwayListenerProps = props.ClickAwayListenerProps, _k = props.width, width = _k === void 0 ? MINIMUM_DROPDOWN_MENU_POPPER_WIDTH : _k, rest = __rest(props, ["anchorEl", "id", "InputBaseProps", "open", "PopperComponent", "PaperComponent", "PopperPlacement", "PopperBaseProps", "search", "title", "label", "children", "options", "onClickAway", "ClickAwayListenerProps", "width"]);
|
|
4546
|
+
var isMultiColumn = "options" in ((options === null || options === void 0 ? void 0 : options[0]) || EMPTY_OBJECT);
|
|
4547
|
+
// (masoudmanson): The DropdownMenu's Popper component should have a minimum
|
|
4548
|
+
// width of MINIMUM_DROPDOWN_MENU_POPPER_WIDTH pixels if the DropdownMenu is
|
|
4549
|
+
// a single column dropdown.However, for larger multi-column autocompletes,
|
|
4550
|
+
// the width should be set to 'auto' to accommodate the expanded layout.
|
|
4551
|
+
var dropdownMenuPopperSx = React.useMemo(function () {
|
|
4552
|
+
return __assign(__assign({}, PopperBaseProps === null || PopperBaseProps === void 0 ? void 0 : PopperBaseProps.sx), { width: isMultiColumn || width < MINIMUM_DROPDOWN_MENU_POPPER_WIDTH
|
|
4553
|
+
? "auto"
|
|
4554
|
+
: width });
|
|
4555
|
+
}, [PopperBaseProps === null || PopperBaseProps === void 0 ? void 0 : PopperBaseProps.sx, isMultiColumn, width]);
|
|
4556
|
+
var DefaultInputBaseProps = React.useMemo(function () {
|
|
4557
|
+
return __assign(__assign({}, InputBaseProps), { onClick: noop });
|
|
4558
|
+
}, [InputBaseProps]);
|
|
4326
4559
|
return (jsxRuntime.jsx(PopperComponent, __assign({ id: id, modifiers: [
|
|
4327
4560
|
{
|
|
4328
4561
|
name: "offset",
|
|
4329
4562
|
options: {
|
|
4330
|
-
offset: [0,
|
|
4563
|
+
offset: [0, (_a = theme.app) === null || _a === void 0 ? void 0 : _a.spacing.s],
|
|
4331
4564
|
},
|
|
4332
4565
|
},
|
|
4333
|
-
], open: open, anchorEl: anchorEl
|
|
4566
|
+
], open: open, anchorEl: anchorEl, placement: PopperPlacement }, PopperBaseProps, {
|
|
4567
|
+
// (masoudmanson): To override the width of the Popper,
|
|
4568
|
+
// the sx prop's value must be set after spreading the PopperBaseProps.
|
|
4569
|
+
sx: dropdownMenuPopperSx, children: jsxRuntime.jsx(PaperComponent, { children: jsxRuntime.jsx(material.ClickAwayListener, __assign({ onClickAway: onClickAway }, ClickAwayListenerProps, { children: jsxRuntime.jsxs(StyledDropdownMenuAutocompleteWrapper, { children: [title && (jsxRuntime.jsx(StyledHeaderTitle, { search: search, children: title })), anchorEl && (jsxRuntime.jsx(Autocomplete, __assign({ label: label, search: search, title: title, open: open, options: options, PopperBaseProps: DEFAULT_POPPER_BASE_PROPS, disablePortal: true, onClickAway: noop }, rest, { InputBaseProps: DefaultInputBaseProps }))), children] }) })) }) })));
|
|
4334
4570
|
};
|
|
4335
4571
|
|
|
4336
4572
|
var labelFontBodyS = fontBody("s");
|
|
@@ -4386,7 +4622,7 @@ var isDisabled = function (props) {
|
|
|
4386
4622
|
var gray = colors === null || colors === void 0 ? void 0 : colors.gray[300];
|
|
4387
4623
|
return react.css(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n path {\n fill: ", ";\n }\n "], ["\n cursor: default;\n border-color: ", ";\n\n span {\n color: ", ";\n }\n\n &.MuiButton-text {\n .styled-label {\n color: ", ";\n }\n }\n\n path {\n fill: ", ";\n }\n "])), gray, colors === null || colors === void 0 ? void 0 : colors.gray[300], colors === null || colors === void 0 ? void 0 : colors.gray[300], colors === null || colors === void 0 ? void 0 : colors.gray[300]);
|
|
4388
4624
|
};
|
|
4389
|
-
var doNotForwardProps$
|
|
4625
|
+
var doNotForwardProps$c = [
|
|
4390
4626
|
"intent",
|
|
4391
4627
|
"state",
|
|
4392
4628
|
"sdsStage",
|
|
@@ -4396,20 +4632,20 @@ var doNotForwardProps$b = [
|
|
|
4396
4632
|
"shouldPutAColonAfterLabel",
|
|
4397
4633
|
];
|
|
4398
4634
|
var StyledInputDropdown = styles.styled(Button, {
|
|
4399
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4635
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$c.includes(prop); },
|
|
4400
4636
|
})(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n ", "\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"], ["\n ", "\n\n /* (thuang): in Minimal it's a different value */\n align-items: center;\n /* (thuang): in Minimal it's a different value */\n flex-direction: row;\n\n justify-content: space-between;\n\n ", "\n"])), labelFontBodyXs, function (props) {
|
|
4401
4637
|
var disabled = props.disabled, intent = props.intent, state = props.state, sdsStage = props.sdsStage, sdsStyle = props.sdsStyle;
|
|
4402
4638
|
return react.css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "], ["\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n "])), inputDropdownStyles(props), sdsStyle === "minimal" && minimal$1(props), sdsStyle === "square" && square$1(props), sdsStyle === "rounded" && rounded$1(props), state === "open" && isOpen(props), sdsStage === "userInput" && userInput$1(props), intent === "warning" && warning$1(props), intent === "error" && error$1(props), disabled && isDisabled(props));
|
|
4403
4639
|
});
|
|
4404
4640
|
var StyledDetail = styles.styled("span", {
|
|
4405
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4641
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$c.includes(prop); },
|
|
4406
4642
|
})(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4407
4643
|
var colors = getColors(props);
|
|
4408
4644
|
var spaces = getSpaces(props);
|
|
4409
4645
|
return "\n color: ".concat(colors === null || colors === void 0 ? void 0 : colors.gray[500], ";\n margin-left: ").concat(spaces === null || spaces === void 0 ? void 0 : spaces.xs, "px;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n ");
|
|
4410
4646
|
});
|
|
4411
4647
|
var StyledLabel$1 = styles.styled("span", {
|
|
4412
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4648
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$c.includes(prop); },
|
|
4413
4649
|
})(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4414
4650
|
var _a;
|
|
4415
4651
|
var details = props.details, counter = props.counter, sdsType = props.sdsType;
|
|
@@ -4422,7 +4658,7 @@ var StyledLabel$1 = styles.styled("span", {
|
|
|
4422
4658
|
return "\n color: ".concat(labelColor, ";\n\n font-weight: ").concat(sdsType === "label" ? fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.semibold : fontWeights === null || fontWeights === void 0 ? void 0 : fontWeights.regular, ";\n ");
|
|
4423
4659
|
});
|
|
4424
4660
|
var StyledCounter = styles.styled("span", {
|
|
4425
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4661
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$c.includes(prop); },
|
|
4426
4662
|
})(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4427
4663
|
var colors = getColors(props);
|
|
4428
4664
|
var corners = getCorners(props);
|
|
@@ -4430,7 +4666,7 @@ var StyledCounter = styles.styled("span", {
|
|
|
4430
4666
|
return "\n background-color: ".concat(colors === null || colors === void 0 ? void 0 : colors.gray[200], ";\n color: ").concat(colors === null || colors === void 0 ? void 0 : colors.primary[400], ";\n border-radius: ").concat(corners === null || corners === void 0 ? void 0 : corners.l, "px;\n padding: 0 ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px;\n margin-left: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.xs, "px;\n ");
|
|
4431
4667
|
});
|
|
4432
4668
|
var MinimalDetails = styles.styled("div", {
|
|
4433
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4669
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$c.includes(prop); },
|
|
4434
4670
|
})(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n ", "\n text-align: left;\n width: 100%;\n\n ", "\n"], ["\n ", "\n text-align: left;\n width: 100%;\n\n ", "\n"])), labelFontBodyS, function (_a) {
|
|
4435
4671
|
var shouldTruncateMinimalDetails = _a.shouldTruncateMinimalDetails;
|
|
4436
4672
|
if (shouldTruncateMinimalDetails) {
|
|
@@ -4438,13 +4674,13 @@ var MinimalDetails = styles.styled("div", {
|
|
|
4438
4674
|
}
|
|
4439
4675
|
});
|
|
4440
4676
|
var LabelWrapper = styles.styled("span", {
|
|
4441
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4677
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$c.includes(prop); },
|
|
4442
4678
|
})(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (_a) {
|
|
4443
4679
|
var isMinimal = _a.isMinimal;
|
|
4444
4680
|
return "\n align-items: ".concat(isMinimal ? "center" : undefined, ";\n display: ").concat(isMinimal ? "inline-flex" : "contents", ";\n justify-content: ").concat(isMinimal ? "space-between" : undefined, ";\n width: 100%;\n ");
|
|
4445
4681
|
});
|
|
4446
4682
|
var IconWrapper = styles.styled("span", {
|
|
4447
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4683
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$c.includes(prop); },
|
|
4448
4684
|
})(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n margin-left: auto;\n display: flex;\n align-items: center;\n"], ["\n margin-left: auto;\n display: flex;\n align-items: center;\n"])));
|
|
4449
4685
|
function labelStyle(props) {
|
|
4450
4686
|
var _a;
|
|
@@ -4585,9 +4821,9 @@ var typeToCss = {
|
|
|
4585
4821
|
primary: primary,
|
|
4586
4822
|
secondary: secondary,
|
|
4587
4823
|
};
|
|
4588
|
-
var doNotForwardProps$
|
|
4824
|
+
var doNotForwardProps$b = ["sdsType", "sdsStyle", "tagColor", "hover"];
|
|
4589
4825
|
var StyledTag$1 = styles.styled(material.Chip, {
|
|
4590
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4826
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$b.includes(prop); },
|
|
4591
4827
|
})(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n border: none;\n\n ", "\n"], ["\n border: none;\n\n ", "\n"])), function (props) {
|
|
4592
4828
|
var _a = props.hover, hover = _a === void 0 ? true : _a, sdsType = props.sdsType, sdsStyle = props.sdsStyle, icon = props.icon;
|
|
4593
4829
|
var isRounded = sdsStyle === "rounded";
|
|
@@ -4644,30 +4880,22 @@ var templateObject_1$v, templateObject_2$f;
|
|
|
4644
4880
|
|
|
4645
4881
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
4646
4882
|
var ComplexFilter = function (_a) {
|
|
4647
|
-
var options = _a.options, _b = _a.label, label = _b === void 0 ? "" : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, _d = _a.search, search = _d === void 0 ? false : _d, onChange = _a.onChange, _e = _a.DropdownMenuProps, DropdownMenuProps = _e === void 0 ? {} : _e, _f = _a.InputDropdownProps, InputDropdownProps = _f === void 0 ? { sdsStyle: "minimal" } : _f, propValue = _a.value, PopperComponent = _a.PopperComponent, _g = _a.InputDropdownComponent, InputDropdownComponent = _g === void 0 ? InputDropdown : _g,
|
|
4883
|
+
var options = _a.options, _b = _a.label, label = _b === void 0 ? "" : _b, _c = _a.multiple, multiple = _c === void 0 ? false : _c, _d = _a.search, search = _d === void 0 ? false : _d, onChange = _a.onChange, _e = _a.DropdownMenuProps, DropdownMenuProps = _e === void 0 ? {} : _e, _f = _a.InputDropdownProps, InputDropdownProps = _f === void 0 ? { sdsStyle: "minimal" } : _f, propValue = _a.value, PopperComponent = _a.PopperComponent, _g = _a.InputDropdownComponent, InputDropdownComponent = _g === void 0 ? InputDropdown : _g, rest = __rest(_a, ["options", "label", "multiple", "search", "onChange", "DropdownMenuProps", "InputDropdownProps", "value", "PopperComponent", "InputDropdownComponent"]);
|
|
4648
4884
|
var isControlled = propValue !== undefined;
|
|
4649
|
-
var
|
|
4650
|
-
var
|
|
4651
|
-
var
|
|
4652
|
-
var _m = React.useState(getInitialValue()), pendingValue = _m[0], setPendingValue = _m[1];
|
|
4653
|
-
React.useEffect(function () {
|
|
4654
|
-
onChange(value);
|
|
4655
|
-
setPendingValue(value);
|
|
4656
|
-
}, [value]);
|
|
4885
|
+
var _h = React.useState(false), open = _h[0], setOpen = _h[1];
|
|
4886
|
+
var _j = React.useState(null), anchorEl = _j[0], setAnchorEl = _j[1];
|
|
4887
|
+
var _k = React.useState((multiple ? [] : null)), value = _k[0], setValue = _k[1];
|
|
4657
4888
|
React.useEffect(function () {
|
|
4658
4889
|
if (isControlled) {
|
|
4659
4890
|
setValue(propValue);
|
|
4660
4891
|
}
|
|
4661
|
-
}, [propValue]);
|
|
4892
|
+
}, [isControlled, propValue]);
|
|
4662
4893
|
// * (mlila): likely, this portion on ComplexFilter will need to be replaced with Dropdown (or a
|
|
4663
4894
|
// * new DropdownFilter) component. As ComplexFilter evolves, there will be more types added,
|
|
4664
4895
|
// * such as sliders for ranges, inline multi selects, etc.
|
|
4665
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Wrapper$1, __assign({}, rest, { children: [jsxRuntime.jsx(InputDropdownComponent, __assign({ label: label, onClick: handleClick, sdsStage: open ? "userInput" : "default" }, InputDropdownProps)), jsxRuntime.jsx(StyledChipsWrapper, { children: jsxRuntime.jsx(Chips, { value: value, multiple: multiple, onDelete: handleDelete }) })] })), jsxRuntime.jsx(DropdownMenu, __assign({ anchorEl: anchorEl, open: open, onClose: handleMenuSelectClose, search: search, multiple: multiple, value:
|
|
4896
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(Wrapper$1, __assign({}, rest, { children: [jsxRuntime.jsx(InputDropdownComponent, __assign({ label: label, onClick: handleClick, sdsStage: open ? "userInput" : "default" }, InputDropdownProps)), jsxRuntime.jsx(StyledChipsWrapper, { children: jsxRuntime.jsx(Chips, { value: value, multiple: multiple, onDelete: handleDelete }) })] })), jsxRuntime.jsx(DropdownMenu, __assign({ anchorEl: anchorEl, open: open, onClose: handleMenuSelectClose, search: search, multiple: multiple, value: value, onChange: handleChange, disableCloseOnSelect: multiple, options: options, PopperComponent: PopperComponent, PopperBaseProps: { sx: { minWidth: 250 } }, onClickAway: handleClose }, DropdownMenuProps, rest))] }));
|
|
4666
4897
|
function handleClick(event) {
|
|
4667
4898
|
if (open) {
|
|
4668
|
-
if (multiple) {
|
|
4669
|
-
setValue(pendingValue);
|
|
4670
|
-
}
|
|
4671
4899
|
setOpen(false);
|
|
4672
4900
|
if (anchorEl) {
|
|
4673
4901
|
anchorEl.focus();
|
|
@@ -4675,9 +4903,6 @@ var ComplexFilter = function (_a) {
|
|
|
4675
4903
|
setAnchorEl(null);
|
|
4676
4904
|
}
|
|
4677
4905
|
else {
|
|
4678
|
-
if (multiple) {
|
|
4679
|
-
setPendingValue(value);
|
|
4680
|
-
}
|
|
4681
4906
|
setAnchorEl(event.currentTarget);
|
|
4682
4907
|
setOpen(true);
|
|
4683
4908
|
}
|
|
@@ -4685,9 +4910,6 @@ var ComplexFilter = function (_a) {
|
|
|
4685
4910
|
function handleClose() {
|
|
4686
4911
|
if (open) {
|
|
4687
4912
|
setOpen(false);
|
|
4688
|
-
if (multiple) {
|
|
4689
|
-
setValue(pendingValue);
|
|
4690
|
-
}
|
|
4691
4913
|
}
|
|
4692
4914
|
}
|
|
4693
4915
|
function handleMenuSelectClose(event, reason) {
|
|
@@ -4696,16 +4918,12 @@ var ComplexFilter = function (_a) {
|
|
|
4696
4918
|
handleClose();
|
|
4697
4919
|
}
|
|
4698
4920
|
}
|
|
4699
|
-
function handleChange(
|
|
4700
|
-
if (multiple) {
|
|
4701
|
-
if (isTriggerChangeOnOptionClick) {
|
|
4702
|
-
setPendingValue(newValue);
|
|
4703
|
-
return setValue(newValue);
|
|
4704
|
-
}
|
|
4705
|
-
return setPendingValue(newValue);
|
|
4706
|
-
}
|
|
4921
|
+
function handleChange(event, newValue) {
|
|
4707
4922
|
setValue(newValue);
|
|
4708
|
-
|
|
4923
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
4924
|
+
if (!multiple) {
|
|
4925
|
+
setOpen(false);
|
|
4926
|
+
}
|
|
4709
4927
|
}
|
|
4710
4928
|
function handleDelete(option) {
|
|
4711
4929
|
if (!multiple) {
|
|
@@ -4714,14 +4932,6 @@ var ComplexFilter = function (_a) {
|
|
|
4714
4932
|
var newValue = (value === null || value === void 0 ? void 0 : value.filter(function (item) { return item !== option; })) || null;
|
|
4715
4933
|
setValue(newValue);
|
|
4716
4934
|
}
|
|
4717
|
-
function getInitialValue() {
|
|
4718
|
-
if (isControlled) {
|
|
4719
|
-
return propValue;
|
|
4720
|
-
}
|
|
4721
|
-
return multiple
|
|
4722
|
-
? []
|
|
4723
|
-
: null;
|
|
4724
|
-
}
|
|
4725
4935
|
};
|
|
4726
4936
|
|
|
4727
4937
|
var DialogContext = React.createContext({ sdsSize: "m" });
|
|
@@ -4734,9 +4944,9 @@ var BoxShadows;
|
|
|
4734
4944
|
})(BoxShadows || (BoxShadows = {}));
|
|
4735
4945
|
|
|
4736
4946
|
// (thuang): Please keep this in sync with the props used in `ExtraProps`
|
|
4737
|
-
var doNotForwardProps$
|
|
4947
|
+
var doNotForwardProps$a = ["sdsSize"];
|
|
4738
4948
|
var StyledPaper = styles.styled(material.Paper, {
|
|
4739
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
4949
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$a.includes(prop); },
|
|
4740
4950
|
})(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n & {\n box-shadow: ", ";\n\n ", "\n\n ", "\n }\n"], ["\n & {\n box-shadow: ", ";\n\n ", "\n\n ", "\n }\n"])), BoxShadows.L, paperDimensions, function (props) {
|
|
4741
4951
|
var spaces = getSpaces(props);
|
|
4742
4952
|
var corners = getCorners(props);
|
|
@@ -4794,9 +5004,9 @@ var Dialog = React.forwardRef(function Dialog(props, ref) {
|
|
|
4794
5004
|
});
|
|
4795
5005
|
|
|
4796
5006
|
// (thuang): Please keep this in sync with the props used in `DialogActionsExtraProps`
|
|
4797
|
-
var doNotForwardProps$
|
|
5007
|
+
var doNotForwardProps$9 = ["buttonPosition"];
|
|
4798
5008
|
var StyledDialogActions = styles.styled(material.DialogActions, {
|
|
4799
|
-
shouldForwardProp: function (prop) { return !doNotForwardProps$
|
|
5009
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$9.includes(prop); },
|
|
4800
5010
|
})(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n padding: 0;\n\n ", "\n"], ["\n padding: 0;\n\n ", "\n"])), function (props) {
|
|
4801
5011
|
var spaces = getSpaces(props);
|
|
4802
5012
|
var _a = props.buttonPosition, buttonPosition = _a === void 0 ? "right" : _a;
|
|
@@ -4861,47 +5071,70 @@ var DialogTitle = React.forwardRef(function DialogTitle(props, ref) {
|
|
|
4861
5071
|
return (jsxRuntime.jsx(StyledDialogTitle, __assign({ ref: ref }, rest, { children: children || (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [onClose && jsxRuntime.jsx(CloseButton, { sdsIcon: "xMark", onClick: onClose }), jsxRuntime.jsx(Title, { children: title }), jsxRuntime.jsx(Subtitle, { children: subtitle })] })) })));
|
|
4862
5072
|
});
|
|
4863
5073
|
|
|
4864
|
-
|
|
4865
|
-
var
|
|
5074
|
+
var doNotForwardProps$8 = ["buttonPosition"];
|
|
5075
|
+
var StyledButtonsWrapper = styles.styled("div", {
|
|
5076
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$8.includes(prop); },
|
|
5077
|
+
})(templateObject_1$p || (templateObject_1$p = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
5078
|
+
var buttonPosition = props.buttonPosition;
|
|
5079
|
+
return "\n display: flex;\n justify-content: ".concat(buttonPosition === "left" ? "start" : "end", ";\n ");
|
|
5080
|
+
});
|
|
5081
|
+
var StyledButton = styles.styled(Button, {
|
|
5082
|
+
shouldForwardProp: function (prop) { return !doNotForwardProps$8.includes(prop); },
|
|
5083
|
+
})(templateObject_2$d || (templateObject_2$d = __makeTemplateObject(["\n ", "\n"], ["\n ", "\n"])), function (props) {
|
|
4866
5084
|
var spacings = getSpaces(props);
|
|
4867
|
-
return "\n margin-top: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n margin-
|
|
5085
|
+
return "\n margin-top: ".concat(spacings === null || spacings === void 0 ? void 0 : spacings.l, "px;\n margin-right: ").concat(spacings === null || spacings === void 0 ? void 0 : spacings.m, "px;\n ");
|
|
4868
5086
|
});
|
|
4869
5087
|
var templateObject_1$p, templateObject_2$d;
|
|
4870
5088
|
|
|
4871
5089
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
4872
|
-
var Dropdown = function (
|
|
4873
|
-
var options =
|
|
5090
|
+
var Dropdown = function (props) {
|
|
5091
|
+
var options = props.options, _a = props.label, label = _a === void 0 ? "" : _a, _b = props.multiple, multiple = _b === void 0 ? false : _b, _c = props.search, search = _c === void 0 ? false : _c, _d = props.buttonPosition, buttonPosition = _d === void 0 ? "right" : _d, _e = props.buttons, buttons = _e === void 0 ? false : _e,
|
|
4874
5092
|
// By default, most dropdowns will close when the user clicks outside the dropdown.
|
|
4875
5093
|
// The exception is the multiple select variant with Apply/Cancel buttons,
|
|
4876
5094
|
// which by default will not close on blur. If closeOnBlur is enabled, clicking out
|
|
4877
5095
|
// is equivalent to clicking the Cancel button, closing the dropdown and losing
|
|
4878
5096
|
// unapplied changes.
|
|
4879
|
-
|
|
5097
|
+
_f = props.closeOnBlur,
|
|
4880
5098
|
// By default, most dropdowns will close when the user clicks outside the dropdown.
|
|
4881
5099
|
// The exception is the multiple select variant with Apply/Cancel buttons,
|
|
4882
5100
|
// which by default will not close on blur. If closeOnBlur is enabled, clicking out
|
|
4883
5101
|
// is equivalent to clicking the Cancel button, closing the dropdown and losing
|
|
4884
5102
|
// unapplied changes.
|
|
4885
|
-
closeOnBlur =
|
|
5103
|
+
closeOnBlur = _f === void 0 ? !buttons : _f, onClose = props.onClose, onChange = props.onChange, _g = props.DropdownMenuProps, DropdownMenuProps = _g === void 0 ? {} : _g, _h = props.InputDropdownProps, InputDropdownProps = _h === void 0 ? { sdsStyle: "minimal" } : _h, _j = props.InputDropdownComponent, InputDropdownComponent = _j === void 0 ? InputDropdown : _j, _k = props.isTriggerChangeOnOptionClick, isTriggerChangeOnOptionClick = _k === void 0 ? false : _k, _l = props.disabled, disabled = _l === void 0 ? false : _l, propValue = props.value, rest = __rest(props, ["options", "label", "multiple", "search", "buttonPosition", "buttons", "closeOnBlur", "onClose", "onChange", "DropdownMenuProps", "InputDropdownProps", "InputDropdownComponent", "isTriggerChangeOnOptionClick", "disabled", "value"]);
|
|
4886
5104
|
if (buttons && !multiple) {
|
|
4887
5105
|
// eslint-disable-next-line no-console
|
|
4888
5106
|
console.warn("Warning: buttons are only supported for multiple select dropdowns.");
|
|
4889
5107
|
}
|
|
5108
|
+
var isMultiColumn = "options" in ((options === null || options === void 0 ? void 0 : options[0]) || EMPTY_OBJECT);
|
|
4890
5109
|
var isControlled = propValue !== undefined;
|
|
4891
|
-
var
|
|
4892
|
-
var
|
|
4893
|
-
var
|
|
4894
|
-
React.
|
|
4895
|
-
|
|
4896
|
-
}, [onChange, value]);
|
|
5110
|
+
var _m = React.useState(null), anchorEl = _m[0], setAnchorEl = _m[1];
|
|
5111
|
+
var _o = React.useState(false), open = _o[0], setOpen = _o[1];
|
|
5112
|
+
var _p = React.useState(getInitialValue()), value = _p[0], setValue = _p[1];
|
|
5113
|
+
var _q = React.useState(getInitialValue()), pendingValue = _q[0], setPendingValue = _q[1];
|
|
5114
|
+
var shouldShowButtons = buttons && !isTriggerChangeOnOptionClick && multiple;
|
|
4897
5115
|
React.useEffect(function () {
|
|
4898
5116
|
if (isControlled) {
|
|
4899
5117
|
setValue(propValue);
|
|
4900
5118
|
}
|
|
4901
5119
|
}, [isControlled, propValue]);
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
5120
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(InputDropdownComponent, __assign({ disabled: disabled, label: label, onClick: handleClick, sdsStage: open ? "userInput" : "default" }, InputDropdownProps, { "data-testid": "dropdown" })), jsxRuntime.jsx(DropdownMenu, __assign({ anchorEl: anchorEl, open: open, search: search, onClose: handleClose, multiple: multiple, disableCloseOnSelect: multiple, options: options, onClickAway: handleClickAway, width: 250, onChange: handleChange, value: isMultiColumn ? value : multiple ? pendingValue : value }, DropdownMenuProps, rest, { children: shouldShowButtons ? (jsxRuntime.jsx(StyledButtonsWrapper, { buttonPosition: buttonPosition, children: buttonPosition === "left" ? (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(StyledButton, { onClick: handleClose, sdsStyle: "square", sdsType: "primary", children: "Apply" }), jsxRuntime.jsx(StyledButton, { onClick: handleCancel, sdsStyle: "square", sdsType: "secondary", children: "Cancel" })] })) : (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(StyledButton, { onClick: handleCancel, sdsStyle: "square", sdsType: "secondary", children: "Cancel" }), jsxRuntime.jsx(StyledButton, { onClick: handleClose, sdsStyle: "square", sdsType: "primary", children: "Apply" })] })) })) : null }))] }));
|
|
5121
|
+
function getInitialValue() {
|
|
5122
|
+
return multiple
|
|
5123
|
+
? []
|
|
5124
|
+
: null;
|
|
5125
|
+
}
|
|
5126
|
+
function handleChange(event, newValue, reason, details) {
|
|
5127
|
+
if (multiple) {
|
|
5128
|
+
if (isTriggerChangeOnOptionClick) {
|
|
5129
|
+
setPendingValue(newValue);
|
|
5130
|
+
return setValueAndCallOnChange(event, newValue, reason, details);
|
|
5131
|
+
}
|
|
5132
|
+
return setPendingValue(newValue);
|
|
5133
|
+
}
|
|
5134
|
+
setValueAndCallOnChange(event, newValue, reason, details);
|
|
5135
|
+
if (!isMultiColumn)
|
|
5136
|
+
setOpen(false);
|
|
5137
|
+
}
|
|
4905
5138
|
function handleClickAway() {
|
|
4906
5139
|
if (open) {
|
|
4907
5140
|
// (masoudmanson): We want to keep the dropdown menu open in two scenarios:
|
|
@@ -4918,12 +5151,14 @@ var Dropdown = function (_a) {
|
|
|
4918
5151
|
}
|
|
4919
5152
|
function handleClick(event) {
|
|
4920
5153
|
if (open) {
|
|
4921
|
-
if (
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
anchorEl
|
|
5154
|
+
if (!shouldShowButtons) {
|
|
5155
|
+
if (multiple) {
|
|
5156
|
+
setValue(pendingValue);
|
|
5157
|
+
}
|
|
5158
|
+
setOpen(false);
|
|
5159
|
+
if (anchorEl) {
|
|
5160
|
+
anchorEl.focus();
|
|
5161
|
+
}
|
|
4927
5162
|
}
|
|
4928
5163
|
}
|
|
4929
5164
|
else {
|
|
@@ -4934,7 +5169,7 @@ var Dropdown = function (_a) {
|
|
|
4934
5169
|
setOpen(true);
|
|
4935
5170
|
}
|
|
4936
5171
|
}
|
|
4937
|
-
function handleClose(
|
|
5172
|
+
function handleClose(event, reason) {
|
|
4938
5173
|
// (thuang): We don't want to close the menu when the input is clicked
|
|
4939
5174
|
if (reason === "toggleInput") {
|
|
4940
5175
|
return;
|
|
@@ -4951,23 +5186,12 @@ var Dropdown = function (_a) {
|
|
|
4951
5186
|
anchorEl.focus();
|
|
4952
5187
|
}
|
|
4953
5188
|
if (closeOnBlur)
|
|
4954
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
5189
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(event, reason);
|
|
4955
5190
|
if (shouldShowButtons) {
|
|
4956
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
5191
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(event, reason);
|
|
4957
5192
|
setOpen(false);
|
|
4958
5193
|
}
|
|
4959
5194
|
}
|
|
4960
|
-
function handleChange(_, newValue) {
|
|
4961
|
-
if (multiple) {
|
|
4962
|
-
if (isTriggerChangeOnOptionClick) {
|
|
4963
|
-
setPendingValue(newValue);
|
|
4964
|
-
return setValue(newValue);
|
|
4965
|
-
}
|
|
4966
|
-
return setPendingValue(newValue);
|
|
4967
|
-
}
|
|
4968
|
-
setValue(newValue);
|
|
4969
|
-
setOpen(false);
|
|
4970
|
-
}
|
|
4971
5195
|
function handleCancel() {
|
|
4972
5196
|
if (multiple) {
|
|
4973
5197
|
// (masoudmanson): To undo the latest actions made on the selections,
|
|
@@ -4978,16 +5202,11 @@ var Dropdown = function (_a) {
|
|
|
4978
5202
|
if (anchorEl) {
|
|
4979
5203
|
anchorEl.focus();
|
|
4980
5204
|
}
|
|
4981
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
4982
5205
|
setOpen(false);
|
|
4983
5206
|
}
|
|
4984
|
-
function
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
}
|
|
4988
|
-
return multiple
|
|
4989
|
-
? []
|
|
4990
|
-
: null;
|
|
5207
|
+
function setValueAndCallOnChange(event, newValue, reason, details) {
|
|
5208
|
+
setValue(newValue);
|
|
5209
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(event, newValue, reason, details);
|
|
4991
5210
|
}
|
|
4992
5211
|
};
|
|
4993
5212
|
|
|
@@ -5207,8 +5426,6 @@ var disabledStyled$1 = function (props) {
|
|
|
5207
5426
|
};
|
|
5208
5427
|
var textArea = function (props) {
|
|
5209
5428
|
var spacings = getSpaces(props);
|
|
5210
|
-
console.log(material.outlinedInputClasses.multiline);
|
|
5211
|
-
console.log(material.outlinedInputClasses.inputMultiline);
|
|
5212
5429
|
return react.css(templateObject_4$5 || (templateObject_4$5 = __makeTemplateObject(["\n .", " {\n padding: ", "px;\n\n > .", " {\n padding: ", "px ", "px ", "px;\n resize: both;\n }\n }\n "], ["\n .", " {\n padding: ", "px;\n\n > .", " {\n padding: ", "px ", "px ", "px;\n resize: both;\n }\n }\n "])), material.outlinedInputClasses.multiline, spacings === null || spacings === void 0 ? void 0 : spacings.xxs, material.outlinedInputClasses.inputMultiline, spacings === null || spacings === void 0 ? void 0 : spacings.xxs, spacings === null || spacings === void 0 ? void 0 : spacings.m, spacings === null || spacings === void 0 ? void 0 : spacings.m);
|
|
5213
5430
|
};
|
|
5214
5431
|
var userInput = function (props) {
|
|
@@ -6260,6 +6477,8 @@ exports.AccordionDetails = AccordionDetails;
|
|
|
6260
6477
|
exports.AccordionHeader = AccordionHeader;
|
|
6261
6478
|
exports.Alert = Alert$1;
|
|
6262
6479
|
exports.Autocomplete = Autocomplete;
|
|
6480
|
+
exports.AutocompleteMultiColumnStyledPopper = StyledPopper$2;
|
|
6481
|
+
exports.AutocompleteSingleColumnStyledPaper = StyledPaper$3;
|
|
6263
6482
|
exports.Banner = Banner;
|
|
6264
6483
|
exports.Button = Button;
|
|
6265
6484
|
exports.ButtonDropdown = ButtonDropdown;
|
|
@@ -6300,6 +6519,7 @@ exports.ListItem = ListItem;
|
|
|
6300
6519
|
exports.ListItemLabel = ListItemLabel;
|
|
6301
6520
|
exports.ListSubheader = ListSubheader;
|
|
6302
6521
|
exports.LoadingIndicator = LoadingIndicator;
|
|
6522
|
+
exports.MINIMUM_DROPDOWN_MENU_POPPER_WIDTH = MINIMUM_DROPDOWN_MENU_POPPER_WIDTH;
|
|
6303
6523
|
exports.Menu = Menu;
|
|
6304
6524
|
exports.MenuItem = MenuItem;
|
|
6305
6525
|
exports.MenuSelect = MenuSelect;
|