@reltio/components 1.4.1346 → 1.4.1348
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/AttributesFiltersButton/AttributesFiltersButton.d.ts +4 -1
- package/cjs/components/AttributesFiltersButton/AttributesFiltersButton.js +9 -3
- package/cjs/components/editors/TimestampEditor/TimestampEditor.js +2 -1
- package/esm/components/AttributesFiltersButton/AttributesFiltersButton.d.ts +4 -1
- package/esm/components/AttributesFiltersButton/AttributesFiltersButton.js +9 -3
- package/esm/components/editors/TimestampEditor/TimestampEditor.js +2 -1
- package/package.json +3 -3
|
@@ -8,6 +8,9 @@ declare type Props = {
|
|
|
8
8
|
ValuesEditor?: React.ElementType;
|
|
9
9
|
FilterSelector?: React.ElementType;
|
|
10
10
|
};
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
onTogglePopup?: (open: boolean) => void;
|
|
13
|
+
isFiltersApplied?: boolean;
|
|
11
14
|
};
|
|
12
|
-
declare const _default: React.MemoExoticComponent<({ filters: filtersProp, attributeTypes, onChange, components }: Props) => JSX.Element>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ filters: filtersProp, attributeTypes, onChange, components, children, onTogglePopup, isFiltersApplied: isFiltersAppliedProp }: Props) => JSX.Element>;
|
|
13
16
|
export default _default;
|
|
@@ -38,14 +38,19 @@ var AttributesFiltersBuilder_1 = __importDefault(require("../AttributesFiltersBu
|
|
|
38
38
|
var ActionButtons_1 = __importDefault(require("./ActionButtons/ActionButtons"));
|
|
39
39
|
var styles_1 = require("./styles");
|
|
40
40
|
var AttributesFiltersButton = function (_a) {
|
|
41
|
-
var filtersProp = _a.filters, attributeTypes = _a.attributeTypes, onChange = _a.onChange, components = _a.components;
|
|
41
|
+
var filtersProp = _a.filters, attributeTypes = _a.attributeTypes, onChange = _a.onChange, components = _a.components, children = _a.children, onTogglePopup = _a.onTogglePopup, isFiltersAppliedProp = _a.isFiltersApplied;
|
|
42
42
|
var styles = (0, styles_1.useStyles)();
|
|
43
43
|
var buttonRef = (0, react_1.useRef)();
|
|
44
44
|
var _b = (0, react_1.useState)(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
45
45
|
var _c = (0, react_1.useState)([]), filters = _c[0], setFilters = _c[1];
|
|
46
|
-
var isFiltersApplied = !!(0, mdm_sdk_1.buildFilterQueryString)()(filtersProp);
|
|
46
|
+
var isFiltersApplied = isFiltersAppliedProp !== null && isFiltersAppliedProp !== void 0 ? isFiltersAppliedProp : !!(0, mdm_sdk_1.buildFilterQueryString)()(filtersProp);
|
|
47
47
|
var buttonColor = isFiltersApplied ? 'primary' : 'inherit';
|
|
48
|
-
var togglePopup = function () {
|
|
48
|
+
var togglePopup = function () {
|
|
49
|
+
if (onTogglePopup) {
|
|
50
|
+
onTogglePopup(!isOpen);
|
|
51
|
+
}
|
|
52
|
+
setIsOpen(function (open) { return !open; });
|
|
53
|
+
};
|
|
49
54
|
(0, react_1.useEffect)(function () {
|
|
50
55
|
if (isOpen) {
|
|
51
56
|
setFilters(filtersProp);
|
|
@@ -77,6 +82,7 @@ var AttributesFiltersButton = function (_a) {
|
|
|
77
82
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
78
83
|
react_1.default.createElement(Typography_1.default, { variant: "h6" }, ui_i18n_1.default.text('Filter')),
|
|
79
84
|
react_1.default.createElement("div", { className: styles.filtersBuilderWrapper },
|
|
85
|
+
children,
|
|
80
86
|
react_1.default.createElement(AttributesFiltersBuilder_1.default, { attributeTypes: attributeTypes, filters: filters, onChange: setFilters, components: components })),
|
|
81
87
|
react_1.default.createElement(Divider_1.default, { className: styles.divider }),
|
|
82
88
|
react_1.default.createElement(ActionButtons_1.default, { onApply: applyButtonHandler, onCancel: cancelButtonHandler, onClear: clearAllButtonHandler })))));
|
|
@@ -68,7 +68,8 @@ var TimestampEditor = function (_a) {
|
|
|
68
68
|
var _e = (0, react_1.useState)(false), isCalendarOpen = _e[0], setIsCalendarOpen = _e[1];
|
|
69
69
|
var timestampFormat = format || "".concat(dateFormat, " ").concat(timeFormat);
|
|
70
70
|
var isAmPmFormat = timestampFormat && timestampFormat.toLowerCase().includes('a');
|
|
71
|
-
|
|
71
|
+
var timestampFormatWithTwoHoursDigits = timestampFormat.replace(/\s[hH]:/, function (str) { return ' ' + str[1] + str.trim(); });
|
|
72
|
+
return (react_1.default.createElement(pickers_1.KeyboardDateTimePicker, __assign({ format: timestampFormatWithTwoHoursDigits, rifmFormatter: isAmPmFormat ? makeAmPmFormatter(timestampFormatWithTwoHoursDigits) : undefined, variant: "inline", invalidDateMessage: ui_i18n_1.default.text('Invalid Date Format'), maxDateMessage: ui_i18n_1.default.text('Date should not be after maximal date'), minDateMessage: ui_i18n_1.default.text('Date should not be before minimal date'), inputVariant: variant,
|
|
72
73
|
//there is a bug in the picker types that prevents time picker from showing seconds picker (see https://github.com/mui-org/material-ui-pickers/issues/739)
|
|
73
74
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
74
75
|
// @ts-ignore: wrong type
|
|
@@ -8,6 +8,9 @@ declare type Props = {
|
|
|
8
8
|
ValuesEditor?: React.ElementType;
|
|
9
9
|
FilterSelector?: React.ElementType;
|
|
10
10
|
};
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
onTogglePopup?: (open: boolean) => void;
|
|
13
|
+
isFiltersApplied?: boolean;
|
|
11
14
|
};
|
|
12
|
-
declare const _default: React.MemoExoticComponent<({ filters: filtersProp, attributeTypes, onChange, components }: Props) => JSX.Element>;
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ filters: filtersProp, attributeTypes, onChange, components, children, onTogglePopup, isFiltersApplied: isFiltersAppliedProp }: Props) => JSX.Element>;
|
|
13
16
|
export default _default;
|
|
@@ -10,14 +10,19 @@ import AttributesFiltersBuilder from '../AttributesFiltersBuilder/AttributesFilt
|
|
|
10
10
|
import ActionButtons from './ActionButtons/ActionButtons';
|
|
11
11
|
import { useStyles } from './styles';
|
|
12
12
|
var AttributesFiltersButton = function (_a) {
|
|
13
|
-
var filtersProp = _a.filters, attributeTypes = _a.attributeTypes, onChange = _a.onChange, components = _a.components;
|
|
13
|
+
var filtersProp = _a.filters, attributeTypes = _a.attributeTypes, onChange = _a.onChange, components = _a.components, children = _a.children, onTogglePopup = _a.onTogglePopup, isFiltersAppliedProp = _a.isFiltersApplied;
|
|
14
14
|
var styles = useStyles();
|
|
15
15
|
var buttonRef = useRef();
|
|
16
16
|
var _b = useState(false), isOpen = _b[0], setIsOpen = _b[1];
|
|
17
17
|
var _c = useState([]), filters = _c[0], setFilters = _c[1];
|
|
18
|
-
var isFiltersApplied = !!buildFilterQueryString()(filtersProp);
|
|
18
|
+
var isFiltersApplied = isFiltersAppliedProp !== null && isFiltersAppliedProp !== void 0 ? isFiltersAppliedProp : !!buildFilterQueryString()(filtersProp);
|
|
19
19
|
var buttonColor = isFiltersApplied ? 'primary' : 'inherit';
|
|
20
|
-
var togglePopup = function () {
|
|
20
|
+
var togglePopup = function () {
|
|
21
|
+
if (onTogglePopup) {
|
|
22
|
+
onTogglePopup(!isOpen);
|
|
23
|
+
}
|
|
24
|
+
setIsOpen(function (open) { return !open; });
|
|
25
|
+
};
|
|
21
26
|
useEffect(function () {
|
|
22
27
|
if (isOpen) {
|
|
23
28
|
setFilters(filtersProp);
|
|
@@ -49,6 +54,7 @@ var AttributesFiltersButton = function (_a) {
|
|
|
49
54
|
React.createElement(React.Fragment, null,
|
|
50
55
|
React.createElement(Typography, { variant: "h6" }, i18n.text('Filter')),
|
|
51
56
|
React.createElement("div", { className: styles.filtersBuilderWrapper },
|
|
57
|
+
children,
|
|
52
58
|
React.createElement(AttributesFiltersBuilder, { attributeTypes: attributeTypes, filters: filters, onChange: setFilters, components: components })),
|
|
53
59
|
React.createElement(Divider, { className: styles.divider }),
|
|
54
60
|
React.createElement(ActionButtons, { onApply: applyButtonHandler, onCancel: cancelButtonHandler, onClear: clearAllButtonHandler })))));
|
|
@@ -40,7 +40,8 @@ var TimestampEditor = function (_a) {
|
|
|
40
40
|
var _e = useState(false), isCalendarOpen = _e[0], setIsCalendarOpen = _e[1];
|
|
41
41
|
var timestampFormat = format || "".concat(dateFormat, " ").concat(timeFormat);
|
|
42
42
|
var isAmPmFormat = timestampFormat && timestampFormat.toLowerCase().includes('a');
|
|
43
|
-
|
|
43
|
+
var timestampFormatWithTwoHoursDigits = timestampFormat.replace(/\s[hH]:/, function (str) { return ' ' + str[1] + str.trim(); });
|
|
44
|
+
return (React.createElement(KeyboardDateTimePicker, __assign({ format: timestampFormatWithTwoHoursDigits, rifmFormatter: isAmPmFormat ? makeAmPmFormatter(timestampFormatWithTwoHoursDigits) : undefined, variant: "inline", invalidDateMessage: i18n.text('Invalid Date Format'), maxDateMessage: i18n.text('Date should not be after maximal date'), minDateMessage: i18n.text('Date should not be before minimal date'), inputVariant: variant,
|
|
44
45
|
//there is a bug in the picker types that prevents time picker from showing seconds picker (see https://github.com/mui-org/material-ui-pickers/issues/739)
|
|
45
46
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
46
47
|
// @ts-ignore: wrong type
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1348",
|
|
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.1348",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1348",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|