ag-common 0.0.798 → 0.0.799
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/dist/ui/components/DarkMode/Base.js +6 -36
- package/dist/ui/components/index.d.ts +0 -33
- package/dist/ui/components/index.js +0 -33
- package/dist/ui/components/shadcn/button.d.ts +1 -1
- package/dist/ui/components/shadcn/dropdown-list.d.ts +13 -0
- package/dist/ui/components/shadcn/dropdown-list.js +57 -0
- package/dist/ui/components/shadcn/sheet.d.ts +1 -1
- package/dist/ui/icons/index.d.ts +1 -6
- package/dist/ui/icons/index.js +1 -4
- package/dist/ui/styles/common.d.ts +21 -14
- package/dist/ui/styles/common.js +44 -45
- package/dist/ui/styles/index.d.ts +0 -1
- package/dist/ui/styles/index.js +0 -1
- package/package.json +8 -13
- package/dist/ui/components/BarChart/Base.d.ts +0 -8
- package/dist/ui/components/BarChart/Base.js +0 -49
- package/dist/ui/components/BarChart/Item.d.ts +0 -12
- package/dist/ui/components/BarChart/Item.js +0 -38
- package/dist/ui/components/BarChart/Legend.d.ts +0 -8
- package/dist/ui/components/BarChart/Legend.js +0 -83
- package/dist/ui/components/BarChart/TooltipContent.d.ts +0 -8
- package/dist/ui/components/BarChart/TooltipContent.js +0 -51
- package/dist/ui/components/BarChart/getLegendItems.d.ts +0 -17
- package/dist/ui/components/BarChart/getLegendItems.js +0 -24
- package/dist/ui/components/BarChart/index.d.ts +0 -2
- package/dist/ui/components/BarChart/index.js +0 -17
- package/dist/ui/components/BarChart/types.d.ts +0 -9
- package/dist/ui/components/BarChart/types.js +0 -2
- package/dist/ui/components/BorderGradient/index.d.ts +0 -21
- package/dist/ui/components/BorderGradient/index.js +0 -77
- package/dist/ui/components/Chevron/index.d.ts +0 -12
- package/dist/ui/components/Chevron/index.js +0 -45
- package/dist/ui/components/Close/index.d.ts +0 -6
- package/dist/ui/components/Close/index.js +0 -41
- package/dist/ui/components/Confirm/Dialog.d.ts +0 -7
- package/dist/ui/components/Confirm/Dialog.js +0 -54
- package/dist/ui/components/Confirm/Modal.d.ts +0 -3
- package/dist/ui/components/Confirm/Modal.js +0 -53
- package/dist/ui/components/Confirm/index.d.ts +0 -3
- package/dist/ui/components/Confirm/index.js +0 -18
- package/dist/ui/components/Confirm/types.d.ts +0 -18
- package/dist/ui/components/Confirm/types.js +0 -2
- package/dist/ui/components/DropdownList/Base.d.ts +0 -3
- package/dist/ui/components/DropdownList/Base.js +0 -178
- package/dist/ui/components/DropdownList/Dialog.d.ts +0 -7
- package/dist/ui/components/DropdownList/Dialog.js +0 -54
- package/dist/ui/components/DropdownList/index.d.ts +0 -2
- package/dist/ui/components/DropdownList/index.js +0 -18
- package/dist/ui/components/DropdownList/types.d.ts +0 -37
- package/dist/ui/components/DropdownList/types.js +0 -2
- package/dist/ui/components/FlexColumn/index.d.ts +0 -3
- package/dist/ui/components/FlexColumn/index.js +0 -31
- package/dist/ui/components/FlexRow/index.d.ts +0 -3
- package/dist/ui/components/FlexRow/index.js +0 -37
- package/dist/ui/components/HorizontalScrollBar/index.d.ts +0 -5
- package/dist/ui/components/HorizontalScrollBar/index.js +0 -66
- package/dist/ui/components/Icon/index.d.ts +0 -31
- package/dist/ui/components/Icon/index.js +0 -69
- package/dist/ui/components/Image/index.d.ts +0 -13
- package/dist/ui/components/Image/index.js +0 -104
- package/dist/ui/components/InfiniteScroll/index.d.ts +0 -17
- package/dist/ui/components/InfiniteScroll/index.js +0 -99
- package/dist/ui/components/KebabDots/index.d.ts +0 -5
- package/dist/ui/components/KebabDots/index.js +0 -16
- package/dist/ui/components/LineChart/Base.d.ts +0 -3
- package/dist/ui/components/LineChart/Base.js +0 -121
- package/dist/ui/components/LineChart/LegendX.d.ts +0 -11
- package/dist/ui/components/LineChart/LegendX.js +0 -107
- package/dist/ui/components/LineChart/LegendY.d.ts +0 -7
- package/dist/ui/components/LineChart/LegendY.js +0 -44
- package/dist/ui/components/LineChart/TooltipContent.d.ts +0 -8
- package/dist/ui/components/LineChart/TooltipContent.js +0 -52
- package/dist/ui/components/LineChart/dateHelpers.d.ts +0 -3
- package/dist/ui/components/LineChart/dateHelpers.js +0 -36
- package/dist/ui/components/LineChart/getLegendItems.d.ts +0 -18
- package/dist/ui/components/LineChart/getLegendItems.js +0 -75
- package/dist/ui/components/LineChart/index.d.ts +0 -2
- package/dist/ui/components/LineChart/index.js +0 -17
- package/dist/ui/components/LineChart/interpolate.d.ts +0 -17
- package/dist/ui/components/LineChart/interpolate.js +0 -58
- package/dist/ui/components/LineChart/types.d.ts +0 -32
- package/dist/ui/components/LineChart/types.js +0 -2
- package/dist/ui/components/Loader/index.d.ts +0 -15
- package/dist/ui/components/Loader/index.js +0 -93
- package/dist/ui/components/MinSidebar/index.d.ts +0 -13
- package/dist/ui/components/MinSidebar/index.js +0 -93
- package/dist/ui/components/Modal/Dialog.d.ts +0 -8
- package/dist/ui/components/Modal/Dialog.js +0 -47
- package/dist/ui/components/Modal/Modal.d.ts +0 -7
- package/dist/ui/components/Modal/Modal.js +0 -178
- package/dist/ui/components/Modal/index.d.ts +0 -3
- package/dist/ui/components/Modal/index.js +0 -18
- package/dist/ui/components/Modal/types.d.ts +0 -16
- package/dist/ui/components/Modal/types.js +0 -2
- package/dist/ui/components/PieChart/index.d.ts +0 -11
- package/dist/ui/components/PieChart/index.js +0 -43
- package/dist/ui/components/ProgressBar/index.d.ts +0 -15
- package/dist/ui/components/ProgressBar/index.js +0 -96
- package/dist/ui/components/Prompt/Dialog.d.ts +0 -2
- package/dist/ui/components/Prompt/Dialog.js +0 -26
- package/dist/ui/components/Prompt/Modal.d.ts +0 -3
- package/dist/ui/components/Prompt/Modal.js +0 -111
- package/dist/ui/components/Prompt/index.d.ts +0 -3
- package/dist/ui/components/Prompt/index.js +0 -18
- package/dist/ui/components/Prompt/types.d.ts +0 -23
- package/dist/ui/components/Prompt/types.js +0 -2
- package/dist/ui/components/PulseRing/index.d.ts +0 -19
- package/dist/ui/components/PulseRing/index.js +0 -75
- package/dist/ui/components/RowOrColumn/index.d.ts +0 -15
- package/dist/ui/components/RowOrColumn/index.js +0 -46
- package/dist/ui/components/Search/AutoHideSearchBox.d.ts +0 -8
- package/dist/ui/components/Search/AutoHideSearchBox.js +0 -114
- package/dist/ui/components/Search/Dialog.d.ts +0 -7
- package/dist/ui/components/Search/Dialog.js +0 -60
- package/dist/ui/components/Search/Inline.d.ts +0 -3
- package/dist/ui/components/Search/Inline.js +0 -137
- package/dist/ui/components/Search/Modal.d.ts +0 -3
- package/dist/ui/components/Search/Modal.js +0 -28
- package/dist/ui/components/Search/SearchBox.d.ts +0 -16
- package/dist/ui/components/Search/SearchBox.js +0 -107
- package/dist/ui/components/Search/index.d.ts +0 -6
- package/dist/ui/components/Search/index.js +0 -21
- package/dist/ui/components/Search/types.d.ts +0 -49
- package/dist/ui/components/Search/types.js +0 -2
- package/dist/ui/components/Sidebar/index.d.ts +0 -11
- package/dist/ui/components/Sidebar/index.js +0 -194
- package/dist/ui/components/SparkLine/index.d.ts +0 -16
- package/dist/ui/components/SparkLine/index.js +0 -64
- package/dist/ui/components/TabBar/index.d.ts +0 -27
- package/dist/ui/components/TabBar/index.js +0 -100
- package/dist/ui/components/Table/index.d.ts +0 -11
- package/dist/ui/components/Table/index.js +0 -49
- package/dist/ui/components/TextEdit/CheckboxEdit.d.ts +0 -14
- package/dist/ui/components/TextEdit/CheckboxEdit.js +0 -104
- package/dist/ui/components/TextEdit/ColourEdit.d.ts +0 -5
- package/dist/ui/components/TextEdit/ColourEdit.js +0 -63
- package/dist/ui/components/TextEdit/LengthBox.d.ts +0 -5
- package/dist/ui/components/TextEdit/LengthBox.js +0 -28
- package/dist/ui/components/TextEdit/ListboxEdit.d.ts +0 -14
- package/dist/ui/components/TextEdit/ListboxEdit.js +0 -61
- package/dist/ui/components/TextEdit/TextEdit.d.ts +0 -3
- package/dist/ui/components/TextEdit/TextEdit.js +0 -145
- package/dist/ui/components/TextEdit/common.d.ts +0 -19
- package/dist/ui/components/TextEdit/common.js +0 -61
- package/dist/ui/components/TextEdit/index.d.ts +0 -5
- package/dist/ui/components/TextEdit/index.js +0 -20
- package/dist/ui/components/TextEdit/types.d.ts +0 -65
- package/dist/ui/components/TextEdit/types.js +0 -2
- package/dist/ui/components/TextWithButton/index.d.ts +0 -10
- package/dist/ui/components/TextWithButton/index.js +0 -89
- package/dist/ui/components/Timeline/index.d.ts +0 -22
- package/dist/ui/components/Timeline/index.js +0 -72
- package/dist/ui/components/TimelineChart/index.d.ts +0 -21
- package/dist/ui/components/TimelineChart/index.js +0 -63
- package/dist/ui/components/TreeChart/TooltipContent.d.ts +0 -7
- package/dist/ui/components/TreeChart/TooltipContent.js +0 -34
- package/dist/ui/components/TreeChart/base.d.ts +0 -3
- package/dist/ui/components/TreeChart/base.js +0 -144
- package/dist/ui/components/TreeChart/helpers.d.ts +0 -4
- package/dist/ui/components/TreeChart/helpers.js +0 -41
- package/dist/ui/components/TreeChart/index.d.ts +0 -2
- package/dist/ui/components/TreeChart/index.js +0 -17
- package/dist/ui/components/TreeChart/types.d.ts +0 -27
- package/dist/ui/components/TreeChart/types.js +0 -2
- package/dist/ui/components/UserImage/index.d.ts +0 -26
- package/dist/ui/components/UserImage/index.js +0 -109
- package/dist/ui/icons/CrossIcon.d.ts +0 -5
- package/dist/ui/icons/CrossIcon.js +0 -24
- package/dist/ui/styles/standaloneStyles.d.ts +0 -24
- package/dist/ui/styles/standaloneStyles.js +0 -69
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Item = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const styles_1 = require("../../styles");
|
|
10
|
-
const Base = styled_1.default.div `
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-flow: row;
|
|
13
|
-
width: 100%;
|
|
14
|
-
height: 100%;
|
|
15
|
-
cursor: default;
|
|
16
|
-
position: relative;
|
|
17
|
-
`;
|
|
18
|
-
const Title = styled_1.default.div `
|
|
19
|
-
position: absolute;
|
|
20
|
-
left: 0.25rem;
|
|
21
|
-
`;
|
|
22
|
-
const Item = ({ data, className, onMouseMove, onMouseLeave, maxWidth, style, }) => (react_1.default.createElement(Base, { className: className, onMouseMove: onMouseMove, onMouseLeave: onMouseLeave, style: style, "data-type": "bcb-item" },
|
|
23
|
-
react_1.default.createElement(Title, { style: {
|
|
24
|
-
color: style.color,
|
|
25
|
-
filter: (0, styles_1.HardOutlineFilter)(style.backgroundColor),
|
|
26
|
-
whiteSpace: 'nowrap',
|
|
27
|
-
} }, data.name),
|
|
28
|
-
data.values.map((v) => (react_1.default.createElement("div", { "data-barchartitem-key": v.name, key: v.name, style: {
|
|
29
|
-
height: '100%',
|
|
30
|
-
width: `${(v.value / maxWidth) * 100}%`,
|
|
31
|
-
backgroundColor: v.colour,
|
|
32
|
-
} }, "\u00A0"))),
|
|
33
|
-
react_1.default.createElement("div", { style: {
|
|
34
|
-
height: '100%',
|
|
35
|
-
flexGrow: 1,
|
|
36
|
-
backgroundColor: 'transparent',
|
|
37
|
-
} }, "\u00A0")));
|
|
38
|
-
exports.Item = Item;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IVarStyles } from '../../styles/common';
|
|
3
|
-
import type { IBarChartData } from './types';
|
|
4
|
-
export declare const Legend: ({ data, maxWidth, style, }: {
|
|
5
|
-
data: IBarChartData[];
|
|
6
|
-
maxWidth: number;
|
|
7
|
-
style: IVarStyles;
|
|
8
|
-
}) => React.JSX.Element;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Legend = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const array_1 = require("../../../common/helpers/array");
|
|
10
|
-
const getLegendItems_1 = require("./getLegendItems");
|
|
11
|
-
const Base = styled_1.default.div `
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-flow: column;
|
|
14
|
-
`;
|
|
15
|
-
const Bar = styled_1.default.div `
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 1rem;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-flow: row;
|
|
20
|
-
position: relative;
|
|
21
|
-
margin-bottom: 0.25rem;
|
|
22
|
-
`;
|
|
23
|
-
const Line = styled_1.default.div `
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: calc(50% - 1px);
|
|
26
|
-
height: 2px;
|
|
27
|
-
left: 0;
|
|
28
|
-
right: 0;
|
|
29
|
-
`;
|
|
30
|
-
const Numbers = styled_1.default.div `
|
|
31
|
-
width: 100%;
|
|
32
|
-
height: 1rem;
|
|
33
|
-
display: flex;
|
|
34
|
-
flex-flow: row;
|
|
35
|
-
justify-content: space-between;
|
|
36
|
-
z-index: 1;
|
|
37
|
-
`;
|
|
38
|
-
const Items = styled_1.default.div `
|
|
39
|
-
width: 100%;
|
|
40
|
-
display: flex;
|
|
41
|
-
flex-flow: row wrap;
|
|
42
|
-
position: relative;
|
|
43
|
-
justify-content: space-between;
|
|
44
|
-
`;
|
|
45
|
-
const Item = styled_1.default.div `
|
|
46
|
-
display: flex;
|
|
47
|
-
flex-flow: row;
|
|
48
|
-
position: relative;
|
|
49
|
-
align-items: center;
|
|
50
|
-
flex-basis: 25%;
|
|
51
|
-
`;
|
|
52
|
-
const Col = styled_1.default.div `
|
|
53
|
-
width: 1rem;
|
|
54
|
-
height: 1rem;
|
|
55
|
-
border-radius: 50%;
|
|
56
|
-
margin-right: 0.25rem;
|
|
57
|
-
`;
|
|
58
|
-
const Legend = ({ data, maxWidth, style, }) => {
|
|
59
|
-
const items = [0];
|
|
60
|
-
if (maxWidth > 10) {
|
|
61
|
-
items.push(Math.floor(maxWidth * 0.25));
|
|
62
|
-
items.push(Math.floor(maxWidth * 0.5));
|
|
63
|
-
items.push(Math.floor(maxWidth * 0.75));
|
|
64
|
-
}
|
|
65
|
-
items.push(maxWidth);
|
|
66
|
-
const keys = (0, array_1.distinctBy)((0, array_1.flat)(data.map((data) => {
|
|
67
|
-
return (0, getLegendItems_1.getLegendItems)({ data }).part.map((v) => ({
|
|
68
|
-
colour: v.colour,
|
|
69
|
-
name: v.name,
|
|
70
|
-
}));
|
|
71
|
-
})), (s) => s.name).sort((a, b) => (a.name < b.name ? -1 : 1));
|
|
72
|
-
return (react_1.default.createElement(Base, { style: style },
|
|
73
|
-
react_1.default.createElement(Bar, null,
|
|
74
|
-
react_1.default.createElement(Line, { style: { background: style.backgroundColor, color: style.color } }),
|
|
75
|
-
react_1.default.createElement(Numbers, null, items.map((i) => (react_1.default.createElement("span", { style: {
|
|
76
|
-
backgroundColor: style.backgroundColor,
|
|
77
|
-
color: style.color,
|
|
78
|
-
}, key: i }, i))))),
|
|
79
|
-
keys.length > 1 && (react_1.default.createElement(Items, null, keys.map((k) => (react_1.default.createElement(Item, { key: k.name },
|
|
80
|
-
react_1.default.createElement(Col, { style: { backgroundColor: k.colour } }),
|
|
81
|
-
k.name)))))));
|
|
82
|
-
};
|
|
83
|
-
exports.Legend = Legend;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IVarStyles } from '../../styles/common';
|
|
3
|
-
import type { IBarChartData } from './types';
|
|
4
|
-
export declare const TooltipContent: ({ data, selectedKey, style, }: {
|
|
5
|
-
data: IBarChartData;
|
|
6
|
-
selectedKey?: string;
|
|
7
|
-
style: IVarStyles;
|
|
8
|
-
}) => React.JSX.Element;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TooltipContent = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const getLegendItems_1 = require("./getLegendItems");
|
|
10
|
-
const Base = styled_1.default.div `
|
|
11
|
-
padding: 0.5rem;
|
|
12
|
-
`;
|
|
13
|
-
const Title = styled_1.default.div `
|
|
14
|
-
font-weight: bold;
|
|
15
|
-
`;
|
|
16
|
-
const Row = styled_1.default.div `
|
|
17
|
-
width: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
`;
|
|
20
|
-
const ItemTitle = styled_1.default.span `
|
|
21
|
-
&[data-selected='true'] {
|
|
22
|
-
font-weight: bold;
|
|
23
|
-
text-decoration: underline;
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
const Total = styled_1.default.span `
|
|
27
|
-
margin-left: auto;
|
|
28
|
-
padding-left: 0.5rem;
|
|
29
|
-
|
|
30
|
-
&[data-selected='true'] {
|
|
31
|
-
font-weight: bold;
|
|
32
|
-
text-decoration: underline;
|
|
33
|
-
}
|
|
34
|
-
`;
|
|
35
|
-
const TooltipContent = ({ data, selectedKey, style, }) => {
|
|
36
|
-
const { part, rest, restTotal } = (0, getLegendItems_1.getLegendItems)({ data, selectedKey });
|
|
37
|
-
return (react_1.default.createElement(Base, { style: Object.assign(Object.assign({}, style), { border: `solid 1px ${style.borderColor}` }) },
|
|
38
|
-
react_1.default.createElement(Title, null, data.name),
|
|
39
|
-
react_1.default.createElement(Row, null,
|
|
40
|
-
react_1.default.createElement("span", null, "total"),
|
|
41
|
-
react_1.default.createElement(Total, null, data.total)),
|
|
42
|
-
part.map((v) => (react_1.default.createElement(Row, { style: { color: v.colour }, key: v.name },
|
|
43
|
-
react_1.default.createElement(ItemTitle, { "data-selected": selectedKey === v.name }, v.name),
|
|
44
|
-
react_1.default.createElement(Total, { "data-selected": selectedKey === v.name }, v.value)))),
|
|
45
|
-
rest.length > 0 && (react_1.default.createElement(Row, null,
|
|
46
|
-
react_1.default.createElement("span", null,
|
|
47
|
-
rest.length,
|
|
48
|
-
" more"),
|
|
49
|
-
react_1.default.createElement(Total, null, restTotal)))));
|
|
50
|
-
};
|
|
51
|
-
exports.TooltipContent = TooltipContent;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { IBarChartData } from './types';
|
|
2
|
-
export declare const getLegendItems: ({ data, selectedKey, }: {
|
|
3
|
-
data: IBarChartData;
|
|
4
|
-
selectedKey?: string;
|
|
5
|
-
}) => {
|
|
6
|
-
part: {
|
|
7
|
-
name: string;
|
|
8
|
-
value: number;
|
|
9
|
-
colour: string;
|
|
10
|
-
}[];
|
|
11
|
-
rest: {
|
|
12
|
-
name: string;
|
|
13
|
-
value: number;
|
|
14
|
-
colour: string;
|
|
15
|
-
}[];
|
|
16
|
-
restTotal: number;
|
|
17
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLegendItems = void 0;
|
|
4
|
-
const array_1 = require("../../../common/helpers/array");
|
|
5
|
-
const math_1 = require("../../../common/helpers/math");
|
|
6
|
-
const object_1 = require("../../../common/helpers/object");
|
|
7
|
-
const getLegendItems = ({ data, selectedKey, }) => {
|
|
8
|
-
const min = data.total * 0.1;
|
|
9
|
-
const shownResults = 4;
|
|
10
|
-
const part = (0, array_1.take)(data.values.filter((r) => r.value > min), shownResults).part;
|
|
11
|
-
const rest = (0, object_1.copy)(data.values).filter((r) => !part.find((p) => p.name === r.name));
|
|
12
|
-
//if we want to ensure this value exists in the returned results
|
|
13
|
-
if (selectedKey) {
|
|
14
|
-
const pi = part.findIndex((r) => r.name === selectedKey);
|
|
15
|
-
const ri = rest.findIndex((r) => r.name === selectedKey);
|
|
16
|
-
if (pi === -1 && ri !== -1) {
|
|
17
|
-
part.push(rest[ri]);
|
|
18
|
-
rest.splice(ri, 1);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
const restTotal = (0, math_1.sumArray)(rest.map((s) => s.value));
|
|
22
|
-
return { part, rest, restTotal };
|
|
23
|
-
};
|
|
24
|
-
exports.getLegendItems = getLegendItems;
|
|
@@ -1,17 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Base"), exports);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type IOnClick = React.MouseEvent<HTMLDivElement, MouseEvent> | React.MouseEvent<HTMLAnchorElement, MouseEvent>;
|
|
3
|
-
export interface IBorderGradient {
|
|
4
|
-
canClick?: boolean;
|
|
5
|
-
noGrow?: boolean;
|
|
6
|
-
className?: string;
|
|
7
|
-
fill?: boolean;
|
|
8
|
-
/** default 2rem */
|
|
9
|
-
radius?: string;
|
|
10
|
-
left?: string;
|
|
11
|
-
right?: string;
|
|
12
|
-
children: React.ReactNode;
|
|
13
|
-
padding?: string;
|
|
14
|
-
onClick?: (e: IOnClick) => void;
|
|
15
|
-
href?: string;
|
|
16
|
-
target?: string;
|
|
17
|
-
rel?: string;
|
|
18
|
-
disabled?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare const BorderGradient: ({ left, right, children, radius, fill, padding, className, onClick, href, target, rel, noGrow, disabled, canClick, }: IBorderGradient) => React.JSX.Element;
|
|
21
|
-
export {};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.BorderGradient = void 0;
|
|
8
|
-
const react_1 = require("@emotion/react");
|
|
9
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
10
|
-
const react_2 = __importDefault(require("react"));
|
|
11
|
-
const object_1 = require("../../../common/helpers/object");
|
|
12
|
-
const colours_1 = require("../../styles/colours");
|
|
13
|
-
const BGcss = (0, react_1.css) `
|
|
14
|
-
max-height: calc(100% - 6px);
|
|
15
|
-
display: flex;
|
|
16
|
-
border: 0;
|
|
17
|
-
padding: 3px;
|
|
18
|
-
background-image:
|
|
19
|
-
linear-gradient(white, white),
|
|
20
|
-
linear-gradient(to bottom right, var(--left), var(--right));
|
|
21
|
-
background-origin: border-box;
|
|
22
|
-
background-clip: content-box, border-box;
|
|
23
|
-
overflow: hidden;
|
|
24
|
-
&[data-ccnd='true'] {
|
|
25
|
-
&:hover {
|
|
26
|
-
filter: saturate(3);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
`;
|
|
30
|
-
const BGLink = styled_1.default.div `
|
|
31
|
-
${BGcss};
|
|
32
|
-
`;
|
|
33
|
-
const BGALink = styled_1.default.a `
|
|
34
|
-
${BGcss};
|
|
35
|
-
`;
|
|
36
|
-
const Padding = styled_1.default.div `
|
|
37
|
-
justify-content: center;
|
|
38
|
-
align-items: center;
|
|
39
|
-
display: flex;
|
|
40
|
-
flex-flow: column;
|
|
41
|
-
border: 0;
|
|
42
|
-
flex-grow: 1;
|
|
43
|
-
`;
|
|
44
|
-
const FeatureBoxFill = (0, styled_1.default)(Padding) `
|
|
45
|
-
background-image: linear-gradient(to bottom right, var(--left), var(--right));
|
|
46
|
-
color: ${colours_1.colours.mainLight};
|
|
47
|
-
flex-grow: 1;
|
|
48
|
-
`;
|
|
49
|
-
const BorderGradient = ({ left = colours_1.colours.orange, right = colours_1.colours.orangeRed, children, radius = '2rem', fill = false, padding = '2rem', className, onClick, href, target, rel, noGrow = false, disabled = false, canClick = false, }) => {
|
|
50
|
-
const CCND = canClick && !disabled;
|
|
51
|
-
const style = (0, object_1.removeUndefValuesFromObject)({
|
|
52
|
-
flexGrow: noGrow ? 0 : 1,
|
|
53
|
-
'--left': left,
|
|
54
|
-
'--right': right,
|
|
55
|
-
borderRadius: radius,
|
|
56
|
-
filter: !disabled ? null : 'grayscale(1)',
|
|
57
|
-
cursor: CCND ? 'pointer' : 'default',
|
|
58
|
-
});
|
|
59
|
-
const props = {
|
|
60
|
-
onClick: (e) => !disabled && onClick && onClick(e),
|
|
61
|
-
className,
|
|
62
|
-
href,
|
|
63
|
-
target,
|
|
64
|
-
rel,
|
|
65
|
-
canClick: !!onClick || canClick,
|
|
66
|
-
style,
|
|
67
|
-
'data-ccnd': CCND,
|
|
68
|
-
};
|
|
69
|
-
const child = (react_2.default.createElement(react_2.default.Fragment, null,
|
|
70
|
-
!fill && react_2.default.createElement(Padding, { style: { padding } }, children),
|
|
71
|
-
fill && react_2.default.createElement(FeatureBoxFill, { style: { padding } }, children)));
|
|
72
|
-
if (href) {
|
|
73
|
-
return react_2.default.createElement(BGALink, Object.assign({}, props), child);
|
|
74
|
-
}
|
|
75
|
-
return react_2.default.createElement(BGLink, Object.assign({}, props), child);
|
|
76
|
-
};
|
|
77
|
-
exports.BorderGradient = BorderGradient;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface IChevron {
|
|
3
|
-
/**
|
|
4
|
-
* default right
|
|
5
|
-
*/
|
|
6
|
-
point: 'up' | 'down' | 'left' | 'right';
|
|
7
|
-
colour?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
width?: string;
|
|
10
|
-
onToggle?: () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const Chevron: ({ width, className, colour, onToggle, point, }: IChevron) => React.JSX.Element;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.Chevron = void 0;
|
|
8
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const ChevronRight_1 = require("../../icons/ChevronRight");
|
|
11
|
-
const Icon_1 = require("../Icon");
|
|
12
|
-
const Base = styled_1.default.span `
|
|
13
|
-
font-size: 2rem;
|
|
14
|
-
display: flex;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
align-items: center;
|
|
17
|
-
`;
|
|
18
|
-
const IconStyled = (0, styled_1.default)(Icon_1.Icon) `
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
margin: 0;
|
|
21
|
-
padding: 0;
|
|
22
|
-
`;
|
|
23
|
-
const Chevron = ({ width = '1.2rem', className, colour = 'black', onToggle, point = 'right', }) => {
|
|
24
|
-
let rotate = 0;
|
|
25
|
-
switch (point) {
|
|
26
|
-
case 'down': {
|
|
27
|
-
rotate = 90;
|
|
28
|
-
break;
|
|
29
|
-
}
|
|
30
|
-
case 'left': {
|
|
31
|
-
rotate = 180;
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
case 'up': {
|
|
35
|
-
rotate = 270;
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
case 'right': {
|
|
39
|
-
rotate = 0;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return (react_1.default.createElement(Base, { className: className, onClick: () => onToggle === null || onToggle === void 0 ? void 0 : onToggle(), onTouchStart: () => onToggle === null || onToggle === void 0 ? void 0 : onToggle(), onKeyDown: (e) => e.key === 'Enter' && (onToggle === null || onToggle === void 0 ? void 0 : onToggle()) },
|
|
43
|
-
react_1.default.createElement(IconStyled, { rotate: rotate, style: { width, height: width, fill: colour } }, ChevronRight_1.ChevronRight)));
|
|
44
|
-
};
|
|
45
|
-
exports.Chevron = Chevron;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.Close = void 0;
|
|
8
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const dom_1 = require("../../helpers/dom");
|
|
11
|
-
const Base = styled_1.default.div `
|
|
12
|
-
position: absolute;
|
|
13
|
-
z-index: 1;
|
|
14
|
-
width: 32px;
|
|
15
|
-
height: 32px;
|
|
16
|
-
opacity: 0.3;
|
|
17
|
-
cursor: pointer;
|
|
18
|
-
background-color: white;
|
|
19
|
-
top: 0;
|
|
20
|
-
right: 0;
|
|
21
|
-
&:hover {
|
|
22
|
-
opacity: 1;
|
|
23
|
-
}
|
|
24
|
-
&:before,
|
|
25
|
-
&:after {
|
|
26
|
-
position: absolute;
|
|
27
|
-
left: 15px;
|
|
28
|
-
content: ' ';
|
|
29
|
-
height: 33px;
|
|
30
|
-
width: 2px;
|
|
31
|
-
background-color: #333;
|
|
32
|
-
}
|
|
33
|
-
&:before {
|
|
34
|
-
transform: rotate(45deg);
|
|
35
|
-
}
|
|
36
|
-
&:after {
|
|
37
|
-
transform: rotate(-45deg);
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
const Close = (p) => (react_1.default.createElement(Base, Object.assign({}, (0, dom_1.filterDataProps)(p), { className: p.className, onClick: (e) => { var _a; return (_a = p.onClick) === null || _a === void 0 ? void 0 : _a.call(p, e); } })));
|
|
41
|
-
exports.Close = Close;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ConfirmDialog = void 0;
|
|
16
|
-
const react_1 = __importDefault(require("react"));
|
|
17
|
-
const client_1 = require("react-dom/client");
|
|
18
|
-
const log_1 = require("../../../common/helpers/log");
|
|
19
|
-
const Modal_1 = require("./Modal");
|
|
20
|
-
/**
|
|
21
|
-
* opens a dialog programatically
|
|
22
|
-
* @param param0
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
const ConfirmDialog = (_a) => __awaiter(void 0, [_a], void 0, function* ({ bottomText, topText, style, }) {
|
|
26
|
-
return new Promise((res) => {
|
|
27
|
-
const idName = 'ag-confirm-dialog';
|
|
28
|
-
if (document.body.querySelectorAll('#' + idName).length !== 0) {
|
|
29
|
-
(0, log_1.error)('confirmDialog already open');
|
|
30
|
-
res(false);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const wrapper = document.body.appendChild(document.createElement('div'));
|
|
34
|
-
wrapper.id = idName;
|
|
35
|
-
const root = (0, client_1.createRoot)(wrapper);
|
|
36
|
-
const onSubmit = (v) => {
|
|
37
|
-
try {
|
|
38
|
-
res(v);
|
|
39
|
-
}
|
|
40
|
-
finally {
|
|
41
|
-
try {
|
|
42
|
-
root.unmount();
|
|
43
|
-
wrapper.remove();
|
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
45
|
-
}
|
|
46
|
-
catch (e) {
|
|
47
|
-
//
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
root.render(react_1.default.createElement(Modal_1.ConfirmModal, { bottomText: bottomText, topText: topText, onSubmit: onSubmit, style: style }));
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
exports.ConfirmDialog = ConfirmDialog;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ConfirmModal = void 0;
|
|
8
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const FlexColumn_1 = require("../FlexColumn");
|
|
11
|
-
const FlexRow_1 = require("../FlexRow");
|
|
12
|
-
const Modal_1 = require("../Modal/Modal");
|
|
13
|
-
const button_1 = require("../shadcn/button");
|
|
14
|
-
const Base = styled_1.default.div `
|
|
15
|
-
width: 95vw;
|
|
16
|
-
max-width: 30rem;
|
|
17
|
-
height: 50vh;
|
|
18
|
-
max-height: 15rem;
|
|
19
|
-
`;
|
|
20
|
-
const Content = (0, styled_1.default)(FlexColumn_1.FlexColumn) `
|
|
21
|
-
padding: 1rem;
|
|
22
|
-
height: calc(100% - 2rem);
|
|
23
|
-
width: calc(100% - 2rem);
|
|
24
|
-
`;
|
|
25
|
-
const TopText = styled_1.default.div `
|
|
26
|
-
font-weight: bold;
|
|
27
|
-
border-bottom: solid 1px #ccc;
|
|
28
|
-
padding-bottom: 0.25rem;
|
|
29
|
-
font-size: 1.5rem;
|
|
30
|
-
margin-bottom: 1rem;
|
|
31
|
-
`;
|
|
32
|
-
const BottomText = styled_1.default.div `
|
|
33
|
-
padding-bottom: 0.25rem;
|
|
34
|
-
font-size: 1.1rem;
|
|
35
|
-
`;
|
|
36
|
-
const Bottom = (0, styled_1.default)(FlexRow_1.FlexRow) `
|
|
37
|
-
margin-top: auto;
|
|
38
|
-
justify-content: flex-end;
|
|
39
|
-
> button:first-of-type {
|
|
40
|
-
margin-right: 1rem;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
43
|
-
const ConfirmModal = ({ onSubmit, bottomText, topText, okText = 'OK', cancelText = 'Cancel', style, }) => {
|
|
44
|
-
return (react_1.default.createElement(Modal_1.Modal, { position: "center", topPosition: "center", open: true, setOpen: () => onSubmit(false), showCloseButton: false, closeOnClickOutside: false },
|
|
45
|
-
react_1.default.createElement(Base, null,
|
|
46
|
-
react_1.default.createElement(Content, { style: style },
|
|
47
|
-
topText && react_1.default.createElement(TopText, null, topText),
|
|
48
|
-
react_1.default.createElement(BottomText, null, bottomText),
|
|
49
|
-
react_1.default.createElement(Bottom, { noGrow: true },
|
|
50
|
-
react_1.default.createElement(button_1.Button, { onClick: () => onSubmit(true) }, okText),
|
|
51
|
-
react_1.default.createElement(button_1.Button, { variant: "outline", onClick: () => onSubmit(false) }, cancelText))))));
|
|
52
|
-
};
|
|
53
|
-
exports.ConfirmModal = ConfirmModal;
|
|
@@ -1,18 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Dialog"), exports);
|
|
18
|
-
__exportStar(require("./Modal"), exports);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from 'react';
|
|
2
|
-
export interface IConfirmDialog {
|
|
3
|
-
/** default (undefined) */
|
|
4
|
-
topText?: string;
|
|
5
|
-
bottomText: string;
|
|
6
|
-
style?: CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
export interface IConfirmModal {
|
|
9
|
-
onSubmit: (v: boolean) => void;
|
|
10
|
-
/** default (undefined) */
|
|
11
|
-
topText?: string;
|
|
12
|
-
bottomText: string;
|
|
13
|
-
/** default OK */
|
|
14
|
-
okText?: string;
|
|
15
|
-
/** default Cancel */
|
|
16
|
-
cancelText?: string;
|
|
17
|
-
style?: CSSProperties;
|
|
18
|
-
}
|