@devtron-labs/devtron-fe-common-lib 0.0.40-beta-12 → 0.0.40-beta-13

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.
@@ -2,8 +2,8 @@ import { ReactNode } from "react";
2
2
  export interface DeleteDialogProps {
3
3
  title: string;
4
4
  description?: string;
5
- closeDelete: () => void;
6
- delete: () => any;
5
+ closeDelete: (e?: React.MouseEvent) => void;
6
+ delete: (e?: React.MouseEvent) => any;
7
7
  deletePrefix?: string;
8
8
  deletePostfix?: string;
9
9
  apiCallInProgress?: boolean;
package/dist/index.js CHANGED
@@ -15098,15 +15098,7 @@ ConfirmationDialog.ButtonGroup = ButtonGroup;
15098
15098
  var warn = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2248%22%20viewBox%3D%220%200%2048%2048%22%3E%20%20%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M0%200h48v48H0z%22%2F%3E%20%20%20%20%20%20%20%20%3Cg%20fill%3D%22%23FFEBEB%22%20stroke%3D%22%23F33E3E%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M7%2024h24v17a4%204%200%200%201-4%204H11a4%204%200%200%201-4-4V24z%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20stroke-linecap%3D%22round%22%20d%3D%22M19%2029.5v10M24%2029.5v10M14%2029.5v10%22%2F%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%20%20%20%20%3Cpath%20stroke%3D%22%23F33E3E%22%20stroke-dasharray%3D%2217%2C3%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20d%3D%22M42%2010a3%203%200%200%201%200%206H31M38%2023a3%203%200%200%200-3-3h-8%22%2F%3E%20%20%20%20%20%20%20%20%3Cg%20stroke%3D%22%23F33E3E%22%20stroke-linejoin%3D%22round%22%20stroke-width%3D%222%22%20transform%3D%22rotate%28-10%2036.29%20-8.86%29%22%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Crect%20width%3D%2230%22%20height%3D%225%22%20y%3D%226%22%20fill%3D%22%23FFEBEB%22%20rx%3D%221%22%2F%3E%20%20%20%20%20%20%20%20%20%20%20%20%3Cpath%20d%3D%22M11%200h8a2%202%200%200%201%202%202v4H9V2a2%202%200%200%201%202-2z%22%2F%3E%20%20%20%20%20%20%20%20%3C%2Fg%3E%20%20%20%20%3C%2Fg%3E%3C%2Fsvg%3E";
15099
15099
 
15100
15100
  var DeleteDialog = function (props) {
15101
- var handleDelete = function (e) {
15102
- e.stopPropagation();
15103
- props.delete();
15104
- };
15105
- var handleModalClose = function (e) {
15106
- e.stopPropagation();
15107
- props.closeDelete();
15108
- };
15109
- return (jsxRuntime.jsxs(ConfirmationDialog, __assign({ className: "confirmation-dialog__body--w-400" }, { children: [jsxRuntime.jsx(ConfirmationDialog.Icon, { src: warn }), jsxRuntime.jsx(ConfirmationDialog.Body, __assign({ title: props.title }, { children: jsxRuntime.jsxs("div", __assign({ className: "fs-13 cn-7 lh-1-54 w-100" }, { children: [props.description ? props.description : null, props.children] })) })), jsxRuntime.jsx(ConfirmationDialog.ButtonGroup, { children: jsxRuntime.jsxs("div", __assign({ className: "flex right" }, { children: [jsxRuntime.jsx("button", __assign({ type: "button", className: "cta cancel cta-cd-delete-modal ml-16", onClick: handleModalClose, disabled: props.apiCallInProgress, "data-testid": "dialog-cancel" }, { children: "Cancel" })), jsxRuntime.jsx("button", __assign({ type: "button", className: "cta delete cta-cd-delete-modal ml-16", onClick: handleDelete, disabled: props.apiCallInProgress, "data-testid": "dialog-delete" }, { children: props.apiCallInProgress ? (jsxRuntime.jsx(Progressing, {})) : ("".concat(props.deletePrefix || '').concat(props.buttonPrimaryText ? props.buttonPrimaryText : 'Delete').concat(props.deletePostfix || '')) }))] })) })] })));
15101
+ return (jsxRuntime.jsxs(ConfirmationDialog, __assign({ className: "confirmation-dialog__body--w-400" }, { children: [jsxRuntime.jsx(ConfirmationDialog.Icon, { src: warn }), jsxRuntime.jsx(ConfirmationDialog.Body, __assign({ title: props.title }, { children: jsxRuntime.jsxs("div", __assign({ className: "fs-13 cn-7 lh-1-54 w-100" }, { children: [props.description ? props.description : null, props.children] })) })), jsxRuntime.jsx(ConfirmationDialog.ButtonGroup, { children: jsxRuntime.jsxs("div", __assign({ className: "flex right" }, { children: [jsxRuntime.jsx("button", __assign({ type: "button", className: "cta cancel cta-cd-delete-modal ml-16", onClick: props.closeDelete, disabled: props.apiCallInProgress, "data-testid": "dialog-cancel" }, { children: "Cancel" })), jsxRuntime.jsx("button", __assign({ type: "button", className: "cta delete cta-cd-delete-modal ml-16", onClick: props.delete, disabled: props.apiCallInProgress, "data-testid": "dialog-delete" }, { children: props.apiCallInProgress ? (jsxRuntime.jsx(Progressing, {})) : ("".concat(props.deletePrefix || '').concat(props.buttonPrimaryText ? props.buttonPrimaryText : 'Delete').concat(props.deletePostfix || '')) }))] })) })] })));
15110
15102
  };
15111
15103
  function DeleteDialogDescription(props) {
15112
15104
  return jsxRuntime.jsx(jsxRuntime.Fragment, { children: props.children });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.40-beta-12",
3
+ "version": "0.0.40-beta-13",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -5,16 +5,6 @@ import ConfirmationDialog from './ConfirmationDialog'
5
5
  import { DeleteDialogProps } from './Types'
6
6
 
7
7
  export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = function (props) {
8
- const handleDelete = (e: React.MouseEvent) => {
9
- e.stopPropagation()
10
- props.delete()
11
- }
12
-
13
- const handleModalClose = (e: React.MouseEvent) => {
14
- e.stopPropagation()
15
- props.closeDelete()
16
- }
17
-
18
8
  return (
19
9
  <ConfirmationDialog className="confirmation-dialog__body--w-400">
20
10
  <ConfirmationDialog.Icon src={warn} />
@@ -29,7 +19,7 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
29
19
  <button
30
20
  type="button"
31
21
  className="cta cancel cta-cd-delete-modal ml-16"
32
- onClick={handleModalClose}
22
+ onClick={props.closeDelete}
33
23
  disabled={props.apiCallInProgress}
34
24
  data-testid="dialog-cancel"
35
25
  >
@@ -38,7 +28,7 @@ export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.F
38
28
  <button
39
29
  type="button"
40
30
  className="cta delete cta-cd-delete-modal ml-16"
41
- onClick={handleDelete}
31
+ onClick={props.delete}
42
32
  disabled={props.apiCallInProgress}
43
33
  data-testid="dialog-delete"
44
34
  >
@@ -3,8 +3,8 @@ import { ReactNode } from "react"
3
3
  export interface DeleteDialogProps {
4
4
  title: string
5
5
  description?: string
6
- closeDelete: () => void
7
- delete: () => any
6
+ closeDelete: (e?: React.MouseEvent) => void
7
+ delete: (e?: React.MouseEvent) => any
8
8
  deletePrefix?: string
9
9
  deletePostfix?: string
10
10
  apiCallInProgress?: boolean