@databrainhq/plugin 0.8.3 → 0.8.4

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
@@ -1,5 +1,5 @@
1
1
  import * as React$6 from "react";
2
- import React__default, { useEffect, useLayoutEffect, useRef, useState, forwardRef, Fragment as Fragment$1, isValidElement, cloneElement as cloneElement$1, createElement as createElement$1, createContext, useContext, useReducer, createRef, useMemo, PureComponent, memo as memo$1 } from "react";
2
+ import React__default, { useEffect, useLayoutEffect, useRef, useState, forwardRef, Fragment as Fragment$1, isValidElement, cloneElement as cloneElement$1, createElement as createElement$1, createContext, useContext, useReducer, createRef, useMemo, useCallback, PureComponent, memo as memo$1 } from "react";
3
3
  import ReactDOM from "react-dom";
4
4
  function _setPrototypeOf$7(o2, p2) {
5
5
  _setPrototypeOf$7 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o3, p3) {
@@ -2641,17 +2641,17 @@ var classnames$1 = { exports: {} };
2641
2641
  })(classnames$1);
2642
2642
  var classnames = classnames$1.exports;
2643
2643
  var styles$E = {
2644
- "btn-primary": "_btn-primary_u81u9_1",
2645
- "btn-secondary": "_btn-secondary_u81u9_9",
2646
- "btn-reject": "_btn-reject_u81u9_17",
2647
- "btn-outlined": "_btn-outlined_u81u9_27",
2648
- "btn-tertiary": "_btn-tertiary_u81u9_35",
2649
- "btn-default": "_btn-default_u81u9_43",
2650
- "btn-large": "_btn-large_u81u9_49",
2651
- "btn-small": "_btn-small_u81u9_55",
2652
- "btn-xs": "_btn-xs_u81u9_61",
2653
- "btn-medium": "_btn-medium_u81u9_67",
2654
- "btn-11rem": "_btn-11rem_u81u9_75"
2644
+ "btn-primary": "_btn-primary_17kvk_1",
2645
+ "btn-secondary": "_btn-secondary_17kvk_5",
2646
+ "btn-reject": "_btn-reject_17kvk_9",
2647
+ "btn-outlined": "_btn-outlined_17kvk_14",
2648
+ "btn-tertiary": "_btn-tertiary_17kvk_18",
2649
+ "btn-default": "_btn-default_17kvk_22",
2650
+ "btn-large": "_btn-large_17kvk_25",
2651
+ "btn-small": "_btn-small_17kvk_28",
2652
+ "btn-xs": "_btn-xs_17kvk_31",
2653
+ "btn-medium": "_btn-medium_17kvk_34",
2654
+ "btn-11rem": "_btn-11rem_17kvk_38"
2655
2655
  };
2656
2656
  var jsxRuntime = { exports: {} };
2657
2657
  var reactJsxRuntime_production_min = {};
@@ -4940,37 +4940,37 @@ let xe = "div", ne = S.RenderStrategy, re = C$2(function(e2, s2) {
4940
4940
  let n2 = useContext(F) !== null, m2 = s() !== null;
4941
4941
  return React__default.createElement(React__default.Fragment, null, !n2 && m2 ? React__default.createElement(q, { ref: s$12, ...e2 }) : React__default.createElement(re, { ref: s$12, ...e2 }));
4942
4942
  }), We = Object.assign(q, { Child: Pe, Root: q });
