ag-common 0.0.61 → 0.0.65
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 +1 -1
- package/dist/ui/components/Chevron/index.d.ts +2 -1
- package/dist/ui/components/Chevron/index.js +1 -1
- package/dist/ui/helpers/mutexData.d.ts +1 -0
- package/dist/ui/helpers/mutexData.js +9 -0
- package/dist/ui/helpers/useOpenApiStore.d.ts +1 -0
- package/dist/ui/helpers/useOpenApiStore.js +3 -1
- package/package.json +1 -1
package/dist/api/helpers/api.js
CHANGED
|
@@ -41,7 +41,7 @@ const stripPKs = (r, excludePK = true) => {
|
|
|
41
41
|
}
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
43
43
|
// @ts-ignore
|
|
44
|
-
const { PK, PK1, PK2, PK3, PK4, L1, L2, L3, L4, L5, L6, TYPE } = r, rest = __rest(r, ["PK", "PK1", "PK2", "PK3", "PK4", "L1", "L2", "L3", "L4", "L5", "L6", "TYPE"]);
|
|
44
|
+
const { PK, PK1, PK2, PK3, PK4, PK5, L1, L2, L3, L4, L5, L6, TYPE } = r, rest = __rest(r, ["PK", "PK1", "PK2", "PK3", "PK4", "PK5", "L1", "L2", "L3", "L4", "L5", "L6", "TYPE"]);
|
|
45
45
|
if (!excludePK) {
|
|
46
46
|
//@ts-ignore
|
|
47
47
|
rest.PK = PK;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const Chevron: ({ down, width, className, colour, }: {
|
|
2
|
+
export declare const Chevron: ({ down, width, className, colour, onToggle, }: {
|
|
3
3
|
colour?: string | undefined;
|
|
4
4
|
className?: string | undefined;
|
|
5
5
|
width?: string | undefined;
|
|
6
6
|
down: boolean;
|
|
7
|
+
onToggle?: (() => void) | undefined;
|
|
7
8
|
}) => JSX.Element;
|
|
@@ -20,6 +20,6 @@ const IconStyled = (0, styled_components_1.default)(Icon_1.Icon) `
|
|
|
20
20
|
`;
|
|
21
21
|
const ChevronIcon = (react_1.default.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 -256 1792 1792" },
|
|
22
22
|
react_1.default.createElement("path", { d: "M1679.339 301.56q0 53-37 90l-651 651q-38 38-91 38-54 0-90-38l-651-651q-38-36-38-90 0-53 38-91l74-75q39-37 91-37 53 0 90 37l486 486 486-486q37-37 90-37 52 0 91 37l75 75q37 39 37 91z" })));
|
|
23
|
-
const Chevron = ({ down, width = '1.2rem', className, colour = 'black', }) => (react_1.default.createElement(SChevron, { className: className },
|
|
23
|
+
const Chevron = ({ down, width = '1.2rem', className, colour = 'black', onToggle, }) => (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()) },
|
|
24
24
|
react_1.default.createElement(IconStyled, { flip: down, fill: colour, width: width, height: width }, ChevronIcon)));
|
|
25
25
|
exports.Chevron = Chevron;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MutexData = void 0;
|
|
4
4
|
/* eslint-disable class-methods-use-this */
|
|
5
|
+
const _1 = require(".");
|
|
5
6
|
const log_1 = require("../../common/helpers/log");
|
|
6
7
|
const useLocalStorage_1 = require("./useLocalStorage");
|
|
7
8
|
class MutexData {
|
|
@@ -42,5 +43,13 @@ class MutexData {
|
|
|
42
43
|
this.pingSubscribers(key);
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
delete(key, updateSubscribers = false) {
|
|
47
|
+
(0, _1.clearLocalStorageItem)(`mutex-${key}`);
|
|
48
|
+
if (updateSubscribers) {
|
|
49
|
+
if (Object.keys(this.subscriptions).length > 0) {
|
|
50
|
+
this.pingSubscribers(key);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
exports.MutexData = MutexData;
|
|
@@ -2,6 +2,7 @@ import { AxiosResponse } from 'axios';
|
|
|
2
2
|
import { OverrideAuth } from './callOpenApi';
|
|
3
3
|
import { CacheItems } from './routes';
|
|
4
4
|
import { AxiosWrapper, User } from './jwt';
|
|
5
|
+
export declare const deleteMutexData: (key: string) => void;
|
|
5
6
|
export declare const setMutexData: ({ key, data, ttlSeconds, }: {
|
|
6
7
|
key: string;
|
|
7
8
|
data: any;
|
|
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.setOpenApiCache = exports.useOpenApiStore = exports.getMutexData = exports.setMutexData = void 0;
|
|
12
|
+
exports.setOpenApiCache = exports.useOpenApiStore = exports.getMutexData = exports.setMutexData = exports.deleteMutexData = void 0;
|
|
13
13
|
const react_1 = require("react");
|
|
14
14
|
const mutex_1 = require("./mutex");
|
|
15
15
|
const mutexData_1 = require("./mutexData");
|
|
@@ -22,6 +22,8 @@ const mutex = new mutex_1.Mutex({
|
|
|
22
22
|
});
|
|
23
23
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
24
|
const mutexData = new mutexData_1.MutexData();
|
|
25
|
+
const deleteMutexData = (key) => mutexData.delete(key);
|
|
26
|
+
exports.deleteMutexData = deleteMutexData;
|
|
25
27
|
const setMutexData = ({ key, data, ttlSeconds = 3600, }) => {
|
|
26
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
29
|
const wrap = {
|