@reltio/components 1.4.886 → 1.4.891

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.
Files changed (81) hide show
  1. package/cjs/components/ConfigureColumnsPopup/ConfigureColumnsPopup.js +17 -14
  2. package/cjs/components/DropDownSelector/DropDownSelector.d.ts +3 -1
  3. package/cjs/components/DropDownSelector/DropDownSelector.js +5 -3
  4. package/cjs/components/EntityTypesSelector/styles.d.ts +1 -1
  5. package/cjs/components/ErrorWrapper/styles.d.ts +1 -1
  6. package/cjs/components/MatchRulesBlock/MatchRulesBlock.d.ts +5 -2
  7. package/cjs/components/MatchRulesBlock/MatchRulesBlock.js +2 -11
  8. package/cjs/components/ProfileCard/ProfileCard.d.ts +11 -19
  9. package/cjs/components/ProfileCard/ProfileCard.js +3 -12
  10. package/cjs/components/ProfileCard/styles.d.ts +1 -1
  11. package/cjs/components/ProfileMatchCard/ProfileMatchCard.d.ts +13 -0
  12. package/cjs/components/ProfileMatchCard/ProfileMatchCard.js +21 -0
  13. package/cjs/components/ProfileMatchCard/styles.d.ts +1 -0
  14. package/cjs/components/ProfileMatchCard/styles.js +28 -0
  15. package/cjs/components/attributes/editMode/AttributesPager/SpecialRenderer.js +2 -2
  16. package/cjs/components/attributes/editMode/Roles/Roles.d.ts +6 -0
  17. package/cjs/components/attributes/editMode/Roles/Roles.js +64 -0
  18. package/cjs/components/attributes/editMode/Roles/styles.d.ts +1 -0
  19. package/cjs/components/attributes/editMode/Roles/styles.js +10 -0
  20. package/cjs/components/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.js +1 -4
  21. package/cjs/components/editors/DateEditor/DateEditor.d.ts +14 -21
  22. package/cjs/components/editors/DateEditor/DateEditor.js +10 -19
  23. package/cjs/components/editors/DateEditor/styles.d.ts +1 -1
  24. package/cjs/components/editors/DateRangeEditor/styles.d.ts +1 -1
  25. package/cjs/components/editors/TimestampEditor/TimestampEditor.d.ts +18 -21
  26. package/cjs/components/editors/TimestampEditor/TimestampEditor.js +9 -19
  27. package/cjs/components/editors/TimestampEditor/styles.d.ts +1 -1
  28. package/cjs/components/index.d.ts +1 -0
  29. package/cjs/components/index.js +3 -1
  30. package/cjs/components/workflow/components/DueDateField/styles.d.ts +1 -1
  31. package/cjs/constants/prop-types.d.ts +0 -1
  32. package/cjs/constants/prop-types.js +1 -3
  33. package/cjs/hooks/helpers/pagingSimulator.d.ts +12 -0
  34. package/cjs/hooks/helpers/pagingSimulator.js +86 -0
  35. package/cjs/hooks/index.d.ts +2 -0
  36. package/cjs/hooks/index.js +5 -1
  37. package/cjs/hooks/useMatchesLoader.d.ts +27 -0
  38. package/cjs/hooks/useMatchesLoader.js +106 -0
  39. package/cjs/hooks/usePagingSimulator.d.ts +10 -0
  40. package/cjs/hooks/usePagingSimulator.js +10 -0
  41. package/esm/components/ConfigureColumnsPopup/ConfigureColumnsPopup.js +17 -14
  42. package/esm/components/DropDownSelector/DropDownSelector.d.ts +3 -1
  43. package/esm/components/DropDownSelector/DropDownSelector.js +5 -3
  44. package/esm/components/EntityTypesSelector/styles.d.ts +1 -1
  45. package/esm/components/ErrorWrapper/styles.d.ts +1 -1
  46. package/esm/components/MatchRulesBlock/MatchRulesBlock.d.ts +5 -2
  47. package/esm/components/MatchRulesBlock/MatchRulesBlock.js +3 -12
  48. package/esm/components/ProfileCard/ProfileCard.d.ts +11 -19
  49. package/esm/components/ProfileCard/ProfileCard.js +4 -13
  50. package/esm/components/ProfileCard/styles.d.ts +1 -1
  51. package/esm/components/ProfileMatchCard/ProfileMatchCard.d.ts +13 -0
  52. package/esm/components/ProfileMatchCard/ProfileMatchCard.js +14 -0
  53. package/esm/components/ProfileMatchCard/styles.d.ts +1 -0
  54. package/esm/components/ProfileMatchCard/styles.js +25 -0
  55. package/esm/components/attributes/editMode/AttributesPager/SpecialRenderer.js +1 -1
  56. package/esm/components/attributes/editMode/Roles/Roles.d.ts +6 -0
  57. package/esm/components/attributes/editMode/Roles/Roles.js +38 -0
  58. package/esm/components/attributes/editMode/Roles/styles.d.ts +1 -0
  59. package/esm/components/attributes/editMode/Roles/styles.js +7 -0
  60. package/esm/components/crosswalks/CrosswalkDateEditor/CrosswalkDateEditor.js +1 -4
  61. package/esm/components/editors/DateEditor/DateEditor.d.ts +14 -21
  62. package/esm/components/editors/DateEditor/DateEditor.js +10 -19
  63. package/esm/components/editors/DateEditor/styles.d.ts +1 -1
  64. package/esm/components/editors/DateRangeEditor/styles.d.ts +1 -1
  65. package/esm/components/editors/TimestampEditor/TimestampEditor.d.ts +18 -21
  66. package/esm/components/editors/TimestampEditor/TimestampEditor.js +9 -19
  67. package/esm/components/editors/TimestampEditor/styles.d.ts +1 -1
  68. package/esm/components/index.d.ts +1 -0
  69. package/esm/components/index.js +1 -0
  70. package/esm/components/workflow/components/DueDateField/styles.d.ts +1 -1
  71. package/esm/constants/prop-types.d.ts +0 -1
  72. package/esm/constants/prop-types.js +1 -2
  73. package/esm/hooks/helpers/pagingSimulator.d.ts +12 -0
  74. package/esm/hooks/helpers/pagingSimulator.js +82 -0
  75. package/esm/hooks/index.d.ts +2 -0
  76. package/esm/hooks/index.js +2 -0
  77. package/esm/hooks/useMatchesLoader.d.ts +27 -0
  78. package/esm/hooks/useMatchesLoader.js +99 -0
  79. package/esm/hooks/usePagingSimulator.d.ts +10 -0
  80. package/esm/hooks/usePagingSimulator.js +6 -0
  81. package/package.json +10 -3
