@reltio/components 1.4.1731 → 1.4.1733

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 (43) hide show
  1. package/cjs/components/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +7 -3
  2. package/cjs/components/AttributesFiltersBuilder/AttributesFiltersBuilder.js +34 -19
  3. package/cjs/components/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.js +7 -5
  4. package/cjs/components/AttributesFiltersBuilder/components/FilterSelector/FilterSelector.js +3 -2
  5. package/cjs/components/AttributesFiltersBuilder/components/ValuesEditor/ValuesEditor.js +5 -3
  6. package/cjs/components/AttributesFiltersBuilder/components/ValuesEditor/styles.js +1 -1
  7. package/cjs/components/AttributesFiltersBuilder/helpers.d.ts +5 -4
  8. package/cjs/components/AttributesFiltersBuilder/helpers.js +33 -19
  9. package/cjs/components/AttributesFiltersBuilder/types.d.ts +3 -2
  10. package/cjs/components/AttributesFiltersButton/AttributesFiltersButton.d.ts +10 -3
  11. package/cjs/components/AttributesFiltersButton/AttributesFiltersButton.js +10 -6
  12. package/cjs/components/BasicAttributeSelector/styles.js +1 -0
  13. package/cjs/components/LogicOperator/LogicOperator.d.ts +9 -0
  14. package/cjs/components/LogicOperator/LogicOperator.js +29 -0
  15. package/cjs/components/LogicOperator/styles.d.ts +2 -0
  16. package/cjs/components/LogicOperator/styles.js +15 -0
  17. package/cjs/components/ReltioGridLayout/ReltioGridLayout.d.ts +3 -6
  18. package/cjs/components/ReltioGridLayout/ReltioGridLayout.js +19 -1
  19. package/cjs/components/index.d.ts +1 -0
  20. package/cjs/components/index.js +3 -1
  21. package/cjs/types/index.d.ts +16 -13
  22. package/esm/components/AttributesFiltersBuilder/AttributesFiltersBuilder.d.ts +7 -3
  23. package/esm/components/AttributesFiltersBuilder/AttributesFiltersBuilder.js +36 -21
  24. package/esm/components/AttributesFiltersBuilder/components/AttributeSelector/AttributeSelector.js +9 -7
  25. package/esm/components/AttributesFiltersBuilder/components/FilterSelector/FilterSelector.js +3 -2
  26. package/esm/components/AttributesFiltersBuilder/components/ValuesEditor/ValuesEditor.js +5 -3
  27. package/esm/components/AttributesFiltersBuilder/components/ValuesEditor/styles.js +1 -1
  28. package/esm/components/AttributesFiltersBuilder/helpers.d.ts +5 -4
  29. package/esm/components/AttributesFiltersBuilder/helpers.js +34 -20
  30. package/esm/components/AttributesFiltersBuilder/types.d.ts +3 -2
  31. package/esm/components/AttributesFiltersButton/AttributesFiltersButton.d.ts +10 -3
  32. package/esm/components/AttributesFiltersButton/AttributesFiltersButton.js +10 -6
  33. package/esm/components/BasicAttributeSelector/styles.js +1 -0
  34. package/esm/components/LogicOperator/LogicOperator.d.ts +9 -0
  35. package/esm/components/LogicOperator/LogicOperator.js +24 -0
  36. package/esm/components/LogicOperator/styles.d.ts +2 -0
  37. package/esm/components/LogicOperator/styles.js +13 -0
  38. package/esm/components/ReltioGridLayout/ReltioGridLayout.d.ts +3 -6
  39. package/esm/components/ReltioGridLayout/ReltioGridLayout.js +21 -3
  40. package/esm/components/index.d.ts +1 -0
  41. package/esm/components/index.js +1 -0
  42. package/esm/types/index.d.ts +16 -13
  43. package/package.json +2 -2
@@ -9,10 +9,10 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- import React, { useCallback, useMemo, useRef, useState, memo } from 'react';
12
+ import React, { useEffect, useCallback, useMemo, useRef, useState, memo } from 'react';
13
13
  import GridLayout from 'react-grid-layout';
