@conduction/nextcloud-vue 2.152.0 → 2.153.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/CnConversationThread/CnConversationThread.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js +2 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js +33 -25
- package/dist/esm/components/CnConversationThread/CnConversationThread.vue3.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue.js +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js +22 -2
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnConversationThread/CnConversationWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +21 -3
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue3.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue.js +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js +20 -0
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnMapWidget/CnMapWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue.js +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnNotificationMatrix/CnNotificationMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue.js +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js +18 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js +4 -2
- package/dist/esm/components/CnPlanWidget/CnPlanWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue.js +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js +25 -3
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue2.js.map +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js +1 -1
- package/dist/esm/components/CnPlanWidget/CnPlanWidgetRow.vue3.js.map +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue.js +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue2.js.map +1 -1
- package/dist/esm/components/CnStepper/CnStepper.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +19 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +20 -2
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +237 -125
- package/dist/esm/utils/fillTemplate.js +12 -2
- package/dist/esm/utils/fillTemplate.js.map +1 -1
- package/dist/esm/utils/savedViewSummary.js +109 -4
- package/dist/esm/utils/savedViewSummary.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +681 -424
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +237 -125
- package/l10n/en.json +19 -1
- package/l10n/nl.json +20 -2
- package/package.json +1 -1
- package/src/components/CnConversationThread/CnConversationThread.vue +7 -1
- package/src/components/CnConversationThread/CnConversationWidget.vue +22 -2
- package/src/components/CnIndexPage/CnIndexPage.vue +21 -3
- package/src/components/CnMapWidget/CnMapWidget.vue +20 -0
- package/src/components/CnNotificationMatrix/CnNotificationMatrix.vue +23 -0
- package/src/components/CnPlanWidget/CnPlanWidget.vue +20 -1
- package/src/components/CnPlanWidget/CnPlanWidgetRow.vue +26 -4
- package/src/components/CnStepper/CnStepper.vue +7 -5
- package/src/css/dialog.css +12 -0
- package/src/css/form-field.css +11 -0
- package/src/css/look-board-detail.css +28 -1
- package/src/css/look-board-index.css +21 -4
- package/src/css/look-board.css +20 -0
- package/src/utils/fillTemplate.js +12 -2
- package/src/utils/savedViewSummary.js +109 -4
|
@@ -3638,7 +3638,13 @@ var translations$s = {
|
|
|
3638
3638
|
Briefcase: "Briefcase",
|
|
3639
3639
|
Eye: "Eye",
|
|
3640
3640
|
Euro: "Euro",
|
|
3641
|
-
Ready: "Ready"
|
|
3641
|
+
Ready: "Ready",
|
|
3642
|
+
"Map layers": "Map layers",
|
|
3643
|
+
you: "you",
|
|
3644
|
+
"my team": "my team",
|
|
3645
|
+
"Subject: {subject}": "Subject: {subject}",
|
|
3646
|
+
Optional: "Optional",
|
|
3647
|
+
Reached: "Reached"
|
|
3642
3648
|
};
|
|
3643
3649
|
var plurals$1 = {
|
|
3644
3650
|
"{count} member": [
|
|
@@ -3847,6 +3853,18 @@ var plurals$1 = {
|
|
|
3847
3853
|
"{names} has no location, so it is not on the map.": [
|
|
3848
3854
|
"{names} has no location, so it is not on the map.",
|
|
3849
3855
|
"{names} have no location, so they are not on the map."
|
|
3856
|
+
],
|
|
3857
|
+
"in %n day": [
|
|
3858
|
+
"in %n day",
|
|
3859
|
+
"in %n days"
|
|
3860
|
+
],
|
|
3861
|
+
"%n day ago": [
|
|
3862
|
+
"%n day ago",
|
|
3863
|
+
"%n days ago"
|
|
3864
|
+
],
|
|
3865
|
+
"%n attachment": [
|
|
3866
|
+
"%n attachment",
|
|
3867
|
+
"%n attachments"
|
|
3850
3868
|
]
|
|
3851
3869
|
};
|
|
3852
3870
|
var en = {
|
|
@@ -4157,7 +4175,7 @@ var translations$c = {
|
|
|
4157
4175
|
Advanced: "Geavanceerd",
|
|
4158
4176
|
"The item could not be created.": "Het item kon niet worden aangemaakt.",
|
|
4159
4177
|
"Start over": "Opnieuw beginnen",
|
|
4160
|
-
"Continue where you left off": "
|
|
4178
|
+
"Continue where you left off": "Verder met de rondleiding",
|
|
4161
4179
|
Active: "Actief",
|
|
4162
4180
|
Appraisal: "Waardering",
|
|
4163
4181
|
Archiving: "Archivering",
|
|
@@ -6688,7 +6706,13 @@ var translations$c = {
|
|
|
6688
6706
|
Briefcase: "Koffer",
|
|
6689
6707
|
Eye: "Oog",
|
|
6690
6708
|
Euro: "Euro",
|
|
6691
|
-
Ready: "Gereed"
|
|
6709
|
+
Ready: "Gereed",
|
|
6710
|
+
"Map layers": "Kaartlagen",
|
|
6711
|
+
you: "jij",
|
|
6712
|
+
"my team": "mijn team",
|
|
6713
|
+
"Subject: {subject}": "Onderwerp: {subject}",
|
|
6714
|
+
Optional: "Optioneel",
|
|
6715
|
+
Reached: "Bereikt"
|
|
6692
6716
|
};
|
|
6693
6717
|
var plurals = {
|
|
6694
6718
|
"{count} member": [
|
|
@@ -6914,6 +6938,18 @@ var plurals = {
|
|
|
6914
6938
|
"{names} has no location, so it is not on the map.": [
|
|
6915
6939
|
"{names} heeft geen locatie, dus staat niet op de kaart.",
|
|
6916
6940
|
"{names} hebben geen locatie, dus staan ze niet op de kaart."
|
|
6941
|
+
],
|
|
6942
|
+
"in %n day": [
|
|
6943
|
+
"over %n dag",
|
|
6944
|
+
"over %n dagen"
|
|
6945
|
+
],
|
|
6946
|
+
"%n day ago": [
|
|
6947
|
+
"%n dag geleden",
|
|
6948
|
+
"%n dagen geleden"
|
|
6949
|
+
],
|
|
6950
|
+
"%n attachment": [
|
|
6951
|
+
"%n bijlage",
|
|
6952
|
+
"%n bijlagen"
|
|
6917
6953
|
]
|
|
6918
6954
|
};
|
|
6919
6955
|
var nl = {
|
|
@@ -29772,7 +29808,7 @@ var script$8r = {
|
|
|
29772
29808
|
|
|
29773
29809
|
props: {
|
|
29774
29810
|
/**
|
|
29775
|
-
* The messages, oldest first: `{ id?, author?, time?, text, side?, channel?, channelIcon?, status?, actions?, note? }`.
|
|
29811
|
+
* The messages, oldest first: `{ id?, author?, time?, text, side?, channel?, channelIcon?, status?, subject?, actions?, note? }`.
|
|
29776
29812
|
* `status` is shown after the channel ("Failed"); `actions` are
|
|
29777
29813
|
* `{ id, label, disabled? }` buttons under the text, each emitting
|
|
29778
29814
|
* `message-action`.
|
|
@@ -29958,6 +29994,7 @@ var script$8r = {
|
|
|
29958
29994
|
channel: typeof message.channel === 'string' ? message.channel : '',
|
|
29959
29995
|
channelIcon: typeof message.channelIcon === 'string' ? message.channelIcon : '',
|
|
29960
29996
|
status: typeof message.status === 'string' ? message.status : '',
|
|
29997
|
+
subjectLine: typeof message.subject === 'string' && message.subject !== '' ? l10n.translate('nextcloud-vue', 'Subject: {subject}', { subject: message.subject }) : '',
|
|
29961
29998
|
actions: Array.isArray(message.actions) ? message.actions.filter((action) => action && action.id && action.label) : [],
|
|
29962
29999
|
directionLabel: side === 'us' ? l10n.translate('nextcloud-vue', 'Sent message') : l10n.translate('nextcloud-vue', 'Received message'),
|
|
29963
30000
|
directionWord: side === 'us' ? l10n.translate('nextcloud-vue', 'Outgoing') : l10n.translate('nextcloud-vue', 'Incoming'),
|
|
@@ -30224,33 +30261,38 @@ const _hoisted_18$1t = {
|
|
|
30224
30261
|
"aria-hidden": "true"
|
|
30225
30262
|
};
|
|
30226
30263
|
const _hoisted_19$1n = ["datetime"];
|
|
30227
|
-
const _hoisted_20$1d = {
|
|
30228
|
-
const _hoisted_21$1b = {
|
|
30264
|
+
const _hoisted_20$1d = {
|
|
30229
30265
|
key: 0,
|
|
30230
|
-
class: "cn-conversation-
|
|
30231
|
-
"data-testid": "cn-conversation-
|
|
30266
|
+
class: "cn-conversation-thread__subject",
|
|
30267
|
+
"data-testid": "cn-conversation-subject"
|
|
30232
30268
|
};
|
|
30269
|
+
const _hoisted_21$1b = { class: "cn-conversation-thread__text" };
|
|
30233
30270
|
const _hoisted_22$1a = {
|
|
30234
30271
|
key: 1,
|
|
30272
|
+
class: "cn-conversation-thread__note",
|
|
30273
|
+
"data-testid": "cn-conversation-note"
|
|
30274
|
+
};
|
|
30275
|
+
const _hoisted_23$11 = {
|
|
30276
|
+
key: 2,
|
|
30235
30277
|
class: "cn-conversation-thread__message-actions"
|
|
30236
30278
|
};
|
|
30237
|
-
const
|
|
30238
|
-
const
|
|
30239
|
-
const
|
|
30279
|
+
const _hoisted_24$U = { class: "cn-conversation-thread__reply-head" };
|
|
30280
|
+
const _hoisted_25$O = ["for"];
|
|
30281
|
+
const _hoisted_26$I = {
|
|
30240
30282
|
key: 0,
|
|
30241
30283
|
class: "cn-conversation-thread__reply-hint",
|
|
30242
30284
|
"data-testid": "cn-conversation-reply-hint"
|
|
30243
30285
|
};
|
|
30244
|
-
const
|
|
30245
|
-
const
|
|
30246
|
-
const
|
|
30247
|
-
const
|
|
30286
|
+
const _hoisted_27$A = ["id", "placeholder", "disabled", "aria-describedby"];
|
|
30287
|
+
const _hoisted_28$y = ["id"];
|
|
30288
|
+
const _hoisted_29$x = { class: "cn-conversation-thread__reply-foot" };
|
|
30289
|
+
const _hoisted_30$v = {
|
|
30248
30290
|
key: 0,
|
|
30249
30291
|
class: "cn-conversation-thread__reply-option",
|
|
30250
30292
|
"data-testid": "cn-conversation-reply-option"
|
|
30251
30293
|
};
|
|
30252
|
-
const
|
|
30253
|
-
const
|
|
30294
|
+
const _hoisted_31$u = ["disabled"];
|
|
30295
|
+
const _hoisted_32$s = { class: "cn-conversation-thread__reply-actions" };
|
|
30254
30296
|
|
|
30255
30297
|
function render$8q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
30256
30298
|
const _component_CnQuickFilterBar = vue$1.resolveComponent("CnQuickFilterBar");
|
|
@@ -30345,12 +30387,15 @@ function render$8q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
30345
30387
|
}, vue$1.toDisplayString(row.timeLabel), 9 /* TEXT, PROPS */, _hoisted_19$1n))
|
|
30346
30388
|
: vue$1.createCommentVNode("v-if", true)
|
|
30347
30389
|
]),
|
|
30348
|
-
|
|
30390
|
+
(row.subjectLine)
|
|
30391
|
+
? (vue$1.openBlock(), vue$1.createElementBlock("span", _hoisted_20$1d, vue$1.toDisplayString(row.subjectLine), 1 /* TEXT */))
|
|
30392
|
+
: vue$1.createCommentVNode("v-if", true),
|
|
30393
|
+
vue$1.createElementVNode("span", _hoisted_21$1b, vue$1.toDisplayString(row.text), 1 /* TEXT */),
|
|
30349
30394
|
(row.note)
|
|
30350
|
-
? (vue$1.openBlock(), vue$1.createElementBlock("span",
|
|
30395
|
+
? (vue$1.openBlock(), vue$1.createElementBlock("span", _hoisted_22$1a, vue$1.toDisplayString(row.note), 1 /* TEXT */))
|
|
30351
30396
|
: vue$1.createCommentVNode("v-if", true),
|
|
30352
30397
|
(row.actions.length > 0)
|
|
30353
|
-
? (vue$1.openBlock(), vue$1.createElementBlock("span",
|
|
30398
|
+
? (vue$1.openBlock(), vue$1.createElementBlock("span", _hoisted_23$11, [
|
|
30354
30399
|
(vue$1.openBlock(true), vue$1.createElementBlock(vue$1.Fragment, null, vue$1.renderList(row.actions, (action) => {
|
|
30355
30400
|
return (vue$1.openBlock(), vue$1.createBlock(_component_NcButton, {
|
|
30356
30401
|
key: action.id,
|
|
@@ -30379,13 +30424,13 @@ function render$8q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
30379
30424
|
onSubmit: _cache[4] || (_cache[4] = vue$1.withModifiers((...args) => ($options.onSend && $options.onSend(...args)), ["prevent"]))
|
|
30380
30425
|
}, [
|
|
30381
30426
|
vue$1.renderSlot(_ctx.$slots, "reply-tools", { setDraft: $options.setDraft }),
|
|
30382
|
-
vue$1.createElementVNode("div",
|
|
30427
|
+
vue$1.createElementVNode("div", _hoisted_24$U, [
|
|
30383
30428
|
vue$1.createElementVNode("label", {
|
|
30384
30429
|
for: $data.inputId,
|
|
30385
30430
|
class: "cn-conversation-thread__reply-label"
|
|
30386
|
-
}, vue$1.toDisplayString($props.replyLabel), 9 /* TEXT, PROPS */,
|
|
30431
|
+
}, vue$1.toDisplayString($props.replyLabel), 9 /* TEXT, PROPS */, _hoisted_25$O),
|
|
30387
30432
|
($props.replyHint)
|
|
30388
|
-
? (vue$1.openBlock(), vue$1.createElementBlock("span",
|
|
30433
|
+
? (vue$1.openBlock(), vue$1.createElementBlock("span", _hoisted_26$I, vue$1.toDisplayString($props.replyHint), 1 /* TEXT */))
|
|
30389
30434
|
: vue$1.createCommentVNode("v-if", true)
|
|
30390
30435
|
]),
|
|
30391
30436
|
vue$1.withDirectives(vue$1.createElementVNode("textarea", {
|
|
@@ -30401,7 +30446,7 @@ function render$8q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
30401
30446
|
_cache[1] || (_cache[1] = vue$1.withKeys(vue$1.withModifiers((...args) => ($options.onSend && $options.onSend(...args)), ["ctrl","prevent"]), ["enter"])),
|
|
30402
30447
|
_cache[2] || (_cache[2] = vue$1.withKeys(vue$1.withModifiers((...args) => ($options.onSend && $options.onSend(...args)), ["meta","prevent"]), ["enter"]))
|
|
30403
30448
|
]
|
|
30404
|
-
}, null, 40 /* PROPS, NEED_HYDRATION */,
|
|
30449
|
+
}, null, 40 /* PROPS, NEED_HYDRATION */, _hoisted_27$A), [
|
|
30405
30450
|
[vue$1.vModelText, $data.draft]
|
|
30406
30451
|
]),
|
|
30407
30452
|
($data.errorMessage)
|
|
@@ -30411,22 +30456,22 @@ function render$8q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
30411
30456
|
class: "cn-conversation-thread__error",
|
|
30412
30457
|
role: "alert",
|
|
30413
30458
|
"data-testid": "cn-conversation-error"
|
|
30414
|
-
}, vue$1.toDisplayString($data.errorMessage), 9 /* TEXT, PROPS */,
|
|
30459
|
+
}, vue$1.toDisplayString($data.errorMessage), 9 /* TEXT, PROPS */, _hoisted_28$y))
|
|
30415
30460
|
: vue$1.createCommentVNode("v-if", true),
|
|
30416
|
-
vue$1.createElementVNode("div",
|
|
30461
|
+
vue$1.createElementVNode("div", _hoisted_29$x, [
|
|
30417
30462
|
($options.optionShown)
|
|
30418
|
-
? (vue$1.openBlock(), vue$1.createElementBlock("label",
|
|
30463
|
+
? (vue$1.openBlock(), vue$1.createElementBlock("label", _hoisted_30$v, [
|
|
30419
30464
|
vue$1.withDirectives(vue$1.createElementVNode("input", {
|
|
30420
30465
|
"onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (($data.optionOn) = $event)),
|
|
30421
30466
|
type: "checkbox",
|
|
30422
30467
|
disabled: $data.sending
|
|
30423
|
-
}, null, 8 /* PROPS */,
|
|
30468
|
+
}, null, 8 /* PROPS */, _hoisted_31$u), [
|
|
30424
30469
|
[vue$1.vModelCheckbox, $data.optionOn]
|
|
30425
30470
|
]),
|
|
30426
30471
|
vue$1.createElementVNode("span", null, vue$1.toDisplayString($props.replyOption.label), 1 /* TEXT */)
|
|
30427
30472
|
]))
|
|
30428
30473
|
: vue$1.createCommentVNode("v-if", true),
|
|
30429
|
-
vue$1.createElementVNode("div",
|
|
30474
|
+
vue$1.createElementVNode("div", _hoisted_32$s, [
|
|
30430
30475
|
vue$1.renderSlot(_ctx.$slots, "reply-actions", { draft: $data.draft }),
|
|
30431
30476
|
vue$1.createVNode(_component_NcButton, {
|
|
30432
30477
|
variant: "primary",
|
|
@@ -30450,7 +30495,7 @@ function render$8q(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
30450
30495
|
}
|
|
30451
30496
|
|
|
30452
30497
|
script$8r.render = render$8q;
|
|
30453
|
-
script$8r.__scopeId = "data-v-
|
|
30498
|
+
script$8r.__scopeId = "data-v-b96e5732";
|
|
30454
30499
|
const __sfc_main$8l = script$8r;
|
|
30455
30500
|
|
|
30456
30501
|
/**
|
|
@@ -30719,6 +30764,9 @@ function userDisplayName(uid) {
|
|
|
30719
30764
|
* `outValue`) for the messages the organisation sent, and `channelField` with
|
|
30720
30765
|
* an optional `channelMap` from stored value to label ("email" to "E-mail")
|
|
30721
30766
|
* and `channelIcons` from stored value to an icon name, drawn before the label.
|
|
30767
|
+
* `subjectField` shows a message's subject on a line of its own above its
|
|
30768
|
+
* text ("Subject: ..."); `noteField` a grey line under it, followed by the
|
|
30769
|
+
* count `attachmentCountField` holds ("1 attachment").
|
|
30722
30770
|
*
|
|
30723
30771
|
* The reply box posts to `endpoint` (`@objectId` filled in), or runs
|
|
30724
30772
|
* `replyAction`, an action descriptor the app decides the meaning of: it is
|
|
@@ -30915,7 +30963,8 @@ var script$8q = {
|
|
|
30915
30963
|
return {
|
|
30916
30964
|
id: key,
|
|
30917
30965
|
author: this.authorOf(message, sideOf),
|
|
30918
|
-
|
|
30966
|
+
subject: c.subjectField ? this.textOf(readPath$8(message, c.subjectField)) : '',
|
|
30967
|
+
note: this.noteOf(message),
|
|
30919
30968
|
time: readPath$8(message, c.timestampField || c.timeField || 'time'),
|
|
30920
30969
|
text: readPath$8(message, c.bodyField || c.textField || 'text'),
|
|
30921
30970
|
side: sideOf,
|
|
@@ -31302,6 +31351,22 @@ var script$8q = {
|
|
|
31302
31351
|
return format === 'user' && text !== '' ? (userDisplayName(text) || text) : text
|
|
31303
31352
|
},
|
|
31304
31353
|
|
|
31354
|
+
/**
|
|
31355
|
+
* The grey line under a message: its note, then its attachment count,
|
|
31356
|
+
* joined with a comma ("Binnengekomen op het Woo-postvak, 1 bijlage").
|
|
31357
|
+
*
|
|
31358
|
+
* @param {object} message The stored message.
|
|
31359
|
+
* @return {string} The line, or '' when it has neither.
|
|
31360
|
+
* @spec openspec/changes/conversation-subject-attachments/specs/conversation-subject-attachments/spec.md#requirement-a-message-can-show-its-subject-note-and-attachment-count
|
|
31361
|
+
*/
|
|
31362
|
+
noteOf(message) {
|
|
31363
|
+
const c = this.content || {};
|
|
31364
|
+
const note = c.noteField ? this.textOf(readPath$8(message, c.noteField)) : '';
|
|
31365
|
+
const count = c.attachmentCountField ? Number(readPath$8(message, c.attachmentCountField)) : 0;
|
|
31366
|
+
const attachments = Number.isFinite(count) && count > 0 ? l10n.translatePlural('nextcloud-vue', '%n attachment', '%n attachments', count) : '';
|
|
31367
|
+
return [note, attachments].filter((part) => part !== '').join(', ')
|
|
31368
|
+
},
|
|
31369
|
+
|
|
31305
31370
|
/**
|
|
31306
31371
|
* @param {unknown} value A stored value.
|
|
31307
31372
|
* @return {string} It as text, or '' for none.
|
|
@@ -31579,7 +31644,7 @@ function render$8p(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
31579
31644
|
}
|
|
31580
31645
|
|
|
31581
31646
|
script$8q.render = render$8p;
|
|
31582
|
-
script$8q.__scopeId = "data-v-
|
|
31647
|
+
script$8q.__scopeId = "data-v-50a6dc5e";
|
|
31583
31648
|
const __sfc_main$8k = script$8q;
|
|
31584
31649
|
|
|
31585
31650
|
/**
|
|
@@ -39999,9 +40064,29 @@ var script$8f = {
|
|
|
39999
40064
|
// The board look keeps the top right for its control column.
|
|
40000
40065
|
this.layersControl = L.control.layers(baseLayers, {}, { position: this.isBoardLook ? 'topleft' : 'topright' });
|
|
40001
40066
|
this.layersControl.addTo(this.map);
|
|
40067
|
+
this.labelLayersToggle();
|
|
40002
40068
|
}
|
|
40003
40069
|
},
|
|
40004
40070
|
|
|
40071
|
+
/**
|
|
40072
|
+
* Name the base-map switch in the user's language: Leaflet titles its
|
|
40073
|
+
* toggle "Layers" and gives it no accessible name of its own.
|
|
40074
|
+
*
|
|
40075
|
+
* @spec openspec/changes/board-map-layers-button/specs/board-map-layers-button/spec.md#requirement-the-base-map-switch-is-a-named-board-button
|
|
40076
|
+
*/
|
|
40077
|
+
labelLayersToggle() {
|
|
40078
|
+
const container = this.layersControl && typeof this.layersControl.getContainer === 'function'
|
|
40079
|
+
? this.layersControl.getContainer()
|
|
40080
|
+
: null;
|
|
40081
|
+
const toggle = container ? container.querySelector('.leaflet-control-layers-toggle') : null;
|
|
40082
|
+
if (!toggle) {
|
|
40083
|
+
return
|
|
40084
|
+
}
|
|
40085
|
+
const label = l10n.translate('nextcloud-vue', 'Map layers');
|
|
40086
|
+
toggle.setAttribute('title', label);
|
|
40087
|
+
toggle.setAttribute('aria-label', label);
|
|
40088
|
+
},
|
|
40089
|
+
|
|
40005
40090
|
/**
|
|
40006
40091
|
* Mount the custom control bar (fit-all / locate / fullscreen). Leaflet's own
|
|
40007
40092
|
* zoom + attribution controls are enabled separately in `initMap`; in the
|
|
@@ -40465,7 +40550,7 @@ function render$8e(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
40465
40550
|
}
|
|
40466
40551
|
|
|
40467
40552
|
script$8f.render = render$8e;
|
|
40468
|
-
script$8f.__scopeId = "data-v-
|
|
40553
|
+
script$8f.__scopeId = "data-v-6a02ff20";
|
|
40469
40554
|
const __sfc_main$89 = script$8f;
|
|
40470
40555
|
|
|
40471
40556
|
// The Netherlands, roughly — a sane default centre for a Dutch-government library.
|
|
@@ -41867,6 +41952,185 @@ function resolveCountPill(config, count, translate = (text) => text) {
|
|
|
41867
41952
|
}
|
|
41868
41953
|
}
|
|
41869
41954
|
|
|
41955
|
+
/**
|
|
41956
|
+
* Nextcloud group search for the schema-driven form's group picker
|
|
41957
|
+
* (a property marked `format: 'nc-group'` or `referenceType: 'nextcloud-group'`).
|
|
41958
|
+
*
|
|
41959
|
+
* Asks the core autocomplete OCS endpoint for groups first: every signed-in
|
|
41960
|
+
* user may call it, and it returns the group's display name. The provisioning
|
|
41961
|
+
* endpoint `cloud/groups` is the fallback; it also answers non-admins, but it
|
|
41962
|
+
* returns only group ids, so the id doubles as the label there.
|
|
41963
|
+
*
|
|
41964
|
+
* Options are `{ id: <gid>, label: <display name> }`: the form stores the gid.
|
|
41965
|
+
*
|
|
41966
|
+
* @module utils/groupAutocomplete
|
|
41967
|
+
*/
|
|
41968
|
+
|
|
41969
|
+
|
|
41970
|
+
const OCS_HEADERS$1 = {
|
|
41971
|
+
'OCS-APIRequest': 'true',
|
|
41972
|
+
Accept: 'application/json',
|
|
41973
|
+
};
|
|
41974
|
+
|
|
41975
|
+
/**
|
|
41976
|
+
* Read the `ocs.data` payload, tolerating a bare body.
|
|
41977
|
+
*
|
|
41978
|
+
* @param {object} response An axios response.
|
|
41979
|
+
* @return {unknown} The data.
|
|
41980
|
+
*/
|
|
41981
|
+
function ocsData$1(response) {
|
|
41982
|
+
const body = response && response.data;
|
|
41983
|
+
return body && body.ocs ? body.ocs.data : body
|
|
41984
|
+
}
|
|
41985
|
+
|
|
41986
|
+
/**
|
|
41987
|
+
* Map one autocomplete suggestion to an option, keeping only groups.
|
|
41988
|
+
*
|
|
41989
|
+
* @param {object} suggestion An autocomplete suggestion.
|
|
41990
|
+
* @return {{id: string, label: string}|null} The option, or null when it is not a group.
|
|
41991
|
+
*/
|
|
41992
|
+
function toGroupOption(suggestion) {
|
|
41993
|
+
if (!suggestion || typeof suggestion !== 'object') {
|
|
41994
|
+
return null
|
|
41995
|
+
}
|
|
41996
|
+
const isGroup = suggestion.source === 'groups'
|
|
41997
|
+
|| suggestion.shareType === 1
|
|
41998
|
+
|| (suggestion.value && suggestion.value.shareType === 1);
|
|
41999
|
+
if (!isGroup) {
|
|
42000
|
+
return null
|
|
42001
|
+
}
|
|
42002
|
+
const gid = suggestion.id || (suggestion.value && suggestion.value.shareWith);
|
|
42003
|
+
if (gid === undefined || gid === null || gid === '') {
|
|
42004
|
+
return null
|
|
42005
|
+
}
|
|
42006
|
+
return { id: String(gid), label: suggestion.label || String(gid) }
|
|
42007
|
+
}
|
|
42008
|
+
|
|
42009
|
+
/**
|
|
42010
|
+
* Search Nextcloud groups by name or id. Fails soft: an error yields `[]`.
|
|
42011
|
+
*
|
|
42012
|
+
* @spec openspec/changes/form-pickers-from-schema/specs/schema-utilities/spec.md
|
|
42013
|
+
* @param {string} [query] The search term (empty loads a first page).
|
|
42014
|
+
* @param {object} [options] Tuning options.
|
|
42015
|
+
* @param {number} [options.limit] Max results (default 25).
|
|
42016
|
+
* @return {Promise<Array<{id: string, label: string}>>} Picker options.
|
|
42017
|
+
*/
|
|
42018
|
+
async function searchNextcloudGroups(query = '', options = {}) {
|
|
42019
|
+
const { limit = 25 } = options;
|
|
42020
|
+
try {
|
|
42021
|
+
const response = await axios$1.get(router.generateOcsUrl('core/autocomplete/get'), {
|
|
42022
|
+
headers: OCS_HEADERS$1,
|
|
42023
|
+
params: {
|
|
42024
|
+
search: query || '',
|
|
42025
|
+
itemType: ' ',
|
|
42026
|
+
itemId: ' ',
|
|
42027
|
+
'shareTypes[]': 1,
|
|
42028
|
+
limit,
|
|
42029
|
+
},
|
|
42030
|
+
});
|
|
42031
|
+
const list = ocsData$1(response);
|
|
42032
|
+
const groups = (Array.isArray(list) ? list : [])
|
|
42033
|
+
.map(toGroupOption)
|
|
42034
|
+
.filter((opt) => opt !== null);
|
|
42035
|
+
if (groups.length > 0) {
|
|
42036
|
+
return groups
|
|
42037
|
+
}
|
|
42038
|
+
} catch {
|
|
42039
|
+
// Fall through to the provisioning endpoint.
|
|
42040
|
+
}
|
|
42041
|
+
try {
|
|
42042
|
+
const response = await axios$1.get(router.generateOcsUrl('cloud/groups'), {
|
|
42043
|
+
headers: OCS_HEADERS$1,
|
|
42044
|
+
params: { search: query || '', limit },
|
|
42045
|
+
});
|
|
42046
|
+
const data = ocsData$1(response);
|
|
42047
|
+
const gids = data && Array.isArray(data.groups) ? data.groups : [];
|
|
42048
|
+
return gids
|
|
42049
|
+
.filter((gid) => typeof gid === 'string' && gid !== '')
|
|
42050
|
+
.map((gid) => ({ id: gid, label: gid }))
|
|
42051
|
+
} catch {
|
|
42052
|
+
return []
|
|
42053
|
+
}
|
|
42054
|
+
}
|
|
42055
|
+
|
|
42056
|
+
/**
|
|
42057
|
+
* Resolve a stored gid to `{ id, label }` for edit-mode display. Falls back
|
|
42058
|
+
* to the gid itself when the name cannot be looked up.
|
|
42059
|
+
*
|
|
42060
|
+
* @spec openspec/changes/form-pickers-from-schema/specs/schema-utilities/spec.md
|
|
42061
|
+
* @param {string} gid The stored group id.
|
|
42062
|
+
* @return {Promise<{id: string, label: string}>} The resolved option.
|
|
42063
|
+
*/
|
|
42064
|
+
async function resolveNextcloudGroup(gid) {
|
|
42065
|
+
const fallback = { id: String(gid), label: String(gid) };
|
|
42066
|
+
if (gid === undefined || gid === null || gid === '') {
|
|
42067
|
+
return fallback
|
|
42068
|
+
}
|
|
42069
|
+
const results = await searchNextcloudGroups(String(gid));
|
|
42070
|
+
return results.find((opt) => opt.id === String(gid)) || fallback
|
|
42071
|
+
}
|
|
42072
|
+
|
|
42073
|
+
/**
|
|
42074
|
+
* Display names already looked up, by group id. Reactive, so every cell that
|
|
42075
|
+
* shows the same group updates when its name arrives.
|
|
42076
|
+
*
|
|
42077
|
+
* @type {Record<string, string>}
|
|
42078
|
+
*/
|
|
42079
|
+
const groupNames = vue$1.reactive({});
|
|
42080
|
+
|
|
42081
|
+
/** In-flight lookups by group id, so one id is asked for once. */
|
|
42082
|
+
const pendingNames = new Map();
|
|
42083
|
+
|
|
42084
|
+
/**
|
|
42085
|
+
* The cached display name of a group, or `null` when it has not been looked
|
|
42086
|
+
* up yet. Reactive: read in a computed or a render, it updates when
|
|
42087
|
+
* {@link loadGroupDisplayName} finishes.
|
|
42088
|
+
*
|
|
42089
|
+
* @spec openspec/changes/nextcloud-group-surfaces/specs/data-display/spec.md#requirement-a-group-cell-shows-the-groups-display-name
|
|
42090
|
+
* @param {string} gid The group id.
|
|
42091
|
+
* @return {string|null} The display name, or null when unknown.
|
|
42092
|
+
*/
|
|
42093
|
+
function groupDisplayName(gid) {
|
|
42094
|
+
if (gid === undefined || gid === null || gid === '') {
|
|
42095
|
+
return null
|
|
42096
|
+
}
|
|
42097
|
+
const name = groupNames[String(gid)];
|
|
42098
|
+
return typeof name === 'string' ? name : null
|
|
42099
|
+
}
|
|
42100
|
+
|
|
42101
|
+
/**
|
|
42102
|
+
* Look a group's display name up once per page and cache it. Concurrent
|
|
42103
|
+
* callers for the same id share one request. A failed or empty lookup caches
|
|
42104
|
+
* the id itself, so the cell shows the id and does not ask again.
|
|
42105
|
+
*
|
|
42106
|
+
* @spec openspec/changes/nextcloud-group-surfaces/specs/data-display/spec.md#requirement-a-group-cell-shows-the-groups-display-name
|
|
42107
|
+
* @param {string} gid The group id.
|
|
42108
|
+
* @return {Promise<string>} The display name, or the id.
|
|
42109
|
+
*/
|
|
42110
|
+
function loadGroupDisplayName(gid) {
|
|
42111
|
+
if (gid === undefined || gid === null || gid === '') {
|
|
42112
|
+
return Promise.resolve('')
|
|
42113
|
+
}
|
|
42114
|
+
const key = String(gid);
|
|
42115
|
+
const known = groupDisplayName(key);
|
|
42116
|
+
if (known !== null) {
|
|
42117
|
+
return Promise.resolve(known)
|
|
42118
|
+
}
|
|
42119
|
+
if (pendingNames.has(key)) {
|
|
42120
|
+
return pendingNames.get(key)
|
|
42121
|
+
}
|
|
42122
|
+
const request = resolveNextcloudGroup(key)
|
|
42123
|
+
.then((option) => (option && option.label) || key)
|
|
42124
|
+
.catch(() => key)
|
|
42125
|
+
.then((label) => {
|
|
42126
|
+
groupNames[key] = label;
|
|
42127
|
+
pendingNames.delete(key);
|
|
42128
|
+
return label
|
|
42129
|
+
});
|
|
42130
|
+
pendingNames.set(key, request);
|
|
42131
|
+
return request
|
|
42132
|
+
}
|
|
42133
|
+
|
|
41870
42134
|
// SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
41871
42135
|
// SPDX-License-Identifier: EUPL-1.2
|
|
41872
42136
|
|
|
@@ -41943,7 +42207,7 @@ function countEntries(list, key) {
|
|
|
41943
42207
|
* Format one token value.
|
|
41944
42208
|
*
|
|
41945
42209
|
* @param {unknown} value The raw value.
|
|
41946
|
-
* @param {string} format `date`, `datetime`, `weekday`, `longdate`, `time`, `user`, `currency`, `relative`, `relativetime`, `ago`, `week`, `days`, `lower`, `mailbox` or '' (as is).
|
|
42210
|
+
* @param {string} format `date`, `datetime`, `weekday`, `longdate`, `time`, `user`, `group`, `currency`, `relative`, `relativetime`, `ago`, `week`, `days`, `lower`, `mailbox` or '' (as is).
|
|
41947
42211
|
* @param {Date} now The reference moment.
|
|
41948
42212
|
* @param {string} [arg] The format's argument (`currency:EUR`, or a row path holding the code).
|
|
41949
42213
|
* @param {object|null} [object] The row, for a currency read from a field.
|
|
@@ -41984,6 +42248,14 @@ function formatValue(value, format, now, arg = '', object = null, config = null,
|
|
|
41984
42248
|
if (format === 'user') {
|
|
41985
42249
|
return userDisplayName(value)
|
|
41986
42250
|
}
|
|
42251
|
+
if (format === 'group') {
|
|
42252
|
+
const name = groupDisplayName(value);
|
|
42253
|
+
if (name === null) {
|
|
42254
|
+
loadGroupDisplayName(value);
|
|
42255
|
+
return ''
|
|
42256
|
+
}
|
|
42257
|
+
return name
|
|
42258
|
+
}
|
|
41987
42259
|
if (format === 'time') {
|
|
41988
42260
|
const date = parseDateValue(value);
|
|
41989
42261
|
return date === null ? '' : formatTimeOfDay(date)
|
|
@@ -42031,7 +42303,8 @@ function formatValue(value, format, now, arg = '', object = null, config = null,
|
|
|
42031
42303
|
* for today), `{path|longdate}` writes the month out ("7 oktober";
|
|
42032
42304
|
* `{path|longdate:year}` always adds the year), `{path|time}` is the time
|
|
42033
42305
|
* of day ("08:45"), `{path|user}` is a user id's display name (looked up
|
|
42034
|
-
* once, '' until it arrives), `{path|
|
|
42306
|
+
* once, '' until it arrives), `{path|group}` is a group id's display name
|
|
42307
|
+
* (the same, through the group name cache), `{path|currency}`,
|
|
42035
42308
|
* `{path|currency:EUR}` and `{path|currency:field}` write an amount in a
|
|
42036
42309
|
* currency (a code, or the row field that holds it; without either, or when
|
|
42037
42310
|
* the row field is empty, the app's reporting currency), `{path|relative}` and
|
|
@@ -44449,185 +44722,6 @@ script$87.render = render$86;
|
|
|
44449
44722
|
script$87.__scopeId = "data-v-0d05d86a";
|
|
44450
44723
|
const __sfc_main$81 = script$87;
|
|
44451
44724
|
|
|
44452
|
-
/**
|
|
44453
|
-
* Nextcloud group search for the schema-driven form's group picker
|
|
44454
|
-
* (a property marked `format: 'nc-group'` or `referenceType: 'nextcloud-group'`).
|
|
44455
|
-
*
|
|
44456
|
-
* Asks the core autocomplete OCS endpoint for groups first: every signed-in
|
|
44457
|
-
* user may call it, and it returns the group's display name. The provisioning
|
|
44458
|
-
* endpoint `cloud/groups` is the fallback; it also answers non-admins, but it
|
|
44459
|
-
* returns only group ids, so the id doubles as the label there.
|
|
44460
|
-
*
|
|
44461
|
-
* Options are `{ id: <gid>, label: <display name> }`: the form stores the gid.
|
|
44462
|
-
*
|
|
44463
|
-
* @module utils/groupAutocomplete
|
|
44464
|
-
*/
|
|
44465
|
-
|
|
44466
|
-
|
|
44467
|
-
const OCS_HEADERS$1 = {
|
|
44468
|
-
'OCS-APIRequest': 'true',
|
|
44469
|
-
Accept: 'application/json',
|
|
44470
|
-
};
|
|
44471
|
-
|
|
44472
|
-
/**
|
|
44473
|
-
* Read the `ocs.data` payload, tolerating a bare body.
|
|
44474
|
-
*
|
|
44475
|
-
* @param {object} response An axios response.
|
|
44476
|
-
* @return {unknown} The data.
|
|
44477
|
-
*/
|
|
44478
|
-
function ocsData$1(response) {
|
|
44479
|
-
const body = response && response.data;
|
|
44480
|
-
return body && body.ocs ? body.ocs.data : body
|
|
44481
|
-
}
|
|
44482
|
-
|
|
44483
|
-
/**
|
|
44484
|
-
* Map one autocomplete suggestion to an option, keeping only groups.
|
|
44485
|
-
*
|
|
44486
|
-
* @param {object} suggestion An autocomplete suggestion.
|
|
44487
|
-
* @return {{id: string, label: string}|null} The option, or null when it is not a group.
|
|
44488
|
-
*/
|
|
44489
|
-
function toGroupOption(suggestion) {
|
|
44490
|
-
if (!suggestion || typeof suggestion !== 'object') {
|
|
44491
|
-
return null
|
|
44492
|
-
}
|
|
44493
|
-
const isGroup = suggestion.source === 'groups'
|
|
44494
|
-
|| suggestion.shareType === 1
|
|
44495
|
-
|| (suggestion.value && suggestion.value.shareType === 1);
|
|
44496
|
-
if (!isGroup) {
|
|
44497
|
-
return null
|
|
44498
|
-
}
|
|
44499
|
-
const gid = suggestion.id || (suggestion.value && suggestion.value.shareWith);
|
|
44500
|
-
if (gid === undefined || gid === null || gid === '') {
|
|
44501
|
-
return null
|
|
44502
|
-
}
|
|
44503
|
-
return { id: String(gid), label: suggestion.label || String(gid) }
|
|
44504
|
-
}
|
|
44505
|
-
|
|
44506
|
-
/**
|
|
44507
|
-
* Search Nextcloud groups by name or id. Fails soft: an error yields `[]`.
|
|
44508
|
-
*
|
|
44509
|
-
* @spec openspec/changes/form-pickers-from-schema/specs/schema-utilities/spec.md
|
|
44510
|
-
* @param {string} [query] The search term (empty loads a first page).
|
|
44511
|
-
* @param {object} [options] Tuning options.
|
|
44512
|
-
* @param {number} [options.limit] Max results (default 25).
|
|
44513
|
-
* @return {Promise<Array<{id: string, label: string}>>} Picker options.
|
|
44514
|
-
*/
|
|
44515
|
-
async function searchNextcloudGroups(query = '', options = {}) {
|
|
44516
|
-
const { limit = 25 } = options;
|
|
44517
|
-
try {
|
|
44518
|
-
const response = await axios$1.get(router.generateOcsUrl('core/autocomplete/get'), {
|
|
44519
|
-
headers: OCS_HEADERS$1,
|
|
44520
|
-
params: {
|
|
44521
|
-
search: query || '',
|
|
44522
|
-
itemType: ' ',
|
|
44523
|
-
itemId: ' ',
|
|
44524
|
-
'shareTypes[]': 1,
|
|
44525
|
-
limit,
|
|
44526
|
-
},
|
|
44527
|
-
});
|
|
44528
|
-
const list = ocsData$1(response);
|
|
44529
|
-
const groups = (Array.isArray(list) ? list : [])
|
|
44530
|
-
.map(toGroupOption)
|
|
44531
|
-
.filter((opt) => opt !== null);
|
|
44532
|
-
if (groups.length > 0) {
|
|
44533
|
-
return groups
|
|
44534
|
-
}
|
|
44535
|
-
} catch {
|
|
44536
|
-
// Fall through to the provisioning endpoint.
|
|
44537
|
-
}
|
|
44538
|
-
try {
|
|
44539
|
-
const response = await axios$1.get(router.generateOcsUrl('cloud/groups'), {
|
|
44540
|
-
headers: OCS_HEADERS$1,
|
|
44541
|
-
params: { search: query || '', limit },
|
|
44542
|
-
});
|
|
44543
|
-
const data = ocsData$1(response);
|
|
44544
|
-
const gids = data && Array.isArray(data.groups) ? data.groups : [];
|
|
44545
|
-
return gids
|
|
44546
|
-
.filter((gid) => typeof gid === 'string' && gid !== '')
|
|
44547
|
-
.map((gid) => ({ id: gid, label: gid }))
|
|
44548
|
-
} catch {
|
|
44549
|
-
return []
|
|
44550
|
-
}
|
|
44551
|
-
}
|
|
44552
|
-
|
|
44553
|
-
/**
|
|
44554
|
-
* Resolve a stored gid to `{ id, label }` for edit-mode display. Falls back
|
|
44555
|
-
* to the gid itself when the name cannot be looked up.
|
|
44556
|
-
*
|
|
44557
|
-
* @spec openspec/changes/form-pickers-from-schema/specs/schema-utilities/spec.md
|
|
44558
|
-
* @param {string} gid The stored group id.
|
|
44559
|
-
* @return {Promise<{id: string, label: string}>} The resolved option.
|
|
44560
|
-
*/
|
|
44561
|
-
async function resolveNextcloudGroup(gid) {
|
|
44562
|
-
const fallback = { id: String(gid), label: String(gid) };
|
|
44563
|
-
if (gid === undefined || gid === null || gid === '') {
|
|
44564
|
-
return fallback
|
|
44565
|
-
}
|
|
44566
|
-
const results = await searchNextcloudGroups(String(gid));
|
|
44567
|
-
return results.find((opt) => opt.id === String(gid)) || fallback
|
|
44568
|
-
}
|
|
44569
|
-
|
|
44570
|
-
/**
|
|
44571
|
-
* Display names already looked up, by group id. Reactive, so every cell that
|
|
44572
|
-
* shows the same group updates when its name arrives.
|
|
44573
|
-
*
|
|
44574
|
-
* @type {Record<string, string>}
|
|
44575
|
-
*/
|
|
44576
|
-
const groupNames = vue$1.reactive({});
|
|
44577
|
-
|
|
44578
|
-
/** In-flight lookups by group id, so one id is asked for once. */
|
|
44579
|
-
const pendingNames = new Map();
|
|
44580
|
-
|
|
44581
|
-
/**
|
|
44582
|
-
* The cached display name of a group, or `null` when it has not been looked
|
|
44583
|
-
* up yet. Reactive: read in a computed or a render, it updates when
|
|
44584
|
-
* {@link loadGroupDisplayName} finishes.
|
|
44585
|
-
*
|
|
44586
|
-
* @spec openspec/changes/nextcloud-group-surfaces/specs/data-display/spec.md#requirement-a-group-cell-shows-the-groups-display-name
|
|
44587
|
-
* @param {string} gid The group id.
|
|
44588
|
-
* @return {string|null} The display name, or null when unknown.
|
|
44589
|
-
*/
|
|
44590
|
-
function groupDisplayName(gid) {
|
|
44591
|
-
if (gid === undefined || gid === null || gid === '') {
|
|
44592
|
-
return null
|
|
44593
|
-
}
|
|
44594
|
-
const name = groupNames[String(gid)];
|
|
44595
|
-
return typeof name === 'string' ? name : null
|
|
44596
|
-
}
|
|
44597
|
-
|
|
44598
|
-
/**
|
|
44599
|
-
* Look a group's display name up once per page and cache it. Concurrent
|
|
44600
|
-
* callers for the same id share one request. A failed or empty lookup caches
|
|
44601
|
-
* the id itself, so the cell shows the id and does not ask again.
|
|
44602
|
-
*
|
|
44603
|
-
* @spec openspec/changes/nextcloud-group-surfaces/specs/data-display/spec.md#requirement-a-group-cell-shows-the-groups-display-name
|
|
44604
|
-
* @param {string} gid The group id.
|
|
44605
|
-
* @return {Promise<string>} The display name, or the id.
|
|
44606
|
-
*/
|
|
44607
|
-
function loadGroupDisplayName(gid) {
|
|
44608
|
-
if (gid === undefined || gid === null || gid === '') {
|
|
44609
|
-
return Promise.resolve('')
|
|
44610
|
-
}
|
|
44611
|
-
const key = String(gid);
|
|
44612
|
-
const known = groupDisplayName(key);
|
|
44613
|
-
if (known !== null) {
|
|
44614
|
-
return Promise.resolve(known)
|
|
44615
|
-
}
|
|
44616
|
-
if (pendingNames.has(key)) {
|
|
44617
|
-
return pendingNames.get(key)
|
|
44618
|
-
}
|
|
44619
|
-
const request = resolveNextcloudGroup(key)
|
|
44620
|
-
.then((option) => (option && option.label) || key)
|
|
44621
|
-
.catch(() => key)
|
|
44622
|
-
.then((label) => {
|
|
44623
|
-
groupNames[key] = label;
|
|
44624
|
-
pendingNames.delete(key);
|
|
44625
|
-
return label
|
|
44626
|
-
});
|
|
44627
|
-
pendingNames.set(key, request);
|
|
44628
|
-
return request
|
|
44629
|
-
}
|
|
44630
|
-
|
|
44631
44725
|
/**
|
|
44632
44726
|
* CnGroupNameCell renders a Nextcloud group id as its display name.
|
|
44633
44727
|
*
|
|
@@ -161631,6 +161725,16 @@ var script$69 = {
|
|
|
161631
161725
|
required: true,
|
|
161632
161726
|
},
|
|
161633
161727
|
|
|
161728
|
+
/**
|
|
161729
|
+
* The word per state that replaces the default, already translated.
|
|
161730
|
+
*
|
|
161731
|
+
* @type {object}
|
|
161732
|
+
*/
|
|
161733
|
+
labels: {
|
|
161734
|
+
type: Object,
|
|
161735
|
+
default: () => ({}),
|
|
161736
|
+
},
|
|
161737
|
+
|
|
161634
161738
|
/** A move is running. */
|
|
161635
161739
|
busy: {
|
|
161636
161740
|
type: Boolean,
|
|
@@ -161651,12 +161755,24 @@ var script$69 = {
|
|
|
161651
161755
|
t: l10n.translate,
|
|
161652
161756
|
|
|
161653
161757
|
/**
|
|
161654
|
-
* The word for
|
|
161758
|
+
* The word for an item's state. A completed milestone is reached, and
|
|
161759
|
+
* an optional item nobody has started reads as optional rather than
|
|
161760
|
+
* waiting. `labels` replaces the word for a state.
|
|
161655
161761
|
*
|
|
161656
|
-
* @param {
|
|
161762
|
+
* @param {object} item The plan item.
|
|
161657
161763
|
* @return {string}
|
|
161658
161764
|
*/
|
|
161659
|
-
stateLabel(
|
|
161765
|
+
stateLabel(item) {
|
|
161766
|
+
const state = item.state;
|
|
161767
|
+
if (typeof this.labels[state] === 'string' && this.labels[state] !== '') {
|
|
161768
|
+
return this.labels[state]
|
|
161769
|
+
}
|
|
161770
|
+
if (state === 'completed' && item.type === 'milestone') {
|
|
161771
|
+
return l10n.translate('nextcloud-vue', 'Reached')
|
|
161772
|
+
}
|
|
161773
|
+
if (item.discretionary && (state === 'available' || state === 'enabled')) {
|
|
161774
|
+
return l10n.translate('nextcloud-vue', 'Optional')
|
|
161775
|
+
}
|
|
161660
161776
|
const labels = {
|
|
161661
161777
|
available: l10n.translate('nextcloud-vue', 'Waiting'),
|
|
161662
161778
|
enabled: l10n.translate('nextcloud-vue', 'Can start'),
|
|
@@ -161696,7 +161812,7 @@ function render$68(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
161696
161812
|
vue$1.createElementVNode("span", {
|
|
161697
161813
|
class: "cn-plan-row__state",
|
|
161698
161814
|
"data-state": $props.item.state
|
|
161699
|
-
}, vue$1.toDisplayString($options.stateLabel($props.item
|
|
161815
|
+
}, vue$1.toDisplayString($options.stateLabel($props.item)), 9 /* TEXT, PROPS */, _hoisted_5$40),
|
|
161700
161816
|
($props.item.state === 'enabled' && $props.item.discretionary)
|
|
161701
161817
|
? (vue$1.openBlock(), vue$1.createBlock(_component_NcButton, {
|
|
161702
161818
|
key: 0,
|
|
@@ -161727,7 +161843,7 @@ function render$68(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
161727
161843
|
}
|
|
161728
161844
|
|
|
161729
161845
|
script$69.render = render$68;
|
|
161730
|
-
script$69.__scopeId = "data-v-
|
|
161846
|
+
script$69.__scopeId = "data-v-3c7f161a";
|
|
161731
161847
|
const __sfc_main$63 = script$69;
|
|
161732
161848
|
|
|
161733
161849
|
/** The page refresh channel the built-in widgets listen on. */
|
|
@@ -161743,7 +161859,8 @@ const PAGE_REFRESH$4 = 'cn:page:refresh';
|
|
|
161743
161859
|
* retry, never an empty plan. Any app whose records run on OpenRegister's
|
|
161744
161860
|
* case layer uses it; dossiq's case plan is the first.
|
|
161745
161861
|
*
|
|
161746
|
-
* `content`: `emptyText`,
|
|
161862
|
+
* `content`: `emptyText`, and `stateLabels` (`{ active: 'Active' }`, the word
|
|
161863
|
+
* for a state), both through the host translate.
|
|
161747
161864
|
*
|
|
161748
161865
|
* The record's id comes from `objectId`, else the bound record.
|
|
161749
161866
|
*/
|
|
@@ -161795,6 +161912,22 @@ var script$68 = {
|
|
|
161795
161912
|
},
|
|
161796
161913
|
|
|
161797
161914
|
computed: {
|
|
161915
|
+
/** @return {object} The configured word per state, translated. */
|
|
161916
|
+
stateLabels() {
|
|
161917
|
+
const map = this.content?.stateLabels;
|
|
161918
|
+
if (!map || typeof map !== 'object') {
|
|
161919
|
+
return {}
|
|
161920
|
+
}
|
|
161921
|
+
const out = {};
|
|
161922
|
+
for (const [state, label] of Object.entries(map)) {
|
|
161923
|
+
const text = this.text(label);
|
|
161924
|
+
if (text !== '') {
|
|
161925
|
+
out[state] = text;
|
|
161926
|
+
}
|
|
161927
|
+
}
|
|
161928
|
+
return out
|
|
161929
|
+
},
|
|
161930
|
+
|
|
161798
161931
|
/** @return {string} The record id. */
|
|
161799
161932
|
id() {
|
|
161800
161933
|
const bound = this.objectData || {};
|
|
@@ -161969,10 +162102,11 @@ function render$67(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
161969
162102
|
}, [
|
|
161970
162103
|
vue$1.createVNode(_component_CnPlanWidgetRow, {
|
|
161971
162104
|
item: node,
|
|
162105
|
+
labels: $options.stateLabels,
|
|
161972
162106
|
busy: $data.busy,
|
|
161973
162107
|
onEnable: $options.enable,
|
|
161974
162108
|
onTransition: $options.transition
|
|
161975
|
-
}, null, 8 /* PROPS */, ["item", "busy", "onEnable", "onTransition"]),
|
|
162109
|
+
}, null, 8 /* PROPS */, ["item", "labels", "busy", "onEnable", "onTransition"]),
|
|
161976
162110
|
(node.children.length > 0)
|
|
161977
162111
|
? (vue$1.openBlock(), vue$1.createElementBlock("ul", _hoisted_3$58, [
|
|
161978
162112
|
(vue$1.openBlock(true), vue$1.createElementBlock(vue$1.Fragment, null, vue$1.renderList(node.children, (child) => {
|
|
@@ -161982,10 +162116,11 @@ function render$67(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
161982
162116
|
}, [
|
|
161983
162117
|
vue$1.createVNode(_component_CnPlanWidgetRow, {
|
|
161984
162118
|
item: child,
|
|
162119
|
+
labels: $options.stateLabels,
|
|
161985
162120
|
busy: $data.busy,
|
|
161986
162121
|
onEnable: $options.enable,
|
|
161987
162122
|
onTransition: $options.transition
|
|
161988
|
-
}, null, 8 /* PROPS */, ["item", "busy", "onEnable", "onTransition"])
|
|
162123
|
+
}, null, 8 /* PROPS */, ["item", "labels", "busy", "onEnable", "onTransition"])
|
|
161989
162124
|
]))
|
|
161990
162125
|
}), 128 /* KEYED_FRAGMENT */))
|
|
161991
162126
|
]))
|
|
@@ -161998,7 +162133,7 @@ function render$67(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
161998
162133
|
}
|
|
161999
162134
|
|
|
162000
162135
|
script$68.render = render$67;
|
|
162001
|
-
script$68.__scopeId = "data-v-
|
|
162136
|
+
script$68.__scopeId = "data-v-06146e95";
|
|
162002
162137
|
const __sfc_main$62 = script$68;
|
|
162003
162138
|
|
|
162004
162139
|
/**
|
|
@@ -196344,7 +196479,7 @@ function render$5l(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
196344
196479
|
}
|
|
196345
196480
|
|
|
196346
196481
|
script$5m.render = render$5l;
|
|
196347
|
-
script$5m.__scopeId = "data-v-
|
|
196482
|
+
script$5m.__scopeId = "data-v-485ec8e1";
|
|
196348
196483
|
const __sfc_main$5g = script$5m;
|
|
196349
196484
|
|
|
196350
196485
|
/**
|
|
@@ -329411,10 +329546,206 @@ function byOrder(a, b) {
|
|
|
329411
329546
|
return aHas ? a.order - b.order : 0
|
|
329412
329547
|
}
|
|
329413
329548
|
|
|
329549
|
+
/**
|
|
329550
|
+
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
329551
|
+
* SPDX-License-Identifier: EUPL-1.2
|
|
329552
|
+
*
|
|
329553
|
+
* The text of one range filter on the Active line ("1 tot en met 31 oktober")
|
|
329554
|
+
* and of several values of one filter ("actief en verlopend").
|
|
329555
|
+
*
|
|
329556
|
+
* @spec openspec/changes/index-filter-labels/specs/active-filter-line-board-look/spec.md#requirement-a-range-is-one-chip
|
|
329557
|
+
*/
|
|
329558
|
+
|
|
329559
|
+
const DATE_PATTERN = /^\d{4}-\d{2}-\d{2}(?:$|T)/;
|
|
329560
|
+
|
|
329561
|
+
/**
|
|
329562
|
+
* The two ends of a range value, or null when the value is not a range.
|
|
329563
|
+
*
|
|
329564
|
+
* @param {unknown} value A filter value: `{from, to}`, `{gte, lte}` or `{gt, lt}`.
|
|
329565
|
+
* @return {{from: unknown, to: unknown}|null} The ends, an open end as null.
|
|
329566
|
+
*/
|
|
329567
|
+
function rangeEnds(value) {
|
|
329568
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
329569
|
+
return null
|
|
329570
|
+
}
|
|
329571
|
+
const pick = (...keys) => {
|
|
329572
|
+
for (const key of keys) {
|
|
329573
|
+
if (value[key] !== undefined && value[key] !== null && value[key] !== '') {
|
|
329574
|
+
return value[key]
|
|
329575
|
+
}
|
|
329576
|
+
}
|
|
329577
|
+
return null
|
|
329578
|
+
};
|
|
329579
|
+
const from = pick('from', 'gte', 'gt');
|
|
329580
|
+
const to = pick('to', 'lte', 'lt');
|
|
329581
|
+
return from === null && to === null ? null : { from, to }
|
|
329582
|
+
}
|
|
329583
|
+
|
|
329584
|
+
/**
|
|
329585
|
+
* A date-only string as a local date, or null when the value is not one.
|
|
329586
|
+
*
|
|
329587
|
+
* @param {unknown} value The value.
|
|
329588
|
+
* @return {Date|null} The date.
|
|
329589
|
+
*/
|
|
329590
|
+
function asDate$1(value) {
|
|
329591
|
+
if (typeof value !== 'string' || !DATE_PATTERN.test(value)) {
|
|
329592
|
+
return null
|
|
329593
|
+
}
|
|
329594
|
+
const [y, m, d] = value.slice(0, 10).split('-').map(Number);
|
|
329595
|
+
const date = new Date(y, m - 1, d);
|
|
329596
|
+
return Number.isNaN(date.getTime()) ? null : date
|
|
329597
|
+
}
|
|
329598
|
+
|
|
329599
|
+
/**
|
|
329600
|
+
* One end written in the locale.
|
|
329601
|
+
*
|
|
329602
|
+
* @param {Date} date The date.
|
|
329603
|
+
* @param {string|undefined} locale BCP 47 locale.
|
|
329604
|
+
* @param {object} options `Intl.DateTimeFormat` options.
|
|
329605
|
+
* @return {string} The text.
|
|
329606
|
+
*/
|
|
329607
|
+
function formatEnd(date, locale, options) {
|
|
329608
|
+
try {
|
|
329609
|
+
return new Intl.DateTimeFormat(locale, options).format(date)
|
|
329610
|
+
} catch {
|
|
329611
|
+
return date.toISOString().slice(0, 10)
|
|
329612
|
+
}
|
|
329613
|
+
}
|
|
329614
|
+
|
|
329615
|
+
/**
|
|
329616
|
+
* The chip text for a range: "{from} through {to}", "from {from}" or "up to {to}".
|
|
329617
|
+
* Date ends get day and month in the locale; the month is written once when
|
|
329618
|
+
* both ends share month and year, the year only when an end is not in the
|
|
329619
|
+
* current one. Other values are written as they are.
|
|
329620
|
+
*
|
|
329621
|
+
* @param {unknown} from The lower end, or null.
|
|
329622
|
+
* @param {unknown} to The upper end, or null.
|
|
329623
|
+
* @param {object} options Options.
|
|
329624
|
+
* @param {(text: string, vars: object) => string} options.translate Translate with placeholders.
|
|
329625
|
+
* @param {string} [options.locale] BCP 47 locale; the environment's when omitted.
|
|
329626
|
+
* @param {Date} [options.now] What counts as now, for the current year.
|
|
329627
|
+
* @return {string} The text.
|
|
329628
|
+
*/
|
|
329629
|
+
function rangeChipText(from, to, { translate, locale, now = new Date() }) {
|
|
329630
|
+
const fromDate = asDate$1(from);
|
|
329631
|
+
const toDate = asDate$1(to);
|
|
329632
|
+
const year = now.getFullYear();
|
|
329633
|
+
const withYear = (fromDate && fromDate.getFullYear() !== year) || (toDate && toDate.getFullYear() !== year);
|
|
329634
|
+
const full = withYear ? { day: 'numeric', month: 'long', year: 'numeric' } : { day: 'numeric', month: 'long' };
|
|
329635
|
+
const sameMonth = fromDate && toDate
|
|
329636
|
+
&& fromDate.getFullYear() === toDate.getFullYear()
|
|
329637
|
+
&& fromDate.getMonth() === toDate.getMonth();
|
|
329638
|
+
|
|
329639
|
+
const fromText = fromDate
|
|
329640
|
+
? formatEnd(fromDate, locale, sameMonth ? { day: 'numeric' } : full)
|
|
329641
|
+
: (from === null || from === undefined ? null : String(from));
|
|
329642
|
+
const toText = toDate
|
|
329643
|
+
? formatEnd(toDate, locale, full)
|
|
329644
|
+
: (to === null || to === undefined ? null : String(to));
|
|
329645
|
+
|
|
329646
|
+
if (fromText !== null && toText !== null) {
|
|
329647
|
+
return translate('{from} through {to}', { from: fromText, to: toText })
|
|
329648
|
+
}
|
|
329649
|
+
if (fromText !== null) {
|
|
329650
|
+
return translate('from {from}', { from: fromText })
|
|
329651
|
+
}
|
|
329652
|
+
return translate('up to {to}', { to: toText })
|
|
329653
|
+
}
|
|
329654
|
+
|
|
329655
|
+
/**
|
|
329656
|
+
* Several value names as one list in the locale: "actief en verlopend",
|
|
329657
|
+
* "a, b en c". Joined with ", " where `Intl.ListFormat` is missing.
|
|
329658
|
+
*
|
|
329659
|
+
* @param {string[]} names The value names.
|
|
329660
|
+
* @param {string} [locale] BCP 47 locale; the environment's when omitted.
|
|
329661
|
+
* @return {string} The text.
|
|
329662
|
+
* @spec openspec/changes/index-filter-labels/specs/active-filter-line-board-look/spec.md#requirement-several-values-read-as-a-list
|
|
329663
|
+
*/
|
|
329664
|
+
function listText(names, locale) {
|
|
329665
|
+
if (names.length < 2 || typeof Intl.ListFormat !== 'function') {
|
|
329666
|
+
return names.join(', ')
|
|
329667
|
+
}
|
|
329668
|
+
try {
|
|
329669
|
+
return new Intl.ListFormat(locale, { type: 'conjunction' }).format(names)
|
|
329670
|
+
} catch {
|
|
329671
|
+
return names.join(', ')
|
|
329672
|
+
}
|
|
329673
|
+
}
|
|
329674
|
+
|
|
329675
|
+
const TODAY_TOKEN = /^@today(?:([+-])(\d+)d)?$/;
|
|
329676
|
+
|
|
329677
|
+
/**
|
|
329678
|
+
* A range end as a local date at midnight: a date string or an `@today`
|
|
329679
|
+
* token, read against `now`. Null for anything else.
|
|
329680
|
+
*
|
|
329681
|
+
* @param {unknown} value The end.
|
|
329682
|
+
* @param {Date} now What counts as now.
|
|
329683
|
+
* @return {Date|null} The date.
|
|
329684
|
+
*/
|
|
329685
|
+
function endDay(value, now) {
|
|
329686
|
+
if (typeof value === 'string') {
|
|
329687
|
+
const token = TODAY_TOKEN.exec(value);
|
|
329688
|
+
if (token) {
|
|
329689
|
+
const shift = token[1] ? Number(token[2]) * (token[1] === '-' ? -1 : 1) : 0;
|
|
329690
|
+
return new Date(now.getFullYear(), now.getMonth(), now.getDate() + shift)
|
|
329691
|
+
}
|
|
329692
|
+
}
|
|
329693
|
+
return asDate$1(value)
|
|
329694
|
+
}
|
|
329695
|
+
|
|
329696
|
+
/**
|
|
329697
|
+
* Whole days from one local date to another.
|
|
329698
|
+
*
|
|
329699
|
+
* @param {Date} a The first date.
|
|
329700
|
+
* @param {Date} b The second date.
|
|
329701
|
+
* @return {number} The days from `a` to `b`.
|
|
329702
|
+
*/
|
|
329703
|
+
function daysBetween(a, b) {
|
|
329704
|
+
return Math.round((Date.UTC(b.getFullYear(), b.getMonth(), b.getDate()) - Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())) / 86400000)
|
|
329705
|
+
}
|
|
329706
|
+
|
|
329707
|
+
/**
|
|
329708
|
+
* A range from today named in words: "today", "within {n} days" or "this
|
|
329709
|
+
* week" (Monday to Sunday, or to next Monday). Null for any other range, so
|
|
329710
|
+
* the caller writes it as dates.
|
|
329711
|
+
*
|
|
329712
|
+
* @param {unknown} from The lower end: a date or an `@today` token.
|
|
329713
|
+
* @param {unknown} to The upper end: a date or an `@today` token.
|
|
329714
|
+
* @param {object} options Options.
|
|
329715
|
+
* @param {(text: string) => string} options.translate Translate.
|
|
329716
|
+
* @param {(one: string, many: string, count: number) => string} options.translatePlural Translate with a count.
|
|
329717
|
+
* @param {Date} [options.now] What counts as now.
|
|
329718
|
+
* @return {string|null} The words, or null.
|
|
329719
|
+
* @spec openspec/changes/index-filter-labels/specs/active-filter-line-board-look/spec.md#requirement-a-range-from-today-is-named-in-words
|
|
329720
|
+
*/
|
|
329721
|
+
function relativeRangeText(from, to, { translate, translatePlural, now = new Date() }) {
|
|
329722
|
+
const start = endDay(from, now);
|
|
329723
|
+
const end = endDay(to, now);
|
|
329724
|
+
if (!start || !end) {
|
|
329725
|
+
return null
|
|
329726
|
+
}
|
|
329727
|
+
const fromToday = daysBetween(now, start);
|
|
329728
|
+
const span = daysBetween(start, end);
|
|
329729
|
+
if (fromToday === 0 && (span === 0 || span === 1)) {
|
|
329730
|
+
return translate('today')
|
|
329731
|
+
}
|
|
329732
|
+
if (fromToday === 0 && span > 1) {
|
|
329733
|
+
return translatePlural('within %n day', 'within %n days', span)
|
|
329734
|
+
}
|
|
329735
|
+
const monday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - ((now.getDay() + 6) % 7));
|
|
329736
|
+
if (daysBetween(monday, start) === 0 && (span === 6 || span === 7)) {
|
|
329737
|
+
return translate('this week')
|
|
329738
|
+
}
|
|
329739
|
+
return null
|
|
329740
|
+
}
|
|
329741
|
+
|
|
329414
329742
|
// SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
329415
329743
|
// SPDX-License-Identifier: EUPL-1.2
|
|
329416
329744
|
|
|
329417
329745
|
|
|
329746
|
+
/** Marks a filter entry built from `field[gte]` / `field[lt]` keys. */
|
|
329747
|
+
const RANGE = Symbol('range');
|
|
329748
|
+
|
|
329418
329749
|
/**
|
|
329419
329750
|
* A saved view's filters as one readable line: "Case type Woo request,
|
|
329420
329751
|
* status open". Each filter is its field's title and its values' display
|
|
@@ -329437,7 +329768,7 @@ function byOrder(a, b) {
|
|
|
329437
329768
|
* @param {object} [options] Options.
|
|
329438
329769
|
* @param {object} [options.properties] The page schema's `properties`.
|
|
329439
329770
|
* @param {{[key: string]: {[value: string]: string}}} [options.valueLabels] Display names per filter key and value.
|
|
329440
|
-
* @param {{[key: string]: {label?: string, values?: object, hidden?: boolean}}} [options.filterLabels] The page's `config.filterLabels
|
|
329771
|
+
* @param {{[key: string]: {label?: string, values?: object, hidden?: boolean, valuesAlone?: boolean}}} [options.filterLabels] The page's `config.filterLabels`; with `valuesAlone` a named value reads as the whole part.
|
|
329441
329772
|
* @param {(text: string) => string} [options.translate] The app's translate, for titles and labels the schema declares.
|
|
329442
329773
|
* @return {string} The line, or '' for a view without filters or search.
|
|
329443
329774
|
* @spec openspec/changes/saved-view-summary-reads-like-the-chips/specs/saved-view-menu-settings/spec.md
|
|
@@ -329448,9 +329779,19 @@ function summarizeViewFilters(state, options = {}) {
|
|
|
329448
329779
|
const valueLabels = (options.valueLabels && typeof options.valueLabels === 'object') ? options.valueLabels : {};
|
|
329449
329780
|
const filterLabels = (options.filterLabels && typeof options.filterLabels === 'object') ? options.filterLabels : {};
|
|
329450
329781
|
const tr = typeof options.translate === 'function' ? options.translate : (text) => text;
|
|
329451
|
-
const filters = (state && state.filters && typeof state.filters === 'object') ? state.filters : {};
|
|
329782
|
+
const filters = groupRanges((state && state.filters && typeof state.filters === 'object') ? state.filters : {});
|
|
329452
329783
|
const parts = [];
|
|
329453
329784
|
for (const [key, raw] of Object.entries(filters)) {
|
|
329785
|
+
if (raw && typeof raw === 'object' && raw[RANGE] === true) {
|
|
329786
|
+
const named = (filterLabels[key] && typeof filterLabels[key] === 'object') ? filterLabels[key] : {};
|
|
329787
|
+
if (named.hidden === true) {
|
|
329788
|
+
continue
|
|
329789
|
+
}
|
|
329790
|
+
const prop = properties[key] || {};
|
|
329791
|
+
const title = typeof named.label === 'string' && named.label !== '' ? named.label : (typeof prop.title === 'string' && prop.title !== '' ? prop.title : key);
|
|
329792
|
+
parts.push(`${tr(title)} ${rangeWords(raw.from, raw.to)}`);
|
|
329793
|
+
continue
|
|
329794
|
+
}
|
|
329454
329795
|
const named = (filterLabels[key] && typeof filterLabels[key] === 'object') ? filterLabels[key] : {};
|
|
329455
329796
|
if (named.hidden === true) {
|
|
329456
329797
|
continue
|
|
@@ -329470,7 +329811,11 @@ function summarizeViewFilters(state, options = {}) {
|
|
|
329470
329811
|
? named.label
|
|
329471
329812
|
: (typeof prop.title === 'string' && prop.title !== '' ? prop.title : key);
|
|
329472
329813
|
const field = tr(title);
|
|
329473
|
-
|
|
329814
|
+
// `valuesAlone: true`: a value the page names reads as the whole part
|
|
329815
|
+
// ("My cases" for assignee @me), not after the field's title.
|
|
329816
|
+
const raws = (Array.isArray(raw) ? raw : [raw]).filter((value) => value !== undefined && value !== '');
|
|
329817
|
+
const alone = named.valuesAlone === true && raws.length === 1 && typeof namedValues[String(raws[0])] === 'string' && namedValues[String(raws[0])] !== '';
|
|
329818
|
+
parts.push(alone ? values[0] : `${field} ${values.join(` ${l10n.translate('nextcloud-vue', 'or')} `)}`);
|
|
329474
329819
|
}
|
|
329475
329820
|
if (state && typeof state.search === 'string' && state.search.trim() !== '') {
|
|
329476
329821
|
parts.push(`"${state.search.trim()}"`);
|
|
@@ -329541,6 +329886,10 @@ function valueText(value, prop, labels, tr) {
|
|
|
329541
329886
|
.join(' ')
|
|
329542
329887
|
}
|
|
329543
329888
|
const id = String(value);
|
|
329889
|
+
const token = tokenWords(id);
|
|
329890
|
+
if (token !== null) {
|
|
329891
|
+
return token
|
|
329892
|
+
}
|
|
329544
329893
|
if (typeof labels[id] === 'string' && labels[id] !== '') {
|
|
329545
329894
|
return labels[id]
|
|
329546
329895
|
}
|
|
@@ -329555,6 +329904,89 @@ function valueText(value, prop, labels, tr) {
|
|
|
329555
329904
|
return id
|
|
329556
329905
|
}
|
|
329557
329906
|
|
|
329907
|
+
/**
|
|
329908
|
+
* The filters with each `field[op]` pair folded into one range entry under
|
|
329909
|
+
* `field`, in the place of its first part, so "deadline[gte] @today,
|
|
329910
|
+
* deadline[lt] @today+7d" reads as one deadline range.
|
|
329911
|
+
*
|
|
329912
|
+
* @param {object} filters The view's filters.
|
|
329913
|
+
* @return {object} The filters, ranges folded.
|
|
329914
|
+
*/
|
|
329915
|
+
function groupRanges(filters) {
|
|
329916
|
+
const out = {};
|
|
329917
|
+
for (const [key, value] of Object.entries(filters)) {
|
|
329918
|
+
const match = /^(.+)\[(gte|gt|lte|lt)\]$/.exec(key);
|
|
329919
|
+
if (!match) {
|
|
329920
|
+
out[key] = value;
|
|
329921
|
+
continue
|
|
329922
|
+
}
|
|
329923
|
+
const field = match[1];
|
|
329924
|
+
const range = out[field] && out[field][RANGE] === true ? out[field] : { [RANGE]: true };
|
|
329925
|
+
if (match[2] === 'gte' || match[2] === 'gt') {
|
|
329926
|
+
range.from = value;
|
|
329927
|
+
} else {
|
|
329928
|
+
range.to = value;
|
|
329929
|
+
}
|
|
329930
|
+
out[field] = range;
|
|
329931
|
+
}
|
|
329932
|
+
return out
|
|
329933
|
+
}
|
|
329934
|
+
|
|
329935
|
+
/**
|
|
329936
|
+
* A range in words: "within 7 days", "today" or "this week" when it starts
|
|
329937
|
+
* today, else "from {from} up to {to}" with each end in words.
|
|
329938
|
+
*
|
|
329939
|
+
* @param {unknown} from The lower end, or undefined.
|
|
329940
|
+
* @param {unknown} to The upper end, or undefined.
|
|
329941
|
+
* @return {string} The words.
|
|
329942
|
+
*/
|
|
329943
|
+
function rangeWords(from, to) {
|
|
329944
|
+
if (from !== undefined && to !== undefined) {
|
|
329945
|
+
const relative = relativeRangeText(from, to, {
|
|
329946
|
+
translate: (text, vars) => l10n.translate('nextcloud-vue', text, vars),
|
|
329947
|
+
translatePlural: (one, many, count) => l10n.translatePlural('nextcloud-vue', one, many, count),
|
|
329948
|
+
});
|
|
329949
|
+
if (relative) {
|
|
329950
|
+
return relative
|
|
329951
|
+
}
|
|
329952
|
+
}
|
|
329953
|
+
const words = (value) => tokenWords(String(value)) ?? String(value);
|
|
329954
|
+
if (from !== undefined && to !== undefined) {
|
|
329955
|
+
return `${l10n.translate('nextcloud-vue', 'from {value}', { value: words(from) })} ${l10n.translate('nextcloud-vue', 'up to {value}', { value: words(to) })}`
|
|
329956
|
+
}
|
|
329957
|
+
return from !== undefined
|
|
329958
|
+
? l10n.translate('nextcloud-vue', 'from {value}', { value: words(from) })
|
|
329959
|
+
: l10n.translate('nextcloud-vue', 'up to {value}', { value: words(to) })
|
|
329960
|
+
}
|
|
329961
|
+
|
|
329962
|
+
/**
|
|
329963
|
+
* A filter token in words: `@me` "you", `@myTeam` "my team", `@today`
|
|
329964
|
+
* "today", `@today+7d` "in 7 days", `@today-7d` "7 days ago". Null for a
|
|
329965
|
+
* value that is not a token.
|
|
329966
|
+
*
|
|
329967
|
+
* @param {string} value The stored value.
|
|
329968
|
+
* @return {string|null} The words, or null.
|
|
329969
|
+
*/
|
|
329970
|
+
function tokenWords(value) {
|
|
329971
|
+
if (value === '@me') {
|
|
329972
|
+
return l10n.translate('nextcloud-vue', 'you')
|
|
329973
|
+
}
|
|
329974
|
+
if (value === '@myTeam') {
|
|
329975
|
+
return l10n.translate('nextcloud-vue', 'my team')
|
|
329976
|
+
}
|
|
329977
|
+
const day = /^@today(?:([+-])(\d+)d)?$/.exec(value);
|
|
329978
|
+
if (!day) {
|
|
329979
|
+
return null
|
|
329980
|
+
}
|
|
329981
|
+
if (!day[1] || Number(day[2]) === 0) {
|
|
329982
|
+
return l10n.translate('nextcloud-vue', 'today')
|
|
329983
|
+
}
|
|
329984
|
+
const count = Number(day[2]);
|
|
329985
|
+
return day[1] === '+'
|
|
329986
|
+
? l10n.translatePlural('nextcloud-vue', 'in %n day', 'in %n days', count)
|
|
329987
|
+
: l10n.translatePlural('nextcloud-vue', '%n day ago', '%n days ago', count)
|
|
329988
|
+
}
|
|
329989
|
+
|
|
329558
329990
|
/**
|
|
329559
329991
|
* The text with its first letter in lower case, unless the first word is in
|
|
329560
329992
|
* capitals (an abbreviation such as "BSN").
|
|
@@ -340509,199 +340941,6 @@ const METADATA_COLUMNS = [
|
|
|
340509
340941
|
{ key: 'updated', label: 'Updated', format: 'date-time' },
|
|
340510
340942
|
];
|
|
340511
340943
|
|
|
340512
|
-
/**
|
|
340513
|
-
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
340514
|
-
* SPDX-License-Identifier: EUPL-1.2
|
|
340515
|
-
*
|
|
340516
|
-
* The text of one range filter on the Active line ("1 tot en met 31 oktober")
|
|
340517
|
-
* and of several values of one filter ("actief en verlopend").
|
|
340518
|
-
*
|
|
340519
|
-
* @spec openspec/changes/index-filter-labels/specs/active-filter-line-board-look/spec.md#requirement-a-range-is-one-chip
|
|
340520
|
-
*/
|
|
340521
|
-
|
|
340522
|
-
const DATE_PATTERN = /^\d{4}-\d{2}-\d{2}(?:$|T)/;
|
|
340523
|
-
|
|
340524
|
-
/**
|
|
340525
|
-
* The two ends of a range value, or null when the value is not a range.
|
|
340526
|
-
*
|
|
340527
|
-
* @param {unknown} value A filter value: `{from, to}`, `{gte, lte}` or `{gt, lt}`.
|
|
340528
|
-
* @return {{from: unknown, to: unknown}|null} The ends, an open end as null.
|
|
340529
|
-
*/
|
|
340530
|
-
function rangeEnds(value) {
|
|
340531
|
-
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
340532
|
-
return null
|
|
340533
|
-
}
|
|
340534
|
-
const pick = (...keys) => {
|
|
340535
|
-
for (const key of keys) {
|
|
340536
|
-
if (value[key] !== undefined && value[key] !== null && value[key] !== '') {
|
|
340537
|
-
return value[key]
|
|
340538
|
-
}
|
|
340539
|
-
}
|
|
340540
|
-
return null
|
|
340541
|
-
};
|
|
340542
|
-
const from = pick('from', 'gte', 'gt');
|
|
340543
|
-
const to = pick('to', 'lte', 'lt');
|
|
340544
|
-
return from === null && to === null ? null : { from, to }
|
|
340545
|
-
}
|
|
340546
|
-
|
|
340547
|
-
/**
|
|
340548
|
-
* A date-only string as a local date, or null when the value is not one.
|
|
340549
|
-
*
|
|
340550
|
-
* @param {unknown} value The value.
|
|
340551
|
-
* @return {Date|null} The date.
|
|
340552
|
-
*/
|
|
340553
|
-
function asDate$1(value) {
|
|
340554
|
-
if (typeof value !== 'string' || !DATE_PATTERN.test(value)) {
|
|
340555
|
-
return null
|
|
340556
|
-
}
|
|
340557
|
-
const [y, m, d] = value.slice(0, 10).split('-').map(Number);
|
|
340558
|
-
const date = new Date(y, m - 1, d);
|
|
340559
|
-
return Number.isNaN(date.getTime()) ? null : date
|
|
340560
|
-
}
|
|
340561
|
-
|
|
340562
|
-
/**
|
|
340563
|
-
* One end written in the locale.
|
|
340564
|
-
*
|
|
340565
|
-
* @param {Date} date The date.
|
|
340566
|
-
* @param {string|undefined} locale BCP 47 locale.
|
|
340567
|
-
* @param {object} options `Intl.DateTimeFormat` options.
|
|
340568
|
-
* @return {string} The text.
|
|
340569
|
-
*/
|
|
340570
|
-
function formatEnd(date, locale, options) {
|
|
340571
|
-
try {
|
|
340572
|
-
return new Intl.DateTimeFormat(locale, options).format(date)
|
|
340573
|
-
} catch {
|
|
340574
|
-
return date.toISOString().slice(0, 10)
|
|
340575
|
-
}
|
|
340576
|
-
}
|
|
340577
|
-
|
|
340578
|
-
/**
|
|
340579
|
-
* The chip text for a range: "{from} through {to}", "from {from}" or "up to {to}".
|
|
340580
|
-
* Date ends get day and month in the locale; the month is written once when
|
|
340581
|
-
* both ends share month and year, the year only when an end is not in the
|
|
340582
|
-
* current one. Other values are written as they are.
|
|
340583
|
-
*
|
|
340584
|
-
* @param {unknown} from The lower end, or null.
|
|
340585
|
-
* @param {unknown} to The upper end, or null.
|
|
340586
|
-
* @param {object} options Options.
|
|
340587
|
-
* @param {(text: string, vars: object) => string} options.translate Translate with placeholders.
|
|
340588
|
-
* @param {string} [options.locale] BCP 47 locale; the environment's when omitted.
|
|
340589
|
-
* @param {Date} [options.now] What counts as now, for the current year.
|
|
340590
|
-
* @return {string} The text.
|
|
340591
|
-
*/
|
|
340592
|
-
function rangeChipText(from, to, { translate, locale, now = new Date() }) {
|
|
340593
|
-
const fromDate = asDate$1(from);
|
|
340594
|
-
const toDate = asDate$1(to);
|
|
340595
|
-
const year = now.getFullYear();
|
|
340596
|
-
const withYear = (fromDate && fromDate.getFullYear() !== year) || (toDate && toDate.getFullYear() !== year);
|
|
340597
|
-
const full = withYear ? { day: 'numeric', month: 'long', year: 'numeric' } : { day: 'numeric', month: 'long' };
|
|
340598
|
-
const sameMonth = fromDate && toDate
|
|
340599
|
-
&& fromDate.getFullYear() === toDate.getFullYear()
|
|
340600
|
-
&& fromDate.getMonth() === toDate.getMonth();
|
|
340601
|
-
|
|
340602
|
-
const fromText = fromDate
|
|
340603
|
-
? formatEnd(fromDate, locale, sameMonth ? { day: 'numeric' } : full)
|
|
340604
|
-
: (from === null || from === undefined ? null : String(from));
|
|
340605
|
-
const toText = toDate
|
|
340606
|
-
? formatEnd(toDate, locale, full)
|
|
340607
|
-
: (to === null || to === undefined ? null : String(to));
|
|
340608
|
-
|
|
340609
|
-
if (fromText !== null && toText !== null) {
|
|
340610
|
-
return translate('{from} through {to}', { from: fromText, to: toText })
|
|
340611
|
-
}
|
|
340612
|
-
if (fromText !== null) {
|
|
340613
|
-
return translate('from {from}', { from: fromText })
|
|
340614
|
-
}
|
|
340615
|
-
return translate('up to {to}', { to: toText })
|
|
340616
|
-
}
|
|
340617
|
-
|
|
340618
|
-
/**
|
|
340619
|
-
* Several value names as one list in the locale: "actief en verlopend",
|
|
340620
|
-
* "a, b en c". Joined with ", " where `Intl.ListFormat` is missing.
|
|
340621
|
-
*
|
|
340622
|
-
* @param {string[]} names The value names.
|
|
340623
|
-
* @param {string} [locale] BCP 47 locale; the environment's when omitted.
|
|
340624
|
-
* @return {string} The text.
|
|
340625
|
-
* @spec openspec/changes/index-filter-labels/specs/active-filter-line-board-look/spec.md#requirement-several-values-read-as-a-list
|
|
340626
|
-
*/
|
|
340627
|
-
function listText(names, locale) {
|
|
340628
|
-
if (names.length < 2 || typeof Intl.ListFormat !== 'function') {
|
|
340629
|
-
return names.join(', ')
|
|
340630
|
-
}
|
|
340631
|
-
try {
|
|
340632
|
-
return new Intl.ListFormat(locale, { type: 'conjunction' }).format(names)
|
|
340633
|
-
} catch {
|
|
340634
|
-
return names.join(', ')
|
|
340635
|
-
}
|
|
340636
|
-
}
|
|
340637
|
-
|
|
340638
|
-
const TODAY_TOKEN = /^@today(?:([+-])(\d+)d)?$/;
|
|
340639
|
-
|
|
340640
|
-
/**
|
|
340641
|
-
* A range end as a local date at midnight: a date string or an `@today`
|
|
340642
|
-
* token, read against `now`. Null for anything else.
|
|
340643
|
-
*
|
|
340644
|
-
* @param {unknown} value The end.
|
|
340645
|
-
* @param {Date} now What counts as now.
|
|
340646
|
-
* @return {Date|null} The date.
|
|
340647
|
-
*/
|
|
340648
|
-
function endDay(value, now) {
|
|
340649
|
-
if (typeof value === 'string') {
|
|
340650
|
-
const token = TODAY_TOKEN.exec(value);
|
|
340651
|
-
if (token) {
|
|
340652
|
-
const shift = token[1] ? Number(token[2]) * (token[1] === '-' ? -1 : 1) : 0;
|
|
340653
|
-
return new Date(now.getFullYear(), now.getMonth(), now.getDate() + shift)
|
|
340654
|
-
}
|
|
340655
|
-
}
|
|
340656
|
-
return asDate$1(value)
|
|
340657
|
-
}
|
|
340658
|
-
|
|
340659
|
-
/**
|
|
340660
|
-
* Whole days from one local date to another.
|
|
340661
|
-
*
|
|
340662
|
-
* @param {Date} a The first date.
|
|
340663
|
-
* @param {Date} b The second date.
|
|
340664
|
-
* @return {number} The days from `a` to `b`.
|
|
340665
|
-
*/
|
|
340666
|
-
function daysBetween(a, b) {
|
|
340667
|
-
return Math.round((Date.UTC(b.getFullYear(), b.getMonth(), b.getDate()) - Date.UTC(a.getFullYear(), a.getMonth(), a.getDate())) / 86400000)
|
|
340668
|
-
}
|
|
340669
|
-
|
|
340670
|
-
/**
|
|
340671
|
-
* A range from today named in words: "today", "within {n} days" or "this
|
|
340672
|
-
* week" (Monday to Sunday, or to next Monday). Null for any other range, so
|
|
340673
|
-
* the caller writes it as dates.
|
|
340674
|
-
*
|
|
340675
|
-
* @param {unknown} from The lower end: a date or an `@today` token.
|
|
340676
|
-
* @param {unknown} to The upper end: a date or an `@today` token.
|
|
340677
|
-
* @param {object} options Options.
|
|
340678
|
-
* @param {(text: string) => string} options.translate Translate.
|
|
340679
|
-
* @param {(one: string, many: string, count: number) => string} options.translatePlural Translate with a count.
|
|
340680
|
-
* @param {Date} [options.now] What counts as now.
|
|
340681
|
-
* @return {string|null} The words, or null.
|
|
340682
|
-
* @spec openspec/changes/index-filter-labels/specs/active-filter-line-board-look/spec.md#requirement-a-range-from-today-is-named-in-words
|
|
340683
|
-
*/
|
|
340684
|
-
function relativeRangeText(from, to, { translate, translatePlural, now = new Date() }) {
|
|
340685
|
-
const start = endDay(from, now);
|
|
340686
|
-
const end = endDay(to, now);
|
|
340687
|
-
if (!start || !end) {
|
|
340688
|
-
return null
|
|
340689
|
-
}
|
|
340690
|
-
const fromToday = daysBetween(now, start);
|
|
340691
|
-
const span = daysBetween(start, end);
|
|
340692
|
-
if (fromToday === 0 && (span === 0 || span === 1)) {
|
|
340693
|
-
return translate('today')
|
|
340694
|
-
}
|
|
340695
|
-
if (fromToday === 0 && span > 1) {
|
|
340696
|
-
return translatePlural('within %n day', 'within %n days', span)
|
|
340697
|
-
}
|
|
340698
|
-
const monday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - ((now.getDay() + 6) % 7));
|
|
340699
|
-
if (daysBetween(monday, start) === 0 && (span === 6 || span === 7)) {
|
|
340700
|
-
return translate('this week')
|
|
340701
|
-
}
|
|
340702
|
-
return null
|
|
340703
|
-
}
|
|
340704
|
-
|
|
340705
340944
|
/**
|
|
340706
340945
|
* SPDX-FileCopyrightText: 2026 Conduction B.V.
|
|
340707
340946
|
* SPDX-License-Identifier: EUPL-1.2
|
|
@@ -359288,7 +359527,24 @@ var script$20 = {
|
|
|
359288
359527
|
if (declared || !from || typeof from.field !== 'string' || from.field === '') {
|
|
359289
359528
|
return ''
|
|
359290
359529
|
}
|
|
359291
|
-
return JSON.stringify({ r: this.register, s: this.exportSchemaSlug, f: this.filter || null, q: from })
|
|
359530
|
+
return JSON.stringify({ r: this.register, s: this.exportSchemaSlug, f: this.filter || null, a: this.quickFiltersFromScope, q: from })
|
|
359531
|
+
},
|
|
359532
|
+
|
|
359533
|
+
/**
|
|
359534
|
+
* The active filters the `quickFiltersFrom` values are counted within,
|
|
359535
|
+
* without the field's own: a saved view's or default filters narrow the
|
|
359536
|
+
* tabs as they narrow the list, and picking a tab keeps the others.
|
|
359537
|
+
*
|
|
359538
|
+
* @return {object}
|
|
359539
|
+
* @spec openspec/changes/quick-filters-from-active-scope/specs/quick-filters-from-active-scope/spec.md#requirement-generated-quick-filters-count-within-the-active-filters
|
|
359540
|
+
*/
|
|
359541
|
+
quickFiltersFromScope() {
|
|
359542
|
+
const field = this.quickFiltersFrom && this.quickFiltersFrom.field;
|
|
359543
|
+
const scope = { ...(this.effectiveActiveFilters || {}) };
|
|
359544
|
+
if (field) {
|
|
359545
|
+
delete scope[field];
|
|
359546
|
+
}
|
|
359547
|
+
return scope
|
|
359292
359548
|
},
|
|
359293
359549
|
|
|
359294
359550
|
filterStripCountKey() {
|
|
@@ -362745,7 +363001,8 @@ var script$20 = {
|
|
|
362745
363001
|
|
|
362746
363002
|
/**
|
|
362747
363003
|
* Build the `quickFiltersFrom` tabs: the field's distinct values with
|
|
362748
|
-
* their counts
|
|
363004
|
+
* their counts within the page filter and the active filters (not the
|
|
363005
|
+
* field's own) in one grouped request, labelled through the
|
|
362749
363006
|
* reference-label resolver when the values are record ids. A failed
|
|
362750
363007
|
* request draws no tabs.
|
|
362751
363008
|
*
|
|
@@ -362764,7 +363021,7 @@ var script$20 = {
|
|
|
362764
363021
|
const ctx = typeof this.selfFetchTokenCtx === 'function' ? this.selfFetchTokenCtx() : {};
|
|
362765
363022
|
let groups;
|
|
362766
363023
|
try {
|
|
362767
|
-
groups = await fetchGroupedCounts({ register: this.register, schema, groupBy: from.field, filter: resolveFilterMap(this.filter, params, ctx) }, ctx);
|
|
363024
|
+
groups = await fetchGroupedCounts({ register: this.register, schema, groupBy: from.field, filter: { ...resolveFilterMap(this.filter, params, ctx), ...resolveFilterMap(this.quickFiltersFromScope, params, ctx) } }, ctx);
|
|
362768
363025
|
} catch {
|
|
362769
363026
|
groups = [];
|
|
362770
363027
|
}
|
|
@@ -445249,7 +445506,7 @@ function render$d(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
445249
445506
|
}
|
|
445250
445507
|
|
|
445251
445508
|
script$d.render = render$d;
|
|
445252
|
-
script$d.__scopeId = "data-v-
|
|
445509
|
+
script$d.__scopeId = "data-v-a251060e";
|
|
445253
445510
|
const __sfc_main$d = script$d;
|
|
445254
445511
|
|
|
445255
445512
|
let titleIdCounter = 0;
|