@reltio/components 1.4.1249 → 1.4.1252

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.
Files changed (23) hide show
  1. package/cjs/components/ProfileBand/ProfileBand.d.ts +8 -17
  2. package/cjs/components/ProfileBand/ProfileBand.js +3 -10
  3. package/cjs/components/ProfileBand/styles.d.ts +1 -1
  4. package/cjs/components/ProfileBand/styles.js +3 -2
  5. package/cjs/components/ProfilesList/styles.d.ts +1 -1
  6. package/cjs/components/activityLog/ActivityLogFilter/ActivityLogFilter.js +3 -1
  7. package/cjs/components/activityLog/ActivityLogFilter/ActivityLogFilterHeader.d.ts +2 -1
  8. package/cjs/components/activityLog/ActivityLogFilter/ActivityLogFilterHeader.js +3 -2
  9. package/cjs/components/activityLog/ActivityLogFilter/styles.js +6 -2
  10. package/cjs/components/attributes/editMode/SimpleAttributeEditor/selectors/getDependentLookupEditorContext.js +5 -3
  11. package/cjs/components/editors/DependentLookupEditor/DependentLookupEditor.js +9 -7
  12. package/esm/components/ProfileBand/ProfileBand.d.ts +8 -17
  13. package/esm/components/ProfileBand/ProfileBand.js +3 -10
  14. package/esm/components/ProfileBand/styles.d.ts +1 -1
  15. package/esm/components/ProfileBand/styles.js +1 -1
  16. package/esm/components/ProfilesList/styles.d.ts +1 -1
  17. package/esm/components/activityLog/ActivityLogFilter/ActivityLogFilter.js +3 -1
  18. package/esm/components/activityLog/ActivityLogFilter/ActivityLogFilterHeader.d.ts +2 -1
  19. package/esm/components/activityLog/ActivityLogFilter/ActivityLogFilterHeader.js +3 -2
  20. package/esm/components/activityLog/ActivityLogFilter/styles.js +7 -3
  21. package/esm/components/attributes/editMode/SimpleAttributeEditor/selectors/getDependentLookupEditorContext.js +5 -3
  22. package/esm/components/editors/DependentLookupEditor/DependentLookupEditor.js +9 -7
  23. package/package.json +3 -3
@@ -1,18 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { Entity } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ className?: string;
5
+ entity?: Entity;
6
+ children?: ReactNode;
7
+ };
8
+ declare const ProfileBand: ({ className, entity, children }: Props) => JSX.Element;
1
9
  export default ProfileBand;
2
- declare function ProfileBand({ className, entity, children, classes, showEntityId }: {
3
- className: any;
4
- entity: any;
5
- children: any;
6
- classes: any;
7
- showEntityId?: boolean;
8
- }): JSX.Element;
9
- declare namespace ProfileBand {
10
- namespace propTypes {
11
- const className: PropTypes.Requireable<string>;
12
- const entity: PropTypes.Requireable<object>;
13
- const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
14
- const classes: PropTypes.Requireable<object>;
15
- const showEntityId: PropTypes.Requireable<boolean>;
16
- }
17
- }
18
- import PropTypes from "prop-types";
@@ -23,7 +23,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  var react_1 = __importStar(require("react"));
26
- var prop_types_1 = __importDefault(require("prop-types"));
27
26
  var classnames_1 = __importDefault(require("classnames"));
28
27
  var react_redux_1 = require("react-redux");
29
28
  var ramda_1 = require("ramda");
@@ -37,9 +36,10 @@ var EntityTypeBadge_1 = __importDefault(require("../EntityTypeBadge/EntityTypeBa
37
36
  var styles_1 = __importDefault(require("./styles"));
38
37
  var ProfileBand = function (_a) {
39
38
  var _b;
40
- var className = _a.className, entity = _a.entity, children = _a.children, classes = _a.classes, _c = _a.showEntityId, showEntityId = _c === void 0 ? true : _c;
41
- var styles = styles_1.default({ classes: classes });
39
+ var className = _a.className, entity = _a.entity, children = _a.children;
40
+ var styles = styles_1.default();
42
41
  var metadata = react_redux_1.useSelector(mdm_module_1.default.selectors.getMetadata);
42
+ var showEntityId = react_redux_1.useSelector(mdm_module_1.default.selectors.getShowEntityId);
43
43
  var handleCopyEntityIdToClipboard = react_1.useCallback(function () {
44
44
  navigator.clipboard.writeText(mdm_sdk_1.getEntityId(entity));
45
45
  }, [entity]);
@@ -72,11 +72,4 @@ var ProfileBand = function (_a) {
72
72
  entityId)))))),