@@ -21,10 +21,9 @@ var __rest = (this && this.__rest) || function (s, e) {
21
21
  return t;
22
22
  };
23
23
  import React, { memo } from 'react';
24
- import PropTypes from 'prop-types';
25
24
  import classnames from 'classnames';
26
25
  import { useSelector } from 'react-redux';
27
- import { EntityType, getEntityId, getEntityType, getEntityUriForLink, getLabel, getPropWithInheritance, theme } from '@reltio/mdm-sdk';
26
+ import { getEntityId, getEntityType, getEntityUriForLink, getLabel, getPropWithInheritance, theme } from '@reltio/mdm-sdk';
28
27
  import mdmModule from '@reltio/mdm-module';
29
28
  import useStyles from './styles';
30
29
  import EntityAvatar from '../EntityAvatar/EntityAvatar';
@@ -32,7 +31,7 @@ import EntityUriLink from '../EntityUriLink/EntityUriLink';
32
31
  import ExpandedValueTooltip from '../ExpandedValueTooltip/ExpandedValueTooltip';
33
32
  import EntityTypeBadge from '../EntityTypeBadge/EntityTypeBadge';
34
33
  var ProfileCard = function (_a) {
35
- var entity = _a.entity, _b = _a.classes, classes = _b === void 0 ? {} : _b, otherProps = __rest(_a, ["entity", "classes"]);
34
+ var entity = _a.entity, _b = _a.classes, classes = _b === void 0 ? {} : _b, disableEntityTypeColor = _a.disableEntityTypeColor, otherProps = __rest(_a, ["entity", "classes", "disableEntityTypeColor"]);
36
35
  var styles = useStyles();
37
36
  var secondaryLabelClass = classes.secondaryLabel, labelClass = classes.label, containerClass = classes.container;
38
37
  var metadata = useSelector(mdmModule.selectors.getMetadata);
@@ -41,7 +40,7 @@ var ProfileCard = function (_a) {
41
40
  var entityType = getEntityType(metadata, type) || {};
42
41
  var entityTypeColor = getPropWithInheritance(metadata, entityType, 'typeColor') || theme.palette.primary.main;
43
42
  return (React.createElement("div", __assign({ className: classnames(styles.container, containerClass) }, otherProps),
44
- React.createElement("div", { className: styles.colorBox, style: { backgroundColor: entityTypeColor } }),
43
+ React.createElement("div", { className: styles.colorBox, style: disableEntityTypeColor ? undefined : { backgroundColor: entityTypeColor } }),
45
44
  React.createElement(EntityAvatar, { entity: entity, avatarClassName: styles.avatar, imageClassName: styles.image }),
46
45
  React.createElement("div", { className: styles.info },
47
46
  React.createElement("div", { className: styles.firstRow },
@@ -49,17 +48,9 @@ var ProfileCard = function (_a) {
49
48
  React.createElement(ExpandedValueTooltip, { value: label, placement: "top", showOnExceededHeight: true },
50
49
  React.createElement("span", { className: classnames(styles.label, labelClass) }, label)))),
51
50
  React.createElement("div", { className: styles.secondRow }, secondaryLabel && (React.createElement(ExpandedValueTooltip, { value: secondaryLabel, placement: "top", showOnExceededHeight: true },
52
- React.createElement("span", { className: classnames(styles.secondaryLabel, secondaryLabelClass) }, secondaryLabel)))),
51
+ React.createElement("span", { className: secondaryLabelClass }, secondaryLabel)))),
53
52
  React.createElement("div", { className: styles.thirdRow },
54
53
  React.createElement(EntityTypeBadge, { entity: entity }),
55
54
  React.createElement("div", null, getEntityId(entity))))));
