@reltio/components 1.4.1276 → 1.4.1278
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/charts/HOCs/withPercents.d.ts +1 -0
- package/cjs/components/charts/HOCs/withPercents.js +3 -1
- package/cjs/components/charts/index.d.ts +1 -1
- package/cjs/components/charts/index.js +2 -1
- package/esm/components/charts/HOCs/withPercents.d.ts +1 -0
- package/esm/components/charts/HOCs/withPercents.js +1 -1
- package/esm/components/charts/index.d.ts +1 -1
- package/esm/components/charts/index.js +1 -1
- package/package.json +3 -3
|
@@ -3,6 +3,7 @@ import { ChartData } from '../types';
|
|
|
3
3
|
declare type PropsWithChartData = {
|
|
4
4
|
data: ChartData[];
|
|
5
5
|
};
|
|
6
|
+
export declare const enrichDataWithPercents: (data: ChartData[]) => ChartData[];
|
|
6
7
|
declare const withPercents: <T extends PropsWithChartData>(Component: React.ComponentType<T>) => {
|
|
7
8
|
({ data, ...otherProps }: T): JSX.Element;
|
|
8
9
|
displayName: string;
|
|
@@ -41,6 +41,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
41
41
|
return t;
|
|
42
42
|
};
|
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
44
|
+
exports.enrichDataWithPercents = void 0;
|
|
44
45
|
var react_1 = __importStar(require("react"));
|
|
45
46
|
var mdm_sdk_1 = require("@reltio/mdm-sdk");
|
|
46
47
|
var ramda_1 = require("ramda");
|
|
@@ -48,10 +49,11 @@ var enrichDataWithPercents = function (data) {
|
|
|
48
49
|
var percents = mdm_sdk_1.countPercents(ramda_1.pluck('value', data), 1);
|
|
49
50
|
return data.map(function (item, i) { return (__assign(__assign({}, item), { percent: percents[i] })); });
|
|
50
51
|
};
|
|
52
|
+
exports.enrichDataWithPercents = enrichDataWithPercents;
|
|
51
53
|
var withPercents = function (Component) {
|
|
52
54
|
var WithPercents = function (_a) {
|
|
53
55
|
var data = _a.data, otherProps = __rest(_a, ["data"]);
|
|
54
|
-
var dataWithPercents = react_1.useMemo(function () { return data && enrichDataWithPercents(data); }, [data]);
|
|
56
|
+
var dataWithPercents = react_1.useMemo(function () { return data && exports.enrichDataWithPercents(data); }, [data]);
|
|
55
57
|
return react_1.default.createElement(Component, __assign({ data: dataWithPercents }, otherProps));
|
|
56
58
|
};
|
|
57
59
|
WithPercents.displayName = 'WithPercents';
|
|
@@ -4,5 +4,5 @@ export { default as PieChart } from './PieChart/PieChart';
|
|
|
4
4
|
export { default as TableWithBars } from './TableWithBars/TableWithBars';
|
|
5
5
|
export { default as TreeChart } from './TreeChart/TreeChart';
|
|
6
6
|
export { default as ChartsFactory } from './ChartsFactory';
|
|
7
|
-
export { default as withPercents } from './HOCs/withPercents';
|
|
7
|
+
export { default as withPercents, enrichDataWithPercents } from './HOCs/withPercents';
|
|
8
8
|
export { useClickableStyle } from './hooks/useClickableStyle';
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.useClickableStyle = exports.withPercents = exports.ChartsFactory = exports.TreeChart = exports.TableWithBars = exports.PieChart = exports.BarChart = void 0;
|
|
6
|
+
exports.useClickableStyle = exports.enrichDataWithPercents = exports.withPercents = exports.ChartsFactory = exports.TreeChart = exports.TableWithBars = exports.PieChart = exports.BarChart = void 0;
|
|
7
7
|
var BarChart_1 = require("./BarChart/BarChart");
|
|
8
8
|
Object.defineProperty(exports, "BarChart", { enumerable: true, get: function () { return __importDefault(BarChart_1).default; } });
|
|
9
9
|
var PieChart_1 = require("./PieChart/PieChart");
|
|
@@ -16,5 +16,6 @@ var ChartsFactory_1 = require("./ChartsFactory");
|
|
|
16
16
|
Object.defineProperty(exports, "ChartsFactory", { enumerable: true, get: function () { return __importDefault(ChartsFactory_1).default; } });
|
|
17
17
|
var withPercents_1 = require("./HOCs/withPercents");
|
|
18
18
|
Object.defineProperty(exports, "withPercents", { enumerable: true, get: function () { return __importDefault(withPercents_1).default; } });
|
|
19
|
+
Object.defineProperty(exports, "enrichDataWithPercents", { enumerable: true, get: function () { return withPercents_1.enrichDataWithPercents; } });
|
|
19
20
|
var useClickableStyle_1 = require("./hooks/useClickableStyle");
|
|
20
21
|
Object.defineProperty(exports, "useClickableStyle", { enumerable: true, get: function () { return useClickableStyle_1.useClickableStyle; } });
|
|
@@ -3,6 +3,7 @@ import { ChartData } from '../types';
|
|
|
3
3
|
declare type PropsWithChartData = {
|
|
4
4
|
data: ChartData[];
|
|
5
5
|
};
|
|
6
|
+
export declare const enrichDataWithPercents: (data: ChartData[]) => ChartData[];
|
|
6
7
|
declare const withPercents: <T extends PropsWithChartData>(Component: React.ComponentType<T>) => {
|
|
7
8
|
({ data, ...otherProps }: T): JSX.Element;
|
|
8
9
|
displayName: string;
|
|
@@ -23,7 +23,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
23
23
|
import React, { useMemo } from 'react';
|
|
24
24
|
import { countPercents } from '@reltio/mdm-sdk';
|
|
25
25
|
import { pluck } from 'ramda';
|
|
26
|
-
var enrichDataWithPercents = function (data) {
|
|
26
|
+
export var enrichDataWithPercents = function (data) {
|
|
27
27
|
var percents = countPercents(pluck('value', data), 1);
|
|
28
28
|
return data.map(function (item, i) { return (__assign(__assign({}, item), { percent: percents[i] })); });
|
|
29
29
|
};
|
|
@@ -4,5 +4,5 @@ export { default as PieChart } from './PieChart/PieChart';
|
|
|
4
4
|
export { default as TableWithBars } from './TableWithBars/TableWithBars';
|
|
5
5
|
export { default as TreeChart } from './TreeChart/TreeChart';
|
|
6
6
|
export { default as ChartsFactory } from './ChartsFactory';
|
|
7
|
-
export { default as withPercents } from './HOCs/withPercents';
|
|
7
|
+
export { default as withPercents, enrichDataWithPercents } from './HOCs/withPercents';
|
|
8
8
|
export { useClickableStyle } from './hooks/useClickableStyle';
|
|
@@ -3,5 +3,5 @@ export { default as PieChart } from './PieChart/PieChart';
|
|
|
3
3
|
export { default as TableWithBars } from './TableWithBars/TableWithBars';
|
|
4
4
|
export { default as TreeChart } from './TreeChart/TreeChart';
|
|
5
5
|
export { default as ChartsFactory } from './ChartsFactory';
|
|
6
|
-
export { default as withPercents } from './HOCs/withPercents';
|
|
6
|
+
export { default as withPercents, enrichDataWithPercents } from './HOCs/withPercents';
|
|
7
7
|
export { useClickableStyle } from './hooks/useClickableStyle';
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1278",
|
|
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.1278",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1278",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|