@pitcher/canvas-ui 2025.12.10-74659 → 2025.12.10-82548

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/canvas-ui.js CHANGED
@@ -94635,40 +94635,40 @@ const _hoisted_47$4 = { class: "ml-2 text-sm text-gray-500" };
94635
94635
  const _hoisted_48$4 = ["data-result-selected", "onClick"];
94636
94636
  const _hoisted_49$4 = { class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center" };
94637
94637
  const _hoisted_50$4 = { class: "flex-1 min-w-0" };
94638
- const _hoisted_51$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94639
- const _hoisted_52$2 = { class: "text-xs text-gray-500" };
94640
- const _hoisted_53$2 = { class: "text-xs text-gray-400" };
94641
- const _hoisted_54$1 = {
94638
+ const _hoisted_51$3 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94639
+ const _hoisted_52$3 = { class: "text-xs text-gray-500" };
94640
+ const _hoisted_53$3 = { class: "text-xs text-gray-400" };
94641
+ const _hoisted_54$2 = {
94642
94642
  key: 0,
94643
94643
  class: "px-0 py-0"
94644
94644
  };
94645
- const _hoisted_55$1 = {
94645
+ const _hoisted_55$2 = {
94646
94646
  key: 0,
94647
94647
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
94648
94648
  };
94649
- const _hoisted_56$1 = {
94649
+ const _hoisted_56$2 = {
94650
94650
  key: 2,
94651
94651
  class: "flex-1 overflow-y-auto bg-white w-full"
94652
94652
  };
94653
- const _hoisted_57$1 = { class: "w-full px-0" };
94654
- const _hoisted_58$1 = { class: "flex items-center px-0 pt-2 pb-1" };
94655
- const _hoisted_59$1 = { class: "text-m font-semibold text-gray-900" };
94656
- const _hoisted_60$1 = { class: "ml-2 text-sm text-gray-500" };
94657
- const _hoisted_61$1 = ["data-result-selected", "onClick"];
94658
- const _hoisted_62$1 = {
94653
+ const _hoisted_57$2 = { class: "w-full px-0" };
94654
+ const _hoisted_58$2 = { class: "flex items-center px-0 pt-2 pb-1" };
94655
+ const _hoisted_59$2 = { class: "text-m font-semibold text-gray-900" };
94656
+ const _hoisted_60$2 = { class: "ml-2 text-sm text-gray-500" };
94657
+ const _hoisted_61$2 = ["data-result-selected", "onClick"];
94658
+ const _hoisted_62$2 = {
94659
94659
  key: 1,
94660
94660
  class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
94661
94661
  };
94662
- const _hoisted_63$1 = { class: "flex-1 min-w-0" };
94663
- const _hoisted_64$1 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94664
- const _hoisted_65$1 = ["innerHTML"];
94665
- const _hoisted_66$1 = { class: "text-xs text-gray-500" };
94666
- const _hoisted_67$1 = { class: "text-xs text-gray-400" };
94667
- const _hoisted_68$1 = {
94662
+ const _hoisted_63$2 = { class: "flex-1 min-w-0" };
94663
+ const _hoisted_64$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
94664
+ const _hoisted_65$2 = ["innerHTML"];
94665
+ const _hoisted_66$2 = { class: "text-xs text-gray-500" };
94666
+ const _hoisted_67$2 = { class: "text-xs text-gray-400" };
94667
+ const _hoisted_68$2 = {
94668
94668
  key: 0,
94669
94669
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
94670
94670
  };
94671
- const _hoisted_69 = {
94671
+ const _hoisted_69$1 = {
94672
94672
  key: 0,
94673
94673
  class: "flex flex-wrap line-height-6 pt-4 pb-2 px-6 border-t border-gray-200 gap-y-4 gap-x-4"
94674
94674
  };
@@ -95847,14 +95847,14 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95847
95847
  })
95848
95848
  ]),
95849
95849
  createElementVNode("div", _hoisted_50$4, [
95850
- createElementVNode("h3", _hoisted_51$2, toDisplayString(item.name), 1),
95851
- createElementVNode("p", _hoisted_52$2, toDisplayString(formatCanvasType(item.content_type)), 1)
95850
+ createElementVNode("h3", _hoisted_51$3, toDisplayString(item.name), 1),
95851
+ createElementVNode("p", _hoisted_52$3, toDisplayString(formatCanvasType(item.content_type)), 1)
95852
95852
  ]),
95853
- createElementVNode("div", _hoisted_53$2, toDisplayString(item.folder?.name || ""), 1)
95853
+ createElementVNode("div", _hoisted_53$3, toDisplayString(item.folder?.name || ""), 1)
95854
95854
  ], 10, _hoisted_48$4);
95855
95855
  }), 128))
95856
95856
  ]),
95857
- filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_54$1, [
95857
+ filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_54$2, [
95858
95858
  createElementVNode("span", {
95859
95859
  class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
95860
95860
  onClick: _cache[14] || (_cache[14] = ($event) => searchType.value = "canvases")
@@ -95869,7 +95869,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95869
95869
  ])) : createCommentVNode("", true)
95870
95870
  ])) : createCommentVNode("", true)
95871
95871
  ]),
95872
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_55$1, [
95872
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_55$2, [
95873
95873
  createVNode(CIcon, {
95874
95874
  class: "text-6xl",
95875
95875
  color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
@@ -95880,9 +95880,9 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95880
95880
  class: normalizeClass(searchError.value ? "text-error font-semibold" : "text-text2")
95881
95881
  }, toDisplayString(searchError.value || unref(t)("canvasUI.CGlobalSearch.noResults")), 3)
95882
95882
  ])) : createCommentVNode("", true)
95883
- ])) : (openBlock(), createElementBlock("div", _hoisted_56$1, [
95884
- createElementVNode("div", _hoisted_57$1, [
95885
- createElementVNode("div", _hoisted_58$1, [
95883
+ ])) : (openBlock(), createElementBlock("div", _hoisted_56$2, [
95884
+ createElementVNode("div", _hoisted_57$2, [
95885
+ createElementVNode("div", _hoisted_58$2, [
95886
95886
  searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
95887
95887
  key: 0,
95888
95888
  class: "mr-2",
@@ -95896,8 +95896,8 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95896
95896
  icon: "presentation",
95897
95897
  size: "16"
95898
95898
  })),
95899
- createElementVNode("span", _hoisted_59$1, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
95900
- createElementVNode("span", _hoisted_60$1, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
95899
+ createElementVNode("span", _hoisted_59$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
95900
+ createElementVNode("span", _hoisted_60$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
95901
95901
  ]),
95902
95902
  createElementVNode("div", null, [
95903
95903
  (openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
@@ -95922,7 +95922,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95922
95922
  "object-fit": "cover",
95923
95923
  src: item.picture_url || "",
95924
95924
  width: "72"
95925
- }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_62$1, [
95925
+ }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_62$2, [
95926
95926
  searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
95927
95927
  key: 0,
95928
95928
  color: "var(--p-text2)",
@@ -95935,20 +95935,20 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95935
95935
  size: "32"
95936
95936
  }))
95937
95937
  ])),
95938
- createElementVNode("div", _hoisted_63$1, [
95939
- createElementVNode("h3", _hoisted_64$1, toDisplayString(item.name), 1),
95938
+ createElementVNode("div", _hoisted_63$2, [
95939
+ createElementVNode("h3", _hoisted_64$2, toDisplayString(item.name), 1),
95940
95940
  searchType.value === "content" && item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
95941
95941
  key: 0,
95942
95942
  class: "text-xs text-gray-600 mb-1",
95943
95943
  innerHTML: getSnippet(item)
95944
- }, null, 8, _hoisted_65$1)) : createCommentVNode("", true),
95945
- createElementVNode("p", _hoisted_66$1, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.content_type || "PDF" : formatCanvasType(item.content_type)), 1)
95944
+ }, null, 8, _hoisted_65$2)) : createCommentVNode("", true),
95945
+ createElementVNode("p", _hoisted_66$2, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.content_type || "PDF" : formatCanvasType(item.content_type)), 1)
95946
95946
  ]),
95947
- createElementVNode("div", _hoisted_67$1, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
95948
- ], 10, _hoisted_61$1);
95947
+ createElementVNode("div", _hoisted_67$2, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
95948
+ ], 10, _hoisted_61$2);
95949
95949
  }), 128))
95950
95950
  ]),
95951
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_68$1, [
95951
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_68$2, [
95952
95952
  createVNode(CIcon, {
95953
95953
  class: "text-6xl",
95954
95954
  color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
@@ -95962,7 +95962,7 @@ const _sfc_main$5I = /* @__PURE__ */ defineComponent({
95962
95962
  ])
95963
95963
  ]))
95964
95964
  ]),
95965
- !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_69, [
95965
+ !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_69$1, [
95966
95966
  createVNode(CShortcut, null, {
95967
95967
  default: withCtx(() => [
95968
95968
  createVNode(CShortcutIcon, { icon: "arrow-up" }),
@@ -140839,17 +140839,96 @@ const _sfc_main$2G = /* @__PURE__ */ defineComponent({
140839
140839
  }
140840
140840
  });
140841
140841
 
140842
- const _hoisted_1$24 = { class: "cb-data-charts-raw" };
140842
+ const _hoisted_1$24 = {
140843
+ key: 0,
140844
+ class: "cb-data-charts-raw__controls"
140845
+ };
140843
140846
  const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140844
140847
  __name: "DataCharts.raw",
140845
140848
  props: {
140846
- data: {}
140849
+ data: {},
140850
+ isPreview: { type: Boolean },
140851
+ isEditMode: { type: Boolean }
140847
140852
  },
140848
140853
  setup(__props) {
140854
+ const { t } = useI18n();
140849
140855
  const chartRef = ref(null);
140856
+ const containerRef = ref(null);
140850
140857
  let chart = null;
140851
140858
  const isChartLoaded = ref(false);
140859
+ const isFullscreen = ref(false);
140860
+ const currentChartType = ref("");
140852
140861
  const props = __props;
140862
+ const showViewControls = computed(() => {
140863
+ if (props.isPreview || props.isEditMode) return false;
140864
+ return props.data?.view_controls?.enable_fullscreen_btn || props.data?.view_controls?.enable_chart_type_switcher;
140865
+ });
140866
+ const containerStyle = computed(() => {
140867
+ if (isFullscreen.value || props.isPreview) {
140868
+ return {};
140869
+ }
140870
+ return {
140871
+ height: props.data?.chart_height ? `${props.data.chart_height}px` : void 0,
140872
+ width: props.data?.chart_width ? `${props.data.chart_width}%` : void 0,
140873
+ minHeight: props.data?.chart_height ? `${props.data.chart_height}px` : void 0,
140874
+ maxHeight: props.data?.chart_height ? `${props.data.chart_height}px` : void 0
140875
+ };
140876
+ });
140877
+ const originalChartType = computed(() => {
140878
+ return props.data?.type || props.data?._primary_chart_type || "bar";
140879
+ });
140880
+ const isScatterChart = computed(() => originalChartType.value === "scatter");
140881
+ const isBubbleChart = computed(() => originalChartType.value === "bubble");
140882
+ const labelValueChartTypes = [
140883
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), key: "bar" },
140884
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), key: "line" },
140885
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.area"), key: "area" },
140886
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), key: "pie" },
140887
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), key: "doughnut" },
140888
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), key: "polarArea" },
140889
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), key: "radar" }
140890
+ ];
140891
+ const scatterChartTypes = [{ label: t("canvasUI.canvasBuilder.dataCharts.types.scatter"), key: "scatter" }];
140892
+ const bubbleChartTypes = [{ label: t("canvasUI.canvasBuilder.dataCharts.types.bubble"), key: "bubble" }];
140893
+ const chartTypeSwitcherOptions = computed(() => {
140894
+ if (isBubbleChart.value) return bubbleChartTypes;
140895
+ if (isScatterChart.value) return scatterChartTypes;
140896
+ return labelValueChartTypes;
140897
+ });
140898
+ function toggleFullscreen() {
140899
+ if (!containerRef.value) return;
140900
+ if (!isFullscreen.value) {
140901
+ isFullscreen.value = true;
140902
+ } else {
140903
+ isFullscreen.value = false;
140904
+ }
140905
+ nextTick(() => {
140906
+ if (chart) {
140907
+ chart.resize();
140908
+ }
140909
+ });
140910
+ }
140911
+ function handleChartTypeChange(newType) {
140912
+ if (!chart || !props.data) return;
140913
+ currentChartType.value = newType;
140914
+ initChart(newType);
140915
+ }
140916
+ function handleKeydown(e) {
140917
+ if (e.key === "Escape" && isFullscreen.value) {
140918
+ isFullscreen.value = false;
140919
+ nextTick(() => {
140920
+ if (chart) {
140921
+ chart.resize();
140922
+ }
140923
+ });
140924
+ }
140925
+ }
140926
+ onMounted(() => {
140927
+ window.addEventListener("keydown", handleKeydown);
140928
+ });
140929
+ onUnmounted(() => {
140930
+ window.removeEventListener("keydown", handleKeydown);
140931
+ });
140853
140932
  const sectionListSectionInfo = inject(
140854
140933
  "sectionListSectionInfo",
140855
140934
  computed(() => null)
@@ -140880,41 +140959,191 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140880
140959
  }
140881
140960
  return window._chartJsPromise;
140882
140961
  }
