@devtron-labs/devtron-fe-common-lib 4.0.5 → 4.0.6

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -14
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -18632,22 +18632,24 @@ var VE = class {
18632
18632
  ]
18633
18633
  })
18634
18634
  }), vD = ({ apiPromise: e, fileName: t, triggerElementConfig: n, disabled: r, modalConfig: i, headers: a, downloadRequestId: o }) => {
18635
- let s = q(null), c = q(new AbortController()), [l, u] = J([]), [d, f] = J(null), [p, m] = J(!1), [h, g] = J(null), _ = async () => {
18635
+ let s = q(null), c = q(null), [l, u] = J([]), [d, f] = J(null), [p, m] = J(!1), [h, g] = J(null), [_, v] = J(!1), y = async () => {
18636
18636
  if (!r) try {
18637
- m(!0), g(null), u(await e({ signal: c.current.signal })), s.current?.link?.click();
18637
+ m(!0), g(null), u(await e({ signal: c.current.signal })), v(!0);
18638
18638
  } catch (e) {
18639
18639
  Mr(e) || (Ga(e), g(e));
18640
18640
  } finally {
18641
18641
  c.current = new AbortController(), m(!1);
18642
18642
  }
18643
- }, v = async () => {
18644
- i?.hideDialog || f(i ? "custom" : "default"), (!i || i.hideDialog) && await _();
18643
+ }, b = async () => {
18644
+ i?.hideDialog || f(i ? "custom" : "default"), (!i || i.hideDialog) && await y();
18645
18645
  };
18646
- return G(() => () => {
18647
- c.current.abort();
18648
- }, []), G(() => {
18649
- ai(o) || v();
18650
- }, [o]), /* @__PURE__ */ (0, Y.jsxs)("div", { children: [
18646
+ return G(() => (c.current = new AbortController(), () => {
18647
+ c.current?.abort();
18648
+ }), []), G(() => {
18649
+ ai(o) || b();
18650
+ }, [o]), G(() => {
18651
+ _ && (s.current?.link?.click(), v(!1));
18652
+ }, [_]), /* @__PURE__ */ (0, Y.jsxs)("div", { children: [
18651
18653
  !n || n.showOnlyIcon ? /* @__PURE__ */ (0, Y.jsx)(N, {
18652
18654
  ...n?.showOnlyIcon ? {
18653
18655
  icon: /* @__PURE__ */ (0, Y.jsx)(I, {
@@ -18663,7 +18665,7 @@ var VE = class {
18663
18665
  color: null
18664
18666
  })
18665
18667
  },
18666
- onClick: v,
18668
+ onClick: b,
18667
18669
  size: V.medium,
18668
18670
  variant: R.secondary,
18669
18671
  dataTestId: "export-csv-button",
@@ -18673,11 +18675,11 @@ var VE = class {
18673
18675
  tooltipProps: { content: "Nothing to export" }
18674
18676
  }) : n.buttonProps ? /* @__PURE__ */ (0, Y.jsx)(N, {
18675
18677
  ...n.buttonProps,
18676
- onClick: v
18678
+ onClick: b
18677
18679
  }) : n.customButton ? /* @__PURE__ */ (0, Y.jsx)("button", {
18678
18680
  "data-testid": "export-csv-button",
18679
18681
  type: "button",
18680
- onClick: v,
18682
+ onClick: b,
18681
18683
  disabled: r,
18682
18684
  className: `dc__transparent ${n.customButton.className}`,
18683
18685
  children: n.customButton.content
@@ -18694,11 +18696,11 @@ var VE = class {
18694
18696
  f(null);
18695
18697
  return;
18696
18698
  }
18697
- f("default"), await _();
18699
+ f("default"), await y();
18698
18700
  }) : /* @__PURE__ */ (0, Y.jsx)(_D, {
18699
18701
  exportDataError: h,
18700
18702
  isLoading: p,
18701
- initiateDownload: _,
18703
+ initiateDownload: y,
18702
18704
  handleCancelRequest: () => {
18703
18705
  c.current.abort(), c.current = new AbortController(), f(null), m(!1);
18704
18706
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Supporting common component library",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",