@reltio/components 1.4.2288 → 1.4.2290

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.
@@ -4,6 +4,7 @@ type Props = {
4
4
  values: DateValues;
5
5
  onChange: (values: DateValues) => void;
6
6
  onFocus?: () => void;
7
+ maxDate?: Date;
7
8
  };
8
- export declare const CustomDateRangeEditor: ({ values, onChange, onFocus }: Props) => React.JSX.Element;
9
+ export declare const CustomDateRangeEditor: ({ values, onChange, onFocus, maxDate }: Props) => React.JSX.Element;
9
10
  export {};
@@ -15,7 +15,7 @@ var formatValue = function (value, placeholder) {
15
15
  : "".concat(formatDataTypeValue({ dataTypeDefinition: { type: DataTypes.TYPE_ACTIVENESS_DATE } }, value));
16
16
  };
17
17
  export var CustomDateRangeEditor = function (_a) {
18
- var values = _a.values, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? identity : _b;
18
+ var values = _a.values, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? identity : _b, maxDate = _a.maxDate;
19
19
  var placeholder = localeFormat;
20
20
  var inputRef = useRef(null);
21
21
  var _c = useState(false), open = _c[0], setOpen = _c[1];
@@ -50,5 +50,5 @@ export var CustomDateRangeEditor = function (_a) {
50
50
  vertical: 'top',
51
51
  horizontal: 'right'
52
52
  }, elevation: 2 },
53
- React.createElement(DateRangePicker, { values: values, onApply: onApply, type: DataTypes.TYPE_ACTIVENESS_DATE }))));
53
+ React.createElement(DateRangePicker, { values: values, onApply: onApply, type: DataTypes.TYPE_ACTIVENESS_DATE, maxDate: maxDate }))));
54
54
  };
@@ -17,6 +17,7 @@ export var useStyles = makeStyles({
17
17
  backgroundColor: 'rgba(0, 0, 0, 0.03)'
18
18
  },
19
19
  inputUnit: {
20
- width: '100%'
20
+ width: '100%',
21
+ minWidth: 110
21
22
  }
22
23
  });
@@ -4,6 +4,7 @@ type Props = {
4
4
  value: DateRangeFilter;
5
5
  dateRangeTypes?: DateRangeTypes[];
6
6
  onChange: (range: DateRangeFilter) => void;
7
+ maxDate?: Date;
7
8
  };
8
- export declare const DateRangeSelector: ({ value, onChange, dateRangeTypes }: Props) => React.JSX.Element;
9
+ export declare const DateRangeSelector: ({ value, onChange, dateRangeTypes, maxDate }: Props) => React.JSX.Element;
9
10
  export {};
@@ -26,7 +26,7 @@ import { useStyles } from './styles';
26
26
  var emptyDates = [null, null];
27
27
  var emptyInterval = [null, 'minutes'];
