@databrainhq/plugin 0.9.4 → 0.9.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.
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,6 +5616,7 @@ const FREQUENCY = [
5615
5616
  { value: "Weekly", label: "Weekly" },
5616
5617
  { value: "Monthly", label: "Monthly" }
5617
5618
  ];
5619
+ const RAW_CSV_OPTIONS = ["download", "email"];
5618
5620
  const ChartConfig = ({
5619
5621
  data,
5620
5622
  setXAxis,
@@ -6526,7 +6528,7 @@ const TextAreaField = ({
6526
6528
  });
6527
6529
  };
6528
6530
  const group$1 = "_group_13otg_1";
6529
- const button$6 = "_button_13otg_9";
6531
+ const button$7 = "_button_13otg_9";
6530
6532
  const checkbox = "_checkbox_13otg_17";
6531
6533
  const enabled = "_enabled_13otg_43";
6532
6534
  const notenabled = "_notenabled_13otg_59";
@@ -6535,7 +6537,7 @@ const labelActive = "_labelActive_13otg_83";
6535
6537
  const labelInactive = "_labelInactive_13otg_91";
6536
6538
  var styles$A = {
6537
6539
  group: group$1,
6538
- button: button$6,
6540
+ button: button$7,
6539
6541
  checkbox,
6540
6542
  "switch": "_switch_13otg_25",
6541
6543
  enabled,
@@ -6909,6 +6911,24 @@ const useExternalDashboardListQuery = (variables, options2) => useQuery(
6909
6911
  fetcher(ExternalDashboardListDocument, variables),
6910
6912
  options2
6911
6913
  );
6914
+ const ExternalMetricRawCsvUrlsDocument = `
6915
+ query ExternalMetricRawCsvUrls($externalMetricId: uuid = "") {
6916
+ externalMetricRawCsvUrls(where: {externalMetricId: {_eq: $externalMetricId}}) {
6917
+ configurations
6918
+ error
6919
+ expireUrlIn
6920
+ externalMetricId
6921
+ id
6922
+ lastUpdatedAt
6923
+ urls
6924
+ }
6925
+ }
6926
+ `;
6927
+ const useExternalMetricRawCsvUrlsQuery = (variables, options2) => useQuery(
6928
+ variables === void 0 ? ["ExternalMetricRawCsvUrls"] : ["ExternalMetricRawCsvUrls", variables],
6929
+ fetcher(ExternalMetricRawCsvUrlsDocument, variables),
6930
+ options2
6931
+ );
6912
6932
  const GuestTokenParamsDocument = `
6913
6933
  query GuestTokenParams($id: uuid = "") {
6914
6934
  guestTokens_by_pk(id: $id) {
@@ -7002,6 +7022,21 @@ const useUnderlyingDataMutation = (options2) => useMutation(
7002
7022
  (variables) => fetcher(UnderlyingDataDocument, variables)(),
7003
7023
  options2
7004
7024
  );
7025
+ const InvokeSaveRawCsvDetailsDocument = `
7026
+ mutation InvokeSaveRawCsvDetails($configurations: json = "", $expireCsvFileAt: String = "", $externalMetricId: String = "", $integrationId: String = "", $integrationName: String = "", $query: String = "", $expireUrlIn: Int = 60) {
7027
+ invokeSaveRawCsvDetails(
7028
+ input: {configurations: $configurations, expireCsvFileAt: $expireCsvFileAt, externalMetricId: $externalMetricId, integrationId: $integrationId, integrationName: $integrationName, query: $query, expireUrlIn: $expireUrlIn}
7029
+ ) {
7030
+ error
7031
+ statusCode
7032
+ }
7033
+ }
7034
+ `;
7035
+ const useInvokeSaveRawCsvDetailsMutation = (options2) => useMutation(
7036
+ ["InvokeSaveRawCsvDetails"],
7037
+ (variables) => fetcher(InvokeSaveRawCsvDetailsDocument, variables)(),
7038
+ options2
7039
+ );
7005
7040
  const MarkArchiveMetricDocument = `
7006
7041
  mutation MarkArchiveMetric($id: uuid! = "", $clientId: String! = "") {
7007
7042
  insert_clientDeletedMetrics_one(
@@ -7287,25 +7322,26 @@ const ExternalMetricForm = ({
7287
7322
  })]
7288
7323
  });
7289
7324
  };
