@reltio/components 1.4.1208 → 1.4.1216
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/cjs/components/MatchRulesBlock/MatchRulesBlock.js +2 -3
- package/cjs/components/MatchRulesBlock/SimpleMatchRulesBuilder/SimpleMatchRulesBuilder.js +3 -3
- package/cjs/components/MatchRulesBlock/types/index.d.ts +0 -2
- package/cjs/components/MatchRulesBlock/types/index.js +0 -2
- package/cjs/hooks/useSnackbar.js +3 -1
- package/esm/components/MatchRulesBlock/MatchRulesBlock.js +2 -3
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBuilder/SimpleMatchRulesBuilder.js +3 -3
- package/esm/components/MatchRulesBlock/types/index.d.ts +0 -2
- package/esm/components/MatchRulesBlock/types/index.js +0 -2
- package/esm/hooks/useSnackbar.js +3 -1
- package/package.json +3 -3
|
@@ -22,11 +22,10 @@ var MatchRulesBlock = function (_a) {
|
|
|
22
22
|
return uri !== mdm_sdk_1.NOT_MATCH;
|
|
23
23
|
});
|
|
24
24
|
var hasNotMatch = rules.length !== matchRules.length;
|
|
25
|
-
var showTransitive = isTransitive && variant !== types_1.MatchRuleVariant.ml;
|
|
26
25
|
var showSimple = !isTransitive && !hasNotMatch;
|
|
27
|
-
var showNotMatch = hasNotMatch &&
|
|
26
|
+
var showNotMatch = hasNotMatch && variant !== types_1.MatchRuleVariant.excludeNotMatch;
|
|
28
27
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
29
|
-
|
|
28
|
+
isTransitive ? (react_1.default.createElement(TransitiveMatchBlock_1.default, { transitiveMatchRules: mdm_sdk_1.getTransitiveMatchRules(metadata, match, entitiesMap) })) : null,
|
|
30
29
|
showSimple ? (react_1.default.createElement(SimpleMatchRulesBuilder_1.default, { variant: variant, matchRules: matchRules, Component: SimpleMatchRulesBlock_1.default })) : null,
|
|
31
30
|
showNotMatch ? react_1.default.createElement(NotMatchRule_1.default, null) : null));
|
|
32
31
|
};
|
|
@@ -33,9 +33,9 @@ var types_1 = require("../types");
|
|
|
33
33
|
var SimpleMatchRulesBuilder = function (_a) {
|
|
34
34
|
var matchRules = _a.matchRules, Component = _a.Component, _b = _a.variant, variant = _b === void 0 ? types_1.MatchRuleVariant.all : _b, otherProps = __rest(_a, ["matchRules", "Component", "variant"]);
|
|
35
35
|
var _c = mdm_sdk_1.partitionByMlMatch(matchRules), MlMatchRules = _c[0], otherMatchRules = _c[1];
|
|
36
|
-
var all = types_1.MatchRuleVariant.all, simple = types_1.MatchRuleVariant.simple,
|
|
37
|
-
var showSimple = [all, simple,
|
|
38
|
-
var showML = [all,
|
|
36
|
+
var all = types_1.MatchRuleVariant.all, simple = types_1.MatchRuleVariant.simple, excludeNotMatch = types_1.MatchRuleVariant.excludeNotMatch;
|
|
37
|
+
var showSimple = [all, simple, excludeNotMatch].includes(variant) && !ramda_1.isEmpty(otherMatchRules);
|
|
38
|
+
var showML = [all, excludeNotMatch].includes(variant) && !ramda_1.isEmpty(MlMatchRules);
|
|
39
39
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
40
40
|
showSimple ? react_1.default.createElement(Component, __assign({ matchRules: otherMatchRules }, otherProps)) : null,
|
|
41
41
|
showML ? react_1.default.createElement(Component, __assign({ isMlMatch: true, matchRules: MlMatchRules }, otherProps)) : null));
|
|
@@ -5,9 +5,7 @@ declare type MatchRule = {
|
|
|
5
5
|
export declare type MatchRules = MatchRule[];
|
|
6
6
|
export declare enum MatchRuleVariant {
|
|
7
7
|
all = "all",
|
|
8
|
-
ml = "ml",
|
|
9
8
|
simple = "simple",
|
|
10
|
-
excludeML = "excludeML",
|
|
11
9
|
excludeNotMatch = "excludeNotMatch"
|
|
12
10
|
}
|
|
13
11
|
export declare type TransitiveMatchRules = Array<{
|
|
@@ -4,8 +4,6 @@ exports.MatchRuleVariant = void 0;
|
|
|
4
4
|
var MatchRuleVariant;
|
|
5
5
|
(function (MatchRuleVariant) {
|
|
6
6
|
MatchRuleVariant["all"] = "all";
|
|
7
|
-
MatchRuleVariant["ml"] = "ml";
|
|
8
7
|
MatchRuleVariant["simple"] = "simple";
|
|
9
|
-
MatchRuleVariant["excludeML"] = "excludeML";
|
|
10
8
|
MatchRuleVariant["excludeNotMatch"] = "excludeNotMatch";
|
|
11
9
|
})(MatchRuleVariant = exports.MatchRuleVariant || (exports.MatchRuleVariant = {}));
|
package/cjs/hooks/useSnackbar.js
CHANGED
|
@@ -28,6 +28,7 @@ var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
|
28
28
|
var Portal_1 = __importDefault(require("@material-ui/core/Portal"));
|
|
29
29
|
var Button_1 = __importDefault(require("@material-ui/core/Button"));
|
|
30
30
|
var Snackbar_1 = __importDefault(require("@material-ui/core/Snackbar"));
|
|
31
|
+
var FIVE_MINUTES = 5 * 60 * 1000;
|
|
31
32
|
var useSnackbar = function (options) {
|
|
32
33
|
if (options === void 0) { options = {}; }
|
|
33
34
|
var anchorOrigin = options.anchorOrigin, showDismiss = options.showDismiss;
|
|
@@ -43,7 +44,8 @@ var useSnackbar = function (options) {
|
|
|
43
44
|
}, []);
|
|
44
45
|
var SnackbarRenderer = react_1.useCallback(function () {
|
|
45
46
|
return (react_1.default.createElement(Portal_1.default, { container: document.body },
|
|
46
|
-
react_1.default.createElement(Snackbar_1.default, { open: isOpenSnackbar, anchorOrigin: anchorOrigin, autoHideDuration:
|
|
47
|
+
react_1.default.createElement(Snackbar_1.default, { open: isOpenSnackbar, anchorOrigin: anchorOrigin, autoHideDuration: FIVE_MINUTES, onClose: closeSnackbar, message: snackbarMessage, action: showDismiss ? (react_1.default.createElement(Button_1.default, { color: "primary", onClick: closeSnackbar }, ui_i18n_1.default.text('Dismiss'))) : undefined })));
|
|
48
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
47
49
|
}, [isOpenSnackbar, closeSnackbar, snackbarMessage]);
|
|
48
50
|
return { SnackbarRenderer: SnackbarRenderer, showSnackbarMessage: showSnackbarMessage };
|
|
49
51
|
};
|
|
@@ -17,11 +17,10 @@ var MatchRulesBlock = function (_a) {
|
|
|
17
17
|
return uri !== NOT_MATCH;
|
|
18
18
|
});
|
|
19
19
|
var hasNotMatch = rules.length !== matchRules.length;
|
|
20
|
-
var showTransitive = isTransitive && variant !== MatchRuleVariant.ml;
|
|
21
20
|
var showSimple = !isTransitive && !hasNotMatch;
|
|
22
|
-
var showNotMatch = hasNotMatch &&
|
|
21
|
+
var showNotMatch = hasNotMatch && variant !== MatchRuleVariant.excludeNotMatch;
|
|
23
22
|
return (React.createElement(React.Fragment, null,
|
|
24
|
-
|
|
23
|
+
isTransitive ? (React.createElement(TransitiveMatchBlock, { transitiveMatchRules: getTransitiveMatchRules(metadata, match, entitiesMap) })) : null,
|
|
25
24
|
showSimple ? (React.createElement(SimpleMatchRulesBuilder, { variant: variant, matchRules: matchRules, Component: SimpleMatchRulesBlock })) : null,
|
|
26
25
|
showNotMatch ? React.createElement(NotMatchRule, null) : null));
|
|
27
26
|
};
|
|
@@ -28,9 +28,9 @@ import { MatchRuleVariant } from '../types';
|
|
|
28
28
|
var SimpleMatchRulesBuilder = function (_a) {
|
|
29
29
|
var matchRules = _a.matchRules, Component = _a.Component, _b = _a.variant, variant = _b === void 0 ? MatchRuleVariant.all : _b, otherProps = __rest(_a, ["matchRules", "Component", "variant"]);
|
|
30
30
|
var _c = partitionByMlMatch(matchRules), MlMatchRules = _c[0], otherMatchRules = _c[1];
|
|
31
|
-
var all = MatchRuleVariant.all, simple = MatchRuleVariant.simple,
|
|
32
|
-
var showSimple = [all, simple,
|
|
33
|
-
var showML = [all,
|
|
31
|
+
var all = MatchRuleVariant.all, simple = MatchRuleVariant.simple, excludeNotMatch = MatchRuleVariant.excludeNotMatch;
|
|
32
|
+
var showSimple = [all, simple, excludeNotMatch].includes(variant) && !isEmpty(otherMatchRules);
|
|
33
|
+
var showML = [all, excludeNotMatch].includes(variant) && !isEmpty(MlMatchRules);
|
|
34
34
|
return (React.createElement(React.Fragment, null,
|
|
35
35
|
showSimple ? React.createElement(Component, __assign({ matchRules: otherMatchRules }, otherProps)) : null,
|
|
36
36
|
showML ? React.createElement(Component, __assign({ isMlMatch: true, matchRules: MlMatchRules }, otherProps)) : null));
|
|
@@ -5,9 +5,7 @@ declare type MatchRule = {
|
|
|
5
5
|
export declare type MatchRules = MatchRule[];
|
|
6
6
|
export declare enum MatchRuleVariant {
|
|
7
7
|
all = "all",
|
|
8
|
-
ml = "ml",
|
|
9
8
|
simple = "simple",
|
|
10
|
-
excludeML = "excludeML",
|
|
11
9
|
excludeNotMatch = "excludeNotMatch"
|
|
12
10
|
}
|
|
13
11
|
export declare type TransitiveMatchRules = Array<{
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export var MatchRuleVariant;
|
|
2
2
|
(function (MatchRuleVariant) {
|
|
3
3
|
MatchRuleVariant["all"] = "all";
|
|
4
|
-
MatchRuleVariant["ml"] = "ml";
|
|
5
4
|
MatchRuleVariant["simple"] = "simple";
|
|
6
|
-
MatchRuleVariant["excludeML"] = "excludeML";
|
|
7
5
|
MatchRuleVariant["excludeNotMatch"] = "excludeNotMatch";
|
|
8
6
|
})(MatchRuleVariant || (MatchRuleVariant = {}));
|
package/esm/hooks/useSnackbar.js
CHANGED
|
@@ -3,6 +3,7 @@ import i18n from 'ui-i18n';
|
|
|
3
3
|
import Portal from '@material-ui/core/Portal';
|
|
4
4
|
import Button from '@material-ui/core/Button';
|
|
5
5
|
import Snackbar from '@material-ui/core/Snackbar';
|
|
6
|
+
var FIVE_MINUTES = 5 * 60 * 1000;
|
|
6
7
|
export var useSnackbar = function (options) {
|
|
7
8
|
if (options === void 0) { options = {}; }
|
|
8
9
|
var anchorOrigin = options.anchorOrigin, showDismiss = options.showDismiss;
|
|
@@ -18,7 +19,8 @@ export var useSnackbar = function (options) {
|
|
|
18
19
|
}, []);
|
|
19
20
|
var SnackbarRenderer = useCallback(function () {
|
|
20
21
|
return (React.createElement(Portal, { container: document.body },
|
|
21
|
-
React.createElement(Snackbar, { open: isOpenSnackbar, anchorOrigin: anchorOrigin, autoHideDuration:
|
|
22
|
+
React.createElement(Snackbar, { open: isOpenSnackbar, anchorOrigin: anchorOrigin, autoHideDuration: FIVE_MINUTES, onClose: closeSnackbar, message: snackbarMessage, action: showDismiss ? (React.createElement(Button, { color: "primary", onClick: closeSnackbar }, i18n.text('Dismiss'))) : undefined })));
|
|
23
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
22
24
|
}, [isOpenSnackbar, closeSnackbar, snackbarMessage]);
|
|
23
25
|
return { SnackbarRenderer: SnackbarRenderer, showSnackbarMessage: showSnackbarMessage };
|
|
24
26
|
};
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1216",
|
|
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.1216",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1216",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|