@devtron-labs/devtron-fe-common-lib 0.0.25 → 0.0.26

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.
@@ -42,4 +42,5 @@ export declare function CustomInput({ name, value, error, onChange, onBlur, onFo
42
42
  }): JSX.Element;
43
43
  export declare function handleUTCTime(ts: string, isRelativeTime?: boolean): string;
44
44
  export declare function useSearchString(): UseSearchString;
45
+ export declare const closeOnEscKeyPressed: (e: any, actionClose: () => void) => void;
45
46
  export {};
package/dist/index.js CHANGED
@@ -10099,7 +10099,12 @@ function useSearchString() {
10099
10099
  return agg;
10100
10100
  }, {});
10101
10101
  return { queryParams: queryParams, searchParams: searchParams };
10102
- }
10102
+ }
10103
+ var closeOnEscKeyPressed = function (e, actionClose) {
10104
+ if (e.keyCode === 27 || e.key === 'Escape') {
10105
+ actionClose();
10106
+ }
10107
+ };
10103
10108
 
10104
10109
  function Progressing(_a) {
10105
10110
  var pageLoader = _a.pageLoader, size = _a.size, theme = _a.theme, styles = _a.styles, fillColor = _a.fillColor;
@@ -23416,6 +23421,7 @@ exports.TriggerTypeMap = TriggerTypeMap;
23416
23421
  exports.URLS = URLS;
23417
23422
  exports.VisibleModal = VisibleModal;
23418
23423
  exports.VisibleModal2 = VisibleModal2;
23424
+ exports.closeOnEscKeyPressed = closeOnEscKeyPressed;
23419
23425
  exports.createGitCommitUrl = createGitCommitUrl;
23420
23426
  exports.extractImage = extractImage;
23421
23427
  exports.get = get;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -369,3 +369,8 @@ export function useSearchString(): UseSearchString {
369
369
  }
370
370
 
371
371
 
372
+ export const closeOnEscKeyPressed = (e: any, actionClose: () => void) => {
373
+ if (e.keyCode === 27 || e.key === 'Escape') {
374
+ actionClose()
375
+ }
376
+ }