@activecollab/components 1.0.207 → 1.0.208

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.
@@ -28,12 +28,15 @@ var ConfirmDialog = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
28
28
  _ref$cancelBtnText = _ref.cancelBtnText,
29
29
  cancelBtnText = _ref$cancelBtnText === void 0 ? "Cancel" : _ref$cancelBtnText,
30
30
  _ref$shouldShowCancel = _ref.shouldShowCancelButton,
31
- shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel;
31
+ shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel,
32
+ _ref$isLoading = _ref.isLoading,
33
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
32
34
  return /*#__PURE__*/_react.default.createElement(_Dialog.Dialog, {
33
35
  ref: ref,
34
36
  open: open,
35
37
  onClose: onCancel,
36
- className: (0, _classnames.default)("c-confirm-dialog", className)
38
+ className: (0, _classnames.default)("c-confirm-dialog", className),
39
+ disableCloseOnEsc: isLoading
37
40
  }, /*#__PURE__*/_react.default.createElement(_Dialog.DialogTitle, null, dialogTitle), /*#__PURE__*/_react.default.createElement(_Dialog.DialogContentDivider, null), /*#__PURE__*/_react.default.createElement(_Dialog.DialogContent, null, /*#__PURE__*/_react.default.createElement(_Body.Body2, {
38
41
  lineHeight: "loose",
39
42
  color: "secondary",
@@ -43,12 +46,14 @@ var ConfirmDialog = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
43
46
  style: {
44
47
  marginRight: "12px"
45
48
  },
46
- onClick: onConfirm
49
+ onClick: onConfirm,
50
+ disabled: isLoading
47
51
  }, confirmBtnText), shouldShowCancelButton ? /*#__PURE__*/_react.default.createElement(_Button.Button, {
48
52
  variant: "secondary",
49
53
  "data-action": "cancel",
50
54
  onClick: onCancel,
51
- type: "button"
55
+ type: "button",
56
+ disabled: isLoading
52
57
  }, cancelBtnText) : null));
53
58
  });
