ag-common 0.0.728 → 0.0.729

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.
Files changed (160) hide show
  1. package/dist/api/helpers/api.js +0 -6
  2. package/dist/api/helpers/dynamo.d.ts +1 -1
  3. package/dist/api/helpers/dynamo.js +11 -12
  4. package/dist/api/helpers/enforceDynamoProvisionCap.js +0 -1
  5. package/dist/api/helpers/openApiHelpers.js +1 -2
  6. package/dist/api/helpers/s3.d.ts +0 -1
  7. package/dist/api/helpers/s3.js +11 -11
  8. package/dist/api/helpers/ses.d.ts +1 -1
  9. package/dist/api/helpers/sts.js +2 -2
  10. package/dist/api/helpers/validateOpenApi.js +1 -4
  11. package/dist/api/helpers/validations.js +3 -5
  12. package/dist/api/index.d.ts +1 -1
  13. package/dist/api/index.js +0 -1
  14. package/dist/api/openapi-postfix.js +0 -3
  15. package/dist/api/openapi-prefix.js +0 -6
  16. package/dist/api/types/index.d.ts +1 -1
  17. package/dist/api/types/index.js +0 -15
  18. package/dist/common/helpers/array.d.ts +1 -1
  19. package/dist/common/helpers/array.js +3 -4
  20. package/dist/common/helpers/async.js +2 -3
  21. package/dist/common/helpers/binary.d.ts +3 -4
  22. package/dist/common/helpers/binary.js +4 -4
  23. package/dist/common/helpers/csv.js +1 -3
  24. package/dist/common/helpers/date.js +0 -1
  25. package/dist/common/helpers/func.js +1 -2
  26. package/dist/common/helpers/generator.js +1 -3
  27. package/dist/common/helpers/groupBy.js +3 -4
  28. package/dist/common/helpers/hashCode.js +0 -1
  29. package/dist/common/helpers/log.js +0 -2
  30. package/dist/common/helpers/math.js +6 -8
  31. package/dist/common/helpers/memo.js +1 -4
  32. package/dist/common/helpers/object.js +9 -14
  33. package/dist/common/helpers/random.js +3 -3
  34. package/dist/common/helpers/stream.js +3 -3
  35. package/dist/common/helpers/string/contains.js +3 -3
  36. package/dist/common/helpers/string/json.js +0 -1
  37. package/dist/common/helpers/string/object.js +1 -2
  38. package/dist/common/helpers/string/redact.js +3 -3
  39. package/dist/common/helpers/string/trim.js +2 -3
  40. package/dist/common/helpers/string/truncate.js +1 -2
  41. package/dist/common/helpers/string/url.js +3 -2
  42. package/dist/common/helpers/xml.js +0 -1
  43. package/dist/node/helpers/fetch.js +2 -2
  44. package/dist/node/helpers/fs.js +2 -3
  45. package/dist/ui/components/Accordion/index.js +17 -7
  46. package/dist/ui/components/BarChart/index.d.ts +1 -1
  47. package/dist/ui/components/BarChart/index.js +0 -1
  48. package/dist/ui/components/Button/index.d.ts +2 -3
  49. package/dist/ui/components/Button/index.js +1 -4
  50. package/dist/ui/components/Confirm/Dialog.js +1 -0
  51. package/dist/ui/components/Confirm/index.d.ts +1 -1
  52. package/dist/ui/components/Confirm/index.js +0 -1
  53. package/dist/ui/components/DarkMode/Base.d.ts +3 -4
  54. package/dist/ui/components/DarkMode/Base.js +18 -7
  55. package/dist/ui/components/DropdownList/Base.d.ts +2 -2
  56. package/dist/ui/components/DropdownList/Base.js +19 -10
  57. package/dist/ui/components/DropdownList/Dialog.d.ts +1 -1
  58. package/dist/ui/components/DropdownList/Dialog.js +2 -0
  59. package/dist/ui/components/DropdownList/types.d.ts +1 -1
  60. package/dist/ui/components/HorizontalScrollBar/index.js +18 -7
  61. package/dist/ui/components/Icon/index.d.ts +2 -2
  62. package/dist/ui/components/Image/index.js +17 -7
  63. package/dist/ui/components/InfiniteScroll/index.js +17 -8
  64. package/dist/ui/components/LineChart/index.d.ts +1 -1
  65. package/dist/ui/components/LineChart/index.js +0 -1
  66. package/dist/ui/components/Loader/index.js +17 -7
  67. package/dist/ui/components/Markdown/index.d.ts +2 -2
  68. package/dist/ui/components/MinSidebar/index.js +17 -7
  69. package/dist/ui/components/Modal/Dialog.js +1 -0
  70. package/dist/ui/components/Modal/Modal.d.ts +2 -2
  71. package/dist/ui/components/Modal/Modal.js +18 -7
  72. package/dist/ui/components/Modal/index.d.ts +1 -1
  73. package/dist/ui/components/Modal/index.js +0 -1
  74. package/dist/ui/components/OpenApiCodeBlock/curl/helpers/body.d.ts +1 -1
  75. package/dist/ui/components/OpenApiCodeBlock/curl/helpers/security.d.ts +1 -1
  76. package/dist/ui/components/OpenApiCodeBlock/curl/index.d.ts +2 -2
  77. package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/call.d.ts +1 -1
  78. package/dist/ui/components/OpenApiCodeBlock/fetch/helpers/req.d.ts +1 -1
  79. package/dist/ui/components/OpenApiCodeBlock/helpers/common.d.ts +4 -5
  80. package/dist/ui/components/OpenApiCodeBlock/helpers/common.js +0 -1
  81. package/dist/ui/components/OpenApiCodeBlock/helpers/joinJsx.d.ts +1 -1
  82. package/dist/ui/components/OpenApiCodeBlock/index.d.ts +1 -1
  83. package/dist/ui/components/OpenApiCodeBlock/index.js +0 -1
  84. package/dist/ui/components/OpenApiCodeBlock/types.d.ts +1 -1
  85. package/dist/ui/components/ProgressBar/index.js +17 -7
  86. package/dist/ui/components/Prompt/Modal.js +18 -7
  87. package/dist/ui/components/Prompt/index.d.ts +1 -1
  88. package/dist/ui/components/Prompt/index.js +0 -1
  89. package/dist/ui/components/RadioGroup/index.d.ts +2 -2
  90. package/dist/ui/components/RadioGroup/index.js +17 -8
  91. package/dist/ui/components/Search/AutoHideSearchBox.js +17 -7
  92. package/dist/ui/components/Search/Dialog.js +1 -0
  93. package/dist/ui/components/Search/Inline.js +17 -8
  94. package/dist/ui/components/Search/SearchBox.d.ts +1 -1
  95. package/dist/ui/components/Search/SearchBox.js +17 -7
  96. package/dist/ui/components/Search/index.d.ts +1 -1
  97. package/dist/ui/components/Search/index.js +0 -1
  98. package/dist/ui/components/Search/types.d.ts +2 -2
  99. package/dist/ui/components/Sidebar/index.js +17 -7
  100. package/dist/ui/components/TabBar/index.d.ts +2 -2
  101. package/dist/ui/components/TabBar/index.js +17 -7
  102. package/dist/ui/components/Table/index.d.ts +2 -2
  103. package/dist/ui/components/TextEdit/CheckboxEdit.js +17 -7
  104. package/dist/ui/components/TextEdit/ColourEdit.js +17 -7
  105. package/dist/ui/components/TextEdit/ListboxEdit.js +20 -18
  106. package/dist/ui/components/TextEdit/TextEdit.d.ts +2 -2
  107. package/dist/ui/components/TextEdit/TextEdit.js +20 -18
  108. package/dist/ui/components/TextEdit/common.d.ts +6 -7
  109. package/dist/ui/components/TextEdit/index.d.ts +1 -1
  110. package/dist/ui/components/TextEdit/index.js +0 -1
  111. package/dist/ui/components/TextEdit/types.d.ts +1 -0
  112. package/dist/ui/components/TextWithButton/index.js +17 -7
  113. package/dist/ui/components/Toast/base.js +18 -7
  114. package/dist/ui/components/Toast/index.d.ts +1 -1
  115. package/dist/ui/components/Toast/index.js +0 -1
  116. package/dist/ui/components/Toast/types.d.ts +1 -1
  117. package/dist/ui/components/TreeChart/base.js +17 -7
  118. package/dist/ui/components/TreeChart/index.d.ts +1 -1
  119. package/dist/ui/components/TreeChart/index.js +0 -1
  120. package/dist/ui/components/UserImage/index.js +17 -7
  121. package/dist/ui/helpers/axiosHelper.d.ts +1 -1
  122. package/dist/ui/helpers/axiosHelper.js +0 -2
  123. package/dist/ui/helpers/callOpenApi/direct.js +2 -7
  124. package/dist/ui/helpers/callOpenApi/helpers.js +1 -2
  125. package/dist/ui/helpers/callOpenApi/hook.d.ts +0 -1
  126. package/dist/ui/helpers/callOpenApi/index.d.ts +1 -1
  127. package/dist/ui/helpers/callOpenApi/index.js +0 -1
  128. package/dist/ui/helpers/cookie/get.js +3 -3
  129. package/dist/ui/helpers/cookie/raw.js +4 -4
  130. package/dist/ui/helpers/cookie/set.js +2 -2
  131. package/dist/ui/helpers/cookie/use.js +2 -2
  132. package/dist/ui/helpers/debounce.js +2 -3
  133. package/dist/ui/helpers/dom.js +0 -2
  134. package/dist/ui/helpers/extractAttributes.js +0 -1
  135. package/dist/ui/helpers/index.d.ts +2 -2
  136. package/dist/ui/helpers/index.js +0 -2
  137. package/dist/ui/helpers/plural.js +1 -2
  138. package/dist/ui/helpers/routes.d.ts +2 -2
  139. package/dist/ui/helpers/serviceWorker.js +1 -2
  140. package/dist/ui/helpers/useContextMenu.d.ts +1 -1
  141. package/dist/ui/helpers/useContextMenu.js +2 -3
  142. package/dist/ui/helpers/useElementAttribute.js +3 -2
  143. package/dist/ui/helpers/useGranularHook.js +1 -1
  144. package/dist/ui/helpers/useInterval.js +2 -2
  145. package/dist/ui/helpers/useIsInViewport.js +1 -2
  146. package/dist/ui/helpers/useLocalStorage.js +2 -2
  147. package/dist/ui/helpers/useLockBodyScroll.js +1 -2
  148. package/dist/ui/helpers/useOnClickOutside.d.ts +1 -1
  149. package/dist/ui/helpers/useOnClickOutside.js +3 -3
  150. package/dist/ui/helpers/useOnScroll.js +6 -7
  151. package/dist/ui/helpers/useOverloadPageSearch.js +2 -0
  152. package/dist/ui/helpers/useQueryString.js +1 -1
  153. package/dist/ui/helpers/useResize.js +2 -2
  154. package/dist/ui/helpers/useTimeout.js +1 -2
  155. package/dist/ui/helpers/useTooltip.d.ts +1 -0
  156. package/dist/ui/helpers/useTooltip.js +18 -7
  157. package/dist/ui/icons/index.d.ts +27 -28
  158. package/dist/ui/styles/common.d.ts +2 -2
  159. package/dist/ui/styles/standaloneStyles.d.ts +12 -13
  160. package/package.json +36 -33
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.callOpenApi = exports.getIdTokenAuthHeaderRaw = void 0;
12
+ exports.callOpenApi = void 0;
13
+ exports.getIdTokenAuthHeaderRaw = getIdTokenAuthHeaderRaw;
13
14
  const const_1 = require("../../../common/const");
