@reltio/components 1.4.2287 → 1.4.2288

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.
@@ -3,12 +3,17 @@ type AddError = (error: {
3
3
  title: string;
4
4
  message: string;
5
5
  }) => void;
6
+ type Classes = {
7
+ errorBlock?: string;
8
+ errorMessage?: string;
9
+ };
6
10
  type Props = {
7
11
  showErrorFromStore?: boolean;
12
+ classes?: Classes;
8
13
  [key: string]: unknown;
9
14
  };
10
15
  export declare const ErrorPopup: {
11
- ({ showErrorFromStore, ...props }: Props): React.JSX.Element;
16
+ ({ showErrorFromStore, classes, ...props }: Props): React.JSX.Element;
12
17
  addError: AddError;
13
18
  };
14
19
  export {};
@@ -22,16 +22,14 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import React, { useEffect } from 'react';
24
24
  import classnames from 'classnames';
25
- import { path } from 'ramda';
26
25
  import i18n from 'ui-i18n';
27
26
  import Portal from '@mui/material/Portal';
28
27
  import RCErrorPopup from 'react-components/dist/ErrorPopup/ErrorPopup';
29
28
  import { useMdmAction, useMdmAutoCloseInterval, useMdmUiError } from '../contexts/MdmModuleContext';
30
- import { useStyles } from './styles';
29
+ import styles from './ErrorPopup.module.css';
31
30
  var addError = RCErrorPopup.addError;
32
31
  export var ErrorPopup = function (_a) {
33
- var showErrorFromStore = _a.showErrorFromStore, props = __rest(_a, ["showErrorFromStore"]);
34
- var styles = useStyles();
32
+ var showErrorFromStore = _a.showErrorFromStore, classes = _a.classes, props = __rest(_a, ["showErrorFromStore", "classes"]);
35
33
  var errorSet = useMdmAction('errorSet');
36
34
  var autoCloseInterval = useMdmAutoCloseInterval();
37
35
  var uiError = useMdmUiError();
@@ -42,6 +40,9 @@ export var ErrorPopup = function (_a) {
42
40
  }
43
41
  }, [errorSet, uiError, showErrorFromStore]);
44
42
  return (React.createElement(Portal, { container: document.body },
45
- React.createElement(RCErrorPopup, __assign({ classes: { errorBlock: classnames(styles.errorBlock, path(['classes', 'errorBlock'], props)) }, autoCloseInterval: autoCloseInterval }, props))));
43
+ React.createElement(RCErrorPopup, __assign({ autoCloseInterval: autoCloseInterval }, props, { classes: {
44
+ errorBlock: classnames(styles.errorBlock, classes === null || classes === void 0 ? void 0 : classes.errorBlock),
45
+ errorMessage: classnames(styles.errorMessage, classes === null || classes === void 0 ? void 0 : classes.errorMessage)
46
+ } }))));
46
47
  };
47
48
  ErrorPopup.addError = addError;