28
28
  export var DateRangeSelector = function (_a) {
29
- var value = _a.value, onChange = _a.onChange, dateRangeTypes = _a.dateRangeTypes;
29
+ var value = _a.value, onChange = _a.onChange, dateRangeTypes = _a.dateRangeTypes, maxDate = _a.maxDate;
30
30
  var styles = useStyles();
31
31
  var getInitPeriodByType = function (type) {
32
32
  if ((value === null || value === void 0 ? void 0 : value.type) === type) {
@@ -101,7 +101,7 @@ export var DateRangeSelector = function (_a) {
101
101
  {
102
102
  label: i18n.text('Date range'),
103
103
  type: DateRangeTypes.BETWEEN,
104
- editor: (React.createElement(CustomDateRangeEditor, { values: datesInterval, onChange: changePeriod, onFocus: function () { return changeType(DateRangeTypes.BETWEEN); } })),
104
+ editor: (React.createElement(CustomDateRangeEditor, { values: datesInterval, onChange: changePeriod, onFocus: function () { return changeType(DateRangeTypes.BETWEEN); }, maxDate: maxDate })),
105
105
  className: styles.dateOption
106
106
  }
107
107
  ];
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import React from 'react';
24
- import { useInRouterContext, Link } from 'react-router-dom';
24
+ import { useInRouterContext, Link } from 'react-router';
25
25
  import classnames from 'classnames';
26
26
  import { useStyles } from './styles';
27
27
  export var InternalLink = function (props) {
@@ -12,7 +12,7 @@ var __assign = (this && this.__assign) || function () {
12
12
  import React from 'react';
13
13
  import { render, screen } from '@testing-library/react';
14
14
  import userEvent from '@testing-library/user-event';
15
- import { BrowserRouter } from 'react-router-dom';
15
+ import { BrowserRouter } from 'react-router';
16
16
  import { InternalLink } from './InternalLink';
17
17
  describe('InternalLink tests', function () {
18
18
  var setUp = function (props) {
@@ -4,6 +4,7 @@ type Props = {
4
4
  values: DateValues;
5
5
  onChange: (values: DateValues) => void;
6
6
  onFocus?: () => void;
7
+ maxDate?: Date;
7
8
  };
8
- export declare const CustomDateRangeEditor: ({ values, onChange, onFocus }: Props) => React.JSX.Element;
9
+ export declare const CustomDateRangeEditor: ({ values, onChange, onFocus, maxDate }: Props) => React.JSX.Element;
9
10
  export {};
@@ -44,7 +44,7 @@ var formatValue = function (value, placeholder) {
44
44
  : "".concat((0, mdm_sdk_1.formatDataTypeValue)({ dataTypeDefinition: { type: mdm_sdk_1.DataTypes.TYPE_ACTIVENESS_DATE } }, value));
45
45
  };
46
46
  var CustomDateRangeEditor = function (_a) {
47
- var values = _a.values, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? ramda_1.identity : _b;
47
+ var values = _a.values, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? ramda_1.identity : _b, maxDate = _a.maxDate;
48
48
  var placeholder = localeFormat;
49
49
  var inputRef = (0, react_1.useRef)(null);
50
50
  var _c = (0, react_1.useState)(false), open = _c[0], setOpen = _c[1];
@@ -79,6 +79,6 @@ var CustomDateRangeEditor = function (_a) {
79
79
  vertical: 'top',
80
80
  horizontal: 'right'
81
81
  }, elevation: 2 },
82
- react_1.default.createElement(DateRangePicker_1.DateRangePicker, { values: values, onApply: onApply, type: mdm_sdk_1.DataTypes.TYPE_ACTIVENESS_DATE }))));
82
+ react_1.default.createElement(DateRangePicker_1.DateRangePicker, { values: values, onApply: onApply, type: mdm_sdk_1.DataTypes.TYPE_ACTIVENESS_DATE, maxDate: maxDate }))));
83
83
  };
84
84
  exports.CustomDateRangeEditor = CustomDateRangeEditor;
@@ -20,6 +20,7 @@ exports.useStyles = (0, styles_1.makeStyles)({
20
20
  backgroundColor: 'rgba(0, 0, 0, 0.03)'
21
21
  },
22
22
  inputUnit: {
23
- width: '100%'
23
+ width: '100%',
24
+ minWidth: 110
24
25
  }
25
26
  });
@@ -4,6 +4,7 @@ type Props = {
4
4
  value: DateRangeFilter;
5
5
  dateRangeTypes?: DateRangeTypes[];
6
6
  onChange: (range: DateRangeFilter) => void;
7
+ maxDate?: Date;
7
8
  };
8
- export declare const DateRangeSelector: ({ value, onChange, dateRangeTypes }: Props) => React.JSX.Element;
9
+ export declare const DateRangeSelector: ({ value, onChange, dateRangeTypes, maxDate }: Props) => React.JSX.Element;
9
10
  export {};
@@ -55,7 +55,7 @@ var styles_1 = require("./styles");
55
55
  var emptyDates = [null, null];
