@conduction/nextcloud-vue 2.56.0-beta.70 → 2.56.0-beta.72
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/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +67 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +93 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +11 -9
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +55 -6
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnIndexPage/CnIndexPage.vue2.js +40 -1
- 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/CnStorePage/CnStorePage.vue.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue2.js +3 -3
- package/dist/esm/components/CnStorePage/CnStorePage.vue2.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePage.vue3.js +5 -5
- package/dist/esm/components/CnStorePage/CnStorePage.vue3.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue2.js +6 -6
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue3.js +1 -1
- package/dist/esm/components/CnStorePage/CnStorePublishDialog.vue3.js.map +1 -1
- package/dist/esm/l10n/en.json.js +62 -59
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +62 -59
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +82 -78
- package/dist/esm/utils/parentCrumb.js +86 -0
- package/dist/esm/utils/parentCrumb.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +923 -586
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +82 -78
- package/l10n/en.json +62 -59
- package/l10n/nl.json +62 -59
- package/package.json +1 -1
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +67 -1
- package/src/components/CnDataMatrix/CnDataMatrix.vue +105 -4
- package/src/components/CnDetailPage/CnDetailPage.vue +55 -6
- package/src/components/CnIndexPage/CnIndexPage.vue +40 -1
- package/src/components/CnStorePage/CnStorePage.vue +8 -8
- package/src/components/CnStorePage/CnStorePublishDialog.vue +7 -7
- package/src/utils/parentCrumb.js +83 -0
|
@@ -2,7 +2,7 @@ import script from './CnChecklistRunWidget.vue2.js';
|
|
|
2
2
|
import { render } from './CnChecklistRunWidget.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-e9adfb50";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|
|
@@ -141,6 +141,8 @@ function clockOf(seconds) {
|
|
|
141
141
|
* follows that moment rather than the page's start, so a reload keeps it. At
|
|
142
142
|
* zero the page is saved and the run finishes. `submitLabel` adds a button
|
|
143
143
|
* that finishes from any page, and `savedText` says so while nothing is unsaved.
|
|
144
|
+
* `saveEachAnswer: true` (or a wait in ms) saves each answer a moment after
|
|
145
|
+
* it is given instead of when the user moves on.
|
|
144
146
|
*
|
|
145
147
|
* `noteWhen: { answers: [...] }` shows a question's note field only once its
|
|
146
148
|
* answer is one of those stored values (the board shows a note under "Nee"),
|
|
@@ -189,7 +191,8 @@ var script = {
|
|
|
189
191
|
* answers | answersPath, answerKey?, answerFields?, recordPhotosField?,
|
|
190
192
|
* record?, saveAction?, finishAction?, pageSize?, allowNote?, noteWhen?,
|
|
191
193
|
* allowPhotos?, caption?, emptyText?, deadlineField?, serverNowField?,
|
|
192
|
-
* timeLeftText?, timeWarningSeconds?, savedText?, submitLabel
|
|
194
|
+
* timeLeftText?, timeWarningSeconds?, savedText?, submitLabel?,
|
|
195
|
+
* saveEachAnswer? }`, as in the component
|
|
193
196
|
* description and docs/components/cn-checklist-run-widget.md.
|
|
194
197
|
*
|
|
195
198
|
* @type {object}
|
|
@@ -258,11 +261,29 @@ var script = {
|
|
|
258
261
|
now: Date.now(),
|
|
259
262
|
recordReadAt: Date.now(),
|
|
260
263
|
deadlineTimer: null,
|
|
264
|
+
// `saveEachAnswer`: the pending save, and the save that runs now.
|
|
265
|
+
answerSaveTimer: null,
|
|
266
|
+
pageSave: null,
|
|
261
267
|
finishedRun: false,
|
|
262
268
|
}
|
|
263
269
|
},
|
|
264
270
|
|
|
265
271
|
computed: {
|
|
272
|
+
/**
|
|
273
|
+
* The wait before an answer saves on its own (`saveEachAnswer`: `true`
|
|
274
|
+
* waits 800 ms, a number that many ms), or null to save on moving on.
|
|
275
|
+
*
|
|
276
|
+
* @return {number|null}
|
|
277
|
+
* @spec openspec/changes/checklist-run-save-each-answer/specs/checklist-run-widget/spec.md#requirement-a-run-can-save-each-answer-as-it-is-given
|
|
278
|
+
*/
|
|
279
|
+
answerSaveDelay() {
|
|
280
|
+
const option = this.content?.saveEachAnswer;
|
|
281
|
+
if (option === true) {
|
|
282
|
+
return 800
|
|
283
|
+
}
|
|
284
|
+
return typeof option === 'number' && option >= 0 ? option : null
|
|
285
|
+
},
|
|
286
|
+
|
|
266
287
|
/** @return {object} What the tokens resolve against. */
|
|
267
288
|
tokenCtx() {
|
|
268
289
|
const unwrap = (c) => (c && typeof c === 'object' && 'value' in c ? c.value : c);
|
|
@@ -572,6 +593,11 @@ var script = {
|
|
|
572
593
|
|
|
573
594
|
beforeUnmount() {
|
|
574
595
|
clearInterval(this.deadlineTimer);
|
|
596
|
+
if (this.answerSaveTimer) {
|
|
597
|
+
clearTimeout(this.answerSaveTimer);
|
|
598
|
+
this.answerSaveTimer = null;
|
|
599
|
+
this.savePage();
|
|
600
|
+
}
|
|
575
601
|
},
|
|
576
602
|
|
|
577
603
|
methods: {
|
|
@@ -929,6 +955,26 @@ var script = {
|
|
|
929
955
|
this.dirty = { ...this.dirty, [id]: true };
|
|
930
956
|
this.missing = this.missing.filter((m) => m !== id);
|
|
931
957
|
this.startLocating(id);
|
|
958
|
+
this.scheduleAnswerSave();
|
|
959
|
+
},
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* With `saveEachAnswer`, save the page a moment after the last change,
|
|
963
|
+
* so typing saves once and a quick run of answers saves together.
|
|
964
|
+
*
|
|
965
|
+
* @return {void}
|
|
966
|
+
* @spec openspec/changes/checklist-run-save-each-answer/specs/checklist-run-widget/spec.md#requirement-a-run-can-save-each-answer-as-it-is-given
|
|
967
|
+
*/
|
|
968
|
+
scheduleAnswerSave() {
|
|
969
|
+
const delay = this.answerSaveDelay;
|
|
970
|
+
if (delay === null) {
|
|
971
|
+
return
|
|
972
|
+
}
|
|
973
|
+
clearTimeout(this.answerSaveTimer);
|
|
974
|
+
this.answerSaveTimer = setTimeout(() => {
|
|
975
|
+
this.answerSaveTimer = null;
|
|
976
|
+
this.savePage();
|
|
977
|
+
}, delay);
|
|
932
978
|
},
|
|
933
979
|
|
|
934
980
|
/**
|
|
@@ -961,6 +1007,7 @@ var script = {
|
|
|
961
1007
|
setLocation(id, location) {
|
|
962
1008
|
this.draft[id].location = location;
|
|
963
1009
|
this.dirty = { ...this.dirty, [id]: true };
|
|
1010
|
+
this.scheduleAnswerSave();
|
|
964
1011
|
},
|
|
965
1012
|
|
|
966
1013
|
/**
|
|
@@ -992,6 +1039,7 @@ var script = {
|
|
|
992
1039
|
}
|
|
993
1040
|
this.photos = { ...this.photos, [id]: [...(this.photos[id] || []), ...files] };
|
|
994
1041
|
this.dirty = { ...this.dirty, [id]: true };
|
|
1042
|
+
this.scheduleAnswerSave();
|
|
995
1043
|
this.missingPhoto = this.missingPhoto.filter((m) => m !== id);
|
|
996
1044
|
if (event.target) {
|
|
997
1045
|
event.target.value = '';
|
|
@@ -1007,6 +1055,24 @@ var script = {
|
|
|
1007
1055
|
* @spec openspec/changes/checklist-run-widget/specs/checklist-run-widget/spec.md#requirement-answers-are-saved-under-the-readers-own-rights
|
|
1008
1056
|
*/
|
|
1009
1057
|
async savePage() {
|
|
1058
|
+
// One save at a time, so an answer is never created twice.
|
|
1059
|
+
while (this.pageSave) {
|
|
1060
|
+
await this.pageSave;
|
|
1061
|
+
}
|
|
1062
|
+
this.pageSave = this.savePageNow();
|
|
1063
|
+
try {
|
|
1064
|
+
return await this.pageSave
|
|
1065
|
+
} finally {
|
|
1066
|
+
this.pageSave = null;
|
|
1067
|
+
}
|
|
1068
|
+
},
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* Save the changed answers of this page now (see `savePage`).
|
|
1072
|
+
*
|
|
1073
|
+
* @return {Promise<boolean>} True when everything saved.
|
|
1074
|
+
*/
|
|
1075
|
+
async savePageNow() {
|
|
1010
1076
|
const changed = this.pageQuestions.filter((q) => this.dirty[q.id]);
|
|
1011
1077
|
if (changed.length === 0) {
|
|
1012
1078
|
return true
|