@reltio/components 1.4.1957 → 1.4.1958

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,49 +1,14 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
6
  exports.UpSetChart = void 0;
30
- var react_1 = __importStar(require("react"));
31
- var ui_i18n_1 = __importDefault(require("ui-i18n"));
32
- var react_2 = require("@upsetjs/react");
33
- var constants_1 = require("./constants");
34
- var styles_1 = require("./styles");
7
+ var react_1 = __importDefault(require("react"));
35
8
  var UpSetChart = function (_a) {
36
9
  var width = _a.width, height = _a.height, data = _a.data;
37
- var styles = (0, styles_1.useStyles)();
38
- var _b = (0, react_1.useState)(null), selection = _b[0], setSelection = _b[1];
39
- var _c = (0, react_1.useMemo)(function () { return (0, react_2.extractCombinations)(data); }, [data]), sets = _c.sets, combinations = _c.combinations;
40
- if (!width || !height)
10
+ if (!width || !height || !data)
41
11
  return null;
42
- return (react_1.default.createElement(react_2.UpSetJS, { width: width, height: height, sets: sets, combinations: combinations, selection: selection, onHover: setSelection, barPadding: 0.6, dotPadding: 0.5, barLabelOffset: 4, exportButtons: false, heightRatios: [0.65], combinationName: ui_i18n_1.default.text('No. of unified profiles'), setName: "", setLabelAlignment: "left", alternatingBackgroundColor: "transparent", notMemberColor: constants_1.NOT_MEMBER_COLOR, hasSelectionColor: constants_1.SECONDARY_COLOR, selectionColor: constants_1.PRIMARY_COLOR, color: constants_1.PRIMARY_COLOR, textColor: constants_1.TEXT_COLOR, fontFamily: "inherit", classNames: {
43
- setLabel: styles.setLabel,
44
- barLabel: styles.barLabel,
45
- axisTick: styles.axisTick,
46
- chartLabel: styles.chartLabel
47
- } }));
12
+ return react_1.default.createElement("div", null, "UpSet");
48
13
  };
49
14
  exports.UpSetChart = UpSetChart;
