ag-common 0.0.419 → 0.0.421

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