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.
@@ -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
- let all = yield dbRaw
324
- .scan({
323
+ const params = {
325
324
  TableName: tableName,
326
- })
327
- .promise();
328
- (0, log_1.warn)(`will delete ${(_h = all === null || all === void 0 ? void 0 : all.Items) === null || _h === void 0 ? void 0 : _h.length} items from ${tableName}`);
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.Items, 25);
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: {
@@ -52,8 +52,8 @@ exports.ButtonBase = (0, styled_components_1.css) `
52
52
  color: white;
53
53
 
54
54
  &[data-disabled='true'] {
55
- cursor: default;
56
- background-color: #888;
55
+ cursor: default !important;
56
+ background-color: #888 !important;
57
57
  }
58
58
 
59
59
  &[data-theme='green'] {
@@ -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;
@@ -8,6 +8,7 @@ export * from './FlexColumn';
8
8
  export * from './FlexRow';
9
9
  export * from './HeadersRaw';
10
10
  export * from './Icon';
11
+ export * from './Image';
11
12
  export * from './KebabDots';
12
13
  export * from './Loader';
13
14
  export * from './Modal';
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.346",
3
+ "version": "0.0.348",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",