4943
- const listBoxButton = "_listBoxButton_1uwmw_9";
4944
- const selectedOptionText = "_selectedOptionText_1uwmw_33";
4945
- const transitionDiv = "_transitionDiv_1uwmw_41";
4946
- const listboxButtonWrapper = "_listboxButtonWrapper_1uwmw_49";
4947
- const arrowicon = "_arrowicon_1uwmw_55";
4948
- const leave$2 = "_leave_1uwmw_61";
4949
- const leaveFrom$2 = "_leaveFrom_1uwmw_67";
4950
- const leaveTo$2 = "_leaveTo_1uwmw_73";
4951
- const notAvailable = "_notAvailable_1uwmw_79";
4952
- const option$1 = "_option_1uwmw_85";
4953
- const activeOption = "_activeOption_1uwmw_91";
4954
- const optionSelected = "_optionSelected_1uwmw_97";
4955
- const inactiveOption = "_inactiveOption_1uwmw_103";
4956
- const optionLabel = "_optionLabel_1uwmw_109";
4957
- const optionSubLabel = "_optionSubLabel_1uwmw_115";
4958
- const selectedLabel = "_selectedLabel_1uwmw_121";
4959
- const nonselectedLabel = "_nonselectedLabel_1uwmw_127";
4960
- const check = "_check_1uwmw_133";
4961
- const checkActive = "_checkActive_1uwmw_139";
4962
- const checkInactive = "_checkInactive_1uwmw_145";
4963
- const checkIcon$1 = "_checkIcon_1uwmw_151";
4964
- const checkIconSelected = "_checkIconSelected_1uwmw_157";
4965
- const checkIconUnselected = "_checkIconUnselected_1uwmw_163";
4966
- const loadMore$1 = "_loadMore_1uwmw_169";
4967
- const selectedList = "_selectedList_1uwmw_175";
4968
- const selectedListItem = "_selectedListItem_1uwmw_181";
4943
+ const listBoxButton = "_listBoxButton_1xd0l_5";
4944
+ const selectedOptionText = "_selectedOptionText_1xd0l_17";
4945
+ const transitionDiv = "_transitionDiv_1xd0l_21";
4946
+ const listboxButtonWrapper = "_listboxButtonWrapper_1xd0l_25";
4947
+ const arrowicon = "_arrowicon_1xd0l_28";
4948
+ const leave$2 = "_leave_1xd0l_31";
4949
+ const leaveFrom$2 = "_leaveFrom_1xd0l_34";
4950
+ const leaveTo$2 = "_leaveTo_1xd0l_37";
4951
+ const notAvailable = "_notAvailable_1xd0l_40";
4952
+ const option$1 = "_option_1xd0l_43";
4953
+ const activeOption = "_activeOption_1xd0l_46";
4954
+ const optionSelected = "_optionSelected_1xd0l_49";
4955
+ const inactiveOption = "_inactiveOption_1xd0l_52";
4956
+ const optionLabel = "_optionLabel_1xd0l_55";
4957
+ const optionSubLabel = "_optionSubLabel_1xd0l_58";
4958
+ const selectedLabel = "_selectedLabel_1xd0l_61";
4959
+ const nonselectedLabel = "_nonselectedLabel_1xd0l_64";
4960
+ const check = "_check_1xd0l_67";
4961
+ const checkActive = "_checkActive_1xd0l_70";
4962
+ const checkInactive = "_checkInactive_1xd0l_73";
4963
+ const checkIcon$1 = "_checkIcon_1xd0l_76";
4964
+ const checkIconSelected = "_checkIconSelected_1xd0l_79";
4965
+ const checkIconUnselected = "_checkIconUnselected_1xd0l_82";
4966
+ const loadMore$1 = "_loadMore_1xd0l_85";
4967
+ const selectedList = "_selectedList_1xd0l_88";
4968
+ const selectedListItem = "_selectedListItem_1xd0l_91";
4969
4969
  var style = {
4970
- "listBox-label": "_listBox-label_1uwmw_1",
4971
- "listBoxButton-container": "_listBoxButton-container_1uwmw_9",
4970
+ "listBox-label": "_listBox-label_1xd0l_1",
4971
+ "listBoxButton-container": "_listBoxButton-container_1xd0l_5",
4972
4972
  listBoxButton,
4973
- "listBox-option": "_listBox-option_1uwmw_25",
4973
+ "listBox-option": "_listBox-option_1xd0l_13",
4974
4974
  selectedOptionText,
4975
4975
  transitionDiv,
4976
4976
  listboxButtonWrapper,
@@ -4997,22 +4997,22 @@ var style = {
4997
4997
  selectedList,
4998
4998
  selectedListItem
4999
4999
  };
5000
- const primary = "_primary_1ipyg_1";
5001
- const secondary = "_secondary_1ipyg_9";
5002
- const tertiary = "_tertiary_1ipyg_19";
5000
+ const primary = "_primary_18yak_1";
5001
+ const secondary = "_secondary_18yak_5";
5002
+ const tertiary = "_tertiary_18yak_10";
5003
5003
  var styles$C = {
5004
5004
  primary,
5005
5005
  secondary,
5006
5006
  tertiary,
5007
- "font-18": "_font-18_1ipyg_27",
5008
- "font-20": "_font-20_1ipyg_35",
5009
- "font-14": "_font-14_1ipyg_43",
5010
- "font-14a": "_font-14a_1ipyg_51",
5011
- "font-14b": "_font-14b_1ipyg_59",
5012
- "font-14c": "_font-14c_1ipyg_67",
5013
- "font-14d": "_font-14d_1ipyg_75",
5014
- "font-15": "_font-15_1ipyg_83",
5015
- "font-34": "_font-34_1ipyg_89"
5007
+ "font-18": "_font-18_18yak_14",
5008
+ "font-20": "_font-20_18yak_18",
5009
+ "font-14": "_font-14_18yak_22",
5010
+ "font-14a": "_font-14a_18yak_26",
5011
+ "font-14b": "_font-14b_18yak_30",
5012
+ "font-14c": "_font-14c_18yak_34",
5013
+ "font-14d": "_font-14d_18yak_38",
5014
+ "font-15": "_font-15_18yak_42",
5015
+ "font-34": "_font-34_18yak_45"
5016
5016
  };
5017
5017
  const variants = {
5018
5018
  h1: "h1",
@@ -5040,10 +5040,10 @@ const Text = ({
5040
5040
  children: children2
5041
5041
  });
5042
5042
  };
5043
- const search$1 = "_search_qirxg_1";
5043
+ const search$1 = "_search_1klck_1";
5044
5044
  var styles$B = {
5045
- "searchTab-container": "_searchTab-container_qirxg_1",
5046
- "searchTab-input": "_searchTab-input_qirxg_9",
5045
+ "searchTab-container": "_searchTab-container_1klck_1",
5046
+ "searchTab-input": "_searchTab-input_1klck_5",
5047
5047
  search: search$1
5048
5048
  };
5049
5049
  const iconoirSearch = (props) => /* @__PURE__ */ jsx("svg", {
@@ -6661,6 +6661,22 @@ const useGenerateEmbeddedMeticMutation = (options2) => useMutation(
6661
6661
  (variables) => fetcher(GenerateEmbeddedMeticDocument, variables)(),
6662
6662
  options2
6663
6663
  );
6664
+ const GetClientDashboardLayoutDocument = `
6665
+ query GetClientDashboardLayout($clientId: String!, $externalDashboardId: uuid!) {
6666
+ clientDashboardMetrics_by_pk(
6667
+ clientId: $clientId
6668
+ externalDashboardId: $externalDashboardId
6669
+ ) {
6670
+ clientId
6671
+ externalDashboardId
6672
+ }
6673
+ }
6674
+ `;
6675
+ const useGetClientDashboardLayoutQuery = (variables, options2) => useQuery(
6676
+ ["GetClientDashboardLayout", variables],
6677
+ fetcher(GetClientDashboardLayoutDocument, variables),
6678
+ options2
6679
+ );
6664
6680
  const CompanySubsetTableDataDocument = `
6665
6681
  mutation CompanySubsetTableData($clientId: String = "", $companyId: String = "") {
6666
6682
  companySubsetTableData(input: {clientId: $clientId, companyId: $companyId}) {
@@ -6819,6 +6835,21 @@ const useUnderlyingDataMutation = (options2) => useMutation(
6819
6835
  (variables) => fetcher(UnderlyingDataDocument, variables)(),
6820
6836
  options2
6821
6837
  );
6838
+ const MarkClientDashboardLayoutChangeDocument = `
6839
+ mutation MarkClientDashboardLayoutChange($clientId: String!, $externalDashboardId: uuid!) {
6840
+ insert_clientDashboardMetrics_one(
6841
+ object: {clientId: $clientId, externalDashboardId: $externalDashboardId}
6842
+ ) {
6843
+ clientId
6844
+ externalDashboardId
6845
+ }
6846
+ }
6847
+ `;
6848
+ const useMarkClientDashboardLayoutChangeMutation = (options2) => useMutation(
6849
+ ["MarkClientDashboardLayoutChange"],
6850
+ (variables) => fetcher(MarkClientDashboardLayoutChangeDocument, variables)(),
6851
+ options2
6852
+ );
6822
6853
  const MarkDeleteMetricDocument = `
6823
6854
  mutation MarkDeleteMetric($id: uuid! = "") {
6824
6855
  update_externalMetrics_by_pk(
@@ -6887,6 +6918,21 @@ const useRawCsvMutation = (options2) => useMutation(
6887
6918
  (variables) => fetcher(RawCsvDocument, variables)(),
6888
6919
  options2
6889
6920
  );
6921
+ const ResizeExternalMetricDocument = `
6922
+ mutation resizeExternalMetric($id: uuid!, $resizeAttributes: jsonb!) {
6923
+ update_externalMetrics_by_pk(
6924
+ pk_columns: {id: $id}
6925
+ _set: {resizeAttributes: $resizeAttributes}
6926
+ ) {
6927
+ resizeAttributes
6928
+ }
6929
+ }
6930
+ `;
6931
+ const useResizeExternalMetricMutation = (options2) => useMutation(
6932
+ ["resizeExternalMetric"],
6933
+ (variables) => fetcher(ResizeExternalMetricDocument, variables)(),
6934
+ options2
6935
+ );
6890
6936
  const ExternalMetricForm = ({
6891
6937
  onSubmit,
6892
6938
  defaultValues,
@@ -6996,22 +7042,22 @@ const ExternalMetricForm = ({
6996
7042
  })]
6997
7043
  });
6998
7044
  };
6999
- const container$d = "_container_1b6ua_1";
7000
- const wrapper$3 = "_wrapper_1b6ua_9";
7001
- const label$3 = "_label_1b6ua_17";
7002
- const floatingLabel = "_floatingLabel_1b6ua_25";
7003
- const clientText = "_clientText_1b6ua_33";
7004
- const normalText = "_normalText_1b6ua_41";
7005
- const dropdown$1 = "_dropdown_1b6ua_49";
7006
- const options = "_options_1b6ua_57";
7007
- const checkedOption = "_checkedOption_1b6ua_65";
7008
- const option = "_option_1b6ua_57";
7009
- const icon$1 = "_icon_1b6ua_81";
7010
- const text$2 = "_text_1b6ua_89";
7011
- const floatingText = "_floatingText_1b6ua_97";
7012
- const search = "_search_1b6ua_105";
7013
- const loadMore = "_loadMore_1b6ua_113";
7014
- const loadMoreIcon = "_loadMoreIcon_1b6ua_121";
7045
+ const container$d = "_container_q0qrl_1";
7046
+ const wrapper$3 = "_wrapper_q0qrl_5";
7047
+ const label$3 = "_label_q0qrl_9";
7048
+ const floatingLabel = "_floatingLabel_q0qrl_13";
7049
+ const clientText = "_clientText_q0qrl_17";
7050
+ const normalText = "_normalText_q0qrl_21";
7051
+ const dropdown$1 = "_dropdown_q0qrl_25";
7052
+ const options = "_options_q0qrl_29";
7053
+ const checkedOption = "_checkedOption_q0qrl_33";
7054
+ const option = "_option_q0qrl_29";
7055
+ const icon$1 = "_icon_q0qrl_41";
7056
+ const text$2 = "_text_q0qrl_45";
7057
+ const floatingText = "_floatingText_q0qrl_49";
7058
+ const search = "_search_q0qrl_53";
7059
+ const loadMore = "_loadMore_q0qrl_57";
7060
+ const loadMoreIcon = "_loadMoreIcon_q0qrl_61";
7015
7061
  var styles$s = {
7016
7062
  container: container$d,
7017
7063
  wrapper: wrapper$3,
@@ -7417,6 +7463,73 @@ const useApplyAdminTheme = (adminTheme) => {
7417
7463
  document.head.appendChild(adminStyles);
7418
7464
  }, [adminTheme]);
7419
7465
  };
7466
+ const useClientDashboardLayout = ({
7467
+ externalDashboardId,
7468
+ clientId
7469
+ }) => {
7470
+ const queryClient2 = useQueryClient();
7471
+ const { data: clientLayoutData } = useGetClientDashboardLayoutQuery(
7472
+ {
7473
+ clientId,
7474
+ externalDashboardId
7475
+ },
7476
+ { enabled: Boolean(externalDashboardId && clientId) }
7477
+ );
7478
+ const isLayoutChanged = useMemo(
7479
+ () => !!(clientLayoutData == null ? void 0 : clientLayoutData.clientDashboardMetrics_by_pk),
7480
+ [clientLayoutData == null ? void 0 : clientLayoutData.clientDashboardMetrics_by_pk]
7481
+ );
7482
+ const { mutateAsync: markClientLayoutChangeMutation } = useMarkClientDashboardLayoutChangeMutation();
7483
+ const markClientLayoutChange = useCallback(async () => {
7484
+ if (!clientId || !externalDashboardId || isLayoutChanged)
7485
+ return;
7486
+ await markClientLayoutChangeMutation(
7487
+ {
7488
+ clientId,
7489
+ externalDashboardId
7490
+ },
7491
+ {
7492
+ onSuccess: (res) => {
7493
+ if (!res.insert_clientDashboardMetrics_one)
7494
+ return;
7495
+ queryClient2.setQueryData(
7496
+ ["GetClientDashboardLayout", { clientId, externalDashboardId }],
7497
+ (prev) => {
7498
+ return {
7499
+ ...prev,
7500
+ clientDashboardMetrics_by_pk: res.insert_clientDashboardMetrics_one
7501
+ };
7502
+ }
7503
+ );
7504
+ }
7505
+ }
7506
+ );
7507
+ }, [
7508
+ markClientLayoutChangeMutation,
7509
+ isLayoutChanged,
7510
+ clientId,
7511
+ externalDashboardId
7512
+ ]);
7513
+ const { mutateAsync: resizeMetricCard } = useResizeExternalMetricMutation();
7514
+ const handleLayoutChange = useCallback(
7515
+ async (_layout, _oldItem, newItem) => {
7516
+ await Promise.all([
7517
+ resizeMetricCard({
7518
+ id: newItem.i,
7519
+ resizeAttributes: {
7520
+ width: newItem.w,
7521
+ height: newItem.h,
7522
+ xAxis: newItem.x,
7523
+ yAxis: newItem.y
7524
+ }
7525
+ }),
7526
+ markClientLayoutChange()
7527
+ ]);
7528
+ },
7529
+ [resizeMetricCard, markClientLayoutChange]
7530
+ );
7531
+ return { handleLayoutChange, markClientLayoutChange, isLayoutChanged };
7532
+ };
7420
7533
  var index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
7421
7534
  __proto__: null,
7422
7535
  useEmbeddedDashboard,
@@ -7424,7 +7537,8 @@ var index$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
7424
7537
  useGenerateDatasetMetrics,
7425
7538
  useGenerateEmbeddedMetric,
7426
7539
  useOutsideAlerter,
7427
- useApplyAdminTheme
7540
+ useApplyAdminTheme,
7541
+ useClientDashboardLayout
7428
7542
  }, Symbol.toStringTag, { value: "Module" }));
