@reltio/components 1.4.1085 → 1.4.1086
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/attributes/PivotingAttributes/PivotingTooltipContent.d.ts +1 -2
- package/cjs/components/attributes/PivotingAttributes/PivotingTooltipContent.js +1 -2
- package/cjs/components/attributes/PivotingAttributes/helpers.d.ts +1 -5
- package/cjs/components/attributes/PivotingAttributes/helpers.js +1 -54
- package/cjs/contexts/SearchFiltersContext/index.d.ts +3 -0
- package/cjs/contexts/SearchFiltersContext/index.js +9 -0
- package/cjs/contexts/index.d.ts +1 -0
- package/cjs/contexts/index.js +3 -1
- package/esm/components/attributes/PivotingAttributes/PivotingTooltipContent.d.ts +1 -2
- package/esm/components/attributes/PivotingAttributes/PivotingTooltipContent.js +2 -3
- package/esm/components/attributes/PivotingAttributes/helpers.d.ts +1 -5
- package/esm/components/attributes/PivotingAttributes/helpers.js +1 -53
- package/esm/contexts/SearchFiltersContext/index.d.ts +3 -0
- package/esm/contexts/SearchFiltersContext/index.js +3 -0
- package/esm/contexts/index.d.ts +1 -0
- package/esm/contexts/index.js +1 -0
- package/package.json +4 -4
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AttributeType, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
3
|
-
import { PivotingValue } from './helpers';
|
|
2
|
+
import { AttributeType, PrimitiveValue, PivotingValue } from '@reltio/mdm-sdk';
|
|
4
3
|
export declare type Props = {
|
|
5
4
|
value: PivotingValue[] | PrimitiveValue;
|
|
6
5
|
attributeType: AttributeType;
|
|
@@ -41,7 +41,6 @@ var mdm_module_1 = __importDefault(require("@reltio/mdm-module"));
|
|
|
41
41
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
42
42
|
var EntityAvatar_1 = __importDefault(require("../../EntityAvatar/EntityAvatar"));
|
|
43
43
|
var EntityUriLink_1 = __importDefault(require("../../EntityUriLink/EntityUriLink"));
|
|
44
|
-
var helpers_1 = require("./helpers");
|
|
45
44
|
var hooks_1 = require("../../../hooks");
|
|
46
45
|
var styles_1 = require("./styles");
|
|
47
46
|
var MAX_ENTITIES_PIVOTING_TOOLTIP = 6;
|
|
@@ -56,7 +55,7 @@ var PivotingTooltipContent = function (_a) {
|
|
|
56
55
|
var entityType = config.entityType || entity.type;
|
|
57
56
|
var shouldShowSeeAllButton = total > MAX_ENTITIES_PIVOTING_TOOLTIP;
|
|
58
57
|
react_1.useEffect(function () {
|
|
59
|
-
var filters =
|
|
58
|
+
var filters = mdm_sdk_1.convertPivotingValueToSearchFilters({ value: value, attributeType: attributeType, entityType: entityType });
|
|
60
59
|
var options = __assign({ max: MAX_ENTITIES_PIVOTING_TOOLTIP }, globalSearchRequestOptions);
|
|
61
60
|
safePromise(Promise.all([mdm_sdk_1.getFilteredEntities(filters, options), mdm_sdk_1.getTotals(filters, options)]))
|
|
62
61
|
.then(function (results) {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { AttributeType,
|
|
2
|
-
export declare type PivotingValue = {
|
|
3
|
-
[uri: string]: string[] | PivotingValue[];
|
|
4
|
-
};
|
|
5
|
-
export declare const getParamsFilteringEntities: (values: PrimitiveValue | PivotingValue[], attributeType: AttributeType, entityType?: string) => SearchFilter[];
|
|
1
|
+
import { AttributeType, Metadata, PivotingAttribute, RecordAttributesType, PrimitiveValue, PivotingValue } from '@reltio/mdm-sdk';
|
|
6
2
|
export declare const generatePivotingValue: (attributeType: AttributeType, value: RecordAttributesType, pivotingAttributes: PivotingAttribute[], metadata: Metadata) => PivotingValue[];
|
|
7
3
|
export declare const convertSimpleAttributePivotingValue: (attrType: AttributeType, value: PrimitiveValue) => {
|
|
8
4
|
[x: string]: PrimitiveValue;
|
|
@@ -1,60 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.preparePivotingAttributeValue = exports.convertNestedAttributePivotingValue = exports.convertSimpleAttributePivotingValue = exports.generatePivotingValue =
|
|
3
|
+
exports.preparePivotingAttributeValue = exports.convertNestedAttributePivotingValue = exports.convertSimpleAttributePivotingValue = exports.generatePivotingValue = void 0;
|
|
4
4
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
5
|
-
var ramda_1 = require("ramda");
|
|
6
|
-
var getParamsFilteringEntities = function (values, attributeType, entityType) {
|
|
7
|
-
if (entityType === void 0) { entityType = ''; }
|
|
8
|
-
var params = [
|
|
9
|
-
{
|
|
10
|
-
fieldName: 'type',
|
|
11
|
-
filter: 'equals',
|
|
12
|
-
values: [entityType]
|
|
13
|
-
}
|
|
14
|
-
];
|
|
15
|
-
if (Array.isArray(values)) {
|
|
16
|
-
params = params.concat(getParamsFilteringNested(attributeType, values));
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
params.push(createSearchParameter([values], attributeType));
|
|
20
|
-
}
|
|
21
|
-
return params;
|
|
22
|
-
};
|
|
23
|
-
exports.getParamsFilteringEntities = getParamsFilteringEntities;
|
|
24
|
-
var getParamsFilteringNested = function (attributeType, values) {
|
|
25
|
-
var attributeSource = mdm_sdk_1.getAttributeSource(attributeType);
|
|
26
|
-
return values.reduce(function (acc, value) {
|
|
27
|
-
var _loop_1 = function (uri) {
|
|
28
|
-
var attrType = (attributeType[attributeSource] || []).find(function (attribute) { return attribute.uri === uri; });
|
|
29
|
-
if (Array.isArray(value[uri]) && typeof value[uri][0] === 'object') {
|
|
30
|
-
acc = (acc || []).concat(getParamsFilteringNested(attrType, value[uri]));
|
|
31
|
-
return { value: acc };
|
|
32
|
-
}
|
|
33
|
-
acc.push(createSearchParameter(value[uri], attrType));
|
|
34
|
-
return { value: acc };
|
|
35
|
-
};
|
|
36
|
-
for (var uri in value) {
|
|
37
|
-
var state_1 = _loop_1(uri);
|
|
38
|
-
if (typeof state_1 === "object")
|
|
39
|
-
return state_1.value;
|
|
40
|
-
}
|
|
41
|
-
}, []);
|
|
42
|
-
};
|
|
43
|
-
var createSearchParameter = function (value, attributeType) {
|
|
44
|
-
if (value && value.length && !ramda_1.isNil(value[0]) && value[0] !== '') {
|
|
45
|
-
return {
|
|
46
|
-
fieldName: mdm_sdk_1.attributeUriToSearchUri(attributeType.uri),
|
|
47
|
-
filter: attributeType.type === mdm_sdk_1.DataTypes.TYPE_BLOB ? mdm_sdk_1.FilterOptions.FULL_TEXT : mdm_sdk_1.FilterOptions.EQUALS,
|
|
48
|
-
values: value
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
return {
|
|
53
|
-
fieldName: mdm_sdk_1.attributeUriToSearchUri(attributeType.uri),
|
|
54
|
-
filter: 'missing'
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
5
|
var getPivotingChildrenUris = function (attributeType, pivotingAttributes) {
|
|
59
6
|
var pivotingAttribute = pivotingAttributes.find(function (attribute) {
|
|
60
7
|
return attribute.uri === attributeType.uri;
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
exports.SearchFiltersContext = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
exports.SearchFiltersContext = react_1.default.createContext([]);
|
|
9
|
+
exports.SearchFiltersContext.displayName = 'SearchFiltersContext';
|
package/cjs/contexts/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { WorkflowTasksContext } from './WorkflowTasksContext';
|
|
|
16
16
|
export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
|
|
17
17
|
export { EntityContext } from './EntityContext';
|
|
18
18
|
export { useReloadAllFacets, ReloadFacetProvider, useReloadFacet } from './ReloadFacetContext';
|
|
19
|
+
export { SearchFiltersContext } from './SearchFiltersContext';
|
package/cjs/contexts/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
|
|
3
|
+
exports.SearchFiltersContext = exports.useReloadFacet = exports.ReloadFacetProvider = exports.useReloadAllFacets = exports.EntityContext = exports.RelatedObjectUrisContext = exports.WorkflowTasksContext = exports.EntityMarkerContext = exports.useAttributeExpanded = exports.ExpandedAttributesProvider = exports.useHighlightedCrosswalks = exports.useCrosswalkHighlight = exports.useCrosswalkFocus = exports.useCrosswalkColor = exports.CrosswalksDisplayProvider = exports.EntitiesMapContext = exports.IdContext = exports.ProfilePerspectiveViewContext = exports.PivotingAttributeContext = exports.UsersContext = exports.CollaborationContext = exports.BlockImageGalleryDialogContext = exports.ViewIdContext = exports.PopupBoundariesContext = exports.HistoryDiffContext = exports.AsyncMountContext = void 0;
|
|
4
4
|
var AsyncMountContext_1 = require("./AsyncMountContext");
|
|
5
5
|
Object.defineProperty(exports, "AsyncMountContext", { enumerable: true, get: function () { return AsyncMountContext_1.AsyncMountContext; } });
|
|
6
6
|
var HistoryAppearanceContext_1 = require("./HistoryAppearanceContext");
|
|
@@ -44,3 +44,5 @@ var ReloadFacetContext_1 = require("./ReloadFacetContext");
|
|
|
44
44
|
Object.defineProperty(exports, "useReloadAllFacets", { enumerable: true, get: function () { return ReloadFacetContext_1.useReloadAllFacets; } });
|
|
45
45
|
Object.defineProperty(exports, "ReloadFacetProvider", { enumerable: true, get: function () { return ReloadFacetContext_1.ReloadFacetProvider; } });
|
|
46
46
|
Object.defineProperty(exports, "useReloadFacet", { enumerable: true, get: function () { return ReloadFacetContext_1.useReloadFacet; } });
|
|
47
|
+
var SearchFiltersContext_1 = require("./SearchFiltersContext");
|
|
48
|
+
Object.defineProperty(exports, "SearchFiltersContext", { enumerable: true, get: function () { return SearchFiltersContext_1.SearchFiltersContext; } });
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AttributeType, PrimitiveValue } from '@reltio/mdm-sdk';
|
|
3
|
-
import { PivotingValue } from './helpers';
|
|
2
|
+
import { AttributeType, PrimitiveValue, PivotingValue } from '@reltio/mdm-sdk';
|
|
4
3
|
export declare type Props = {
|
|
5
4
|
value: PivotingValue[] | PrimitiveValue;
|
|
6
5
|
attributeType: AttributeType;
|
|
@@ -13,10 +13,9 @@ import React, { useEffect, useState } from 'react';
|
|
|
13
13
|
import { useSelector } from 'react-redux';
|
|
14
14
|
import i18n from 'ui-i18n';
|
|
15
15
|
import mdm from '@reltio/mdm-module';
|
|
16
|
-
import { getEntityUriForLink, getFilteredEntities, getLabel, getTotals } from '@reltio/mdm-sdk';
|
|
16
|
+
import { getEntityUriForLink, getFilteredEntities, getLabel, getTotals, convertPivotingValueToSearchFilters } from '@reltio/mdm-sdk';
|
|
17
17
|
import EntityAvatar from '../../EntityAvatar/EntityAvatar';
|
|
18
18
|
import EntityUriLink from '../../EntityUriLink/EntityUriLink';
|
|
19
|
-
import { getParamsFilteringEntities } from './helpers';
|
|
20
19
|
import { useSafePromise } from '../../../hooks';
|
|
21
20
|
import { useStyles } from './styles';
|
|
22
21
|
var MAX_ENTITIES_PIVOTING_TOOLTIP = 6;
|
|
@@ -31,7 +30,7 @@ export var PivotingTooltipContent = function (_a) {
|
|
|
31
30
|
var entityType = config.entityType || entity.type;
|
|
32
31
|
var shouldShowSeeAllButton = total > MAX_ENTITIES_PIVOTING_TOOLTIP;
|
|
33
32
|
useEffect(function () {
|
|
34
|
-
var filters =
|
|
33
|
+
var filters = convertPivotingValueToSearchFilters({ value: value, attributeType: attributeType, entityType: entityType });
|
|
35
34
|
var options = __assign({ max: MAX_ENTITIES_PIVOTING_TOOLTIP }, globalSearchRequestOptions);
|
|
36
35
|
safePromise(Promise.all([getFilteredEntities(filters, options), getTotals(filters, options)]))
|
|
37
36
|
.then(function (results) {
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { AttributeType,
|
|
2
|
-
export declare type PivotingValue = {
|
|
3
|
-
[uri: string]: string[] | PivotingValue[];
|
|
4
|
-
};
|
|
5
|
-
export declare const getParamsFilteringEntities: (values: PrimitiveValue | PivotingValue[], attributeType: AttributeType, entityType?: string) => SearchFilter[];
|
|
1
|
+
import { AttributeType, Metadata, PivotingAttribute, RecordAttributesType, PrimitiveValue, PivotingValue } from '@reltio/mdm-sdk';
|
|
6
2
|
export declare const generatePivotingValue: (attributeType: AttributeType, value: RecordAttributesType, pivotingAttributes: PivotingAttribute[], metadata: Metadata) => PivotingValue[];
|
|
7
3
|
export declare const convertSimpleAttributePivotingValue: (attrType: AttributeType, value: PrimitiveValue) => {
|
|
8
4
|
[x: string]: PrimitiveValue;
|
|
@@ -1,56 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isNil } from 'ramda';
|
|
3
|
-
export var getParamsFilteringEntities = function (values, attributeType, entityType) {
|
|
4
|
-
if (entityType === void 0) { entityType = ''; }
|
|
5
|
-
var params = [
|
|
6
|
-
{
|
|
7
|
-
fieldName: 'type',
|
|
8
|
-
filter: 'equals',
|
|
9
|
-
values: [entityType]
|
|
10
|
-
}
|
|
11
|
-
];
|
|
12
|
-
if (Array.isArray(values)) {
|
|
13
|
-
params = params.concat(getParamsFilteringNested(attributeType, values));
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
params.push(createSearchParameter([values], attributeType));
|
|
17
|
-
}
|
|
18
|
-
return params;
|
|
19
|
-
};
|
|
20
|
-
var getParamsFilteringNested = function (attributeType, values) {
|
|
21
|
-
var attributeSource = getAttributeSource(attributeType);
|
|
22
|
-
return values.reduce(function (acc, value) {
|
|
23
|
-
var _loop_1 = function (uri) {
|
|
24
|
-
var attrType = (attributeType[attributeSource] || []).find(function (attribute) { return attribute.uri === uri; });
|
|
25
|
-
if (Array.isArray(value[uri]) && typeof value[uri][0] === 'object') {
|
|
26
|
-
acc = (acc || []).concat(getParamsFilteringNested(attrType, value[uri]));
|
|
27
|
-
return { value: acc };
|
|
28
|
-
}
|
|
29
|
-
acc.push(createSearchParameter(value[uri], attrType));
|
|
30
|
-
return { value: acc };
|
|
31
|
-
};
|
|
32
|
-
for (var uri in value) {
|
|
33
|
-
var state_1 = _loop_1(uri);
|
|
34
|
-
if (typeof state_1 === "object")
|
|
35
|
-
return state_1.value;
|
|
36
|
-
}
|
|
37
|
-
}, []);
|
|
38
|
-
};
|
|
39
|
-
var createSearchParameter = function (value, attributeType) {
|
|
40
|
-
if (value && value.length && !isNil(value[0]) && value[0] !== '') {
|
|
41
|
-
return {
|
|
42
|
-
fieldName: attributeUriToSearchUri(attributeType.uri),
|
|
43
|
-
filter: attributeType.type === DataTypes.TYPE_BLOB ? FilterOptions.FULL_TEXT : FilterOptions.EQUALS,
|
|
44
|
-
values: value
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
return {
|
|
49
|
-
fieldName: attributeUriToSearchUri(attributeType.uri),
|
|
50
|
-
filter: 'missing'
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
};
|
|
1
|
+
import { DataTypes, findAttributeTypeByUri, isOv, getLastUriPart } from '@reltio/mdm-sdk';
|
|
54
2
|
var getPivotingChildrenUris = function (attributeType, pivotingAttributes) {
|
|
55
3
|
var pivotingAttribute = pivotingAttributes.find(function (attribute) {
|
|
56
4
|
return attribute.uri === attributeType.uri;
|
package/esm/contexts/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { WorkflowTasksContext } from './WorkflowTasksContext';
|
|
|
16
16
|
export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
|
|
17
17
|
export { EntityContext } from './EntityContext';
|
|
18
18
|
export { useReloadAllFacets, ReloadFacetProvider, useReloadFacet } from './ReloadFacetContext';
|
|
19
|
+
export { SearchFiltersContext } from './SearchFiltersContext';
|
package/esm/contexts/index.js
CHANGED
|
@@ -16,3 +16,4 @@ export { WorkflowTasksContext } from './WorkflowTasksContext';
|
|
|
16
16
|
export { RelatedObjectUrisContext } from './RelatedObjectUrisContext';
|
|
17
17
|
export { EntityContext } from './EntityContext';
|
|
18
18
|
export { useReloadAllFacets, ReloadFacetProvider, useReloadFacet } from './ReloadFacetContext';
|
|
19
|
+
export { SearchFiltersContext } from './SearchFiltersContext';
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1086",
|
|
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.1086",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1086",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"react-grid-layout": "^1.1.1",
|
|
26
26
|
"react-input-autosize": "^2.2.2",
|
|
27
27
|
"react-lifecycles-compat": "^3.0.4",
|
|
28
|
-
"react-mentions": "
|
|
28
|
+
"react-mentions": "4.3.0",
|
|
29
29
|
"react-number-format": "^4.3.0",
|
|
30
30
|
"react-redux": "^7.2.3",
|
|
31
31
|
"react-resize-detector": "^4.2.0",
|