ag-common 0.0.695 → 0.0.696
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 +1 -1
- package/dist/api/helpers/openApiHelpers.js +1 -1
- package/dist/ui/components/DarkMode/Base.js +1 -1
- package/dist/ui/components/OpenApiCodeBlock/curl/helpers/getCurlLines.js +1 -1
- package/dist/ui/components/Search/AutoHideSearchBox.js +3 -3
- package/dist/ui/components/Search/SearchBox.d.ts +6 -0
- package/dist/ui/components/Search/SearchBox.js +8 -6
- package/dist/ui/helpers/callOpenApi/cached.js +1 -1
- package/package.json +1 -1
|
@@ -59,7 +59,7 @@ const batchWrite = (tableName, itemsIn) => __awaiter(void 0, void 0, void 0, fun
|
|
|
59
59
|
let params = new lib_dynamodb_1.BatchWriteCommand({
|
|
60
60
|
RequestItems: {
|
|
61
61
|
[`${tableName}`]: items.map((Item) => ({
|
|
62
|
-
PutRequest: { Item
|
|
62
|
+
PutRequest: { Item },
|
|
63
63
|
})),
|
|
64
64
|
},
|
|
65
65
|
});
|
|
@@ -139,7 +139,7 @@ const openApiImpl = (p) => {
|
|
|
139
139
|
memorySize: lc.memory,
|
|
140
140
|
timeout: lc.timeout,
|
|
141
141
|
description: '(cdk)',
|
|
142
|
-
entry
|
|
142
|
+
entry,
|
|
143
143
|
reservedConcurrentExecutions: lc.reservedConcurrentExecutions,
|
|
144
144
|
logRetention: aws_cdk_lib_1.aws_logs.RetentionDays.FIVE_DAYS,
|
|
145
145
|
layers: lc.layers,
|
|
@@ -87,7 +87,7 @@ const UseDarkMode = ({ cookieDocument, }) => {
|
|
|
87
87
|
const [darkmode, setDarkmode] = (0, use_1.useCookie)({
|
|
88
88
|
defaultValue: types_1.TDarkMode.system,
|
|
89
89
|
name: 'darkmode',
|
|
90
|
-
cookieDocument
|
|
90
|
+
cookieDocument,
|
|
91
91
|
parse: (v) => Number(v),
|
|
92
92
|
stringify: (v) => v.toString(),
|
|
93
93
|
});
|
|
@@ -79,19 +79,19 @@ const AutoHideSearchBox = (p) => {
|
|
|
79
79
|
}, [p.searchText], [open]);
|
|
80
80
|
return (react_1.default.createElement(Base, { className: p.className, "data-open": open },
|
|
81
81
|
react_1.default.createElement(Icon, { style: { cursor: 'pointer' }, onClick: () => {
|
|
82
|
-
var _a
|
|
82
|
+
var _a;
|
|
83
83
|
if (open) {
|
|
84
84
|
p.setSearchText('', false);
|
|
85
85
|
}
|
|
86
86
|
setOpen(!open);
|
|
87
87
|
(_a = p.onOpenToggle) === null || _a === void 0 ? void 0 : _a.call(p, !open);
|
|
88
88
|
if (!open) {
|
|
89
|
-
(
|
|
89
|
+
setTimeout(() => { var _a; return (_a = textEditRef.current) === null || _a === void 0 ? void 0 : _a.focus(); }, 100);
|
|
90
90
|
}
|
|
91
91
|
} },
|
|
92
92
|
open && react_1.default.createElement(icons_1.CrossIcon, null),
|
|
93
93
|
!open && react_1.default.createElement(icons_1.Magnify, { style: { fill: 'white' } })),
|
|
94
|
-
react_1.default.createElement(SearchBoxStyled, Object.assign({ textBoxRef: textEditRef }, p, {
|
|
94
|
+
react_1.default.createElement(SearchBoxStyled, Object.assign({ textBoxRef: textEditRef }, p, { "data-open": open, setSearchText: (val, enter) => {
|
|
95
95
|
//we dont want empty enters to do anything
|
|
96
96
|
if (val === '' && enter) {
|
|
97
97
|
p.setSearchText(val, false);
|
|
@@ -6,5 +6,11 @@ export interface ISearchBox {
|
|
|
6
6
|
setSearchText: (val: string, enterPressed: boolean) => void;
|
|
7
7
|
className?: string;
|
|
8
8
|
textBoxRef?: React.RefObject<IRefTextEdit>;
|
|
9
|
+
/**
|
|
10
|
+
* if truthy will enable text edit mode by default. if focus is true, will also focus on open
|
|
11
|
+
*/
|
|
12
|
+
defaultEditing?: {
|
|
13
|
+
focus?: boolean;
|
|
14
|
+
};
|
|
9
15
|
}
|
|
10
16
|
export declare const SearchBox: (p: ISearchBox) => React.JSX.Element;
|
|
@@ -72,23 +72,25 @@ const TextEditStyled = (0, styled_1.default)(TextEdit_1.TextEdit) `
|
|
|
72
72
|
background-color: white;
|
|
73
73
|
`;
|
|
74
74
|
const SearchBox = (p) => {
|
|
75
|
-
|
|
76
|
-
const
|
|
75
|
+
const ur = (0, react_1.useRef)(p.textBoxRef);
|
|
76
|
+
const cr = (0, react_1.createRef)();
|
|
77
|
+
const textBoxRef = (!p.textBoxRef ? cr : ur);
|
|
77
78
|
(0, react_1.useEffect)(() => {
|
|
78
|
-
if (!textBoxRef
|
|
79
|
+
if (!(textBoxRef === null || textBoxRef === void 0 ? void 0 : textBoxRef.current) ||
|
|
80
|
+
textBoxRef.current.getValue() === p.searchText) {
|
|
79
81
|
return;
|
|
80
82
|
}
|
|
81
83
|
textBoxRef.current.setValue(p.searchText);
|
|
82
84
|
p.setSearchText(p.searchText, true);
|
|
83
|
-
}, [p]);
|
|
85
|
+
}, [p, textBoxRef]);
|
|
84
86
|
return (react_1.default.createElement(Base, Object.assign({ "data-type": "search", className: p.className }, (0, dom_1.filterDataProps)(p)),
|
|
85
|
-
react_1.default.createElement(TextEditStyled, { ref: textBoxRef, defaultValue: p.searchText, placeholder: p.placeholderText, defaultEditing: { focus: true }, singleLine: true, leftContent: react_1.default.createElement(MagnifyIcon, { onClick: () => { var _a; return p.setSearchText(((_a = textBoxRef.current) === null || _a === void 0 ? void 0 : _a.getValue()) || '', true); } },
|
|
87
|
+
react_1.default.createElement(TextEditStyled, { ref: textBoxRef, defaultValue: p.searchText, placeholder: p.placeholderText, defaultEditing: Object.assign({ focus: true }, p.defaultEditing), singleLine: true, leftContent: react_1.default.createElement(MagnifyIcon, { onClick: () => { var _a; return p.setSearchText(((_a = textBoxRef === null || textBoxRef === void 0 ? void 0 : textBoxRef.current) === null || _a === void 0 ? void 0 : _a.getValue()) || '', true); } },
|
|
86
88
|
react_1.default.createElement(icons_1.Magnify, null)), allowUndo: false, onClickOutsideWithNoValue: null, onSubmit: (v, enterPressed) => (0, debounce_1.debounce)(() => {
|
|
87
89
|
p.setSearchText(v, enterPressed);
|
|
88
90
|
}, { key: 'pagesearch', time: 200 }) }),
|
|
89
91
|
p.searchText && (react_1.default.createElement(CrossIconStyled, { onClick: () => {
|
|
90
92
|
var _a;
|
|
91
|
-
(_a = textBoxRef.current) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
93
|
+
(_a = textBoxRef === null || textBoxRef === void 0 ? void 0 : textBoxRef.current) === null || _a === void 0 ? void 0 : _a.setValue('');
|
|
92
94
|
p.setSearchText('', true);
|
|
93
95
|
} }))));
|
|
94
96
|
};
|
|
@@ -25,7 +25,7 @@ let callOpenApiCache;
|
|
|
25
25
|
*/
|
|
26
26
|
function getCacheKey({ cacheKey, overrideAuth, ssrCacheItems, }) {
|
|
27
27
|
const authkeyPrefix1 = (0, direct_1.getIdTokenAuthHeaderRaw)({
|
|
28
|
-
overrideAuth
|
|
28
|
+
overrideAuth,
|
|
29
29
|
});
|
|
30
30
|
const authPref = !authkeyPrefix1 ? '' : (0, hashCode_1.hashCode)((0, base64_1.toBase64)(authkeyPrefix1));
|
|
31
31
|
const ssrCachePref = !ssrCacheItems
|
package/package.json
CHANGED