@conduction/nextcloud-vue 2.169.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/CnCellRenderer/CnCellRenderer.vue.js +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js +7 -2
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue2.js.map +1 -1
- package/dist/esm/components/CnCellRenderer/CnCellRenderer.vue3.js.map +1 -1
- 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/CnDashboardGrid/CnDashboardGrid.vue.js +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js +88 -0
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js +4 -3
- package/dist/esm/components/CnDashboardGrid/CnDashboardGrid.vue3.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue.js +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js +46 -3
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue2.js.map +1 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js +2 -1
- package/dist/esm/components/CnDashboardPage/CnDashboardPage.vue3.js.map +1 -1
- 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 +9 -3
- 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/CnObjectPartiesWidget/CnObjectPartiesWidget.vue.js +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js +13 -6
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.vue2.js.map +1 -1
- package/dist/esm/components/CnObjectPartiesWidget/CnObjectPartiesWidget.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/integrations/builtin/contacts/CnContactsTab.vue.js +1 -1
- package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue2.js +14 -3
- package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue2.js.map +1 -1
- package/dist/esm/integrations/builtin/contacts/CnContactsTab.vue3.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 +874 -496
- package/dist/esm/utils/noteThreads.js +14 -2
- package/dist/esm/utils/noteThreads.js.map +1 -1
- package/dist/esm/utils/objectParties.js +50 -5
- package/dist/esm/utils/objectParties.js.map +1 -1
- package/dist/nextcloud-vue.cjs.js +11549 -10100
- package/dist/nextcloud-vue.cjs.js.map +2 -2
- package/dist/nextcloud-vue.css +874 -496
- 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/CnCellRenderer/CnCellRenderer.vue +7 -2
- 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/CnDashboardGrid/CnDashboardGrid.md +1 -0
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +100 -2
- package/src/components/CnDashboardPage/CnDashboardPage.vue +47 -3
- package/src/components/CnDetailPage/CnDetailPage.vue +8 -8
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHeaderItems.vue +6 -0
- package/src/components/CnDetailWidgetHost/CnDetailWidgetHost.vue +9 -9
- 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/CnObjectPartiesWidget/CnObjectPartiesWidget.vue +14 -5
- 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/dialog.css +7 -5
- package/src/css/look-board-detail.css +120 -1
- package/src/css/look-board-index.css +21 -2
- package/src/css/look-board.css +55 -2
- package/src/dialogs/CnConfirmDialog.vue +3 -1
- package/src/index.js +3 -0
- package/src/integrations/builtin/contacts/CnContactsTab.vue +14 -3
- package/src/integrations/builtin/contacts/__tests__/CnContactsTabBoardRows.spec.js +17 -2
- package/src/utils/noteThreads.js +13 -1
- package/src/utils/objectParties.js +49 -4
- package/dist/esm/components/CnMassDeleteDialog/CnMassDeleteDialog.vue3.js.map +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { translate } from '@nextcloud/l10n';
|
|
2
|
+
import { NcButton, NcSelect, NcTextField } from '@nextcloud/vue';
|
|
3
|
+
import Close from 'vue-material-design-icons/Close.vue';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CnConditionRow - one condition as a row of field, operator and value, with
|
|
7
|
+
* a remove button. Shared by CnConditionListEditor and CnConditionGroupEditor;
|
|
8
|
+
* the editor owns the condition and decides the options, the row only draws
|
|
9
|
+
* them and reports what the user picked.
|
|
10
|
+
*/
|
|
11
|
+
var script = {
|
|
12
|
+
name: 'CnConditionRow',
|
|
13
|
+
|
|
14
|
+
components: { NcButton, NcSelect, NcTextField, Close },
|
|
15
|
+
|
|
16
|
+
props: {
|
|
17
|
+
/**
|
|
18
|
+
* The condition drawn.
|
|
19
|
+
*
|
|
20
|
+
* @type {{field: string, operator: string, value?: unknown}}
|
|
21
|
+
*/
|
|
22
|
+
condition: { type: Object, required: true },
|
|
23
|
+
/**
|
|
24
|
+
* The field choices, `[{ id, label }]`.
|
|
25
|
+
*
|
|
26
|
+
* @type {Array<{id: string, label: string}>}
|
|
27
|
+
*/
|
|
28
|
+
fieldOptions: { type: Array, default: () => [] },
|
|
29
|
+
/**
|
|
30
|
+
* The operator choices for the condition's field, `[{ id, label }]`.
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<{id: string, label: string}>}
|
|
33
|
+
*/
|
|
34
|
+
operatorOptions: { type: Array, default: () => [] },
|
|
35
|
+
/**
|
|
36
|
+
* The value choices, or null when the value is typed.
|
|
37
|
+
*
|
|
38
|
+
* @type {Array<{id: unknown, label: string}>|null}
|
|
39
|
+
*/
|
|
40
|
+
valueOptions: { type: Array, default: null },
|
|
41
|
+
/**
|
|
42
|
+
* The input type of a typed value: text, number or date.
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
*/
|
|
46
|
+
inputType: { type: String, default: 'text' },
|
|
47
|
+
/**
|
|
48
|
+
* Whether the operator takes a value.
|
|
49
|
+
*
|
|
50
|
+
* @type {boolean}
|
|
51
|
+
*/
|
|
52
|
+
showValue: { type: Boolean, default: true },
|
|
53
|
+
/**
|
|
54
|
+
* Keep the field, operator and value labels for screen readers only.
|
|
55
|
+
*
|
|
56
|
+
* @type {boolean}
|
|
57
|
+
*/
|
|
58
|
+
hideLabels: { type: Boolean, default: false },
|
|
59
|
+
/**
|
|
60
|
+
* The labels of the three controls, already translated. Missing keys
|
|
61
|
+
* read Field, Operator and Value.
|
|
62
|
+
*
|
|
63
|
+
* @type {{field?: string, operator?: string, value?: string}}
|
|
64
|
+
*/
|
|
65
|
+
controlLabels: { type: Object, default: () => ({}) },
|
|
66
|
+
/**
|
|
67
|
+
* A message shown under the row, already translated.
|
|
68
|
+
*
|
|
69
|
+
* @type {string}
|
|
70
|
+
*/
|
|
71
|
+
error: { type: String, default: '' },
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
emits: ['field', 'operator', 'value', 'remove'],
|
|
75
|
+
|
|
76
|
+
computed: {
|
|
77
|
+
labels() {
|
|
78
|
+
return {
|
|
79
|
+
field: this.controlLabels.field || translate('nextcloud-vue', 'Field'),
|
|
80
|
+
operator: this.controlLabels.operator || translate('nextcloud-vue', 'Operator'),
|
|
81
|
+
value: this.controlLabels.value || translate('nextcloud-vue', 'Value'),
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
fieldOption() {
|
|
86
|
+
return this.fieldOptions.find((o) => o.id === this.condition.field) || null
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
operatorOption() {
|
|
90
|
+
return this.operatorOptions.find((o) => o.id === this.condition.operator) || null
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
valueOption() {
|
|
94
|
+
return (this.valueOptions || []).find((o) => String(o.id) === String(this.condition.value)) || null
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
textValue() {
|
|
98
|
+
const value = this.condition.value;
|
|
99
|
+
return value === undefined || value === null ? '' : String(value)
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
methods: {
|
|
104
|
+
t: translate,
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The label binding of a select: shown above it, or for screen
|
|
108
|
+
* readers only.
|
|
109
|
+
*
|
|
110
|
+
* @param {string} text The label.
|
|
111
|
+
* @return {object} The props.
|
|
112
|
+
*/
|
|
113
|
+
selectLabel(text) {
|
|
114
|
+
return this.hideLabels ? { ariaLabelCombobox: text } : { inputLabel: text }
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export { script as default };
|
|
120
|
+
//# sourceMappingURL=CnConditionRow.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnConditionRow.vue2.js","sources":["../../../../src/components/CnConditionListEditor/CnConditionRow.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-condition-row\" :class=\"{ 'cn-condition-row--error': !!error }\">\n\t\t<div class=\"cn-condition-row__controls\">\n\t\t\t<NcSelect\n\t\t\t\tclass=\"cn-condition-row__field\"\n\t\t\t\t:modelValue=\"fieldOption\"\n\t\t\t\t:options=\"fieldOptions\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\tv-bind=\"selectLabel(labels.field)\"\n\t\t\t\t:clearable=\"false\"\n\t\t\t\t@update:modelValue=\"$emit('field', $event)\" />\n\t\t\t<NcSelect\n\t\t\t\tclass=\"cn-condition-row__operator\"\n\t\t\t\t:modelValue=\"operatorOption\"\n\t\t\t\t:options=\"operatorOptions\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\tv-bind=\"selectLabel(labels.operator)\"\n\t\t\t\t:clearable=\"false\"\n\t\t\t\t:disabled=\"!condition.field\"\n\t\t\t\t@update:modelValue=\"$emit('operator', $event)\" />\n\t\t\t<template v-if=\"showValue\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-if=\"valueOptions\"\n\t\t\t\t\tclass=\"cn-condition-row__value\"\n\t\t\t\t\t:modelValue=\"valueOption\"\n\t\t\t\t\t:options=\"valueOptions\"\n\t\t\t\t\tlabel=\"label\"\n\t\t\t\t\tv-bind=\"selectLabel(labels.value)\"\n\t\t\t\t\t:clearable=\"false\"\n\t\t\t\t\t:disabled=\"!condition.field\"\n\t\t\t\t\t@update:modelValue=\"$emit('value', $event ? $event.id : '')\" />\n\t\t\t\t<NcTextField\n\t\t\t\t\tv-else\n\t\t\t\t\tclass=\"cn-condition-row__value\"\n\t\t\t\t\t:type=\"inputType\"\n\t\t\t\t\t:modelValue=\"textValue\"\n\t\t\t\t\t:label=\"labels.value\"\n\t\t\t\t\t:disabled=\"!condition.field\"\n\t\t\t\t\t@update:modelValue=\"$emit('value', $event)\" />\n\t\t\t</template>\n\t\t\t<NcButton\n\t\t\t\tclass=\"cn-condition-row__remove\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Remove condition')\"\n\t\t\t\t:title=\"t('nextcloud-vue', 'Remove condition')\"\n\t\t\t\t@click=\"$emit('remove')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<!-- @slot The remove button's icon; a close cross by default. -->\n\t\t\t\t\t<slot name=\"remove-icon\">\n\t\t\t\t\t\t<Close :size=\"18\" />\n\t\t\t\t\t</slot>\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t</div>\n\t\t<p v-if=\"error\" class=\"cn-condition-row__error\" role=\"alert\">\n\t\t\t{{ error }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'\nimport Close from 'vue-material-design-icons/Close.vue'\n\n/**\n * CnConditionRow - one condition as a row of field, operator and value, with\n * a remove button. Shared by CnConditionListEditor and CnConditionGroupEditor;\n * the editor owns the condition and decides the options, the row only draws\n * them and reports what the user picked.\n */\nexport default {\n\tname: 'CnConditionRow',\n\n\tcomponents: { NcButton, NcSelect, NcTextField, Close },\n\n\tprops: {\n\t\t/**\n\t\t * The condition drawn.\n\t\t *\n\t\t * @type {{field: string, operator: string, value?: unknown}}\n\t\t */\n\t\tcondition: { type: Object, required: true },\n\t\t/**\n\t\t * The field choices, `[{ id, label }]`.\n\t\t *\n\t\t * @type {Array<{id: string, label: string}>}\n\t\t */\n\t\tfieldOptions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * The operator choices for the condition's field, `[{ id, label }]`.\n\t\t *\n\t\t * @type {Array<{id: string, label: string}>}\n\t\t */\n\t\toperatorOptions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * The value choices, or null when the value is typed.\n\t\t *\n\t\t * @type {Array<{id: unknown, label: string}>|null}\n\t\t */\n\t\tvalueOptions: { type: Array, default: null },\n\t\t/**\n\t\t * The input type of a typed value: text, number or date.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tinputType: { type: String, default: 'text' },\n\t\t/**\n\t\t * Whether the operator takes a value.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tshowValue: { type: Boolean, default: true },\n\t\t/**\n\t\t * Keep the field, operator and value labels for screen readers only.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\thideLabels: { type: Boolean, default: false },\n\t\t/**\n\t\t * The labels of the three controls, already translated. Missing keys\n\t\t * read Field, Operator and Value.\n\t\t *\n\t\t * @type {{field?: string, operator?: string, value?: string}}\n\t\t */\n\t\tcontrolLabels: { type: Object, default: () => ({}) },\n\t\t/**\n\t\t * A message shown under the row, already translated.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\terror: { type: String, default: '' },\n\t},\n\n\temits: ['field', 'operator', 'value', 'remove'],\n\n\tcomputed: {\n\t\tlabels() {\n\t\t\treturn {\n\t\t\t\tfield: this.controlLabels.field || t('nextcloud-vue', 'Field'),\n\t\t\t\toperator: this.controlLabels.operator || t('nextcloud-vue', 'Operator'),\n\t\t\t\tvalue: this.controlLabels.value || t('nextcloud-vue', 'Value'),\n\t\t\t}\n\t\t},\n\n\t\tfieldOption() {\n\t\t\treturn this.fieldOptions.find((o) => o.id === this.condition.field) || null\n\t\t},\n\n\t\toperatorOption() {\n\t\t\treturn this.operatorOptions.find((o) => o.id === this.condition.operator) || null\n\t\t},\n\n\t\tvalueOption() {\n\t\t\treturn (this.valueOptions || []).find((o) => String(o.id) === String(this.condition.value)) || null\n\t\t},\n\n\t\ttextValue() {\n\t\t\tconst value = this.condition.value\n\t\t\treturn value === undefined || value === null ? '' : String(value)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * The label binding of a select: shown above it, or for screen\n\t\t * readers only.\n\t\t *\n\t\t * @param {string} text The label.\n\t\t * @return {object} The props.\n\t\t */\n\t\tselectLabel(text) {\n\t\t\treturn this.hideLabels ? { ariaLabelCombobox: text } : { inputLabel: text }\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-condition-row {\n\tmin-width: 0;\n}\n\n.cn-condition-row__controls {\n\tdisplay: grid;\n\tgrid-template-columns: var(--cn-condition-row-columns, minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) auto);\n\tgap: 8px;\n\talign-items: var(--cn-condition-row-align, end);\n}\n\n.cn-condition-row__controls > :nth-child(3):last-child {\n\tgrid-column: 4;\n}\n\n.cn-condition-row__field,\n.cn-condition-row__operator,\n.cn-condition-row__value {\n\twidth: 100%;\n\tmin-width: 0;\n\tmargin: 0;\n}\n\n.cn-condition-row--error .cn-condition-row__controls :deep(input),\n.cn-condition-row--error .cn-condition-row__controls :deep(.vs__dropdown-toggle) {\n\tborder-color: var(--color-border-error, var(--color-error));\n}\n\n.cn-condition-row__error {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-error, var(--color-error));\n\tfont-size: 0.9em;\n}\n\n@media (max-width: 640px) {\n\t.cn-condition-row__controls {\n\t\tgrid-template-columns: minmax(0, 1fr) auto;\n\t}\n}\n</style>\n"],"names":["t"],"mappings":"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"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, createVNode, mergeProps, Fragment, createBlock, createCommentVNode, withCtx, renderSlot, toDisplayString } from 'vue';
|
|
2
|
+
|
|
3
|
+
const _hoisted_1 = { class: "cn-condition-row__controls" };
|
|
4
|
+
const _hoisted_2 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "cn-condition-row__error",
|
|
7
|
+
role: "alert"
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
11
|
+
const _component_NcSelect = resolveComponent("NcSelect");
|
|
12
|
+
const _component_NcTextField = resolveComponent("NcTextField");
|
|
13
|
+
const _component_Close = resolveComponent("Close");
|
|
14
|
+
const _component_NcButton = resolveComponent("NcButton");
|
|
15
|
+
|
|
16
|
+
return (openBlock(), createElementBlock("div", {
|
|
17
|
+
class: normalizeClass(["cn-condition-row", { 'cn-condition-row--error': !!$props.error }])
|
|
18
|
+
}, [
|
|
19
|
+
createElementVNode("div", _hoisted_1, [
|
|
20
|
+
createVNode(_component_NcSelect, mergeProps({
|
|
21
|
+
class: "cn-condition-row__field",
|
|
22
|
+
modelValue: $options.fieldOption,
|
|
23
|
+
options: $props.fieldOptions,
|
|
24
|
+
label: "label"
|
|
25
|
+
}, $options.selectLabel($options.labels.field), {
|
|
26
|
+
clearable: false,
|
|
27
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => (_ctx.$emit('field', $event)))
|
|
28
|
+
}), null, 16 /* FULL_PROPS */, ["modelValue", "options"]),
|
|
29
|
+
createVNode(_component_NcSelect, mergeProps({
|
|
30
|
+
class: "cn-condition-row__operator",
|
|
31
|
+
modelValue: $options.operatorOption,
|
|
32
|
+
options: $props.operatorOptions,
|
|
33
|
+
label: "label"
|
|
34
|
+
}, $options.selectLabel($options.labels.operator), {
|
|
35
|
+
clearable: false,
|
|
36
|
+
disabled: !$props.condition.field,
|
|
37
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = $event => (_ctx.$emit('operator', $event)))
|
|
38
|
+
}), null, 16 /* FULL_PROPS */, ["modelValue", "options", "disabled"]),
|
|
39
|
+
($props.showValue)
|
|
40
|
+
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
41
|
+
($props.valueOptions)
|
|
42
|
+
? (openBlock(), createBlock(_component_NcSelect, mergeProps({
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "cn-condition-row__value",
|
|
45
|
+
modelValue: $options.valueOption,
|
|
46
|
+
options: $props.valueOptions,
|
|
47
|
+
label: "label"
|
|
48
|
+
}, $options.selectLabel($options.labels.value), {
|
|
49
|
+
clearable: false,
|
|
50
|
+
disabled: !$props.condition.field,
|
|
51
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = $event => (_ctx.$emit('value', $event ? $event.id : '')))
|
|
52
|
+
}), null, 16 /* FULL_PROPS */, ["modelValue", "options", "disabled"]))
|
|
53
|
+
: (openBlock(), createBlock(_component_NcTextField, {
|
|
54
|
+
key: 1,
|
|
55
|
+
class: "cn-condition-row__value",
|
|
56
|
+
type: $props.inputType,
|
|
57
|
+
modelValue: $options.textValue,
|
|
58
|
+
label: $options.labels.value,
|
|
59
|
+
disabled: !$props.condition.field,
|
|
60
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = $event => (_ctx.$emit('value', $event)))
|
|
61
|
+
}, null, 8 /* PROPS */, ["type", "modelValue", "label", "disabled"]))
|
|
62
|
+
], 64 /* STABLE_FRAGMENT */))
|
|
63
|
+
: createCommentVNode("v-if", true),
|
|
64
|
+
createVNode(_component_NcButton, {
|
|
65
|
+
class: "cn-condition-row__remove",
|
|
66
|
+
variant: "tertiary",
|
|
67
|
+
"aria-label": $options.t('nextcloud-vue', 'Remove condition'),
|
|
68
|
+
title: $options.t('nextcloud-vue', 'Remove condition'),
|
|
69
|
+
onClick: _cache[4] || (_cache[4] = $event => (_ctx.$emit('remove')))
|
|
70
|
+
}, {
|
|
71
|
+
icon: withCtx(() => [
|
|
72
|
+
renderSlot(_ctx.$slots, "remove-icon", {}, () => [
|
|
73
|
+
createVNode(_component_Close, { size: 18 })
|
|
74
|
+
])
|
|
75
|
+
]),
|
|
76
|
+
_: 3 /* FORWARDED */
|
|
77
|
+
}, 8 /* PROPS */, ["aria-label", "title"])
|
|
78
|
+
]),
|
|
79
|
+
($props.error)
|
|
80
|
+
? (openBlock(), createElementBlock("p", _hoisted_2, toDisplayString($props.error), 1 /* TEXT */))
|
|
81
|
+
: createCommentVNode("v-if", true)
|
|
82
|
+
], 2 /* CLASS */))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { render };
|
|
86
|
+
//# sourceMappingURL=CnConditionRow.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnConditionRow.vue3.js","sources":["../../../../src/components/CnConditionListEditor/CnConditionRow.vue?vue&type=template&id=e1c8a9e2&lang.js"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2026 Conduction B.V.\n - SPDX-License-Identifier: EUPL-1.2\n-->\n\n<template>\n\t<div class=\"cn-condition-row\" :class=\"{ 'cn-condition-row--error': !!error }\">\n\t\t<div class=\"cn-condition-row__controls\">\n\t\t\t<NcSelect\n\t\t\t\tclass=\"cn-condition-row__field\"\n\t\t\t\t:modelValue=\"fieldOption\"\n\t\t\t\t:options=\"fieldOptions\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\tv-bind=\"selectLabel(labels.field)\"\n\t\t\t\t:clearable=\"false\"\n\t\t\t\t@update:modelValue=\"$emit('field', $event)\" />\n\t\t\t<NcSelect\n\t\t\t\tclass=\"cn-condition-row__operator\"\n\t\t\t\t:modelValue=\"operatorOption\"\n\t\t\t\t:options=\"operatorOptions\"\n\t\t\t\tlabel=\"label\"\n\t\t\t\tv-bind=\"selectLabel(labels.operator)\"\n\t\t\t\t:clearable=\"false\"\n\t\t\t\t:disabled=\"!condition.field\"\n\t\t\t\t@update:modelValue=\"$emit('operator', $event)\" />\n\t\t\t<template v-if=\"showValue\">\n\t\t\t\t<NcSelect\n\t\t\t\t\tv-if=\"valueOptions\"\n\t\t\t\t\tclass=\"cn-condition-row__value\"\n\t\t\t\t\t:modelValue=\"valueOption\"\n\t\t\t\t\t:options=\"valueOptions\"\n\t\t\t\t\tlabel=\"label\"\n\t\t\t\t\tv-bind=\"selectLabel(labels.value)\"\n\t\t\t\t\t:clearable=\"false\"\n\t\t\t\t\t:disabled=\"!condition.field\"\n\t\t\t\t\t@update:modelValue=\"$emit('value', $event ? $event.id : '')\" />\n\t\t\t\t<NcTextField\n\t\t\t\t\tv-else\n\t\t\t\t\tclass=\"cn-condition-row__value\"\n\t\t\t\t\t:type=\"inputType\"\n\t\t\t\t\t:modelValue=\"textValue\"\n\t\t\t\t\t:label=\"labels.value\"\n\t\t\t\t\t:disabled=\"!condition.field\"\n\t\t\t\t\t@update:modelValue=\"$emit('value', $event)\" />\n\t\t\t</template>\n\t\t\t<NcButton\n\t\t\t\tclass=\"cn-condition-row__remove\"\n\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t:aria-label=\"t('nextcloud-vue', 'Remove condition')\"\n\t\t\t\t:title=\"t('nextcloud-vue', 'Remove condition')\"\n\t\t\t\t@click=\"$emit('remove')\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<!-- @slot The remove button's icon; a close cross by default. -->\n\t\t\t\t\t<slot name=\"remove-icon\">\n\t\t\t\t\t\t<Close :size=\"18\" />\n\t\t\t\t\t</slot>\n\t\t\t\t</template>\n\t\t\t</NcButton>\n\t\t</div>\n\t\t<p v-if=\"error\" class=\"cn-condition-row__error\" role=\"alert\">\n\t\t\t{{ error }}\n\t\t</p>\n\t</div>\n</template>\n\n<script>\nimport { translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcSelect, NcTextField } from '@nextcloud/vue'\nimport Close from 'vue-material-design-icons/Close.vue'\n\n/**\n * CnConditionRow - one condition as a row of field, operator and value, with\n * a remove button. Shared by CnConditionListEditor and CnConditionGroupEditor;\n * the editor owns the condition and decides the options, the row only draws\n * them and reports what the user picked.\n */\nexport default {\n\tname: 'CnConditionRow',\n\n\tcomponents: { NcButton, NcSelect, NcTextField, Close },\n\n\tprops: {\n\t\t/**\n\t\t * The condition drawn.\n\t\t *\n\t\t * @type {{field: string, operator: string, value?: unknown}}\n\t\t */\n\t\tcondition: { type: Object, required: true },\n\t\t/**\n\t\t * The field choices, `[{ id, label }]`.\n\t\t *\n\t\t * @type {Array<{id: string, label: string}>}\n\t\t */\n\t\tfieldOptions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * The operator choices for the condition's field, `[{ id, label }]`.\n\t\t *\n\t\t * @type {Array<{id: string, label: string}>}\n\t\t */\n\t\toperatorOptions: { type: Array, default: () => [] },\n\t\t/**\n\t\t * The value choices, or null when the value is typed.\n\t\t *\n\t\t * @type {Array<{id: unknown, label: string}>|null}\n\t\t */\n\t\tvalueOptions: { type: Array, default: null },\n\t\t/**\n\t\t * The input type of a typed value: text, number or date.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\tinputType: { type: String, default: 'text' },\n\t\t/**\n\t\t * Whether the operator takes a value.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\tshowValue: { type: Boolean, default: true },\n\t\t/**\n\t\t * Keep the field, operator and value labels for screen readers only.\n\t\t *\n\t\t * @type {boolean}\n\t\t */\n\t\thideLabels: { type: Boolean, default: false },\n\t\t/**\n\t\t * The labels of the three controls, already translated. Missing keys\n\t\t * read Field, Operator and Value.\n\t\t *\n\t\t * @type {{field?: string, operator?: string, value?: string}}\n\t\t */\n\t\tcontrolLabels: { type: Object, default: () => ({}) },\n\t\t/**\n\t\t * A message shown under the row, already translated.\n\t\t *\n\t\t * @type {string}\n\t\t */\n\t\terror: { type: String, default: '' },\n\t},\n\n\temits: ['field', 'operator', 'value', 'remove'],\n\n\tcomputed: {\n\t\tlabels() {\n\t\t\treturn {\n\t\t\t\tfield: this.controlLabels.field || t('nextcloud-vue', 'Field'),\n\t\t\t\toperator: this.controlLabels.operator || t('nextcloud-vue', 'Operator'),\n\t\t\t\tvalue: this.controlLabels.value || t('nextcloud-vue', 'Value'),\n\t\t\t}\n\t\t},\n\n\t\tfieldOption() {\n\t\t\treturn this.fieldOptions.find((o) => o.id === this.condition.field) || null\n\t\t},\n\n\t\toperatorOption() {\n\t\t\treturn this.operatorOptions.find((o) => o.id === this.condition.operator) || null\n\t\t},\n\n\t\tvalueOption() {\n\t\t\treturn (this.valueOptions || []).find((o) => String(o.id) === String(this.condition.value)) || null\n\t\t},\n\n\t\ttextValue() {\n\t\t\tconst value = this.condition.value\n\t\t\treturn value === undefined || value === null ? '' : String(value)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * The label binding of a select: shown above it, or for screen\n\t\t * readers only.\n\t\t *\n\t\t * @param {string} text The label.\n\t\t * @return {object} The props.\n\t\t */\n\t\tselectLabel(text) {\n\t\t\treturn this.hideLabels ? { ariaLabelCombobox: text } : { inputLabel: text }\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n.cn-condition-row {\n\tmin-width: 0;\n}\n\n.cn-condition-row__controls {\n\tdisplay: grid;\n\tgrid-template-columns: var(--cn-condition-row-columns, minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.6fr) auto);\n\tgap: 8px;\n\talign-items: var(--cn-condition-row-align, end);\n}\n\n.cn-condition-row__controls > :nth-child(3):last-child {\n\tgrid-column: 4;\n}\n\n.cn-condition-row__field,\n.cn-condition-row__operator,\n.cn-condition-row__value {\n\twidth: 100%;\n\tmin-width: 0;\n\tmargin: 0;\n}\n\n.cn-condition-row--error .cn-condition-row__controls :deep(input),\n.cn-condition-row--error .cn-condition-row__controls :deep(.vs__dropdown-toggle) {\n\tborder-color: var(--color-border-error, var(--color-error));\n}\n\n.cn-condition-row__error {\n\tmargin: 4px 0 0;\n\tcolor: var(--color-text-error, var(--color-error));\n\tfont-size: 0.9em;\n}\n\n@media (max-width: 640px) {\n\t.cn-condition-row__controls {\n\t\tgrid-template-columns: minmax(0, 1fr) auto;\n\t}\n}\n</style>\n"],"names":["_normalizeClass","_createVNode","_mergeProps","_Fragment","_createBlock","_renderSlot"],"mappings":"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"}
|
|
@@ -3,7 +3,7 @@ export { fillRowTracks } from './CnDashboardGrid.vue2.js';
|
|
|
3
3
|
import { render } from './CnDashboardGrid.vue3.js';
|
|
4
4
|
|
|
5
5
|
script.render = render;
|
|
6
|
-
script.__scopeId = "data-v-
|
|
6
|
+
script.__scopeId = "data-v-4ef4b904";
|
|
7
7
|
const __sfc_main = script;
|
|
8
8
|
|
|
9
9
|
export { __sfc_main as default };
|
|
@@ -275,6 +275,22 @@ var script = {
|
|
|
275
275
|
default: null,
|
|
276
276
|
},
|
|
277
277
|
|
|
278
|
+
/**
|
|
279
|
+
* Weights for groups of the twelve columns: `[{ span, weight }]`, the
|
|
280
|
+
* spans adding up to 12. Each group takes its weight's share of the
|
|
281
|
+
* width, split evenly over its columns, so three groups of four can be
|
|
282
|
+
* drawn 332 / 415 / 332 (PqWerkplekKlant in a call). Items on a
|
|
283
|
+
* `sideColumn` track keep that column. Only on the full twelve-column
|
|
284
|
+
* grid and not while editing; GridStack keeps the twelve columns
|
|
285
|
+
* underneath.
|
|
286
|
+
*
|
|
287
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
288
|
+
*/
|
|
289
|
+
columnWeights: {
|
|
290
|
+
type: Array,
|
|
291
|
+
default: null,
|
|
292
|
+
},
|
|
293
|
+
|
|
278
294
|
/**
|
|
279
295
|
* Fill the height the host gives the grid instead of growing with
|
|
280
296
|
* the content: in view mode the layout rows divide the grid's own
|
|
@@ -359,6 +375,41 @@ var script = {
|
|
|
359
375
|
*
|
|
360
376
|
* @return {object|null}
|
|
361
377
|
*/
|
|
378
|
+
/**
|
|
379
|
+
* The left edge of each of the twelve columns and the right edge of
|
|
380
|
+
* the last, as fractions of the grid's width, from `columnWeights`;
|
|
381
|
+
* null when the grid keeps its twelve shares.
|
|
382
|
+
*
|
|
383
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
384
|
+
* @return {number[]|null}
|
|
385
|
+
*/
|
|
386
|
+
columnBounds() {
|
|
387
|
+
const groups = this.columnWeights;
|
|
388
|
+
if (this.editable || !Array.isArray(groups) || groups.length === 0) {
|
|
389
|
+
return null
|
|
390
|
+
}
|
|
391
|
+
const perColumn = [];
|
|
392
|
+
for (const group of groups) {
|
|
393
|
+
const span = Number(group?.span);
|
|
394
|
+
const weight = Number(group?.weight);
|
|
395
|
+
if (!Number.isInteger(span) || span < 1 || !Number.isFinite(weight) || weight <= 0) {
|
|
396
|
+
return null
|
|
397
|
+
}
|
|
398
|
+
for (let i = 0; i < span; i++) {
|
|
399
|
+
perColumn.push(weight / span);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
if (perColumn.length !== 12) {
|
|
403
|
+
return null
|
|
404
|
+
}
|
|
405
|
+
const total = perColumn.reduce((sum, w) => sum + w, 0);
|
|
406
|
+
const bounds = [0];
|
|
407
|
+
for (const w of perColumn) {
|
|
408
|
+
bounds.push(bounds[bounds.length - 1] + w / total);
|
|
409
|
+
}
|
|
410
|
+
return bounds
|
|
411
|
+
},
|
|
412
|
+
|
|
362
413
|
sideColumnStyle() {
|
|
363
414
|
const width = Number(this.sideColumn?.width);
|
|
364
415
|
if (this.editable || !Number.isFinite(width) || width <= 0) {
|
|
@@ -734,6 +785,43 @@ var script = {
|
|
|
734
785
|
}
|
|
735
786
|
},
|
|
736
787
|
|
|
788
|
+
/**
|
|
789
|
+
* The left and width fractions of an item on weighted columns, or
|
|
790
|
+
* null when the grid keeps its twelve shares or the item is on a
|
|
791
|
+
* side-column track.
|
|
792
|
+
*
|
|
793
|
+
* @spec openspec/changes/dashboard-column-weights/specs/dashboard-column-weights/spec.md#requirement-a-dashboard-can-weigh-its-column-groups
|
|
794
|
+
* @param {object} item The layout item.
|
|
795
|
+
* @return {object|null}
|
|
796
|
+
*/
|
|
797
|
+
weightStyle(item) {
|
|
798
|
+
const bounds = this.columnBounds;
|
|
799
|
+
if (bounds === null || (this.sideColumnStyle !== null && (item.track === 'main' || item.track === 'side'))) {
|
|
800
|
+
return null
|
|
801
|
+
}
|
|
802
|
+
const x = Math.min(Math.max(Number.isFinite(item.gridX) ? item.gridX : 0, 0), 12);
|
|
803
|
+
const w = Number.isFinite(item.gridWidth) ? item.gridWidth : this.minWidth;
|
|
804
|
+
const end = Math.min(Math.max(x + w, x), 12);
|
|
805
|
+
return {
|
|
806
|
+
'--cn-weight-left': String(bounds[x]),
|
|
807
|
+
'--cn-weight-width': String(bounds[end] - bounds[x]),
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* The inline style of an item: its place on a filled grid, or its
|
|
813
|
+
* place on weighted columns.
|
|
814
|
+
*
|
|
815
|
+
* @param {object} item The layout item.
|
|
816
|
+
* @return {object|undefined}
|
|
817
|
+
*/
|
|
818
|
+
itemStyle(item) {
|
|
819
|
+
if (this.filling) {
|
|
820
|
+
return this.fillItemStyle(item)
|
|
821
|
+
}
|
|
822
|
+
return this.weightStyle(item) || undefined
|
|
823
|
+
},
|
|
824
|
+
|
|
737
825
|
resolveItemLabel(item, index) {
|
|
738
826
|
if (this.itemLabel) {
|
|
739
827
|
return String(this.itemLabel(item, index) ?? '')
|