7429
7543
  const materialSymbolsKeyboardArrowDown = (props) => /* @__PURE__ */ jsx("svg", {
7430
7544
  viewBox: "0 0 24 24",
@@ -86385,12 +86499,12 @@ const InfoTooltip = ({
86385
86499
  });
86386
86500
  };
86387
86501
  var styles$j = {
86388
- "header-container": "_header-container_1pbz4_1",
86389
- "btn-container": "_btn-container_1pbz4_9",
86390
- "back-btn": "_back-btn_1pbz4_17",
86391
- "sql-btn": "_sql-btn_1pbz4_25",
86392
- "save-btn": "_save-btn_1pbz4_33",
86393
- "save-btn-icon": "_save-btn-icon_1pbz4_41"
86502
+ "header-container": "_header-container_t2r6v_1",
86503
+ "btn-container": "_btn-container_t2r6v_5",
86504
+ "back-btn": "_back-btn_t2r6v_9",
86505
+ "sql-btn": "_sql-btn_t2r6v_13",
86506
+ "save-btn": "_save-btn_t2r6v_17",
86507
+ "save-btn-icon": "_save-btn-icon_t2r6v_21"
86394
86508
  };
86395
86509
  const Header = ({
86396
86510
  setShowMetricCreateModal,
@@ -86442,25 +86556,25 @@ const Header = ({
86442
86556
  })]
86443
86557
  });
