@reltio/components 1.4.1194 → 1.4.1198
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/ActionButton/styles.d.ts +1 -1
- package/cjs/components/attributes/ImageAttributesLine/styles.d.ts +1 -1
- package/cjs/components/attributes/editMode/MoreAttributesButton/styles.d.ts +1 -1
- package/cjs/components/commonReactSelectComponents/LoadMoreButton.d.ts +8 -0
- package/cjs/components/commonReactSelectComponents/LoadMoreButton.js +17 -0
- package/cjs/components/commonReactSelectComponents/MenuList.d.ts +3 -0
- package/cjs/components/commonReactSelectComponents/MenuList.js +25 -0
- package/cjs/components/commonReactSelectComponents/styles.d.ts +1 -0
- package/cjs/components/commonReactSelectComponents/styles.js +24 -0
- package/cjs/components/crosswalks/CrosswalkAttributes/styles.d.ts +1 -1
- package/cjs/components/editors/DataTypeValueEditor/useEditorContext.d.ts +8 -2
- package/cjs/components/editors/DataTypeValueEditor/useEditorContext.js +5 -4
- package/cjs/components/editors/DependentLookupEditor/DependentLookupEditor.js +52 -10
- package/cjs/components/editors/TypeaheadEditor/TypeaheadEditor.js +32 -7
- package/cjs/components/history/HistoryGraph/HistoryCircle.d.ts +1 -1
- package/cjs/components/history/HistoryGraph/HistoryGraph.d.ts +1 -1
- package/cjs/components/index.d.ts +2 -0
- package/cjs/components/index.js +7 -3
- package/esm/components/ActionButton/styles.d.ts +1 -1
- package/esm/components/attributes/ImageAttributesLine/styles.d.ts +1 -1
- package/esm/components/attributes/editMode/MoreAttributesButton/styles.d.ts +1 -1
- package/esm/components/commonReactSelectComponents/LoadMoreButton.d.ts +8 -0
- package/esm/components/commonReactSelectComponents/LoadMoreButton.js +12 -0
- package/esm/components/commonReactSelectComponents/MenuList.d.ts +3 -0
- package/esm/components/commonReactSelectComponents/MenuList.js +20 -0
- package/esm/components/commonReactSelectComponents/styles.d.ts +1 -0
- package/esm/components/commonReactSelectComponents/styles.js +21 -0
- package/esm/components/crosswalks/CrosswalkAttributes/styles.d.ts +1 -1
- package/esm/components/editors/DataTypeValueEditor/useEditorContext.d.ts +8 -2
- package/esm/components/editors/DataTypeValueEditor/useEditorContext.js +5 -4
- package/esm/components/editors/DependentLookupEditor/DependentLookupEditor.js +54 -12
- package/esm/components/editors/TypeaheadEditor/TypeaheadEditor.js +34 -9
- package/esm/components/history/HistoryGraph/HistoryCircle.d.ts +1 -1
- package/esm/components/history/HistoryGraph/HistoryGraph.d.ts +1 -1
- package/esm/components/index.d.ts +2 -0
- package/esm/components/index.js +2 -0
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "button" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "button" | "startIcon" | "menuItem" | "menuText" | "iconButton" | "overflowStyle" | "menuIcon">;
|
|
@@ -3,4 +3,4 @@ export declare type SIZES_TYPE = {
|
|
|
3
3
|
imageWidth: number;
|
|
4
4
|
imageHeight: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const useStyles: (props: SIZES_TYPE) => import("@material-ui/core/styles/withStyles").ClassNameMap<"number" | "
|
|
6
|
+
export declare const useStyles: (props: SIZES_TYPE) => import("@material-ui/core/styles/withStyles").ClassNameMap<"number" | "moreButton" | "imageBox" | "moreButtonContainer">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "dense" | "
|
|
1
|
+
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "dense" | "moreButton" | "buttonLabel" | "subHeader" | "moreAttributes" | "popupContainer" | "moreAttributesPopup" | "noResultsCaptionContainer">;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
+
onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const LoadMoreButton: ({ loading, onClick, onMouseDown }: Props) => JSX.Element;
|
|
8
|
+
export default LoadMoreButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
7
|
+
var Button_1 = __importDefault(require("@material-ui/core/Button"));
|
|
8
|
+
var core_1 = require("@material-ui/core");
|
|
9
|
+
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
10
|
+
var styles_1 = require("./styles");
|
|
11
|
+
var LoadMoreButton = function (_a) {
|
|
12
|
+
var loading = _a.loading, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
13
|
+
var styles = styles_1.useStyles();
|
|
14
|
+
return (react_1.default.createElement("div", { className: styles.loadMoreContainer }, loading ? (react_1.default.createElement(core_1.CircularProgress, { className: styles.loadingSpinner, size: 24 })) : (react_1.default.createElement(Button_1.default, { color: "primary", onClick: onClick, onMouseDown: onMouseDown, className: styles.moreButton },
|
|
15
|
+
react_1.default.createElement("div", { className: styles.buttonLabel }, ui_i18n_1.default.text('Load more'))))));
|
|
16
|
+
};
|
|
17
|
+
exports.default = LoadMoreButton;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var react_select_1 = require("react-select");
|
|
19
|
+
var MenuList = function (props) {
|
|
20
|
+
var menuListFooter = props.selectProps.menuListFooter, children = props.children;
|
|
21
|
+
return (react_1.default.createElement(react_select_1.components.MenuList, __assign({}, props),
|
|
22
|
+
children,
|
|
23
|
+
menuListFooter));
|
|
24
|
+
};
|
|
25
|
+
exports.default = MenuList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"loadMoreContainer" | "moreButton" | "buttonLabel" | "loadingSpinner">;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useStyles = void 0;
|
|
4
|
+
var styles_1 = require("@material-ui/core/styles");
|
|
5
|
+
exports.useStyles = styles_1.makeStyles({
|
|
6
|
+
loadMoreContainer: {
|
|
7
|
+
display: 'flex',
|
|
8
|
+
height: '32px'
|
|
9
|
+
},
|
|
10
|
+
moreButton: {
|
|
11
|
+
padding: '9px 38px 9px 38px'
|
|
12
|
+
},
|
|
13
|
+
buttonLabel: {
|
|
14
|
+
fontSize: '14px',
|
|
15
|
+
fontWeight: 500,
|
|
16
|
+
lineHeight: '16px',
|
|
17
|
+
whiteSpace: 'nowrap',
|
|
18
|
+
overflow: 'hidden'
|
|
19
|
+
},
|
|
20
|
+
loadingSpinner: {
|
|
21
|
+
alignSelf: 'center',
|
|
22
|
+
marginLeft: '40px'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"attributeValue" | "text" | "input" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"attributeValue" | "text" | "input" | "moreButton" | "editor" | "sourceIcon" | "attributeTitle" | "attributeWrapper">;
|
|
@@ -20,14 +20,20 @@ declare function useEditorContext(fieldName: any, dataTypeDefinition: any): {
|
|
|
20
20
|
} | {
|
|
21
21
|
lookups: any;
|
|
22
22
|
lookupCode: any;
|
|
23
|
-
getLookups: (type
|
|
23
|
+
getLookups: ({ type, parents, displayNamePrefix, max, offset }: {
|
|
24
|
+
type: any;
|
|
25
|
+
parents: any;
|
|
26
|
+
displayNamePrefix: any;
|
|
27
|
+
max: any;
|
|
28
|
+
offset: any;
|
|
29
|
+
}) => Promise<any>;
|
|
24
30
|
resolveLookups: (type: any, codeValues: any) => Promise<void>;
|
|
25
31
|
entries?: undefined;
|
|
26
32
|
getSuggestions?: undefined;
|
|
27
33
|
format?: undefined;
|
|
28
34
|
tenant?: undefined;
|
|
29
35
|
} | {
|
|
30
|
-
getSuggestions: (searchValue: any) => Promise<string[]>;
|
|
36
|
+
getSuggestions: (searchValue: any, max: any, pageNo: any) => Promise<string[]>;
|
|
31
37
|
entries?: undefined;
|
|
32
38
|
lookups?: undefined;
|
|
33
39
|
lookupCode?: undefined;
|
|
@@ -41,11 +41,11 @@ var useEditorContext = function (fieldName, dataTypeDefinition) {
|
|
|
41
41
|
var attributePresentations = react_redux_1.useSelector(mdm_module_1.default.selectors.getAttributePresentations);
|
|
42
42
|
var globalSearchRequestOptions = react_redux_1.useSelector(mdm_module_1.default.selectors.getGlobalSearchRequestOptions);
|
|
43
43
|
var dispatch = react_redux_1.useDispatch();
|
|
44
|
-
var typeaheadGetSuggestion = react_1.useCallback(function (searchValue) {
|
|
44
|
+
var typeaheadGetSuggestion = react_1.useCallback(function (searchValue, max, pageNo) {
|
|
45
45
|
return mdm_sdk_1.getFacetedAttributeData({
|
|
46
46
|
fieldName: fieldName,
|
|
47
47
|
searchValue: searchValue,
|
|
48
|
-
options: __assign({}, globalSearchRequestOptions)
|
|
48
|
+
options: __assign(__assign({}, globalSearchRequestOptions), { max: max, pageNo: pageNo })
|
|
49
49
|
}).then(function (response) { return Object.keys(response[fieldName]); });
|
|
50
50
|
}, [fieldName, globalSearchRequestOptions]);
|
|
51
51
|
var type = dataTypeDefinition.type, values = dataTypeDefinition.values, lookupCode = dataTypeDefinition.lookupCode, uri = dataTypeDefinition.uri, dependentLookupCode = dataTypeDefinition.dependentLookupCode, options = dataTypeDefinition.options;
|
|
@@ -66,8 +66,9 @@ var useEditorContext = function (fieldName, dataTypeDefinition) {
|
|
|
66
66
|
return {
|
|
67
67
|
lookups: lookups,
|
|
68
68
|
lookupCode: dependentLookupCode,
|
|
69
|
-
getLookups: function (
|
|
70
|
-
|
|
69
|
+
getLookups: function (_a) {
|
|
70
|
+
var type = _a.type, parents = _a.parents, displayNamePrefix = _a.displayNamePrefix, max = _a.max, offset = _a.offset;
|
|
71
|
+
return mdm_sdk_1.getDependentLookups({ type: type, parents: parents, displayNamePrefix: displayNamePrefix, max: max, offset: offset }).then(function (_a) {
|
|
71
72
|
var codeValues = _a.codeValues;
|
|
72
73
|
return ramda_1.propOr({}, type, codeValues);
|
|
73
74
|
});
|
|
@@ -48,13 +48,14 @@ exports.DEBOUNCE_INTERVAL = void 0;
|
|
|
48
48
|
var react_1 = __importStar(require("react"));
|
|
49
49
|
var prop_types_1 = __importDefault(require("prop-types"));
|
|
50
50
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
51
|
-
var
|
|
51
|
+
var Select_1 = __importDefault(require("../../ReactSelect/Select"));
|
|
52
52
|
var ramda_1 = require("ramda");
|
|
53
53
|
var helpers_1 = require("./helpers");
|
|
54
54
|
var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
55
55
|
var utils_1 = require("../../../core/utils");
|
|
56
56
|
var DropdownIndicator_1 = __importDefault(require("../../commonReactSelectComponents/DropdownIndicator"));
|
|
57
57
|
var MenuWithPopper_1 = __importDefault(require("../../commonReactSelectComponents/MenuWithPopper"));
|
|
58
|
+
var MenuList_1 = __importDefault(require("../../commonReactSelectComponents/MenuList"));
|
|
58
59
|
var styles_1 = require("./styles");
|
|
59
60
|
var useLookupsResolver_1 = __importDefault(require("./useLookupsResolver"));
|
|
60
61
|
var MultiValueChip_1 = __importDefault(require("../commonComponents/MultiValueChip/MultiValueChip"));
|
|
@@ -62,15 +63,18 @@ var OptionWithCheckIcon_1 = __importDefault(require("../../commonReactSelectComp
|
|
|
62
63
|
var useDefaultOptions_1 = __importDefault(require("./useDefaultOptions"));
|
|
63
64
|
var useAutopopulation_1 = __importDefault(require("./useAutopopulation"));
|
|
64
65
|
var useSavingFocus_1 = __importDefault(require("./useSavingFocus"));
|
|
66
|
+
var LoadMoreButton_1 = __importDefault(require("../../commonReactSelectComponents/LoadMoreButton"));
|
|
65
67
|
var SelectComponents = {
|
|
66
68
|
IndicatorSeparator: utils_1.EmptyStub,
|
|
67
69
|
LoadingIndicator: utils_1.EmptyStub,
|
|
68
70
|
Option: OptionWithCheckIcon_1.default,
|
|
69
71
|
DropdownIndicator: DropdownIndicator_1.default,
|
|
70
72
|
Menu: MenuWithPopper_1.default,
|
|
73
|
+
MenuList: MenuList_1.default,
|
|
71
74
|
MultiValue: MultiValueChip_1.default
|
|
72
75
|
};
|
|
73
76
|
exports.DEBOUNCE_INTERVAL = 400;
|
|
77
|
+
var MAX_DEPENDENT_LOOKUP_VALUES = 50;
|
|
74
78
|
var DependentLookupEditor = function (_a) {
|
|
75
79
|
var multiple = _a.multiple, value = _a.value, lookupTypeCode = _a.lookupCode, TextFieldProps = _a.TextFieldProps, parents = _a.parents, onChange = _a.onChange, getLookups = _a.getLookups, _b = _a.lookups, lookups = _b === void 0 ? {} : _b, resolveLookups = _a.resolveLookups, fullWidth = _a.fullWidth, disabled = _a.disabled, placeholder = _a.placeholder, autopopulationId = _a.autopopulationId, otherProps = __rest(_a, ["multiple", "value", "lookupCode", "TextFieldProps", "parents", "onChange", "getLookups", "lookups", "resolveLookups", "fullWidth", "disabled", "placeholder", "autopopulationId"]);
|
|
76
80
|
var inputRef = react_1.useRef(null);
|
|
@@ -84,16 +88,54 @@ var DependentLookupEditor = function (_a) {
|
|
|
84
88
|
});
|
|
85
89
|
useSavingFocus_1.default(selectRef, inputRef, disabled);
|
|
86
90
|
var _c = react_1.useState(''), inputValue = _c[0], setInputValue = _c[1];
|
|
87
|
-
var
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
var _d = react_1.useState([]), options = _d[0], setOptions = _d[1];
|
|
92
|
+
var _e = react_1.useState(1), pageNumber = _e[0], setPageNumber = _e[1];
|
|
93
|
+
var _f = react_1.useState(false), nextPageIsLoading = _f[0], setNextPageIsLoading = _f[1];
|
|
94
|
+
var handleInputChange = function (value) {
|
|
95
|
+
if (value !== inputValue) {
|
|
96
|
+
setInputValue(value);
|
|
97
|
+
setPageNumber(1);
|
|
98
|
+
debouncedLoadOptions(value, setOptions);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var loadOptions = react_1.useCallback(function (value, pageNumber) {
|
|
102
|
+
if (pageNumber === void 0) { pageNumber = 1; }
|
|
103
|
+
return getLookups({
|
|
104
|
+
type: lookupTypeCode,
|
|
105
|
+
parents: parents,
|
|
106
|
+
displayNamePrefix: value,
|
|
107
|
+
max: MAX_DEPENDENT_LOOKUP_VALUES + 1,
|
|
108
|
+
offset: (pageNumber - 1) * MAX_DEPENDENT_LOOKUP_VALUES
|
|
109
|
+
}).then(function (buildOptions) { return helpers_1.buildLookupOptions(buildOptions); });
|
|
110
|
+
}, [lookupTypeCode, parents]);
|
|
111
|
+
var loadMoreOptions = react_1.useCallback(function () {
|
|
112
|
+
setNextPageIsLoading(true);
|
|
113
|
+
loadOptions(inputValue, pageNumber + 1)
|
|
114
|
+
.then(function (buildOptions) {
|
|
115
|
+
setOptions(function (options) {
|
|
116
|
+
return ramda_1.concat(options.slice(0, pageNumber * MAX_DEPENDENT_LOOKUP_VALUES), buildOptions);
|
|
117
|
+
});
|
|
118
|
+
setPageNumber(function (page) { return page + 1; });
|
|
119
|
+
})
|
|
120
|
+
.catch(function () { return []; })
|
|
121
|
+
.finally(function () { return setNextPageIsLoading(false); });
|
|
122
|
+
}, [loadOptions, inputValue, pageNumber]);
|
|
91
123
|
var debouncedLoadOptions = react_1.useCallback(mdm_sdk_1.debounce(function (value, callback) {
|
|
124
|
+
setNextPageIsLoading(true);
|
|
92
125
|
loadOptions(value)
|
|
93
126
|
.then(function (options) { return callback(options); })
|
|
94
|
-
.catch(function () { return callback([]); })
|
|
127
|
+
.catch(function () { return callback([]); })
|
|
128
|
+
.finally(function () { return setNextPageIsLoading(false); });
|
|
95
129
|
}, exports.DEBOUNCE_INTERVAL), [loadOptions]);
|
|
96
|
-
var
|
|
130
|
+
var _g = useDefaultOptions_1.default(loadOptions), defaultOptions = _g.defaultOptions, initialDefaultOptions = _g.initialDefaultOptions, isLoadingDefaultOptions = _g.isLoading;
|
|
131
|
+
react_1.useEffect(function () {
|
|
132
|
+
setOptions(defaultOptions);
|
|
133
|
+
}, [defaultOptions]);
|
|
134
|
+
var displayedOptions = react_1.useMemo(function () { return options.slice(0, pageNumber * MAX_DEPENDENT_LOOKUP_VALUES); }, [
|
|
135
|
+
options,
|
|
136
|
+
pageNumber
|
|
137
|
+
]);
|
|
138
|
+
var showMoreButton = options.length > displayedOptions.length;
|
|
97
139
|
var isEmptyValue = multiple ? ramda_1.isEmpty(value) : !(value === null || value === void 0 ? void 0 : value.lookupCode) && !(value === null || value === void 0 ? void 0 : value.value);
|
|
98
140
|
var markAsTouched = useAutopopulation_1.default({
|
|
99
141
|
id: autopopulationId,
|
|
@@ -102,13 +144,13 @@ var DependentLookupEditor = function (_a) {
|
|
|
102
144
|
multiple: multiple,
|
|
103
145
|
onChange: onChange
|
|
104
146
|
}).markAsTouched;
|
|
105
|
-
return (react_1.default.createElement(
|
|
147
|
+
return (react_1.default.createElement(Select_1.default, __assign({}, otherProps, { isMulti: multiple, classes: styles, menuPortalTarget: document.body, menuPlacement: "auto", TextFieldProps: __assign(__assign({}, TextFieldProps), { ref: inputRef, disabled: (TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.disabled) || disabled }), inputRef: inputRef, innerRef: selectRef, styles: {
|
|
106
148
|
menuPortal: function (base) { return (__assign(__assign({}, base), { zIndex: 1300 })); },
|
|
107
149
|
container: function (base) { return (__assign(__assign({}, base), (fullWidth ? { width: '100%' } : {}))); }
|
|
108
|
-
}, loadingMessage: function () { return ui_i18n_1.default.text('Loading...'); }, noOptionsMessage: function () { return ui_i18n_1.default.text('No results found'); }, components: SelectComponents, isClearable: true, isSearchable: true, inputValue: inputValue, onInputChange:
|
|
150
|
+
}, loadingMessage: function () { return ui_i18n_1.default.text('Loading...'); }, noOptionsMessage: function () { return ui_i18n_1.default.text('No results found'); }, components: SelectComponents, isClearable: true, isSearchable: true, inputValue: inputValue, onInputChange: handleInputChange, isLoading: !inputValue && isLoadingDefaultOptions, hideSelectedOptions: false, placeholder: placeholder || '', isDisabled: disabled, options: displayedOptions, getOptionValue: ramda_1.either(ramda_1.prop('value'), ramda_1.prop('lookupCode')), getOptionLabel: helpers_1.getOptionLabel, onChange: function (value) {
|
|
109
151
|
markAsTouched();
|
|
110
152
|
onChange(value);
|
|
111
|
-
}, value: ramda_1.defaultTo(multiple ? [] : null, value) })));
|
|
153
|
+
}, value: ramda_1.defaultTo(multiple ? [] : null, value), menuListFooter: showMoreButton && react_1.default.createElement(LoadMoreButton_1.default, { loading: nextPageIsLoading, onClick: loadMoreOptions }) })));
|
|
112
154
|
};
|
|
113
155
|
DependentLookupEditor.propTypes = {
|
|
114
156
|
multiple: prop_types_1.default.bool,
|
|
@@ -65,21 +65,44 @@ var utils_1 = require("../../../core/utils");
|
|
|
65
65
|
var styles_1 = require("./styles");
|
|
66
66
|
var ExpandedValueTooltip_1 = __importDefault(require("../../ExpandedValueTooltip/ExpandedValueTooltip"));
|
|
67
67
|
var ValueChip_1 = __importDefault(require("../../ValueChip/ValueChip"));
|
|
68
|
+
var LoadMoreButton_1 = __importDefault(require("../../commonReactSelectComponents/LoadMoreButton"));
|
|
69
|
+
var hooks_1 = require("../../../hooks");
|
|
68
70
|
var FETCH_DEBOUNCE_INTERVAL = 300;
|
|
71
|
+
var PAGE_SIZE = 50;
|
|
69
72
|
var TypeaheadEditor = function (_a) {
|
|
70
73
|
var value = _a.value, getSuggestions = _a.getSuggestions, onChange = _a.onChange, multiple = _a.multiple, fullWidth = _a.fullWidth, _b = _a.InputProps, InputProps = _b === void 0 ? {} : _b, inputProps = __rest(_a, ["value", "getSuggestions", "onChange", "multiple", "fullWidth", "InputProps"]);
|
|
71
74
|
var _c = react_1.useState([]), suggestions = _c[0], setSuggestions = _c[1];
|
|
72
75
|
var _d = react_1.useState(false), isPlaceholderVisible = _d[0], setPlaceholderVisibility = _d[1];
|
|
76
|
+
var _e = react_1.useState(1), pageNumber = _e[0], setPageNumber = _e[1];
|
|
77
|
+
var _f = react_1.useState(false), nextPageIsLoading = _f[0], setNextPageIsLoading = _f[1];
|
|
78
|
+
var pageSizeForRequest = PAGE_SIZE + 1;
|
|
79
|
+
var _g = react_1.useState(''), currentValue = _g[0], setCurrentValue = _g[1];
|
|
80
|
+
value = ramda_1.defaultTo(multiple ? [] : '', value);
|
|
81
|
+
var inputValue = multiple ? currentValue : value;
|
|
82
|
+
hooks_1.useDidUpdateEffect(function () {
|
|
83
|
+
setPageNumber(1);
|
|
84
|
+
}, [inputValue]);
|
|
73
85
|
var inputRef = react_1.useRef();
|
|
74
86
|
var styles = styles_1.useStyles();
|
|
75
87
|
var isFocused = function () { var _a; return ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === document.activeElement; };
|
|
76
|
-
var fetchSuggestions = ramda_1.pipe(ramda_1.prop('value'), ramda_1.trim, getSuggestions, ramda_1.andThen(ramda_1.pipe(ramda_1.tap(setSuggestions), ramda_1.both(ramda_1.isEmpty, isFocused), setPlaceholderVisibility)));
|
|
88
|
+
var fetchSuggestions = ramda_1.pipe(ramda_1.prop('value'), ramda_1.trim, function (value) { return getSuggestions(value, pageSizeForRequest); }, ramda_1.andThen(ramda_1.pipe(ramda_1.tap(setSuggestions), ramda_1.both(ramda_1.isEmpty, isFocused), setPlaceholderVisibility)));
|
|
89
|
+
var onLoadMoreSuggestions = function () {
|
|
90
|
+
setNextPageIsLoading(true);
|
|
91
|
+
getSuggestions(inputValue, pageSizeForRequest, pageNumber + 1)
|
|
92
|
+
.then(ramda_1.pipe(ramda_1.concat(suggestions), setSuggestions, ramda_1.always(pageNumber + 1), setPageNumber))
|
|
93
|
+
.finally(function () {
|
|
94
|
+
setNextPageIsLoading(false);
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
var onMouseDown = function (event) {
|
|
98
|
+
event.preventDefault();
|
|
99
|
+
};
|
|
77
100
|
var debouncedFetchSuggestions = react_1.useCallback(mdm_sdk_1.debounce(fetchSuggestions, FETCH_DEBOUNCE_INTERVAL), [
|
|
78
101
|
getSuggestions
|
|
79
102
|
]);
|
|
80
|
-
|
|
81
|
-
var
|
|
82
|
-
var
|
|
103
|
+
var displayedSuggestions = react_1.useMemo(function () { return suggestions.slice(0, pageNumber * PAGE_SIZE); }, [suggestions, pageNumber]);
|
|
104
|
+
var showMoreButton = suggestions.length > displayedSuggestions.length;
|
|
105
|
+
var _h = react_1.useState(false), hasHighlightedItem = _h[0], setHasHighlightedItem = _h[1];
|
|
83
106
|
var onInputChange = function (_a) {
|
|
84
107
|
var newValue = _a.newValue, method = _a.method;
|
|
85
108
|
switch (method) {
|
|
@@ -113,11 +136,11 @@ var TypeaheadEditor = function (_a) {
|
|
|
113
136
|
}
|
|
114
137
|
}
|
|
115
138
|
};
|
|
116
|
-
return (react_1.default.createElement(react_autosuggest_1.default, { suggestions:
|
|
139
|
+
return (react_1.default.createElement(react_autosuggest_1.default, { suggestions: displayedSuggestions, shouldRenderSuggestions: ramda_1.T, inputProps: __assign(__assign({ value: inputValue, onChange: ramda_1.pipe(ramda_1.nthArg(1), onInputChange), onKeyDown: function (event) {
|
|
117
140
|
if (event.keyCode === 13 && multiple && !hasHighlightedItem) {
|
|
118
141
|
onInputChange({ method: 'enter', newValue: currentValue });
|
|
119
142
|
}
|
|
120
|
-
}, fullWidth: fullWidth }, inputProps), { autoComplete: 'nope' }), getSuggestionValue: ramda_1.identity, onSuggestionsFetchRequested: ramda_1.ifElse(ramda_1.propEq('reason', 'input-changed'), debouncedFetchSuggestions, fetchSuggestions), onSuggestionsClearRequested: ramda_1.pipe(ramda_1.always([]), setSuggestions, ramda_1.F, setPlaceholderVisibility), renderInputComponent: function (_a) {
|
|
143
|
+
}, fullWidth: fullWidth }, inputProps), { autoComplete: 'nope' }), getSuggestionValue: ramda_1.identity, onSuggestionsFetchRequested: ramda_1.ifElse(ramda_1.propEq('reason', 'input-changed'), debouncedFetchSuggestions, fetchSuggestions), onSuggestionsClearRequested: ramda_1.pipe(ramda_1.always([]), setSuggestions, ramda_1.F, setPlaceholderVisibility, ramda_1.always(1), setPageNumber), renderInputComponent: function (_a) {
|
|
121
144
|
var _b;
|
|
122
145
|
var ref = _a.ref, onInputChange = _a.onChange, otherProps = __rest(_a, ["ref", "onChange"]);
|
|
123
146
|
var commonClasses = {
|
|
@@ -128,7 +151,9 @@ var TypeaheadEditor = function (_a) {
|
|
|
128
151
|
}, renderSuggestionsContainer: function (_a) {
|
|
129
152
|
var children = _a.children, _b = _a.containerProps, ref = _b.ref, restContainerProps = __rest(_b, ["ref"]);
|
|
130
153
|
return (react_1.default.createElement(Popper_1.default, { anchorEl: inputRef.current, open: Boolean(children) || isPlaceholderVisible },
|
|
131
|
-
react_1.default.createElement(Paper_1.default, __assign({ ref: ref, square: true }, restContainerProps, { style: { width: ramda_1.prop('clientWidth', inputRef.current) } }),
|
|
154
|
+
react_1.default.createElement(Paper_1.default, __assign({ ref: ref, square: true }, restContainerProps, { style: { width: ramda_1.prop('clientWidth', inputRef.current) } }),
|
|
155
|
+
children || react_1.default.createElement(EmptySearchResult_1.NoResults, { className: styles['typeahead__suggestions-placeholder'] }),
|
|
156
|
+
showMoreButton && !isPlaceholderVisible && (react_1.default.createElement(LoadMoreButton_1.default, { onClick: onLoadMoreSuggestions, onMouseDown: onMouseDown, loading: nextPageIsLoading })))));
|
|
132
157
|
}, renderSuggestion: function (suggestion, _a) {
|
|
133
158
|
var isHighlighted = _a.isHighlighted;
|
|
134
159
|
return (react_1.default.createElement(MenuItem_1.default, { className: styles['typeahead__suggestions-menuItem'], selected: isHighlighted, component: "div" },
|
|
@@ -9,5 +9,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<{
|
|
|
9
9
|
isCollapsed?: boolean;
|
|
10
10
|
showCollapseIcon?: boolean;
|
|
11
11
|
showLine?: boolean;
|
|
12
|
-
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "
|
|
12
|
+
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "offset" | "children" | "radius" | "order" | "method" | "width" | "height" | "in" | "format" | "key" | "attributeName" | "name" | "mode" | "attributeType" | "direction" | "path" | "from" | "to" | "end" | "clipPath" | "color" | "cursor" | "display" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "opacity" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "textDecoration" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "local" | "style" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "onScroll" | "className" | "y" | "d" | "origin" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "media" | "target" | "min" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "autoReverse" | "azimuth" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "orientation" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "isDashed" | "isCollapsed" | "showCollapseIcon" | "showLine"> & React.RefAttributes<unknown>>;
|
|
13
13
|
export default _default;
|
|
@@ -16,7 +16,7 @@ export declare const HistoryCircleWithTooltip: React.ForwardRefExoticComponent<i
|
|
|
16
16
|
isCollapsed?: boolean;
|
|
17
17
|
showCollapseIcon?: boolean;
|
|
18
18
|
showLine?: boolean;
|
|
19
|
-
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "
|
|
19
|
+
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "offset" | "children" | "radius" | "order" | "method" | "width" | "height" | "in" | "format" | "key" | "attributeName" | "name" | "mode" | "attributeType" | "direction" | "path" | "from" | "to" | "end" | "clipPath" | "color" | "cursor" | "display" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "opacity" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "textDecoration" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "local" | "style" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "onScroll" | "className" | "y" | "d" | "origin" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "media" | "target" | "min" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "autoReverse" | "azimuth" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "orientation" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "isDashed" | "isCollapsed" | "showCollapseIcon" | "showLine"> & React.RefAttributes<unknown>>;
|
|
20
20
|
declare type Props = {
|
|
21
21
|
graphData: HistoryData;
|
|
22
22
|
onHistoryCircleMouseOver?: (uri: string, timestamp: number, index: number) => void;
|
|
@@ -36,6 +36,8 @@ export { default as ColorBar } from './ColorBar/ColorBar';
|
|
|
36
36
|
export { default as CommentsContainer } from './CommentsContainer/CommentsContainer';
|
|
37
37
|
export { default as DropdownIndicator } from './commonReactSelectComponents/DropdownIndicator';
|
|
38
38
|
export { default as DropdownIndicatorWithIconButton } from './commonReactSelectComponents/DropdownIndicatorWithIconButton';
|
|
39
|
+
export { default as LoadMoreButton } from './commonReactSelectComponents/LoadMoreButton';
|
|
40
|
+
export { default as MenuList } from './commonReactSelectComponents/MenuList';
|
|
39
41
|
export { default as MenuWithPopper } from './commonReactSelectComponents/MenuWithPopper';
|
|
40
42
|
export { default as ConfigureColumnsPopup } from './ConfigureColumnsPopup/ConfigureColumnsPopup';
|
|
41
43
|
export { default as ConnectionRelationTypeSelector } from './ConnectionRelationTypeSelector/ConnectionRelationTypeSelector';
|
package/cjs/components/index.js
CHANGED
|
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
14
|
};
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
17
|
-
exports.
|
|
18
|
-
exports.MatchRulesSelector = exports.MultiValueSelector = exports.DragAndDrop = exports.ConnectionEditor = exports.AttributesFiltersBuilder = exports.AttributesFiltersButton = exports.AttributeGroupIcon = exports.BasicAttributeSelector = exports.ProfilesList = exports.ActionButtonMode = exports.ActionButton = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.RelationEditor = exports.OvIcon = exports.ErrorMessage = exports.ReltioMap = exports.ConfirmDeleteDialog = exports.ConfirmationDialog = exports.Marginator = exports.LightArrowTooltip = exports.ArrowExpandButton = exports.ScrollableTabs = exports.ExpandableSearchInput = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleDropDownSelector = void 0;
|
|
16
|
+
exports.EMPTY_STATE_VARIANTS = exports.EMPTY_STATE_ICONS = exports.EmptyState = exports.NoResults = exports.NoData = exports.DropDownSelector = exports.DropDownMenuButton = exports.Drawer = exports.DataTypeValue = exports.ConnectionRelationTypeSelector = exports.ConfigureColumnsPopup = exports.MenuWithPopper = exports.MenuList = exports.LoadMoreButton = exports.DropdownIndicatorWithIconButton = exports.DropdownIndicator = exports.CommentsContainer = exports.ColorBar = exports.CollapseButton = exports.CollaborationItem = exports.ClickAwayProvider = exports.BasicViewHeader = exports.BasicViewContent = exports.BasicView = exports.ProfileBandNavigation = exports.AvatarWithFallback = exports.AutoSizeList = exports.ReadOnlyAttributesPager = exports.SimpleAttribute = exports.ReferenceAttribute = exports.NestedAttribute = exports.EditableImageAttributesLine = exports.ImageAttributesLine = exports.ReadOnlyAttributesList = exports.ReadOnlyAttributeValuesBlock = exports.EditableAttribute = exports.ReadOnlyAttribute = exports.CardinalityMessage = exports.AttributesPager = exports.SimpleAttributeEditor = exports.RelationTypeSelector = exports.ReferenceAttributeEditor = exports.NestedAttributeEditor = exports.MoreAttributesButton = exports.EntitySelector = exports.EntityCreator = exports.AttributesList = exports.BranchDecorator = exports.AttributesView = exports.AttributeListItem = void 0;
|
|
17
|
+
exports.SidePanelEmptyState = exports.SideButtonsPanel = exports.SelectorWithOnlyOptionAutoSelect = exports.SelectionPopupPopper = exports.SelectionPopup = exports.useKeyboardNavigation = exports.WhiteSearchInput = exports.SearchInput = exports.ResizablePanes = exports.ReltioGridLayout = exports.ReactSortableTreeUtils = exports.ReactSortableTreeHandlers = exports.ReactSortableTree = exports.ReactSelectOptionFilters = exports.MultiSelect = exports.QueryBuilderRowsGroup = exports.QueryBuilderRow = exports.ProfileCard = exports.ProfileBand = exports.PotentialMatchReviewCard = exports.PopupWithArrow = exports.Popper = exports.MultipleInput = exports.ModeSwitcherSelect = exports.ModeSwitcher = exports.TransitiveMatchBlock = exports.SimpleMatchRulesBuilder = exports.SimpleMatchRulesBlock = exports.MatchRulesBlock = exports.LoadingSpinner = exports.Link = exports.LinearLoadIndicator = exports.ImportModes = exports.ImportButton = exports.ImageGalleryDialog = exports.Highlighter = exports.HierarchicalAttributeTooltip = exports.HideOnShrink = exports.FlipCard = exports.FacetViewHeader = exports.ExpandedValueTooltip = exports.ErrorWrapper = exports.ErrorPopup = exports.ErrorBoundary = exports.EntityUriLink = exports.RelationTypesSelector = exports.EntityTypesSelector = exports.EntityTypeIcon = exports.EntityTypeBadge = exports.EntityAvatar = void 0;
|
|
18
|
+
exports.MatchRulesSelector = exports.MultiValueSelector = exports.DragAndDrop = exports.ConnectionEditor = exports.AttributesFiltersBuilder = exports.AttributesFiltersButton = exports.AttributeGroupIcon = exports.BasicAttributeSelector = exports.ProfilesList = exports.ActionButtonMode = exports.ActionButton = exports.NotMatchButton = exports.MergeButton = exports.ProfileMatchCard = exports.RelationEditor = exports.OvIcon = exports.ErrorMessage = exports.ReltioMap = exports.ConfirmDeleteDialog = exports.ConfirmationDialog = exports.Marginator = exports.LightArrowTooltip = exports.ArrowExpandButton = exports.ScrollableTabs = exports.ExpandableSearchInput = exports.VirtualGroupedList = exports.ViewMoreToggle = exports.VerticalHeadingsTable = exports.VerticalDivider = exports.AttributeTitle = exports.Spacer = exports.SourceIcon = exports.SmallIconButtonWithTooltip = exports.SmallIconButton = exports.SimpleDropDownSelector = exports.SidePanelContentHeader = exports.SidePanel = void 0;
|
|
19
19
|
__exportStar(require("./activityLog"), exports);
|
|
20
20
|
var AttributeListItem_1 = require("./AttributeListItem/AttributeListItem");
|
|
21
21
|
Object.defineProperty(exports, "AttributeListItem", { enumerable: true, get: function () { return __importDefault(AttributeListItem_1).default; } });
|
|
@@ -90,6 +90,10 @@ var DropdownIndicator_1 = require("./commonReactSelectComponents/DropdownIndicat
|
|
|
90
90
|
Object.defineProperty(exports, "DropdownIndicator", { enumerable: true, get: function () { return __importDefault(DropdownIndicator_1).default; } });
|
|
91
91
|
var DropdownIndicatorWithIconButton_1 = require("./commonReactSelectComponents/DropdownIndicatorWithIconButton");
|
|
92
92
|
Object.defineProperty(exports, "DropdownIndicatorWithIconButton", { enumerable: true, get: function () { return __importDefault(DropdownIndicatorWithIconButton_1).default; } });
|
|
93
|
+
var LoadMoreButton_1 = require("./commonReactSelectComponents/LoadMoreButton");
|
|
94
|
+
Object.defineProperty(exports, "LoadMoreButton", { enumerable: true, get: function () { return __importDefault(LoadMoreButton_1).default; } });
|
|
95
|
+
var MenuList_1 = require("./commonReactSelectComponents/MenuList");
|
|
96
|
+
Object.defineProperty(exports, "MenuList", { enumerable: true, get: function () { return __importDefault(MenuList_1).default; } });
|
|
93
97
|
var MenuWithPopper_1 = require("./commonReactSelectComponents/MenuWithPopper");
|
|
94
98
|
Object.defineProperty(exports, "MenuWithPopper", { enumerable: true, get: function () { return __importDefault(MenuWithPopper_1).default; } });
|
|
95
99
|
var ConfigureColumnsPopup_1 = require("./ConfigureColumnsPopup/ConfigureColumnsPopup");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "button" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "button" | "startIcon" | "menuItem" | "menuText" | "iconButton" | "overflowStyle" | "menuIcon">;
|
|
@@ -3,4 +3,4 @@ export declare type SIZES_TYPE = {
|
|
|
3
3
|
imageWidth: number;
|
|
4
4
|
imageHeight: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const useStyles: (props: SIZES_TYPE) => import("@material-ui/core/styles/withStyles").ClassNameMap<"number" | "
|
|
6
|
+
export declare const useStyles: (props: SIZES_TYPE) => import("@material-ui/core/styles/withStyles").ClassNameMap<"number" | "moreButton" | "imageBox" | "moreButtonContainer">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "dense" | "
|
|
1
|
+
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"icon" | "dense" | "moreButton" | "buttonLabel" | "subHeader" | "moreAttributes" | "popupContainer" | "moreAttributesPopup" | "noResultsCaptionContainer">;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare type Props = {
|
|
3
|
+
loading: boolean;
|
|
4
|
+
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
|
+
onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const LoadMoreButton: ({ loading, onClick, onMouseDown }: Props) => JSX.Element;
|
|
8
|
+
export default LoadMoreButton;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Button from '@material-ui/core/Button';
|
|
3
|
+
import { CircularProgress } from '@material-ui/core';
|
|
4
|
+
import i18n from 'ui-i18n';
|
|
5
|
+
import { useStyles } from './styles';
|
|
6
|
+
var LoadMoreButton = function (_a) {
|
|
7
|
+
var loading = _a.loading, onClick = _a.onClick, onMouseDown = _a.onMouseDown;
|
|
8
|
+
var styles = useStyles();
|
|
9
|
+
return (React.createElement("div", { className: styles.loadMoreContainer }, loading ? (React.createElement(CircularProgress, { className: styles.loadingSpinner, size: 24 })) : (React.createElement(Button, { color: "primary", onClick: onClick, onMouseDown: onMouseDown, className: styles.moreButton },
|
|
10
|
+
React.createElement("div", { className: styles.buttonLabel }, i18n.text('Load more'))))));
|
|
11
|
+
};
|
|
12
|
+
export default LoadMoreButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { components } from 'react-select';
|
|
14
|
+
var MenuList = function (props) {
|
|
15
|
+
var menuListFooter = props.selectProps.menuListFooter, children = props.children;
|
|
16
|
+
return (React.createElement(components.MenuList, __assign({}, props),
|
|
17
|
+
children,
|
|
18
|
+
menuListFooter));
|
|
19
|
+
};
|
|
20
|
+
export default MenuList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"loadMoreContainer" | "moreButton" | "buttonLabel" | "loadingSpinner">;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
2
|
+
export var useStyles = makeStyles({
|
|
3
|
+
loadMoreContainer: {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
height: '32px'
|
|
6
|
+
},
|
|
7
|
+
moreButton: {
|
|
8
|
+
padding: '9px 38px 9px 38px'
|
|
9
|
+
},
|
|
10
|
+
buttonLabel: {
|
|
11
|
+
fontSize: '14px',
|
|
12
|
+
fontWeight: 500,
|
|
13
|
+
lineHeight: '16px',
|
|
14
|
+
whiteSpace: 'nowrap',
|
|
15
|
+
overflow: 'hidden'
|
|
16
|
+
},
|
|
17
|
+
loadingSpinner: {
|
|
18
|
+
alignSelf: 'center',
|
|
19
|
+
marginLeft: '40px'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"attributeValue" | "text" | "input" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"attributeValue" | "text" | "input" | "moreButton" | "editor" | "sourceIcon" | "attributeTitle" | "attributeWrapper">;
|
|
@@ -20,14 +20,20 @@ declare function useEditorContext(fieldName: any, dataTypeDefinition: any): {
|
|
|
20
20
|
} | {
|
|
21
21
|
lookups: any;
|
|
22
22
|
lookupCode: any;
|
|
23
|
-
getLookups: (type
|
|
23
|
+
getLookups: ({ type, parents, displayNamePrefix, max, offset }: {
|
|
24
|
+
type: any;
|
|
25
|
+
parents: any;
|
|
26
|
+
displayNamePrefix: any;
|
|
27
|
+
max: any;
|
|
28
|
+
offset: any;
|
|
29
|
+
}) => Promise<any>;
|
|
24
30
|
resolveLookups: (type: any, codeValues: any) => Promise<void>;
|
|
25
31
|
entries?: undefined;
|
|
26
32
|
getSuggestions?: undefined;
|
|
27
33
|
format?: undefined;
|
|
28
34
|
tenant?: undefined;
|
|
29
35
|
} | {
|
|
30
|
-
getSuggestions: (searchValue: any) => Promise<string[]>;
|
|
36
|
+
getSuggestions: (searchValue: any, max: any, pageNo: any) => Promise<string[]>;
|
|
31
37
|
entries?: undefined;
|
|
32
38
|
lookups?: undefined;
|
|
33
39
|
lookupCode?: undefined;
|
|
@@ -20,11 +20,11 @@ var useEditorContext = function (fieldName, dataTypeDefinition) {
|
|
|
20
20
|
var attributePresentations = useSelector(mdm.selectors.getAttributePresentations);
|
|
21
21
|
var globalSearchRequestOptions = useSelector(mdm.selectors.getGlobalSearchRequestOptions);
|
|
22
22
|
var dispatch = useDispatch();
|
|
23
|
-
var typeaheadGetSuggestion = useCallback(function (searchValue) {
|
|
23
|
+
var typeaheadGetSuggestion = useCallback(function (searchValue, max, pageNo) {
|
|
24
24
|
return getFacetedAttributeData({
|
|
25
25
|
fieldName: fieldName,
|
|
26
26
|
searchValue: searchValue,
|
|
27
|
-
options: __assign({}, globalSearchRequestOptions)
|
|
27
|
+
options: __assign(__assign({}, globalSearchRequestOptions), { max: max, pageNo: pageNo })
|
|
28
28
|
}).then(function (response) { return Object.keys(response[fieldName]); });
|
|
29
29
|
}, [fieldName, globalSearchRequestOptions]);
|
|
30
30
|
var type = dataTypeDefinition.type, values = dataTypeDefinition.values, lookupCode = dataTypeDefinition.lookupCode, uri = dataTypeDefinition.uri, dependentLookupCode = dataTypeDefinition.dependentLookupCode, options = dataTypeDefinition.options;
|
|
@@ -45,8 +45,9 @@ var useEditorContext = function (fieldName, dataTypeDefinition) {
|
|
|
45
45
|
return {
|
|
46
46
|
lookups: lookups,
|
|
47
47
|
lookupCode: dependentLookupCode,
|
|
48
|
-
getLookups: function (
|
|
49
|
-
|
|
48
|
+
getLookups: function (_a) {
|
|
49
|
+
var type = _a.type, parents = _a.parents, displayNamePrefix = _a.displayNamePrefix, max = _a.max, offset = _a.offset;
|
|
50
|
+
return getDependentLookups({ type: type, parents: parents, displayNamePrefix: displayNamePrefix, max: max, offset: offset }).then(function (_a) {
|
|
50
51
|
var codeValues = _a.codeValues;
|
|
51
52
|
return propOr({}, type, codeValues);
|
|
52
53
|
});
|
|
@@ -20,16 +20,17 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
23
|
+
import React, { useCallback, useRef, useState, useEffect, useMemo } from 'react';
|
|
24
24
|
import PropTypes from 'prop-types';
|
|
25
25
|
import { debounce, LookupValueType } from '@reltio/mdm-sdk';
|
|
26
|
-
import
|
|
27
|
-
import { defaultTo, either, isEmpty, prop } from 'ramda';
|
|
26
|
+
import Select from '../../ReactSelect/Select';
|
|
27
|
+
import { concat, defaultTo, either, isEmpty, prop } from 'ramda';
|
|
28
28
|
import { buildLookupOptions, getOptionLabel } from './helpers';
|
|
29
29
|
import i18n from 'ui-i18n';
|
|
30
30
|
import { EmptyStub } from '../../../core/utils';
|
|
31
31
|
import DropdownIndicator from '../../commonReactSelectComponents/DropdownIndicator';
|
|
32
32
|
import MenuWithPopper from '../../commonReactSelectComponents/MenuWithPopper';
|
|
33
|
+
import MenuList from '../../commonReactSelectComponents/MenuList';
|
|
33
34
|
import { useStyles } from './styles';
|
|
34
35
|
import useLookupsResolver from './useLookupsResolver';
|
|
35
36
|
import MultiValueChip from '../commonComponents/MultiValueChip/MultiValueChip';
|
|
@@ -37,15 +38,18 @@ import OptionWithCheckIcon from '../../commonReactSelectComponents/OptionWithChe
|
|
|
37
38
|
import useDefaultOptions from './useDefaultOptions';
|
|
38
39
|
import useAutopopulation from './useAutopopulation';
|
|
39
40
|
import useSavingFocus from './useSavingFocus';
|
|
41
|
+
import LoadMoreButton from '../../commonReactSelectComponents/LoadMoreButton';
|
|
40
42
|
var SelectComponents = {
|
|
41
43
|
IndicatorSeparator: EmptyStub,
|
|
42
44
|
LoadingIndicator: EmptyStub,
|
|
43
45
|
Option: OptionWithCheckIcon,
|
|
44
46
|
DropdownIndicator: DropdownIndicator,
|
|
45
47
|
Menu: MenuWithPopper,
|
|
48
|
+
MenuList: MenuList,
|
|
46
49
|
MultiValue: MultiValueChip
|
|
47
50
|
};
|
|
48
51
|
export var DEBOUNCE_INTERVAL = 400;
|
|
52
|
+
var MAX_DEPENDENT_LOOKUP_VALUES = 50;
|
|
49
53
|
var DependentLookupEditor = function (_a) {
|
|
50
54
|
var multiple = _a.multiple, value = _a.value, lookupTypeCode = _a.lookupCode, TextFieldProps = _a.TextFieldProps, parents = _a.parents, onChange = _a.onChange, getLookups = _a.getLookups, _b = _a.lookups, lookups = _b === void 0 ? {} : _b, resolveLookups = _a.resolveLookups, fullWidth = _a.fullWidth, disabled = _a.disabled, placeholder = _a.placeholder, autopopulationId = _a.autopopulationId, otherProps = __rest(_a, ["multiple", "value", "lookupCode", "TextFieldProps", "parents", "onChange", "getLookups", "lookups", "resolveLookups", "fullWidth", "disabled", "placeholder", "autopopulationId"]);
|
|
51
55
|
var inputRef = useRef(null);
|
|
@@ -59,16 +63,54 @@ var DependentLookupEditor = function (_a) {
|
|
|
59
63
|
});
|
|
60
64
|
useSavingFocus(selectRef, inputRef, disabled);
|
|
61
65
|
var _c = useState(''), inputValue = _c[0], setInputValue = _c[1];
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
var _d = useState([]), options = _d[0], setOptions = _d[1];
|
|
67
|
+
var _e = useState(1), pageNumber = _e[0], setPageNumber = _e[1];
|
|
68
|
+
var _f = useState(false), nextPageIsLoading = _f[0], setNextPageIsLoading = _f[1];
|
|
69
|
+
var handleInputChange = function (value) {
|
|
70
|
+
if (value !== inputValue) {
|
|
71
|
+
setInputValue(value);
|
|
72
|
+
setPageNumber(1);
|
|
73
|
+
debouncedLoadOptions(value, setOptions);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
var loadOptions = useCallback(function (value, pageNumber) {
|
|
77
|
+
if (pageNumber === void 0) { pageNumber = 1; }
|
|
78
|
+
return getLookups({
|
|
79
|
+
type: lookupTypeCode,
|
|
80
|
+
parents: parents,
|
|
81
|
+
displayNamePrefix: value,
|
|
82
|
+
max: MAX_DEPENDENT_LOOKUP_VALUES + 1,
|
|
83
|
+
offset: (pageNumber - 1) * MAX_DEPENDENT_LOOKUP_VALUES
|
|
84
|
+
}).then(function (buildOptions) { return buildLookupOptions(buildOptions); });
|
|
85
|
+
}, [lookupTypeCode, parents]);
|
|
86
|
+
var loadMoreOptions = useCallback(function () {
|
|
87
|
+
setNextPageIsLoading(true);
|
|
88
|
+
loadOptions(inputValue, pageNumber + 1)
|
|
89
|
+
.then(function (buildOptions) {
|
|
90
|
+
setOptions(function (options) {
|
|
91
|
+
return concat(options.slice(0, pageNumber * MAX_DEPENDENT_LOOKUP_VALUES), buildOptions);
|
|
92
|
+
});
|
|
93
|
+
setPageNumber(function (page) { return page + 1; });
|
|
94
|
+
})
|
|
95
|
+
.catch(function () { return []; })
|
|
96
|
+
.finally(function () { return setNextPageIsLoading(false); });
|
|
97
|
+
}, [loadOptions, inputValue, pageNumber]);
|
|
66
98
|
var debouncedLoadOptions = useCallback(debounce(function (value, callback) {
|
|
99
|
+
setNextPageIsLoading(true);
|
|
67
100
|
loadOptions(value)
|
|
68
101
|
.then(function (options) { return callback(options); })
|
|
69
|
-
.catch(function () { return callback([]); })
|
|
102
|
+
.catch(function () { return callback([]); })
|
|
103
|
+
.finally(function () { return setNextPageIsLoading(false); });
|
|
70
104
|
}, DEBOUNCE_INTERVAL), [loadOptions]);
|
|
71
|
-
var
|
|
105
|
+
var _g = useDefaultOptions(loadOptions), defaultOptions = _g.defaultOptions, initialDefaultOptions = _g.initialDefaultOptions, isLoadingDefaultOptions = _g.isLoading;
|
|
106
|
+
useEffect(function () {
|
|
107
|
+
setOptions(defaultOptions);
|
|
108
|
+
}, [defaultOptions]);
|
|
109
|
+
var displayedOptions = useMemo(function () { return options.slice(0, pageNumber * MAX_DEPENDENT_LOOKUP_VALUES); }, [
|
|
110
|
+
options,
|
|
111
|
+
pageNumber
|
|
112
|
+
]);
|
|
113
|
+
var showMoreButton = options.length > displayedOptions.length;
|
|
72
114
|
var isEmptyValue = multiple ? isEmpty(value) : !(value === null || value === void 0 ? void 0 : value.lookupCode) && !(value === null || value === void 0 ? void 0 : value.value);
|
|
73
115
|
var markAsTouched = useAutopopulation({
|
|
74
116
|
id: autopopulationId,
|
|
@@ -77,13 +119,13 @@ var DependentLookupEditor = function (_a) {
|
|
|
77
119
|
multiple: multiple,
|
|
78
120
|
onChange: onChange
|
|
79
121
|
}).markAsTouched;
|
|
80
|
-
return (React.createElement(
|
|
122
|
+
return (React.createElement(Select, __assign({}, otherProps, { isMulti: multiple, classes: styles, menuPortalTarget: document.body, menuPlacement: "auto", TextFieldProps: __assign(__assign({}, TextFieldProps), { ref: inputRef, disabled: (TextFieldProps === null || TextFieldProps === void 0 ? void 0 : TextFieldProps.disabled) || disabled }), inputRef: inputRef, innerRef: selectRef, styles: {
|
|
81
123
|
menuPortal: function (base) { return (__assign(__assign({}, base), { zIndex: 1300 })); },
|
|
82
124
|
container: function (base) { return (__assign(__assign({}, base), (fullWidth ? { width: '100%' } : {}))); }
|
|
83
|
-
}, loadingMessage: function () { return i18n.text('Loading...'); }, noOptionsMessage: function () { return i18n.text('No results found'); }, components: SelectComponents, isClearable: true, isSearchable: true, inputValue: inputValue, onInputChange:
|
|
125
|
+
}, loadingMessage: function () { return i18n.text('Loading...'); }, noOptionsMessage: function () { return i18n.text('No results found'); }, components: SelectComponents, isClearable: true, isSearchable: true, inputValue: inputValue, onInputChange: handleInputChange, isLoading: !inputValue && isLoadingDefaultOptions, hideSelectedOptions: false, placeholder: placeholder || '', isDisabled: disabled, options: displayedOptions, getOptionValue: either(prop('value'), prop('lookupCode')), getOptionLabel: getOptionLabel, onChange: function (value) {
|
|
84
126
|
markAsTouched();
|
|
85
127
|
onChange(value);
|
|
86
|
-
}, value: defaultTo(multiple ? [] : null, value) })));
|
|
128
|
+
}, value: defaultTo(multiple ? [] : null, value), menuListFooter: showMoreButton && React.createElement(LoadMoreButton, { loading: nextPageIsLoading, onClick: loadMoreOptions }) })));
|
|
87
129
|
};
|
|
88
130
|
DependentLookupEditor.propTypes = {
|
|
89
131
|
multiple: PropTypes.bool,
|
|
@@ -33,29 +33,52 @@ import MenuItem from '@material-ui/core/MenuItem';
|
|
|
33
33
|
import Paper from '@material-ui/core/Paper';
|
|
34
34
|
import Popper from '../../Popper/Popper';
|
|
35
35
|
import PropTypes from 'prop-types';
|
|
36
|
-
import React, { useCallback, useRef, useState } from 'react';
|
|
36
|
+
import React, { useCallback, useRef, useMemo, useState } from 'react';
|
|
37
37
|
import { NoResults } from '../../../components/EmptySearchResult';
|
|
38
|
-
import { always, andThen, both, defaultTo, F, identity, ifElse, isEmpty, nthArg, path, pipe, prop, propEq, remove, T, tap, trim, uniq } from 'ramda';
|
|
38
|
+
import { always, andThen, both, concat, defaultTo, F, identity, ifElse, isEmpty, nthArg, path, pipe, prop, propEq, remove, T, tap, trim, uniq } from 'ramda';
|
|
39
39
|
import { debounce, isEmptyValue } from '@reltio/mdm-sdk';
|
|
40
40
|
import { getValue } from '../../../core/utils';
|
|
41
41
|
import { useStyles } from './styles';
|
|
42
42
|
import ExpandedValueTooltip from '../../ExpandedValueTooltip/ExpandedValueTooltip';
|
|
43
43
|
import ValueChip from '../../ValueChip/ValueChip';
|
|
44
|
+
import LoadMoreButton from '../../commonReactSelectComponents/LoadMoreButton';
|
|
45
|
+
import { useDidUpdateEffect } from '../../../hooks';
|
|
44
46
|
var FETCH_DEBOUNCE_INTERVAL = 300;
|
|
47
|
+
var PAGE_SIZE = 50;
|
|
45
48
|
var TypeaheadEditor = function (_a) {
|
|
46
49
|
var value = _a.value, getSuggestions = _a.getSuggestions, onChange = _a.onChange, multiple = _a.multiple, fullWidth = _a.fullWidth, _b = _a.InputProps, InputProps = _b === void 0 ? {} : _b, inputProps = __rest(_a, ["value", "getSuggestions", "onChange", "multiple", "fullWidth", "InputProps"]);
|
|
47
50
|
var _c = useState([]), suggestions = _c[0], setSuggestions = _c[1];
|
|
48
51
|
var _d = useState(false), isPlaceholderVisible = _d[0], setPlaceholderVisibility = _d[1];
|
|
52
|
+
var _e = useState(1), pageNumber = _e[0], setPageNumber = _e[1];
|
|
53
|
+
var _f = useState(false), nextPageIsLoading = _f[0], setNextPageIsLoading = _f[1];
|
|
54
|
+
var pageSizeForRequest = PAGE_SIZE + 1;
|
|
55
|
+
var _g = useState(''), currentValue = _g[0], setCurrentValue = _g[1];
|
|
56
|
+
value = defaultTo(multiple ? [] : '', value);
|
|
57
|
+
var inputValue = multiple ? currentValue : value;
|
|
58
|
+
useDidUpdateEffect(function () {
|
|
59
|
+
setPageNumber(1);
|
|
60
|
+
}, [inputValue]);
|
|
49
61
|
var inputRef = useRef();
|
|
50
62
|
var styles = useStyles();
|
|
51
63
|
var isFocused = function () { var _a; return ((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === document.activeElement; };
|
|
52
|
-
var fetchSuggestions = pipe(prop('value'), trim, getSuggestions, andThen(pipe(tap(setSuggestions), both(isEmpty, isFocused), setPlaceholderVisibility)));
|
|
64
|
+
var fetchSuggestions = pipe(prop('value'), trim, function (value) { return getSuggestions(value, pageSizeForRequest); }, andThen(pipe(tap(setSuggestions), both(isEmpty, isFocused), setPlaceholderVisibility)));
|
|
65
|
+
var onLoadMoreSuggestions = function () {
|
|
66
|
+
setNextPageIsLoading(true);
|
|
67
|
+
getSuggestions(inputValue, pageSizeForRequest, pageNumber + 1)
|
|
68
|
+
.then(pipe(concat(suggestions), setSuggestions, always(pageNumber + 1), setPageNumber))
|
|
69
|
+
.finally(function () {
|
|
70
|
+
setNextPageIsLoading(false);
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
var onMouseDown = function (event) {
|
|
74
|
+
event.preventDefault();
|
|
75
|
+
};
|
|
53
76
|
var debouncedFetchSuggestions = useCallback(debounce(fetchSuggestions, FETCH_DEBOUNCE_INTERVAL), [
|
|
54
77
|
getSuggestions
|
|
55
78
|
]);
|
|
56
|
-
|
|
57
|
-
var
|
|
58
|
-
var
|
|
79
|
+
var displayedSuggestions = useMemo(function () { return suggestions.slice(0, pageNumber * PAGE_SIZE); }, [suggestions, pageNumber]);
|
|
80
|
+
var showMoreButton = suggestions.length > displayedSuggestions.length;
|
|
81
|
+
var _h = useState(false), hasHighlightedItem = _h[0], setHasHighlightedItem = _h[1];
|
|
59
82
|
var onInputChange = function (_a) {
|
|
60
83
|
var newValue = _a.newValue, method = _a.method;
|
|
61
84
|
switch (method) {
|
|
@@ -89,11 +112,11 @@ var TypeaheadEditor = function (_a) {
|
|
|
89
112
|
}
|
|
90
113
|
}
|
|
91
114
|
};
|
|
92
|
-
return (React.createElement(Autosuggest, { suggestions:
|
|
115
|
+
return (React.createElement(Autosuggest, { suggestions: displayedSuggestions, shouldRenderSuggestions: T, inputProps: __assign(__assign({ value: inputValue, onChange: pipe(nthArg(1), onInputChange), onKeyDown: function (event) {
|
|
93
116
|
if (event.keyCode === 13 && multiple && !hasHighlightedItem) {
|
|
94
117
|
onInputChange({ method: 'enter', newValue: currentValue });
|
|
95
118
|
}
|
|
96
|
-
}, fullWidth: fullWidth }, inputProps), { autoComplete: 'nope' }), getSuggestionValue: identity, onSuggestionsFetchRequested: ifElse(propEq('reason', 'input-changed'), debouncedFetchSuggestions, fetchSuggestions), onSuggestionsClearRequested: pipe(always([]), setSuggestions, F, setPlaceholderVisibility), renderInputComponent: function (_a) {
|
|
119
|
+
}, 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) {
|
|
97
120
|
var _b;
|
|
98
121
|
var ref = _a.ref, onInputChange = _a.onChange, otherProps = __rest(_a, ["ref", "onChange"]);
|
|
99
122
|
var commonClasses = {
|
|
@@ -104,7 +127,9 @@ var TypeaheadEditor = function (_a) {
|
|
|
104
127
|
}, renderSuggestionsContainer: function (_a) {
|
|
105
128
|
var children = _a.children, _b = _a.containerProps, ref = _b.ref, restContainerProps = __rest(_b, ["ref"]);
|
|
106
129
|
return (React.createElement(Popper, { anchorEl: inputRef.current, open: Boolean(children) || isPlaceholderVisible },
|
|
107
|
-
React.createElement(Paper, __assign({ ref: ref, square: true }, restContainerProps, { style: { width: prop('clientWidth', inputRef.current) } }),
|
|
130
|
+
React.createElement(Paper, __assign({ ref: ref, square: true }, restContainerProps, { style: { width: prop('clientWidth', inputRef.current) } }),
|
|
131
|
+
children || React.createElement(NoResults, { className: styles['typeahead__suggestions-placeholder'] }),
|
|
132
|
+
showMoreButton && !isPlaceholderVisible && (React.createElement(LoadMoreButton, { onClick: onLoadMoreSuggestions, onMouseDown: onMouseDown, loading: nextPageIsLoading })))));
|
|
108
133
|
}, renderSuggestion: function (suggestion, _a) {
|
|
109
134
|
var isHighlighted = _a.isHighlighted;
|
|
110
135
|
return (React.createElement(MenuItem, { className: styles['typeahead__suggestions-menuItem'], selected: isHighlighted, component: "div" },
|
|
@@ -9,5 +9,5 @@ declare const _default: React.ForwardRefExoticComponent<Pick<{
|
|
|
9
9
|
isCollapsed?: boolean;
|
|
10
10
|
showCollapseIcon?: boolean;
|
|
11
11
|
showLine?: boolean;
|
|
12
|
-
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "
|
|
12
|
+
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "offset" | "children" | "radius" | "order" | "method" | "width" | "height" | "in" | "format" | "key" | "attributeName" | "name" | "mode" | "attributeType" | "direction" | "path" | "from" | "to" | "end" | "clipPath" | "color" | "cursor" | "display" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "opacity" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "textDecoration" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "local" | "style" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "onScroll" | "className" | "y" | "d" | "origin" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "media" | "target" | "min" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "autoReverse" | "azimuth" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "orientation" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "isDashed" | "isCollapsed" | "showCollapseIcon" | "showLine"> & React.RefAttributes<unknown>>;
|
|
13
13
|
export default _default;
|
|
@@ -16,7 +16,7 @@ export declare const HistoryCircleWithTooltip: React.ForwardRefExoticComponent<i
|
|
|
16
16
|
isCollapsed?: boolean;
|
|
17
17
|
showCollapseIcon?: boolean;
|
|
18
18
|
showLine?: boolean;
|
|
19
|
-
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "
|
|
19
|
+
} & React.SVGProps<SVGGElement>, "string" | "visibility" | "type" | "values" | "filter" | "operator" | "id" | "max" | "offset" | "children" | "radius" | "order" | "method" | "width" | "height" | "in" | "format" | "key" | "attributeName" | "name" | "mode" | "attributeType" | "direction" | "path" | "from" | "to" | "end" | "clipPath" | "color" | "cursor" | "display" | "fontFamily" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontVariant" | "fontWeight" | "imageRendering" | "letterSpacing" | "opacity" | "overflow" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "textDecoration" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "local" | "style" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "onScroll" | "className" | "y" | "d" | "origin" | "lang" | "tabIndex" | "role" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "href" | "media" | "target" | "min" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "autoReverse" | "azimuth" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "elevation" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "numOctaves" | "orient" | "orientation" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "spacing" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewBox" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "x" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan" | "isDashed" | "isCollapsed" | "showCollapseIcon" | "showLine"> & React.RefAttributes<unknown>>;
|
|
20
20
|
declare type Props = {
|
|
21
21
|
graphData: HistoryData;
|
|
22
22
|
onHistoryCircleMouseOver?: (uri: string, timestamp: number, index: number) => void;
|
|
@@ -36,6 +36,8 @@ export { default as ColorBar } from './ColorBar/ColorBar';
|
|
|
36
36
|
export { default as CommentsContainer } from './CommentsContainer/CommentsContainer';
|
|
37
37
|
export { default as DropdownIndicator } from './commonReactSelectComponents/DropdownIndicator';
|
|
38
38
|
export { default as DropdownIndicatorWithIconButton } from './commonReactSelectComponents/DropdownIndicatorWithIconButton';
|
|
39
|
+
export { default as LoadMoreButton } from './commonReactSelectComponents/LoadMoreButton';
|
|
40
|
+
export { default as MenuList } from './commonReactSelectComponents/MenuList';
|
|
39
41
|
export { default as MenuWithPopper } from './commonReactSelectComponents/MenuWithPopper';
|
|
40
42
|
export { default as ConfigureColumnsPopup } from './ConfigureColumnsPopup/ConfigureColumnsPopup';
|
|
41
43
|
export { default as ConnectionRelationTypeSelector } from './ConnectionRelationTypeSelector/ConnectionRelationTypeSelector';
|
package/esm/components/index.js
CHANGED
|
@@ -36,6 +36,8 @@ export { default as ColorBar } from './ColorBar/ColorBar';
|
|
|
36
36
|
export { default as CommentsContainer } from './CommentsContainer/CommentsContainer';
|
|
37
37
|
export { default as DropdownIndicator } from './commonReactSelectComponents/DropdownIndicator';
|
|
38
38
|
export { default as DropdownIndicatorWithIconButton } from './commonReactSelectComponents/DropdownIndicatorWithIconButton';
|
|
39
|
+
export { default as LoadMoreButton } from './commonReactSelectComponents/LoadMoreButton';
|
|
40
|
+
export { default as MenuList } from './commonReactSelectComponents/MenuList';
|
|
39
41
|
export { default as MenuWithPopper } from './commonReactSelectComponents/MenuWithPopper';
|
|
40
42
|
export { default as ConfigureColumnsPopup } from './ConfigureColumnsPopup/ConfigureColumnsPopup';
|
|
41
43
|
export { default as ConnectionRelationTypeSelector } from './ConnectionRelationTypeSelector/ConnectionRelationTypeSelector';
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1198",
|
|
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.1198",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1198",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|