@reltio/components 1.4.2227 → 1.4.2228

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  2. package/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  3. package/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  4. package/SimpleAttribute/SimpleAttribute.js +15 -7
  5. package/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  6. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.d.ts +9 -1
  7. package/cjs/ReadOnlyAttributeValuesBlock/ReadOnlyAttributeValuesBlock.js +3 -3
  8. package/cjs/SimpleAttribute/SimpleAttribute.d.ts +5 -2
  9. package/cjs/SimpleAttribute/SimpleAttribute.js +19 -11
  10. package/cjs/SimpleAttribute/SimpleAttribute.module.css.js +9 -0
  11. package/cjs/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
  12. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
  13. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test-data.js +51 -21
  14. package/cjs/features/crosswalks/AttributesTable/AttributesTable.test.js +56 -0
  15. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
  16. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +31 -0
  17. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
  18. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
  19. package/cjs/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +5 -0
  20. package/cjs/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
  21. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
  22. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
  23. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
  24. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
  25. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
  26. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +15 -0
  27. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
  28. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +53 -0
  29. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
  30. package/cjs/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +7 -0
  31. package/cjs/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
  32. package/cjs/features/crosswalks/AttributesTable/helpers.js +96 -17
  33. package/cjs/features/crosswalks/AttributesTable/helpers.test.js +499 -50
  34. package/cjs/features/crosswalks/AttributesTable/types.d.ts +17 -3
  35. package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
  36. package/cjs/features/crosswalks/contexts/SyncedValueHeightsContext.js +66 -0
  37. package/features/crosswalks/AttributesTable/AttributesTable.js +3 -1
  38. package/features/crosswalks/AttributesTable/AttributesTable.test-data.d.ts +4 -1
  39. package/features/crosswalks/AttributesTable/AttributesTable.test-data.js +49 -20
  40. package/features/crosswalks/AttributesTable/AttributesTable.test.js +58 -2
  41. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.d.ts +7 -0
  42. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.js +24 -0
  43. package/features/crosswalks/AttributesTable/components/FallbackIndicator/FallbackIndicator.module.css.js +9 -0
  44. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.d.ts +1 -0
  45. package/features/crosswalks/AttributesTable/components/FallbackIndicator/index.js +1 -0
  46. package/features/crosswalks/AttributesTable/components/OvValuesRenderer/OvValuesRenderer.js +3 -1
  47. package/features/crosswalks/AttributesTable/components/RuleTypeInfoButton/RuleTypeInfoButton.js +1 -1
  48. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.d.ts +1 -1
  49. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.js +65 -11
  50. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/RuleTypeRenderer.module.css.js +9 -0
  51. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.d.ts +7 -0
  52. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightConsumer.js +8 -0
  53. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.d.ts +7 -0
  54. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/ValueHeightReporter.js +23 -0
  55. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.d.ts +2 -0
  56. package/features/crosswalks/AttributesTable/components/SyncedValueHeight/index.js +2 -0
  57. package/features/crosswalks/AttributesTable/helpers.d.ts +4 -2
  58. package/features/crosswalks/AttributesTable/helpers.js +95 -18
  59. package/features/crosswalks/AttributesTable/helpers.test.js +501 -52
  60. package/features/crosswalks/AttributesTable/types.d.ts +17 -3
  61. package/features/crosswalks/contexts/SyncedValueHeightsContext.d.ts +11 -0
  62. package/features/crosswalks/contexts/SyncedValueHeightsContext.js +38 -0
  63. package/package.json +2 -2
  64. package/SimpleAttribute/styles.d.ts +0 -1
  65. package/SimpleAttribute/styles.js +0 -42
  66. package/cjs/SimpleAttribute/styles.d.ts +0 -1
  67. package/cjs/SimpleAttribute/styles.js +0 -45
  68. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  69. package/cjs/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -13
  70. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.d.ts +0 -1
  71. package/features/crosswalks/AttributesTable/components/RuleTypeRenderer/styles.js +0 -10
@@ -1,14 +1,28 @@
1
1
  import React from 'react';