86444
86558
  };
86445
- const floatingCreateButton = "_floatingCreateButton_jfq7q_25";
86446
- const floatingCreateButtonIcon = "_floatingCreateButtonIcon_jfq7q_33";
86559
+ const floatingCreateButton = "_floatingCreateButton_6ovk2_13";
86560
+ const floatingCreateButtonIcon = "_floatingCreateButtonIcon_6ovk2_17";
86447
86561
  var styles$i = {
86448
- "create-btn": "_create-btn_jfq7q_1",
86449
- "modal-container": "_modal-container_jfq7q_9",
86450
- "query-modal": "_query-modal_jfq7q_17",
86562
+ "create-btn": "_create-btn_6ovk2_1",
86563
+ "modal-container": "_modal-container_6ovk2_5",
86564
+ "query-modal": "_query-modal_6ovk2_9",
86451
86565
  floatingCreateButton,
86452
86566
  floatingCreateButtonIcon
86453
86567
  };
86454
- const container$7 = "_container_u2z1d_1";
86455
- const header$3 = "_header_u2z1d_9";
86456
- const wrapper$2 = "_wrapper_u2z1d_17";
86457
- const column = "_column_u2z1d_33";
86458
- const columnText$1 = "_columnText_u2z1d_41";
86568
+ const container$7 = "_container_1q2ss_1";
86569
+ const header$3 = "_header_1q2ss_5";
86570
+ const wrapper$2 = "_wrapper_1q2ss_9";
86571
+ const column = "_column_1q2ss_17";
86572
+ const columnText$1 = "_columnText_1q2ss_21";
86459
86573
  var styles$h = {
86460
86574
  container: container$7,
86461
86575
  header: header$3,
86462
86576
  wrapper: wrapper$2,
86463
- "col-container": "_col-container_u2z1d_25",
86577
+ "col-container": "_col-container_1q2ss_13",
86464
86578
  column,
86465
86579
  columnText: columnText$1
86466
86580
  };
