@databrainhq/plugin 0.9.5 → 0.9.7

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.
package/dist/index.es.js CHANGED
@@ -2515,7 +2515,7 @@ function useQuery(arg1, arg2, arg3) {
2515
2515
  const container$h = "_container_12kmo_1";
2516
2516
  const fixed = "_fixed_12kmo_1";
2517
2517
  const flex = "_flex_12kmo_1";
2518
- const table$4 = "_table_12kmo_1";
2518
+ const table$3 = "_table_12kmo_1";
2519
2519
  const grid = "_grid_12kmo_1";
2520
2520
  const hidden = "_hidden_12kmo_1";
2521
2521
  const transform = "_transform_12kmo_1";
@@ -2542,7 +2542,8 @@ var styles$L = {
2542
2542
  "ml-[40px]": "_ml-[40px]_12kmo_1",
2543
2543
  "mb-2": "_mb-2_12kmo_1",
2544
2544
  flex,
2545
- table: table$4,
2545
+ table: table$3,
2546
+ "!table": "_!table_12kmo_1",
2546
2547
  grid,
2547
2548
  hidden,
2548
2549
  "h-screen": "_h-screen_12kmo_1",
@@ -5615,7 +5616,10 @@ const FREQUENCY = [
5615
5616
  { value: "Weekly", label: "Weekly" },
5616
5617
  { value: "Monthly", label: "Monthly" }
5617
5618
  ];
5618
- const RAW_CSV_OPTIONS = ["download", "email"];
5619
+ const RAW_CSV_OPTIONS = ["Url download", "Email"];
5620
+ const NONE$1 = "NONE";
5621
+ const REQUESTED = "REQUESTED";
5622
+ const AVAILABLE = "AVAILABLE";
5619
5623
  const ChartConfig = ({
5620
5624
  data,
5621
5625
  setXAxis,
@@ -6527,7 +6531,7 @@ const TextAreaField = ({
6527
6531
  });
6528
6532
  };
6529
6533
  const group$1 = "_group_13otg_1";
6530
- const button$6 = "_button_13otg_9";
6534
+ const button$7 = "_button_13otg_9";
6531
6535
  const checkbox = "_checkbox_13otg_17";
6532
6536
  const enabled = "_enabled_13otg_43";
6533
6537
  const notenabled = "_notenabled_13otg_59";
@@ -6536,7 +6540,7 @@ const labelActive = "_labelActive_13otg_83";
6536
6540
  const labelInactive = "_labelInactive_13otg_91";
6537
6541
  var styles$A = {
6538
6542
  group: group$1,
6539
- button: button$6,
6543
+ button: button$7,
6540
6544
  checkbox,
6541
6545
  "switch": "_switch_13otg_25",
6542
6546
  enabled,
@@ -6920,6 +6924,7 @@ const ExternalMetricRawCsvUrlsDocument = `
6920
6924
  id
6921
6925
  lastUpdatedAt
6922
6926
  urls
6927
+ requestStatus
6923
6928
  }
6924
6929
  }
6925
6930
  `;
@@ -6958,6 +6963,19 @@ const useMetricAccessQuery = (variables, options2) => useQuery(
6958
6963
  fetcher(MetricAccessDocument, variables),
6959
6964
  options2
6960
6965
  );
6966
+ const RawCsvSettingsDocument = `
6967
+ query RawCsvSettings($id: uuid = "") {
6968
+ companyWorkspaces_by_pk(id: $id) {
6969
+ rawCsvSettings
6970
+ id
6971
+ }
6972
+ }
6973
+ `;
6974
+ const useRawCsvSettingsQuery = (variables, options2) => useQuery(
6975
+ variables === void 0 ? ["RawCsvSettings"] : ["RawCsvSettings", variables],
6976
+ fetcher(RawCsvSettingsDocument, variables),
6977
+ options2
6978
+ );
6961
6979
  const ScheduleEmailReportDocument = `
6962
6980
  query ScheduleEmailReport($token: uuid = "") {
6963
6981
  scheduleEmailReports(where: {guestToken: {_eq: $token}}) {
@@ -7193,6 +7211,28 @@ const useUpdateAdminMetricMutation = (options2) => useMutation(
7193
7211
  (variables) => fetcher(UpdateAdminMetricDocument, variables)(),
7194
7212
  options2
7195
7213
  );
7214
+ const UpdateCsvDownloadStatusDocument = `
7215
+ mutation UpdateCSVDownloadStatus($configurations: jsonb = "", $expireUrlIn: Int = 60, $externalMetricId: uuid = "", $requestStatus: String = "", $urls: jsonb = "") {
7216
+ insert_externalMetricRawCsvUrls_one(
7217
+ object: {configurations: $configurations, expireUrlIn: $expireUrlIn, externalMetricId: $externalMetricId, requestStatus: $requestStatus, urls: $urls}
7218
+ on_conflict: {constraint: externalMetricRawCsvUrls_externalMetricId_key, update_columns: [configurations, error, expireUrlIn, lastUpdatedAt, requestStatus, urls]}
7219
+ ) {
7220
+ id
7221
+ requestStatus
7222
+ configurations
7223
+ error
7224
+ expireUrlIn
7225
+ externalMetricId
7226
+ lastUpdatedAt
7227
+ urls
7228
+ }
7229
+ }
7230
+ `;
7231
+ const useUpdateCsvDownloadStatusMutation = (options2) => useMutation(
7232
+ ["UpdateCSVDownloadStatus"],
7233
+ (variables) => fetcher(UpdateCsvDownloadStatusDocument, variables)(),
7234
+ options2
7235
+ );
7196
7236
  const UpdateExternalMetricDocument = `
7197
7237
  mutation UpdateExternalMetric($externalMetricId: uuid!, $set: externalMetrics_set_input!) {
7198
7238
  update_externalMetrics_by_pk(pk_columns: {id: $externalMetricId}, _set: $set) {
@@ -7321,25 +7361,26 @@ const ExternalMetricForm = ({
7321
7361
  })]
7322
7362
  });
7323
7363
  };
7324
- const container$d = "_container_1brv3_1";
7325
- const wrapper$3 = "_wrapper_1brv3_9";
7326
- const label$3 = "_label_1brv3_17";
7327
- const floatingLabel = "_floatingLabel_1brv3_25";
7328
- const floatingText = "_floatingText_1brv3_31";
7329
- const clientText = "_clientText_1brv3_39";
7330
- const normalText = "_normalText_1brv3_47";
7331
- const dropdown$1 = "_dropdown_1brv3_55";
7332
- const options = "_options_1brv3_63";
7333
- const checkedOption = "_checkedOption_1brv3_71";
7334
- const option = "_option_1brv3_63";
7335
- const icon$1 = "_icon_1brv3_87";
7336
- const text$2 = "_text_1brv3_95";
7337
- const search = "_search_1brv3_103";
7338
- const loadMore = "_loadMore_1brv3_111";
7339
- const loadMoreIcon = "_loadMoreIcon_1brv3_119";
7364
+ const container$d = "_container_1dkbf_1";
7365
+ const wrapper$2 = "_wrapper_1dkbf_9";
7366
+ const label$3 = "_label_1dkbf_17";
7367
+ const floatingLabel = "_floatingLabel_1dkbf_25";
7368
+ const floatingText = "_floatingText_1dkbf_31";
7369
+ const clientText = "_clientText_1dkbf_39";
7370
+ const normalText = "_normalText_1dkbf_47";
7371
+ const dropdown$1 = "_dropdown_1dkbf_55";
7372
+ const options = "_options_1dkbf_63";
7373
+ const checkedOption = "_checkedOption_1dkbf_71";
7374
+ const option = "_option_1dkbf_63";
7375
+ const icon$1 = "_icon_1dkbf_87";
7376
+ const text$1 = "_text_1dkbf_95";
7377
+ const search = "_search_1dkbf_103";
7378
+ const loadMore = "_loadMore_1dkbf_111";
7379
+ const loadMoreIcon = "_loadMoreIcon_1dkbf_119";
7380
+ const aboveList = "_aboveList_1dkbf_127";
7340
7381
  var styles$y = {
7341
7382
  container: container$d,
7342
- wrapper: wrapper$3,
7383
+ wrapper: wrapper$2,
7343
7384
  label: label$3,
7344
7385
  floatingLabel,
7345
7386
  floatingText,
@@ -7350,10 +7391,11 @@ var styles$y = {
7350
7391
  checkedOption,
7351
7392
  option,
7352
7393
  icon: icon$1,
7353
- text: text$2,
7394
+ text: text$1,
7354
7395
  search,
7355
7396
  loadMore,
7356
- loadMoreIcon
7397
+ loadMoreIcon,
7398
+ aboveList
7357
7399
  };
7358
7400
  const useEmbeddedDashboard = (token) => {
7359
7401
  var _a2, _b2;
@@ -7927,6 +7969,9 @@ var index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
7927
7969
  DATE_NUM,
7928
7970
  FREQUENCY,
7929
7971
  RAW_CSV_OPTIONS,
7972
+ NONE: NONE$1,
7973
+ REQUESTED,
7974
+ AVAILABLE,
7930
7975
  operatorList,
7931
7976
  RowLimitList,
7932
7977
  AggregateList,
@@ -8070,12 +8115,14 @@ const FloatingDropDown = ({
8070
8115
  selectedOption: selectedOption2,
8071
8116
  onChange,
8072
8117
  className,
8118
+ buttonClass,
8073
8119
  options: options2,
8074
8120
  isDisabled,
8075
8121
  children: children2,
8076
8122
  icon: icon2,
8077
8123
  isSearchEnabled,
8078
- closeControl
8124
+ closeControl,
8125
+ dropdownAbove
8079
8126
  }) => {
8080
8127
  const [isShow, setIsShow] = useState(false);
8081
8128
  const wrapperRef = useRef(null);
@@ -8102,7 +8149,7 @@ const FloatingDropDown = ({
8102
8149
  type: "button",
8103
8150
  variant: "custom",
8104
8151
  isDisabled,
8105
- className: styles$y.wrapper,
8152
+ className: classnames(styles$y.wrapper, buttonClass),
8106
8153
  onClick: () => setIsShow(!isShow),
8107
8154
  children: [/* @__PURE__ */ jsxs(Text, {
8108
8155
  variant: "p",
@@ -8111,7 +8158,7 @@ const FloatingDropDown = ({
8111
8158
  children: [icon2, selectedOption2.label || selectedOption2.value || "Select An Option"]
8112
8159
  }), /* @__PURE__ */ jsx(materialSymbolsKeyboardArrowDown, {})]
8113
8160
  }), isShow && !isDisabled && /* @__PURE__ */ jsxs("div", {
8114
- className: styles$y.dropdown,
8161
+ className: `${dropdownAbove ? styles$y.aboveList : styles$y.dropdown}`,
8115
8162
  children: [isSearchEnabled && /* @__PURE__ */ jsx(SearchTab, {
8116
8163
  className: styles$y.search,
8117
8164
  setSearchKeyword
@@ -19902,9 +19949,9 @@ function blurSeriesFromHighlightPayload(seriesModel, payload, api) {
19902
19949
  var el = data.getItemGraphicEl(dataIndex);
19903
19950
  if (!el) {
19904
19951
  var count2 = data.count();
19905
- var current = 0;
19906
- while (!el && current < count2) {
19907
- el = data.getItemGraphicEl(current++);
19952
+ var current2 = 0;
19953
+ while (!el && current2 < count2) {
19954
+ el = data.getItemGraphicEl(current2++);
19908
19955
  }
19909
19956
  }
19910
19957
  if (el) {
@@ -25754,13 +25801,13 @@ var Task = function() {
25754
25801
  }();
25755
25802
  var iterator = function() {
25756
25803
  var end2;
25757
- var current;
25804
+ var current2;
25758
25805
  var modBy;
25759
25806
  var modDataCount;
25760
25807
  var winCount;
25761
25808
  var it = {
25762
25809
  reset: function(s2, e2, sStep, sCount) {
25763
- current = s2;
25810
+ current2 = s2;
25764
25811
  end2 = e2;
25765
25812
  modBy = sStep;
25766
25813
  modDataCount = sCount;
@@ -25770,12 +25817,12 @@ var iterator = function() {
25770
25817
  };
25771
25818
  return it;
25772
25819
  function sequentialNext() {
25773
- return current < end2 ? current++ : null;
25820
+ return current2 < end2 ? current2++ : null;
25774
25821
  }
25775
25822
  function modNext() {
25776
- var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);
25777
- var result = current >= end2 ? null : dataIndex < modDataCount ? dataIndex : current;
25778
- current++;
25823
+ var dataIndex = current2 % winCount * modBy + Math.ceil(current2 / winCount);
25824
+ var result = current2 >= end2 ? null : dataIndex < modDataCount ? dataIndex : current2;
25825
+ current2++;
25779
25826
  return result;
25780
25827
  }
25781
25828
  }();
@@ -40910,7 +40957,7 @@ var LineView = function(_super) {
40910
40957
  var point = [symbol.x, symbol.y];
40911
40958
  var start2 = void 0;
40912
40959
  var end2 = void 0;
40913
- var current = void 0;
40960
+ var current2 = void 0;
40914
40961
  if (clipShape) {
40915
40962
  if (isCoordSysPolar) {
40916
40963
  var polarClip = clipShape;
@@ -40918,26 +40965,26 @@ var LineView = function(_super) {
40918
40965
  if (isHorizontalOrRadial) {
40919
40966
  start2 = polarClip.startAngle;
40920
40967
  end2 = polarClip.endAngle;
40921
- current = -coord[1] / 180 * Math.PI;
40968
+ current2 = -coord[1] / 180 * Math.PI;
40922
40969
  } else {
40923
40970
  start2 = polarClip.r0;
40924
40971
  end2 = polarClip.r;
40925
- current = coord[0];
40972
+ current2 = coord[0];
40926
40973
  }
40927
40974
  } else {
40928
40975
  var gridClip = clipShape;
40929
40976
  if (isHorizontalOrRadial) {
40930
40977
  start2 = gridClip.x;
40931
40978
  end2 = gridClip.x + gridClip.width;
40932
- current = symbol.x;
40979
+ current2 = symbol.x;
40933
40980
  } else {
40934
40981
  start2 = gridClip.y + gridClip.height;
40935
40982
  end2 = gridClip.y;
40936
- current = symbol.y;
40983
+ current2 = symbol.y;
40937
40984
  }
40938
40985
  }
40939
40986
  }
40940
- var ratio = end2 === start2 ? 0 : (current - start2) / (end2 - start2);
40987
+ var ratio = end2 === start2 ? 0 : (current2 - start2) / (end2 - start2);
40941
40988
  if (isAxisInverse) {
40942
40989
  ratio = 1 - ratio;
40943
40990
  }
@@ -41071,17 +41118,17 @@ var LineView = function(_super) {
41071
41118
  var polygon = this._polygon;
41072
41119
  var seriesModel = data.hostModel;
41073
41120
  var diff2 = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin);
41074
- var current = diff2.current;
41121
+ var current2 = diff2.current;
41075
41122
  var stackedOnCurrent = diff2.stackedOnCurrent;
41076
41123
  var next = diff2.next;
41077
41124
  var stackedOnNext = diff2.stackedOnNext;
41078
41125
  if (step) {
41079
- current = turnPointsIntoStep(diff2.current, coordSys, step, connectNulls);
41126
+ current2 = turnPointsIntoStep(diff2.current, coordSys, step, connectNulls);
41080
41127
  stackedOnCurrent = turnPointsIntoStep(diff2.stackedOnCurrent, coordSys, step, connectNulls);
41081
41128
  next = turnPointsIntoStep(diff2.next, coordSys, step, connectNulls);
41082
41129
  stackedOnNext = turnPointsIntoStep(diff2.stackedOnNext, coordSys, step, connectNulls);
41083
41130
  }
41084
- if (getBoundingDiff(current, next) > 3e3 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3e3) {
41131
+ if (getBoundingDiff(current2, next) > 3e3 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3e3) {
41085
41132
  polyline.stopAnimation();
41086
41133
  polyline.setShape({
41087
41134
  points: next
@@ -41096,20 +41143,20 @@ var LineView = function(_super) {
41096
41143
  return;
41097
41144
  }
41098
41145
  polyline.shape.__points = diff2.current;
41099
- polyline.shape.points = current;
41146
+ polyline.shape.points = current2;
41100
41147
  var target = {
41101
41148
  shape: {
41102
41149
  points: next
41103
41150
  }
41104
41151
  };
41105
- if (diff2.current !== current) {
41152
+ if (diff2.current !== current2) {
41106
41153
  target.shape.__points = diff2.next;
41107
41154
  }
41108
41155
  polyline.stopAnimation();
41109
41156
  updateProps$1(polyline, target, seriesModel);
41110
41157
  if (polygon) {
41111
41158
  polygon.setShape({
41112
- points: current,
41159
+ points: current2,
41113
41160
  stackedOnPoints: stackedOnCurrent
41114
41161
  });
41115
41162
  polygon.stopAnimation();
@@ -44862,15 +44909,15 @@ function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
44862
44909
  function ignoreEl(el) {
44863
44910
  el && (el.ignore = true);
44864
44911
  }
44865
- function isTwoLabelOverlapped(current, next) {
44866
- var firstRect = current && current.getBoundingRect().clone();
44912
+ function isTwoLabelOverlapped(current2, next) {
44913
+ var firstRect = current2 && current2.getBoundingRect().clone();
44867
44914
  var nextRect = next && next.getBoundingRect().clone();
44868
44915
  if (!firstRect || !nextRect) {
44869
44916
  return;
44870
44917
  }
44871
44918
  var mRotationBack = identity([]);
44872
- rotate(mRotationBack, mRotationBack, -current.rotation);
44873
- firstRect.applyTransform(mul([], mRotationBack, current.getLocalTransform()));
44919
+ rotate(mRotationBack, mRotationBack, -current2.rotation);
44920
+ firstRect.applyTransform(mul([], mRotationBack, current2.getLocalTransform()));
44874
44921
  nextRect.applyTransform(mul([], mRotationBack, next.getLocalTransform()));
44875
44922
  return firstRect.intersect(nextRect);
44876
44923
  }
@@ -48842,8 +48889,8 @@ var GeoView = function(_super) {
48842
48889
  };
48843
48890
  GeoView2.prototype._handleRegionClick = function(e2) {
48844
48891
  var eventData;
48845
- findEventDispatcher(e2.target, function(current) {
48846
- return (eventData = getECData(current).eventData) != null;
48892
+ findEventDispatcher(e2.target, function(current2) {
48893
+ return (eventData = getECData(current2).eventData) != null;
48847
48894
  }, true);
48848
48895
  if (eventData) {
48849
48896
  this._api.dispatchAction({
@@ -50328,11 +50375,11 @@ function enableAriaDecalForTree(seriesModel) {
50328
50375
  var tree = data.tree;
50329
50376
  var decalPaletteScope2 = {};
50330
50377
  tree.eachNode(function(node) {
50331
- var current = node;
50332
- while (current && current.depth > 1) {
50333
- current = current.parentNode;
50378
+ var current2 = node;
50379
+ while (current2 && current2.depth > 1) {
50380
+ current2 = current2.parentNode;
50334
50381
  }
50335
- var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + "", decalPaletteScope2);
50382
+ var decal = getDecalFromPalette(seriesModel.ecModel, current2.name || current2.dataIndex + "", decalPaletteScope2);
50336
50383
  node.setVisual("decal", decal);
50337
50384
  });
50338
50385
  }
@@ -62003,11 +62050,11 @@ function sort(children2, sortOrder) {
62003
62050
  function sunburstVisual(ecModel) {
62004
62051
  var paletteScope = {};
62005
62052
  function pickColor(node, seriesModel, treeHeight) {
62006
- var current = node;
62007
- while (current && current.depth > 1) {
62008
- current = current.parentNode;
62053
+ var current2 = node;
62054
+ while (current2 && current2.depth > 1) {
62055
+ current2 = current2.parentNode;
62009
62056
  }
62010
- var color2 = seriesModel.getColorFromPalette(current.name || current.dataIndex + "", paletteScope);
62057
+ var color2 = seriesModel.getColorFromPalette(current2.name || current2.dataIndex + "", paletteScope);
62011
62058
  if (node.depth > 1 && isString$1(color2)) {
62012
62059
  color2 = lift(color2, (node.depth - 1) / (treeHeight - 1) * 0.5);
62013
62060
  }
@@ -68446,8 +68493,8 @@ var DataView = function(_super) {
68446
68493
  viewMain.appendChild(textarea2);
68447
68494
  }
68448
68495
  var blockMetaList = result.meta;
68449
- var buttonContainer = document.createElement("div");
68450
- buttonContainer.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
68496
+ var buttonContainer2 = document.createElement("div");
68497
+ buttonContainer2.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
68451
68498
  var buttonStyle = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px";
68452
68499
  var closeButton = document.createElement("div");
68453
68500
  var refreshButton = document.createElement("div");
@@ -68486,11 +68533,11 @@ var DataView = function(_super) {
68486
68533
  closeButton.innerHTML = lang[1];
68487
68534
  refreshButton.innerHTML = lang[2];
68488
68535
  refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;
68489
- !model.get("readOnly") && buttonContainer.appendChild(refreshButton);
68490
- buttonContainer.appendChild(closeButton);
68536
+ !model.get("readOnly") && buttonContainer2.appendChild(refreshButton);
68537
+ buttonContainer2.appendChild(closeButton);
68491
68538
  root2.appendChild(header2);
68492
68539
  root2.appendChild(viewMain);
68493
- root2.appendChild(buttonContainer);
68540
+ root2.appendChild(buttonContainer2);
68494
68541
  viewMain.style.height = container2.clientHeight - 80 + "px";
68495
68542
  container2.appendChild(root2);
68496
68543
  this._dom = root2;
@@ -73916,10 +73963,10 @@ var ScrollableLegendView = function(_super) {
73916
73963
  var pageText = controllerGroup.childOfName("pageText");
73917
73964
  var pageFormatter = legendModel.get("pageFormatter");
73918
73965
  var pageIndex = pageInfo.pageIndex;
73919
- var current = pageIndex != null ? pageIndex + 1 : 0;
73966
+ var current2 = pageIndex != null ? pageIndex + 1 : 0;
73920
73967
  var total = pageInfo.pageCount;
73921
- pageText && pageFormatter && pageText.setStyle("text", isString$1(pageFormatter) ? pageFormatter.replace("{current}", current == null ? "" : current + "").replace("{total}", total == null ? "" : total + "") : pageFormatter({
73922
- current,
73968
+ pageText && pageFormatter && pageText.setStyle("text", isString$1(pageFormatter) ? pageFormatter.replace("{current}", current2 == null ? "" : current2 + "").replace("{total}", total == null ? "" : total + "") : pageFormatter({
73969
+ current: current2,
73923
73970
  total
73924
73971
  }));
73925
73972
  };
@@ -81606,7 +81653,7 @@ const StackedBarChart = ({
81606
81653
  children: /* @__PURE__ */ jsx(EChartsReact, {
81607
81654
  style: {
81608
81655
  width: "100%",
81609
- height: "300px"
81656
+ height: "90%"
81610
81657
  },
81611
81658
  option: option2,
81612
81659
  onEvents: {
@@ -84029,7 +84076,7 @@ const alphanumeric = (rowA, rowB, columnId) => {
84029
84076
  const alphanumericCaseSensitive = (rowA, rowB, columnId) => {
84030
84077
  return compareAlphanumeric(toString$1(rowA.getValue(columnId)), toString$1(rowB.getValue(columnId)));
84031
84078
  };
84032
- const text$1 = (rowA, rowB, columnId) => {
84079
+ const text = (rowA, rowB, columnId) => {
84033
84080
  return compareBasic(toString$1(rowA.getValue(columnId)).toLowerCase(), toString$1(rowB.getValue(columnId)).toLowerCase());
84034
84081
  };
84035
84082
  const textCaseSensitive = (rowA, rowB, columnId) => {
@@ -84091,7 +84138,7 @@ function compareAlphanumeric(aStr, bStr) {
84091
84138
  const sortingFns = {
84092
84139
  alphanumeric,
84093
84140
  alphanumericCaseSensitive,
84094
- text: text$1,
84141
+ text,
84095
84142
  textCaseSensitive,
84096
84143
  datetime,
84097
84144
  basic
@@ -85626,41 +85673,51 @@ function getAccessorAttributes(accessor) {
85626
85673
  ...accessor
85627
85674
  };
85628
85675
  }
85629
- const tableData = "_tableData_17lmd_7";
85630
- const tableHeadCol$1 = "_tableHeadCol_17lmd_13";
85631
- const tableRow$1 = "_tableRow_17lmd_19";
85632
- const tableRowCol$1 = "_tableRowCol_17lmd_25";
85633
- const row = "_row_17lmd_31";
85634
- const container$b = "_container_17lmd_37";
85635
- const table$3 = "_table_17lmd_1";
85636
- const previewTable = "_previewTable_17lmd_49";
85637
- const preview = "_preview_17lmd_49";
85638
- const searchButton = "_searchButton_17lmd_61";
85639
- const previewText = "_previewText_17lmd_67";
85640
- const noData$1 = "_noData_17lmd_73";
85641
- const error$2 = "_error_17lmd_79";
85642
- const errorMsg = "_errorMsg_17lmd_85";
85643
- const tableIcon = "_tableIcon_17lmd_91";
85644
- const stripedRow = "_stripedRow_17lmd_97";
85645
- const rowHover = "_rowHover_17lmd_103";
85646
- const rightBorder = "_rightBorder_17lmd_109";
85647
- const searchContainer = "_searchContainer_17lmd_115";
85648
- const sortButton = "_sortButton_17lmd_121";
85649
- const debounceInput = "_debounceInput_17lmd_127";
85650
- const searchTab = "_searchTab_17lmd_133";
85651
- const noDataHead = "_noDataHead_17lmd_139";
85652
- const noDataBody = "_noDataBody_17lmd_145";
85653
- const showSort = "_showSort_17lmd_151";
85654
- const noSort = "_noSort_17lmd_157";
85676
+ const tableData = "_tableData_1bay1_7";
85677
+ const tableHeadCol$1 = "_tableHeadCol_1bay1_13";
85678
+ const tableRow$1 = "_tableRow_1bay1_19";
85679
+ const tableRowCol$1 = "_tableRowCol_1bay1_25";
85680
+ const row = "_row_1bay1_31";
85681
+ const container$b = "_container_1bay1_37";
85682
+ const table$2 = "_table_1bay1_1";
85683
+ const previewTable = "_previewTable_1bay1_49";
85684
+ const preview = "_preview_1bay1_49";
85685
+ const searchButton = "_searchButton_1bay1_61";
85686
+ const previewText = "_previewText_1bay1_67";
85687
+ const noData$1 = "_noData_1bay1_73";
85688
+ const error$2 = "_error_1bay1_79";
85689
+ const errorMsg = "_errorMsg_1bay1_85";
85690
+ const tableIcon = "_tableIcon_1bay1_91";
85691
+ const stripedRow = "_stripedRow_1bay1_97";
85692
+ const rowHover = "_rowHover_1bay1_103";
85693
+ const rightBorder = "_rightBorder_1bay1_109";
85694
+ const searchContainer = "_searchContainer_1bay1_115";
85695
+ const sortButton = "_sortButton_1bay1_121";
85696
+ const searchTab = "_searchTab_1bay1_127";
85697
+ const searchTabInput = "_searchTabInput_1bay1_133";
85698
+ const searchTabIcon = "_searchTabIcon_1bay1_139";
85699
+ const noDataHead = "_noDataHead_1bay1_145";
85700
+ const noDataBody = "_noDataBody_1bay1_151";
85701
+ const showSort = "_showSort_1bay1_157";
85702
+ const noSort = "_noSort_1bay1_163";
85703
+ const pagination = "_pagination_1bay1_169";
85704
+ const rowStyle = "_rowStyle_1bay1_175";
85705
+ const rowText = "_rowText_1bay1_181";
85706
+ const rowsDropdown = "_rowsDropdown_1bay1_187";
85707
+ const pageStyle = "_pageStyle_1bay1_193";
85708
+ const buttonContainer = "_buttonContainer_1bay1_199";
85709
+ const button$6 = "_button_1bay1_199";
85710
+ const paginationWrapper = "_paginationWrapper_1bay1_217";
85711
+ const current = "_current_1bay1_223";
85655
85712
  var styles$u = {
85656
- "table-loader-container": "_table-loader-container_17lmd_1",
85713
+ "table-loader-container": "_table-loader-container_1bay1_1",
85657
85714
  tableData,
85658
85715
  tableHeadCol: tableHeadCol$1,
85659
85716
  tableRow: tableRow$1,
85660
85717
  tableRowCol: tableRowCol$1,
85661
85718
  row,
85662
85719
  container: container$b,
85663
- table: table$3,
85720
+ table: table$2,
85664
85721
  previewTable,
85665
85722
  preview,
85666
85723
  searchButton,
@@ -85674,12 +85731,22 @@ var styles$u = {
85674
85731
  rightBorder,
85675
85732
  searchContainer,
85676
85733
  sortButton,
85677
- debounceInput,
85678
85734
  searchTab,
85735
+ searchTabInput,
85736
+ searchTabIcon,
85679
85737
  noDataHead,
85680
85738
  noDataBody,
85681
85739
  showSort,
85682
- noSort
85740
+ noSort,
85741
+ pagination,
85742
+ rowStyle,
85743
+ rowText,
85744
+ rowsDropdown,
85745
+ pageStyle,
85746
+ buttonContainer,
85747
+ button: button$6,
85748
+ paginationWrapper,
85749
+ current
85683
85750
  };
85684
85751
  const DebouncedInput = ({
85685
85752
  value: initialValue,
@@ -85697,11 +85764,19 @@ const DebouncedInput = ({
85697
85764
  }, debounce2);
85698
85765
  return () => clearTimeout(timeout);
85699
85766
  }, [debounce2, onChange, value]);
85700
- return /* @__PURE__ */ jsx("input", {
85701
- ...props,
85702
- value,
85703
- onChange: (e2) => setValue(e2.target.value),
85704
- className: styles$u.searchTab
85767
+ return /* @__PURE__ */ jsxs("div", {
85768
+ className: `${styles$u.searchTab} ${props.className || ""}`,
85769
+ children: [/* @__PURE__ */ jsx("input", {
85770
+ ...props,
85771
+ value,
85772
+ onChange: (e2) => setValue(e2.target.value),
85773
+ className: styles$u.searchTabInput
85774
+ }), /* @__PURE__ */ jsx(iconoirSearch, {
85775
+ className: styles$u.searchTabIcon,
85776
+ color: "#C7C7C7",
85777
+ width: "30px",
85778
+ height: "30px"
85779
+ })]
85705
85780
  });
85706
85781
  };
85707
85782
  var TableIcon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDAgNTAwIj48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZTojMTgyYzYwO30uY2xzL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g2LjQzIiB3aWR0aD0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyMjQuMjMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iMjQyLjY5IiB5PSIyODYuNDMiIHdpZHRoPSI4LjQ3IiBoZWlnaHQ9IjQiLz48cmVjdCBjbGFzcz0iY2xzLTQiIHg9IjI2MC42MiIgeT0iMjg2LjQzIiB3aWR0aD0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyNzguODMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjwvZz48L3N2Zz4=";
@@ -85732,8 +85807,10 @@ const Table = ({
85732
85807
  isLoading,
85733
85808
  error: error2,
85734
85809
  tableSettings,
85735
- tableName
85810
+ tableName,
85811
+ className = ""
85736
85812
  }) => {
85813
+ var _a2, _b2, _c2, _d;
85737
85814
  const columnHelper = createColumnHelper();
85738
85815
  const columns = [];
85739
85816
  const tableData2 = (data == null ? void 0 : data.length) ? data : [];
@@ -85757,7 +85834,25 @@ const Table = ({
85757
85834
  };
85758
85835
  const [sorting, setSorting] = useState([]);
85759
85836
  const [rowSelection, setRowSelection] = useState({});
85837
+ const [rowSize, setRowSize] = useState({
85838
+ value: "25",
85839
+ label: "Show 25"
85840
+ });
85841
+ const rowSizeList = [{
85842
+ label: "Show 25",
85843
+ value: "25"
85844
+ }, {
85845
+ label: "Show 50",
85846
+ value: "50"
85847
+ }, {
85848
+ label: "Show 75",
85849
+ value: "75"
85850
+ }, {
85851
+ label: "Show 100",
85852
+ value: "100"
85853
+ }];
85760
85854
  const [globalFilter, setGlobalFilter] = useState("");
85855
+ let fetchData;
85761
85856
  if (data) {
85762
85857
  for (const key in data[0]) {
85763
85858
  const colName = key;
@@ -85767,6 +85862,13 @@ const Table = ({
85767
85862
  });
85768
85863
  columns.push(col);
85769
85864
  }
85865
+ fetchData = async (options2) => {
85866
+ await new Promise((r2) => setTimeout(r2, 500));
85867
+ return {
85868
+ rows: data.slice(options2.pageIndex * options2.pageSize, (options2.pageIndex + 1) * options2.pageSize),
85869
+ pageCount: Math.ceil(data.length / options2.pageSize)
85870
+ };
85871
+ };
85770
85872
  }
85771
85873
  const fuzzyFilter = (row2, columnId, value, addMeta) => {
85772
85874
  const itemRank = rankItem(row2.getValue(columnId), value);
@@ -85775,15 +85877,36 @@ const Table = ({
85775
85877
  });
85776
85878
  return itemRank.passed;
85777
85879
  };
85880
+ const [isHovered, setHovered] = useState("");
85881
+ const [{
85882
+ pageIndex,
85883
+ pageSize
85884
+ }, setPagination] = React__default.useState({
85885
+ pageIndex: 0,
85886
+ pageSize: 10
85887
+ });
85888
+ const fetchDataOptions = {
85889
+ pageIndex,
85890
+ pageSize
85891
+ };
85892
+ const dataQuery = useQuery(["data", fetchDataOptions], () => fetchData(fetchDataOptions), {
85893
+ keepPreviousData: true
85894
+ });
85895
+ const pagination2 = React__default.useMemo(() => ({
85896
+ pageIndex,
85897
+ pageSize
85898
+ }), [pageIndex, pageSize]);
85778
85899
  const table2 = useReactTable({
85779
- data: tableData2,
85900
+ data: (_b2 = (_a2 = dataQuery.data) == null ? void 0 : _a2.rows) != null ? _b2 : tableData2,
85780
85901
  columns,
85902
+ pageCount: (_d = (_c2 = dataQuery.data) == null ? void 0 : _c2.pageCount) != null ? _d : -1,
85781
85903
  filterFns: {
85782
85904
  fuzzy: fuzzyFilter
85783
85905
  },
85784
85906
  state: {
85785
85907
  sorting,
85786
- globalFilter
85908
+ globalFilter,
85909
+ pagination: pagination2
85787
85910
  },
85788
85911
  enableGlobalFilter: true,
85789
85912
  onRowSelectionChange: setRowSelection,
@@ -85793,11 +85916,15 @@ const Table = ({
85793
85916
  getFilteredRowModel: getFilteredRowModel(),
85794
85917
  getSortedRowModel: getSortedRowModel(),
85795
85918
  onGlobalFilterChange: setGlobalFilter,
85919
+ onPaginationChange: setPagination,
85920
+ manualPagination: true,
85796
85921
  debugTable: true
85797
85922
  });
85798
- const [isHovered, setHovered] = useState("");
85923
+ useEffect(() => {
85924
+ table2.setPageSize(Number(rowSize.value));
85925
+ }, [rowSize, table2]);
85799
85926
  return /* @__PURE__ */ jsx("div", {
85800
- className: styles$u.container,
85927
+ className: `${styles$u.container} ${className}`,
85801
85928
  children: /* @__PURE__ */ jsxs("div", {
85802
85929
  className: styles$u.previewTable,
85803
85930
  children: [/* @__PURE__ */ jsxs("div", {
@@ -85807,13 +85934,10 @@ const Table = ({
85807
85934
  variant: "h1",
85808
85935
  className: styles$u.previewText,
85809
85936
  children: tableName
85810
- }), (tableSettings == null ? void 0 : tableSettings.enableTableSearch) && /* @__PURE__ */ jsx("div", {
85811
- children: /* @__PURE__ */ jsx(DebouncedInput, {
85812
- value: globalFilter,
85813
- onChange: (value) => setGlobalFilter(String(value)),
85814
- className: styles$u.debounceInput,
85815
- placeholder: "Search"
85816
- })
85937
+ }), (tableSettings == null ? void 0 : tableSettings.enableTableSearch) && /* @__PURE__ */ jsx(DebouncedInput, {
85938
+ value: globalFilter,
85939
+ onChange: (value) => setGlobalFilter(String(value)),
85940
+ placeholder: "Search"
85817
85941
  })]
85818
85942
  }), /* @__PURE__ */ jsxs("div", {
85819
85943
  className: styles$u.tableData,
@@ -85826,58 +85950,60 @@ const Table = ({
85826
85950
  color: "blue"
85827
85951
  }
85828
85952
  })
85829
- }), !!(data == null ? void 0 : data.length) && !isLoading && /* @__PURE__ */ jsxs("table", {
85830
- className: styles$u.table,
85831
- children: [/* @__PURE__ */ jsx("thead", {
85832
- children: table2.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
85833
- className: styles$u.row,
85834
- children: headerGroup.headers.map((header2) => {
85835
- var _a2;
85836
- return /* @__PURE__ */ jsx("th", {
85837
- className: styles$u.tableHeadCol,
85838
- colSpan: header2.colSpan,
85839
- children: (tableSettings == null ? void 0 : tableSettings.enableSorting) ? /* @__PURE__ */ jsx("div", {
85840
- className: header2.column.getCanSort() ? styles$u.sortButton : "",
85841
- onClick: header2.column.getToggleSortingHandler(),
85842
- onMouseOver: () => setHovered(header2.id),
85843
- onMouseOut: () => setHovered(""),
85844
- children: header2.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", {
85845
- style: headerStyle,
85846
- children: [flexRender(header2.column.columnDef.header, header2.getContext()), /* @__PURE__ */ jsx("div", {
85847
- className: isHovered === header2.id ? styles$u.showSort : styles$u.noSort,
85848
- children: (_a2 = {
85849
- asc: " \u{1F53C}",
85850
- desc: " \u{1F53D}"
85851
- }[header2.column.getIsSorted()]) != null ? _a2 : null
85852
- })]
85853
- })
85854
- }) : /* @__PURE__ */ jsx(Fragment, {
85855
- children: header2.isPlaceholder ? null : /* @__PURE__ */ jsx("div", {
85856
- style: headerStyle,
85857
- children: flexRender(header2.column.columnDef.header, header2.getContext())
85953
+ }), !!(data == null ? void 0 : data.length) && !isLoading && /* @__PURE__ */ jsx(Fragment, {
85954
+ children: /* @__PURE__ */ jsxs("table", {
85955
+ className: styles$u.table,
85956
+ children: [/* @__PURE__ */ jsx("thead", {
85957
+ children: table2.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
85958
+ className: styles$u.row,
85959
+ children: headerGroup.headers.map((header2) => {
85960
+ var _a3;
85961
+ return /* @__PURE__ */ jsx("th", {
85962
+ className: styles$u.tableHeadCol,
85963
+ colSpan: header2.colSpan,
85964
+ children: (tableSettings == null ? void 0 : tableSettings.enableSorting) ? /* @__PURE__ */ jsx("div", {
85965
+ className: header2.column.getCanSort() ? styles$u.sortButton : "",
85966
+ onClick: header2.column.getToggleSortingHandler(),
85967
+ onMouseOver: () => setHovered(header2.id),
85968
+ onMouseOut: () => setHovered(""),
85969
+ children: header2.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", {
85970
+ style: headerStyle,
85971
+ children: [flexRender(header2.column.columnDef.header, header2.getContext()), /* @__PURE__ */ jsx("div", {
85972
+ className: isHovered === header2.id ? styles$u.showSort : styles$u.noSort,
85973
+ children: (_a3 = {
85974
+ asc: " \u{1F53C}",
85975
+ desc: " \u{1F53D}"
85976
+ }[header2.column.getIsSorted()]) != null ? _a3 : null
85977
+ })]
85978
+ })
85979
+ }) : /* @__PURE__ */ jsx(Fragment, {
85980
+ children: header2.isPlaceholder ? null : /* @__PURE__ */ jsx("div", {
85981
+ style: headerStyle,
85982
+ children: flexRender(header2.column.columnDef.header, header2.getContext())
85983
+ })
85858
85984
  })
85859
- })
85860
- }, header2.id);
85861
- })
85862
- }, headerGroup.id))
85863
- }), /* @__PURE__ */ jsx("tbody", {
85864
- children: table2.getRowModel().rows.map((row2) => /* @__PURE__ */ jsx("tr", {
85865
- className: `${styles$u.tableRow} ${(tableSettings == null ? void 0 : tableSettings.showRowHover) ? styles$u.rowHover : ""} ${(tableSettings == null ? void 0 : tableSettings.enableStripedRows) && row2.id % 2 !== 0 ? styles$u.stripedRow : ""}`,
85866
- children: row2.getVisibleCells().map((cell) => /* @__PURE__ */ jsxs("td", {
85867
- className: `${styles$u.tableRowCol} ${!(tableSettings == null ? void 0 : tableSettings.hideVerticalDivider) ? styles$u.rightBorder : ""}`,
85868
- children: [!!tableSettings && /* @__PURE__ */ jsx("div", {
85869
- style: divStyle,
85870
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
85871
- }), !tableSettings && /* @__PURE__ */ jsx("div", {
85872
- style: {
85873
- textAlign: "center",
85874
- width: "100%"
85875
- },
85876
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
85877
- })]
85878
- }, cell.id))
85879
- }, row2.id))
85880
- })]
85985
+ }, header2.id);
85986
+ })
85987
+ }, headerGroup.id))
85988
+ }), /* @__PURE__ */ jsx("tbody", {
85989
+ children: table2.getRowModel().rows.map((row2) => /* @__PURE__ */ jsx("tr", {
85990
+ className: `${styles$u.tableRow} ${(tableSettings == null ? void 0 : tableSettings.showRowHover) ? styles$u.rowHover : ""} ${(tableSettings == null ? void 0 : tableSettings.enableStripedRows) && Number(row2.id) % 2 !== 0 ? styles$u.stripedRow : ""}`,
85991
+ children: row2.getVisibleCells().map((cell) => /* @__PURE__ */ jsxs("td", {
85992
+ className: `${styles$u.tableRowCol} ${!(tableSettings == null ? void 0 : tableSettings.hideVerticalDivider) ? styles$u.rightBorder : ""}`,
85993
+ children: [!!tableSettings && /* @__PURE__ */ jsx("div", {
85994
+ style: divStyle,
85995
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
85996
+ }), !tableSettings && /* @__PURE__ */ jsx("div", {
85997
+ style: {
85998
+ textAlign: "center",
85999
+ width: "100%"
86000
+ },
86001
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
86002
+ })]
86003
+ }, cell.id))
86004
+ }, row2.id))
86005
+ })]
86006
+ })
85881
86007
  }), !(data == null ? void 0 : data.length) && !isLoading && !error2.length && /* @__PURE__ */ jsxs("div", {
85882
86008
  className: styles$u.noData,
85883
86009
  children: [/* @__PURE__ */ jsx("img", {
@@ -85905,6 +86031,37 @@ const Table = ({
85905
86031
  children: error2
85906
86032
  })
85907
86033
  })]
86034
+ }), data && /* @__PURE__ */ jsxs("div", {
86035
+ className: styles$u.pagination,
86036
+ children: [/* @__PURE__ */ jsx("div", {
86037
+ className: styles$u.rowStyle,
86038
+ children: /* @__PURE__ */ jsx(FloatingDropDown, {
86039
+ onChange: setRowSize,
86040
+ selectedOption: rowSize,
86041
+ options: rowSizeList,
86042
+ labelVariant: "static",
86043
+ dropdownAbove: true,
86044
+ buttonClass: styles$u.rowsDropdown
86045
+ })
86046
+ }), /* @__PURE__ */ jsxs("span", {
86047
+ className: styles$u.pageStyle,
86048
+ children: [table2.getState().pagination.pageSize * table2.getState().pagination.pageIndex + 1, "-", data.length <= table2.getState().pagination.pageSize * (table2.getState().pagination.pageIndex + 1) ? data.length : table2.getState().pagination.pageSize * (table2.getState().pagination.pageIndex + 1), " ", "of ", data.length]
86049
+ }), /* @__PURE__ */ jsxs("div", {
86050
+ className: styles$u.buttonContainer,
86051
+ children: [/* @__PURE__ */ jsx(Button, {
86052
+ variant: "custom",
86053
+ className: styles$u.button,
86054
+ onClick: () => table2.previousPage(),
86055
+ disabled: !table2.getCanPreviousPage(),
86056
+ children: "Prev"
86057
+ }), /* @__PURE__ */ jsx(Button, {
86058
+ variant: "custom",
86059
+ className: styles$u.button,
86060
+ onClick: () => table2.nextPage(),
86061
+ disabled: !table2.getCanNextPage(),
86062
+ children: "Next"
86063
+ })]
86064
+ })]
85908
86065
  })]
85909
86066
  })
85910
86067
  });
@@ -86853,13 +87010,13 @@ var styles$o = {
86853
87010
  };
86854
87011
  const container$7 = "_container_u2z1d_1";
86855
87012
  const header$3 = "_header_u2z1d_9";
86856
- const wrapper$2 = "_wrapper_u2z1d_17";
87013
+ const wrapper$1 = "_wrapper_u2z1d_17";
86857
87014
  const column = "_column_u2z1d_33";
86858
87015
  const columnText$1 = "_columnText_u2z1d_41";
86859
87016
  var styles$n = {
86860
87017
  container: container$7,
86861
87018
  header: header$3,
86862
- wrapper: wrapper$2,
87019
+ wrapper: wrapper$1,
86863
87020
  "col-container": "_col-container_u2z1d_25",
86864
87021
  column,
86865
87022
  columnText: columnText$1
@@ -88237,40 +88394,33 @@ const ChartTab = ({
88237
88394
  })]
88238
88395
  });
88239
88396
  };
88240
- const container$5 = "_container_wjdaz_1";
88241
- const wrapper$1 = "_wrapper_wjdaz_9";
88242
- const text = "_text_wjdaz_17";
88243
- const table$2 = "_table_wjdaz_23";
88397
+ const container$5 = "_container_1r4rr_1";
88244
88398
  var styles$i = {
88245
- container: container$5,
88246
- wrapper: wrapper$1,
88247
- text,
88248
- table: table$2
88399
+ container: container$5
88249
88400
  };
88250
88401
  const InputTables = ({
88251
88402
  previewTableDataList
88252
88403
  }) => {
88253
88404
  return /* @__PURE__ */ jsx("div", {
88254
88405
  className: styles$i.container,
88255
- children: /* @__PURE__ */ jsx("div", {
88256
- className: styles$i.wrapper,
88257
- children: previewTableDataList == null ? void 0 : previewTableDataList.map((table2) => /* @__PURE__ */ jsxs("div", {
88258
- className: styles$i.text,
88259
- children: [/* @__PURE__ */ jsx(Text, {
88260
- variant: "h1",
88261
- styleClass: "primary",
88262
- className: "",
88263
- children: table2.name
88264
- }), /* @__PURE__ */ jsx("div", {
88265
- className: styles$i.table,
88266
- children: /* @__PURE__ */ jsx(Table, {
88267
- data: table2.data,
88268
- error: table2.isError,
88269
- isLoading: false
88270
- })
88271
- })]
88272
- }, table2.name))
88273
- })
88406
+ children: previewTableDataList == null ? void 0 : previewTableDataList.map((table2) => /* @__PURE__ */ jsx(Table, {
88407
+ data: table2.data,
88408
+ error: table2.isError,
88409
+ isLoading: false,
88410
+ tableName: table2.name,
88411
+ tableSettings: {
88412
+ showTableTitle: true,
88413
+ hideVerticalDivider: false,
88414
+ showRowHover: false,
88415
+ enableStripedRows: false,
88416
+ enableTableSearch: false,
88417
+ contentAlignment: "center",
88418
+ enableFilter: false,
88419
+ enableSorting: false,
88420
+ lineGap: "",
88421
+ showTableDesc: false
88422
+ }
88423
+ }, table2.name))
88274
88424
  });
88275
88425
  };
88276
88426
  const container$4 = "_container_127xg_1";
@@ -120050,7 +120200,7 @@ var GridItem = /* @__PURE__ */ function(_React$Component) {
120050
120200
  }, {
120051
120201
  key: "mixinResizable",
120052
120202
  value: function mixinResizable(child, position2, isResizable) {
120053
- var _this$props6 = this.props, cols = _this$props6.cols, x2 = _this$props6.x, minW2 = _this$props6.minW, minH2 = _this$props6.minH, maxW2 = _this$props6.maxW, maxH2 = _this$props6.maxH, transformScale = _this$props6.transformScale, resizeHandles = _this$props6.resizeHandles, resizeHandle = _this$props6.resizeHandle;
120203
+ var _this$props6 = this.props, cols = _this$props6.cols, x2 = _this$props6.x, minW2 = _this$props6.minW, minH2 = _this$props6.minH, maxW2 = _this$props6.maxW, maxH2 = _this$props6.maxH, transformScale = _this$props6.transformScale, resizeHandles = _this$props6.resizeHandles, resizeHandle2 = _this$props6.resizeHandle;
120054
120204
  var positionParams = this.getPositionParams();
120055
120205
  var maxWidth = (0, _calculateUtils$1.calcGridItemPosition)(positionParams, 0, 0, cols - x2, 0).width;
120056
120206
  var mins = (0, _calculateUtils$1.calcGridItemPosition)(positionParams, 0, 0, minW2, minH2);
@@ -120073,7 +120223,7 @@ var GridItem = /* @__PURE__ */ function(_React$Component) {
120073
120223
  onResize: this.onResize,
120074
120224
  transformScale,
120075
120225
  resizeHandles,
120076
- handle: resizeHandle
120226
+ handle: resizeHandle2
120077
120227
  },
120078
120228
  child
120079
120229
  );
@@ -120790,7 +120940,7 @@ var ReactGridLayout = /* @__PURE__ */ function(_React$Component) {
120790
120940
  var l2 = (0, _utils$2.getLayoutItem)(this.state.layout, String(child.key));
120791
120941
  if (!l2)
120792
120942
  return null;
120793
- var _this$props8 = this.props, width = _this$props8.width, cols = _this$props8.cols, margin = _this$props8.margin, containerPadding = _this$props8.containerPadding, rowHeight = _this$props8.rowHeight, maxRows = _this$props8.maxRows, isDraggable = _this$props8.isDraggable, isResizable = _this$props8.isResizable, isBounded = _this$props8.isBounded, useCSSTransforms = _this$props8.useCSSTransforms, transformScale = _this$props8.transformScale, draggableCancel = _this$props8.draggableCancel, draggableHandle = _this$props8.draggableHandle, resizeHandles = _this$props8.resizeHandles, resizeHandle = _this$props8.resizeHandle;
120943
+ var _this$props8 = this.props, width = _this$props8.width, cols = _this$props8.cols, margin = _this$props8.margin, containerPadding = _this$props8.containerPadding, rowHeight = _this$props8.rowHeight, maxRows = _this$props8.maxRows, isDraggable = _this$props8.isDraggable, isResizable = _this$props8.isResizable, isBounded = _this$props8.isBounded, useCSSTransforms = _this$props8.useCSSTransforms, transformScale = _this$props8.transformScale, draggableCancel = _this$props8.draggableCancel, draggableHandle = _this$props8.draggableHandle, resizeHandles = _this$props8.resizeHandles, resizeHandle2 = _this$props8.resizeHandle;
120794
120944
  var _this$state3 = this.state, mounted = _this$state3.mounted, droppingPosition = _this$state3.droppingPosition;
120795
120945
  var draggable = typeof l2.isDraggable === "boolean" ? l2.isDraggable : !l2.static && isDraggable;
120796
120946
  var resizable2 = typeof l2.isResizable === "boolean" ? l2.isResizable : !l2.static && isResizable;
@@ -120829,7 +120979,7 @@ var ReactGridLayout = /* @__PURE__ */ function(_React$Component) {
120829
120979
  static: l2.static,
120830
120980
  droppingPosition: isDroppingItem ? droppingPosition : void 0,
120831
120981
  resizeHandles: resizeHandlesOptions,
120832
- resizeHandle
120982
+ resizeHandle: resizeHandle2
120833
120983
  }, child);
120834
120984
  }
120835
120985
  }, {
@@ -121626,48 +121776,69 @@ function WidthProvideRGL(ComposedComponent) {
121626
121776
  module.exports.WidthProvider = WidthProvider.default;
121627
121777
  })(reactGridLayout);
121628
121778
  var styles$c = "";
121629
- const fullscreen$2 = "_fullscreen_1en1r_49";
121779
+ const resizeHandle = "_resizeHandle_170un_17";
121780
+ const fullscreen$2 = "_fullscreen_170un_57";
121630
121781
  var styles$b = {
121631
- "MetricList-container": "_MetricList-container_1en1r_1",
121632
- "MetricList-wrapper": "_MetricList-wrapper_1en1r_9",
121633
- "MetricList-wrapper-move": "_MetricList-wrapper-move_1en1r_17",
121634
- "noMetric-container": "_noMetric-container_1en1r_25",
121635
- "noMetric-wrapper": "_noMetric-wrapper_1en1r_33",
121636
- "alt-container": "_alt-container_1en1r_41",
121782
+ "MetricList-container": "_MetricList-container_170un_1",
121783
+ "MetricList-wrapper": "_MetricList-wrapper_170un_9",
121784
+ resizeHandle,
121785
+ "MetricList-wrapper-move": "_MetricList-wrapper-move_170un_25",
121786
+ "noMetric-container": "_noMetric-container_170un_33",
121787
+ "noMetric-wrapper": "_noMetric-wrapper_170un_41",
121788
+ "alt-container": "_alt-container_170un_49",
121637
121789
  fullscreen: fullscreen$2
121638
121790
  };
121639
- const cardContainer = "_cardContainer_1u57p_1";
121640
- const listHeader = "_listHeader_1u57p_9";
121641
- const metricName = "_metricName_1u57p_17";
121642
- const metricTitle = "_metricTitle_1u57p_25";
121643
- const metricDescription = "_metricDescription_1u57p_33";
121644
- const popup = "_popup_1u57p_41";
121645
- const metricFilter$1 = "_metricFilter_1u57p_49";
121646
- const popupIcon = "_popupIcon_1u57p_57";
121647
- const popupMenu = "_popupMenu_1u57p_65";
121648
- const popupItem = "_popupItem_1u57p_73";
121649
- const popupItemIcon = "_popupItemIcon_1u57p_81";
121650
- const csvBtn = "_csvBtn_1u57p_89";
121651
- const deleteBtn = "_deleteBtn_1u57p_97";
121652
- const metricData = "_metricData_1u57p_105";
121653
- const singleValueData = "_singleValueData_1u57p_113";
121654
- const singleValue = "_singleValue_1u57p_113";
121655
- const noData = "_noData_1u57p_129";
121656
- const noDataContent = "_noDataContent_1u57p_137";
121657
- const noDataText = "_noDataText_1u57p_145";
121658
- const loading$1 = "_loading_1u57p_153";
121659
- const features = "_features_1u57p_161";
121660
- const fullscreen$1 = "_fullscreen_1u57p_169";
121661
- const deleteModal = "_deleteModal_1u57p_177";
121662
- const cancelBtn = "_cancelBtn_1u57p_185";
121663
- const warningIcon = "_warningIcon_1u57p_193";
121664
- const downloadCsv = "_downloadCsv_1u57p_201";
121665
- const downloadCsvWrapper = "_downloadCsvWrapper_1u57p_209";
121666
- const downloadCsvHeader = "_downloadCsvHeader_1u57p_215";
121667
- const downloadCsvFooter = "_downloadCsvFooter_1u57p_221";
121668
- const downloadCsvCancelBtn = "_downloadCsvCancelBtn_1u57p_229";
121669
- const downloadCsvNote = "_downloadCsvNote_1u57p_237";
121670
- const downloadCsvNoteText = "_downloadCsvNoteText_1u57p_245";
121791
+ const cardContainer = "_cardContainer_1qrhu_1";
121792
+ const listHeader = "_listHeader_1qrhu_9";
121793
+ const metricName = "_metricName_1qrhu_17";
121794
+ const metricTitle = "_metricTitle_1qrhu_25";
121795
+ const metricDescription = "_metricDescription_1qrhu_33";
121796
+ const popup = "_popup_1qrhu_41";
121797
+ const metricFilter$1 = "_metricFilter_1qrhu_49";
121798
+ const popupIcon = "_popupIcon_1qrhu_57";
121799
+ const popupMenu = "_popupMenu_1qrhu_65";
121800
+ const popupItem = "_popupItem_1qrhu_73";
121801
+ const popupItemIcon = "_popupItemIcon_1qrhu_81";
121802
+ const csvBtn = "_csvBtn_1qrhu_89";
121803
+ const deleteBtn = "_deleteBtn_1qrhu_97";
121804
+ const metricData = "_metricData_1qrhu_105";
121805
+ const metricTable = "_metricTable_1qrhu_113";
121806
+ const singleValueData = "_singleValueData_1qrhu_121";
121807
+ const singleValue = "_singleValue_1qrhu_121";
121808
+ const noData = "_noData_1qrhu_137";
121809
+ const noDataContent = "_noDataContent_1qrhu_145";
121810
+ const noDataText = "_noDataText_1qrhu_153";
121811
+ const loading$1 = "_loading_1qrhu_161";
121812
+ const features = "_features_1qrhu_169";
121813
+ const fullscreen$1 = "_fullscreen_1qrhu_177";
121814
+ const deleteModal = "_deleteModal_1qrhu_185";
121815
+ const cancelBtn = "_cancelBtn_1qrhu_193";
121816
+ const warningIcon = "_warningIcon_1qrhu_201";
121817
+ const downloadCsv = "_downloadCsv_1qrhu_209";
121818
+ const downloadCsvWrapper = "_downloadCsvWrapper_1qrhu_217";
121819
+ const downloadCsvHeader = "_downloadCsvHeader_1qrhu_225";
121820
+ const downloadCsvFooter = "_downloadCsvFooter_1qrhu_233";
121821
+ const downloadCsvCancelBtn = "_downloadCsvCancelBtn_1qrhu_241";
121822
+ const downloadCsvNote = "_downloadCsvNote_1qrhu_249";
121823
+ const downloadCsvExpiredNote = "_downloadCsvExpiredNote_1qrhu_257";
121824
+ const downloadCsvNoteText = "_downloadCsvNoteText_1qrhu_263";
121825
+ const downloadUrlTimeline = "_downloadUrlTimeline_1qrhu_287";
121826
+ const timeLineItem = "_timeLineItem_1qrhu_295";
121827
+ const timeLineActiveIcon = "_timeLineActiveIcon_1qrhu_303";
121828
+ const timeLineIcon = "_timeLineIcon_1qrhu_311";
121829
+ const timeLineItemline = "_timeLineItemline_1qrhu_319";
121830
+ const downloadCsvLoading = "_downloadCsvLoading_1qrhu_327";
121831
+ const downloadCsvLoadingIcon = "_downloadCsvLoadingIcon_1qrhu_335";
121832
+ const downloadCsvLoadingText = "_downloadCsvLoadingText_1qrhu_343";
121833
+ const timeLineCheckedIcon = "_timeLineCheckedIcon_1qrhu_351";
121834
+ const timeLineCheckedIconWrapper = "_timeLineCheckedIconWrapper_1qrhu_359";
121835
+ const downloadCsvBackBtnWrapper = "_downloadCsvBackBtnWrapper_1qrhu_367";
121836
+ const downloadCsvBackBtnText = "_downloadCsvBackBtnText_1qrhu_375";
121837
+ const downloadCsvHeaderText = "_downloadCsvHeaderText_1qrhu_397";
121838
+ const downloadCsvTabContainer = "_downloadCsvTabContainer_1qrhu_405";
121839
+ const downloadCsvActiveTab = "_downloadCsvActiveTab_1qrhu_413";
121840
+ const downloadCsvTab = "_downloadCsvTab_1qrhu_405";
121841
+ const downloadCsvActiveTabText = "_downloadCsvActiveTabText_1qrhu_429";
121671
121842
  var styles$a = {
121672
121843
  cardContainer,
121673
121844
  listHeader,
@@ -121683,6 +121854,7 @@ var styles$a = {
121683
121854
  csvBtn,
121684
121855
  deleteBtn,
121685
121856
  metricData,
121857
+ metricTable,
121686
121858
  singleValueData,
121687
121859
  singleValue,
121688
121860
  noData,
@@ -121700,9 +121872,27 @@ var styles$a = {
121700
121872
  downloadCsvFooter,
121701
121873
  downloadCsvCancelBtn,
121702
121874
  downloadCsvNote,
121875
+ downloadCsvExpiredNote,
121703
121876
  downloadCsvNoteText,
121704
- "tab-border-bottom": "_tab-border-bottom_1u57p_253",
121705
- "download-info-text": "_download-info-text_1u57p_261"
121877
+ "tab-border-bottom": "_tab-border-bottom_1qrhu_271",
121878
+ "download-info-text": "_download-info-text_1qrhu_279",
121879
+ downloadUrlTimeline,
121880
+ timeLineItem,
121881
+ timeLineActiveIcon,
121882
+ timeLineIcon,
121883
+ timeLineItemline,
121884
+ downloadCsvLoading,
121885
+ downloadCsvLoadingIcon,
121886
+ downloadCsvLoadingText,
121887
+ timeLineCheckedIcon,
121888
+ timeLineCheckedIconWrapper,
121889
+ downloadCsvBackBtnWrapper,
121890
+ downloadCsvBackBtnText,
121891
+ downloadCsvHeaderText,
121892
+ downloadCsvTabContainer,
121893
+ downloadCsvActiveTab,
121894
+ downloadCsvTab,
121895
+ downloadCsvActiveTabText
121706
121896
  };
121707
121897
  var NoData = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMzAwIj48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZTojMTgyYzYwO30uY2xzLTEsLmNscy0ye2ZpbGw6bm9uZTtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7fS5jbHMtM3tmaWxsOiM1ODY1ZjY7b3BhY2l0eTouMTt9LmNscy00e2ZpbGw6I2YyZjNmNDt9LmNscy01e2ZpbGw6I2MxYzdjOTt9LmNscy02e2ZpbGw6I2RhZGVkZjt9LmNscy03e2ZpbGw6IzE4MmM2MDt9LmNscy0ye3N0cm9rZTojNTg2NWY2O3N0cm9rZS13aWR0aDo0cHg7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0ibTIxMC41LDIwMC44M2MuNC0uNjYuNjgtMS40LjgyLTIuMiwxLjU4LTguODcsMy4xNS0xNy43NSw0LjczLTI2LjYyLDIuMDMtMTEuNDQsNC4wNi0yMi44OCw2LjA5LTM0LjMyLjcyLTQuMDgsMS43Ny04LjI1LDIuMTYtMTIuMzguNDMtNC41Ni0yLjA5LTkuNjgtNi44Ni0xMC42Ni0uMDEsMC0uMDMsMC0uMDQsMC0yLjQtLjQ5LTUuMDItLjIyLTcuNDUtLjIyaC00NC4yMmMtLjUyLDAtMi4zMy0uMzEtMi43NywwbC0yNC4yOCwxNy4yMmgtNjEuNjFjLTMuOTcsMC02Ljk5LDMuNTYtNi4zNCw3LjQ3bDkuN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MjA4LjczIDE0OC40OCAyMDguODggOTAuOTUgMjA5LjAyIDg5LjUgMjA4LjY2IDg3Ljk4IDIwNy45MiA4Ni44MiAyMDYuNTggODYuMDEgMjA1LjAzIDg1LjY4IDIwMy45MyIvPjwvc3ZnPg==";
121708
121898
  const materialSymbolsArchiveOutline = (props) => /* @__PURE__ */ jsx("svg", {
@@ -122491,7 +122681,7 @@ const MetricCard = ({
122491
122681
  variant: "custom",
122492
122682
  type: "button",
122493
122683
  className: `${styles$a.popupItem} ${styles$a.csvBtn}`,
122494
- onClick: () => onDownloadRawCsv(metricItem),
122684
+ onClick: () => onDownloadRawCsv(metricItem, filterValues2),
122495
122685
  children: [/* @__PURE__ */ jsx(Icons, {
122496
122686
  name: "csv-icon",
122497
122687
  className: styles$a.popupItemIcon
@@ -122516,11 +122706,8 @@ const MetricCard = ({
122516
122706
  })]
122517
122707
  })]
122518
122708
  })]
122519
- }), (drillDownSettings == null ? void 0 : drillDownSettings.isEnableGroupBy) && /* @__PURE__ */ jsx(DrillBreadCrumb, {
122520
- dimensions: drillDownSettings.selectedDimensions,
122521
- drilledLevel
122522
122709
  }), chartType2 && /* @__PURE__ */ jsxs("div", {
122523
- className: styles$a.metricData,
122710
+ className: `${styles$a.metricData} ${chartType2 === "table" ? styles$a.metricTable : ""}`,
122524
122711
  onContextMenu: (e2) => {
122525
122712
  e2.preventDefault();
122526
122713
  },
@@ -122547,6 +122734,9 @@ const MetricCard = ({
122547
122734
  color: "blue"
122548
122735
  }
122549
122736
  })
122737
+ }), (drillDownSettings == null ? void 0 : drillDownSettings.isEnableGroupBy) && /* @__PURE__ */ jsx(DrillBreadCrumb, {
122738
+ dimensions: drillDownSettings.selectedDimensions,
122739
+ drilledLevel
122550
122740
  }), (chartParams == null ? void 0 : chartParams.name) && columnName && /* @__PURE__ */ jsx(ChartPopup$1, {
122551
122741
  isOpen: isShowChartPopup,
122552
122742
  setOpen: setShowChartPopup,
@@ -122981,6 +123171,12 @@ const LayoutAlert = ({
122981
123171
  })
122982
123172
  });
122983
123173
  };
123174
+ const DashboardContext = createContext({
123175
+ isLoading: void 0,
123176
+ data: void 0,
123177
+ token: void 0
123178
+ });
123179
+ const useDashboardContext = () => useContext(DashboardContext);
122984
123180
  const timeAgo = (unixTimestamp) => {
122985
123181
  const now = Date.now();
122986
123182
  const diff2 = now - unixTimestamp;
@@ -123018,12 +123214,22 @@ const getSqlStatement = ({
123018
123214
  });
123019
123215
  return replacedStr;
123020
123216
  };
123021
- const useDownloadRawCsv = (onCloseModal, metricItem) => {
123217
+ const useDownloadRawCsv = (onCloseModal, metricItem, filterValues2) => {
123218
+ var _a2, _b2;
123219
+ const queryClient2 = useQueryClient();
123220
+ const { data } = useDashboardContext();
123221
+ const { data: rawCsvSettingsData } = useRawCsvSettingsQuery(
123222
+ {
123223
+ id: (_a2 = data == null ? void 0 : data.workspace) == null ? void 0 : _a2.id
123224
+ },
123225
+ { enabled: !!((_b2 = data == null ? void 0 : data.workspace) == null ? void 0 : _b2.id) }
123226
+ );
123022
123227
  const [csvDownloadUrlError, setCsvDownloadUrlError] = useState("");
123023
123228
  const [isLoading, setLoading] = useState(false);
123024
123229
  const [downloadCsvError, setError] = useState("");
123025
123230
  const { mutate } = useRawCsvMutation();
123026
123231
  const { mutate: invokeSaveRawCsvDetailsMutation } = useInvokeSaveRawCsvDetailsMutation();
123232
+ const { mutate: updateCsvDownloadStatus } = useUpdateCsvDownloadStatusMutation();
123027
123233
  const { handleSubmit, register: register2 } = useForm();
123028
123234
  const { data: RawCsvUrlsData } = useExternalMetricRawCsvUrlsQuery(
123029
123235
  { externalMetricId: metricItem == null ? void 0 : metricItem.id },
@@ -123035,7 +123241,7 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123035
123241
  const expires = parseInt(params.get("Expires"), 10);
123036
123242
  const currentTime = Math.floor(Date.now() / 1e3);
123037
123243
  const secondsLeft = expires - currentTime;
123038
- return { isExpired: currentTime > expires, secondsLeft };
123244
+ return { isExpired: currentTime >= expires, secondsLeft };
123039
123245
  };
123040
123246
  const getUrls = (urls) => {
123041
123247
  try {
@@ -123044,18 +123250,27 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123044
123250
  return [];
123045
123251
  }
123046
123252
  };
123253
+ const rawCsvSettings = useMemo(
123254
+ () => {
123255
+ var _a3, _b3;
123256
+ return {
123257
+ expireTimeInMin: ((_b3 = (_a3 = rawCsvSettingsData == null ? void 0 : rawCsvSettingsData.companyWorkspaces_by_pk) == null ? void 0 : _a3.rawCsvSettings) == null ? void 0 : _b3.expireTimeInMin) || 30
123258
+ };
123259
+ },
123260
+ [rawCsvSettingsData]
123261
+ );
123047
123262
  const csvDownloadUrls = useMemo(() => {
123048
- var _a2;
123049
- if ((_a2 = RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls) == null ? void 0 : _a2.length) {
123050
- const urls = getUrls(RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls[0].urls);
123263
+ if (RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls.length) {
123264
+ const urls = getUrls(RawCsvUrlsData.externalMetricRawCsvUrls[0].urls);
123051
123265
  return {
123052
123266
  urls,
123053
123267
  lastUpdatedAt: timeAgo(
123054
- Date.parse(RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls[0].lastUpdatedAt)
123268
+ Date.parse(RawCsvUrlsData.externalMetricRawCsvUrls[0].lastUpdatedAt)
123055
123269
  ),
123056
123270
  isExpired: urls.length ? isLinkExpired(urls[0]).isExpired : true,
123057
- error: RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls[0].error,
123058
- expireUrlIn: urls.length ? isLinkExpired(urls[0]).secondsLeft : 0
123271
+ error: RawCsvUrlsData.externalMetricRawCsvUrls[0].error,
123272
+ expireUrlIn: urls.length ? isLinkExpired(urls[0]).secondsLeft : 0,
123273
+ status: RawCsvUrlsData.externalMetricRawCsvUrls[0].requestStatus
123059
123274
  };
123060
123275
  }
123061
123276
  return {
@@ -123063,7 +123278,8 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123063
123278
  lastUpdatedAt: 0,
123064
123279
  isExpired: true,
123065
123280
  error: null,
123066
- expireUrlIn: 0
123281
+ expireUrlIn: 0,
123282
+ status: "NONE"
123067
123283
  };
123068
123284
  }, [RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls]);
123069
123285
  const handleDownload = (url) => {
@@ -123106,7 +123322,7 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123106
123322
  query: sqlQuery,
123107
123323
  clientName,
123108
123324
  tenancyType,
123109
- values
123325
+ values: filterValues2
123110
123326
  });
123111
123327
  mutate(
123112
123328
  {
@@ -123117,10 +123333,9 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123117
123333
  workspaceId
123118
123334
  },
123119
123335
  {
123120
- onSuccess(data) {
123121
- var _a2, _b2;
123122
- const success2 = (_a2 = data.sendRawCsv) == null ? void 0 : _a2.status;
123123
- const error2 = (_b2 = data.sendRawCsv) == null ? void 0 : _b2.error;
123336
+ onSuccess({ sendRawCsv }) {
123337
+ const success2 = sendRawCsv == null ? void 0 : sendRawCsv.status;
123338
+ const error2 = sendRawCsv == null ? void 0 : sendRawCsv.error;
123124
123339
  if (success2) {
123125
123340
  setError("");
123126
123341
  setLoading(false);
@@ -123137,17 +123352,17 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123137
123352
  );
123138
123353
  };
123139
123354
  const saveRawCsvDetails = ({
123140
- values,
123141
123355
  clientName,
123142
- tenancyType
123356
+ tenancyType,
123357
+ expirationMinutes,
123358
+ onSuccess
123143
123359
  }) => {
123144
- setLoading(true);
123145
- setError("");
123360
+ const expirationDate = new Date(Date.now() + expirationMinutes * 60 * 1e3);
123146
123361
  invokeSaveRawCsvDetailsMutation(
123147
123362
  {
123148
- configurations: { metricItem, fieldValues: values },
123149
- expireCsvFileAt: values.expireCsvFileAt,
123150
- expireUrlIn: parseInt(values.expireUrlIn, 10),
123363
+ configurations: { metricItem },
123364
+ expireCsvFileAt: expirationDate,
123365
+ expireUrlIn: expirationMinutes * 60,
123151
123366
  externalMetricId: metricItem == null ? void 0 : metricItem.id,
123152
123367
  integrationId: metricItem == null ? void 0 : metricItem.companyIntegrationId,
123153
123368
  integrationName: metricItem == null ? void 0 : metricItem.integrationName,
@@ -123155,13 +123370,15 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123155
123370
  query: metricItem == null ? void 0 : metricItem.query,
123156
123371
  clientName,
123157
123372
  tenancyType,
123158
- values
123373
+ values: filterValues2
123159
123374
  })
123160
123375
  },
123161
123376
  {
123162
123377
  onSuccess({ invokeSaveRawCsvDetails }) {
123163
123378
  if (invokeSaveRawCsvDetails == null ? void 0 : invokeSaveRawCsvDetails.statusCode) {
123164
123379
  setLoading(false);
123380
+ setError("");
123381
+ onSuccess();
123165
123382
  onCloseModal(false);
123166
123383
  } else if (invokeSaveRawCsvDetails == null ? void 0 : invokeSaveRawCsvDetails.error) {
123167
123384
  setLoading(false);
@@ -123178,6 +123395,65 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123178
123395
  }
123179
123396
  );
123180
123397
  };
123398
+ const onRequestToDownload = ({
123399
+ clientName,
123400
+ tenancyType,
123401
+ requestStatus
123402
+ }) => {
123403
+ setLoading(true);
123404
+ setError("");
123405
+ const expirationMinutes = rawCsvSettings.expireTimeInMin || 30;
123406
+ updateCsvDownloadStatus(
123407
+ {
123408
+ configurations: metricItem,
123409
+ expireUrlIn: expirationMinutes * 60,
123410
+ externalMetricId: metricItem == null ? void 0 : metricItem.id,
123411
+ requestStatus,
123412
+ urls: "[]"
123413
+ },
123414
+ {
123415
+ onSuccess({ insert_externalMetricRawCsvUrls_one }) {
123416
+ if (insert_externalMetricRawCsvUrls_one == null ? void 0 : insert_externalMetricRawCsvUrls_one.id) {
123417
+ saveRawCsvDetails({
123418
+ expirationMinutes,
123419
+ clientName,
123420
+ tenancyType,
123421
+ onSuccess: () => {
123422
+ queryClient2.setQueryData(
123423
+ [
123424
+ "ExternalMetricRawCsvUrls",
123425
+ { externalMetricId: metricItem == null ? void 0 : metricItem.id }
123426
+ ],
123427
+ (prev) => {
123428
+ const prevExternalMetricRawCsvUrls = prev == null ? void 0 : prev.externalMetricRawCsvUrls;
123429
+ const index2 = prevExternalMetricRawCsvUrls == null ? void 0 : prevExternalMetricRawCsvUrls.findIndex(
123430
+ (url) => url.externalMetricId === (metricItem == null ? void 0 : metricItem.id)
123431
+ );
123432
+ if (index2 > -1) {
123433
+ prevExternalMetricRawCsvUrls[index2] = {
123434
+ ...insert_externalMetricRawCsvUrls_one
123435
+ };
123436
+ }
123437
+ return {
123438
+ ...prev,
123439
+ externalMetricRawCsvUrls: prevExternalMetricRawCsvUrls
123440
+ };
123441
+ }
123442
+ );
123443
+ }
123444
+ });
123445
+ } else {
123446
+ setLoading(false);
123447
+ setError(SOMETHING_WENT_WRONG);
123448
+ }
123449
+ },
123450
+ onError() {
123451
+ setLoading(false);
123452
+ setError(SOMETHING_WENT_WRONG);
123453
+ }
123454
+ }
123455
+ );
123456
+ };
123181
123457
  return {
123182
123458
  isLoading,
123183
123459
  downloadCsvError,
@@ -123187,7 +123463,8 @@ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123187
123463
  csvDownloadUrls,
123188
123464
  handleDownload,
123189
123465
  csvDownloadUrlError,
123190
- saveRawCsvDetails
123466
+ saveRawCsvDetails,
123467
+ onRequestToDownload
123191
123468
  };
123192
123469
  };
123193
123470
  const required = { required: "Required" };
@@ -123217,7 +123494,8 @@ const DownloadRawCsvModal = ({
123217
123494
  isShowRawCsvModal,
123218
123495
  metricItem,
123219
123496
  client,
123220
- companyTenancyType
123497
+ companyTenancyType,
123498
+ filterValues: filterValues2
123221
123499
  }) => {
123222
123500
  const [rawCsvType, setRawCsvType] = useState(RAW_CSV_OPTIONS[0]);
123223
123501
  const {
@@ -123227,22 +123505,50 @@ const DownloadRawCsvModal = ({
123227
123505
  onSubmitDownloadCsv,
123228
123506
  register: register2,
123229
123507
  csvDownloadUrls,
123508
+ onRequestToDownload,
123230
123509
  handleDownload,
123231
- csvDownloadUrlError,
123232
- saveRawCsvDetails
123233
- } = useDownloadRawCsv(onCloseModal, metricItem);
123510
+ csvDownloadUrlError
123511
+ } = useDownloadRawCsv(onCloseModal, metricItem, filterValues2);
123234
123512
  return /* @__PURE__ */ jsx(Modal, {
123235
123513
  isOpen: isShowRawCsvModal,
123236
123514
  onClose: () => onCloseModal(false),
123237
- headerTitle: "Raw CSV",
123515
+ customHeader: /* @__PURE__ */ jsxs("div", {
123516
+ className: styles$a.downloadCsvHeader,
123517
+ children: [/* @__PURE__ */ jsxs("div", {
123518
+ className: styles$a.downloadCsvHeaderText,
123519
+ children: [/* @__PURE__ */ jsx(Text, {
123520
+ variant: "p",
123521
+ styleClass: "primary",
123522
+ children: "Download Raw CSV"
123523
+ }), /* @__PURE__ */ jsx("div", {
123524
+ className: styles$a.downloadCsvTabContainer,
123525
+ children: RAW_CSV_OPTIONS.map((tab2) => /* @__PURE__ */ jsx(Button, {
123526
+ variant: "custom",
123527
+ type: "button",
123528
+ onClick: () => {
123529
+ setRawCsvType(tab2);
123530
+ },
123531
+ className: rawCsvType === tab2 ? styles$a.downloadCsvActiveTab : styles$a.downloadCsvTab,
123532
+ children: /* @__PURE__ */ jsx(Text, {
123533
+ styleClass: "font-14",
123534
+ variant: "p",
123535
+ className: rawCsvType === tab2 ? styles$a.downloadCsvActiveTabText : "",
123536
+ children: tab2
123537
+ })
123538
+ }, tab2))
123539
+ })]
123540
+ }), /* @__PURE__ */ jsx(Button, {
123541
+ variant: "secondary",
123542
+ type: "button",
123543
+ onClick: () => onCloseModal(false),
123544
+ children: /* @__PURE__ */ jsx(Icons, {
123545
+ name: "close-icon"
123546
+ })
123547
+ })]
123548
+ }),
123238
123549
  children: /* @__PURE__ */ jsxs("div", {
123239
123550
  className: styles$a.downloadCsv,
123240
- children: [/* @__PURE__ */ jsx(Tab, {
123241
- activeTab: rawCsvType,
123242
- options: RAW_CSV_OPTIONS,
123243
- setActiveTab: setRawCsvType,
123244
- className: styles$a["tab-border-bottom"]
123245
- }), rawCsvType === RAW_CSV_OPTIONS[1] && /* @__PURE__ */ jsxs("form", {
123551
+ children: [rawCsvType === RAW_CSV_OPTIONS[1] && /* @__PURE__ */ jsxs("form", {
123246
123552
  onSubmit: handleSubmit((values) => onSubmitDownloadCsv({
123247
123553
  values,
123248
123554
  sqlQuery: metricItem == null ? void 0 : metricItem.query,
@@ -123296,65 +123602,103 @@ const DownloadRawCsvModal = ({
123296
123602
  children: "Submit"
123297
123603
  })]
123298
123604
  })]
123299
- }), rawCsvType === RAW_CSV_OPTIONS[0] && /* @__PURE__ */ jsx("div", {
123300
- children: !csvDownloadUrls.isExpired ? /* @__PURE__ */ jsxs(Fragment, {
123605
+ }), rawCsvType === RAW_CSV_OPTIONS[0] && /* @__PURE__ */ jsxs("div", {
123606
+ children: [csvDownloadUrls.status === NONE$1 && /* @__PURE__ */ jsxs(Fragment, {
123301
123607
  children: [/* @__PURE__ */ jsxs("div", {
123302
123608
  className: styles$a.downloadCsvWrapper,
123303
- children: [/* @__PURE__ */ jsxs(Text, {
123304
- variant: "p",
123305
- styleClass: "primary",
123306
- children: ["Last download request:", /* @__PURE__ */ jsx("span", {
123307
- className: styles$a["download-info-text"],
123308
- children: csvDownloadUrls.lastUpdatedAt
123609
+ children: [/* @__PURE__ */ jsxs("div", {
123610
+ className: styles$a.downloadUrlTimeline,
123611
+ children: [/* @__PURE__ */ jsxs("div", {
123612
+ className: styles$a.timeLineItem,
123613
+ children: [/* @__PURE__ */ jsx("span", {
123614
+ className: styles$a.timeLineActiveIcon,
123615
+ children: "1"
123616
+ }), /* @__PURE__ */ jsx(Text, {
123617
+ variant: "p",
123618
+ styleClass: "primary",
123619
+ children: "Request url"
123620
+ })]
123621
+ }), /* @__PURE__ */ jsx("div", {
123622
+ className: styles$a.timeLineItemline
123623
+ }), /* @__PURE__ */ jsxs("div", {
123624
+ className: styles$a.timeLineItem,
123625
+ children: [/* @__PURE__ */ jsx("span", {
123626
+ className: styles$a.timeLineIcon,
123627
+ children: "2"
123628
+ }), /* @__PURE__ */ jsx(Text, {
123629
+ variant: "p",
123630
+ styleClass: "primary",
123631
+ children: "Download url"
123632
+ })]
123309
123633
  })]
123310
- }), /* @__PURE__ */ jsxs(Text, {
123311
- variant: "p",
123312
- styleClass: "primary",
123313
- children: ["Url will expire in :", /* @__PURE__ */ jsxs("span", {
123314
- className: styles$a["download-info-text"],
123315
- children: [csvDownloadUrls.expireUrlIn, " sec"]
123634
+ }), /* @__PURE__ */ jsxs("div", {
123635
+ className: styles$a.downloadCsvNote,
123636
+ children: [/* @__PURE__ */ jsx(Icons, {
123637
+ name: "info-icon",
123638
+ className: styles$a.popupItemIcon
123639
+ }), /* @__PURE__ */ jsxs("div", {
123640
+ className: styles$a.downloadCsvNoteText,
123641
+ children: [/* @__PURE__ */ jsx(Text, {
123642
+ styleClass: "primary",
123643
+ variant: "h1",
123644
+ children: "Note:"
123645
+ }), /* @__PURE__ */ jsx(Text, {
123646
+ styleClass: "font-14",
123647
+ variant: "p",
123648
+ children: "It may take some time for the url to appear as the file size may be too large, especially for larger row entities."
123649
+ })]
123316
123650
  })]
123317
- }), csvDownloadUrlError && /* @__PURE__ */ jsx(Error$1, {
123318
- message: csvDownloadUrlError
123319
123651
  })]
123652
+ }), downloadCsvError && /* @__PURE__ */ jsx(Error$1, {
123653
+ message: downloadCsvError
123320
123654
  }), /* @__PURE__ */ jsxs(ModalFooter, {
123321
123655
  children: [/* @__PURE__ */ jsx(Button, {
123322
123656
  variant: "custom",
123323
123657
  type: "button",
123324
- size: "small",
123325
123658
  className: styles$a.downloadCsvCancelBtn,
123326
123659
  onClick: () => onCloseModal(false),
123327
123660
  isDisabled: isLoading,
123328
123661
  children: "Cancel"
123329
- }), csvDownloadUrls.urls.map((url) => /* @__PURE__ */ jsx(Button, {
123662
+ }), /* @__PURE__ */ jsx(Button, {
123330
123663
  variant: "primary",
123331
123664
  type: "button",
123332
123665
  size: "medium",
123333
- onClick: () => handleDownload(url),
123334
- children: "Download"
123335
- }))]
123666
+ onClick: () => onRequestToDownload({
123667
+ clientName: client,
123668
+ tenancyType: companyTenancyType,
123669
+ requestStatus: REQUESTED
123670
+ }),
123671
+ children: "Request url"
123672
+ })]
123336
123673
  })]
123337
- }) : /* @__PURE__ */ jsxs("form", {
123338
- onSubmit: handleSubmit((values) => saveRawCsvDetails({
123339
- values,
123340
- clientName: client,
123341
- tenancyType: companyTenancyType
123342
- })),
123674
+ }), csvDownloadUrls.status === REQUESTED && /* @__PURE__ */ jsxs(Fragment, {
123343
123675
  children: [/* @__PURE__ */ jsxs("div", {
123344
123676
  className: styles$a.downloadCsvWrapper,
123345
- children: [/* @__PURE__ */ jsx(InputField, {
123346
- type: "date",
123347
- label: "File Expire",
123348
- placeholder: "select expire date for file",
123349
- register: register2("expireCsvFileAt"),
123350
- pattern: "(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))"
123351
- }), /* @__PURE__ */ jsx(InputField, {
123352
- type: "number",
123353
- label: "Download URL expire (sec)",
123354
- placeholder: "120",
123355
- register: register2("expireUrlIn"),
123356
- defaultValue: 120,
123357
- min: 60
123677
+ children: [/* @__PURE__ */ jsxs("div", {
123678
+ className: styles$a.downloadUrlTimeline,
123679
+ children: [/* @__PURE__ */ jsxs("div", {
123680
+ className: styles$a.timeLineItem,
123681
+ children: [/* @__PURE__ */ jsx("span", {
123682
+ className: styles$a.timeLineActiveIcon,
123683
+ children: "1"
123684
+ }), /* @__PURE__ */ jsx(Text, {
123685
+ variant: "p",
123686
+ styleClass: "primary",
123687
+ children: "Request url"
123688
+ })]
123689
+ }), /* @__PURE__ */ jsx("div", {
123690
+ className: styles$a.timeLineItemline
123691
+ }), /* @__PURE__ */ jsxs("div", {
123692
+ className: styles$a.timeLineItem,
123693
+ children: [/* @__PURE__ */ jsx("span", {
123694
+ className: styles$a.timeLineIcon,
123695
+ children: "2"
123696
+ }), /* @__PURE__ */ jsx(Text, {
123697
+ variant: "p",
123698
+ styleClass: "primary",
123699
+ children: "Download url"
123700
+ })]
123701
+ })]
123358
123702
  }), /* @__PURE__ */ jsxs("div", {
123359
123703
  className: styles$a.downloadCsvNote,
123360
123704
  children: [/* @__PURE__ */ jsx(Icons, {
@@ -123369,32 +123713,166 @@ const DownloadRawCsvModal = ({
123369
123713
  }), /* @__PURE__ */ jsx(Text, {
123370
123714
  styleClass: "font-14",
123371
123715
  variant: "p",
123372
- children: "Please check again in some time, download link will be available."
123716
+ children: "It may take some time for the url to appear as the file size may be too large, especially for larger row entities."
123373
123717
  })]
123374
123718
  })]
123375
- }), csvDownloadUrls.error && /* @__PURE__ */ jsx(Error$1, {
123719
+ }), csvDownloadUrls.error ? /* @__PURE__ */ jsx(Error$1, {
123376
123720
  message: csvDownloadUrls.error
123377
- }), downloadCsvError && /* @__PURE__ */ jsx(Error$1, {
123378
- message: downloadCsvError
123721
+ }) : /* @__PURE__ */ jsxs("div", {
123722
+ className: styles$a.downloadCsvLoading,
123723
+ children: [/* @__PURE__ */ jsx(eosIconsLoading, {
123724
+ className: styles$a.downloadCsvLoadingIcon
123725
+ }), /* @__PURE__ */ jsx(Text, {
123726
+ variant: "p",
123727
+ styleClass: "font-14",
123728
+ className: styles$a.downloadCsvLoadingText,
123729
+ children: "please wait while your download is being processed..."
123730
+ })]
123379
123731
  })]
123732
+ }), downloadCsvError && /* @__PURE__ */ jsx(Error$1, {
123733
+ message: downloadCsvError
123380
123734
  }), /* @__PURE__ */ jsxs(ModalFooter, {
123381
123735
  children: [/* @__PURE__ */ jsx(Button, {
123382
123736
  variant: "custom",
123383
123737
  type: "button",
123384
- size: "small",
123385
123738
  className: styles$a.downloadCsvCancelBtn,
123386
123739
  onClick: () => onCloseModal(false),
123387
123740
  isDisabled: isLoading,
123388
123741
  children: "Cancel"
123389
- }), /* @__PURE__ */ jsx(Button, {
123742
+ }), csvDownloadUrls.error ? /* @__PURE__ */ jsx(Button, {
123390
123743
  variant: "primary",
123391
- type: "submit",
123392
- size: "small",
123744
+ type: "button",
123745
+ size: "medium",
123746
+ onClick: () => onRequestToDownload({
123747
+ clientName: client,
123748
+ tenancyType: companyTenancyType,
123749
+ requestStatus: REQUESTED
123750
+ }),
123751
+ children: "Request url"
123752
+ }) : /* @__PURE__ */ jsx(Button, {
123753
+ variant: "custom",
123754
+ type: "button",
123755
+ size: "medium",
123756
+ isDisabled: true,
123757
+ className: styles$a.downloadCsvCancelBtn,
123758
+ children: "Request url"
123759
+ })]
123760
+ })]
123761
+ }), csvDownloadUrls.status === AVAILABLE && /* @__PURE__ */ jsxs(Fragment, {
123762
+ children: [/* @__PURE__ */ jsxs("div", {
123763
+ className: styles$a.downloadCsvWrapper,
123764
+ children: [/* @__PURE__ */ jsxs("div", {
123765
+ className: styles$a.downloadUrlTimeline,
123766
+ children: [/* @__PURE__ */ jsxs("div", {
123767
+ className: styles$a.timeLineItem,
123768
+ children: [/* @__PURE__ */ jsx("span", {
123769
+ className: styles$a.timeLineCheckedIconWrapper,
123770
+ children: /* @__PURE__ */ jsx(materialSymbolsCheckSmallRounded, {
123771
+ className: styles$a.timeLineCheckedIcon
123772
+ })
123773
+ }), /* @__PURE__ */ jsx(Text, {
123774
+ variant: "p",
123775
+ styleClass: "primary",
123776
+ children: "Request url"
123777
+ })]
123778
+ }), /* @__PURE__ */ jsx("div", {
123779
+ className: styles$a.timeLineItemline
123780
+ }), /* @__PURE__ */ jsxs("div", {
123781
+ className: styles$a.timeLineItem,
123782
+ children: [/* @__PURE__ */ jsx("span", {
123783
+ className: styles$a.timeLineActiveIcon,
123784
+ children: "2"
123785
+ }), /* @__PURE__ */ jsx(Text, {
123786
+ variant: "p",
123787
+ styleClass: "primary",
123788
+ children: "Download url"
123789
+ })]
123790
+ })]
123791
+ }), csvDownloadUrls.isExpired ? /* @__PURE__ */ jsxs("div", {
123792
+ className: styles$a.downloadCsvExpiredNote,
123793
+ children: [/* @__PURE__ */ jsx(Icons, {
123794
+ name: "info-icon",
123795
+ className: styles$a.popupItemIcon
123796
+ }), /* @__PURE__ */ jsxs("div", {
123797
+ className: styles$a.downloadCsvNoteText,
123798
+ children: [/* @__PURE__ */ jsx(Text, {
123799
+ styleClass: "primary",
123800
+ variant: "h1",
123801
+ children: "Note:"
123802
+ }), /* @__PURE__ */ jsx(Text, {
123803
+ styleClass: "font-14",
123804
+ variant: "p",
123805
+ children: "Your download link has expired. Please click on Request url to generate a new download url."
123806
+ })]
123807
+ })]
123808
+ }) : /* @__PURE__ */ jsxs("div", {
123809
+ className: styles$a.downloadCsvNote,
123810
+ children: [/* @__PURE__ */ jsx(Icons, {
123811
+ name: "info-icon",
123812
+ className: styles$a.popupItemIcon
123813
+ }), /* @__PURE__ */ jsxs("div", {
123814
+ className: styles$a.downloadCsvNoteText,
123815
+ children: [/* @__PURE__ */ jsx(Text, {
123816
+ styleClass: "primary",
123817
+ variant: "h1",
123818
+ children: "Note:"
123819
+ }), /* @__PURE__ */ jsxs(Text, {
123820
+ styleClass: "font-14",
123821
+ variant: "p",
123822
+ children: ["Your download may expire in", " ", (csvDownloadUrls.expireUrlIn / 60).toFixed(2), " ", "minutes. Please click Download button to download your raw CSV file."]
123823
+ })]
123824
+ })]
123825
+ }), downloadCsvError && /* @__PURE__ */ jsx(Error$1, {
123826
+ message: downloadCsvError
123827
+ }), csvDownloadUrlError && /* @__PURE__ */ jsx(Error$1, {
123828
+ message: csvDownloadUrlError
123829
+ })]
123830
+ }), /* @__PURE__ */ jsxs(ModalFooter, {
123831
+ children: [/* @__PURE__ */ jsx("div", {
123832
+ className: styles$a.downloadCsvBackBtnWrapper,
123833
+ children: csvDownloadUrls.isExpired && /* @__PURE__ */ jsx(Button, {
123834
+ variant: "secondary",
123835
+ type: "button",
123836
+ size: "11rem",
123837
+ isDisabled: isLoading,
123838
+ onClick: () => onRequestToDownload({
123839
+ clientName: client,
123840
+ tenancyType: companyTenancyType,
123841
+ requestStatus: REQUESTED
123842
+ }),
123843
+ className: styles$a.downloadCsvBackBtnText,
123844
+ children: /* @__PURE__ */ jsxs(Text, {
123845
+ styleClass: "font-14a",
123846
+ variant: "p",
123847
+ className: styles$a.downloadCsvBackBtnText,
123848
+ children: [/* @__PURE__ */ jsx(Icons, {
123849
+ name: "arrow-back-icon"
123850
+ }), "Go back to Request url"]
123851
+ })
123852
+ })
123853
+ }), /* @__PURE__ */ jsx(Button, {
123854
+ variant: "custom",
123855
+ type: "button",
123856
+ className: styles$a.downloadCsvCancelBtn,
123857
+ onClick: () => onCloseModal(false),
123393
123858
  isDisabled: isLoading,
123394
- children: "Submit"
123859
+ children: "Cancel"
123860
+ }), !csvDownloadUrls.isExpired && csvDownloadUrls.urls.map((url) => /* @__PURE__ */ jsx(Button, {
123861
+ variant: "primary",
123862
+ type: "button",
123863
+ size: "medium",
123864
+ onClick: () => handleDownload(url),
123865
+ children: "Download"
123866
+ })), csvDownloadUrls.isExpired && /* @__PURE__ */ jsx(Button, {
123867
+ variant: "custom",
123868
+ type: "button",
123869
+ size: "medium",
123870
+ isDisabled: true,
123871
+ className: styles$a.downloadCsvCancelBtn,
123872
+ children: "Download"
123395
123873
  })]
123396
123874
  })]
123397
- })
123875
+ })]
123398
123876
  })]
123399
123877
  })
123400
123878
  });
@@ -123491,12 +123969,19 @@ const ExternalMetricList = ({
123491
123969
  x: (cardLayout == null ? void 0 : cardLayout.x) || metric.resizeAttributes.xAxis || 0,
123492
123970
  y: (cardLayout == null ? void 0 : cardLayout.y) || metric.resizeAttributes.yAxis || 0,
123493
123971
  minW: 3,
123494
- minH: 6,
123495
- maxH: 15
123972
+ minH: metric.chartOptions.chartType !== "single value" ? 8 : 5,
123973
+ maxH: metric.chartOptions.chartType === "table" ? Infinity : 15
123496
123974
  };
123497
123975
  });
123498
123976
  return [allMetricList, layoutAttributes];
123499
123977
  }, [externalDashboardMetrics, layout3]);
123978
+ useEffect(() => {
123979
+ if (!metricsList.length || !metricsLayout.length)
123980
+ return;
123981
+ document.querySelectorAll(".react-resizable-handle").forEach((el) => {
123982
+ el.classList.add(styles$b.resizeHandle);
123983
+ });
123984
+ }, [metricsList.length && metricsLayout.length]);
123500
123985
  return /* @__PURE__ */ jsx(Fragment, {
123501
123986
  children: metricsList.length && metricsLayout.length ? /* @__PURE__ */ jsxs(Fragment, {
123502
123987
  children: [/* @__PURE__ */ jsxs("div", {
@@ -123582,9 +124067,10 @@ const ExternalMetricList = ({
123582
124067
  metricData: metricData2,
123583
124068
  metric
123584
124069
  }),
123585
- onDownloadRawCsv: (metric) => setRawCsvModal({
124070
+ onDownloadRawCsv: (metric, filterValues2) => setRawCsvModal({
123586
124071
  metric,
123587
- show: true
124072
+ show: true,
124073
+ filterValues: filterValues2
123588
124074
  })
123589
124075
  })
123590
124076
  }, metricItem.id))
@@ -123606,7 +124092,8 @@ const ExternalMetricList = ({
123606
124092
  onCloseModal: (value) => setRawCsvModal({
123607
124093
  metric: void 0,
123608
124094
  show: value
123609
- })
124095
+ }),
124096
+ filterValues: rawCsvModal.filterValues
123610
124097
  }), /* @__PURE__ */ jsx(FullScreenChart, {
123611
124098
  onCancel: () => setFullScreen(false),
123612
124099
  isShow: isFullScreen,
@@ -123911,12 +124398,6 @@ const TagInputField = ({
123911
124398
  })
123912
124399
  });
123913
124400
  };
123914
- const DashboardContext = createContext({
123915
- isLoading: void 0,
123916
- data: void 0,
123917
- token: void 0
123918
- });
123919
- const useDashboardContext = () => useContext(DashboardContext);
123920
124401
  const getTimezoneOffset = (timezone, date) => {
123921
124402
  const localOffset = date.getTimezoneOffset() * -1;
123922
124403
  const targetOffset = new Date(