56
55
  };
57
- ProfileCard.propTypes = {
58
- entity: EntityType,
59
- classes: PropTypes.shape({
60
- label: PropTypes.string,
61
- secondaryLabel: PropTypes.string,
62
- container: PropTypes.string
63
- })
64
- };
65
56
  export default memo(ProfileCard);
@@ -1,2 +1,2 @@
1
+ declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "image" | "link" | "avatar" | "firstRow" | "container" | "colorBox" | "info" | "secondRow" | "thirdRow">;
1
2
  export default useStyles;
2
- declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "image" | "link" | "avatar" | "firstRow" | "container" | "info" | "colorBox" | "secondRow" | "thirdRow">;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { Entity, Metadata, PotentialMatch } from '@reltio/mdm-sdk';
3
+ declare type Props = {
4
+ entitiesMap: {
5
+ [key: string]: Pick<Entity, 'uri' | 'type' | 'label'>;
6
+ };
7
+ entity: Entity;
8
+ match: PotentialMatch;
9
+ metadata: Metadata;
10
+ children?: React.ReactNode;
11
+ };
12
+ export declare const ProfileMatchCard: ({ children, entitiesMap, entity, match, metadata }: Props) => JSX.Element;
13
+ export {};
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { useStyles } from './styles';
3
+ import ProfileCard from '../ProfileCard/ProfileCard';
4
+ import MatchRulesBlock from '../MatchRulesBlock/MatchRulesBlock';
5
+ export var ProfileMatchCard = function (_a) {
6
+ var children = _a.children, entitiesMap = _a.entitiesMap, entity = _a.entity, match = _a.match, metadata = _a.metadata;
7
+ var styles = useStyles();
8
+ return (React.createElement("div", { className: styles.root },
9
+ React.createElement("div", { className: styles.profileCardWrapper },
10
+ React.createElement(ProfileCard, { entity: match.object, classes: { container: styles.profileCardContainer }, disableEntityTypeColor: true }),
11
+ children),
12
+ React.createElement("div", { className: styles.rulesContainer },
13
+ React.createElement(MatchRulesBlock, { match: match, metadata: metadata, entitiesMap: entitiesMap, entity: entity }))));
14
+ };
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"root" | "rulesContainer" | "profileCardWrapper" | "profileCardContainer">;
@@ -0,0 +1,25 @@
1
+ import { makeStyles } from '@material-ui/core/styles';
2
+ export var useStyles = makeStyles({
3
+ root: {
4
+ display: 'flex',
5
+ flexDirection: 'column',
6
+ paddingRight: '12px',
7
+ paddingTop: '8px',
8
+ paddingBottom: '8px',
9
+ '& + &': {
10
+ borderTop: '1px solid rgba(0,0,0, 0.12)'
11
+ }
12
+ },
13
+ profileCardWrapper: {
14
+ display: 'flex',
15
+ flexDirection: 'row',
16
+ alignItems: 'center',
17
+ gap: '4px'
18
+ },
19
+ profileCardContainer: {
20
+ flexGrow: 1
21
+ },
22
+ rulesContainer: {
23
+ paddingLeft: '40px'
24
+ }
25
+ });
@@ -27,8 +27,8 @@ import Title from '../../../Title/Title';
27
27
  import Cardinality from './CardinalityMessage';
28
28
  import ErrorMessage from '../../../ErrorWrapper/ErrorMessage';
29
29
  import Attribute from '../AttributesFactory/Attribute';
30
+ import { Roles } from '../Roles/Roles';
30
31
  import Tags from '../Tags';
31
- import Roles from '../../readMode/SpecialAttributes/Roles'; //TODO: should be edit mode
32
32
  import { useStyles } from './styles';