@@ -87813,10 +87927,10 @@ const ChartTab = ({
87813
87927
  })]
87814
87928
  });
87815
87929
  };
87816
- const container$5 = "_container_wjdaz_1";
87817
- const wrapper$1 = "_wrapper_wjdaz_9";
87818
- const text = "_text_wjdaz_17";
87819
- const table$2 = "_table_wjdaz_23";
87930
+ const container$5 = "_container_yjeiv_1";
87931
+ const wrapper$1 = "_wrapper_yjeiv_5";
87932
+ const text = "_text_yjeiv_9";
87933
+ const table$2 = "_table_yjeiv_12";
87820
87934
  var styles$c = {
87821
87935
  container: container$5,
87822
87936
  wrapper: wrapper$1,
@@ -87849,16 +87963,16 @@ const InputTables = ({
87849
87963
  })
87850
87964
  });
87851
87965
  };
87852
- const container$4 = "_container_127xg_1";
87853
- const header$1 = "_header_127xg_9";
87854
- const tabButton$1 = "_tabButton_127xg_31";
87855
- const selectedTab = "_selectedTab_127xg_37";
87856
- const table$1 = "_table_127xg_43";
87966
+ const container$4 = "_container_38zl3_1";
87967
+ const header$1 = "_header_38zl3_5";
87968
+ const tabButton$1 = "_tabButton_38zl3_16";
87969
+ const selectedTab = "_selectedTab_38zl3_19";
87970
+ const table$1 = "_table_38zl3_22";
87857
87971
  var styles$b = {
87858
87972
  container: container$4,
87859
87973
  header: header$1,
87860
- "text-container": "_text-container_127xg_17",
87861
- "btn-container": "_btn-container_127xg_25",
87974
+ "text-container": "_text-container_38zl3_9",
87975
+ "btn-container": "_btn-container_38zl3_13",
87862
87976
  tabButton: tabButton$1,
87863
87977
  selectedTab,
87864
87978
  table: table$1
@@ -87929,13 +88043,13 @@ const TableTab = ({
87929
88043
  })]
