@reltio/components 1.4.1340 → 1.4.1342

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 (25) hide show
  1. package/cjs/components/MatchRulesBlock/MatchRulesBlock.js +2 -2
  2. package/cjs/components/MatchRulesBlock/MatchRulesTooltip/MatchRulesTooltip.js +4 -1
  3. package/cjs/components/MatchRulesBlock/MatchRulesTooltip/styles.d.ts +1 -1
  4. package/cjs/components/MatchRulesBlock/MatchRulesTooltip/styles.js +5 -0
  5. package/cjs/components/MatchRulesBlock/SimpleMatchRules/SimpleMatchRules.js +4 -1
  6. package/cjs/components/MatchRulesBlock/SimpleMatchRules/styles.d.ts +1 -1
  7. package/cjs/components/MatchRulesBlock/SimpleMatchRules/styles.js +5 -0
  8. package/cjs/components/MatchRulesBlock/types/index.d.ts +1 -0
  9. package/cjs/icons/NegativeRuleIcon.d.ts +3 -0
  10. package/cjs/icons/NegativeRuleIcon.js +22 -0
  11. package/cjs/icons/NegativeRuleTooltipIcon.d.ts +3 -0
  12. package/cjs/icons/NegativeRuleTooltipIcon.js +22 -0
  13. package/esm/components/MatchRulesBlock/MatchRulesBlock.js +2 -2
  14. package/esm/components/MatchRulesBlock/MatchRulesTooltip/MatchRulesTooltip.js +4 -1
  15. package/esm/components/MatchRulesBlock/MatchRulesTooltip/styles.d.ts +1 -1
  16. package/esm/components/MatchRulesBlock/MatchRulesTooltip/styles.js +5 -0
  17. package/esm/components/MatchRulesBlock/SimpleMatchRules/SimpleMatchRules.js +4 -1
  18. package/esm/components/MatchRulesBlock/SimpleMatchRules/styles.d.ts +1 -1
  19. package/esm/components/MatchRulesBlock/SimpleMatchRules/styles.js +5 -0
  20. package/esm/components/MatchRulesBlock/types/index.d.ts +1 -0
  21. package/esm/icons/NegativeRuleIcon.d.ts +3 -0
  22. package/esm/icons/NegativeRuleIcon.js +17 -0
  23. package/esm/icons/NegativeRuleTooltipIcon.d.ts +3 -0
  24. package/esm/icons/NegativeRuleTooltipIcon.js +17 -0
  25. package/package.json +3 -3
@@ -12,11 +12,11 @@ var NotMatchRule_1 = __importDefault(require("./NotMatchRule/NotMatchRule"));
12
12
  var types_1 = require("./types");