73
73
  children && react_1.default.createElement("div", null, children))));
74
74
  };
75
- ProfileBand.propTypes = {
76
- className: prop_types_1.default.string,
77
- entity: prop_types_1.default.object,
78
- children: prop_types_1.default.node,
79
- classes: prop_types_1.default.object,
80
- showEntityId: prop_types_1.default.bool
81
- };
82
75
  exports.default = ProfileBand;
@@ -1,2 +1,2 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "entityType" | "profileBand" | "secondaryLabel" | "inactive" | "entityId" | "badge" | "profileIcon" | "profileBandWrapper" | "imageProfileIcon" | "profileInfo" | "businessCard" | "specialInfo">;
1
2
  export default useStyles;
2
- declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "entityType" | "profileBand" | "secondaryLabel" | "inactive" | "entityId" | "badge" | "profileIcon" | "businessCard" | "profileBandWrapper" | "imageProfileIcon" | "profileInfo" | "specialInfo">;
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useStyles = void 0;
3
4
  var styles_1 = require("@material-ui/core/styles");
4
- var useStyles = styles_1.makeStyles(function (theme) { return ({
5
+ exports.useStyles = styles_1.makeStyles(function (theme) { return ({
5
6
  profileBandWrapper: {
6
7
  // especially for IE (overflow fix)
7
8
  flexShrink: 0
@@ -83,4 +84,4 @@ var useStyles = styles_1.makeStyles(function (theme) { return ({
83
84
  }
84
85
  }
85
86
  }); });
86
- exports.default = useStyles;
87
+ exports.default = exports.useStyles;
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "item" | "image" | "secondaryLabel" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "@keyframes animate" | "highlighted" | "justImported" | "businessCard" | "secondRow">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "item" | "image" | "secondaryLabel" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "businessCard" | "@keyframes animate" | "highlighted" | "justImported" | "secondRow">;
@@ -38,17 +38,19 @@ var react_redux_1 = require("react-redux");
38
38
  var ActivityLogFilterHeader_1 = __importDefault(require("./ActivityLogFilterHeader"));
39
39
  var ActivityFilterEditor_1 = __importDefault(require("../ActivityFilterEditor/ActivityFilterEditor"));
40
40
  var ActivityExportButton_1 = __importDefault(require("../ActivityExportButton/ActivityExportButton"));
41
+ var ramda_1 = require("ramda");
41
42
  var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
42
43
  var ActivityLogFilter = function (_a) {
43
44
  var value = _a.value, entityType = _a.entityType, entityUri = _a.entityUri, onChange = _a.onChange, exportTypes = _a.exportTypes;
44
45
  var initialValue = react_1.useRef(value);
46
+ var isApplied = !ramda_1.equals(value, initialValue.current);
45
47
  var canExport = react_redux_1.useSelector(mdm_module_1.default.selectors.getCanUserMakeActivitiesExport);
46
48
  var _b = react_1.useState(false), isEditorOpen = _b[0], setIsEditorOpen = _b[1];
47
49
  var handleClear = function () { return onChange(__assign({}, initialValue.current)); };
48
50
  var handleCancel = function () { return setIsEditorOpen(false); };
49
51
  var handleToggleFilter = function () { return setIsEditorOpen(function (isEditorOpen) { return !isEditorOpen; }); };
50
52
  return (react_1.default.createElement(react_1.default.Fragment, null,
51
- react_1.default.createElement(ActivityLogFilterHeader_1.default, { onToggle: handleToggleFilter, filters: value }, canExport && react_1.default.createElement(ActivityExportButton_1.default, { filters: __assign(__assign({}, value), { entityUri: entityUri }), exportTypes: exportTypes })),
53
+ react_1.default.createElement(ActivityLogFilterHeader_1.default, { onToggle: handleToggleFilter, filters: value, isApplied: isApplied }, canExport && react_1.default.createElement(ActivityExportButton_1.default, { filters: __assign(__assign({}, value), { entityUri: entityUri }), exportTypes: exportTypes })),
52
54
  react_1.default.createElement(ActivityFilterEditor_1.default, { value: value, open: isEditorOpen, entityType: entityType, onApply: onChange, onCancel: handleCancel, onClear: handleClear })));
53
55
  };
54
56
  exports.default = ActivityLogFilter;
@@ -4,6 +4,7 @@ declare type Props = {
4
4
  onToggle: () => void;
5
5
  filters: ActivitiesFilter;
6
6
  children?: React.ReactNode;
7
+ isApplied?: boolean;
7
8
  };
8
- declare const ActivityLogFilterHeader: ({ children, onToggle, filters }: Props) => JSX.Element;
9
+ declare const ActivityLogFilterHeader: ({ children, onToggle, filters, isApplied }: Props) => JSX.Element;
9
10
  export default ActivityLogFilterHeader;
@@ -10,9 +10,10 @@ var Typography_1 = __importDefault(require("@material-ui/core/Typography"));
10
10
  var FilterList_1 = __importDefault(require("@material-ui/icons/FilterList"));
11
11
  var helpers_1 = require("./helpers");
12
12
  var SmallIconButton_1 = require("../../SmallIconButton");
13
+ var classnames_1 = __importDefault(require("classnames"));
13
14
  var styles_1 = require("./styles");
14
15
  var ActivityLogFilterHeader = function (_a) {
15
- var children = _a.children, onToggle = _a.onToggle, filters = _a.filters;
16
+ var children = _a.children, onToggle = _a.onToggle, filters = _a.filters, _b = _a.isApplied, isApplied = _b === void 0 ? false : _b;
16
17
  var styles = styles_1.useStyles();
17
18
  var filterLabel = helpers_1.getFilterLabel(filters);
18
19
  return (react_1.default.createElement("div", { className: styles.header },
@@ -21,6 +22,6 @@ var ActivityLogFilterHeader = function (_a) {
21
22
  react_1.default.createElement(Typography_1.default, { variant: "body2", className: styles.label, color: "textSecondary", display: "block", noWrap: true }, filterLabel)),
22
23
  react_1.default.createElement("div", { className: styles.buttonsWrapper },
23
24
  children,
24
- react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { icon: FilterList_1.default, size: "L", onClick: onToggle, tooltipTitle: ui_i18n_1.default.text('Filter'), className: styles.icon }))));
25
+ react_1.default.createElement(SmallIconButton_1.SmallIconButtonWithTooltip, { icon: FilterList_1.default, size: "L", onClick: onToggle, tooltipTitle: ui_i18n_1.default.text('Filter'), className: classnames_1.default(styles.icon, { activeIcon: isApplied }) }))));
25
26
  };
26
27
  exports.default = ActivityLogFilterHeader;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useStyles = void 0;
4
4
  var styles_1 = require("@material-ui/core/styles");
5
- exports.useStyles = styles_1.makeStyles(function () { return ({
5
+ exports.useStyles = styles_1.makeStyles(function (theme) { return ({
6
6
  header: {
7
7
  width: 'auto',
8
8
  display: 'flex',
@@ -13,7 +13,11 @@ exports.useStyles = styles_1.makeStyles(function () { return ({
13
13
  fontSize: '14px'
14
14
  },
15
15
  icon: {
16
- margin: '4px'
16
+ margin: '4px',
17
+ '&.activeIcon': {
18
+ backgroundColor: styles_1.fade(theme.palette.primary.main, 0.12),
19
+ color: '#0072CE'
20
+ }
17
21
  },
18
22
  buttonsWrapper: {
19
23
  marginLeft: 'auto',
@@ -20,10 +20,12 @@ var getDependentLookupEditorContext = function (state, attributeValue, attribute
20
20
  var autocompleteConfig = mdm_module_1.default.selectors.getLookupAutocomplete(state);
21
21
  var autopopulationEnabled = mdm_sdk_1.isAutopopulationEnabled(autocompleteConfig, attributeTypeUri);
22
22
  var isEmptyValue = !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.lookupCode) && !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.value);
23
- var placeholder = (isEmptyValue && isBlocked && ui_i18n_1.default.text('Populating values...')) || missedParentsMessage || '';
23
+ var placeholder = (isEmptyValue && isBlocked && ui_i18n_1.default.text('Populating values...')) ||
24
+ (isEmptyValue && missedParentsMessage) ||
25
+ '';
24
26
  var context = {
25
- parents: parents,
26
- disabled: !!missedParentsMessage || isBlocked,
27
+ parents: missedParentsMessage ? null : parents,
28
+ disabled: (!!missedParentsMessage && isEmptyValue) || isBlocked,
27
29
  placeholder: placeholder,
28
30
  autopopulationId: autopopulationEnabled ? valueUri : null
29
31
  };
@@ -102,13 +102,15 @@ var DependentLookupEditor = function (_a) {
102
102
  var loadOptions = react_1.useCallback(function (value, pageNumber) {
103
103
  if (pageNumber === void 0) { pageNumber = 1; }
104
104
  setOptionsAreLoading(true);
105
- return getLookups({
106
- type: lookupTypeCode,
107
- parents: parents,
108
- displayNamePrefix: value,
109
- max: max + 1,
110
- offset: (pageNumber - 1) * max
111
- })
105
+ return (parents === null
106
+ ? Promise.resolve([])
107
+ : getLookups({
108
+ type: lookupTypeCode,
109
+ parents: parents,
110
+ displayNamePrefix: value,
111
+ max: max + 1,
112
+ offset: (pageNumber - 1) * max
113
+ }))
112
114
  .then(function (buildOptions) { return helpers_1.buildLookupOptions(buildOptions); })
113
115
  .catch(function () { return []; })
114
116
  .finally(function () { return setOptionsAreLoading(false); });
@@ -1,18 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { Entity } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ className?: string;
5
+ entity?: Entity;
6
+ children?: ReactNode;
7
+ };
8
+ declare const ProfileBand: ({ className, entity, children }: Props) => JSX.Element;
1
9
  export default ProfileBand;
2
- declare function ProfileBand({ className, entity, children, classes, showEntityId }: {
3
- className: any;
4
- entity: any;
5
- children: any;
6
- classes: any;
7
- showEntityId?: boolean;
8
- }): JSX.Element;
9
- declare namespace ProfileBand {
10
- namespace propTypes {
11
- const className: PropTypes.Requireable<string>;
12
- const entity: PropTypes.Requireable<object>;
13
- const children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
14
- const classes: PropTypes.Requireable<object>;
15
- const showEntityId: PropTypes.Requireable<boolean>;
16
- }
17
- }
18
- import PropTypes from "prop-types";
@@ -1,5 +1,4 @@
1
1
  import React, { useCallback } from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import classnames from 'classnames';
4
3
  import { useSelector } from 'react-redux';
5
4
  import { isNil } from 'ramda';
@@ -13,9 +12,10 @@ import EntityTypeBadge from '../EntityTypeBadge/EntityTypeBadge';
13
12
  import useStyles from './styles';
14
13
  var ProfileBand = function (_a) {
15
14
  var _b;
16
- var className = _a.className, entity = _a.entity, children = _a.children, classes = _a.classes, _c = _a.showEntityId, showEntityId = _c === void 0 ? true : _c;
17
- var styles = useStyles({ classes: classes });
15
+ var className = _a.className, entity = _a.entity, children = _a.children;
16
+ var styles = useStyles();
18
17
  var metadata = useSelector(mdmModule.selectors.getMetadata);
18
+ var showEntityId = useSelector(mdmModule.selectors.getShowEntityId);
19
19
  var handleCopyEntityIdToClipboard = useCallback(function () {
20
20
  navigator.clipboard.writeText(getEntityId(entity));
21
21
  }, [entity]);
@@ -48,11 +48,4 @@ var ProfileBand = function (_a) {
48
48
  entityId)))))),
49
49
  children && React.createElement("div", null, children))));
50
50
  };
51
- ProfileBand.propTypes = {
52
- className: PropTypes.string,
53
- entity: PropTypes.object,
54
- children: PropTypes.node,
55
- classes: PropTypes.object,
56
- showEntityId: PropTypes.bool
57
- };
58
51
  export default ProfileBand;
@@ -1,2 +1,2 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "entityType" | "profileBand" | "secondaryLabel" | "inactive" | "entityId" | "badge" | "profileIcon" | "profileBandWrapper" | "imageProfileIcon" | "profileInfo" | "businessCard" | "specialInfo">;
1
2
  export default useStyles;
2
- declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "entityType" | "profileBand" | "secondaryLabel" | "inactive" | "entityId" | "badge" | "profileIcon" | "businessCard" | "profileBandWrapper" | "imageProfileIcon" | "profileInfo" | "specialInfo">;
@@ -1,5 +1,5 @@
1
1
  import { makeStyles } from '@material-ui/core/styles';
2
- var useStyles = makeStyles(function (theme) { return ({
2
+ export var useStyles = makeStyles(function (theme) { return ({
3
3
  profileBandWrapper: {
4
4
  // especially for IE (overflow fix)
5
5
  flexShrink: 0
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "item" | "image" | "secondaryLabel" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "@keyframes animate" | "highlighted" | "justImported" | "businessCard" | "secondRow">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "item" | "image" | "secondaryLabel" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "businessCard" | "@keyframes animate" | "highlighted" | "justImported" | "secondRow">;
@@ -14,17 +14,19 @@ import { useSelector } from 'react-redux';
14
14
  import ActivityLogFilterHeader from './ActivityLogFilterHeader';
15
15
  import ActivityFilterEditor from '../ActivityFilterEditor/ActivityFilterEditor';
16
16
  import ActivityExportButton from '../ActivityExportButton/ActivityExportButton';
17
+ import { equals } from 'ramda';
17
18
  import mdmModule from '@reltio/mdm-module';
18
19
  var ActivityLogFilter = function (_a) {
19
20
  var value = _a.value, entityType = _a.entityType, entityUri = _a.entityUri, onChange = _a.onChange, exportTypes = _a.exportTypes;
20
21
  var initialValue = useRef(value);
22
+ var isApplied = !equals(value, initialValue.current);
21
23
  var canExport = useSelector(mdmModule.selectors.getCanUserMakeActivitiesExport);
22
24
  var _b = useState(false), isEditorOpen = _b[0], setIsEditorOpen = _b[1];
23
25
  var handleClear = function () { return onChange(__assign({}, initialValue.current)); };
24
26
  var handleCancel = function () { return setIsEditorOpen(false); };
25
27
  var handleToggleFilter = function () { return setIsEditorOpen(function (isEditorOpen) { return !isEditorOpen; }); };
26
28
  return (React.createElement(React.Fragment, null,
27
- React.createElement(ActivityLogFilterHeader, { onToggle: handleToggleFilter, filters: value }, canExport && React.createElement(ActivityExportButton, { filters: __assign(__assign({}, value), { entityUri: entityUri }), exportTypes: exportTypes })),
29
+ React.createElement(ActivityLogFilterHeader, { onToggle: handleToggleFilter, filters: value, isApplied: isApplied }, canExport && React.createElement(ActivityExportButton, { filters: __assign(__assign({}, value), { entityUri: entityUri }), exportTypes: exportTypes })),
28
30
  React.createElement(ActivityFilterEditor, { value: value, open: isEditorOpen, entityType: entityType, onApply: onChange, onCancel: handleCancel, onClear: handleClear })));
29
31
  };
30
32
  export default ActivityLogFilter;
@@ -4,6 +4,7 @@ declare type Props = {
4
4
  onToggle: () => void;
5
5
  filters: ActivitiesFilter;
6
6
  children?: React.ReactNode;
7
+ isApplied?: boolean;
7
8
  };
8
- declare const ActivityLogFilterHeader: ({ children, onToggle, filters }: Props) => JSX.Element;
9
+ declare const ActivityLogFilterHeader: ({ children, onToggle, filters, isApplied }: Props) => JSX.Element;
9
10
  export default ActivityLogFilterHeader;
@@ -5,9 +5,10 @@ import Typography from '@material-ui/core/Typography';
5
5
  import FilterListIcon from '@material-ui/icons/FilterList';
6
6
  import { getFilterLabel } from './helpers';
7
7
  import { SmallIconButtonWithTooltip } from '../../SmallIconButton';
8
+ import classnames from 'classnames';
8
9
  import { useStyles } from './styles';
9
10
  var ActivityLogFilterHeader = function (_a) {
10
- var children = _a.children, onToggle = _a.onToggle, filters = _a.filters;
11
+ var children = _a.children, onToggle = _a.onToggle, filters = _a.filters, _b = _a.isApplied, isApplied = _b === void 0 ? false : _b;
11
12
  var styles = useStyles();
12
13
  var filterLabel = getFilterLabel(filters);
13
14
  return (React.createElement("div", { className: styles.header },
@@ -16,6 +17,6 @@ var ActivityLogFilterHeader = function (_a) {
16
17
  React.createElement(Typography, { variant: "body2", className: styles.label, color: "textSecondary", display: "block", noWrap: true }, filterLabel)),
17
18
  React.createElement("div", { className: styles.buttonsWrapper },
18
19
  children,
19
- React.createElement(SmallIconButtonWithTooltip, { icon: FilterListIcon, size: "L", onClick: onToggle, tooltipTitle: i18n.text('Filter'), className: styles.icon }))));
20
+ React.createElement(SmallIconButtonWithTooltip, { icon: FilterListIcon, size: "L", onClick: onToggle, tooltipTitle: i18n.text('Filter'), className: classnames(styles.icon, { activeIcon: isApplied }) }))));
20
21
  };
21
22
  export default ActivityLogFilterHeader;
@@ -1,5 +1,5 @@
1
- import { makeStyles } from '@material-ui/core/styles';
2
- export var useStyles = makeStyles(function () { return ({
1
+ import { fade, makeStyles } from '@material-ui/core/styles';
2
+ export var useStyles = makeStyles(function (theme) { return ({
3
3
  header: {
4
4
  width: 'auto',
5
5
  display: 'flex',
@@ -10,7 +10,11 @@ export var useStyles = makeStyles(function () { return ({
10
10
  fontSize: '14px'
11
11
  },
12
12
  icon: {
13
- margin: '4px'
13
+ margin: '4px',
14
+ '&.activeIcon': {
15
+ backgroundColor: fade(theme.palette.primary.main, 0.12),
16
+ color: '#0072CE'
17
+ }
14
18
  },
15
19
  buttonsWrapper: {
16
20
  marginLeft: 'auto',
@@ -14,10 +14,12 @@ export var getDependentLookupEditorContext = function (state, attributeValue, at
14
14
  var autocompleteConfig = mdmModule.selectors.getLookupAutocomplete(state);
15
15
  var autopopulationEnabled = isAutopopulationEnabled(autocompleteConfig, attributeTypeUri);
16
16
  var isEmptyValue = !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.lookupCode) && !(attributeValue === null || attributeValue === void 0 ? void 0 : attributeValue.value);
17
- var placeholder = (isEmptyValue && isBlocked && i18n.text('Populating values...')) || missedParentsMessage || '';
17
+ var placeholder = (isEmptyValue && isBlocked && i18n.text('Populating values...')) ||
18
+ (isEmptyValue && missedParentsMessage) ||
19
+ '';
18
20
  var context = {
19
- parents: parents,
20
- disabled: !!missedParentsMessage || isBlocked,
21
+ parents: missedParentsMessage ? null : parents,
22
+ disabled: (!!missedParentsMessage && isEmptyValue) || isBlocked,
21
23
  placeholder: placeholder,
22
24
  autopopulationId: autopopulationEnabled ? valueUri : null
23
25
  };
@@ -77,13 +77,15 @@ var DependentLookupEditor = function (_a) {
77
77
  var loadOptions = useCallback(function (value, pageNumber) {
78
78
  if (pageNumber === void 0) { pageNumber = 1; }
79
79
  setOptionsAreLoading(true);
80
- return getLookups({
81
- type: lookupTypeCode,
82
- parents: parents,
83
- displayNamePrefix: value,
84
- max: max + 1,
85
- offset: (pageNumber - 1) * max
86
- })
80
+ return (parents === null
81
+ ? Promise.resolve([])
82
+ : getLookups({
83
+ type: lookupTypeCode,
84
+ parents: parents,
85
+ displayNamePrefix: value,
86
+ max: max + 1,
87
+ offset: (pageNumber - 1) * max
88
+ }))
87
89
  .then(function (buildOptions) { return buildLookupOptions(buildOptions); })
88
90
  .catch(function () { return []; })
89
91
  .finally(function () { return setOptionsAreLoading(false); });
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1249",
3
+ "version": "1.4.1252",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
7
7
  "dependencies": {
8
8
  "@date-io/moment": "^1.3.5",
9
9
  "@react-google-maps/api": "2.7.0",
10
- "@reltio/mdm-module": "^1.4.1249",
11
- "@reltio/mdm-sdk": "^1.4.1249",
10
+ "@reltio/mdm-module": "^1.4.1252",
11
+ "@reltio/mdm-sdk": "^1.4.1252",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",