140883
- function processChartData(chartData, context) {
140962
+ function normalizeRValues(values, minRadius = 5, maxRadius = 40) {
140963
+ if (values.length === 0) return [];
140964
+ const rValues = values.map((v) => v.r);
140965
+ const minR = Math.min(...rValues);
140966
+ const maxR = Math.max(...rValues);
140967
+ if (minR === maxR) {
140968
+ return values.map((v) => ({
140969
+ ...v,
140970
+ r: (minRadius + maxRadius) / 2,
140971
+ originalR: v.r
140972
+ }));
140973
+ }
140974
+ return values.map((v) => ({
140975
+ ...v,
140976
+ r: minRadius + (v.r - minR) / (maxR - minR) * (maxRadius - minRadius),
140977
+ originalR: v.r
140978
+ }));
140979
+ }
140980
+ function processSeriesDataPoints(dataPoints, chartType, context) {
140981
+ const isScatterChart2 = chartType === "scatter";
140982
+ const isBubbleChart2 = chartType === "bubble";
140983
+ const isXYChart = isScatterChart2 || isBubbleChart2;
140884
140984
  const processedData = {
140885
140985
  labels: [],
140886
140986
  values: []
140887
140987
  };
140888
- chartData.data_points?.forEach((point) => {
140988
+ const rawBubbleData = [];
140989
+ dataPoints?.forEach((point) => {
140889
140990
  let label = point.label;
140890
- let value = point.value;
140891
140991
  try {
140892
140992
  if (typeof label === "string") {
140893
140993
  label = renderTemplate(label, context);
140894
140994
  }
140895
- if (typeof value === "string") {
140896
- value = renderTemplate(value, context);
140897
- }
140898
- if (typeof label === "string" && label.includes(",") && typeof value === "string" && value.includes(",")) {
140899
- const labels = label.split(",");
140900
- const values = value.split(",");
140901
- labels.forEach((l, idx) => {
140902
- const v = values[idx];
140903
- if (v !== void 0) {
140904
- processedData.labels.push(l);
140905
- processedData.values.push(Number(v) || 0);
140995
+ if (isXYChart) {
140996
+ let xValue = point.x_value ?? "0";
140997
+ let yValue = point.y_value ?? "0";
140998
+ let rValue = point.r_value ?? "10";
140999
+ if (typeof xValue === "string") {
141000
+ xValue = renderTemplate(xValue, context);
141001
+ }
141002
+ if (typeof yValue === "string") {
141003
+ yValue = renderTemplate(yValue, context);
141004
+ }
141005
+ if (typeof rValue === "string") {
141006
+ rValue = renderTemplate(rValue, context);
141007
+ }
141008
+ if (typeof label === "string" && label.includes(",") && typeof xValue === "string" && xValue.includes(",") && typeof yValue === "string" && yValue.includes(",")) {
141009
+ const labels = label.split(",");
141010
+ const xValues = xValue.split(",");
141011
+ const yValues = yValue.split(",");
141012
+ const rValues = typeof rValue === "string" && rValue.includes(",") ? rValue.split(",") : [];
141013
+ labels.forEach((l, idx) => {
141014
+ const x = Number(xValues[idx]) || 0;
141015
+ const y = Number(yValues[idx]) || 0;
141016
+ if (isBubbleChart2) {
141017
+ const r = rValues[idx] ? Number(rValues[idx]) || 10 : 10;
141018
+ rawBubbleData.push({ label: l, x, y, r: Math.abs(r) });
141019
+ } else {
141020
+ processedData.labels.push(l);
141021
+ processedData.values.push({ x, y });
141022
+ }
141023
+ });
141024
+ } else {
141025
+ const x = Number(xValue) || 0;
141026
+ const y = Number(yValue) || 0;
141027
+ if (isBubbleChart2) {
141028
+ const r = Number(rValue) || 10;
141029
+ rawBubbleData.push({ label, x, y, r: Math.abs(r) });
141030
+ } else {
141031
+ processedData.labels.push(label);
141032
+ processedData.values.push({ x, y });
140906
141033
  }
140907
- });
141034
+ }
140908
141035
  } else {
140909
- processedData.labels.push(label);
140910
- processedData.values.push(Number(value) || 0);
141036
+ let value = point.value;
141037
+ if (typeof value === "string") {
141038
+ value = renderTemplate(value, context);
141039
+ }
141040
+ if (typeof label === "string" && label.includes(",") && typeof value === "string" && value.includes(",")) {
141041
+ const labels = label.split(",");
141042
+ const values = value.split(",");
141043
+ labels.forEach((l, idx) => {
141044
+ const v = values[idx];
141045
+ if (v !== void 0) {
141046
+ processedData.labels.push(l);
141047
+ processedData.values.push(Number(v) || 0);
141048
+ }
141049
+ });
141050
+ } else {
141051
+ processedData.labels.push(label);
141052
+ processedData.values.push(Number(value) || 0);
141053
+ }
140911
141054
  }
140912
141055
  } catch (err) {
140913
141056
  console.warn("Error processing chart data point:", err);
140914
- processedData.labels.push(label);
140915
- processedData.values.push(Number(value) || 0);
141057
+ if (isBubbleChart2) {
141058
+ rawBubbleData.push({ label, x: 0, y: 0, r: 10 });
141059
+ } else if (isXYChart) {
141060
+ processedData.labels.push(label);
141061
+ processedData.values.push({ x: 0, y: 0 });
141062
+ } else {
141063
+ processedData.labels.push(label);
141064
+ processedData.values.push(0);
141065
+ }
140916
141066
  }
140917
141067
  });
141068
+ if (isBubbleChart2 && rawBubbleData.length > 0) {
141069
+ const bubbleValues = rawBubbleData.map((d) => ({ x: d.x, y: d.y, r: d.r }));
141070
+ const normalizedValues = normalizeRValues(bubbleValues);
141071
+ rawBubbleData.forEach((d, idx) => {
141072
+ processedData.labels.push(d.label);
141073
+ processedData.values.push(normalizedValues[idx]);
141074
+ });
141075
+ }
141076
+ return processedData;
141077
+ }
141078
+ function processChartData(chartData, context, overrideType) {
141079
+ if (chartData.series && Array.isArray(chartData.series) && chartData.series.length > 0) {
141080
+ const datasets = [];
141081
+ let allLabels = [];
141082
+ const isSingleSeries = chartData.series.length === 1;
141083
+ chartData.series.forEach((series, index) => {
141084
+ const seriesChartType = overrideType || series.chart_type || chartData.type || "bar";
141085
+ const processedData2 = processSeriesDataPoints(series.data_points || [], seriesChartType, context);
141086
+ if (processedData2.labels.length > allLabels.length) {
141087
+ allLabels = processedData2.labels;
141088
+ }
141089
+ const preBuiltDataset = chartData.data?.datasets?.[index];
141090
+ let backgroundColor2 = preBuiltDataset?.background_color || preBuiltDataset?.backgroundColor;
141091
+ let borderColor2 = preBuiltDataset?.border_color || preBuiltDataset?.borderColor;
141092
+ if (isSingleSeries && Array.isArray(backgroundColor2)) {
141093
+ const resolvedColors = backgroundColor2.map((color, i) => {
141094
+ if (typeof color === "string" && color.startsWith("palette")) {
141095
+ const paletteIndex = parseInt(color.replace("palette", ""));
141096
+ const validIndex = paletteIndex >= 0 ? paletteIndex % palette.value.length : i;
141097
+ return palette.value[validIndex];
141098
+ }
141099
+ return color;
141100
+ });
141101
+ const dataPointsCount = processedData2.values.length;
141102
+ backgroundColor2 = Array.from({ length: dataPointsCount }, (_, i) => resolvedColors[i % resolvedColors.length]);
141103
+ borderColor2 = [...backgroundColor2];
141104
+ } else if (typeof backgroundColor2 === "string" && backgroundColor2.startsWith("palette")) {
141105
+ const paletteIndex = parseInt(backgroundColor2.replace("palette", ""));
141106
+ const validIndex = paletteIndex >= 0 ? paletteIndex % palette.value.length : index;
141107
+ backgroundColor2 = palette.value[validIndex];
141108
+ borderColor2 = backgroundColor2;
141109
+ }
141110
+ const datasetOptions = {
141111
+ label: series.name,
141112
+ data: processedData2.values,
141113
+ backgroundColor: backgroundColor2 || palette.value[index % palette.value.length],
141114
+ borderColor: borderColor2 || palette.value[index % palette.value.length],
141115
+ borderWidth: 1
141116
+ };
141117
+ if (!isSingleSeries) {
141118
+ if (series.chart_type === "area") {
141119
+ datasetOptions.type = "line";
141120
+ datasetOptions.fill = true;
141121
+ datasetOptions.tension = 0.4;
141122
+ } else {
141123
+ datasetOptions.type = series.chart_type;
141124
+ }
141125
+ }
141126
+ if (series.chart_type === "area") {
141127
+ datasetOptions.fill = true;
141128
+ datasetOptions.tension = 0.4;
141129
+ }
141130
+ if (["line", "area"].includes(series.chart_type)) {
141131
+ datasetOptions.tension = 0.4;
141132
+ }
141133
+ datasets.push(datasetOptions);
141134
+ });
141135
+ return {
141136
+ ...chartData,
141137
+ type: chartData.type || chartData._primary_chart_type || "bar",
141138
+ data: {
141139
+ ...chartData.data,
141140
+ labels: allLabels,
141141
+ datasets
141142
+ }
141143
+ };
141144
+ }
141145
+ const chartType = overrideType || chartData.type || "bar";
141146
+ const processedData = processSeriesDataPoints(chartData.data_points || [], chartType, context);
140918
141147
  let backgroundColor = chartData.data?.datasets?.[0]?.background_color || [];
140919
141148
  let borderColor = chartData.data?.datasets?.[0]?.border_color || [];
140920
141149
  if (chartData.color_scheme_type === "theme" && Array.isArray(backgroundColor)) {
@@ -140960,7 +141189,7 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140960
141189
  }
140961
141190
  };
140962
141191
  }
140963
- function initChart() {
141192
+ function initChart(overrideType) {
140964
141193
  if (!props.data || !chartRef.value || !isChartLoaded.value) {
140965
141194
  return;
140966
141195
  }
@@ -140968,25 +141197,85 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
140968
141197
  chart.destroy();
140969
141198
  }
140970
141199
  const context = props.data.context ?? (!isEmpty(activeCanvas.value?.context) || isCanvas.value ? { ...crmShape.value, ...activeCanvas.value?.context } : crmShape.value);
140971
- const processedChartData = processChartData(props.data, context);
141200
+ const processedChartData = processChartData(props.data, context, overrideType);
141201
+ let chartType = overrideType || currentChartType.value || processedChartData.type || "bar";
141202
+ const isAreaChart = chartType === "area";
141203
+ if (isAreaChart) {
141204
+ chartType = "line";
141205
+ }
140972
141206
  if (processedChartData.data?.datasets) {
140973
141207
  processedChartData.data.datasets = processedChartData.data.datasets.map((dataset) => {
140974
- const { background_color, border_color, point_style, ...rest } = dataset;
141208
+ const { background_color, border_color, point_style, fill, tension, show_line, ...rest } = dataset;
140975
141209
  return {
140976
141210
  ...rest,
140977
141211
  backgroundColor: dataset.backgroundColor || background_color || ["#000000"],
140978
141212
  borderColor: dataset.borderColor || border_color || ["#000000"],
140979
- pointStyle: point_style
141213
+ pointStyle: point_style,
141214
+ fill: isAreaChart ? true : fill,
141215
+ tension: isAreaChart ? tension ?? 0.4 : tension,
141216
+ showLine: show_line
140980
141217
  };
140981
141218
  });
140982
141219
  }
141220
+ let scales = processedChartData.options?.scales;
141221
+ if (scales) {
141222
+ const convertedScales = {};
141223
+ if (scales.x) {
141224
+ convertedScales.x = { ...scales.x };
141225
+ }
141226
+ if (scales.y) {
141227
+ convertedScales.y = {
141228
+ ...scales.y,
141229
+ beginAtZero: scales.y.begin_at_zero
141230
+ };
141231
+ delete convertedScales.y.begin_at_zero;
141232
+ }
141233
+ if (scales.r) {
141234
+ convertedScales.r = {
141235
+ ...scales.r,
141236
+ beginAtZero: scales.r.begin_at_zero,
141237
+ ticks: scales.r.ticks ? {
141238
+ stepSize: scales.r.ticks.step_size
141239
+ } : void 0
141240
+ };
141241
+ }
141242
+ scales = convertedScales;
141243
+ }
141244
+ if (["pie", "doughnut", "polarArea"].includes(chartType)) {
141245
+ scales = void 0;
141246
+ }
141247
+ const tooltipCallbacks = {};
141248
+ const isBubble = chartType === "bubble";
141249
+ if (props.data.percent_display || isBubble) {
141250
+ tooltipCallbacks.label = function(context2) {
141251
+ const label = context2.dataset.label || "";
141252
+ const value = context2.raw;
141253
+ if (isBubble && typeof value === "object" && value !== null) {
141254
+ const x = value.x;
141255
+ const y = value.y;
141256
+ const r = value.originalR !== void 0 ? value.originalR : value.r;
141257
+ return `${label}${label ? ": " : ""}(${x}, ${y}, ${r})`;
141258
+ }
141259
+ if (props.data?.percent_display && typeof value === "number" && value >= 0 && value <= 1) {
141260
+ return `${label}${label ? ": " : ""}${(value * 100).toFixed(2)}%`;
141261
+ }
141262
+ return `${label}${label ? ": " : ""}${value}`;
141263
+ };
141264
+ }
140983
141265
  const chartConfig = {
140984
141266
  ...processedChartData,
140985
- type: processedChartData.type,
141267
+ type: chartType,
140986
141268
  options: merge$1({}, processedChartData.options, {
140987
141269
  responsive: true,
140988
141270
  maintainAspectRatio: false,
140989
- indexAxis: processedChartData.options?.index_axis
141271
+ indexAxis: processedChartData.options?.index_axis,
141272
+ scales,
141273
+ plugins: {
141274
+ ...processedChartData.options?.plugins,
141275
+ tooltip: props.data.percent_display || isBubble ? {
141276
+ callbacks: tooltipCallbacks
141277
+ } : void 0
141278
+ }
140990
141279
  })
140991
141280
  };
140992
141281
  chart = new window.Chart(chartRef.value, chartConfig);
@@ -141006,84 +141295,172 @@ const _sfc_main$2F = /* @__PURE__ */ defineComponent({
141006
141295
  isChartLoaded.value = true;
141007
141296
  });
141008
141297
  return (_ctx, _cache) => {
141009
- return openBlock(), createElementBlock("div", _hoisted_1$24, [
141298
+ return openBlock(), createElementBlock("div", {
141299
+ ref_key: "containerRef",
141300
+ ref: containerRef,
141301
+ class: normalizeClass(["cb-data-charts-raw", { "is-fullscreen": isFullscreen.value }]),
141302
+ style: normalizeStyle(containerStyle.value)
141303
+ }, [
141304
+ showViewControls.value ? (openBlock(), createElementBlock("div", _hoisted_1$24, [
141305
+ props.data?.view_controls?.enable_chart_type_switcher ? (openBlock(), createBlock(unref(NDropdown), {
141306
+ key: 0,
141307
+ options: chartTypeSwitcherOptions.value,
141308
+ trigger: "click",
141309
+ onSelect: handleChartTypeChange
141310
+ }, {
141311
+ default: withCtx(() => [
141312
+ createVNode(CButton, {
141313
+ quaternary: "",
141314
+ size: "small"
141315
+ }, {
141316
+ icon: withCtx(() => [
141317
+ createVNode(CIcon, { icon: "chart-bar" })
141318
+ ]),
141319
+ _: 1
141320
+ })
141321
+ ]),
141322
+ _: 1
141323
+ }, 8, ["options"])) : createCommentVNode("", true),
141324
+ props.data?.view_controls?.enable_fullscreen_btn ? (openBlock(), createBlock(CButton, {
141325
+ key: 1,
141326
+ quaternary: "",
141327
+ size: "small",
141328
+ onClick: toggleFullscreen
141329
+ }, {
141330
+ icon: withCtx(() => [
141331
+ createVNode(CIcon, {
141332
+ icon: isFullscreen.value ? "compress" : "expand"
141333
+ }, null, 8, ["icon"])
141334
+ ]),
141335
+ _: 1
141336
+ })) : createCommentVNode("", true)
141337
+ ])) : createCommentVNode("", true),
141010
141338
  createElementVNode("canvas", {
141011
141339
  ref_key: "chartRef",
141012
141340
  ref: chartRef,
141013
141341
  class: "w-full h-full"
141014
141342
  }, null, 512)
141015
- ]);
141343
+ ], 6);
141016
141344
  };
141017
141345
  }
141018
141346
  });
141019
141347
 
141020
- const RawDataCharts = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__scopeId", "data-v-e71330a8"]]);
141348
+ const RawDataCharts = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__scopeId", "data-v-7078dc66"]]);
141349
+
141350
+ const STANDALONE_CHART_TYPES = ["pie", "doughnut", "radar", "polarArea"];
141351
+ const ONE_D_CHART_TYPES = ["bar", "line", "area"];
141352
+ const TWO_D_CHART_TYPES = ["scatter"];
141353
+ const THREE_D_CHART_TYPES = ["bubble"];
141354
+ const XY_CHART_TYPES = ["scatter"];
141355
+ const XYR_CHART_TYPES = ["bubble"];
141021
141356
 
141022
141357
  const _hoisted_1$23 = { class: "flex gap-4 h-[calc(80vh-120px)] w-full" };
141023
141358
  const _hoisted_2$1t = { class: "cb-data-charts-settings__card overflow-auto flex-1" };
141024
141359
  const _hoisted_3$17 = { class: "flex flex-col h-full" };
141025
141360
  const _hoisted_4$X = { class: "flex-grow overflow-y-auto overflow-x-hidden" };
141026
- const _hoisted_5$O = { class: "mb-4" };
141027
- const _hoisted_6$H = { class: "block mb-2" };
141028
- const _hoisted_7$v = { class: "mb-4" };
141029
- const _hoisted_8$q = { class: "block mb-2" };
141030
- const _hoisted_9$m = { class: "mb-4" };
141031
- const _hoisted_10$h = { class: "block mb-2" };
141032
- const _hoisted_11$f = { class: "mb-4" };
141033
- const _hoisted_12$b = { class: "block mb-2" };
141034
- const _hoisted_13$a = {
141361
+ const _hoisted_5$O = { class: "text-sm font-semibold mb-3 text-gray-600 dark:text-gray-400 uppercase tracking-wide" };
141362
+ const _hoisted_6$H = { class: "flex items-end border-b border-gray-200 dark:border-gray-700 mb-4 -mx-4 px-4" };
141363
+ const _hoisted_7$v = ["onClick"];
141364
+ const _hoisted_8$q = { class: "text-sm font-medium truncate max-w-24" };
141365
+ const _hoisted_9$m = ["onClick"];
141366
+ const _hoisted_10$h = ["title"];
141367
+ const _hoisted_11$f = {
141035
141368
  key: 0,
141036
141369
  class: "mb-4"
141037
141370
  };
141371
+ const _hoisted_12$b = { class: "block mb-2" };
141372
+ const _hoisted_13$a = { class: "mb-4" };
141038
141373
  const _hoisted_14$9 = { class: "block mb-2" };
141039
141374
  const _hoisted_15$8 = { class: "mb-4" };
141040
- const _hoisted_16$8 = { class: "block mb-2" };
141041
- const _hoisted_17$7 = {
141042
- key: 1,
141043
- class: "mb-4"
141044
- };
141045
- const _hoisted_18$6 = { class: "block mb-2" };
141046
- const _hoisted_19$6 = { class: "mb-4" };
141047
- const _hoisted_20$5 = { class: "flex justify-between items-center mb-2" };
141048
- const _hoisted_21$5 = { class: "block" };
141049
- const _hoisted_22$3 = { class: "flex gap-2 flex-1" };
141050
- const _hoisted_23$3 = ["onClick"];
141051
- const _hoisted_24$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141052
- const _hoisted_25$3 = { class: "flex gap-4 h-full" };
141053
- const _hoisted_26$3 = { class: "flex-1 flex flex-col" };
141054
- const _hoisted_27$3 = { class: "text-sm mb-2" };
141055
- const _hoisted_28$3 = { class: "overflow-auto" };
141056
- const _hoisted_29$3 = {
141375
+ const _hoisted_16$8 = { class: "flex justify-between items-center mb-2" };
141376
+ const _hoisted_17$7 = { class: "block" };
141377
+ const _hoisted_18$6 = ["onClick"];
141378
+ const _hoisted_19$6 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141379
+ const _hoisted_20$5 = { class: "flex gap-4 h-full" };
141380
+ const _hoisted_21$5 = { class: "flex-1 flex flex-col" };
141381
+ const _hoisted_22$3 = { class: "text-sm mb-2" };
141382
+ const _hoisted_23$3 = { class: "overflow-auto" };
141383
+ const _hoisted_24$3 = {
141057
141384
  key: 0,
141058
141385
  class: "flex-1 border-l pl-4"
141059
141386
  };
141060
- const _hoisted_30$3 = { class: "text-sm font-medium mb-2" };
141061
- const _hoisted_31$3 = { class: "flex flex-col gap-2" };
141062
- const _hoisted_32$3 = { class: "block mb-1 text-sm" };
141063
- const _hoisted_33$3 = { class: "block mb-1 text-sm" };
141064
- const _hoisted_34$3 = ["onClick"];
141065
- const _hoisted_35$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141066
- const _hoisted_36$3 = { class: "flex gap-4 h-full" };
141067
- const _hoisted_37$3 = { class: "flex-1 flex flex-col" };
141068
- const _hoisted_38$3 = { class: "text-sm mb-2" };
141069
- const _hoisted_39$3 = { class: "overflow-auto" };
141070
- const _hoisted_40$3 = {
141387
+ const _hoisted_25$3 = { class: "text-sm font-medium mb-2" };
141388
+ const _hoisted_26$3 = { class: "flex flex-col gap-2" };
141389
+ const _hoisted_27$3 = { class: "block mb-1 text-sm" };
141390
+ const _hoisted_28$3 = { class: "block mb-1 text-sm" };
141391
+ const _hoisted_29$3 = ["onClick"];
141392
+ const _hoisted_30$3 = { class: "p-4 min-w-[400px] max-h-[400px]" };
141393
+ const _hoisted_31$3 = { class: "flex gap-4 h-full" };
141394
+ const _hoisted_32$3 = { class: "flex-1 flex flex-col" };
141395
+ const _hoisted_33$3 = { class: "text-sm mb-2" };
141396
+ const _hoisted_34$3 = { class: "overflow-auto" };
141397
+ const _hoisted_35$3 = {
141071
141398
  key: 0,
141072
141399
  class: "flex-1 border-l pl-4"
141073
141400
  };
141074
- const _hoisted_41$3 = { class: "flex flex-col gap-2" };
141075
- const _hoisted_42$3 = { class: "flex justify-center mt-2" };
141076
- const _hoisted_43$3 = { class: "mb-4" };
141077
- const _hoisted_44$3 = { class: "block mb-2" };
141078
- const _hoisted_45$3 = { class: "mb-4" };
141079
- const _hoisted_46$3 = { class: "block mb-2" };
141080
- const _hoisted_47$3 = { class: "cb-data-charts-settings__preview flex-1 border-l border-[#eee] pl-4" };
141081
- const _hoisted_48$3 = { class: "text-sm font-medium mb-4" };
141082
- const _hoisted_49$3 = {
141401
+ const _hoisted_36$3 = { class: "text-sm font-medium mb-2" };
141402
+ const _hoisted_37$3 = { class: "flex flex-col gap-2" };
141403
+ const _hoisted_38$3 = { class: "block mb-1 text-sm" };
141404
+ const _hoisted_39$3 = { class: "block mb-1 text-sm" };
141405
+ const _hoisted_40$3 = { class: "block mb-1 text-sm" };
141406
+ const _hoisted_41$3 = { key: 0 };
141407
+ const _hoisted_42$3 = { class: "block mb-1 text-sm" };
141408
+ const _hoisted_43$3 = ["onClick"];
141409
+ const _hoisted_44$3 = { class: "p-4 min-w-[400px] max-h-[400px] overflow-auto" };
141410
+ const _hoisted_45$3 = { class: "text-sm mb-2" };
141411
+ const _hoisted_46$3 = ["onClick"];
141412
+ const _hoisted_47$3 = { class: "p-4 min-w-[400px] max-h-[400px] overflow-auto" };
141413
+ const _hoisted_48$3 = { class: "text-sm mb-2" };
141414
+ const _hoisted_49$3 = { class: "flex justify-center mt-2" };
141415
+ const _hoisted_50$3 = { class: "text-sm font-semibold mb-3 mt-6 text-gray-600 dark:text-gray-400 uppercase tracking-wide border-t border-gray-200 dark:border-gray-700 pt-6" };
141416
+ const _hoisted_51$2 = { class: "mb-4" };
141417
+ const _hoisted_52$2 = { class: "block mb-2" };
141418
+ const _hoisted_53$2 = { class: "mb-4" };
141419
+ const _hoisted_54$1 = { class: "block mb-2" };
141420
+ const _hoisted_55$1 = { class: "mb-4" };
141421
+ const _hoisted_56$1 = { class: "block mb-2" };
141422
+ const _hoisted_57$1 = { class: "mb-4" };
141423
+ const _hoisted_58$1 = { class: "block mb-2" };
141424
+ const _hoisted_59$1 = {
141425
+ key: 2,
141426
+ class: "mb-4"
141427
+ };
141428
+ const _hoisted_60$1 = { class: "block mb-2" };
141429
+ const _hoisted_61$1 = {
141430
+ key: 3,
141431
+ class: "mb-4"
141432
+ };
141433
+ const _hoisted_62$1 = { class: "block mb-2" };
141434
+ const _hoisted_63$1 = { class: "mb-4" };
141435
+ const _hoisted_64$1 = { class: "block mb-2" };
141436
+ const _hoisted_65$1 = { class: "mb-4" };
141437
+ const _hoisted_66$1 = { class: "block mb-2" };
141438
+ const _hoisted_67$1 = { class: "mb-4" };
141439
+ const _hoisted_68$1 = { class: "block mb-2" };
141440
+ const _hoisted_69 = { class: "flex items-center gap-2" };
141441
+ const _hoisted_70 = { class: "text-sm text-gray-500" };
141442
+ const _hoisted_71 = { class: "mb-4" };
141443
+ const _hoisted_72 = { class: "block mb-2" };
141444
+ const _hoisted_73 = { class: "flex flex-col gap-2" };
141445
+ const _hoisted_74 = { class: "flex items-center gap-2" };
141446
+ const _hoisted_75 = { class: "text-sm" };
141447
+ const _hoisted_76 = { class: "text-sm" };
141448
+ const _hoisted_77 = { class: "flex items-center gap-2" };
141449
+ const _hoisted_78 = { class: "text-sm" };
141450
+ const _hoisted_79 = { class: "mb-4" };
141451
+ const _hoisted_80 = { class: "block mb-2" };
141452
+ const _hoisted_81 = { class: "flex flex-col gap-3" };
141453
+ const _hoisted_82 = { class: "flex items-center gap-2" };
141454
+ const _hoisted_83 = { class: "text-sm w-16" };
141455
+ const _hoisted_84 = { class: "flex items-center gap-2" };
141456
+ const _hoisted_85 = { class: "text-sm w-16" };
141457
+ const _hoisted_86 = { class: "cb-data-charts-settings__preview flex-1 border-l border-[#eee] pl-4" };
141458
+ const _hoisted_87 = { class: "text-sm font-medium mb-4" };
141459
+ const _hoisted_88 = {
141083
141460
  class: "preview-container",
141084
141461
  style: { "height": "300px" }
141085
141462
  };
141086
- const _hoisted_50$3 = { class: "flex justify-between gap-4" };
141463
+ const _hoisted_89 = { class: "flex justify-between gap-4" };
141087
141464
  const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141088
141465
  __name: "DataCharts.settings",
141089
141466
  props: {
@@ -141097,7 +141474,91 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141097
141474
  const { setComponentEditMode, updateNodeDataById } = useCanvas$1();
141098
141475
  const { crmShape } = useCrmShape();
141099
141476
  const { palette } = useCanvasTheme$1();
141100
- const chartType = ref(props.data?.type ?? "bar");
141477
+ let seriesIdCounter = 0;
141478
+ function generateSeriesId() {
141479
+ return `series_${Date.now()}_${seriesIdCounter++}`;
141480
+ }
141481
+ function convertSavedSeriesToRuntime(savedSeries) {
141482
+ return {
141483
+ id: savedSeries.id || generateSeriesId(),
141484
+ name: savedSeries.name || "Series 1",
141485
+ chartType: savedSeries.chart_type || "bar",
141486
+ dataPoints: (savedSeries.data_points || []).map((dp) => ({
141487
+ label: dp.label || "",
141488
+ value: dp.value || "",
141489
+ xValue: dp.x_value ?? "",
141490
+ yValue: dp.y_value ?? "",
141491
+ rValue: dp.r_value ?? "",
141492
+ dynamicValue: dp.dynamic_value,
141493
+ dynamicXValue: dp.dynamic_x_value,
141494
+ dynamicYValue: dp.dynamic_y_value,
141495
+ dynamicRValue: dp.dynamic_r_value,
141496
+ arrayConfig: dp.array_config
141497
+ }))
141498
+ };
141499
+ }
141500
+ function convertLegacyToSeries() {
141501
+ const chartTypeValue = props.data?.type ?? props.data?._primary_chart_type ?? "bar";
141502
+ const dataPoints = props.data?.data_points && Array.isArray(props.data.data_points) ? props.data.data_points.map((dp) => ({
141503
+ label: dp.label,
141504
+ value: dp.value,
141505
+ xValue: dp.x_value ?? "",
141506
+ yValue: dp.y_value ?? "",
141507
+ dynamicValue: dp.dynamic_value,
141508
+ dynamicXValue: dp.dynamic_x_value,
141509
+ dynamicYValue: dp.dynamic_y_value,
141510
+ arrayConfig: dp.array_config
141511
+ })) : props.data?.data?.labels ? props.data.data.labels.map((label, index) => ({
141512
+ label: String(label),
141513
+ value: String(props.data?.data?.datasets?.[0]?.data?.[index] ?? 0),
141514
+ xValue: "",
141515
+ yValue: ""
141516
+ })) : [];
141517
+ return [
141518
+ {
141519
+ id: generateSeriesId(),
141520
+ name: t("canvasUI.canvasBuilder.dataCharts.series") + " 1",
141521
+ chartType: chartTypeValue,
141522
+ dataPoints
141523
+ }
141524
+ ];
141525
+ }
141526
+ const seriesList = ref(
141527
+ props.data?.series && Array.isArray(props.data.series) && props.data.series.length > 0 ? props.data.series.map((s) => convertSavedSeriesToRuntime(s)) : convertLegacyToSeries()
141528
+ );
141529
+ const activeSeriesIndex = ref(0);
141530
+ const activeSeries = computed(() => seriesList.value[activeSeriesIndex.value]);
141531
+ const isActiveSeriesXYChart = computed(() => XY_CHART_TYPES.includes(activeSeries.value?.chartType));
141532
+ const isActiveSeriesXYRChart = computed(() => XYR_CHART_TYPES.includes(activeSeries.value?.chartType));
141533
+ const isPrimaryStandalone = computed(() => STANDALONE_CHART_TYPES.includes(seriesList.value[0]?.chartType));
141534
+ const isMultiSeries = computed(() => seriesList.value.length > 1);
141535
+ const canAddSeries = computed(() => !isPrimaryStandalone.value);
141536
+ const availableChartTypeOptions = computed(() => {
141537
+ const allOptions = [
141538
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), value: "bar" },
141539
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), value: "line" },
141540
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), value: "pie" },
141541
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), value: "doughnut" },
141542
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), value: "polarArea" },
141543
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), value: "radar" },
141544
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.scatter"), value: "scatter" },
141545
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.bubble"), value: "bubble" },
141546
+ { label: t("canvasUI.canvasBuilder.dataCharts.types.area"), value: "area" }
141547
+ ];
141548
+ const primaryType = seriesList.value[0]?.chartType;
141549
+ if (seriesList.value.length > 1 || activeSeriesIndex.value > 0) {
141550
+ if (THREE_D_CHART_TYPES.includes(primaryType)) {
141551
+ return allOptions.filter((opt) => THREE_D_CHART_TYPES.includes(opt.value));
141552
+ }
141553
+ if (TWO_D_CHART_TYPES.includes(primaryType)) {
141554
+ return allOptions.filter((opt) => TWO_D_CHART_TYPES.includes(opt.value));
141555
+ }
141556
+ return allOptions.filter((opt) => ONE_D_CHART_TYPES.includes(opt.value));
141557
+ }
141558
+ return allOptions;
141559
+ });
141560
+ const chartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
141561
+ const primaryChartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
141101
141562
  const backgroundColor = props.data?.data?.datasets?.[0]?.background_color;
