@conduction/nextcloud-vue 2.183.0 → 2.184.0

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.
@@ -19700,6 +19700,73 @@ function useEndpointSource(source, options) {
19700
19700
  return { data, body, loading, error, refused, refusal, truncated, blocked, awaitingRequest, request, refetch }
19701
19701
  }
19702
19702
 
19703
+ /*
19704
+ * SPDX-FileCopyrightText: 2026 Conduction B.V.
19705
+ * SPDX-License-Identifier: EUPL-1.2
19706
+ */
19707
+
19708
+ /**
19709
+ * widgetData — a self-fetching widget tells its host what it shows.
19710
+ *
19711
+ * A widget that fetches its own data (CnChartWidget, CnStatsBlockWidget)
19712
+ * keeps that data to itself, so a host that derives values from it (a
19713
+ * dashboard's calculated fields, an export) has nothing to read. A widget
19714
+ * using this mixin defines a `widgetData` computed returning a plain,
19715
+ * serialisable summary of what it shows, or null while there is nothing yet;
19716
+ * the mixin emits `data` with that summary whenever it changes, including the
19717
+ * first time it is known.
19718
+ *
19719
+ * @spec openspec/changes/widget-data-event/specs/widget-data-event/spec.md#requirement-a-self-fetching-widget-tells-its-host-what-it-shows
19720
+ */
19721
+ var widgetData = {
19722
+ emits: ['data'],
19723
+
19724
+ watch: {
19725
+ widgetData: {
19726
+ immediate: true,
19727
+ /**
19728
+ * Emit the summary once it is known, and on every change.
19729
+ *
19730
+ * @param {object|null} summary The widget's data summary.
19731
+ * @return {void}
19732
+ */
19733
+ handler(summary) {
19734
+ if (summary !== null && summary !== undefined) {
19735
+ /**
19736
+ * What the widget shows, as a plain summary.
19737
+ *
19738
+ * @event data
19739
+ * @type {object}
19740
+ */
19741
+ this.$emit('data', summary);
19742
+ }
19743
+ },
19744
+ },
19745
+ },
19746
+ };
19747
+
19748
+ /**
19749
+ * The sum of the numbers in a chart series: a list of numbers (a pie or
19750
+ * donut) or the `data` of its first named series. Non-numbers count as 0.
19751
+ *
19752
+ * @param {Array<number|object>|undefined} series The series.
19753
+ * @return {number|null} The total, or null for no series.
19754
+ * @spec openspec/changes/widget-data-event/specs/widget-data-event/spec.md#requirement-a-self-fetching-widget-tells-its-host-what-it-shows
19755
+ */
19756
+ function seriesTotal(series) {
19757
+ if (!Array.isArray(series) || series.length === 0) {
19758
+ return null
19759
+ }
19760
+ const values = typeof series[0] === 'object' && series[0] !== null ? series[0].data : series;
19761
+ if (!Array.isArray(values)) {
19762
+ return null
19763
+ }
19764
+ return values.reduce((sum, value) => {
19765
+ const number = typeof value === 'object' && value !== null ? Number(value.y) : Number(value);
19766
+ return Number.isFinite(number) ? sum + number : sum
19767
+ }, 0)
19768
+ }
19769
+
19703
19770
  /**
19704
19771
  * SPDX-FileCopyrightText: 2026 Conduction B.V.
19705
19772
  * SPDX-License-Identifier: EUPL-1.2
@@ -26675,6 +26742,8 @@ var script$9b = {
26675
26742
 
26676
26743
  components: { CnEndpointNotice: __sfc_main$96, NcNoteCard: vue.NcNoteCard },
26677
26744
 
26745
+ mixins: [widgetData],
26746
+
26678
26747
  inject: {
26679
26748
  /**
26680
26749
  * Reactive date-range provided by an ancestor `CnDashboardPage`.
@@ -27424,6 +27493,24 @@ var script$9b = {
27424
27493
  return fromDs !== undefined ? fromDs : this.series
27425
27494
  },
27426
27495
 
27496
+ /**
27497
+ * What the chart shows, for the `data` event: its series, categories,
27498
+ * labels and the total of its first series; null until it has a series.
27499
+ *
27500
+ * @return {{series: Array, categories: Array, labels: Array, total: number|null}|null}
27501
+ * @spec openspec/changes/widget-data-event/specs/widget-data-event/spec.md#requirement-a-self-fetching-widget-tells-its-host-what-it-shows
27502
+ */
27503
+ widgetData() {
27504
+ const series = this.resolvedSeries;
27505
+ if (!Array.isArray(series) || series.length === 0) {
27506
+ return null
27507
+ }
27508
+ const categories = Array.isArray(this.resolvedCategories) ? this.resolvedCategories : [];
27509
+ const rest = this.aggregateData || this.bucketData || this.groupByData;
27510
+ const labels = Array.isArray(rest?.labels) ? rest.labels : (Array.isArray(this.labels) ? this.labels : categories);
27511
+ return { series, categories, labels, total: seriesTotal(series) }
27512
+ },
27513
+
27427
27514
  resolvedCategories() {
27428
27515
  if (this.cellData) {
27429
27516
  return this.cellData.categories
@@ -29488,7 +29575,7 @@ function render$99(_ctx, _cache, $props, $setup, $data, $options) {
29488
29575
  }
29489
29576
 
29490
29577
  script$9b.render = render$99;
29491
- script$9b.__scopeId = "data-v-1fd46864";
29578
+ script$9b.__scopeId = "data-v-03a0a5bc";
29492
29579
  const __sfc_main$95 = script$9b;
29493
29580
 
29494
29581
  /**
@@ -189909,6 +189996,8 @@ var script$6o = {
189909
189996
 
189910
189997
  components: { CnStatsBlock: __sfc_main$6k, CnStatWidget: __sfc_main$6j },
189911
189998
 
189999
+ mixins: [widgetData],
190000
+
189912
190001
  inject: {
189913
190002
  /**
189914
190003
  * Detail-page object context provided by CnDetailPage — enables
@@ -190374,6 +190463,23 @@ var script$6o = {
190374
190463
  })))
190375
190464
  },
190376
190465
 
190466
+ /**
190467
+ * What the widget shows, for the `data` event: the count of a single
190468
+ * source, or every entry's count; null until a count is known.
190469
+ *
190470
+ * @return {{count: number}|{counts: Array<number|null>}|null}
190471
+ * @spec openspec/changes/widget-data-event/specs/widget-data-event/spec.md#requirement-a-self-fetching-widget-tells-its-host-what-it-shows
190472
+ */
190473
+ widgetData() {
190474
+ if (this.hasEntries) {
190475
+ return this.entryFetching.some(Boolean) || this.entryCounts.length === 0 ? null : { counts: [...this.entryCounts] }
190476
+ }
190477
+ if (typeof this.restCount === 'number' || this.dsData?.count !== undefined) {
190478
+ return { count: this.resolvedCount }
190479
+ }
190480
+ return null
190481
+ },
190482
+
190377
190483
  resolvedCount() {
190378
190484
  if (typeof this.restCount === 'number') {
190379
190485
  return this.restCount
@@ -190744,7 +190850,7 @@ function render$6m(_ctx, _cache, $props, $setup, $data, $options) {
190744
190850
  }
190745
190851
 
190746
190852
  script$6o.render = render$6m;
190747
- script$6o.__scopeId = "data-v-4341e971";
190853
+ script$6o.__scopeId = "data-v-23816a8e";
190748
190854
  const __sfc_main$6i = script$6o;
190749
190855
 
190750
190856
  const DEFAULT_CONTENT$p = Object.freeze({
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/nextcloud-vue.cjs.js.map
3
- size: 53756679 bytes
4
- sha256: 504642566e85d8556b1f782e1ff66647a0a2e0cb1b346e17a73f7a0402363aea
3
+ size: 53764950 bytes
4
+ sha256: 9d79106eadd9b97d063d110f8fc759b7f4cd4087d863cd49b781631cf890a89d