@pitcher/canvas-ui 2025.12.31-012047-beta → 2026.1.5-123919-beta

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
@@ -142425,7 +142425,10 @@ const _hoisted_94 = { class: "flex flex-col gap-2" };
142425
142425
  const _hoisted_95 = { class: "flex items-center gap-2" };
142426
142426
  const _hoisted_96 = { class: "text-sm" };
142427
142427
  const _hoisted_97 = { class: "text-sm" };
142428
- const _hoisted_98 = { class: "flex items-center gap-2" };
142428
+ const _hoisted_98 = {
142429
+ key: 0,
142430
+ class: "flex items-center gap-2"
142431
+ };
142429
142432
  const _hoisted_99 = { class: "text-sm" };
142430
142433
  const _hoisted_100 = { class: "mb-4" };
142431
142434
  const _hoisted_101 = { class: "block mb-2" };
@@ -142451,7 +142454,8 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
142451
142454
  const props = __props;
142452
142455
  const { t } = useI18n();
142453
142456
  const themeVars = useThemeVars();
142454
- const { setComponentEditMode, updateNodeDataById } = useCanvas$1();
142457
+ const { mode, setComponentEditMode, updateNodeDataById } = useCanvas$1();
142458
+ const isAdminMode = computed(() => mode.value === CanvasBuilderMode.ADMIN);
142455
142459
  const { crmShape } = useCrmShape();
142456
142460
  const { palette } = useCanvasTheme$1();
142457
142461
  let seriesIdCounter = 0;
@@ -142539,7 +142543,9 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
142539
142543
  });
142540
142544
  const chartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
142541
142545
  const primaryChartType = computed(() => seriesList.value[0]?.chartType ?? "bar");
142542
- const backgroundColor = props.data?.data?.datasets?.[0]?.background_color;
142546
+ const savedColorScheme = props.data?.color_scheme;
142547
+ const datasets = props.data?.data?.datasets;
142548
+ const backgroundColor = savedColorScheme ?? (datasets && datasets.length > 1 ? datasets.map((ds) => ds.background_color).filter(Boolean) : datasets?.[0]?.background_color);
142543
142549
  const colorSchemeType = ref(props.data?.color_scheme_type ?? "theme");
142544
142550
  const chartColors = ref([]);
142545
142551
  const displayColors = computed(() => {
@@ -142574,7 +142580,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
142574
142580
  const percentDisplay = ref(props.data?.percent_display ?? false);
142575
142581
  const enableFullscreenBtn = ref(props.data?.view_controls?.enable_fullscreen_btn ?? false);
142576
142582
  const enableChartTypeSwitcher = ref(props.data?.view_controls?.enable_chart_type_switcher ?? false);
142577
- const enableDataEntry = ref(props.data?.view_controls?.enable_data_entry ?? false);
142583
+ const enableDataEntry = ref(props.data?.view_controls?.enable_data_entry !== false);
142578
142584
  const chartHeight = ref(props.data?.chart_height ?? 800);
142579
142585
  const chartWidth = ref(props.data?.chart_width ?? 100);
142580
142586
  const legendPositionOptions = [
@@ -143091,7 +143097,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
143091
143097
  return chartColors.value;
143092
143098
  }
143093
143099
  function createChartConfig() {
143094
- const datasets = [];
143100
+ const datasets2 = [];
143095
143101
  let allLabels = [];
143096
143102
  const colorsForStorage = getSeriesColors(true);
143097
143103
  const isSingleSeries = seriesList.value.length === 1;
@@ -143136,7 +143142,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
143136
143142
  if (processedData.labels.length > allLabels.length) {
143137
143143
  allLabels = processedData.labels;
143138
143144
  }
143139
- datasets.push(datasetOptions);
143145
+ datasets2.push(datasetOptions);
143140
143146
  });
143141
143147
  const primaryType = seriesList.value[0].chartType;
143142
143148
  let actualPrimaryType = primaryType;
@@ -143175,6 +143181,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
143175
143181
  const config = {
143176
143182
  type: actualPrimaryType,
143177
143183
  color_scheme_type: colorSchemeType.value,
143184
+ color_scheme: colorsForStorage,
143178
143185
  percent_display: percentDisplay.value,
143179
143186
  chart_height: chartHeight.value,
143180
143187
  chart_width: chartWidth.value,
@@ -143185,7 +143192,7 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
143185
143192
  },
143186
143193
  data: {
143187
143194
  labels: allLabels,
143188
- datasets
143195
+ datasets: datasets2
143189
143196
  },
143190
143197
  options: {
143191
143198
  responsive: true,
@@ -143945,13 +143952,13 @@ const _sfc_main$2E = /* @__PURE__ */ defineComponent({
143945
143952
  ]),
143946
143953
  _: 1
143947
143954
  }, 8, ["disabled"]),
143948
- createElementVNode("div", _hoisted_98, [
143955
+ isAdminMode.value ? (openBlock(), createElementBlock("div", _hoisted_98, [
143949
143956
  createVNode(unref(NSwitch), {
143950
143957
  value: enableDataEntry.value,
143951
143958
  "onUpdate:value": _cache[13] || (_cache[13] = ($event) => enableDataEntry.value = $event)
143952
143959
  }, null, 8, ["value"]),
143953
143960
  createElementVNode("span", _hoisted_99, toDisplayString(unref(t)("canvasUI.canvasBuilder.dataCharts.enableDataEntry")), 1)
143954
- ])
143961
+ ])) : createCommentVNode("", true)
143955
143962
  ])
143956
143963
  ]),
143957
143964
  createElementVNode("div", _hoisted_100, [
@@ -144066,7 +144073,7 @@ const _sfc_main$2D = /* @__PURE__ */ defineComponent({
144066
144073
  if (mode.value === CanvasBuilderMode.ADMIN) {
144067
144074
  return true;
144068
144075
  }
144069
- return props.data?.view_controls?.enable_data_entry ?? false;
144076
+ return props.data?.view_controls?.enable_data_entry !== false;
144070
144077
  });
144071
144078
  onMounted(() => {
144072
144079
  if (justAddedComponentId.value === props.id) {