141102
141563
  const colorSchemeType = ref(props.data?.color_scheme_type ?? "theme");
141103
141564
  const chartColors = ref([]);
@@ -141126,24 +141587,16 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141126
141587
  const chartTitle = ref(props.data?.options?.plugins?.title?.text ?? "");
141127
141588
  const legendPosition = ref(props.data?.options?.plugins?.legend?.position ?? "top");
141128
141589
  const enableAnimation = ref((props.data?.options?.animation?.duration ?? 0) > 0);
141129
- const dataPoints = ref(
141130
- props.data?.data_points && Array.isArray(props.data.data_points) ? [...props.data.data_points] : props.data?.data?.labels ? props.data.data.labels.map((label, index) => ({
141131
- label: String(label),
141132
- value: String(props.data?.data?.datasets?.[0]?.data?.[index] ?? 0)
141133
- })) : []
141134
- );
141135
141590
  const xAxisLabel = ref(props.data?.options?.scales?.x?.title?.text ?? "");
141136
141591
  const yAxisLabel = ref(props.data?.options?.scales?.y?.title?.text ?? "");
141137
141592
  const orientation = ref(props.data?.options?.index_axis ?? "x");
141138
141593
  const pointStyle = ref(props.data?.data?.datasets?.[0]?.point_style ?? "circle");
141139
- const chartTypeOptions = [
141140
- { label: t("canvasUI.canvasBuilder.dataCharts.types.bar"), value: "bar" },
141141
- { label: t("canvasUI.canvasBuilder.dataCharts.types.line"), value: "line" },
141142
- { label: t("canvasUI.canvasBuilder.dataCharts.types.pie"), value: "pie" },
141143
- { label: t("canvasUI.canvasBuilder.dataCharts.types.doughnut"), value: "doughnut" },
141144
- { label: t("canvasUI.canvasBuilder.dataCharts.types.polarArea"), value: "polarArea" },
141145
- { label: t("canvasUI.canvasBuilder.dataCharts.types.radar"), value: "radar" }
141146
- ];
141594
+ const percentDisplay = ref(props.data?.percent_display ?? false);
141595
+ const enableFullscreenBtn = ref(props.data?.view_controls?.enable_fullscreen_btn ?? false);
141596
+ const enableChartTypeSwitcher = ref(props.data?.view_controls?.enable_chart_type_switcher ?? false);
141597
+ const enableDataEntry = ref(props.data?.view_controls?.enable_data_entry ?? false);
141598
+ const chartHeight = ref(props.data?.chart_height ?? 800);
141599
+ const chartWidth = ref(props.data?.chart_width ?? 100);
141147
141600
  const legendPositionOptions = [
141148
141601
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.none"), value: "none" },
141149
141602
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.top"), value: "top" },
@@ -141152,8 +141605,8 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141152
141605
  { label: t("canvasUI.canvasBuilder.dataCharts.legendPositions.right"), value: "right" }
141153
141606
  ];
141154
141607
  const orientationOptions = [
141155
- { label: t("canvasUI.canvasBuilder.dataCharts.orientations.horizontal"), value: "x" },
141156
- { label: t("canvasUI.canvasBuilder.dataCharts.orientations.vertical"), value: "y" }
141608
+ { label: t("canvasUI.canvasBuilder.dataCharts.orientations.horizontal"), value: "y" },
141609
+ { label: t("canvasUI.canvasBuilder.dataCharts.orientations.vertical"), value: "x" }
141157
141610
  ];
141158
141611
  const pointStyleOptions = [
141159
141612
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.circle"), value: "circle" },
@@ -141163,12 +141616,18 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141163
141616
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.star"), value: "star" },
141164
141617
  { label: t("canvasUI.canvasBuilder.dataCharts.pointStyles.triangle"), value: "triangle" }
141165
141618
  ];
141166
- function getColors() {
141167
- if (colorSchemeType.value === "theme") {
141168
- return chartColors.value.map((index) => `palette${index}`);
141169
- }
141170
- return chartColors.value;
141171
- }
141619
+ const deleteButtonStyle = computed(() => ({
141620
+ "--n-border": "1px solid transparent",
141621
+ "--n-border-disabled": "1px solid transparent",
141622
+ "--n-border-focus": "1px solid transparent",
141623
+ "--n-border-hover": "1px solid transparent",
141624
+ "--n-border-pressed": "1px solid transparent",
141625
+ "--n-color-focus": themeVars.value.error2,
141626
+ "--n-color-hover": themeVars.value.error2,
141627
+ "--n-color-disabled": themeVars.value.error2,
141628
+ "--n-color-pressed": themeVars.value.error2
141629
+ }));
141630
+ const activePopoverField = ref(null);
141172
141631
  function updateChartColors(newColors) {
141173
141632
  if (colorSchemeType.value === "theme") {
141174
141633
  chartColors.value = newColors.map((color, i) => {
@@ -141196,17 +141655,55 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141196
141655
  }
141197
141656
  }
141198
141657
  );
141658
+ function closePopover() {
141659
+ activePopoverPoint.value = null;
141660
+ activePopoverField.value = null;
141661
+ }
141662
+ function addSeries() {
141663
+ if (!canAddSeries.value) return;
141664
+ const newIndex = seriesList.value.length;
141665
+ const newSeries = {
141666
+ id: generateSeriesId(),
141667
+ name: `${t("canvasUI.canvasBuilder.dataCharts.series")} ${newIndex + 1}`,
141668
+ chartType: seriesList.value[0].chartType,
141669
+ // Default to same type as first series
141670
+ dataPoints: []
141671
+ };
141672
+ seriesList.value.push(newSeries);
141673
+ activeSeriesIndex.value = newIndex;
141674
+ updatePreview();
141675
+ }
141676
+ function removeSeries(index) {
141677
+ if (index === 0 || index >= seriesList.value.length) return;
141678
+ seriesList.value.splice(index, 1);
141679
+ if (activeSeriesIndex.value >= seriesList.value.length) {
141680
+ activeSeriesIndex.value = seriesList.value.length - 1;
141681
+ }
141682
+ updatePreview();
141683
+ }
141684
+ function onChartTypeChange(newType) {
141685
+ if (activeSeriesIndex.value === 0 && STANDALONE_CHART_TYPES.includes(newType)) {
141686
+ seriesList.value = [seriesList.value[0]];
141687
+ }
141688
+ updatePreview();
141689
+ }
141199
141690
  function addDataPoint() {
141200
- dataPoints.value.push({
141691
+ activeSeries.value.dataPoints.push({
141201
141692
  label: "",
141693
+ xValue: "",
141694
+ yValue: "",
141695
+ rValue: "",
141202
141696
  value: ""
141203
141697
  });
141204
141698
  }
141205
141699
  function removeDataPoint(index) {
141206
- dataPoints.value.splice(index, 1);
141700
+ activeSeries.value.dataPoints.splice(index, 1);
141207
141701
  }
141208
141702
  function removeAllDataPoints() {
141209
- dataPoints.value = [];
141703
+ activeSeries.value.dataPoints = [];
141704
+ }
141705
+ function isArrayOrObject(value) {
141706
+ return Array.isArray(value) || typeof value === "object" && value !== null;
141210
141707
  }
141211
141708
  function getFieldOptions(data) {
141212
141709
  if (!data || typeof data !== "object") return [];
@@ -141217,6 +141714,54 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141217
141714
  value: field
141218
141715
  }));
141219
141716
  }
