@devtron-labs/devtron-fe-common-lib 0.0.22 → 0.0.23

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
@@ -10094,7 +10094,12 @@ function useSearchString() {
10094
10094
  return agg;
10095
10095
  }, {});
10096
10096
  return { queryParams: queryParams, searchParams: searchParams };
10097
- }
10097
+ }
10098
+ var closeOnEscKeyPressed = function (e, actionClose) {
10099
+ if (e.keyCode === 27 || e.key === 'Escape') {
10100
+ actionClose();
10101
+ }
10102
+ };
10098
10103
 
10099
10104
  function Progressing(_a) {
10100
10105
  var pageLoader = _a.pageLoader, size = _a.size, theme = _a.theme, styles = _a.styles, fillColor = _a.fillColor;
@@ -23410,6 +23415,7 @@ exports.TriggerTypeMap = TriggerTypeMap;
23410
23415
  exports.URLS = URLS;
23411
23416
  exports.VisibleModal = VisibleModal;
23412
23417
  exports.VisibleModal2 = VisibleModal2;
23418
+ exports.closeOnEscKeyPressed = closeOnEscKeyPressed;
23413
23419
  exports.createGitCommitUrl = createGitCommitUrl;
23414
23420
  exports.extractImage = extractImage;
23415
23421
  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.22",
3
+ "version": "0.0.23",
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
+ }