@reltio/components 1.4.1356 → 1.4.1358
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.
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, SimpleAttributeValue, NestedAttributeValue, ReferenceAttributeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
export declare const ChipWithTooltip: React.ForwardRefExoticComponent<import("prop-types").InferPropsInner<Pick<{
|
|
4
|
+
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
5
|
+
tooltipPlacement: import("prop-types").Requireable<string>;
|
|
6
|
+
showForDisabled: import("prop-types").Requireable<boolean>;
|
|
7
|
+
}, never>> & Partial<import("prop-types").InferPropsInner<Pick<{
|
|
8
|
+
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
9
|
+
tooltipPlacement: import("prop-types").Requireable<string>;
|
|
10
|
+
showForDisabled: import("prop-types").Requireable<boolean>;
|
|
11
|
+
}, "tooltipTitle" | "tooltipPlacement" | "showForDisabled">>> & {
|
|
12
|
+
avatar?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
|
+
children?: null;
|
|
14
|
+
clickable?: boolean;
|
|
15
|
+
color?: "default" | "primary" | "secondary";
|
|
16
|
+
deleteIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
19
|
+
label?: React.ReactNode;
|
|
20
|
+
onDelete?: (event: any) => void;
|
|
21
|
+
size?: "medium" | "small";
|
|
22
|
+
variant?: "default" | "outlined";
|
|
23
|
+
} & import("@material-ui/core/OverridableComponent").CommonProps<import("@material-ui/core/Chip").ChipTypeMap<{}, "div">> & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
24
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
25
|
+
}, "translate" | "hidden" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key">>;
|
|
26
|
+
declare type ComplexWithLabel = NestedAttributeValue | ReferenceAttributeValue;
|
|
27
|
+
declare type Props = {
|
|
28
|
+
className?: string;
|
|
29
|
+
attributeType: AttributeType;
|
|
30
|
+
nonOvValues: Array<SimpleAttributeValue | ComplexWithLabel>;
|
|
31
|
+
nonOvTotal: number;
|
|
32
|
+
};
|
|
33
|
+
declare const OvIcon: ({ className, attributeType, nonOvValues, nonOvTotal }: Props) => JSX.Element;
|
|
2
34
|
export default OvIcon;
|
|
3
|
-
import React from "react";
|
|
4
|
-
declare function OvIcon({ className, attributeType, nonOvValues, nonOvTotal }: {
|
|
5
|
-
className: any;
|
|
6
|
-
attributeType: any;
|
|
7
|
-
nonOvValues?: any[];
|
|
8
|
-
nonOvTotal: any;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
declare namespace OvIcon {
|
|
11
|
-
namespace propTypes {
|
|
12
|
-
export const className: PropTypes.Requireable<string>;
|
|
13
|
-
export const nonOvTotal: PropTypes.Requireable<number>;
|
|
14
|
-
export { AttributeTypeType as attributeType };
|
|
15
|
-
export const nonOvValues: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
16
|
-
value: PropTypes.Requireable<object>;
|
|
17
|
-
ov: PropTypes.Requireable<boolean>;
|
|
18
|
-
type: PropTypes.Requireable<string>;
|
|
19
|
-
uri: PropTypes.Requireable<string>;
|
|
20
|
-
}> | PropTypes.InferProps<{
|
|
21
|
-
value: PropTypes.Requireable<NonNullable<string | number | boolean>>;
|
|
22
|
-
ov: PropTypes.Requireable<boolean>;
|
|
23
|
-
type: PropTypes.Requireable<string>;
|
|
24
|
-
uri: PropTypes.Requireable<string>;
|
|
25
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
26
|
-
lookupRawValue: PropTypes.Requireable<string>;
|
|
27
|
-
}>>[]>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
import PropTypes from "prop-types";
|
|
31
|
-
import { AttributeTypeType } from "@reltio/mdm-sdk/src/constants";
|
|
@@ -1,36 +1,61 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.ChipWithTooltip = void 0;
|
|
7
|
-
var react_1 =
|
|
8
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
30
|
+
var react_1 = __importStar(require("react"));
|
|
9
31
|
var classnames_1 = __importDefault(require("classnames"));
|
|
10
32
|
var Chip_1 = __importDefault(require("@material-ui/core/Chip"));
|
|
11
33
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
12
|
-
var
|
|
34
|
+
var mdm_module_1 = require("@reltio/mdm-module");
|
|
13
35
|
var DataTypeValue_1 = __importDefault(require("../../DataTypeValue/DataTypeValue"));
|
|
14
36
|
var HOCs_1 = require("../../../HOCs");
|
|
37
|
+
var react_redux_1 = require("react-redux");
|
|
38
|
+
var styles_1 = require("./styles");
|
|
15
39
|
exports.ChipWithTooltip = (0, HOCs_1.withTooltip)(Chip_1.default);
|
|
16
40
|
var OvIcon = function (_a) {
|
|
17
|
-
var
|
|
41
|
+
var _b;
|
|
42
|
+
var className = _a.className, attributeType = _a.attributeType, _c = _a.nonOvValues, nonOvValues = _c === void 0 ? [] : _c, nonOvTotal = _a.nonOvTotal;
|
|
18
43
|
var styles = (0, styles_1.useStyles)();
|
|
44
|
+
var dispatch = (0, react_redux_1.useDispatch)();
|
|
45
|
+
var attributeUri = (_b = nonOvValues === null || nonOvValues === void 0 ? void 0 : nonOvValues[0]) === null || _b === void 0 ? void 0 : _b.uri;
|
|
46
|
+
var onClick = (0, react_1.useCallback)(function () {
|
|
47
|
+
var entityUri = attributeUri ? (0, mdm_sdk_1.getEntityUriFromAttributeUri)(attributeUri) : '';
|
|
48
|
+
dispatch(mdm_module_1.ui.actions.openEntity({ uri: entityUri, viewId: null, screen: 'sources' }));
|
|
49
|
+
}, [attributeUri, dispatch]);
|
|
19
50
|
if (!nonOvTotal) {
|
|
20
51
|
return null;
|
|
21
52
|
}
|
|
22
53
|
var tooltipTitle = nonOvValues.length
|
|
23
54
|
? nonOvValues.map(function (value, i) { return (react_1.default.createElement("div", { key: i }, (0, mdm_sdk_1.isComplexAttribute)(attributeType) ? ((0, mdm_sdk_1.getLabel)(value.label)) : (react_1.default.createElement(DataTypeValue_1.default, { value: (0, mdm_sdk_1.getAttributeValue)(value), dataTypeDefinition: (0, mdm_sdk_1.getAttrDataTypeDefinition)(attributeType), rich: false })))); })
|
|
24
55
|
: null;
|
|
25
|
-
return (react_1.default.createElement(exports.ChipWithTooltip, { tooltipTitle: tooltipTitle, tooltipPlacement: "top", label: "+ ".concat(nonOvTotal), variant: "outlined", classes: {
|
|
56
|
+
return (react_1.default.createElement(exports.ChipWithTooltip, { tooltipTitle: tooltipTitle, tooltipPlacement: "top", label: "+ ".concat(nonOvTotal), variant: "outlined", onClick: onClick, classes: {
|
|
26
57
|
root: (0, classnames_1.default)(styles.container, className),
|
|
27
58
|
label: styles.label
|
|
28
59
|
} }));
|
|
29
60
|
};
|
|
30
|
-
OvIcon.propTypes = {
|
|
31
|
-
className: prop_types_1.default.string,
|
|
32
|
-
nonOvTotal: prop_types_1.default.number,
|
|
33
|
-
attributeType: mdm_sdk_1.AttributeTypeType,
|
|
34
|
-
nonOvValues: prop_types_1.default.arrayOf(prop_types_1.default.oneOfType([mdm_sdk_1.SimpleAttributeValueType, mdm_sdk_1.NestedAttributeValueType, mdm_sdk_1.ReferenceAttributeValueType]))
|
|
35
|
-
};
|
|
36
61
|
exports.default = OvIcon;
|
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AttributeType, SimpleAttributeValue, NestedAttributeValue, ReferenceAttributeValue } from '@reltio/mdm-sdk';
|
|
3
|
+
export declare const ChipWithTooltip: React.ForwardRefExoticComponent<import("prop-types").InferPropsInner<Pick<{
|
|
4
|
+
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
5
|
+
tooltipPlacement: import("prop-types").Requireable<string>;
|
|
6
|
+
showForDisabled: import("prop-types").Requireable<boolean>;
|
|
7
|
+
}, never>> & Partial<import("prop-types").InferPropsInner<Pick<{
|
|
8
|
+
tooltipTitle: import("prop-types").Requireable<import("prop-types").ReactNodeLike>;
|
|
9
|
+
tooltipPlacement: import("prop-types").Requireable<string>;
|
|
10
|
+
showForDisabled: import("prop-types").Requireable<boolean>;
|
|
11
|
+
}, "tooltipTitle" | "tooltipPlacement" | "showForDisabled">>> & {
|
|
12
|
+
avatar?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
|
+
children?: null;
|
|
14
|
+
clickable?: boolean;
|
|
15
|
+
color?: "default" | "primary" | "secondary";
|
|
16
|
+
deleteIcon?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
icon?: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
19
|
+
label?: React.ReactNode;
|
|
20
|
+
onDelete?: (event: any) => void;
|
|
21
|
+
size?: "medium" | "small";
|
|
22
|
+
variant?: "default" | "outlined";
|
|
23
|
+
} & import("@material-ui/core/OverridableComponent").CommonProps<import("@material-ui/core/Chip").ChipTypeMap<{}, "div">> & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
24
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
25
|
+
}, "translate" | "hidden" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "tabIndex" | "title" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key">>;
|
|
26
|
+
declare type ComplexWithLabel = NestedAttributeValue | ReferenceAttributeValue;
|
|
27
|
+
declare type Props = {
|
|
28
|
+
className?: string;
|
|
29
|
+
attributeType: AttributeType;
|
|
30
|
+
nonOvValues: Array<SimpleAttributeValue | ComplexWithLabel>;
|
|
31
|
+
nonOvTotal: number;
|
|
32
|
+
};
|
|
33
|
+
declare const OvIcon: ({ className, attributeType, nonOvValues, nonOvTotal }: Props) => JSX.Element;
|
|
2
34
|
export default OvIcon;
|
|
3
|
-
import React from "react";
|
|
4
|
-
declare function OvIcon({ className, attributeType, nonOvValues, nonOvTotal }: {
|
|
5
|
-
className: any;
|
|
6
|
-
attributeType: any;
|
|
7
|
-
nonOvValues?: any[];
|
|
8
|
-
nonOvTotal: any;
|
|
9
|
-
}): JSX.Element;
|
|
10
|
-
declare namespace OvIcon {
|
|
11
|
-
namespace propTypes {
|
|
12
|
-
export const className: PropTypes.Requireable<string>;
|
|
13
|
-
export const nonOvTotal: PropTypes.Requireable<number>;
|
|
14
|
-
export { AttributeTypeType as attributeType };
|
|
15
|
-
export const nonOvValues: PropTypes.Requireable<NonNullable<PropTypes.InferProps<{
|
|
16
|
-
value: PropTypes.Requireable<object>;
|
|
17
|
-
ov: PropTypes.Requireable<boolean>;
|
|
18
|
-
type: PropTypes.Requireable<string>;
|
|
19
|
-
uri: PropTypes.Requireable<string>;
|
|
20
|
-
}> | PropTypes.InferProps<{
|
|
21
|
-
value: PropTypes.Requireable<NonNullable<string | number | boolean>>;
|
|
22
|
-
ov: PropTypes.Requireable<boolean>;
|
|
23
|
-
type: PropTypes.Requireable<string>;
|
|
24
|
-
uri: PropTypes.Requireable<string>;
|
|
25
|
-
lookupCode: PropTypes.Requireable<string>;
|
|
26
|
-
lookupRawValue: PropTypes.Requireable<string>;
|
|
27
|
-
}>>[]>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
import PropTypes from "prop-types";
|
|
31
|
-
import { AttributeTypeType } from "@reltio/mdm-sdk/src/constants";
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { useCallback } from 'react';
|
|
3
2
|
import classnames from 'classnames';
|
|
4
3
|
import Chip from '@material-ui/core/Chip';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { getAttrDataTypeDefinition, getAttributeValue, isComplexAttribute, getLabel, getEntityUriFromAttributeUri } from '@reltio/mdm-sdk';
|
|
5
|
+
import { ui } from '@reltio/mdm-module';
|
|
7
6
|
import DataTypeValue from '../../DataTypeValue/DataTypeValue';
|
|
8
7
|
import { withTooltip } from '../../../HOCs';
|
|
8
|
+
import { useDispatch } from 'react-redux';
|
|
9
|
+
import { useStyles } from './styles';
|
|
9
10
|
export var ChipWithTooltip = withTooltip(Chip);
|
|
10
11
|
var OvIcon = function (_a) {
|
|
11
|
-
var
|
|
12
|
+
var _b;
|
|
13
|
+
var className = _a.className, attributeType = _a.attributeType, _c = _a.nonOvValues, nonOvValues = _c === void 0 ? [] : _c, nonOvTotal = _a.nonOvTotal;
|
|
12
14
|
var styles = useStyles();
|
|
15
|
+
var dispatch = useDispatch();
|
|
16
|
+
var attributeUri = (_b = nonOvValues === null || nonOvValues === void 0 ? void 0 : nonOvValues[0]) === null || _b === void 0 ? void 0 : _b.uri;
|
|
17
|
+
var onClick = useCallback(function () {
|
|
18
|
+
var entityUri = attributeUri ? getEntityUriFromAttributeUri(attributeUri) : '';
|
|
19
|
+
dispatch(ui.actions.openEntity({ uri: entityUri, viewId: null, screen: 'sources' }));
|
|
20
|
+
}, [attributeUri, dispatch]);
|
|
13
21
|
if (!nonOvTotal) {
|
|
14
22
|
return null;
|
|
15
23
|
}
|
|
16
24
|
var tooltipTitle = nonOvValues.length
|
|
17
25
|
? nonOvValues.map(function (value, i) { return (React.createElement("div", { key: i }, isComplexAttribute(attributeType) ? (getLabel(value.label)) : (React.createElement(DataTypeValue, { value: getAttributeValue(value), dataTypeDefinition: getAttrDataTypeDefinition(attributeType), rich: false })))); })
|
|
18
26
|
: null;
|
|
19
|
-
return (React.createElement(ChipWithTooltip, { tooltipTitle: tooltipTitle, tooltipPlacement: "top", label: "+ ".concat(nonOvTotal), variant: "outlined", classes: {
|
|
27
|
+
return (React.createElement(ChipWithTooltip, { tooltipTitle: tooltipTitle, tooltipPlacement: "top", label: "+ ".concat(nonOvTotal), variant: "outlined", onClick: onClick, classes: {
|
|
20
28
|
root: classnames(styles.container, className),
|
|
21
29
|
label: styles.label
|
|
22
30
|
} }));
|
|
23
31
|
};
|
|
24
|
-
OvIcon.propTypes = {
|
|
25
|
-
className: PropTypes.string,
|
|
26
|
-
nonOvTotal: PropTypes.number,
|
|
27
|
-
attributeType: AttributeTypeType,
|
|
28
|
-
nonOvValues: PropTypes.arrayOf(PropTypes.oneOfType([SimpleAttributeValueType, NestedAttributeValueType, ReferenceAttributeValueType]))
|
|
29
|
-
};
|
|
30
32
|
export default OvIcon;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1358",
|
|
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.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1358",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1358",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|