141717
+ function updateDynamicValueExpression(point) {
141718
+ if (!point.selectedValue || !point.arrayConfig?.labelField || !point.arrayConfig?.valueField) {
141719
+ return;
141720
+ }
141721
+ const path = point.dynamicValue?.path;
141722
+ if (!path) {
141723
+ return;
141724
+ }
141725
+ point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141726
+ point.value = `{{#each ${path}}}{{lookup this "${point.arrayConfig.valueField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141727
+ point.dynamicValue = {
141728
+ path,
141729
+ value: point.value
141730
+ };
141731
+ closePopover();
141732
+ }
141733
+ function updateXYDynamicValueExpression(point) {
141734
+ if (!point.selectedXValue || !point.arrayConfig?.labelField || !point.arrayConfig?.xField || !point.arrayConfig?.yField) {
141735
+ return;
141736
+ }
141737
+ const isBubble = isActiveSeriesXYRChart.value;
141738
+ if (isBubble && !point.arrayConfig?.rField) {
141739
+ return;
141740
+ }
141741
+ const path = point.dynamicXValue?.path;
141742
+ if (!path) {
141743
+ return;
141744
+ }
141745
+ point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141746
+ point.xValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.xField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141747
+ point.yValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.yField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141748
+ point.dynamicXValue = {
141749
+ path,
141750
+ value: point.xValue
141751
+ };
141752
+ point.dynamicYValue = {
141753
+ path,
141754
+ value: point.yValue
141755
+ };
141756
+ if (isBubble && point.arrayConfig.rField) {
141757
+ point.rValue = `{{#each ${path}}}{{lookup this "${point.arrayConfig.rField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141758
+ point.dynamicRValue = {
141759
+ path,
141760
+ value: point.rValue
141761
+ };
141762
+ }
141763
+ closePopover();
141764
+ }
141220
141765
  const dynamicValueTreeData = computed(() => {
141221
141766
  function processObject(obj, path = []) {
141222
141767
  const result = [];
@@ -141267,24 +141812,59 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141267
141812
  return h("span", { class: "text-sm" }, { default: () => info.option.label || "" });
141268
141813
  }
141269
141814
  const activePopoverPoint = ref(null);
141270
- function handleDynamicValueClick(point) {
141271
- if (activePopoverPoint.value === point) {
141272
- activePopoverPoint.value = null;
141815
+ function handleDynamicValueClick(point, field = "value") {
141816
+ if (activePopoverPoint.value === point && activePopoverField.value === field) {
141817
+ closePopover();
141273
141818
  } else {
141274
- point.selectedValue = void 0;
141275
- point.dynamicValue = void 0;
141276
- point.arrayConfig = void 0;
141277
- point.value = "";
141819
+ if (field === "value") {
141820
+ point.selectedValue = void 0;
141821
+ point.dynamicValue = void 0;
141822
+ point.arrayConfig = void 0;
141823
+ point.value = "";
141824
+ } else if (field === "x") {
141825
+ point.selectedXValue = void 0;
141826
+ point.dynamicXValue = void 0;
141827
+ point.dynamicYValue = void 0;
141828
+ point.dynamicRValue = void 0;
141829
+ point.arrayConfig = void 0;
141830
+ point.xValue = "";
141831
+ point.yValue = "";
141832
+ point.rValue = "";
141833
+ point.label = "";
141834
+ } else if (field === "y") {
141835
+ point.selectedYValue = void 0;
141836
+ point.dynamicYValue = void 0;
141837
+ point.yValue = "";
141838
+ } else if (field === "r") {
141839
+ point.selectedRValue = void 0;
141840
+ point.dynamicRValue = void 0;
141841
+ point.rValue = "";
141842
+ }
141278
141843
  activePopoverPoint.value = point;
141844
+ activePopoverField.value = field;
141279
141845
  }
141280
141846
  }
141281
- function handleDynamicValueSelect(keys, point) {
141847
+ function handleDynamicValueSelect(keys, point, field = "value") {
141282
141848
  const selectedKey = keys[0];
141283
141849
  if (!selectedKey) {
141284
- point.dynamicValue = void 0;
141285
- point.selectedValue = void 0;
141286
- point.value = "";
141287
- activePopoverPoint.value = null;
141850
+ if (field === "value") {
141851
+ point.dynamicValue = void 0;
141852
+ point.selectedValue = void 0;
141853
+ point.value = "";
141854
+ } else if (field === "x") {
141855
+ point.dynamicXValue = void 0;
141856
+ point.selectedXValue = void 0;
141857
+ point.xValue = "";
141858
+ } else if (field === "y") {
141859
+ point.dynamicYValue = void 0;
141860
+ point.selectedYValue = void 0;
141861
+ point.yValue = "";
141862
+ } else if (field === "r") {
141863
+ point.dynamicRValue = void 0;
141864
+ point.selectedRValue = void 0;
141865
+ point.rValue = "";
141866
+ }
141867
+ closePopover();
141288
141868
  return;
141289
141869
  }
141290
141870
  const pathParts = selectedKey.split(/\.(?![^[]*])/) || [];
@@ -141299,6 +141879,80 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141299
141879
  currentValue = currentValue?.[part];
141300
141880
  }
141301
141881
  }
141882
+ if (field === "x") {
141883
+ point.selectedXValue = currentValue;
141884
+ if (Array.isArray(currentValue) || typeof currentValue === "object" && currentValue !== null) {
141885
+ point.arrayConfig = {
141886
+ labelField: "",
141887
+ valueField: "",
141888
+ xField: "",
141889
+ yField: "",
141890
+ rField: ""
141891
+ };
141892
+ point.dynamicXValue = {
141893
+ path: selectedKey,
141894
+ value: ""
141895
+ };
141896
+ return;
141897
+ }
141898
+ const rootPart = pathParts[0];
141899
+ let expression = "";
141900
+ if (pathParts.length === 1) {
141901
+ expression = `{{${rootPart}}}`;
141902
+ } else {
141903
+ const restOfPath = pathParts.slice(1).map((part) => {
141904
+ if (part.includes("[") && part.includes("]")) {
141905
+ return part.split("[")[1].split("]")[0];
141906
+ }
141907
+ return part;
141908
+ });
141909
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141910
+ }
141911
+ point.dynamicXValue = { path: selectedKey, value: expression };
141912
+ point.xValue = expression;
141913
+ closePopover();
141914
+ return;
141915
+ }
141916
+ if (field === "y") {
141917
+ point.selectedYValue = currentValue;
141918
+ const rootPart = pathParts[0];
141919
+ let expression = "";
141920
+ if (pathParts.length === 1) {
141921
+ expression = `{{${rootPart}}}`;
141922
+ } else {
141923
+ const restOfPath = pathParts.slice(1).map((part) => {
141924
+ if (part.includes("[") && part.includes("]")) {
141925
+ return part.split("[")[1].split("]")[0];
141926
+ }
141927
+ return part;
141928
+ });
141929
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141930
+ }
141931
+ point.dynamicYValue = { path: selectedKey, value: expression };
141932
+ point.yValue = expression;
141933
+ closePopover();
141934
+ return;
141935
+ }
141936
+ if (field === "r") {
141937
+ point.selectedRValue = currentValue;
141938
+ const rootPart = pathParts[0];
141939
+ let expression = "";
141940
+ if (pathParts.length === 1) {
141941
+ expression = `{{${rootPart}}}`;
141942
+ } else {
141943
+ const restOfPath = pathParts.slice(1).map((part) => {
141944
+ if (part.includes("[") && part.includes("]")) {
141945
+ return part.split("[")[1].split("]")[0];
141946
+ }
141947
+ return part;
141948
+ });
141949
+ expression = `{{lookup (lookup ${rootPart} ${restOfPath[0]}) "${restOfPath[1]}"}}`;
141950
+ }
141951
+ point.dynamicRValue = { path: selectedKey, value: expression };
141952
+ point.rValue = expression;
141953
+ closePopover();
141954
+ return;
141955
+ }
141302
141956
  point.selectedValue = currentValue;
141303
141957
  if (Array.isArray(currentValue) || typeof currentValue === "object" && currentValue !== null) {
141304
141958
  point.arrayConfig = {
@@ -141328,79 +141982,189 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141328
141982
  value: expression
141329
141983
  };
141330
141984
  point.value = expression;
141331
- activePopoverPoint.value = null;
141985
+ closePopover();
141986
+ }
141987
+ }
141988
+ function normalizeRValues(values, minRadius = 5, maxRadius = 40) {
141989
+ if (values.length === 0) return [];
141990
+ const rValues = values.map((v) => v.r);
141991
+ const minR = Math.min(...rValues);
141992
+ const maxR = Math.max(...rValues);
141993
+ if (minR === maxR) {
141994
+ return values.map((v) => ({
141995
+ ...v,
141996
+ r: (minRadius + maxRadius) / 2,
141997
+ originalR: v.r
141998
+ }));
141332
141999
  }
142000
+ return values.map((v) => ({
142001
+ ...v,
142002
+ r: minRadius + (v.r - minR) / (maxR - minR) * (maxRadius - minRadius),
142003
+ originalR: v.r
142004
+ }));
141333
142005
  }
141334
- function updateDynamicValueExpression(point) {
141335
- if (!point.selectedValue || !point.arrayConfig?.labelField || !point.arrayConfig?.valueField) {
141336
- return;
141337
- }
141338
- const path = point.dynamicValue?.path;
141339
- if (!path) {
141340
- return;
142006
+ function processSeriesData(series) {
142007
+ const isXY = XY_CHART_TYPES.includes(series.chartType);
142008
+ const isXYR = XYR_CHART_TYPES.includes(series.chartType);
142009
+ if (isXY || isXYR) {
142010
+ const processedData2 = {
142011
+ labels: [],
142012
+ values: []
142013
+ };
142014
+ const rawBubbleData = [];
142015
+ series.dataPoints.forEach((point) => {
142016
+ const x = !isNaN(Number(point.xValue)) ? Number(point.xValue) : 0;
142017
+ const y = !isNaN(Number(point.yValue)) ? Number(point.yValue) : 0;
142018
+ if (series.chartType === "bubble") {
142019
+ const r = point.rValue && !isNaN(Number(point.rValue)) ? Math.abs(Number(point.rValue)) : 10;
142020
+ rawBubbleData.push({ label: point.label, x, y, r });
142021
+ } else {
142022
+ processedData2.labels.push(point.label);
142023
+ processedData2.values.push({ x, y });
142024
+ }
142025
+ });
142026
+ if (series.chartType === "bubble" && rawBubbleData.length > 0) {
142027
+ const bubbleValues = rawBubbleData.map((d) => ({ x: d.x, y: d.y, r: d.r }));
142028
+ const normalizedValues = normalizeRValues(bubbleValues);
142029
+ rawBubbleData.forEach((d, idx) => {
142030
+ processedData2.labels.push(d.label);
142031
+ processedData2.values.push(normalizedValues[idx]);
142032
+ });
142033
+ }
142034
+ return processedData2;
141341
142035
  }
141342
- point.label = `{{#each ${path}}}{{lookup this "${point.arrayConfig.labelField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141343
- point.value = `{{#each ${path}}}{{lookup this "${point.arrayConfig.valueField}"}}{{#unless @last}},{{/unless}}{{/each}}`;
141344
- point.dynamicValue = {
141345
- path,
141346
- value: point.value
141347
- };
141348
- activePopoverPoint.value = null;
141349
- }
141350
- function processChartData() {
141351
142036
  const processedData = {
141352
142037
  labels: [],
141353
142038
  values: []
141354
142039
  };
141355
- dataPoints.value.forEach((point) => {
142040
+ series.dataPoints.forEach((point) => {
141356
142041
  processedData.labels.push(point.label);
141357
142042
  processedData.values.push(!isNaN(Number(point.value)) ? Number(point.value) : 0);
141358
142043
  });
141359
142044
  return processedData;
141360
142045
  }
142046
+ function getSeriesColors(forStorage = false) {
142047
+ if (colorSchemeType.value === "theme") {
142048
+ if (forStorage) {
142049
+ return chartColors.value.map((index) => `palette${index}`);
142050
+ }
142051
+ return chartColors.value.map((index) => {
142052
+ const idx = parseInt(index);
142053
+ return palette.value[idx % palette.value.length];
142054
+ });
142055
+ }
142056
+ return chartColors.value;
142057
+ }
141361
142058
  function createChartConfig() {
142059
+ const datasets = [];
142060
+ let allLabels = [];
142061
+ const colorsForStorage = getSeriesColors(true);
142062
+ const isSingleSeries = seriesList.value.length === 1;
142063
+ seriesList.value.forEach((series, index) => {
142064
+ const processedData = processSeriesData(series);
142065
+ let backgroundColor2;
142066
+ let borderColor;
142067
+ if (isSingleSeries) {
142068
+ backgroundColor2 = colorsForStorage;
142069
+ borderColor = [...colorsForStorage];
142070
+ } else {
142071
+ const seriesColor = colorsForStorage[index % colorsForStorage.length];
142072
+ backgroundColor2 = seriesColor;
142073
+ borderColor = seriesColor;
142074
+ }
142075
+ const datasetOptions = {
142076
+ label: series.name,
142077
+ data: processedData.values,
142078
+ background_color: backgroundColor2,
142079
+ border_color: borderColor,
142080
+ borderWidth: 1
142081
+ };
142082
+ if (!isSingleSeries) {
142083
+ if (series.chartType === "area") {
142084
+ datasetOptions.type = "line";
142085
+ datasetOptions.fill = true;
142086
+ datasetOptions.tension = 0.4;
142087
+ } else {
142088
+ datasetOptions.type = series.chartType;
142089
+ }
142090
+ }
142091
+ if (series.chartType === "area") {
142092
+ datasetOptions.fill = true;
142093
+ datasetOptions.tension = 0.4;
142094
+ }
142095
+ if (["line", "scatter", "area"].includes(series.chartType)) {
142096
+ datasetOptions.pointStyle = pointStyle.value;
142097
+ }
142098
+ if (["line", "area"].includes(series.chartType)) {
142099
+ datasetOptions.tension = 0.4;
142100
+ }
142101
+ if (processedData.labels.length > allLabels.length) {
142102
+ allLabels = processedData.labels;
142103
+ }
142104
+ datasets.push(datasetOptions);
142105
+ });
142106
+ const primaryType = seriesList.value[0].chartType;
142107
+ let actualPrimaryType = primaryType;
142108
+ if (primaryType === "area") {
142109
+ actualPrimaryType = "line";
142110
+ }
142111
+ let scales = void 0;
142112
+ const chartTypesWithScales = ["bar", "line", "scatter", "bubble", "area"];
142113
+ if (chartTypesWithScales.includes(primaryType)) {
142114
+ scales = {
142115
+ x: {
142116
+ title: {
142117
+ display: !!xAxisLabel.value,
142118
+ text: xAxisLabel.value
142119
+ }
142120
+ },
142121
+ y: {
142122
+ title: {
142123
+ display: !!yAxisLabel.value,
142124
+ text: yAxisLabel.value
142125
+ },
142126
+ begin_at_zero: true
142127
+ }
142128
+ };
142129
+ } else if (["radar", "polarArea"].includes(primaryType)) {
142130
+ scales = {
142131
+ r: {
142132
+ begin_at_zero: true,
142133
+ ticks: {
142134
+ step_size: 1
142135
+ }
142136
+ }
142137
+ };
142138
+ }
142139
+ const showLegend = seriesList.value.length > 1 || legendPosition.value !== "none";
141362
142140
  const config = {
141363
- type: chartType.value,
142141
+ type: actualPrimaryType,
141364
142142
  color_scheme_type: colorSchemeType.value,
142143
+ percent_display: percentDisplay.value,
142144
+ chart_height: chartHeight.value,
142145
+ chart_width: chartWidth.value,
142146
+ view_controls: {
142147
+ enable_fullscreen_btn: enableFullscreenBtn.value,
142148
+ enable_chart_type_switcher: enableChartTypeSwitcher.value,
142149
+ enable_data_entry: enableDataEntry.value
142150
+ },
141365
142151
  data: {
141366
- labels: [],
141367
- datasets: [
141368
- {
141369
- label: "Data Series",
141370
- data: [],
141371
- background_color: getColors(),
141372
- border_color: getColors(),
141373
- border_width: 1,
141374
- point_style: ["line"].includes(chartType.value) ? pointStyle.value : void 0
141375
- }
141376
- ]
142152
+ labels: allLabels,
142153
+ datasets
141377
142154
  },
141378
142155
  options: {
141379
142156
  responsive: true,
141380
142157
  maintainAspectRatio: false,
141381
- index_axis: ["bar", "line"].includes(chartType.value) ? orientation.value : void 0,
141382
- scales: ["bar", "line"].includes(chartType.value) ? {
141383
- x: {
141384
- title: {
141385
- display: !!xAxisLabel.value,
141386
- text: xAxisLabel.value
141387
- }
141388
- },
141389
- y: {
141390
- title: {
141391
- display: !!yAxisLabel.value,
141392
- text: yAxisLabel.value
141393
- }
141394
- }
141395
- } : void 0,
142158
+ index_axis: ["bar", "line"].includes(primaryType) ? orientation.value : void 0,
142159
+ scales,
141396
142160
  plugins: {
141397
142161
  title: {
141398
142162
  display: !!chartTitle.value,
141399
142163
  text: chartTitle.value
141400
142164
  },
141401
142165
  legend: {
141402
- display: legendPosition.value !== "none",
141403
- position: legendPosition.value,
142166
+ display: showLegend,
142167
+ position: legendPosition.value !== "none" ? legendPosition.value : "top",
141404
142168
  labels: {
141405
142169
  usePointStyle: true
141406
142170
  }
@@ -141410,14 +142174,27 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141410
142174
  duration: enableAnimation.value ? 1e3 : 0
141411
142175
  }
141412
142176
  },
141413
- data_points: dataPoints.value.map((point) => ({
141414
- label: point.label,
141415
- value: point.value
141416
- }))
142177
+ // Save series data for editing
142178
+ series: seriesList.value.map((series) => ({
142179
+ id: series.id,
142180
+ name: series.name,
142181
+ chart_type: series.chartType,
142182
+ data_points: series.dataPoints.map((point) => ({
142183
+ label: point.label,
142184
+ value: point.value,
142185
+ x_value: point.xValue,
142186
+ y_value: point.yValue,
142187
+ r_value: point.rValue,
142188
+ dynamic_value: point.dynamicValue,
142189
+ dynamic_x_value: point.dynamicXValue,
142190
+ dynamic_y_value: point.dynamicYValue,
142191
+ dynamic_r_value: point.dynamicRValue,
142192
+ array_config: point.arrayConfig
142193
+ }))
142194
+ })),
142195
+ // Store the primary chart type for reference
142196
+ _primary_chart_type: primaryType
141417
142197
  };
141418
- const processedData = processChartData();
141419
- config.data.labels = processedData.labels;
141420
- config.data.datasets[0].data = processedData.values;
141421
142198
  return config;
141422
142199
  }
141423
142200
  function onCancel() {
@@ -141445,9 +142222,14 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141445
142222
  },
141446
142223
  { immediate: true }
141447
142224
  );
142225
+ watch(isMultiSeries, (multiSeries) => {
142226
+ if (multiSeries) {
142227
+ enableChartTypeSwitcher.value = false;
142228
+ }
142229
+ });
141448
142230
  watch(
141449
142231
  [
141450
- chartType,
142232
+ seriesList,
141451
142233
  chartColors,
141452
142234
  colorSchemeType,
141453
142235
  chartTitle,
@@ -141456,7 +142238,13 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141456
142238
  yAxisLabel,
141457
142239
  orientation,
141458
142240
  pointStyle,
141459
- dataPoints
142241
+ percentDisplay,
142242
+ enableAnimation,
142243
+ enableFullscreenBtn,
142244
+ enableChartTypeSwitcher,
142245
+ enableDataEntry,
142246
+ chartHeight,
142247
+ chartWidth
141460
142248
  ],
141461
142249
  () => {
141462
142250
  updatePreview();
@@ -141482,10 +142270,10 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141482
142270
  "--n-padding-left": "16px"
141483
142271
  }]),
141484
142272
  title: unref(t)("canvasUI.canvasBuilder.dataCharts.editDataChartsComponent"),
141485
- onClose: _cache[11] || (_cache[11] = ($event) => unref(setComponentEditMode)(false))
142273
+ onClose: _cache[16] || (_cache[16] = ($event) => unref(setComponentEditMode)(false))
141486
142274
  }, {
141487
142275
  footer: withCtx(() => [
141488
- createElementVNode("div", _hoisted_50$3, [
142276
+ createElementVNode("div", _hoisted_89, [
141489
142277
  createVNode(CButton, { onClick: onCancel }, {
141490
142278
  default: withCtx(() => [
141491
142279
  createTextVNode(toDisplayString(unref(t)("canvasUI.common.cancel")), 1)
@@ -141523,69 +142311,66 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141523
142311
  createElementVNode("div", _hoisted_2$1t, [
141524
142312
  createElementVNode("div", _hoisted_3$17, [
141525
142313
  createElementVNode("div", _hoisted_4$X, [
141526
- createElementVNode("div", _hoisted_5$O, [
141527
- createElementVNode("label", _hoisted_6$H, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartType")), 1),
141528
- createVNode(unref(NSelect), {
141529
- value: chartType.value,
141530
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => chartType.value = $event),
141531
- options: chartTypeOptions
141532
- }, null, 8, ["value"])
142314
+ createElementVNode("div", _hoisted_5$O, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataSettings")), 1),
142315
+ createElementVNode("div", _hoisted_6$H, [
142316
+ (openBlock(true), createElementBlock(Fragment, null, renderList(seriesList.value, (series, index) => {
142317
+ return openBlock(), createElementBlock("div", {
142318
+ key: series.id,
142319
+ class: normalizeClass(["series-tab flex items-center gap-1 px-3 py-2 h-9 cursor-pointer border border-b-0 rounded-t-lg mr-1 transition-colors", [
142320
+ activeSeriesIndex.value === index ? "bg-white dark:bg-gray-800 border-gray-200 dark:border-gray-700 -mb-px" : "bg-gray-100 dark:bg-gray-900 border-transparent hover:bg-gray-200 dark:hover:bg-gray-700"
142321
+ ]]),
142322
+ onClick: ($event) => activeSeriesIndex.value = index
142323
+ }, [
142324
+ createElementVNode("span", _hoisted_8$q, toDisplayString(series.name), 1),
142325
+ index > 0 ? (openBlock(), createElementBlock("div", {
142326
+ key: 0,
142327
+ class: "ml-1 p-0.5 rounded hover:bg-gray-300 dark:hover:bg-gray-600",
142328
+ onClick: withModifiers(($event) => removeSeries(index), ["stop"])
142329
+ }, [
142330
+ createVNode(CIcon, {
142331
+ class: "text-gray-500",
142332
+ icon: "times",
142333
+ size: 10
142334
+ })
142335
+ ], 8, _hoisted_9$m)) : createCommentVNode("", true)
142336
+ ], 10, _hoisted_7$v);
142337
+ }), 128)),
142338
+ canAddSeries.value ? (openBlock(), createElementBlock("button", {
142339
+ key: 0,
142340
+ class: "flex items-center justify-center w-8 h-8 mb-1 rounded bg-transparent border-none hover:bg-gray-200 dark:hover:bg-gray-700 transition-colors cursor-pointer",
142341
+ title: unref(t)("canvasUI.canvasBuilder.dataCharts.addSeries"),
142342
+ onClick: addSeries
142343
+ }, [
142344
+ createVNode(CIcon, {
142345
+ icon: "plus",
142346
+ size: 14
142347
+ })
142348
+ ], 8, _hoisted_10$h)) : createCommentVNode("", true)
141533
142349
  ]),
141534
- ["bar", "line"].includes(chartType.value) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
141535
- createElementVNode("div", _hoisted_7$v, [
141536
- createElementVNode("label", _hoisted_8$q, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xAxisLabel")), 1),
141537
- createVNode(unref(NInput), {
141538
- value: xAxisLabel.value,
141539
- "onUpdate:value": _cache[1] || (_cache[1] = ($event) => xAxisLabel.value = $event),
141540
- type: "text"
141541
- }, null, 8, ["value"])
141542
- ]),
141543
- createElementVNode("div", _hoisted_9$m, [
141544
- createElementVNode("label", _hoisted_10$h, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yAxisLabel")), 1),
141545
- createVNode(unref(NInput), {
141546
- value: yAxisLabel.value,
141547
- "onUpdate:value": _cache[2] || (_cache[2] = ($event) => yAxisLabel.value = $event),
141548
- type: "text"
141549
- }, null, 8, ["value"])
141550
- ]),
141551
- createElementVNode("div", _hoisted_11$f, [
141552
- createElementVNode("label", _hoisted_12$b, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.orientation")), 1),
141553
- createVNode(unref(NSelect), {
141554
- value: orientation.value,
141555
- "onUpdate:value": _cache[3] || (_cache[3] = ($event) => orientation.value = $event),
141556
- options: orientationOptions
141557
- }, null, 8, ["value"])
141558
- ]),
141559
- ["line", "radar"].includes(chartType.value) ? (openBlock(), createElementBlock("div", _hoisted_13$a, [
141560
- createElementVNode("label", _hoisted_14$9, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.pointStyle")), 1),
141561
- createVNode(unref(NSelect), {
141562
- value: pointStyle.value,
141563
- "onUpdate:value": _cache[4] || (_cache[4] = ($event) => pointStyle.value = $event),
141564
- options: pointStyleOptions
141565
- }, null, 8, ["value"])
141566
- ])) : createCommentVNode("", true)
141567
- ], 64)) : createCommentVNode("", true),
141568
- createElementVNode("div", _hoisted_15$8, [
141569
- createElementVNode("label", _hoisted_16$8, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTitle")), 1),
142350
+ seriesList.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_11$f, [
142351
+ createElementVNode("label", _hoisted_12$b, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.seriesName")), 1),
141570
142352
  createVNode(unref(NInput), {
141571
- value: chartTitle.value,
141572
- "onUpdate:value": _cache[5] || (_cache[5] = ($event) => chartTitle.value = $event),
142353
+ value: activeSeries.value.name,
142354
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => activeSeries.value.name = $event),
141573
142355
  type: "text"
141574
142356
  }, null, 8, ["value"])
141575
- ]),
141576
- ["pie", "doughnut", "polarArea"].includes(chartType.value) ? (openBlock(), createElementBlock("div", _hoisted_17$7, [
141577
- createElementVNode("label", _hoisted_18$6, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.legendPosition")), 1),
141578
- createVNode(unref(NSelect), {
141579
- value: legendPosition.value,
141580
- "onUpdate:value": _cache[6] || (_cache[6] = ($event) => legendPosition.value = $event),
141581
- options: legendPositionOptions
141582
- }, null, 8, ["value"])
141583
142357
  ])) : createCommentVNode("", true),
141584
- createElementVNode("div", _hoisted_19$6, [
141585
- createElementVNode("div", _hoisted_20$5, [
141586
- createElementVNode("label", _hoisted_21$5, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataPoints")), 1),
142358
+ createElementVNode("div", _hoisted_13$a, [
142359
+ createElementVNode("label", _hoisted_14$9, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartType")), 1),
142360
+ createVNode(unref(NSelect), {
142361
+ value: activeSeries.value.chartType,
142362
+ "onUpdate:value": [
142363
+ _cache[1] || (_cache[1] = ($event) => activeSeries.value.chartType = $event),
142364
+ onChartTypeChange
142365
+ ],
142366
+ options: availableChartTypeOptions.value
142367
+ }, null, 8, ["value", "options"])
142368
+ ]),
142369
+ createElementVNode("div", _hoisted_15$8, [
142370
+ createElementVNode("div", _hoisted_16$8, [
142371
+ createElementVNode("label", _hoisted_17$7, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.dataPoints")), 1),
141587
142372
  createVNode(unref(Button), {
141588
- disabled: !dataPoints.value.length,
142373
+ disabled: !activeSeries.value.dataPoints.length,
141589
142374
  size: "small",
141590
142375
  onClick: removeAllDataPoints
141591
142376
  }, {
@@ -141595,205 +142380,301 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141595
142380
  _: 1
141596
142381
  }, 8, ["disabled"])
141597
142382
  ]),
141598
- (openBlock(true), createElementBlock(Fragment, null, renderList(dataPoints.value, (point, index) => {
142383
+ !isActiveSeriesXYChart.value && !isActiveSeriesXYRChart.value ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(activeSeries.value.dataPoints, (point, index) => {
141599
142384
  return openBlock(), createElementBlock("div", {
141600
142385
  key: index,
141601
142386
  class: "flex gap-2 mb-2"
141602
142387
  }, [
141603
- point.selectedValue && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createBlock(unref(NTooltip), {
141604
- key: 0,
141605
- trigger: "hover"
142388
+ createVNode(unref(NInput), {
142389
+ value: point.label,
142390
+ "onUpdate:value": ($event) => point.label = $event,
142391
+ class: "flex-1",
142392
+ disabled: !!point.arrayConfig,
142393
+ placeholder: "Label"
142394
+ }, null, 8, ["value", "onUpdate:value", "disabled"]),
142395
+ createVNode(unref(NInput), {
142396
+ value: point.value,
142397
+ "onUpdate:value": ($event) => point.value = $event,
142398
+ class: "flex-1",
142399
+ disabled: !!point.dynamicValue,
142400
+ placeholder: "Value",
142401
+ type: "text"
141606
142402
  }, {
141607
- trigger: withCtx(() => [
141608
- createVNode(unref(NInput), {
141609
- value: point.label,
141610
- "onUpdate:value": ($event) => point.label = $event,
141611
- class: "flex-1",
141612
- disabled: true,
141613
- placeholder: "Label"
141614
- }, null, 8, ["value", "onUpdate:value"])
142403
+ suffix: withCtx(() => [
142404
+ createVNode(unref(NPopover), {
142405
+ placement: "bottom",
142406
+ show: activePopoverPoint.value === point && activePopoverField.value === "value",
142407
+ trigger: "manual",
142408
+ onClickoutside: closePopover
142409
+ }, {
142410
+ trigger: withCtx(() => [
142411
+ createElementVNode("div", {
142412
+ class: "cursor-pointer flex items-center",
142413
+ onClick: ($event) => handleDynamicValueClick(point, "value")
142414
+ }, [
142415
+ createVNode(CIcon, {
142416
+ class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
142417
+ icon: "caret-down"
142418
+ }, null, 8, ["class"])
142419
+ ], 8, _hoisted_18$6)
142420
+ ]),
142421
+ default: withCtx(() => [
142422
+ createElementVNode("div", _hoisted_19$6, [
142423
+ createElementVNode("div", _hoisted_20$5, [
142424
+ createElementVNode("div", _hoisted_21$5, [
142425
+ createElementVNode("div", _hoisted_22$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142426
+ createElementVNode("div", _hoisted_23$3, [
142427
+ createVNode(unref(NTree), {
142428
+ "block-line": "",
142429
+ class: "max-h-[300px]",
142430
+ data: dynamicValueTreeData.value,
142431
+ "render-label": renderDynamicValueTreeLabel,
142432
+ "selected-keys": [point.dynamicValue?.path ?? ""],
142433
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "value")
142434
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142435
+ ])
142436
+ ]),
142437
+ point.selectedValue && point.arrayConfig && isArrayOrObject(point.selectedValue) ? (openBlock(), createElementBlock("div", _hoisted_24$3, [
142438
+ createElementVNode("div", _hoisted_25$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
142439
+ createElementVNode("div", _hoisted_26$3, [
142440
+ createElementVNode("div", null, [
142441
+ createElementVNode("label", _hoisted_27$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
142442
+ createVNode(unref(NSelect), {
142443
+ value: point.arrayConfig.labelField,
142444
+ "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
142445
+ options: getFieldOptions(point.selectedValue)
142446
+ }, null, 8, ["value", "onUpdate:value", "options"])
142447
+ ]),
142448
+ createElementVNode("div", null, [
142449
+ createElementVNode("label", _hoisted_28$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.valueField")), 1),
142450
+ createVNode(unref(NSelect), {
142451
+ value: point.arrayConfig.valueField,
142452
+ "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
142453
+ options: getFieldOptions(point.selectedValue)
142454
+ }, null, 8, ["value", "onUpdate:value", "options"])
142455
+ ])
142456
+ ])
142457
+ ])) : createCommentVNode("", true)
142458
+ ])
142459
+ ])
142460
+ ]),
142461
+ _: 2
142462
+ }, 1032, ["show"])
141615
142463
  ]),
141616
- default: withCtx(() => [
141617
- createTextVNode(" " + toDisplayString(point.label), 1)
142464
+ _: 2
142465
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142466
+ createVNode(CButton, {
142467
+ circle: "",
142468
+ class: "bg-error2 self-center",
142469
+ size: "small",
142470
+ style: normalizeStyle(deleteButtonStyle.value),
142471
+ type: "error",
142472
+ onClick: ($event) => removeDataPoint(index)
142473
+ }, {
142474
+ icon: withCtx(() => [
142475
+ createVNode(CIcon, {
142476
+ class: "color-error",
142477
+ "fa-type": "far",
142478
+ icon: "trash",
142479
+ size: 12
142480
+ })
141618
142481
  ]),
141619
142482
  _: 2
141620
- }, 1024)) : (openBlock(), createBlock(unref(NInput), {
141621
- key: 1,
142483
+ }, 1032, ["style", "onClick"])
142484
+ ]);
142485
+ }), 128)) : (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(activeSeries.value.dataPoints, (point, index) => {
142486
+ return openBlock(), createElementBlock("div", {
142487
+ key: index,
142488
+ class: "flex gap-2 mb-2"
142489
+ }, [
142490
+ createVNode(unref(NInput), {
141622
142491
  value: point.label,
141623
142492
  "onUpdate:value": ($event) => point.label = $event,
141624
142493
  class: "flex-1",
142494
+ disabled: !!point.arrayConfig,
141625
142495
  placeholder: "Label"
141626
- }, null, 8, ["value", "onUpdate:value"])),
141627
- createElementVNode("div", _hoisted_22$3, [
141628
- point.dynamicValue ? (openBlock(), createBlock(unref(NTooltip), {
141629
- key: 0,
141630
- trigger: "hover"
141631
- }, {
141632
- trigger: withCtx(() => [
141633
- createVNode(unref(NInput), {
141634
- value: point.value,
141635
- "onUpdate:value": ($event) => point.value = $event,
141636
- class: "flex-1",
141637
- disabled: !!point.dynamicValue,
141638
- placeholder: "Value",
141639
- type: "text"
141640
- }, {
141641
- suffix: withCtx(() => [
141642
- createVNode(unref(NPopover), {
141643
- placement: "bottom",
141644
- show: activePopoverPoint.value === point,
141645
- trigger: "manual",
141646
- onClickoutside: _cache[7] || (_cache[7] = ($event) => activePopoverPoint.value = null)
141647
- }, {
141648
- trigger: withCtx(() => [
141649
- createElementVNode("div", {
141650
- class: "cursor-pointer flex items-center",
141651
- onClick: ($event) => handleDynamicValueClick(point)
141652
- }, [
141653
- createVNode(CIcon, {
141654
- class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
141655
- icon: "caret-down"
141656
- }, null, 8, ["class"])
141657
- ], 8, _hoisted_23$3)
141658
- ]),
141659
- default: withCtx(() => [
141660
- createElementVNode("div", _hoisted_24$3, [
141661
- createElementVNode("div", _hoisted_25$3, [
141662
- createElementVNode("div", _hoisted_26$3, [
141663
- createElementVNode("div", _hoisted_27$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
141664
- createElementVNode("div", _hoisted_28$3, [
141665
- createVNode(unref(NTree), {
141666
- "block-line": "",
141667
- class: "max-h-[300px]",
141668
- data: dynamicValueTreeData.value,
141669
- "render-label": renderDynamicValueTreeLabel,
141670
- "selected-keys": [point.dynamicValue?.path ?? ""],
141671
- "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point)
141672
- }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141673
- ])
141674
- ]),
141675
- point.selectedValue && point.arrayConfig && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createElementBlock("div", _hoisted_29$3, [
141676
- createElementVNode("div", _hoisted_30$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
141677
- createElementVNode("div", _hoisted_31$3, [
141678
- createElementVNode("div", null, [
141679
- createElementVNode("label", _hoisted_32$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
141680
- createVNode(unref(NSelect), {
141681
- value: point.arrayConfig.labelField,
141682
- "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
141683
- options: getFieldOptions(point.selectedValue)
141684
- }, null, 8, ["value", "onUpdate:value", "options"])
141685
- ]),
141686
- createElementVNode("div", null, [
141687
- createElementVNode("label", _hoisted_33$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.valueField")), 1),
141688
- createVNode(unref(NSelect), {
141689
- value: point.arrayConfig.valueField,
141690
- "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
141691
- options: getFieldOptions(point.selectedValue)
141692
- }, null, 8, ["value", "onUpdate:value", "options"])
141693
- ])
141694
- ])
141695
- ])) : createCommentVNode("", true)
141696
- ])
142496
+ }, null, 8, ["value", "onUpdate:value", "disabled"]),
142497
+ createVNode(unref(NInput), {
142498
+ value: point.xValue,
142499
+ "onUpdate:value": ($event) => point.xValue = $event,
142500
+ class: "flex-1",
142501
+ disabled: !!point.dynamicXValue,
142502
+ placeholder: "X Value",
142503
+ type: "text"
142504
+ }, {
142505
+ suffix: withCtx(() => [
142506
+ createVNode(unref(NPopover), {
142507
+ placement: "bottom",
142508
+ show: activePopoverPoint.value === point && activePopoverField.value === "x",
142509
+ trigger: "manual",
142510
+ onClickoutside: closePopover
142511
+ }, {
142512
+ trigger: withCtx(() => [
142513
+ createElementVNode("div", {
142514
+ class: "cursor-pointer flex items-center",
142515
+ onClick: ($event) => handleDynamicValueClick(point, "x")
142516
+ }, [
142517
+ createVNode(CIcon, {
142518
+ class: normalizeClass(point.dynamicXValue ? "text-blue-500" : ""),
142519
+ icon: "caret-down"
142520
+ }, null, 8, ["class"])
142521
+ ], 8, _hoisted_29$3)
142522
+ ]),
142523
+ default: withCtx(() => [
142524
+ createElementVNode("div", _hoisted_30$3, [
142525
+ createElementVNode("div", _hoisted_31$3, [
142526
+ createElementVNode("div", _hoisted_32$3, [
142527
+ createElementVNode("div", _hoisted_33$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142528
+ createElementVNode("div", _hoisted_34$3, [
142529
+ createVNode(unref(NTree), {
142530
+ "block-line": "",
142531
+ class: "max-h-[300px]",
142532
+ data: dynamicValueTreeData.value,
142533
+ "render-label": renderDynamicValueTreeLabel,
142534
+ "selected-keys": [point.dynamicXValue?.path ?? ""],
142535
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "x")
142536
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141697
142537
  ])
141698
142538
  ]),
141699
- _: 2
141700
- }, 1032, ["show"])
141701
- ]),
141702
- _: 2
141703
- }, 1032, ["value", "onUpdate:value", "disabled"])
141704
- ]),
141705
- default: withCtx(() => [
141706
- createTextVNode(" " + toDisplayString(point.value), 1)
141707
- ]),
141708
- _: 2
141709
- }, 1024)) : (openBlock(), createBlock(unref(NInput), {
141710
- key: 1,
141711
- value: point.value,
141712
- "onUpdate:value": ($event) => point.value = $event,
141713
- class: "flex-1",
141714
- disabled: !!point.dynamicValue,
141715
- placeholder: "Value",
141716
- type: "text"
141717
- }, {
141718
- suffix: withCtx(() => [
141719
- createVNode(unref(NPopover), {
141720
- placement: "bottom",
141721
- show: activePopoverPoint.value === point,
141722
- trigger: "manual",
141723
- onClickoutside: _cache[8] || (_cache[8] = ($event) => activePopoverPoint.value = null)
141724
- }, {
141725
- trigger: withCtx(() => [
141726
- createElementVNode("div", {
141727
- class: "cursor-pointer flex items-center",
141728
- onClick: ($event) => handleDynamicValueClick(point)
141729
- }, [
141730
- createVNode(CIcon, {
141731
- class: normalizeClass(point.dynamicValue ? "text-blue-500" : ""),
141732
- icon: "caret-down"
141733
- }, null, 8, ["class"])
141734
- ], 8, _hoisted_34$3)
141735
- ]),
141736
- default: withCtx(() => [
141737
- createElementVNode("div", _hoisted_35$3, [
141738
- createElementVNode("div", _hoisted_36$3, [
142539
+ point.selectedXValue && point.arrayConfig && isArrayOrObject(point.selectedXValue) ? (openBlock(), createElementBlock("div", _hoisted_35$3, [
142540
+ createElementVNode("div", _hoisted_36$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.configureArrayObjectFields")), 1),
141739
142541
  createElementVNode("div", _hoisted_37$3, [
141740
- createElementVNode("div", _hoisted_38$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
141741
- createElementVNode("div", _hoisted_39$3, [
141742
- createVNode(unref(NTree), {
141743
- "block-line": "",
141744
- class: "max-h-[300px]",
141745
- data: dynamicValueTreeData.value,
141746
- "render-label": renderDynamicValueTreeLabel,
141747
- "selected-keys": [point.dynamicValue?.path ?? ""],
141748
- "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point)
141749
- }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
141750
- ])
141751
- ]),
141752
- point.selectedValue && point.arrayConfig && (Array.isArray(point.selectedValue) || typeof point.selectedValue === "object" && point.selectedValue !== null) ? (openBlock(), createElementBlock("div", _hoisted_40$3, [
141753
- _cache[14] || (_cache[14] = createElementVNode("div", { class: "text-sm font-medium mb-2" }, "Configure Array/Object Fields", -1)),
141754
- createElementVNode("div", _hoisted_41$3, [
141755
- createElementVNode("div", null, [
141756
- _cache[12] || (_cache[12] = createElementVNode("label", { class: "block mb-1 text-sm" }, "Label Field", -1)),
141757
- createVNode(unref(NSelect), {
141758
- value: point.arrayConfig.labelField,
141759
- "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateDynamicValueExpression(point)],
141760
- options: getFieldOptions(point.selectedValue)
141761
- }, null, 8, ["value", "onUpdate:value", "options"])
141762
- ]),
141763
- createElementVNode("div", null, [
141764
- _cache[13] || (_cache[13] = createElementVNode("label", { class: "block mb-1 text-sm" }, "Value Field", -1)),
141765
- createVNode(unref(NSelect), {
141766
- value: point.arrayConfig.valueField,
141767
- "onUpdate:value": [($event) => point.arrayConfig.valueField = $event, ($event) => updateDynamicValueExpression(point)],
141768
- options: getFieldOptions(point.selectedValue)
141769
- }, null, 8, ["value", "onUpdate:value", "options"])
141770
- ])
141771
- ])
141772
- ])) : createCommentVNode("", true)
141773
- ])
142542
+ createElementVNode("div", null, [
142543
+ createElementVNode("label", _hoisted_38$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.labelField")), 1),
142544
+ createVNode(unref(NSelect), {
142545
+ value: point.arrayConfig.labelField,
142546
+ "onUpdate:value": [($event) => point.arrayConfig.labelField = $event, ($event) => updateXYDynamicValueExpression(point)],
142547
+ options: getFieldOptions(point.selectedXValue)
142548
+ }, null, 8, ["value", "onUpdate:value", "options"])
142549
+ ]),
142550
+ createElementVNode("div", null, [
142551
+ createElementVNode("label", _hoisted_39$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xValueField")), 1),
142552
+ createVNode(unref(NSelect), {
142553
+ value: point.arrayConfig.xField,
142554
+ "onUpdate:value": [($event) => point.arrayConfig.xField = $event, ($event) => updateXYDynamicValueExpression(point)],
142555
+ options: getFieldOptions(point.selectedXValue)
142556
+ }, null, 8, ["value", "onUpdate:value", "options"])
142557
+ ]),
142558
+ createElementVNode("div", null, [
142559
+ createElementVNode("label", _hoisted_40$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yValueField")), 1),
142560
+ createVNode(unref(NSelect), {
142561
+ value: point.arrayConfig.yField,
142562
+ "onUpdate:value": [($event) => point.arrayConfig.yField = $event, ($event) => updateXYDynamicValueExpression(point)],
142563
+ options: getFieldOptions(point.selectedXValue)
142564
+ }, null, 8, ["value", "onUpdate:value", "options"])
142565
+ ]),
142566
+ isActiveSeriesXYRChart.value ? (openBlock(), createElementBlock("div", _hoisted_41$3, [
142567
+ createElementVNode("label", _hoisted_42$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.rValueField")), 1),
142568
+ createVNode(unref(NSelect), {
142569
+ value: point.arrayConfig.rField,
142570
+ "onUpdate:value": [($event) => point.arrayConfig.rField = $event, ($event) => updateXYDynamicValueExpression(point)],
142571
+ options: getFieldOptions(point.selectedXValue)
142572
+ }, null, 8, ["value", "onUpdate:value", "options"])
142573
+ ])) : createCommentVNode("", true)
142574
+ ])
142575
+ ])) : createCommentVNode("", true)
141774
142576
  ])
141775
- ]),
141776
- _: 2
141777
- }, 1032, ["show"])
141778
- ]),
141779
- _: 2
141780
- }, 1032, ["value", "onUpdate:value", "disabled"]))
141781
- ]),
142577
+ ])
142578
+ ]),
142579
+ _: 2
142580
+ }, 1032, ["show"])
142581
+ ]),
142582
+ _: 2
142583
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142584
+ createVNode(unref(NInput), {
142585
+ value: point.yValue,
142586
+ "onUpdate:value": ($event) => point.yValue = $event,
142587
+ class: "flex-1",
142588
+ disabled: !!point.dynamicYValue,
142589
+ placeholder: "Y Value",
142590
+ type: "text"
142591
+ }, {
142592
+ suffix: withCtx(() => [
142593
+ createVNode(unref(NPopover), {
142594
+ placement: "bottom",
142595
+ show: activePopoverPoint.value === point && activePopoverField.value === "y",
142596
+ trigger: "manual",
142597
+ onClickoutside: closePopover
142598
+ }, {
142599
+ trigger: withCtx(() => [
142600
+ createElementVNode("div", {
142601
+ class: "cursor-pointer flex items-center",
142602
+ onClick: ($event) => handleDynamicValueClick(point, "y")
142603
+ }, [
142604
+ createVNode(CIcon, {
142605
+ class: normalizeClass(point.dynamicYValue ? "text-blue-500" : ""),
142606
+ icon: "caret-down"
142607
+ }, null, 8, ["class"])
142608
+ ], 8, _hoisted_43$3)
142609
+ ]),
142610
+ default: withCtx(() => [
142611
+ createElementVNode("div", _hoisted_44$3, [
142612
+ createElementVNode("div", _hoisted_45$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142613
+ createVNode(unref(NTree), {
142614
+ "block-line": "",
142615
+ class: "max-h-[300px]",
142616
+ data: dynamicValueTreeData.value,
142617
+ "render-label": renderDynamicValueTreeLabel,
142618
+ "selected-keys": [point.dynamicYValue?.path ?? ""],
142619
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "y")
142620
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142621
+ ])
142622
+ ]),
142623
+ _: 2
142624
+ }, 1032, ["show"])
142625
+ ]),
142626
+ _: 2
142627
+ }, 1032, ["value", "onUpdate:value", "disabled"]),
142628
+ isActiveSeriesXYRChart.value ? (openBlock(), createBlock(unref(NInput), {
142629
+ key: 0,
142630
+ value: point.rValue,
142631
+ "onUpdate:value": ($event) => point.rValue = $event,
142632
+ class: "flex-1",
142633
+ disabled: !!point.dynamicRValue,
142634
+ placeholder: "Size (R)",
142635
+ type: "text"
142636
+ }, {
142637
+ suffix: withCtx(() => [
142638
+ createVNode(unref(NPopover), {
142639
+ placement: "bottom",
142640
+ show: activePopoverPoint.value === point && activePopoverField.value === "r",
142641
+ trigger: "manual",
142642
+ onClickoutside: closePopover
142643
+ }, {
142644
+ trigger: withCtx(() => [
142645
+ createElementVNode("div", {
142646
+ class: "cursor-pointer flex items-center",
142647
+ onClick: ($event) => handleDynamicValueClick(point, "r")
142648
+ }, [
142649
+ createVNode(CIcon, {
142650
+ class: normalizeClass(point.dynamicRValue ? "text-blue-500" : ""),
142651
+ icon: "caret-down"
142652
+ }, null, 8, ["class"])
142653
+ ], 8, _hoisted_46$3)
142654
+ ]),
142655
+ default: withCtx(() => [
142656
+ createElementVNode("div", _hoisted_47$3, [
142657
+ createElementVNode("div", _hoisted_48$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.selectDynamicValue")), 1),
142658
+ createVNode(unref(NTree), {
142659
+ "block-line": "",
142660
+ class: "max-h-[300px]",
142661
+ data: dynamicValueTreeData.value,
142662
+ "render-label": renderDynamicValueTreeLabel,
142663
+ "selected-keys": [point.dynamicRValue?.path ?? ""],
142664
+ "onUpdate:selectedKeys": (keys) => handleDynamicValueSelect(keys, point, "r")
142665
+ }, null, 8, ["data", "selected-keys", "onUpdate:selectedKeys"])
142666
+ ])
142667
+ ]),
142668
+ _: 2
142669
+ }, 1032, ["show"])
142670
+ ]),
142671
+ _: 2
142672
+ }, 1032, ["value", "onUpdate:value", "disabled"])) : createCommentVNode("", true),
141782
142673
  createVNode(CButton, {
141783
142674
  circle: "",
141784
142675
  class: "bg-error2 self-center",
141785
142676
  size: "small",
141786
- style: normalizeStyle({
141787
- "--n-border": "1px solid transparent",
141788
- "--n-border-disabled": "1px solid transparent",
141789
- "--n-border-focus": "1px solid transparent",
141790
- "--n-border-hover": "1px solid transparent",
141791
- "--n-border-pressed": "1px solid transparent",
141792
- "--n-color-focus": unref(themeVars).error2,
141793
- "--n-color-hover": unref(themeVars).error2,
141794
- "--n-color-disabled": unref(themeVars).error2,
141795
- "--n-color-pressed": unref(themeVars).error2
141796
- }),
142677
+ style: normalizeStyle(deleteButtonStyle.value),
141797
142678
  type: "error",
141798
142679
  onClick: ($event) => removeDataPoint(index)
141799
142680
  }, {
@@ -141809,7 +142690,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141809
142690
  }, 1032, ["style", "onClick"])
141810
142691
  ]);
141811
142692
  }), 128)),
141812
- createElementVNode("div", _hoisted_42$3, [
142693
+ createElementVNode("div", _hoisted_49$3, [
141813
142694
  createVNode(CButton, {
141814
142695
  class: "mt-2",
141815
142696
  "icon-placement": "left",
@@ -141829,11 +142710,62 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141829
142710
  })
141830
142711
  ])
141831
142712
  ]),
141832
- createElementVNode("div", _hoisted_43$3, [
141833
- createElementVNode("label", _hoisted_44$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.colorScheme")), 1),
142713
+ createElementVNode("div", _hoisted_50$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartSettings")), 1),
142714
+ createElementVNode("div", _hoisted_51$2, [
142715
+ createElementVNode("label", _hoisted_52$2, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTitle")), 1),
142716
+ createVNode(unref(NInput), {
142717
+ value: chartTitle.value,
142718
+ "onUpdate:value": _cache[2] || (_cache[2] = ($event) => chartTitle.value = $event),
142719
+ type: "text"
142720
+ }, null, 8, ["value"])
142721
+ ]),
142722
+ ["bar", "line"].includes(primaryChartType.value) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
142723
+ createElementVNode("div", _hoisted_53$2, [
142724
+ createElementVNode("label", _hoisted_54$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.xAxisLabel")), 1),
142725
+ createVNode(unref(NInput), {
142726
+ value: xAxisLabel.value,
142727
+ "onUpdate:value": _cache[3] || (_cache[3] = ($event) => xAxisLabel.value = $event),
142728
+ type: "text"
142729
+ }, null, 8, ["value"])
142730
+ ]),
142731
+ createElementVNode("div", _hoisted_55$1, [
142732
+ createElementVNode("label", _hoisted_56$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.yAxisLabel")), 1),
142733
+ createVNode(unref(NInput), {
142734
+ value: yAxisLabel.value,
142735
+ "onUpdate:value": _cache[4] || (_cache[4] = ($event) => yAxisLabel.value = $event),
142736
+ type: "text"
142737
+ }, null, 8, ["value"])
142738
+ ]),
142739
+ createElementVNode("div", _hoisted_57$1, [
142740
+ createElementVNode("label", _hoisted_58$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.orientation")), 1),
142741
+ createVNode(unref(NSelect), {
142742
+ value: orientation.value,
142743
+ "onUpdate:value": _cache[5] || (_cache[5] = ($event) => orientation.value = $event),
142744
+ options: orientationOptions
142745
+ }, null, 8, ["value"])
142746
+ ])
142747
+ ], 64)) : createCommentVNode("", true),
142748
+ ["pie", "doughnut", "polarArea"].includes(primaryChartType.value) ? (openBlock(), createElementBlock("div", _hoisted_59$1, [
142749
+ createElementVNode("label", _hoisted_60$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.legendPosition")), 1),
142750
+ createVNode(unref(NSelect), {
142751
+ value: legendPosition.value,
142752
+ "onUpdate:value": _cache[6] || (_cache[6] = ($event) => legendPosition.value = $event),
142753
+ options: legendPositionOptions
142754
+ }, null, 8, ["value"])
142755
+ ])) : createCommentVNode("", true),
142756
+ ["line", "scatter", "area"].includes(primaryChartType.value) ? (openBlock(), createElementBlock("div", _hoisted_61$1, [
142757
+ createElementVNode("label", _hoisted_62$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.pointStyle")), 1),
142758
+ createVNode(unref(NSelect), {
142759
+ value: pointStyle.value,
142760
+ "onUpdate:value": _cache[7] || (_cache[7] = ($event) => pointStyle.value = $event),
142761
+ options: pointStyleOptions
142762
+ }, null, 8, ["value"])
142763
+ ])) : createCommentVNode("", true),
142764
+ createElementVNode("div", _hoisted_63$1, [
142765
+ createElementVNode("label", _hoisted_64$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.colorScheme")), 1),
141834
142766
  createVNode(unref(NSelect), {
141835
142767
  value: colorSchemeType.value,
141836
- "onUpdate:value": _cache[9] || (_cache[9] = ($event) => colorSchemeType.value = $event),
142768
+ "onUpdate:value": _cache[8] || (_cache[8] = ($event) => colorSchemeType.value = $event),
141837
142769
  class: "mb-2",
141838
142770
  options: [
141839
142771
  { label: unref(t)("canvasUI.canvasBuilder.dataCharts.useThemeColors"), value: "theme" },
@@ -141850,19 +142782,106 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141850
142782
  "onUpdate:palette": updateChartColors
141851
142783
  }, null, 8, ["allow-add", "allow-delete", "allow-edit", "initial-palette"]))
141852
142784
  ]),
141853
- createElementVNode("div", _hoisted_45$3, [
141854
- createElementVNode("label", _hoisted_46$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.animation")), 1),
142785
+ createElementVNode("div", _hoisted_65$1, [
142786
+ createElementVNode("label", _hoisted_66$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.animation")), 1),
141855
142787
  createVNode(unref(NSwitch), {
141856
142788
  value: enableAnimation.value,
141857
- "onUpdate:value": _cache[10] || (_cache[10] = ($event) => enableAnimation.value = $event)
142789
+ "onUpdate:value": _cache[9] || (_cache[9] = ($event) => enableAnimation.value = $event)
141858
142790
  }, null, 8, ["value"])
142791
+ ]),
142792
+ createElementVNode("div", _hoisted_67$1, [
142793
+ createElementVNode("label", _hoisted_68$1, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.percentDisplay")), 1),
142794
+ createElementVNode("div", _hoisted_69, [
142795
+ createVNode(unref(NSwitch), {
142796
+ value: percentDisplay.value,
142797
+ "onUpdate:value": _cache[10] || (_cache[10] = ($event) => percentDisplay.value = $event)
142798
+ }, null, 8, ["value"]),
142799
+ createElementVNode("span", _hoisted_70, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.percentDisplayHint")), 1)
142800
+ ])
142801
+ ]),
142802
+ createElementVNode("div", _hoisted_71, [
142803
+ createElementVNode("label", _hoisted_72, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.viewModeControls")), 1),
142804
+ createElementVNode("div", _hoisted_73, [
142805
+ createElementVNode("div", _hoisted_74, [
142806
+ createVNode(unref(NSwitch), {
142807
+ value: enableFullscreenBtn.value,
142808
+ "onUpdate:value": _cache[11] || (_cache[11] = ($event) => enableFullscreenBtn.value = $event)
142809
+ }, null, 8, ["value"]),
142810
+ createElementVNode("span", _hoisted_75, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableFullscreenBtn")), 1)
142811
+ ]),
142812
+ createVNode(unref(NTooltip), {
142813
+ disabled: !isMultiSeries.value,
142814
+ trigger: "hover"
142815
+ }, {
142816
+ trigger: withCtx(() => [
142817
+ createElementVNode("div", {
142818
+ class: normalizeClass(["flex items-center gap-2", { "opacity-50 cursor-not-allowed": isMultiSeries.value }])
142819
+ }, [
142820
+ createVNode(unref(NSwitch), {
142821
+ value: enableChartTypeSwitcher.value,
142822
+ "onUpdate:value": _cache[12] || (_cache[12] = ($event) => enableChartTypeSwitcher.value = $event),
142823
+ disabled: isMultiSeries.value
142824
+ }, null, 8, ["value", "disabled"]),
142825
+ createElementVNode("span", _hoisted_76, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableChartTypeSwitcher")), 1)
142826
+ ], 2)
142827
+ ]),
142828
+ default: withCtx(() => [
142829
+ createTextVNode(" " + toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartTypeSwitcherMultiSeriesDisabled")), 1)
142830
+ ]),
142831
+ _: 1
142832
+ }, 8, ["disabled"]),
142833
+ createElementVNode("div", _hoisted_77, [
142834
+ createVNode(unref(NSwitch), {
142835
+ value: enableDataEntry.value,
142836
+ "onUpdate:value": _cache[13] || (_cache[13] = ($event) => enableDataEntry.value = $event)
142837
+ }, null, 8, ["value"]),
142838
+ createElementVNode("span", _hoisted_78, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableDataEntry")), 1)
142839
+ ])
142840
+ ])
142841
+ ]),
142842
+ createElementVNode("div", _hoisted_79, [
142843
+ createElementVNode("label", _hoisted_80, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.chartSize")), 1),
142844
+ createElementVNode("div", _hoisted_81, [
142845
+ createElementVNode("div", _hoisted_82, [
142846
+ createElementVNode("label", _hoisted_83, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.height")), 1),
142847
+ createVNode(unref(NInputNumber), {
142848
+ value: chartHeight.value,
142849
+ "onUpdate:value": _cache[14] || (_cache[14] = ($event) => chartHeight.value = $event),
142850
+ class: "flex-1",
142851
+ max: 1e3,
142852
+ min: 100,
142853
+ step: 10
142854
+ }, {
142855
+ suffix: withCtx(() => _cache[17] || (_cache[17] = [
142856
+ createTextVNode("px")
142857
+ ])),
142858
+ _: 1
142859
+ }, 8, ["value"])
142860
+ ]),
142861
+ createElementVNode("div", _hoisted_84, [
142862
+ createElementVNode("label", _hoisted_85, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.width")), 1),
142863
+ createVNode(unref(NInputNumber), {
142864
+ value: chartWidth.value,
142865
+ "onUpdate:value": _cache[15] || (_cache[15] = ($event) => chartWidth.value = $event),
142866
+ class: "flex-1",
142867
+ max: 100,
142868
+ min: 10,
142869
+ step: 5
142870
+ }, {
142871
+ suffix: withCtx(() => _cache[18] || (_cache[18] = [
142872
+ createTextVNode("%")
142873
+ ])),
142874
+ _: 1
142875
+ }, 8, ["value"])
142876
+ ])
142877
+ ])
141859
142878
  ])
141860
142879
  ])
141861
142880
  ])
141862
142881
  ]),
141863
- createElementVNode("div", _hoisted_47$3, [
141864
- createElementVNode("div", _hoisted_48$3, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.preview")), 1),
141865
- createElementVNode("div", _hoisted_49$3, [
142882
+ createElementVNode("div", _hoisted_86, [
142883
+ createElementVNode("div", _hoisted_87, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.preview")), 1),
142884
+ createElementVNode("div", _hoisted_88, [
141866
142885
  createVNode(unref(NCard), { bordered: false }, {
141867
142886
  default: withCtx(() => [
141868
142887
  (openBlock(), createBlock(RawDataCharts, {
@@ -141870,7 +142889,8 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
141870
142889
  data: {
141871
142890
  ...previewData.value,
141872
142891
  context: unref(crmShape)
141873
- }
142892
+ },
142893
+ "is-preview": ""
141874
142894
  }, null, 8, ["data"]))
141875
142895
  ]),
141876
142896
  _: 1
@@ -141927,6 +142947,12 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141927
142947
  usedInSectionId,
141928
142948
  when_used_in_section
141929
142949
  });
142950
+ const canEditChart = computed(() => {
142951
+ if (mode.value === CanvasBuilderMode.ADMIN) {
142952
+ return true;
142953
+ }
142954
+ return props.data?.view_controls?.enable_data_entry ?? false;
142955
+ });
141930
142956
  onMounted(() => {
141931
142957
  if (justAddedComponentId.value === props.id) {
141932
142958
  setComponentEditMode(ComponentTypes.DataCharts, props.id);
@@ -141938,7 +142964,7 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141938
142964
  unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
141939
142965
  key: 0,
141940
142966
  name: _ctx.tracking_id
141941
- }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) && unref(componentPermissions).hasSomethingEditable ? (openBlock(), createBlock(_sfc_main$34, {
142967
+ }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) && unref(componentPermissions).hasSomethingEditable && canEditChart.value ? (openBlock(), createBlock(_sfc_main$34, {
141942
142968
  key: 1,
141943
142969
  id: unref(id),
141944
142970
  active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
@@ -141960,6 +142986,7 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141960
142986
  key: key.value,
141961
142987
  class: "ma-1",
141962
142988
  data: _ctx.data,
142989
+ "is-edit-mode": "",
141963
142990
  style: normalizeStyle(_ctx.style)
141964
142991
  }, null, 8, ["data", "style"])) : (openBlock(), createBlock(_sfc_main$2G, {
141965
142992
  key: 1,
@@ -141971,8 +142998,9 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
141971
142998
  }, 8, ["id", "active", "duplicate", "edit", "remove", "selected", "settings", "stylable"])) : (openBlock(), createBlock(RawDataCharts, {
141972
142999
  key: 2,
141973
143000
  data: _ctx.data,
143001
+ "is-edit-mode": unref(isEditMode),
141974
143002
  style: normalizeStyle(_ctx.style)
141975
- }, null, 8, ["data", "style"])),
143003
+ }, null, 8, ["data", "is-edit-mode", "style"])),
141976
143004
  unref(componentEditMode) && unref(componentEditMode).id === unref(id) ? (openBlock(), createBlock(_sfc_main$2E, {
141977
143005
  key: 3,
141978
143006
  id: unref(id),
@@ -181093,6 +182121,19 @@ const convertToSosl = (soqlQuery, searchString, searchInField = "ALL") => {
181093
182121
  return `FIND {${searchString}} IN ${searchInField} FIELDS RETURNING ${objectName}(${fields.join(", ")}${soslWhereClause}${soslOrderByClause}${soslLimitClause})`;
181094
182122
  };
181095
182123
 
182124
+ const isTheUiItself = (app) => !!app?.app_metadata?.provide?.includes("ui");
182125
+ const isPostcallApp = (app) => !!app?.app_metadata?.provide?.includes("postcall");
182126
+ const isFileViewerReplacement = (app) => !!app?.app_metadata?.replaces?.includes("file-viewer") || !!app?.app_metadata?.replaces?.some(
182127
+ (r) => r && typeof r !== "string" && r.module === "file-viewer"
182128
+ );
182129
+ const doesNotHaveAnyModuleOrHookSpecified = (app) => !app?.app_metadata?.module && !app?.app_metadata?.hooks && !app?.app_metadata?.app_type;
182130
+ const hasAppTypeDefined = (app) => !!app?.app_metadata?.app_type;
182131
+ const isCanvasSectionExecution = (app) => !!app?.app_metadata?.module?.canvas_section_execution?.enabled;
182132
+ const isCanvasDrawerApp = (app) => !!app?.app_metadata?.module?.canvas_drawer?.enabled;
182133
+ const appRequiresCrm = (app) => !!app?.app_metadata?.require?.includes("crm");
182134
+ const shouldShowInSidebar = (app) => !isTheUiItself(app) && (!!app?.app_metadata?.module?.ui_app?.enabled || doesNotHaveAnyModuleOrHookSpecified(app) && !isPostcallApp(app) && !isFileViewerReplacement(app) && !isCanvasDrawerApp(app) && !isCanvasSectionExecution(app) && !hasAppTypeDefined(app));
182135
+ const filterSidebarApps = (apps) => apps.filter(shouldShowInSidebar);
182136
+
181096
182137
  var EventAction = /* @__PURE__ */ ((EventAction2) => {
181097
182138
  EventAction2["CREATE"] = "create";
181098
182139
  EventAction2["PATCH"] = "patch";
@@ -181728,5 +182769,5 @@ const localeNames = {
181728
182769
  };
181729
182770
  const localeDropdownOptions = supportedLocales.map((locale) => ({ key: locale, name: localeNames[locale] }));
181730
182771
 
181731
- export { ADMIN_API_METHOD_TYPES, ADMIN_API_TYPES, ADMIN_MESSAGE, ADMIN_MESSAGE_TYPES, APPS_DB, AccessTypeEnum, App$3 as AgendaSelectorApp, AppTypeEnum, _sfc_main as AssetsManagerApp, App$1 as Browser, BulkUpdateMetadataOperationEnum, BulkUpdateTagsOperationEnum, CALL_STORAGE_KEY, CANVASES, CANVAS_HOOKS, CANVAS_TYPOGRAPHY_CSS_PROPERTIES, CANVAS_TYPOGRAPHY_PRESETS, CAlgoliaSearch, CAssignedCanvasesManagement, _sfc_main$4n as CAssignedCanvasesManagementToolbar, _sfc_main$6q as CAvatar, _sfc_main$4M as CBlockManagement, CButton, _sfc_main$5d as CCanvasDeleteDialogContent, _sfc_main$5e as CCanvasMetadataFilters, CCanvasSelector, _sfc_main$6T as CCard, CCarousel, _sfc_main$3G as CCatalogIqSwitcher, _sfc_main$6S as CCheckbox, _sfc_main$3A as CChip, CCollapse, _sfc_main$6P as CCollapseItem, _sfc_main$6p as CCollapseTransition, NColorPicker as CColorPicker, CComponentListItem, CConfigEditor, NConfigProvider as CConfigProvider, _sfc_main$6f as CConfirmationAction, CConfirmationContent, CConfirmationHeader, CConfirmationModal, CContactSelector, CContactSelectorSelected, _sfc_main$66 as CContentError, _sfc_main$63 as CCreateCanvasModal, _sfc_main$62 as CCreateTemplateSectionBlockModal, _sfc_main$5T as CCreateThemeModal, CDP_EVENT_TYPE, CDataTable, NDatePicker as CDatePicker, CDateRangeFilter, CDetailPageSectionButtons, NDialogProvider as CDialogProvider, _sfc_main$6N as CDivider, _sfc_main$6M as CDrawer, _sfc_main$6L as CDrawerContent, _sfc_main$6K as CDropdown, _sfc_main$6n as CEmpty, _sfc_main$4k as CEntitySelector, _sfc_main$6J as CErrorFullScreen, _sfc_main$6l as CFeedback, _sfc_main$3o as CFileAccessManagement, _sfc_main$6A as CFileAttributes, _sfc_main$3p as CFilePanel, _sfc_main$6G as CFileThumbnail, CFileViewer, CFilesAccessInfo, _sfc_main$3Z as CFilesAccessManage, _sfc_main$3I as CFilesFolderDeleteDialogContent, NForm as CForm, NFormItem as CFormItem, NFormItemCol as CFormItemCol, NFormItemGridItem as CFormItemGi, NFormItemGridItem as CFormItemGridItem, FormItemRow as CFormItemRow, _sfc_main$4f as CFullScreenLoader, NGridItem as CGi, CGlobalLoader, _sfc_main$5M as CGlobalSearch, GlobalStyle as CGlobalStyle, NGrid as CGrid, NGridItem as CGridItem, CGroupsAccessInfo, NH1 as CH1, NH2 as CH2, NH3 as CH3, NH4 as CH4, NH5 as CH5, NH6 as CH6, _sfc_main$6k as CHelpText, CIcon, _sfc_main$6I as CImage, _sfc_main$4U as CInfoBadge, _sfc_main$6z as CInput, NInputNumber as CInputNumber, _sfc_main$3y as CKnockNotificationsAppWrapper, CLIENT_TYPE, NLayout as CLayout, NLayoutContent as CLayoutContent, LayoutFooter as CLayoutFooter, LayoutHeader as CLayoutHeader, LayoutSider as CLayoutSider, _sfc_main$4V as CList, NMessageProvider as CMessageProvider, _sfc_main$5J as CMetaDataBadge, _sfc_main$6y as CModal, CMonacoEditor, CMovableWidget, CMultiSelect, NNotificationProvider as CNotificationProvider, NPagination as CPagination, _sfc_main$6j as CPillSelect, _sfc_main$6x as CPopover, _sfc_main$6H as CProcessingOverlay, NProgress as CProgress, _sfc_main$5q as CRichTextEditor, _sfc_main$4o as CSavedCanvasesManagement, CSearch, _sfc_main$6v as CSearchOnClick, CSearchOnClickWithSuggestions, CSecondaryNav, _sfc_main$4P as CSectionManagement, CSelect, CSelectFilter, _sfc_main$3x as CSettingsEditor, CShortcut, CSingleSelect, NSkeleton as CSkeleton, _sfc_main$3C as CSlideViewer, NSpace as CSpace, _sfc_main$6o as CSpin, _sfc_main$6m as CSwitch, CTable, _sfc_main$5a as CTableInput, CTableMore, CTableSelect, CTableTag, _sfc_main$6D as CTag, CTags, _sfc_main$4E as CTemplateManagement, text as CText, _sfc_main$6t as CThemeEditor, _sfc_main$4z as CThemeManagement, _sfc_main$5j as CToastProvider, CToolbar, _sfc_main$6r as CTooltip, CUpsertFolderModal, _sfc_main$5n as CUserAvatar, CUserMenu, CUsersAccessInfo, CUsersGroupsAccessManage, _sfc_main$5k as CVirtualTable, _sfc_main$46 as CWarningAlert, CallState, CanvasActions, _sfc_main$15 as CanvasBuilderApp, CanvasBuilderMode, CanvasExcludedComponentTypesEnum, CanvasHistoryAction, App as CanvasSelector, CanvasStatus, CanvasThemeStatus, CanvasesViewsTypes, CollaborationRoleEnum, CollectionPlayerApp, App$4 as CollectionSelectorApp, ComponentIcon, ComponentTypes, ContactSelectorQuickFilterType, ContentGridLayoutTypes, ContentSelector, CoreFolderEntityType, DATE_TIME_FORMAT, DEFAULT_ADMIN_TABLE_HEIGHT, DEFAULT_ADMIN_TABLE_WITH_PAGINATION_HEIGHT, DEFAULT_GLOBAL_COMPONENT_SPACING, DEFAULT_GLOBAL_COMPONENT_SPACING_INTERVAL, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PEER_CONNECTIVITY_VERSION, DEFAULT_PITCHER_SETTINGS, DSR_API_METHOD_TYPES, DSR_API_TYPES, DSR_MESSAGE, DSR_MESSAGE_TYPES, DSR_TYPE, DefaultExpiresAtEnum, DownloadTypeEnum, EMBED_TYPE, EventAction, EventExternalObjectContentTypeEnum, EventStatusEnum, FileContentTypeEnum, FileStatusEnum, FileTypeEnum, GlobalSearchResultType, GridLayoutTypes, HIDE_IF_EMPTY_COMPONENT_ID_TAG_PREFIX, HIDE_IF_EMPTY_COMPONENT_TRACKING_ID_TAG_PREFIX, HIDE_TAGS_WITH_PREFIX, HtmlLayoutTypes, IFRAME_ACTION_TYPES, IFRAME_DATA_MESSAGE, INITIAL_CALL_STATE, IS_DEV_ORG, IS_LOCALHOST, InstanceMembershipRoleEnum, InstanceMembershipUserStatusEnum, InvitationStatusEnum, LanguageEnum, LinkAlignmentTypes, LinkAnchorTypes, LinkPreviewTypes, MAX_LUMINANCE_FOR_LIGHT_TEXT, MAX_UPLOAD_SIZE, MIN_DIFFERENCE_IN_MINUTES, MetadataTemplateFieldTypeEnum, MultimediaHorizontalAlignmentOptions, NON_MEMBER_ROLES, NotesApp, OperatorEnum, PAPER_SIZE_PRESETS, PEER_CONNECTIVITY_EVENT, PEER_CONNECTIVITY_HANDLER_MATCH_ALL, PITCHER_EVENT, PITCHER_SETTINGS_KEY, PLATFORM_TYPE, PRINT_SCALE_FACTOR, PeerConnectivityActions, PitcherBroadcastedEventName, PitcherEventName, PitcherExternalEventName, PitcherMessageType, PitcherResponseStatus, PostAction, App$2 as PptConversionSelectorApp, REQUEST_DEFAULT_CANCEL_TIMEOUT, SEARCH_DEBOUNCE_TIME, SUPPORTED_FONT_EXTENSIONS, SUPPORTED_FONT_TYPES, SUPPORTED_IMAGE_EXTENSIONS, SUPPORTED_IMAGE_TYPES, SUPPORTED_UPLOAD_FILE_EXTENSIONS, SUPPORTED_VIDEO_EXTENSIONS, SUPPORTED_VIDEO_TYPES, SfEventColors, SfEventColorsLight, StorageRegionEnum, TRACKING_EVENTS_STORAGE_KEY, UI_API_METHOD_TYPES, UI_MESSAGE, UI_MESSAGE_TYPES, UI_NATIVE_MESSAGE_TYPES, UserRoleEnum, ViewCompactItemType, addCanvasComponent, _export as agendaSelector, applyCanvasThemeAssetsToNode, applyFont, applyToTreeBy, autofocus as autofocusDirective, camelCaseKeys, canvasUiUnoPreset, clearLocalStorageIfNeeded, ClickOutsideDirective as clickOutsideDirective, collectAllNodesByCondition, _export$3 as collectionPlayer, _export$2 as collectionSelector, componentIconType, computeLocalStorageBytes, convertSecondsToMinutes, convertToPixels, convertToSosl, createNodeId, createPitcherSettings, dayjs, deepDiff, deepToRaw, derivePatchRequestFields, determineUserRole, discardSectionComponentOverride, displayBytesWithMUnit, displayIntegerWithMunit, doesLocalOverrideExist, downloadFile, draggable as draggableDirective, elementMounted as elementMountedDirective, escapeSoqlString, evaluateAccessor, executeWithDoublingTime, exitFullscreen, fallbackLocale, fetchAll, fetchAllWithOffset, fetchFirstChunkAndRemainingAsync, filterTreeBy, findAllEmbeddableTypesInCanvasContent, findAllEmbeddableTypesInSectionsContent, findEmbeddableInCanvasContent, findEmbeddableInSectionsContent, findNodeInTreeByCondition, findNodeInTreeById, findNodeInTreeByType, findParentByNodeId, formatDate, formatDateDetailed, formatDateTime, formatDateTimeAgo, formatDayMonthBasedOnBrowserLang, formatDimensionForGotenberg, generateAIThumbnailUrl, getAllPages, getAppConfigFromAppSource, getAvailableApis, getComponentDescription, getComponentKeywords, getComponentTitle, getContrastTextColor, getDefinedProps, getEventColor, getExcessItemsIndexes, getFontAwesomeIconNameAndType, getImageSize, getLocalOverrideUrl, getLuminance, getNextPageParam, getNodeDisplayNameByComponentType, getNumberWithRegex, getPageQuantity, getPageRange, getPreviewUrl, getRoleIcon, getSectionGlobalComponentSpacing, handleThemeAssetComparison, highLevelApi, indirectEval, insertItemSorted, isAfter, isBefore, isBeforeMinDate, isEmbeddableWithZeroHeight, isFirefox, isFullscreen, isHeadlessOrNotAvailableApp, isImageAccessible, isIosDevice, isMac, isMobile, isModifierClick, isNonMemberRole, isOriginValid, isPastMaxDate, isPitcherOrIosDevice, isPitcherWkWebView, isQueryParamTruthy, isSafari, isSafariOnIosDevice, isSameOrAfter, isSameOrBefore, isTextComponentEmpty, isTouchScreen, isValidHex, isWindows, lightThemeOverrides, loadCustomHelpersFromApps, loadRemoteScriptWithCtx, loadScript, loadScriptStyle, loadStyle, localeDropdownOptions, localeNames, locales, minFutureDate, minPastDate, moveNodeTo, msToSeconds, navigateTo, normalizeFilterParams, normalizeNetworkFilterParams, openUsdz, parseCollectionPlayerSlidesToContentSelector, parseContentSelectorToCollectionPlayerSlides, parseFileToCollectionPlayer, parsePdfFileToCollectionPlayer, parsePptxFileToCollectionPlayer, pascalCaseKeys, _export$1 as pptConversionSelector, processCanvasForSectionThemeOverride, regenerateTreeIds, registerCustomHelper, registerCustomHelpers, registerPeerConnectivityHandler, renderTemplate, replaceThemePresetsWithInlineStyles, replaceTranslationMessagesWithOverrides, requestFullscreen, requestStream, scrollCanvasToTop, scrollToComponentById, secondsToHumanReadable, sendPeerConnectivityEvent, setDateTime, shouldDisplayPlaceholderComponent, shouldOpenInCollectionPlayerViewer, shouldShowEmbeddable, skipElementsInTree, snakeCaseKeys, someNodeInTree, sortCollectionByString, splitUserName, stringToHslColor, supportedLocales, tapDirective, titleCase, toggleFullscreen, tooltipDirective, transformFilesToCollectionPlayer, transformFilesToContentGrid, updateFirstContentGridWithShareboxItems, urlSafeFetchInChunks, useAdmin, useAdminAndDsrState, useApi, useAppsDb, useBindValidation, useBroadcastRouteChange, useCanvasById, useCanvasLocks, useCanvasOverlay, useCanvasVisibility, useCanvasesAsInfinity, useCollectionPlayerOverlay, useCommentTracking, useConfirmation, useCreateEvent, useDeleteEvent, useDsr, useFetchCanvases, useFetchEvents, useFetchUsers, useFileDisplayHelpers, useFolderNameDescription, useGlobalSearch, useInfiniteScroll, useLocation, useMetadataSearch, useMetadataTemplates, useNotesApp, useNotification, useOpenFileStack, usePitcherApi, usePolling, usePresentationHistory, useRecentFiles, useShareCanvas, useSharedCommentsStorage, useSuggestedTags, useTheme, useThemeVars, useToast, useUi, useUpdateEvent, useWindowEvents, vueQueryPluginOptions, wait, waitForIframeInitialize, waitForValue };
182772
+ export { ADMIN_API_METHOD_TYPES, ADMIN_API_TYPES, ADMIN_MESSAGE, ADMIN_MESSAGE_TYPES, APPS_DB, AccessTypeEnum, App$3 as AgendaSelectorApp, AppTypeEnum, _sfc_main as AssetsManagerApp, App$1 as Browser, BulkUpdateMetadataOperationEnum, BulkUpdateTagsOperationEnum, CALL_STORAGE_KEY, CANVASES, CANVAS_HOOKS, CANVAS_TYPOGRAPHY_CSS_PROPERTIES, CANVAS_TYPOGRAPHY_PRESETS, CAlgoliaSearch, CAssignedCanvasesManagement, _sfc_main$4n as CAssignedCanvasesManagementToolbar, _sfc_main$6q as CAvatar, _sfc_main$4M as CBlockManagement, CButton, _sfc_main$5d as CCanvasDeleteDialogContent, _sfc_main$5e as CCanvasMetadataFilters, CCanvasSelector, _sfc_main$6T as CCard, CCarousel, _sfc_main$3G as CCatalogIqSwitcher, _sfc_main$6S as CCheckbox, _sfc_main$3A as CChip, CCollapse, _sfc_main$6P as CCollapseItem, _sfc_main$6p as CCollapseTransition, NColorPicker as CColorPicker, CComponentListItem, CConfigEditor, NConfigProvider as CConfigProvider, _sfc_main$6f as CConfirmationAction, CConfirmationContent, CConfirmationHeader, CConfirmationModal, CContactSelector, CContactSelectorSelected, _sfc_main$66 as CContentError, _sfc_main$63 as CCreateCanvasModal, _sfc_main$62 as CCreateTemplateSectionBlockModal, _sfc_main$5T as CCreateThemeModal, CDP_EVENT_TYPE, CDataTable, NDatePicker as CDatePicker, CDateRangeFilter, CDetailPageSectionButtons, NDialogProvider as CDialogProvider, _sfc_main$6N as CDivider, _sfc_main$6M as CDrawer, _sfc_main$6L as CDrawerContent, _sfc_main$6K as CDropdown, _sfc_main$6n as CEmpty, _sfc_main$4k as CEntitySelector, _sfc_main$6J as CErrorFullScreen, _sfc_main$6l as CFeedback, _sfc_main$3o as CFileAccessManagement, _sfc_main$6A as CFileAttributes, _sfc_main$3p as CFilePanel, _sfc_main$6G as CFileThumbnail, CFileViewer, CFilesAccessInfo, _sfc_main$3Z as CFilesAccessManage, _sfc_main$3I as CFilesFolderDeleteDialogContent, NForm as CForm, NFormItem as CFormItem, NFormItemCol as CFormItemCol, NFormItemGridItem as CFormItemGi, NFormItemGridItem as CFormItemGridItem, FormItemRow as CFormItemRow, _sfc_main$4f as CFullScreenLoader, NGridItem as CGi, CGlobalLoader, _sfc_main$5M as CGlobalSearch, GlobalStyle as CGlobalStyle, NGrid as CGrid, NGridItem as CGridItem, CGroupsAccessInfo, NH1 as CH1, NH2 as CH2, NH3 as CH3, NH4 as CH4, NH5 as CH5, NH6 as CH6, _sfc_main$6k as CHelpText, CIcon, _sfc_main$6I as CImage, _sfc_main$4U as CInfoBadge, _sfc_main$6z as CInput, NInputNumber as CInputNumber, _sfc_main$3y as CKnockNotificationsAppWrapper, CLIENT_TYPE, NLayout as CLayout, NLayoutContent as CLayoutContent, LayoutFooter as CLayoutFooter, LayoutHeader as CLayoutHeader, LayoutSider as CLayoutSider, _sfc_main$4V as CList, NMessageProvider as CMessageProvider, _sfc_main$5J as CMetaDataBadge, _sfc_main$6y as CModal, CMonacoEditor, CMovableWidget, CMultiSelect, NNotificationProvider as CNotificationProvider, NPagination as CPagination, _sfc_main$6j as CPillSelect, _sfc_main$6x as CPopover, _sfc_main$6H as CProcessingOverlay, NProgress as CProgress, _sfc_main$5q as CRichTextEditor, _sfc_main$4o as CSavedCanvasesManagement, CSearch, _sfc_main$6v as CSearchOnClick, CSearchOnClickWithSuggestions, CSecondaryNav, _sfc_main$4P as CSectionManagement, CSelect, CSelectFilter, _sfc_main$3x as CSettingsEditor, CShortcut, CSingleSelect, NSkeleton as CSkeleton, _sfc_main$3C as CSlideViewer, NSpace as CSpace, _sfc_main$6o as CSpin, _sfc_main$6m as CSwitch, CTable, _sfc_main$5a as CTableInput, CTableMore, CTableSelect, CTableTag, _sfc_main$6D as CTag, CTags, _sfc_main$4E as CTemplateManagement, text as CText, _sfc_main$6t as CThemeEditor, _sfc_main$4z as CThemeManagement, _sfc_main$5j as CToastProvider, CToolbar, _sfc_main$6r as CTooltip, CUpsertFolderModal, _sfc_main$5n as CUserAvatar, CUserMenu, CUsersAccessInfo, CUsersGroupsAccessManage, _sfc_main$5k as CVirtualTable, _sfc_main$46 as CWarningAlert, CallState, CanvasActions, _sfc_main$15 as CanvasBuilderApp, CanvasBuilderMode, CanvasExcludedComponentTypesEnum, CanvasHistoryAction, App as CanvasSelector, CanvasStatus, CanvasThemeStatus, CanvasesViewsTypes, CollaborationRoleEnum, CollectionPlayerApp, App$4 as CollectionSelectorApp, ComponentIcon, ComponentTypes, ContactSelectorQuickFilterType, ContentGridLayoutTypes, ContentSelector, CoreFolderEntityType, DATE_TIME_FORMAT, DEFAULT_ADMIN_TABLE_HEIGHT, DEFAULT_ADMIN_TABLE_WITH_PAGINATION_HEIGHT, DEFAULT_GLOBAL_COMPONENT_SPACING, DEFAULT_GLOBAL_COMPONENT_SPACING_INTERVAL, DEFAULT_ITEMS_PER_PAGE, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_SIZE_OPTIONS, DEFAULT_PEER_CONNECTIVITY_VERSION, DEFAULT_PITCHER_SETTINGS, DSR_API_METHOD_TYPES, DSR_API_TYPES, DSR_MESSAGE, DSR_MESSAGE_TYPES, DSR_TYPE, DefaultExpiresAtEnum, DownloadTypeEnum, EMBED_TYPE, EventAction, EventExternalObjectContentTypeEnum, EventStatusEnum, FileContentTypeEnum, FileStatusEnum, FileTypeEnum, GlobalSearchResultType, GridLayoutTypes, HIDE_IF_EMPTY_COMPONENT_ID_TAG_PREFIX, HIDE_IF_EMPTY_COMPONENT_TRACKING_ID_TAG_PREFIX, HIDE_TAGS_WITH_PREFIX, HtmlLayoutTypes, IFRAME_ACTION_TYPES, IFRAME_DATA_MESSAGE, INITIAL_CALL_STATE, IS_DEV_ORG, IS_LOCALHOST, InstanceMembershipRoleEnum, InstanceMembershipUserStatusEnum, InvitationStatusEnum, LanguageEnum, LinkAlignmentTypes, LinkAnchorTypes, LinkPreviewTypes, MAX_LUMINANCE_FOR_LIGHT_TEXT, MAX_UPLOAD_SIZE, MIN_DIFFERENCE_IN_MINUTES, MetadataTemplateFieldTypeEnum, MultimediaHorizontalAlignmentOptions, NON_MEMBER_ROLES, NotesApp, OperatorEnum, PAPER_SIZE_PRESETS, PEER_CONNECTIVITY_EVENT, PEER_CONNECTIVITY_HANDLER_MATCH_ALL, PITCHER_EVENT, PITCHER_SETTINGS_KEY, PLATFORM_TYPE, PRINT_SCALE_FACTOR, PeerConnectivityActions, PitcherBroadcastedEventName, PitcherEventName, PitcherExternalEventName, PitcherMessageType, PitcherResponseStatus, PostAction, App$2 as PptConversionSelectorApp, REQUEST_DEFAULT_CANCEL_TIMEOUT, SEARCH_DEBOUNCE_TIME, SUPPORTED_FONT_EXTENSIONS, SUPPORTED_FONT_TYPES, SUPPORTED_IMAGE_EXTENSIONS, SUPPORTED_IMAGE_TYPES, SUPPORTED_UPLOAD_FILE_EXTENSIONS, SUPPORTED_VIDEO_EXTENSIONS, SUPPORTED_VIDEO_TYPES, SfEventColors, SfEventColorsLight, StorageRegionEnum, TRACKING_EVENTS_STORAGE_KEY, UI_API_METHOD_TYPES, UI_MESSAGE, UI_MESSAGE_TYPES, UI_NATIVE_MESSAGE_TYPES, UserRoleEnum, ViewCompactItemType, addCanvasComponent, _export as agendaSelector, appRequiresCrm, applyCanvasThemeAssetsToNode, applyFont, applyToTreeBy, autofocus as autofocusDirective, camelCaseKeys, canvasUiUnoPreset, clearLocalStorageIfNeeded, ClickOutsideDirective as clickOutsideDirective, collectAllNodesByCondition, _export$3 as collectionPlayer, _export$2 as collectionSelector, componentIconType, computeLocalStorageBytes, convertSecondsToMinutes, convertToPixels, convertToSosl, createNodeId, createPitcherSettings, dayjs, deepDiff, deepToRaw, derivePatchRequestFields, determineUserRole, discardSectionComponentOverride, displayBytesWithMUnit, displayIntegerWithMunit, doesLocalOverrideExist, doesNotHaveAnyModuleOrHookSpecified, downloadFile, draggable as draggableDirective, elementMounted as elementMountedDirective, escapeSoqlString, evaluateAccessor, executeWithDoublingTime, exitFullscreen, fallbackLocale, fetchAll, fetchAllWithOffset, fetchFirstChunkAndRemainingAsync, filterSidebarApps, filterTreeBy, findAllEmbeddableTypesInCanvasContent, findAllEmbeddableTypesInSectionsContent, findEmbeddableInCanvasContent, findEmbeddableInSectionsContent, findNodeInTreeByCondition, findNodeInTreeById, findNodeInTreeByType, findParentByNodeId, formatDate, formatDateDetailed, formatDateTime, formatDateTimeAgo, formatDayMonthBasedOnBrowserLang, formatDimensionForGotenberg, generateAIThumbnailUrl, getAllPages, getAppConfigFromAppSource, getAvailableApis, getComponentDescription, getComponentKeywords, getComponentTitle, getContrastTextColor, getDefinedProps, getEventColor, getExcessItemsIndexes, getFontAwesomeIconNameAndType, getImageSize, getLocalOverrideUrl, getLuminance, getNextPageParam, getNodeDisplayNameByComponentType, getNumberWithRegex, getPageQuantity, getPageRange, getPreviewUrl, getRoleIcon, getSectionGlobalComponentSpacing, handleThemeAssetComparison, hasAppTypeDefined, highLevelApi, indirectEval, insertItemSorted, isAfter, isBefore, isBeforeMinDate, isCanvasDrawerApp, isCanvasSectionExecution, isEmbeddableWithZeroHeight, isFileViewerReplacement, isFirefox, isFullscreen, isHeadlessOrNotAvailableApp, isImageAccessible, isIosDevice, isMac, isMobile, isModifierClick, isNonMemberRole, isOriginValid, isPastMaxDate, isPitcherOrIosDevice, isPitcherWkWebView, isPostcallApp, isQueryParamTruthy, isSafari, isSafariOnIosDevice, isSameOrAfter, isSameOrBefore, isTextComponentEmpty, isTheUiItself, isTouchScreen, isValidHex, isWindows, lightThemeOverrides, loadCustomHelpersFromApps, loadRemoteScriptWithCtx, loadScript, loadScriptStyle, loadStyle, localeDropdownOptions, localeNames, locales, minFutureDate, minPastDate, moveNodeTo, msToSeconds, navigateTo, normalizeFilterParams, normalizeNetworkFilterParams, openUsdz, parseCollectionPlayerSlidesToContentSelector, parseContentSelectorToCollectionPlayerSlides, parseFileToCollectionPlayer, parsePdfFileToCollectionPlayer, parsePptxFileToCollectionPlayer, pascalCaseKeys, _export$1 as pptConversionSelector, processCanvasForSectionThemeOverride, regenerateTreeIds, registerCustomHelper, registerCustomHelpers, registerPeerConnectivityHandler, renderTemplate, replaceThemePresetsWithInlineStyles, replaceTranslationMessagesWithOverrides, requestFullscreen, requestStream, scrollCanvasToTop, scrollToComponentById, secondsToHumanReadable, sendPeerConnectivityEvent, setDateTime, shouldDisplayPlaceholderComponent, shouldOpenInCollectionPlayerViewer, shouldShowEmbeddable, shouldShowInSidebar, skipElementsInTree, snakeCaseKeys, someNodeInTree, sortCollectionByString, splitUserName, stringToHslColor, supportedLocales, tapDirective, titleCase, toggleFullscreen, tooltipDirective, transformFilesToCollectionPlayer, transformFilesToContentGrid, updateFirstContentGridWithShareboxItems, urlSafeFetchInChunks, useAdmin, useAdminAndDsrState, useApi, useAppsDb, useBindValidation, useBroadcastRouteChange, useCanvasById, useCanvasLocks, useCanvasOverlay, useCanvasVisibility, useCanvasesAsInfinity, useCollectionPlayerOverlay, useCommentTracking, useConfirmation, useCreateEvent, useDeleteEvent, useDsr, useFetchCanvases, useFetchEvents, useFetchUsers, useFileDisplayHelpers, useFolderNameDescription, useGlobalSearch, useInfiniteScroll, useLocation, useMetadataSearch, useMetadataTemplates, useNotesApp, useNotification, useOpenFileStack, usePitcherApi, usePolling, usePresentationHistory, useRecentFiles, useShareCanvas, useSharedCommentsStorage, useSuggestedTags, useTheme, useThemeVars, useToast, useUi, useUpdateEvent, useWindowEvents, vueQueryPluginOptions, wait, waitForIframeInitialize, waitForValue };
181732
182773
  //# sourceMappingURL=canvas-ui.js.map