33
33
  var SpecialRenderer = function (_a) {
34
34
  var values = _a.values, attributeType = _a.attributeType, parentUri = _a.parentUri, mode = _a.mode, errorMessage = _a.errorMessage, otherProps = __rest(_a, ["values", "attributeType", "parentUri", "mode", "errorMessage"]);
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare type Props = {
3
+ values: string[];
4
+ };
5
+ export declare const Roles: ({ values }: Props) => JSX.Element;
6
+ export {};
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { prop, propEq } from 'ramda';
3
+ import { useSelector, useDispatch } from 'react-redux';
4
+ import { EntityAttrTypes, getRolesForEntityType, getLastUriPart } from '@reltio/mdm-sdk';
5
+ import mdmModule, { profile } from '@reltio/mdm-module';
6
+ import SimpleDropDownSelector from '../../../SimpleDropDownSelector/SimpleDropDownSelector';
7
+ import { MultiValueChip } from '../../..';
8
+ import { useStyles } from './styles';
9
+ var components = { MultiValue: MultiValueChip };
10
+ export var Roles = function (_a) {
11
+ var values = _a.values;
12
+ var styles = useStyles();
13
+ var dispatch = useDispatch();
14
+ var metadata = useSelector(mdmModule.selectors.getMetadata);
15
+ var entity = useSelector(mdmModule.selectors.getEntity);
16
+ var entityUri = entity.uri;
17
+ var options = getRolesForEntityType(metadata, entity.type).map(function (role) { return ({
18
+ value: role.uri,
19
+ label: role.label
20
+ }); });
21
+ var formattedValues = values.map(function (value) {
22
+ var _a;
23
+ var label = (_a = options.find(propEq('value', value))) === null || _a === void 0 ? void 0 : _a.label;
24
+ return {
25
+ value: value,
26
+ label: label || getLastUriPart(value)
27
+ };
28
+ });
29
+ var handleChange = function (values) {
30
+ var roles = (values === null || values === void 0 ? void 0 : values.map(prop('value'))) || [];
31
+ dispatch(profile.actions.modifyAttribute({
32
+ value: roles,
33
+ attributeType: EntityAttrTypes.roles,
34
+ uri: entityUri
35
+ }));
36
+ };
37
+ return (React.createElement(SimpleDropDownSelector, { label: '', height: 40, isMulti: true, options: options, value: formattedValues, onChange: handleChange, components: components, classes: styles }));
38
+ };
@@ -0,0 +1 @@
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"valueContainer">;
@@ -0,0 +1,7 @@
1
+ import { makeStyles } from '@material-ui/core/styles';
2
+ export var useStyles = makeStyles({
3
+ valueContainer: {
4
+ marginLeft: '8px',
5
+ width: 0
6
+ }
7
+ });
@@ -8,10 +8,7 @@ var CrosswalkDateEditor = function (_a) {
8
8
  var styles = useStyles();
9
9
  var _d = useState(false), isOpen = _d[0], setIsOpen = _d[1];
10
10
  var handleChange = function (date) { return onChange(date.valueOf()); };
11
- return (
12
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
- // @ts-ignore
14
- React.createElement(TimestampEditor, { variant: "filled", value: value ? new Date(value) : null, disabled: disabled, onChange: unless(always(isOpen), handleChange), onAccept: handleChange, onOpen: function () { return setIsOpen(true); }, onClose: function () { return setIsOpen(false); }, InputProps: {
11
+ return (React.createElement(TimestampEditor, { variant: "filled", value: value ? new Date(value) : null, disabled: disabled, onChange: unless(always(isOpen), handleChange), onAccept: handleChange, onOpen: function () { return setIsOpen(true); }, onClose: function () { return setIsOpen(false); }, InputProps: {
15
12
  disableUnderline: true,
16
13
  classes: { input: styles.timestampEditorInput, root: classnames(styles.timestampEditor, classes.root) }
17
14
  } }));
@@ -1,22 +1,15 @@
1
+ /// <reference types="react" />
2
+ import { TextFieldProps } from '@material-ui/core/TextField';
3
+ import { KeyboardDatePickerProps } from '@material-ui/pickers/DatePicker';
4
+ declare type DateEditorProps = {
5
+ value: number | Date;
6
+ label: string;
7
+ variant?: TextFieldProps['variant'];
8
+ size?: TextFieldProps['size'];
9
+ hiddenLabel?: TextFieldProps['hiddenLabel'];
10
+ onBlur?: () => void;
11
+ onFocus?: () => void;
12
+ onChange: (value: number | Date) => void;
13
+ } & Omit<KeyboardDatePickerProps, 'value' | 'label' | 'variant' | 'size' | 'hiddenLabel' | 'onBlur' | 'onFocus' | 'onChange'>;
14
+ declare const DateEditor: ({ value, label, variant, onChange, InputProps, InputLabelProps, onBlur, onFocus, ...otherProps }: DateEditorProps) => JSX.Element;
1
15
  export default DateEditor;
2
- declare function DateEditor({ value, label, variant, onChange, InputProps, InputLabelProps, ...otherProps }: {
3
- [x: string]: any;
4
- value?: any;
5
- label: any;
6
- variant?: string;
7
- onChange: any;
8
- InputProps?: {};
9
- InputLabelProps?: {};
10
- }): JSX.Element;
11
- declare namespace DateEditor {
12
- namespace propTypes {
13
- export const value: PropTypes.Requireable<number | Date>;
14
- export const label: PropTypes.Requireable<string>;
15
- export { InputVariant as variant };
16
- export const InputProps: PropTypes.Requireable<object>;
17
- export const InputLabelProps: PropTypes.Requireable<object>;
18
- export const onChange: PropTypes.Validator<(...args: any[]) => any>;
19
- }
20
- }
21
- import PropTypes from "prop-types";
22
- import { InputVariant } from "../../../constants/prop-types";
@@ -20,28 +20,27 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import PropTypes from 'prop-types';
23
+ import { KeyboardDatePicker } from '@material-ui/pickers';
24
+ import { debounce, utils } from '@reltio/mdm-sdk';
25
+ import classnames from 'classnames';
26
+ import moment from 'moment';
27
+ import { invoker, isNil, pipe, when } from 'ramda';
24
28
  import React, { useState } from 'react';
25
29
  import i18n from 'ui-i18n';
26
- import moment from 'moment';
27
- import classnames from 'classnames';
28
- import { pipe, when, isNil, invoker } from 'ramda';
29
- import { utils, debounce } from '@reltio/mdm-sdk';
30
- import { KeyboardDatePicker } from '@material-ui/pickers';
31
- import { InputVariant } from '../../../constants/prop-types';
32
30
  import CalendarIcon from '../../../icons/Calendar';
31
+ import { noop } from '../../../core';
33
32
  import { useStyles } from './styles';
34
33
  var format = moment.localeData().longDateFormat('L');
35
34
  var DateEditor = function (_a) {
36
35
  var _b, _c;
37
36
  var _d;
38
- var _e = _a.value, value = _e === void 0 ? null : _e, label = _a.label, _f = _a.variant, variant = _f === void 0 ? 'filled' : _f, onChange = _a.onChange, _g = _a.InputProps, InputProps = _g === void 0 ? {} : _g, _h = _a.InputLabelProps, InputLabelProps = _h === void 0 ? {} : _h, otherProps = __rest(_a, ["value", "label", "variant", "onChange", "InputProps", "InputLabelProps"]);
37
+ var _e = _a.value, value = _e === void 0 ? null : _e, label = _a.label, _f = _a.variant, variant = _f === void 0 ? 'filled' : _f, onChange = _a.onChange, _g = _a.InputProps, InputProps = _g === void 0 ? {} : _g, _h = _a.InputLabelProps, InputLabelProps = _h === void 0 ? {} : _h, _j = _a.onBlur, onBlur = _j === void 0 ? noop : _j, _k = _a.onFocus, onFocus = _k === void 0 ? noop : _k, otherProps = __rest(_a, ["value", "label", "variant", "onChange", "InputProps", "InputLabelProps", "onBlur", "onFocus"]);
39
38
  var styles = useStyles();
40
- var _j = useState(false), isCalendarOpen = _j[0], setIsCalendarOpen = _j[1];
41
- return (React.createElement(KeyboardDatePicker, __assign({ format: format, 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, autoOk: true, InputAdornmentProps: { position: 'end', classes: { positionEnd: styles.adornmentPositionEnd } }, KeyboardButtonProps: {
39
+ var _l = useState(false), isCalendarOpen = _l[0], setIsCalendarOpen = _l[1];
40
+ return (React.createElement(KeyboardDatePicker, __assign({ format: format, 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, autoOk: true, onBlur: onBlur, onFocus: onFocus, InputAdornmentProps: { position: 'end', classes: { positionEnd: styles.adornmentPositionEnd } }, KeyboardButtonProps: {
42
41
  classes: { root: styles.iconButtonRoot },
43
42
  onKeyPress: invoker(0, 'stopPropagation')
44
- }, keyboardIcon: React.createElement(CalendarIcon, { className: styles.icon }), onChange: debounce(when(utils.dates.isValidMomentDateOrNull, pipe(utils.dates.momentToDate, utils.dates.clearDateTime, onChange)), 0), label: label, "aria-label": label, value: value, placeholder: i18n.text(format), disableToolbar: true, onClose: function () { return setIsCalendarOpen(false); }, onOpen: function () { return setIsCalendarOpen(true); }, InputProps: __assign({ classes: {
43
+ }, keyboardIcon: React.createElement(CalendarIcon, { className: styles.icon }), onChange: debounce(when(utils.dates.isValidMomentDateOrNull, pipe(utils.dates.momentToDate, utils.dates.clearDateTime, onChange)), 0), label: label, "aria-label": label, value: value, placeholder: i18n.text(format), onClose: function () { return setIsCalendarOpen(false); }, onOpen: function () { return setIsCalendarOpen(true); }, InputProps: __assign({ classes: {
45
44
  root: styles.inputRoot,
46
45
  underline: classnames((_b = {}, _b[styles.underline] = isCalendarOpen, _b)),
47
46
  adornedEnd: styles.adornedEnd
@@ -56,12 +55,4 @@ var DateEditor = function (_a) {
56
55
  }
57
56
  }, InputLabelProps: __assign({ classes: __assign({ root: classnames((_c = {}, _c[styles.inputLabel] = isCalendarOpen, _c), (_d = InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.classes) === null || _d === void 0 ? void 0 : _d.root) }, InputLabelProps === null || InputLabelProps === void 0 ? void 0 : InputLabelProps.classes), shrink: !isNil(label) }, InputLabelProps) }, otherProps)));
58
57
  };
59
- DateEditor.propTypes = {
60
- value: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),
61
- label: PropTypes.string,
62
- variant: InputVariant,
63
- InputProps: PropTypes.object,
64
- InputLabelProps: PropTypes.object,
65
- onChange: PropTypes.func.isRequired
66
- };
67
58
  export default DateEditor;
@@ -1 +1 @@
1
- export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "icon" | "adornedEnd" | "inputRoot" | "inputLabel" | "iconButtonRoot" | "adornmentPositionEnd">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "icon" | "adornedEnd" | "iconButtonRoot" | "inputLabel" | "inputRoot" | "adornmentPositionEnd">;
@@ -1 +1 @@
1
- export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "dropdownIndicator" | "adornedEnd" | "inputRoot" | "paper" | "menuItem" | "menuText" | "inputLabel">;
1
+ export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "dropdownIndicator" | "adornedEnd" | "inputLabel" | "inputRoot" | "paper" | "menuItem" | "menuText">;
@@ -1,22 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { InputLabelProps } from '@material-ui/core/InputLabel';
3
+ import { TextFieldProps } from '@material-ui/core/TextField';
4
+ import { Moment } from 'moment';
5
+ import { KeyboardDateTimePickerProps } from '@material-ui/pickers/DateTimePicker';
6
+ declare type TimestampEditorProps = {
7
+ value: number | Date;
8
+ label?: string;
9
+ variant: TextFieldProps['variant'];
10
+ InputProps: TextFieldProps['InputProps'];
11
+ format?: string;
12
+ InputLabelProps?: Partial<InputLabelProps>;
13
+ onBlur?: () => void;
14
+ onFocus?: () => void;
15
+ onChange: (value: number | Date) => void;
16
+ onAccept: (value: number | Date | Moment) => void;
17
+ } & Omit<KeyboardDateTimePickerProps, 'value' | 'label' | 'variant' | 'size' | 'hiddenLabel' | 'onBlur' | 'onFocus' | 'onChange' | 'onAccept'>;
18
+ declare const TimestampEditor: ({ value, label, variant, onChange, InputProps, format, ...otherProps }: TimestampEditorProps) => JSX.Element;
1
19
  export default TimestampEditor;
2
- declare function TimestampEditor({ value, label, variant, onChange, InputProps, format, ...otherProps }: {
3
- [x: string]: any;
4
- value?: any;
5
- label: any;
6
- variant?: string;
7
- onChange: any;
8
- InputProps: any;
9
- format: any;
10
- }): JSX.Element;
11
- declare namespace TimestampEditor {
12
- namespace propTypes {
13
- export const value: PropTypes.Requireable<number | Date>;
14
- export const format: PropTypes.Requireable<string>;
15
- export const label: PropTypes.Requireable<string>;
16
- export { InputVariant as variant };
17
- export const InputProps: PropTypes.Requireable<object>;
18
- export const onChange: PropTypes.Validator<(...args: any[]) => any>;
19
- }
20
- }
21
- import PropTypes from "prop-types";
22
- import { InputVariant } from "../../../constants/prop-types";
@@ -20,17 +20,15 @@ var __rest = (this && this.__rest) || function (s, e) {
20
20
  }
21
21
  return t;
22
22
  };
23
- import PropTypes from 'prop-types';
24
- import React, { useState } from 'react';
25
- import i18n from 'ui-i18n';
26
- import moment from 'moment';
27
- import classnames from 'classnames';
28
- import { pipe, when, isNil, invoker } from 'ramda';
29
- import { makeMaskFromFormat, maskedDateFormatter } from '@material-ui/pickers/_helpers/text-field-helper';
30
- import { KeyboardDateTimePicker } from '@material-ui/pickers';
31
23
  import DateRangeIcon from '@material-ui/icons/DateRange';
24
+ import { KeyboardDateTimePicker } from '@material-ui/pickers';
25
+ import { makeMaskFromFormat, maskedDateFormatter } from '@material-ui/pickers/_helpers/text-field-helper';
32
26
  import { utils } from '@reltio/mdm-sdk';
33
- import { InputVariant } from '../../../constants/prop-types';
27
+ import classnames from 'classnames';
28
+ import moment from 'moment';
29
+ import { invoker, isNil, pipe, when } from 'ramda';
30
+ import React, { useState } from 'react';
31
+ import i18n from 'ui-i18n';
34
32
  import { useStyles } from './styles';
35
33
  var dateFormat = moment.localeData().longDateFormat('L');
36
34
  var timeFormat = moment.localeData().longDateFormat('LTS');
@@ -42,10 +40,10 @@ var TimestampEditor = function (_a) {
42
40
  var _e = useState(false), isCalendarOpen = _e[0], setIsCalendarOpen = _e[1];
43
41
  var timestampFormat = format || dateFormat + " " + timeFormat;
44
42
  var isAmPmFormat = timestampFormat && timestampFormat.toLowerCase().includes('a');
45
- return (React.createElement(KeyboardDateTimePicker, __assign({ format: timestampFormat, rifmFormatter: isAmPmFormat ? makeAmPmFormatter(timestampFormat) : 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, views: ['year', 'date', 'hours', 'minutes', 'seconds'], autoOk: true, InputAdornmentProps: { position: 'end' }, KeyboardButtonProps: {
43
+ return (React.createElement(KeyboardDateTimePicker, __assign({ format: timestampFormat, rifmFormatter: isAmPmFormat ? makeAmPmFormatter(timestampFormat) : 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, views: ['year', 'date', 'hours', 'minutes'], autoOk: true, InputAdornmentProps: { position: 'end' }, KeyboardButtonProps: {
46
44
  classes: { root: styles.iconButtonRoot },
47
45
  onKeyPress: invoker(0, 'stopPropagation')
48
- }, keyboardIcon: React.createElement(DateRangeIcon, null), onChange: when(utils.dates.isValidMomentDateOrNull, pipe(utils.dates.momentToDate, onChange)), label: label, "aria-label": label, value: value, placeholder: i18n.text((dateFormat + " HH:MM").toUpperCase()), ampm: false, disableToolbar: true, onClose: function () { return setIsCalendarOpen(false); }, onOpen: function () { return setIsCalendarOpen(true); }, InputProps: __assign({ classes: {
46
+ }, keyboardIcon: React.createElement(DateRangeIcon, null), onChange: when(utils.dates.isValidMomentDateOrNull, pipe(utils.dates.momentToDate, onChange)), label: label, "aria-label": label, value: value, placeholder: i18n.text((dateFormat + " HH:MM").toUpperCase()), ampm: false, onClose: function () { return setIsCalendarOpen(false); }, onOpen: function () { return setIsCalendarOpen(true); }, InputProps: __assign({ classes: {
49
47
  root: styles.inputRoot,
50
48
  underline: classnames((_b = {}, _b[styles.underline] = isCalendarOpen, _b)),
51
49
  adornedEnd: styles.adornedEnd
@@ -65,12 +63,4 @@ var TimestampEditor = function (_a) {
65
63
  shrink: !isNil(label)
66
64
  } }, otherProps)));
67
65
  };
68
- TimestampEditor.propTypes = {
69
- value: PropTypes.oneOfType([PropTypes.number, PropTypes.instanceOf(Date)]),
70
- format: PropTypes.string,
71
- label: PropTypes.string,
72
- variant: InputVariant,
73
- InputProps: PropTypes.object,
74
- onChange: PropTypes.func.isRequired
75
- };
76
66
  export default TimestampEditor;
@@ -1 +1 @@
1
- export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "adornedEnd" | "inputRoot" | "inputLabel" | "iconButtonRoot">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"underline" | "adornedEnd" | "iconButtonRoot" | "inputLabel" | "inputRoot">;
@@ -121,3 +121,4 @@ export * from './history';
121
121
  export { default as OvIcon } from './attributes/OvIcon';
122
122
  export { default as RelationEditor } from './RelationEditor';
123
123
  export * from './workflow';
124
+ export { ProfileMatchCard } from './ProfileMatchCard/ProfileMatchCard';
@@ -120,3 +120,4 @@ export * from './history';
120
120
  export { default as OvIcon } from './attributes/OvIcon';
121
121
  export { default as RelationEditor } from './RelationEditor';
122
122
  export * from './workflow';
123
+ export { ProfileMatchCard } from './ProfileMatchCard/ProfileMatchCard';
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"dueDate" | "dueDateInput" | "inputLabel">;
1
+ export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"dueDate" | "inputLabel" | "dueDateInput">;
@@ -44,7 +44,6 @@ export const ColumnFilterType: PropTypes.Requireable<PropTypes.InferProps<{
44
44
  }>)[])[]>;
45
45
  filter: PropTypes.Requireable<string>;
46
46
  }>>;
47
- export const InputVariant: PropTypes.Requireable<string>;
48
47
  export const ColumnsDataType: PropTypes.Requireable<PropTypes.InferProps<{
49
48
  id: PropTypes.Requireable<string>;
50
49
  label: PropTypes.Requireable<string>;
@@ -34,7 +34,6 @@ var ColumnFilterType = PropTypes.shape({
34
34
  value: PropTypes.oneOfType([FilterValueType, PropTypes.arrayOf(FilterValueType)]),
35
35
  filter: PropTypes.string
36
36
  });
37
- var InputVariant = PropTypes.oneOf(['standard', 'outlined', 'filled']);
38
37
  var PlainColumnsDataType = PropTypes.arrayOf(PropTypes.shape({
39
38
  id: PropTypes.string,
40
39
  label: PropTypes.string,
@@ -62,4 +61,4 @@ var QueryBuilderAttributeType = PropTypes.shape({
62
61
  filter: PropTypes.string,
63
62
  operator: PropTypes.string
64
63
  });
65
- export { NumberFormatType, SelectValueType, DropDownEntryType, DropDownGroupEntryType, ColumnDataType, SortingType, ColumnFilterType, InputVariant, ColumnsDataType, GroupedColumnsDataType, QueryBuilderAttributeDataType, QueryBuilderAttributeType };
64
+ export { NumberFormatType, SelectValueType, DropDownEntryType, DropDownGroupEntryType, ColumnDataType, SortingType, ColumnFilterType, ColumnsDataType, GroupedColumnsDataType, QueryBuilderAttributeDataType, QueryBuilderAttributeType };
@@ -0,0 +1,12 @@
1
+ declare type RequestProps = {
2
+ max: number;
3
+ offset: number;
4
+ force?: boolean;
5
+ [key: string]: unknown;
6
+ };
7
+ export declare const createPagingSimulator: (request: any) => ({ max, offset, force, ...requestParams }: RequestProps) => Promise<{
8
+ response: any[];
9
+ total: number;
10
+ originalResponse: any[];
11
+ }>;
12
+ export {};
@@ -0,0 +1,82 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ var __rest = (this && this.__rest) || function (s, e) {
38
+ var t = {};
39
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
40
+ t[p] = s[p];
41
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
42
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
43
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
44
+ t[p[i]] = s[p[i]];
45
+ }
46
+ return t;
47
+ };
48
+ import { equals } from 'ramda';
49
+ export var createPagingSimulator = function (request) {
50
+ var previousValues = {};
51
+ var requestResponse = [];
52
+ return function (_a) { return __awaiter(void 0, void 0, void 0, function () {
53
+ var shouldSendRequest, previousValuesKeys, _i, previousValuesKeys_1, key;
54
+ var max = _a.max, offset = _a.offset, force = _a.force, requestParams = __rest(_a, ["max", "offset", "force"]);
55
+ return __generator(this, function (_b) {
56
+ switch (_b.label) {
57
+ case 0:
58
+ shouldSendRequest = force;
59
+ previousValuesKeys = Object.keys(previousValues);
60
+ shouldSendRequest = shouldSendRequest || !equals(Object.keys(requestParams), previousValuesKeys);
61
+ if (!shouldSendRequest) {
62
+ for (_i = 0, previousValuesKeys_1 = previousValuesKeys; _i < previousValuesKeys_1.length; _i++) {
63
+ key = previousValuesKeys_1[_i];
64
+ shouldSendRequest = shouldSendRequest || !equals(previousValues[key], requestParams[key]);
65
+ }
66
+ }
67
+ if (!shouldSendRequest) return [3 /*break*/, 2];
68
+ return [4 /*yield*/, request(requestParams)];
69
+ case 1:
70
+ // eslint-disable-next-line no-unused-vars
71
+ requestResponse = _b.sent();
72
+ previousValues = requestParams;
73
+ _b.label = 2;
74
+ case 2: return [2 /*return*/, {
75
+ response: requestResponse.slice(offset, offset + max),
76
+ total: requestResponse.length,
77
+ originalResponse: requestResponse
78
+ }];
79
+ }
80
+ });
81
+ }); };
82
+ };
@@ -11,3 +11,5 @@ export { useSavedState } from './useSavedState';
11
11
  export { useUsers } from './useUsers';
12
12
  export { useWhyDidYouUpdate } from './useWhyDidYouUpdate';
13
13
  export { useConfigPermissions } from './useConfigPermissions';
14
+ export { useMatchesLoader } from './useMatchesLoader';
15
+ export { usePagingSimulator } from './usePagingSimulator';
@@ -11,3 +11,5 @@ export { useSavedState } from './useSavedState';
11
11
  export { useUsers } from './useUsers';
12
12
  export { useWhyDidYouUpdate } from './useWhyDidYouUpdate';
13
13
  export { useConfigPermissions } from './useConfigPermissions';
14
+ export { useMatchesLoader } from './useMatchesLoader';
15
+ export { usePagingSimulator } from './usePagingSimulator';
@@ -0,0 +1,27 @@
1
+ import { Entity, PotentialMatch } from '@reltio/mdm-sdk';
2
+ declare type Props = {
3
+ enabled: boolean;
4
+ entity: Entity;
5
+ filter: string;
6
+ onFinishLoading?: () => void;
7
+ onStartLoading?: () => void;
8
+ options: {
9
+ showTransitiveMatches?: boolean;
10
+ showInactiveEntities?: boolean;
11
+ };
12
+ page: number;
13
+ rowsPerPage: number;
14
+ sorting?: {
15
+ order: string;
16
+ field: string;
17
+ };
18
+ };
19
+ export declare const useMatchesLoader: ({ enabled, entity, filter, onFinishLoading, onStartLoading, options, page, rowsPerPage, sorting }: Props) => {
20
+ total: number;
21
+ matches: PotentialMatch[];
22
+ entitiesMap: {
23
+ [key: string]: Pick<Entity, "uri" | "type" | "label">;
24
+ };
25
+ loadMatches: () => void;
26
+ };
27
+ export {};