14
15
  const array_1 = require("../../../common/helpers/array");
15
16
  const log_1 = require("../../../common/helpers/log");
@@ -40,7 +41,6 @@ function getIdTokenAuthHeaderRaw({ overrideAuth, }) {
40
41
  }
41
42
  return idToken;
42
43
  }
43
- exports.getIdTokenAuthHeaderRaw = getIdTokenAuthHeaderRaw;
44
44
  /**
45
45
  * get id_token, and then refresh
46
46
  */
@@ -61,7 +61,6 @@ function getIdTokenAuthHeader(_a) {
61
61
  const callOpenApi = (p) => __awaiter(void 0, void 0, void 0, function* () {
62
62
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
63
63
  const { func, apiUrl, logout, newDefaultApi, headers } = p;
64
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
64
  let error;
66
65
  let data = undefined;
67
66
  const config = {
@@ -80,7 +79,6 @@ const callOpenApi = (p) => __awaiter(void 0, void 0, void 0, function* () {
80
79
  if (config.baseOptions.headers.authorization) {
81
80
  config.middleware = [
82
81
  {
83
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
84
82
  pre: (oldFetchParams) => {
85
83
  var _a, _b, _c;
86
84
  const url = (_a = oldFetchParams === null || oldFetchParams === void 0 ? void 0 : oldFetchParams.url) !== null && _a !== void 0 ? _a : '(url)';
@@ -97,7 +95,6 @@ const callOpenApi = (p) => __awaiter(void 0, void 0, void 0, function* () {
97
95
  while (errorCount <= errorMax) {
98
96
  errorCount += 1;
99
97
  try {
100
- // eslint-disable-next-line no-await-in-loop
101
98
  const response = yield func(cl);
102
99
  if (response.status < 400) {
103
100
  data = response.data;
@@ -106,12 +103,10 @@ const callOpenApi = (p) => __awaiter(void 0, void 0, void 0, function* () {
106
103
  throw { response };
107
104
  }
108
105
  catch (e) {
109
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
110
106
  const ae = e;
111
107
  const status = Number((_c = (_a = ae.code) !== null && _a !== void 0 ? _a : (_b = ae.response) === null || _b === void 0 ? void 0 : _b.status) !== null && _c !== void 0 ? _c : 500);
112
108
  const errorMessage = [
113
109
  (_d = ae.status) !== null && _d !== void 0 ? _d : '',
114
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
115
110
  (_g = (_f = (_e = ae.response) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.toString()) !== null && _g !== void 0 ? _g : '',
116
111
  (_j = (_h = ae.response) === null || _h === void 0 ? void 0 : _h.statusText.toString()) !== null && _j !== void 0 ? _j : '',
117
112
  (_l = (_k = ae.response) === null || _k === void 0 ? void 0 : _k.status.toString()) !== null && _l !== void 0 ? _l : '',
@@ -26,7 +26,6 @@ const apiResponseToAxiosResponse = (p) => __awaiter(void 0, void 0, void 0, func
26
26
  statusText: r.raw.statusText,
27
27
  data: yield r.value(),
28
28
  headers: (0, array_1.arrayToObject)(Object.entries(r.raw.headers), (s) => s[0], (s) => s[1]),
29
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
29
  config: {},
31
30
  };
32
31
  return r1;
@@ -39,6 +38,7 @@ const apiResponseToAxiosResponse = (p) => __awaiter(void 0, void 0, void 0, func
39
38
  try {
40
39
  const st = yield (0, stream_1.getStringFromStream)(er.body);
41
40
  statusText = st;
41
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
42
42
  }
43
43
  catch (e) {
44
44
  //
@@ -52,7 +52,6 @@ const apiResponseToAxiosResponse = (p) => __awaiter(void 0, void 0, void 0, func
52
52
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
53
53
  er.headers &&
54
54
  (0, array_1.arrayToObject)(Object.entries(er.headers), (s) => s[0], (s) => s[1]),
55
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
55
  config: {},
57
56
  };
58
57
  return ret;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { AxiosWrapper } from '../jwt';
3
2
  import type { CacheItems } from '../routes';
4
3
  import type { ICallOpenApi } from './types';
@@ -2,4 +2,4 @@ export * from './cached';
2
2
  export * from './direct';
3
3
  export * from './helpers';
4
4
  export * from './hook';
5
- export * from './types';
5
+ export type * from './types';
@@ -18,4 +18,3 @@ __exportStar(require("./cached"), exports);
18
18
  __exportStar(require("./direct"), exports);
19
19
  __exportStar(require("./helpers"), exports);
20
20
  __exportStar(require("./hook"), exports);
21
- __exportStar(require("./types"), exports);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCookieString = exports.getCookieRawWrapper = void 0;
3
+ exports.getCookieString = void 0;
4
+ exports.getCookieRawWrapper = getCookieRawWrapper;
4
5
  const log_1 = require("../../../common/helpers/log");
5
6
  const base64_1 = require("../../../common/helpers/string/base64");
6
7
  const raw_1 = require("./raw");
@@ -22,7 +23,7 @@ function getCookieRawWrapper({ name, cookieDocument, defaultValue, parse: parseR
22
23
  };
23
24
  let raw = '';
24
25
  let currentCount = 0;
25
- // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
26
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
26
27
  while (true) {
27
28
  const newv = (0, raw_1.getCookie)({
28
29
  name: name + currentCount,
@@ -46,6 +47,5 @@ function getCookieRawWrapper({ name, cookieDocument, defaultValue, parse: parseR
46
47
  return defaultValue;
47
48
  }
48
49
  }
49
- exports.getCookieRawWrapper = getCookieRawWrapper;
50
50
  const getCookieString = (p) => getCookieRawWrapper(Object.assign(Object.assign({}, p), { parse: (s) => s, defaultValue: p.defaultValue || '' }));
51
51
  exports.getCookieString = getCookieString;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.wipeCookies = exports.setCookie = exports.getCookie = exports.getAllCookies = void 0;
3
+ exports.getCookie = exports.getAllCookies = void 0;
4
+ exports.setCookie = setCookie;
5
+ exports.wipeCookies = wipeCookies;
4
6
  const log_1 = require("../../../common/helpers/log");
5
7
  const const_1 = require("./const");
6
8
  /**
@@ -39,7 +41,6 @@ function setCookie({ name, value, expiryDays = 1, }) {
39
41
  const expires = `expires=${!value || expiryDays < 0 ? const_1.expireDate : d.toUTCString()}`;
40
42
  document.cookie = `${name}=${!value ? '' : value};${expires};path=/; SameSite=Strict; Secure`;
41
43
  }
42
- exports.setCookie = setCookie;
43
44
  /** delete all non httponly cookies */
44
45
  function wipeCookies(name) {
45
46
  if (typeof window === 'undefined') {
@@ -47,7 +48,7 @@ function wipeCookies(name) {
47
48
  return;
48
49
  }
49
50
  let currentCount = 0;
50
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, no-constant-condition
51
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
51
52
  while (true) {
52
53
  if ((0, exports.getCookie)({
53
54
  name: name + currentCount,
@@ -61,4 +62,3 @@ function wipeCookies(name) {
61
62
  }
62
63
  }
63
64
  }
64
- exports.wipeCookies = wipeCookies;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setCookieString = exports.setCookieRawWrapper = void 0;
3
+ exports.setCookieString = void 0;
4
+ exports.setCookieRawWrapper = setCookieRawWrapper;
4
5
  const base64_1 = require("../../../common/helpers/string/base64");
5
6
  const chunk_1 = require("../../../common/helpers/string/chunk");
6
7
  const const_1 = require("./const");
@@ -28,6 +29,5 @@ function setCookieRawWrapper(p) {
28
29
  (0, raw_1.setCookie)(Object.assign(Object.assign({}, p), { name: p.name + index1, value: chunk }));
29
30
  }
30
31
  }
31
- exports.setCookieRawWrapper = setCookieRawWrapper;
32
32
  const setCookieString = (p) => setCookieRawWrapper(Object.assign(Object.assign({}, p), { stringify: (s) => s }));
33
33
  exports.setCookieString = setCookieString;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCookieBoolean = exports.useCookieNumber = exports.useCookieString = exports.useCookie = void 0;
3
+ exports.useCookieBoolean = exports.useCookieNumber = exports.useCookieString = void 0;
4
+ exports.useCookie = useCookie;
4
5
  const react_1 = require("react");
5
6
  const get_1 = require("./get");
6
7
  const set_1 = require("./set");
@@ -29,7 +30,6 @@ function useCookie(p) {
29
30
  };
30
31
  return [cookie, setState];
31
32
  }
32
- exports.useCookie = useCookie;
33
33
  const useCookieString = (p) => {
34
34
  var _a;
35
35
  return useCookie(Object.assign(Object.assign({}, p), { parse: (s) => s !== null && s !== void 0 ? s : '', stringify: (s) => s, defaultValue: (_a = p.defaultValue) !== null && _a !== void 0 ? _a : '' }));
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.debounce = exports.useDebounce = void 0;
4
+ exports.useDebounce = useDebounce;
5
+ exports.debounce = debounce;
5
6
  const react_1 = require("react");
6
7
  function useDebounce(value, delay) {
7
8
  const [debouncedValue, setDebouncedValue] = (0, react_1.useState)(value);
@@ -15,7 +16,6 @@ function useDebounce(value, delay) {
15
16
  }, [delay, value]);
16
17
  return debouncedValue;
17
18
  }
18
- exports.useDebounce = useDebounce;
19
19
  const hashMap = {};
20
20
  function debounce(callback, { key, time, }) {
21
21
  clearTimeout(hashMap[key]);
@@ -24,4 +24,3 @@ function debounce(callback, { key, time, }) {
24
24
  callback();
25
25
  }, time);
26
26
  }
27
- exports.debounce = debounce;
@@ -22,7 +22,6 @@ exports.convertRemToPixels = convertRemToPixels;
22
22
  * @param p
23
23
  * @returns
24
24
  */
25
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
26
25
  const filterDataProps = (p) => {
27
26
  const x = Object.entries(p)
28
27
  .filter((r) => r[0].startsWith('data-'))
@@ -38,7 +37,6 @@ const isRightClick = (event) => {
38
37
  isRightMB = event.which == 3;
39
38
  else if ('button' in event)
40
39
  // IE, Opera
41
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
42
40
  isRightMB = event.button == 2;
43
41
  return isRightMB;
44
42
  };
@@ -7,7 +7,6 @@ const extractAttributes = ({ idName }) => {
7
7
  return {};
8
8
  }
9
9
  const ret = {};
10
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11
10
  // @ts-ignore
12
11
  [...document.getElementById(idName).attributes].forEach((a) => {
13
12
  ret[a.name] = a.value;
@@ -1,12 +1,12 @@
1
1
  export * from './axiosHelper';
2
2
  export * from './callOpenApi';
3
- export * from './cognito';
3
+ export type * from './cognito';
4
4
  export * from './cookie';
5
5
  export * from './date';
6
6
  export * from './debounce';
7
7
  export * from './dom';
8
8
  export * from './extractAttributes';
9
- export * from './jwt';
9
+ export type * from './jwt';
10
10
  export * from './plural';
11
11
  export * from './routes';
12
12
  export * from './serviceWorker';
@@ -16,13 +16,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./axiosHelper"), exports);
18
18
  __exportStar(require("./callOpenApi"), exports);
19
- __exportStar(require("./cognito"), exports);
20
19
  __exportStar(require("./cookie"), exports);
21
20
  __exportStar(require("./date"), exports);
22
21
  __exportStar(require("./debounce"), exports);
23
22
  __exportStar(require("./dom"), exports);
24
23
  __exportStar(require("./extractAttributes"), exports);
25
- __exportStar(require("./jwt"), exports);
26
24
  __exportStar(require("./plural"), exports);
27
25
  __exportStar(require("./routes"), exports);
28
26
  __exportStar(require("./serviceWorker"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.plural = void 0;
3
+ exports.plural = plural;
4
4
  function plural(word, count) {
5
5
  if (!word || !count) {
6
6
  return word;
@@ -10,4 +10,3 @@ function plural(word, count) {
10
10
  }
11
11
  return word;
12
12
  }
13
- exports.plural = plural;
@@ -60,8 +60,8 @@ export declare const getServerReq: ({ pathname, query, headers, }: {
60
60
  */
61
61
  headers: {
62
62
  host?: string;
63
- 'user-agent'?: string;
64
- 'x-forwarded-proto'?: 'http' | 'https';
63
+ "user-agent"?: string;
64
+ "x-forwarded-proto"?: "http" | "https";
65
65
  };
66
66
  /**
67
67
  * eg ctx.asPath || '/'
@@ -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.uninstallServiceWorkers = void 0;
12
+ exports.uninstallServiceWorkers = uninstallServiceWorkers;
13
13
  const async_1 = require("../../common/helpers/async");
14
14
  function uninstallServiceWorkers() {
15
15
  return __awaiter(this, void 0, void 0, function* () {
@@ -21,4 +21,3 @@ function uninstallServiceWorkers() {
21
21
  .then((registrations) => __awaiter(this, void 0, void 0, function* () { return (0, async_1.asyncForEach)([...registrations], (r) => r.unregister()); }));
22
22
  });
23
23
  }
24
- exports.uninstallServiceWorkers = uninstallServiceWorkers;
@@ -1,5 +1,5 @@
1
1
  export declare const useContextMenu: ({ ref, }: {
2
- ref: React.RefObject<HTMLDivElement>;
2
+ ref: React.RefObject<HTMLDivElement | null>;
3
3
  }) => {
4
4
  xPos: string;
5
5
  yPos: string;
@@ -7,9 +7,7 @@ const useContextMenu = ({ ref, }) => {
7
7
  const [xPos, setXPos] = (0, react_1.useState)('0px');
8
8
  const [yPos, setYPos] = (0, react_1.useState)('0px');
9
9
  const [showMenu, setShowMenu] = (0, react_1.useState)(false);
10
- const handleContextMenu = (0, react_1.useCallback)(
11
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
- (e) => {
10
+ const handleContextMenu = (0, react_1.useCallback)((e) => {
13
11
  var _a;
14
12
  if (!((_a = ref.current) === null || _a === void 0 ? void 0 : _a.contains(e.target))) {
15
13
  return;
@@ -32,6 +30,7 @@ const useContextMenu = ({ ref, }) => {
32
30
  try {
33
31
  document.addEventListener('click', handleClick);
34
32
  document.removeEventListener('contextmenu', handleContextMenu);
33
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
35
34
  }
36
35
  catch (e) {
37
36
  //
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useElementAttribute = void 0;
4
+ exports.useElementAttribute = useElementAttribute;
5
5
  const react_1 = require("react");
6
6
  /**
7
7
  * add and remove an attribute on an element
@@ -19,6 +19,7 @@ function useElementAttribute({ enabled, key, value, element, }) {
19
19
  else {
20
20
  element.removeAttribute(key);
21
21
  }
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
23
  }
23
24
  catch (e) {
24
25
  //
@@ -26,6 +27,7 @@ function useElementAttribute({ enabled, key, value, element, }) {
26
27
  return () => {
27
28
  try {
28
29
  element.removeAttribute(key);
30
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
29
31
  }
30
32
  catch (e) {
31
33
  //
@@ -33,4 +35,3 @@ function useElementAttribute({ enabled, key, value, element, }) {
33
35
  };
34
36
  }, [element, enabled, key, value]);
35
37
  }
36
- exports.useElementAttribute = useElementAttribute;
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.useGranularEffect = exports.useGranularHook = void 0;
5
5
  const react_1 = require("react");
6
6
  const useGranularHook = (hook, callback, primaryDeps, secondaryDeps) => {
7
- const ref = (0, react_1.useRef)();
7
+ const ref = (0, react_1.useRef)(null);
8
8
  if (!ref.current ||
9
9
  !primaryDeps.every((w, i) => { var _a; return Object.is(w, (_a = ref.current) === null || _a === void 0 ? void 0 : _a[i]); }))
10
10
  ref.current = [...primaryDeps, ...secondaryDeps];
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useInterval = exports.useIsomorphicLayoutEffect = void 0;
4
+ exports.useIsomorphicLayoutEffect = void 0;
5
+ exports.useInterval = useInterval;
5
6
  const react_1 = require("react");
6
7
  exports.useIsomorphicLayoutEffect = typeof window !== 'undefined' ? react_1.useLayoutEffect : react_1.useEffect;
7
8
  exports.default = exports.useIsomorphicLayoutEffect;
@@ -34,4 +35,3 @@ delay, opt) {
34
35
  };
35
36
  }, [opt, delay]);
36
37
  }
37
- exports.useInterval = useInterval;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useIsInViewport = void 0;
3
+ exports.useIsInViewport = useIsInViewport;
4
4
  const react_1 = require("react");
5
5
  function useIsInViewport(ref) {
6
6
  const [isInViewport, setIsInViewport] = (0, react_1.useState)(false);
@@ -17,4 +17,3 @@ function useIsInViewport(ref) {
17
17
  }, [ref]);
18
18
  return isInViewport;
19
19
  }
20
- exports.useIsInViewport = useIsInViewport;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UseLocalStorage = exports.getLocalStorageItem = exports.setLocalStorageItem = exports.clearAllLocalStorage = exports.clearLocalStorageItem = void 0;
3
+ exports.getLocalStorageItem = exports.setLocalStorageItem = exports.clearAllLocalStorage = exports.clearLocalStorageItem = void 0;
4
+ exports.UseLocalStorage = UseLocalStorage;
4
5
  const react_1 = require("react");
5
6
  const date_1 = require("../../common/helpers/date");
6
7
  const log_1 = require("../../common/helpers/log");
@@ -83,4 +84,3 @@ function UseLocalStorage(key, initialValue, ttl) {
83
84
  };
84
85
  return [storedValue, setValue];
85
86
  }
86
- exports.UseLocalStorage = UseLocalStorage;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLockBodyScroll = void 0;
3
+ exports.useLockBodyScroll = useLockBodyScroll;
4
4
  const react_1 = require("react");
5
5
  function useLockBodyScroll(enabled) {
6
6
  (0, react_1.useLayoutEffect)(() => {
@@ -16,4 +16,3 @@ function useLockBodyScroll(enabled) {
16
16
  };
17
17
  }, [enabled]);
18
18
  }
19
- exports.useLockBodyScroll = useLockBodyScroll;
@@ -1,7 +1,7 @@
1
1
  import type { RefObject } from 'react';
2
2
  type Event = MouseEvent | TouchEvent;
3
3
  export declare function useOnClickOutside<T extends HTMLElement = HTMLElement>(p: {
4
- ref: RefObject<T>;
4
+ ref: RefObject<T | null>;
5
5
  /** can either be a boolean, or a callback */
6
6
  disabled?: boolean | (() => boolean);
7
7
  /** if true, will also consider moving mouse outside div. default false */
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useOnClickOutside = void 0;
4
+ exports.useOnClickOutside = useOnClickOutside;
5
5
  const react_1 = require("react");
6
6
  const dom_1 = require("./dom");
7
7
  function useOnClickOutside(p, handler) {
@@ -9,7 +9,7 @@ function useOnClickOutside(p, handler) {
9
9
  const listener = (event) => {
10
10
  var _a;
11
11
  const disabled = !p.disabled || typeof p.disabled === 'boolean'
12
- ? (_a = p.disabled) !== null && _a !== void 0 ? _a : false
12
+ ? ((_a = p.disabled) !== null && _a !== void 0 ? _a : false)
13
13
  : p.disabled();
14
14
  if (disabled) {
15
15
  return;
@@ -48,6 +48,7 @@ function useOnClickOutside(p, handler) {
48
48
  document.removeEventListener(`mousedown`, listener);
49
49
  document.removeEventListener(`touchstart`, listener);
50
50
  document.removeEventListener(`mousemove`, listener);
51
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
51
52
  }
52
53
  catch (e) {
53
54
  //
@@ -56,4 +57,3 @@ function useOnClickOutside(p, handler) {
56
57
  // Reload only if ref or handler changes
57
58
  }, [p, handler]);
58
59
  }
59
- exports.useOnClickOutside = useOnClickOutside;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useOnScroll = void 0;
4
+ exports.useOnScroll = useOnScroll;
5
5
  const react_1 = require("react");
6
6
  const debounce_1 = require("./debounce");
7
7
  const useGranularHook_1 = require("./useGranularHook");
@@ -18,9 +18,9 @@ function useOnScroll({ onScroll, element, } = {}) {
18
18
  (0, useGranularHook_1.useGranularEffect)(() => {
19
19
  var _a;
20
20
  const listener = (e) => {
21
- var _a, _b, _c, _d;
22
- const y = (_b = (_a = element === null || element === void 0 ? void 0 : element.current) === null || _a === void 0 ? void 0 : _a.scrollTop) !== null && _b !== void 0 ? _b : window.scrollY;
23
- const x = (_d = (_c = element === null || element === void 0 ? void 0 : element.current) === null || _c === void 0 ? void 0 : _c.scrollLeft) !== null && _d !== void 0 ? _d : window.scrollX;
21
+ var _a, _b;
22
+ const y = (_a = element === null || element === void 0 ? void 0 : element.current.scrollTop) !== null && _a !== void 0 ? _a : window.scrollY;
23
+ const x = (_b = element === null || element === void 0 ? void 0 : element.current.scrollLeft) !== null && _b !== void 0 ? _b : window.scrollX;
24
24
  const r = {
25
25
  y,
26
26
  x,
@@ -46,6 +46,7 @@ function useOnScroll({ onScroll, element, } = {}) {
46
46
  var _a;
47
47
  try {
48
48
  ((_a = element === null || element === void 0 ? void 0 : element.current) !== null && _a !== void 0 ? _a : document).removeEventListener(`scroll`, listenDebounce);
49
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
49
50
  }
50
51
  catch (e) {
51
52
  //
@@ -53,11 +54,9 @@ function useOnScroll({ onScroll, element, } = {}) {
53
54
  };
54
55
  }, [element], [element, onScroll, startScrollTopY]);
55
56
  (0, react_1.useEffect)(() => {
56
- var _a;
57
- if (startScrollTopY === -1 && ((_a = element === null || element === void 0 ? void 0 : element.current) === null || _a === void 0 ? void 0 : _a.scrollTop)) {
57
+ if (startScrollTopY === -1 && (element === null || element === void 0 ? void 0 : element.current.scrollTop)) {
58
58
  setStartScrollTopY(element.current.scrollTop);
59
59
  }
60
60
  }, [element, startScrollTopY]);
61
61
  return state;
62
62
  }
63
- exports.useOnScroll = useOnScroll;
@@ -18,6 +18,7 @@ const useOverloadPageSearch = ({ disabled = false, onTrigger, }) => {
18
18
  if (!disabled) {
19
19
  window.addEventListener('keydown', ctrlF);
20
20
  }
21
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
22
  }
22
23
  catch (e) {
23
24
  //
@@ -25,6 +26,7 @@ const useOverloadPageSearch = ({ disabled = false, onTrigger, }) => {
25
26
  return () => {
26
27
  try {
27
28
  window.removeEventListener('keydown', ctrlF);
29
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
28
30
  }
29
31
  catch (e) {
30
32
  //
@@ -13,7 +13,7 @@ exports.isServer = typeof window === 'undefined';
13
13
  */
14
14
  const useQueryStringRaw = ({ name, queryValues, defaultValue, stringify, parse, }) => {
15
15
  const qv = exports.isServer
16
- ? queryValues !== null && queryValues !== void 0 ? queryValues : {}
16
+ ? (queryValues !== null && queryValues !== void 0 ? queryValues : {})
17
17
  : (0, object_1.paramsToObject)(new URLSearchParams(window.location.search));
18
18
  const qsv = parse(qv[name]) || defaultValue;
19
19
  const [state, setStateRaw] = (0, react_1.useState)(qsv);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useResize = void 0;
4
+ exports.useResize = useResize;
5
5
  const react_1 = require("react");
6
6
  const media_1 = require("../styles/media");
7
7
  function getWindowDimensions() {
@@ -33,6 +33,7 @@ function useResize() {
33
33
  return () => {
34
34
  try {
35
35
  window.removeEventListener('resize', handleResize);
36
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
36
37
  }
37
38
  catch (e) {
38
39
  //
@@ -41,4 +42,3 @@ function useResize() {
41
42
  }, [windowDimensions]);
42
43
  return windowDimensions;
43
44
  }
44
- exports.useResize = useResize;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  'use client';
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useTimeout = void 0;
4
+ exports.useTimeout = useTimeout;
5
5
  const react_1 = require("react");
6
6
  function useTimeout(callback,
7
7
  /** if null wont trigger */
@@ -33,4 +33,3 @@ delay) {
33
33
  }
34
34
  }, [delay]);
35
35
  }
36
- exports.useTimeout = useTimeout;
@@ -1,4 +1,5 @@
1
1
  import type { MouseEvent } from 'react';
2
+ import type { JSX } from 'react';
2
3
  interface IPos<T> {
3
4
  cursor: MouseEvent;
4
5
  data: T;
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -114,6 +124,7 @@ const useTooltip = (p) => {
114
124
  var _a;
115
125
  try {
116
126
  (_a = document.querySelector(`#${portalId}`)) === null || _a === void 0 ? void 0 : _a.remove();
127
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
117
128
  }
118
129
  catch (e) {
119
130
  //