@conduction/nextcloud-vue 2.56.0-beta.69 → 2.56.0-beta.70
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 +257 -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 +162 -9
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue2.js.map +1 -1
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.vue3.js +63 -23
- package/dist/esm/components/CnDataMatrix/CnDataMatrix.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/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/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 +63 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +63 -1
- package/dist/esm/l10n/nl.json.js.map +1 -1
- package/dist/esm/library-style.js +1 -1
- package/dist/esm/nextcloud-vue.css +1134 -499
- 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/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 +20307 -14544
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +1134 -499
- package/l10n/en.json +63 -1
- package/l10n/nl.json +63 -1
- 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 +311 -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 +199 -13
- 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/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/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/qr.js +681 -0
- package/src/utils/schema.js +3 -0
- package/src/utils/templateVariables.js +51 -0
|
@@ -1,66 +1,155 @@
|
|
|
1
|
-
import { resolveComponent, openBlock, createElementBlock, createVNode, createBlock, withCtx, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
1
|
+
import { resolveComponent, openBlock, createElementBlock, createVNode, createElementVNode, createBlock, withCtx, createTextVNode, toDisplayString, normalizeClass, createCommentVNode } from 'vue';
|
|
2
2
|
|
|
3
3
|
const _hoisted_1 = { class: "cn-duration-field" };
|
|
4
4
|
const _hoisted_2 = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "cn-duration-field__row"
|
|
6
|
+
class: "cn-duration-field__row cn-duration-field__row--timer"
|
|
7
7
|
};
|
|
8
|
-
const _hoisted_3 =
|
|
8
|
+
const _hoisted_3 = ["aria-label"];
|
|
9
|
+
const _hoisted_4 = {
|
|
9
10
|
key: 1,
|
|
10
11
|
class: "cn-duration-field__row"
|
|
11
12
|
};
|
|
13
|
+
const _hoisted_5 = {
|
|
14
|
+
key: 2,
|
|
15
|
+
class: "cn-duration-field__row"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_6 = { class: "cn-duration-field__norm-line" };
|
|
18
|
+
const _hoisted_7 = {
|
|
19
|
+
key: 0,
|
|
20
|
+
"data-testid": "cn-duration-norm-words"
|
|
21
|
+
};
|
|
12
22
|
|
|
13
23
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
24
|
const _component_NcTextField = resolveComponent("NcTextField");
|
|
15
|
-
const _component_NcSelect = resolveComponent("NcSelect");
|
|
16
25
|
const _component_NcButton = resolveComponent("NcButton");
|
|
26
|
+
const _component_NcSelect = resolveComponent("NcSelect");
|
|
27
|
+
const _component_NcProgressBar = resolveComponent("NcProgressBar");
|
|
17
28
|
|
|
18
29
|
return (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
19
|
-
(
|
|
30
|
+
($props.timer)
|
|
20
31
|
? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
21
32
|
createVNode(_component_NcTextField, {
|
|
22
|
-
class: "cn-duration-
|
|
23
|
-
type: "number",
|
|
24
|
-
label: $props.inputLabel,
|
|
25
|
-
modelValue: $options.amountText,
|
|
26
|
-
disabled: $props.disabled,
|
|
27
|
-
error: $props.error,
|
|
28
|
-
"onUpdate:modelValue": $options.onAmount
|
|
29
|
-
}, null, 8 /* PROPS */, ["label", "modelValue", "disabled", "error", "onUpdate:modelValue"]),
|
|
30
|
-
createVNode(_component_NcSelect, {
|
|
31
|
-
class: "cn-duration-field__unit",
|
|
32
|
-
inputLabel: $props.unitLabel,
|
|
33
|
-
modelValue: $options.unitOption,
|
|
34
|
-
options: $options.unitOptions,
|
|
35
|
-
clearable: false,
|
|
36
|
-
disabled: $props.disabled,
|
|
37
|
-
label: "label",
|
|
38
|
-
"onUpdate:modelValue": $options.onUnit
|
|
39
|
-
}, null, 8 /* PROPS */, ["inputLabel", "modelValue", "options", "disabled", "onUpdate:modelValue"])
|
|
40
|
-
]))
|
|
41
|
-
: (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
42
|
-
createVNode(_component_NcTextField, {
|
|
43
|
-
class: "cn-duration-field__iso",
|
|
33
|
+
class: "cn-duration-field__clock",
|
|
44
34
|
label: $props.inputLabel,
|
|
45
|
-
modelValue: $options.
|
|
46
|
-
readonly: !$data.editIso,
|
|
35
|
+
modelValue: $options.clockText,
|
|
47
36
|
disabled: $props.disabled,
|
|
48
|
-
error: $props.error ||
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
37
|
+
error: $props.error || $options.clockInvalid,
|
|
38
|
+
helperText: $options.clockInvalid ? $options.t('nextcloud-vue', 'Enter minutes, or minutes and seconds as 04:23.') : $props.hint,
|
|
39
|
+
"data-testid": "cn-duration-clock",
|
|
40
|
+
"onUpdate:modelValue": $options.onClock
|
|
41
|
+
}, null, 8 /* PROPS */, ["label", "modelValue", "disabled", "error", "helperText", "onUpdate:modelValue"]),
|
|
42
|
+
createElementVNode("div", {
|
|
43
|
+
class: "cn-duration-field__controls",
|
|
44
|
+
role: "group",
|
|
45
|
+
"aria-label": $props.timerLabel
|
|
46
|
+
}, [
|
|
47
|
+
(!$data.running)
|
|
48
|
+
? (openBlock(), createBlock(_component_NcButton, {
|
|
49
|
+
key: 0,
|
|
50
|
+
disabled: $props.disabled,
|
|
51
|
+
"data-testid": "cn-duration-start",
|
|
52
|
+
onClick: $options.start
|
|
53
|
+
}, {
|
|
54
|
+
default: withCtx(() => [
|
|
55
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Start')), 1 /* TEXT */)
|
|
56
|
+
]),
|
|
57
|
+
_: 1 /* STABLE */
|
|
58
|
+
}, 8 /* PROPS */, ["disabled", "onClick"]))
|
|
59
|
+
: (openBlock(), createBlock(_component_NcButton, {
|
|
60
|
+
key: 1,
|
|
61
|
+
disabled: $props.disabled,
|
|
62
|
+
"data-testid": "cn-duration-stop",
|
|
63
|
+
onClick: $options.stop
|
|
64
|
+
}, {
|
|
65
|
+
default: withCtx(() => [
|
|
66
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Stop')), 1 /* TEXT */)
|
|
67
|
+
]),
|
|
68
|
+
_: 1 /* STABLE */
|
|
69
|
+
}, 8 /* PROPS */, ["disabled", "onClick"])),
|
|
70
|
+
createVNode(_component_NcButton, {
|
|
71
|
+
variant: "tertiary",
|
|
72
|
+
disabled: $props.disabled,
|
|
73
|
+
"data-testid": "cn-duration-reset",
|
|
74
|
+
onClick: $options.reset
|
|
75
|
+
}, {
|
|
76
|
+
default: withCtx(() => [
|
|
77
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Reset')), 1 /* TEXT */)
|
|
78
|
+
]),
|
|
79
|
+
_: 1 /* STABLE */
|
|
80
|
+
}, 8 /* PROPS */, ["disabled", "onClick"])
|
|
81
|
+
], 8 /* PROPS */, _hoisted_3),
|
|
82
|
+
createElementVNode("span", {
|
|
83
|
+
class: normalizeClass(["cn-duration-field__state", { 'cn-duration-field__state--running': $data.running }]),
|
|
84
|
+
role: "status",
|
|
85
|
+
"data-testid": "cn-duration-state"
|
|
86
|
+
}, toDisplayString($options.stateText), 3 /* TEXT, CLASS */)
|
|
63
87
|
]))
|
|
88
|
+
: (!$options.rawMode)
|
|
89
|
+
? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
90
|
+
createVNode(_component_NcTextField, {
|
|
91
|
+
class: "cn-duration-field__amount",
|
|
92
|
+
type: "number",
|
|
93
|
+
label: $props.inputLabel,
|
|
94
|
+
modelValue: $options.amountText,
|
|
95
|
+
disabled: $props.disabled,
|
|
96
|
+
error: $props.error,
|
|
97
|
+
"onUpdate:modelValue": $options.onAmount
|
|
98
|
+
}, null, 8 /* PROPS */, ["label", "modelValue", "disabled", "error", "onUpdate:modelValue"]),
|
|
99
|
+
createVNode(_component_NcSelect, {
|
|
100
|
+
class: "cn-duration-field__unit",
|
|
101
|
+
inputLabel: $props.unitLabel,
|
|
102
|
+
modelValue: $options.unitOption,
|
|
103
|
+
options: $options.unitOptions,
|
|
104
|
+
clearable: false,
|
|
105
|
+
disabled: $props.disabled,
|
|
106
|
+
label: "label",
|
|
107
|
+
"onUpdate:modelValue": $options.onUnit
|
|
108
|
+
}, null, 8 /* PROPS */, ["inputLabel", "modelValue", "options", "disabled", "onUpdate:modelValue"])
|
|
109
|
+
]))
|
|
110
|
+
: (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
111
|
+
createVNode(_component_NcTextField, {
|
|
112
|
+
class: "cn-duration-field__iso",
|
|
113
|
+
label: $props.inputLabel,
|
|
114
|
+
modelValue: $options.rawText,
|
|
115
|
+
readonly: !$data.editIso,
|
|
116
|
+
disabled: $props.disabled,
|
|
117
|
+
error: $props.error || ($data.editIso && !$options.validIso),
|
|
118
|
+
"onUpdate:modelValue": $options.onIso
|
|
119
|
+
}, null, 8 /* PROPS */, ["label", "modelValue", "readonly", "disabled", "error", "onUpdate:modelValue"]),
|
|
120
|
+
(!$props.disabled)
|
|
121
|
+
? (openBlock(), createBlock(_component_NcButton, {
|
|
122
|
+
key: 0,
|
|
123
|
+
"data-testid": "cn-duration-edit-iso",
|
|
124
|
+
onClick: _cache[0] || (_cache[0] = $event => ($data.editIso = !$data.editIso))
|
|
125
|
+
}, {
|
|
126
|
+
default: withCtx(() => [
|
|
127
|
+
createTextVNode(toDisplayString($options.t('nextcloud-vue', 'Edit as ISO')), 1 /* TEXT */)
|
|
128
|
+
]),
|
|
129
|
+
_: 1 /* STABLE */
|
|
130
|
+
}))
|
|
131
|
+
: createCommentVNode("v-if", true)
|
|
132
|
+
])),
|
|
133
|
+
($props.timer && $options.normSeconds)
|
|
134
|
+
? (openBlock(), createElementBlock("div", {
|
|
135
|
+
key: 3,
|
|
136
|
+
class: normalizeClass(["cn-duration-field__norm", `cn-duration-field__norm--${$options.normLevel}`]),
|
|
137
|
+
"data-testid": "cn-duration-norm"
|
|
138
|
+
}, [
|
|
139
|
+
createElementVNode("div", _hoisted_6, [
|
|
140
|
+
createElementVNode("span", null, toDisplayString($options.normText), 1 /* TEXT */),
|
|
141
|
+
createElementVNode("span", null, toDisplayString($options.normPercent) + "%", 1 /* TEXT */),
|
|
142
|
+
($options.normWords)
|
|
143
|
+
? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString($options.normWords), 1 /* TEXT */))
|
|
144
|
+
: createCommentVNode("v-if", true)
|
|
145
|
+
]),
|
|
146
|
+
createVNode(_component_NcProgressBar, {
|
|
147
|
+
value: Math.min($options.normPercent, 100),
|
|
148
|
+
error: $options.normLevel === 'over',
|
|
149
|
+
"aria-label": $options.normText
|
|
150
|
+
}, null, 8 /* PROPS */, ["value", "error", "aria-label"])
|
|
151
|
+
], 2 /* CLASS */))
|
|
152
|
+
: createCommentVNode("v-if", true)
|
|
64
153
|
]))
|
|
65
154
|
}
|
|
66
155
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnDurationField.vue3.js","sources":["../../../../src/components/CnDurationField/CnDurationField.vue?vue&type=template&id=12a6b992&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-duration-field\">\n\t\t<div v-if=\"!rawMode\" class=\"cn-duration-field__row\">\n\t\t\t<NcTextField\n\t\t\t\tclass=\"cn-duration-field__amount\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"inputLabel\"\n\t\t\t\t:modelValue=\"amountText\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:error=\"error\"\n\t\t\t\t@update:modelValue=\"onAmount\" />\n\t\t\t<NcSelect\n\t\t\t\tclass=\"cn-duration-field__unit\"\n\t\t\t\t:inputLabel=\"unitLabel\"\n\t\t\t\t:modelValue=\"unitOption\"\n\t\t\t\t:options=\"unitOptions\"\n\t\t\t\t:clearable=\"false\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\t@update:modelValue=\"onUnit\" />\n\t\t</div>\n\t\t<div v-else class=\"cn-duration-field__row\">\n\t\t\t<NcTextField\n\t\t\t\tclass=\"cn-duration-field__iso\"\n\t\t\t\t:label=\"inputLabel\"\n\t\t\t\t:modelValue=\"rawText\"\n\t\t\t\t:readonly=\"!editIso\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:error=\"error || (editIso && !validIso)\"\n\t\t\t\t@update:modelValue=\"onIso\" />\n\t\t\t<NcButton\n\t\t\t\tv-if=\"!disabled\"\n\t\t\t\tdata-testid=\"cn-duration-edit-iso\"\n\t\t\t\t@click=\"editIso = !editIso\">\n\t\t\t\t{{ t('nextcloud-vue', 'Edit as ISO') }}\n\t\t\t</NcButton>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'\nimport { DURATION_UNITS, formatDuration, isIsoDuration, parseDuration } from '../../utils/isoDuration.js'\n\n/**\n * CnDurationField — edits an ISO 8601 duration as a number plus a unit\n * (minutes, hours, days, weeks, months, years). `CnFormDialog` renders it for\n * `type: string, format: duration`.\n *\n * `P56D` shows 56 and days; changing the unit writes the canonical string.\n * A value that is not exactly one unit (`P1DT2H`) shows as read-only ISO text\n * with an \"Edit as ISO\" toggle, so nothing is rounded. Clearing the number\n * writes `null`.\n *\n * Example:\n * ```vue\n * <CnDurationField v-model=\"term\" input-label=\"Handling term\" />\n * ```\n */\nexport default {\n\tname: 'CnDurationField',\n\n\tcomponents: { NcButton, NcSelect, NcTextField },\n\n\tprops: {\n\t\t/** ISO 8601 duration string (v-model), or null. */\n\t\tmodelValue: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Accessible label of the number input. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Accessible label of the unit select. */\n\t\tunitLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Unit'),\n\t\t},\n\n\t\t/** Disable both inputs. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Show the inputs in their error state. */\n\t\terror: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: ['update:modelValue'],\n\n\tdata() {\n\t\treturn {\n\t\t\tunit: 'days',\n\t\t\teditIso: false,\n\t\t\tdraftIso: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tparsed() {\n\t\t\treturn parseDuration(this.modelValue)\n\t\t},\n\n\t\thasValue() {\n\t\t\treturn this.modelValue !== null && this.modelValue !== undefined && this.modelValue !== ''\n\t\t},\n\n\t\t// A non-empty value that is not one unit is shown as ISO text.\n\t\trawMode() {\n\t\t\treturn this.editIso || (this.hasValue && this.parsed === null)\n\t\t},\n\n\t\trawText() {\n\t\t\treturn this.draftIso !== null ? this.draftIso : (this.modelValue || '')\n\t\t},\n\n\t\tvalidIso() {\n\t\t\treturn isIsoDuration(this.rawText)\n\t\t},\n\n\t\tcurrentUnit() {\n\t\t\treturn this.parsed ? this.parsed.unit : this.unit\n\t\t},\n\n\t\tamountText() {\n\t\t\treturn this.parsed ? String(this.parsed.amount) : ''\n\t\t},\n\n\t\tunitOptions() {\n\t\t\tconst labels = {\n\t\t\t\tminutes: t('nextcloud-vue', 'minutes'),\n\t\t\t\thours: t('nextcloud-vue', 'hours'),\n\t\t\t\tdays: t('nextcloud-vue', 'days'),\n\t\t\t\tweeks: t('nextcloud-vue', 'weeks'),\n\t\t\t\tmonths: t('nextcloud-vue', 'months'),\n\t\t\t\tyears: t('nextcloud-vue', 'years'),\n\t\t\t}\n\t\t\treturn DURATION_UNITS.map((u) => ({ id: u, label: labels[u] }))\n\t\t},\n\n\t\tunitOption() {\n\t\t\treturn this.unitOptions.find((o) => o.id === this.currentUnit) || null\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonAmount(value) {\n\t\t\t/** @event update:modelValue The ISO string for the chosen amount and unit; null when the amount is cleared. */\n\t\t\tthis.$emit('update:modelValue', formatDuration(value, this.currentUnit))\n\t\t},\n\n\t\tonUnit(option) {\n\t\t\tif (!option) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.unit = option.id\n\t\t\tif (this.parsed) {\n\t\t\t\tthis.$emit('update:modelValue', formatDuration(this.parsed.amount, option.id))\n\t\t\t}\n\t\t},\n\n\t\tonIso(value) {\n\t\t\tthis.draftIso = value\n\t\t\tif (isIsoDuration(value)) {\n\t\t\t\tthis.$emit('update:modelValue', value)\n\t\t\t} else if (value === '') {\n\t\t\t\tthis.$emit('update:modelValue', null)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-duration-field__row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n}\n\n.cn-duration-field__amount,\n.cn-duration-field__iso {\n\tflex: 1 1 auto;\n}\n\n.cn-duration-field__unit {\n\tmin-width: 140px;\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createVNode","_createBlock"],"mappings":";;AASM,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,mBAAI,GAAA;;;AACM,EAAA,KAAA,EAAA,wBAAA;;;;AAmBR,EAAA,KAAK,EAAC,wBAAI;;;;;;;;;MAnBV,QAAO,CAAA,OAAA;AAAjB,SAAAA,SAAA,EAAA,EAAAC,kBAAA,CAkBI,OAlBJ,UAkBI,EAAA;qBAVmB,CAAA,sBAAA,EAAA;AANvB,YAAA,KAAK,EAAC,2BAAa;AACnB,YAAA,IAAI,EAAC,QAAQ;AACZ,YAAA,KAAK,EAAE,MAAU,CAAA,UAAA;AACjB,YAAA,UAAM,EAAA,QAAA,CAAA,UAAA;AACN,YAAA,QAAQ,EAAE,MAAQ,CAAA,QAAA;AAClB,YAAA,KAAK,EAAE,MAAK,CAAA,KAAA;AACZ,YAAA,qBAAiB,EAAE,QAAG,CAAA,QAAA;;UACvBC,WAQ6B,CAAA,mBAAA,EAAA;AAP7B,YAAA,KAAK,EAAC,yBAAW;AAChB,YAAA,UAAU,EAAE,MAAM,CAAA,SAAA;AAClB,YAAA,UAAU,EAAC,QAAA,CAAA,UAAA;AACX,YAAA,OAAO,EAAE,QAAW,CAAA,WAAA;AACpB,YAAA,SAAE,EAAA,KAAA;AACF,YAAA,QAAS,EAAC,MAAQ,CAAA,QAAA;AACnB,YAAA,KAAK,EAAC,OAAI;AACT,YAAA,qBAAiB,EAAE,QAAM,CAAA,MAAA;;;AAE1B,SAAAF,SAAA,EAAA,EAAAC,kBAAA,QAAA;UACAC,WAO2B,CAAA,sBAAA,EAAA;AAN3B,YAAA,KAAK,EAAC,wBAAa;AAClB,YAAA,KAAK,EAAE,MAAU,CAAA,UAAA;AACjB,YAAA,UAAU,EAAE,QAAO,CAAA,OAAA;AACnB,YAAA,QAAM,GAAA,KAAA,CAAA,OAAA;AACN,YAAA,QAAQ,EAAE,MAAI,CAAA,QAAA;AACd,YAAA,KAAK,EAAE,MAAA,CAAA,KAAK,KAAK,KAAA,CAAA,OAAO,KAAK,QAAG,CAAA,QAAA,CAAA;AAChC,YAAA,qBAAiB,EAAE,QAAK,CAAA,KAAA;;YAElB,MAAE,CAAA,QAAA;4BADTC;;AAEA,gBAAA,aAAG,EAAA,sBAAA;gBACF,OAAC,EAAA,MAAA,CAAA,CAAA,CAAA,KAAA,MAAA,CAAA,CAAA,CAAA,GAAA,MAAA,KAAA,KAAA,CAAA,OAAA,GAAA,CAAA,KAAA,CAAA,OAAA,CAAA,CAAA;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"CnDurationField.vue3.js","sources":["../../../../src/components/CnDurationField/CnDurationField.vue?vue&type=template&id=4d13ee2b&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-duration-field\">\n\t\t<div v-if=\"timer\" class=\"cn-duration-field__row cn-duration-field__row--timer\">\n\t\t\t<NcTextField\n\t\t\t\tclass=\"cn-duration-field__clock\"\n\t\t\t\t:label=\"inputLabel\"\n\t\t\t\t:modelValue=\"clockText\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:error=\"error || clockInvalid\"\n\t\t\t\t:helperText=\"clockInvalid ? t('nextcloud-vue', 'Enter minutes, or minutes and seconds as 04:23.') : hint\"\n\t\t\t\tdata-testid=\"cn-duration-clock\"\n\t\t\t\t@update:modelValue=\"onClock\" />\n\t\t\t<div\n\t\t\t\tclass=\"cn-duration-field__controls\"\n\t\t\t\trole=\"group\"\n\t\t\t\t:aria-label=\"timerLabel\">\n\t\t\t\t<NcButton\n\t\t\t\t\tv-if=\"!running\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\tdata-testid=\"cn-duration-start\"\n\t\t\t\t\t@click=\"start\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Start') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tv-else\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\tdata-testid=\"cn-duration-stop\"\n\t\t\t\t\t@click=\"stop\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Stop') }}\n\t\t\t\t</NcButton>\n\t\t\t\t<NcButton\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\tdata-testid=\"cn-duration-reset\"\n\t\t\t\t\t@click=\"reset\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'Reset') }}\n\t\t\t\t</NcButton>\n\t\t\t</div>\n\t\t\t<span\n\t\t\t\tclass=\"cn-duration-field__state\"\n\t\t\t\t:class=\"{ 'cn-duration-field__state--running': running }\"\n\t\t\t\trole=\"status\"\n\t\t\t\tdata-testid=\"cn-duration-state\">{{ stateText }}</span>\n\t\t</div>\n\t\t<div v-else-if=\"!rawMode\" class=\"cn-duration-field__row\">\n\t\t\t<NcTextField\n\t\t\t\tclass=\"cn-duration-field__amount\"\n\t\t\t\ttype=\"number\"\n\t\t\t\t:label=\"inputLabel\"\n\t\t\t\t:modelValue=\"amountText\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:error=\"error\"\n\t\t\t\t@update:modelValue=\"onAmount\" />\n\t\t\t<NcSelect\n\t\t\t\tclass=\"cn-duration-field__unit\"\n\t\t\t\t:inputLabel=\"unitLabel\"\n\t\t\t\t:modelValue=\"unitOption\"\n\t\t\t\t:options=\"unitOptions\"\n\t\t\t\t:clearable=\"false\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\t@update:modelValue=\"onUnit\" />\n\t\t</div>\n\t\t<div v-else class=\"cn-duration-field__row\">\n\t\t\t<NcTextField\n\t\t\t\tclass=\"cn-duration-field__iso\"\n\t\t\t\t:label=\"inputLabel\"\n\t\t\t\t:modelValue=\"rawText\"\n\t\t\t\t:readonly=\"!editIso\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:error=\"error || (editIso && !validIso)\"\n\t\t\t\t@update:modelValue=\"onIso\" />\n\t\t\t<NcButton\n\t\t\t\tv-if=\"!disabled\"\n\t\t\t\tdata-testid=\"cn-duration-edit-iso\"\n\t\t\t\t@click=\"editIso = !editIso\">\n\t\t\t\t{{ t('nextcloud-vue', 'Edit as ISO') }}\n\t\t\t</NcButton>\n\t\t</div>\n\t\t<div\n\t\t\tv-if=\"timer && normSeconds\"\n\t\t\tclass=\"cn-duration-field__norm\"\n\t\t\t:class=\"`cn-duration-field__norm--${normLevel}`\"\n\t\t\tdata-testid=\"cn-duration-norm\">\n\t\t\t<div class=\"cn-duration-field__norm-line\">\n\t\t\t\t<span>{{ normText }}</span>\n\t\t\t\t<span>{{ normPercent }}%</span>\n\t\t\t\t<span v-if=\"normWords\" data-testid=\"cn-duration-norm-words\">{{ normWords }}</span>\n\t\t\t</div>\n\t\t\t<NcProgressBar\n\t\t\t\t:value=\"Math.min(normPercent, 100)\"\n\t\t\t\t:error=\"normLevel === 'over'\"\n\t\t\t\t:aria-label=\"normText\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcProgressBar, NcSelect, NcTextField } from '@nextcloud/vue'\nimport {\n\tDURATION_UNITS,\n\tdurationSeconds,\n\tformatClock,\n\tformatDuration,\n\tisIsoDuration,\n\tparseClock,\n\tparseDuration,\n\tsecondsToDuration,\n} from '../../utils/isoDuration.js'\n\n/**\n * CnDurationField — edits an ISO 8601 duration as a number plus a unit\n * (minutes, hours, days, weeks, months, years). `CnFormDialog` renders it for\n * `type: string, format: duration`.\n *\n * `P56D` shows 56 and days; changing the unit writes the canonical string.\n * A value that is not exactly one unit (`P1DT2H`) shows as read-only ISO text\n * with an \"Edit as ISO\" toggle, so nothing is rounded. Clearing the number\n * writes `null`.\n *\n * With `timer` the field is a clock: Start, Stop and Reset run it, and it writes\n * the running time into the value every second, so a form saved mid-run holds it.\n * Typing a time stops the clock and keeps what was typed. `autoStart` starts it\n * when the field holds no value yet. `norm` shows the time against a length.\n *\n * Example:\n * ```vue\n * <CnDurationField v-model=\"term\" input-label=\"Handling term\" />\n * <CnDurationField v-model=\"length\" input-label=\"Duration\" timer auto-start norm=\"PT5M\" />\n * ```\n */\nexport default {\n\tname: 'CnDurationField',\n\n\tcomponents: { NcButton, NcProgressBar, NcSelect, NcTextField },\n\n\tprops: {\n\t\t/** ISO 8601 duration string (v-model), or null. */\n\t\tmodelValue: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Accessible label of the number input. */\n\t\tinputLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Accessible label of the unit select. */\n\t\tunitLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Unit'),\n\t\t},\n\n\t\t/** Disable both inputs. */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Show the inputs in their error state. */\n\t\terror: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** Draw the field as a clock with Start, Stop and Reset. */\n\t\ttimer: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** With `timer`: start the clock when the field holds no value yet. */\n\t\tautoStart: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/** With `timer`: an ISO 8601 length to show the time against. */\n\t\tnorm: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Percentage of `norm` from which the bar warns. */\n\t\tnormWarningPercent: {\n\t\t\ttype: Number,\n\t\t\tdefault: 80,\n\t\t},\n\n\t\t/** Words before the time on the norm line. */\n\t\tnormLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/** Accessible name of the Start, Stop and Reset group. */\n\t\ttimerLabel: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Timer'),\n\t\t},\n\n\t\t/** With `timer`: a line under the clock. */\n\t\thint: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t},\n\n\temits: ['update:modelValue', 'started', 'stopped', 'reset'],\n\n\tdata() {\n\t\treturn {\n\t\t\tunit: 'days',\n\t\t\teditIso: false,\n\t\t\tdraftIso: null,\n\t\t\trunning: false,\n\t\t\thasRun: false,\n\t\t\tstartedAt: 0,\n\t\t\tsecondsBefore: 0,\n\t\t\telapsed: 0,\n\t\t\tclockDraft: null,\n\t\t\tinterval: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tparsed() {\n\t\t\treturn parseDuration(this.modelValue)\n\t\t},\n\n\t\thasValue() {\n\t\t\treturn this.modelValue !== null && this.modelValue !== undefined && this.modelValue !== ''\n\t\t},\n\n\t\t// A non-empty value that is not one unit is shown as ISO text.\n\t\trawMode() {\n\t\t\treturn this.editIso || (this.hasValue && this.parsed === null)\n\t\t},\n\n\t\trawText() {\n\t\t\treturn this.draftIso !== null ? this.draftIso : (this.modelValue || '')\n\t\t},\n\n\t\tvalidIso() {\n\t\t\treturn isIsoDuration(this.rawText)\n\t\t},\n\n\t\tcurrentUnit() {\n\t\t\treturn this.parsed ? this.parsed.unit : this.unit\n\t\t},\n\n\t\tamountText() {\n\t\t\treturn this.parsed ? String(this.parsed.amount) : ''\n\t\t},\n\n\t\tunitOptions() {\n\t\t\tconst labels = {\n\t\t\t\tminutes: t('nextcloud-vue', 'minutes'),\n\t\t\t\thours: t('nextcloud-vue', 'hours'),\n\t\t\t\tdays: t('nextcloud-vue', 'days'),\n\t\t\t\tweeks: t('nextcloud-vue', 'weeks'),\n\t\t\t\tmonths: t('nextcloud-vue', 'months'),\n\t\t\t\tyears: t('nextcloud-vue', 'years'),\n\t\t\t}\n\t\t\treturn DURATION_UNITS.map((u) => ({ id: u, label: labels[u] }))\n\t\t},\n\n\t\tunitOption() {\n\t\t\treturn this.unitOptions.find((o) => o.id === this.currentUnit) || null\n\t\t},\n\n\t\tclockInvalid() {\n\t\t\treturn this.clockDraft !== null && this.clockDraft.trim() !== '' && parseClock(this.clockDraft) === null\n\t\t},\n\n\t\tclockText() {\n\t\t\tif (this.clockDraft !== null) {\n\t\t\t\treturn this.clockDraft\n\t\t\t}\n\t\t\treturn this.running || this.hasValue ? formatClock(this.elapsed) : ''\n\t\t},\n\n\t\tstateText() {\n\t\t\tif (this.running) {\n\t\t\t\treturn t('nextcloud-vue', 'Running')\n\t\t\t}\n\t\t\treturn this.hasRun ? t('nextcloud-vue', 'Stopped') : ''\n\t\t},\n\n\t\tnormSeconds() {\n\t\t\treturn this.norm ? durationSeconds(this.norm) : null\n\t\t},\n\n\t\tnormPercent() {\n\t\t\treturn this.normSeconds ? Math.round((this.elapsed / this.normSeconds) * 100) : 0\n\t\t},\n\n\t\tnormLevel() {\n\t\t\tif (this.normPercent >= 100) {\n\t\t\t\treturn 'over'\n\t\t\t}\n\t\t\treturn this.normPercent >= this.normWarningPercent ? 'near' : 'within'\n\t\t},\n\n\t\tnormWords() {\n\t\t\tif (this.normLevel === 'over') {\n\t\t\t\treturn t('nextcloud-vue', 'Over the norm')\n\t\t\t}\n\t\t\treturn this.normLevel === 'near' ? t('nextcloud-vue', 'Close to the norm') : ''\n\t\t},\n\n\t\tnormText() {\n\t\t\tconst amount = t('nextcloud-vue', '{elapsed} of {norm}', {\n\t\t\t\telapsed: formatClock(this.elapsed),\n\t\t\t\tnorm: formatClock(this.normSeconds),\n\t\t\t})\n\t\t\treturn this.normLabel ? `${this.normLabel} ${amount}` : amount\n\t\t},\n\t},\n\n\twatch: {\n\t\t// The clock owns the value while it runs; the echo of its own write is ignored.\n\t\tmodelValue: {\n\t\t\timmediate: true,\n\t\t\thandler(value) {\n\t\t\t\tif (!this.running) {\n\t\t\t\t\tthis.elapsed = durationSeconds(value) ?? 0\n\t\t\t\t}\n\t\t\t\tif (this.clockDraft !== null && secondsToDuration(parseClock(this.clockDraft)) !== value) {\n\t\t\t\t\tthis.clockDraft = null\n\t\t\t\t}\n\t\t\t},\n\t\t},\n\n\t\tautoStart() {\n\t\t\tthis.maybeAutoStart()\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.maybeAutoStart()\n\t},\n\n\tbeforeUnmount() {\n\t\tclearInterval(this.interval)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\tmaybeAutoStart() {\n\t\t\tif (this.timer && this.autoStart && !this.disabled && !this.hasRun && !this.hasValue) {\n\t\t\t\tthis.start()\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Run the clock from the time it shows now.\n\t\t *\n\t\t * @spec openspec/changes/duration-field-timer/specs/duration-field-timer/spec.md#requirement-a-duration-field-can-run-as-a-clock\n\t\t */\n\t\tstart() {\n\t\t\tif (this.running) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.clockDraft = null\n\t\t\tthis.secondsBefore = this.elapsed\n\t\t\tthis.startedAt = Date.now()\n\t\t\tthis.running = true\n\t\t\tthis.hasRun = true\n\t\t\tthis.interval = setInterval(this.tick, 1000)\n\t\t\t/** @event started The clock started. */\n\t\t\tthis.$emit('started')\n\t\t},\n\n\t\t// Counted from the start time, because a background tab throttles intervals.\n\t\ttick() {\n\t\t\tthis.elapsed = this.secondsBefore + Math.floor((Date.now() - this.startedAt) / 1000)\n\t\t\tthis.$emit('update:modelValue', secondsToDuration(this.elapsed))\n\t\t},\n\n\t\thalt() {\n\t\t\tclearInterval(this.interval)\n\t\t\tthis.interval = null\n\t\t\tthis.running = false\n\t\t},\n\n\t\t/**\n\t\t * Stop the clock and write the final time.\n\t\t *\n\t\t * @spec openspec/changes/duration-field-timer/specs/duration-field-timer/spec.md#requirement-a-duration-field-can-run-as-a-clock\n\t\t */\n\t\tstop() {\n\t\t\tif (!this.running) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.tick()\n\t\t\tthis.halt()\n\t\t\tconst value = secondsToDuration(this.elapsed)\n\t\t\t/** @event stopped The clock stopped; carries the ISO string of the time. */\n\t\t\tthis.$emit('stopped', value)\n\t\t},\n\n\t\t/**\n\t\t * Stop the clock and clear the value.\n\t\t *\n\t\t * @spec openspec/changes/duration-field-timer/specs/duration-field-timer/spec.md#requirement-a-duration-field-can-run-as-a-clock\n\t\t */\n\t\treset() {\n\t\t\tthis.halt()\n\t\t\tthis.elapsed = 0\n\t\t\tthis.clockDraft = null\n\t\t\tthis.hasRun = false\n\t\t\tthis.$emit('update:modelValue', null)\n\t\t\t/** @event reset The clock stopped and the value was cleared. */\n\t\t\tthis.$emit('reset')\n\t\t},\n\n\t\tonClock(text) {\n\t\t\tconst seconds = parseClock(text)\n\t\t\tthis.clockDraft = text\n\t\t\tif (String(text).trim() === '') {\n\t\t\t\tthis.halt()\n\t\t\t\tthis.elapsed = 0\n\t\t\t\tthis.$emit('update:modelValue', null)\n\t\t\t} else if (seconds !== null) {\n\t\t\t\tthis.halt()\n\t\t\t\tthis.elapsed = seconds\n\t\t\t\tthis.$emit('update:modelValue', secondsToDuration(seconds))\n\t\t\t}\n\t\t},\n\n\t\tonAmount(value) {\n\t\t\t/** @event update:modelValue The ISO string for the chosen amount and unit; null when the amount is cleared. */\n\t\t\tthis.$emit('update:modelValue', formatDuration(value, this.currentUnit))\n\t\t},\n\n\t\tonUnit(option) {\n\t\t\tif (!option) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.unit = option.id\n\t\t\tif (this.parsed) {\n\t\t\t\tthis.$emit('update:modelValue', formatDuration(this.parsed.amount, option.id))\n\t\t\t}\n\t\t},\n\n\t\tonIso(value) {\n\t\t\tthis.draftIso = value\n\t\t\tif (isIsoDuration(value)) {\n\t\t\t\tthis.$emit('update:modelValue', value)\n\t\t\t} else if (value === '') {\n\t\t\t\tthis.$emit('update:modelValue', null)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-duration-field__row {\n\tdisplay: flex;\n\tgap: 8px;\n\talign-items: flex-end;\n}\n\n.cn-duration-field__amount,\n.cn-duration-field__iso {\n\tflex: 1 1 auto;\n}\n\n.cn-duration-field__unit {\n\tmin-width: 140px;\n}\n\n.cn-duration-field__row--timer {\n\tflex-wrap: wrap;\n}\n\n.cn-duration-field__clock {\n\tflex: 0 1 160px;\n\tfont-variant-numeric: tabular-nums;\n}\n\n.cn-duration-field__controls {\n\tdisplay: flex;\n\tgap: 4px;\n}\n\n.cn-duration-field__state {\n\talign-self: center;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-duration-field__state--running {\n\tcolor: var(--color-success-text);\n\tfont-weight: bold;\n}\n\n.cn-duration-field__norm {\n\tmargin-top: 8px;\n}\n\n.cn-duration-field__norm-line {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tjustify-content: space-between;\n\tmargin-bottom: 4px;\n\tfont-variant-numeric: tabular-nums;\n}\n\n.cn-duration-field__norm--near .cn-duration-field__norm-line {\n\tcolor: var(--color-warning-text);\n}\n\n.cn-duration-field__norm--over .cn-duration-field__norm-line {\n\tcolor: var(--color-error-text);\n}\n</style>\n"],"names":["_openBlock","_createElementBlock","_createVNode","_createElementVNode","_createBlock","_normalizeClass","_toDisplayString"],"mappings":"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"}
|
|
@@ -2,7 +2,7 @@ import script from './CnFormDialog.vue2.js';
|
|
|
2
2
|
import { render } from './CnFormDialog.vue3.js';
|
|
3
3
|
|
|
4
4
|
script.render = render;
|
|
5
|
-
script.__scopeId = "data-v-
|
|
5
|
+
script.__scopeId = "data-v-52624130";
|
|
6
6
|
const __sfc_main = script;
|
|
7
7
|
|
|
8
8
|
export { __sfc_main as default };
|