87930
88044
  });
87931
88045
  };
87932
- const wrapper = "_wrapper_49kql_17";
87933
- const searchCommand = "_searchCommand_49kql_23";
87934
- const tabButton = "_tabButton_49kql_29";
87935
- const tabActive = "_tabActive_49kql_35";
88046
+ const wrapper = "_wrapper_wy97p_9";
88047
+ const searchCommand = "_searchCommand_wy97p_12";
88048
+ const tabButton = "_tabButton_wy97p_15";
88049
+ const tabActive = "_tabActive_wy97p_18";
87936
88050
  var styles$a = {
87937
- "main-container": "_main-container_49kql_1",
87938
- "outputTab-header": "_outputTab-header_49kql_9",
88051
+ "main-container": "_main-container_wy97p_1",
88052
+ "outputTab-header": "_outputTab-header_wy97p_5",
87939
88053
  wrapper,
87940
88054
  searchCommand,
87941
88055
  tabButton,
@@ -88066,30 +88180,30 @@ const MetricOutput = ({
88066
88180
  })]
88067
88181
  });
88068
88182
  };
88069
- const fieldValueIcon = "_fieldValueIcon_fl6kw_49";
88070
- const fieldAddBtnIcon = "_fieldAddBtnIcon_fl6kw_65";
88071
- const group = "_group_fl6kw_1";
88072
- const tooltipWrapper = "_tooltipWrapper_fl6kw_89";
88073
- const tooltip = "_tooltip_fl6kw_89";
88074
- const dropdown = "_dropdown_fl6kw_113";
88075
- const filterDropdown = "_filterDropdown_fl6kw_121";
88076
- const filterValues = "_filterValues_fl6kw_129";
88077
- const columnText = "_columnText_fl6kw_137";
88078
- const disabled = "_disabled_fl6kw_145";
88079
- const checkIcon = "_checkIcon_fl6kw_153";
88080
- const generateButton = "_generateButton_fl6kw_161";
88183
+ const fieldValueIcon = "_fieldValueIcon_z8ldj_25";
88184
+ const fieldAddBtnIcon = "_fieldAddBtnIcon_z8ldj_33";
88185
+ const group = "_group_z8ldj_1";
88186
+ const tooltipWrapper = "_tooltipWrapper_z8ldj_45";
88187
+ const tooltip = "_tooltip_z8ldj_45";
88188
+ const dropdown = "_dropdown_z8ldj_57";
88189
+ const filterDropdown = "_filterDropdown_z8ldj_61";
88190
+ const filterValues = "_filterValues_z8ldj_65";
88191
+ const columnText = "_columnText_z8ldj_69";
88192
+ const disabled = "_disabled_z8ldj_73";
88193
+ const checkIcon = "_checkIcon_z8ldj_77";
88194
+ const generateButton = "_generateButton_z8ldj_81";
88081
88195
  var styles$9 = {
88082
- "form-container": "_form-container_fl6kw_1",
88083
- "field-container": "_field-container_fl6kw_9",
88084
- "field-label": "_field-label_fl6kw_17",
88085
- "field-wrapper": "_field-wrapper_fl6kw_25",
88086
- "field-inner-container": "_field-inner-container_fl6kw_33",
88087
- "field-value": "_field-value_fl6kw_41",
88196
+ "form-container": "_form-container_z8ldj_1",
88197
+ "field-container": "_field-container_z8ldj_5",
88198
+ "field-label": "_field-label_z8ldj_9",
88199
+ "field-wrapper": "_field-wrapper_z8ldj_13",
88200
+ "field-inner-container": "_field-inner-container_z8ldj_17",
88201
+ "field-value": "_field-value_z8ldj_21",
88088
88202
  fieldValueIcon,
88089
- "field-add-btn": "_field-add-btn_fl6kw_57",
88203
+ "field-add-btn": "_field-add-btn_z8ldj_29",
88090
88204
  fieldAddBtnIcon,
88091
- "field-value-container": "_field-value-container_fl6kw_73",
88092
- "field-prompt": "_field-prompt_fl6kw_81",
88205
+ "field-value-container": "_field-value-container_z8ldj_37",
88206
+ "field-prompt": "_field-prompt_z8ldj_41",
88093
88207
  group,
88094
88208
  tooltipWrapper,
88095
88209
  tooltip,
@@ -89240,10 +89354,10 @@ const MetricForm = ({
89240
89354
  })]
89241
89355
  });
89242
89356
  };
89243
- const container$2 = "_container_1v000_1";
89244
- const header = "_header_1v000_9";
89245
- const enableGroupBy = "_enableGroupBy_1v000_15";
89246
- const enableGroupButton = "_enableGroupButton_1v000_21";
89357
+ const container$2 = "_container_rofqe_1";
89358
+ const header = "_header_rofqe_5";
89359
+ const enableGroupBy = "_enableGroupBy_rofqe_8";
89360
+ const enableGroupButton = "_enableGroupButton_rofqe_11";
89247
89361
  var styles$7 = {
89248
89362
  container: container$2,
89249
89363
  header,
@@ -94926,11 +95040,11 @@ function WidthProvideRGL(ComposedComponent) {
94926
95040
  })(reactGridLayout);
