ag-common 0.0.346 → 0.0.348
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/dynamo.js +12 -6
- package/dist/ui/components/Button/index.js +2 -2
- package/dist/ui/components/Image/index.d.ts +12 -0
- package/dist/ui/components/Image/index.js +60 -0
- package/dist/ui/components/index.d.ts +1 -0
- package/dist/ui/components/index.js +1 -0
- package/package.json +1 -1
|
@@ -320,15 +320,21 @@ const wipeTable = (tableName) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
320
320
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
321
321
|
// @ts-ignore
|
|
322
322
|
let keyHash = infoV.Table.KeySchema.find((k) => k.KeyType === 'HASH').AttributeName;
|
|
323
|
-
|
|
324
|
-
.scan({
|
|
323
|
+
const params = {
|
|
325
324
|
TableName: tableName,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
ExclusiveStartKey: undefined,
|
|
326
|
+
};
|
|
327
|
+
let all = [];
|
|
328
|
+
let working;
|
|
329
|
+
do {
|
|
330
|
+
working = yield dbRaw.scan(params).promise();
|
|
331
|
+
(_h = working.Items) === null || _h === void 0 ? void 0 : _h.forEach((item) => all.push(item));
|
|
332
|
+
params.ExclusiveStartKey = working.LastEvaluatedKey;
|
|
333
|
+
} while (typeof working.LastEvaluatedKey !== 'undefined');
|
|
334
|
+
(0, log_1.warn)(`will delete ${all === null || all === void 0 ? void 0 : all.length} items from ${tableName}`);
|
|
329
335
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
330
336
|
// @ts-ignore
|
|
331
|
-
const datagr = (0, array_1.chunk)(all
|
|
337
|
+
const datagr = (0, array_1.chunk)(all, 25);
|
|
332
338
|
let res = yield Promise.all(datagr.map((group) => dbRaw
|
|
333
339
|
.batchWriteItem({
|
|
334
340
|
RequestItems: {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ImgHTMLAttributes } from 'react';
|
|
2
|
+
export interface IImage {
|
|
3
|
+
/** if true, will set order to -1 for mobile. default false */
|
|
4
|
+
smalltop?: boolean;
|
|
5
|
+
/** if true, will hide on mobile. default false */
|
|
6
|
+
bigonly?: boolean;
|
|
7
|
+
/** if true, will hide on desktop. default false */
|
|
8
|
+
smallonly?: boolean;
|
|
9
|
+
/** if true is counted as a small image, and will be sized accordingly. default false */
|
|
10
|
+
small?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Image: (p: ImgHTMLAttributes<HTMLImageElement> & IImage) => JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Image = void 0;
|
|
18
|
+
const react_1 = __importDefault(require("react"));
|
|
19
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
20
|
+
const media_1 = require("../../styles/media");
|
|
21
|
+
const Base = styled_components_1.default.img `
|
|
22
|
+
object-fit: contain;
|
|
23
|
+
min-height: 5rem;
|
|
24
|
+
min-width: 5rem;
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
|
|
27
|
+
&[data-smalltop='true'] {
|
|
28
|
+
@media ${media_1.smallScreen} {
|
|
29
|
+
order: -1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
@media ${media_1.smallScreen} {
|
|
33
|
+
width: 90vw;
|
|
34
|
+
|
|
35
|
+
&[data-bigonly='true'] {
|
|
36
|
+
display: none;
|
|
37
|
+
}
|
|
38
|
+
&[data-small='true'] {
|
|
39
|
+
width: 50vw;
|
|
40
|
+
max-height: 25rem;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@media ${media_1.bigScreen} {
|
|
45
|
+
width: 100%;
|
|
46
|
+
max-width: 50rem;
|
|
47
|
+
&[data-smallonly='true'] {
|
|
48
|
+
display: none;
|
|
49
|
+
}
|
|
50
|
+
&[data-small='true'] {
|
|
51
|
+
max-width: 30rem;
|
|
52
|
+
max-height: 25rem;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
const Image = (p) => {
|
|
57
|
+
const { smalltop, bigonly, smallonly, small } = p, p1 = __rest(p, ["smalltop", "bigonly", "smallonly", "small"]);
|
|
58
|
+
return (react_1.default.createElement(Base, Object.assign({}, p1, { "data-smalltop": smalltop, "data-bigonly": bigonly, "data-smallonly": smallonly, "data-small": small })));
|
|
59
|
+
};
|
|
60
|
+
exports.Image = Image;
|
|
@@ -24,6 +24,7 @@ __exportStar(require("./FlexColumn"), exports);
|
|
|
24
24
|
__exportStar(require("./FlexRow"), exports);
|
|
25
25
|
__exportStar(require("./HeadersRaw"), exports);
|
|
26
26
|
__exportStar(require("./Icon"), exports);
|
|
27
|
+
__exportStar(require("./Image"), exports);
|
|
27
28
|
__exportStar(require("./KebabDots"), exports);
|
|
28
29
|
__exportStar(require("./Loader"), exports);
|
|
29
30
|
__exportStar(require("./Modal"), exports);
|