13
13
  var MatchRulesBlock = function (_a) {
14
14
  var entitiesMap = _a.entitiesMap, entity = _a.entity, match = _a.match, metadata = _a.metadata, _b = _a.variant, variant = _b === void 0 ? types_1.MatchRuleVariant.all : _b;
15
- if (!match.matchRules) {
15
+ if (!match.matchRules && !match.negativeRules) {
16
16
  return null;
17
17
  }
18
18
  var isTransitive = (0, mdm_sdk_1.isTransitiveMatch)(match);
19
- var matchRules = (0, mdm_sdk_1.getMatchRules)(metadata, entity.type, match.matchRules);
19
+ var matchRules = (0, mdm_sdk_1.getMatchRules)(metadata, entity.type, (match.matchRules || []).concat(match.negativeRules || []));
20
20
  var rules = matchRules.filter(function (_a) {
21
21
  var uri = _a.uri;
22
22
  return uri !== mdm_sdk_1.NOT_MATCH;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
7
  var MatchRulesTitle_1 = __importDefault(require("../MatchRulesTitle"));
8
8
  var styles_1 = __importDefault(require("./styles"));
9
+ var NegativeRuleTooltipIcon_1 = __importDefault(require("../../../icons/NegativeRuleTooltipIcon"));
9
10
  var MatchRulesTooltip = function (_a) {
10
11
  var _b = _a.isMlMatch, isMlMatch = _b === void 0 ? false : _b, matchRules = _a.matchRules;
11
12
  var styles = (0, styles_1.default)();
@@ -13,6 +14,8 @@ var MatchRulesTooltip = function (_a) {
13
14
  react_1.default.createElement("div", { className: styles.title },
14
15
  react_1.default.createElement(MatchRulesTitle_1.default, { isMlMatch: isMlMatch }),
15
16
  ' '),
16
- react_1.default.createElement("div", { className: styles.body }, matchRules.map(function (match) { return (react_1.default.createElement("div", { key: match.uri }, "- ".concat(match.label))); }))));
17
+ react_1.default.createElement("div", { className: styles.body }, matchRules.map(function (match) { return (react_1.default.createElement("div", { key: match.uri },
18
+ '- ',
19
+ match.negativeRule && react_1.default.createElement(NegativeRuleTooltipIcon_1.default, { className: styles.negativeRuleIcon }), "".concat(match.label))); }))));
17
20
  };
18
21
  exports.default = MatchRulesTooltip;
@@ -1,2 +1,2 @@
1
- declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "title" | "container">;
1
+ declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "title" | "container" | "negativeRuleIcon">;
2
2
  export default styles;
@@ -14,6 +14,11 @@ var styles = (0, styles_1.makeStyles)({
14
14
  padding: '8px',
15
15
  fontSize: '12px',
16
16
  lineHeight: '14px'
17
+ },
18
+ negativeRuleIcon: {
19
+ position: 'relative',
20
+ marginRight: '4px',
21
+ top: '1px'
17
22
  }
18
23
  });
19
24
  exports.default = styles;
@@ -7,12 +7,15 @@ var react_1 = __importDefault(require("react"));
7
7
  var classnames_1 = __importDefault(require("classnames"));
8
8
  var MatchRulesTitle_1 = __importDefault(require("../MatchRulesTitle"));
9
9
  var styles_1 = __importDefault(require("./styles"));
10
+ var NegativeRuleIcon_1 = __importDefault(require("../../../icons/NegativeRuleIcon"));
10
11
  var SimpleMatchRules = function (_a) {
11
12
  var isMlMatch = _a.isMlMatch, matchRules = _a.matchRules, className = _a.className;
12
13
  var styles = (0, styles_1.default)();
13
14
  return (react_1.default.createElement("div", { "data-reltio-id": "simple-match-rules", className: (0, classnames_1.default)(styles.container, className) },
14
15
  react_1.default.createElement("div", { className: styles.title },
15
16
  react_1.default.createElement(MatchRulesTitle_1.default, { isMlMatch: isMlMatch })),
16
- react_1.default.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (match) { return (react_1.default.createElement("div", { key: match.uri }, "- ".concat(match.label))); }))));
17
+ react_1.default.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (match) { return (react_1.default.createElement("div", { key: match.uri },
18
+ '- ',
19
+ match.negativeRule && react_1.default.createElement(NegativeRuleIcon_1.default, { className: styles.negativeRuleIcon }), "".concat(match.label))); }))));
17
20
  };
18
21
  exports.default = SimpleMatchRules;
@@ -1,2 +1,2 @@
1
- declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "labelsContainer">;
1
+ declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "negativeRuleIcon" | "labelsContainer">;
2
2
  export default styles;
@@ -13,6 +13,11 @@ var styles = (0, styles_1.makeStyles)(function (theme) { return ({
13
13
  labelsContainer: {
14
14
  color: theme.palette.text.primary,
15
15
  marginBottom: '8px'
16
+ },
17
+ negativeRuleIcon: {
18
+ position: 'relative',
19
+ marginRight: '4px',
20
+ top: '1px'
16
21
  }
17
22
  }); });
18
23
  exports.default = styles;
@@ -1,6 +1,7 @@
1
1
  declare type MatchRule = {
2
2
  uri: string;
3
3
  label: string;
4
+ negativeRule?: Record<string, unknown>;
4
5
  };
5
6
  export declare type MatchRules = MatchRule[];