54
59
  exports.ConfirmDialog = ConfirmDialog;
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmDialog.js","names":["ConfirmDialog","forwardRef","ref","open","onCancel","onConfirm","className","dialogTitle","dialogContent","confirmBtnText","cancelBtnText","shouldShowCancelButton","classnames","marginRight","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport classnames from \"classnames\";\nimport {\n Dialog,\n DialogTitle,\n DialogContent,\n DialogActions,\n DialogContentDivider,\n} from \"../Dialog\";\nimport { Button } from \"../Button/Button\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nexport interface IConfirmDialog {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: string;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDivElement, IConfirmDialog>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard changes?\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n },\n ref\n ) => {\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n >\n <DialogTitle>{dialogTitle}</DialogTitle>\n <DialogContentDivider />\n <DialogContent>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n </DialogContent>\n <DialogContentDivider />\n <DialogActions>\n <Button\n variant=\"primary\"\n style={{ marginRight: \"12px\" }}\n onClick={onConfirm}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </DialogActions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAOA;AACA;AAAqD;AAAA;AAAA;AAc9C,IAAMA,aAAa,gBAAG,IAAAC,iBAAU,EACrC,gBAYEC,GAAG,EACA;EAAA,qBAXDC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,QAAQ,QAARA,QAAQ;IACRC,SAAS,QAATA,SAAS;IACTC,SAAS,QAATA,SAAS;IAAA,wBACTC,WAAW;IAAXA,WAAW,iCAAG,kBAAkB;IAAA,0BAChCC,aAAa;IAAbA,aAAa,mCAAG,mCAAmC;IAAA,2BACnDC,cAAc;IAAdA,cAAc,oCAAG,IAAI;IAAA,0BACrBC,aAAa;IAAbA,aAAa,mCAAG,QAAQ;IAAA,6BACxBC,sBAAsB;IAAtBA,sBAAsB,sCAAG,IAAI;EAI/B,oBACE,6BAAC,cAAM;IACL,GAAG,EAAET,GAAI;IACT,IAAI,EAAEC,IAAK;IACX,OAAO,EAAEC,QAAS;IAClB,SAAS,EAAE,IAAAQ,mBAAU,EAAC,kBAAkB,EAAEN,SAAS;EAAE,gBAErD,6BAAC,mBAAW,QAAEC,WAAW,CAAe,eACxC,6BAAC,4BAAoB,OAAG,eACxB,6BAAC,qBAAa,qBACZ,6BAAC,WAAK;IAAC,UAAU,EAAC,OAAO;IAAC,KAAK,EAAC,WAAW;IAAC,UAAU,EAAC;EAAU,GAC9DC,aAAa,CACR,CACM,eAChB,6BAAC,4BAAoB,OAAG,eACxB,6BAAC,qBAAa,qBACZ,6BAAC,cAAM;IACL,OAAO,EAAC,SAAS;IACjB,KAAK,EAAE;MAAEK,WAAW,EAAE;IAAO,CAAE;IAC/B,OAAO,EAAER;EAAU,GAElBI,cAAc,CACR,EACRE,sBAAsB,gBACrB,6BAAC,cAAM;IACL,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpB,OAAO,EAAEP,QAAS;IAClB,IAAI,EAAC;EAAQ,GAEZM,aAAa,CACP,GACP,IAAI,CACM,CACT;AAEb,CAAC,CACF;AAAC;AAEFV,aAAa,CAACc,WAAW,GAAG,eAAe"}
1
+ {"version":3,"file":"ConfirmDialog.js","names":["ConfirmDialog","forwardRef","ref","open","onCancel","onConfirm","className","dialogTitle","dialogContent","confirmBtnText","cancelBtnText","shouldShowCancelButton","isLoading","classnames","marginRight","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport classnames from \"classnames\";\nimport {\n Dialog,\n DialogTitle,\n DialogContent,\n DialogActions,\n DialogContentDivider,\n} from \"../Dialog\";\nimport { Button } from \"../Button/Button\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nexport interface IConfirmDialog {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: string;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n isLoading?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDivElement, IConfirmDialog>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard changes?\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n isLoading = false,\n },\n ref\n ) => {\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n disableCloseOnEsc={isLoading}\n >\n <DialogTitle>{dialogTitle}</DialogTitle>\n <DialogContentDivider />\n <DialogContent>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n </DialogContent>\n <DialogContentDivider />\n <DialogActions>\n <Button\n variant=\"primary\"\n style={{ marginRight: \"12px\" }}\n onClick={onConfirm}\n disabled={isLoading}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n disabled={isLoading}\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </DialogActions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAOA;AACA;AAAqD;AAAA;AAAA;AAe9C,IAAMA,aAAa,gBAAG,IAAAC,iBAAU,EACrC,gBAaEC,GAAG,EACA;EAAA,qBAZDC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,QAAQ,QAARA,QAAQ;IACRC,SAAS,QAATA,SAAS;IACTC,SAAS,QAATA,SAAS;IAAA,wBACTC,WAAW;IAAXA,WAAW,iCAAG,kBAAkB;IAAA,0BAChCC,aAAa;IAAbA,aAAa,mCAAG,mCAAmC;IAAA,2BACnDC,cAAc;IAAdA,cAAc,oCAAG,IAAI;IAAA,0BACrBC,aAAa;IAAbA,aAAa,mCAAG,QAAQ;IAAA,6BACxBC,sBAAsB;IAAtBA,sBAAsB,sCAAG,IAAI;IAAA,sBAC7BC,SAAS;IAATA,SAAS,+BAAG,KAAK;EAInB,oBACE,6BAAC,cAAM;IACL,GAAG,EAAEV,GAAI;IACT,IAAI,EAAEC,IAAK;IACX,OAAO,EAAEC,QAAS;IAClB,SAAS,EAAE,IAAAS,mBAAU,EAAC,kBAAkB,EAAEP,SAAS,CAAE;IACrD,iBAAiB,EAAEM;EAAU,gBAE7B,6BAAC,mBAAW,QAAEL,WAAW,CAAe,eACxC,6BAAC,4BAAoB,OAAG,eACxB,6BAAC,qBAAa,qBACZ,6BAAC,WAAK;IAAC,UAAU,EAAC,OAAO;IAAC,KAAK,EAAC,WAAW;IAAC,UAAU,EAAC;EAAU,GAC9DC,aAAa,CACR,CACM,eAChB,6BAAC,4BAAoB,OAAG,eACxB,6BAAC,qBAAa,qBACZ,6BAAC,cAAM;IACL,OAAO,EAAC,SAAS;IACjB,KAAK,EAAE;MAAEM,WAAW,EAAE;IAAO,CAAE;IAC/B,OAAO,EAAET,SAAU;IACnB,QAAQ,EAAEO;EAAU,GAEnBH,cAAc,CACR,EACRE,sBAAsB,gBACrB,6BAAC,cAAM;IACL,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpB,OAAO,EAAEP,QAAS;IAClB,IAAI,EAAC,QAAQ;IACb,QAAQ,EAAEQ;EAAU,GAEnBF,aAAa,CACP,GACP,IAAI,CACM,CACT;AAEb,CAAC,CACF;AAAC;AAEFV,aAAa,CAACe,WAAW,GAAG,eAAe"}
@@ -9,6 +9,7 @@ export interface IConfirmDialog {
9
9
  confirmBtnText?: string;
10
10
  cancelBtnText?: string;
11
11
  shouldShowCancelButton?: boolean;
12
+ isLoading?: boolean;
12
13
  }
13
14
  export declare const ConfirmDialog: React.ForwardRefExoticComponent<IConfirmDialog & React.RefAttributes<HTMLDivElement>>;
14
15
  //# sourceMappingURL=ConfirmDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAY1C,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,eAAO,MAAM,aAAa,uFAoDzB,CAAC"}
1
+ {"version":3,"file":"ConfirmDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAY1C,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,uFAwDzB,CAAC"}
@@ -18,12 +18,15 @@ export var ConfirmDialog = /*#__PURE__*/forwardRef(function (_ref, ref) {
18
18
  _ref$cancelBtnText = _ref.cancelBtnText,
19
19
  cancelBtnText = _ref$cancelBtnText === void 0 ? "Cancel" : _ref$cancelBtnText,
20
20
  _ref$shouldShowCancel = _ref.shouldShowCancelButton,
21
- shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel;
21
+ shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel,
22
+ _ref$isLoading = _ref.isLoading,
23
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
22
24
  return /*#__PURE__*/React.createElement(Dialog, {
23
25
  ref: ref,
24
26
  open: open,
25
27
  onClose: onCancel,
26
- className: classnames("c-confirm-dialog", className)
28
+ className: classnames("c-confirm-dialog", className),
29
+ disableCloseOnEsc: isLoading
27
30
  }, /*#__PURE__*/React.createElement(DialogTitle, null, dialogTitle), /*#__PURE__*/React.createElement(DialogContentDivider, null), /*#__PURE__*/React.createElement(DialogContent, null, /*#__PURE__*/React.createElement(Body2, {
28
31
  lineHeight: "loose",
29
32
  color: "secondary",
@@ -33,12 +36,14 @@ export var ConfirmDialog = /*#__PURE__*/forwardRef(function (_ref, ref) {
33
36
  style: {
34
37
  marginRight: "12px"
35
38
  },
36
- onClick: onConfirm
39
+ onClick: onConfirm,
40
+ disabled: isLoading
37
41
  }, confirmBtnText), shouldShowCancelButton ? /*#__PURE__*/React.createElement(Button, {
38
42
  variant: "secondary",
39
43
  "data-action": "cancel",
40
44
  onClick: onCancel,
41
- type: "button"
45
+ type: "button",
46
+ disabled: isLoading
42
47
  }, cancelBtnText) : null));
43
48
  });
44
49
  ConfirmDialog.displayName = "ConfirmDialog";
@@ -1 +1 @@
1
- {"version":3,"file":"ConfirmDialog.js","names":["React","forwardRef","classnames","Dialog","DialogTitle","DialogContent","DialogActions","DialogContentDivider","Button","Body2","ConfirmDialog","ref","open","onCancel","onConfirm","className","dialogTitle","dialogContent","confirmBtnText","cancelBtnText","shouldShowCancelButton","marginRight","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport classnames from \"classnames\";\nimport {\n Dialog,\n DialogTitle,\n DialogContent,\n DialogActions,\n DialogContentDivider,\n} from \"../Dialog\";\nimport { Button } from \"../Button/Button\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nexport interface IConfirmDialog {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: string;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDivElement, IConfirmDialog>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard changes?\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n },\n ref\n ) => {\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n >\n <DialogTitle>{dialogTitle}</DialogTitle>\n <DialogContentDivider />\n <DialogContent>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n </DialogContent>\n <DialogContentDivider />\n <DialogActions>\n <Button\n variant=\"primary\"\n style={{ marginRight: \"12px\" }}\n onClick={onConfirm}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </DialogActions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,MAAM,EACNC,WAAW,EACXC,aAAa,EACbC,aAAa,EACbC,oBAAoB,QACf,WAAW;AAClB,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,KAAK,QAAQ,8BAA8B;AAcpD,OAAO,IAAMC,aAAa,gBAAGT,UAAU,CACrC,gBAYEU,GAAG,EACA;EAAA,qBAXDC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,QAAQ,QAARA,QAAQ;IACRC,SAAS,QAATA,SAAS;IACTC,SAAS,QAATA,SAAS;IAAA,wBACTC,WAAW;IAAXA,WAAW,iCAAG,kBAAkB;IAAA,0BAChCC,aAAa;IAAbA,aAAa,mCAAG,mCAAmC;IAAA,2BACnDC,cAAc;IAAdA,cAAc,oCAAG,IAAI;IAAA,0BACrBC,aAAa;IAAbA,aAAa,mCAAG,QAAQ;IAAA,6BACxBC,sBAAsB;IAAtBA,sBAAsB,sCAAG,IAAI;EAI/B,oBACE,oBAAC,MAAM;IACL,GAAG,EAAET,GAAI;IACT,IAAI,EAAEC,IAAK;IACX,OAAO,EAAEC,QAAS;IAClB,SAAS,EAAEX,UAAU,CAAC,kBAAkB,EAAEa,SAAS;EAAE,gBAErD,oBAAC,WAAW,QAAEC,WAAW,CAAe,eACxC,oBAAC,oBAAoB,OAAG,eACxB,oBAAC,aAAa,qBACZ,oBAAC,KAAK;IAAC,UAAU,EAAC,OAAO;IAAC,KAAK,EAAC,WAAW;IAAC,UAAU,EAAC;EAAU,GAC9DC,aAAa,CACR,CACM,eAChB,oBAAC,oBAAoB,OAAG,eACxB,oBAAC,aAAa,qBACZ,oBAAC,MAAM;IACL,OAAO,EAAC,SAAS;IACjB,KAAK,EAAE;MAAEI,WAAW,EAAE;IAAO,CAAE;IAC/B,OAAO,EAAEP;EAAU,GAElBI,cAAc,CACR,EACRE,sBAAsB,gBACrB,oBAAC,MAAM;IACL,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpB,OAAO,EAAEP,QAAS;IAClB,IAAI,EAAC;EAAQ,GAEZM,aAAa,CACP,GACP,IAAI,CACM,CACT;AAEb,CAAC,CACF;AAEDT,aAAa,CAACY,WAAW,GAAG,eAAe"}
1
+ {"version":3,"file":"ConfirmDialog.js","names":["React","forwardRef","classnames","Dialog","DialogTitle","DialogContent","DialogActions","DialogContentDivider","Button","Body2","ConfirmDialog","ref","open","onCancel","onConfirm","className","dialogTitle","dialogContent","confirmBtnText","cancelBtnText","shouldShowCancelButton","isLoading","marginRight","displayName"],"sources":["../../../../src/components/ConfirmDialog/ConfirmDialog.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport classnames from \"classnames\";\nimport {\n Dialog,\n DialogTitle,\n DialogContent,\n DialogActions,\n DialogContentDivider,\n} from \"../Dialog\";\nimport { Button } from \"../Button/Button\";\nimport { Body2 } from \"../Typography/Variants/Body2\";\n\nexport interface IConfirmDialog {\n open?: boolean;\n onCancel?: () => void;\n onConfirm?: () => void;\n className?: string;\n dialogTitle?: string;\n dialogContent?: string;\n confirmBtnText?: string;\n cancelBtnText?: string;\n shouldShowCancelButton?: boolean;\n isLoading?: boolean;\n}\n\nexport const ConfirmDialog = forwardRef<HTMLDivElement, IConfirmDialog>(\n (\n {\n open = false,\n onCancel,\n onConfirm,\n className,\n dialogTitle = \"Discard changes?\",\n dialogContent = \"All unsaved changes will be lost.\",\n confirmBtnText = \"OK\",\n cancelBtnText = \"Cancel\",\n shouldShowCancelButton = true,\n isLoading = false,\n },\n ref\n ) => {\n return (\n <Dialog\n ref={ref}\n open={open}\n onClose={onCancel}\n className={classnames(\"c-confirm-dialog\", className)}\n disableCloseOnEsc={isLoading}\n >\n <DialogTitle>{dialogTitle}</DialogTitle>\n <DialogContentDivider />\n <DialogContent>\n <Body2 lineHeight=\"loose\" color=\"secondary\" whitespace=\"pre-line\">\n {dialogContent}\n </Body2>\n </DialogContent>\n <DialogContentDivider />\n <DialogActions>\n <Button\n variant=\"primary\"\n style={{ marginRight: \"12px\" }}\n onClick={onConfirm}\n disabled={isLoading}\n >\n {confirmBtnText}\n </Button>\n {shouldShowCancelButton ? (\n <Button\n variant=\"secondary\"\n data-action=\"cancel\"\n onClick={onCancel}\n type=\"button\"\n disabled={isLoading}\n >\n {cancelBtnText}\n </Button>\n ) : null}\n </DialogActions>\n </Dialog>\n );\n }\n);\n\nConfirmDialog.displayName = \"ConfirmDialog\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,UAAU,MAAM,YAAY;AACnC,SACEC,MAAM,EACNC,WAAW,EACXC,aAAa,EACbC,aAAa,EACbC,oBAAoB,QACf,WAAW;AAClB,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,KAAK,QAAQ,8BAA8B;AAepD,OAAO,IAAMC,aAAa,gBAAGT,UAAU,CACrC,gBAaEU,GAAG,EACA;EAAA,qBAZDC,IAAI;IAAJA,IAAI,0BAAG,KAAK;IACZC,QAAQ,QAARA,QAAQ;IACRC,SAAS,QAATA,SAAS;IACTC,SAAS,QAATA,SAAS;IAAA,wBACTC,WAAW;IAAXA,WAAW,iCAAG,kBAAkB;IAAA,0BAChCC,aAAa;IAAbA,aAAa,mCAAG,mCAAmC;IAAA,2BACnDC,cAAc;IAAdA,cAAc,oCAAG,IAAI;IAAA,0BACrBC,aAAa;IAAbA,aAAa,mCAAG,QAAQ;IAAA,6BACxBC,sBAAsB;IAAtBA,sBAAsB,sCAAG,IAAI;IAAA,sBAC7BC,SAAS;IAATA,SAAS,+BAAG,KAAK;EAInB,oBACE,oBAAC,MAAM;IACL,GAAG,EAAEV,GAAI;IACT,IAAI,EAAEC,IAAK;IACX,OAAO,EAAEC,QAAS;IAClB,SAAS,EAAEX,UAAU,CAAC,kBAAkB,EAAEa,SAAS,CAAE;IACrD,iBAAiB,EAAEM;EAAU,gBAE7B,oBAAC,WAAW,QAAEL,WAAW,CAAe,eACxC,oBAAC,oBAAoB,OAAG,eACxB,oBAAC,aAAa,qBACZ,oBAAC,KAAK;IAAC,UAAU,EAAC,OAAO;IAAC,KAAK,EAAC,WAAW;IAAC,UAAU,EAAC;EAAU,GAC9DC,aAAa,CACR,CACM,eAChB,oBAAC,oBAAoB,OAAG,eACxB,oBAAC,aAAa,qBACZ,oBAAC,MAAM;IACL,OAAO,EAAC,SAAS;IACjB,KAAK,EAAE;MAAEK,WAAW,EAAE;IAAO,CAAE;IAC/B,OAAO,EAAER,SAAU;IACnB,QAAQ,EAAEO;EAAU,GAEnBH,cAAc,CACR,EACRE,sBAAsB,gBACrB,oBAAC,MAAM;IACL,OAAO,EAAC,WAAW;IACnB,eAAY,QAAQ;IACpB,OAAO,EAAEP,QAAS;IAClB,IAAI,EAAC,QAAQ;IACb,QAAQ,EAAEQ;EAAU,GAEnBF,aAAa,CACP,GACP,IAAI,CACM,CACT;AAEb,CAAC,CACF;AAEDT,aAAa,CAACa,WAAW,GAAG,eAAe"}
package/dist/index.js CHANGED
@@ -9271,12 +9271,15 @@
9271
9271
  _ref$cancelBtnText = _ref.cancelBtnText,
9272
9272
  cancelBtnText = _ref$cancelBtnText === void 0 ? "Cancel" : _ref$cancelBtnText,
9273
9273
  _ref$shouldShowCancel = _ref.shouldShowCancelButton,
9274
- shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel;
9274
+ shouldShowCancelButton = _ref$shouldShowCancel === void 0 ? true : _ref$shouldShowCancel,
9275
+ _ref$isLoading = _ref.isLoading,
9276
+ isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading;
9275
9277
  return /*#__PURE__*/React__default["default"].createElement(Dialog, {
9276
9278
  ref: ref,
9277
9279
  open: open,
9278
9280
  onClose: onCancel,
9279
- className: classNames__default["default"]("c-confirm-dialog", className)
9281
+ className: classNames__default["default"]("c-confirm-dialog", className),
9282
+ disableCloseOnEsc: isLoading
9280
9283
  }, /*#__PURE__*/React__default["default"].createElement(DialogTitle, null, dialogTitle), /*#__PURE__*/React__default["default"].createElement(DialogContentDivider, null), /*#__PURE__*/React__default["default"].createElement(DialogContent, null, /*#__PURE__*/React__default["default"].createElement(Body2, {
9281
9284
  lineHeight: "loose",
9282
9285
  color: "secondary",
@@ -9286,12 +9289,14 @@
9286
9289
  style: {
9287
9290
  marginRight: "12px"
9288
9291
  },
9289
- onClick: onConfirm
9292
+ onClick: onConfirm,
9293
+ disabled: isLoading
9290
9294
  }, confirmBtnText), shouldShowCancelButton ? /*#__PURE__*/React__default["default"].createElement(Button, {
9291
9295
  variant: "secondary",
9292
9296
  "data-action": "cancel",
9293
9297
  onClick: onCancel,
9294
- type: "button"
9298
+ type: "button",
9299
+ disabled: isLoading
9295
9300
  }, cancelBtnText) : null));
9296
9301
  });
9297
9302
  ConfirmDialog.displayName = "ConfirmDialog";