ag-common 0.0.798 → 0.0.800
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 +9 -14
- 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,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.SearchInline = void 0;
|
|
41
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
42
|
-
const react_1 = __importStar(require("react"));
|
|
43
|
-
const array_1 = require("../../../common/helpers/array");
|
|
44
|
-
const styles_1 = require("../../styles");
|
|
45
|
-
const SearchBox_1 = require("./SearchBox");
|
|
46
|
-
const Base = styled_1.default.div `
|
|
47
|
-
display: flex;
|
|
48
|
-
flex-flow: column;
|
|
49
|
-
flex-grow: 1;
|
|
50
|
-
width: 100%;
|
|
51
|
-
height: calc(100% - 1rem);
|
|
52
|
-
@media ${styles_1.smallScreen} {
|
|
53
|
-
height: calc(100% - 0.5rem);
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
const Content = styled_1.default.div `
|
|
57
|
-
width: calc(100% - 2rem);
|
|
58
|
-
margin: auto;
|
|
59
|
-
display: flex;
|
|
60
|
-
flex-flow: column;
|
|
61
|
-
justify-content: flex-start;
|
|
62
|
-
align-items: center;
|
|
63
|
-
max-height: 100%;
|
|
64
|
-
overflow-y: auto;
|
|
65
|
-
overflow-x: hidden;
|
|
66
|
-
|
|
67
|
-
flex-grow: 1;
|
|
68
|
-
&[data-hasitems='true'] {
|
|
69
|
-
padding-bottom: 0.5rem;
|
|
70
|
-
}
|
|
71
|
-
@media ${styles_1.smallScreen} {
|
|
72
|
-
margin: 0;
|
|
73
|
-
width: calc(100% - 0.5rem);
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
const RowCount = styled_1.default.div `
|
|
77
|
-
width: 100%;
|
|
78
|
-
text-align: center;
|
|
79
|
-
width: fit-content;
|
|
80
|
-
text-decoration-color: currentcolor;
|
|
81
|
-
text-decoration: underline;
|
|
82
|
-
|
|
83
|
-
&[data-top='true'] {
|
|
84
|
-
padding-bottom: 0.5rem;
|
|
85
|
-
}
|
|
86
|
-
&[data-top='false'] {
|
|
87
|
-
padding-top: 0.5rem;
|
|
88
|
-
}
|
|
89
|
-
`;
|
|
90
|
-
const SearchInline = (p) => {
|
|
91
|
-
var _a, _b, _c, _d, _e, _f;
|
|
92
|
-
const { maxDisplayItems = 1000 } = p;
|
|
93
|
-
const rowCountOptDisplay = (_b = (_a = p.rowCountOpt) === null || _a === void 0 ? void 0 : _a.display) !== null && _b !== void 0 ? _b : 'bottom';
|
|
94
|
-
const [searchText, setSearchText] = (0, react_1.useState)((_c = p.defaultValue) !== null && _c !== void 0 ? _c : '');
|
|
95
|
-
(0, react_1.useImperativeHandle)(p.textBoxRef, () => ({
|
|
96
|
-
setValue: (v) => {
|
|
97
|
-
var _a, _b;
|
|
98
|
-
const value = (_a = textBoxRef.current) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
99
|
-
if (v === value) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
(_b = textBoxRef.current) === null || _b === void 0 ? void 0 : _b.setValue(v);
|
|
103
|
-
setSearchText(v);
|
|
104
|
-
},
|
|
105
|
-
focus: () => { var _a; return (_a = textBoxRef.current) === null || _a === void 0 ? void 0 : _a.focus(); },
|
|
106
|
-
getValue: () => { var _a; return (_a = textBoxRef.current) === null || _a === void 0 ? void 0 : _a.getValue(); },
|
|
107
|
-
}));
|
|
108
|
-
const textBoxRef = (0, react_1.useRef)(null);
|
|
109
|
-
const resWrap = (foundItem, target) => {
|
|
110
|
-
var _a, _b;
|
|
111
|
-
if (!foundItem) {
|
|
112
|
-
(_a = p.onSelectItem) === null || _a === void 0 ? void 0 : _a.call(p, undefined);
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
(_b = p.onSelectItem) === null || _b === void 0 ? void 0 : _b.call(p, { foundItem, searchText, target });
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
const filteredItemsRaw = p.displayItems.filter((i) => p.willDisplayItem(searchText, i));
|
|
119
|
-
const { part: filteredItems } = (0, array_1.take)(filteredItemsRaw, maxDisplayItems < 0 ? filteredItemsRaw.length : maxDisplayItems);
|
|
120
|
-
const outdiff = filteredItems.length !== p.displayItems.length;
|
|
121
|
-
const showText = (_f = (_e = (_d = p.texts) === null || _d === void 0 ? void 0 : _d.totalItems) === null || _e === void 0 ? void 0 : _e.call(_d, filteredItems.length, p.displayItems.length)) !== null && _f !== void 0 ? _f : `Showing ${filteredItems.length} out of ${p.displayItems.length} total
|
|
122
|
-
items`;
|
|
123
|
-
return (react_1.default.createElement(Base, { className: p.className },
|
|
124
|
-
react_1.default.createElement(SearchBox_1.SearchBox, Object.assign({}, p, { searchText: searchText, setSearchText: (t) => {
|
|
125
|
-
var _a;
|
|
126
|
-
setSearchText(t);
|
|
127
|
-
(_a = p.onSearchTextChange) === null || _a === void 0 ? void 0 : _a.call(p, t);
|
|
128
|
-
}, textBoxRef: textBoxRef })),
|
|
129
|
-
react_1.default.createElement(Content, { "data-hasitems": !!filteredItems.length, "data-type": "content" },
|
|
130
|
-
rowCountOptDisplay === 'top' && outdiff && (react_1.default.createElement(RowCount, { "data-top": "true" }, showText)),
|
|
131
|
-
filteredItems.map((item, index) => (0, react_1.cloneElement)(p.renderItem({ searchText, item, index }), {
|
|
132
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
133
|
-
onClick: (e) => resWrap(item, e.target),
|
|
134
|
-
})),
|
|
135
|
-
rowCountOptDisplay === 'bottom' && outdiff && (react_1.default.createElement(RowCount, { "data-top": "false" }, showText)))));
|
|
136
|
-
};
|
|
137
|
-
exports.SearchInline = SearchInline;
|
|
@@ -1,28 +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.SearchModal = void 0;
|
|
8
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const styles_1 = require("../../styles");
|
|
11
|
-
const Modal_1 = require("../Modal/Modal");
|
|
12
|
-
const Inline_1 = require("./Inline");
|
|
13
|
-
const ModalStyled = (0, styled_1.default)(Modal_1.Modal) `
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-flow: column;
|
|
16
|
-
top: 10rem;
|
|
17
|
-
@media ${styles_1.bigScreen} {
|
|
18
|
-
width: 50vw;
|
|
19
|
-
max-width: 60rem;
|
|
20
|
-
}
|
|
21
|
-
@media ${styles_1.smallScreen} {
|
|
22
|
-
width: 100%;
|
|
23
|
-
max-width: 95vw;
|
|
24
|
-
}
|
|
25
|
-
`;
|
|
26
|
-
const SearchModal = (p) => (react_1.default.createElement(ModalStyled, { position: "center", topPosition: "center", open: true, setOpen: () => { var _a; return (_a = p.onSelectItem) === null || _a === void 0 ? void 0 : _a.call(p, undefined); }, showCloseButton: false, closeOnClickOutside: true },
|
|
27
|
-
react_1.default.createElement(Inline_1.SearchInline, Object.assign({}, p))));
|
|
28
|
-
exports.SearchModal = SearchModal;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { IRefTextEdit } from '../TextEdit';
|
|
3
|
-
export interface ISearchBox {
|
|
4
|
-
placeholderText?: string;
|
|
5
|
-
searchText: string;
|
|
6
|
-
setSearchText: (val: string, enterPressed: boolean) => void;
|
|
7
|
-
className?: string;
|
|
8
|
-
textBoxRef?: React.RefObject<IRefTextEdit | null>;
|
|
9
|
-
/**
|
|
10
|
-
* if truthy will enable text edit mode by default. if focus is true, will also focus on open
|
|
11
|
-
*/
|
|
12
|
-
defaultEditing?: {
|
|
13
|
-
focus?: boolean;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export declare const SearchBox: (p: ISearchBox) => React.JSX.Element;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.SearchBox = void 0;
|
|
41
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
42
|
-
const react_1 = __importStar(require("react"));
|
|
43
|
-
const debounce_1 = require("../../helpers/debounce");
|
|
44
|
-
const dom_1 = require("../../helpers/dom");
|
|
45
|
-
const icons_1 = require("../../icons");
|
|
46
|
-
const styles_1 = require("../../styles");
|
|
47
|
-
const TextEdit_1 = require("../TextEdit");
|
|
48
|
-
const Base = styled_1.default.div `
|
|
49
|
-
padding: 1rem;
|
|
50
|
-
display: flex;
|
|
51
|
-
flex-flow: row;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
align-items: center;
|
|
54
|
-
width: calc(100% - 2rem);
|
|
55
|
-
margin: auto;
|
|
56
|
-
position: relative;
|
|
57
|
-
|
|
58
|
-
@media ${styles_1.smallScreen} {
|
|
59
|
-
padding: 0.5rem;
|
|
60
|
-
margin: 0;
|
|
61
|
-
width: calc(100% - 1rem);
|
|
62
|
-
max-height: calc(100% - 1rem);
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
65
|
-
const MagnifyIcon = styled_1.default.div `
|
|
66
|
-
width: 1.5rem;
|
|
67
|
-
height: 1.5rem;
|
|
68
|
-
margin-right: 0.5rem;
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
margin-left: 0.5rem;
|
|
71
|
-
`;
|
|
72
|
-
const CrossIconStyled = (0, styled_1.default)(icons_1.CrossIcon) `
|
|
73
|
-
position: absolute;
|
|
74
|
-
right: 1rem;
|
|
75
|
-
@media ${styles_1.bigScreen} {
|
|
76
|
-
right: 2rem;
|
|
77
|
-
}
|
|
78
|
-
`;
|
|
79
|
-
const TextEditStyled = (0, styled_1.default)(TextEdit_1.TextEdit) `
|
|
80
|
-
padding: 0;
|
|
81
|
-
height: 2.5rem;
|
|
82
|
-
background-color: white;
|
|
83
|
-
`;
|
|
84
|
-
const SearchBox = (p) => {
|
|
85
|
-
const ur = (0, react_1.useRef)(p.textBoxRef);
|
|
86
|
-
const cr = (0, react_1.createRef)();
|
|
87
|
-
const textBoxRef = (!p.textBoxRef ? cr : ur);
|
|
88
|
-
(0, react_1.useEffect)(() => {
|
|
89
|
-
if (!(textBoxRef === null || textBoxRef === void 0 ? void 0 : textBoxRef.current) ||
|
|
90
|
-
textBoxRef.current.getValue() === p.searchText) {
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
textBoxRef.current.setValue(p.searchText);
|
|
94
|
-
p.setSearchText(p.searchText, true);
|
|
95
|
-
}, [p, textBoxRef]);
|
|
96
|
-
return (react_1.default.createElement(Base, Object.assign({ "data-type": "search", className: p.className }, (0, dom_1.filterDataProps)(p)),
|
|
97
|
-
react_1.default.createElement(TextEditStyled, { ref: textBoxRef, defaultValue: p.searchText, placeholder: p.placeholderText, defaultEditing: Object.assign({ focus: true }, p.defaultEditing), singleLine: true, leftContent: react_1.default.createElement(MagnifyIcon, { onClick: () => { var _a; return p.setSearchText(((_a = textBoxRef === null || textBoxRef === void 0 ? void 0 : textBoxRef.current) === null || _a === void 0 ? void 0 : _a.getValue()) || '', true); } },
|
|
98
|
-
react_1.default.createElement(icons_1.Magnify, null)), allowUndo: false, onClickOutsideWithNoValue: null, onSubmit: (v, enterPressed) => (0, debounce_1.debounce)(() => {
|
|
99
|
-
p.setSearchText(v, enterPressed);
|
|
100
|
-
}, { key: 'pagesearch', time: 200 }) }),
|
|
101
|
-
p.searchText && (react_1.default.createElement(CrossIconStyled, { onClick: () => {
|
|
102
|
-
var _a;
|
|
103
|
-
(_a = textBoxRef === null || textBoxRef === void 0 ? void 0 : textBoxRef.current) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
104
|
-
p.setSearchText('', true);
|
|
105
|
-
} }))));
|
|
106
|
-
};
|
|
107
|
-
exports.SearchBox = SearchBox;
|
|
@@ -1,21 +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("./AutoHideSearchBox"), exports);
|
|
18
|
-
__exportStar(require("./Dialog"), exports);
|
|
19
|
-
__exportStar(require("./Inline"), exports);
|
|
20
|
-
__exportStar(require("./Modal"), exports);
|
|
21
|
-
__exportStar(require("./SearchBox"), exports);
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { JSX } from 'react';
|
|
2
|
-
import type { IRefTextEdit } from '../TextEdit/types';
|
|
3
|
-
export type TSearchModalRes<T> = {
|
|
4
|
-
foundItem: T;
|
|
5
|
-
searchText: string;
|
|
6
|
-
target: EventTarget;
|
|
7
|
-
};
|
|
8
|
-
export interface ISearchDialog<T> {
|
|
9
|
-
defaultValue?: string;
|
|
10
|
-
placeholderText?: string;
|
|
11
|
-
/**
|
|
12
|
-
* method run to render each filtered item
|
|
13
|
-
* will inject onClick handler
|
|
14
|
-
*/
|
|
15
|
-
renderItem: ({ searchText, item, index, }: {
|
|
16
|
-
searchText: string;
|
|
17
|
-
item: T;
|
|
18
|
-
index: number;
|
|
19
|
-
}) => JSX.Element;
|
|
20
|
-
/**
|
|
21
|
-
* all potential items
|
|
22
|
-
*/
|
|
23
|
-
displayItems: T[];
|
|
24
|
-
/**
|
|
25
|
-
* run to filter items by search text
|
|
26
|
-
*/
|
|
27
|
-
willDisplayItem: (searchText: string, item: T) => boolean;
|
|
28
|
-
/** how many search items to return at most. default 1000. if -1 will return all */
|
|
29
|
-
maxDisplayItems?: number;
|
|
30
|
-
/**
|
|
31
|
-
* get unique render key
|
|
32
|
-
*/
|
|
33
|
-
getKeyF: (i: T) => string;
|
|
34
|
-
className?: string;
|
|
35
|
-
texts?: {
|
|
36
|
-
/**
|
|
37
|
-
* default if not provided: "showing X out of Y total items"
|
|
38
|
-
*/
|
|
39
|
-
totalItems?: (showing: number, outof: number) => string;
|
|
40
|
-
};
|
|
41
|
-
onSearchTextChange?: (v: string) => void;
|
|
42
|
-
onSelectItem?: (v: TSearchModalRes<T> | undefined) => void;
|
|
43
|
-
textBoxRef?: React.RefObject<IRefTextEdit | null>;
|
|
44
|
-
rowCountOpt?: {
|
|
45
|
-
/** if provided will change position of row count when some lines are hidden. default bottom */
|
|
46
|
-
display?: 'bottom' | 'top' | 'off';
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
export type ISearchModal<T> = ISearchDialog<T>;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ISidebar {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
/** default:defaultClosed
|
|
6
|
-
* defaultClosed: always closed by default.
|
|
7
|
-
* fixedOpen: always open on bigscreen. cant close if bigscreen
|
|
8
|
-
*/
|
|
9
|
-
mode?: 'defaultClosed' | 'fixedOpen';
|
|
10
|
-
}
|
|
11
|
-
export declare const Sidebar: ({ children, className, mode, }: ISidebar) => React.JSX.Element;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
'use client';
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.Sidebar = void 0;
|
|
41
|
-
const react_1 = require("@emotion/react");
|
|
42
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
43
|
-
const react_2 = __importStar(require("react"));
|
|
44
|
-
const helpers_1 = require("../../helpers");
|
|
45
|
-
const Hamburger_1 = require("../../icons/Hamburger");
|
|
46
|
-
const common_1 = require("../../styles/common");
|
|
47
|
-
const media_1 = require("../../styles/media");
|
|
48
|
-
const Chevron_1 = require("../Chevron");
|
|
49
|
-
const closedSidebarHover = (0, react_1.css) `
|
|
50
|
-
padding-left: 0.5rem;
|
|
51
|
-
width: 0.5rem;
|
|
52
|
-
background-color: rgba(0, 0, 0, 0.1);
|
|
53
|
-
cursor: pointer;
|
|
54
|
-
&:hover,
|
|
55
|
-
&:hover [data-hover='true'] {
|
|
56
|
-
background-color: #ccc;
|
|
57
|
-
}
|
|
58
|
-
&:hover {
|
|
59
|
-
border-right: solid 1px #999;
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
const Base = styled_1.default.div `
|
|
63
|
-
position: sticky;
|
|
64
|
-
top: 0;
|
|
65
|
-
transition: all 200ms;
|
|
66
|
-
border-right: solid 1px #ccc;
|
|
67
|
-
height: 100vh;
|
|
68
|
-
z-index: 1;
|
|
69
|
-
|
|
70
|
-
${common_1.NoTextSelect};
|
|
71
|
-
&:hover {
|
|
72
|
-
[data-type='content-block'] {
|
|
73
|
-
left: 1rem;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&[data-open='true'] {
|
|
78
|
-
width: fit-content;
|
|
79
|
-
|
|
80
|
-
@media ${media_1.smallScreen} {
|
|
81
|
-
max-width: unset;
|
|
82
|
-
position: fixed;
|
|
83
|
-
top: 0;
|
|
84
|
-
left: 0;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
&[data-open='false'] {
|
|
88
|
-
${closedSidebarHover};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
:not([data-open]) {
|
|
92
|
-
@media ${media_1.smallScreen} {
|
|
93
|
-
${closedSidebarHover};
|
|
94
|
-
}
|
|
95
|
-
@media ${media_1.bigScreen} {
|
|
96
|
-
width: fit-content;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
`;
|
|
100
|
-
const closedContentBlockOffScreen = (0, react_1.css) `
|
|
101
|
-
left: -100vw;
|
|
102
|
-
transition: left 200ms;
|
|
103
|
-
height: 100%;
|
|
104
|
-
`;
|
|
105
|
-
const ContentBlock = styled_1.default.div `
|
|
106
|
-
${closedContentBlockOffScreen};
|
|
107
|
-
&[data-open='false'] {
|
|
108
|
-
position: absolute;
|
|
109
|
-
top: 0;
|
|
110
|
-
z-index: 1;
|
|
111
|
-
width: fit-content;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
:not([data-open]) {
|
|
115
|
-
@media ${media_1.smallScreen} {
|
|
116
|
-
position: absolute;
|
|
117
|
-
${closedContentBlockOffScreen};
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
`;
|
|
121
|
-
const Content = styled_1.default.div `
|
|
122
|
-
display: flex;
|
|
123
|
-
flex-flow: column;
|
|
124
|
-
width: 100%;
|
|
125
|
-
height: 100%;
|
|
126
|
-
|
|
127
|
-
&[data-open='false'] {
|
|
128
|
-
filter: drop-shadow(1px 1px 0.5rem #555);
|
|
129
|
-
border-radius: 1rem;
|
|
130
|
-
background-color: rgba(255, 255, 255, 0.1);
|
|
131
|
-
}
|
|
132
|
-
`;
|
|
133
|
-
const HamburgerB = styled_1.default.div `
|
|
134
|
-
position: absolute;
|
|
135
|
-
transition: all 200ms;
|
|
136
|
-
z-index: 2;
|
|
137
|
-
|
|
138
|
-
&[data-hide-on-big='true'] {
|
|
139
|
-
@media ${media_1.bigScreen} {
|
|
140
|
-
display: none;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
&[data-open='false'] {
|
|
145
|
-
top: 0.5rem;
|
|
146
|
-
left: 0.25rem;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
:not([data-open]) {
|
|
150
|
-
@media ${media_1.bigScreen} {
|
|
151
|
-
top: 0.5rem;
|
|
152
|
-
right: -0.75rem;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
&[data-open='true'] {
|
|
156
|
-
top: 0.5rem;
|
|
157
|
-
right: -0.75rem;
|
|
158
|
-
}
|
|
159
|
-
display: flex;
|
|
160
|
-
justify-content: center;
|
|
161
|
-
align-items: center;
|
|
162
|
-
width: 1.5rem;
|
|
163
|
-
height: 1.5rem;
|
|
164
|
-
background-color: rgba(255, 255, 255, 0.9);
|
|
165
|
-
padding: 0.25rem;
|
|
166
|
-
&:hover {
|
|
167
|
-
background-color: rgba(255, 255, 255, 0.7);
|
|
168
|
-
}
|
|
169
|
-
border-radius: 50%;
|
|
170
|
-
border: solid 1px rgba(0, 0, 0, 0.5);
|
|
171
|
-
cursor: pointer;
|
|
172
|
-
`;
|
|
173
|
-
const ChevronStyled = (0, styled_1.default)(Chevron_1.Chevron) `
|
|
174
|
-
svg {
|
|
175
|
-
fill: #555;
|
|
176
|
-
}
|
|
177
|
-
`;
|
|
178
|
-
const Sidebar = ({ children, className, mode = 'defaultClosed', }) => {
|
|
179
|
-
const ref = (0, react_2.useRef)(null);
|
|
180
|
-
const [open, setOpen] = (0, react_2.useState)(mode === 'defaultClosed' ? false : null);
|
|
181
|
-
(0, helpers_1.useOnClickOutside)({ ref, disabled: () => !open || window.innerWidth > media_1.smallScreenPx }, () => {
|
|
182
|
-
setOpen(false);
|
|
183
|
-
});
|
|
184
|
-
return (react_2.default.createElement(Base, { "data-type": "sidebar", className: className, "data-open": open, onClick: () => !open && setOpen(true), "data-hover": true, ref: ref },
|
|
185
|
-
react_2.default.createElement(HamburgerB, { "data-hide-on-big": mode === 'fixedOpen', "data-open": open, onClick: (e) => {
|
|
186
|
-
e.stopPropagation();
|
|
187
|
-
setOpen(!open);
|
|
188
|
-
}, "data-hover": true }, open ? react_2.default.createElement(ChevronStyled, { point: "left", width: "100%" }) : react_2.default.createElement(Hamburger_1.Hamburger, null)),
|
|
189
|
-
react_2.default.createElement(ContentBlock, { "data-type": "content-block", "data-open": open },
|
|
190
|
-
react_2.default.createElement(Content, { "data-type": "content", "data-open": open, onClick: (e) => {
|
|
191
|
-
e.stopPropagation();
|
|
192
|
-
} }, children))));
|
|
193
|
-
};
|
|
194
|
-
exports.Sidebar = Sidebar;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ISparkLine {
|
|
3
|
-
/**
|
|
4
|
-
* default #4d76ff
|
|
5
|
-
*/
|
|
6
|
-
pointColour?: string;
|
|
7
|
-
className?: string;
|
|
8
|
-
data: TSparkLineData[];
|
|
9
|
-
pointTitleF?: (p: TSparkLineData) => string;
|
|
10
|
-
title?: string;
|
|
11
|
-
}
|
|
12
|
-
export type TSparkLineData = {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
};
|
|
16
|
-
export declare const SparkLine: (p: ISparkLine) => React.JSX.Element;
|
|
@@ -1,64 +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.SparkLine = void 0;
|
|
8
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
9
|
-
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const array_1 = require("../../../common/helpers/array");
|
|
11
|
-
const math_1 = require("../../../common/helpers/math");
|
|
12
|
-
const barWidth = 2;
|
|
13
|
-
const Base = styled_1.default.div `
|
|
14
|
-
width: calc(100% - 1px);
|
|
15
|
-
height: calc(100% - 1px);
|
|
16
|
-
border: solid 1px #666;
|
|
17
|
-
padding: 0;
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: flex-end;
|
|
21
|
-
overflow: hidden;
|
|
22
|
-
`;
|
|
23
|
-
const Points = styled_1.default.div `
|
|
24
|
-
position: relative;
|
|
25
|
-
width: calc(100% - ${barWidth}px);
|
|
26
|
-
height: calc(100% - ${barWidth}px);
|
|
27
|
-
margin-left: ${barWidth}px;
|
|
28
|
-
`;
|
|
29
|
-
const Point = styled_1.default.div `
|
|
30
|
-
position: absolute;
|
|
31
|
-
width: ${barWidth}px;
|
|
32
|
-
`;
|
|
33
|
-
const SparkLine = (p) => {
|
|
34
|
-
const { data: raw, pointColour = '#4d76ff' } = p;
|
|
35
|
-
const xMin = Math.min(...raw.map((d) => d.x));
|
|
36
|
-
const xMax = Math.max(...raw.map((d) => d.x));
|
|
37
|
-
const yMin = Math.min(...raw.map((d) => d.y));
|
|
38
|
-
const yMax = Math.max(...raw.map((d) => d.y));
|
|
39
|
-
const data = (0, array_1.distinctBy)(raw.map((orig) => ({
|
|
40
|
-
x: (0, math_1.rangePercentage)({
|
|
41
|
-
value: orig.x,
|
|
42
|
-
min: xMin,
|
|
43
|
-
max: xMax,
|
|
44
|
-
}) * 100,
|
|
45
|
-
y: (0, math_1.rangePercentage)({
|
|
46
|
-
value: orig.y,
|
|
47
|
-
min: yMin,
|
|
48
|
-
max: yMax,
|
|
49
|
-
}) * 100,
|
|
50
|
-
orig,
|
|
51
|
-
})), (s) => s.x);
|
|
52
|
-
return (react_1.default.createElement(Base, { className: p.className, title: p.title },
|
|
53
|
-
react_1.default.createElement(Points, null, data.map((pt) => {
|
|
54
|
-
var _a, _b;
|
|
55
|
-
return (react_1.default.createElement(Point, { title: (_b = (_a = p.pointTitleF) === null || _a === void 0 ? void 0 : _a.call(p, pt.orig)) !== null && _b !== void 0 ? _b : '', key: pt.x + ' ' + pt.y, style: {
|
|
56
|
-
backgroundColor: pointColour,
|
|
57
|
-
borderColor: pointColour,
|
|
58
|
-
left: `calc(${pt.x}% - ${barWidth}px)`,
|
|
59
|
-
bottom: 0,
|
|
60
|
-
height: `calc(${pt.y}% + ${barWidth}px)`,
|
|
61
|
-
} }));
|
|
62
|
-
}))));
|
|
63
|
-
};
|
|
64
|
-
exports.SparkLine = SparkLine;
|