@conduction/nextcloud-vue 2.174.0 → 2.176.1
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/CnActionDialog/CnActionDialog.vue.js +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js +114 -11
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js +67 -17
- package/dist/esm/components/CnActionDialog/CnActionDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js +9 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue.js.map +1 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js +352 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue2.js.map +1 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js +266 -0
- package/dist/esm/components/CnBlockListEditor/CnBlockListEditor.vue3.js.map +1 -0
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue.js +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js +323 -7
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js +113 -59
- package/dist/esm/components/CnChecklistRunWidget/CnChecklistRunWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue.js +1 -1
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js +210 -5
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue2.js.map +1 -1
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js +134 -46
- package/dist/esm/components/CnChildRecordsField/CnChildRecordsField.vue3.js.map +1 -1
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js +9 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue.js.map +1 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js +385 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue2.js.map +1 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js +277 -0
- package/dist/esm/components/CnChoiceMatrix/CnChoiceMatrix.vue3.js.map +1 -0
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue.js +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js +175 -20
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js +30 -8
- package/dist/esm/components/CnCountdownWidget/CnCountdownWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue.js +1 -1
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js +72 -6
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js +48 -14
- package/dist/esm/components/CnCreateFormWidget/CnCreateFormWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue.js +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js +255 -10
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +70 -28
- 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/CnDisplayScreen/CnDisplayScreen.vue.js +9 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue.js.map +1 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js +175 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue2.js.map +1 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js +114 -0
- package/dist/esm/components/CnDisplayScreen/CnDisplayScreen.vue3.js.map +1 -0
- package/dist/esm/components/CnDurationField/CnDurationField.vue.js +1 -1
- package/dist/esm/components/CnDurationField/CnDurationField.vue2.js +218 -4
- package/dist/esm/components/CnDurationField/CnDurationField.vue2.js.map +1 -1
- package/dist/esm/components/CnDurationField/CnDurationField.vue3.js +133 -44
- package/dist/esm/components/CnDurationField/CnDurationField.vue3.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue.js +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js +5 -1
- package/dist/esm/components/CnFormDialog/CnFormDialog.vue3.js.map +1 -1
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js +9 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue.js.map +1 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js +113 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue2.js.map +1 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js +43 -0
- package/dist/esm/components/CnGeoCaptureField/CnGeoCaptureField.vue3.js.map +1 -0
- 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/CnMarkdownEditor/CnMarkdownEditor.vue.js +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js +110 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js +60 -18
- package/dist/esm/components/CnMarkdownEditor/CnMarkdownEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js +2 -2
- package/dist/esm/components/CnMenuTreeNode/CnMenuTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js +2 -2
- package/dist/esm/components/CnObjectKanban/CnObjectKanban.vue2.js.map +1 -1
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js +2 -2
- package/dist/esm/components/CnPageTreeNode/CnPageTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnQrCode/CnQrCode.vue.js +9 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue.js.map +1 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue2.js +241 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue2.js.map +1 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue3.js +75 -0
- package/dist/esm/components/CnQrCode/CnQrCode.vue3.js.map +1 -0
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue.js +1 -1
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js +34 -3
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue2.js.map +1 -1
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js +81 -19
- package/dist/esm/components/CnReadinessChecklist/CnReadinessChecklist.vue3.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue.js +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js +11 -0
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js +112 -88
- package/dist/esm/components/CnRecordListWidget/CnRecordListWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnRevealField/CnRevealField.vue.js +9 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue.js.map +1 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue2.js +157 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue2.js.map +1 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue3.js +116 -0
- package/dist/esm/components/CnRevealField/CnRevealField.vue3.js.map +1 -0
- 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/components/CnTextWidget/CnTextWidget.vue.js +1 -1
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js +43 -3
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js +19 -12
- package/dist/esm/components/CnTextWidget/CnTextWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js +9 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue.js.map +1 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js +87 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue2.js.map +1 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js +126 -0
- package/dist/esm/components/CnTransferCard/CnTransferCard.vue3.js.map +1 -0
- package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js +66 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +129 -29
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js +158 -6
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +100 -39
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +79 -14
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +79 -14
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +1162 -523
- package/dist/esm/node_modules/vuedraggable/dist/vuedraggable.umd.js +2 -2
- package/dist/esm/utils/captureLocation.js +32 -0
- package/dist/esm/utils/captureLocation.js.map +1 -0
- package/dist/esm/utils/childRecordTotals.js +157 -0
- package/dist/esm/utils/childRecordTotals.js.map +1 -0
- package/dist/esm/utils/isoDuration.js +51 -1
- package/dist/esm/utils/isoDuration.js.map +1 -1
- package/dist/esm/utils/parentCrumb.js +86 -0
- package/dist/esm/utils/parentCrumb.js.map +1 -0
- package/dist/esm/utils/qr.js +649 -0
- package/dist/esm/utils/qr.js.map +1 -0
- package/dist/esm/utils/schema.js +3 -0
- package/dist/esm/utils/schema.js.map +1 -1
- package/dist/esm/utils/templateVariables.js +54 -0
- package/dist/esm/utils/templateVariables.js.map +1 -0
- package/dist/nextcloud-vue.cjs.js +21125 -15025
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1162 -523
- package/l10n/en.json +79 -14
- package/l10n/nl.json +79 -14
- package/package.json +1 -1
- package/src/components/CnActionDialog/CnActionDialog.vue +156 -9
- package/src/components/CnBlockListEditor/CnBlockListEditor.vue +615 -0
- package/src/components/CnBlockListEditor/index.js +9 -0
- package/src/components/CnChecklistRunWidget/CnChecklistRunWidget.vue +377 -10
- package/src/components/CnChildRecordsField/CnChildRecordsField.vue +306 -15
- package/src/components/CnChoiceMatrix/CnChoiceMatrix.vue +710 -0
- package/src/components/CnChoiceMatrix/index.js +9 -0
- package/src/components/CnCountdownWidget/CnCountdownWidget.vue +223 -28
- package/src/components/CnCreateFormWidget/CnCreateFormWidget.vue +97 -6
- package/src/components/CnDataMatrix/CnDataMatrix.vue +304 -17
- package/src/components/CnDetailPage/CnDetailPage.vue +55 -6
- package/src/components/CnDisplayScreen/CnDisplayScreen.vue +308 -0
- package/src/components/CnDisplayScreen/index.js +9 -0
- package/src/components/CnDurationField/CnDurationField.vue +330 -5
- package/src/components/CnFormDialog/CnFormDialog.vue +4 -0
- package/src/components/CnGeoCaptureField/CnGeoCaptureField.vue +148 -0
- package/src/components/CnGeoCaptureField/index.js +9 -0
- package/src/components/CnIndexPage/CnIndexPage.vue +40 -1
- package/src/components/CnMarkdownEditor/CnMarkdownEditor.vue +139 -1
- package/src/components/CnQrCode/CnQrCode.vue +321 -0
- package/src/components/CnQrCode/index.js +9 -0
- package/src/components/CnReadinessChecklist/CnReadinessChecklist.vue +80 -3
- package/src/components/CnRecordListWidget/CnRecordListWidget.vue +34 -1
- package/src/components/CnRevealField/CnRevealField.vue +273 -0
- package/src/components/CnRevealField/index.js +9 -0
- package/src/components/CnStorePage/CnStorePage.vue +8 -8
- package/src/components/CnStorePage/CnStorePublishDialog.vue +7 -7
- package/src/components/CnTextWidget/CnTextWidget.vue +62 -3
- package/src/components/CnTransferCard/CnTransferCard.vue +205 -0
- package/src/components/CnTransferCard/index.js +9 -0
- package/src/components/CnTreeView/CnTreeNode.vue +145 -2
- package/src/components/CnTreeView/CnTreeView.vue +210 -6
- package/src/components/index.js +7 -0
- package/src/index.js +8 -0
- package/src/utils/captureLocation.js +29 -0
- package/src/utils/childRecordTotals.js +153 -0
- package/src/utils/isoDuration.js +50 -0
- package/src/utils/parentCrumb.js +83 -0
- package/src/utils/qr.js +681 -0
- package/src/utils/schema.js +3 -0
- package/src/utils/templateVariables.js +51 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import script from './CnGeoCaptureField.vue2.js';
|
|
2
|
+
import { render } from './CnGeoCaptureField.vue3.js';
|
|
3
|
+
|
|
4
|
+
script.render = render;
|
|
5
|
+
script.__scopeId = "data-v-03b514ef";
|
|
6
|
+
const __sfc_main = script;
|
|
7
|
+
|
|
8
|
+
export { __sfc_main as default };
|
|
9
|
+
//# sourceMappingURL=CnGeoCaptureField.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnGeoCaptureField.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
|
+
import { NcButton, NcTextField } from '@nextcloud/vue';
|
|
3
|
+
import { captureLocation } from '../../utils/captureLocation.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CnGeoCaptureField: the place something was recorded, captured from the
|
|
7
|
+
* device (board DqInspectie: "51.9012, 4.4831 · ±12 m · 10:52"). A fix whose
|
|
8
|
+
* accuracy is worse than `goodAccuracy`, or no fix at all, says so, offers a
|
|
9
|
+
* retry and takes an address by hand. The user can always carry on, and the
|
|
10
|
+
* value says how good it was through `low`.
|
|
11
|
+
*
|
|
12
|
+
* The value is `{ lat, lng, accuracy, at, low, address? }`, or null.
|
|
13
|
+
*
|
|
14
|
+
* ```vue
|
|
15
|
+
* <CnGeoCaptureField v-model="place" auto />
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* @event update:modelValue The new value.
|
|
19
|
+
* @spec openspec/changes/checklist-run-location/specs/checklist-run-location/spec.md#requirement-a-field-captures-where-something-was-recorded
|
|
20
|
+
*/
|
|
21
|
+
var script = {
|
|
22
|
+
name: 'CnGeoCaptureField',
|
|
23
|
+
|
|
24
|
+
components: { NcButton, NcTextField },
|
|
25
|
+
|
|
26
|
+
props: {
|
|
27
|
+
/** The captured place: `{ lat, lng, accuracy, at, low, address? }`, or null. */
|
|
28
|
+
modelValue: { type: Object, default: null },
|
|
29
|
+
/** Capture on mount when no value is held yet. */
|
|
30
|
+
auto: { type: Boolean, default: false },
|
|
31
|
+
/** A host is capturing; the field says it is looking. */
|
|
32
|
+
busy: { type: Boolean, default: false },
|
|
33
|
+
/** The accuracy in metres above which a fix counts as low. */
|
|
34
|
+
goodAccuracy: { type: Number, default: 50 },
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
emits: ['update:modelValue'],
|
|
38
|
+
|
|
39
|
+
data() {
|
|
40
|
+
return { capturing: false }
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
computed: {
|
|
44
|
+
/** @return {boolean} Whether a capture is under way. */
|
|
45
|
+
searching() {
|
|
46
|
+
return this.busy || this.capturing
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
/** @return {boolean} Whether the value has coordinates. */
|
|
50
|
+
hasFix() {
|
|
51
|
+
return Number.isFinite(this.modelValue?.lat) && Number.isFinite(this.modelValue?.lng)
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
/** @return {boolean} Whether the fix is missing or too rough. */
|
|
55
|
+
needsAddress() {
|
|
56
|
+
return !this.hasFix || this.modelValue.low === true
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
/** @return {string} The state of the capture in words. */
|
|
60
|
+
lineText() {
|
|
61
|
+
if (this.searching) {
|
|
62
|
+
return translate('nextcloud-vue', 'Looking for your location…')
|
|
63
|
+
}
|
|
64
|
+
if (!this.hasFix) {
|
|
65
|
+
return translate('nextcloud-vue', 'No location found. You can carry on, or add the address by hand.')
|
|
66
|
+
}
|
|
67
|
+
const accuracy = Math.round(this.modelValue.accuracy);
|
|
68
|
+
if (this.modelValue.low === true) {
|
|
69
|
+
return translate('nextcloud-vue', 'Location is inaccurate (±{accuracy} m). Wait for a better signal or add the address by hand.', { accuracy })
|
|
70
|
+
}
|
|
71
|
+
const time = new Date(this.modelValue.at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
|
72
|
+
return `${this.modelValue.lat.toFixed(4)}, ${this.modelValue.lng.toFixed(4)} · ±${accuracy} m · ${time}`
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
mounted() {
|
|
77
|
+
if (this.auto && !this.modelValue) {
|
|
78
|
+
this.retry();
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
methods: {
|
|
83
|
+
t: translate,
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Ask the device again. A fix replaces what is held, keeping a typed
|
|
87
|
+
* address; no fix keeps it all.
|
|
88
|
+
*
|
|
89
|
+
* @return {Promise<void>}
|
|
90
|
+
*/
|
|
91
|
+
async retry() {
|
|
92
|
+
this.capturing = true;
|
|
93
|
+
const fix = await captureLocation();
|
|
94
|
+
this.capturing = false;
|
|
95
|
+
if (fix) {
|
|
96
|
+
this.$emit('update:modelValue', { ...this.modelValue, ...fix, low: fix.accuracy > this.goodAccuracy });
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Keep the address typed by hand beside whatever fix there is.
|
|
102
|
+
*
|
|
103
|
+
* @param {string} address The address.
|
|
104
|
+
* @return {void}
|
|
105
|
+
*/
|
|
106
|
+
setAddress(address) {
|
|
107
|
+
this.$emit('update:modelValue', { low: true, ...this.modelValue, address });
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export { script as default };
|
|
113
|
+
//# sourceMappingURL=CnGeoCaptureField.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnGeoCaptureField.vue2.js","sources":["../../../../src/components/CnGeoCaptureField/CnGeoCaptureField.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-geo-capture\" data-testid=\"cn-geo-capture\">\n\t\t<p class=\"cn-geo-capture__line\" role=\"status\" data-testid=\"cn-geo-capture-line\">\n\t\t\t{{ lineText }}\n\t\t</p>\n\t\t<template v-if=\"!searching && needsAddress\">\n\t\t\t<NcButton variant=\"tertiary\" data-testid=\"cn-geo-capture-retry\" @click=\"retry\">\n\t\t\t\t{{ t('nextcloud-vue', 'Try again') }}\n\t\t\t</NcButton>\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"modelValue?.address || ''\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Address (by hand)')\"\n\t\t\t\tdata-testid=\"cn-geo-capture-address\"\n\t\t\t\t@update:modelValue=\"setAddress\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcTextField } from '@nextcloud/vue'\nimport { captureLocation } from '../../utils/captureLocation.js'\n\n/**\n * CnGeoCaptureField: the place something was recorded, captured from the\n * device (board DqInspectie: \"51.9012, 4.4831 · ±12 m · 10:52\"). A fix whose\n * accuracy is worse than `goodAccuracy`, or no fix at all, says so, offers a\n * retry and takes an address by hand. The user can always carry on, and the\n * value says how good it was through `low`.\n *\n * The value is `{ lat, lng, accuracy, at, low, address? }`, or null.\n *\n * ```vue\n * <CnGeoCaptureField v-model=\"place\" auto />\n * ```\n *\n * @event update:modelValue The new value.\n * @spec openspec/changes/checklist-run-location/specs/checklist-run-location/spec.md#requirement-a-field-captures-where-something-was-recorded\n */\nexport default {\n\tname: 'CnGeoCaptureField',\n\n\tcomponents: { NcButton, NcTextField },\n\n\tprops: {\n\t\t/** The captured place: `{ lat, lng, accuracy, at, low, address? }`, or null. */\n\t\tmodelValue: { type: Object, default: null },\n\t\t/** Capture on mount when no value is held yet. */\n\t\tauto: { type: Boolean, default: false },\n\t\t/** A host is capturing; the field says it is looking. */\n\t\tbusy: { type: Boolean, default: false },\n\t\t/** The accuracy in metres above which a fix counts as low. */\n\t\tgoodAccuracy: { type: Number, default: 50 },\n\t},\n\n\temits: ['update:modelValue'],\n\n\tdata() {\n\t\treturn { capturing: false }\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether a capture is under way. */\n\t\tsearching() {\n\t\t\treturn this.busy || this.capturing\n\t\t},\n\n\t\t/** @return {boolean} Whether the value has coordinates. */\n\t\thasFix() {\n\t\t\treturn Number.isFinite(this.modelValue?.lat) && Number.isFinite(this.modelValue?.lng)\n\t\t},\n\n\t\t/** @return {boolean} Whether the fix is missing or too rough. */\n\t\tneedsAddress() {\n\t\t\treturn !this.hasFix || this.modelValue.low === true\n\t\t},\n\n\t\t/** @return {string} The state of the capture in words. */\n\t\tlineText() {\n\t\t\tif (this.searching) {\n\t\t\t\treturn t('nextcloud-vue', 'Looking for your location…')\n\t\t\t}\n\t\t\tif (!this.hasFix) {\n\t\t\t\treturn t('nextcloud-vue', 'No location found. You can carry on, or add the address by hand.')\n\t\t\t}\n\t\t\tconst accuracy = Math.round(this.modelValue.accuracy)\n\t\t\tif (this.modelValue.low === true) {\n\t\t\t\treturn t('nextcloud-vue', 'Location is inaccurate (±{accuracy} m). Wait for a better signal or add the address by hand.', { accuracy })\n\t\t\t}\n\t\t\tconst time = new Date(this.modelValue.at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n\t\t\treturn `${this.modelValue.lat.toFixed(4)}, ${this.modelValue.lng.toFixed(4)} · ±${accuracy} m · ${time}`\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.auto && !this.modelValue) {\n\t\t\tthis.retry()\n\t\t}\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Ask the device again. A fix replaces what is held, keeping a typed\n\t\t * address; no fix keeps it all.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync retry() {\n\t\t\tthis.capturing = true\n\t\t\tconst fix = await captureLocation()\n\t\t\tthis.capturing = false\n\t\t\tif (fix) {\n\t\t\t\tthis.$emit('update:modelValue', { ...this.modelValue, ...fix, low: fix.accuracy > this.goodAccuracy })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Keep the address typed by hand beside whatever fix there is.\n\t\t *\n\t\t * @param {string} address The address.\n\t\t * @return {void}\n\t\t */\n\t\tsetAddress(address) {\n\t\t\tthis.$emit('update:modelValue', { low: true, ...this.modelValue, address })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-geo-capture {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-geo-capture__line {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-variant-numeric: tabular-nums;\n\tmargin: 0;\n}\n</style>\n"],"names":["t"],"mappings":"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"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, Fragment, createVNode, withCtx, createTextVNode, createCommentVNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
class: "cn-geo-capture",
|
|
5
|
+
"data-testid": "cn-geo-capture"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
class: "cn-geo-capture__line",
|
|
9
|
+
role: "status",
|
|
10
|
+
"data-testid": "cn-geo-capture-line"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
const _component_NcButton = resolveComponent("NcButton");
|
|
15
|
+
const _component_NcTextField = resolveComponent("NcTextField");
|
|
16
|
+
|
|
17
|
+
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
18
|
+
createElementVNode("p", _hoisted_2, toDisplayString($options.lineText), 1 /* TEXT */),
|
|
19
|
+
(!$options.searching && $options.needsAddress)
|
|
20
|
+
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
21
|
+
createVNode(_component_NcButton, {
|
|
22
|
+
variant: "tertiary",
|
|
23
|
+
"data-testid": "cn-geo-capture-retry",
|
|
24
|
+
onClick: $options.retry
|
|
25
|
+
}, {
|
|
26
|
+
default: withCtx(() => [
|
|
27
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Try again')), 1 /* TEXT */)
|
|
28
|
+
]),
|
|
29
|
+
_: 1 /* STABLE */
|
|
30
|
+
}, 8 /* PROPS */, ["onClick"]),
|
|
31
|
+
createVNode(_component_NcTextField, {
|
|
32
|
+
modelValue: $props.modelValue?.address || '',
|
|
33
|
+
label: $options.t('nextcloud-vue', 'Address (by hand)'),
|
|
34
|
+
"data-testid": "cn-geo-capture-address",
|
|
35
|
+
"onUpdate:modelValue": $options.setAddress
|
|
36
|
+
}, null, 8 /* PROPS */, ["modelValue", "label", "onUpdate:modelValue"])
|
|
37
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
38
|
+
: createCommentVNode("v-if", true)
|
|
39
|
+
]))
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { render };
|
|
43
|
+
//# sourceMappingURL=CnGeoCaptureField.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnGeoCaptureField.vue3.js","sources":["../../../../src/components/CnGeoCaptureField/CnGeoCaptureField.vue?vue&type=template&id=03b514ef&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-geo-capture\" data-testid=\"cn-geo-capture\">\n\t\t<p class=\"cn-geo-capture__line\" role=\"status\" data-testid=\"cn-geo-capture-line\">\n\t\t\t{{ lineText }}\n\t\t</p>\n\t\t<template v-if=\"!searching && needsAddress\">\n\t\t\t<NcButton variant=\"tertiary\" data-testid=\"cn-geo-capture-retry\" @click=\"retry\">\n\t\t\t\t{{ t('nextcloud-vue', 'Try again') }}\n\t\t\t</NcButton>\n\t\t\t<NcTextField\n\t\t\t\t:modelValue=\"modelValue?.address || ''\"\n\t\t\t\t:label=\"t('nextcloud-vue', 'Address (by hand)')\"\n\t\t\t\tdata-testid=\"cn-geo-capture-address\"\n\t\t\t\t@update:modelValue=\"setAddress\" />\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcTextField } from '@nextcloud/vue'\nimport { captureLocation } from '../../utils/captureLocation.js'\n\n/**\n * CnGeoCaptureField: the place something was recorded, captured from the\n * device (board DqInspectie: \"51.9012, 4.4831 · ±12 m · 10:52\"). A fix whose\n * accuracy is worse than `goodAccuracy`, or no fix at all, says so, offers a\n * retry and takes an address by hand. The user can always carry on, and the\n * value says how good it was through `low`.\n *\n * The value is `{ lat, lng, accuracy, at, low, address? }`, or null.\n *\n * ```vue\n * <CnGeoCaptureField v-model=\"place\" auto />\n * ```\n *\n * @event update:modelValue The new value.\n * @spec openspec/changes/checklist-run-location/specs/checklist-run-location/spec.md#requirement-a-field-captures-where-something-was-recorded\n */\nexport default {\n\tname: 'CnGeoCaptureField',\n\n\tcomponents: { NcButton, NcTextField },\n\n\tprops: {\n\t\t/** The captured place: `{ lat, lng, accuracy, at, low, address? }`, or null. */\n\t\tmodelValue: { type: Object, default: null },\n\t\t/** Capture on mount when no value is held yet. */\n\t\tauto: { type: Boolean, default: false },\n\t\t/** A host is capturing; the field says it is looking. */\n\t\tbusy: { type: Boolean, default: false },\n\t\t/** The accuracy in metres above which a fix counts as low. */\n\t\tgoodAccuracy: { type: Number, default: 50 },\n\t},\n\n\temits: ['update:modelValue'],\n\n\tdata() {\n\t\treturn { capturing: false }\n\t},\n\n\tcomputed: {\n\t\t/** @return {boolean} Whether a capture is under way. */\n\t\tsearching() {\n\t\t\treturn this.busy || this.capturing\n\t\t},\n\n\t\t/** @return {boolean} Whether the value has coordinates. */\n\t\thasFix() {\n\t\t\treturn Number.isFinite(this.modelValue?.lat) && Number.isFinite(this.modelValue?.lng)\n\t\t},\n\n\t\t/** @return {boolean} Whether the fix is missing or too rough. */\n\t\tneedsAddress() {\n\t\t\treturn !this.hasFix || this.modelValue.low === true\n\t\t},\n\n\t\t/** @return {string} The state of the capture in words. */\n\t\tlineText() {\n\t\t\tif (this.searching) {\n\t\t\t\treturn t('nextcloud-vue', 'Looking for your location…')\n\t\t\t}\n\t\t\tif (!this.hasFix) {\n\t\t\t\treturn t('nextcloud-vue', 'No location found. You can carry on, or add the address by hand.')\n\t\t\t}\n\t\t\tconst accuracy = Math.round(this.modelValue.accuracy)\n\t\t\tif (this.modelValue.low === true) {\n\t\t\t\treturn t('nextcloud-vue', 'Location is inaccurate (±{accuracy} m). Wait for a better signal or add the address by hand.', { accuracy })\n\t\t\t}\n\t\t\tconst time = new Date(this.modelValue.at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n\t\t\treturn `${this.modelValue.lat.toFixed(4)}, ${this.modelValue.lng.toFixed(4)} · ±${accuracy} m · ${time}`\n\t\t},\n\t},\n\n\tmounted() {\n\t\tif (this.auto && !this.modelValue) {\n\t\t\tthis.retry()\n\t\t}\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Ask the device again. A fix replaces what is held, keeping a typed\n\t\t * address; no fix keeps it all.\n\t\t *\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync retry() {\n\t\t\tthis.capturing = true\n\t\t\tconst fix = await captureLocation()\n\t\t\tthis.capturing = false\n\t\t\tif (fix) {\n\t\t\t\tthis.$emit('update:modelValue', { ...this.modelValue, ...fix, low: fix.accuracy > this.goodAccuracy })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Keep the address typed by hand beside whatever fix there is.\n\t\t *\n\t\t * @param {string} address The address.\n\t\t * @return {void}\n\t\t */\n\t\tsetAddress(address) {\n\t\t\tthis.$emit('update:modelValue', { low: true, ...this.modelValue, address })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-geo-capture {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-geo-capture__line {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-variant-numeric: tabular-nums;\n\tmargin: 0;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createElementVNode","_toDisplayString","_createVNode"],"mappings":";;;AASM,EAAA,KAAI,EAAE,gBAAe;AAAE,EAAA,aAAW,EAAC,gBAAI;;;AACxC,EAAA,KAAK,EAAC,sBAAsB;AAAC,EAAA,IAAI,EAAC,QAAQ;AAAC,EAAA,aAAW,EAAC,qBAAqB;;;;;;;AAD/E,EAAA,QAAAA,SAAA,EAAA,EAAAC,kBAAA,QAAA;IACCC,kBAEG,CAAA,GAAA,EAFH,UAEG,EAAAC,eAAA,CADC,QAAO,CAAA,QAAA,CAAA,EAAA,CAAA,YAAA;AAEA,IAAA,CAAA,CAAA,QAAA,CAAA,SAAA,IAAA,QAAA,CAAA,YAAA;;UACVC,WAEU,CAAA,mBAAA,EAAA;AAFD,YAAA,OAAO,EAAC,UAAU;AAAC,YAAA,aAAU,EAAA,sBAAA;AAAA,YAAA,OAAA,EAAA,QAAA,CAAA,KAAA;;6BACtC,MAAqC;8CAAlC,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,WAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;UAEJA;YACC,UAAO,EAAA,MAAA,CAAA,UAAA,EAAA,OAAA,IAAA,EAAA;AACP,YAAA,KAAC,EAAA,QAAA,CAAA,CAAA,CAAA,eAAA,EAAA,mBAAA,CAAA;;;;;;;;;;;"}
|
|
@@ -952,6 +952,21 @@ var script = {
|
|
|
952
952
|
default: null,
|
|
953
953
|
},
|
|
954
954
|
|
|
955
|
+
/**
|
|
956
|
+
* Text added to the count line after a middle dot while a quick filter
|
|
957
|
+
* or lens is selected (manifest `config.countSuffixByFilter`),
|
|
958
|
+
* `{ <tab id or label>: text }`: a lens that sorts by waiting time
|
|
959
|
+
* says "longest waiting first". A quick filter tab can also carry
|
|
960
|
+
* its own `countSuffix`, which comes first. The text goes through the
|
|
961
|
+
* host translate function. Null (the default) adds nothing.
|
|
962
|
+
*
|
|
963
|
+
* @spec openspec/changes/index-count-suffix-per-filter/specs/index-page/spec.md#requirement-the-count-line-can-say-what-the-selected-quick-filter-does
|
|
964
|
+
*/
|
|
965
|
+
countSuffixByFilter: {
|
|
966
|
+
type: Object,
|
|
967
|
+
default: null,
|
|
968
|
+
},
|
|
969
|
+
|
|
955
970
|
/**
|
|
956
971
|
* The property keys the card's facts list shows, in order (manifest key
|
|
957
972
|
* `config.cardFields`). Without it the board look shows the first four
|
|
@@ -7870,7 +7885,8 @@ var script = {
|
|
|
7870
7885
|
* @return {string}
|
|
7871
7886
|
*/
|
|
7872
7887
|
headerDescription() {
|
|
7873
|
-
const
|
|
7888
|
+
const suffix = this.quickFilterCountSuffix;
|
|
7889
|
+
const base = suffix && this.headerDescriptionBase ? `${this.headerDescriptionBase} · ${suffix}` : this.headerDescriptionBase;
|
|
7874
7890
|
if (this.currentViewMode !== 'map' || !this.mapListEnabled) {
|
|
7875
7891
|
return base
|
|
7876
7892
|
}
|
|
@@ -7892,6 +7908,29 @@ var script = {
|
|
|
7892
7908
|
return active || this.quickFilterNarrows
|
|
7893
7909
|
},
|
|
7894
7910
|
|
|
7911
|
+
/**
|
|
7912
|
+
* The count line text of the selected quick filters or lenses: each
|
|
7913
|
+
* tab's `countSuffix`, else its entry in `countSuffixByFilter` (by
|
|
7914
|
+
* id, then by label), translated and joined by a middle dot.
|
|
7915
|
+
*
|
|
7916
|
+
* @return {string}
|
|
7917
|
+
* @spec openspec/changes/index-count-suffix-per-filter/specs/index-page/spec.md#requirement-the-count-line-can-say-what-the-selected-quick-filter-does
|
|
7918
|
+
*/
|
|
7919
|
+
quickFilterCountSuffix() {
|
|
7920
|
+
const tabs = this.tabStripEntries || [];
|
|
7921
|
+
const byFilter = this.countSuffixByFilter && typeof this.countSuffixByFilter === 'object' ? this.countSuffixByFilter : {};
|
|
7922
|
+
const indices = this.quickFilterMultiple
|
|
7923
|
+
? (this.selectedQuickFilterIndices || [])
|
|
7924
|
+
: [this.activeQuickFilterIndex];
|
|
7925
|
+
return indices
|
|
7926
|
+
.map((index) => (typeof index === 'number' ? tabs[index] : null))
|
|
7927
|
+
.filter(Boolean)
|
|
7928
|
+
.map((tab) => [tab.countSuffix, byFilter[tab.id], byFilter[tab.label]].find((text) => typeof text === 'string' && text !== ''))
|
|
7929
|
+
.filter(Boolean)
|
|
7930
|
+
.map((text) => this.cnTranslate(text))
|
|
7931
|
+
.join(' · ')
|
|
7932
|
+
},
|
|
7933
|
+
|
|
7895
7934
|
/**
|
|
7896
7935
|
* Whether a selected quick filter tab carries a filter (an "All" tab
|
|
7897
7936
|
* does not).
|