@reltio/components 1.4.1808 → 1.4.1810
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.
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AttributeError, AttributeType } from '@reltio/mdm-sdk';
|
|
2
3
|
export declare enum ScrollType {
|
|
3
4
|
Error = "Error",
|
|
4
|
-
NewAttribute = "NewAttribute"
|
|
5
|
+
NewAttribute = "NewAttribute",
|
|
6
|
+
NewView = "NewView"
|
|
5
7
|
}
|
|
6
8
|
type ScrollToElementContextProps = {
|
|
7
9
|
element: unknown;
|
|
8
10
|
type: ScrollType;
|
|
9
|
-
highlightError?: (element:
|
|
10
|
-
highlightAttribute?: (element:
|
|
11
|
-
|
|
11
|
+
highlightError?: (element: AttributeError) => void;
|
|
12
|
+
highlightAttribute?: (element: AttributeType) => void;
|
|
13
|
+
highlightView?: (element: string) => void;
|
|
14
|
+
scrollIntoRef: (ref: React.Ref<HTMLDivElement>) => void;
|
|
12
15
|
};
|
|
13
16
|
export declare const isHighlightedErrorType: (type: ScrollType) => boolean;
|
|
14
17
|
export declare const isHighlightedAttributeType: (type: ScrollType) => boolean;
|
|
@@ -30,6 +30,7 @@ var ScrollType;
|
|
|
30
30
|
(function (ScrollType) {
|
|
31
31
|
ScrollType["Error"] = "Error";
|
|
32
32
|
ScrollType["NewAttribute"] = "NewAttribute";
|
|
33
|
+
ScrollType["NewView"] = "NewView";
|
|
33
34
|
})(ScrollType || (exports.ScrollType = ScrollType = {}));
|
|
34
35
|
var isHighlightedErrorType = function (type) { return type === ScrollType.Error; };
|
|
35
36
|
exports.isHighlightedErrorType = isHighlightedErrorType;
|
|
@@ -38,6 +39,7 @@ exports.isHighlightedAttributeType = isHighlightedAttributeType;
|
|
|
38
39
|
exports.ScrollToElementContext = react_1.default.createContext({
|
|
39
40
|
element: null,
|
|
40
41
|
type: null,
|
|
42
|
+
highlightView: core_1.noop,
|
|
41
43
|
highlightError: core_1.noop,
|
|
42
44
|
highlightAttribute: core_1.noop,
|
|
43
45
|
scrollIntoRef: core_1.noop
|
|
@@ -59,12 +61,16 @@ var ScrollToElementProvider = function (_a) {
|
|
|
59
61
|
var handleHighlightAttribute = (0, react_1.useCallback)(function (highlightedAttribute) {
|
|
60
62
|
setTimeout(function () { return setElement({ value: highlightedAttribute, type: ScrollType.NewAttribute }); }, 300);
|
|
61
63
|
}, []);
|
|
64
|
+
var handleHighlightView = (0, react_1.useCallback)(function (value) {
|
|
65
|
+
setElement({ value: value, type: ScrollType.NewView });
|
|
66
|
+
}, []);
|
|
62
67
|
var contextValue = (0, react_1.useMemo)(function () { return ({
|
|
63
68
|
element: element === null || element === void 0 ? void 0 : element.value,
|
|
69
|
+
type: element === null || element === void 0 ? void 0 : element.type,
|
|
70
|
+
highlightView: handleHighlightView,
|
|
64
71
|
highlightError: handleHighlightError,
|
|
65
72
|
highlightAttribute: handleHighlightAttribute,
|
|
66
|
-
scrollIntoRef: scrollIntoRef
|
|
67
|
-
type: element === null || element === void 0 ? void 0 : element.type
|
|
73
|
+
scrollIntoRef: scrollIntoRef
|
|
68
74
|
}); }, [element, scrollIntoRef]);
|
|
69
75
|
return react_1.default.createElement(exports.ScrollToElementContext.Provider, { value: contextValue }, children);
|
|
70
76
|
};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { AttributeError, AttributeType } from '@reltio/mdm-sdk';
|
|
2
3
|
export declare enum ScrollType {
|
|
3
4
|
Error = "Error",
|
|
4
|
-
NewAttribute = "NewAttribute"
|
|
5
|
+
NewAttribute = "NewAttribute",
|
|
6
|
+
NewView = "NewView"
|
|
5
7
|
}
|
|
6
8
|
type ScrollToElementContextProps = {
|
|
7
9
|
element: unknown;
|
|
8
10
|
type: ScrollType;
|
|
9
|
-
highlightError?: (element:
|
|
10
|
-
highlightAttribute?: (element:
|
|
11
|
-
|
|
11
|
+
highlightError?: (element: AttributeError) => void;
|
|
12
|
+
highlightAttribute?: (element: AttributeType) => void;
|
|
13
|
+
highlightView?: (element: string) => void;
|
|
14
|
+
scrollIntoRef: (ref: React.Ref<HTMLDivElement>) => void;
|
|
12
15
|
};
|
|
13
16
|
export declare const isHighlightedErrorType: (type: ScrollType) => boolean;
|
|
14
17
|
export declare const isHighlightedAttributeType: (type: ScrollType) => boolean;
|
|
@@ -4,12 +4,14 @@ export var ScrollType;
|
|
|
4
4
|
(function (ScrollType) {
|
|
5
5
|
ScrollType["Error"] = "Error";
|
|
6
6
|
ScrollType["NewAttribute"] = "NewAttribute";
|
|
7
|
+
ScrollType["NewView"] = "NewView";
|
|
7
8
|
})(ScrollType || (ScrollType = {}));
|
|
8
9
|
export var isHighlightedErrorType = function (type) { return type === ScrollType.Error; };
|
|
9
10
|
export var isHighlightedAttributeType = function (type) { return type === ScrollType.NewAttribute; };
|
|
10
11
|
export var ScrollToElementContext = React.createContext({
|
|
11
12
|
element: null,
|
|
12
13
|
type: null,
|
|
14
|
+
highlightView: noop,
|
|
13
15
|
highlightError: noop,
|
|
14
16
|
highlightAttribute: noop,
|
|
15
17
|
scrollIntoRef: noop
|
|
@@ -31,12 +33,16 @@ export var ScrollToElementProvider = function (_a) {
|
|
|
31
33
|
var handleHighlightAttribute = useCallback(function (highlightedAttribute) {
|
|
32
34
|
setTimeout(function () { return setElement({ value: highlightedAttribute, type: ScrollType.NewAttribute }); }, 300);
|
|
33
35
|
}, []);
|
|
36
|
+
var handleHighlightView = useCallback(function (value) {
|
|
37
|
+
setElement({ value: value, type: ScrollType.NewView });
|
|
38
|
+
}, []);
|
|
34
39
|
var contextValue = useMemo(function () { return ({
|
|
35
40
|
element: element === null || element === void 0 ? void 0 : element.value,
|
|
41
|
+
type: element === null || element === void 0 ? void 0 : element.type,
|
|
42
|
+
highlightView: handleHighlightView,
|
|
36
43
|
highlightError: handleHighlightError,
|
|
37
44
|
highlightAttribute: handleHighlightAttribute,
|
|
38
|
-
scrollIntoRef: scrollIntoRef
|
|
39
|
-
type: element === null || element === void 0 ? void 0 : element.type
|
|
45
|
+
scrollIntoRef: scrollIntoRef
|
|
40
46
|
}); }, [element, scrollIntoRef]);
|
|
41
47
|
return React.createElement(ScrollToElementContext.Provider, { value: contextValue }, children);
|
|
42
48
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1810",
|
|
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
|
"@fluentui/react-context-selector": "^9.1.26",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-sdk": "^1.4.1771",
|
|
11
11
|
"classnames": "^2.2.5",
|
|
12
12
|
"d3-cloud": "^1.2.5",
|
|
13
13
|
"d3-geo": "^2.0.1",
|