@quillsql/react 2.16.42 → 2.16.44

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.js CHANGED
@@ -16998,7 +16998,7 @@ async function generatePivotWithSQL({
16998
16998
  client,
16999
16999
  task: "pivot-template",
17000
17000
  metadata: {
17001
- clientId: client.clientId,
17001
+ clientId: client.id,
17002
17002
  pivot: pivotConfig,
17003
17003
  reportId: report?.id !== "__quillTempReport" ? report?.id : void 0,
17004
17004
  itemQuery: reportBuilderState ? void 0 : report?.queryString,
@@ -18823,7 +18823,7 @@ var init_tableProcessing = __esm({
18823
18823
  metadata: {
18824
18824
  reportBuilderState,
18825
18825
  stringColumns: stringColumns.map((col) => col.field),
18826
- clientId: client.clientId,
18826
+ clientId: client.id,
18827
18827
  databaseType: client.databaseType?.toLowerCase() || "postgresql",
18828
18828
  customFields,
18829
18829
  filters: void 0,
@@ -19014,7 +19014,7 @@ var init_tableProcessing = __esm({
19014
19014
  metadata: {
19015
19015
  reportBuilderState,
19016
19016
  columns: stringNames,
19017
- clientId: client.publicKey,
19017
+ clientId: client.id,
19018
19018
  databaseType: client.databaseType,
19019
19019
  customFieldsByTable: customFields,
19020
19020
  useNewNodeSql: true,
@@ -19029,7 +19029,7 @@ var init_tableProcessing = __esm({
19029
19029
  task: "query",
19030
19030
  metadata: {
19031
19031
  query: countQuery,
19032
- clientId: client.publicKey,
19032
+ clientId: client.id,
19033
19033
  databaseType: client.databaseType,
19034
19034
  customFieldsByTable: customFields,
19035
19035
  useNewNodeSql: true,
@@ -19089,7 +19089,7 @@ var init_tableProcessing = __esm({
19089
19089
  metadata: {
19090
19090
  reportBuilderState,
19091
19091
  stringColumns: columns,
19092
- clientId: client.clientId,
19092
+ clientId: client.id,
19093
19093
  databaseType: client.databaseType?.toLowerCase() || "postgresql",
19094
19094
  customFields,
19095
19095
  filters,
@@ -19139,7 +19139,7 @@ var init_tableProcessing = __esm({
19139
19139
  task: "query",
19140
19140
  metadata: {
19141
19141
  query,
19142
- clientId: client.publicKey,
19142
+ clientId: client.id,
19143
19143
  databaseType: client.databaseType,
19144
19144
  customFieldsByTable: customFields,
19145
19145
  useNewNodeSql: true,
@@ -19251,7 +19251,7 @@ var init_tableProcessing = __esm({
19251
19251
  task: "query",
19252
19252
  metadata: {
19253
19253
  query,
19254
- clientId: client.publicKey,
19254
+ clientId: client.id,
19255
19255
  databaseType: client.databaseType,
19256
19256
  customFieldsByTable: customFields,
19257
19257
  useNewNodeSql: true,
@@ -19361,7 +19361,7 @@ var init_tableProcessing = __esm({
19361
19361
  metadata: {
19362
19362
  query,
19363
19363
  filterMap,
19364
- clientId: client.publicKey,
19364
+ clientId: client.id,
19365
19365
  databaseType: client?.databaseType,
19366
19366
  customFieldsByTable: customFields,
19367
19367
  additionalProcessing: processing,
@@ -19396,7 +19396,7 @@ var init_tableProcessing = __esm({
19396
19396
  task: "log-broken-query",
19397
19397
  metadata: {
19398
19398
  query,
19399
- clientId: client.clientId,
19399
+ clientId: client.id,
19400
19400
  error: parsingError
19401
19401
  },
19402
19402
  getToken
@@ -19504,7 +19504,7 @@ var init_tableProcessing = __esm({
19504
19504
  metadata: {
19505
19505
  dashboardItemId: reportId,
19506
19506
  filters: minimalFilters,
19507
- clientId: client?.publicKey,
19507
+ clientId: client?.id,
19508
19508
  databaseType: client?.databaseType,
19509
19509
  additionalProcessing: updatedProcessing,
19510
19510
  forcePagination: true,
@@ -19578,7 +19578,7 @@ var init_tableProcessing = __esm({
19578
19578
  rowCountOnly,
19579
19579
  customFields,
19580
19580
  tenants,
19581
- clientId: client.clientId,
19581
+ clientId: client.id,
19582
19582
  databaseType: client.databaseType?.toLowerCase() || "postgresql",
19583
19583
  dashboardName
19584
19584
  },
@@ -19719,7 +19719,7 @@ async function testSqlViewState(client, referencedTables, getToken) {
19719
19719
  task: "test-view",
19720
19720
  metadata: {
19721
19721
  tables: [table],
19722
- clientId: client.clientId
19722
+ clientId: client.id
19723
19723
  },
19724
19724
  getToken
19725
19725
  });
@@ -19728,7 +19728,7 @@ async function testSqlViewState(client, referencedTables, getToken) {
19728
19728
  metadata: {
19729
19729
  table,
19730
19730
  task: "set-broken-view",
19731
- clientId: client.clientId
19731
+ clientId: client.id
19732
19732
  }
19733
19733
  };
19734
19734
  quillFetch({
@@ -19838,7 +19838,7 @@ async function* quillStream({
19838
19838
  body: JSON.stringify({
19839
19839
  metadata: {
19840
19840
  task,
19841
- clientId: client.clientId,
19841
+ clientId: client.id,
19842
19842
  ...metadata
19843
19843
  }
19844
19844
  }),
@@ -20065,7 +20065,7 @@ async function getData(client, cloudQueryEndpoint, noCred, hostedRequestBody, cl
20065
20065
  body: method === "POST" ? JSON.stringify({
20066
20066
  ...cloudRequestBody,
20067
20067
  ...{
20068
- publicKey: client?.publicKey
20068
+ publicKey: client?.id
20069
20069
  }
20070
20070
  }) : null,
20071
20071
  signal: abortSignal
@@ -20094,7 +20094,7 @@ async function fetchSqlQuery(ast, client, getToken, formData) {
20094
20094
  client,
20095
20095
  task: "sqlify",
20096
20096
  metadata: {
20097
- clientId: client.clientId,
20097
+ clientId: client.id,
20098
20098
  useNewNodeSql: true,
20099
20099
  ast: { ...ast, where }
20100
20100
  },
@@ -20115,7 +20115,7 @@ async function fetchSqlQueryFromState(reportBuilderState, client, getToken, data
20115
20115
  client,
20116
20116
  task: "sqlify",
20117
20117
  metadata: {
20118
- clientId: client.clientId,
20118
+ clientId: client.id,
20119
20119
  useNewNodeSql: true,
20120
20120
  ast
20121
20121
  },
@@ -20132,7 +20132,7 @@ async function fetchQueryDateRangesFromState(reportBuilderState, columns, client
20132
20132
  client,
20133
20133
  task: "report-builder-date-ranges",
20134
20134
  metadata: {
20135
- clientId: client.clientId,
20135
+ clientId: client.id,
20136
20136
  reportBuilderState,
20137
20137
  dateColumns: columns,
20138
20138
  databaseType: databaseType || "postgresql",
@@ -20223,7 +20223,7 @@ var init_dataFetcher = __esm({
20223
20223
  body: JSON.stringify({
20224
20224
  metadata: {
20225
20225
  task,
20226
- clientId: client.clientId,
20226
+ clientId: client.id ?? client.clientId,
20227
20227
  ...metadata
20228
20228
  }
20229
20229
  }),
@@ -21169,7 +21169,7 @@ async function getDashboard(dashboardName, client, getToken, tenants, flags) {
21169
21169
  task: "dashboard",
21170
21170
  metadata: {
21171
21171
  name: dashboardName,
21172
- clientId: client.publicKey,
21172
+ clientId: client.id,
21173
21173
  databaseType: client.databaseType,
21174
21174
  useNewNodeSql: true,
21175
21175
  tenants,
@@ -21388,7 +21388,7 @@ async function fetchReportRows({
21388
21388
  task: "report",
21389
21389
  metadata: {
21390
21390
  reportId,
21391
- clientId: client.publicKey,
21391
+ clientId: client.id,
21392
21392
  databaseType: client.databaseType,
21393
21393
  filters: filters.map((filter) => ({ ...filter, options: void 0 })),
21394
21394
  useNewNodeSql: true,
@@ -21437,7 +21437,7 @@ async function fetchReport({
21437
21437
  metadata: {
21438
21438
  reportId,
21439
21439
  dashboardItemId: reportId,
21440
- clientId: client.publicKey,
21440
+ clientId: client.id,
21441
21441
  databaseType: client.databaseType,
21442
21442
  filters: filters.map((filter) => ({ ...filter, options: void 0 })),
21443
21443
  customFields,
@@ -21570,7 +21570,7 @@ async function fetchReportRowCount(reportId, client, getToken, tenants, flags, u
21570
21570
  metadata: {
21571
21571
  reportId,
21572
21572
  dashboardItemId: reportId,
21573
- clientId: client.publicKey,
21573
+ clientId: client.id,
21574
21574
  databaseType: client.databaseType,
21575
21575
  filters: filters.map((filter) => ({ ...filter, options: void 0 })),
21576
21576
  customFields,
@@ -21599,7 +21599,7 @@ async function saveReport({
21599
21599
  eventTracking,
21600
21600
  tenants
21601
21601
  }) {
21602
- const { publicKey, databaseType } = client;
21602
+ const { id, databaseType } = client;
21603
21603
  const {
21604
21604
  reportBuilderState,
21605
21605
  queryString,
@@ -21626,7 +21626,7 @@ async function saveReport({
21626
21626
  dashboardItemId,
21627
21627
  ...dashboardItemId ? { reportId: dashboardItemId } : {},
21628
21628
  // Remove useNewNodeSql since backend will handle conversion
21629
- clientId: publicKey,
21629
+ clientId: id,
21630
21630
  tenants,
21631
21631
  // Only include adminMode for 'create' task, not 'create-report'
21632
21632
  ...isCreateTask && { adminMode },
@@ -22431,7 +22431,6 @@ var getSchemaInfo = async ({
22431
22431
  getToken,
22432
22432
  eventTracking
22433
22433
  }) => {
22434
- const { publicKey } = client;
22435
22434
  let customFieldsByTableUnique = null;
22436
22435
  if (client.featureFlags?.customFieldsEnabled && tenants && tenants[0] !== "QUILL_ALL_TENANTS" && tenants.length === 1 && (typeof tenants[0] !== "object" || tenants[0].tenantIds?.[0] !== "QUILL_ALL_TENANTS" && tenants[0].tenantIds?.length === 1)) {
22437
22436
  try {
@@ -22450,13 +22449,13 @@ var getSchemaInfo = async ({
22450
22449
  client,
22451
22450
  task: "schema",
22452
22451
  metadata: {
22453
- clientId: publicKey,
22452
+ clientId: client.id,
22454
22453
  removeCustomerField: true,
22455
22454
  removeCustomFieldRef: true,
22456
22455
  tableIds,
22457
22456
  customFieldsByTable: customFieldsByTableUnique,
22458
22457
  useNewCustomFields: true,
22459
- gatherSchemaData: "665610862cf7a3000be66453" === publicKey ? true : false,
22458
+ gatherSchemaData: "665610862cf7a3000be66453" === client.id ? true : false,
22460
22459
  // TODO: this should be a feature flag on the client
22461
22460
  tenants
22462
22461
  },
@@ -23568,7 +23567,7 @@ var CacheCab = class {
23568
23567
  task: "report",
23569
23568
  metadata: {
23570
23569
  reportId,
23571
- clientId: client.publicKey,
23570
+ clientId: client.id,
23572
23571
  databaseType: client.databaseType,
23573
23572
  filters: adjusted,
23574
23573
  additionalProcessing: { page: { rowsPerPage: 1e3, rowsPerRequest: 1e5 } },
@@ -23707,7 +23706,7 @@ var CacheCab = class {
23707
23706
  );
23708
23707
  const keyParts = [
23709
23708
  reportId,
23710
- client.publicKey,
23709
+ client.id,
23711
23710
  client.databaseType,
23712
23711
  hashString(stableStringify(canonicalizeForKey(tenants ?? null))),
23713
23712
  hashString(stableStringify(canonicalizeForKey(flags ?? null))),
@@ -24345,12 +24344,11 @@ var ContextProvider = ({
24345
24344
  typeof window !== "undefined" && sessionStorage ? JSON.parse(sessionStorage.getItem("quill-client") ?? "null") : null
24346
24345
  );
24347
24346
  const populatedClient = useMemo(() => {
24348
- if (!client || client.clientId !== publicKey) return null;
24347
+ if (!client || client.id !== publicKey) return null;
24349
24348
  return {
24350
24349
  ...client,
24351
- publicKey,
24352
- _id: publicKey,
24353
24350
  id: publicKey,
24351
+ clientId: publicKey,
24354
24352
  queryHeaders,
24355
24353
  queryEndpoint,
24356
24354
  streamEndpoint,
@@ -24511,7 +24509,7 @@ var ContextProvider = ({
24511
24509
  try {
24512
24510
  const result = await quillFetch({
24513
24511
  client: {
24514
- clientId: publicKey,
24512
+ id: publicKey,
24515
24513
  queryEndpoint,
24516
24514
  queryHeaders,
24517
24515
  withCredentials: !!withCredentials
@@ -24633,7 +24631,7 @@ var ContextProvider = ({
24633
24631
  try {
24634
24632
  const resp = await quillFetch({
24635
24633
  client: {
24636
- clientId: publicKey,
24634
+ id: publicKey,
24637
24635
  queryEndpoint,
24638
24636
  queryHeaders,
24639
24637
  withCredentials: !!withCredentials
@@ -24641,7 +24639,7 @@ var ContextProvider = ({
24641
24639
  task: fetchRows ? "report" : "report-info",
24642
24640
  metadata: {
24643
24641
  reportId,
24644
- clientId: populatedClient.publicKey,
24642
+ clientId: populatedClient.id,
24645
24643
  useNewNodeSql: true,
24646
24644
  filters: filters?.map((f) => ({ ...f, options: void 0 })),
24647
24645
  additionalProcessing,
@@ -24824,7 +24822,7 @@ var ContextProvider = ({
24824
24822
  try {
24825
24823
  const result = await quillFetch({
24826
24824
  client: {
24827
- clientId: publicKey,
24825
+ id: publicKey,
24828
24826
  queryEndpoint,
24829
24827
  queryHeaders,
24830
24828
  withCredentials: !!withCredentials
@@ -25033,7 +25031,7 @@ var ContextProvider = ({
25033
25031
  });
25034
25032
  return curDashboardConfig;
25035
25033
  }
25036
- if (!populatedClient || !populatedClient.publicKey) {
25034
+ if (!populatedClient || !populatedClient.id) {
25037
25035
  return curDashboardConfig;
25038
25036
  }
25039
25037
  if (dashboardName === null || dashboardName === void 0)
@@ -25187,7 +25185,7 @@ var ContextProvider = ({
25187
25185
  try {
25188
25186
  const result = await quillFetch({
25189
25187
  client: {
25190
- clientId: publicKey2,
25188
+ id: publicKey2,
25191
25189
  queryEndpoint,
25192
25190
  queryHeaders,
25193
25191
  withCredentials: !!withCredentials
@@ -25730,8 +25728,7 @@ var ContextProvider = ({
25730
25728
  withCredentials: withCredentials ?? false,
25731
25729
  databaseType: envClient.databaseType,
25732
25730
  name: envClient.name,
25733
- clientId: publicKey2,
25734
- publicKey: publicKey2,
25731
+ id: publicKey2,
25735
25732
  featureFlags: envClient.featureFlags,
25736
25733
  clerkOrgId: envClient.clerkOrgId,
25737
25734
  allTenantTypes: hydratedTenantTypes
@@ -25803,16 +25800,16 @@ var ContextProvider = ({
25803
25800
  }, [publicKey]);
25804
25801
  useEffect(() => {
25805
25802
  if (!hasHandledInitialPopulatedClient.current) {
25806
- if (!populatedClient?.publicKey && !populatedClient?.currentTenants) {
25803
+ if (!populatedClient?.id && !populatedClient?.currentTenants) {
25807
25804
  return;
25808
25805
  }
25809
25806
  hasHandledInitialPopulatedClient.current = true;
25810
- currentPublicKey.current = populatedClient?.publicKey ?? null;
25807
+ currentPublicKey.current = populatedClient?.id ?? null;
25811
25808
  currentTenant.current = populatedClient?.currentTenants ?? null;
25812
25809
  return;
25813
25810
  }
25814
25811
  let publicKeyChanged = false;
25815
- if (populatedClient?.publicKey && currentPublicKey.current !== populatedClient?.publicKey) {
25812
+ if (populatedClient?.id && currentPublicKey.current !== populatedClient?.id) {
25816
25813
  publicKeyChanged = true;
25817
25814
  dispatch({ type: "CLEAR_DASHBOARDS" });
25818
25815
  dashboardFiltersDispatch({ type: "CLEAR_DASHBOARD_FILTERS" });
@@ -25821,7 +25818,7 @@ var ContextProvider = ({
25821
25818
  backfilledDashboards.current.clear();
25822
25819
  if (isAdmin) {
25823
25820
  setIsDashboardsLoading(true);
25824
- fetchDashboards(populatedClient?.publicKey);
25821
+ fetchDashboards(populatedClient?.id);
25825
25822
  } else {
25826
25823
  setIsDashboardsLoading(false);
25827
25824
  }
@@ -25853,17 +25850,17 @@ var ContextProvider = ({
25853
25850
  })
25854
25851
  );
25855
25852
  }
25856
- if (populatedClient?.currentTenants && populatedClient?.publicKey) {
25853
+ if (populatedClient?.currentTenants && populatedClient?.id) {
25857
25854
  const tenant = typeof populatedClient?.currentTenants[0] === "object" ? populatedClient?.currentTenants[0]?.tenantField : void 0;
25858
25855
  const tenantIds = tenant && typeof populatedClient?.currentTenants[0] === "object" ? populatedClient?.currentTenants[0]?.tenantIds : populatedClient?.currentTenants;
25859
25856
  eventTracking?.setUser?.({
25860
- clientId: populatedClient.publicKey,
25857
+ clientId: populatedClient.id,
25861
25858
  clerkOrgId: populatedClient.clerkOrgId,
25862
25859
  tenant,
25863
25860
  tenantIds
25864
25861
  });
25865
25862
  }
25866
- }, [populatedClient?.currentTenants, populatedClient?.publicKey]);
25863
+ }, [populatedClient?.currentTenants, populatedClient?.id]);
25867
25864
  if (!theme) {
25868
25865
  return null;
25869
25866
  }
@@ -26177,7 +26174,7 @@ var useDashboardInternal = (dashboardName, customFilters) => {
26177
26174
  });
26178
26175
  const body = {
26179
26176
  task: "set-section-order",
26180
- clientId: client.clientId,
26177
+ clientId: client.id,
26181
26178
  dashboardName,
26182
26179
  sectionOrder
26183
26180
  };
@@ -26405,7 +26402,7 @@ var useDashboards = () => {
26405
26402
  dateFilter,
26406
26403
  name: name2.trim(),
26407
26404
  task: "edit-dashboard",
26408
- clientId: clientId ?? client.clientId,
26405
+ clientId: clientId ?? client.id,
26409
26406
  tenantKeys: dashboardOwners
26410
26407
  };
26411
26408
  try {
@@ -26480,7 +26477,7 @@ var useDashboards = () => {
26480
26477
  initialCacheDateRange,
26481
26478
  name: name2.trim(),
26482
26479
  task: "edit-dashboard",
26483
- clientId: clientId ?? client.clientId,
26480
+ clientId: clientId ?? client.id,
26484
26481
  tenantKeys
26485
26482
  };
26486
26483
  try {
@@ -26658,7 +26655,7 @@ var useDashboards = () => {
26658
26655
  client,
26659
26656
  task: "delete-dashboard",
26660
26657
  metadata: {
26661
- clientId: client.clientId,
26658
+ clientId: client.id,
26662
26659
  databaseType: client.databaseType,
26663
26660
  name: name2
26664
26661
  }
@@ -27502,7 +27499,7 @@ async function getExportData(client, dashboardFilters, reportId, getToken, event
27502
27499
  metadata: {
27503
27500
  reportId,
27504
27501
  dashboardItemId: reportId,
27505
- clientId: client.publicKey,
27502
+ clientId: client.id,
27506
27503
  databaseType: client?.databaseType,
27507
27504
  filters: minimalFilters,
27508
27505
  useNewNodeSql: true,
@@ -30580,7 +30577,8 @@ var getLegendLabel = (entry) => {
30580
30577
  var LegendItem = ({
30581
30578
  entry,
30582
30579
  index,
30583
- theme
30580
+ theme,
30581
+ onClick
30584
30582
  }) => /* @__PURE__ */ jsx27(
30585
30583
  "div",
30586
30584
  {
@@ -30589,6 +30587,7 @@ var LegendItem = ({
30589
30587
  alignItems: "baseline",
30590
30588
  marginRight: "1rem"
30591
30589
  },
30590
+ onClick: () => onClick ? onClick(entry) : void 0,
30592
30591
  children: /* @__PURE__ */ jsxs19(
30593
30592
  "div",
30594
30593
  {
@@ -30632,7 +30631,8 @@ var getOuterWidth = (element) => {
30632
30631
  };
30633
30632
  var RenderLegend = ({
30634
30633
  payload,
30635
- limit
30634
+ limit,
30635
+ onClickLegendElement
30636
30636
  }) => {
30637
30637
  const [theme] = useContext5(ThemeContext);
30638
30638
  const [isOpen, setIsOpen] = useState9(false);
@@ -30709,7 +30709,6 @@ var RenderLegend = ({
30709
30709
  visibility: "hidden",
30710
30710
  height: 0,
30711
30711
  overflow: "hidden",
30712
- pointerEvents: "none",
30713
30712
  display: "flex",
30714
30713
  alignItems: "center",
30715
30714
  flexWrap: "nowrap",
@@ -30733,7 +30732,15 @@ var RenderLegend = ({
30733
30732
  ref: (element) => {
30734
30733
  itemRefs.current[index] = element;
30735
30734
  },
30736
- children: /* @__PURE__ */ jsx27(LegendItem, { entry, index, theme })
30735
+ children: /* @__PURE__ */ jsx27(
30736
+ LegendItem,
30737
+ {
30738
+ entry,
30739
+ index,
30740
+ theme,
30741
+ onClick: onClickLegendElement
30742
+ }
30743
+ )
30737
30744
  },
30738
30745
  `legend-measure-${index}`
30739
30746
  ))
@@ -30774,7 +30781,8 @@ var RenderLegend = ({
30774
30781
  {
30775
30782
  entry,
30776
30783
  index,
30777
- theme
30784
+ theme,
30785
+ onClick: onClickLegendElement
30778
30786
  },
30779
30787
  `legend-${index}`
30780
30788
  ))
@@ -30821,7 +30829,8 @@ var RenderLegend = ({
30821
30829
  {
30822
30830
  entry,
30823
30831
  index,
30824
- theme
30832
+ theme,
30833
+ onClick: onClickLegendElement
30825
30834
  },
30826
30835
  `legend-popover-${index}`
30827
30836
  ))
@@ -31093,6 +31102,7 @@ var PieChartWrapper = React4.forwardRef(
31093
31102
  containerStyle,
31094
31103
  theme,
31095
31104
  onClickChartElement,
31105
+ onClickLegendElement,
31096
31106
  yAxisFields,
31097
31107
  showLegend = false,
31098
31108
  ...other
@@ -31189,7 +31199,13 @@ var PieChartWrapper = React4.forwardRef(
31189
31199
  paddingBottom: 20,
31190
31200
  fontFamily: theme?.fontFamily
31191
31201
  },
31192
- content: /* @__PURE__ */ jsx28(RenderLegend, { limit: 5 })
31202
+ content: /* @__PURE__ */ jsx28(
31203
+ RenderLegend,
31204
+ {
31205
+ limit: 5,
31206
+ onClickLegendElement
31207
+ }
31208
+ )
31193
31209
  }
31194
31210
  ),
31195
31211
  /* @__PURE__ */ jsx28(
@@ -32495,6 +32511,8 @@ function LineChart({
32495
32511
  cartesianGridLineColor,
32496
32512
  onClickChartElement = () => {
32497
32513
  },
32514
+ onClickLegendElement = () => {
32515
+ },
32498
32516
  dateFilter,
32499
32517
  referenceLines,
32500
32518
  showLegend = false
@@ -32591,7 +32609,7 @@ function LineChart({
32591
32609
  paddingBottom: 20,
32592
32610
  fontFamily: theme?.fontFamily
32593
32611
  },
32594
- content: /* @__PURE__ */ jsx35(RenderLegend, {})
32612
+ content: /* @__PURE__ */ jsx35(RenderLegend, { onClickLegendElement })
32595
32613
  }
32596
32614
  ),
32597
32615
  /* @__PURE__ */ jsx35(
@@ -32821,6 +32839,8 @@ function RadarChart({
32821
32839
  isAnimationActive = true,
32822
32840
  onClickChartElement = () => {
32823
32841
  },
32842
+ onClickLegendElement = () => {
32843
+ },
32824
32844
  dateFilter,
32825
32845
  showLegend = false
32826
32846
  }) {
@@ -32914,7 +32934,7 @@ function RadarChart({
32914
32934
  paddingBottom: 20,
32915
32935
  fontFamily: theme?.fontFamily
32916
32936
  },
32917
- content: /* @__PURE__ */ jsx36(RenderLegend, {})
32937
+ content: /* @__PURE__ */ jsx36(RenderLegend, { onClickLegendElement })
32918
32938
  }
32919
32939
  ),
32920
32940
  /* @__PURE__ */ jsx36(
@@ -33186,6 +33206,7 @@ function BarChart({
33186
33206
  hideYAxis = false,
33187
33207
  hideCartesianGrid = false,
33188
33208
  onClickChartElement,
33209
+ onClickLegendElement,
33189
33210
  dateFilter,
33190
33211
  referenceLines,
33191
33212
  showLegend = false,
@@ -33279,9 +33300,7 @@ function BarChart({
33279
33300
  {
33280
33301
  data: data ?? [],
33281
33302
  layout,
33282
- onClick: (event) => onClickChartElement ? onClickChartElement(
33283
- event?.activePayload ? event.activePayload[0].payload : void 0
33284
- ) : void 0,
33303
+ onClick: (event) => onClickChartElement ? onClickChartElement(event) : void 0,
33285
33304
  children: [
33286
33305
  !hideCartesianGrid && /* @__PURE__ */ jsx38(
33287
33306
  CartesianGrid2,
@@ -33301,7 +33320,7 @@ function BarChart({
33301
33320
  wrapperStyle: {
33302
33321
  paddingBottom: 20
33303
33322
  },
33304
- content: /* @__PURE__ */ jsx38(RenderLegend, {})
33323
+ content: /* @__PURE__ */ jsx38(RenderLegend, { onClickLegendElement })
33305
33324
  }
33306
33325
  ),
33307
33326
  isHorizontalBars ? /* @__PURE__ */ jsxs28(Fragment3, { children: [
@@ -39041,6 +39060,7 @@ var ChartDisplay = ({
39041
39060
  onPageChange,
39042
39061
  onSortChange,
39043
39062
  onClickChartElement,
39063
+ onClickLegendElement,
39044
39064
  overrideTheme,
39045
39065
  referenceLines,
39046
39066
  showLegend,
@@ -39109,6 +39129,7 @@ var ChartDisplay = ({
39109
39129
  theme: overrideTheme ?? theme,
39110
39130
  colorMap,
39111
39131
  onClickChartElement,
39132
+ onClickLegendElement,
39112
39133
  yAxisFields: config?.yAxisFields,
39113
39134
  showLegend: resolvedShowLegend
39114
39135
  }
@@ -39182,6 +39203,7 @@ var ChartDisplay = ({
39182
39203
  hideCartesianGrid,
39183
39204
  colorMap,
39184
39205
  onClickChartElement,
39206
+ onClickLegendElement,
39185
39207
  dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
39186
39208
  referenceLines,
39187
39209
  showLegend: resolvedShowLegend
@@ -39209,6 +39231,7 @@ var ChartDisplay = ({
39209
39231
  hideCartesianGrid,
39210
39232
  colorMap,
39211
39233
  onClickChartElement,
39234
+ onClickLegendElement,
39212
39235
  dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
39213
39236
  referenceLines,
39214
39237
  showLegend: resolvedShowLegend,
@@ -39365,6 +39388,7 @@ var ChartDisplay = ({
39365
39388
  className,
39366
39389
  isAnimationActive,
39367
39390
  onClickChartElement,
39391
+ onClickLegendElement,
39368
39392
  dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
39369
39393
  showLegend: resolvedShowLegend
39370
39394
  }
@@ -39395,6 +39419,7 @@ var ChartDisplay = ({
39395
39419
  comparisonLineStyle: comparisonLineStyle ?? "solid",
39396
39420
  cartesianGridLineColor,
39397
39421
  onClickChartElement,
39422
+ onClickLegendElement,
39398
39423
  dateFilter: !hideDateRangeFilter ? dateFilter : void 0,
39399
39424
  referenceLines,
39400
39425
  showLegend: resolvedShowLegend
@@ -41460,7 +41485,7 @@ function DashboardLegacy({
41460
41485
  const [filterValues, setFilterValues] = useState26({});
41461
41486
  const prevNameRef = useRef15(name2);
41462
41487
  const prevFlagsRef = useRef15(flags);
41463
- const prevClientRef = useRef15(client?.publicKey ?? "");
41488
+ const prevClientRef = useRef15(client?.id ?? "");
41464
41489
  const addFilterPopoverButtonRef = useRef15(null);
41465
41490
  const viewFiltersPopoverButtonRef = useRef15(null);
41466
41491
  const previousFilters = useRef15(filters);
@@ -41516,15 +41541,15 @@ function DashboardLegacy({
41516
41541
  });
41517
41542
  }, [flags]);
41518
41543
  useEffect19(() => {
41519
- if (prevClientRef.current === client?.publicKey) {
41544
+ if (prevClientRef.current === client?.id) {
41520
41545
  return;
41521
41546
  }
41522
- const isInitialKeySet = !prevClientRef.current && client?.publicKey;
41547
+ const isInitialKeySet = !prevClientRef.current && client?.id;
41523
41548
  if (isInitialKeySet && Object.values(data?.sections ?? {}).flat().length) {
41524
- prevClientRef.current = client?.publicKey ?? "";
41549
+ prevClientRef.current = client?.id ?? "";
41525
41550
  return;
41526
41551
  }
41527
- prevClientRef.current = client?.publicKey ?? "";
41552
+ prevClientRef.current = client?.id ?? "";
41528
41553
  if (isClientLoading) {
41529
41554
  return;
41530
41555
  }
@@ -41536,7 +41561,7 @@ function DashboardLegacy({
41536
41561
  prevFlagsRef.current = flags;
41537
41562
  isInitialLoadOfDashboardRef.current = false;
41538
41563
  });
41539
- }, [client?.publicKey]);
41564
+ }, [client?.id]);
41540
41565
  useEffect19(() => {
41541
41566
  setFilterValues(
41542
41567
  Object.values(populatedDashboardFilters ?? {}).reduce((acc, f) => {
@@ -42519,6 +42544,7 @@ function StaticChart(props) {
42519
42544
  const {
42520
42545
  reportId,
42521
42546
  onClickChartElement,
42547
+ onClickLegendElement,
42522
42548
  containerStyle,
42523
42549
  showLegend,
42524
42550
  className
@@ -42571,6 +42597,7 @@ function StaticChart(props) {
42571
42597
  reportId,
42572
42598
  config,
42573
42599
  onClickChartElement,
42600
+ onClickLegendElement,
42574
42601
  loading,
42575
42602
  className,
42576
42603
  containerStyle: safeContainerStyle,
@@ -47644,7 +47671,7 @@ function ChartBuilder({
47644
47671
  task: "dashboard",
47645
47672
  metadata: {
47646
47673
  name: dashboardName,
47647
- clientId: client.clientId,
47674
+ clientId: client.id,
47648
47675
  databaseType: client.databaseType,
47649
47676
  useNewNodeSql: true,
47650
47677
  tenants
@@ -47704,11 +47731,11 @@ function ChartBuilder({
47704
47731
  const getReferencedTables = async (client2, dbTables, sqlQuery, reportBuilderState2, skipStar) => {
47705
47732
  const metadata = reportBuilderState2 ? {
47706
47733
  reportBuilderState: reportBuilderState2,
47707
- clientId: client2.clientId,
47734
+ clientId: client2.id,
47708
47735
  useNewNodeSql: true
47709
47736
  } : {
47710
47737
  query: sqlQuery,
47711
- clientId: client2.clientId,
47738
+ clientId: client2.id,
47712
47739
  useNewNodeSql: true
47713
47740
  };
47714
47741
  try {
@@ -47934,7 +47961,7 @@ function ChartBuilder({
47934
47961
  client,
47935
47962
  task: "dashnames",
47936
47963
  metadata: {
47937
- clientId: client.clientId
47964
+ clientId: client.id
47938
47965
  }
47939
47966
  });
47940
47967
  dashNames = resp.dashboardNames;
@@ -51479,7 +51506,7 @@ function SQLEditor({
51479
51506
  setColumns([]);
51480
51507
  setDisplayTable(false);
51481
51508
  }
51482
- }, [client?.publicKey]);
51509
+ }, [client?.id]);
51483
51510
  useEffect25(() => {
51484
51511
  if (isChartBuilderOpen === false) {
51485
51512
  onCloseChartBuilder && onCloseChartBuilder();
@@ -51738,7 +51765,7 @@ function SQLEditor({
51738
51765
  task: "astify",
51739
51766
  metadata: {
51740
51767
  query: sqlQuery,
51741
- clientId: client2.clientId,
51768
+ clientId: client2.id,
51742
51769
  useNewNodeSql: true
51743
51770
  }
51744
51771
  });
@@ -51931,7 +51958,7 @@ function SQLEditor({
51931
51958
  query: query || "",
51932
51959
  schema: filteredSchema,
51933
51960
  databaseType: client?.databaseType ?? "postgresql",
51934
- clientName: client?.publicKey || "",
51961
+ clientName: client?.id || "",
51935
51962
  setQuery,
51936
51963
  handleRunQuery: () => {
51937
51964
  handleRunQuery(currentProcessing, true);
@@ -54090,7 +54117,7 @@ var useReportBuilderInternal = ({
54090
54117
  !client.featureFlags?.["recommendedPivotsDisabled"]
54091
54118
  );
54092
54119
  }
54093
- if (!initialTableName && !reportId && client.publicKey) {
54120
+ if (!initialTableName && !reportId && client.id) {
54094
54121
  clearAllState();
54095
54122
  }
54096
54123
  }, [client]);
@@ -59084,11 +59111,11 @@ function Chat({
59084
59111
  setIsLoading(false);
59085
59112
  };
59086
59113
  const submitDefaultMessage = async (nextMessages, abortController) => {
59087
- const clientId = client.clientId ?? client.publicKey;
59114
+ const clientId = client.id;
59088
59115
  let responseBuffer = "";
59089
59116
  for await (const chunk of quillStream({
59090
59117
  client: {
59091
- clientId,
59118
+ id: clientId,
59092
59119
  queryEndpoint: client.queryEndpoint,
59093
59120
  streamEndpoint: client.streamEndpoint,
59094
59121
  queryHeaders: client.queryHeaders,
@@ -59172,12 +59199,12 @@ function Chat({
59172
59199
  }
59173
59200
  };
59174
59201
  const submitAgentMessage = async (nextMessages, abortController) => {
59175
- const clientId = client.clientId ?? client.publicKey;
59202
+ const clientId = client.id;
59176
59203
  let updatedMessages = [...nextMessages];
59177
59204
  for await (const event of quillAgentStream({
59178
59205
  endpoint: `${agentEndpoint}/agent/chat`,
59179
59206
  messages: updatedMessages,
59180
- sourceClientId: clientId,
59207
+ sourceClientId: clientId ?? "<unknown>",
59181
59208
  getToken,
59182
59209
  abortSignal: abortController.signal
59183
59210
  })) {
@@ -59245,7 +59272,7 @@ function Chat({
59245
59272
  setIsLoading(true);
59246
59273
  const abortController = new AbortController();
59247
59274
  abortControllerRef.current = abortController;
59248
- const clientId = client.clientId ?? client.publicKey;
59275
+ const clientId = client.id;
59249
59276
  if (!clientId) {
59250
59277
  setInputError("No client selected.");
59251
59278
  setIsLoading(false);
@@ -60135,7 +60162,7 @@ var useVirtualTables = () => {
60135
60162
  };
60136
60163
  };
60137
60164
  const handleRefreshSome = async (client, tables) => {
60138
- if (!client.clientId) return schemaData;
60165
+ if (!client.id) return schemaData;
60139
60166
  setLoadingTables({
60140
60167
  ...loadingTables,
60141
60168
  ...tables.reduce((acc, table) => {
@@ -60153,7 +60180,7 @@ var useVirtualTables = () => {
60153
60180
  name: table.name,
60154
60181
  customFieldInfo: table.customFieldInfo,
60155
60182
  id: table._id,
60156
- clientId: client.clientId,
60183
+ clientId: client.id,
60157
60184
  runQueryConfig: { getColumns: true },
60158
60185
  databaseType: client.databaseType,
60159
60186
  useNewNodeSql: true