@luscii-healthtech/web-ui 2.35.0 → 2.36.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/components/Form/form.types.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +28 -5
- package/dist/index.d.ts +1 -1
- package/dist/web-ui.cjs.development.js +91 -199
- package/dist/web-ui.cjs.development.js.map +1 -1
- package/dist/web-ui.cjs.production.min.js +1 -1
- package/dist/web-ui.cjs.production.min.js.map +1 -1
- package/dist/web-ui.esm.js +91 -199
- package/dist/web-ui.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/Select/LegacySelect.d.ts +0 -31
- package/dist/components/Select/SelectV2.d.ts +0 -33
- package/dist/components/Select/options.transformer.d.ts +0 -14
- package/dist/components/Select/select.utils.d.ts +0 -7
|
@@ -2,7 +2,7 @@ import { Control, DeepPartial, FieldErrors, FieldName, FieldValues, RegisterOpti
|
|
|
2
2
|
import React, { HTMLInputTypeAttribute } from "react";
|
|
3
3
|
import { InputProps } from "../Input/Input";
|
|
4
4
|
import { RadioGroupProps } from "../RadioGroup/RadioGroupV2";
|
|
5
|
-
import { SelectProps } from "../Select/
|
|
5
|
+
import { SelectProps } from "../Select/Select";
|
|
6
6
|
import { ImagePickerProps } from "../ImagePicker/ImagePicker";
|
|
7
7
|
import { PartialProperties } from "../../types/general.types";
|
|
8
8
|
export declare type AllowedTextInputTypes = Extract<HTMLInputTypeAttribute, "email" | "number" | "password" | "text">;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Props, GroupBase } from "react-select";
|
|
2
|
-
import { SelectInstance } from "react-select";
|
|
3
2
|
import React from "react";
|
|
4
3
|
/**
|
|
5
4
|
* Exceptional case for this file:
|
|
@@ -9,9 +8,33 @@ import React from "react";
|
|
|
9
8
|
* bundle the svg assets used here, and we end up with some broken style.
|
|
10
9
|
*/
|
|
11
10
|
import "./Select.scss";
|
|
12
|
-
|
|
11
|
+
import { FormFieldWidth } from "../Form/form.types";
|
|
12
|
+
interface OptionMinimal {
|
|
13
|
+
value: any;
|
|
14
|
+
label?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SelectProps<Option extends OptionMinimal = OptionMinimal, IsMulti extends boolean = any, Group extends GroupBase<Option> = GroupBase<Option>> extends Props<Option, IsMulti, Group> {
|
|
17
|
+
isError?: boolean;
|
|
18
|
+
width?: FormFieldWidth;
|
|
19
|
+
/**
|
|
20
|
+
* REASON: this could be a ticket to fix later on, but react-select has some tricky types to navigate
|
|
21
|
+
* imo there's little to no value spending time on fixing it properly since it already works.
|
|
22
|
+
*
|
|
23
|
+
* This change is protected by policy: https://app.glassfrog.com/organizations/13950/orgnav/policies/12870328
|
|
24
|
+
*/
|
|
25
|
+
value?: any;
|
|
26
|
+
}
|
|
13
27
|
/**
|
|
14
|
-
*
|
|
28
|
+
* A wrapper around react-select to style it according to our design specification.
|
|
29
|
+
*
|
|
30
|
+
* In addition, the value is taken out of the option, instead of returning the complete option.
|
|
31
|
+
*
|
|
32
|
+
* Care when using grouped options: the value of the options overspanning all groups need to be unique!
|
|
33
|
+
* For instance, if you have an option with value "chocolate" in both the groups "flavor" and "dip", then you get unforeseen errors.
|
|
34
|
+
* This is a problem within react-select itself, not our wrapper.
|
|
35
|
+
*
|
|
36
|
+
* Care when using defaultValue: this still requires the complete Option (instead of the value of the Option).
|
|
37
|
+
* So far there wasn't a use-case for this.
|
|
15
38
|
*/
|
|
16
|
-
declare const
|
|
17
|
-
export
|
|
39
|
+
export declare const Select: React.ForwardRefExoticComponent<SelectProps<OptionMinimal, boolean, GroupBase<OptionMinimal>> & React.RefAttributes<unknown>>;
|
|
40
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export { RadioGroupProps, RadioGroupV2, } from "./components/RadioGroup/RadioGro
|
|
|
50
50
|
export { default as Section } from "./components/Section/Section";
|
|
51
51
|
export { default as SectionItemWithContent } from "./components/Section/SectionItemWithContent";
|
|
52
52
|
export { default as SectionItem, SectionItemProps, } from "./components/Section/SectionItem";
|
|
53
|
-
export { SelectProps, Select } from "./components/Select/
|
|
53
|
+
export { SelectProps, Select } from "./components/Select/Select";
|
|
54
54
|
export { SettingsMenuButton, SettingsMenuButtonProps, } from "./components/SettingsMenuButton/SettingsMenuButton";
|
|
55
55
|
export { Spinner } from "./components/Spinner/Spinner";
|
|
56
56
|
export { Steps } from "./components/Steps/Steps";
|
|
@@ -3667,6 +3667,8 @@ var PaginationMenuSmall = function PaginationMenuSmall(props) {
|
|
|
3667
3667
|
var css_248z$f = ".customized-select [class*=\"IndicatorsContainer\"] {\n background: url(\"data:image/svg+xml,%3Csvg width%3D%228%22 height%3D%2214%22 viewBox%3D%220 0 8 14%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M4 0C4.26522 5.96046e-08 4.51957 0.105357 4.70711 0.292893L7.70711 3.29289C8.09763 3.68342 8.09763 4.31658 7.70711 4.70711C7.31658 5.09763 6.68342 5.09763 6.29289 4.70711L4 2.41421L1.70711 4.70711C1.31658 5.09763 0.683417 5.09763 0.292893 4.70711C-0.0976311 4.31658 -0.097631 3.68342 0.292893 3.29289L3.29289 0.292893C3.48043 0.105357 3.73478 0 4 0ZM0.292893 9.29289C0.683417 8.90237 1.31658 8.90237 1.70711 9.29289L4 11.5858L6.29289 9.29289C6.68342 8.90237 7.31658 8.90237 7.70711 9.29289C8.09763 9.68342 8.09763 10.3166 7.70711 10.7071L4.70711 13.7071C4.31658 14.0976 3.68342 14.0976 3.29289 13.7071L0.292893 10.7071C-0.0976311 10.3166 -0.0976311 9.68342 0.292893 9.29289Z%22 fill%3D%22%239CA3AF%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n opacity: 0.5;\n transition: opacity 0.3s ease-in-out;\n margin-right: 0.75rem;\n}\n\n.customized-select [class*=\"IndicatorsContainer\"] svg {\n display: none;\n}\n\n.customized-select [class*=\"MenuList\"] [class*=\"option\"]::after {\n position: absolute;\n content: \"\";\n background: url(\"data:image/svg+xml,%3Csvg xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22%3E %3Cg transform%3D%22translate(1.5%2C 0.5)%22%3E %3Cpath fill%3D%22none%22 fill-rule%3D%22evenodd%22 stroke%3D%22%230074DD%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22 stroke-width%3D%222%22 d%3D%22M12.643 3.357L6.03 9.97l-2.674 2.674L0 9.286%22%2F%3E %3C%2Fg%3E%3C%2Fsvg%3E\") no-repeat center;\n right: 12px;\n height: 1rem;\n width: 1rem;\n}\n";
|
|
3668
3668
|
styleInject(css_248z$f);
|
|
3669
3669
|
|
|
3670
|
+
var _excluded$d = ["isError", "styles", "options", "onChange", "value", "width", "isMulti", "className"];
|
|
3671
|
+
|
|
3670
3672
|
function generateCustomStyles(hasError, isIE11) {
|
|
3671
3673
|
return {
|
|
3672
3674
|
option: function option(baseStyles, state) {
|
|
@@ -3678,15 +3680,14 @@ function generateCustomStyles(hasError, isIE11) {
|
|
|
3678
3680
|
position: "relative",
|
|
3679
3681
|
padding: "0.75rem",
|
|
3680
3682
|
opacity: state.isDisabled ? "0.5" : 1,
|
|
3683
|
+
"&:after": {
|
|
3684
|
+
visibility: state.isSelected ? "visible" : "hidden"
|
|
3685
|
+
},
|
|
3681
3686
|
transition: "background-color 0.3s ease-in-out",
|
|
3682
3687
|
"&:hover": {
|
|
3683
3688
|
// tailwind blue-50
|
|
3684
3689
|
backgroundColor: state.isSelected ? "transparent" : "#F2FAFD"
|
|
3685
3690
|
},
|
|
3686
|
-
// The static styles of this pseudo-element is in ./Select.scss
|
|
3687
|
-
"&:after": {
|
|
3688
|
-
visibility: state.isSelected ? "visible" : "hidden"
|
|
3689
|
-
},
|
|
3690
3691
|
pointerEvents: state.isDisabled ? "none" : "auto"
|
|
3691
3692
|
});
|
|
3692
3693
|
},
|
|
@@ -3740,7 +3741,6 @@ function generateCustomStyles(hasError, isIE11) {
|
|
|
3740
3741
|
display: "none"
|
|
3741
3742
|
};
|
|
3742
3743
|
},
|
|
3743
|
-
// The indicatorContainer styles is added via the `Select.scss` file.
|
|
3744
3744
|
menu: function menu(baseStyles) {
|
|
3745
3745
|
return _extends({}, baseStyles, {
|
|
3746
3746
|
zIndex: 20
|
|
@@ -3749,21 +3749,73 @@ function generateCustomStyles(hasError, isIE11) {
|
|
|
3749
3749
|
};
|
|
3750
3750
|
}
|
|
3751
3751
|
/**
|
|
3752
|
-
*
|
|
3752
|
+
* A wrapper around react-select to style it according to our design specification.
|
|
3753
|
+
*
|
|
3754
|
+
* In addition, the value is taken out of the option, instead of returning the complete option.
|
|
3755
|
+
*
|
|
3756
|
+
* Care when using grouped options: the value of the options overspanning all groups need to be unique!
|
|
3757
|
+
* For instance, if you have an option with value "chocolate" in both the groups "flavor" and "dip", then you get unforeseen errors.
|
|
3758
|
+
* This is a problem within react-select itself, not our wrapper.
|
|
3759
|
+
*
|
|
3760
|
+
* Care when using defaultValue: this still requires the complete Option (instead of the value of the Option).
|
|
3761
|
+
* So far there wasn't a use-case for this.
|
|
3753
3762
|
*/
|
|
3763
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3754
3764
|
|
|
3755
3765
|
|
|
3756
|
-
var
|
|
3757
|
-
var
|
|
3758
|
-
|
|
3759
|
-
|
|
3766
|
+
var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, innerRef) {
|
|
3767
|
+
var _ref$isError = _ref.isError,
|
|
3768
|
+
isError = _ref$isError === void 0 ? false : _ref$isError,
|
|
3769
|
+
styles = _ref.styles,
|
|
3770
|
+
options = _ref.options,
|
|
3771
|
+
onChange = _ref.onChange,
|
|
3772
|
+
value = _ref.value,
|
|
3773
|
+
_ref$width = _ref.width,
|
|
3774
|
+
width = _ref$width === void 0 ? "full" : _ref$width,
|
|
3775
|
+
isMulti = _ref.isMulti,
|
|
3776
|
+
className = _ref.className,
|
|
3777
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$d);
|
|
3778
|
+
|
|
3760
3779
|
var isIE11 = "MSInputMethodContext" in window && "documentMode" in document;
|
|
3761
|
-
var customStyles = generateCustomStyles(
|
|
3762
|
-
var mergedStyles = ReactSelect.mergeStyles(customStyles, styles);
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3780
|
+
var customStyles = generateCustomStyles(isError, isIE11);
|
|
3781
|
+
var mergedStyles = ReactSelect.mergeStyles(customStyles, styles); // the options can be either a list of options or a grouped list of options
|
|
3782
|
+
// this is a typechecker to verify it is the case.
|
|
3783
|
+
|
|
3784
|
+
var isOptionsGrouped = !options ? false : options.reduce(function (acc, o) {
|
|
3785
|
+
return acc || "options" in o && !("values" in o);
|
|
3786
|
+
}, false); // we subsequently flatmap to ensure it's always a list of options
|
|
3787
|
+
|
|
3788
|
+
var flatmappedOptions = !options ? [] : isOptionsGrouped ? options.flatMap(function (g) {
|
|
3789
|
+
return g.options;
|
|
3790
|
+
}) : options; // based on: https://stackoverflow.com/a/70022957
|
|
3791
|
+
|
|
3792
|
+
var onChangeWrapped = !onChange ? undefined : isMulti ? function (val, a) {
|
|
3793
|
+
return onChange(val.map(function (v) {
|
|
3794
|
+
return v.value;
|
|
3795
|
+
}), a);
|
|
3796
|
+
} : function (val, a) {
|
|
3797
|
+
return onChange(val == null ? void 0 : val.value, a);
|
|
3798
|
+
}; // TODO: how can we report the error if a value was given that is not within the options?
|
|
3799
|
+
|
|
3800
|
+
var valueWrapped = !value || !options ? value : isMulti ? flatmappedOptions.filter(function (o) {
|
|
3801
|
+
return value.includes(o.value);
|
|
3802
|
+
}) : flatmappedOptions.find(function (o) {
|
|
3803
|
+
return o.value === value;
|
|
3804
|
+
});
|
|
3805
|
+
return /*#__PURE__*/React__default.createElement(ReactSelect__default, _extends({}, otherProps, {
|
|
3806
|
+
ref: innerRef,
|
|
3807
|
+
styles: mergedStyles,
|
|
3808
|
+
options: options,
|
|
3809
|
+
onChange: onChangeWrapped,
|
|
3810
|
+
value: valueWrapped,
|
|
3811
|
+
isMulti: isMulti,
|
|
3812
|
+
className: classNames("customized-select", className, {
|
|
3813
|
+
"w-16": width === "sm",
|
|
3814
|
+
"w-32": width === "md",
|
|
3815
|
+
"w-56": width === "lg",
|
|
3816
|
+
"w-80": width === "xl",
|
|
3817
|
+
"flex-grow": width === "full"
|
|
3818
|
+
})
|
|
3767
3819
|
}));
|
|
3768
3820
|
});
|
|
3769
3821
|
|
|
@@ -3806,13 +3858,13 @@ var getSummaryText = function getSummaryText(pageCount, currentPageNumber, local
|
|
|
3806
3858
|
};
|
|
3807
3859
|
|
|
3808
3860
|
var PaginationMenuLarge = function PaginationMenuLarge(props) {
|
|
3809
|
-
var handleOnPageNumberSelect = function handleOnPageNumberSelect(
|
|
3810
|
-
|
|
3861
|
+
var handleOnPageNumberSelect = function handleOnPageNumberSelect(value) {
|
|
3862
|
+
props.onChange(value, props.pageSize);
|
|
3811
3863
|
};
|
|
3812
3864
|
|
|
3813
|
-
var handleOnPageSizeSelect = function handleOnPageSizeSelect(
|
|
3865
|
+
var handleOnPageSizeSelect = function handleOnPageSizeSelect(value) {
|
|
3814
3866
|
var pageSize = PAGE_SIZE_OPTIONS.find(function (option) {
|
|
3815
|
-
return option ===
|
|
3867
|
+
return option.value === value;
|
|
3816
3868
|
});
|
|
3817
3869
|
pageSize && props.onChange(1, pageSize.value);
|
|
3818
3870
|
};
|
|
@@ -3826,25 +3878,19 @@ var PaginationMenuLarge = function PaginationMenuLarge(props) {
|
|
|
3826
3878
|
className: "flex flex-row items-center"
|
|
3827
3879
|
}, props.pageSize && props.resultCount && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Text, {
|
|
3828
3880
|
text: props.localization.display
|
|
3829
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
3881
|
+
}), /*#__PURE__*/React__default.createElement(Select, {
|
|
3830
3882
|
className: "w-24 ml-2 mr-4",
|
|
3831
3883
|
options: PAGE_SIZE_OPTIONS,
|
|
3832
3884
|
onChange: handleOnPageSizeSelect,
|
|
3833
|
-
value:
|
|
3834
|
-
label: props.pageSize.toString(),
|
|
3835
|
-
value: props.pageSize
|
|
3836
|
-
},
|
|
3885
|
+
value: props.pageSize,
|
|
3837
3886
|
menuPlacement: "auto"
|
|
3838
3887
|
})), /*#__PURE__*/React__default.createElement(Text, {
|
|
3839
3888
|
text: props.localization.page
|
|
3840
|
-
}), /*#__PURE__*/React__default.createElement(
|
|
3889
|
+
}), /*#__PURE__*/React__default.createElement(Select, {
|
|
3841
3890
|
className: "w-24 ml-2",
|
|
3842
3891
|
options: getPageNumberOptions(props.pageCount),
|
|
3843
3892
|
onChange: handleOnPageNumberSelect,
|
|
3844
|
-
value:
|
|
3845
|
-
label: props.currentPageNumber.toString(),
|
|
3846
|
-
value: props.currentPageNumber
|
|
3847
|
-
},
|
|
3893
|
+
value: props.currentPageNumber,
|
|
3848
3894
|
isDisabled: props.pageCount < 2,
|
|
3849
3895
|
menuPlacement: "auto"
|
|
3850
3896
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -3904,7 +3950,7 @@ var TableFooter = function TableFooter(props) {
|
|
|
3904
3950
|
}, props.paginationMenuProps)))));
|
|
3905
3951
|
};
|
|
3906
3952
|
|
|
3907
|
-
var _excluded$
|
|
3953
|
+
var _excluded$e = ["items", "fieldConfigurations", "emptyRowsText", "emptyFieldContentText", "isLoading", "showHeader", "paginationMenuProps", "onRowClick", "className", "dataTestId"];
|
|
3908
3954
|
function Table(_ref) {
|
|
3909
3955
|
var items = _ref.items,
|
|
3910
3956
|
fieldConfigurations = _ref.fieldConfigurations,
|
|
@@ -3918,7 +3964,7 @@ function Table(_ref) {
|
|
|
3918
3964
|
onRowClick = _ref.onRowClick,
|
|
3919
3965
|
className = _ref.className,
|
|
3920
3966
|
dataTestId = _ref.dataTestId,
|
|
3921
|
-
otherAttributes = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
3967
|
+
otherAttributes = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
|
3922
3968
|
|
|
3923
3969
|
// For not displaying empty view at creation
|
|
3924
3970
|
var _useState = React.useState(true),
|
|
@@ -4870,7 +4916,7 @@ Page.propTypes = {
|
|
|
4870
4916
|
navLayoutProps: PropTypes.object
|
|
4871
4917
|
};
|
|
4872
4918
|
|
|
4873
|
-
var _excluded$
|
|
4919
|
+
var _excluded$f = ["text", "type", "className"];
|
|
4874
4920
|
var TITLE_TYPE_OPTIONS = {
|
|
4875
4921
|
DEFAULT: "default",
|
|
4876
4922
|
BIG: "big",
|
|
@@ -4889,7 +4935,7 @@ function LegacyTitle(_ref) {
|
|
|
4889
4935
|
type = _ref.type,
|
|
4890
4936
|
_ref$className = _ref.className,
|
|
4891
4937
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
4892
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
4938
|
+
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
|
4893
4939
|
|
|
4894
4940
|
var ContainerElement;
|
|
4895
4941
|
var containerClassName = classNames("cweb-title", className, {
|
|
@@ -5274,7 +5320,7 @@ Radio.propTypes = {
|
|
|
5274
5320
|
var css_248z$m = ".cweb-radio-group {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n align-items: center;\n}\n\n.cweb-radio-group > .cweb-radio {\n flex: 0 0 auto;\n margin-right: 8px;\n}\n\n.cweb-radio-group .cweb-form-field {\n margin-bottom: 12px;\n}\n\n.cweb-radio-group .cweb-form-info-text {\n margin-left: 1.5rem;\n}\n\n.cweb-radio-group.vertical {\n display: flex;\n justify-content: flex-start;\n flex-direction: column;\n align-items: flex-start;\n}\n\n.cweb-radio-group.vertical .cweb-form-field:not(:last-child) {\n margin-bottom: 8px;\n}\n\n.cweb-radio-group.vertical > .cweb-radio {\n flex: 0 0 auto;\n margin-bottom: 8px;\n}\n\n.cweb-radio-group.hasError > .cweb-radio .cweb-radio-icon-container {\n border: 1px solid #ff6266 !important;\n}\n";
|
|
5275
5321
|
styleInject(css_248z$m);
|
|
5276
5322
|
|
|
5277
|
-
var _excluded$
|
|
5323
|
+
var _excluded$g = ["className", "radioClassName", "name", "selectedOption", "isVertical", "radioOptions", "onChange", "error", "isDisabled"];
|
|
5278
5324
|
/**
|
|
5279
5325
|
* @deprecated: use RadioV2 instead
|
|
5280
5326
|
*/
|
|
@@ -5289,7 +5335,7 @@ function RadioGroup(_ref) {
|
|
|
5289
5335
|
onChange = _ref.onChange,
|
|
5290
5336
|
error = _ref.error,
|
|
5291
5337
|
isDisabled = _ref.isDisabled,
|
|
5292
|
-
otherOptions = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5338
|
+
otherOptions = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
5293
5339
|
|
|
5294
5340
|
var containerClassName = classNames("cweb-radio-group", {
|
|
5295
5341
|
vertical: isVertical
|
|
@@ -5335,7 +5381,7 @@ RadioGroup.propTypes = {
|
|
|
5335
5381
|
var css_248z$n = ".cweb-section .cweb-button:last-of-type {\n margin-right: 24px;\n}\n\n.cweb-section .cweb-button:not(:last-of-type) {\n margin-right: 8px;\n}\n\n.cweb-section .cweb-button.add-button, .cweb-section .cweb-button.edit-button, .cweb-section .cweb-button.delete-button {\n margin-left: auto;\n width: 32px;\n height: 32px;\n}\n\n.cweb-section .cweb-button.add-button {\n background: url(\"data:image/svg+xml,%3Csvg width%3D%2244%22 height%3D%2244%22 viewBox%3D%220 0 44 44%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle cx%3D%2222%22 cy%3D%2222%22 r%3D%2222%22 fill%3D%22white%22%2F%3E%3Crect x%3D%220.5%22 y%3D%220.5%22 width%3D%2243%22 height%3D%2243%22 rx%3D%2221.5%22 stroke%3D%22%23009FE3%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M22 32C23.1046 32 24 31.1046 24 30L24 24H30C31.1046 24 32 23.1046 32 22C32 20.8954 31.1046 20 30 20H24L24 14C24 12.8954 23.1046 12 22 12C20.8954 12 20 12.8954 20 14L20 20H14C12.8954 20 12 20.8954 12 22C12 23.1046 12.8954 24 14 24H20L20 30C20 31.1046 20.8954 32 22 32Z%22 fill%3D%22%23009FE3%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n background-size: contain;\n}\n\n.cweb-section .cweb-button.add-button:hover, .cweb-section .cweb-button.add-button:active, .cweb-section .cweb-button.add-button:focus {\n background: url(\"data:image/svg+xml,%3Csvg width%3D%2244%22 height%3D%2244%22 viewBox%3D%220 0 44 44%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect x%3D%220.5%22 y%3D%220.5%22 width%3D%2243%22 height%3D%2243%22 rx%3D%2221.5%22 stroke%3D%22%230A78B2%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M21 12C19.8954 12 19 12.8954 19 14V19L14 19C12.8954 19 12 19.8954 12 21V23C12 24.1046 12.8954 25 14 25H19V30C19 31.1046 19.8954 32 21 32H23C24.1046 32 25 31.1046 25 30V25H30C31.1046 25 32 24.1046 32 23V21C32 19.8954 31.1046 19 30 19L25 19V14C25 12.8954 24.1046 12 23 12H21Z%22 fill%3D%22%23007BBB%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n background-size: contain;\n}\n\n.cweb-section .cweb-button.edit-button {\n background: url(\"data:image/svg+xml,%3Csvg width%3D%2244%22 height%3D%2244%22 viewBox%3D%220 0 44 44%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect x%3D%220.5%22 y%3D%220.5%22 width%3D%2243%22 height%3D%2243%22 rx%3D%2221.5%22 stroke%3D%22%23009FE3%22%2F%3E%3Cpath d%3D%22M13.5643 27.1001C13.4169 26.9527 13.1433 27.0159 13.1012 27.2266L12.0065 31.6507C11.9644 31.8614 12.1328 32.051 12.3433 31.9878L16.7851 30.9134C16.9956 30.8712 17.0799 30.5973 16.9114 30.4499L13.5643 27.1001Z%22 fill%3D%22%23009FE3%22%2F%3E%3Cpath d%3D%22M26.2161 14.1222C26.1109 14.0169 25.9214 14.0169 25.8161 14.1222L14.4484 25.4987C14.3432 25.604 14.3432 25.7936 14.4484 25.8989L18.1114 29.5647C18.2166 29.67 18.4061 29.67 18.5113 29.5647L29.879 18.1882C29.9843 18.0829 29.9843 17.8933 29.879 17.788L26.2161 14.1222Z%22 fill%3D%22%23009FE3%22%2F%3E%3Cpath d%3D%22M31.1633 12.8374C30.0475 11.7209 28.2161 11.7209 27.1004 12.8374C27.0583 12.8796 27.0583 12.9217 27.1004 12.9638L31.037 16.9035C31.0791 16.9456 31.1212 16.9456 31.1633 16.9035C32.279 15.7869 32.279 13.954 31.1633 12.8374Z%22 fill%3D%22%23009FE3%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n background-size: contain;\n}\n\n.cweb-section .cweb-button.edit-button:hover, .cweb-section .cweb-button.edit-button:active, .cweb-section .cweb-button.edit-button:focus {\n background: url(\"data:image/svg+xml,%3Csvg width%3D%2244%22 height%3D%2244%22 viewBox%3D%220 0 44 44%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect x%3D%220.5%22 y%3D%220.5%22 width%3D%2243%22 height%3D%2243%22 rx%3D%2221.5%22 stroke%3D%22%23007BBB%22%2F%3E%3Cpath d%3D%22M13.5643 27.1001C13.4169 26.9527 13.1433 27.0159 13.1012 27.2266L12.0065 31.6507C11.9644 31.8614 12.1328 32.051 12.3433 31.9878L16.7851 30.9134C16.9956 30.8712 17.0799 30.5973 16.9114 30.4499L13.5643 27.1001Z%22 fill%3D%22%230A78B2%22%2F%3E%3Cpath d%3D%22M26.2161 14.1222C26.1109 14.0169 25.9214 14.0169 25.8161 14.1222L14.4484 25.4987C14.3432 25.604 14.3432 25.7936 14.4484 25.8989L18.1114 29.5647C18.2166 29.67 18.4061 29.67 18.5113 29.5647L29.879 18.1882C29.9843 18.0829 29.9843 17.8933 29.879 17.788L26.2161 14.1222Z%22 fill%3D%22%230A78B2%22%2F%3E%3Cpath d%3D%22M31.1633 12.8374C30.0475 11.7209 28.2161 11.7209 27.1004 12.8374C27.0583 12.8796 27.0583 12.9217 27.1004 12.9638L31.037 16.9035C31.0791 16.9456 31.1212 16.9456 31.1633 16.9035C32.279 15.7869 32.279 13.954 31.1633 12.8374Z%22 fill%3D%22%230A78B2%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n background-size: contain;\n}\n\n.cweb-section .cweb-button.delete-button {\n background: url(\"data:image/svg+xml,%3Csvg width%3D%2244%22 height%3D%2244%22 viewBox%3D%220 0 44 44%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect x%3D%220.5%22 y%3D%220.5%22 width%3D%2243%22 height%3D%2243%22 rx%3D%2221.5%22 stroke%3D%22%23FF6266%22%2F%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M13 12C12.4477 12 12 12.4477 12 13C12 13.5523 12.4477 14 13 14H31C31.5523 14 32 13.5523 32 13C32 12.4477 31.5523 12 31 12H13ZM14 16H30V30C30 31.1046 29.1046 32 28 32H16C14.8954 32 14 31.1046 14 30V16ZM17 18H19V30H17V18ZM21 18H23V30H21V18ZM27 18H25V30H27V18Z%22 fill%3D%22%23FF6266%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n background-size: contain;\n}\n\n.cweb-section .cweb-button.delete-button:hover, .cweb-section .cweb-button.delete-button:active, .cweb-section .cweb-button.delete-button:focus {\n background: url(\"data:image/svg+xml,%3Csvg width%3D%2244%22 height%3D%2244%22 viewBox%3D%220 0 44 44%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath fill-rule%3D%22evenodd%22 clip-rule%3D%22evenodd%22 d%3D%22M13 12C12.4477 12 12 12.4477 12 13C12 13.5523 12.4477 14 13 14H31C31.5523 14 32 13.5523 32 13C32 12.4477 31.5523 12 31 12H13ZM14 16H30V30C30 31.1046 29.1046 32 28 32H16C14.8954 32 14 31.1046 14 30V16ZM17 18H19V30H17V18ZM21 18H23V30H21V18ZM27 18H25V30H27V18Z%22 fill%3D%22%23FC494E%22%2F%3E%3Crect x%3D%220.5%22 y%3D%220.5%22 width%3D%2243%22 height%3D%2243%22 rx%3D%2221.5%22 stroke%3D%22%23FC494E%22%2F%3E%3C%2Fsvg%3E\") no-repeat center;\n background-size: contain;\n}\n\n.cweb-section > .cweb-section-header {\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n border-bottom: 1px solid #eeeeee;\n width: 100%;\n padding: 18px 24px;\n}\n\n.cweb-section > .cweb-section-footer {\n display: flex;\n justify-content: space-between;\n flex-direction: row;\n align-items: center;\n border-top: 1px solid #eeeeee;\n width: 100%;\n padding: 1rem 24px 1rem 24px;\n}\n\n.cweb-section > .cweb-section-footer img {\n width: 32px;\n height: 32px;\n}\n";
|
|
5336
5382
|
styleInject(css_248z$n);
|
|
5337
5383
|
|
|
5338
|
-
var _excluded$
|
|
5384
|
+
var _excluded$h = ["title", "buttons", "footer", "children", "className", "isLoading", "loadingIndicatorProps"];
|
|
5339
5385
|
function Section(_ref) {
|
|
5340
5386
|
var title = _ref.title,
|
|
5341
5387
|
buttons = _ref.buttons,
|
|
@@ -5345,7 +5391,7 @@ function Section(_ref) {
|
|
|
5345
5391
|
_ref$isLoading = _ref.isLoading,
|
|
5346
5392
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
5347
5393
|
loadingIndicatorProps = _ref.loadingIndicatorProps,
|
|
5348
|
-
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5394
|
+
restProps = _objectWithoutPropertiesLoose(_ref, _excluded$h);
|
|
5349
5395
|
|
|
5350
5396
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, restProps, {
|
|
5351
5397
|
className: classNames("cweb-section", "flex justify-start flex-col items-start", "rounded-lg", "mx-0 my-4", "bg-white", "w-full", className)
|
|
@@ -5376,12 +5422,12 @@ function Section(_ref) {
|
|
|
5376
5422
|
var css_248z$o = ".cweb-list-item {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n align-items: center;\n padding: 16px 0 16px 0;\n border-bottom: 1px solid #eeeeee;\n}\n\n.cweb-list-item:last-child {\n border-bottom: none;\n}\n\n.cweb-list-item.cweb-list-item-clickable {\n cursor: pointer;\n}\n\n.cweb-list-item.cweb-list-item-clickable:hover {\n background-color: #f2fafd;\n}\n";
|
|
5377
5423
|
styleInject(css_248z$o);
|
|
5378
5424
|
|
|
5379
|
-
var _excluded$
|
|
5425
|
+
var _excluded$i = ["children", "className", "onClick"];
|
|
5380
5426
|
var SectionItem = function SectionItem(props) {
|
|
5381
5427
|
var children = props.children,
|
|
5382
5428
|
className = props.className,
|
|
5383
5429
|
onClick = props.onClick,
|
|
5384
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5430
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$i);
|
|
5385
5431
|
|
|
5386
5432
|
var classes = classNames("cweb-list-item", className, {
|
|
5387
5433
|
"cweb-list-item-clickable": !!onClick
|
|
@@ -5392,7 +5438,7 @@ var SectionItem = function SectionItem(props) {
|
|
|
5392
5438
|
}, rest), children);
|
|
5393
5439
|
};
|
|
5394
5440
|
|
|
5395
|
-
var _excluded$
|
|
5441
|
+
var _excluded$j = ["text", "icon", "className", "iconClass", "onClick"];
|
|
5396
5442
|
|
|
5397
5443
|
function SectionItemWithContent(props) {
|
|
5398
5444
|
var text = props.text,
|
|
@@ -5400,7 +5446,7 @@ function SectionItemWithContent(props) {
|
|
|
5400
5446
|
className = props.className,
|
|
5401
5447
|
iconClass = props.iconClass,
|
|
5402
5448
|
onClick = props.onClick,
|
|
5403
|
-
rest = _objectWithoutPropertiesLoose(props, _excluded$
|
|
5449
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded$j);
|
|
5404
5450
|
|
|
5405
5451
|
var mergedClasses = classNames("cweb-section-text-item", className);
|
|
5406
5452
|
var iconClasses = classNames("w-6 h-6 mr-4", iconClass);
|
|
@@ -5416,158 +5462,6 @@ function SectionItemWithContent(props) {
|
|
|
5416
5462
|
}));
|
|
5417
5463
|
}
|
|
5418
5464
|
|
|
5419
|
-
var _excluded$j = ["isError", "styles", "options", "onChange", "value", "width", "isMulti", "className"];
|
|
5420
|
-
|
|
5421
|
-
function generateCustomStyles$1(hasError, isIE11) {
|
|
5422
|
-
return {
|
|
5423
|
-
option: function option(baseStyles, state) {
|
|
5424
|
-
return _extends({}, baseStyles, {
|
|
5425
|
-
fontWeight: state.isSelected ? "bold" : "normal",
|
|
5426
|
-
fontSize: "14px",
|
|
5427
|
-
backgroundColor: "none",
|
|
5428
|
-
color: "inherit",
|
|
5429
|
-
position: "relative",
|
|
5430
|
-
padding: "0.75rem",
|
|
5431
|
-
opacity: state.isDisabled ? "0.5" : 1,
|
|
5432
|
-
"&:after": {
|
|
5433
|
-
visibility: state.isSelected ? "visible" : "hidden"
|
|
5434
|
-
},
|
|
5435
|
-
transition: "background-color 0.3s ease-in-out",
|
|
5436
|
-
"&:hover": {
|
|
5437
|
-
// tailwind blue-50
|
|
5438
|
-
backgroundColor: state.isSelected ? "transparent" : "#F2FAFD"
|
|
5439
|
-
},
|
|
5440
|
-
pointerEvents: state.isDisabled ? "none" : "auto"
|
|
5441
|
-
});
|
|
5442
|
-
},
|
|
5443
|
-
container: function container(baseStyles) {
|
|
5444
|
-
return _extends({}, baseStyles, {
|
|
5445
|
-
flexGrow: isIE11 ? 0.5 : "initial"
|
|
5446
|
-
});
|
|
5447
|
-
},
|
|
5448
|
-
control: function control(baseStyles, state) {
|
|
5449
|
-
var defaultBorderColor = state.isFocused ? "#045baa" : "#D1D5DB";
|
|
5450
|
-
var validatedBorderColor = hasError ? "#c53030" : defaultBorderColor;
|
|
5451
|
-
var defaultOutline = hasError ? "rgba(255, 98, 102, 0.3)" : "rgba(0, 159, 227, 0.3)";
|
|
5452
|
-
var validatedOutline = "4px solid " + (state.isFocused ? defaultOutline : "transparent");
|
|
5453
|
-
return _extends({}, baseStyles, {
|
|
5454
|
-
fontSize: "14px",
|
|
5455
|
-
transition: "border 0.3s ease-in-out",
|
|
5456
|
-
height: isIE11 ? "50px" : "2.75rem",
|
|
5457
|
-
// primary outline
|
|
5458
|
-
outline: validatedOutline,
|
|
5459
|
-
borderColor: validatedBorderColor,
|
|
5460
|
-
borderWidth: "1px !important",
|
|
5461
|
-
borderStyle: "solid",
|
|
5462
|
-
borderRadius: "4px",
|
|
5463
|
-
boxShadow: "0px 1px 2px rgba(0, 0, 0, 0.05)",
|
|
5464
|
-
"&:hover": {
|
|
5465
|
-
borderColor: "#9CA3AF",
|
|
5466
|
-
// selector for the chevron
|
|
5467
|
-
'> [class*="IndicatorsContainer"]': {
|
|
5468
|
-
opacity: 1
|
|
5469
|
-
}
|
|
5470
|
-
}
|
|
5471
|
-
});
|
|
5472
|
-
},
|
|
5473
|
-
// The placeholder has the following css prop: grid-area: 1/1/2/3;
|
|
5474
|
-
// And grid-area doesn't work on IE11, so we need to style it slightly different.
|
|
5475
|
-
placeholder: function placeholder(baseStyles) {
|
|
5476
|
-
return _extends({}, baseStyles, {
|
|
5477
|
-
fontWeight: 100,
|
|
5478
|
-
color: "#6B7280",
|
|
5479
|
-
paddingTop: isIE11 ? "1.2rem" : undefined
|
|
5480
|
-
});
|
|
5481
|
-
},
|
|
5482
|
-
singleValue: function singleValue(baseStyles) {
|
|
5483
|
-
return _extends({}, baseStyles, {
|
|
5484
|
-
paddingTop: isIE11 ? "1.2rem" : undefined,
|
|
5485
|
-
fontSize: "14px"
|
|
5486
|
-
});
|
|
5487
|
-
},
|
|
5488
|
-
indicatorSeparator: function indicatorSeparator() {
|
|
5489
|
-
return {
|
|
5490
|
-
display: "none"
|
|
5491
|
-
};
|
|
5492
|
-
},
|
|
5493
|
-
menu: function menu(baseStyles) {
|
|
5494
|
-
return _extends({}, baseStyles, {
|
|
5495
|
-
zIndex: 20
|
|
5496
|
-
});
|
|
5497
|
-
}
|
|
5498
|
-
};
|
|
5499
|
-
}
|
|
5500
|
-
/**
|
|
5501
|
-
* A wrapper around react-select to style it according to our design specification.
|
|
5502
|
-
*
|
|
5503
|
-
* In addition, the value is taken out of the option, instead of returning the complete option.
|
|
5504
|
-
*
|
|
5505
|
-
* Care when using grouped options: the value of the options overspanning all groups need to be unique!
|
|
5506
|
-
* For instance, if you have an option with value "chocolate" in both the groups "flavor" and "dip", then you get unforeseen errors.
|
|
5507
|
-
* This is a problem within react-select itself, not our wrapper.
|
|
5508
|
-
*
|
|
5509
|
-
* Care when using defaultValue: this still requires the complete Option (instead of the value of the Option).
|
|
5510
|
-
* So far there wasn't a use-case for this.
|
|
5511
|
-
*/
|
|
5512
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, innerRef) {
|
|
5516
|
-
var _ref$isError = _ref.isError,
|
|
5517
|
-
isError = _ref$isError === void 0 ? false : _ref$isError,
|
|
5518
|
-
styles = _ref.styles,
|
|
5519
|
-
options = _ref.options,
|
|
5520
|
-
onChange = _ref.onChange,
|
|
5521
|
-
value = _ref.value,
|
|
5522
|
-
_ref$width = _ref.width,
|
|
5523
|
-
width = _ref$width === void 0 ? "full" : _ref$width,
|
|
5524
|
-
isMulti = _ref.isMulti,
|
|
5525
|
-
className = _ref.className,
|
|
5526
|
-
otherProps = _objectWithoutPropertiesLoose(_ref, _excluded$j);
|
|
5527
|
-
|
|
5528
|
-
var isIE11 = "MSInputMethodContext" in window && "documentMode" in document;
|
|
5529
|
-
var customStyles = generateCustomStyles$1(isError, isIE11);
|
|
5530
|
-
var mergedStyles = ReactSelect.mergeStyles(customStyles, styles); // the options can be either a list of options or a grouped list of options
|
|
5531
|
-
// this is a typechecker to verify it is the case.
|
|
5532
|
-
|
|
5533
|
-
var isOptionsGrouped = !options ? false : options.reduce(function (acc, o) {
|
|
5534
|
-
return acc || "options" in o && !("values" in o);
|
|
5535
|
-
}, false); // we subsequently flatmap to ensure it's always a list of options
|
|
5536
|
-
|
|
5537
|
-
var flatmappedOptions = !options ? [] : isOptionsGrouped ? options.flatMap(function (g) {
|
|
5538
|
-
return g.options;
|
|
5539
|
-
}) : options; // based on: https://stackoverflow.com/a/70022957
|
|
5540
|
-
|
|
5541
|
-
var onChangeWrapped = !onChange ? undefined : isMulti ? function (val, a) {
|
|
5542
|
-
return onChange(val.map(function (v) {
|
|
5543
|
-
return v.value;
|
|
5544
|
-
}), a);
|
|
5545
|
-
} : function (val, a) {
|
|
5546
|
-
return onChange(val == null ? void 0 : val.value, a);
|
|
5547
|
-
}; // TODO: how can we report the error if a value was given that is not within the options?
|
|
5548
|
-
|
|
5549
|
-
var valueWrapped = !value || !options ? value : isMulti ? flatmappedOptions.filter(function (o) {
|
|
5550
|
-
return value.includes(o.value);
|
|
5551
|
-
}) : flatmappedOptions.find(function (o) {
|
|
5552
|
-
return o.value === value;
|
|
5553
|
-
});
|
|
5554
|
-
return /*#__PURE__*/React__default.createElement(ReactSelect__default, _extends({}, otherProps, {
|
|
5555
|
-
ref: innerRef,
|
|
5556
|
-
styles: mergedStyles,
|
|
5557
|
-
options: options,
|
|
5558
|
-
onChange: onChangeWrapped,
|
|
5559
|
-
value: valueWrapped,
|
|
5560
|
-
isMulti: isMulti,
|
|
5561
|
-
className: classNames("customized-select", className, {
|
|
5562
|
-
"w-16": width === "sm",
|
|
5563
|
-
"w-32": width === "md",
|
|
5564
|
-
"w-56": width === "lg",
|
|
5565
|
-
"w-80": width === "xl",
|
|
5566
|
-
"flex-grow": width === "full"
|
|
5567
|
-
})
|
|
5568
|
-
}));
|
|
5569
|
-
});
|
|
5570
|
-
|
|
5571
5465
|
var useOutsideClick = function useOutsideClick(ref, callback) {
|
|
5572
5466
|
var handleClick = function handleClick(e) {
|
|
5573
5467
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
@@ -5944,13 +5838,11 @@ var TabLinksSelect = function TabLinksSelect(_ref) {
|
|
|
5944
5838
|
};
|
|
5945
5839
|
});
|
|
5946
5840
|
|
|
5947
|
-
var handleChange = function handleChange(
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
navigate(selected == null ? void 0 : (_selected$value = selected.value) == null ? void 0 : _selected$value.href);
|
|
5841
|
+
var handleChange = function handleChange(value) {
|
|
5842
|
+
navigate(value == null ? void 0 : value.href);
|
|
5951
5843
|
};
|
|
5952
5844
|
|
|
5953
|
-
return /*#__PURE__*/React__default.createElement(
|
|
5845
|
+
return /*#__PURE__*/React__default.createElement(Select, {
|
|
5954
5846
|
value: options.filter(function (_ref3) {
|
|
5955
5847
|
var value = _ref3.value;
|
|
5956
5848
|
return (location == null ? void 0 : location.href) === (value == null ? void 0 : value.href);
|