@conduction/nextcloud-vue 2.182.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.
Files changed (27) hide show
  1. package/dist/esm/components/CnChartWidget/CnChartWidget.vue.js +1 -1
  2. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js +21 -0
  3. package/dist/esm/components/CnChartWidget/CnChartWidget2.vue.js.map +1 -1
  4. package/dist/esm/components/CnChartWidget/CnChartWidget3.vue.js.map +1 -1
  5. package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
  6. package/dist/esm/components/CnMapWidget/CnMapWidget2.vue.js +36 -7
  7. package/dist/esm/components/CnMapWidget/CnMapWidget2.vue.js.map +1 -1
  8. package/dist/esm/components/CnMapWidget/CnMapWidget3.vue.js.map +1 -1
  9. package/dist/esm/components/CnMapWidget/spatialFilter.js +136 -0
  10. package/dist/esm/components/CnMapWidget/spatialFilter.js.map +1 -0
  11. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget.vue.js +1 -1
  12. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget2.vue.js +20 -0
  13. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget2.vue.js.map +1 -1
  14. package/dist/esm/components/CnStatsBlockWidget/CnStatsBlockWidget3.vue.js.map +1 -1
  15. package/dist/esm/library-style.js +1 -1
  16. package/dist/esm/mixins/widgetData.js +69 -0
  17. package/dist/esm/mixins/widgetData.js.map +1 -0
  18. package/dist/esm/nextcloud-vue.css +112 -112
  19. package/dist/nextcloud-vue.cjs.js +275 -10
  20. package/dist/nextcloud-vue.cjs.js.map +2 -2
  21. package/dist/nextcloud-vue.css +112 -112
  22. package/package.json +1 -1
  23. package/src/components/CnChartWidget/CnChartWidget.vue +21 -0
  24. package/src/components/CnMapWidget/CnMapWidget.vue +41 -7
  25. package/src/components/CnMapWidget/spatialFilter.js +132 -0
  26. package/src/components/CnStatsBlockWidget/CnStatsBlockWidget.vue +20 -0
  27. package/src/mixins/widgetData.js +66 -0
@@ -2,7 +2,7 @@ import script from './CnChartWidget2.vue.js';
2
2
  import { render } from './CnChartWidget3.vue.js';
3
3
 
4
4
  script.render = render;
5
- script.__scopeId = "data-v-1fd46864";
5
+ script.__scopeId = "data-v-03a0a5bc";
6
6
  const __sfc_main = script;
7
7
 
8
8
  export { __sfc_main as default };
@@ -5,6 +5,7 @@ import { markRaw, inject, ref } from 'vue';
5
5
  import m from '../../node_modules/vue3-apexcharts/dist/vue3-apexcharts.js';
6
6
  import { useDataSource } from '../../composables/useDataSource.js';
7
7
  import { getByPath, useEndpointSource } from '../../composables/useEndpointSource.js';
8
+ import widgetData, { seriesTotal } from '../../mixins/widgetData.js';
8
9
  import { useObjectStore } from '../../store/useObjectStore.js';
9
10
  import { resolveObjectOpType } from '../../utils/actionsDispatcher.js';
10
11
  import { fetchReferenceObjects } from '../../utils/boardReferenceColumns.js';
@@ -261,6 +262,8 @@ var script = {
261
262
 
262
263
  components: { CnEndpointNotice: __sfc_main, NcNoteCard },
263
264
 
265
+ mixins: [widgetData],
266
+
264
267
  inject: {
265
268
  /**
266
269
  * Reactive date-range provided by an ancestor `CnDashboardPage`.
@@ -1010,6 +1013,24 @@ var script = {
1010
1013
  return fromDs !== undefined ? fromDs : this.series
1011
1014
  },
1012
1015
 
1016
+ /**
1017
+ * What the chart shows, for the `data` event: its series, categories,
1018
+ * labels and the total of its first series; null until it has a series.
1019
+ *
1020
+ * @return {{series: Array, categories: Array, labels: Array, total: number|null}|null}
1021
+ * @spec openspec/changes/widget-data-event/specs/widget-data-event/spec.md#requirement-a-self-fetching-widget-tells-its-host-what-it-shows
1022
+ */
1023
+ widgetData() {
1024
+ const series = this.resolvedSeries;
1025
+ if (!Array.isArray(series) || series.length === 0) {
1026
+ return null
1027
+ }
1028
+ const categories = Array.isArray(this.resolvedCategories) ? this.resolvedCategories : [];
1029
+ const rest = this.aggregateData || this.bucketData || this.groupByData;
1030
+ const labels = Array.isArray(rest?.labels) ? rest.labels : (Array.isArray(this.labels) ? this.labels : categories);
1031
+ return { series, categories, labels, total: seriesTotal(series) }
1032
+ },
1033
+
1013
1034
  resolvedCategories() {
1014
1035
  if (this.cellData) {
1015
1036
  return this.cellData.categories