@reltio/components 1.4.1599 → 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 (71) 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/esm/components/MultipleInput/MultipleInput.d.ts +3 -1
  37. package/esm/components/MultipleInput/MultipleInput.js +8 -6
  38. package/esm/components/MultipleInput/styles.d.ts +1 -1
  39. package/esm/components/MultipleInput/styles.js +3 -0
  40. package/esm/components/MultipliableSelect/MultipliableSelect.d.ts +3 -1
  41. package/esm/components/MultipliableSelect/MultipliableSelect.js +4 -3
  42. package/esm/components/MultipliableSelect/styles.d.ts +1 -1
  43. package/esm/components/MultipliableSelect/styles.js +3 -0
  44. package/esm/components/SimpleInput/SimpleInput.d.ts +4 -1
  45. package/esm/components/SimpleInput/SimpleInput.js +11 -5
  46. package/esm/components/SimpleInput/styles.d.ts +1 -0
  47. package/esm/components/SimpleInput/styles.js +6 -0
  48. package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.d.ts +1 -4
  49. package/esm/components/attributes/editMode/AttributesPager/AttributeRenderer.js +9 -5
  50. package/esm/components/attributes/editMode/AttributesPager/index.d.ts +3 -3
  51. package/esm/components/attributes/editMode/SimpleAttributeEditor/SimpleAttributeEditor.js +1 -1
  52. package/esm/components/editors/BooleanRadioEditor/BooleanRadioEditor.d.ts +9 -13
  53. package/esm/components/editors/BooleanRadioEditor/BooleanRadioEditor.js +8 -11
  54. package/esm/components/editors/BooleanRadioEditor/styles.d.ts +1 -1
  55. package/esm/components/editors/BooleanRadioEditor/styles.js +16 -1
  56. package/esm/components/editors/DateEditor/DateEditor.d.ts +2 -1
  57. package/esm/components/editors/DateEditor/DateEditor.js +6 -5
  58. package/esm/components/editors/DateEditor/styles.d.ts +1 -1
  59. package/esm/components/editors/DateEditor/styles.js +3 -0
  60. package/esm/components/editors/DependentLookupEditor/DependentLookupEditor.js +7 -1
  61. package/esm/components/editors/DependentLookupEditor/styles.d.ts +1 -1
  62. package/esm/components/editors/DependentLookupEditor/styles.js +3 -0
  63. package/esm/components/editors/TimestampEditor/TimestampEditor.d.ts +2 -1
  64. package/esm/components/editors/TimestampEditor/TimestampEditor.js +6 -5
  65. package/esm/components/editors/TimestampEditor/styles.d.ts +1 -1
  66. package/esm/components/editors/TimestampEditor/styles.js +3 -0
  67. package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.d.ts +3 -1
  68. package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.js +13 -10
  69. package/esm/components/editors/TypeaheadEditor/styles.d.ts +1 -1
  70. package/esm/components/editors/TypeaheadEditor/styles.js +3 -0
  71. package/package.json +3 -3
@@ -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)',
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1599",
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.1599",
11
- "@reltio/mdm-sdk": "^1.4.1599",
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",