14
14
  import ReactResizeDetector from 'react-resize-detector';
15
- import { pipe, ifElse, always } from 'ramda';
15
+ import { pipe, ifElse, always, equals } from 'ramda';
16
16
  import classnames from 'classnames';
17
17
  import { alignGroupedItemsHeights, calcLayoutItemsHeight, reltioLayoutToReactGridLayout, reactGridLayoutToReltioLayout, reactGridLayoutItemToReltioLayoutItem, copyPropsFromPreviousLayout, calcHeight, getReltioLayoutItemById } from './helpers';
18
18
  import { noop } from '../../core';
@@ -26,6 +26,7 @@ var ReltioGridLayout = function (_a) {
26
26
  var _b;
27
27
  var views = _a.views, layout = _a.layout, _c = _a.layoutOptions, layoutOptions = _c === void 0 ? DEFAULT_LAYOUT_OPTIONS : _c, _d = _a.onLayoutChanged, onLayoutChanged = _d === void 0 ? noop : _d, draggableHandle = _a.draggableHandle, LayoutItem = _a.LayoutItem, onRemove = _a.onRemove, onDrop = _a.onDrop, droppingItem = _a.droppingItem, isDroppable = _a.isDroppable, onDropDragOver = _a.onDropDragOver, isStatic = _a.isStatic, classes = _a.classes, _e = _a.onResize, onResize = _e === void 0 ? noop : _e;
28
28
  var ref = useRef();
29
+ var shouldCompareLayout = useRef(false);
29
30
  var heightsMap = useRef({});
30
31
  var styles = useStyles();
31
32
  var _f = useState(null), resizingItemId = _f[0], setResizingItemId = _f[1];
@@ -33,7 +34,8 @@ var ReltioGridLayout = function (_a) {
33
34
  var _h = useState(0), width = _h[0], setWidth = _h[1];
34
35
  var cols = layoutOptions.cols, rowHeight = layoutOptions.rowHeight, margin = layoutOptions.margin;
35
36
  var processedLayout = useMemo(function () { return reltioLayoutToReactGridLayout(layout); }, [layout]);
36
- var onReltioLayoutChanged = pipe(reactGridLayoutToReltioLayout, copyPropsFromPreviousLayout(['autosizing'], layout), ifElse(always(isStatic), alignGroupedItemsHeights(heightsMap.current), calcLayoutItemsHeight(heightsMap.current)), onLayoutChanged);
37
+ var convertReactLayoutToReltioLayout = pipe(reactGridLayoutToReltioLayout, copyPropsFromPreviousLayout(['autosizing'], layout), ifElse(always(isStatic), alignGroupedItemsHeights(heightsMap.current), calcLayoutItemsHeight(heightsMap.current)));
38
+ var onReltioLayoutChanged = pipe(convertReactLayoutToReltioLayout, onLayoutChanged);
37
39
  var handleDrop = function (layout, layoutItem, e) {
38
40
  if (onDrop && layoutItem) {
39
41
  onDrop(reactGridLayoutToReltioLayout(layout), reactGridLayoutItemToReltioLayoutItem(layoutItem), e);
@@ -46,10 +48,26 @@ var ReltioGridLayout = function (_a) {
46
48
  var newHeight = calcHeight(height, layoutOptions);
47
49
  if (newHeight !== heightsMap.current[layoutItemId]) {
48
50
  heightsMap.current[layoutItemId] = newHeight;
51
+ shouldCompareLayout.current = false;
49
52
  onReltioLayoutChanged(processedLayout);
50
53
  }
51
54
  }
52
55
  } })); };