94927
95041
  var styles$6 = "";
94928
95042
  var styles$5 = {
94929
- "MetricList-container": "_MetricList-container_1b506_1",
94930
- "MetricList-wrapper": "_MetricList-wrapper_1b506_9",
94931
- "noMetric-container": "_noMetric-container_1b506_17",
94932
- "noMetric-wrapper": "_noMetric-wrapper_1b506_25",
94933
- "alt-container": "_alt-container_1b506_33"
95043
+ "MetricList-container": "_MetricList-container_1jw09_1",
95044
+ "MetricList-wrapper": "_MetricList-wrapper_1jw09_9",
95045
+ "noMetric-container": "_noMetric-container_1jw09_17",
95046
+ "noMetric-wrapper": "_noMetric-wrapper_1jw09_25",
95047
+ "alt-container": "_alt-container_1jw09_33"
94934
95048
  };
94935
95049
  const cardContainer = "_cardContainer_1wz4e_1";
94936
95050
  const listHeader = "_listHeader_1wz4e_9";
@@ -95053,8 +95167,8 @@ const ChartImageDownloadButton = ({
95053
95167
  }), text2]
95054
95168
  });
95055
95169
  };
95056
- const metricFilter = "_metricFilter_1xge8_1";
95057
- const customContainer = "_customContainer_1xge8_7";
95170
+ const metricFilter = "_metricFilter_k2gef_1";
95171
+ const customContainer = "_customContainer_k2gef_4";
95058
95172
  var styles$3 = {
95059
95173
  metricFilter,
95060
95174
  customContainer
@@ -95121,24 +95235,24 @@ const MetricFilterDropDown = ({
95121
95235
  }) : void 0
95122
95236
  });
95123
95237
  };