7290
- const container$d = "_container_i9keb_1";
7291
- const wrapper$3 = "_wrapper_i9keb_5";
7292
- const label$3 = "_label_i9keb_9";
7293
- const floatingLabel = "_floatingLabel_i9keb_13";
7294
- const floatingText = "_floatingText_i9keb_16";
7295
- const clientText = "_clientText_i9keb_20";
7296
- const normalText = "_normalText_i9keb_24";
7297
- const dropdown$1 = "_dropdown_i9keb_28";
7298
- const options = "_options_i9keb_32";
7299
- const checkedOption = "_checkedOption_i9keb_36";
7300
- const option = "_option_i9keb_32";
7301
- const icon$1 = "_icon_i9keb_44";
7302
- const text$2 = "_text_i9keb_48";
7303
- const search = "_search_i9keb_52";
7304
- const loadMore = "_loadMore_i9keb_56";
7305
- const loadMoreIcon = "_loadMoreIcon_i9keb_60";
7325
+ const container$d = "_container_1f7qx_1";
7326
+ const wrapper$2 = "_wrapper_1f7qx_5";
7327
+ const label$3 = "_label_1f7qx_9";
7328
+ const floatingLabel = "_floatingLabel_1f7qx_13";
7329
+ const floatingText = "_floatingText_1f7qx_16";
7330
+ const clientText = "_clientText_1f7qx_20";
7331
+ const normalText = "_normalText_1f7qx_24";
7332
+ const dropdown$1 = "_dropdown_1f7qx_28";
7333
+ const options = "_options_1f7qx_32";
7334
+ const checkedOption = "_checkedOption_1f7qx_36";
7335
+ const option = "_option_1f7qx_32";
7336
+ const icon$1 = "_icon_1f7qx_44";
7337
+ const text$1 = "_text_1f7qx_48";
7338
+ const search = "_search_1f7qx_52";
7339
+ const loadMore = "_loadMore_1f7qx_56";
7340
+ const loadMoreIcon = "_loadMoreIcon_1f7qx_60";
7341
+ const aboveList = "_aboveList_1f7qx_64";
7306
7342
  var styles$y = {
7307
7343
  container: container$d,
7308
- wrapper: wrapper$3,
7344
+ wrapper: wrapper$2,
7309
7345
  label: label$3,
7310
7346
  floatingLabel,
7311
7347
  floatingText,
@@ -7316,10 +7352,11 @@ var styles$y = {
7316
7352
  checkedOption,
7317
7353
  option,
7318
7354
  icon: icon$1,
7319
- text: text$2,
7355
+ text: text$1,
7320
7356
  search,
7321
7357
  loadMore,
7322
- loadMoreIcon
7358
+ loadMoreIcon,
7359
+ aboveList
7323
7360
  };
7324
7361
  const useEmbeddedDashboard = (token) => {
7325
7362
  var _a2, _b2;
@@ -7892,6 +7929,7 @@ var index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
7892
7929
  TIME,
7893
7930
  DATE_NUM,
7894
7931
  FREQUENCY,
7932
+ RAW_CSV_OPTIONS,
7895
7933
  operatorList,
7896
7934
  RowLimitList,
7897
7935
  AggregateList,
@@ -8035,12 +8073,14 @@ const FloatingDropDown = ({
8035
8073
  selectedOption: selectedOption2,
8036
8074
  onChange,
8037
8075
  className,
8076
+ buttonClass,
8038
8077
  options: options2,
8039
8078
  isDisabled,
8040
8079
  children: children2,
8041
8080
  icon: icon2,
8042
8081
  isSearchEnabled,
8043
- closeControl
8082
+ closeControl,
8083
+ dropdownAbove
8044
8084
  }) => {
8045
8085
  const [isShow, setIsShow] = useState(false);
8046
8086
  const wrapperRef = useRef(null);
@@ -8067,7 +8107,7 @@ const FloatingDropDown = ({
8067
8107
  type: "button",
8068
8108
  variant: "custom",
8069
8109
  isDisabled,
8070
- className: styles$y.wrapper,
8110
+ className: classnames(styles$y.wrapper, buttonClass),
8071
8111
  onClick: () => setIsShow(!isShow),
8072
8112
  children: [/* @__PURE__ */ jsxs(Text, {
8073
8113
  variant: "p",
@@ -8076,7 +8116,7 @@ const FloatingDropDown = ({
8076
8116
  children: [icon2, selectedOption2.label || selectedOption2.value || "Select An Option"]
8077
8117
  }), /* @__PURE__ */ jsx(materialSymbolsKeyboardArrowDown, {})]
8078
8118
  }), isShow && !isDisabled && /* @__PURE__ */ jsxs("div", {
8079
- className: styles$y.dropdown,
8119
+ className: `${dropdownAbove ? styles$y.aboveList : styles$y.dropdown}`,
8080
8120
  children: [isSearchEnabled && /* @__PURE__ */ jsx(SearchTab, {
8081
8121
  className: styles$y.search,
8082
8122
  setSearchKeyword
@@ -8289,9 +8329,9 @@ const MultiFilterDropdown = React__default.memo(({
8289
8329
  ...rest
8290
8330
  });
8291
8331
  });
8292
- const fullscreen$2 = "_fullscreen_1wo1t_1";
8332
+ const fullscreen$3 = "_fullscreen_1wo1t_1";
8293
8333
  var styles$x = {
8294
- fullscreen: fullscreen$2
8334
+ fullscreen: fullscreen$3
8295
8335
  };
8296
8336
  const csvlink = "_csvlink_azd6y_1";
8297
8337
  const noChart = "_noChart_azd6y_7";
@@ -19867,9 +19907,9 @@ function blurSeriesFromHighlightPayload(seriesModel, payload, api) {
19867
19907
  var el = data.getItemGraphicEl(dataIndex);
19868
19908
  if (!el) {
19869
19909
  var count2 = data.count();
19870
- var current = 0;
19871
- while (!el && current < count2) {
19872
- el = data.getItemGraphicEl(current++);
19910
+ var current2 = 0;
19911
+ while (!el && current2 < count2) {
19912
+ el = data.getItemGraphicEl(current2++);
19873
19913
  }
19874
19914
  }
19875
19915
  if (el) {
@@ -25719,13 +25759,13 @@ var Task = function() {
25719
25759
  }();
25720
25760
  var iterator = function() {
25721
25761
  var end2;
25722
- var current;
25762
+ var current2;
25723
25763
  var modBy;
25724
25764
  var modDataCount;
25725
25765
  var winCount;
25726
25766
  var it = {
25727
25767
  reset: function(s2, e2, sStep, sCount) {
25728
- current = s2;
25768
+ current2 = s2;
25729
25769
  end2 = e2;
25730
25770
  modBy = sStep;
25731
25771
  modDataCount = sCount;
@@ -25735,12 +25775,12 @@ var iterator = function() {
25735
25775
  };
25736
25776
  return it;
25737
25777
  function sequentialNext() {
25738
- return current < end2 ? current++ : null;
25778
+ return current2 < end2 ? current2++ : null;
25739
25779
  }
25740
25780
  function modNext() {
25741
- var dataIndex = current % winCount * modBy + Math.ceil(current / winCount);
25742
- var result = current >= end2 ? null : dataIndex < modDataCount ? dataIndex : current;
25743
- current++;
25781
+ var dataIndex = current2 % winCount * modBy + Math.ceil(current2 / winCount);
25782
+ var result = current2 >= end2 ? null : dataIndex < modDataCount ? dataIndex : current2;
25783
+ current2++;
25744
25784
  return result;
25745
25785
  }
25746
25786
  }();
@@ -40875,7 +40915,7 @@ var LineView = function(_super) {
40875
40915
  var point = [symbol.x, symbol.y];
40876
40916
  var start2 = void 0;
40877
40917
  var end2 = void 0;
40878
- var current = void 0;
40918
+ var current2 = void 0;
40879
40919
  if (clipShape) {
40880
40920
  if (isCoordSysPolar) {
40881
40921
  var polarClip = clipShape;
@@ -40883,26 +40923,26 @@ var LineView = function(_super) {
40883
40923
  if (isHorizontalOrRadial) {
40884
40924
  start2 = polarClip.startAngle;
40885
40925
  end2 = polarClip.endAngle;
40886
- current = -coord[1] / 180 * Math.PI;
40926
+ current2 = -coord[1] / 180 * Math.PI;
40887
40927
  } else {
40888
40928
  start2 = polarClip.r0;
40889
40929
  end2 = polarClip.r;
40890
- current = coord[0];
40930
+ current2 = coord[0];
40891
40931
  }
40892
40932
  } else {
40893
40933
  var gridClip = clipShape;
40894
40934
  if (isHorizontalOrRadial) {
40895
40935
  start2 = gridClip.x;
40896
40936
  end2 = gridClip.x + gridClip.width;
40897
- current = symbol.x;
40937
+ current2 = symbol.x;
40898
40938
  } else {
40899
40939
  start2 = gridClip.y + gridClip.height;
40900
40940
  end2 = gridClip.y;
40901
- current = symbol.y;
40941
+ current2 = symbol.y;
40902
40942
  }
40903
40943
  }
40904
40944
  }
40905
- var ratio = end2 === start2 ? 0 : (current - start2) / (end2 - start2);
40945
+ var ratio = end2 === start2 ? 0 : (current2 - start2) / (end2 - start2);
40906
40946
  if (isAxisInverse) {
40907
40947
  ratio = 1 - ratio;
40908
40948
  }
@@ -41036,17 +41076,17 @@ var LineView = function(_super) {
41036
41076
  var polygon = this._polygon;
41037
41077
  var seriesModel = data.hostModel;
41038
41078
  var diff2 = lineAnimationDiff(this._data, data, this._stackedOnPoints, stackedOnPoints, this._coordSys, coordSys, this._valueOrigin);
41039
- var current = diff2.current;
41079
+ var current2 = diff2.current;
41040
41080
  var stackedOnCurrent = diff2.stackedOnCurrent;
41041
41081
  var next = diff2.next;
41042
41082
  var stackedOnNext = diff2.stackedOnNext;
41043
41083
  if (step) {
41044
- current = turnPointsIntoStep(diff2.current, coordSys, step, connectNulls);
41084
+ current2 = turnPointsIntoStep(diff2.current, coordSys, step, connectNulls);
41045
41085
  stackedOnCurrent = turnPointsIntoStep(diff2.stackedOnCurrent, coordSys, step, connectNulls);
41046
41086
  next = turnPointsIntoStep(diff2.next, coordSys, step, connectNulls);
41047
41087
  stackedOnNext = turnPointsIntoStep(diff2.stackedOnNext, coordSys, step, connectNulls);
41048
41088
  }
41049
- if (getBoundingDiff(current, next) > 3e3 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3e3) {
41089
+ if (getBoundingDiff(current2, next) > 3e3 || polygon && getBoundingDiff(stackedOnCurrent, stackedOnNext) > 3e3) {
41050
41090
  polyline.stopAnimation();
41051
41091
  polyline.setShape({
41052
41092
  points: next
@@ -41061,20 +41101,20 @@ var LineView = function(_super) {
41061
41101
  return;
41062
41102
  }
41063
41103
  polyline.shape.__points = diff2.current;
41064
- polyline.shape.points = current;
41104
+ polyline.shape.points = current2;
41065
41105
  var target = {
41066
41106
  shape: {
41067
41107
  points: next
41068
41108
  }
41069
41109
  };
41070
- if (diff2.current !== current) {
41110
+ if (diff2.current !== current2) {
41071
41111
  target.shape.__points = diff2.next;
41072
41112
  }
41073
41113
  polyline.stopAnimation();
41074
41114
  updateProps$1(polyline, target, seriesModel);
41075
41115
  if (polygon) {
41076
41116
  polygon.setShape({
41077
- points: current,
41117
+ points: current2,
41078
41118
  stackedOnPoints: stackedOnCurrent
41079
41119
  });
41080
41120
  polygon.stopAnimation();
@@ -44827,15 +44867,15 @@ function fixMinMaxLabelShow(axisModel, labelEls, tickEls) {
44827
44867
  function ignoreEl(el) {
44828
44868
  el && (el.ignore = true);
44829
44869
  }
44830
- function isTwoLabelOverlapped(current, next) {
44831
- var firstRect = current && current.getBoundingRect().clone();
44870
+ function isTwoLabelOverlapped(current2, next) {
44871
+ var firstRect = current2 && current2.getBoundingRect().clone();
44832
44872
  var nextRect = next && next.getBoundingRect().clone();
44833
44873
  if (!firstRect || !nextRect) {
44834
44874
  return;
44835
44875
  }
44836
44876
  var mRotationBack = identity([]);
44837
- rotate(mRotationBack, mRotationBack, -current.rotation);
44838
- firstRect.applyTransform(mul([], mRotationBack, current.getLocalTransform()));
44877
+ rotate(mRotationBack, mRotationBack, -current2.rotation);
44878
+ firstRect.applyTransform(mul([], mRotationBack, current2.getLocalTransform()));
44839
44879
  nextRect.applyTransform(mul([], mRotationBack, next.getLocalTransform()));
44840
44880
  return firstRect.intersect(nextRect);
44841
44881
  }
@@ -48807,8 +48847,8 @@ var GeoView = function(_super) {
48807
48847
  };
48808
48848
  GeoView2.prototype._handleRegionClick = function(e2) {
48809
48849
  var eventData;
48810
- findEventDispatcher(e2.target, function(current) {
48811
- return (eventData = getECData(current).eventData) != null;
48850
+ findEventDispatcher(e2.target, function(current2) {
48851
+ return (eventData = getECData(current2).eventData) != null;
48812
48852
  }, true);
48813
48853
  if (eventData) {
48814
48854
  this._api.dispatchAction({
@@ -50293,11 +50333,11 @@ function enableAriaDecalForTree(seriesModel) {
50293
50333
  var tree = data.tree;
50294
50334
  var decalPaletteScope2 = {};
50295
50335
  tree.eachNode(function(node) {
50296
- var current = node;
50297
- while (current && current.depth > 1) {
50298
- current = current.parentNode;
50336
+ var current2 = node;
50337
+ while (current2 && current2.depth > 1) {
50338
+ current2 = current2.parentNode;
50299
50339
  }
50300
- var decal = getDecalFromPalette(seriesModel.ecModel, current.name || current.dataIndex + "", decalPaletteScope2);
50340
+ var decal = getDecalFromPalette(seriesModel.ecModel, current2.name || current2.dataIndex + "", decalPaletteScope2);
50301
50341
  node.setVisual("decal", decal);
50302
50342
  });
50303
50343
  }
@@ -61968,11 +62008,11 @@ function sort(children2, sortOrder) {
61968
62008
  function sunburstVisual(ecModel) {
61969
62009
  var paletteScope = {};
61970
62010
  function pickColor(node, seriesModel, treeHeight) {
61971
- var current = node;
61972
- while (current && current.depth > 1) {
61973
- current = current.parentNode;
62011
+ var current2 = node;
62012
+ while (current2 && current2.depth > 1) {
62013
+ current2 = current2.parentNode;
61974
62014
  }
61975
- var color2 = seriesModel.getColorFromPalette(current.name || current.dataIndex + "", paletteScope);
62015
+ var color2 = seriesModel.getColorFromPalette(current2.name || current2.dataIndex + "", paletteScope);
61976
62016
  if (node.depth > 1 && isString$1(color2)) {
61977
62017
  color2 = lift(color2, (node.depth - 1) / (treeHeight - 1) * 0.5);
61978
62018
  }
@@ -68411,8 +68451,8 @@ var DataView = function(_super) {
68411
68451
  viewMain.appendChild(textarea2);
68412
68452
  }
68413
68453
  var blockMetaList = result.meta;
68414
- var buttonContainer = document.createElement("div");
68415
- buttonContainer.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
68454
+ var buttonContainer2 = document.createElement("div");
68455
+ buttonContainer2.style.cssText = "position:absolute;bottom:5px;left:0;right:0";
68416
68456
  var buttonStyle = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px";
68417
68457
  var closeButton = document.createElement("div");
68418
68458
  var refreshButton = document.createElement("div");
@@ -68451,11 +68491,11 @@ var DataView = function(_super) {
68451
68491
  closeButton.innerHTML = lang[1];
68452
68492
  refreshButton.innerHTML = lang[2];
68453
68493
  refreshButton.style.cssText = closeButton.style.cssText = buttonStyle;
68454
- !model.get("readOnly") && buttonContainer.appendChild(refreshButton);
68455
- buttonContainer.appendChild(closeButton);
68494
+ !model.get("readOnly") && buttonContainer2.appendChild(refreshButton);
68495
+ buttonContainer2.appendChild(closeButton);
68456
68496
  root2.appendChild(header2);
68457
68497
  root2.appendChild(viewMain);
68458
- root2.appendChild(buttonContainer);
68498
+ root2.appendChild(buttonContainer2);
68459
68499
  viewMain.style.height = container2.clientHeight - 80 + "px";
68460
68500
  container2.appendChild(root2);
68461
68501
  this._dom = root2;
@@ -73881,10 +73921,10 @@ var ScrollableLegendView = function(_super) {
73881
73921
  var pageText = controllerGroup.childOfName("pageText");
73882
73922
  var pageFormatter = legendModel.get("pageFormatter");
73883
73923
  var pageIndex = pageInfo.pageIndex;
73884
- var current = pageIndex != null ? pageIndex + 1 : 0;
73924
+ var current2 = pageIndex != null ? pageIndex + 1 : 0;
73885
73925
  var total = pageInfo.pageCount;
73886
- pageText && pageFormatter && pageText.setStyle("text", isString$1(pageFormatter) ? pageFormatter.replace("{current}", current == null ? "" : current + "").replace("{total}", total == null ? "" : total + "") : pageFormatter({
73887
- current,
73926
+ pageText && pageFormatter && pageText.setStyle("text", isString$1(pageFormatter) ? pageFormatter.replace("{current}", current2 == null ? "" : current2 + "").replace("{total}", total == null ? "" : total + "") : pageFormatter({
73927
+ current: current2,
73888
73928
  total
73889
73929
  }));
73890
73930
  };
@@ -81571,7 +81611,7 @@ const StackedBarChart = ({
81571
81611
  children: /* @__PURE__ */ jsx(EChartsReact, {
81572
81612
  style: {
81573
81613
  width: "100%",
81574
- height: "300px"
81614
+ height: "90%"
81575
81615
  },
81576
81616
  option: option2,
81577
81617
  onEvents: {
@@ -81644,7 +81684,7 @@ const SingleValueChart = ({
81644
81684
  chartClickConfig,
81645
81685
  hideBorder
81646
81686
  }) => {
81647
- var _a2, _b2, _c2, _d;
81687
+ var _a2, _b2;
81648
81688
  const subHeaderFont = {
81649
81689
  fontSize: `${customSettings.subHeaderFontSize || 14}px`
81650
81690
  };
@@ -81856,38 +81896,7 @@ const SingleValueChart = ({
81856
81896
  return val;
81857
81897
  }
81858
81898
  };
81859
- const dateFormatter = (val, formatter) => {
81860
- const year = val.toString().slice(0, 4);
81861
- const month = val.toString().slice(5, 7);
81862
- const date = val.toString().slice(8, 10);
81863
- const time2 = val.toString().slice(11, 19);
81864
- switch (formatter) {
81865
- case "dd-mm-yyyy": {
81866
- return `${date}-${month}-${year}`;
81867
- }
81868
- case "mm-dd-yyyy": {
81869
- return `${month}-${date}-${year}`;
81870
- }
81871
- case "yyyy-mm-dd": {
81872
- return `${year}-${month}-${date}`;
81873
- }
81874
- case "dd/mm/yyyy": {
81875
- return `${date}/${month}/${year}`;
81876
- }
81877
- case "mm/dd/yyyy": {
81878
- return `${month}/${date}/${year}`;
81879
- }
81880
- case "yyyy/mm/dd": {
81881
- return `${year}/${month}/${date}`;
81882
- }
81883
- case "hh:mm:ss": {
81884
- return time2;
81885
- }
81886
- default:
81887
- return val;
81888
- }
81889
- };
81890
- const value = ((_a2 = data[0]) == null ? void 0 : _a2.value) && (Number((_b2 = data[0]) == null ? void 0 : _b2.value) || 0).toString().length > 16 ? dateFormatter(Number((_c2 = data[0]) == null ? void 0 : _c2.value) || 0, customSettings.dateFormatter) : formattedData(Number((_d = data[0]) == null ? void 0 : _d.value) || 0, customSettings.numberFormatter);
81899
+ const value = ((_a2 = data[0]) == null ? void 0 : _a2.value) && formattedData(Number((_b2 = data[0]) == null ? void 0 : _b2.value) || 0, customSettings.numberFormatter);
81891
81900
  return /* @__PURE__ */ jsxs("div", {
81892
81901
  className: hideBorder ? styles$v.borderLessContainer : styles$v.container,
81893
81902
  children: [/* @__PURE__ */ jsx("div", {
@@ -84025,7 +84034,7 @@ const alphanumeric = (rowA, rowB, columnId) => {
84025
84034
  const alphanumericCaseSensitive = (rowA, rowB, columnId) => {
84026
84035
  return compareAlphanumeric(toString$1(rowA.getValue(columnId)), toString$1(rowB.getValue(columnId)));
84027
84036
  };
84028
- const text$1 = (rowA, rowB, columnId) => {
84037
+ const text = (rowA, rowB, columnId) => {
84029
84038
  return compareBasic(toString$1(rowA.getValue(columnId)).toLowerCase(), toString$1(rowB.getValue(columnId)).toLowerCase());
84030
84039
  };
84031
84040
  const textCaseSensitive = (rowA, rowB, columnId) => {
@@ -84087,7 +84096,7 @@ function compareAlphanumeric(aStr, bStr) {
84087
84096
  const sortingFns = {
84088
84097
  alphanumeric,
84089
84098
  alphanumericCaseSensitive,
84090
- text: text$1,
84099
+ text,
84091
84100
  textCaseSensitive,
84092
84101
  datetime,
84093
84102
  basic
@@ -85622,41 +85631,51 @@ function getAccessorAttributes(accessor) {
85622
85631
  ...accessor
85623
85632
  };
85624
85633
  }
85625
- const tableData = "_tableData_17lmd_7";
85626
- const tableHeadCol$1 = "_tableHeadCol_17lmd_13";
85627
- const tableRow$1 = "_tableRow_17lmd_19";
85628
- const tableRowCol$1 = "_tableRowCol_17lmd_25";
85629
- const row = "_row_17lmd_31";
85630
- const container$b = "_container_17lmd_37";
85631
- const table$3 = "_table_17lmd_1";
85632
- const previewTable = "_previewTable_17lmd_49";
85633
- const preview = "_preview_17lmd_49";
85634
- const searchButton = "_searchButton_17lmd_61";
85635
- const previewText = "_previewText_17lmd_67";
85636
- const noData$1 = "_noData_17lmd_73";
85637
- const error$2 = "_error_17lmd_79";
85638
- const errorMsg = "_errorMsg_17lmd_85";
85639
- const tableIcon = "_tableIcon_17lmd_91";
85640
- const stripedRow = "_stripedRow_17lmd_97";
85641
- const rowHover = "_rowHover_17lmd_103";
85642
- const rightBorder = "_rightBorder_17lmd_109";
85643
- const searchContainer = "_searchContainer_17lmd_115";
85644
- const sortButton = "_sortButton_17lmd_121";
85645
- const debounceInput = "_debounceInput_17lmd_127";
85646
- const searchTab = "_searchTab_17lmd_133";
85647
- const noDataHead = "_noDataHead_17lmd_139";
85648
- const noDataBody = "_noDataBody_17lmd_145";
85649
- const showSort = "_showSort_17lmd_151";
85650
- const noSort = "_noSort_17lmd_157";
85634
+ const tableData = "_tableData_1bay1_7";
85635
+ const tableHeadCol$1 = "_tableHeadCol_1bay1_13";
85636
+ const tableRow$1 = "_tableRow_1bay1_19";
85637
+ const tableRowCol$1 = "_tableRowCol_1bay1_25";
85638
+ const row = "_row_1bay1_31";
85639
+ const container$b = "_container_1bay1_37";
85640
+ const table$2 = "_table_1bay1_1";
85641
+ const previewTable = "_previewTable_1bay1_49";
85642
+ const preview = "_preview_1bay1_49";
85643
+ const searchButton = "_searchButton_1bay1_61";
85644
+ const previewText = "_previewText_1bay1_67";
85645
+ const noData$1 = "_noData_1bay1_73";
85646
+ const error$2 = "_error_1bay1_79";
85647
+ const errorMsg = "_errorMsg_1bay1_85";
85648
+ const tableIcon = "_tableIcon_1bay1_91";
85649
+ const stripedRow = "_stripedRow_1bay1_97";
85650
+ const rowHover = "_rowHover_1bay1_103";
85651
+ const rightBorder = "_rightBorder_1bay1_109";
85652
+ const searchContainer = "_searchContainer_1bay1_115";
85653
+ const sortButton = "_sortButton_1bay1_121";
85654
+ const searchTab = "_searchTab_1bay1_127";
85655
+ const searchTabInput = "_searchTabInput_1bay1_133";
85656
+ const searchTabIcon = "_searchTabIcon_1bay1_139";
85657
+ const noDataHead = "_noDataHead_1bay1_145";
85658
+ const noDataBody = "_noDataBody_1bay1_151";
85659
+ const showSort = "_showSort_1bay1_157";
85660
+ const noSort = "_noSort_1bay1_163";
85661
+ const pagination = "_pagination_1bay1_169";
85662
+ const rowStyle = "_rowStyle_1bay1_175";
85663
+ const rowText = "_rowText_1bay1_181";
85664
+ const rowsDropdown = "_rowsDropdown_1bay1_187";
85665
+ const pageStyle = "_pageStyle_1bay1_193";
85666
+ const buttonContainer = "_buttonContainer_1bay1_199";
85667
+ const button$6 = "_button_1bay1_199";
85668
+ const paginationWrapper = "_paginationWrapper_1bay1_217";
85669
+ const current = "_current_1bay1_223";
85651
85670
  var styles$u = {
85652
- "table-loader-container": "_table-loader-container_17lmd_1",
85671
+ "table-loader-container": "_table-loader-container_1bay1_1",
85653
85672
  tableData,
85654
85673
  tableHeadCol: tableHeadCol$1,
85655
85674
  tableRow: tableRow$1,
85656
85675
  tableRowCol: tableRowCol$1,
85657
85676
  row,
85658
85677
  container: container$b,
85659
- table: table$3,
85678
+ table: table$2,
85660
85679
  previewTable,
85661
85680
  preview,
85662
85681
  searchButton,
@@ -85670,12 +85689,22 @@ var styles$u = {
85670
85689
  rightBorder,
85671
85690
  searchContainer,
85672
85691
  sortButton,
85673
- debounceInput,
85674
85692
  searchTab,
85693
+ searchTabInput,
85694
+ searchTabIcon,
85675
85695
  noDataHead,
85676
85696
  noDataBody,
85677
85697
  showSort,
85678
- noSort
85698
+ noSort,
85699
+ pagination,
85700
+ rowStyle,
85701
+ rowText,
85702
+ rowsDropdown,
85703
+ pageStyle,
85704
+ buttonContainer,
85705
+ button: button$6,
85706
+ paginationWrapper,
85707
+ current
85679
85708
  };
85680
85709
  const DebouncedInput = ({
85681
85710
  value: initialValue,
@@ -85693,11 +85722,19 @@ const DebouncedInput = ({
85693
85722
  }, debounce2);
85694
85723
  return () => clearTimeout(timeout);
85695
85724
  }, [debounce2, onChange, value]);
85696
- return /* @__PURE__ */ jsx("input", {
85697
- ...props,
85698
- value,
85699
- onChange: (e2) => setValue(e2.target.value),
85700
- className: styles$u.searchTab
85725
+ return /* @__PURE__ */ jsxs("div", {
85726
+ className: `${styles$u.searchTab} ${props.className || ""}`,
85727
+ children: [/* @__PURE__ */ jsx("input", {
85728
+ ...props,
85729
+ value,
85730
+ onChange: (e2) => setValue(e2.target.value),
85731
+ className: styles$u.searchTabInput
85732
+ }), /* @__PURE__ */ jsx(iconoirSearch, {
85733
+ className: styles$u.searchTabIcon,
85734
+ color: "#C7C7C7",
85735
+ width: "30px",
85736
+ height: "30px"
85737
+ })]
85701
85738
  });
85702
85739
  };
85703
85740
  var TableIcon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDAgNTAwIj48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZTojMTgyYzYwO30uY2xzLTEsLmNscy0ye2Zp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D0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyMjQuMjMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iMjQyLjY5IiB5PSIyODYuNDMiIHdpZHRoPSI4LjQ3IiBoZWlnaHQ9IjQiLz48cmVjdCBjbGFzcz0iY2xzLTQiIHg9IjI2MC42MiIgeT0iMjg2LjQzIiB3aWR0aD0iOC40NyIgaGVpZ2h0PSI0Ii8+PHJlY3QgY2xhc3M9ImNscy00IiB4PSIyNzguODMiIHk9IjI4Ni40MyIgd2lkdGg9IjguNDciIGhlaWdodD0iNCIvPjwvZz48L3N2Zz4=";
@@ -85728,8 +85765,10 @@ const Table = ({
85728
85765
  isLoading,
85729
85766
  error: error2,
85730
85767
  tableSettings,
85731
- tableName
85768
+ tableName,
85769
+ className = ""
85732
85770
  }) => {
85771
+ var _a2, _b2, _c2, _d;
85733
85772
  const columnHelper = createColumnHelper();
85734
85773
  const columns = [];
85735
85774
  const tableData2 = (data == null ? void 0 : data.length) ? data : [];
@@ -85753,7 +85792,25 @@ const Table = ({
85753
85792
  };
85754
85793
  const [sorting, setSorting] = useState([]);
85755
85794
  const [rowSelection, setRowSelection] = useState({});
85795
+ const [rowSize, setRowSize] = useState({
85796
+ value: "25",
85797
+ label: "Show 25"
85798
+ });
85799
+ const rowSizeList = [{
85800
+ label: "Show 25",
85801
+ value: "25"
85802
+ }, {
85803
+ label: "Show 50",
85804
+ value: "50"
85805
+ }, {
85806
+ label: "Show 75",
85807
+ value: "75"
85808
+ }, {
85809
+ label: "Show 100",
85810
+ value: "100"
85811
+ }];
85756
85812
  const [globalFilter, setGlobalFilter] = useState("");
85813
+ let fetchData;
85757
85814
  if (data) {
85758
85815
  for (const key in data[0]) {
85759
85816
  const colName = key;
@@ -85763,6 +85820,13 @@ const Table = ({
85763
85820
  });
85764
85821
  columns.push(col);
85765
85822
  }
85823
+ fetchData = async (options2) => {
85824
+ await new Promise((r2) => setTimeout(r2, 500));
85825
+ return {
85826
+ rows: data.slice(options2.pageIndex * options2.pageSize, (options2.pageIndex + 1) * options2.pageSize),
85827
+ pageCount: Math.ceil(data.length / options2.pageSize)
85828
+ };
85829
+ };
85766
85830
  }
85767
85831
  const fuzzyFilter = (row2, columnId, value, addMeta) => {
85768
85832
  const itemRank = rankItem(row2.getValue(columnId), value);
@@ -85771,15 +85835,36 @@ const Table = ({
85771
85835
  });
85772
85836
  return itemRank.passed;
85773
85837
  };
85838
+ const [isHovered, setHovered] = useState("");
85839
+ const [{
85840
+ pageIndex,
85841
+ pageSize
85842
+ }, setPagination] = React__default.useState({
85843
+ pageIndex: 0,
85844
+ pageSize: 10
85845
+ });
85846
+ const fetchDataOptions = {
85847
+ pageIndex,
85848
+ pageSize
85849
+ };
85850
+ const dataQuery = useQuery(["data", fetchDataOptions], () => fetchData(fetchDataOptions), {
85851
+ keepPreviousData: true
85852
+ });
85853
+ const pagination2 = React__default.useMemo(() => ({
85854
+ pageIndex,
85855
+ pageSize
85856
+ }), [pageIndex, pageSize]);
85774
85857
  const table2 = useReactTable({
85775
- data: tableData2,
85858
+ data: (_b2 = (_a2 = dataQuery.data) == null ? void 0 : _a2.rows) != null ? _b2 : tableData2,
85776
85859
  columns,
85860
+ pageCount: (_d = (_c2 = dataQuery.data) == null ? void 0 : _c2.pageCount) != null ? _d : -1,
85777
85861
  filterFns: {
85778
85862
  fuzzy: fuzzyFilter
85779
85863
  },
85780
85864
  state: {
85781
85865
  sorting,
85782
- globalFilter
85866
+ globalFilter,
85867
+ pagination: pagination2
85783
85868
  },
85784
85869
  enableGlobalFilter: true,
85785
85870
  onRowSelectionChange: setRowSelection,
@@ -85789,11 +85874,15 @@ const Table = ({
85789
85874
  getFilteredRowModel: getFilteredRowModel(),
85790
85875
  getSortedRowModel: getSortedRowModel(),
85791
85876
  onGlobalFilterChange: setGlobalFilter,
85877
+ onPaginationChange: setPagination,
85878
+ manualPagination: true,
85792
85879
  debugTable: true
85793
85880
  });
85794
- const [isHovered, setHovered] = useState("");
85881
+ useEffect(() => {
85882
+ table2.setPageSize(Number(rowSize.value));
85883
+ }, [rowSize, table2]);
85795
85884
  return /* @__PURE__ */ jsx("div", {
85796
- className: styles$u.container,
85885
+ className: `${styles$u.container} ${className}`,
85797
85886
  children: /* @__PURE__ */ jsxs("div", {
85798
85887
  className: styles$u.previewTable,
85799
85888
  children: [/* @__PURE__ */ jsxs("div", {
@@ -85803,13 +85892,10 @@ const Table = ({
85803
85892
  variant: "h1",
85804
85893
  className: styles$u.previewText,
85805
85894
  children: tableName
85806
- }), (tableSettings == null ? void 0 : tableSettings.enableTableSearch) && /* @__PURE__ */ jsx("div", {
85807
- children: /* @__PURE__ */ jsx(DebouncedInput, {
85808
- value: globalFilter,
85809
- onChange: (value) => setGlobalFilter(String(value)),
85810
- className: styles$u.debounceInput,
85811
- placeholder: "Search"
85812
- })
85895
+ }), (tableSettings == null ? void 0 : tableSettings.enableTableSearch) && /* @__PURE__ */ jsx(DebouncedInput, {
85896
+ value: globalFilter,
85897
+ onChange: (value) => setGlobalFilter(String(value)),
85898
+ placeholder: "Search"
85813
85899
  })]
85814
85900
  }), /* @__PURE__ */ jsxs("div", {
85815
85901
  className: styles$u.tableData,
@@ -85822,58 +85908,60 @@ const Table = ({
85822
85908
  color: "blue"
85823
85909
  }
85824
85910
  })
85825
- }), !!(data == null ? void 0 : data.length) && !isLoading && /* @__PURE__ */ jsxs("table", {
85826
- className: styles$u.table,
85827
- children: [/* @__PURE__ */ jsx("thead", {
85828
- children: table2.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
85829
- className: styles$u.row,
85830
- children: headerGroup.headers.map((header2) => {
85831
- var _a2;
85832
- return /* @__PURE__ */ jsx("th", {
85833
- className: styles$u.tableHeadCol,
85834
- colSpan: header2.colSpan,
85835
- children: (tableSettings == null ? void 0 : tableSettings.enableSorting) ? /* @__PURE__ */ jsx("div", {
85836
- className: header2.column.getCanSort() ? styles$u.sortButton : "",
85837
- onClick: header2.column.getToggleSortingHandler(),
85838
- onMouseOver: () => setHovered(header2.id),
85839
- onMouseOut: () => setHovered(""),
85840
- children: header2.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", {
85841
- style: headerStyle,
85842
- children: [flexRender(header2.column.columnDef.header, header2.getContext()), /* @__PURE__ */ jsx("div", {
85843
- className: isHovered === header2.id ? styles$u.showSort : styles$u.noSort,
85844
- children: (_a2 = {
85845
- asc: " \u{1F53C}",
85846
- desc: " \u{1F53D}"
85847
- }[header2.column.getIsSorted()]) != null ? _a2 : null
85848
- })]
85849
- })
85850
- }) : /* @__PURE__ */ jsx(Fragment, {
85851
- children: header2.isPlaceholder ? null : /* @__PURE__ */ jsx("div", {
85852
- style: headerStyle,
85853
- children: flexRender(header2.column.columnDef.header, header2.getContext())
85911
+ }), !!(data == null ? void 0 : data.length) && !isLoading && /* @__PURE__ */ jsx(Fragment, {
85912
+ children: /* @__PURE__ */ jsxs("table", {
85913
+ className: styles$u.table,
85914
+ children: [/* @__PURE__ */ jsx("thead", {
85915
+ children: table2.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx("tr", {
85916
+ className: styles$u.row,
85917
+ children: headerGroup.headers.map((header2) => {
85918
+ var _a3;
85919
+ return /* @__PURE__ */ jsx("th", {
85920
+ className: styles$u.tableHeadCol,
85921
+ colSpan: header2.colSpan,
85922
+ children: (tableSettings == null ? void 0 : tableSettings.enableSorting) ? /* @__PURE__ */ jsx("div", {
85923
+ className: header2.column.getCanSort() ? styles$u.sortButton : "",
85924
+ onClick: header2.column.getToggleSortingHandler(),
85925
+ onMouseOver: () => setHovered(header2.id),
85926
+ onMouseOut: () => setHovered(""),
85927
+ children: header2.isPlaceholder ? null : /* @__PURE__ */ jsxs("div", {
85928
+ style: headerStyle,
85929
+ children: [flexRender(header2.column.columnDef.header, header2.getContext()), /* @__PURE__ */ jsx("div", {
85930
+ className: isHovered === header2.id ? styles$u.showSort : styles$u.noSort,
85931
+ children: (_a3 = {
85932
+ asc: " \u{1F53C}",
85933
+ desc: " \u{1F53D}"
85934
+ }[header2.column.getIsSorted()]) != null ? _a3 : null
85935
+ })]
85936
+ })
85937
+ }) : /* @__PURE__ */ jsx(Fragment, {
85938
+ children: header2.isPlaceholder ? null : /* @__PURE__ */ jsx("div", {
85939
+ style: headerStyle,
85940
+ children: flexRender(header2.column.columnDef.header, header2.getContext())
85941
+ })
85854
85942
  })
85855
- })
85856
- }, header2.id);
85857
- })
85858
- }, headerGroup.id))
85859
- }), /* @__PURE__ */ jsx("tbody", {
85860
- children: table2.getRowModel().rows.map((row2) => /* @__PURE__ */ jsx("tr", {
85861
- 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 : ""}`,
85862
- children: row2.getVisibleCells().map((cell) => /* @__PURE__ */ jsxs("td", {
85863
- className: `${styles$u.tableRowCol} ${!(tableSettings == null ? void 0 : tableSettings.hideVerticalDivider) ? styles$u.rightBorder : ""}`,
85864
- children: [!!tableSettings && /* @__PURE__ */ jsx("div", {
85865
- style: divStyle,
85866
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
85867
- }), !tableSettings && /* @__PURE__ */ jsx("div", {
85868
- style: {
85869
- textAlign: "center",
85870
- width: "100%"
85871
- },
85872
- children: flexRender(cell.column.columnDef.cell, cell.getContext())
85873
- })]
85874
- }, cell.id))
85875
- }, row2.id))
85876
- })]
85943
+ }, header2.id);
85944
+ })
85945
+ }, headerGroup.id))
85946
+ }), /* @__PURE__ */ jsx("tbody", {
85947
+ children: table2.getRowModel().rows.map((row2) => /* @__PURE__ */ jsx("tr", {
85948
+ 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 : ""}`,
85949
+ children: row2.getVisibleCells().map((cell) => /* @__PURE__ */ jsxs("td", {
85950
+ className: `${styles$u.tableRowCol} ${!(tableSettings == null ? void 0 : tableSettings.hideVerticalDivider) ? styles$u.rightBorder : ""}`,
85951
+ children: [!!tableSettings && /* @__PURE__ */ jsx("div", {
85952
+ style: divStyle,
85953
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
85954
+ }), !tableSettings && /* @__PURE__ */ jsx("div", {
85955
+ style: {
85956
+ textAlign: "center",
85957
+ width: "100%"
85958
+ },
85959
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
85960
+ })]
85961
+ }, cell.id))
85962
+ }, row2.id))
85963
+ })]
85964
+ })
85877
85965
  }), !(data == null ? void 0 : data.length) && !isLoading && !error2.length && /* @__PURE__ */ jsxs("div", {
85878
85966
  className: styles$u.noData,
85879
85967
  children: [/* @__PURE__ */ jsx("img", {
@@ -85901,6 +85989,37 @@ const Table = ({
85901
85989
  children: error2
85902
85990
  })
85903
85991
  })]
85992
+ }), data && /* @__PURE__ */ jsxs("div", {
85993
+ className: styles$u.pagination,
85994
+ children: [/* @__PURE__ */ jsx("div", {
85995
+ className: styles$u.rowStyle,
85996
+ children: /* @__PURE__ */ jsx(FloatingDropDown, {
85997
+ onChange: setRowSize,
85998
+ selectedOption: rowSize,
85999
+ options: rowSizeList,
86000
+ labelVariant: "static",
86001
+ dropdownAbove: true,
86002
+ buttonClass: styles$u.rowsDropdown
86003
+ })
86004
+ }), /* @__PURE__ */ jsxs("span", {
86005
+ className: styles$u.pageStyle,
86006
+ 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]
86007
+ }), /* @__PURE__ */ jsxs("div", {
86008
+ className: styles$u.buttonContainer,
86009
+ children: [/* @__PURE__ */ jsx(Button, {
86010
+ variant: "custom",
86011
+ className: styles$u.button,
86012
+ onClick: () => table2.previousPage(),
86013
+ disabled: !table2.getCanPreviousPage(),
86014
+ children: "Prev"
86015
+ }), /* @__PURE__ */ jsx(Button, {
86016
+ variant: "custom",
86017
+ className: styles$u.button,
86018
+ onClick: () => table2.nextPage(),
86019
+ disabled: !table2.getCanNextPage(),
86020
+ children: "Next"
86021
+ })]
86022
+ })]
85904
86023
  })]
85905
86024
  })
85906
86025
  });
@@ -86849,13 +86968,13 @@ var styles$o = {
86849
86968
  };
86850
86969
  const container$7 = "_container_1q2ss_1";
86851
86970
  const header$3 = "_header_1q2ss_5";
86852
- const wrapper$2 = "_wrapper_1q2ss_9";
86971
+ const wrapper$1 = "_wrapper_1q2ss_9";
86853
86972
  const column = "_column_1q2ss_17";
86854
86973
  const columnText$1 = "_columnText_1q2ss_21";
86855
86974
  var styles$n = {
86856
86975
  container: container$7,
86857
86976
  header: header$3,
86858
- wrapper: wrapper$2,
86977
+ wrapper: wrapper$1,
86859
86978
  "col-container": "_col-container_1q2ss_13",
86860
86979
  column,
86861
86980
  columnText: columnText$1
@@ -87668,47 +87787,6 @@ const ChartConfigure = ({
87668
87787
  value: customSettings.subHeaderFontSize
87669
87788
  })]
87670
87789
  })]
87671
- }), /* @__PURE__ */ jsxs("div", {
87672
- className: styles$m.seriesWrapper,
87673
- children: [/* @__PURE__ */ jsx(Text, {
87674
- variant: "h1",
87675
- styleClass: "primary",
87676
- children: "Date formatting"
87677
- }), /* @__PURE__ */ jsx("div", {
87678
- className: styles$m.valueLabelWrapper,
87679
- children: /* @__PURE__ */ jsx(Select, {
87680
- value: customSettings.dateFormatter,
87681
- options: [{
87682
- label: "None",
87683
- value: "none"
87684
- }, {
87685
- label: "dd-mm-yyyy",
87686
- value: "dd-mm-yyyy"
87687
- }, {
87688
- label: "mm-dd-yyyy",
87689
- value: "mm-dd-yyyy"
87690
- }, {
87691
- label: "yyyy-mm-dd",
87692
- value: "yyyy-mm-dd"
87693
- }, {
87694
- label: "dd/mm/yyyy",
87695
- value: "dd/mm/yyyy"
87696
- }, {
87697
- label: "mm/dd/yyyy",
87698
- value: "mm/dd/yyyy"
87699
- }, {
87700
- label: "yyyy/mm/dd",
87701
- value: "yyyy/mm/dd"
87702
- }, {
87703
- label: "hh:mm:ss",
87704
- value: "hh:mm:ss"
87705
- }],
87706
- onChange: (value) => setCustomSettings((s2) => ({
87707
- ...s2,
87708
- dateFormatter: value
87709
- }))
87710
- })
87711
- })]
87712
87790
  }), /* @__PURE__ */ jsxs("div", {
87713
87791
  className: styles$m.seriesWrapper,
87714
87792
  children: [/* @__PURE__ */ jsx(Text, {
@@ -88274,40 +88352,33 @@ const ChartTab = ({
88274
88352
  })]
88275
88353
  });
88276
88354
  };
88277
- const container$5 = "_container_yjeiv_1";
88278
- const wrapper$1 = "_wrapper_yjeiv_5";
88279
- const text = "_text_yjeiv_9";
88280
- const table$2 = "_table_yjeiv_12";
88355
+ const container$5 = "_container_epyr2_1";
88281
88356
  var styles$i = {
88282
- container: container$5,
88283
- wrapper: wrapper$1,
88284
- text,
88285
- table: table$2
88357
+ container: container$5
88286
88358
  };
88287
88359
  const InputTables = ({
88288
88360
  previewTableDataList
88289
88361
  }) => {
88290
88362
  return /* @__PURE__ */ jsx("div", {
88291
88363
  className: styles$i.container,
88292
- children: /* @__PURE__ */ jsx("div", {
88293
- className: styles$i.wrapper,
88294
- children: previewTableDataList == null ? void 0 : previewTableDataList.map((table2) => /* @__PURE__ */ jsxs("div", {
88295
- className: styles$i.text,
88296
- children: [/* @__PURE__ */ jsx(Text, {
88297
- variant: "h1",
88298
- styleClass: "primary",
88299
- className: "",
88300
- children: table2.name
88301
- }), /* @__PURE__ */ jsx("div", {
88302
- className: styles$i.table,
88303
- children: /* @__PURE__ */ jsx(Table, {
88304
- data: table2.data,
88305
- error: table2.isError,
88306
- isLoading: false
88307
- })
88308
- })]
88309
- }, table2.name))
88310
- })
88364
+ children: previewTableDataList == null ? void 0 : previewTableDataList.map((table2) => /* @__PURE__ */ jsx(Table, {
88365
+ data: table2.data,
88366
+ error: table2.isError,
88367
+ isLoading: false,
88368
+ tableName: table2.name,
88369
+ tableSettings: {
88370
+ showTableTitle: true,
88371
+ hideVerticalDivider: false,
88372
+ showRowHover: false,
88373
+ enableStripedRows: false,
88374
+ enableTableSearch: false,
88375
+ contentAlignment: "center",
88376
+ enableFilter: false,
88377
+ enableSorting: false,
88378
+ lineGap: "",
88379
+ showTableDesc: false
88380
+ }
88381
+ }, table2.name))
88311
88382
  });
88312
88383
  };
88313
88384
  const container$4 = "_container_38zl3_1";
@@ -107939,8 +108010,8 @@ var ace$3 = { exports: {} };
107939
108010
  } };
107940
108011
  if (config.get("loadWorkerFromBlob")) {
107941
108012
  var blob = $workerBlob(workerUrl);
107942
- var URL = window.URL || window.webkitURL;
107943
- var blobURL = URL.createObjectURL(blob);
108013
+ var URL2 = window.URL || window.webkitURL;
108014
+ var blobURL = URL2.createObjectURL(blob);
107944
108015
  return new Worker(blobURL);
107945
108016
  }
107946
108017
  return new Worker(workerUrl);
@@ -120087,7 +120158,7 @@ var GridItem = /* @__PURE__ */ function(_React$Component) {
120087
120158
  }, {
120088
120159
  key: "mixinResizable",
120089
120160
  value: function mixinResizable(child, position2, isResizable) {
120090
- 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;
120161
+ 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;
120091
120162
  var positionParams = this.getPositionParams();
120092
120163
  var maxWidth = (0, _calculateUtils$1.calcGridItemPosition)(positionParams, 0, 0, cols - x2, 0).width;
120093
120164
  var mins = (0, _calculateUtils$1.calcGridItemPosition)(positionParams, 0, 0, minW2, minH2);
@@ -120110,7 +120181,7 @@ var GridItem = /* @__PURE__ */ function(_React$Component) {
120110
120181
  onResize: this.onResize,
120111
120182
  transformScale,
120112
120183
  resizeHandles,
120113
- handle: resizeHandle
120184
+ handle: resizeHandle2
120114
120185
  },
120115
120186
  child
120116
120187
  );
@@ -120827,7 +120898,7 @@ var ReactGridLayout = /* @__PURE__ */ function(_React$Component) {
120827
120898
  var l2 = (0, _utils$2.getLayoutItem)(this.state.layout, String(child.key));
120828
120899
  if (!l2)
120829
120900
  return null;
120830
- 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;
120901
+ 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;
120831
120902
  var _this$state3 = this.state, mounted = _this$state3.mounted, droppingPosition = _this$state3.droppingPosition;
120832
120903
  var draggable = typeof l2.isDraggable === "boolean" ? l2.isDraggable : !l2.static && isDraggable;
120833
120904
  var resizable2 = typeof l2.isResizable === "boolean" ? l2.isResizable : !l2.static && isResizable;
@@ -120866,7 +120937,7 @@ var ReactGridLayout = /* @__PURE__ */ function(_React$Component) {
120866
120937
  static: l2.static,
120867
120938
  droppingPosition: isDroppingItem ? droppingPosition : void 0,
120868
120939
  resizeHandles: resizeHandlesOptions,
120869
- resizeHandle
120940
+ resizeHandle: resizeHandle2
120870
120941
  }, child);
120871
120942
  }
120872
120943
  }, {
@@ -121663,46 +121734,51 @@ function WidthProvideRGL(ComposedComponent) {
121663
121734
  module.exports.WidthProvider = WidthProvider.default;
121664
121735
  })(reactGridLayout);
121665
121736
  var styles$c = "";
121737
+ const resizeHandle = "_resizeHandle_170un_17";
121738
+ const fullscreen$2 = "_fullscreen_170un_57";
121666
121739
  var styles$b = {
121667
- "MetricList-container": "_MetricList-container_15a2v_1",
121668
- "MetricList-wrapper": "_MetricList-wrapper_15a2v_9",
121669
- "MetricList-wrapper-move": "_MetricList-wrapper-move_15a2v_17",
121670
- "noMetric-container": "_noMetric-container_15a2v_25",
121671
- "noMetric-wrapper": "_noMetric-wrapper_15a2v_33",
121672
- "alt-container": "_alt-container_15a2v_41"
121740
+ "MetricList-container": "_MetricList-container_170un_1",
121741
+ "MetricList-wrapper": "_MetricList-wrapper_170un_9",
121742
+ resizeHandle,
121743
+ "MetricList-wrapper-move": "_MetricList-wrapper-move_170un_25",
121744
+ "noMetric-container": "_noMetric-container_170un_33",
121745
+ "noMetric-wrapper": "_noMetric-wrapper_170un_41",
121746
+ "alt-container": "_alt-container_170un_49",
121747
+ fullscreen: fullscreen$2
121673
121748
  };
121674
- const cardContainer = "_cardContainer_hxh6o_1";
121675
- const listHeader = "_listHeader_hxh6o_9";
121676
- const metricName = "_metricName_hxh6o_17";
121677
- const metricTitle = "_metricTitle_hxh6o_25";
121678
- const metricDescription = "_metricDescription_hxh6o_33";
121679
- const popup = "_popup_hxh6o_41";
121680
- const metricFilter$1 = "_metricFilter_hxh6o_49";
121681
- const popupIcon = "_popupIcon_hxh6o_57";
121682
- const popupMenu = "_popupMenu_hxh6o_65";
121683
- const popupItem = "_popupItem_hxh6o_73";
121684
- const popupItemIcon = "_popupItemIcon_hxh6o_81";
121685
- const csvBtn = "_csvBtn_hxh6o_89";
121686
- const deleteBtn = "_deleteBtn_hxh6o_97";
121687
- const metricData = "_metricData_hxh6o_105";
121688
- const singleValueData = "_singleValueData_hxh6o_113";
121689
- const singleValue = "_singleValue_hxh6o_113";
121690
- const noData = "_noData_hxh6o_129";
121691
- const noDataContent = "_noDataContent_hxh6o_137";
121692
- const noDataText = "_noDataText_hxh6o_145";
121693
- const loading$1 = "_loading_hxh6o_153";
121694
- const features = "_features_hxh6o_161";
121695
- const fullscreen$1 = "_fullscreen_hxh6o_169";
121696
- const deleteModal = "_deleteModal_hxh6o_177";
121697
- const cancelBtn = "_cancelBtn_hxh6o_185";
121698
- const warningIcon = "_warningIcon_hxh6o_193";
121699
- const downloadCsv = "_downloadCsv_hxh6o_201";
121700
- const downloadCsvWrapper = "_downloadCsvWrapper_hxh6o_209";
121701
- const downloadCsvHeader = "_downloadCsvHeader_hxh6o_215";
121702
- const downloadCsvFooter = "_downloadCsvFooter_hxh6o_221";
121703
- const downloadCsvCancelBtn = "_downloadCsvCancelBtn_hxh6o_229";
121704
- const downloadCsvNote = "_downloadCsvNote_hxh6o_237";
121705
- const downloadCsvNoteText = "_downloadCsvNoteText_hxh6o_245";
121749
+ const cardContainer = "_cardContainer_2m9mz_1";
121750
+ const listHeader = "_listHeader_2m9mz_9";
121751
+ const metricName = "_metricName_2m9mz_17";
121752
+ const metricTitle = "_metricTitle_2m9mz_25";
121753
+ const metricDescription = "_metricDescription_2m9mz_33";
121754
+ const popup = "_popup_2m9mz_41";
121755
+ const metricFilter$1 = "_metricFilter_2m9mz_49";
121756
+ const popupIcon = "_popupIcon_2m9mz_57";
121757
+ const popupMenu = "_popupMenu_2m9mz_65";
121758
+ const popupItem = "_popupItem_2m9mz_73";
121759
+ const popupItemIcon = "_popupItemIcon_2m9mz_81";
121760
+ const csvBtn = "_csvBtn_2m9mz_89";
121761
+ const deleteBtn = "_deleteBtn_2m9mz_97";
121762
+ const metricData = "_metricData_2m9mz_105";
121763
+ const metricTable = "_metricTable_2m9mz_113";
121764
+ const singleValueData = "_singleValueData_2m9mz_121";
121765
+ const singleValue = "_singleValue_2m9mz_121";
121766
+ const noData = "_noData_2m9mz_137";
121767
+ const noDataContent = "_noDataContent_2m9mz_145";
121768
+ const noDataText = "_noDataText_2m9mz_153";
121769
+ const loading$1 = "_loading_2m9mz_161";
121770
+ const features = "_features_2m9mz_169";
121771
+ const fullscreen$1 = "_fullscreen_2m9mz_177";
121772
+ const deleteModal = "_deleteModal_2m9mz_185";
121773
+ const cancelBtn = "_cancelBtn_2m9mz_193";
121774
+ const warningIcon = "_warningIcon_2m9mz_201";
121775
+ const downloadCsv = "_downloadCsv_2m9mz_209";
121776
+ const downloadCsvWrapper = "_downloadCsvWrapper_2m9mz_217";
121777
+ const downloadCsvHeader = "_downloadCsvHeader_2m9mz_225";
121778
+ const downloadCsvFooter = "_downloadCsvFooter_2m9mz_233";
121779
+ const downloadCsvCancelBtn = "_downloadCsvCancelBtn_2m9mz_241";
121780
+ const downloadCsvNote = "_downloadCsvNote_2m9mz_249";
121781
+ const downloadCsvNoteText = "_downloadCsvNoteText_2m9mz_257";
121706
121782
  var styles$a = {
121707
121783
  cardContainer,
121708
121784
  listHeader,
@@ -121718,6 +121794,7 @@ var styles$a = {
121718
121794
  csvBtn,
121719
121795
  deleteBtn,
121720
121796
  metricData,
121797
+ metricTable,
121721
121798
  singleValueData,
121722
121799
  singleValue,
121723
121800
  noData,
@@ -121735,7 +121812,9 @@ var styles$a = {
121735
121812
  downloadCsvFooter,
121736
121813
  downloadCsvCancelBtn,
121737
121814
  downloadCsvNote,
121738
- downloadCsvNoteText
121815
+ downloadCsvNoteText,
121816
+ "tab-border-bottom": "_tab-border-bottom_2m9mz_265",
121817
+ "download-info-text": "_download-info-text_2m9mz_273"
121739
121818
  };
121740
121819
  var NoData = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMDAgMzAwIj48ZGVmcz48c3R5bGU+LmNscy0xe3N0cm9rZTojMTgyYzYwO30uY2xzLTEsLmNscy0ye2ZpbGw6bm9uZTtzdHJva2UtbGluZWNhcDpyb3VuZDtzdHJva2UtbGluZWpvaW46cm91bmQ7fS5jbHMtM3tmaWxsOiM1ODY1ZjY7b3BhY2l0eTouMTt9LmNscy00e2ZpbGw6I2YyZjNmNDt9LmNscy01e2ZpbGw6I2MxYzdjOTt9LmNscy02e2ZpbGw6I2RhZGVkZjt9LmNscy03e2ZpbGw6IzE4MmM2MDt9LmNscy0ye3N0cm9rZTojNTg2NWY2O3N0cm9rZS13aWR0aDo0cHg7fTwvc3R5bGU+PC9kZWZzPjxwYXRoIGNsYXNzPSJjbHMtMSIgZD0ibTIxMC41LDIwMC44M2MuNC0uNjYuNjgtMS40LjgyLTIuMiwxLjU4LTguODcsMy4xNS0xNy43NSw0LjczLTI2LjYyLDIuMDMtMTEuNDQsNC4wNi0yMi44OCw2LjA5LTM0LjMyLjcyLTQuMDgsMS43Ny04LjI1LDIuMTYtMTIuMzguNDMtNC41Ni0yLjA5LTkuNjgtNi44Ni0xMC42Ni0uMDEsMC0uMDMsMC0uMDQsMC0yLjQtLjQ5LTUuMDItLjIyLTcuNDUtLjIyaC00NC4yMmMtLjUyLDAtMi4zMy0uMzEtMi43NywwbC0yNC4yOCwxNy4yMmgtNjEuNjFjLTMuOTcsMC02Ljk5LDMuNTYtNi4zNCw3LjQ3bDkuNzUsNTkuNDJjLjUxLDMuMTEsMy4yLDUuMzksNi4zNCw1LjM5aDExNy44NiIvPjxwYXRoIGNsYXNzP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A4Ni44MiAyMDYuNTggODYuMDEgMjA1LjAzIDg1LjY4IDIwMy45MyIvPjwvc3ZnPg==";
121741
121820
  const materialSymbolsArchiveOutline = (props) => /* @__PURE__ */ jsx("svg", {
@@ -122141,105 +122220,6 @@ const ChartPopup = ({
122141
122220
  });
122142
122221
  };
122143
122222
  var ChartPopup$1 = React__default.memo(ChartPopup);
122144
- const getSqlStatement = ({
122145
- query,
122146
- clientName,
122147
- tenancyType,
122148
- values
122149
- }) => {
122150
- const str = clientName ? tenancyType === DATABASE ? query.replace(new RegExp(DATABASE_NAME, "g"), clientName) : Number(clientName) ? query.replace(new RegExp(CLIENT_NAME_VAR_NUM, "g"), clientName) : query.replace(new RegExp(CLIENT_NAME_VAR, "g"), clientName) : query;
122151
- if (!values) {
122152
- return str;
122153
- }
122154
- const replacedStr = str.replace(/[^']+_variable/g, (match) => {
122155
- const value = values[match];
122156
- return `${value}`;
122157
- });
122158
- return replacedStr;
122159
- };
122160
- const useDownloadRawCsv = () => {
122161
- const [isShowRawCsvModal, setRawCsvModal] = useState(false);
122162
- const [isLoading, setLoading] = useState(false);
122163
- const [downloadCsvError, setError] = useState("");
122164
- const { mutate } = useRawCsvMutation();
122165
- const { handleSubmit, register: register2 } = useForm();
122166
- const onSubmitDownloadCsv = ({
122167
- companyId,
122168
- sqlQuery,
122169
- values,
122170
- clientName,
122171
- tenancyType,
122172
- metricName: metricName2,
122173
- workspaceId
122174
- }) => {
122175
- setLoading(true);
122176
- setError("");
122177
- const modifiedQuery = getSqlStatement({
122178
- query: sqlQuery,
122179
- clientName,
122180
- tenancyType,
122181
- values
122182
- });
122183
- mutate(
122184
- {
122185
- companyId,
122186
- recipientAddress: values.email,
122187
- sqlQuery: modifiedQuery,
122188
- metricName: metricName2,
122189
- workspaceId
122190
- },
122191
- {
122192
- onSuccess(data) {
122193
- var _a2, _b2;
122194
- const success2 = (_a2 = data.sendRawCsv) == null ? void 0 : _a2.status;
122195
- const error2 = (_b2 = data.sendRawCsv) == null ? void 0 : _b2.error;
122196
- if (success2) {
122197
- setError("");
122198
- setLoading(false);
122199
- setRawCsvModal(false);
122200
- } else if (error2) {
122201
- setError(error2.message);
122202
- setLoading(false);
122203
- } else {
122204
- setError(SOMETHING_WENT_WRONG);
122205
- setLoading(false);
122206
- }
122207
- }
122208
- }
122209
- );
122210
- };
122211
- return {
122212
- isShowRawCsvModal,
122213
- setRawCsvModal,
122214
- isLoading,
122215
- downloadCsvError,
122216
- onSubmitDownloadCsv,
122217
- handleSubmit,
122218
- register: register2
122219
- };
122220
- };
122221
- const required = { required: "Required" };
122222
- const asEmail = {
122223
- ...required,
122224
- pattern: {
122225
- value: /^\S+@\S+$/i,
122226
- message: "Entered value does not match email format"
122227
- }
122228
- };
122229
- ({
122230
- ...required,
122231
- minLength: {
122232
- value: 8,
122233
- message: "Min length is 8"
122234
- }
122235
- });
122236
- ({
122237
- ...required,
122238
- minLength: {
122239
- value: 3,
122240
- message: "Min length is 3"
122241
- }
122242
- });
122243
122223
  var styles$6 = {
122244
122224
  "dbc-container": "_dbc-container_1dw7c_1",
122245
122225
  "active-dimension": "_active-dimension_1dw7c_5"
@@ -122269,7 +122249,9 @@ const MetricCard = ({
122269
122249
  companyTenancyType,
122270
122250
  renderHeaderName,
122271
122251
  onArchive,
122272
- onEdit
122252
+ onEdit,
122253
+ onTableView,
122254
+ onDownloadRawCsv
122273
122255
  }) => {
122274
122256
  var _a2;
122275
122257
  const chartRef = useRef(null);
@@ -122380,7 +122362,6 @@ const MetricCard = ({
122380
122362
  const [backGroundColor, setBackGroundColor] = useState({
122381
122363
  show: false
122382
122364
  });
122383
- const [isShowTablePreview, setTablePreview] = useState(false);
122384
122365
  const [groupedData, setGroupedData] = useState([]);
122385
122366
  const [drillDownSettings, setDrillDownSettings] = useState();
122386
122367
  const [drilledLevel, setDrilledLevel] = useState(0);
@@ -122522,17 +122503,8 @@ const MetricCard = ({
122522
122503
  const onDrillDown = () => {
122523
122504
  drilldown(columnName, chartParams, drillDownSettings, dataDb, setDrilledLevel, drilledLevel, setShowChartPopup, setGroupedData);
122524
122505
  };
122525
- const {
122526
- isShowRawCsvModal,
122527
- setRawCsvModal,
122528
- downloadCsvError,
122529
- handleSubmit,
122530
- isLoading,
122531
- onSubmitDownloadCsv,
122532
- register: register2
122533
- } = useDownloadRawCsv();
122534
- return /* @__PURE__ */ jsxs(Fragment, {
122535
- children: [/* @__PURE__ */ jsxs("div", {
122506
+ return /* @__PURE__ */ jsx(Fragment, {
122507
+ children: /* @__PURE__ */ jsxs("div", {
122536
122508
  className: styles$a.cardContainer,
122537
122509
  onContextMenu: (e2) => {
122538
122510
  e2.preventDefault();
@@ -122618,20 +122590,20 @@ const MetricCard = ({
122618
122590
  text: "Save As CSV",
122619
122591
  iconClass: styles$a.popupItemIcon
122620
122592
  }), !!dataDb.length && /* @__PURE__ */ jsxs(Fragment, {
122621
- children: [/* @__PURE__ */ jsxs(Button, {
122593
+ children: [onTableView && /* @__PURE__ */ jsxs(Button, {
122622
122594
  variant: "custom",
122623
122595
  type: "button",
122624
122596
  className: `${styles$a.popupItem} ${styles$a.csvBtn}`,
122625
- onClick: () => setTablePreview(true),
122597
+ onClick: () => onTableView(metricItem, dataDb),
122626
122598
  children: [/* @__PURE__ */ jsx(Icons, {
122627
122599
  name: "table-tab-icon",
122628
122600
  className: styles$a.popupItemIcon
122629
122601
  }), "View As Table"]
122630
- }), /* @__PURE__ */ jsxs(Button, {
122602
+ }), onDownloadRawCsv && /* @__PURE__ */ jsxs(Button, {
122631
122603
  variant: "custom",
122632
122604
  type: "button",
122633
122605
  className: `${styles$a.popupItem} ${styles$a.csvBtn}`,
122634
- onClick: () => setRawCsvModal(true),
122606
+ onClick: () => onDownloadRawCsv(metricItem),
122635
122607
  children: [/* @__PURE__ */ jsx(Icons, {
122636
122608
  name: "csv-icon",
122637
122609
  className: styles$a.popupItemIcon
@@ -122656,11 +122628,8 @@ const MetricCard = ({
122656
122628
  })]
122657
122629
  })]
122658
122630
  })]
122659
- }), (drillDownSettings == null ? void 0 : drillDownSettings.isEnableGroupBy) && /* @__PURE__ */ jsx(DrillBreadCrumb, {
122660
- dimensions: drillDownSettings.selectedDimensions,
122661
- drilledLevel
122662
122631
  }), chartType2 && /* @__PURE__ */ jsxs("div", {
122663
- className: styles$a.metricData,
122632
+ className: `${styles$a.metricData} ${chartType2 === "table" ? styles$a.metricTable : ""}`,
122664
122633
  onContextMenu: (e2) => {
122665
122634
  e2.preventDefault();
122666
122635
  },
@@ -122687,6 +122656,9 @@ const MetricCard = ({
122687
122656
  color: "blue"
122688
122657
  }
122689
122658
  })
122659
+ }), (drillDownSettings == null ? void 0 : drillDownSettings.isEnableGroupBy) && /* @__PURE__ */ jsx(DrillBreadCrumb, {
122660
+ dimensions: drillDownSettings.selectedDimensions,
122661
+ drilledLevel
122690
122662
  }), (chartParams == null ? void 0 : chartParams.name) && columnName && /* @__PURE__ */ jsx(ChartPopup$1, {
122691
122663
  isOpen: isShowChartPopup,
122692
122664
  setOpen: setShowChartPopup,
@@ -122719,82 +122691,7 @@ const MetricCard = ({
122719
122691
  handleChartRightClick
122720
122692
  }) : null]
122721
122693
  })]
122722
- }), !!dataDb.length && /* @__PURE__ */ jsx(Modal, {
122723
- isOpen: isShowTablePreview,
122724
- onClose: () => setTablePreview(false),
122725
- headerTitle: metricItem.name,
122726
- children: /* @__PURE__ */ jsx("div", {
122727
- className: styles$a.fullscreen,
122728
- children: /* @__PURE__ */ jsx(Table, {
122729
- data: dataDb,
122730
- isLoading: isQueryLoading,
122731
- error: ""
122732
- })
122733
- })
122734
- }), /* @__PURE__ */ jsx(Modal, {
122735
- isOpen: isShowRawCsvModal,
122736
- onClose: () => setRawCsvModal(false),
122737
- headerTitle: "Download Raw csv",
122738
- children: /* @__PURE__ */ jsxs("form", {
122739
- className: styles$a.downloadCsv,
122740
- onSubmit: handleSubmit((values) => {
122741
- var _a3;
122742
- return onSubmitDownloadCsv({
122743
- values,
122744
- sqlQuery: metricItem.query,
122745
- companyId: metricItem.companyId,
122746
- clientName: client,
122747
- tenancyType: companyTenancyType,
122748
- metricName: metricItem == null ? void 0 : metricItem.name,
122749
- workspaceId: (_a3 = metricItem == null ? void 0 : metricItem.companyIntegration) == null ? void 0 : _a3.workspaceId
122750
- });
122751
- }),
122752
- children: [/* @__PURE__ */ jsxs("div", {
122753
- className: styles$a.downloadCsvWrapper,
122754
- children: [/* @__PURE__ */ jsx(InputField, {
122755
- type: "email",
122756
- label: "email",
122757
- placeholder: "enter a valid email",
122758
- register: register2("email", asEmail)
122759
- }), /* @__PURE__ */ jsx(Error$1, {
122760
- message: downloadCsvError
122761
- }), /* @__PURE__ */ jsxs("div", {
122762
- className: styles$a.downloadCsvNote,
122763
- children: [/* @__PURE__ */ jsx(Icons, {
122764
- name: "info-icon",
122765
- className: styles$a.popupItemIcon
122766
- }), /* @__PURE__ */ jsxs("div", {
122767
- className: styles$a.downloadCsvNoteText,
122768
- children: [/* @__PURE__ */ jsx(Text, {
122769
- styleClass: "primary",
122770
- variant: "h1",
122771
- children: "Note:"
122772
- }), /* @__PURE__ */ jsx(Text, {
122773
- styleClass: "font-14",
122774
- variant: "p",
122775
- children: "You will shortly receive a mail with CSV attached to the above email id, once you click on Submit"
122776
- })]
122777
- })]
122778
- })]
122779
- }), /* @__PURE__ */ jsxs(ModalFooter, {
122780
- children: [/* @__PURE__ */ jsx(Button, {
122781
- variant: "custom",
122782
- type: "button",
122783
- size: "small",
122784
- className: styles$a.downloadCsvCancelBtn,
122785
- onClick: () => setRawCsvModal(false),
122786
- isDisabled: isLoading,
122787
- children: "Cancel"
122788
- }), /* @__PURE__ */ jsx(Button, {
122789
- variant: "primary",
122790
- type: "submit",
122791
- size: "small",
122792
- isDisabled: isLoading,
122793
- children: "Submit"
122794
- })]
122795
- })]
122796
- })
122797
- })]
122694
+ })
122798
122695
  });
122799
122696
  };
122800
122697
  const SingleValueCard = ({
@@ -123196,6 +123093,443 @@ const LayoutAlert = ({
123196
123093
  })
123197
123094
  });
123198
123095
  };
123096
+ const timeAgo = (unixTimestamp) => {
123097
+ const now = Date.now();
123098
+ const diff2 = now - unixTimestamp;
123099
+ const units = [
123100
+ { label: "year", duration: 1e3 * 60 * 60 * 24 * 365 },
123101
+ { label: "month", duration: 1e3 * 60 * 60 * 24 * 30 },
123102
+ { label: "week", duration: 1e3 * 60 * 60 * 24 * 7 },
123103
+ { label: "day", duration: 1e3 * 60 * 60 * 24 },
123104
+ { label: "hour", duration: 1e3 * 60 * 60 },
123105
+ { label: "minute", duration: 1e3 * 60 },
123106
+ { label: "second", duration: 1e3 },
123107
+ { label: "millisecond", duration: 1 }
123108
+ ];
123109
+ for (const unit of units) {
123110
+ const numUnitsAgo = Math.floor(diff2 / unit.duration);
123111
+ if (numUnitsAgo >= 1) {
123112
+ return `${numUnitsAgo} ${unit.label}${numUnitsAgo > 1 ? "s" : ""} ago`;
123113
+ }
123114
+ }
123115
+ return "just now";
123116
+ };
123117
+ const getSqlStatement = ({
123118
+ query,
123119
+ clientName,
123120
+ tenancyType,
123121
+ values
123122
+ }) => {
123123
+ const str = clientName ? tenancyType === DATABASE ? query.replace(new RegExp(DATABASE_NAME, "g"), clientName) : Number(clientName) ? query.replace(new RegExp(CLIENT_NAME_VAR_NUM, "g"), clientName) : query.replace(new RegExp(CLIENT_NAME_VAR, "g"), clientName) : query;
123124
+ if (!values) {
123125
+ return str;
123126
+ }
123127
+ const replacedStr = str.replace(/[^']+_variable/g, (match) => {
123128
+ const value = values[match];
123129
+ return `${value}`;
123130
+ });
123131
+ return replacedStr;
123132
+ };
123133
+ const useDownloadRawCsv = (onCloseModal, metricItem) => {
123134
+ const [csvDownloadUrlError, setCsvDownloadUrlError] = useState("");
123135
+ const [isLoading, setLoading] = useState(false);
123136
+ const [downloadCsvError, setError] = useState("");
123137
+ const { mutate } = useRawCsvMutation();
123138
+ const { mutate: invokeSaveRawCsvDetailsMutation } = useInvokeSaveRawCsvDetailsMutation();
123139
+ const { handleSubmit, register: register2 } = useForm();
123140
+ const { data: RawCsvUrlsData } = useExternalMetricRawCsvUrlsQuery(
123141
+ { externalMetricId: metricItem == null ? void 0 : metricItem.id },
123142
+ { enabled: !!(metricItem == null ? void 0 : metricItem.id) }
123143
+ );
123144
+ const isLinkExpired = (url) => {
123145
+ const queryString = url.split("?")[1];
123146
+ const params = new URLSearchParams(queryString);
123147
+ const expires = parseInt(params.get("Expires"), 10);
123148
+ const currentTime = Math.floor(Date.now() / 1e3);
123149
+ const secondsLeft = expires - currentTime;
123150
+ return { isExpired: currentTime > expires, secondsLeft };
123151
+ };
123152
+ const getUrls = (urls) => {
123153
+ try {
123154
+ return JSON.parse(urls);
123155
+ } catch {
123156
+ return [];
123157
+ }
123158
+ };
123159
+ const csvDownloadUrls = useMemo(() => {
123160
+ if (RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls.length) {
123161
+ const urls = getUrls(RawCsvUrlsData.externalMetricRawCsvUrls[0].urls);
123162
+ return {
123163
+ urls,
123164
+ lastUpdatedAt: timeAgo(
123165
+ Date.parse(RawCsvUrlsData.externalMetricRawCsvUrls[0].lastUpdatedAt)
123166
+ ),
123167
+ isExpired: urls.length ? isLinkExpired(urls[0]).isExpired : true,
123168
+ error: RawCsvUrlsData.externalMetricRawCsvUrls[0].error,
123169
+ expireUrlIn: urls.length ? isLinkExpired(urls[0]).secondsLeft : 0
123170
+ };
123171
+ }
123172
+ return {
123173
+ urls: [],
123174
+ lastUpdatedAt: 0,
123175
+ isExpired: true,
123176
+ error: null,
123177
+ expireUrlIn: 0
123178
+ };
123179
+ }, [RawCsvUrlsData == null ? void 0 : RawCsvUrlsData.externalMetricRawCsvUrls]);
123180
+ const handleDownload = (url) => {
123181
+ setCsvDownloadUrlError("");
123182
+ fetch(url).then((response) => {
123183
+ if (!response.ok) {
123184
+ if (response.status === 403) {
123185
+ setCsvDownloadUrlError("download link is expired");
123186
+ } else {
123187
+ setCsvDownloadUrlError("something went wrong");
123188
+ }
123189
+ }
123190
+ return response.blob();
123191
+ }).then((blob) => {
123192
+ const csvUrl = URL.createObjectURL(blob);
123193
+ const a2 = document.createElement("a");
123194
+ a2.download = `${metricItem == null ? void 0 : metricItem.name}.csv`;
123195
+ a2.href = csvUrl;
123196
+ document.body.appendChild(a2);
123197
+ a2.click();
123198
+ document.body.removeChild(a2);
123199
+ }).catch(() => {
123200
+ setCsvDownloadUrlError(
123201
+ "There was an error downloading the CSV file. Please try again later."
123202
+ );
123203
+ });
123204
+ };
123205
+ const onSubmitDownloadCsv = ({
123206
+ companyId,
123207
+ sqlQuery,
123208
+ values,
123209
+ clientName,
123210
+ tenancyType,
123211
+ metricName: metricName2,
123212
+ workspaceId
123213
+ }) => {
123214
+ setLoading(true);
123215
+ setError("");
123216
+ const modifiedQuery = getSqlStatement({
123217
+ query: sqlQuery,
123218
+ clientName,
123219
+ tenancyType,
123220
+ values
123221
+ });
123222
+ mutate(
123223
+ {
123224
+ companyId,
123225
+ recipientAddress: values.email,
123226
+ sqlQuery: modifiedQuery,
123227
+ metricName: metricName2,
123228
+ workspaceId
123229
+ },
123230
+ {
123231
+ onSuccess(data) {
123232
+ var _a2, _b2;
123233
+ const success2 = (_a2 = data.sendRawCsv) == null ? void 0 : _a2.status;
123234
+ const error2 = (_b2 = data.sendRawCsv) == null ? void 0 : _b2.error;
123235
+ if (success2) {
123236
+ setError("");
123237
+ setLoading(false);
123238
+ onCloseModal(false);
123239
+ } else if (error2) {
123240
+ setError(error2.message);
123241
+ setLoading(false);
123242
+ } else {
123243
+ setError(SOMETHING_WENT_WRONG);
123244
+ setLoading(false);
123245
+ }
123246
+ }
123247
+ }
123248
+ );
123249
+ };
123250
+ const saveRawCsvDetails = ({
123251
+ values,
123252
+ clientName,
123253
+ tenancyType
123254
+ }) => {
123255
+ setLoading(true);
123256
+ setError("");
123257
+ invokeSaveRawCsvDetailsMutation(
123258
+ {
123259
+ configurations: { metricItem, fieldValues: values },
123260
+ expireCsvFileAt: values.expireCsvFileAt,
123261
+ expireUrlIn: parseInt(values.expireUrlIn, 10),
123262
+ externalMetricId: metricItem == null ? void 0 : metricItem.id,
123263
+ integrationId: metricItem == null ? void 0 : metricItem.companyIntegrationId,
123264
+ integrationName: metricItem == null ? void 0 : metricItem.integrationName,
123265
+ query: getSqlStatement({
123266
+ query: metricItem == null ? void 0 : metricItem.query,
123267
+ clientName,
123268
+ tenancyType,
123269
+ values
123270
+ })
123271
+ },
123272
+ {
123273
+ onSuccess({ invokeSaveRawCsvDetails }) {
123274
+ if (invokeSaveRawCsvDetails == null ? void 0 : invokeSaveRawCsvDetails.statusCode) {
123275
+ setLoading(false);
123276
+ onCloseModal(false);
123277
+ } else if (invokeSaveRawCsvDetails == null ? void 0 : invokeSaveRawCsvDetails.error) {
123278
+ setLoading(false);
123279
+ setError(invokeSaveRawCsvDetails.error);
123280
+ } else {
123281
+ setLoading(false);
123282
+ setError(SOMETHING_WENT_WRONG);
123283
+ }
123284
+ },
123285
+ onError() {
123286
+ setLoading(false);
123287
+ setError(SOMETHING_WENT_WRONG);
123288
+ }
123289
+ }
123290
+ );
123291
+ };
123292
+ return {
123293
+ isLoading,
123294
+ downloadCsvError,
123295
+ onSubmitDownloadCsv,
123296
+ handleSubmit,
123297
+ register: register2,
123298
+ csvDownloadUrls,
123299
+ handleDownload,
123300
+ csvDownloadUrlError,
123301
+ saveRawCsvDetails
123302
+ };
123303
+ };
123304
+ const required = { required: "Required" };
123305
+ const asEmail = {
123306
+ ...required,
123307
+ pattern: {
123308
+ value: /^\S+@\S+$/i,
123309
+ message: "Entered value does not match email format"
123310
+ }
123311
+ };
123312
+ ({
123313
+ ...required,
123314
+ minLength: {
123315
+ value: 8,
123316
+ message: "Min length is 8"
123317
+ }
123318
+ });
123319
+ ({
123320
+ ...required,
123321
+ minLength: {
123322
+ value: 3,
123323
+ message: "Min length is 3"
123324
+ }
123325
+ });
123326
+ const DownloadRawCsvModal = ({
123327
+ onCloseModal,
123328
+ isShowRawCsvModal,
123329
+ metricItem,
123330
+ client,
123331
+ companyTenancyType
123332
+ }) => {
123333
+ const [rawCsvType, setRawCsvType] = useState(RAW_CSV_OPTIONS[0]);
123334
+ const {
123335
+ downloadCsvError,
123336
+ handleSubmit,
123337
+ isLoading,
123338
+ onSubmitDownloadCsv,
123339
+ register: register2,
123340
+ csvDownloadUrls,
123341
+ handleDownload,
123342
+ csvDownloadUrlError,
123343
+ saveRawCsvDetails
123344
+ } = useDownloadRawCsv(onCloseModal, metricItem);
123345
+ return /* @__PURE__ */ jsx(Modal, {
123346
+ isOpen: isShowRawCsvModal,
123347
+ onClose: () => onCloseModal(false),
123348
+ headerTitle: "Raw CSV",
123349
+ children: /* @__PURE__ */ jsxs("div", {
123350
+ className: styles$a.downloadCsv,
123351
+ children: [/* @__PURE__ */ jsx(Tab, {
123352
+ activeTab: rawCsvType,
123353
+ options: RAW_CSV_OPTIONS,
123354
+ setActiveTab: setRawCsvType,
123355
+ className: styles$a["tab-border-bottom"]
123356
+ }), rawCsvType === RAW_CSV_OPTIONS[1] && /* @__PURE__ */ jsxs("form", {
123357
+ onSubmit: handleSubmit((values) => onSubmitDownloadCsv({
123358
+ values,
123359
+ sqlQuery: metricItem == null ? void 0 : metricItem.query,
123360
+ companyId: metricItem == null ? void 0 : metricItem.companyId,
123361
+ clientName: client,
123362
+ tenancyType: companyTenancyType,
123363
+ metricName: metricItem == null ? void 0 : metricItem.name,
123364
+ workspaceId: metricItem == null ? void 0 : metricItem.companyIntegration.workspaceId
123365
+ })),
123366
+ children: [/* @__PURE__ */ jsxs("div", {
123367
+ className: styles$a.downloadCsvWrapper,
123368
+ children: [/* @__PURE__ */ jsx(InputField, {
123369
+ type: "email",
123370
+ label: "email",
123371
+ placeholder: "enter a valid email",
123372
+ register: register2("email", asEmail)
123373
+ }), downloadCsvError && /* @__PURE__ */ jsx(Error$1, {
123374
+ message: downloadCsvError
123375
+ }), /* @__PURE__ */ jsxs("div", {
123376
+ className: styles$a.downloadCsvNote,
123377
+ children: [/* @__PURE__ */ jsx(Icons, {
123378
+ name: "info-icon",
123379
+ className: styles$a.popupItemIcon
123380
+ }), /* @__PURE__ */ jsxs("div", {
123381
+ className: styles$a.downloadCsvNoteText,
123382
+ children: [/* @__PURE__ */ jsx(Text, {
123383
+ styleClass: "primary",
123384
+ variant: "h1",
123385
+ children: "Note:"
123386
+ }), /* @__PURE__ */ jsx(Text, {
123387
+ styleClass: "font-14",
123388
+ variant: "p",
123389
+ children: "You will shortly receive a mail with CSV attached to the above email id, once you click on Submit"
123390
+ })]
123391
+ })]
123392
+ })]
123393
+ }), /* @__PURE__ */ jsxs(ModalFooter, {
123394
+ children: [/* @__PURE__ */ jsx(Button, {
123395
+ variant: "custom",
123396
+ type: "button",
123397
+ size: "small",
123398
+ className: styles$a.downloadCsvCancelBtn,
123399
+ onClick: () => onCloseModal(false),
123400
+ isDisabled: isLoading,
123401
+ children: "Cancel"
123402
+ }), /* @__PURE__ */ jsx(Button, {
123403
+ variant: "primary",
123404
+ type: "submit",
123405
+ size: "small",
123406
+ isDisabled: isLoading,
123407
+ children: "Submit"
123408
+ })]
123409
+ })]
123410
+ }), rawCsvType === RAW_CSV_OPTIONS[0] && /* @__PURE__ */ jsx("div", {
123411
+ children: !csvDownloadUrls.isExpired ? /* @__PURE__ */ jsxs(Fragment, {
123412
+ children: [/* @__PURE__ */ jsxs("div", {
123413
+ className: styles$a.downloadCsvWrapper,
123414
+ children: [/* @__PURE__ */ jsxs(Text, {
123415
+ variant: "p",
123416
+ styleClass: "primary",
123417
+ children: ["Last download request:", /* @__PURE__ */ jsx("span", {
123418
+ className: styles$a["download-info-text"],
123419
+ children: csvDownloadUrls.lastUpdatedAt
123420
+ })]
123421
+ }), /* @__PURE__ */ jsxs(Text, {
123422
+ variant: "p",
123423
+ styleClass: "primary",
123424
+ children: ["Url will expire in :", /* @__PURE__ */ jsxs("span", {
123425
+ className: styles$a["download-info-text"],
123426
+ children: [csvDownloadUrls.expireUrlIn, " sec"]
123427
+ })]
123428
+ }), csvDownloadUrlError && /* @__PURE__ */ jsx(Error$1, {
123429
+ message: csvDownloadUrlError
123430
+ })]
123431
+ }), /* @__PURE__ */ jsxs(ModalFooter, {
123432
+ children: [/* @__PURE__ */ jsx(Button, {
123433
+ variant: "custom",
123434
+ type: "button",
123435
+ size: "small",
123436
+ className: styles$a.downloadCsvCancelBtn,
123437
+ onClick: () => onCloseModal(false),
123438
+ isDisabled: isLoading,
123439
+ children: "Cancel"
123440
+ }), csvDownloadUrls.urls.map((url) => /* @__PURE__ */ jsx(Button, {
123441
+ variant: "primary",
123442
+ type: "button",
123443
+ size: "medium",
123444
+ onClick: () => handleDownload(url),
123445
+ children: "Download"
123446
+ }))]
123447
+ })]
123448
+ }) : /* @__PURE__ */ jsxs("form", {
123449
+ onSubmit: handleSubmit((values) => saveRawCsvDetails({
123450
+ values,
123451
+ clientName: client,
123452
+ tenancyType: companyTenancyType
123453
+ })),
123454
+ children: [/* @__PURE__ */ jsxs("div", {
123455
+ className: styles$a.downloadCsvWrapper,
123456
+ children: [/* @__PURE__ */ jsx(InputField, {
123457
+ type: "date",
123458
+ label: "File Expire",
123459
+ placeholder: "select expire date for file",
123460
+ register: register2("expireCsvFileAt"),
123461
+ 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))"
123462
+ }), /* @__PURE__ */ jsx(InputField, {
123463
+ type: "number",
123464
+ label: "Download URL expire (sec)",
123465
+ placeholder: "120",
123466
+ register: register2("expireUrlIn"),
123467
+ defaultValue: 120,
123468
+ min: 60
123469
+ }), /* @__PURE__ */ jsxs("div", {
123470
+ className: styles$a.downloadCsvNote,
123471
+ children: [/* @__PURE__ */ jsx(Icons, {
123472
+ name: "info-icon",
123473
+ className: styles$a.popupItemIcon
123474
+ }), /* @__PURE__ */ jsxs("div", {
123475
+ className: styles$a.downloadCsvNoteText,
123476
+ children: [/* @__PURE__ */ jsx(Text, {
123477
+ styleClass: "primary",
123478
+ variant: "h1",
123479
+ children: "Note:"
123480
+ }), /* @__PURE__ */ jsx(Text, {
123481
+ styleClass: "font-14",
123482
+ variant: "p",
123483
+ children: "Please check again in some time, download link will be available."
123484
+ })]
123485
+ })]
123486
+ }), csvDownloadUrls.error && /* @__PURE__ */ jsx(Error$1, {
123487
+ message: csvDownloadUrls.error
123488
+ }), downloadCsvError && /* @__PURE__ */ jsx(Error$1, {
123489
+ message: downloadCsvError
123490
+ })]
123491
+ }), /* @__PURE__ */ jsxs(ModalFooter, {
123492
+ children: [/* @__PURE__ */ jsx(Button, {
123493
+ variant: "custom",
123494
+ type: "button",
123495
+ size: "small",
123496
+ className: styles$a.downloadCsvCancelBtn,
123497
+ onClick: () => onCloseModal(false),
123498
+ isDisabled: isLoading,
123499
+ children: "Cancel"
123500
+ }), /* @__PURE__ */ jsx(Button, {
123501
+ variant: "primary",
123502
+ type: "submit",
123503
+ size: "small",
123504
+ isDisabled: isLoading,
123505
+ children: "Submit"
123506
+ })]
123507
+ })]
123508
+ })
123509
+ })]
123510
+ })
123511
+ });
123512
+ };
123513
+ const TableViewModal = ({
123514
+ metricData: metricData2,
123515
+ isOpen,
123516
+ onClose,
123517
+ title: title2
123518
+ }) => {
123519
+ return /* @__PURE__ */ jsx(Modal, {
123520
+ isOpen,
123521
+ onClose: () => onClose(),
123522
+ headerTitle: title2,
123523
+ children: /* @__PURE__ */ jsx("div", {
123524
+ className: styles$a.fullscreen,
123525
+ children: /* @__PURE__ */ jsx(Table, {
123526
+ data: metricData2 || [],
123527
+ isLoading: false,
123528
+ error: ""
123529
+ })
123530
+ })
123531
+ });
123532
+ };
123199
123533
  const GridLayout = reactGridLayout.exports.WidthProvider(reactGridLayout.exports.Responsive);
123200
123534
  const ExternalMetricList = ({
123201
123535
  chartColors,
@@ -123216,6 +123550,7 @@ const ExternalMetricList = ({
123216
123550
  companyId,
123217
123551
  workspaceId
123218
123552
  }) => {
123553
+ var _a2;
123219
123554
  const [isFullScreen, setFullScreen] = useState(false);
123220
123555
  const [archiveModal, setArchiveModal] = useState({
123221
123556
  id: "",
@@ -123228,6 +123563,12 @@ const ExternalMetricList = ({
123228
123563
  const [editModal, setEditModal] = useState({
123229
123564
  show: false
123230
123565
  });
123566
+ const [tableViewModal, setTableViewModal] = useState({
123567
+ show: false
123568
+ });
123569
+ const [rawCsvModal, setRawCsvModal] = useState({
123570
+ show: false
123571
+ });
123231
123572
  const [fullScreenChart, setFullScreenChart] = useState();
123232
123573
  const {
123233
123574
  saveLayout,
@@ -123261,12 +123602,19 @@ const ExternalMetricList = ({
123261
123602
  x: (cardLayout == null ? void 0 : cardLayout.x) || metric.resizeAttributes.xAxis || 0,
123262
123603
  y: (cardLayout == null ? void 0 : cardLayout.y) || metric.resizeAttributes.yAxis || 0,
123263
123604
  minW: 3,
123264
- minH: 6,
123265
- maxH: 15
123605
+ minH: metric.chartOptions.chartType !== "single value" ? 8 : 5,
123606
+ maxH: metric.chartOptions.chartType === "table" ? Infinity : 15
123266
123607
  };
123267
123608
  });
123268
123609
  return [allMetricList, layoutAttributes];
123269
123610
  }, [externalDashboardMetrics, layout3]);
123611
+ useEffect(() => {
123612
+ if (!metricsList.length || !metricsLayout.length)
123613
+ return;
123614
+ document.querySelectorAll(".react-resizable-handle").forEach((el) => {
123615
+ el.classList.add(styles$b.resizeHandle);
123616
+ });
123617
+ }, [metricsList.length && metricsLayout.length]);
123270
123618
  return /* @__PURE__ */ jsx(Fragment, {
123271
123619
  children: metricsList.length && metricsLayout.length ? /* @__PURE__ */ jsxs(Fragment, {
123272
123620
  children: [/* @__PURE__ */ jsxs("div", {
@@ -123346,10 +123694,37 @@ const ExternalMetricList = ({
123346
123694
  show: true,
123347
123695
  metric,
123348
123696
  metricData: metricData2
123349
- }) : void 0
123697
+ }) : void 0,
123698
+ onTableView: (metric, metricData2) => setTableViewModal({
123699
+ show: true,
123700
+ metricData: metricData2,
123701
+ metric
123702
+ }),
123703
+ onDownloadRawCsv: (metric) => setRawCsvModal({
123704
+ metric,
123705
+ show: true
123706
+ })
123350
123707
  })
123351
123708
  }, metricItem.id))
123352
123709
  })]
123710
+ }), /* @__PURE__ */ jsx(TableViewModal, {
123711
+ onClose: () => setTableViewModal({
123712
+ show: false,
123713
+ metric: void 0,
123714
+ metricData: void 0
123715
+ }),
123716
+ isOpen: tableViewModal.show,
123717
+ title: ((_a2 = tableViewModal.metric) == null ? void 0 : _a2.name) || "Table view",
123718
+ metricData: tableViewModal.metricData
123719
+ }), /* @__PURE__ */ jsx(DownloadRawCsvModal, {
123720
+ client,
123721
+ companyTenancyType,
123722
+ isShowRawCsvModal: rawCsvModal.show,
123723
+ metricItem: rawCsvModal.metric,
123724
+ onCloseModal: (value) => setRawCsvModal({
123725
+ metric: void 0,
123726
+ show: value
123727
+ })
123353
123728
  }), /* @__PURE__ */ jsx(FullScreenChart, {
123354
123729
  onCancel: () => setFullScreen(false),
123355
123730
  isShow: isFullScreen,
@@ -123515,6 +123890,8 @@ var index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
123515
123890
  SingleValueCard,
123516
123891
  ArchiveMetricModal,
123517
123892
  LayoutAlert,
123893
+ TableViewModal,
123894
+ DownloadRawCsvModal,
123518
123895
  MetricTable,
123519
123896
  Modal,
123520
123897
  ModalFooter,