56
+ useEffect(function () {
57
+ if (isStatic) {
58
+ if (shouldCompareLayout.current) {
59
+ var expectedLayout = convertReactLayoutToReltioLayout(processedLayout);
60
+ var isSameLayout = equals(reltioLayoutToReactGridLayout(expectedLayout), processedLayout);
61
+ if (!isSameLayout) {
62
+ shouldCompareLayout.current = false;
63
+ onLayoutChanged(expectedLayout);
64
+ }
65
+ }
66
+ else {
67
+ shouldCompareLayout.current = true;
68
+ }
69
+ }
70
+ }, [processedLayout, isStatic]);
53
71
  return (React.createElement(React.Fragment, null,
54
72
  React.createElement(ReactResizeDetector, { refreshMode: "debounce", refreshRate: 50, handleWidth: true, onResize: function (width) { return setWidth(width); } }),
55
73
  !!width && (React.createElement(GridLayout, { innerRef: ref, layout: processedLayout, cols: cols, draggableHandle: draggableHandle, autoSize: true, rowHeight: rowHeight, width: width, margin: margin, onLayoutChange: isStatic ? undefined : onReltioLayoutChanged, isResizable: !isStatic && !isFullscreenEnabled, isDraggable: !isStatic && !isFullscreenEnabled, className: classnames(classes === null || classes === void 0 ? void 0 : classes.root, styles.gridLayout, (_b = {},
@@ -155,3 +155,4 @@ export { default as MultilineMenuItem } from './MultilineMenuItem/MultilineMenuI
155
155
  export { default as TenantLabel } from './TenantLabel/TenantLabel';
156
156
  export { default as StepNavigation } from './StepNavigation/StepNavigation';
157
157
  export { TableSkeleton } from './TableSkeleton/TableSkeleton';
158
+ export { default as LogicOperator } from './LogicOperator/LogicOperator';
@@ -155,3 +155,4 @@ export { default as MultilineMenuItem } from './MultilineMenuItem/MultilineMenuI
155
155
  export { default as TenantLabel } from './TenantLabel/TenantLabel';
156
156
  export { default as StepNavigation } from './StepNavigation/StepNavigation';
157
157
  export { TableSkeleton } from './TableSkeleton/TableSkeleton';
158
+ export { default as LogicOperator } from './LogicOperator/LogicOperator';
@@ -1,17 +1,7 @@
1
1
  import React from 'react';
2
- import { AttributeType, SearchFilter } from '@reltio/mdm-sdk';
3
- export type ReactGridLayoutItem = {
4
- i: string;
5
- x: number;
6
- y: number;
7
- w: number;
8
- h: number;
9
- minW?: number;
10
- minH?: number;
11
- maxW?: number;
12
- maxH?: number;
13
- static?: boolean;
14
- };
2
+ import { AttributeType, SearchFilter, SearchOperator } from '@reltio/mdm-sdk';
3
+ import { Layout as LayoutItem } from 'react-grid-layout';
4
+ export type ReactGridLayoutItem = LayoutItem;
15
5
  export type ReltioGridLayoutOptions = {
16
6
  cols: number;
17
7
  rowHeight: number;
@@ -46,6 +36,7 @@ export type FiltersRowData = {
46
36
  filter: string;
47
37
  id: number;
48
38
  values: SearchFilter['values'];
39
+ operator?: SearchOperator;
49
40
  };
50
41
  export type AttributeSelectorItem = {
51
42
  attrType?: AttributeType;
@@ -62,6 +53,11 @@ export type AttributeSelectorItemsGroup = {
62
53
  title: string;
63
54
  attributes: AttributeSelectorItem[];
64
55
  };
56
+ export type AttributesTypesGroup = {
57
+ id?: string;
58
+ title: string;
59
+ attributeTypes: AttributeType[];
60
+ };
65
61
  export type AttributeSelectionInfo = {
66
62
  index: number;
67
63
  checked: boolean;
@@ -137,3 +133,10 @@ export type AnyAction = {
137
133
  type: string;
138
134
  [key: string]: any;
139
135
  };
136
+ export type AttributesFilterComponentsClasses = {
137
+ attributeSelectorContainer?: string;
138
+ valuesEditorContainer?: string;
139
+ filterSelectorContainer?: string;
140
+ actionsContainer?: string;
141
+ filterPopup?: string;
142
+ };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1731",
3
+ "version": "1.4.1733",
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.1716",
10
+ "@reltio/mdm-sdk": "^1.4.1717",
11
11
  "classnames": "^2.2.5",
12
12
  "d3-cloud": "^1.2.5",
13
13
  "d3-geo": "^2.0.1",