@reltio/components 1.4.2288 → 1.4.2289

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
  ];
@@ -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
  ];
@@ -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.2289",
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",