56
56
  var emptyInterval = [null, 'minutes'];
57
57
  var DateRangeSelector = function (_a) {
58
- var value = _a.value, onChange = _a.onChange, dateRangeTypes = _a.dateRangeTypes;
58
+ var value = _a.value, onChange = _a.onChange, dateRangeTypes = _a.dateRangeTypes, maxDate = _a.maxDate;
59
59
  var styles = (0, styles_1.useStyles)();
60
60
  var getInitPeriodByType = function (type) {
61
61
  if ((value === null || value === void 0 ? void 0 : value.type) === type) {
@@ -130,7 +130,7 @@ var DateRangeSelector = function (_a) {
130
130
  {
131
131
  label: ui_i18n_1.default.text('Date range'),
132
132
  type: mdm_sdk_1.DateRangeTypes.BETWEEN,
133
- editor: (react_1.default.createElement(CustomDateRangeEditor_1.CustomDateRangeEditor, { values: datesInterval, onChange: changePeriod, onFocus: function () { return changeType(mdm_sdk_1.DateRangeTypes.BETWEEN); } })),
133
+ editor: (react_1.default.createElement(CustomDateRangeEditor_1.CustomDateRangeEditor, { values: datesInterval, onChange: changePeriod, onFocus: function () { return changeType(mdm_sdk_1.DateRangeTypes.BETWEEN); }, maxDate: maxDate })),
134
134
  className: styles.dateOption
135
135
  }
136
136
  ];
@@ -27,14 +27,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
28
  exports.InternalLink = void 0;
29
29
  var react_1 = __importDefault(require("react"));
30
- var react_router_dom_1 = require("react-router-dom");
30
+ var react_router_1 = require("react-router");
31
31
  var classnames_1 = __importDefault(require("classnames"));
32
32
  var styles_1 = require("./styles");
33
33
  var InternalLink = function (props) {
34
34
  var styles = (0, styles_1.useStyles)();
35
- var inRouterContext = (0, react_router_dom_1.useInRouterContext)();
35
+ var inRouterContext = (0, react_router_1.useInRouterContext)();
36
36
  var href = props.href, className = props.className, otherProps = __rest(props, ["href", "className"]);
37
37
  var linkClassName = (0, classnames_1.default)(styles.link, className);
38
- return inRouterContext && href ? (react_1.default.createElement(react_router_dom_1.Link, __assign({ to: href.replace(window.location.origin, ''), className: linkClassName }, otherProps))) : (react_1.default.createElement("a", __assign({ href: href, className: linkClassName }, otherProps)));
38
+ return inRouterContext && href ? (react_1.default.createElement(react_router_1.Link, __assign({ to: href.replace(window.location.origin, ''), className: linkClassName }, otherProps))) : (react_1.default.createElement("a", __assign({ href: href, className: linkClassName }, otherProps)));
39
39
  };
40
40
  exports.InternalLink = InternalLink;
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var react_1 = __importDefault(require("react"));
18
18
  var react_2 = require("@testing-library/react");
19
19
  var user_event_1 = __importDefault(require("@testing-library/user-event"));
20
- var react_router_dom_1 = require("react-router-dom");
20
+ var react_router_1 = require("react-router");
21
21
  var InternalLink_1 = require("./InternalLink");
22
22
  describe('InternalLink tests', function () {
23
23
  var setUp = function (props) {
@@ -25,7 +25,7 @@ describe('InternalLink tests', function () {
25
25
  var user = user_event_1.default.setup();
26
26
  var Providers = function (_a) {
27
27
  var children = _a.children;
28
- return react_1.default.createElement(react_router_dom_1.BrowserRouter, null, children);
28
+ return react_1.default.createElement(react_router_1.BrowserRouter, null, children);
29
29
  };
30
30
  return __assign({ user: user }, (0, react_2.render)(react_1.default.createElement(InternalLink_1.InternalLink, __assign({}, props)), { wrapper: Providers }));
31
31
  };
@@ -3,4 +3,5 @@ import { RequestStates } from '../../types';
3
3
  export declare const useTenantOptionalParameters: (tenant?: string, apiPath?: string) => {
4
4
  optionalParameters: TenantOptionalParameters;
5
5
  requestState: RequestStates;
6
+ reload: () => void;
6
7
  };
@@ -32,13 +32,14 @@ var useTenantOptionalParameters = function (tenant, apiPath) {
32
32
  setOptionalParameters(null);
33
33
  setRequestState(types_1.RequestStates.ERROR);
34
34
  });
35
- }, [apiPath, tenant]);
35
+ }, [apiPath, tenant, safePromise]);
36
36
  (0, react_1.useEffect)(function () {
37
37
  loadOptionalParameters();
38
38
  }, [loadOptionalParameters]);
39
39
  return (0, react_1.useMemo)(function () { return ({
40
40
  optionalParameters: optionalParameters,
41
- requestState: requestState
42
- }); }, [optionalParameters, requestState]);
41
+ requestState: requestState,
42
+ reload: loadOptionalParameters
43
+ }); }, [optionalParameters, requestState, loadOptionalParameters]);
43
44
  };
