ag-common 0.0.128 → 0.0.129
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.d.ts +7 -1
- package/dist/api/helpers/api.js +9 -8
- package/dist/ui/components/Chevron/index.d.ts +1 -0
- package/dist/ui/components/Chevron/index.js +6 -6
- package/dist/ui/components/DropdownList/index.d.ts +1 -0
- package/dist/ui/components/HeadersRaw/index.d.ts +1 -0
- package/dist/ui/components/Loader/index.d.ts +1 -0
- package/dist/ui/components/LoginButton/index.d.ts +1 -0
- package/dist/ui/components/LogoutButton/index.d.ts +1 -0
- package/dist/ui/components/Sidebar/index.d.ts +2 -1
- package/dist/ui/components/Table/index.d.ts +1 -0
- package/dist/ui/components/TextEdit/CheckboxEdit.d.ts +1 -0
- package/dist/ui/components/TextEdit/ColourEdit.d.ts +1 -0
- package/dist/ui/components/TextEdit/ListboxEdit.d.ts +1 -0
- package/dist/ui/components/TextEdit/TextEdit.d.ts +1 -0
- package/dist/ui/components/TextEdit/images.d.ts +1 -0
- package/dist/ui/components/Toast/index.d.ts +1 -0
- package/dist/ui/components/UserImage/index.d.ts +1 -0
- package/dist/ui/helpers/lang.d.ts +1 -0
- package/package.json +1 -1
|
@@ -2,7 +2,13 @@ import { APIGatewayProxyResult, DYNAMOKEYS } from '../types';
|
|
|
2
2
|
export declare const returnCode: <T>(statusCode: number, body?: T | undefined, extraHeaders?: {
|
|
3
3
|
[a: string]: string;
|
|
4
4
|
} | undefined, fullSiteUrl?: string | undefined) => APIGatewayProxyResult;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* strip all dynamo generated keys. can optionally keep PK
|
|
7
|
+
* @param record
|
|
8
|
+
* @param keepPk if true, will keep PK. default true
|
|
9
|
+
* @returns stripped record
|
|
10
|
+
*/
|
|
11
|
+
export declare const stripPKs: <T>(record: T, keepPk?: boolean) => T;
|
|
6
12
|
export declare const generateDynamoPKS: ({ type, L1, L2, L3, L4, L5, L6, additionalPKValues, }: {
|
|
7
13
|
type: string;
|
|
8
14
|
L1: string;
|
package/dist/api/helpers/api.js
CHANGED
|
@@ -33,21 +33,22 @@ const returnCode = (statusCode, body, extraHeaders, fullSiteUrl) => {
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
exports.returnCode = returnCode;
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
-
const stripPKs = (r,
|
|
38
36
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
37
|
+
* strip all dynamo generated keys. can optionally keep PK
|
|
38
|
+
* @param record
|
|
39
|
+
* @param keepPk if true, will keep PK. default true
|
|
40
|
+
* @returns stripped record
|
|
41
41
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
const stripPKs = (record, keepPk = true) => {
|
|
44
|
+
if (!record) {
|
|
44
45
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
45
46
|
return null;
|
|
46
47
|
}
|
|
47
48
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
48
49
|
// @ts-ignore
|
|
49
|
-
const { PK, PK1, PK2, PK3, PK4, PK5, L1, L2, L3, L4, L5, L6 } =
|
|
50
|
-
if (
|
|
50
|
+
const { PK, PK1, PK2, PK3, PK4, PK5, L1, L2, L3, L4, L5, L6 } = record, rest = __rest(record, ["PK", "PK1", "PK2", "PK3", "PK4", "PK5", "L1", "L2", "L3", "L4", "L5", "L6"]);
|
|
51
|
+
if (keepPk) {
|
|
51
52
|
//@ts-ignore
|
|
52
53
|
rest.PK = PK;
|
|
53
54
|
}
|
|
@@ -18,25 +18,25 @@ const IconStyled = (0, styled_components_1.default)(Icon_1.Icon) `
|
|
|
18
18
|
margin: 0;
|
|
19
19
|
padding: 0;
|
|
20
20
|
`;
|
|
21
|
-
const ChevronIcon = (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg"
|
|
22
|
-
react_1.default.createElement("path", { d: "
|
|
21
|
+
const ChevronIcon = (react_1.default.createElement("svg", { width: "24", height: "24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
22
|
+
react_1.default.createElement("path", { d: "M10.294 9.698a.988.988 0 0 1 0-1.407 1.01 1.01 0 0 1 1.419 0l2.965 2.94a1.09 1.09 0 0 1 0 1.548l-2.955 2.93a1.01 1.01 0 0 1-1.638-.322.988.988 0 0 1 .218-1.085l2.318-2.297-2.327-2.307Z", fill: "inherit", className: "_14TyY7wB85QoVU" })));
|
|
23
23
|
const Chevron = ({ width = '1.2rem', className, colour = 'black', onToggle, point = 'right', }) => {
|
|
24
24
|
let rotate = 0;
|
|
25
25
|
switch (point) {
|
|
26
26
|
case 'down': {
|
|
27
|
-
rotate =
|
|
27
|
+
rotate = 270;
|
|
28
28
|
break;
|
|
29
29
|
}
|
|
30
30
|
case 'left': {
|
|
31
|
-
rotate =
|
|
31
|
+
rotate = 0;
|
|
32
32
|
break;
|
|
33
33
|
}
|
|
34
34
|
case 'up': {
|
|
35
|
-
rotate =
|
|
35
|
+
rotate = 90;
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
38
|
case 'right': {
|
|
39
|
-
rotate =
|
|
39
|
+
rotate = 180;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
return (react_1.default.createElement(SChevron, { className: className, onClick: () => onToggle === null || onToggle === void 0 ? void 0 : onToggle(), onTouchStart: () => onToggle === null || onToggle === void 0 ? void 0 : onToggle(), onKeyPress: (e) => e.key === 'Enter' && (onToggle === null || onToggle === void 0 ? void 0 : onToggle()) },
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const Sidebar: ({ children, className, key, cookieDocument, }: {
|
|
2
3
|
children: any;
|
|
3
4
|
className?: string | undefined;
|
|
@@ -6,7 +7,7 @@ export declare const Sidebar: ({ children, className, key, cookieDocument, }: {
|
|
|
6
7
|
*/
|
|
7
8
|
key?: string | undefined;
|
|
8
9
|
/**
|
|
9
|
-
* pass in SSR cookiedocument
|
|
10
|
+
* optionally pass in SSR cookiedocument
|
|
10
11
|
*/
|
|
11
12
|
cookieDocument?: string | undefined;
|
|
12
13
|
}) => JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { StyledComponent } from 'styled-components';
|
|
2
3
|
export declare const ValueReadonly: StyledComponent<"div", any, {}, never>;
|
|
3
4
|
export declare const TextEdit: ({ defaultValue, defaultEditing, onSubmit, disableEdit, placeholder, onEditingChange, onClickOutsideWithNoValue, onClickNotEditing, className, singleLine, }: {
|