@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 './CnRevealField.vue2.js';
|
|
2
|
+
import { render } from './CnRevealField.vue3.js';
|
|
3
|
+
|
|
4
|
+
script.render = render;
|
|
5
|
+
script.__scopeId = "data-v-bd786526";
|
|
6
|
+
const __sfc_main = script;
|
|
7
|
+
|
|
8
|
+
export { __sfc_main as default };
|
|
9
|
+
//# sourceMappingURL=CnRevealField.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnRevealField.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
|
+
import { NcButton, NcLoadingIcon, NcTextField } from '@nextcloud/vue';
|
|
3
|
+
|
|
4
|
+
let uid = 0;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* CnRevealField — a protected value shown masked until the user asks to see
|
|
8
|
+
* it (board DqContact: "BSN *****4001 Tonen", "Het tonen van het BSN wordt
|
|
9
|
+
* gelogd.").
|
|
10
|
+
*
|
|
11
|
+
* The component never holds the value until the user asks: `load` fetches it
|
|
12
|
+
* on every reveal, so the server can log each viewing. With `requireReason`
|
|
13
|
+
* the user first states why, and `load` receives that reason. Hide masks the
|
|
14
|
+
* value again and drops it; the next Show calls `load` again.
|
|
15
|
+
*
|
|
16
|
+
* ```vue
|
|
17
|
+
* <CnRevealField
|
|
18
|
+
* label="BSN"
|
|
19
|
+
* masked-value="*****4001"
|
|
20
|
+
* :load="(reason) => api.revealBsn(person.id, reason)"
|
|
21
|
+
* require-reason
|
|
22
|
+
* note="Het tonen van het BSN wordt gelogd." />
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @event revealed Emitted once the value shows, with `{ reason }`.
|
|
26
|
+
* @event hidden Emitted when the user masks the value again.
|
|
27
|
+
*/
|
|
28
|
+
var script = {
|
|
29
|
+
name: 'CnRevealField',
|
|
30
|
+
|
|
31
|
+
components: {
|
|
32
|
+
NcButton,
|
|
33
|
+
NcLoadingIcon,
|
|
34
|
+
NcTextField,
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
props: {
|
|
38
|
+
/** What the value is, already translated ("BSN"). */
|
|
39
|
+
label: { type: String, required: true },
|
|
40
|
+
/** What shows while the value is hidden, such as the last digits behind stars. */
|
|
41
|
+
maskedValue: { type: String, default: '••••••' },
|
|
42
|
+
/**
|
|
43
|
+
* Fetches the value: `(reason) => string | Promise<string>`. Called on
|
|
44
|
+
* every reveal; `reason` is '' unless `requireReason` is set.
|
|
45
|
+
*/
|
|
46
|
+
load: { type: Function, required: true },
|
|
47
|
+
/** Ask why the user needs the value before it is fetched. */
|
|
48
|
+
requireReason: { type: Boolean, default: false },
|
|
49
|
+
/** Label of the reason field, already translated; the library default is "Why do you need to see this?". */
|
|
50
|
+
reasonLabel: { type: String, default: '' },
|
|
51
|
+
/** A line under the value, already translated, such as that showing it is logged. */
|
|
52
|
+
note: { type: String, default: '' },
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
emits: ['revealed', 'hidden'],
|
|
56
|
+
|
|
57
|
+
data() {
|
|
58
|
+
uid += 1;
|
|
59
|
+
return {
|
|
60
|
+
labelId: `cn-reveal-field-${uid}`,
|
|
61
|
+
revealed: false,
|
|
62
|
+
revealedValue: '',
|
|
63
|
+
askingReason: false,
|
|
64
|
+
reason: '',
|
|
65
|
+
loading: false,
|
|
66
|
+
error: '',
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
methods: {
|
|
71
|
+
t: translate,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Show or hide the value. Showing asks the reason first when
|
|
75
|
+
* `requireReason` is set.
|
|
76
|
+
*
|
|
77
|
+
* @return {Promise<void>|void}
|
|
78
|
+
*/
|
|
79
|
+
toggle() {
|
|
80
|
+
if (this.revealed) {
|
|
81
|
+
this.hide();
|
|
82
|
+
return undefined
|
|
83
|
+
}
|
|
84
|
+
if (this.requireReason) {
|
|
85
|
+
this.askingReason = true;
|
|
86
|
+
this.error = '';
|
|
87
|
+
this.$nextTick(() => this.$refs.reasonField?.focus?.());
|
|
88
|
+
return undefined
|
|
89
|
+
}
|
|
90
|
+
return this.reveal('')
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Reveal with the typed reason.
|
|
95
|
+
*
|
|
96
|
+
* @return {Promise<void>|void}
|
|
97
|
+
*/
|
|
98
|
+
submitReason() {
|
|
99
|
+
const reason = this.reason.trim();
|
|
100
|
+
if (reason === '') {
|
|
101
|
+
return undefined
|
|
102
|
+
}
|
|
103
|
+
return this.reveal(reason)
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Close the reason form without fetching.
|
|
108
|
+
*
|
|
109
|
+
* @return {void}
|
|
110
|
+
*/
|
|
111
|
+
cancelReason() {
|
|
112
|
+
this.askingReason = false;
|
|
113
|
+
this.reason = '';
|
|
114
|
+
},
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Fetch the value through `load` and show it; a failure keeps the
|
|
118
|
+
* value masked and says so.
|
|
119
|
+
*
|
|
120
|
+
* @param {string} reason Why the user asked, or ''.
|
|
121
|
+
* @return {Promise<void>}
|
|
122
|
+
*/
|
|
123
|
+
async reveal(reason) {
|
|
124
|
+
this.loading = true;
|
|
125
|
+
this.error = '';
|
|
126
|
+
try {
|
|
127
|
+
const value = await this.load(reason);
|
|
128
|
+
if (value === null || value === undefined || value === '') {
|
|
129
|
+
throw new Error('empty')
|
|
130
|
+
}
|
|
131
|
+
this.revealedValue = String(value);
|
|
132
|
+
this.revealed = true;
|
|
133
|
+
this.askingReason = false;
|
|
134
|
+
this.reason = '';
|
|
135
|
+
this.$emit('revealed', { reason });
|
|
136
|
+
} catch {
|
|
137
|
+
this.error = translate('nextcloud-vue', 'The value could not be shown. Try again later.');
|
|
138
|
+
} finally {
|
|
139
|
+
this.loading = false;
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Mask the value again and drop it.
|
|
145
|
+
*
|
|
146
|
+
* @return {void}
|
|
147
|
+
*/
|
|
148
|
+
hide() {
|
|
149
|
+
this.revealed = false;
|
|
150
|
+
this.revealedValue = '';
|
|
151
|
+
this.$emit('hidden');
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export { script as default };
|
|
157
|
+
//# sourceMappingURL=CnRevealField.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnRevealField.vue2.js","sources":["../../../../src/components/CnRevealField/CnRevealField.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n<template>\n\t<div class=\"cn-reveal-field\" data-testid=\"cn-reveal-field\">\n\t\t<div class=\"cn-reveal-field__row\">\n\t\t\t<span :id=\"labelId\" class=\"cn-reveal-field__label\">{{ label }}</span>\n\t\t\t<span\n\t\t\t\tclass=\"cn-reveal-field__value\"\n\t\t\t\t:class=\"{ 'cn-reveal-field__value--masked': !revealed }\"\n\t\t\t\t:aria-labelledby=\"labelId\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t\tdata-testid=\"cn-reveal-value\">{{ revealed ? revealedValue : maskedValue }}</span>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"!askingReason\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:aria-label=\"revealed ? t('nextcloud-vue', 'Hide {label}', { label }) : t('nextcloud-vue', 'Show {label}', { label })\"\n\t\t\t\t:disabled=\"loading\"\n\t\t\t\tdata-testid=\"cn-reveal-toggle\"\n\t\t\t\t@click=\"toggle\">\n\t\t\t\t<template v-if=\"loading\" #icon>\n\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ revealed ? t('nextcloud-vue', 'Hide') : t('nextcloud-vue', 'Show') }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<form\n\t\t\tv-if=\"askingReason\"\n\t\t\tclass=\"cn-reveal-field__reason\"\n\t\t\tdata-testid=\"cn-reveal-reason\"\n\t\t\t@submit.prevent=\"submitReason\">\n\t\t\t<NcTextField\n\t\t\t\tref=\"reasonField\"\n\t\t\t\t:modelValue=\"reason\"\n\t\t\t\t:label=\"reasonLabel || t('nextcloud-vue', 'Why do you need to see this?')\"\n\t\t\t\trequired\n\t\t\t\tdata-testid=\"cn-reveal-reason-input\"\n\t\t\t\t@update:modelValue=\"reason = $event\" />\n\t\t\t<div class=\"cn-reveal-field__reason-actions\">\n\t\t\t\t<NcButton variant=\"tertiary\" data-testid=\"cn-reveal-reason-cancel\" @click=\"cancelReason\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:disabled=\"reason.trim() === '' || loading\"\n\t\t\t\t\tdata-testid=\"cn-reveal-reason-submit\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Show') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</form>\n\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-reveal-field__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-reveal-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<p v-if=\"note\" class=\"cn-reveal-field__note\" data-testid=\"cn-reveal-note\">\n\t\t\t{{ note }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon, NcTextField } from '@nextcloud/vue'\n\nlet uid = 0\n\n/**\n * CnRevealField — a protected value shown masked until the user asks to see\n * it (board DqContact: \"BSN *****4001 Tonen\", \"Het tonen van het BSN wordt\n * gelogd.\").\n *\n * The component never holds the value until the user asks: `load` fetches it\n * on every reveal, so the server can log each viewing. With `requireReason`\n * the user first states why, and `load` receives that reason. Hide masks the\n * value again and drops it; the next Show calls `load` again.\n *\n * ```vue\n * <CnRevealField\n * label=\"BSN\"\n * masked-value=\"*****4001\"\n * :load=\"(reason) => api.revealBsn(person.id, reason)\"\n * require-reason\n * note=\"Het tonen van het BSN wordt gelogd.\" />\n * ```\n *\n * @event revealed Emitted once the value shows, with `{ reason }`.\n * @event hidden Emitted when the user masks the value again.\n */\nexport default {\n\tname: 'CnRevealField',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t\tNcTextField,\n\t},\n\n\tprops: {\n\t\t/** What the value is, already translated (\"BSN\"). */\n\t\tlabel: { type: String, required: true },\n\t\t/** What shows while the value is hidden, such as the last digits behind stars. */\n\t\tmaskedValue: { type: String, default: '••••••' },\n\t\t/**\n\t\t * Fetches the value: `(reason) => string | Promise<string>`. Called on\n\t\t * every reveal; `reason` is '' unless `requireReason` is set.\n\t\t */\n\t\tload: { type: Function, required: true },\n\t\t/** Ask why the user needs the value before it is fetched. */\n\t\trequireReason: { type: Boolean, default: false },\n\t\t/** Label of the reason field, already translated; the library default is \"Why do you need to see this?\". */\n\t\treasonLabel: { type: String, default: '' },\n\t\t/** A line under the value, already translated, such as that showing it is logged. */\n\t\tnote: { type: String, default: '' },\n\t},\n\n\temits: ['revealed', 'hidden'],\n\n\tdata() {\n\t\tuid += 1\n\t\treturn {\n\t\t\tlabelId: `cn-reveal-field-${uid}`,\n\t\t\trevealed: false,\n\t\t\trevealedValue: '',\n\t\t\taskingReason: false,\n\t\t\treason: '',\n\t\t\tloading: false,\n\t\t\terror: '',\n\t\t}\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Show or hide the value. Showing asks the reason first when\n\t\t * `requireReason` is set.\n\t\t *\n\t\t * @return {Promise<void>|void}\n\t\t */\n\t\ttoggle() {\n\t\t\tif (this.revealed) {\n\t\t\t\tthis.hide()\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (this.requireReason) {\n\t\t\t\tthis.askingReason = true\n\t\t\t\tthis.error = ''\n\t\t\t\tthis.$nextTick(() => this.$refs.reasonField?.focus?.())\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.reveal('')\n\t\t},\n\n\t\t/**\n\t\t * Reveal with the typed reason.\n\t\t *\n\t\t * @return {Promise<void>|void}\n\t\t */\n\t\tsubmitReason() {\n\t\t\tconst reason = this.reason.trim()\n\t\t\tif (reason === '') {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.reveal(reason)\n\t\t},\n\n\t\t/**\n\t\t * Close the reason form without fetching.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancelReason() {\n\t\t\tthis.askingReason = false\n\t\t\tthis.reason = ''\n\t\t},\n\n\t\t/**\n\t\t * Fetch the value through `load` and show it; a failure keeps the\n\t\t * value masked and says so.\n\t\t *\n\t\t * @param {string} reason Why the user asked, or ''.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync reveal(reason) {\n\t\t\tthis.loading = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst value = await this.load(reason)\n\t\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\t\tthrow new Error('empty')\n\t\t\t\t}\n\t\t\t\tthis.revealedValue = String(value)\n\t\t\t\tthis.revealed = true\n\t\t\t\tthis.askingReason = false\n\t\t\t\tthis.reason = ''\n\t\t\t\tthis.$emit('revealed', { reason })\n\t\t\t} catch {\n\t\t\t\tthis.error = t('nextcloud-vue', 'The value could not be shown. Try again later.')\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Mask the value again and drop it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\thide() {\n\t\t\tthis.revealed = false\n\t\t\tthis.revealedValue = ''\n\t\t\tthis.$emit('hidden')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-reveal-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-reveal-field__row {\n\talign-items: center;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 12px;\n}\n\n.cn-reveal-field__label {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-reveal-field__value {\n\tfont-variant-numeric: tabular-nums;\n\tfont-weight: 500;\n}\n\n.cn-reveal-field__value--masked {\n\tletter-spacing: 0.08em;\n}\n\n.cn-reveal-field__reason {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-reveal-field__reason-actions {\n\tdisplay: flex;\n\tgap: 8px;\n\tjustify-content: flex-end;\n}\n\n.cn-reveal-field__error {\n\tcolor: var(--color-error-text, var(--color-error));\n\tmargin: 0;\n}\n\n.cn-reveal-field__note {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n\tmargin: 0;\n}\n</style>\n"],"names":["t"],"mappings":";;;AAsEA,IAAI,MAAM,EAAA;;AAEV;;;;AAIC;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;;;;AAID,aAAe;AACd,CAAA,IAAI,EAAE,eAAe;;CAErB,UAAU,EAAE;AACX,EAAA,QAAQ;EACR,aAAa;EACb,WAAW;EACX;;AAED,CAAA,KAAK,EAAE;AACN;AACA,EAAA,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EA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CAAC,QAAS,GAAE,MAAI;AACpB,GAAA,IAAI,CAAC,aAAY,GAAI,GAAC;AACtB,GAAA,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAA;GACnB;EACD;AACF;;;;"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, normalizeClass, createBlock, createSlots, withCtx, createTextVNode, createVNode, createCommentVNode, withModifiers } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
class: "cn-reveal-field",
|
|
5
|
+
"data-testid": "cn-reveal-field"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_2 = { class: "cn-reveal-field__row" };
|
|
8
|
+
const _hoisted_3 = ["id"];
|
|
9
|
+
const _hoisted_4 = ["aria-labelledby"];
|
|
10
|
+
const _hoisted_5 = { class: "cn-reveal-field__reason-actions" };
|
|
11
|
+
const _hoisted_6 = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "cn-reveal-field__error",
|
|
14
|
+
role: "alert",
|
|
15
|
+
"data-testid": "cn-reveal-error"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_7 = {
|
|
18
|
+
key: 2,
|
|
19
|
+
class: "cn-reveal-field__note",
|
|
20
|
+
"data-testid": "cn-reveal-note"
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
24
|
+
const _component_NcLoadingIcon = resolveComponent("NcLoadingIcon");
|
|
25
|
+
const _component_NcButton = resolveComponent("NcButton");
|
|
26
|
+
const _component_NcTextField = resolveComponent("NcTextField");
|
|
27
|
+
|
|
28
|
+
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
29
|
+
createElementVNode("div", _hoisted_2, [
|
|
30
|
+
createElementVNode("span", {
|
|
31
|
+
id: $data.labelId,
|
|
32
|
+
class: "cn-reveal-field__label"
|
|
33
|
+
}, toDisplayString($props.label), 9 /* TEXT, PROPS */, _hoisted_3),
|
|
34
|
+
createElementVNode("span", {
|
|
35
|
+
class: normalizeClass(["cn-reveal-field__value", { 'cn-reveal-field__value--masked': !$data.revealed }]),
|
|
36
|
+
"aria-labelledby": $data.labelId,
|
|
37
|
+
"aria-live": "polite",
|
|
38
|
+
"data-testid": "cn-reveal-value"
|
|
39
|
+
}, toDisplayString($data.revealed ? $data.revealedValue : $props.maskedValue), 11 /* TEXT, CLASS, PROPS */, _hoisted_4),
|
|
40
|
+
(!$data.askingReason)
|
|
41
|
+
? (openBlock(), createBlock(_component_NcButton, {
|
|
42
|
+
key: 0,
|
|
43
|
+
variant: "tertiary",
|
|
44
|
+
"aria-label": $data.revealed ? $options.t('nextcloud-vue', 'Hide {label}', { label: $props.label }) : $options.t('nextcloud-vue', 'Show {label}', { label: $props.label }),
|
|
45
|
+
disabled: $data.loading,
|
|
46
|
+
"data-testid": "cn-reveal-toggle",
|
|
47
|
+
onClick: $options.toggle
|
|
48
|
+
}, createSlots({
|
|
49
|
+
default: withCtx(() => [
|
|
50
|
+
createTextVNode(" " + toDisplayString($data.revealed ? $options.t('nextcloud-vue', 'Hide') : $options.t('nextcloud-vue', 'Show')), 1 /* TEXT */)
|
|
51
|
+
]),
|
|
52
|
+
_: 2 /* DYNAMIC */
|
|
53
|
+
}, [
|
|
54
|
+
($data.loading)
|
|
55
|
+
? {
|
|
56
|
+
name: "icon",
|
|
57
|
+
fn: withCtx(() => [
|
|
58
|
+
createVNode(_component_NcLoadingIcon, { size: 20 })
|
|
59
|
+
]),
|
|
60
|
+
key: "0"
|
|
61
|
+
}
|
|
62
|
+
: undefined
|
|
63
|
+
]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["aria-label", "disabled", "onClick"]))
|
|
64
|
+
: createCommentVNode("v-if", true)
|
|
65
|
+
]),
|
|
66
|
+
($data.askingReason)
|
|
67
|
+
? (openBlock(), createElementBlock("form", {
|
|
68
|
+
key: 0,
|
|
69
|
+
class: "cn-reveal-field__reason",
|
|
70
|
+
"data-testid": "cn-reveal-reason",
|
|
71
|
+
onSubmit: _cache[1] || (_cache[1] = withModifiers((...args) => ($options.submitReason && $options.submitReason(...args)), ["prevent"]))
|
|
72
|
+
}, [
|
|
73
|
+
createVNode(_component_NcTextField, {
|
|
74
|
+
ref: "reasonField",
|
|
75
|
+
modelValue: $data.reason,
|
|
76
|
+
label: $props.reasonLabel || $options.t('nextcloud-vue', 'Why do you need to see this?'),
|
|
77
|
+
required: "",
|
|
78
|
+
"data-testid": "cn-reveal-reason-input",
|
|
79
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ($data.reason = $event))
|
|
80
|
+
}, null, 8 /* PROPS */, ["modelValue", "label"]),
|
|
81
|
+
createElementVNode("div", _hoisted_5, [
|
|
82
|
+
createVNode(_component_NcButton, {
|
|
83
|
+
variant: "tertiary",
|
|
84
|
+
"data-testid": "cn-reveal-reason-cancel",
|
|
85
|
+
onClick: $options.cancelReason
|
|
86
|
+
}, {
|
|
87
|
+
default: withCtx(() => [
|
|
88
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Cancel')), 1 /* TEXT */)
|
|
89
|
+
]),
|
|
90
|
+
_: 1 /* STABLE */
|
|
91
|
+
}, 8 /* PROPS */, ["onClick"]),
|
|
92
|
+
createVNode(_component_NcButton, {
|
|
93
|
+
type: "submit",
|
|
94
|
+
variant: "primary",
|
|
95
|
+
disabled: $data.reason.trim() === '' || $data.loading,
|
|
96
|
+
"data-testid": "cn-reveal-reason-submit"
|
|
97
|
+
}, {
|
|
98
|
+
default: withCtx(() => [
|
|
99
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Show')), 1 /* TEXT */)
|
|
100
|
+
]),
|
|
101
|
+
_: 1 /* STABLE */
|
|
102
|
+
}, 8 /* PROPS */, ["disabled"])
|
|
103
|
+
])
|
|
104
|
+
], 32 /* NEED_HYDRATION */))
|
|
105
|
+
: createCommentVNode("v-if", true),
|
|
106
|
+
($data.error)
|
|
107
|
+
? (openBlock(), createElementBlock("p", _hoisted_6, toDisplayString($data.error), 1 /* TEXT */))
|
|
108
|
+
: createCommentVNode("v-if", true),
|
|
109
|
+
($props.note)
|
|
110
|
+
? (openBlock(), createElementBlock("p", _hoisted_7, toDisplayString($props.note), 1 /* TEXT */))
|
|
111
|
+
: createCommentVNode("v-if", true)
|
|
112
|
+
]))
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export { render };
|
|
116
|
+
//# sourceMappingURL=CnRevealField.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnRevealField.vue3.js","sources":["../../../../src/components/CnRevealField/CnRevealField.vue?vue&type=template&id=bd786526&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-reveal-field\" data-testid=\"cn-reveal-field\">\n\t\t<div class=\"cn-reveal-field__row\">\n\t\t\t<span :id=\"labelId\" class=\"cn-reveal-field__label\">{{ label }}</span>\n\t\t\t<span\n\t\t\t\tclass=\"cn-reveal-field__value\"\n\t\t\t\t:class=\"{ 'cn-reveal-field__value--masked': !revealed }\"\n\t\t\t\t:aria-labelledby=\"labelId\"\n\t\t\t\taria-live=\"polite\"\n\t\t\t\tdata-testid=\"cn-reveal-value\">{{ revealed ? revealedValue : maskedValue }}</span>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"!askingReason\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:aria-label=\"revealed ? t('nextcloud-vue', 'Hide {label}', { label }) : t('nextcloud-vue', 'Show {label}', { label })\"\n\t\t\t\t:disabled=\"loading\"\n\t\t\t\tdata-testid=\"cn-reveal-toggle\"\n\t\t\t\t@click=\"toggle\">\n\t\t\t\t<template v-if=\"loading\" #icon>\n\t\t\t\t\t<NcLoadingIcon :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ revealed ? t('nextcloud-vue', 'Hide') : t('nextcloud-vue', 'Show') }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<form\n\t\t\tv-if=\"askingReason\"\n\t\t\tclass=\"cn-reveal-field__reason\"\n\t\t\tdata-testid=\"cn-reveal-reason\"\n\t\t\t@submit.prevent=\"submitReason\">\n\t\t\t<NcTextField\n\t\t\t\tref=\"reasonField\"\n\t\t\t\t:modelValue=\"reason\"\n\t\t\t\t:label=\"reasonLabel || t('nextcloud-vue', 'Why do you need to see this?')\"\n\t\t\t\trequired\n\t\t\t\tdata-testid=\"cn-reveal-reason-input\"\n\t\t\t\t@update:modelValue=\"reason = $event\" />\n\t\t\t<div class=\"cn-reveal-field__reason-actions\">\n\t\t\t\t<NcButton variant=\"tertiary\" data-testid=\"cn-reveal-reason-cancel\" @click=\"cancelReason\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Cancel') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t:disabled=\"reason.trim() === '' || loading\"\n\t\t\t\t\tdata-testid=\"cn-reveal-reason-submit\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Show') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t</form>\n\n\t\t<p v-if=\"error\"\n\t\t\tclass=\"cn-reveal-field__error\"\n\t\t\trole=\"alert\"\n\t\t\tdata-testid=\"cn-reveal-error\">\n\t\t\t{{ error }}\n\t\t</p>\n\t\t<p v-if=\"note\" class=\"cn-reveal-field__note\" data-testid=\"cn-reveal-note\">\n\t\t\t{{ note }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon, NcTextField } from '@nextcloud/vue'\n\nlet uid = 0\n\n/**\n * CnRevealField — a protected value shown masked until the user asks to see\n * it (board DqContact: \"BSN *****4001 Tonen\", \"Het tonen van het BSN wordt\n * gelogd.\").\n *\n * The component never holds the value until the user asks: `load` fetches it\n * on every reveal, so the server can log each viewing. With `requireReason`\n * the user first states why, and `load` receives that reason. Hide masks the\n * value again and drops it; the next Show calls `load` again.\n *\n * ```vue\n * <CnRevealField\n * label=\"BSN\"\n * masked-value=\"*****4001\"\n * :load=\"(reason) => api.revealBsn(person.id, reason)\"\n * require-reason\n * note=\"Het tonen van het BSN wordt gelogd.\" />\n * ```\n *\n * @event revealed Emitted once the value shows, with `{ reason }`.\n * @event hidden Emitted when the user masks the value again.\n */\nexport default {\n\tname: 'CnRevealField',\n\n\tcomponents: {\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t\tNcTextField,\n\t},\n\n\tprops: {\n\t\t/** What the value is, already translated (\"BSN\"). */\n\t\tlabel: { type: String, required: true },\n\t\t/** What shows while the value is hidden, such as the last digits behind stars. */\n\t\tmaskedValue: { type: String, default: '••••••' },\n\t\t/**\n\t\t * Fetches the value: `(reason) => string | Promise<string>`. Called on\n\t\t * every reveal; `reason` is '' unless `requireReason` is set.\n\t\t */\n\t\tload: { type: Function, required: true },\n\t\t/** Ask why the user needs the value before it is fetched. */\n\t\trequireReason: { type: Boolean, default: false },\n\t\t/** Label of the reason field, already translated; the library default is \"Why do you need to see this?\". */\n\t\treasonLabel: { type: String, default: '' },\n\t\t/** A line under the value, already translated, such as that showing it is logged. */\n\t\tnote: { type: String, default: '' },\n\t},\n\n\temits: ['revealed', 'hidden'],\n\n\tdata() {\n\t\tuid += 1\n\t\treturn {\n\t\t\tlabelId: `cn-reveal-field-${uid}`,\n\t\t\trevealed: false,\n\t\t\trevealedValue: '',\n\t\t\taskingReason: false,\n\t\t\treason: '',\n\t\t\tloading: false,\n\t\t\terror: '',\n\t\t}\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Show or hide the value. Showing asks the reason first when\n\t\t * `requireReason` is set.\n\t\t *\n\t\t * @return {Promise<void>|void}\n\t\t */\n\t\ttoggle() {\n\t\t\tif (this.revealed) {\n\t\t\t\tthis.hide()\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (this.requireReason) {\n\t\t\t\tthis.askingReason = true\n\t\t\t\tthis.error = ''\n\t\t\t\tthis.$nextTick(() => this.$refs.reasonField?.focus?.())\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.reveal('')\n\t\t},\n\n\t\t/**\n\t\t * Reveal with the typed reason.\n\t\t *\n\t\t * @return {Promise<void>|void}\n\t\t */\n\t\tsubmitReason() {\n\t\t\tconst reason = this.reason.trim()\n\t\t\tif (reason === '') {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\treturn this.reveal(reason)\n\t\t},\n\n\t\t/**\n\t\t * Close the reason form without fetching.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\tcancelReason() {\n\t\t\tthis.askingReason = false\n\t\t\tthis.reason = ''\n\t\t},\n\n\t\t/**\n\t\t * Fetch the value through `load` and show it; a failure keeps the\n\t\t * value masked and says so.\n\t\t *\n\t\t * @param {string} reason Why the user asked, or ''.\n\t\t * @return {Promise<void>}\n\t\t */\n\t\tasync reveal(reason) {\n\t\t\tthis.loading = true\n\t\t\tthis.error = ''\n\t\t\ttry {\n\t\t\t\tconst value = await this.load(reason)\n\t\t\t\tif (value === null || value === undefined || value === '') {\n\t\t\t\t\tthrow new Error('empty')\n\t\t\t\t}\n\t\t\t\tthis.revealedValue = String(value)\n\t\t\t\tthis.revealed = true\n\t\t\t\tthis.askingReason = false\n\t\t\t\tthis.reason = ''\n\t\t\t\tthis.$emit('revealed', { reason })\n\t\t\t} catch {\n\t\t\t\tthis.error = t('nextcloud-vue', 'The value could not be shown. Try again later.')\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Mask the value again and drop it.\n\t\t *\n\t\t * @return {void}\n\t\t */\n\t\thide() {\n\t\t\tthis.revealed = false\n\t\t\tthis.revealedValue = ''\n\t\t\tthis.$emit('hidden')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-reveal-field {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 6px;\n}\n\n.cn-reveal-field__row {\n\talign-items: center;\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 4px 12px;\n}\n\n.cn-reveal-field__label {\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-reveal-field__value {\n\tfont-variant-numeric: tabular-nums;\n\tfont-weight: 500;\n}\n\n.cn-reveal-field__value--masked {\n\tletter-spacing: 0.08em;\n}\n\n.cn-reveal-field__reason {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n}\n\n.cn-reveal-field__reason-actions {\n\tdisplay: flex;\n\tgap: 8px;\n\tjustify-content: flex-end;\n}\n\n.cn-reveal-field__error {\n\tcolor: var(--color-error-text, var(--color-error));\n\tmargin: 0;\n}\n\n.cn-reveal-field__note {\n\tcolor: var(--color-text-maxcontrast);\n\tfont-size: 0.9em;\n\tmargin: 0;\n}\n</style>\n"],"names":["_createElementVNode","_normalizeClass","_createBlock","_toDisplayString","_createVNode","_createElementBlock"],"mappings":";;;AASM,EAAA,KAAK,EAAC,iBAAiB;AAAC,EAAA,aAAG,EAAA,iBAAA;;AAC1B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAE,sBAAqB,GAAA;;;AAkC3B,MAAA,UAAA,GAAA,EAAA,KAAI,EAAA,iCAAA,GAAA;;;AAeT,EAAA,KAAE,EAAA,wBAAA;AACF,EAAA,IAAI,EAAC,OAAO;AACZ,EAAA,aAAS,EAAA,iBAAA;;;;;;;;;;;;;;uBA/BJ,iBAAA,EAAA;wBAnBqB,CAAA,MAAA,EAAA;AAAnB,QAAA,EAAE,EAAE,KAAO,CAAA,OAAA;AAAE,QAAA,KAAK,EAAC,wBAAA;yBAAA,MAAA,CAAA,KAAA,CAAA,EAAA,CAAA,oBAAA,UAAA,CAAA;MACzBA,kBAKiF,CAAA,MAAA,EAAA;QAJjF,KAAK,EAAAC,cAAA,CAAA,CAAC,wBAAwB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,CAAA,sBAAA,EAAA;AALV,YAAA,GAAG,EAAC,aAAa;AAChB,YAAA,UAAU,EAAE,KAAM,CAAA,MAAA;YAClB,KAAK,EAAE,MAAW,CAAA,WAAA,IAAI,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,8BAAA,CAAA;AACxB,YAAA,QAAQ,EAAR,EAAQ;AACP,YAAA,aAAU,EAAC,wBAAsB;YACjC,qBAAS,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAA,KAAA,CAAA,MAAA,GAAA,MAAA,CAAA,CAAA;;AACV,UAAAJ,kBAAA,CAWK,OAXL,UAWK,EAAA;uBARM,CAAA,mBAAA,EAAA;AAFD,cAAA,OAAG,EAAA,UAAA;AAAA,cAAA,aAAA,EAAA,yBAAA;AAAA,cAAA,OAAA,EAAA,QAAA,CAAA,YAAA;;+BACZ,MAAgB;gDAAb,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,QAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;YAEJI,WAMU,CAAA,mBAAA,EAAA;AALV,cAAA,IAAI,EAAC,QAAQ;AACb,cAAA,OAAO,EAAC,SAAC;AACR,cAAA,QAAE,EAAA,KAAA,CAAA,MAAA,CAAA,IAAA,aAAA,KAAA,CAAA,OAAA;AACH,cAAA,aAAG,EAAA,yBAAA;;;;;;;;;;UAMK,CAAA,KAAA;sBAAVC,kBAKG,CAAA,GAAA,EALH,UAKG,EAAAF,eAAA,CADD,KAAA,CAAA,KAAA,CAAA,EAAA,CAAA,YAAA;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ export { DEFAULT_STORE_KINDS } from './CnStorePage.vue2.js';
|
|
|
3
3
|
import { render } from './CnStorePage.vue3.js';
|
|
4
4
|
|
|
5
5
|
script.render = render;
|
|
6
|
-
script.__scopeId = "data-v-
|
|
6
|
+
script.__scopeId = "data-v-45414193";
|
|
7
7
|
const __sfc_main = script;
|
|
8
8
|
|
|
9
9
|
export { __sfc_main as default };
|
|
@@ -256,7 +256,7 @@ var script = {
|
|
|
256
256
|
* @return {string} The heading to render.
|
|
257
257
|
*/
|
|
258
258
|
resolvedTitle() {
|
|
259
|
-
return this.title || this.page?.title || t('nextcloud-vue', '
|
|
259
|
+
return this.title || this.page?.title || t('nextcloud-vue', 'Marketplace')
|
|
260
260
|
},
|
|
261
261
|
|
|
262
262
|
/**
|
|
@@ -555,7 +555,7 @@ var script = {
|
|
|
555
555
|
notConfiguredMessage() {
|
|
556
556
|
const base = t(
|
|
557
557
|
'nextcloud-vue',
|
|
558
|
-
'No
|
|
558
|
+
'No marketplace registry is configured, so nothing was requested from the network. An administrator can connect one under Administration settings.',
|
|
559
559
|
);
|
|
560
560
|
|
|
561
561
|
return this.builtIn.length > 0
|
|
@@ -569,7 +569,7 @@ var script = {
|
|
|
569
569
|
* @return {string} The unreachable note.
|
|
570
570
|
*/
|
|
571
571
|
unreachableMessage() {
|
|
572
|
-
const base = t('nextcloud-vue', 'The
|
|
572
|
+
const base = t('nextcloud-vue', 'The marketplace registry did not answer.');
|
|
573
573
|
|
|
574
574
|
return this.builtIn.length > 0
|
|
575
575
|
? `${base} ${t('nextcloud-vue', 'The items below ship with this app.')}`
|