@reltio/components 1.4.1433 → 1.4.1434
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/BasicViewHeader/BasicViewHeader.js +3 -2
- package/cjs/components/DateIntervalSelector/DateIntervalSelector.js +4 -11
- package/cjs/components/activityLog/ActivityLogFilter/helpers.js +8 -2
- package/cjs/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.js +1 -1
- package/esm/components/BasicViewHeader/BasicViewHeader.js +3 -2
- package/esm/components/DateIntervalSelector/DateIntervalSelector.js +4 -11
- package/esm/components/activityLog/ActivityLogFilter/helpers.js +9 -3
- package/esm/components/workflow/cards/GenericWorkflowTaskCard/GenericWorkflowTaskCard.js +1 -1
- package/package.json +3 -3
|
@@ -26,14 +26,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
var react_1 = __importDefault(require("react"));
|
|
29
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
29
30
|
var Toolbar_1 = __importDefault(require("@material-ui/core/Toolbar"));
|
|
30
31
|
var Typography_1 = __importDefault(require("@material-ui/core/Typography"));
|
|
31
32
|
var styles_1 = require("./styles");
|
|
32
33
|
var BasicViewHeader = function (_a) {
|
|
33
|
-
var
|
|
34
|
+
var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.children, children = _c === void 0 ? null : _c, _d = _a.classes, classes = _d === void 0 ? {} : _d, otherProps = __rest(_a, ["title", "children", "classes"]);
|
|
34
35
|
var styles = (0, styles_1.useStyles)();
|
|
35
36
|
return (react_1.default.createElement(Toolbar_1.default, __assign({ className: classes.root, classes: { root: styles.toolbar } }, otherProps),
|
|
36
|
-
react_1.default.createElement(Typography_1.default, { className: classes.title, classes: { root: styles.title }, variant: "h6" }, title),
|
|
37
|
+
react_1.default.createElement(Typography_1.default, { className: classes.title, classes: { root: styles.title }, variant: "h6" }, ui_i18n_1.default.text(title)),
|
|
37
38
|
children));
|
|
38
39
|
};
|
|
39
40
|
exports.default = BasicViewHeader;
|
|
@@ -5,20 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
var react_1 = __importDefault(require("react"));
|
|
7
7
|
var ramda_1 = require("ramda");
|
|
8
|
-
var
|
|
8
|
+
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
9
9
|
var capitalize_1 = __importDefault(require("@material-ui/core/utils/capitalize"));
|
|
10
10
|
var TextField_1 = __importDefault(require("@material-ui/core/TextField"));
|
|
11
11
|
var SimpleDropDownSelector_1 = __importDefault(require("../SimpleDropDownSelector/SimpleDropDownSelector"));
|
|
12
12
|
var utils_1 = require("../../core/utils");
|
|
13
13
|
var styles_1 = require("./styles");
|
|
14
|
-
var periods = [
|
|
15
|
-
ui_i18n_1.default.text('minutes'),
|
|
16
|
-
ui_i18n_1.default.text('hours'),
|
|
17
|
-
ui_i18n_1.default.text('days'),
|
|
18
|
-
ui_i18n_1.default.text('weeks'),
|
|
19
|
-
ui_i18n_1.default.text('months'),
|
|
20
|
-
ui_i18n_1.default.text('years')
|
|
21
|
-
];
|
|
14
|
+
var periods = ['minutes', 'hours', 'days', 'weeks', 'months', 'years'];
|
|
22
15
|
var DateIntervalSelector = function (_a) {
|
|
23
16
|
var _b = _a.interval, value = _b[0], unit = _b[1], onChange = _a.onChange, onFocus = _a.onFocus;
|
|
24
17
|
var styles = (0, styles_1.useStyles)();
|
|
@@ -31,9 +24,9 @@ var DateIntervalSelector = function (_a) {
|
|
|
31
24
|
var onUnitChange = (0, ramda_1.pipe)(getIntervalFromUnit, onChange);
|
|
32
25
|
return (react_1.default.createElement("div", { className: styles.root },
|
|
33
26
|
react_1.default.createElement(TextField_1.default, { type: "number", value: value || '', onChange: onNumberChange, inputProps: { min: 1, onFocus: onFocus }, InputProps: { classes: { root: styles.input } }, className: styles.inputNumber }),
|
|
34
|
-
react_1.default.createElement(SimpleDropDownSelector_1.default, { label: '', placeholder: (0, capitalize_1.default)(unit), className: styles.inputUnit, value: { value: unit, label: (0, capitalize_1.default)(unit) }, options: periods.map(function (value) { return ({
|
|
27
|
+
react_1.default.createElement(SimpleDropDownSelector_1.default, { label: '', placeholder: (0, capitalize_1.default)(unit), className: styles.inputUnit, value: { value: unit, label: (0, capitalize_1.default)((0, mdm_sdk_1.getIntervalUnitLabel)(unit)) }, options: periods.map(function (value) { return ({
|
|
35
28
|
value: value,
|
|
36
|
-
label: (0, capitalize_1.default)(value)
|
|
29
|
+
label: (0, capitalize_1.default)((0, mdm_sdk_1.getIntervalUnitLabel)(value))
|
|
37
30
|
}); }), onChange: onUnitChange, TextFieldProps: {
|
|
38
31
|
inputProps: { onFocus: onFocus },
|
|
39
32
|
InputProps: { classes: { root: styles.input } }
|
|
@@ -25,9 +25,15 @@ var getFilterLabel = function (filters) {
|
|
|
25
25
|
};
|
|
26
26
|
switch (date.type) {
|
|
27
27
|
case mdm_sdk_1.DateRangeTypes.WITHIN:
|
|
28
|
-
return ui_i18n_1.default.text('Within ${amount} ${unit}', {
|
|
28
|
+
return ui_i18n_1.default.text('Within ${amount} ${unit}', {
|
|
29
|
+
amount: date.period[0],
|
|
30
|
+
unit: (0, mdm_sdk_1.getIntervalUnitLabel)(date.period[1])
|
|
31
|
+
});
|
|
29
32
|
case mdm_sdk_1.DateRangeTypes.AGO:
|
|
30
|
-
return ui_i18n_1.default.text('More than ${amount} ${unit} ago', {
|
|
33
|
+
return ui_i18n_1.default.text('More than ${amount} ${unit} ago', {
|
|
34
|
+
amount: date.period[0],
|
|
35
|
+
unit: (0, mdm_sdk_1.getIntervalUnitLabel)(date.period[1])
|
|
36
|
+
});
|
|
31
37
|
case mdm_sdk_1.DateRangeTypes.BETWEEN:
|
|
32
38
|
return ui_i18n_1.default.text('${startDate} to ${endDate}', {
|
|
33
39
|
startDate: formatDateValue(date.period[0]),
|
|
@@ -61,7 +61,7 @@ var GenericWorkflowTaskCard = function (_a) {
|
|
|
61
61
|
react_1.default.createElement(LineDecorator_1.default, { plain: true, first: true, transparent: !isExpanded },
|
|
62
62
|
react_1.default.createElement("div", { className: styles.mainInfo },
|
|
63
63
|
react_1.default.createElement("div", { className: styles.title },
|
|
64
|
-
react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.caption, styles.flex) }, processDefinitionDisplayName),
|
|
64
|
+
react_1.default.createElement("div", { className: (0, classnames_1.default)(styles.caption, styles.flex) }, ui_i18n_1.default.text(processDefinitionDisplayName)),
|
|
65
65
|
react_1.default.createElement(Flag_1.default, { className: styles.flag }),
|
|
66
66
|
react_1.default.createElement(Tooltip_1.default, { title: ui_i18n_1.default.text('Due date') },
|
|
67
67
|
react_1.default.createElement("span", { className: styles.date }, ui_i18n_1.default.date(dueDate, 'L'))),
|
|
@@ -21,14 +21,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
+
import i18n from 'ui-i18n';
|
|
24
25
|
import Toolbar from '@material-ui/core/Toolbar';
|
|
25
26
|
import Typography from '@material-ui/core/Typography';
|
|
26
27
|
import { useStyles } from './styles';
|
|
27
28
|
var BasicViewHeader = function (_a) {
|
|
28
|
-
var
|
|
29
|
+
var _b = _a.title, title = _b === void 0 ? '' : _b, _c = _a.children, children = _c === void 0 ? null : _c, _d = _a.classes, classes = _d === void 0 ? {} : _d, otherProps = __rest(_a, ["title", "children", "classes"]);
|
|
29
30
|
var styles = useStyles();
|
|
30
31
|
return (React.createElement(Toolbar, __assign({ className: classes.root, classes: { root: styles.toolbar } }, otherProps),
|
|
31
|
-
React.createElement(Typography, { className: classes.title, classes: { root: styles.title }, variant: "h6" }, title),
|
|
32
|
+
React.createElement(Typography, { className: classes.title, classes: { root: styles.title }, variant: "h6" }, i18n.text(title)),
|
|
32
33
|
children));
|
|
33
34
|
};
|
|
34
35
|
export default BasicViewHeader;
|
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { pipe } from 'ramda';
|
|
3
|
-
import
|
|
3
|
+
import { getIntervalUnitLabel } from '@reltio/mdm-sdk';
|
|
4
4
|
import capitalize from '@material-ui/core/utils/capitalize';
|
|
5
5
|
import TextField from '@material-ui/core/TextField';
|
|
6
6
|
import SimpleDropDownSelector from '../SimpleDropDownSelector/SimpleDropDownSelector';
|
|
7
7
|
import { getValue } from '../../core/utils';
|
|
8
8
|
import { useStyles } from './styles';
|
|
9
|
-
var periods = [
|
|
10
|
-
i18n.text('minutes'),
|
|
11
|
-
i18n.text('hours'),
|
|
12
|
-
i18n.text('days'),
|
|
13
|
-
i18n.text('weeks'),
|
|
14
|
-
i18n.text('months'),
|
|
15
|
-
i18n.text('years')
|
|
16
|
-
];
|
|
9
|
+
var periods = ['minutes', 'hours', 'days', 'weeks', 'months', 'years'];
|
|
17
10
|
var DateIntervalSelector = function (_a) {
|
|
18
11
|
var _b = _a.interval, value = _b[0], unit = _b[1], onChange = _a.onChange, onFocus = _a.onFocus;
|
|
19
12
|
var styles = useStyles();
|
|
@@ -26,9 +19,9 @@ var DateIntervalSelector = function (_a) {
|
|
|
26
19
|
var onUnitChange = pipe(getIntervalFromUnit, onChange);
|
|
27
20
|
return (React.createElement("div", { className: styles.root },
|
|
28
21
|
React.createElement(TextField, { type: "number", value: value || '', onChange: onNumberChange, inputProps: { min: 1, onFocus: onFocus }, InputProps: { classes: { root: styles.input } }, className: styles.inputNumber }),
|
|
29
|
-
React.createElement(SimpleDropDownSelector, { label: '', placeholder: capitalize(unit), className: styles.inputUnit, value: { value: unit, label: capitalize(unit) }, options: periods.map(function (value) { return ({
|
|
22
|
+
React.createElement(SimpleDropDownSelector, { label: '', placeholder: capitalize(unit), className: styles.inputUnit, value: { value: unit, label: capitalize(getIntervalUnitLabel(unit)) }, options: periods.map(function (value) { return ({
|
|
30
23
|
value: value,
|
|
31
|
-
label: capitalize(value)
|
|
24
|
+
label: capitalize(getIntervalUnitLabel(value))
|
|
32
25
|
}); }), onChange: onUnitChange, TextFieldProps: {
|
|
33
26
|
inputProps: { onFocus: onFocus },
|
|
34
27
|
InputProps: { classes: { root: styles.input } }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i18n from 'ui-i18n';
|
|
2
2
|
import { curry, join, identity, isNil, map, pipe, reject, sortBy, defaultTo, pluck } from 'ramda';
|
|
3
|
-
import { DataTypes, formatDataTypeValue, DateRangeTypes } from '@reltio/mdm-sdk';
|
|
3
|
+
import { DataTypes, formatDataTypeValue, DateRangeTypes, getIntervalUnitLabel } from '@reltio/mdm-sdk';
|
|
4
4
|
import { getActivityLabel } from '../utils/activities';
|
|
5
5
|
export var getFilterLabel = function (filters) {
|
|
6
6
|
var getLabel = curry(function (unit, pluralUnit, values) {
|
|
@@ -19,9 +19,15 @@ export var getFilterLabel = function (filters) {
|
|
|
19
19
|
};
|
|
20
20
|
switch (date.type) {
|
|
21
21
|
case DateRangeTypes.WITHIN:
|
|
22
|
-
return i18n.text('Within ${amount} ${unit}', {
|
|
22
|
+
return i18n.text('Within ${amount} ${unit}', {
|
|
23
|
+
amount: date.period[0],
|
|
24
|
+
unit: getIntervalUnitLabel(date.period[1])
|
|
25
|
+
});
|
|
23
26
|
case DateRangeTypes.AGO:
|
|
24
|
-
return i18n.text('More than ${amount} ${unit} ago', {
|
|
27
|
+
return i18n.text('More than ${amount} ${unit} ago', {
|
|
28
|
+
amount: date.period[0],
|
|
29
|
+
unit: getIntervalUnitLabel(date.period[1])
|
|
30
|
+
});
|
|
25
31
|
case DateRangeTypes.BETWEEN:
|
|
26
32
|
return i18n.text('${startDate} to ${endDate}', {
|
|
27
33
|
startDate: formatDateValue(date.period[0]),
|
|
@@ -33,7 +33,7 @@ var GenericWorkflowTaskCard = function (_a) {
|
|
|
33
33
|
React.createElement(LineDecorator, { plain: true, first: true, transparent: !isExpanded },
|
|
34
34
|
React.createElement("div", { className: styles.mainInfo },
|
|
35
35
|
React.createElement("div", { className: styles.title },
|
|
36
|
-
React.createElement("div", { className: classnames(styles.caption, styles.flex) }, processDefinitionDisplayName),
|
|
36
|
+
React.createElement("div", { className: classnames(styles.caption, styles.flex) }, i18n.text(processDefinitionDisplayName)),
|
|
37
37
|
React.createElement(FlagIcon, { className: styles.flag }),
|
|
38
38
|
React.createElement(Tooltip, { title: i18n.text('Due date') },
|
|
39
39
|
React.createElement("span", { className: styles.date }, i18n.date(dueDate, 'L'))),
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1434",
|
|
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.1434",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1434",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|