@@ -1,19 +1,7 @@
1
- import React, { useMemo, useState } from 'react';
2
- import i18n from 'ui-i18n';
3
- import { extractCombinations, UpSetJS } from '@upsetjs/react';
4
- import { NOT_MEMBER_COLOR, PRIMARY_COLOR, SECONDARY_COLOR, TEXT_COLOR } from './constants';
5
- import { useStyles } from './styles';
1
+ import React from 'react';
6
2
  export var UpSetChart = function (_a) {
7
3
  var width = _a.width, height = _a.height, data = _a.data;
8
- var styles = useStyles();
9
- var _b = useState(null), selection = _b[0], setSelection = _b[1];
10
- var _c = useMemo(function () { return extractCombinations(data); }, [data]), sets = _c.sets, combinations = _c.combinations;
11
- if (!width || !height)
4
+ if (!width || !height || !data)
12
5
  return null;
13
- return (React.createElement(UpSetJS, { width: width, height: height, sets: sets, combinations: combinations, selection: selection, onHover: setSelection, barPadding: 0.6, dotPadding: 0.5, barLabelOffset: 4, exportButtons: false, heightRatios: [0.65], combinationName: i18n.text('No. of unified profiles'), setName: "", setLabelAlignment: "left", alternatingBackgroundColor: "transparent", notMemberColor: NOT_MEMBER_COLOR, hasSelectionColor: SECONDARY_COLOR, selectionColor: PRIMARY_COLOR, color: PRIMARY_COLOR, textColor: TEXT_COLOR, fontFamily: "inherit", classNames: {
14
- setLabel: styles.setLabel,
15
- barLabel: styles.barLabel,
16
- axisTick: styles.axisTick,
17
- chartLabel: styles.chartLabel
18
- } }));
6
+ return React.createElement("div", null, "UpSet");
19
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reltio/components",
3
- "version": "1.4.1957",
3
+ "version": "1.4.1958",
4
4
  "license": "SEE LICENSE IN LICENSE FILE",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./esm/index.js",
@@ -9,7 +9,6 @@
9
9
  "@react-google-maps/api": "2.7.0",
10
10
  "@react-sigma/core": "3.4.0",
11
11
  "@reltio/mdm-sdk": "^1.4.1866",
12
- "@upsetjs/react": "^1.11.0",
13
12
  "d3-cloud": "^1.2.5",
14
13
  "d3-geo": "^2.0.1",
15
14
  "d3-hierarchy": "^2.0.0",
@@ -57,8 +56,5 @@
57
56
  "publishConfig": {
58
57
  "access": "public"
59
58
  },
60
- "overrides": {
61
- "@types/lz-string": "1.3.34"
62
- },
63
59
  "sideEffects": false
64
60
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1,67 +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
- 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_2 = require("@testing-library/react");
19
- var UpSetChart_1 = require("./UpSetChart");
20
- var defaultData = [
21
- { name: '1', sets: ['Salesforce'] },
22
- { name: '2', sets: ['SAP'] },
23
- { name: '3', sets: ['ServiceNow'] },
24
- { name: '4', sets: ['D&B'] },
25
- { name: '5', sets: ['Reltio'] },
26
- { name: '6', sets: ['Salesforce', 'SAP'] },
27
- { name: '7', sets: ['Salesforce', 'D&B'] },
28
- { name: '8', sets: ['Salesforce', 'Reltio'] },
29
- { name: '9', sets: ['ServiceNow', 'Reltio'] },
30
- { name: '10', sets: ['Salesforce', 'D&B'] },
31
- { name: '11', sets: ['SAP', 'D&B'] },
32
- { name: '12', sets: ['SAP', 'ServiceNow'] },
33
- { name: '13', sets: ['Salesforce', 'D&B', 'Reltio'] },
34
- { name: '14', sets: ['Salesforce', 'SAP', 'Reltio'] },
35
- { name: '15', sets: ['Salesforce', 'ServiceNow'] }
36
- ];
37
- var defaultProps = {
38
- data: defaultData,
39
- width: 600,
40
- height: 400
41
- };
42
- var setUp = function (props) {
43
- if (props === void 0) { props = defaultProps; }
44
- return (0, react_2.render)(react_1.default.createElement(UpSetChart_1.UpSetChart, __assign({}, props)));
45
- };
46
- describe('UpSetChart', function () {
47
- beforeEach(function () {
48
- jest.spyOn(Math, 'random').mockReturnValue(0.5);
49
- });
50
- afterEach(function () {
51
- jest.spyOn(Math, 'random').mockRestore();
52
- });
53
- it('should render correctly', function () {
54
- var container = setUp().container;
55
- expect(container).toMatchSnapshot();
56
- });
57
- it('should render nothing if width is 0 or undefined', function () {
58
- var props = __assign(__assign({}, defaultProps), { width: 0 });
59
- var container = setUp(props).container;
60
- expect(container).toBeEmptyDOMElement();
61
- });
62
- it('should render nothing if height is 0 or undefined', function () {
63
- var props = __assign(__assign({}, defaultProps), { height: 0 });
64
- var container = setUp(props).container;
65
- expect(container).toBeEmptyDOMElement();
66
- });
67
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,62 +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 React from 'react';
13
- import { render } from '@testing-library/react';
14
- import { UpSetChart } from './UpSetChart';
15
- var defaultData = [
16
- { name: '1', sets: ['Salesforce'] },
17
- { name: '2', sets: ['SAP'] },
18
- { name: '3', sets: ['ServiceNow'] },
19
- { name: '4', sets: ['D&B'] },
20
- { name: '5', sets: ['Reltio'] },
21
- { name: '6', sets: ['Salesforce', 'SAP'] },
22
- { name: '7', sets: ['Salesforce', 'D&B'] },
23
- { name: '8', sets: ['Salesforce', 'Reltio'] },
24
- { name: '9', sets: ['ServiceNow', 'Reltio'] },
25
- { name: '10', sets: ['Salesforce', 'D&B'] },
26
- { name: '11', sets: ['SAP', 'D&B'] },
27
- { name: '12', sets: ['SAP', 'ServiceNow'] },
28
- { name: '13', sets: ['Salesforce', 'D&B', 'Reltio'] },
29
- { name: '14', sets: ['Salesforce', 'SAP', 'Reltio'] },
30
- { name: '15', sets: ['Salesforce', 'ServiceNow'] }
31
- ];
32
- var defaultProps = {
33
- data: defaultData,
34
- width: 600,
35
- height: 400
36
- };
37
- var setUp = function (props) {
38
- if (props === void 0) { props = defaultProps; }
39
- return render(React.createElement(UpSetChart, __assign({}, props)));
40
- };
41
- describe('UpSetChart', function () {
42
- beforeEach(function () {
43
- jest.spyOn(Math, 'random').mockReturnValue(0.5);
44
- });
45
- afterEach(function () {
46
- jest.spyOn(Math, 'random').mockRestore();
47
- });
48
- it('should render correctly', function () {
49
- var container = setUp().container;
50
- expect(container).toMatchSnapshot();
51
- });
52
- it('should render nothing if width is 0 or undefined', function () {
53
- var props = __assign(__assign({}, defaultProps), { width: 0 });
54
- var container = setUp(props).container;
55
- expect(container).toBeEmptyDOMElement();
56
- });
57
- it('should render nothing if height is 0 or undefined', function () {
58
- var props = __assign(__assign({}, defaultProps), { height: 0 });
59
- var container = setUp(props).container;
60
- expect(container).toBeEmptyDOMElement();
61
- });
62
- });