@reltio/components 1.4.1598 → 1.4.1600

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 (75) hide show
  1. package/cjs/components/MultipleInput/MultipleInput.d.ts +3 -1
  2. package/cjs/components/MultipleInput/MultipleInput.js +8 -6
  3. package/cjs/components/MultipleInput/styles.d.ts +1 -1
  4. package/cjs/components/MultipleInput/styles.js +3 -0
  5. package/cjs/components/MultipliableSelect/MultipliableSelect.d.ts +3 -1
  6. package/cjs/components/MultipliableSelect/MultipliableSelect.js +4 -3
  7. package/cjs/components/MultipliableSelect/styles.d.ts +1 -1
  8. package/cjs/components/MultipliableSelect/styles.js +3 -0
  9. package/cjs/components/SimpleInput/SimpleInput.d.ts +4 -1
  10. package/cjs/components/SimpleInput/SimpleInput.js +11 -5
  11. package/cjs/components/SimpleInput/styles.d.ts +1 -0
  12. package/cjs/components/SimpleInput/styles.js +9 -0
  13. package/cjs/components/attributes/editMode/AttributesPager/AttributeRenderer.d.ts +1 -4
  14. package/cjs/components/attributes/editMode/AttributesPager/AttributeRenderer.js +8 -4
  15. package/cjs/components/attributes/editMode/AttributesPager/index.d.ts +3 -3
  16. package/cjs/components/attributes/editMode/SimpleAttributeEditor/SimpleAttributeEditor.js +1 -1
  17. package/cjs/components/editors/BooleanRadioEditor/BooleanRadioEditor.d.ts +9 -13
  18. package/cjs/components/editors/BooleanRadioEditor/BooleanRadioEditor.js +8 -11
  19. package/cjs/components/editors/BooleanRadioEditor/styles.d.ts +1 -1
  20. package/cjs/components/editors/BooleanRadioEditor/styles.js +16 -1
  21. package/cjs/components/editors/DateEditor/DateEditor.d.ts +2 -1
  22. package/cjs/components/editors/DateEditor/DateEditor.js +11 -10
  23. package/cjs/components/editors/DateEditor/styles.d.ts +1 -1
  24. package/cjs/components/editors/DateEditor/styles.js +3 -0
  25. package/cjs/components/editors/DependentLookupEditor/DependentLookupEditor.js +7 -1
  26. package/cjs/components/editors/DependentLookupEditor/styles.d.ts +1 -1
  27. package/cjs/components/editors/DependentLookupEditor/styles.js +3 -0
  28. package/cjs/components/editors/TimestampEditor/TimestampEditor.d.ts +2 -1
  29. package/cjs/components/editors/TimestampEditor/TimestampEditor.js +11 -10
  30. package/cjs/components/editors/TimestampEditor/styles.d.ts +1 -1
  31. package/cjs/components/editors/TimestampEditor/styles.js +3 -0
  32. package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +3 -1
  33. package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.js +13 -10
  34. package/cjs/components/editors/TypeaheadEditor/styles.d.ts +1 -1
  35. package/cjs/components/editors/TypeaheadEditor/styles.js +3 -0
  36. package/cjs/hooks/useLayoutResetter.js +1 -2
  37. package/cjs/hooks/useSnackbar.js +3 -3
  38. package/esm/components/MultipleInput/MultipleInput.d.ts +3 -1
  39. package/esm/components/MultipleInput/MultipleInput.js +8 -6
  40. package/esm/components/MultipleInput/styles.d.ts +1 -1
  41. package/esm/components/MultipleInput/styles.js +3 -0
  42. package/esm/components/MultipliableSelect/MultipliableSelect.d.ts +3 -1
  43. package/esm/components/MultipliableSelect/MultipliableSelect.js +4 -3
  44. package/esm/components/MultipliableSelect/styles.d.ts +1 -1
  45. package/esm/components/MultipliableSelect/styles.js +3 -0
  46. package/esm/components/SimpleInput/SimpleInput.d.ts +4 -1
  47. package/esm/components/SimpleInput/SimpleInput.js +11 -5
  48. package/esm/components/SimpleInput/styles.d.ts +1 -0
  49. package/esm/components/SimpleInput/styles.js +6 -0
  50. package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.d.ts +1 -4
  51. package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.js +9 -5
  52. package/esm/components/attributes/editMode/AttributesPager/index.d.ts +3 -3
  53. package/esm/components/attributes/editMode/SimpleAttributeEditor/SimpleAttributeEditor.js +1 -1
  54. package/esm/components/editors/BooleanRadioEditor/BooleanRadioEditor.d.ts +9 -13
  55. package/esm/components/editors/BooleanRadioEditor/BooleanRadioEditor.js +8 -11
  56. package/esm/components/editors/BooleanRadioEditor/styles.d.ts +1 -1
  57. package/esm/components/editors/BooleanRadioEditor/styles.js +16 -1
  58. package/esm/components/editors/DateEditor/DateEditor.d.ts +2 -1
  59. package/esm/components/editors/DateEditor/DateEditor.js +6 -5
  60. package/esm/components/editors/DateEditor/styles.d.ts +1 -1
  61. package/esm/components/editors/DateEditor/styles.js +3 -0
  62. package/esm/components/editors/DependentLookupEditor/DependentLookupEditor.js +7 -1
  63. package/esm/components/editors/DependentLookupEditor/styles.d.ts +1 -1
  64. package/esm/components/editors/DependentLookupEditor/styles.js +3 -0
  65. package/esm/components/editors/TimestampEditor/TimestampEditor.d.ts +2 -1
  66. package/esm/components/editors/TimestampEditor/TimestampEditor.js +6 -5
  67. package/esm/components/editors/TimestampEditor/styles.d.ts +1 -1
  68. package/esm/components/editors/TimestampEditor/styles.js +3 -0
  69. package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +3 -1
  70. package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.js +13 -10
  71. package/esm/components/editors/TypeaheadEditor/styles.d.ts +1 -1
  72. package/esm/components/editors/TypeaheadEditor/styles.js +3 -0
  73. package/esm/hooks/useLayoutResetter.js +1 -2
  74. package/esm/hooks/useSnackbar.js +3 -3
  75. package/package.json +3 -3
