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

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.
@@ -9,6 +9,7 @@ export interface DeleteDialogProps {
9
9
  apiCallInProgress?: boolean;
10
10
  dataTestId?: string;
11
11
  buttonPrimaryText?: string;
12
+ shouldStopPropagation?: boolean;
12
13
  }
13
14
  export interface ForceDeleteDialogType {
14
15
  onClickDelete: () => void;
package/dist/index.js CHANGED
@@ -15099,11 +15099,15 @@ var warn = "data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22U
15099
15099
 
15100
15100
  var DeleteDialog = function (props) {
15101
15101
  var handleDelete = function (e) {
15102
- e.stopPropagation();
15102
+ if (props.shouldStopPropagation) {
15103
+ e.stopPropagation();
15104
+ }
15103
15105
  props.delete();
15104
15106
  };
15105
15107
  var handleModalClose = function (e) {
15106
- e.stopPropagation();
15108
+ if (props.shouldStopPropagation) {
15109
+ e.stopPropagation();
15110
+ }
15107
15111
  props.closeDelete();
15108
15112
  };
15109
15113
  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 || '')) }))] })) })] })));
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-15",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -6,12 +6,18 @@ import { DeleteDialogProps } from './Types'
6
6
 
7
7
  export const DeleteDialog: React.FC<DeleteDialogProps> & { Description?: React.FC<any> } = function (props) {
8
8
  const handleDelete = (e: React.MouseEvent) => {
9
- e.stopPropagation()
9
+ if (props.shouldStopPropagation) {
10
+ e.stopPropagation()
11
+ }
12
+
10
13
  props.delete()
11
14
  }
12
15
 
13
16
  const handleModalClose = (e: React.MouseEvent) => {
14
- e.stopPropagation()
17
+ if (props.shouldStopPropagation) {
18
+ e.stopPropagation()
19
+ }
20
+
15
21
  props.closeDelete()
16
22
  }
17
23
 
@@ -10,6 +10,7 @@ export interface DeleteDialogProps {
10
10
  apiCallInProgress?: boolean
11
11
  dataTestId?: string
12
12
  buttonPrimaryText?: string
13
+ shouldStopPropagation?: boolean
13
14
  }
14
15
 
15
16
  export interface ForceDeleteDialogType {