2
- import { AttributeType, AttributeValue, Crosswalk, SurvivorStrategy } from '@reltio/mdm-sdk';
2
+ import { AttributeType, AttributeValue, Crosswalk, ParticipationStatus, SurvivorStrategy } from '@reltio/mdm-sdk';
3
3
  import { AddInlineAttributeEvent, DeleteInlineAttributeEvent, EditInlineAttributeEvent, IgnoreInlineAttributeEvent, PinInlineAttributeEvent } from '../../../types/inlineAttributes';
4
4
  import { ColumnData, RenderRowCellProps } from '../../../types/basicTable';
5
5
  import { CrosswalksMap } from '../../../types';
6
- export type RuleTypeValues = {
7
- ruleType: SurvivorStrategy;
6
+ export type StrategyAdditionalFields = {
8
7
  primaryAttributeUri?: string;
9
8
  comparisonAttributeUri?: string;
10
9
  sourcesUriOrder?: string[];
11
10
  };
11
+ export type AppliedSurvivorshipStrategy = {
12
+ strategy: SurvivorStrategy;
13
+ } & StrategyAdditionalFields;
14
+ export type RuleTypeItem = {
15
+ type: 'rule';
16
+ data: AppliedSurvivorshipStrategy;
17
+ valueUri: string;
18
+ } | {
19
+ type: 'status';
20
+ data: ParticipationStatus;
21
+ valueUri: string;
22
+ };
23
+ export type RuleTypeValues = {
24
+ ruleTypes: RuleTypeItem[];
25
+ };
12
26
  export type OvValues = {
13
27
  attributeType: AttributeType;
14
28
  values: AttributeValue[];
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ type Props = {
3
+ reportHeight: (uri: string, height: number) => void;
4
+ getHeight: (key: string) => number | undefined;
5
+ clear: () => void;
6
+ };
7
+ export declare const SyncedValueHeightsProvider: ({ children }: {
8
+ children: React.ReactNode;
9
+ }) => React.JSX.Element;
10
+ export declare const useSyncedValueHeights: () => Props;
11
+ export {};
@@ -0,0 +1,38 @@
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, { createContext, useCallback, useContext, useMemo, useState } from 'react';
13
+ var SyncedValueHeightsContext = createContext(null);
14
+ export var SyncedValueHeightsProvider = function (_a) {
15
+ var children = _a.children;
16
+ var _b = useState({}), heights = _b[0], setHeights = _b[1];
17
+ var reportHeight = useCallback(function (uri, height) {
18
+ if (!uri || !height || heights[uri] === height)
19
+ return;
20
+ setHeights(function (prev) {
21
+ var _a;
22
+ return (__assign(__assign({}, prev), (_a = {}, _a[uri] = height, _a)));
23
+ });
24
+ }, [heights]);
25
+ var getHeight = useCallback(function (uri) { return (uri ? heights[uri] : 0); }, [heights]);
26
+ var clear = useCallback(function () {
27
+ setHeights({});
28
+ }, []);
29
+ var value = useMemo(function () { return ({ reportHeight: reportHeight, getHeight: getHeight, clear: clear }); }, [reportHeight, getHeight, clear]);
30
+ return React.createElement(SyncedValueHeightsContext.Provider, { value: value }, children);
31
+ };
32
+ export var useSyncedValueHeights = function () {
33
+ var context = useContext(SyncedValueHeightsContext);
34
+ if (!context) {
35
+ throw new Error('useSyncedValueHeights must be used within SyncedValueHeightsProvider');
36
+ }
37
+ return context;
38
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.2227",
3
+ "version": "1.4.2228",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -11,7 +11,7 @@
11
11
  "@fluentui/react-context-selector": "^9.1.26",
12
12
  "@googlemaps/markerclusterer": "^2.5.3",
13
13
  "@react-sigma/core": "3.4.0",
14
- "@reltio/mdm-sdk": "^1.4.2021",
14
+ "@reltio/mdm-sdk": "^1.4.2022",
15
15
  "@vis.gl/react-google-maps": "^1.3.0",
16
16
  "d3-cloud": "^1.2.5",
17
17
  "d3-geo": "^2.0.1",
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"root" | "attributeValue" | "insertAttribute" | "updateAttribute" | "deleteAttribute" | "commentsContainer" | "multilineAttribute" | "ovFalse">;
@@ -1,42 +0,0 @@
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 { makeStyles } from '@mui/styles';
13
- import { HistoryOperations, historyPalettes } from '@reltio/mdm-sdk';
14
- export var useStyles = makeStyles(function (theme) { return ({
15
- root: {
16
- display: 'flex',
17
- alignItems: 'start',
18
- justifyContent: 'space-between'
19
- },
20
- commentsContainer: {
21
- height: '15px',
22
- marginRight: '-4px' // AttributesPager padding compensation
23
- },
24
- attributeValue: {
25
- verticalAlign: 'middle',
26
- wordBreak: 'break-all',
27
- whiteSpace: 'break-spaces'
28
- },
29
- updateAttribute: __assign(__assign({ width: 'fit-content', padding: '0 4px', marginLeft: '-4px' }, historyPalettes[HistoryOperations.updateAttribute]), { '& > a': {
30
- color: historyPalettes[HistoryOperations.updateAttribute].color
31
- } }),
32
- insertAttribute: __assign(__assign({ width: 'fit-content' }, historyPalettes[HistoryOperations.insertAttribute]), { '& > a': {
33
- color: historyPalettes[HistoryOperations.insertAttribute].color
34
- } }),
35
- deleteAttribute: __assign(__assign({ width: 'fit-content', padding: '0 4px', marginLeft: '-4px', textDecoration: 'line-through' }, historyPalettes[HistoryOperations.deleteAttribute]), { '& > a': {
36
- color: historyPalettes[HistoryOperations.deleteAttribute].color
37
- } }),
38
- multilineAttribute: {
39
- width: 'fit-content'
40
- },
41
- ovFalse: theme.inactive
42
- }); });
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"root" | "attributeValue" | "insertAttribute" | "updateAttribute" | "deleteAttribute" | "commentsContainer" | "multilineAttribute" | "ovFalse">;
@@ -1,45 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.useStyles = void 0;
15
- var styles_1 = require("@mui/styles");
16
- var mdm_sdk_1 = require("@reltio/mdm-sdk");
17
- exports.useStyles = (0, styles_1.makeStyles)(function (theme) { return ({
18
- root: {
19
- display: 'flex',
20
- alignItems: 'start',
21
- justifyContent: 'space-between'
22
- },
23
- commentsContainer: {
24
- height: '15px',
25
- marginRight: '-4px' // AttributesPager padding compensation
26
- },
27
- attributeValue: {
28
- verticalAlign: 'middle',
29
- wordBreak: 'break-all',
30
- whiteSpace: 'break-spaces'
31
- },
32
- updateAttribute: __assign(__assign({ width: 'fit-content', padding: '0 4px', marginLeft: '-4px' }, mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.updateAttribute]), { '& > a': {
33
- color: mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.updateAttribute].color
34
- } }),
35
- insertAttribute: __assign(__assign({ width: 'fit-content' }, mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.insertAttribute]), { '& > a': {
36
- color: mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.insertAttribute].color
37
- } }),
38
- deleteAttribute: __assign(__assign({ width: 'fit-content', padding: '0 4px', marginLeft: '-4px', textDecoration: 'line-through' }, mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.deleteAttribute]), { '& > a': {
39
- color: mdm_sdk_1.historyPalettes[mdm_sdk_1.HistoryOperations.deleteAttribute].color
40
- } }),
41
- multilineAttribute: {
42
- width: 'fit-content'
43
- },
44
- ovFalse: theme.inactive
45
- }); });
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"label" | "root">;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useStyles = void 0;
4
- var styles_1 = require("@mui/styles");
5
- exports.useStyles = (0, styles_1.makeStyles)({
6
- root: {
7
- display: 'flex',
8
- alignItems: 'center'
9
- },
10
- label: {
11
- marginRight: '5px'
12
- }
13
- });
@@ -1 +0,0 @@
1
- export declare const useStyles: (props?: any) => import("@mui/styles").ClassNameMap<"label" | "root">;
@@ -1,10 +0,0 @@
1
- import { makeStyles } from '@mui/styles';
2
- export var useStyles = makeStyles({
3
- root: {
4
- display: 'flex',
5
- alignItems: 'center'
6
- },
7
- label: {
8
- marginRight: '5px'
9
- }
10
- });