@conduction/nextcloud-vue 2.170.0 → 2.171.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js +9 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js +242 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue2.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js +200 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroup.vue3.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js +9 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js +186 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue2.js.map +1 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js +24 -0
- package/dist/esm/components/CnConditionGroupEditor/CnConditionGroupEditor.vue3.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue.js +1 -1
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js +3 -15
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue2.js.map +1 -1
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js +16 -61
- package/dist/esm/components/CnConditionListEditor/CnConditionListEditor.vue3.js.map +1 -1
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js +9 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js +120 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue2.js.map +1 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js +86 -0
- package/dist/esm/components/CnConditionListEditor/CnConditionRow.vue3.js.map +1 -0
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js +9 -9
- package/dist/esm/components/CnDetailPage/CnDetailPage.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue3.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue.js +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue2.js.map +1 -1
- package/dist/esm/components/CnDetailWidgetHost/CnDetailWidgetHost.vue3.js.map +1 -1
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js +8 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue.js.map +1 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js +101 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue2.js.map +1 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js +54 -0
- package/dist/esm/components/CnDialogActions/CnDialogActions.vue3.js.map +1 -0
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js +14 -2
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue2.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js +1 -1
- package/dist/esm/components/CnFilesBrowser/CnFilesBrowser.vue3.js.map +1 -1
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js +21 -2
- package/dist/esm/components/CnFilesBrowser/filesBrowser.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue.js +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js +7 -0
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js +2 -2
- package/dist/esm/components/CnFlowsPage/CnFlowBoard.vue3.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js +11 -0
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue2.js.map +1 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js +2 -1
- package/dist/esm/components/CnFlowsPage/CnFlowEditorPage.vue3.js.map +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue.js +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnLinkedWidget/CnLinkedWidget.vue3.js.map +1 -1
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue.js +9 -0
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue.js.map +1 -0
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue2.js +248 -0
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue2.js.map +1 -0
- package/dist/esm/components/{CnMassDeleteDialog/CnMassDeleteDialog.vue3.js → CnMassActionDialog/CnMassActionDialog.vue3.js} +66 -52
- package/dist/esm/components/CnMassActionDialog/CnMassActionDialog.vue3.js.map +1 -0
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue.js +0 -3
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue.js.map +1 -1
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue2.js +25 -121
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue2.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue.js +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js +11 -3
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue2.js.map +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js +1 -1
- package/dist/esm/components/CnNotesCard/CnNotesCard.vue3.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue.js +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js +21 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js +2 -2
- package/dist/esm/components/CnObjectSidebar/CnNotesTab.vue3.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue.js +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeNode.vue3.js +23 -5
- 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 +3 -0
- package/dist/esm/components/CnTreeView/CnTreeView.vue2.js.map +1 -1
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js +14 -4
- package/dist/esm/components/CnTreeView/CnTreeView.vue3.js.map +1 -1
- package/dist/esm/dialogs/CnConfirmDialog.vue.js +1 -1
- package/dist/esm/dialogs/CnConfirmDialog.vue2.js.map +1 -1
- package/dist/esm/dialogs/CnConfirmDialog.vue3.js +5 -3
- package/dist/esm/dialogs/CnConfirmDialog.vue3.js.map +1 -1
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/l10n/en.json.js +16 -1
- package/dist/esm/l10n/en.json.js.map +1 -1
- package/dist/esm/l10n/nl.json.js +16 -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 +638 -302
- package/dist/esm/utils/noteThreads.js +14 -2
- package/dist/esm/utils/noteThreads.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +11316 -10074
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +638 -302
- package/l10n/en.json +16 -1
- package/l10n/nl.json +16 -1
- package/package.json +1 -1
- package/scripts/.jsdoc-baselines.json +1 -1
- package/src/components/CnConditionGroupEditor/CnConditionGroup.vue +528 -0
- package/src/components/CnConditionGroupEditor/CnConditionGroupEditor.vue +211 -0
- package/src/components/CnConditionGroupEditor/index.js +9 -0
- package/src/components/CnConditionListEditor/CnConditionListEditor.vue +15 -78
- package/src/components/CnConditionListEditor/CnConditionRow.vue +226 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +8 -8
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue +6 -0
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +0 -6
- package/src/components/CnDialogActions/CnDialogActions.vue +124 -0
- package/src/components/CnDialogActions/index.js +7 -0
- package/src/components/CnFilesBrowser/CnFilesBrowser.vue +15 -3
- package/src/components/CnFilesBrowser/filesBrowser.js +21 -2
- package/src/components/CnFlowsPage/CnFlowBoard.vue +10 -3
- package/src/components/CnFlowsPage/CnFlowEditorPage.vue +12 -0
- package/src/components/CnLinkedWidget/CnLinkedWidget.vue +7 -0
- package/src/components/CnMassActionDialog/CnMassActionDialog.vue +382 -0
- package/src/components/CnMassActionDialog/index.js +7 -0
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.md +4 -0
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +25 -254
- package/src/components/CnNotesCard/CnNotesCard.vue +12 -4
- package/src/components/CnObjectSidebar/CnNotesTab.vue +23 -3
- package/src/components/CnTreeView/CnTreeNode.vue +10 -1
- package/src/components/CnTreeView/CnTreeView.vue +9 -0
- package/src/components/index.js +3 -0
- package/src/css/context-menu.css +7 -0
- package/src/css/look-board-detail.css +120 -1
- package/src/css/look-board.css +43 -2
- package/src/dialogs/CnConfirmDialog.vue +3 -1
- package/src/index.js +3 -0
- package/src/utils/noteThreads.js +13 -1
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue3.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import script from './CnConditionGroup.vue2.js';
|
|
2
|
+
import { render } from './CnConditionGroup.vue3.js';
|
|
3
|
+
|
|
4
|
+
script.render = render;
|
|
5
|
+
script.__scopeId = "data-v-73aaa314";
|
|
6
|
+
const __sfc_main = script;
|
|
7
|
+
|
|
8
|
+
export { __sfc_main as default };
|
|
9
|
+
//# sourceMappingURL=CnConditionGroup.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnConditionGroup.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
|
+
import { NcButton, NcCheckboxRadioSwitch } from '@nextcloud/vue';
|
|
3
|
+
import FolderPlusOutline from 'vue-material-design-icons/FolderPlusOutline.vue';
|
|
4
|
+
import Lock from 'vue-material-design-icons/Lock.vue';
|
|
5
|
+
import Plus from 'vue-material-design-icons/Plus.vue';
|
|
6
|
+
import TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue';
|
|
7
|
+
import __sfc_main from '../CnConditionListEditor/CnConditionRow.vue.js';
|
|
8
|
+
import { operatorTakesValue } from '../CnConditionListEditor/conditionOperators.js';
|
|
9
|
+
|
|
10
|
+
let groupSeq = 0;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* CnConditionGroup - one group of CnConditionGroupEditor: the combinator
|
|
14
|
+
* choice, its rows, and the groups inside it, drawn recursively. Internal to
|
|
15
|
+
* the editor, which owns the tree.
|
|
16
|
+
*/
|
|
17
|
+
var script = {
|
|
18
|
+
name: 'CnConditionGroup',
|
|
19
|
+
|
|
20
|
+
components: { CnConditionRow: __sfc_main, FolderPlusOutline, Lock, NcButton, NcCheckboxRadioSwitch, Plus, TrashCanOutline },
|
|
21
|
+
|
|
22
|
+
props: {
|
|
23
|
+
/** The group: `{ type: 'AND' | 'OR', children }`. */
|
|
24
|
+
node: { type: Object, required: true },
|
|
25
|
+
/** How deep this group sits; the root is 0. */
|
|
26
|
+
depth: { type: Number, default: 0 },
|
|
27
|
+
/** This group's path in validator notation (`$.children[1]`). */
|
|
28
|
+
path: { type: String, default: '$' },
|
|
29
|
+
/** The fields, normalised to `{ id, label, type, format?, options? }`. */
|
|
30
|
+
fields: { type: Array, default: () => [] },
|
|
31
|
+
/** The operators of a field, `(field) => [{ id, label }]`. */
|
|
32
|
+
operatorsFor: { type: Function, required: true },
|
|
33
|
+
/** The deepest group Add group may create. */
|
|
34
|
+
maxDepth: { type: Number, default: 1 },
|
|
35
|
+
/** Messages keyed by node path. */
|
|
36
|
+
errors: { type: Object, default: () => ({}) },
|
|
37
|
+
/** What an empty root says, already translated. */
|
|
38
|
+
emptyText: { type: String, default: '' },
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
emits: ['update:node', 'remove'],
|
|
42
|
+
|
|
43
|
+
data() {
|
|
44
|
+
groupSeq += 1;
|
|
45
|
+
return { radioName: `cn-condition-group-${groupSeq}` }
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
computed: {
|
|
49
|
+
combinators() {
|
|
50
|
+
return [
|
|
51
|
+
{ value: 'AND', label: translate('nextcloud-vue', 'Match all conditions') },
|
|
52
|
+
{ value: 'OR', label: translate('nextcloud-vue', 'Match any condition') },
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
controlLabels() {
|
|
57
|
+
return {
|
|
58
|
+
field: translate('nextcloud-vue', 'Field'),
|
|
59
|
+
operator: translate('nextcloud-vue', 'Condition'),
|
|
60
|
+
value: translate('nextcloud-vue', 'Value'),
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
ownError() {
|
|
65
|
+
return this.errors[this.path] || ''
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
methods: {
|
|
70
|
+
t: translate,
|
|
71
|
+
operatorTakesValue,
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* What a child is: a group drawn as a card, a group the editor keeps
|
|
75
|
+
* as written (NOT), or a condition.
|
|
76
|
+
*
|
|
77
|
+
* @param {object} child The child node.
|
|
78
|
+
* @return {string} group, locked or condition.
|
|
79
|
+
*/
|
|
80
|
+
kindOf(child) {
|
|
81
|
+
if (!Array.isArray(child?.children)) {
|
|
82
|
+
return 'condition'
|
|
83
|
+
}
|
|
84
|
+
return ['AND', 'OR'].includes(String(child.type || 'AND').toUpperCase()) ? 'group' : 'locked'
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The word before a row: Where on the first, then and or or.
|
|
89
|
+
*
|
|
90
|
+
* @param {number} index The row index.
|
|
91
|
+
* @return {string} The word.
|
|
92
|
+
*/
|
|
93
|
+
connector(index) {
|
|
94
|
+
if (index === 0) {
|
|
95
|
+
return translate('nextcloud-vue', 'Where')
|
|
96
|
+
}
|
|
97
|
+
return this.node.type === 'OR' ? translate('nextcloud-vue', 'or') : translate('nextcloud-vue', 'and')
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
caption(child) {
|
|
101
|
+
return String(child.type).toUpperCase() === 'OR'
|
|
102
|
+
? translate('nextcloud-vue', 'one of these')
|
|
103
|
+
: translate('nextcloud-vue', 'all of these')
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
childPath(index) {
|
|
107
|
+
return `${this.path}.children[${index}]`
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
fieldOf(id) {
|
|
111
|
+
return this.fields.find((f) => f.id === id)
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The field choices, plus a stored field the list does not offer.
|
|
116
|
+
*
|
|
117
|
+
* @param {object} child The condition.
|
|
118
|
+
* @return {Array<{id: string, label: string}>} The choices.
|
|
119
|
+
*/
|
|
120
|
+
fieldOptionsFor(child) {
|
|
121
|
+
const options = this.fields.map((f) => ({ id: f.id, label: f.label || f.id }));
|
|
122
|
+
if (child.field && !options.some((o) => o.id === child.field)) {
|
|
123
|
+
options.push({ id: child.field, label: child.field });
|
|
124
|
+
}
|
|
125
|
+
return options
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The operator choices of the condition's field, plus a stored
|
|
130
|
+
* operator the list does not offer.
|
|
131
|
+
*
|
|
132
|
+
* @param {object} child The condition.
|
|
133
|
+
* @return {Array<{id: string, label: string}>} The choices.
|
|
134
|
+
*/
|
|
135
|
+
operatorOptionsFor(child) {
|
|
136
|
+
const options = this.operatorsFor(this.fieldOf(child.field));
|
|
137
|
+
if (child.operator && !options.some((o) => o.id === child.operator)) {
|
|
138
|
+
return [...options, { id: child.operator, label: child.operator }]
|
|
139
|
+
}
|
|
140
|
+
return options
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
valueOptionsFor(child) {
|
|
144
|
+
const field = this.fieldOf(child.field);
|
|
145
|
+
if (field?.type === 'boolean') {
|
|
146
|
+
return [
|
|
147
|
+
{ id: true, label: translate('nextcloud-vue', 'Yes') },
|
|
148
|
+
{ id: false, label: translate('nextcloud-vue', 'No') },
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
if (Array.isArray(field?.options) && field.options.length > 0) {
|
|
152
|
+
return field.options.map((o) => (typeof o === 'object'
|
|
153
|
+
? { id: o.id ?? o.value, label: o.label ?? String(o.id ?? o.value) }
|
|
154
|
+
: { id: o, label: String(o) }))
|
|
155
|
+
}
|
|
156
|
+
return null
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
inputTypeFor(child) {
|
|
160
|
+
const field = this.fieldOf(child.field);
|
|
161
|
+
if (field?.type === 'number' || field?.type === 'integer') {
|
|
162
|
+
return 'number'
|
|
163
|
+
}
|
|
164
|
+
return field?.type === 'date' || field?.format === 'date' ? 'date' : 'text'
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
emitNode(next) {
|
|
168
|
+
this.$emit('update:node', next);
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
setChildren(children) {
|
|
172
|
+
this.emitNode({ ...this.node, children });
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
setChild(index, next) {
|
|
176
|
+
const children = [...this.node.children];
|
|
177
|
+
children[index] = next;
|
|
178
|
+
this.setChildren(children);
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
removeChild(index) {
|
|
182
|
+
this.setChildren(this.node.children.filter((_, i) => i !== index));
|
|
183
|
+
},
|
|
184
|
+
|
|
185
|
+
setType(type) {
|
|
186
|
+
this.emitNode({ ...this.node, type: type === 'OR' ? 'OR' : 'AND' });
|
|
187
|
+
},
|
|
188
|
+
|
|
189
|
+
addCondition() {
|
|
190
|
+
this.setChildren([...this.node.children, { field: '', operator: '', value: '' }]);
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
addGroup() {
|
|
194
|
+
this.setChildren([...this.node.children, { type: 'AND', children: [{ field: '', operator: '', value: '' }] }]);
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Pick a field: the operator resets to the field's first one and the
|
|
199
|
+
* value clears, since a value for another field rarely fits.
|
|
200
|
+
*
|
|
201
|
+
* @param {number} index The row index.
|
|
202
|
+
* @param {object} option The field choice.
|
|
203
|
+
*/
|
|
204
|
+
setField(index, option) {
|
|
205
|
+
const field = this.fieldOf(option?.id);
|
|
206
|
+
const first = this.operatorsFor(field)[0];
|
|
207
|
+
this.setChild(index, {
|
|
208
|
+
field: option?.id || '',
|
|
209
|
+
operator: first ? first.id : '',
|
|
210
|
+
value: field?.type === 'boolean' ? true : '',
|
|
211
|
+
});
|
|
212
|
+
},
|
|
213
|
+
|
|
214
|
+
setOperator(index, option) {
|
|
215
|
+
const next = { ...this.node.children[index], operator: option?.id || '' };
|
|
216
|
+
if (!operatorTakesValue(next.operator)) {
|
|
217
|
+
delete next.value;
|
|
218
|
+
} else if (next.value === undefined) {
|
|
219
|
+
next.value = '';
|
|
220
|
+
}
|
|
221
|
+
this.setChild(index, next);
|
|
222
|
+
},
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Set a value, as a number for a number field.
|
|
226
|
+
*
|
|
227
|
+
* @param {number} index The row index.
|
|
228
|
+
* @param {object} child The condition.
|
|
229
|
+
* @param {unknown} raw The picked or typed value.
|
|
230
|
+
*/
|
|
231
|
+
setValue(index, child, raw) {
|
|
232
|
+
let value = raw;
|
|
233
|
+
if (this.inputTypeFor(child) === 'number' && raw !== '' && !Number.isNaN(Number(raw))) {
|
|
234
|
+
value = Number(raw);
|
|
235
|
+
}
|
|
236
|
+
this.setChild(index, { ...child, value });
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export { script as default };
|
|
242
|
+
//# sourceMappingURL=CnConditionGroup.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnConditionGroup.vue2.js","sources":["../../../../src/components/CnConditionGroupEditor/CnConditionGroup.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-condition-group\"\n\t\t:class=\"{\n\t\t\t'cn-condition-group--nested': depth > 0,\n\t\t\t'cn-condition-group--error': !!ownError,\n\t\t}\">\n\t\t<div class=\"cn-condition-group__header\">\n\t\t\t<fieldset class=\"cn-condition-group__combinator\">\n\t\t\t\t<legend class=\"cn-condition-group__legend\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'How the conditions combine') }}\n\t\t\t\t</legend>\n\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\tv-for=\"choice in combinators\"\n\t\t\t\t\t:key=\"choice.value\"\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t:class=\"{ 'cn-condition-group__choice--checked': node.type === choice.value }\"\n\t\t\t\t\t:name=\"radioName\"\n\t\t\t\t\t:value=\"choice.value\"\n\t\t\t\t\t:modelValue=\"node.type\"\n\t\t\t\t\t@update:modelValue=\"setType\">\n\t\t\t\t\t{{ choice.label }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t</fieldset>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"depth > 0\"\n\t\t\t\tclass=\"cn-condition-group__remove-group\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t@click=\"$emit('remove')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<TrashCanOutline :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('nextcloud-vue', 'Remove group') }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<ol v-if=\"node.children.length\" class=\"cn-condition-group__rows\">\n\t\t\t<li v-for=\"(child, index) in node.children\" :key=\"index\" class=\"cn-condition-group__item\">\n\t\t\t\t<template v-if=\"kindOf(child) === 'group'\">\n\t\t\t\t\t<div class=\"cn-condition-group__line\">\n\t\t\t\t\t\t<span class=\"cn-condition-group__connector\">{{ connector(index) }}</span>\n\t\t\t\t\t\t<span class=\"cn-condition-group__caption\">{{ caption(child) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<CnConditionGroup\n\t\t\t\t\t\tclass=\"cn-condition-group__child\"\n\t\t\t\t\t\t:node=\"child\"\n\t\t\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t\t\t:path=\"childPath(index)\"\n\t\t\t\t\t\t:fields=\"fields\"\n\t\t\t\t\t\t:operatorsFor=\"operatorsFor\"\n\t\t\t\t\t\t:maxDepth=\"maxDepth\"\n\t\t\t\t\t\t:errors=\"errors\"\n\t\t\t\t\t\t@update:node=\"setChild(index, $event)\"\n\t\t\t\t\t\t@remove=\"removeChild(index)\" />\n\t\t\t\t</template>\n\t\t\t\t<div v-else-if=\"kindOf(child) === 'locked'\" class=\"cn-condition-group__line\">\n\t\t\t\t\t<span class=\"cn-condition-group__connector\">{{ connector(index) }}</span>\n\t\t\t\t\t<div class=\"cn-condition-group__locked\">\n\t\t\t\t\t\t<Lock :size=\"16\" />\n\t\t\t\t\t\t<span>{{ t('nextcloud-vue', 'These conditions are kept as written') }}</span>\n\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\tclass=\"cn-condition-group__pill\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Remove group')\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Remove group')\"\n\t\t\t\t\t\t\t@click=\"removeChild(index)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<TrashCanOutline :size=\"18\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-else class=\"cn-condition-group__line\">\n\t\t\t\t\t<span class=\"cn-condition-group__connector\">{{ connector(index) }}</span>\n\t\t\t\t\t<CnConditionRow\n\t\t\t\t\t\tclass=\"cn-condition-group__row\"\n\t\t\t\t\t\t:condition=\"child\"\n\t\t\t\t\t\t:fieldOptions=\"fieldOptionsFor(child)\"\n\t\t\t\t\t\t:operatorOptions=\"operatorOptionsFor(child)\"\n\t\t\t\t\t\t:valueOptions=\"valueOptionsFor(child)\"\n\t\t\t\t\t\t:inputType=\"inputTypeFor(child)\"\n\t\t\t\t\t\t:showValue=\"operatorTakesValue(child.operator)\"\n\t\t\t\t\t\t:controlLabels=\"controlLabels\"\n\t\t\t\t\t\t:error=\"errors[childPath(index)] || ''\"\n\t\t\t\t\t\thideLabels\n\t\t\t\t\t\t@field=\"setField(index, $event)\"\n\t\t\t\t\t\t@operator=\"setOperator(index, $event)\"\n\t\t\t\t\t\t@value=\"setValue(index, child, $event)\"\n\t\t\t\t\t\t@remove=\"removeChild(index)\">\n\t\t\t\t\t\t<template #remove-icon>\n\t\t\t\t\t\t\t<TrashCanOutline :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</CnConditionRow>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</ol>\n\t\t<p v-else class=\"cn-condition-group__empty\">\n\t\t\t{{ depth === 0 && emptyText ? emptyText : t('nextcloud-vue', 'This group has no conditions yet.') }}\n\t\t</p>\n\n\t\t<p v-if=\"ownError\" class=\"cn-condition-group__error\" role=\"alert\">\n\t\t\t{{ ownError }}\n\t\t</p>\n\n\t\t<div class=\"cn-condition-group__actions\">\n\t\t\t<NcButton variant=\"tertiary\" :disabled=\"fields.length === 0\" @click=\"addCondition\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('nextcloud-vue', 'Add condition') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"depth < maxDepth\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:disabled=\"fields.length === 0\"\n\t\t\t\t@click=\"addGroup\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FolderPlusOutline :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('nextcloud-vue', 'Add group') }}\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, NcCheckboxRadioSwitch } from '@nextcloud/vue'\nimport FolderPlusOutline from 'vue-material-design-icons/FolderPlusOutline.vue'\nimport Lock from 'vue-material-design-icons/Lock.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'\nimport CnConditionRow from '../CnConditionListEditor/CnConditionRow.vue'\nimport { operatorTakesValue } from '../CnConditionListEditor/conditionOperators.js'\n\nlet groupSeq = 0\n\n/**\n * CnConditionGroup - one group of CnConditionGroupEditor: the combinator\n * choice, its rows, and the groups inside it, drawn recursively. Internal to\n * the editor, which owns the tree.\n */\nexport default {\n\tname: 'CnConditionGroup',\n\n\tcomponents: { CnConditionRow, FolderPlusOutline, Lock, NcButton, NcCheckboxRadioSwitch, Plus, TrashCanOutline },\n\n\tprops: {\n\t\t/** The group: `{ type: 'AND' | 'OR', children }`. */\n\t\tnode: { type: Object, required: true },\n\t\t/** How deep this group sits; the root is 0. */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** This group's path in validator notation (`$.children[1]`). */\n\t\tpath: { type: String, default: '$' },\n\t\t/** The fields, normalised to `{ id, label, type, format?, options? }`. */\n\t\tfields: { type: Array, default: () => [] },\n\t\t/** The operators of a field, `(field) => [{ id, label }]`. */\n\t\toperatorsFor: { type: Function, required: true },\n\t\t/** The deepest group Add group may create. */\n\t\tmaxDepth: { type: Number, default: 1 },\n\t\t/** Messages keyed by node path. */\n\t\terrors: { type: Object, default: () => ({}) },\n\t\t/** What an empty root says, already translated. */\n\t\temptyText: { type: String, default: '' },\n\t},\n\n\temits: ['update:node', 'remove'],\n\n\tdata() {\n\t\tgroupSeq += 1\n\t\treturn { radioName: `cn-condition-group-${groupSeq}` }\n\t},\n\n\tcomputed: {\n\t\tcombinators() {\n\t\t\treturn [\n\t\t\t\t{ value: 'AND', label: t('nextcloud-vue', 'Match all conditions') },\n\t\t\t\t{ value: 'OR', label: t('nextcloud-vue', 'Match any condition') },\n\t\t\t]\n\t\t},\n\n\t\tcontrolLabels() {\n\t\t\treturn {\n\t\t\t\tfield: t('nextcloud-vue', 'Field'),\n\t\t\t\toperator: t('nextcloud-vue', 'Condition'),\n\t\t\t\tvalue: t('nextcloud-vue', 'Value'),\n\t\t\t}\n\t\t},\n\n\t\townError() {\n\t\t\treturn this.errors[this.path] || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\t\toperatorTakesValue,\n\n\t\t/**\n\t\t * What a child is: a group drawn as a card, a group the editor keeps\n\t\t * as written (NOT), or a condition.\n\t\t *\n\t\t * @param {object} child The child node.\n\t\t * @return {string} group, locked or condition.\n\t\t */\n\t\tkindOf(child) {\n\t\t\tif (!Array.isArray(child?.children)) {\n\t\t\t\treturn 'condition'\n\t\t\t}\n\t\t\treturn ['AND', 'OR'].includes(String(child.type || 'AND').toUpperCase()) ? 'group' : 'locked'\n\t\t},\n\n\t\t/**\n\t\t * The word before a row: Where on the first, then and or or.\n\t\t *\n\t\t * @param {number} index The row index.\n\t\t * @return {string} The word.\n\t\t */\n\t\tconnector(index) {\n\t\t\tif (index === 0) {\n\t\t\t\treturn t('nextcloud-vue', 'Where')\n\t\t\t}\n\t\t\treturn this.node.type === 'OR' ? t('nextcloud-vue', 'or') : t('nextcloud-vue', 'and')\n\t\t},\n\n\t\tcaption(child) {\n\t\t\treturn String(child.type).toUpperCase() === 'OR'\n\t\t\t\t? t('nextcloud-vue', 'one of these')\n\t\t\t\t: t('nextcloud-vue', 'all of these')\n\t\t},\n\n\t\tchildPath(index) {\n\t\t\treturn `${this.path}.children[${index}]`\n\t\t},\n\n\t\tfieldOf(id) {\n\t\t\treturn this.fields.find((f) => f.id === id)\n\t\t},\n\n\t\t/**\n\t\t * The field choices, plus a stored field the list does not offer.\n\t\t *\n\t\t * @param {object} child The condition.\n\t\t * @return {Array<{id: string, label: string}>} The choices.\n\t\t */\n\t\tfieldOptionsFor(child) {\n\t\t\tconst options = this.fields.map((f) => ({ id: f.id, label: f.label || f.id }))\n\t\t\tif (child.field && !options.some((o) => o.id === child.field)) {\n\t\t\t\toptions.push({ id: child.field, label: child.field })\n\t\t\t}\n\t\t\treturn options\n\t\t},\n\n\t\t/**\n\t\t * The operator choices of the condition's field, plus a stored\n\t\t * operator the list does not offer.\n\t\t *\n\t\t * @param {object} child The condition.\n\t\t * @return {Array<{id: string, label: string}>} The choices.\n\t\t */\n\t\toperatorOptionsFor(child) {\n\t\t\tconst options = this.operatorsFor(this.fieldOf(child.field))\n\t\t\tif (child.operator && !options.some((o) => o.id === child.operator)) {\n\t\t\t\treturn [...options, { id: child.operator, label: child.operator }]\n\t\t\t}\n\t\t\treturn options\n\t\t},\n\n\t\tvalueOptionsFor(child) {\n\t\t\tconst field = this.fieldOf(child.field)\n\t\t\tif (field?.type === 'boolean') {\n\t\t\t\treturn [\n\t\t\t\t\t{ id: true, label: t('nextcloud-vue', 'Yes') },\n\t\t\t\t\t{ id: false, label: t('nextcloud-vue', 'No') },\n\t\t\t\t]\n\t\t\t}\n\t\t\tif (Array.isArray(field?.options) && field.options.length > 0) {\n\t\t\t\treturn field.options.map((o) => (typeof o === 'object'\n\t\t\t\t\t? { id: o.id ?? o.value, label: o.label ?? String(o.id ?? o.value) }\n\t\t\t\t\t: { id: o, label: String(o) }))\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\n\t\tinputTypeFor(child) {\n\t\t\tconst field = this.fieldOf(child.field)\n\t\t\tif (field?.type === 'number' || field?.type === 'integer') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\treturn field?.type === 'date' || field?.format === 'date' ? 'date' : 'text'\n\t\t},\n\n\t\temitNode(next) {\n\t\t\tthis.$emit('update:node', next)\n\t\t},\n\n\t\tsetChildren(children) {\n\t\t\tthis.emitNode({ ...this.node, children })\n\t\t},\n\n\t\tsetChild(index, next) {\n\t\t\tconst children = [...this.node.children]\n\t\t\tchildren[index] = next\n\t\t\tthis.setChildren(children)\n\t\t},\n\n\t\tremoveChild(index) {\n\t\t\tthis.setChildren(this.node.children.filter((_, i) => i !== index))\n\t\t},\n\n\t\tsetType(type) {\n\t\t\tthis.emitNode({ ...this.node, type: type === 'OR' ? 'OR' : 'AND' })\n\t\t},\n\n\t\taddCondition() {\n\t\t\tthis.setChildren([...this.node.children, { field: '', operator: '', value: '' }])\n\t\t},\n\n\t\taddGroup() {\n\t\t\tthis.setChildren([...this.node.children, { type: 'AND', children: [{ field: '', operator: '', value: '' }] }])\n\t\t},\n\n\t\t/**\n\t\t * Pick a field: the operator resets to the field's first one and the\n\t\t * value clears, since a value for another field rarely fits.\n\t\t *\n\t\t * @param {number} index The row index.\n\t\t * @param {object} option The field choice.\n\t\t */\n\t\tsetField(index, option) {\n\t\t\tconst field = this.fieldOf(option?.id)\n\t\t\tconst first = this.operatorsFor(field)[0]\n\t\t\tthis.setChild(index, {\n\t\t\t\tfield: option?.id || '',\n\t\t\t\toperator: first ? first.id : '',\n\t\t\t\tvalue: field?.type === 'boolean' ? true : '',\n\t\t\t})\n\t\t},\n\n\t\tsetOperator(index, option) {\n\t\t\tconst next = { ...this.node.children[index], operator: option?.id || '' }\n\t\t\tif (!operatorTakesValue(next.operator)) {\n\t\t\t\tdelete next.value\n\t\t\t} else if (next.value === undefined) {\n\t\t\t\tnext.value = ''\n\t\t\t}\n\t\t\tthis.setChild(index, next)\n\t\t},\n\n\t\t/**\n\t\t * Set a value, as a number for a number field.\n\t\t *\n\t\t * @param {number} index The row index.\n\t\t * @param {object} child The condition.\n\t\t * @param {unknown} raw The picked or typed value.\n\t\t */\n\t\tsetValue(index, child, raw) {\n\t\t\tlet value = raw\n\t\t\tif (this.inputTypeFor(child) === 'number' && raw !== '' && !Number.isNaN(Number(raw))) {\n\t\t\t\tvalue = Number(raw)\n\t\t\t}\n\t\t\tthis.setChild(index, { ...child, value })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-condition-group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmin-width: 0;\n\tpadding: 14px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\t--cn-condition-row-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.25fr) auto;\n\t--cn-condition-row-align: center;\n}\n\n.cn-condition-group--nested {\n\tmargin-inline-start: 52px;\n\tpadding: 12px 12px 8px;\n\tborder-color: var(--color-border);\n\tborder-inline-start: 3px solid var(--color-primary-element);\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-background-hover);\n}\n\n.cn-condition-group--error {\n\tborder-color: var(--color-border-error, var(--color-error));\n}\n\n.cn-condition-group__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n}\n\n.cn-condition-group__combinator {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px 18px;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tmin-width: 0;\n}\n\n.cn-condition-group__legend {\n\tfloat: inline-start;\n\tmargin-inline-end: 6px;\n\tpadding: 0;\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__choice--checked :deep(.checkbox-radio-switch__text) {\n\tfont-weight: 600;\n}\n\n.cn-condition-group__remove-group {\n\tcolor: var(--color-text-error, var(--color-error));\n}\n\n.cn-condition-group__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-condition-group__item {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmin-width: 0;\n}\n\n.cn-condition-group__line {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tmin-width: 0;\n}\n\n.cn-condition-group__connector {\n\tflex: 0 0 44px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__caption {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__row {\n\tflex: 1 1 auto;\n}\n\n.cn-condition-group__locked {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\talign-items: center;\n\tgap: 8px;\n\tmin-height: var(--default-clickable-area);\n\tpadding: 0 0 0 10px;\n\tborder: 1px dashed var(--color-border-dark);\n\tborder-radius: var(--border-radius-element, 8px);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__locked > span {\n\tflex: 1 1 auto;\n}\n\n.cn-condition-group__pill,\n.cn-condition-group__row :deep(.cn-condition-row__remove) {\n\tborder-radius: var(--border-radius-pill, 17px);\n}\n\n.cn-condition-group__empty {\n\tmargin: 0;\n\tpadding: 12px;\n\tborder: 1px dashed var(--color-border-dark);\n\tborder-radius: var(--border-radius-large);\n\tcolor: var(--color-text-maxcontrast);\n\ttext-align: center;\n}\n\n.cn-condition-group__error {\n\tmargin: 0;\n\tcolor: var(--color-text-error, var(--color-error));\n\tfont-size: 0.9em;\n}\n\n.cn-condition-group__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 6px;\n\tpadding-inline-start: 44px;\n}\n\n@media (max-width: 640px) {\n\t.cn-condition-group--nested {\n\t\tmargin-inline-start: 12px;\n\t}\n\n\t.cn-condition-group__line {\n\t\tflex-wrap: wrap;\n\t}\n\n\t.cn-condition-group__actions {\n\t\tpadding-inline-start: 0;\n\t}\n}\n</style>\n"],"names":["CnConditionRow","t"],"mappings":";;;;;;;;;AA2IA,IAAI,QAAO,GAAI,EAAA;;AAEf;AACC;AACA;;;AAGD,aAAe;CACd,IAAI,EAAE,kBAAkB;;CAExB,UAAU,EAAE,kBAAEA,UAAc,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,qBAAqB,EAAE,IAAI,EAAE,eAAc,EAAG;;AAE/G,CAAA,KAAK,EAAE;AACN;AACA,EAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;AACtC;EACA,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,CAAA,EAAG;;AAEnC,EAAA,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,GAAE,EAAG;;AAEpC,EAAA,MAAM,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI;;AAE1C,EAAA,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM;AAChD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GAAE,IAAK,GAAE,EAAE;IAC5C,EAAA;GACD;;EAED,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE;AAC1B,GAAA,MAAM,IAAG,GAAI,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAC,IAAK,EAAG,GAAA;AACxE,GAAA,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;AACvC,IAAA,OAAO,IAAI,CAAC,MAAI;AACjB,IAAA,MAAO,IAAI,IAAI,CAAC,KAAM,KAAI,SAAS,EAAE;IACpC,IAAI,CAAC,KAAM,GAAE,GAAC;AACf,IAAA;GACA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAA;GACzB;;AAED;AACC;AACA;AACA;AACA;AACA;;EAED,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE;GAC3B,IAAI,KAAI,GAAI,IAAE;AACd,GAAA,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAE,KAAI,QAAO,IAAK,GAAE,KAAM,EAAC,IAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE;AACtF,IAAA,KAAI,GAAI,MAAM,CAAC,GAAG,EAAA;AACnB,IAAA;AACA,GAAA,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,GAAG,KAAK,EAAE,OAAO,EAAA;GACxC;EACD;AACF;;;;"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, Fragment, renderList, createBlock, withCtx, createTextVNode, createVNode, createCommentVNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = { class: "cn-condition-group__header" };
|
|
4
|
+
const _hoisted_2 = { class: "cn-condition-group__combinator" };
|
|
5
|
+
const _hoisted_3 = { class: "cn-condition-group__legend" };
|
|
6
|
+
const _hoisted_4 = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "cn-condition-group__rows"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_5 = { class: "cn-condition-group__line" };
|
|
11
|
+
const _hoisted_6 = { class: "cn-condition-group__connector" };
|
|
12
|
+
const _hoisted_7 = { class: "cn-condition-group__caption" };
|
|
13
|
+
const _hoisted_8 = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "cn-condition-group__line"
|
|
16
|
+
};
|
|
17
|
+
const _hoisted_9 = { class: "cn-condition-group__connector" };
|
|
18
|
+
const _hoisted_10 = { class: "cn-condition-group__locked" };
|
|
19
|
+
const _hoisted_11 = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "cn-condition-group__line"
|
|
22
|
+
};
|
|
23
|
+
const _hoisted_12 = { class: "cn-condition-group__connector" };
|
|
24
|
+
const _hoisted_13 = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "cn-condition-group__empty"
|
|
27
|
+
};
|
|
28
|
+
const _hoisted_14 = {
|
|
29
|
+
key: 2,
|
|
30
|
+
class: "cn-condition-group__error",
|
|
31
|
+
role: "alert"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_15 = { class: "cn-condition-group__actions" };
|
|
34
|
+
|
|
35
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
36
|
+
const _component_NcCheckboxRadioSwitch = resolveComponent("NcCheckboxRadioSwitch");
|
|
37
|
+
const _component_TrashCanOutline = resolveComponent("TrashCanOutline");
|
|
38
|
+
const _component_NcButton = resolveComponent("NcButton");
|
|
39
|
+
const _component_CnConditionGroup = resolveComponent("CnConditionGroup", true);
|
|
40
|
+
const _component_Lock = resolveComponent("Lock");
|
|
41
|
+
const _component_CnConditionRow = resolveComponent("CnConditionRow");
|
|
42
|
+
const _component_Plus = resolveComponent("Plus");
|
|
43
|
+
const _component_FolderPlusOutline = resolveComponent("FolderPlusOutline");
|
|
44
|
+
|
|
45
|
+
return (openBlock(), createElementBlock("div", {
|
|
46
|
+
class: normalizeClass(["cn-condition-group", {
|
|
47
|
+
'cn-condition-group--nested': $props.depth > 0,
|
|
48
|
+
'cn-condition-group--error': !!$options.ownError,
|
|
49
|
+
}])
|
|
50
|
+
}, [
|
|
51
|
+
createElementVNode("div", _hoisted_1, [
|
|
52
|
+
createElementVNode("fieldset", _hoisted_2, [
|
|
53
|
+
createElementVNode("legend", _hoisted_3, toDisplayString($options.t('nextcloud-vue', 'How the conditions combine')), 1 /* TEXT */),
|
|
54
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($options.combinators, (choice) => {
|
|
55
|
+
return (openBlock(), createBlock(_component_NcCheckboxRadioSwitch, {
|
|
56
|
+
key: choice.value,
|
|
57
|
+
type: "radio",
|
|
58
|
+
class: normalizeClass({ 'cn-condition-group__choice--checked': $props.node.type === choice.value }),
|
|
59
|
+
name: $data.radioName,
|
|
60
|
+
value: choice.value,
|
|
61
|
+
modelValue: $props.node.type,
|
|
62
|
+
"onUpdate:modelValue": $options.setType
|
|
63
|
+
}, {
|
|
64
|
+
default: withCtx(() => [
|
|
65
|
+
createTextVNode(toDisplayString(choice.label), 1 /* TEXT */)
|
|
66
|
+
]),
|
|
67
|
+
_: 2 /* DYNAMIC */
|
|
68
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["class", "name", "value", "modelValue", "onUpdate:modelValue"]))
|
|
69
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
70
|
+
]),
|
|
71
|
+
($props.depth > 0)
|
|
72
|
+
? (openBlock(), createBlock(_component_NcButton, {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "cn-condition-group__remove-group",
|
|
75
|
+
variant: "tertiary",
|
|
76
|
+
onClick: _cache[0] || (_cache[0] = $event => (_ctx.$emit('remove')))
|
|
77
|
+
}, {
|
|
78
|
+
icon: withCtx(() => [
|
|
79
|
+
createVNode(_component_TrashCanOutline, { size: 16 })
|
|
80
|
+
]),
|
|
81
|
+
default: withCtx(() => [
|
|
82
|
+
createTextVNode(" " + toDisplayString($options.t('nextcloud-vue', 'Remove group')), 1 /* TEXT */)
|
|
83
|
+
]),
|
|
84
|
+
_: 1 /* STABLE */
|
|
85
|
+
}))
|
|
86
|
+
: createCommentVNode("v-if", true)
|
|
87
|
+
]),
|
|
88
|
+
($props.node.children.length)
|
|
89
|
+
? (openBlock(), createElementBlock("ol", _hoisted_4, [
|
|
90
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList($props.node.children, (child, index) => {
|
|
91
|
+
return (openBlock(), createElementBlock("li", {
|
|
92
|
+
key: index,
|
|
93
|
+
class: "cn-condition-group__item"
|
|
94
|
+
}, [
|
|
95
|
+
($options.kindOf(child) === 'group')
|
|
96
|
+
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
97
|
+
createElementVNode("div", _hoisted_5, [
|
|
98
|
+
createElementVNode("span", _hoisted_6, toDisplayString($options.connector(index)), 1 /* TEXT */),
|
|
99
|
+
createElementVNode("span", _hoisted_7, toDisplayString($options.caption(child)), 1 /* TEXT */)
|
|
100
|
+
]),
|
|
101
|
+
createVNode(_component_CnConditionGroup, {
|
|
102
|
+
class: "cn-condition-group__child",
|
|
103
|
+
node: child,
|
|
104
|
+
depth: $props.depth + 1,
|
|
105
|
+
path: $options.childPath(index),
|
|
106
|
+
fields: $props.fields,
|
|
107
|
+
operatorsFor: $props.operatorsFor,
|
|
108
|
+
maxDepth: $props.maxDepth,
|
|
109
|
+
errors: $props.errors,
|
|
110
|
+
"onUpdate:node": $event => ($options.setChild(index, $event)),
|
|
111
|
+
onRemove: $event => ($options.removeChild(index))
|
|
112
|
+
}, null, 8 /* PROPS */, ["node", "depth", "path", "fields", "operatorsFor", "maxDepth", "errors", "onUpdate:node", "onRemove"])
|
|
113
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
114
|
+
: ($options.kindOf(child) === 'locked')
|
|
115
|
+
? (openBlock(), createElementBlock("div", _hoisted_8, [
|
|
116
|
+
createElementVNode("span", _hoisted_9, toDisplayString($options.connector(index)), 1 /* TEXT */),
|
|
117
|
+
createElementVNode("div", _hoisted_10, [
|
|
118
|
+
createVNode(_component_Lock, { size: 16 }),
|
|
119
|
+
createElementVNode("span", null, toDisplayString($options.t('nextcloud-vue', 'These conditions are kept as written')), 1 /* TEXT */),
|
|
120
|
+
createVNode(_component_NcButton, {
|
|
121
|
+
class: "cn-condition-group__pill",
|
|
122
|
+
variant: "tertiary",
|
|
123
|
+
"aria-label": $options.t('nextcloud-vue', 'Remove group'),
|
|
124
|
+
title: $options.t('nextcloud-vue', 'Remove group'),
|
|
125
|
+
onClick: $event => ($options.removeChild(index))
|
|
126
|
+
}, {
|
|
127
|
+
icon: withCtx(() => [
|
|
128
|
+
createVNode(_component_TrashCanOutline, { size: 18 })
|
|
129
|
+
]),
|
|
130
|
+
_: 1 /* STABLE */
|
|
131
|
+
}, 8 /* PROPS */, ["aria-label", "title", "onClick"])
|
|
132
|
+
])
|
|
133
|
+
]))
|
|
134
|
+
: (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
135
|
+
createElementVNode("span", _hoisted_12, toDisplayString($options.connector(index)), 1 /* TEXT */),
|
|
136
|
+
createVNode(_component_CnConditionRow, {
|
|
137
|
+
class: "cn-condition-group__row",
|
|
138
|
+
condition: child,
|
|
139
|
+
fieldOptions: $options.fieldOptionsFor(child),
|
|
140
|
+
operatorOptions: $options.operatorOptionsFor(child),
|
|
141
|
+
valueOptions: $options.valueOptionsFor(child),
|
|
142
|
+
inputType: $options.inputTypeFor(child),
|
|
143
|
+
showValue: $options.operatorTakesValue(child.operator),
|
|
144
|
+
controlLabels: $options.controlLabels,
|
|
145
|
+
error: $props.errors[$options.childPath(index)] || '',
|
|
146
|
+
hideLabels: "",
|
|
147
|
+
onField: $event => ($options.setField(index, $event)),
|
|
148
|
+
onOperator: $event => ($options.setOperator(index, $event)),
|
|
149
|
+
onValue: $event => ($options.setValue(index, child, $event)),
|
|
150
|
+
onRemove: $event => ($options.removeChild(index))
|
|
151
|
+
}, {
|
|
152
|
+
"remove-icon": withCtx(() => [
|
|
153
|
+
createVNode(_component_TrashCanOutline, { size: 18 })
|
|
154
|
+
]),
|
|
155
|
+
_: 1 /* STABLE */
|
|
156
|
+
}, 8 /* PROPS */, ["condition", "fieldOptions", "operatorOptions", "valueOptions", "inputType", "showValue", "controlLabels", "error", "onField", "onOperator", "onValue", "onRemove"])
|
|
157
|
+
]))
|
|
158
|
+
]))
|
|
159
|
+
}), 128 /* KEYED_FRAGMENT */))
|
|
160
|
+
]))
|
|
161
|
+
: (openBlock(), createElementBlock("p", _hoisted_13, toDisplayString($props.depth === 0 && $props.emptyText ? $props.emptyText : $options.t('nextcloud-vue', 'This group has no conditions yet.')), 1 /* TEXT */)),
|
|
162
|
+
($options.ownError)
|
|
163
|
+
? (openBlock(), createElementBlock("p", _hoisted_14, toDisplayString($options.ownError), 1 /* TEXT */))
|
|
164
|
+
: createCommentVNode("v-if", true),
|
|
165
|
+
createElementVNode("div", _hoisted_15, [
|
|
166
|
+
createVNode(_component_NcButton, {
|
|
167
|
+
variant: "tertiary",
|
|
168
|
+
disabled: $props.fields.length === 0,
|
|
169
|
+
onClick: $options.addCondition
|
|
170
|
+
}, {
|
|
171
|
+
icon: withCtx(() => [
|
|
172
|
+
createVNode(_component_Plus, { size: 16 })
|
|
173
|
+
]),
|
|
174
|
+
default: withCtx(() => [
|
|
175
|
+
createTextVNode(" " + toDisplayString($options.t('nextcloud-vue', 'Add condition')), 1 /* TEXT */)
|
|
176
|
+
]),
|
|
177
|
+
_: 1 /* STABLE */
|
|
178
|
+
}, 8 /* PROPS */, ["disabled", "onClick"]),
|
|
179
|
+
($props.depth < $props.maxDepth)
|
|
180
|
+
? (openBlock(), createBlock(_component_NcButton, {
|
|
181
|
+
key: 0,
|
|
182
|
+
variant: "tertiary",
|
|
183
|
+
disabled: $props.fields.length === 0,
|
|
184
|
+
onClick: $options.addGroup
|
|
185
|
+
}, {
|
|
186
|
+
icon: withCtx(() => [
|
|
187
|
+
createVNode(_component_FolderPlusOutline, { size: 16 })
|
|
188
|
+
]),
|
|
189
|
+
default: withCtx(() => [
|
|
190
|
+
createTextVNode(" " + toDisplayString($options.t('nextcloud-vue', 'Add group')), 1 /* TEXT */)
|
|
191
|
+
]),
|
|
192
|
+
_: 1 /* STABLE */
|
|
193
|
+
}, 8 /* PROPS */, ["disabled", "onClick"]))
|
|
194
|
+
: createCommentVNode("v-if", true)
|
|
195
|
+
])
|
|
196
|
+
], 2 /* CLASS */))
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export { render };
|
|
200
|
+
//# sourceMappingURL=CnConditionGroup.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnConditionGroup.vue3.js","sources":["../../../../src/components/CnConditionGroupEditor/CnConditionGroup.vue?vue&type=template&id=73aaa314&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div\n\t\tclass=\"cn-condition-group\"\n\t\t:class=\"{\n\t\t\t'cn-condition-group--nested': depth > 0,\n\t\t\t'cn-condition-group--error': !!ownError,\n\t\t}\">\n\t\t<div class=\"cn-condition-group__header\">\n\t\t\t<fieldset class=\"cn-condition-group__combinator\">\n\t\t\t\t<legend class=\"cn-condition-group__legend\">\n\t\t\t\t\t{{ t('nextcloud-vue', 'How the conditions combine') }}\n\t\t\t\t</legend>\n\t\t\t\t<NcCheckboxRadioSwitch\n\t\t\t\t\tv-for=\"choice in combinators\"\n\t\t\t\t\t:key=\"choice.value\"\n\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t:class=\"{ 'cn-condition-group__choice--checked': node.type === choice.value }\"\n\t\t\t\t\t:name=\"radioName\"\n\t\t\t\t\t:value=\"choice.value\"\n\t\t\t\t\t:modelValue=\"node.type\"\n\t\t\t\t\t@update:modelValue=\"setType\">\n\t\t\t\t\t{{ choice.label }}\n\t\t\t\t</NcCheckboxRadioSwitch>\n\t\t\t</fieldset>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"depth > 0\"\n\t\t\t\tclass=\"cn-condition-group__remove-group\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t@click=\"$emit('remove')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<TrashCanOutline :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('nextcloud-vue', 'Remove group') }}\n\t\t\t</NcButton>\n\t\t</div>\n\n\t\t<ol v-if=\"node.children.length\" class=\"cn-condition-group__rows\">\n\t\t\t<li v-for=\"(child, index) in node.children\" :key=\"index\" class=\"cn-condition-group__item\">\n\t\t\t\t<template v-if=\"kindOf(child) === 'group'\">\n\t\t\t\t\t<div class=\"cn-condition-group__line\">\n\t\t\t\t\t\t<span class=\"cn-condition-group__connector\">{{ connector(index) }}</span>\n\t\t\t\t\t\t<span class=\"cn-condition-group__caption\">{{ caption(child) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<CnConditionGroup\n\t\t\t\t\t\tclass=\"cn-condition-group__child\"\n\t\t\t\t\t\t:node=\"child\"\n\t\t\t\t\t\t:depth=\"depth + 1\"\n\t\t\t\t\t\t:path=\"childPath(index)\"\n\t\t\t\t\t\t:fields=\"fields\"\n\t\t\t\t\t\t:operatorsFor=\"operatorsFor\"\n\t\t\t\t\t\t:maxDepth=\"maxDepth\"\n\t\t\t\t\t\t:errors=\"errors\"\n\t\t\t\t\t\t@update:node=\"setChild(index, $event)\"\n\t\t\t\t\t\t@remove=\"removeChild(index)\" />\n\t\t\t\t</template>\n\t\t\t\t<div v-else-if=\"kindOf(child) === 'locked'\" class=\"cn-condition-group__line\">\n\t\t\t\t\t<span class=\"cn-condition-group__connector\">{{ connector(index) }}</span>\n\t\t\t\t\t<div class=\"cn-condition-group__locked\">\n\t\t\t\t\t\t<Lock :size=\"16\" />\n\t\t\t\t\t\t<span>{{ t('nextcloud-vue', 'These conditions are kept as written') }}</span>\n\t\t\t\t\t\t<NcButton\n\t\t\t\t\t\t\tclass=\"cn-condition-group__pill\"\n\t\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Remove group')\"\n\t\t\t\t\t\t\t:title=\"t('nextcloud-vue', 'Remove group')\"\n\t\t\t\t\t\t\t@click=\"removeChild(index)\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<TrashCanOutline :size=\"18\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div v-else class=\"cn-condition-group__line\">\n\t\t\t\t\t<span class=\"cn-condition-group__connector\">{{ connector(index) }}</span>\n\t\t\t\t\t<CnConditionRow\n\t\t\t\t\t\tclass=\"cn-condition-group__row\"\n\t\t\t\t\t\t:condition=\"child\"\n\t\t\t\t\t\t:fieldOptions=\"fieldOptionsFor(child)\"\n\t\t\t\t\t\t:operatorOptions=\"operatorOptionsFor(child)\"\n\t\t\t\t\t\t:valueOptions=\"valueOptionsFor(child)\"\n\t\t\t\t\t\t:inputType=\"inputTypeFor(child)\"\n\t\t\t\t\t\t:showValue=\"operatorTakesValue(child.operator)\"\n\t\t\t\t\t\t:controlLabels=\"controlLabels\"\n\t\t\t\t\t\t:error=\"errors[childPath(index)] || ''\"\n\t\t\t\t\t\thideLabels\n\t\t\t\t\t\t@field=\"setField(index, $event)\"\n\t\t\t\t\t\t@operator=\"setOperator(index, $event)\"\n\t\t\t\t\t\t@value=\"setValue(index, child, $event)\"\n\t\t\t\t\t\t@remove=\"removeChild(index)\">\n\t\t\t\t\t\t<template #remove-icon>\n\t\t\t\t\t\t\t<TrashCanOutline :size=\"18\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</CnConditionRow>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t</ol>\n\t\t<p v-else class=\"cn-condition-group__empty\">\n\t\t\t{{ depth === 0 && emptyText ? emptyText : t('nextcloud-vue', 'This group has no conditions yet.') }}\n\t\t</p>\n\n\t\t<p v-if=\"ownError\" class=\"cn-condition-group__error\" role=\"alert\">\n\t\t\t{{ ownError }}\n\t\t</p>\n\n\t\t<div class=\"cn-condition-group__actions\">\n\t\t\t<NcButton variant=\"tertiary\" :disabled=\"fields.length === 0\" @click=\"addCondition\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<Plus :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('nextcloud-vue', 'Add condition') }}\n\t\t\t</NcButton>\n\t\t\t<NcButton v-if=\"depth < maxDepth\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:disabled=\"fields.length === 0\"\n\t\t\t\t@click=\"addGroup\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<FolderPlusOutline :size=\"16\" />\n\t\t\t\t</template>\n\t\t\t\t{{ t('nextcloud-vue', 'Add group') }}\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, NcCheckboxRadioSwitch } from '@nextcloud/vue'\nimport FolderPlusOutline from 'vue-material-design-icons/FolderPlusOutline.vue'\nimport Lock from 'vue-material-design-icons/Lock.vue'\nimport Plus from 'vue-material-design-icons/Plus.vue'\nimport TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'\nimport CnConditionRow from '../CnConditionListEditor/CnConditionRow.vue'\nimport { operatorTakesValue } from '../CnConditionListEditor/conditionOperators.js'\n\nlet groupSeq = 0\n\n/**\n * CnConditionGroup - one group of CnConditionGroupEditor: the combinator\n * choice, its rows, and the groups inside it, drawn recursively. Internal to\n * the editor, which owns the tree.\n */\nexport default {\n\tname: 'CnConditionGroup',\n\n\tcomponents: { CnConditionRow, FolderPlusOutline, Lock, NcButton, NcCheckboxRadioSwitch, Plus, TrashCanOutline },\n\n\tprops: {\n\t\t/** The group: `{ type: 'AND' | 'OR', children }`. */\n\t\tnode: { type: Object, required: true },\n\t\t/** How deep this group sits; the root is 0. */\n\t\tdepth: { type: Number, default: 0 },\n\t\t/** This group's path in validator notation (`$.children[1]`). */\n\t\tpath: { type: String, default: '$' },\n\t\t/** The fields, normalised to `{ id, label, type, format?, options? }`. */\n\t\tfields: { type: Array, default: () => [] },\n\t\t/** The operators of a field, `(field) => [{ id, label }]`. */\n\t\toperatorsFor: { type: Function, required: true },\n\t\t/** The deepest group Add group may create. */\n\t\tmaxDepth: { type: Number, default: 1 },\n\t\t/** Messages keyed by node path. */\n\t\terrors: { type: Object, default: () => ({}) },\n\t\t/** What an empty root says, already translated. */\n\t\temptyText: { type: String, default: '' },\n\t},\n\n\temits: ['update:node', 'remove'],\n\n\tdata() {\n\t\tgroupSeq += 1\n\t\treturn { radioName: `cn-condition-group-${groupSeq}` }\n\t},\n\n\tcomputed: {\n\t\tcombinators() {\n\t\t\treturn [\n\t\t\t\t{ value: 'AND', label: t('nextcloud-vue', 'Match all conditions') },\n\t\t\t\t{ value: 'OR', label: t('nextcloud-vue', 'Match any condition') },\n\t\t\t]\n\t\t},\n\n\t\tcontrolLabels() {\n\t\t\treturn {\n\t\t\t\tfield: t('nextcloud-vue', 'Field'),\n\t\t\t\toperator: t('nextcloud-vue', 'Condition'),\n\t\t\t\tvalue: t('nextcloud-vue', 'Value'),\n\t\t\t}\n\t\t},\n\n\t\townError() {\n\t\t\treturn this.errors[this.path] || ''\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\t\toperatorTakesValue,\n\n\t\t/**\n\t\t * What a child is: a group drawn as a card, a group the editor keeps\n\t\t * as written (NOT), or a condition.\n\t\t *\n\t\t * @param {object} child The child node.\n\t\t * @return {string} group, locked or condition.\n\t\t */\n\t\tkindOf(child) {\n\t\t\tif (!Array.isArray(child?.children)) {\n\t\t\t\treturn 'condition'\n\t\t\t}\n\t\t\treturn ['AND', 'OR'].includes(String(child.type || 'AND').toUpperCase()) ? 'group' : 'locked'\n\t\t},\n\n\t\t/**\n\t\t * The word before a row: Where on the first, then and or or.\n\t\t *\n\t\t * @param {number} index The row index.\n\t\t * @return {string} The word.\n\t\t */\n\t\tconnector(index) {\n\t\t\tif (index === 0) {\n\t\t\t\treturn t('nextcloud-vue', 'Where')\n\t\t\t}\n\t\t\treturn this.node.type === 'OR' ? t('nextcloud-vue', 'or') : t('nextcloud-vue', 'and')\n\t\t},\n\n\t\tcaption(child) {\n\t\t\treturn String(child.type).toUpperCase() === 'OR'\n\t\t\t\t? t('nextcloud-vue', 'one of these')\n\t\t\t\t: t('nextcloud-vue', 'all of these')\n\t\t},\n\n\t\tchildPath(index) {\n\t\t\treturn `${this.path}.children[${index}]`\n\t\t},\n\n\t\tfieldOf(id) {\n\t\t\treturn this.fields.find((f) => f.id === id)\n\t\t},\n\n\t\t/**\n\t\t * The field choices, plus a stored field the list does not offer.\n\t\t *\n\t\t * @param {object} child The condition.\n\t\t * @return {Array<{id: string, label: string}>} The choices.\n\t\t */\n\t\tfieldOptionsFor(child) {\n\t\t\tconst options = this.fields.map((f) => ({ id: f.id, label: f.label || f.id }))\n\t\t\tif (child.field && !options.some((o) => o.id === child.field)) {\n\t\t\t\toptions.push({ id: child.field, label: child.field })\n\t\t\t}\n\t\t\treturn options\n\t\t},\n\n\t\t/**\n\t\t * The operator choices of the condition's field, plus a stored\n\t\t * operator the list does not offer.\n\t\t *\n\t\t * @param {object} child The condition.\n\t\t * @return {Array<{id: string, label: string}>} The choices.\n\t\t */\n\t\toperatorOptionsFor(child) {\n\t\t\tconst options = this.operatorsFor(this.fieldOf(child.field))\n\t\t\tif (child.operator && !options.some((o) => o.id === child.operator)) {\n\t\t\t\treturn [...options, { id: child.operator, label: child.operator }]\n\t\t\t}\n\t\t\treturn options\n\t\t},\n\n\t\tvalueOptionsFor(child) {\n\t\t\tconst field = this.fieldOf(child.field)\n\t\t\tif (field?.type === 'boolean') {\n\t\t\t\treturn [\n\t\t\t\t\t{ id: true, label: t('nextcloud-vue', 'Yes') },\n\t\t\t\t\t{ id: false, label: t('nextcloud-vue', 'No') },\n\t\t\t\t]\n\t\t\t}\n\t\t\tif (Array.isArray(field?.options) && field.options.length > 0) {\n\t\t\t\treturn field.options.map((o) => (typeof o === 'object'\n\t\t\t\t\t? { id: o.id ?? o.value, label: o.label ?? String(o.id ?? o.value) }\n\t\t\t\t\t: { id: o, label: String(o) }))\n\t\t\t}\n\t\t\treturn null\n\t\t},\n\n\t\tinputTypeFor(child) {\n\t\t\tconst field = this.fieldOf(child.field)\n\t\t\tif (field?.type === 'number' || field?.type === 'integer') {\n\t\t\t\treturn 'number'\n\t\t\t}\n\t\t\treturn field?.type === 'date' || field?.format === 'date' ? 'date' : 'text'\n\t\t},\n\n\t\temitNode(next) {\n\t\t\tthis.$emit('update:node', next)\n\t\t},\n\n\t\tsetChildren(children) {\n\t\t\tthis.emitNode({ ...this.node, children })\n\t\t},\n\n\t\tsetChild(index, next) {\n\t\t\tconst children = [...this.node.children]\n\t\t\tchildren[index] = next\n\t\t\tthis.setChildren(children)\n\t\t},\n\n\t\tremoveChild(index) {\n\t\t\tthis.setChildren(this.node.children.filter((_, i) => i !== index))\n\t\t},\n\n\t\tsetType(type) {\n\t\t\tthis.emitNode({ ...this.node, type: type === 'OR' ? 'OR' : 'AND' })\n\t\t},\n\n\t\taddCondition() {\n\t\t\tthis.setChildren([...this.node.children, { field: '', operator: '', value: '' }])\n\t\t},\n\n\t\taddGroup() {\n\t\t\tthis.setChildren([...this.node.children, { type: 'AND', children: [{ field: '', operator: '', value: '' }] }])\n\t\t},\n\n\t\t/**\n\t\t * Pick a field: the operator resets to the field's first one and the\n\t\t * value clears, since a value for another field rarely fits.\n\t\t *\n\t\t * @param {number} index The row index.\n\t\t * @param {object} option The field choice.\n\t\t */\n\t\tsetField(index, option) {\n\t\t\tconst field = this.fieldOf(option?.id)\n\t\t\tconst first = this.operatorsFor(field)[0]\n\t\t\tthis.setChild(index, {\n\t\t\t\tfield: option?.id || '',\n\t\t\t\toperator: first ? first.id : '',\n\t\t\t\tvalue: field?.type === 'boolean' ? true : '',\n\t\t\t})\n\t\t},\n\n\t\tsetOperator(index, option) {\n\t\t\tconst next = { ...this.node.children[index], operator: option?.id || '' }\n\t\t\tif (!operatorTakesValue(next.operator)) {\n\t\t\t\tdelete next.value\n\t\t\t} else if (next.value === undefined) {\n\t\t\t\tnext.value = ''\n\t\t\t}\n\t\t\tthis.setChild(index, next)\n\t\t},\n\n\t\t/**\n\t\t * Set a value, as a number for a number field.\n\t\t *\n\t\t * @param {number} index The row index.\n\t\t * @param {object} child The condition.\n\t\t * @param {unknown} raw The picked or typed value.\n\t\t */\n\t\tsetValue(index, child, raw) {\n\t\t\tlet value = raw\n\t\t\tif (this.inputTypeFor(child) === 'number' && raw !== '' && !Number.isNaN(Number(raw))) {\n\t\t\t\tvalue = Number(raw)\n\t\t\t}\n\t\t\tthis.setChild(index, { ...child, value })\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-condition-group {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmin-width: 0;\n\tpadding: 14px;\n\tborder: 1px solid var(--color-border);\n\tborder-radius: var(--border-radius-large);\n\t--cn-condition-row-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1.25fr) auto;\n\t--cn-condition-row-align: center;\n}\n\n.cn-condition-group--nested {\n\tmargin-inline-start: 52px;\n\tpadding: 12px 12px 8px;\n\tborder-color: var(--color-border);\n\tborder-inline-start: 3px solid var(--color-primary-element);\n\tborder-radius: var(--border-radius-element, 8px);\n\tbackground: var(--color-background-hover);\n}\n\n.cn-condition-group--error {\n\tborder-color: var(--color-border-error, var(--color-error));\n}\n\n.cn-condition-group__header {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tjustify-content: space-between;\n\tgap: 8px;\n}\n\n.cn-condition-group__combinator {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\talign-items: center;\n\tgap: 8px 18px;\n\tmargin: 0;\n\tpadding: 0;\n\tborder: 0;\n\tmin-width: 0;\n}\n\n.cn-condition-group__legend {\n\tfloat: inline-start;\n\tmargin-inline-end: 6px;\n\tpadding: 0;\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__choice--checked :deep(.checkbox-radio-switch__text) {\n\tfont-weight: 600;\n}\n\n.cn-condition-group__remove-group {\n\tcolor: var(--color-text-error, var(--color-error));\n}\n\n.cn-condition-group__rows {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.cn-condition-group__item {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n\tmin-width: 0;\n}\n\n.cn-condition-group__line {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\tmin-width: 0;\n}\n\n.cn-condition-group__connector {\n\tflex: 0 0 44px;\n\tfont-size: 13px;\n\tfont-weight: 600;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__caption {\n\tfont-size: 13px;\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__row {\n\tflex: 1 1 auto;\n}\n\n.cn-condition-group__locked {\n\tdisplay: flex;\n\tflex: 1 1 auto;\n\talign-items: center;\n\tgap: 8px;\n\tmin-height: var(--default-clickable-area);\n\tpadding: 0 0 0 10px;\n\tborder: 1px dashed var(--color-border-dark);\n\tborder-radius: var(--border-radius-element, 8px);\n\tcolor: var(--color-text-maxcontrast);\n}\n\n.cn-condition-group__locked > span {\n\tflex: 1 1 auto;\n}\n\n.cn-condition-group__pill,\n.cn-condition-group__row :deep(.cn-condition-row__remove) {\n\tborder-radius: var(--border-radius-pill, 17px);\n}\n\n.cn-condition-group__empty {\n\tmargin: 0;\n\tpadding: 12px;\n\tborder: 1px dashed var(--color-border-dark);\n\tborder-radius: var(--border-radius-large);\n\tcolor: var(--color-text-maxcontrast);\n\ttext-align: center;\n}\n\n.cn-condition-group__error {\n\tmargin: 0;\n\tcolor: var(--color-text-error, var(--color-error));\n\tfont-size: 0.9em;\n}\n\n.cn-condition-group__actions {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 6px;\n\tpadding-inline-start: 44px;\n}\n\n@media (max-width: 640px) {\n\t.cn-condition-group--nested {\n\t\tmargin-inline-start: 12px;\n\t}\n\n\t.cn-condition-group__line {\n\t\tflex-wrap: wrap;\n\t}\n\n\t.cn-condition-group__actions {\n\t\tpadding-inline-start: 0;\n\t}\n}\n</style>\n"],"names":["_createElementBlock","_createElementVNode","_toDisplayString","_Fragment","_renderList","_createBlock","_createTextVNode","_openBlock","_createVNode"],"mappings":";;AAiBO,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,4BAAY,GAAA;AACZ,MAAA,UAAA,GAAA,EAAA,KAAI,EAAE,gCAAc,GAAA;AACrB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,4BAAK,GAAA;;;AA2BW,EAAA,KAAK,EAAC,0BAA0B;;AAGxD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,0BAAsB,GAAA;AAC1B,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAAA,GAAA;AACN,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,6BAAK,GAAA;;;AAcT,EAAA,KAAA,EAAA,0BAAA;;AACH,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,+BAAqB,GAAA;AAC5B,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,4BAAQ,GAAA;;;AAeR,EAAA,KAAK,EAAC,0BAAqB;;AAChC,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC,+BAA+B,GAAA;;;AAuBpC,EAAA,KAAI,EAAA,2BAAA;;;;AAIK,EAAA,KAAK,EAAC,2BAA2B;AAAC,EAAA,IAAI,EAAE,OAAM;;AAI5D,MAAA,WAAA,GAAA,EAAA,KAAK,EAAC;;;;;;;;;;;;uBAvGXA;AACA,IAAA,KAAK,kBAAC,oBA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EAAA;AALD,QAAA,OAAA,EAAA,UAAA;QAAA,QAAA,EAAA,MAAA,CAAA,MAAA,CAAA,MAAA,KAAA,CAAA;AAAA,QAAA,OAAA,EAAA,QAAA,CAAA,YAAA;;AACE,QAAA,IAAI,UACd,MAAgB;UAAhBA,WAAgB,CAAA,eAAA,EAAA,EAAT,IAAI,EAAE,EAAE,EAAA,CAAA;;yBACL,MACX;AADW,UAAAF,eAAA,CAAA,GACX,mBAAG,QAAC,CAAA,CAAA,CAAA,eAAA,EAAA,eAAA,CAAA,CAAA,EAAA,CAAA,YAAA;;;;AAEW,MAAA,CAAA,MAAA,CAAA,KAAK,GAAG,MAAQ,CAAA,QAAA;;;AAC/B,YAAA,OAAO,EAAC,UAAE;YACT,QAAQ,EAAE,MAAM,CAAA,MAAA,CAAC,MAAM,KAAA,CAAA;AACvB,YAAA,OAAK,EAAE,QAAC,CAAA,QAAA;;AACN,YAAA,IAAA,UACF,MAAC;cAADE,WAAC,CAAA,4BAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import script from './CnConditionGroupEditor.vue2.js';
|
|
2
|
+
import { render } from './CnConditionGroupEditor.vue3.js';
|
|
3
|
+
|
|
4
|
+
script.render = render;
|
|
5
|
+
script.__scopeId = "data-v-36d77d2d";
|
|
6
|
+
const __sfc_main = script;
|
|
7
|
+
|
|
8
|
+
export { __sfc_main as default };
|
|
9
|
+
//# sourceMappingURL=CnConditionGroupEditor.vue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnConditionGroupEditor.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|