@@ -0,0 +1,9 @@
1
+ const styles = {"errorBlock":"ErrorPopup-errorBlock--c0C9V","errorMessage":"ErrorPopup-errorMessage--dKa8w"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.ErrorPopup-errorBlock--c0C9V{font-family:Roboto,Helvetica,Arial,sans-serif;left:0;margin:0 auto;max-width:1280px;min-height:58px;right:0;width:calc(100% - 64px);z-index:10000}.ErrorPopup-errorMessage--dKa8w{white-space:pre-line}`;
7
+ head.appendChild(style);
8
+ }
9
+ export default styles;
@@ -3,12 +3,17 @@ type AddError = (error: {
3
3
  title: string;
4
4
  message: string;
5
5
  }) => void;
6
+ type Classes = {
7
+ errorBlock?: string;
8
+ errorMessage?: string;
9
+ };
6
10
  type Props = {
7
11
  showErrorFromStore?: boolean;
12
+ classes?: Classes;
8
13
  [key: string]: unknown;
9
14
  };
10
15
  export declare const ErrorPopup: {
11
- ({ showErrorFromStore, ...props }: Props): React.JSX.Element;
16
+ ({ showErrorFromStore, classes, ...props }: Props): React.JSX.Element;
12
17
  addError: AddError;
13
18
  };
14
19
  export {};
@@ -51,16 +51,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
51
51
  exports.ErrorPopup = void 0;
52
52
  var react_1 = __importStar(require("react"));
53
53
  var classnames_1 = __importDefault(require("classnames"));
54
- var ramda_1 = require("ramda");
55
54
  var ui_i18n_1 = __importDefault(require("ui-i18n"));
56
55
  var Portal_1 = __importDefault(require("@mui/material/Portal"));
57
56
  var ErrorPopup_1 = __importDefault(require("react-components/dist/ErrorPopup/ErrorPopup"));
58
57
  var MdmModuleContext_1 = require("../contexts/MdmModuleContext");
59
- var styles_1 = require("./styles");
58
+ var ErrorPopup_module_css_1 = __importDefault(require("./ErrorPopup.module.css"));
60
59
  var addError = ErrorPopup_1.default.addError;
61
60
  var ErrorPopup = function (_a) {
62
- var showErrorFromStore = _a.showErrorFromStore, props = __rest(_a, ["showErrorFromStore"]);
63
- var styles = (0, styles_1.useStyles)();
61
+ var showErrorFromStore = _a.showErrorFromStore, classes = _a.classes, props = __rest(_a, ["showErrorFromStore", "classes"]);
64
62
  var errorSet = (0, MdmModuleContext_1.useMdmAction)('errorSet');
65
63
  var autoCloseInterval = (0, MdmModuleContext_1.useMdmAutoCloseInterval)();
66
64
  var uiError = (0, MdmModuleContext_1.useMdmUiError)();
@@ -71,7 +69,10 @@ var ErrorPopup = function (_a) {
71
69
  }
72
70
  }, [errorSet, uiError, showErrorFromStore]);
73
71
  return (react_1.default.createElement(Portal_1.default, { container: document.body },
74
- react_1.default.createElement(ErrorPopup_1.default, __assign({ classes: { errorBlock: (0, classnames_1.default)(styles.errorBlock, (0, ramda_1.path)(['classes', 'errorBlock'], props)) }, autoCloseInterval: autoCloseInterval }, props))));
72
+ react_1.default.createElement(ErrorPopup_1.default, __assign({ autoCloseInterval: autoCloseInterval }, props, { classes: {
73
+ errorBlock: (0, classnames_1.default)(ErrorPopup_module_css_1.default.errorBlock, classes === null || classes === void 0 ? void 0 : classes.errorBlock),
74
+ errorMessage: (0, classnames_1.default)(ErrorPopup_module_css_1.default.errorMessage, classes === null || classes === void 0 ? void 0 : classes.errorMessage)
75
+ } }))));
75
76
  };
76
77
  exports.ErrorPopup = ErrorPopup;
77
78
  exports.ErrorPopup.addError = addError;
@@ -0,0 +1,9 @@
1
+ const styles = {"errorBlock":"ErrorPopup-errorBlock--c0C9V","errorMessage":"ErrorPopup-errorMessage--dKa8w"};
2
+ if (typeof document !== 'undefined') {
3
+ const head = document.head || document.getElementsByTagName('head')[0]
4
+ const style = document.createElement('style');
5
+ style.type = 'text/css'
6
+ style.innerHTML = `.ErrorPopup-errorBlock--c0C9V{font-family:Roboto,Helvetica,Arial,sans-serif;left:0;margin:0 auto;max-width:1280px;min-height:58px;right:0;width:calc(100% - 64px);z-index:10000}.ErrorPopup-errorMessage--dKa8w{white-space:pre-line}`;
7
+ head.appendChild(style);
8
+ }
9
+ module.exports = styles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.2287",
3
+ "version": "1.4.2288",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"errorBlock">;
@@ -1,13 +0,0 @@
1
- import { makeStyles } from '@mui/styles';
2
- export var useStyles = makeStyles(function () { return ({
3
- errorBlock: {
4
- fontFamily: 'Roboto, Helvetica, Arial, sans-serif',
5
- minHeight: '58px',
6
- left: 0,
7
- right: 0,
8
- width: 'calc(100% - 64px)',
9
- maxWidth: '1280px',
10
- margin: '0 auto',
11
- zIndex: 10000
12
- }
13
- }); });
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"errorBlock">;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useStyles = void 0;
4
- var styles_1 = require("@mui/styles");
5
- exports.useStyles = (0, styles_1.makeStyles)(function () { return ({
6
- errorBlock: {
7
- fontFamily: 'Roboto, Helvetica, Arial, sans-serif',
8
- minHeight: '58px',
9
- left: 0,
10
- right: 0,
11
- width: 'calc(100% - 64px)',
12
- maxWidth: '1280px',
13
- margin: '0 auto',
14
- zIndex: 10000
15
- }
16
- }); });