44
45
  exports.useTenantOptionalParameters = useTenantOptionalParameters;
@@ -3,4 +3,5 @@ import { RequestStates } from '../../types';
3
3
  export declare const useTenantOptionalParameters: (tenant?: string, apiPath?: string) => {
4
4
  optionalParameters: TenantOptionalParameters;
5
5
  requestState: RequestStates;
6
+ reload: () => void;
6
7
  };
@@ -29,12 +29,13 @@ export var useTenantOptionalParameters = function (tenant, apiPath) {
29
29
  setOptionalParameters(null);
30
30
  setRequestState(RequestStates.ERROR);
31
31
  });
32
- }, [apiPath, tenant]);
32
+ }, [apiPath, tenant, safePromise]);
33
33
  useEffect(function () {
34
34
  loadOptionalParameters();
35
35
  }, [loadOptionalParameters]);
36
36
  return useMemo(function () { return ({
37
37
  optionalParameters: optionalParameters,
38
- requestState: requestState
39
- }); }, [optionalParameters, requestState]);
38
+ requestState: requestState,
39
+ reload: loadOptionalParameters
40
+ }); }, [optionalParameters, requestState, loadOptionalParameters]);
40
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.2288",
3
+ "version": "1.4.2290",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -11,7 +11,7 @@
11
11
  "@fluentui/react-context-selector": "^9.1.26",
12
12
  "@googlemaps/markerclusterer": "^2.5.3",
13
13
  "@react-sigma/core": "3.4.0",
14
- "@reltio/mdm-sdk": "^1.4.2059",
14
+ "@reltio/mdm-sdk": "^1.4.2060",
15
15
  "@vis.gl/react-google-maps": "^1.3.0",
16
16
  "d3-cloud": "^1.2.5",
17
17
  "d3-geo": "^2.0.1",
@@ -30,7 +30,6 @@
30
30
  "react-mentions": "^4.3.0",
31
31
  "react-number-format": "^4.9.2",
32
32
  "react-resizable-panels": "^2.0.20",
33
- "react-router-dom": "^6.30.2",
34
33
  "react-select": "^5.8.0",
35
34
  "react-simple-maps": "^3.0.0",
36
35
  "react-virtualized": "^9.22.5",
@@ -54,6 +53,7 @@
54
53
  "react": "^18.3.1",
55
54
  "react-components": "bitbucket:reltio-ondemand/react-components#v5.0.1",
56
55
  "react-resize-detector": "^9.1.1",
56
+ "react-router": "^7.18.1",
57
57
  "ui-i18n": "bitbucket:reltio-ondemand/ui-i18n#v1.4.0"
58
58
  },
59
59
  "publishConfig": {