@conduction/nextcloud-vue 2.164.0 → 2.165.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.
- package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue.js +1 -1
- package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue2.js.map +1 -1
- package/dist/esm/components/CnLinkCardsPage/CnLinkCardsPage.vue3.js.map +1 -1
- package/dist/esm/components/CnMailTab/CnMailTab.vue.js +1 -1
- package/dist/esm/components/CnMailTab/CnMailTab.vue2.js +43 -2
- package/dist/esm/components/CnMailTab/CnMailTab.vue2.js.map +1 -1
- package/dist/esm/components/CnMailTab/CnMailTab.vue3.js.map +1 -1
- package/dist/esm/components/CnModuleCard/CnModuleCard.vue.js +1 -1
- package/dist/esm/components/CnModuleCard/CnModuleCard.vue2.js.map +1 -1
- package/dist/esm/components/CnModuleCard/CnModuleCard.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js +7 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectDataWidget/CnObjectDataWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue.js +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js +49 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnStatWidget/CnStatWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue.js +1 -1
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js +48 -8
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js +33 -31
- package/dist/esm/components/CnWeekStripWidget/CnWeekStripWidget.vue3.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +203 -178
- package/dist/esm/utils/filterRangeLabel.js +5 -3
- package/dist/esm/utils/filterRangeLabel.js.map +1 -1
- package/dist/esm/utils/validateManifestV2.compiled.js +3 -3
- package/dist/esm/utils/validateManifestV2.compiled.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +303 -165
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +203 -178
- package/package.json +1 -1
- package/src/components/CnLinkCardsPage/CnLinkCardsPage.vue +4 -0
- package/src/components/CnMailTab/CnMailTab.vue +43 -2
- package/src/components/CnModuleCard/CnModuleCard.vue +4 -0
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +7 -1
- package/src/components/CnStatWidget/CnStatWidget.vue +49 -1
- package/src/components/CnWeekStripWidget/CnWeekStripWidget.vue +60 -9
- package/src/css/look-board-detail.css +12 -5
- package/src/schemas/app-manifest-v2.schema.json +5 -3
- package/src/utils/filterRangeLabel.js +5 -3
- package/src/utils/validateManifestV2.compiled.js +3 -3
|
@@ -2,7 +2,7 @@ import script from './CnStatWidget.vue2.js';
|
|
|
2
2
|
import { render } from './CnStatWidget.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-7953f166";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -12,6 +12,7 @@ import { normalizeLook } from '../../composables/useLook.js';
|
|
|
12
12
|
import widgetLink from '../../mixins/widgetLink.js';
|
|
13
13
|
import { useObjectStore } from '../../store/useObjectStore.js';
|
|
14
14
|
import { resolveObjectOpType } from '../../utils/actionsDispatcher.js';
|
|
15
|
+
import { daysUntil } from '../../utils/dateVariant.js';
|
|
15
16
|
import { resolveObjectTokenContext } from '../../utils/detailObjectContext.js';
|
|
16
17
|
import { aggFilterParam } from '../../utils/fetchAggregate.js';
|
|
17
18
|
import { needsListEndpoint, fetchListTotal } from '../../utils/fetchFilterCounts.js';
|
|
@@ -1873,7 +1874,9 @@ var script = {
|
|
|
1873
1874
|
this.captionRatioParts = { num: num === undefined ? null : num, den };
|
|
1874
1875
|
return
|
|
1875
1876
|
}
|
|
1876
|
-
const found =
|
|
1877
|
+
const found = own.metric === 'daysSinceEarliest'
|
|
1878
|
+
? await this.fetchDaysSinceEarliest(axios, generateUrl, source, own.field, own.filter || {})
|
|
1879
|
+
: await this.fetchAggregate(axios, generateUrl, source, own.metric, own.field, own.filter || {}, own.via);
|
|
1877
1880
|
this.captionValue = found === null || found === undefined || Number.isNaN(Number(found)) ? null : Number(found);
|
|
1878
1881
|
} catch {
|
|
1879
1882
|
this.captionValue = null;
|
|
@@ -1881,6 +1884,51 @@ var script = {
|
|
|
1881
1884
|
}
|
|
1882
1885
|
},
|
|
1883
1886
|
|
|
1887
|
+
/**
|
|
1888
|
+
* The whole days from the earliest `field` date among the matching
|
|
1889
|
+
* records to today (`captionSource.metric: "daysSinceEarliest"`):
|
|
1890
|
+
* "longest: 9 days" over the days since each case entered its status.
|
|
1891
|
+
* One list read, ordered by the field, of the first record that has
|
|
1892
|
+
* it. 0 when no record matches, null when the date cannot be read.
|
|
1893
|
+
*
|
|
1894
|
+
* @spec openspec/changes/stat-caption-days-since-earliest/specs/stat-caption-days-since-earliest/spec.md#requirement-a-stat-caption-can-count-the-days-since-the-earliest-date
|
|
1895
|
+
* @param {object} axios The axios instance.
|
|
1896
|
+
* @param {(url: string, params?: object) => string} generateUrl The router helper.
|
|
1897
|
+
* @param {object} s The source (register/schema).
|
|
1898
|
+
* @param {string} field The date field.
|
|
1899
|
+
* @param {object} filter The filter map.
|
|
1900
|
+
* @return {Promise<number|null>} The days, or null.
|
|
1901
|
+
*/
|
|
1902
|
+
async fetchDaysSinceEarliest(axios, generateUrl, s, field, filter) {
|
|
1903
|
+
if (typeof field !== 'string' || field === '') {
|
|
1904
|
+
return null
|
|
1905
|
+
}
|
|
1906
|
+
const params = {};
|
|
1907
|
+
for (const [key, value] of Object.entries(this.resolveSourceFilter(filter))) {
|
|
1908
|
+
if (value === null) {
|
|
1909
|
+
params[`${key}[isnull]`] = 'true';
|
|
1910
|
+
} else if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
1911
|
+
for (const [op, operand] of Object.entries(value)) {
|
|
1912
|
+
params[`${key}[${op}]`] = operand;
|
|
1913
|
+
}
|
|
1914
|
+
} else if (value !== '' && value !== undefined) {
|
|
1915
|
+
params[key] = value;
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
params[`${field}[isnull]`] = 'false';
|
|
1919
|
+
params[`_order[${field}]`] = 'asc';
|
|
1920
|
+
params._limit = 1;
|
|
1921
|
+
const url = generateUrl('/apps/openregister/api/objects/{register}/{schema}', { register: s.register, schema: s.schema });
|
|
1922
|
+
const res = await axios.get(url, { params });
|
|
1923
|
+
const first = Array.isArray(res?.data?.results) ? res.data.results[0] : undefined;
|
|
1924
|
+
if (!first) {
|
|
1925
|
+
return 0
|
|
1926
|
+
}
|
|
1927
|
+
const raw = first[field] !== undefined ? first[field] : first['@self']?.[field];
|
|
1928
|
+
const days = daysUntil(raw, new Date());
|
|
1929
|
+
return days === null ? null : Math.max(0, -days)
|
|
1930
|
+
},
|
|
1931
|
+
|
|
1884
1932
|
/**
|
|
1885
1933
|
* Read the limit's own count (`content.limitSource`: `{ register?,
|
|
1886
1934
|
* schema?, metric?, field?, filter?, via? }`, register and schema
|