rbro-tat-uds 2.2.2 → 2.2.3
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/build/cjs/components/GraficContributieUnitlinked/GraficContributieUnitlinked.cjs +157 -0
- package/build/cjs/components/GraficContributieUnitlinked/index.cjs +12 -0
- package/build/cjs/components/index.cjs +2 -0
- package/build/cjs/index.cjs +145 -0
- package/build/esm/components/GraficContributieUnitlinked/GraficContributieUnitlinked.js +153 -0
- package/build/esm/components/GraficContributieUnitlinked/index.js +8 -0
- package/build/esm/components/index.js +1 -0
- package/build/esm/index.js +145 -1
- package/build/types/components/GraficContributieUnitlinked/GraficContributieUnitlinked.d.ts +16 -0
- package/build/types/components/GraficContributieUnitlinked/index.d.ts +6 -0
- package/build/types/index.d.ts +1 -0
- package/package.json +1 -1
@@ -0,0 +1,157 @@
|
|
1
|
+
"use strict";
|
2
|
+
"use client";
|
3
|
+
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
7
|
+
|
8
|
+
var jsxRuntime = require('react/jsx-runtime');
|
9
|
+
var utils = require('../../utils');
|
10
|
+
var React = require('react');
|
11
|
+
var styled = require('styled-components');
|
12
|
+
|
13
|
+
const GraficContributieUnitlinkedStyled = styled.svg`
|
14
|
+
& > .limit_label_main {
|
15
|
+
font-size: 14px;
|
16
|
+
font-weight: 400;
|
17
|
+
fill: ${utils.colors.gray_950};
|
18
|
+
}
|
19
|
+
& > .limit_label_secondary {
|
20
|
+
font-size: 16px;
|
21
|
+
font-weight: 700;
|
22
|
+
fill: ${utils.colors.gray_950};
|
23
|
+
}
|
24
|
+
`;
|
25
|
+
const GraficContributieUnitlinked = ({
|
26
|
+
limitTop = 50,
|
27
|
+
limitBottom = 100,
|
28
|
+
limitTopLabel = "Top Label",
|
29
|
+
limitBottomLabel = "Bottom Label",
|
30
|
+
currency = "RON",
|
31
|
+
height = 142,
|
32
|
+
colorBar = utils.colors.danger_100,
|
33
|
+
colorFilledBar = utils.colors.success_400
|
34
|
+
}) => {
|
35
|
+
const RO = new Intl.NumberFormat("RO");
|
36
|
+
const svg_ref = React.useRef(null);
|
37
|
+
const [w, setW] = React.useState(0);
|
38
|
+
const BAR_HEIGHT = 24;
|
39
|
+
const configuration = React.useMemo(() => {
|
40
|
+
const barY = height / 2 - BAR_HEIGHT / 2;
|
41
|
+
const barYStop = barY + BAR_HEIGHT;
|
42
|
+
const limitTopHeight = height - barYStop + BAR_HEIGHT;
|
43
|
+
const limitTopX = Math.min(Math.max(0, limitTop / limitBottom * w), w - 2);
|
44
|
+
const limitTopLabelsAnchor = limitTopX > w * 0.75 ? "end" : "start";
|
45
|
+
const limitBottomX = w - 2;
|
46
|
+
const limitBottomY = barY;
|
47
|
+
const limitBottomHeight = limitTopHeight;
|
48
|
+
return {
|
49
|
+
barY,
|
50
|
+
barYStop,
|
51
|
+
limitTopHeight,
|
52
|
+
limitTopX,
|
53
|
+
limitTopLabelsAnchor,
|
54
|
+
limitBottomY,
|
55
|
+
limitBottomHeight,
|
56
|
+
limitBottomX
|
57
|
+
};
|
58
|
+
}, [limitTop, limitBottom, height, w]);
|
59
|
+
React.useEffect(() => {
|
60
|
+
if (svg_ref.current) {
|
61
|
+
setW(svg_ref.current.clientWidth);
|
62
|
+
}
|
63
|
+
}, [svg_ref]);
|
64
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
65
|
+
GraficContributieUnitlinkedStyled,
|
66
|
+
{
|
67
|
+
ref: svg_ref,
|
68
|
+
width: "100%",
|
69
|
+
height,
|
70
|
+
xmlns: "http://www.w3.org/2000/svg",
|
71
|
+
children: [
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
73
|
+
"rect",
|
74
|
+
{
|
75
|
+
x: 0,
|
76
|
+
y: configuration.barY,
|
77
|
+
width: "100%",
|
78
|
+
height: BAR_HEIGHT,
|
79
|
+
fill: colorBar
|
80
|
+
}
|
81
|
+
),
|
82
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
83
|
+
"rect",
|
84
|
+
{
|
85
|
+
x: 0,
|
86
|
+
y: configuration.barY,
|
87
|
+
width: configuration.limitTopX,
|
88
|
+
height: BAR_HEIGHT,
|
89
|
+
fill: colorFilledBar
|
90
|
+
}
|
91
|
+
),
|
92
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
93
|
+
"rect",
|
94
|
+
{
|
95
|
+
x: configuration.limitTopX,
|
96
|
+
y: 0,
|
97
|
+
height: configuration.limitTopHeight,
|
98
|
+
fill: "black",
|
99
|
+
width: 2
|
100
|
+
}
|
101
|
+
),
|
102
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
103
|
+
"text",
|
104
|
+
{
|
105
|
+
className: "limit_label_main",
|
106
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
107
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
108
|
+
y: 12,
|
109
|
+
children: limitTopLabel
|
110
|
+
}
|
111
|
+
),
|
112
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
113
|
+
"text",
|
114
|
+
{
|
115
|
+
className: "limit_label_secondary",
|
116
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
117
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
118
|
+
y: 12 + 20,
|
119
|
+
children: RO.format(limitTop) + " " + currency
|
120
|
+
}
|
121
|
+
),
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
123
|
+
"rect",
|
124
|
+
{
|
125
|
+
x: configuration.limitBottomX,
|
126
|
+
y: configuration.limitBottomY,
|
127
|
+
height: configuration.limitBottomHeight,
|
128
|
+
fill: "black",
|
129
|
+
width: 2
|
130
|
+
}
|
131
|
+
),
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
133
|
+
"text",
|
134
|
+
{
|
135
|
+
className: "limit_label_main",
|
136
|
+
textAnchor: "end",
|
137
|
+
x: configuration.limitBottomX - 12,
|
138
|
+
y: height - 20,
|
139
|
+
children: limitBottomLabel
|
140
|
+
}
|
141
|
+
),
|
142
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
143
|
+
"text",
|
144
|
+
{
|
145
|
+
className: "limit_label_secondary",
|
146
|
+
textAnchor: "end",
|
147
|
+
x: configuration.limitBottomX - 12,
|
148
|
+
y: height,
|
149
|
+
children: RO.format(limitBottom) + " " + currency
|
150
|
+
}
|
151
|
+
)
|
152
|
+
]
|
153
|
+
}
|
154
|
+
);
|
155
|
+
};
|
156
|
+
|
157
|
+
exports.default = GraficContributieUnitlinked;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
"use client";
|
3
|
+
|
4
|
+
'use strict';
|
5
|
+
|
6
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
7
|
+
|
8
|
+
var GraficContributieUnitlinked = require('./GraficContributieUnitlinked.cjs');
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
exports.default = GraficContributieUnitlinked.default;
|
@@ -89,6 +89,7 @@ var UnitlinkGraph = require('./UnitlinkGraph/UnitlinkGraph.cjs');
|
|
89
89
|
var VerticalHeat = require('./VerticalHeat/VerticalHeat.cjs');
|
90
90
|
var Icon = require('./Icon/Icon.cjs');
|
91
91
|
var Spinner = require('./Spinner/Spinner.cjs');
|
92
|
+
var GraficContributieUnitlinked = require('./GraficContributieUnitlinked/GraficContributieUnitlinked.cjs');
|
92
93
|
|
93
94
|
|
94
95
|
|
@@ -178,3 +179,4 @@ exports.UnitlinkGraph = UnitlinkGraph.default;
|
|
178
179
|
exports.VerticalHeat = VerticalHeat.default;
|
179
180
|
exports.Icon = Icon.default;
|
180
181
|
exports.Spinner = Spinner.default;
|
182
|
+
exports.GraficContributieUnitlinked = GraficContributieUnitlinked.default;
|
package/build/cjs/index.cjs
CHANGED
@@ -11378,6 +11378,150 @@ const IconCard = ({
|
|
11378
11378
|
);
|
11379
11379
|
};
|
11380
11380
|
|
11381
|
+
const GraficContributieUnitlinkedStyled = styled__default.default.svg`
|
11382
|
+
& > .limit_label_main {
|
11383
|
+
font-size: 14px;
|
11384
|
+
font-weight: 400;
|
11385
|
+
fill: ${utils.colors.gray_950};
|
11386
|
+
}
|
11387
|
+
& > .limit_label_secondary {
|
11388
|
+
font-size: 16px;
|
11389
|
+
font-weight: 700;
|
11390
|
+
fill: ${utils.colors.gray_950};
|
11391
|
+
}
|
11392
|
+
`;
|
11393
|
+
const GraficContributieUnitlinked = ({
|
11394
|
+
limitTop = 50,
|
11395
|
+
limitBottom = 100,
|
11396
|
+
limitTopLabel = "Top Label",
|
11397
|
+
limitBottomLabel = "Bottom Label",
|
11398
|
+
currency = "RON",
|
11399
|
+
height = 142,
|
11400
|
+
colorBar = utils.colors.danger_100,
|
11401
|
+
colorFilledBar = utils.colors.success_400
|
11402
|
+
}) => {
|
11403
|
+
const RO = new Intl.NumberFormat("RO");
|
11404
|
+
const svg_ref = React.useRef(null);
|
11405
|
+
const [w, setW] = React.useState(0);
|
11406
|
+
const BAR_HEIGHT = 24;
|
11407
|
+
const configuration = React.useMemo(() => {
|
11408
|
+
const barY = height / 2 - BAR_HEIGHT / 2;
|
11409
|
+
const barYStop = barY + BAR_HEIGHT;
|
11410
|
+
const limitTopHeight = height - barYStop + BAR_HEIGHT;
|
11411
|
+
const limitTopX = Math.min(Math.max(0, limitTop / limitBottom * w), w - 2);
|
11412
|
+
const limitTopLabelsAnchor = limitTopX > w * 0.75 ? "end" : "start";
|
11413
|
+
const limitBottomX = w - 2;
|
11414
|
+
const limitBottomY = barY;
|
11415
|
+
const limitBottomHeight = limitTopHeight;
|
11416
|
+
return {
|
11417
|
+
barY,
|
11418
|
+
barYStop,
|
11419
|
+
limitTopHeight,
|
11420
|
+
limitTopX,
|
11421
|
+
limitTopLabelsAnchor,
|
11422
|
+
limitBottomY,
|
11423
|
+
limitBottomHeight,
|
11424
|
+
limitBottomX
|
11425
|
+
};
|
11426
|
+
}, [limitTop, limitBottom, height, w]);
|
11427
|
+
React.useEffect(() => {
|
11428
|
+
if (svg_ref.current) {
|
11429
|
+
setW(svg_ref.current.clientWidth);
|
11430
|
+
}
|
11431
|
+
}, [svg_ref]);
|
11432
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
11433
|
+
GraficContributieUnitlinkedStyled,
|
11434
|
+
{
|
11435
|
+
ref: svg_ref,
|
11436
|
+
width: "100%",
|
11437
|
+
height,
|
11438
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11439
|
+
children: [
|
11440
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11441
|
+
"rect",
|
11442
|
+
{
|
11443
|
+
x: 0,
|
11444
|
+
y: configuration.barY,
|
11445
|
+
width: "100%",
|
11446
|
+
height: BAR_HEIGHT,
|
11447
|
+
fill: colorBar
|
11448
|
+
}
|
11449
|
+
),
|
11450
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11451
|
+
"rect",
|
11452
|
+
{
|
11453
|
+
x: 0,
|
11454
|
+
y: configuration.barY,
|
11455
|
+
width: configuration.limitTopX,
|
11456
|
+
height: BAR_HEIGHT,
|
11457
|
+
fill: colorFilledBar
|
11458
|
+
}
|
11459
|
+
),
|
11460
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11461
|
+
"rect",
|
11462
|
+
{
|
11463
|
+
x: configuration.limitTopX,
|
11464
|
+
y: 0,
|
11465
|
+
height: configuration.limitTopHeight,
|
11466
|
+
fill: "black",
|
11467
|
+
width: 2
|
11468
|
+
}
|
11469
|
+
),
|
11470
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11471
|
+
"text",
|
11472
|
+
{
|
11473
|
+
className: "limit_label_main",
|
11474
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
11475
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
11476
|
+
y: 12,
|
11477
|
+
children: limitTopLabel
|
11478
|
+
}
|
11479
|
+
),
|
11480
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11481
|
+
"text",
|
11482
|
+
{
|
11483
|
+
className: "limit_label_secondary",
|
11484
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
11485
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
11486
|
+
y: 12 + 20,
|
11487
|
+
children: RO.format(limitTop) + " " + currency
|
11488
|
+
}
|
11489
|
+
),
|
11490
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11491
|
+
"rect",
|
11492
|
+
{
|
11493
|
+
x: configuration.limitBottomX,
|
11494
|
+
y: configuration.limitBottomY,
|
11495
|
+
height: configuration.limitBottomHeight,
|
11496
|
+
fill: "black",
|
11497
|
+
width: 2
|
11498
|
+
}
|
11499
|
+
),
|
11500
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11501
|
+
"text",
|
11502
|
+
{
|
11503
|
+
className: "limit_label_main",
|
11504
|
+
textAnchor: "end",
|
11505
|
+
x: configuration.limitBottomX - 12,
|
11506
|
+
y: height - 20,
|
11507
|
+
children: limitBottomLabel
|
11508
|
+
}
|
11509
|
+
),
|
11510
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
11511
|
+
"text",
|
11512
|
+
{
|
11513
|
+
className: "limit_label_secondary",
|
11514
|
+
textAnchor: "end",
|
11515
|
+
x: configuration.limitBottomX - 12,
|
11516
|
+
y: height,
|
11517
|
+
children: RO.format(limitBottom) + " " + currency
|
11518
|
+
}
|
11519
|
+
)
|
11520
|
+
]
|
11521
|
+
}
|
11522
|
+
);
|
11523
|
+
};
|
11524
|
+
|
11381
11525
|
var _g$a, _g2$8, _path$8, _path2$8, _path3$8, _path4$8, _path5$8, _path6$8, _path7$8, _path8$8, _path9$8, _path0$8, _path1$7, _path10$6, _g3$8, _g4$4, _path11$5, _path12$5, _path13$3, _path14$3, _path15$3, _path16$3, _path17$3, _path18$3, _path19$3, _path20$3, _path21$3, _path22$3, _path23$3, _defs$a;
|
11382
11526
|
function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
|
11383
11527
|
var SvgMInvestingMoney = function SvgMInvestingMoney(props) {
|
@@ -26273,6 +26417,7 @@ exports.Dropdown = Dropdown;
|
|
26273
26417
|
exports.Flex = Flex;
|
26274
26418
|
exports.FormField = FormField;
|
26275
26419
|
exports.GraficConfiguratiePensii = GraficConfiguratiePensii;
|
26420
|
+
exports.GraficContributieUnitlinked = GraficContributieUnitlinked;
|
26276
26421
|
exports.GraficFondInvestitii = GraficFondInvestitii;
|
26277
26422
|
exports.GraficFondInvestitiiInflatie = GraficFondInvestitiiInflatie;
|
26278
26423
|
exports.GraficPensii = GraficPensii;
|
@@ -0,0 +1,153 @@
|
|
1
|
+
"use strict";
|
2
|
+
"use client";
|
3
|
+
|
4
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
5
|
+
import { colors } from '../../utils';
|
6
|
+
import { useRef, useState, useMemo, useEffect } from 'react';
|
7
|
+
import styled from 'styled-components';
|
8
|
+
|
9
|
+
const GraficContributieUnitlinkedStyled = styled.svg`
|
10
|
+
& > .limit_label_main {
|
11
|
+
font-size: 14px;
|
12
|
+
font-weight: 400;
|
13
|
+
fill: ${colors.gray_950};
|
14
|
+
}
|
15
|
+
& > .limit_label_secondary {
|
16
|
+
font-size: 16px;
|
17
|
+
font-weight: 700;
|
18
|
+
fill: ${colors.gray_950};
|
19
|
+
}
|
20
|
+
`;
|
21
|
+
const GraficContributieUnitlinked = ({
|
22
|
+
limitTop = 50,
|
23
|
+
limitBottom = 100,
|
24
|
+
limitTopLabel = "Top Label",
|
25
|
+
limitBottomLabel = "Bottom Label",
|
26
|
+
currency = "RON",
|
27
|
+
height = 142,
|
28
|
+
colorBar = colors.danger_100,
|
29
|
+
colorFilledBar = colors.success_400
|
30
|
+
}) => {
|
31
|
+
const RO = new Intl.NumberFormat("RO");
|
32
|
+
const svg_ref = useRef(null);
|
33
|
+
const [w, setW] = useState(0);
|
34
|
+
const BAR_HEIGHT = 24;
|
35
|
+
const configuration = useMemo(() => {
|
36
|
+
const barY = height / 2 - BAR_HEIGHT / 2;
|
37
|
+
const barYStop = barY + BAR_HEIGHT;
|
38
|
+
const limitTopHeight = height - barYStop + BAR_HEIGHT;
|
39
|
+
const limitTopX = Math.min(Math.max(0, limitTop / limitBottom * w), w - 2);
|
40
|
+
const limitTopLabelsAnchor = limitTopX > w * 0.75 ? "end" : "start";
|
41
|
+
const limitBottomX = w - 2;
|
42
|
+
const limitBottomY = barY;
|
43
|
+
const limitBottomHeight = limitTopHeight;
|
44
|
+
return {
|
45
|
+
barY,
|
46
|
+
barYStop,
|
47
|
+
limitTopHeight,
|
48
|
+
limitTopX,
|
49
|
+
limitTopLabelsAnchor,
|
50
|
+
limitBottomY,
|
51
|
+
limitBottomHeight,
|
52
|
+
limitBottomX
|
53
|
+
};
|
54
|
+
}, [limitTop, limitBottom, height, w]);
|
55
|
+
useEffect(() => {
|
56
|
+
if (svg_ref.current) {
|
57
|
+
setW(svg_ref.current.clientWidth);
|
58
|
+
}
|
59
|
+
}, [svg_ref]);
|
60
|
+
return /* @__PURE__ */ jsxs(
|
61
|
+
GraficContributieUnitlinkedStyled,
|
62
|
+
{
|
63
|
+
ref: svg_ref,
|
64
|
+
width: "100%",
|
65
|
+
height,
|
66
|
+
xmlns: "http://www.w3.org/2000/svg",
|
67
|
+
children: [
|
68
|
+
/* @__PURE__ */ jsx(
|
69
|
+
"rect",
|
70
|
+
{
|
71
|
+
x: 0,
|
72
|
+
y: configuration.barY,
|
73
|
+
width: "100%",
|
74
|
+
height: BAR_HEIGHT,
|
75
|
+
fill: colorBar
|
76
|
+
}
|
77
|
+
),
|
78
|
+
/* @__PURE__ */ jsx(
|
79
|
+
"rect",
|
80
|
+
{
|
81
|
+
x: 0,
|
82
|
+
y: configuration.barY,
|
83
|
+
width: configuration.limitTopX,
|
84
|
+
height: BAR_HEIGHT,
|
85
|
+
fill: colorFilledBar
|
86
|
+
}
|
87
|
+
),
|
88
|
+
/* @__PURE__ */ jsx(
|
89
|
+
"rect",
|
90
|
+
{
|
91
|
+
x: configuration.limitTopX,
|
92
|
+
y: 0,
|
93
|
+
height: configuration.limitTopHeight,
|
94
|
+
fill: "black",
|
95
|
+
width: 2
|
96
|
+
}
|
97
|
+
),
|
98
|
+
/* @__PURE__ */ jsx(
|
99
|
+
"text",
|
100
|
+
{
|
101
|
+
className: "limit_label_main",
|
102
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
103
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
104
|
+
y: 12,
|
105
|
+
children: limitTopLabel
|
106
|
+
}
|
107
|
+
),
|
108
|
+
/* @__PURE__ */ jsx(
|
109
|
+
"text",
|
110
|
+
{
|
111
|
+
className: "limit_label_secondary",
|
112
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
113
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
114
|
+
y: 12 + 20,
|
115
|
+
children: RO.format(limitTop) + " " + currency
|
116
|
+
}
|
117
|
+
),
|
118
|
+
/* @__PURE__ */ jsx(
|
119
|
+
"rect",
|
120
|
+
{
|
121
|
+
x: configuration.limitBottomX,
|
122
|
+
y: configuration.limitBottomY,
|
123
|
+
height: configuration.limitBottomHeight,
|
124
|
+
fill: "black",
|
125
|
+
width: 2
|
126
|
+
}
|
127
|
+
),
|
128
|
+
/* @__PURE__ */ jsx(
|
129
|
+
"text",
|
130
|
+
{
|
131
|
+
className: "limit_label_main",
|
132
|
+
textAnchor: "end",
|
133
|
+
x: configuration.limitBottomX - 12,
|
134
|
+
y: height - 20,
|
135
|
+
children: limitBottomLabel
|
136
|
+
}
|
137
|
+
),
|
138
|
+
/* @__PURE__ */ jsx(
|
139
|
+
"text",
|
140
|
+
{
|
141
|
+
className: "limit_label_secondary",
|
142
|
+
textAnchor: "end",
|
143
|
+
x: configuration.limitBottomX - 12,
|
144
|
+
y: height,
|
145
|
+
children: RO.format(limitBottom) + " " + currency
|
146
|
+
}
|
147
|
+
)
|
148
|
+
]
|
149
|
+
}
|
150
|
+
);
|
151
|
+
};
|
152
|
+
|
153
|
+
export { GraficContributieUnitlinked as default };
|
@@ -87,3 +87,4 @@ export { default as UnitlinkGraph } from './UnitlinkGraph/UnitlinkGraph.js';
|
|
87
87
|
export { default as VerticalHeat } from './VerticalHeat/VerticalHeat.js';
|
88
88
|
export { default as Icon } from './Icon/Icon.js';
|
89
89
|
export { default as Spinner } from './Spinner/Spinner.js';
|
90
|
+
export { default as GraficContributieUnitlinked } from './GraficContributieUnitlinked/GraficContributieUnitlinked.js';
|
package/build/esm/index.js
CHANGED
@@ -11355,6 +11355,150 @@ const IconCard = ({
|
|
11355
11355
|
);
|
11356
11356
|
};
|
11357
11357
|
|
11358
|
+
const GraficContributieUnitlinkedStyled = styled.svg`
|
11359
|
+
& > .limit_label_main {
|
11360
|
+
font-size: 14px;
|
11361
|
+
font-weight: 400;
|
11362
|
+
fill: ${colors.gray_950};
|
11363
|
+
}
|
11364
|
+
& > .limit_label_secondary {
|
11365
|
+
font-size: 16px;
|
11366
|
+
font-weight: 700;
|
11367
|
+
fill: ${colors.gray_950};
|
11368
|
+
}
|
11369
|
+
`;
|
11370
|
+
const GraficContributieUnitlinked = ({
|
11371
|
+
limitTop = 50,
|
11372
|
+
limitBottom = 100,
|
11373
|
+
limitTopLabel = "Top Label",
|
11374
|
+
limitBottomLabel = "Bottom Label",
|
11375
|
+
currency = "RON",
|
11376
|
+
height = 142,
|
11377
|
+
colorBar = colors.danger_100,
|
11378
|
+
colorFilledBar = colors.success_400
|
11379
|
+
}) => {
|
11380
|
+
const RO = new Intl.NumberFormat("RO");
|
11381
|
+
const svg_ref = useRef(null);
|
11382
|
+
const [w, setW] = useState(0);
|
11383
|
+
const BAR_HEIGHT = 24;
|
11384
|
+
const configuration = useMemo(() => {
|
11385
|
+
const barY = height / 2 - BAR_HEIGHT / 2;
|
11386
|
+
const barYStop = barY + BAR_HEIGHT;
|
11387
|
+
const limitTopHeight = height - barYStop + BAR_HEIGHT;
|
11388
|
+
const limitTopX = Math.min(Math.max(0, limitTop / limitBottom * w), w - 2);
|
11389
|
+
const limitTopLabelsAnchor = limitTopX > w * 0.75 ? "end" : "start";
|
11390
|
+
const limitBottomX = w - 2;
|
11391
|
+
const limitBottomY = barY;
|
11392
|
+
const limitBottomHeight = limitTopHeight;
|
11393
|
+
return {
|
11394
|
+
barY,
|
11395
|
+
barYStop,
|
11396
|
+
limitTopHeight,
|
11397
|
+
limitTopX,
|
11398
|
+
limitTopLabelsAnchor,
|
11399
|
+
limitBottomY,
|
11400
|
+
limitBottomHeight,
|
11401
|
+
limitBottomX
|
11402
|
+
};
|
11403
|
+
}, [limitTop, limitBottom, height, w]);
|
11404
|
+
useEffect(() => {
|
11405
|
+
if (svg_ref.current) {
|
11406
|
+
setW(svg_ref.current.clientWidth);
|
11407
|
+
}
|
11408
|
+
}, [svg_ref]);
|
11409
|
+
return /* @__PURE__ */ jsxs(
|
11410
|
+
GraficContributieUnitlinkedStyled,
|
11411
|
+
{
|
11412
|
+
ref: svg_ref,
|
11413
|
+
width: "100%",
|
11414
|
+
height,
|
11415
|
+
xmlns: "http://www.w3.org/2000/svg",
|
11416
|
+
children: [
|
11417
|
+
/* @__PURE__ */ jsx(
|
11418
|
+
"rect",
|
11419
|
+
{
|
11420
|
+
x: 0,
|
11421
|
+
y: configuration.barY,
|
11422
|
+
width: "100%",
|
11423
|
+
height: BAR_HEIGHT,
|
11424
|
+
fill: colorBar
|
11425
|
+
}
|
11426
|
+
),
|
11427
|
+
/* @__PURE__ */ jsx(
|
11428
|
+
"rect",
|
11429
|
+
{
|
11430
|
+
x: 0,
|
11431
|
+
y: configuration.barY,
|
11432
|
+
width: configuration.limitTopX,
|
11433
|
+
height: BAR_HEIGHT,
|
11434
|
+
fill: colorFilledBar
|
11435
|
+
}
|
11436
|
+
),
|
11437
|
+
/* @__PURE__ */ jsx(
|
11438
|
+
"rect",
|
11439
|
+
{
|
11440
|
+
x: configuration.limitTopX,
|
11441
|
+
y: 0,
|
11442
|
+
height: configuration.limitTopHeight,
|
11443
|
+
fill: "black",
|
11444
|
+
width: 2
|
11445
|
+
}
|
11446
|
+
),
|
11447
|
+
/* @__PURE__ */ jsx(
|
11448
|
+
"text",
|
11449
|
+
{
|
11450
|
+
className: "limit_label_main",
|
11451
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
11452
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
11453
|
+
y: 12,
|
11454
|
+
children: limitTopLabel
|
11455
|
+
}
|
11456
|
+
),
|
11457
|
+
/* @__PURE__ */ jsx(
|
11458
|
+
"text",
|
11459
|
+
{
|
11460
|
+
className: "limit_label_secondary",
|
11461
|
+
textAnchor: configuration.limitTopLabelsAnchor,
|
11462
|
+
x: configuration.limitTopX + (configuration.limitTopLabelsAnchor === "start" ? 12 : -12),
|
11463
|
+
y: 12 + 20,
|
11464
|
+
children: RO.format(limitTop) + " " + currency
|
11465
|
+
}
|
11466
|
+
),
|
11467
|
+
/* @__PURE__ */ jsx(
|
11468
|
+
"rect",
|
11469
|
+
{
|
11470
|
+
x: configuration.limitBottomX,
|
11471
|
+
y: configuration.limitBottomY,
|
11472
|
+
height: configuration.limitBottomHeight,
|
11473
|
+
fill: "black",
|
11474
|
+
width: 2
|
11475
|
+
}
|
11476
|
+
),
|
11477
|
+
/* @__PURE__ */ jsx(
|
11478
|
+
"text",
|
11479
|
+
{
|
11480
|
+
className: "limit_label_main",
|
11481
|
+
textAnchor: "end",
|
11482
|
+
x: configuration.limitBottomX - 12,
|
11483
|
+
y: height - 20,
|
11484
|
+
children: limitBottomLabel
|
11485
|
+
}
|
11486
|
+
),
|
11487
|
+
/* @__PURE__ */ jsx(
|
11488
|
+
"text",
|
11489
|
+
{
|
11490
|
+
className: "limit_label_secondary",
|
11491
|
+
textAnchor: "end",
|
11492
|
+
x: configuration.limitBottomX - 12,
|
11493
|
+
y: height,
|
11494
|
+
children: RO.format(limitBottom) + " " + currency
|
11495
|
+
}
|
11496
|
+
)
|
11497
|
+
]
|
11498
|
+
}
|
11499
|
+
);
|
11500
|
+
};
|
11501
|
+
|
11358
11502
|
var _g$a, _g2$8, _path$8, _path2$8, _path3$8, _path4$8, _path5$8, _path6$8, _path7$8, _path8$8, _path9$8, _path0$8, _path1$7, _path10$6, _g3$8, _g4$4, _path11$5, _path12$5, _path13$3, _path14$3, _path15$3, _path16$3, _path17$3, _path18$3, _path19$3, _path20$3, _path21$3, _path22$3, _path23$3, _defs$a;
|
11359
11503
|
function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
|
11360
11504
|
var SvgMInvestingMoney = function SvgMInvestingMoney(props) {
|
@@ -26224,4 +26368,4 @@ const VerticalHeat = ({
|
|
26224
26368
|
] });
|
26225
26369
|
};
|
26226
26370
|
|
26227
|
-
export { Alert, AppBranding, AutosaveStatus, Bar, BreadcrumbItem, Breadcrumbs, Button, ButtonLink, Card, Checkbox, CityPicker, ConfigurationSaveInfo, Container, Content, ContentDropdown, CreditCard, DashboardCard, DashboardCategory, DashboardSmallShortcut, Datepicker, Divider, DonutGraph, Dropdown, Flex, FormField, GraficConfiguratiePensii, GraficFondInvestitii, GraficFondInvestitiiInflatie, GraficPensii, GraficPlanInvestitii, GraficPropunerePensii, Icon$1 as Icon, IconButton, IconCard, Illustration, ImageCard, InPageTab, InvestmentFundItem, LabeledText, LabeledTextInLine, Layout, Logo, Modal, ObjectiveCard, ObjectiveCardSmall, OfferCard, OperationsDashboardCard, OperationsDashboardCategory, PageMessage, PageTitle, Pill, PlanFinanciarAUMBar, PlanFinanciarAUMGraph, PlanulFinanciarTeaser, ProductTeaser, ProductTeaserButton, ProductTeaserParameters, ProductTeaserStep, ProposalPensii, ProposalUnitlinked, PropunereAsigurariCalatorie, PropunereFlexicredit, PropunereFondInvestitii, PropunuerePlanInvestitii as PropunerePlanInvestitii, Radio, RatesCalculator, Section, SegmentedTabs, SelectionButton, SelectionPill, ShortcutCard, Sidebar, SidebarItem, Slider, Spinner, StepTab, StepsBar, Switch, Tab, TextInput, TimedButton, TimelineSteps, TimelineStepsItem, Timer, UnitLinkGraph as UnitlinkGraph, VerticalHeat };
|
26371
|
+
export { Alert, AppBranding, AutosaveStatus, Bar, BreadcrumbItem, Breadcrumbs, Button, ButtonLink, Card, Checkbox, CityPicker, ConfigurationSaveInfo, Container, Content, ContentDropdown, CreditCard, DashboardCard, DashboardCategory, DashboardSmallShortcut, Datepicker, Divider, DonutGraph, Dropdown, Flex, FormField, GraficConfiguratiePensii, GraficContributieUnitlinked, GraficFondInvestitii, GraficFondInvestitiiInflatie, GraficPensii, GraficPlanInvestitii, GraficPropunerePensii, Icon$1 as Icon, IconButton, IconCard, Illustration, ImageCard, InPageTab, InvestmentFundItem, LabeledText, LabeledTextInLine, Layout, Logo, Modal, ObjectiveCard, ObjectiveCardSmall, OfferCard, OperationsDashboardCard, OperationsDashboardCategory, PageMessage, PageTitle, Pill, PlanFinanciarAUMBar, PlanFinanciarAUMGraph, PlanulFinanciarTeaser, ProductTeaser, ProductTeaserButton, ProductTeaserParameters, ProductTeaserStep, ProposalPensii, ProposalUnitlinked, PropunereAsigurariCalatorie, PropunereFlexicredit, PropunereFondInvestitii, PropunuerePlanInvestitii as PropunerePlanInvestitii, Radio, RatesCalculator, Section, SegmentedTabs, SelectionButton, SelectionPill, ShortcutCard, Sidebar, SidebarItem, Slider, Spinner, StepTab, StepsBar, Switch, Tab, TextInput, TimedButton, TimelineSteps, TimelineStepsItem, Timer, UnitLinkGraph as UnitlinkGraph, VerticalHeat };
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
|
3
|
+
interface GraficContributieUnitlinkedProps {
|
4
|
+
limitTop?: number;
|
5
|
+
limitTopLabel?: string;
|
6
|
+
limitBottom?: number;
|
7
|
+
limitBottomLabel?: string;
|
8
|
+
currency?: string;
|
9
|
+
height?: number;
|
10
|
+
colorBar?: string;
|
11
|
+
colorFilledBar?: string;
|
12
|
+
}
|
13
|
+
declare const GraficContributieUnitlinked: React.FC<GraficContributieUnitlinkedProps>;
|
14
|
+
|
15
|
+
export { GraficContributieUnitlinked as default };
|
16
|
+
export type { GraficContributieUnitlinkedProps };
|
package/build/types/index.d.ts
CHANGED
@@ -39,6 +39,7 @@ export { default as GraficPensii } from './components/GraficPensii/GraficPensii.
|
|
39
39
|
export { default as GraficPlanInvestitii, GraficPlanInvestitiiProps } from './components/GraficPlanInvestitii/GraficPlanInvestitii.js';
|
40
40
|
export { default as GraficPropunerePensii, GraficPropunerePensiiProps } from './components/GraficPropunerePensii/GraficPropunerePensii.js';
|
41
41
|
export { default as IconCard } from './components/IconCard/IconCard.js';
|
42
|
+
export { default as GraficContributieUnitlinked, GraficContributieUnitlinkedProps } from './components/GraficContributieUnitlinked/GraficContributieUnitlinked.js';
|
42
43
|
export { default as Illustration } from './components/Illustration/Illustration.js';
|
43
44
|
export { default as ImageCard, ImageCardProps } from './components/ImageCard/ImageCard.js';
|
44
45
|
export { default as InPageTab, InPageTabProps } from './components/InPageTab/InPageTab.js';
|