@@ -22,18 +22,19 @@ var __rest = (this && this.__rest) || function (s, e) {
22
22
  };
23
23
  import React, { useMemo } from 'react';
24
24
  import i18n from 'ui-i18n';
25
- import { mergeDeepLeft } from 'ramda';
25
+ import classnames from 'classnames';
26
+ import { mergeDeepLeft, isNil, pipe, when, both } from 'ramda';
26
27
  import moment from 'moment';
27
28
  import { getLocaleFormat, utils } from '@reltio/mdm-sdk';
28
- import { both, isNil, pipe, when } from 'ramda';
29
29
  import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
30
30
  import { renderTimeViewClock } from '@mui/x-date-pickers/timeViewRenderers';
31
31
  import { DEFAULT_MAX_DATE, DEFAULT_MIN_DATE } from '../constants';
32
32
  import { useStyles } from './styles';
33
33
  var TimestampEditor = function (_a) {
34
- var value = _a.value, _b = _a.minDate, minDate = _b === void 0 ? DEFAULT_MIN_DATE : _b, _c = _a.maxDate, maxDate = _c === void 0 ? DEFAULT_MAX_DATE : _c, label = _a.label, slotProps = _a.slotProps, onChange = _a.onChange, format = _a.format, otherProps = __rest(_a, ["value", "minDate", "maxDate", "label", "slotProps", "onChange", "format"]);
34
+ var _b;
35
+ var value = _a.value, _c = _a.minDate, minDate = _c === void 0 ? DEFAULT_MIN_DATE : _c, _d = _a.maxDate, maxDate = _d === void 0 ? DEFAULT_MAX_DATE : _d, label = _a.label, slotProps = _a.slotProps, onChange = _a.onChange, format = _a.format, isCrossedOut = _a.isCrossedOut, otherProps = __rest(_a, ["value", "minDate", "maxDate", "label", "slotProps", "onChange", "format", "isCrossedOut"]);
35
36
  var styles = useStyles();
36
- var _d = React.useState(null), error = _d[0], setError = _d[1];
37
+ var _e = React.useState(null), error = _e[0], setError = _e[1];
37
38
  var errorMessage = useMemo(function () {
38
39
  switch (error) {
39
40
  case 'maxDate':
@@ -58,7 +59,7 @@ var TimestampEditor = function (_a) {
58
59
  helperText: errorMessage,
59
60
  InputProps: {
60
61
  classes: {
61
- root: styles.inputRoot
62
+ root: classnames(styles.inputRoot, (_b = {}, _b[styles.isCrossedOut] = isCrossedOut, _b))
62
63
  },
63
64
  disableUnderline: isNil(editorValue)
64
65
  },
@@ -1 +1 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"underline" | "inputRoot" | "adornedEnd" | "iconButtonRoot" | "inputLabel">;
1
+ export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"underline" | "isCrossedOut" | "inputRoot" | "adornedEnd" | "iconButtonRoot" | "inputLabel">;
@@ -21,5 +21,8 @@ export var useStyles = makeStyles(function (theme) { return ({
21
21
  fontSize: '14px',
22
22
  letterSpacing: 0,
23
23
  lineHeight: '16px'
24
+ },
25
+ isCrossedOut: {
26
+ textDecoration: 'line-through'
24
27
  }
25
28
  }); });
@@ -1,5 +1,5 @@
1
1
  export default TypeaheadEditor;
2
- declare function TypeaheadEditor({ value, max, getSuggestions, onChange, multiple, fullWidth, InputProps, ...inputProps }: {
2
+ declare function TypeaheadEditor({ value, max, getSuggestions, onChange, multiple, fullWidth, InputProps, isCrossedOut, ...inputProps }: {
3
3
  [x: string]: any;
4
4
  value: any;
5
5
  max?: number;
@@ -8,6 +8,7 @@ declare function TypeaheadEditor({ value, max, getSuggestions, onChange, multipl
8
8
  multiple: any;
9
9
  fullWidth: any;
10
10
  InputProps?: {};
11
+ isCrossedOut?: boolean;
11
12
  }): JSX.Element;
12
13
  declare namespace TypeaheadEditor {
13
14
  namespace propTypes {
@@ -19,6 +20,7 @@ declare namespace TypeaheadEditor {
19
20
  const getSuggestions: PropTypes.Validator<(...args: any[]) => any>;
20
21
  const InputProps: PropTypes.Requireable<object>;
21
22
  const max: PropTypes.Requireable<number>;
23
+ const isCrossedOut: PropTypes.Requireable<boolean>;
22
24
  }
23
25
  }
24
26
  import PropTypes from 'prop-types';
@@ -50,13 +50,13 @@ import { useDidUpdateEffect } from '../../../hooks';
50
50
  var FETCH_DEBOUNCE_INTERVAL = 300;
51
51
  var PAGE_SIZE = 50;
52
52
  var TypeaheadEditor = function (_a) {
53
- var value = _a.value, _b = _a.max, max = _b === void 0 ? PAGE_SIZE : _b, getSuggestions = _a.getSuggestions, onChange = _a.onChange, multiple = _a.multiple, fullWidth = _a.fullWidth, _c = _a.InputProps, InputProps = _c === void 0 ? {} : _c, inputProps = __rest(_a, ["value", "max", "getSuggestions", "onChange", "multiple", "fullWidth", "InputProps"]);
54
- var _d = useState([]), suggestions = _d[0], setSuggestions = _d[1];
55
- var _e = useState(false), isPlaceholderVisible = _e[0], setPlaceholderVisibility = _e[1];
56
- var _f = useState(1), pageNumber = _f[0], setPageNumber = _f[1];
57
- var _g = useState(false), nextPageIsLoading = _g[0], setNextPageIsLoading = _g[1];
53
+ var value = _a.value, _b = _a.max, max = _b === void 0 ? PAGE_SIZE : _b, getSuggestions = _a.getSuggestions, onChange = _a.onChange, multiple = _a.multiple, fullWidth = _a.fullWidth, _c = _a.InputProps, InputProps = _c === void 0 ? {} : _c, _d = _a.isCrossedOut, isCrossedOut = _d === void 0 ? false : _d, inputProps = __rest(_a, ["value", "max", "getSuggestions", "onChange", "multiple", "fullWidth", "InputProps", "isCrossedOut"]);
54
+ var _e = useState([]), suggestions = _e[0], setSuggestions = _e[1];
55
+ var _f = useState(false), isPlaceholderVisible = _f[0], setPlaceholderVisibility = _f[1];
56
+ var _g = useState(1), pageNumber = _g[0], setPageNumber = _g[1];
57
+ var _h = useState(false), nextPageIsLoading = _h[0], setNextPageIsLoading = _h[1];
58
58
  var pageSizeForRequest = max + 1;
59
- var _h = useState(''), currentValue = _h[0], setCurrentValue = _h[1];
59
+ var _j = useState(''), currentValue = _j[0], setCurrentValue = _j[1];
60
60
  value = defaultTo(multiple ? [] : '', value);
61
61
  var inputValue = multiple ? currentValue : value;
62
62
  useDidUpdateEffect(function () {
@@ -82,7 +82,7 @@ var TypeaheadEditor = function (_a) {
82
82
  ]);
83
83
  var displayedSuggestions = useMemo(function () { return suggestions.slice(0, pageNumber * max); }, [suggestions, pageNumber, max]);
84
84
  var showMoreButton = suggestions.length > displayedSuggestions.length;
85
- var _j = useState(false), hasHighlightedItem = _j[0], setHasHighlightedItem = _j[1];
85
+ var _k = useState(false), hasHighlightedItem = _k[0], setHasHighlightedItem = _k[1];
86
86
  var onInputChange = function (_a) {
87
87
  var newValue = _a.newValue, method = _a.method;
88
88
  switch (method) {
@@ -121,13 +121,15 @@ var TypeaheadEditor = function (_a) {
121
121
  onInputChange({ method: 'enter', newValue: currentValue });
122
122
  }
123
123
  }, fullWidth: fullWidth }, inputProps), { autoComplete: 'nope' }), getSuggestionValue: identity, onSuggestionsFetchRequested: ifElse(propEq('reason', 'input-changed'), debouncedFetchSuggestions, fetchSuggestions), onSuggestionsClearRequested: pipe(always([]), setSuggestions, F, setPlaceholderVisibility, always(1), setPageNumber), renderInputComponent: function (_a) {
124
- var _b;
124
+ var _b, _c;
125
125
  var ref = _a.ref, onInputChange = _a.onChange, otherProps = __rest(_a, ["ref", "onChange"]);
126
126
  var commonClasses = {
127
127
  underline: classnames((_b = {}, _b[styles['input__underline']] = isEmptyValue(value), _b)),
128
128
  input: classnames(styles['rawInput'], path(['classes', 'input'], InputProps))
129
129
  };
130
- return multiple ? (React.createElement(TextField, __assign({ variant: "standard" }, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value.map(function (item, index) { return (React.createElement(ValueChip, { key: item, label: item, onDelete: function () { return onChange(remove(index, 1, value)); } })); }), inputComponent: AutosizeInput, classes: __assign(__assign({ root: classnames(styles['multiple-input__input'], path(['classes', 'root'], InputProps)) }, commonClasses), { input: classnames(styles.autosizeInput, commonClasses.input), adornedStart: styles['multiple-input__adornedStart'] }) }), value: currentValue, onChange: onInputChange, classes: { root: styles['multiple-input__root'] } }))) : (React.createElement(TextField, __assign({ variant: "standard" }, otherProps, { ref: inputRef, inputRef: ref, value: value, onChange: pipe(tap(onInputChange), getValue, onChange), InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: classnames(styles['input__root'], path(['classes', 'root'], InputProps)) }, commonClasses) }) })));
130
+ return multiple ? (React.createElement(TextField, __assign({ variant: "standard" }, otherProps, { ref: inputRef, inputRef: ref, InputProps: __assign(__assign({}, InputProps), { startAdornment: value.map(function (item, index) { return (React.createElement(ValueChip, { key: item, label: item, onDelete: function () { return onChange(remove(index, 1, value)); } })); }), inputComponent: AutosizeInput, classes: __assign(__assign({ root: classnames(styles['multiple-input__input'], path(['classes', 'root'], InputProps)) }, commonClasses), { input: classnames(styles.autosizeInput, commonClasses.input), adornedStart: styles['multiple-input__adornedStart'] }) }), value: currentValue, onChange: onInputChange, classes: { root: styles['multiple-input__root'] } }))) : (React.createElement(TextField, __assign({ variant: "standard" }, otherProps, { ref: inputRef, inputRef: ref, value: value, onChange: pipe(tap(onInputChange), getValue, onChange), InputProps: __assign(__assign({}, InputProps), { classes: __assign({ root: classnames(styles['input__root'], path(['classes', 'root'], InputProps), (_c = {},
131
+ _c[styles.isCrossedOut] = isCrossedOut,
132
+ _c)) }, commonClasses) }) })));
131
133
  }, renderSuggestionsContainer: function (_a) {
132
134
  var children = _a.children, _b = _a.containerProps, ref = _b.ref, restContainerProps = __rest(_b, ["ref"]);
133
135
  return (React.createElement(Popper, { anchorEl: inputRef.current, open: Boolean(children) || isPlaceholderVisible },
@@ -153,6 +155,7 @@ TypeaheadEditor.propTypes = {
153
155
  onChange: PropTypes.func.isRequired,
154
156
  getSuggestions: PropTypes.func.isRequired,
155
157
  InputProps: PropTypes.object,
156
- max: PropTypes.number
158
+ max: PropTypes.number,
159
+ isCrossedOut: PropTypes.bool
157
160
  };
158
161
  export default TypeaheadEditor;
@@ -1 +1 @@
1
- export const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"autosizeInput" | "typeahead__suggestions-placeholder" | "typeahead__suggestions-container--open" | "typeahead__suggestions-list" | "typeahead__suggestions-menuItem" | "input__root" | "rawInput" | "multiple-input__root" | "multiple-input__input" | "multiple-input__adornedStart" | "input__underline" | "typeahead__suggestions-container" | "menuItem--item">;
1
+ export const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"isCrossedOut" | "autosizeInput" | "typeahead__suggestions-placeholder" | "typeahead__suggestions-container--open" | "typeahead__suggestions-list" | "typeahead__suggestions-menuItem" | "input__root" | "rawInput" | "multiple-input__root" | "multiple-input__input" | "multiple-input__adornedStart" | "input__underline" | "typeahead__suggestions-container" | "menuItem--item">;
@@ -42,6 +42,9 @@ export var useStyles = makeStyles({
42
42
  paddingTop: '10px',
43
43
  paddingBottom: '11px'
44
44
  },
45
+ isCrossedOut: {
46
+ textDecoration: 'line-through'
47
+ },
45
48
  'multiple-input__root': {
46
49
  flexWrap: 'wrap',
47
50
  color: 'rgba(0,0,0,0.87)',
@@ -10,8 +10,7 @@ export var useLayoutResetter = function (_a) {
10
10
  onDismissClick: onResetUndo,
11
11
  showDismiss: true,
12
12
  autoHideDuration: 5000,
13
- dismissTitle: i18n.text('Undo'),
14
- anchorOrigin: { vertical: 'bottom', horizontal: 'center' }
13
+ dismissTitle: i18n.text('Undo')
15
14
  }), SnackbarRenderer = _b.SnackbarRenderer, showSnackbarMessage = _b.showSnackbarMessage;
16
15
  return { SnackbarRenderer: SnackbarRenderer, resetLayout: resetLayout };
17
16
  };
@@ -7,9 +7,9 @@ import Snackbar from '@mui/material/Snackbar';
7
7
  import { noop } from '../core';
8
8
  var FIVE_MINUTES = 5 * 60 * 1000;
9
9
  export var useSnackbar = function (_a) {
10
- var _b = _a === void 0 ? {} : _a, anchorOrigin = _b.anchorOrigin, showDismiss = _b.showDismiss, _c = _b.dismissTitle, dismissTitle = _c === void 0 ? i18n.text('Dismiss') : _c, _d = _b.autoHideDuration, autoHideDuration = _d === void 0 ? FIVE_MINUTES : _d, _e = _b.onDismissClick, onDismissClick = _e === void 0 ? noop : _e;
11
- var _f = useState(false), isOpenSnackbar = _f[0], setIsOpenSnackbar = _f[1];
12
- var _g = useState(''), snackbarMessage = _g[0], setSnackbarMessage = _g[1];
10
+ var _b = _a === void 0 ? {} : _a, _c = _b.anchorOrigin, anchorOrigin = _c === void 0 ? { vertical: 'bottom', horizontal: 'center' } : _c, showDismiss = _b.showDismiss, _d = _b.dismissTitle, dismissTitle = _d === void 0 ? i18n.text('Dismiss') : _d, _e = _b.autoHideDuration, autoHideDuration = _e === void 0 ? FIVE_MINUTES : _e, _f = _b.onDismissClick, onDismissClick = _f === void 0 ? noop : _f;
11
+ var _g = useState(false), isOpenSnackbar = _g[0], setIsOpenSnackbar = _g[1];
12
+ var _h = useState(''), snackbarMessage = _h[0], setSnackbarMessage = _h[1];
13
13
  var closeSnackbar = useCallback(function () {
14
14
  setIsOpenSnackbar(false);
15
15
  setSnackbarMessage('');
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1598",
3
+ "version": "1.4.1600",
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.1598",
11
- "@reltio/mdm-sdk": "^1.4.1598",
10
+ "@reltio/mdm-module": "^1.4.1600",
11
+ "@reltio/mdm-sdk": "^1.4.1600",
12
12
  "classnames": "^2.2.5",
13
13
  "d3-cloud": "^1.2.5",
14
14
  "d3-geo": "^2.0.1",