95124
- const container$1 = "_container_1hc1e_1";
95125
- const popover = "_popover_1hc1e_9";
95126
- const button = "_button_1hc1e_17";
95127
- const buttonOpen = "_buttonOpen_1hc1e_25";
95128
- const menu = "_menu_1hc1e_33";
95129
- const enter = "_enter_1hc1e_41";
95130
- const enterFrom = "_enterFrom_1hc1e_49";
95131
- const enterTo = "_enterTo_1hc1e_57";
95132
- const leave = "_leave_1hc1e_65";
95133
- const leaveFrom = "_leaveFrom_1hc1e_73";
95134
- const leaveTo = "_leaveTo_1hc1e_81";
95135
- const center = "_center_1hc1e_89";
95136
- const top = "_top_1hc1e_97";
95137
- const bottom = "_bottom_1hc1e_105";
95138
- const left = "_left_1hc1e_113";
95139
- const right = "_right_1hc1e_121";
95140
- const chartOptionBtn = "_chartOptionBtn_1hc1e_225";
95141
- const chartpopup = "_chartpopup_1hc1e_233";
95238
+ const container$1 = "_container_1h8m9_1";
95239
+ const popover = "_popover_1h8m9_5";
95240
+ const button = "_button_1h8m9_9";
95241
+ const buttonOpen = "_buttonOpen_1h8m9_13";
95242
+ const menu = "_menu_1h8m9_17";
95243
+ const enter = "_enter_1h8m9_21";
95244
+ const enterFrom = "_enterFrom_1h8m9_25";
95245
+ const enterTo = "_enterTo_1h8m9_29";
95246
+ const leave = "_leave_1h8m9_33";
95247
+ const leaveFrom = "_leaveFrom_1h8m9_37";
95248
+ const leaveTo = "_leaveTo_1h8m9_41";
95249
+ const center = "_center_1h8m9_45";
95250
+ const top = "_top_1h8m9_49";
95251
+ const bottom = "_bottom_1h8m9_53";
95252
+ const left = "_left_1h8m9_57";
95253
+ const right = "_right_1h8m9_61";
95254
+ const chartOptionBtn = "_chartOptionBtn_1h8m9_113";
95255
+ const chartpopup = "_chartpopup_1h8m9_117";
95142
95256
  var styles$2 = {
95143
95257
  container: container$1,
95144
95258
  popover,
@@ -95156,23 +95270,23 @@ var styles$2 = {
95156
95270
  bottom,
95157
95271
  left,
95158
95272
  right,
95159
- "left-top-end": "_left-top-end_1hc1e_129",
95160
- "right-top-end": "_right-top-end_1hc1e_137",
95161
- "left-bottom-end": "_left-bottom-end_1hc1e_145",
95162
- "right-bottom-end": "_right-bottom-end_1hc1e_153",
95163
- "top-left": "_top-left_1hc1e_161",
95164
- "top-right": "_top-right_1hc1e_169",
95165
- "bottom-left": "_bottom-left_1hc1e_177",
95166
- "bottom-right": "_bottom-right_1hc1e_185",
95167
- "left-top": "_left-top_1hc1e_129",
95168
- "left-bottom": "_left-bottom_1hc1e_145",
95169
- "right-top": "_right-top_1hc1e_137",
95170
- "right-bottom": "_right-bottom_1hc1e_153",
95273
+ "left-top-end": "_left-top-end_1h8m9_65",
95274
+ "right-top-end": "_right-top-end_1h8m9_69",
95275
+ "left-bottom-end": "_left-bottom-end_1h8m9_73",
95276
+ "right-bottom-end": "_right-bottom-end_1h8m9_77",
95277
+ "top-left": "_top-left_1h8m9_81",
95278
+ "top-right": "_top-right_1h8m9_85",
95279
+ "bottom-left": "_bottom-left_1h8m9_89",
95280
+ "bottom-right": "_bottom-right_1h8m9_93",
95281
+ "left-top": "_left-top_1h8m9_65",
95282
+ "left-bottom": "_left-bottom_1h8m9_73",
95283
+ "right-top": "_right-top_1h8m9_69",
95284
+ "right-bottom": "_right-bottom_1h8m9_77",
95171
95285
  chartOptionBtn,
95172
95286
  chartpopup
95173
95287
  };
95174
- const fullscreen = "_fullscreen_19jec_1";
95175
- const loading = "_loading_19jec_9";
95288
+ const fullscreen = "_fullscreen_1gpy3_1";
95289
+ const loading = "_loading_1gpy3_5";
95176
95290
  var styles$1 = {
95177
95291
  fullscreen,
95178
95292
  loading
@@ -95923,6 +96037,9 @@ const MetricCard = ({
95923
96037
  })]
95924
96038
  }), chartType2 && /* @__PURE__ */ jsxs("div", {
95925
96039
  className: styles$4.metricData,
96040
+ onContextMenu: (e2) => {
96041
+ e2.preventDefault();
96042
+ },
95926
96043
  children: [!isQueryLoading && !dataDb.length ? /* @__PURE__ */ jsx("div", {
95927
96044
  className: styles$4.noData,
95928
96045
  children: /* @__PURE__ */ jsxs("div", {
@@ -96357,7 +96474,7 @@ const DeleteMetricModal = ({
96357
96474
  }, {
96358
96475
  onSuccess: () => {
96359
96476
  queryClient2.setQueryData(["EmbeddedDashboardMetrics", {
96360
- dashboardId
96477
+ externalDashboardId: dashboardId
96361
96478
  }], (prev) => {
96362
96479
  var _a2;
96363
96480
  const externalDashboardMetrics = (_a2 = prev == null ? void 0 : prev.externalDashboardMetrics) == null ? void 0 : _a2.filter((exDm) => exDm.externalMetricId !== metricId);
@@ -96415,7 +96532,8 @@ const ExternalMetricList = ({
96415
96532
  layoutCols,
96416
96533
  params,
96417
96534
  companyTenancyType = "TABLE",
96418
- externalDashboardId
96535
+ externalDashboardId,
96536
+ externalDashboardPk
96419
96537
  }) => {
96420
96538
  const [isFullScreen, setFullScreen] = useState(false);
96421
96539
  const [deleteModal2, setDeleteModal] = useState({
@@ -96423,6 +96541,12 @@ const ExternalMetricList = ({
96423
96541
  show: false
96424
96542
  });
96425
96543
  const [fullScreenChart, setFullScreenChart] = useState();
96544
+ const {
96545
+ handleLayoutChange
96546
+ } = useClientDashboardLayout({
96547
+ clientId: client,
96548
+ externalDashboardId: externalDashboardPk
96549
+ });
96426
96550
  const metricListData = externalDashboardMetrics == null ? void 0 : externalDashboardMetrics.map((data) => data.externalMetric);
96427
96551
  const adminMetrics = metricListData == null ? void 0 : metricListData.filter((data) => !data.isCreatedByClient);
96428
96552
  const clientMetrics = metricListData == null ? void 0 : metricListData.filter((data) => data.isCreatedByClient && data.clientId === client);
@@ -96452,9 +96576,8 @@ const ExternalMetricList = ({
96452
96576
  maxH: 15
96453
96577
  }))
96454
96578
  },
96455
- isResizable: false,
96456
- isDraggable: false,
96457
- isDroppable: false,
96579
+ onResizeStop: handleLayoutChange,
96580
+ onDragStop: handleLayoutChange,
96458
96581
  rowHeight: 30,
96459
96582
  width: 1200,
96460
96583
  breakpoints: breakpoint != null ? breakpoint : {
@@ -96752,6 +96875,7 @@ const EmbeddedDashboard = React__default.memo(({
96752
96875
  client: data.clientId,
96753
96876
  isLiveMode: data.mode,
96754
96877
  externalDashboardId: data.externalDashboardId,
96878
+ externalDashboardPk: data.externalDashboard.id,
96755
96879
  isAllowedToDeleteMetrics: data.isAllowedToDeleteMetrics,
96756
96880
  externalDashboardMetrics: data.externalDashboardMetrics,
96757
96881
  isMetricListLoading: isLoading,