@luscii-healthtech/web-ui 35.13.1 → 35.13.2
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.
|
@@ -29,6 +29,12 @@ export interface SelectProps<Option extends OptionMinimal = OptionMinimal, IsMul
|
|
|
29
29
|
* This change is protected by policy: https://app.glassfrog.com/organizations/13950/orgnav/policies/12870328
|
|
30
30
|
*/
|
|
31
31
|
value?: any;
|
|
32
|
+
/**
|
|
33
|
+
* The internal processing in this component is causing issues, but we cannot
|
|
34
|
+
* just remove it. This prop allows us to use the component in a fully controlled
|
|
35
|
+
* way, without any processing of the value.
|
|
36
|
+
*/
|
|
37
|
+
skipValueProcessing?: boolean;
|
|
32
38
|
}
|
|
33
39
|
/**
|
|
34
40
|
* A wrapper around react-select to style it according to our design specification.
|
|
@@ -4289,12 +4289,25 @@ const SelectLoadingIndicator = (props) => React__namespace.default.createElement
|
|
|
4289
4289
|
function generateCustomStyles(hasError) {
|
|
4290
4290
|
return {
|
|
4291
4291
|
option: (baseStyles, state) => {
|
|
4292
|
-
return Object.assign(Object.assign({}, baseStyles), {
|
|
4293
|
-
|
|
4294
|
-
|
|
4292
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
4293
|
+
fontWeight: state.isSelected ? "bold" : "normal",
|
|
4294
|
+
fontSize: "14px",
|
|
4295
4295
|
// tailwind blue-50
|
|
4296
|
-
backgroundColor: state.
|
|
4297
|
-
|
|
4296
|
+
backgroundColor: state.isFocused ? "#F2FAFD" : "none",
|
|
4297
|
+
color: "inherit",
|
|
4298
|
+
position: "relative",
|
|
4299
|
+
padding: "0.75rem",
|
|
4300
|
+
opacity: state.isDisabled ? "0.5" : 1,
|
|
4301
|
+
"&:after": {
|
|
4302
|
+
visibility: state.isSelected ? "visible" : "hidden"
|
|
4303
|
+
},
|
|
4304
|
+
transition: "background-color 0.3s ease-in-out",
|
|
4305
|
+
"&:hover": {
|
|
4306
|
+
// tailwind blue-50
|
|
4307
|
+
backgroundColor: state.isSelected ? "transparent" : "#F2FAFD"
|
|
4308
|
+
},
|
|
4309
|
+
pointerEvents: state.isDisabled ? "none" : "auto"
|
|
4310
|
+
});
|
|
4298
4311
|
},
|
|
4299
4312
|
container: (baseStyles) => {
|
|
4300
4313
|
return Object.assign(Object.assign({}, baseStyles), { flexGrow: "initial" });
|
|
@@ -4355,7 +4368,7 @@ function generateCustomStyles(hasError) {
|
|
|
4355
4368
|
};
|
|
4356
4369
|
}
|
|
4357
4370
|
const Select = React__namespace.default.forwardRef((_a, innerRef) => {
|
|
4358
|
-
var { isError = false, styles, options, onChange, value, width = "full", isMulti, className } = _a, otherProps = __rest(_a, ["isError", "styles", "options", "onChange", "value", "width", "isMulti", "className"]);
|
|
4371
|
+
var { isError = false, styles, options, onChange, value, width = "full", isMulti, className, skipValueProcessing } = _a, otherProps = __rest(_a, ["isError", "styles", "options", "onChange", "value", "width", "isMulti", "className", "skipValueProcessing"]);
|
|
4359
4372
|
const customStyles = generateCustomStyles(isError);
|
|
4360
4373
|
const mergedStyles = ReactSelect.mergeStyles(customStyles, styles);
|
|
4361
4374
|
const isOptionsGrouped = !options ? false : options.reduce((acc, o) => acc || "options" in o && !("values" in o), false);
|
|
@@ -4375,7 +4388,7 @@ const Select = React__namespace.default.forwardRef((_a, innerRef) => {
|
|
|
4375
4388
|
var { children } = _a2, commonProps = __rest(_a2, ["children"]);
|
|
4376
4389
|
return React__namespace.default.createElement(ReactSelect.components.SelectContainer, Object.assign({}, commonProps, { innerProps: Object.assign({}, commonProps.innerProps, Object.assign({}, getDataAttributes())) }), children);
|
|
4377
4390
|
};
|
|
4378
|
-
return React__namespace.default.createElement(ReactSelect__default.default, Object.assign({}, otherProps, { ref: innerRef, styles: mergedStyles, options, onChange: onChangeWrapped, value: valueWrapped, isMulti, className: classNames__default.default("customized-select", className, {
|
|
4391
|
+
return React__namespace.default.createElement(ReactSelect__default.default, Object.assign({}, otherProps, { ref: innerRef, styles: mergedStyles, options, onChange: skipValueProcessing ? onChange : onChangeWrapped, value: skipValueProcessing ? value : valueWrapped, isMulti, className: classNames__default.default("customized-select", className, {
|
|
4379
4392
|
"ui-w-16": width === "sm",
|
|
4380
4393
|
"ui-w-32": width === "md",
|
|
4381
4394
|
"ui-w-56": width === "lg",
|