ag-common 0.0.418 → 0.0.419
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/api/helpers/api.js +34 -35
- package/dist/api/helpers/aws.js +9 -13
- package/dist/api/helpers/cloudfront.js +7 -24
- package/dist/api/helpers/dynamo.js +85 -134
- package/dist/api/helpers/dynamoInfra.js +14 -19
- package/dist/api/helpers/enforceDynamoProvisionCap.js +14 -18
- package/dist/api/helpers/index.js +14 -30
- package/dist/api/helpers/openApiHelpers.d.ts +2 -3
- package/dist/api/helpers/openApiHelpers.js +34 -37
- package/dist/api/helpers/s3.js +81 -126
- package/dist/api/helpers/ses.js +9 -28
- package/dist/api/helpers/sqs.js +9 -26
- package/dist/api/helpers/ssm.js +8 -14
- package/dist/api/helpers/sts.js +16 -34
- package/dist/api/helpers/validateOpenApi.js +92 -103
- package/dist/api/helpers/validations.js +29 -46
- package/dist/api/index.js +2 -18
- package/dist/api/openapi-prefix.js +25 -38
- package/dist/api/types/aws.js +1 -2
- package/dist/api/types/index.js +1 -17
- package/dist/common/const.js +2 -5
- package/dist/common/helpers/array.js +8 -19
- package/dist/common/helpers/async.js +10 -28
- package/dist/common/helpers/binary.js +5 -10
- package/dist/common/helpers/date.js +14 -25
- package/dist/common/helpers/email.js +5 -11
- package/dist/common/helpers/func.js +3 -7
- package/dist/common/helpers/generator.js +9 -24
- package/dist/common/helpers/groupBy.js +3 -9
- package/dist/common/helpers/hashCode.js +3 -9
- package/dist/common/helpers/i18n.js +9 -17
- package/dist/common/helpers/index.js +18 -34
- package/dist/common/helpers/log.js +16 -28
- package/dist/common/helpers/math.js +9 -21
- package/dist/common/helpers/memo.js +3 -7
- package/dist/common/helpers/object.js +20 -35
- package/dist/common/helpers/random.js +4 -10
- package/dist/common/helpers/secondsInNearest.js +2 -7
- package/dist/common/helpers/sleep.js +1 -5
- package/dist/common/helpers/string/base64.js +2 -7
- package/dist/common/helpers/string/chunk.js +1 -5
- package/dist/common/helpers/string/contains.js +2 -7
- package/dist/common/helpers/string/getExtendedStringSegment.js +5 -9
- package/dist/common/helpers/string/index.js +10 -26
- package/dist/common/helpers/string/json.js +1 -5
- package/dist/common/helpers/string/object.js +1 -5
- package/dist/common/helpers/string/surround.js +1 -5
- package/dist/common/helpers/string/trim.js +2 -7
- package/dist/common/helpers/string/truncate.js +1 -5
- package/dist/common/helpers/string/url.js +4 -9
- package/dist/common/index.js +2 -18
- package/dist/index.js +3 -19
- package/dist/ui/components/BorderGradient/index.js +18 -25
- package/dist/ui/components/Button/index.js +17 -25
- package/dist/ui/components/Chevron/index.js +9 -16
- package/dist/ui/components/Close/index.js +6 -13
- package/dist/ui/components/Confirm/Dialog.js +9 -25
- package/dist/ui/components/Confirm/Modal.js +20 -27
- package/dist/ui/components/Confirm/index.js +3 -19
- package/dist/ui/components/Confirm/types.js +1 -2
- package/dist/ui/components/DropdownList/Base.js +33 -64
- package/dist/ui/components/DropdownList/Dialog.js +8 -24
- package/dist/ui/components/DropdownList/index.js +2 -18
- package/dist/ui/components/DropdownList/types.js +1 -2
- package/dist/ui/components/FlexColumn/index.js +4 -14
- package/dist/ui/components/FlexRow/index.js +4 -14
- package/dist/ui/components/HeadersRaw/index.js +20 -27
- package/dist/ui/components/HorizontalScrollBar/index.js +6 -34
- package/dist/ui/components/Icon/index.js +9 -16
- package/dist/ui/components/Image/index.js +10 -28
- package/dist/ui/components/InfiniteScroll/index.js +18 -50
- package/dist/ui/components/KebabDots/index.js +6 -13
- package/dist/ui/components/Loader/index.js +9 -39
- package/dist/ui/components/Modal/Dialog.js +7 -23
- package/dist/ui/components/Modal/Modal.js +19 -49
- package/dist/ui/components/Modal/index.js +3 -19
- package/dist/ui/components/Modal/types.js +1 -2
- package/dist/ui/components/OpenApiCodeBlock/OpenApiCodeBlock.js +26 -34
- package/dist/ui/components/OpenApiCodeBlock/curl/helpers/body.js +12 -19
- package/dist/ui/components/OpenApiCodeBlock/curl/helpers/getCurlLines.js +6 -11
- package/dist/ui/components/OpenApiCodeBlock/curl/helpers/security.js +8 -15
- package/dist/ui/components/OpenApiCodeBlock/curl/index.js +14 -21
- package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/call.js +8 -15
- package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/getFetchLines.js +3 -8
- package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/req.js +27 -34
- package/dist/ui/components/OpenApiCodeBlock/fetch/index.js +11 -18
- package/dist/ui/components/OpenApiCodeBlock/helpers/common.js +7 -17
- package/dist/ui/components/OpenApiCodeBlock/helpers/joinJsx.js +6 -15
- package/dist/ui/components/OpenApiCodeBlock/index.js +2 -18
- package/dist/ui/components/OpenApiCodeBlock/types.js +1 -2
- package/dist/ui/components/PieChart/index.js +11 -18
- package/dist/ui/components/ProgressBar/index.js +15 -45
- package/dist/ui/components/Prompt/Dialog.js +7 -23
- package/dist/ui/components/Prompt/Modal.js +25 -55
- package/dist/ui/components/Prompt/index.js +2 -18
- package/dist/ui/components/RowOrColumn/index.js +7 -17
- package/dist/ui/components/Search/AutoHideSearchBox.js +24 -56
- package/dist/ui/components/Search/Base.js +21 -52
- package/dist/ui/components/Search/Dialog.js +10 -26
- package/dist/ui/components/Search/Inline.js +3 -10
- package/dist/ui/components/Search/Modal.js +10 -17
- package/dist/ui/components/Search/SearchBox.js +26 -58
- package/dist/ui/components/Search/index.js +7 -23
- package/dist/ui/components/Search/types.js +1 -2
- package/dist/ui/components/Sidebar/index.js +18 -25
- package/dist/ui/components/SparkLine/index.js +17 -27
- package/dist/ui/components/Table/index.js +15 -22
- package/dist/ui/components/TextEdit/CheckboxEdit.js +21 -51
- package/dist/ui/components/TextEdit/ColourEdit.js +17 -44
- package/dist/ui/components/TextEdit/LengthBox.js +5 -12
- package/dist/ui/components/TextEdit/ListboxEdit.js +15 -42
- package/dist/ui/components/TextEdit/RadioGroup.js +13 -43
- package/dist/ui/components/TextEdit/TextEdit.js +48 -78
- package/dist/ui/components/TextEdit/common.js +11 -17
- package/dist/ui/components/TextEdit/index.js +6 -22
- package/dist/ui/components/TextEdit/types.js +1 -2
- package/dist/ui/components/TextWithButton/index.js +10 -40
- package/dist/ui/components/TimelineChart/index.js +14 -24
- package/dist/ui/components/Toast/Cross.js +9 -16
- package/dist/ui/components/Toast/Tick.js +4 -11
- package/dist/ui/components/Toast/Warning.js +8 -15
- package/dist/ui/components/Toast/base.js +33 -65
- package/dist/ui/components/Toast/index.js +2 -18
- package/dist/ui/components/Toast/types.js +1 -2
- package/dist/ui/components/UserImage/index.js +17 -48
- package/dist/ui/components/index.js +30 -46
- package/dist/ui/helpers/axiosHelper.js +25 -39
- package/dist/ui/helpers/browserHelpers.js +7 -22
- package/dist/ui/helpers/callOpenApi/cached.js +18 -37
- package/dist/ui/helpers/callOpenApi/direct.js +46 -59
- package/dist/ui/helpers/callOpenApi/helpers.js +25 -40
- package/dist/ui/helpers/callOpenApi/hook.js +47 -36
- package/dist/ui/helpers/callOpenApi/index.js +5 -21
- package/dist/ui/helpers/callOpenApi/types.js +1 -2
- package/dist/ui/helpers/cognito.js +1 -2
- package/dist/ui/helpers/cookie/const.js +2 -5
- package/dist/ui/helpers/cookie/get.js +13 -14
- package/dist/ui/helpers/cookie/index.js +5 -21
- package/dist/ui/helpers/cookie/raw.js +9 -16
- package/dist/ui/helpers/cookie/set.js +10 -15
- package/dist/ui/helpers/cookie/use.js +23 -16
- package/dist/ui/helpers/date.js +10 -15
- package/dist/ui/helpers/debounce.js +5 -10
- package/dist/ui/helpers/dom.js +6 -13
- package/dist/ui/helpers/extractAttributes.js +2 -7
- package/dist/ui/helpers/index.js +25 -41
- package/dist/ui/helpers/jwt.js +1 -2
- package/dist/ui/helpers/plural.js +1 -5
- package/dist/ui/helpers/routes.js +17 -24
- package/dist/ui/helpers/serviceWorker.js +8 -23
- package/dist/ui/helpers/useContextMenu.js +9 -14
- package/dist/ui/helpers/useElementAttribute.js +3 -7
- package/dist/ui/helpers/useGranularHook.js +5 -10
- package/dist/ui/helpers/useInterval.js +8 -12
- package/dist/ui/helpers/useLocalStorage.js +24 -32
- package/dist/ui/helpers/useLockBodyScroll.js +3 -7
- package/dist/ui/helpers/useOnClickOutside.js +7 -12
- package/dist/ui/helpers/useOnScroll.js +15 -21
- package/dist/ui/helpers/useOverloadPageSearch.js +3 -7
- package/dist/ui/helpers/useQueryString.js +14 -20
- package/dist/ui/helpers/useResize.js +8 -12
- package/dist/ui/helpers/useTimeout.js +5 -9
- package/dist/ui/icons/ChevronRight.js +3 -9
- package/dist/ui/icons/CrossIcon.js +5 -12
- package/dist/ui/icons/Door.js +4 -10
- package/dist/ui/icons/HorizontalDots.js +3 -9
- package/dist/ui/icons/Magnify.js +3 -10
- package/dist/ui/icons/Pencil.js +5 -12
- package/dist/ui/icons/Save.js +4 -11
- package/dist/ui/icons/Undo.js +5 -12
- package/dist/ui/icons/UserOutline.js +3 -9
- package/dist/ui/icons/index.js +9 -25
- package/dist/ui/index.js +4 -20
- package/dist/ui/styles/colours.js +7 -12
- package/dist/ui/styles/common.js +14 -22
- package/dist/ui/styles/index.js +4 -20
- package/dist/ui/styles/media.js +7 -10
- package/dist/ui/styles/standaloneStyles.js +10 -16
- package/package.json +18 -17
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const styles_1 = require("../../styles");
|
|
10
|
-
const Modal_1 = require("../Modal/Modal");
|
|
11
|
-
const Base_1 = require("./Base");
|
|
12
|
-
const ModalStyled = (0, styled_1.default)(Modal_1.Modal) `
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { bigScreen, smallScreen } from '../../styles';
|
|
4
|
+
import { Modal } from '../Modal/Modal';
|
|
5
|
+
import { SearchBase } from './Base';
|
|
6
|
+
const ModalStyled = styled(Modal) `
|
|
13
7
|
display: flex;
|
|
14
8
|
flex-flow: column;
|
|
15
9
|
top: 10rem;
|
|
16
|
-
@media ${
|
|
10
|
+
@media ${bigScreen} {
|
|
17
11
|
width: 50vw;
|
|
18
12
|
max-width: 60rem;
|
|
19
13
|
}
|
|
20
|
-
@media ${
|
|
14
|
+
@media ${smallScreen} {
|
|
21
15
|
width: 100%;
|
|
22
16
|
max-width: 95vw;
|
|
23
17
|
}
|
|
24
18
|
`;
|
|
25
|
-
const SearchModal = (p) => (
|
|
26
|
-
|
|
27
|
-
exports.SearchModal = SearchModal;
|
|
19
|
+
export const SearchModal = (p) => (React.createElement(ModalStyled, { position: "center", topPosition: "center", open: true, setOpen: () => p.onSelectItem(undefined), showCloseButton: false, closeOnClickOutside: true },
|
|
20
|
+
React.createElement(SearchBase, { ...p })));
|
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.SearchBox = void 0;
|
|
30
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
31
|
-
const react_1 = __importStar(require("react"));
|
|
32
|
-
const debounce_1 = require("../../helpers/debounce");
|
|
33
|
-
const dom_1 = require("../../helpers/dom");
|
|
34
|
-
const icons_1 = require("../../icons");
|
|
35
|
-
const styles_1 = require("../../styles");
|
|
36
|
-
const TextEdit_1 = require("../TextEdit");
|
|
37
|
-
const Base = styled_1.default.div `
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React, { createRef, forwardRef, useEffect, useImperativeHandle, } from 'react';
|
|
3
|
+
import { debounce } from '../../helpers/debounce';
|
|
4
|
+
import { filterDataProps } from '../../helpers/dom';
|
|
5
|
+
import { CrossIcon, Magnify } from '../../icons';
|
|
6
|
+
import { bigScreen, smallScreen } from '../../styles';
|
|
7
|
+
import { TextEdit } from '../TextEdit';
|
|
8
|
+
const Base = styled.div `
|
|
38
9
|
padding: 1rem;
|
|
39
10
|
display: flex;
|
|
40
11
|
flex-flow: row;
|
|
@@ -44,52 +15,49 @@ const Base = styled_1.default.div `
|
|
|
44
15
|
margin: auto;
|
|
45
16
|
position: relative;
|
|
46
17
|
|
|
47
|
-
@media ${
|
|
18
|
+
@media ${smallScreen} {
|
|
48
19
|
margin: 0;
|
|
49
20
|
padding: 0;
|
|
50
21
|
padding-top: 0.5rem;
|
|
51
22
|
width: 100%;
|
|
52
23
|
}
|
|
53
24
|
`;
|
|
54
|
-
const MagnifyIcon =
|
|
25
|
+
const MagnifyIcon = styled.div `
|
|
55
26
|
width: 1.5rem;
|
|
56
27
|
height: 1.5rem;
|
|
57
28
|
margin-right: 0.5rem;
|
|
58
29
|
cursor: pointer;
|
|
59
30
|
`;
|
|
60
|
-
const CrossIconStyled = (
|
|
31
|
+
const CrossIconStyled = styled(CrossIcon) `
|
|
61
32
|
position: absolute;
|
|
62
33
|
right: 1rem;
|
|
63
|
-
@media ${
|
|
34
|
+
@media ${bigScreen} {
|
|
64
35
|
right: 2rem;
|
|
65
36
|
}
|
|
66
37
|
`;
|
|
67
|
-
|
|
68
|
-
const textEditRef =
|
|
69
|
-
|
|
38
|
+
export const SearchBox = forwardRef((p, ref) => {
|
|
39
|
+
const textEditRef = createRef();
|
|
40
|
+
useImperativeHandle(ref, () => ({
|
|
70
41
|
setValue: (v) => {
|
|
71
|
-
|
|
72
|
-
const value = (_a = textEditRef.current) === null || _a === void 0 ? void 0 : _a.getValue();
|
|
42
|
+
const value = textEditRef.current?.getValue();
|
|
73
43
|
if (v === value) {
|
|
74
44
|
return;
|
|
75
45
|
}
|
|
76
|
-
|
|
46
|
+
textEditRef.current?.setValue(v);
|
|
77
47
|
},
|
|
78
|
-
focus: () =>
|
|
79
|
-
getValue: () =>
|
|
48
|
+
focus: () => textEditRef.current?.focus(),
|
|
49
|
+
getValue: () => textEditRef.current?.getValue(),
|
|
80
50
|
}));
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
(_a = textEditRef === null || textEditRef === void 0 ? void 0 : textEditRef.current) === null || _a === void 0 ? void 0 : _a.setValue(p.searchText);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
textEditRef?.current?.setValue(p.searchText);
|
|
84
53
|
}, [p.searchText, textEditRef]);
|
|
85
|
-
return (
|
|
86
|
-
|
|
87
|
-
|
|
54
|
+
return (React.createElement(Base, { "data-type": "search", className: p.className, ...filterDataProps(p) },
|
|
55
|
+
React.createElement(TextEdit, { ref: textEditRef, placeholder: p.placeholderText, defaultEditing: { focus: true }, singleLine: true, leftContent: React.createElement(MagnifyIcon, { onClick: () => p.setSearchText(textEditRef?.current?.getValue() || '', true) },
|
|
56
|
+
React.createElement(Magnify, null)), noGrow: true, allowUndo: false, onClickOutsideWithNoValue: null, onSubmit: (v, enterPressed) => debounce(() => {
|
|
88
57
|
p.setSearchText(v, enterPressed);
|
|
89
58
|
}, { key: 'pagesearch', time: 200 }), defaultValue: p.defaultValue }),
|
|
90
|
-
p.searchText && (
|
|
91
|
-
|
|
92
|
-
(_a = textEditRef.current) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
59
|
+
p.searchText && (React.createElement(CrossIconStyled, { onClick: () => {
|
|
60
|
+
textEditRef.current?.setValue('');
|
|
93
61
|
p.setSearchText('', true);
|
|
94
62
|
} }))));
|
|
95
63
|
});
|
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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("./Base"), exports);
|
|
19
|
-
__exportStar(require("./Dialog"), exports);
|
|
20
|
-
__exportStar(require("./Inline"), exports);
|
|
21
|
-
__exportStar(require("./Modal"), exports);
|
|
22
|
-
__exportStar(require("./SearchBox"), exports);
|
|
23
|
-
__exportStar(require("./types"), exports);
|
|
1
|
+
export * from './AutoHideSearchBox';
|
|
2
|
+
export * from './Base';
|
|
3
|
+
export * from './Dialog';
|
|
4
|
+
export * from './Inline';
|
|
5
|
+
export * from './Modal';
|
|
6
|
+
export * from './SearchBox';
|
|
7
|
+
export * from './types';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const use_1 = require("../../helpers/cookie/use");
|
|
10
|
-
const common_1 = require("../../styles/common");
|
|
11
|
-
const Chevron_1 = require("../Chevron");
|
|
12
|
-
const Base = styled_1.default.div `
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useCookieBoolean } from '../../helpers/cookie/use';
|
|
4
|
+
import { NoTextSelect } from '../../styles/common';
|
|
5
|
+
import { Chevron } from '../Chevron';
|
|
6
|
+
const Base = styled.div `
|
|
13
7
|
position: relative;
|
|
14
8
|
transition: all 200ms;
|
|
15
9
|
border-right: solid 1px #ccc;
|
|
@@ -28,7 +22,7 @@ const Base = styled_1.default.div `
|
|
|
28
22
|
border-right: solid 1px #999;
|
|
29
23
|
}
|
|
30
24
|
}
|
|
31
|
-
${
|
|
25
|
+
${NoTextSelect};
|
|
32
26
|
|
|
33
27
|
&:hover {
|
|
34
28
|
[data-content] {
|
|
@@ -36,7 +30,7 @@ const Base = styled_1.default.div `
|
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
32
|
`;
|
|
39
|
-
const ContentBlock =
|
|
33
|
+
const ContentBlock = styled.div `
|
|
40
34
|
left: -18rem;
|
|
41
35
|
transition: left 200ms;
|
|
42
36
|
&[data-open='false'] {
|
|
@@ -46,7 +40,7 @@ const ContentBlock = styled_1.default.div `
|
|
|
46
40
|
//width set in style
|
|
47
41
|
}
|
|
48
42
|
`;
|
|
49
|
-
const Content =
|
|
43
|
+
const Content = styled.div `
|
|
50
44
|
display: flex;
|
|
51
45
|
flex-flow: column;
|
|
52
46
|
width: 100%;
|
|
@@ -60,7 +54,7 @@ const Content = styled_1.default.div `
|
|
|
60
54
|
border-radius: 1rem;
|
|
61
55
|
}
|
|
62
56
|
`;
|
|
63
|
-
const Hamburger =
|
|
57
|
+
const Hamburger = styled.div `
|
|
64
58
|
position: absolute;
|
|
65
59
|
transition: all 200ms;
|
|
66
60
|
&[data-open='false'] {
|
|
@@ -84,23 +78,22 @@ const Hamburger = styled_1.default.div `
|
|
|
84
78
|
border: solid 1px rgba(0, 0, 0, 0.5);
|
|
85
79
|
cursor: pointer;
|
|
86
80
|
`;
|
|
87
|
-
const ChevronStyled = (
|
|
81
|
+
const ChevronStyled = styled(Chevron) `
|
|
88
82
|
svg {
|
|
89
83
|
fill: #555;
|
|
90
84
|
}
|
|
91
85
|
`;
|
|
92
|
-
const Sidebar = ({ children, className, key = 'sidebar', cookieDocument, width = '15rem', }) => {
|
|
93
|
-
const [open, setOpen] =
|
|
86
|
+
export const Sidebar = ({ children, className, key = 'sidebar', cookieDocument, width = '15rem', }) => {
|
|
87
|
+
const [open, setOpen] = useCookieBoolean({
|
|
94
88
|
name: key,
|
|
95
89
|
defaultValue: false,
|
|
96
90
|
cookieDocument: cookieDocument,
|
|
97
91
|
});
|
|
98
|
-
return (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
return (React.createElement(Base, { className: className, "data-open": open, onClick: () => !open && setOpen(true), "data-hover": true, style: { width: !open ? '0.5rem' : width } },
|
|
93
|
+
React.createElement(Hamburger, { "data-open": open, onClick: () => setOpen(!open), "data-hover": true },
|
|
94
|
+
React.createElement(ChevronStyled, { point: open ? 'left' : 'right', width: "100%" })),
|
|
95
|
+
React.createElement(ContentBlock, { "data-content": true, "data-open": open, style: { width: !open ? width : undefined } },
|
|
96
|
+
React.createElement(Content, { "data-open": open, onClick: (e) => {
|
|
103
97
|
e.stopPropagation();
|
|
104
98
|
} }, children))));
|
|
105
99
|
};
|
|
106
|
-
exports.Sidebar = Sidebar;
|
|
@@ -1,60 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.SparkLine = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const math_1 = require("../../../common/helpers/math");
|
|
10
|
-
const Base = styled_1.default.div `
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { rangePercentage } from '../../../common/helpers/math';
|
|
4
|
+
const Base = styled.div `
|
|
11
5
|
width: calc(100% - 2px - 1rem);
|
|
12
6
|
height: 100%;
|
|
13
7
|
border: solid 1px #666;
|
|
14
8
|
border-radius: 0.5rem;
|
|
15
9
|
padding: 0.5rem;
|
|
16
10
|
`;
|
|
17
|
-
const Points =
|
|
11
|
+
const Points = styled.div `
|
|
18
12
|
position: relative;
|
|
19
13
|
|
|
20
14
|
width: 100%;
|
|
21
15
|
height: 100%;
|
|
22
16
|
`;
|
|
23
|
-
const Point =
|
|
17
|
+
const Point = styled.div `
|
|
24
18
|
position: absolute;
|
|
25
19
|
border-width: 2px;
|
|
26
20
|
border-style: solid;
|
|
27
21
|
width: 1px;
|
|
28
22
|
`;
|
|
29
|
-
const SparkLine = (p) => {
|
|
23
|
+
export const SparkLine = (p) => {
|
|
30
24
|
const { data: raw, pointColour = '#4d76ff' } = p;
|
|
31
25
|
const xMin = Math.min(...raw.map((d) => d.x));
|
|
32
26
|
const xMax = Math.max(...raw.map((d) => d.x));
|
|
33
27
|
const yMin = Math.min(...raw.map((d) => d.y));
|
|
34
28
|
const yMax = Math.max(...raw.map((d) => d.y));
|
|
35
29
|
const data = raw.map((orig) => ({
|
|
36
|
-
x:
|
|
30
|
+
x: rangePercentage({
|
|
37
31
|
value: orig.x,
|
|
38
32
|
min: xMin,
|
|
39
33
|
max: xMax,
|
|
40
34
|
}) * 100,
|
|
41
|
-
y:
|
|
35
|
+
y: rangePercentage({
|
|
42
36
|
value: orig.y,
|
|
43
37
|
min: yMin,
|
|
44
38
|
max: yMax,
|
|
45
39
|
}) * 100,
|
|
46
40
|
orig,
|
|
47
41
|
}));
|
|
48
|
-
return (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
height: pt.y + '%',
|
|
57
|
-
} }));
|
|
58
|
-
}))));
|
|
42
|
+
return (React.createElement(Base, { className: p.className, title: p.title },
|
|
43
|
+
React.createElement(Points, null, data.map((pt) => (React.createElement(Point, { title: p.pointTitleF?.(pt.orig) ?? '', key: pt.x + ' ' + pt.y, style: {
|
|
44
|
+
backgroundColor: pointColour,
|
|
45
|
+
borderColor: pointColour,
|
|
46
|
+
left: pt.x + '%',
|
|
47
|
+
bottom: 0,
|
|
48
|
+
height: pt.y + '%',
|
|
49
|
+
} }))))));
|
|
59
50
|
};
|
|
60
|
-
exports.SparkLine = SparkLine;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Table = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const groupBy_1 = require("../../../common/helpers/groupBy");
|
|
10
|
-
const Base = styled_1.default.div `
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { groupByList } from '../../../common/helpers/groupBy';
|
|
4
|
+
const Base = styled.div `
|
|
11
5
|
display: flex;
|
|
12
6
|
flex-flow: column;
|
|
13
7
|
width: 100%;
|
|
14
8
|
`;
|
|
15
|
-
const TableRow =
|
|
9
|
+
const TableRow = styled.div `
|
|
16
10
|
display: flex;
|
|
17
11
|
border: solid 1px #ccc;
|
|
18
12
|
&[data-header='true'] {
|
|
@@ -22,24 +16,23 @@ const TableRow = styled_1.default.div `
|
|
|
22
16
|
border-top: 0;
|
|
23
17
|
}
|
|
24
18
|
`;
|
|
25
|
-
const Group =
|
|
19
|
+
const Group = styled.div `
|
|
26
20
|
display: flex;
|
|
27
21
|
flex-flow: column;
|
|
28
22
|
width: 100%;
|
|
29
23
|
`;
|
|
30
|
-
const GroupTitle =
|
|
24
|
+
const GroupTitle = styled.div `
|
|
31
25
|
font-size: 1.5rem;
|
|
32
26
|
`;
|
|
33
|
-
const GroupWrap =
|
|
27
|
+
const GroupWrap = styled.div `
|
|
34
28
|
display: flex;
|
|
35
29
|
flex-flow: column;
|
|
36
30
|
`;
|
|
37
|
-
const Table = ({ children, className, headerRow }) => {
|
|
38
|
-
const grouped =
|
|
39
|
-
return (
|
|
40
|
-
group.key && (
|
|
41
|
-
|
|
42
|
-
headerRow && (
|
|
43
|
-
group.items.map((item) => (
|
|
31
|
+
export const Table = ({ children, className, headerRow }) => {
|
|
32
|
+
const grouped = groupByList(children, (s) => s.groupTitle);
|
|
33
|
+
return (React.createElement(Base, { className: className }, grouped.map((group) => (React.createElement(GroupWrap, { key: 'gk' + group.key },
|
|
34
|
+
group.key && (React.createElement(GroupTitle, { key: `gt${group.key}` }, group.key)),
|
|
35
|
+
React.createElement(Group, { key: `g${group.key}` },
|
|
36
|
+
headerRow && (React.createElement(TableRow, { "data-header": "true", key: `headrow${group.key}` }, headerRow)),
|
|
37
|
+
group.items.map((item) => (React.createElement(TableRow, { key: item.content.key }, item.content)))))))));
|
|
44
38
|
};
|
|
45
|
-
exports.Table = Table;
|
|
@@ -1,59 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.CheckboxEdit = void 0;
|
|
30
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
31
|
-
const react_1 = __importStar(require("react"));
|
|
32
|
-
const useOnClickOutside_1 = require("../../helpers/useOnClickOutside");
|
|
33
|
-
const Save_1 = require("../../icons/Save");
|
|
34
|
-
const Undo_1 = require("../../icons/Undo");
|
|
35
|
-
const common_1 = require("../../styles/common");
|
|
36
|
-
const FlexRow_1 = require("../FlexRow");
|
|
37
|
-
const common_2 = require("./common");
|
|
38
|
-
const Icons = (0, styled_1.default)(FlexRow_1.FlexRow) `
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { useOnClickOutside } from '../../helpers/useOnClickOutside';
|
|
4
|
+
import { Save } from '../../icons/Save';
|
|
5
|
+
import { Undo } from '../../icons/Undo';
|
|
6
|
+
import { noDrag } from '../../styles/common';
|
|
7
|
+
import { FlexRow } from '../FlexRow';
|
|
8
|
+
import { IconD as Icon, iconLeft, iconRight, ValueBox, ValueInputCB, } from './common';
|
|
9
|
+
const Icons = styled(FlexRow) `
|
|
39
10
|
position: absolute;
|
|
40
11
|
top: 0;
|
|
41
12
|
right: -2rem;
|
|
42
13
|
`;
|
|
43
|
-
const CheckboxEdit = ({ defaultValue, onSubmit, noGrow = false, allowUndo = true, }) => {
|
|
44
|
-
const ref =
|
|
45
|
-
const [value, setValue] =
|
|
46
|
-
|
|
14
|
+
export const CheckboxEdit = ({ defaultValue, onSubmit, noGrow = false, allowUndo = true, }) => {
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
const [value, setValue] = useState(defaultValue);
|
|
17
|
+
useEffect(() => {
|
|
47
18
|
setValue(defaultValue);
|
|
48
19
|
}, [defaultValue]);
|
|
49
20
|
const valueChange = value !== defaultValue;
|
|
50
|
-
|
|
21
|
+
useOnClickOutside({ ref, moveMouseOutside: false }, () => {
|
|
51
22
|
if (valueChange) {
|
|
52
23
|
onSubmit(value);
|
|
53
24
|
}
|
|
54
25
|
});
|
|
55
|
-
return (
|
|
56
|
-
|
|
26
|
+
return (React.createElement(ValueBox, { ...noDrag, ref: ref, "data-nogrow": noGrow },
|
|
27
|
+
React.createElement(ValueInputCB, { type: "checkbox", "data-type": "checkbox", checked: value, onChange: () => {
|
|
57
28
|
if (allowUndo) {
|
|
58
29
|
setValue(!value);
|
|
59
30
|
}
|
|
@@ -61,10 +32,9 @@ const CheckboxEdit = ({ defaultValue, onSubmit, noGrow = false, allowUndo = true
|
|
|
61
32
|
onSubmit(!value);
|
|
62
33
|
}
|
|
63
34
|
}, onKeyDown: (e) => e.key === 'Enter' && value !== defaultValue && onSubmit(value) }),
|
|
64
|
-
allowUndo && value !== defaultValue && (
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
35
|
+
allowUndo && value !== defaultValue && (React.createElement(Icons, { center: true, enableOverflow: true },
|
|
36
|
+
React.createElement(Icon, { style: iconLeft, onClick: () => value !== defaultValue && onSubmit(value) },
|
|
37
|
+
React.createElement(Save, null)),
|
|
38
|
+
React.createElement(Icon, { style: iconRight, onClick: () => setValue(defaultValue) },
|
|
39
|
+
React.createElement(Undo, null))))));
|
|
69
40
|
};
|
|
70
|
-
exports.CheckboxEdit = CheckboxEdit;
|
|
@@ -1,52 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.ColourEdit = void 0;
|
|
27
|
-
const react_1 = __importStar(require("react"));
|
|
28
|
-
const useOnClickOutside_1 = require("../../helpers/useOnClickOutside");
|
|
29
|
-
const Save_1 = require("../../icons/Save");
|
|
30
|
-
const Undo_1 = require("../../icons/Undo");
|
|
31
|
-
const common_1 = require("../../styles/common");
|
|
32
|
-
const common_2 = require("./common");
|
|
33
|
-
const ColourEdit = ({ defaultValue, onSubmit, }) => {
|
|
34
|
-
const ref = (0, react_1.useRef)(null);
|
|
35
|
-
const [value, setValue] = (0, react_1.useState)(defaultValue);
|
|
36
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { useOnClickOutside } from '../../helpers/useOnClickOutside';
|
|
3
|
+
import { Save } from '../../icons/Save';
|
|
4
|
+
import { Undo } from '../../icons/Undo';
|
|
5
|
+
import { noDrag } from '../../styles/common';
|
|
6
|
+
import { IconD as Icon, iconLeft, iconRight, ValueBox } from './common';
|
|
7
|
+
export const ColourEdit = ({ defaultValue, onSubmit, }) => {
|
|
8
|
+
const ref = useRef(null);
|
|
9
|
+
const [value, setValue] = useState(defaultValue);
|
|
10
|
+
useEffect(() => {
|
|
37
11
|
setValue(defaultValue);
|
|
38
12
|
}, [defaultValue]);
|
|
39
13
|
const valueChange = value !== defaultValue;
|
|
40
|
-
|
|
14
|
+
useOnClickOutside({ ref, moveMouseOutside: false }, () => {
|
|
41
15
|
if (valueChange) {
|
|
42
16
|
onSubmit(value);
|
|
43
17
|
}
|
|
44
18
|
});
|
|
45
|
-
return (
|
|
46
|
-
|
|
47
|
-
value !== defaultValue && (
|
|
48
|
-
|
|
49
|
-
valueChange && (
|
|
50
|
-
|
|
19
|
+
return (React.createElement(ValueBox, { ...noDrag, ref: ref },
|
|
20
|
+
React.createElement("input", { type: "color", size: 5, value: value, onChange: (v) => setValue(v.target.value) }),
|
|
21
|
+
value !== defaultValue && (React.createElement(Icon, { style: iconLeft, onClick: () => valueChange && onSubmit(value.trim()) },
|
|
22
|
+
React.createElement(Save, null))),
|
|
23
|
+
valueChange && (React.createElement(Icon, { style: iconRight, onClick: () => setValue(defaultValue) },
|
|
24
|
+
React.createElement(Undo, null)))));
|
|
51
25
|
};
|
|
52
|
-
exports.ColourEdit = ColourEdit;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TextEditLengthBox = void 0;
|
|
7
|
-
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const Base = styled_1.default.div `
|
|
1
|
+
import styled from '@emotion/styled';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const Base = styled.div `
|
|
10
4
|
/* position: absolute;
|
|
11
5
|
bottom: 0.5rem;
|
|
12
6
|
right: 0.5rem; */
|
|
13
7
|
`;
|
|
14
|
-
const TextEditLengthBox = ({ min, max, }) => {
|
|
8
|
+
export const TextEditLengthBox = ({ min, max, }) => {
|
|
15
9
|
let color = 'black';
|
|
16
10
|
if (min / max > 0.55) {
|
|
17
11
|
color = 'indianred';
|
|
@@ -19,9 +13,8 @@ const TextEditLengthBox = ({ min, max, }) => {
|
|
|
19
13
|
if (min === max) {
|
|
20
14
|
color = 'red';
|
|
21
15
|
}
|
|
22
|
-
return (
|
|
16
|
+
return (React.createElement(Base, { style: { color } },
|
|
23
17
|
min,
|
|
24
18
|
"/",
|
|
25
19
|
max));
|
|
26
20
|
};
|
|
27
|
-
exports.TextEditLengthBox = TextEditLengthBox;
|