@reltio/components 1.4.854 → 1.4.859
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/components/attributes/OvIcon/OvIcon.js +4 -1
- package/components/history/ContributorsPanel/ContributorItem.d.ts +8 -0
- package/components/history/ContributorsPanel/ContributorItem.js +21 -0
- package/components/history/ContributorsPanel/ContributorsPanel.d.ts +10 -0
- package/components/history/ContributorsPanel/ContributorsPanel.js +32 -0
- package/components/history/ContributorsPanel/styles.d.ts +6 -0
- package/components/history/ContributorsPanel/styles.js +40 -0
- package/components/history/HistoryView/HistoryView.d.ts +3 -1
- package/components/history/HistoryView/HistoryView.js +12 -2
- package/components/history/HistoryView/styles.d.ts +1 -1
- package/components/history/HistoryView/styles.js +3 -0
- package/package.json +3 -3
|
@@ -19,7 +19,10 @@ var OvIcon = function (_a) {
|
|
|
19
19
|
if (!nonOvTotal) {
|
|
20
20
|
return null;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
var tooltipTitle = nonOvValues.length
|
|
23
|
+
? nonOvValues.map(function (value, i) { return (react_1.default.createElement("div", { key: i }, mdm_sdk_1.isComplexAttribute(attributeType) ? (mdm_sdk_1.getLabel(value.label)) : (react_1.default.createElement(DataTypeValue_1.default, { value: mdm_sdk_1.getAttributeValue(value), dataTypeDefinition: mdm_sdk_1.getAttrDataTypeDefinition(attributeType), rich: false })))); })
|
|
24
|
+
: null;
|
|
25
|
+
return (react_1.default.createElement(exports.ChipWithTooltip, { tooltipTitle: tooltipTitle, tooltipPlacement: "top", label: "+ " + nonOvTotal, variant: "outlined", classes: {
|
|
23
26
|
root: classnames_1.default(styles.container, className),
|
|
24
27
|
label: styles.label
|
|
25
28
|
} }));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
8
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
9
|
+
var styles_1 = require("./styles");
|
|
10
|
+
var ContributorItem = function (_a) {
|
|
11
|
+
var _b;
|
|
12
|
+
var value = _a.value, _c = _a.isSelected, isSelected = _c === void 0 ? true : _c, onClick = _a.onClick;
|
|
13
|
+
var color = mdm_sdk_1.getContributorColor(value);
|
|
14
|
+
var styles = styles_1.useContributorStyles({ color: color });
|
|
15
|
+
return (react_1.default.createElement("div", { className: classnames_1.default(styles.icon, (_b = {},
|
|
16
|
+
_b[styles.inactive] = !isSelected,
|
|
17
|
+
_b[styles.active] = isSelected,
|
|
18
|
+
_b[styles.clickable] = !!onClick,
|
|
19
|
+
_b)), onClick: onClick }));
|
|
20
|
+
};
|
|
21
|
+
exports.default = ContributorItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
values: string[];
|
|
4
|
+
selectedValues: string[];
|
|
5
|
+
onSelectValues: (values: string[]) => void;
|
|
6
|
+
entityUri: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const ContributorsPanel: ({ values, selectedValues, entityUri, onSelectValues, className }: Props) => JSX.Element;
|
|
10
|
+
export default ContributorsPanel;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
3
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
4
|
+
to[j] = from[i];
|
|
5
|
+
return to;
|
|
6
|
+
};
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
var react_1 = __importDefault(require("react"));
|
|
12
|
+
var classnames_1 = __importDefault(require("classnames"));
|
|
13
|
+
var ramda_1 = require("ramda");
|
|
14
|
+
var ContributorItem_1 = __importDefault(require("./ContributorItem"));
|
|
15
|
+
var styles_1 = require("./styles");
|
|
16
|
+
var ContributorsPanel = function (_a) {
|
|
17
|
+
var values = _a.values, selectedValues = _a.selectedValues, entityUri = _a.entityUri, onSelectValues = _a.onSelectValues, className = _a.className;
|
|
18
|
+
var styles = styles_1.useStyles();
|
|
19
|
+
var handleClick = function (value) {
|
|
20
|
+
if (selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.includes(value)) {
|
|
21
|
+
onSelectValues(ramda_1.without([value], selectedValues));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
onSelectValues(__spreadArray(__spreadArray([], (selectedValues || [])), [value]));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
return (react_1.default.createElement("div", { className: classnames_1.default(styles.root, className) },
|
|
28
|
+
react_1.default.createElement(ContributorItem_1.default, { value: entityUri }),
|
|
29
|
+
(values === null || values === void 0 ? void 0 : values.length) > 0 &&
|
|
30
|
+
values.map(function (value) { return (react_1.default.createElement(ContributorItem_1.default, { key: value, value: value, isSelected: selectedValues === null || selectedValues === void 0 ? void 0 : selectedValues.includes(value), onClick: function () { return handleClick(value); } })); })));
|
|
31
|
+
};
|
|
32
|
+
exports.default = ContributorsPanel;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"root">;
|
|
2
|
+
declare type StylesProps = {
|
|
3
|
+
color: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const useContributorStyles: (props: StylesProps) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "active" | "inactive" | "clickable">;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useContributorStyles = exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles({
|
|
6
|
+
root: {
|
|
7
|
+
flex: 1,
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexWrap: 'wrap',
|
|
10
|
+
padding: '10px 15px'
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports.useContributorStyles = styles_1.makeStyles({
|
|
14
|
+
icon: function (_a) {
|
|
15
|
+
var color = _a.color;
|
|
16
|
+
return ({
|
|
17
|
+
boxSizing: 'border-box',
|
|
18
|
+
borderWidth: 2,
|
|
19
|
+
borderStyle: 'solid',
|
|
20
|
+
borderColor: color,
|
|
21
|
+
height: 12,
|
|
22
|
+
width: 12,
|
|
23
|
+
borderRadius: 30,
|
|
24
|
+
transition: 'opacity 0.3s',
|
|
25
|
+
margin: 4
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
active: function (_a) {
|
|
29
|
+
var color = _a.color;
|
|
30
|
+
return ({
|
|
31
|
+
backgroundColor: color
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
inactive: {
|
|
35
|
+
backgroundColor: 'white'
|
|
36
|
+
},
|
|
37
|
+
clickable: {
|
|
38
|
+
cursor: 'pointer'
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
declare type Props = {
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
historyWithTotal: HistoryWithTotal;
|
|
6
|
+
contributorsUris: string[];
|
|
7
|
+
entityUri: string;
|
|
6
8
|
};
|
|
7
|
-
declare const _default: React.MemoExoticComponent<({ isLoading, historyWithTotal }: Props) => JSX.Element>;
|
|
9
|
+
declare const _default: React.MemoExoticComponent<({ isLoading, historyWithTotal, contributorsUris, entityUri }: Props) => JSX.Element>;
|
|
8
10
|
export default _default;
|
|
@@ -18,12 +18,22 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
21
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
22
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
23
|
+
};
|
|
21
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
25
|
var react_1 = __importStar(require("react"));
|
|
26
|
+
var ContributorsPanel_1 = __importDefault(require("../ContributorsPanel/ContributorsPanel"));
|
|
23
27
|
var styles_1 = require("./styles");
|
|
24
28
|
var HistoryView = function (_a) {
|
|
25
|
-
var isLoading = _a.isLoading, historyWithTotal = _a.historyWithTotal;
|
|
29
|
+
var isLoading = _a.isLoading, historyWithTotal = _a.historyWithTotal, contributorsUris = _a.contributorsUris, entityUri = _a.entityUri;
|
|
26
30
|
var styles = styles_1.useStyles();
|
|
27
|
-
|
|
31
|
+
var _b = react_1.useState(null), selectedUris = _b[0], setSelectedUris = _b[1];
|
|
32
|
+
react_1.useEffect(function () {
|
|
33
|
+
setSelectedUris(contributorsUris);
|
|
34
|
+
}, [contributorsUris]);
|
|
35
|
+
return (react_1.default.createElement("div", { className: styles.root },
|
|
36
|
+
react_1.default.createElement(ContributorsPanel_1.default, { values: contributorsUris, selectedValues: selectedUris, onSelectValues: setSelectedUris, entityUri: entityUri, className: styles.borderBottom }),
|
|
37
|
+
!isLoading && react_1.default.createElement("div", null, "total: " + (historyWithTotal === null || historyWithTotal === void 0 ? void 0 : historyWithTotal.total))));
|
|
28
38
|
};
|
|
29
39
|
exports.default = react_1.memo(HistoryView);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"root">;
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"borderBottom" | "root">;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.859",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@date-io/moment": "^1.3.5",
|
|
8
8
|
"@react-google-maps/api": "^2.7.0",
|
|
9
|
-
"@reltio/mdm-module": "^1.4.
|
|
10
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
9
|
+
"@reltio/mdm-module": "^1.4.859",
|
|
10
|
+
"@reltio/mdm-sdk": "^1.4.859",
|
|
11
11
|
"classnames": "^2.2.5",
|
|
12
12
|
"frontend-collective-react-dnd-scrollzone": "^1.0.2",
|
|
13
13
|
"nanoid": "^2.0.0",
|