6
7
  export declare enum MatchRuleVariant {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const NegativeRuleIcon: React.FC<React.SVGProps<SVGSVGElement>>;
3
+ export default NegativeRuleIcon;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var react_1 = __importDefault(require("react"));
18
+ var NegativeRuleIcon = function (props) {
19
+ return (react_1.default.createElement("svg", __assign({ width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
20
+ react_1.default.createElement("path", { d: "M5 0C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10C7.76 10 10 7.76 10 5C10 2.24 7.76 0 5 0ZM7.5 5.5H2.5V4.5H7.5V5.5Z", fill: "black", fillOpacity: "0.54" })));
21
+ };
22
+ exports.default = NegativeRuleIcon;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const NegativeRuleTooltipIcon: React.FC<React.SVGProps<SVGSVGElement>>;
3
+ export default NegativeRuleTooltipIcon;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ var react_1 = __importDefault(require("react"));
18
+ var NegativeRuleTooltipIcon = function (props) {
19
+ return (react_1.default.createElement("svg", __assign({ width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
20
+ react_1.default.createElement("path", { d: "M5 0C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10C7.76 10 10 7.76 10 5C10 2.24 7.76 0 5 0ZM7.5 5.5H2.5V4.5H7.5V5.5Z", fill: "white", fillOpacity: "0.54" })));
21
+ };
22
+ exports.default = NegativeRuleTooltipIcon;
@@ -7,11 +7,11 @@ import NotMatchRule from './NotMatchRule/NotMatchRule';
7
7
  import { MatchRuleVariant } from './types';
8
8
  var MatchRulesBlock = function (_a) {
9
9
  var entitiesMap = _a.entitiesMap, entity = _a.entity, match = _a.match, metadata = _a.metadata, _b = _a.variant, variant = _b === void 0 ? MatchRuleVariant.all : _b;
10
- if (!match.matchRules) {
10
+ if (!match.matchRules && !match.negativeRules) {
11
11
  return null;
12
12
  }
13
13
  var isTransitive = isTransitiveMatch(match);
14
- var matchRules = getMatchRules(metadata, entity.type, match.matchRules);
14
+ var matchRules = getMatchRules(metadata, entity.type, (match.matchRules || []).concat(match.negativeRules || []));
15
15
  var rules = matchRules.filter(function (_a) {
16
16
  var uri = _a.uri;
17
17
  return uri !== NOT_MATCH;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import MatchRulesTitle from '../MatchRulesTitle';
3
3
  import useStyles from './styles';
4
+ import NegativeRuleTooltipIcon from '../../../icons/NegativeRuleTooltipIcon';
4
5
  var MatchRulesTooltip = function (_a) {
5
6
  var _b = _a.isMlMatch, isMlMatch = _b === void 0 ? false : _b, matchRules = _a.matchRules;
6
7
  var styles = useStyles();
@@ -8,6 +9,8 @@ var MatchRulesTooltip = function (_a) {
8
9
  React.createElement("div", { className: styles.title },
9
10
  React.createElement(MatchRulesTitle, { isMlMatch: isMlMatch }),
10
11
  ' '),
11
- React.createElement("div", { className: styles.body }, matchRules.map(function (match) { return (React.createElement("div", { key: match.uri }, "- ".concat(match.label))); }))));
12
+ React.createElement("div", { className: styles.body }, matchRules.map(function (match) { return (React.createElement("div", { key: match.uri },
13
+ '- ',
14
+ match.negativeRule && React.createElement(NegativeRuleTooltipIcon, { className: styles.negativeRuleIcon }), "".concat(match.label))); }))));
12
15
  };
13
16
  export default MatchRulesTooltip;
@@ -1,2 +1,2 @@
1
- declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "title" | "container">;
1
+ declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"body" | "title" | "container" | "negativeRuleIcon">;
2
2
  export default styles;
@@ -12,6 +12,11 @@ var styles = makeStyles({
12
12
  padding: '8px',
13
13
  fontSize: '12px',
14
14
  lineHeight: '14px'
15
+ },
16
+ negativeRuleIcon: {
17
+ position: 'relative',
18
+ marginRight: '4px',
19
+ top: '1px'
15
20
  }
16
21
  });
17
22
  export default styles;
@@ -2,12 +2,15 @@ import React from 'react';
2
2
  import classnames from 'classnames';
3
3
  import MatchRulesTitle from '../MatchRulesTitle';
4
4
  import useStyles from './styles';
5
+ import NegativeRuleIcon from '../../../icons/NegativeRuleIcon';
5
6
  var SimpleMatchRules = function (_a) {
6
7
  var isMlMatch = _a.isMlMatch, matchRules = _a.matchRules, className = _a.className;
7
8
  var styles = useStyles();
8
9
  return (React.createElement("div", { "data-reltio-id": "simple-match-rules", className: classnames(styles.container, className) },
9
10
  React.createElement("div", { className: styles.title },
10
11
  React.createElement(MatchRulesTitle, { isMlMatch: isMlMatch })),
11
- React.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (match) { return (React.createElement("div", { key: match.uri }, "- ".concat(match.label))); }))));
12
+ React.createElement("div", { className: styles.labelsContainer }, matchRules.map(function (match) { return (React.createElement("div", { key: match.uri },
13
+ '- ',
14
+ match.negativeRule && React.createElement(NegativeRuleIcon, { className: styles.negativeRuleIcon }), "".concat(match.label))); }))));
12
15
  };
13
16
  export default SimpleMatchRules;
@@ -1,2 +1,2 @@
1
- declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "labelsContainer">;
1
+ declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"title" | "container" | "negativeRuleIcon" | "labelsContainer">;
2
2
  export default styles;
@@ -11,6 +11,11 @@ var styles = makeStyles(function (theme) { return ({
11
11
  labelsContainer: {
12
12
  color: theme.palette.text.primary,
13
13
  marginBottom: '8px'
14
+ },
15
+ negativeRuleIcon: {
16
+ position: 'relative',
17
+ marginRight: '4px',
18
+ top: '1px'
14
19
  }
15
20
  }); });
16
21
  export default styles;
@@ -1,6 +1,7 @@
1
1
  declare type MatchRule = {
2
2
  uri: string;
3
3
  label: string;
4
+ negativeRule?: Record<string, unknown>;
4
5
  };
5
6
  export declare type MatchRules = MatchRule[];
6
7
  export declare enum MatchRuleVariant {
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const NegativeRuleIcon: React.FC<React.SVGProps<SVGSVGElement>>;
3
+ export default NegativeRuleIcon;
@@ -0,0 +1,17 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ var NegativeRuleIcon = function (props) {
14
+ return (React.createElement("svg", __assign({ width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
15
+ React.createElement("path", { d: "M5 0C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10C7.76 10 10 7.76 10 5C10 2.24 7.76 0 5 0ZM7.5 5.5H2.5V4.5H7.5V5.5Z", fill: "black", fillOpacity: "0.54" })));
16
+ };
17
+ export default NegativeRuleIcon;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const NegativeRuleTooltipIcon: React.FC<React.SVGProps<SVGSVGElement>>;
3
+ export default NegativeRuleTooltipIcon;
@@ -0,0 +1,17 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import React from 'react';
13
+ var NegativeRuleTooltipIcon = function (props) {
14
+ return (React.createElement("svg", __assign({ width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props),
15
+ React.createElement("path", { d: "M5 0C2.24 0 0 2.24 0 5C0 7.76 2.24 10 5 10C7.76 10 10 7.76 10 5C10 2.24 7.76 0 5 0ZM7.5 5.5H2.5V4.5H7.5V5.5Z", fill: "white", fillOpacity: "0.54" })));
16
+ };
17
+ export default NegativeRuleTooltipIcon;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1340",
3
+ "version": "1.4.1342",
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.1340",
11
- "@reltio/mdm-sdk": "^1.4.1340",
10
+ "@reltio/mdm-module": "^1.4.1342",
11
+ "@reltio/mdm-sdk": "^1.4.1342",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",