@reltio/components 1.4.1210 → 1.4.1218
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/SimpleMatchRulesBuilder/SimpleMatchRulesBuilder.js +3 -1
- package/cjs/components/MatchRulesBlock/SimpleMatchRulesBuilder/styles.d.ts +2 -0
- package/cjs/components/MatchRulesBlock/SimpleMatchRulesBuilder/styles.js +13 -0
- package/cjs/components/MatchRulesBlock/TransitiveMatchBlock/styles.d.ts +1 -1
- package/cjs/components/MatchRulesBlock/TransitiveMatchBlock/styles.js +4 -5
- package/cjs/hooks/useSnackbar.js +3 -1
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBuilder/SimpleMatchRulesBuilder.js +3 -1
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBuilder/styles.d.ts +2 -0
- package/esm/components/MatchRulesBlock/SimpleMatchRulesBuilder/styles.js +11 -0
- package/esm/components/MatchRulesBlock/TransitiveMatchBlock/styles.d.ts +1 -1
- package/esm/components/MatchRulesBlock/TransitiveMatchBlock/styles.js +4 -5
- package/esm/hooks/useSnackbar.js +3 -1
- package/package.json +3 -3
|
@@ -30,13 +30,15 @@ var prop_types_1 = __importDefault(require("prop-types"));
|
|
|
30
30
|
var ramda_1 = require("ramda");
|
|
31
31
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
32
32
|
var types_1 = require("../types");
|
|
33
|
+
var styles_1 = __importDefault(require("./styles"));
|
|
33
34
|
var SimpleMatchRulesBuilder = function (_a) {
|
|
34
35
|
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"]);
|
|
36
|
+
var styles = styles_1.default();
|
|
35
37
|
var _c = mdm_sdk_1.partitionByMlMatch(matchRules), MlMatchRules = _c[0], otherMatchRules = _c[1];
|
|
36
38
|
var all = types_1.MatchRuleVariant.all, simple = types_1.MatchRuleVariant.simple, excludeNotMatch = types_1.MatchRuleVariant.excludeNotMatch;
|
|
37
39
|
var showSimple = [all, simple, excludeNotMatch].includes(variant) && !ramda_1.isEmpty(otherMatchRules);
|
|
38
40
|
var showML = [all, excludeNotMatch].includes(variant) && !ramda_1.isEmpty(MlMatchRules);
|
|
39
|
-
return (react_1.default.createElement(
|
|
41
|
+
return (react_1.default.createElement("div", { className: styles.container },
|
|
40
42
|
showSimple ? react_1.default.createElement(Component, __assign({ matchRules: otherMatchRules }, otherProps)) : null,
|
|
41
43
|
showML ? react_1.default.createElement(Component, __assign({ isMlMatch: true, matchRules: MlMatchRules }, otherProps)) : null));
|
|
42
44
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
4
|
+
var styles = styles_1.makeStyles({
|
|
5
|
+
container: {
|
|
6
|
+
display: 'flex',
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
'& :not(:last-child)': {
|
|
9
|
+
marginBottom: '2px'
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
exports.default = styles;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"container"
|
|
1
|
+
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"container">;
|
|
2
2
|
export default styles;
|
|
@@ -4,11 +4,10 @@ var styles_1 = require("@material-ui/core/styles");
|
|
|
4
4
|
var styles = styles_1.makeStyles({
|
|
5
5
|
container: {
|
|
6
6
|
display: 'flex',
|
|
7
|
-
flexDirection: 'column'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
flexDirection: 'column'
|
|
7
|
+
flexDirection: 'column',
|
|
8
|
+
'& :not(:last-child)': {
|
|
9
|
+
marginBottom: '2px'
|
|
10
|
+
}
|
|
12
11
|
}
|
|
13
12
|
});
|
|
14
13
|
exports.default = styles;
|
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
|
};
|
|
@@ -25,13 +25,15 @@ import PropTypes from 'prop-types';
|
|
|
25
25
|
import { isEmpty } from 'ramda';
|
|
26
26
|
import { MatchRulesType, partitionByMlMatch } from '@reltio/mdm-sdk';
|
|
27
27
|
import { MatchRuleVariant } from '../types';
|
|
28
|
+
import useStyles from './styles';
|
|
28
29
|
var SimpleMatchRulesBuilder = function (_a) {
|
|
29
30
|
var matchRules = _a.matchRules, Component = _a.Component, _b = _a.variant, variant = _b === void 0 ? MatchRuleVariant.all : _b, otherProps = __rest(_a, ["matchRules", "Component", "variant"]);
|
|
31
|
+
var styles = useStyles();
|
|
30
32
|
var _c = partitionByMlMatch(matchRules), MlMatchRules = _c[0], otherMatchRules = _c[1];
|
|
31
33
|
var all = MatchRuleVariant.all, simple = MatchRuleVariant.simple, excludeNotMatch = MatchRuleVariant.excludeNotMatch;
|
|
32
34
|
var showSimple = [all, simple, excludeNotMatch].includes(variant) && !isEmpty(otherMatchRules);
|
|
33
35
|
var showML = [all, excludeNotMatch].includes(variant) && !isEmpty(MlMatchRules);
|
|
34
|
-
return (React.createElement(
|
|
36
|
+
return (React.createElement("div", { className: styles.container },
|
|
35
37
|
showSimple ? React.createElement(Component, __assign({ matchRules: otherMatchRules }, otherProps)) : null,
|
|
36
38
|
showML ? React.createElement(Component, __assign({ isMlMatch: true, matchRules: MlMatchRules }, otherProps)) : null));
|
|
37
39
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"container"
|
|
1
|
+
declare const styles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"container">;
|
|
2
2
|
export default styles;
|
|
@@ -2,11 +2,10 @@ import { makeStyles } from '@material-ui/core/styles';
|
|
|
2
2
|
var styles = makeStyles({
|
|
3
3
|
container: {
|
|
4
4
|
display: 'flex',
|
|
5
|
-
flexDirection: 'column'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
flexDirection: 'column'
|
|
5
|
+
flexDirection: 'column',
|
|
6
|
+
'& :not(:last-child)': {
|
|
7
|
+
marginBottom: '2px'
|
|
8
|
+
}
|
|
10
9
|
}
|
|
11
10
|
});
|
|
12
11
|
export default styles;
|
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.1218",
|
|
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.1218",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1218",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|