@reltio/components 1.4.2274 → 1.4.2276
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/HOCs/withReactSelectMuiSkin/helpers.d.ts +2 -0
- package/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
- package/HOCs/withReactSelectMuiSkin/styles.js +3 -0
- package/ProfileResizablePanes/ProfileResizablePanes.js +4 -1
- package/ProfileResizablePanes/ProfileResizablePanes.spec.js +11 -0
- package/ReactSelectOption/ReactSelectOption.d.ts +2 -0
- package/ReactSelectOption/ReactSelectOption.js +8 -3
- package/SimpleDropDownSelector/SimpleDropDownSelector.d.ts +1 -1
- package/SimpleDropDownSelector/SimpleDropDownSelector.js +16 -2
- package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +1 -2
- package/SimpleDropDownSelector/components/DropDownValue/DropDownValue.module.css.js +9 -0
- package/SimpleDropDownSelector/index.d.ts +1 -0
- package/SimpleDropDownSelector/index.js +1 -0
- package/cjs/HOCs/withReactSelectMuiSkin/helpers.d.ts +2 -0
- package/cjs/HOCs/withReactSelectMuiSkin/styles.d.ts +1 -1
- package/cjs/HOCs/withReactSelectMuiSkin/styles.js +3 -0
- package/cjs/ProfileResizablePanes/ProfileResizablePanes.js +4 -1
- package/cjs/ProfileResizablePanes/ProfileResizablePanes.spec.js +11 -0
- package/cjs/ReactSelectOption/ReactSelectOption.d.ts +2 -0
- package/cjs/ReactSelectOption/ReactSelectOption.js +8 -3
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.d.ts +1 -1
- package/cjs/SimpleDropDownSelector/SimpleDropDownSelector.js +16 -2
- package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.js +2 -3
- package/cjs/SimpleDropDownSelector/components/DropDownValue/DropDownValue.module.css.js +9 -0
- package/cjs/SimpleDropDownSelector/index.d.ts +1 -0
- package/cjs/SimpleDropDownSelector/index.js +3 -1
- package/package.json +1 -1
- package/SimpleDropDownSelector/components/DropDownValue/styles.d.ts +0 -1
- package/SimpleDropDownSelector/components/DropDownValue/styles.js +0 -6
- package/cjs/SimpleDropDownSelector/components/DropDownValue/styles.d.ts +0 -1
- package/cjs/SimpleDropDownSelector/components/DropDownValue/styles.js +0 -9
|
@@ -38,11 +38,13 @@ export declare const reactSelectComponents: {
|
|
|
38
38
|
innerRef: import("prop-types").Requireable<any>;
|
|
39
39
|
isFocused: import("prop-types").Validator<boolean>;
|
|
40
40
|
isSelected: import("prop-types").Validator<boolean>;
|
|
41
|
+
isDisabled: import("prop-types").Requireable<boolean>;
|
|
41
42
|
label: import("prop-types").Requireable<string>;
|
|
42
43
|
selectProps: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
43
44
|
classes: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
44
45
|
option: import("prop-types").Requireable<string>;
|
|
45
46
|
'option--selected': import("prop-types").Requireable<string>;
|
|
47
|
+
'option--disabled': import("prop-types").Requireable<string>;
|
|
46
48
|
}>>;
|
|
47
49
|
}>>;
|
|
48
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--item" | "valueContainer--multi">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--disabled" | "option--item" | "valueContainer--multi">;
|
|
@@ -58,6 +58,9 @@ export var useStyles = makeStyles(function (theme) { return ({
|
|
|
58
58
|
'option--selected': {
|
|
59
59
|
fontWeight: 400
|
|
60
60
|
},
|
|
61
|
+
// Always defined so the dynamic class key is never `undefined`. Consumers supply the actual
|
|
62
|
+
// disabled-option styling per-instance via the `classes` prop (merged on top of this).
|
|
63
|
+
'option--disabled': {},
|
|
61
64
|
'option--item': {
|
|
62
65
|
display: 'block',
|
|
63
66
|
width: '100%',
|
|
@@ -14,7 +14,10 @@ export var ProfileResizablePanes = function (_a) {
|
|
|
14
14
|
var _c = (perspectiveSettings || {}).width, width = _c === void 0 ? DEFAULT_R_PANE_SIZE : _c;
|
|
15
15
|
var active = !isNil(defaultTab) ? defaultTab : perspectiveSettings === null || perspectiveSettings === void 0 ? void 0 : perspectiveSettings.active;
|
|
16
16
|
var activeButton = buttonsProps.find(function (button) { return button.id === active; });
|
|
17
|
-
|
|
17
|
+
// When there are no buttons (e.g. the interactions screen drives the panel purely via `active`),
|
|
18
|
+
// open state must not depend on a matching button. Only require `activeButton` when buttons exist,
|
|
19
|
+
// so a stale persisted `active` pointing to a removed tab doesn't open an empty pane.
|
|
20
|
+
var isSidePanelOpen = !isNil(active) && !disabled && (buttonsProps.length === 0 || Boolean(activeButton));
|
|
18
21
|
var handleUpdateSettings = useCallback(function (newSetting) {
|
|
19
22
|
updatePerspectiveSettings(newSetting);
|
|
20
23
|
}, [updatePerspectiveSettings]);
|
|
@@ -83,6 +83,10 @@ var setUp = function (props) {
|
|
|
83
83
|
graph: {
|
|
84
84
|
active: 1,
|
|
85
85
|
width: 320
|
|
86
|
+
},
|
|
87
|
+
interactions: {
|
|
88
|
+
active: 0,
|
|
89
|
+
width: 400
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
92
|
};
|
|
@@ -143,6 +147,13 @@ describe('ProfileResizablePanes tests', function () {
|
|
|
143
147
|
return [2 /*return*/];
|
|
144
148
|
});
|
|
145
149
|
}); });
|
|
150
|
+
it('should open the second pane when buttonsProps is empty and active is set (interactions screen)', function () {
|
|
151
|
+
var container = setUp(__assign(__assign({}, defaultProps), { perspectiveId: 'interactions', buttonsProps: [] })).container;
|
|
152
|
+
expect(screen.getByTestId('rightPanel')).toBeInTheDocument();
|
|
153
|
+
expect(isResizingDisabled(container)).toBe(false);
|
|
154
|
+
checkPanelSize(getSplitPane1(container), '60.0');
|
|
155
|
+
checkPanelSize(getSplitPane2(container), '40.0');
|
|
156
|
+
});
|
|
146
157
|
it('should render resizable panes with open second pane on button click', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
147
158
|
var _a, container, user, button2;
|
|
148
159
|
return __generator(this, function (_b) {
|
|
@@ -13,11 +13,13 @@ export namespace ReactSelectOption {
|
|
|
13
13
|
let innerRef: PropTypes.Requireable<any>;
|
|
14
14
|
let isFocused: PropTypes.Validator<boolean>;
|
|
15
15
|
let isSelected: PropTypes.Validator<boolean>;
|
|
16
|
+
let isDisabled: PropTypes.Requireable<boolean>;
|
|
16
17
|
let label: PropTypes.Requireable<string>;
|
|
17
18
|
let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
18
19
|
classes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
20
|
option: PropTypes.Requireable<string>;
|
|
20
21
|
'option--selected': PropTypes.Requireable<string>;
|
|
22
|
+
'option--disabled': PropTypes.Requireable<string>;
|
|
21
23
|
}>>;
|
|
22
24
|
}>>;
|
|
23
25
|
}
|
|
@@ -16,8 +16,11 @@ import MenuItem from '@mui/material/MenuItem';
|
|
|
16
16
|
import { ExpandedValueTooltip } from '../ExpandedValueTooltip';
|
|
17
17
|
export var ReactSelectOption = function (props) {
|
|
18
18
|
var _a;
|
|
19
|
-
var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, label = props.label, classes = props.selectProps.classes;
|
|
20
|
-
return (React.createElement(MenuItem, __assign({ className: classNames(classes.option, (_a = {},
|
|
19
|
+
var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, isDisabled = props.isDisabled, label = props.label, classes = props.selectProps.classes;
|
|
20
|
+
return (React.createElement(MenuItem, __assign({ className: classNames(classes.option, (_a = {},
|
|
21
|
+
_a[classes['option--selected']] = isSelected,
|
|
22
|
+
_a[classes['option--disabled']] = isDisabled,
|
|
23
|
+
_a)), ref: innerRef, selected: isFocused, disabled: isDisabled, component: "div" }, innerProps),
|
|
21
24
|
React.createElement(ExpandedValueTooltip, { value: label },
|
|
22
25
|
React.createElement("div", { className: classes['option--item'] }, children))));
|
|
23
26
|
};
|
|
@@ -40,11 +43,13 @@ ReactSelectOption.propTypes = {
|
|
|
40
43
|
]),
|
|
41
44
|
isFocused: PropTypes.bool.isRequired,
|
|
42
45
|
isSelected: PropTypes.bool.isRequired,
|
|
46
|
+
isDisabled: PropTypes.bool,
|
|
43
47
|
label: PropTypes.string,
|
|
44
48
|
selectProps: PropTypes.shape({
|
|
45
49
|
classes: PropTypes.shape({
|
|
46
50
|
option: PropTypes.string,
|
|
47
|
-
'option--selected': PropTypes.string
|
|
51
|
+
'option--selected': PropTypes.string,
|
|
52
|
+
'option--disabled': PropTypes.string
|
|
48
53
|
})
|
|
49
54
|
})
|
|
50
55
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropDownSelector } from '../DropDownSelector';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<(props: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ components, ...props }: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -9,13 +9,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
import React, { memo } from 'react';
|
|
13
24
|
import { DropDownSelector } from '../DropDownSelector';
|
|
14
25
|
import { DropDownValue } from './components/DropDownValue';
|
|
15
26
|
import { DropDownPlaceholder } from './components/DropDownPlaceholder';
|
|
16
|
-
var
|
|
27
|
+
var defaultComponents = {
|
|
17
28
|
SingleValue: DropDownValue,
|
|
18
29
|
Placeholder: DropDownPlaceholder
|
|
19
30
|
};
|
|
20
|
-
var SimpleDropDownSelector = function (
|
|
31
|
+
var SimpleDropDownSelector = function (_a) {
|
|
32
|
+
var components = _a.components, props = __rest(_a, ["components"]);
|
|
33
|
+
return (React.createElement(DropDownSelector, __assign({ components: __assign(__assign({}, defaultComponents), components) }, props)));
|
|
34
|
+
};
|
|
21
35
|
export default memo(SimpleDropDownSelector);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Typography from '@mui/material/Typography';
|
|
3
|
-
import
|
|
3
|
+
import styles from './DropDownValue.module.css';
|
|
4
4
|
export var DropDownValue = function (_a) {
|
|
5
5
|
var menuIsOpen = _a.selectProps.menuIsOpen, label = _a.data.label;
|
|
6
|
-
var styles = useStyles();
|
|
7
6
|
return (!menuIsOpen && (React.createElement(Typography, { "data-reltio-id": "simple-drop-down-value", variant: "body2", classes: { root: styles.value } }, label)));
|
|
8
7
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"value":"DropDownValue-value--DA2jT"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.DropDownValue-value--DA2jT{color:var(--mui-palette-text-primary)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
export default styles;
|
|
@@ -38,11 +38,13 @@ export declare const reactSelectComponents: {
|
|
|
38
38
|
innerRef: import("prop-types").Requireable<any>;
|
|
39
39
|
isFocused: import("prop-types").Validator<boolean>;
|
|
40
40
|
isSelected: import("prop-types").Validator<boolean>;
|
|
41
|
+
isDisabled: import("prop-types").Requireable<boolean>;
|
|
41
42
|
label: import("prop-types").Requireable<string>;
|
|
42
43
|
selectProps: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
43
44
|
classes: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
44
45
|
option: import("prop-types").Requireable<string>;
|
|
45
46
|
'option--selected': import("prop-types").Requireable<string>;
|
|
47
|
+
'option--disabled': import("prop-types").Requireable<string>;
|
|
46
48
|
}>>;
|
|
47
49
|
}>>;
|
|
48
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--item" | "valueContainer--multi">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"menu" | "option" | "placeholder" | "singleValue" | "dropdownIndicator" | "clearIndicator" | "control" | "groupHeading" | "multiValue" | "noOptionsMessage" | "valueContainer" | "multiValue__label" | "option--selected" | "option--disabled" | "option--item" | "valueContainer--multi">;
|
|
@@ -61,6 +61,9 @@ exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
|
|
|
61
61
|
'option--selected': {
|
|
62
62
|
fontWeight: 400
|
|
63
63
|
},
|
|
64
|
+
// Always defined so the dynamic class key is never `undefined`. Consumers supply the actual
|
|
65
|
+
// disabled-option styling per-instance via the `classes` prop (merged on top of this).
|
|
66
|
+
'option--disabled': {},
|
|
64
67
|
'option--item': {
|
|
65
68
|
display: 'block',
|
|
66
69
|
width: '100%',
|
|
@@ -40,7 +40,10 @@ var ProfileResizablePanes = function (_a) {
|
|
|
40
40
|
var _c = (perspectiveSettings || {}).width, width = _c === void 0 ? DEFAULT_R_PANE_SIZE : _c;
|
|
41
41
|
var active = !(0, ramda_1.isNil)(defaultTab) ? defaultTab : perspectiveSettings === null || perspectiveSettings === void 0 ? void 0 : perspectiveSettings.active;
|
|
42
42
|
var activeButton = buttonsProps.find(function (button) { return button.id === active; });
|
|
43
|
-
|
|
43
|
+
// When there are no buttons (e.g. the interactions screen drives the panel purely via `active`),
|
|
44
|
+
// open state must not depend on a matching button. Only require `activeButton` when buttons exist,
|
|
45
|
+
// so a stale persisted `active` pointing to a removed tab doesn't open an empty pane.
|
|
46
|
+
var isSidePanelOpen = !(0, ramda_1.isNil)(active) && !disabled && (buttonsProps.length === 0 || Boolean(activeButton));
|
|
44
47
|
var handleUpdateSettings = (0, react_1.useCallback)(function (newSetting) {
|
|
45
48
|
updatePerspectiveSettings(newSetting);
|
|
46
49
|
}, [updatePerspectiveSettings]);
|
|
@@ -88,6 +88,10 @@ var setUp = function (props) {
|
|
|
88
88
|
graph: {
|
|
89
89
|
active: 1,
|
|
90
90
|
width: 320
|
|
91
|
+
},
|
|
92
|
+
interactions: {
|
|
93
|
+
active: 0,
|
|
94
|
+
width: 400
|
|
91
95
|
}
|
|
92
96
|
}
|
|
93
97
|
};
|
|
@@ -148,6 +152,13 @@ describe('ProfileResizablePanes tests', function () {
|
|
|
148
152
|
return [2 /*return*/];
|
|
149
153
|
});
|
|
150
154
|
}); });
|
|
155
|
+
it('should open the second pane when buttonsProps is empty and active is set (interactions screen)', function () {
|
|
156
|
+
var container = setUp(__assign(__assign({}, defaultProps), { perspectiveId: 'interactions', buttonsProps: [] })).container;
|
|
157
|
+
expect(react_2.screen.getByTestId('rightPanel')).toBeInTheDocument();
|
|
158
|
+
expect(isResizingDisabled(container)).toBe(false);
|
|
159
|
+
checkPanelSize(getSplitPane1(container), '60.0');
|
|
160
|
+
checkPanelSize(getSplitPane2(container), '40.0');
|
|
161
|
+
});
|
|
151
162
|
it('should render resizable panes with open second pane on button click', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
152
163
|
var _a, container, user, button2;
|
|
153
164
|
return __generator(this, function (_b) {
|
|
@@ -13,11 +13,13 @@ export namespace ReactSelectOption {
|
|
|
13
13
|
let innerRef: PropTypes.Requireable<any>;
|
|
14
14
|
let isFocused: PropTypes.Validator<boolean>;
|
|
15
15
|
let isSelected: PropTypes.Validator<boolean>;
|
|
16
|
+
let isDisabled: PropTypes.Requireable<boolean>;
|
|
16
17
|
let label: PropTypes.Requireable<string>;
|
|
17
18
|
let selectProps: PropTypes.Requireable<PropTypes.InferProps<{
|
|
18
19
|
classes: PropTypes.Requireable<PropTypes.InferProps<{
|
|
19
20
|
option: PropTypes.Requireable<string>;
|
|
20
21
|
'option--selected': PropTypes.Requireable<string>;
|
|
22
|
+
'option--disabled': PropTypes.Requireable<string>;
|
|
21
23
|
}>>;
|
|
22
24
|
}>>;
|
|
23
25
|
}
|
|
@@ -22,8 +22,11 @@ var MenuItem_1 = __importDefault(require("@mui/material/MenuItem"));
|
|
|
22
22
|
var ExpandedValueTooltip_1 = require("../ExpandedValueTooltip");
|
|
23
23
|
var ReactSelectOption = function (props) {
|
|
24
24
|
var _a;
|
|
25
|
-
var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, label = props.label, classes = props.selectProps.classes;
|
|
26
|
-
return (react_1.default.createElement(MenuItem_1.default, __assign({ className: (0, classnames_1.default)(classes.option, (_a = {},
|
|
25
|
+
var innerProps = props.innerProps, innerRef = props.innerRef, children = props.children, isFocused = props.isFocused, isSelected = props.isSelected, isDisabled = props.isDisabled, label = props.label, classes = props.selectProps.classes;
|
|
26
|
+
return (react_1.default.createElement(MenuItem_1.default, __assign({ className: (0, classnames_1.default)(classes.option, (_a = {},
|
|
27
|
+
_a[classes['option--selected']] = isSelected,
|
|
28
|
+
_a[classes['option--disabled']] = isDisabled,
|
|
29
|
+
_a)), ref: innerRef, selected: isFocused, disabled: isDisabled, component: "div" }, innerProps),
|
|
27
30
|
react_1.default.createElement(ExpandedValueTooltip_1.ExpandedValueTooltip, { value: label },
|
|
28
31
|
react_1.default.createElement("div", { className: classes['option--item'] }, children))));
|
|
29
32
|
};
|
|
@@ -47,11 +50,13 @@ exports.ReactSelectOption.propTypes = {
|
|
|
47
50
|
]),
|
|
48
51
|
isFocused: prop_types_1.default.bool.isRequired,
|
|
49
52
|
isSelected: prop_types_1.default.bool.isRequired,
|
|
53
|
+
isDisabled: prop_types_1.default.bool,
|
|
50
54
|
label: prop_types_1.default.string,
|
|
51
55
|
selectProps: prop_types_1.default.shape({
|
|
52
56
|
classes: prop_types_1.default.shape({
|
|
53
57
|
option: prop_types_1.default.string,
|
|
54
|
-
'option--selected': prop_types_1.default.string
|
|
58
|
+
'option--selected': prop_types_1.default.string,
|
|
59
|
+
'option--disabled': prop_types_1.default.string
|
|
55
60
|
})
|
|
56
61
|
})
|
|
57
62
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DropDownSelector } from '../DropDownSelector';
|
|
3
|
-
declare const _default: React.MemoExoticComponent<(props: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ components, ...props }: React.ComponentProps<typeof DropDownSelector>) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -33,14 +33,28 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
33
|
__setModuleDefault(result, mod);
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
37
|
+
var t = {};
|
|
38
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
39
|
+
t[p] = s[p];
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
41
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
42
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
43
|
+
t[p[i]] = s[p[i]];
|
|
44
|
+
}
|
|
45
|
+
return t;
|
|
46
|
+
};
|
|
36
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
48
|
var react_1 = __importStar(require("react"));
|
|
38
49
|
var DropDownSelector_1 = require("../DropDownSelector");
|
|
39
50
|
var DropDownValue_1 = require("./components/DropDownValue");
|
|
40
51
|
var DropDownPlaceholder_1 = require("./components/DropDownPlaceholder");
|
|
41
|
-
var
|
|
52
|
+
var defaultComponents = {
|
|
42
53
|
SingleValue: DropDownValue_1.DropDownValue,
|
|
43
54
|
Placeholder: DropDownPlaceholder_1.DropDownPlaceholder
|
|
44
55
|
};
|
|
45
|
-
var SimpleDropDownSelector = function (
|
|
56
|
+
var SimpleDropDownSelector = function (_a) {
|
|
57
|
+
var components = _a.components, props = __rest(_a, ["components"]);
|
|
58
|
+
return (react_1.default.createElement(DropDownSelector_1.DropDownSelector, __assign({ components: __assign(__assign({}, defaultComponents), components) }, props)));
|
|
59
|
+
};
|
|
46
60
|
exports.default = (0, react_1.memo)(SimpleDropDownSelector);
|
|
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DropDownValue = void 0;
|
|
7
7
|
var react_1 = __importDefault(require("react"));
|
|
8
8
|
var Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
9
|
-
var
|
|
9
|
+
var DropDownValue_module_css_1 = __importDefault(require("./DropDownValue.module.css"));
|
|
10
10
|
var DropDownValue = function (_a) {
|
|
11
11
|
var menuIsOpen = _a.selectProps.menuIsOpen, label = _a.data.label;
|
|
12
|
-
|
|
13
|
-
return (!menuIsOpen && (react_1.default.createElement(Typography_1.default, { "data-reltio-id": "simple-drop-down-value", variant: "body2", classes: { root: styles.value } }, label)));
|
|
12
|
+
return (!menuIsOpen && (react_1.default.createElement(Typography_1.default, { "data-reltio-id": "simple-drop-down-value", variant: "body2", classes: { root: DropDownValue_module_css_1.default.value } }, label)));
|
|
14
13
|
};
|
|
15
14
|
exports.DropDownValue = DropDownValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const styles = {"value":"DropDownValue-value--DA2jT"};
|
|
2
|
+
if (typeof document !== 'undefined') {
|
|
3
|
+
const head = document.head || document.getElementsByTagName('head')[0]
|
|
4
|
+
const style = document.createElement('style');
|
|
5
|
+
style.type = 'text/css'
|
|
6
|
+
style.innerHTML = `.DropDownValue-value--DA2jT{color:var(--mui-palette-text-primary)}`;
|
|
7
|
+
head.appendChild(style);
|
|
8
|
+
}
|
|
9
|
+
module.exports = styles;
|
|
@@ -3,6 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SimpleDropDownSelector = void 0;
|
|
6
|
+
exports.DropDownValue = exports.SimpleDropDownSelector = void 0;
|
|
7
7
|
var SimpleDropDownSelector_1 = require("./SimpleDropDownSelector");
|
|
8
8
|
Object.defineProperty(exports, "SimpleDropDownSelector", { enumerable: true, get: function () { return __importDefault(SimpleDropDownSelector_1).default; } });
|
|
9
|
+
var DropDownValue_1 = require("./components/DropDownValue");
|
|
10
|
+
Object.defineProperty(exports, "DropDownValue", { enumerable: true, get: function () { return DropDownValue_1.DropDownValue; } });
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"value">;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"value">;
|