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
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.interpolatePercentInRange = exports.rangePercentage = exports.toFixedDown = exports.isNumber = exports.sumArray = exports.clamp = exports.roundToHalf = exports.toFixed = void 0;
3
+ exports.interpolatePercentInRange = exports.isNumber = exports.toFixed = void 0;
4
+ exports.roundToHalf = roundToHalf;
5
+ exports.clamp = clamp;
6
+ exports.sumArray = sumArray;
7
+ exports.toFixedDown = toFixedDown;
8
+ exports.rangePercentage = rangePercentage;
4
9
  const toFixed = (num, fixed) => {
5
10
  var _a;
6
11
  const re = new RegExp(`^-?\\d+(?:.\\d{0,${fixed || -1}})?`);
@@ -22,7 +27,6 @@ function roundToHalf(converted) {
22
27
  }
23
28
  return parseInt(converted.toString(), 10) + 0.5;
24
29
  }
25
- exports.roundToHalf = roundToHalf;
26
30
  /** restricts value between two numbers */
27
31
  function clamp({ value, min, max, }) {
28
32
  if (value < min) {
@@ -33,16 +37,13 @@ function clamp({ value, min, max, }) {
33
37
  }
34
38
  return value;
35
39
  }
36
- exports.clamp = clamp;
37
40
  function sumArray(array) {
38
41
  return array.reduce((a, b) => a + b, 0);
39
42
  }
40
- exports.sumArray = sumArray;
41
43
  const isNumber = (num) => !isNaN(Number(num));
42
44
  exports.isNumber = isNumber;
43
45
  function toFixedDown(num, scale) {
44
46
  if (!`${num}`.includes('e')) {
45
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
46
47
  // @ts-ignore
47
48
  return +`${Math.round(`${num}e+${scale}`)}e-${scale}`;
48
49
  }
@@ -51,11 +52,9 @@ function toFixedDown(num, scale) {
51
52
  if (+arr[1] + scale > 0) {
52
53
  sig = '+';
53
54
  }
54
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
55
55
  // @ts-ignore
56
56
  return +`${Math.round(`${+arr[0]}e${sig}${+arr[1] + scale}`)}e-${scale}`;
57
57
  }
58
- exports.toFixedDown = toFixedDown;
59
58
  /**
60
59
  * get percentage of value within supplied range
61
60
  * eg value of 5 between 0-10 = 0.5. value of 5 between 5-10 = 0
@@ -70,7 +69,6 @@ function rangePercentage({ value, min, max, }) {
70
69
  }
71
70
  return r;
72
71
  }
73
- exports.rangePercentage = rangePercentage;
74
72
  /** will interpolate value of percent inside range. 0.5 between 100 and 200 = 150 */
75
73
  const interpolatePercentInRange = ({ percent, min, max, }) => (max - min) * percent + min;
76
74
  exports.interpolatePercentInRange = interpolatePercentInRange;
@@ -1,10 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.memo = void 0;
3
+ exports.memo = memo;
4
4
  const hashCode_1 = require("./hashCode");
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
5
  const memoData = {};
7
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
6
  function memo(func, ...args) {
9
7
  const hc = (0, hashCode_1.hashCode)(JSON.stringify(args));
10
8
  if (!memoData[hc]) {
@@ -12,4 +10,3 @@ function memo(func, ...args) {
12
10
  }
13
11
  return memoData[hc];
14
12
  }
15
- exports.memo = memo;
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.copy = exports.isObject = exports.castStringlyObject = exports.removeUndefValuesFromObjectAdditional = exports.removeUndefValuesFromObject = exports.filterObject = exports.castObject = exports.objectToString = exports.paramsToObject = exports.objectAlphaSort = exports.objectToArray = exports.getObjectKeysAsNumber = exports.objectKeysToLowerCase = exports.isJson = exports.tryJsonParse = void 0;
3
+ exports.copy = exports.isObject = exports.castStringlyObject = exports.removeUndefValuesFromObjectAdditional = exports.removeUndefValuesFromObject = exports.filterObject = exports.castObject = exports.objectAlphaSort = exports.getObjectKeysAsNumber = exports.objectKeysToLowerCase = exports.tryJsonParse = void 0;
4
+ exports.isJson = isJson;
5
+ exports.objectToArray = objectToArray;
6
+ exports.paramsToObject = paramsToObject;
7
+ exports.objectToString = objectToString;
4
8
  const tryJsonParse = (str, defaultValue) => {
5
9
  if (!str) {
6
10
  return null;
7
11
  }
8
12
  try {
9
13
  return JSON.parse(str);
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
15
  }
11
16
  catch (e) {
12
17
  return defaultValue;
@@ -16,13 +21,13 @@ exports.tryJsonParse = tryJsonParse;
16
21
  function isJson(str) {
17
22
  try {
18
23
  JSON.parse(typeof str === 'string' ? str : JSON.stringify(str));
24
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
19
25
  }
20
26
  catch (e) {
21
27
  return false;
22
28
  }
23
29
  return true;
24
30
  }
25
- exports.isJson = isJson;
26
31
  const objectKeysToLowerCase = (origObj) => {
27
32
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
28
33
  if (!origObj || Object.keys(origObj).length === 0) {
@@ -30,11 +35,9 @@ const objectKeysToLowerCase = (origObj) => {
30
35
  }
31
36
  return Object.keys(origObj).reduce((newObj, key) => {
32
37
  const val = origObj[key];
33
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
38
  const newVal = typeof val === 'object'
35
39
  ? (0, exports.objectKeysToLowerCase)(val)
36
40
  : val;
37
- // eslint-disable-next-line no-param-reassign
38
41
  newObj[key.toLowerCase()] = newVal;
39
42
  return newObj;
40
43
  }, {});
@@ -53,27 +56,24 @@ function objectToArray(obj) {
53
56
  });
54
57
  return ret;
55
58
  }
56
- exports.objectToArray = objectToArray;
57
59
  /**
58
60
  * Recursively alphabetically sort an object
59
61
  * @param object
60
62
  * @param depthLeft
61
63
  * @returns
62
64
  */
63
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
64
65
  const objectAlphaSort = (object, depthLeft = -1) => {
65
66
  if (depthLeft === 0) {
66
67
  return object;
67
68
  }
68
69
  if (object !== null && typeof object === 'object') {
69
- return (Object.keys(object)
70
+ return Object.keys(object)
70
71
  .sort((a, b) => (a.toLowerCase() < b.toLowerCase() ? -1 : 1))
71
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
72
72
  .reduce((result, key) => {
73
73
  //@ts-ignore
74
74
  result[key] = (0, exports.objectAlphaSort)(object[key], depthLeft - 1);
75
75
  return result;
76
- }, {}));
76
+ }, {});
77
77
  }
78
78
  else if (Array.isArray(object)) {
79
79
  //@ts-ignore
@@ -89,7 +89,6 @@ exports.objectAlphaSort = objectAlphaSort;
89
89
  * @param entries Could be URLSearchParams
90
90
  * @returns
91
91
  */
92
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
93
92
  function paramsToObject(entries) {
94
93
  const result = {};
95
94
  for (const [key, value] of entries) {
@@ -97,7 +96,6 @@ function paramsToObject(entries) {
97
96
  }
98
97
  return result;
99
98
  }
100
- exports.paramsToObject = paramsToObject;
101
99
  /**
102
100
  * stringify an object of key values. Could be used to stringify a querystring url
103
101
  * @param obj
@@ -118,7 +116,6 @@ joinKeys) {
118
116
  const ret = raw.join(joinKeys);
119
117
  return ret;
120
118
  }
121
- exports.objectToString = objectToString;
122
119
  /**
123
120
  * run func over values in object. can be used to cast value type string[]|string to string
124
121
  * @param orig
@@ -155,7 +152,6 @@ const removeUndefValuesFromObject = (orig) => {
155
152
  const ret = {};
156
153
  Object.entries(orig).forEach(([k, v]) => {
157
154
  if (v !== null && v !== undefined) {
158
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
159
155
  ret[k] = v;
160
156
  }
161
157
  });
@@ -190,7 +186,6 @@ const castStringlyObject = (orig) => {
190
186
  });
191
187
  };
192
188
  exports.castStringlyObject = castStringlyObject;
193
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
194
189
  const isObject = (o) => o && typeof o === 'object' && !Array.isArray(o);
195
190
  exports.isObject = isObject;
196
191
  const copy = (v) => JSON.parse(JSON.stringify(v));
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shuffle = exports.randomDecimal = exports.random = void 0;
3
+ exports.randomDecimal = void 0;
4
+ exports.random = random;
5
+ exports.shuffle = shuffle;
4
6
  /** random number up to max. seed defaults to now.getTime() */
5
7
  function random(max, seed) {
6
8
  seed = seed !== null && seed !== void 0 ? seed : new Date().getTime();
@@ -8,7 +10,6 @@ function random(max, seed) {
8
10
  const rnd = ret / 233280;
9
11
  return Math.ceil(rnd * max);
10
12
  }
11
- exports.random = random;
12
13
  /** between 0 and 1. seed defaults to now.getTime() */
13
14
  const randomDecimal = function (seed) {
14
15
  seed = seed !== null && seed !== void 0 ? seed : new Date().getTime();
@@ -33,4 +34,3 @@ function shuffle(array, seed) {
33
34
  }
34
35
  return array;
35
36
  }
36
- exports.shuffle = shuffle;
@@ -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.getStringFromStream = void 0;
12
+ exports.getStringFromStream = getStringFromStream;
13
13
  const log_1 = require("./log");
14
14
  function getStringFromStream(stream) {
15
15
  return __awaiter(this, void 0, void 0, function* () {
@@ -17,7 +17,7 @@ function getStringFromStream(stream) {
17
17
  const reader = stream.getReader();
18
18
  let result = '';
19
19
  try {
20
- // eslint-disable-next-line no-constant-condition, @typescript-eslint/no-unnecessary-condition
20
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
21
21
  while (true) {
22
22
  const { done, value } = yield reader.read();
23
23
  if (done)
@@ -27,6 +27,7 @@ function getStringFromStream(stream) {
27
27
  // Append the chunk to the final result
28
28
  result += chunkString;
29
29
  }
30
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
30
31
  }
31
32
  catch (e) {
32
33
  (0, log_1.error)('error converting stream');
@@ -37,4 +38,3 @@ function getStringFromStream(stream) {
37
38
  return result;
38
39
  });
39
40
  }
40
- exports.getStringFromStream = getStringFromStream;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.containsInsensitiveIndexes = exports.containsInsensitive = exports.containsInsensitiveIndex = void 0;
3
+ exports.containsInsensitive = void 0;
4
+ exports.containsInsensitiveIndex = containsInsensitiveIndex;
5
+ exports.containsInsensitiveIndexes = containsInsensitiveIndexes;
4
6
  /**
5
7
  * returns >-1 if found
6
8
  * @param str
@@ -22,7 +24,6 @@ function containsInsensitiveIndex({ str, fromLast = false, }, ...args) {
22
24
  }
23
25
  return !fromLast ? finds[0] : finds[finds.length - 1];
24
26
  }
25
- exports.containsInsensitiveIndex = containsInsensitiveIndex;
26
27
  /**
27
28
  * returns true if text is found
28
29
  * @param str
@@ -59,4 +60,3 @@ function containsInsensitiveIndexes({ haystack, needle, fromLast = false, maxFou
59
60
  }
60
61
  return indexes;
61
62
  }
62
- exports.containsInsensitiveIndexes = containsInsensitiveIndexes;
@@ -8,7 +8,6 @@ exports.safeStringify = void 0;
8
8
  * @returns
9
9
  */
10
10
  const safeStringify = (obj, indent = 2) => {
11
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
11
  let cache = [];
13
12
  const retVal = JSON.stringify(obj, (_key, value) => typeof value === 'object' && value !== null
14
13
  ? cache.includes(value)
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringToObject = void 0;
3
+ exports.stringToObject = stringToObject;
4
4
  /**
5
5
  * object to string - can be used for querystring a=b&c=d etc
6
6
  * @param raw eg a=b&c=d
@@ -17,4 +17,3 @@ function stringToObject(raw, splitKeyValue, splitKeys) {
17
17
  });
18
18
  return ret;
19
19
  }
20
- exports.stringToObject = stringToObject;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.redactObject = exports.redactString = void 0;
3
+ exports.redactString = redactString;
4
+ exports.redactObject = redactObject;
4
5
  function redactString(str) {
5
6
  let ret = str;
6
7
  ret = ret || '';
@@ -11,7 +12,6 @@ function redactString(str) {
11
12
  ret = ret.replace(/(eyJ[\w-_.]*\.[\w-_.]*\.[\w-_.]*)/gim, '<redacted>');
12
13
  return ret;
13
14
  }
14
- exports.redactString = redactString;
15
15
  function redactObject(ob) {
16
16
  if (typeof ob === 'string') {
17
17
  return redactString(ob);
@@ -19,6 +19,7 @@ function redactObject(ob) {
19
19
  else if (typeof ob === 'object') {
20
20
  try {
21
21
  return JSON.parse(redactString(JSON.stringify(ob)));
22
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
22
23
  }
23
24
  catch (e) {
24
25
  return ob;
@@ -26,4 +27,3 @@ function redactObject(ob) {
26
27
  }
27
28
  return ob;
28
29
  }
29
- exports.redactObject = redactObject;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.trim = exports.trimSide = void 0;
3
+ exports.trimSide = trimSide;
4
+ exports.trim = trim;
4
5
  function trimSide(str, fromStart = true, ...params) {
5
6
  const pstr = params.join('');
6
7
  if (!str) {
@@ -12,7 +13,6 @@ function trimSide(str, fromStart = true, ...params) {
12
13
  }
13
14
  return ret;
14
15
  }
15
- exports.trimSide = trimSide;
16
16
  function trim(str, ...params) {
17
17
  if (!str) {
18
18
  return '';
@@ -21,4 +21,3 @@ function trim(str, ...params) {
21
21
  str = trimSide(str, false, ...params);
22
22
  return str;
23
23
  }
24
- exports.trim = trim;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.truncate = void 0;
3
+ exports.truncate = truncate;
4
4
  /** truncate text */
5
5
  function truncate(
6
6
  /** string to truncate */
@@ -14,4 +14,3 @@ ellip = '...') {
14
14
  }
15
15
  return str.length > n ? str.substr(0, n - 1) + ellip : str;
16
16
  }
17
- exports.truncate = truncate;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripUrl = exports.isValidUrl = exports.niceUrl = void 0;
3
+ exports.stripUrl = exports.niceUrl = void 0;
4
+ exports.isValidUrl = isValidUrl;
4
5
  const trim_1 = require("./trim");
5
6
  /**
6
7
  * removes protocol, and trailing slashes
@@ -22,12 +23,12 @@ function isValidUrl(raw) {
22
23
  try {
23
24
  const url = new URL(raw);
24
25
  return url.protocol === 'http:' || url.protocol === 'https:';
26
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
25
27
  }
26
28
  catch (_) {
27
29
  return false;
28
30
  }
29
31
  }
30
- exports.isValidUrl = isValidUrl;
31
32
  const stripUrl = (nu) => ({
32
33
  hash: nu.hash,
33
34
  host: nu.host,
@@ -1,5 +1,4 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -12,7 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.fetchFile = void 0;
15
+ exports.fetchFile = fetchFile;
16
16
  const fs_1 = __importDefault(require("fs"));
17
17
  /**
18
18
  * download(fetch) file
@@ -38,10 +38,10 @@ function fetchFile(p) {
38
38
  yield write();
39
39
  try {
40
40
  fileStream.close();
41
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
41
42
  }
42
43
  catch (e) {
43
44
  //
44
45
  }
45
46
  });
46
47
  }
47
- exports.fetchFile = fetchFile;
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getFileNameAndExtension = exports.getAllFiles = void 0;
6
+ exports.getAllFiles = getAllFiles;
7
+ exports.getFileNameAndExtension = getFileNameAndExtension;
7
8
  const fs_1 = __importDefault(require("fs"));
8
9
  const path_1 = __importDefault(require("path"));
9
10
  /**
@@ -33,7 +34,6 @@ function getAllFiles(dirPath, extension) {
33
34
  getFilesRecursively(dirPath);
34
35
  return files;
35
36
  }
36
- exports.getAllFiles = getAllFiles;
37
37
  /**
38
38
  * Extracts the file name and extension from a given file path.
39
39
  *
@@ -50,4 +50,3 @@ function getFileNameAndExtension(filePath) {
50
50
  directory,
51
51
  };
52
52
  }
53
- exports.getFileNameAndExtension = getFileNameAndExtension;
@@ -16,13 +16,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
26
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
27
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
38
  };
@@ -1,2 +1,2 @@
1
1
  export * from './Base';
2
- export * from './types';
2
+ export type * from './types';
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Base"), exports);
18
- __exportStar(require("./types"), exports);
@@ -1,5 +1,4 @@
1
- import type { KeyboardEventHandler, MouseEventHandler } from 'react';
2
- import React from 'react';
1
+ import type { JSX, KeyboardEventHandler, MouseEventHandler } from 'react';
3
2
  export declare const ButtonBase: import("@emotion/react").SerializedStyles;
4
3
  export interface IButton {
5
4
  title?: string;
@@ -12,4 +11,4 @@ export interface IButton {
12
11
  href?: string;
13
12
  colourTheme?: 'green' | 'red';
14
13
  }
15
- export declare const Button: (props: IButton) => React.JSX.Element;
14
+ export declare const Button: (props: IButton) => JSX.Element;
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.Button = exports.ButtonBase = void 0;
8
- /* eslint-disable react/destructuring-assignment */
9
8
  const react_1 = require("@emotion/react");
10
9
  const styled_1 = __importDefault(require("@emotion/styled"));
11
10
  const react_2 = __importDefault(require("react"));
@@ -61,10 +60,8 @@ const BaseA = styled_1.default.a `
61
60
  `;
62
61
  const Button = (props) => {
63
62
  var _a, _b;
64
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
65
63
  const Component = props.href
66
- ? // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
- BaseA
64
+ ? BaseA
68
65
  : BaseButton;
69
66
  return (react_2.default.createElement(Component, Object.assign({ className: props.className, "data-invert": props.invert, "data-disabled": (_a = props.disabled) !== null && _a !== void 0 ? _a : false, role: "button", title: props.title || undefined, "data-theme": (_b = props.colourTheme) !== null && _b !== void 0 ? _b : 'green' }, props), props.children));
70
67
  };
@@ -41,6 +41,7 @@ const ConfirmDialog = (_a) => __awaiter(void 0, [_a], void 0, function* ({ botto
41
41
  try {
42
42
  root.unmount();
43
43
  wrapper.remove();
44
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
44
45
  }
45
46
  catch (e) {
46
47
  //
@@ -1,3 +1,3 @@
1
1
  export * from './Dialog';
2
2
  export * from './Modal';
3
- export * from './types';
3
+ export type * from './types';
@@ -16,4 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./Dialog"), exports);
18
18
  __exportStar(require("./Modal"), exports);
19
- __exportStar(require("./types"), exports);
@@ -1,5 +1,4 @@
1
- import type { CSSProperties, Dispatch, SetStateAction } from 'react';
2
- import React from 'react';
1
+ import type { CSSProperties, Dispatch, JSX, SetStateAction } from 'react';
3
2
  import { TDarkMode, TDarkModeCalc } from './types';
4
3
  export interface IDarkMode {
5
4
  onSubmit?: (p: TDarkMode) => void;
@@ -25,6 +24,6 @@ export declare const UseDarkMode: ({ cookieDocument, }: {
25
24
  */
26
25
  export declare const DarkModeAux: ({ iconSize, className, mode, onSubmit, style, dm, }: IDarkMode & {
27
26
  dm: IUseDarkMode;
28
- }) => React.JSX.Element;
27
+ }) => JSX.Element;
29
28
  /** shows darkmode toggle. Persists to cookie, and modifies html classList with either dark-mode or light-mode */
30
- export declare const DarkMode: (p: IDarkMode) => React.JSX.Element;
29
+ export declare const DarkMode: (p: IDarkMode) => JSX.Element;
@@ -16,13 +16,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
26
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
27
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
38
  };
@@ -131,6 +141,7 @@ const DarkModeAux = ({ iconSize = '2.5rem', className, mode, onSubmit, style, dm
131
141
  if (className) {
132
142
  document.getElementsByTagName('html')[0].classList.add(className);
133
143
  }
144
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
134
145
  }
135
146
  catch (e) {
136
147
  //
@@ -1,3 +1,3 @@
1
- import React from 'react';
1
+ import type { JSX } from 'react';
2
2
  import type { IDropdownList } from './types';
3
- export declare function DropdownList<T>(p: IDropdownList<T>): React.JSX.Element;
3
+ export declare function DropdownList<T>(p: IDropdownList<T>): JSX.Element;
@@ -16,18 +16,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
16
16
  }) : function(o, v) {
17
17
  o["default"] = v;
18
18
  });
19
- var __importStar = (this && this.__importStar) || function (mod) {
20
- if (mod && mod.__esModule) return mod;
21
- var result = {};
22
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
- __setModuleDefault(result, mod);
24
- return result;
25
- };
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
26
36
  var __importDefault = (this && this.__importDefault) || function (mod) {
27
37
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
38
  };
29
39
  Object.defineProperty(exports, "__esModule", { value: true });
30
- exports.DropdownList = void 0;
40
+ exports.DropdownList = DropdownList;
31
41
  const styled_1 = __importDefault(require("@emotion/styled"));
32
42
  const react_1 = __importStar(require("react"));
33
43
  const dom_1 = require("../../helpers/dom");
@@ -103,7 +113,7 @@ function DropdownList(p) {
103
113
  const [state, setState] = (0, react_1.useState)(p.value);
104
114
  const [open, setOpen] = (0, react_1.useState)(p.open);
105
115
  const [bounced, setBounced] = (0, react_1.useState)(false);
106
- (0, useOnClickOutside_1.useOnClickOutside)({ disabled: !open, ref, moveMouseOutside: false }, () => {
116
+ (0, useOnClickOutside_1.useOnClickOutside)({ disabled: !open, ref: ref, moveMouseOutside: false }, () => {
107
117
  var _a;
108
118
  setOpen(false);
109
119
  setBounced(false);
@@ -166,4 +176,3 @@ function DropdownList(p) {
166
176
  p.options.map((s, i) => (react_1.default.createElement(ListItem, { key: typeof s === 'string' ? s : p.renderF(s, i).key, render: p.renderF(s, i), onChange: () => p.onChange(s, i), selected: s === state })))),
167
177
  openDisplay));
168
178
  }
169
- exports.DropdownList = DropdownList;
@@ -4,4 +4,4 @@ export declare const DropdownListDialog: <T>(p: {
4
4
  x: number;
5
5
  y: number;
6
6
  };
7
- } & Omit<IDropdownList<T>, 'onChange'>) => Promise<undefined | [v: T, index: number]>;
7
+ } & Omit<IDropdownList<T>, "onChange">) => Promise<undefined | [v: T, index: number]>;