@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,248 @@
|
|
|
1
|
+
import { translate, translatePlural } from '@nextcloud/l10n';
|
|
2
|
+
import { NcButton, NcNoteCard, NcLoadingIcon } from '@nextcloud/vue';
|
|
3
|
+
import AlertOutline from 'vue-material-design-icons/AlertOutline.vue';
|
|
4
|
+
import Close from 'vue-material-design-icons/Close.vue';
|
|
5
|
+
import __sfc_main$2 from '../CnConfirmValueField/CnConfirmValueField.vue.js';
|
|
6
|
+
import __sfc_main from '../CnDialog/CnDialog.vue.js';
|
|
7
|
+
import { confirmValueMixin } from '../../mixins/confirmValue.js';
|
|
8
|
+
import { dialogBoardMixin } from '../../mixins/dialogBoard.js';
|
|
9
|
+
import { splitAroundPlaceholder } from '../../utils/dialogSentence.js';
|
|
10
|
+
import __sfc_main$1 from '../CnIcon/CnIcon.vue.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* CnMassActionDialog — two-phase confirmation dialog for one action on many
|
|
14
|
+
* items: publish, lock, validate, restore, delete.
|
|
15
|
+
*
|
|
16
|
+
* Phase 1 (review): shows the items the action applies to, each with a button
|
|
17
|
+
* that takes it off the list. Phase 2 (result): shows success or an error.
|
|
18
|
+
*
|
|
19
|
+
* The dialog does NOT perform the action itself. It emits `confirm` with the
|
|
20
|
+
* ids of the items still on the list; the parent performs the call and
|
|
21
|
+
* reports back through `setResult()` on a ref.
|
|
22
|
+
*
|
|
23
|
+
* ```vue
|
|
24
|
+
* <CnMassActionDialog
|
|
25
|
+
* v-if="showPublish"
|
|
26
|
+
* ref="publishDialog"
|
|
27
|
+
* :items="selectedObjects"
|
|
28
|
+
* :dialog-title="t('myapp', 'Publish objects')"
|
|
29
|
+
* :warning-text="t('myapp', 'The following objects will be published.')"
|
|
30
|
+
* :confirm-label="t('myapp', 'Publish')"
|
|
31
|
+
* confirm-icon="Publish"
|
|
32
|
+
* @confirm="onPublishConfirm"
|
|
33
|
+
* @close="showPublish = false" />
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* // In methods:
|
|
37
|
+
* async onPublishConfirm(ids) {
|
|
38
|
+
* try {
|
|
39
|
+
* await store.massPublish(ids)
|
|
40
|
+
* this.$refs.publishDialog.setResult({ success: true })
|
|
41
|
+
* } catch (e) {
|
|
42
|
+
* this.$refs.publishDialog.setResult({ error: e.message })
|
|
43
|
+
* }
|
|
44
|
+
* }
|
|
45
|
+
*
|
|
46
|
+
* `CnMassDeleteDialog` is this dialog with the delete texts, the `error`
|
|
47
|
+
* variant and a trash icon as defaults.
|
|
48
|
+
*
|
|
49
|
+
* @event close Emitted when the dialog should be closed (cancel, close button, or auto-close after success).
|
|
50
|
+
*/
|
|
51
|
+
var script = {
|
|
52
|
+
name: 'CnMassActionDialog',
|
|
53
|
+
|
|
54
|
+
/** Prefix of the dialog's test ids: `<prefix>-dialog`, `<prefix>-dialog-confirm`, `<prefix>-sentence`, `<prefix>-note`. */
|
|
55
|
+
testidPrefix: 'cn-mass-action',
|
|
56
|
+
|
|
57
|
+
components: {
|
|
58
|
+
CnDialog: __sfc_main,
|
|
59
|
+
NcButton,
|
|
60
|
+
NcNoteCard,
|
|
61
|
+
NcLoadingIcon,
|
|
62
|
+
CnIcon: __sfc_main$1,
|
|
63
|
+
Close,
|
|
64
|
+
AlertOutline,
|
|
65
|
+
CnConfirmValueField: __sfc_main$2,
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
mixins: [dialogBoardMixin, confirmValueMixin],
|
|
69
|
+
|
|
70
|
+
props: {
|
|
71
|
+
/** Items the action applies to. Each must have an `id` property. */
|
|
72
|
+
items: {
|
|
73
|
+
type: Array,
|
|
74
|
+
required: true,
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
/** Property name used for display (e.g., 'title', 'name') */
|
|
78
|
+
nameField: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: 'title',
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
/** Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. */
|
|
84
|
+
nameFormatter: {
|
|
85
|
+
type: Function,
|
|
86
|
+
default: null,
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
/** Dialog title */
|
|
90
|
+
dialogTitle: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: () => translate('nextcloud-vue', 'Confirm action'),
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
/** Warning text shown above the item list */
|
|
96
|
+
warningText: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: () => translate('nextcloud-vue', 'The action applies to the following items. Remove any items you want to leave out.'),
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
/** Text when all items removed from list */
|
|
102
|
+
emptyText: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: () => translate('nextcloud-vue', 'No items selected.'),
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
/** Success message */
|
|
108
|
+
successText: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: () => translate('nextcloud-vue', 'Done.'),
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
/** Label for the cancel button (visible before the action runs). */
|
|
114
|
+
cancelLabel: { type: String, default: () => translate('nextcloud-vue', 'Cancel') },
|
|
115
|
+
/** Label for the close button (visible after the action completes). */
|
|
116
|
+
closeLabel: { type: String, default: () => translate('nextcloud-vue', 'Close') },
|
|
117
|
+
/** Label for the primary button that confirms the action. */
|
|
118
|
+
confirmLabel: { type: String, default: () => translate('nextcloud-vue', 'Confirm') },
|
|
119
|
+
/** Aria label for the per-row "remove from list" icon button. */
|
|
120
|
+
removeLabel: { type: String, default: () => translate('nextcloud-vue', 'Remove from list') },
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Visual variant of the primary button. Use `error` for a destructive
|
|
124
|
+
* action such as delete or purge.
|
|
125
|
+
*/
|
|
126
|
+
variant: {
|
|
127
|
+
type: String,
|
|
128
|
+
default: 'primary',
|
|
129
|
+
validator: (v) => ['primary', 'error', 'warning', 'success'].includes(v),
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Icon on the primary button: a CnIcon name (`Publish`) or an icon
|
|
134
|
+
* component. Empty draws none.
|
|
135
|
+
*
|
|
136
|
+
* @type {string|object}
|
|
137
|
+
*/
|
|
138
|
+
confirmIcon: { type: [String, Object], default: '' },
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Board look: the question above the list, with `{count}` where the
|
|
142
|
+
* bold item count goes.
|
|
143
|
+
*/
|
|
144
|
+
sentence: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: () => translate('nextcloud-vue', 'Are you sure you want to continue with {count}?'),
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
/** Board look: end the sentence with "This action cannot be undone." */
|
|
150
|
+
irreversible: { type: Boolean, default: false },
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
emits: ['close', 'confirm'],
|
|
154
|
+
|
|
155
|
+
data() {
|
|
156
|
+
return {
|
|
157
|
+
localItems: [...this.items],
|
|
158
|
+
loading: false,
|
|
159
|
+
result: null,
|
|
160
|
+
closeTimeout: null,
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
computed: {
|
|
165
|
+
/** The board sentence around the bold item count. */
|
|
166
|
+
sentenceParts() {
|
|
167
|
+
return splitAroundPlaceholder(this.sentence, 'count')
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
/** Prefix of the test ids, set per preset. */
|
|
171
|
+
testidPrefix() {
|
|
172
|
+
return this.$options.testidPrefix
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
countLabel() {
|
|
176
|
+
return translatePlural('nextcloud-vue', '%n item', '%n items', this.localItems.length)
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
irreversibleText() {
|
|
180
|
+
return translate('nextcloud-vue', 'This action cannot be undone.')
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
watch: {
|
|
185
|
+
items(val) {
|
|
186
|
+
this.localItems = [...val];
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
|
|
190
|
+
beforeUnmount() {
|
|
191
|
+
if (this.closeTimeout) {
|
|
192
|
+
clearTimeout(this.closeTimeout);
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
methods: {
|
|
197
|
+
getItemName(item) {
|
|
198
|
+
if (this.nameFormatter) {
|
|
199
|
+
return this.nameFormatter(item)
|
|
200
|
+
}
|
|
201
|
+
return item[this.nameField] || item.name || item.title || item.id
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
removeItem(id) {
|
|
205
|
+
this.localItems = this.localItems.filter((i) => i.id !== id);
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
executeConfirm() {
|
|
209
|
+
if (!this.confirmValueMatches) {
|
|
210
|
+
return
|
|
211
|
+
}
|
|
212
|
+
this.loading = true;
|
|
213
|
+
const ids = this.localItems.map((i) => i.id);
|
|
214
|
+
/**
|
|
215
|
+
* Emitted when the user confirms the action. Payload: the ids of the items still on the list.
|
|
216
|
+
*
|
|
217
|
+
* @event confirm
|
|
218
|
+
* @type {Array<string|number>}
|
|
219
|
+
*/
|
|
220
|
+
this.$emit('confirm', ids);
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Set the result of the action. Call this from the parent
|
|
225
|
+
* after the API call completes.
|
|
226
|
+
*
|
|
227
|
+
* @param {{ success?: boolean, error?: string }} resultData - Result data to pass to the dialog
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
setResult(resultData) {
|
|
231
|
+
this.loading = false;
|
|
232
|
+
this.result = resultData;
|
|
233
|
+
if (resultData.success) {
|
|
234
|
+
this.closeTimeout = setTimeout(() => {
|
|
235
|
+
/**
|
|
236
|
+
* Emitted when the dialog should close: cancel, close button, or 2 seconds after a success.
|
|
237
|
+
*
|
|
238
|
+
* @event close
|
|
239
|
+
*/
|
|
240
|
+
this.$emit('close');
|
|
241
|
+
}, 2000);
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export { script as default };
|
|
248
|
+
//# sourceMappingURL=CnMassActionDialog.vue2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnMassActionDialog.vue2.js","sources":["../../../../src/components/CnMassActionDialog/CnMassActionDialog.vue"],"sourcesContent":["<template>\n\t<CnDialog\n\t\t:look=\"look\"\n\t\t:width=\"width\"\n\t\tdefaultWidth=\"confirm\"\n\t\t:eyebrow=\"eyebrow\"\n\t\t:subtitle=\"subtitle\"\n\t\t:name=\"dialogTitle\"\n\t\tsize=\"normal\"\n\t\t:noClose=\"loading\"\n\t\t@closing=\"$emit('close')\">\n\t\t<!-- Review phase -->\n\t\t<div v-if=\"result === null\"\n\t\t\tclass=\"cn-mass-delete__review\"\n\t\t\tdata-testid=\"cn-modal\"\n\t\t\t:data-testid-modal=\"testidPrefix + '-dialog'\"\n\t\t\tdata-testid-phase=\"review\">\n\t\t\t<template v-if=\"isBoardLook\">\n\t\t\t\t<p class=\"cn-dialog__sentence\" :data-testid=\"testidPrefix + '-sentence'\">\n\t\t\t\t\t{{ sentenceParts[0] }}<strong class=\"cn-dialog__name\">{{ countLabel }}</strong>{{ sentenceParts[1] }}\n\t\t\t\t\t<template v-if=\"irreversible\">\n\t\t\t\t\t\t{{ irreversibleText }}\n\t\t\t\t\t</template>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"cn-dialog__note\"\n\t\t\t\t\trole=\"note\"\n\t\t\t\t\t:data-testid=\"testidPrefix + '-note'\">\n\t\t\t\t\t<AlertOutline :size=\"20\" aria-hidden=\"true\" />\n\t\t\t\t\t<span>{{ warningText }}</span>\n\t\t\t\t</p>\n\t\t\t</template>\n\t\t\t<NcNoteCard v-else type=\"warning\">\n\t\t\t\t{{ warningText }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<div class=\"cn-mass-delete__list\">\n\t\t\t\t<div\n\t\t\t\t\tv-for=\"item in localItems\"\n\t\t\t\t\t:key=\"item.id\"\n\t\t\t\t\tclass=\"cn-mass-delete__item\">\n\t\t\t\t\t<span class=\"cn-mass-delete__item-name\">\n\t\t\t\t\t\t{{ getItemName(item) }}\n\t\t\t\t\t</span>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t:aria-label=\"removeLabel\"\n\t\t\t\t\t\t@click=\"removeItem(item.id)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Close :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<p v-if=\"localItems.length === 0\" class=\"cn-mass-delete__empty\">\n\t\t\t\t{{ emptyText }}\n\t\t\t</p>\n\t\t\t<CnConfirmValueField v-if=\"confirmValue !== ''\"\n\t\t\t\tv-model=\"typedConfirmValue\"\n\t\t\t\t:value=\"confirmValue\"\n\t\t\t\t:label=\"confirmFieldLabel\" />\n\t\t</div>\n\n\t\t<!-- Result phase -->\n\t\t<div v-else\n\t\t\tclass=\"cn-mass-delete__result\"\n\t\t\tdata-testid=\"cn-modal\"\n\t\t\t:data-testid-modal=\"testidPrefix + '-dialog'\"\n\t\t\tdata-testid-phase=\"result\">\n\t\t\t<NcNoteCard v-if=\"result.success\" type=\"success\">\n\t\t\t\t{{ successText }}\n\t\t\t</NcNoteCard>\n\t\t\t<NcNoteCard v-if=\"result.error\" type=\"error\">\n\t\t\t\t{{ result.error }}\n\t\t\t</NcNoteCard>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton :disabled=\"loading\" @click=\"$emit('close')\">\n\t\t\t\t{{ result === null ? cancelLabel : closeLabel }}\n\t\t\t</NcButton>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"result === null\"\n\t\t\t\t:variant=\"variant\"\n\t\t\t\t:class=\"{ 'cn-dialog__confirm-pending': confirmValuePending }\"\n\t\t\t\t:disabled=\"loading || localItems.length === 0 || confirmValuePending\"\n\t\t\t\t:aria-disabled=\"confirmValuePending ? 'true' : undefined\"\n\t\t\t\t:data-testid=\"testidPrefix + '-dialog-confirm'\"\n\t\t\t\t@click=\"executeConfirm\">\n\t\t\t\t<template v-if=\"loading || confirmIcon\" #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"loading\" :size=\"20\" />\n\t\t\t\t\t<CnIcon v-else-if=\"typeof confirmIcon === 'string'\" :name=\"confirmIcon\" :size=\"20\" />\n\t\t\t\t\t<component :is=\"confirmIcon\" v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ confirmLabel }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'\nimport AlertOutline from 'vue-material-design-icons/AlertOutline.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport CnConfirmValueField from '../CnConfirmValueField/CnConfirmValueField.vue'\nimport CnDialog from '../CnDialog/CnDialog.vue'\nimport { confirmValueMixin } from '../../mixins/confirmValue.js'\nimport { dialogBoardMixin } from '../../mixins/dialogBoard.js'\nimport { splitAroundPlaceholder } from '../../utils/dialogSentence.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\n/**\n * CnMassActionDialog — two-phase confirmation dialog for one action on many\n * items: publish, lock, validate, restore, delete.\n *\n * Phase 1 (review): shows the items the action applies to, each with a button\n * that takes it off the list. Phase 2 (result): shows success or an error.\n *\n * The dialog does NOT perform the action itself. It emits `confirm` with the\n * ids of the items still on the list; the parent performs the call and\n * reports back through `setResult()` on a ref.\n *\n * ```vue\n * <CnMassActionDialog\n * v-if=\"showPublish\"\n * ref=\"publishDialog\"\n * :items=\"selectedObjects\"\n * :dialog-title=\"t('myapp', 'Publish objects')\"\n * :warning-text=\"t('myapp', 'The following objects will be published.')\"\n * :confirm-label=\"t('myapp', 'Publish')\"\n * confirm-icon=\"Publish\"\n * @confirm=\"onPublishConfirm\"\n * @close=\"showPublish = false\" />\n * ```\n *\n * // In methods:\n * async onPublishConfirm(ids) {\n * try {\n * await store.massPublish(ids)\n * this.$refs.publishDialog.setResult({ success: true })\n * } catch (e) {\n * this.$refs.publishDialog.setResult({ error: e.message })\n * }\n * }\n *\n * `CnMassDeleteDialog` is this dialog with the delete texts, the `error`\n * variant and a trash icon as defaults.\n *\n * @event close Emitted when the dialog should be closed (cancel, close button, or auto-close after success).\n */\nexport default {\n\tname: 'CnMassActionDialog',\n\n\t/** Prefix of the dialog's test ids: `<prefix>-dialog`, `<prefix>-dialog-confirm`, `<prefix>-sentence`, `<prefix>-note`. */\n\ttestidPrefix: 'cn-mass-action',\n\n\tcomponents: {\n\t\tCnDialog,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcLoadingIcon,\n\t\tCnIcon,\n\t\tClose,\n\t\tAlertOutline,\n\t\tCnConfirmValueField,\n\t},\n\n\tmixins: [dialogBoardMixin, confirmValueMixin],\n\n\tprops: {\n\t\t/** Items the action applies to. Each must have an `id` property. */\n\t\titems: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Property name used for display (e.g., 'title', 'name') */\n\t\tnameField: {\n\t\t\ttype: String,\n\t\t\tdefault: 'title',\n\t\t},\n\n\t\t/** Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. */\n\t\tnameFormatter: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Dialog title */\n\t\tdialogTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Confirm action'),\n\t\t},\n\n\t\t/** Warning text shown above the item list */\n\t\twarningText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'The action applies to the following items. Remove any items you want to leave out.'),\n\t\t},\n\n\t\t/** Text when all items removed from list */\n\t\temptyText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'No items selected.'),\n\t\t},\n\n\t\t/** Success message */\n\t\tsuccessText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Done.'),\n\t\t},\n\n\t\t/** Label for the cancel button (visible before the action runs). */\n\t\tcancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },\n\t\t/** Label for the close button (visible after the action completes). */\n\t\tcloseLabel: { type: String, default: () => t('nextcloud-vue', 'Close') },\n\t\t/** Label for the primary button that confirms the action. */\n\t\tconfirmLabel: { type: String, default: () => t('nextcloud-vue', 'Confirm') },\n\t\t/** Aria label for the per-row \"remove from list\" icon button. */\n\t\tremoveLabel: { type: String, default: () => t('nextcloud-vue', 'Remove from list') },\n\n\t\t/**\n\t\t * Visual variant of the primary button. Use `error` for a destructive\n\t\t * action such as delete or purge.\n\t\t */\n\t\tvariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'primary',\n\t\t\tvalidator: (v) => ['primary', 'error', 'warning', 'success'].includes(v),\n\t\t},\n\n\t\t/**\n\t\t * Icon on the primary button: a CnIcon name (`Publish`) or an icon\n\t\t * component. Empty draws none.\n\t\t *\n\t\t * @type {string|object}\n\t\t */\n\t\tconfirmIcon: { type: [String, Object], default: '' },\n\n\t\t/**\n\t\t * Board look: the question above the list, with `{count}` where the\n\t\t * bold item count goes.\n\t\t */\n\t\tsentence: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Are you sure you want to continue with {count}?'),\n\t\t},\n\n\t\t/** Board look: end the sentence with \"This action cannot be undone.\" */\n\t\tirreversible: { type: Boolean, default: false },\n\t},\n\n\temits: ['close', 'confirm'],\n\n\tdata() {\n\t\treturn {\n\t\t\tlocalItems: [...this.items],\n\t\t\tloading: false,\n\t\t\tresult: null,\n\t\t\tcloseTimeout: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** The board sentence around the bold item count. */\n\t\tsentenceParts() {\n\t\t\treturn splitAroundPlaceholder(this.sentence, 'count')\n\t\t},\n\n\t\t/** Prefix of the test ids, set per preset. */\n\t\ttestidPrefix() {\n\t\t\treturn this.$options.testidPrefix\n\t\t},\n\n\t\tcountLabel() {\n\t\t\treturn n('nextcloud-vue', '%n item', '%n items', this.localItems.length)\n\t\t},\n\n\t\tirreversibleText() {\n\t\t\treturn t('nextcloud-vue', 'This action cannot be undone.')\n\t\t},\n\t},\n\n\twatch: {\n\t\titems(val) {\n\t\t\tthis.localItems = [...val]\n\t\t},\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.closeTimeout) {\n\t\t\tclearTimeout(this.closeTimeout)\n\t\t}\n\t},\n\n\tmethods: {\n\t\tgetItemName(item) {\n\t\t\tif (this.nameFormatter) {\n\t\t\t\treturn this.nameFormatter(item)\n\t\t\t}\n\t\t\treturn item[this.nameField] || item.name || item.title || item.id\n\t\t},\n\n\t\tremoveItem(id) {\n\t\t\tthis.localItems = this.localItems.filter((i) => i.id !== id)\n\t\t},\n\n\t\texecuteConfirm() {\n\t\t\tif (!this.confirmValueMatches) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tconst ids = this.localItems.map((i) => i.id)\n\t\t\t/**\n\t\t\t * Emitted when the user confirms the action. Payload: the ids of the items still on the list.\n\t\t\t *\n\t\t\t * @event confirm\n\t\t\t * @type {Array<string|number>}\n\t\t\t */\n\t\t\tthis.$emit('confirm', ids)\n\t\t},\n\n\t\t/**\n\t\t * Set the result of the action. Call this from the parent\n\t\t * after the API call completes.\n\t\t *\n\t\t * @param {{ success?: boolean, error?: string }} resultData - Result data to pass to the dialog\n\t\t * @public\n\t\t */\n\t\tsetResult(resultData) {\n\t\t\tthis.loading = false\n\t\t\tthis.result = resultData\n\t\t\tif (resultData.success) {\n\t\t\t\tthis.closeTimeout = setTimeout(() => {\n\t\t\t\t\t/**\n\t\t\t\t\t * Emitted when the dialog should close: cancel, close button, or 2 seconds after a success.\n\t\t\t\t\t *\n\t\t\t\t\t * @event close\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('close')\n\t\t\t\t}, 2000)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* Every preset keeps the cn-mass-delete class names: apps style against them. */\n.cn-mass-delete__list {\n\tmax-height: 300px;\n\toverflow-y: auto;\n\tmargin-top: 12px;\n}\n\n.cn-mass-delete__item {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 8px 12px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-mass-delete__item:last-child {\n\tborder-bottom: none;\n}\n\n.cn-mass-delete__item-name {\n\tfont-weight: 500;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-mass-delete__empty {\n\ttext-align: center;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tpadding: 20px;\n}\n</style>\n"],"names":["CnDialog","CnIcon","CnConfirmValueField","t","n"],"mappings":";;;;;;;;;;;AAgHA;AACC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA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,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,GAAG,EAAA;GACzB;;AAED;AACC;;AAEA;AACA;AACA;;AAED,EAAA,SAAS,CAAC,UAAU,EAAE;AACrB,GAAA,IAAI,CAAC,OAAQ,GAAE,MAAI;AACnB,GAAA,IAAI,CAAC,SAAS,WAAS;GACvB,IAAI,UAAU,CAAC,OAAO,EAAE;AACvB,IAAA,IAAI,CAAC,YAAa,GAAE,UAAU,CAAC,MAAM;AACpC;AACC;AACA;;;AAGD,KAAA,IAAI,CAAC,KAAK,CAAC,OAAO,EAAA;AACnB,KAAC,EAAE,IAAI,EAAA;AACR,IAAA;GACA;EACD;AACF;;;;"}
|
|
@@ -1,35 +1,16 @@
|
|
|
1
|
-
import { resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, toDisplayString, normalizeClass, createCommentVNode, createElementBlock, Fragment, createElementVNode, renderList } from 'vue';
|
|
1
|
+
import { resolveComponent, openBlock, createBlock, withCtx, createVNode, createTextVNode, toDisplayString, normalizeClass, createSlots, resolveDynamicComponent, createCommentVNode, createElementBlock, Fragment, createElementVNode, renderList } from 'vue';
|
|
2
2
|
|
|
3
|
-
const _hoisted_1 =
|
|
4
|
-
|
|
5
|
-
class: "cn-mass-delete__review",
|
|
6
|
-
"data-testid": "cn-modal",
|
|
7
|
-
"data-testid-modal": "cn-mass-delete-dialog",
|
|
8
|
-
"data-testid-phase": "review"
|
|
9
|
-
};
|
|
10
|
-
const _hoisted_2 = {
|
|
11
|
-
class: "cn-dialog__sentence",
|
|
12
|
-
"data-testid": "cn-mass-delete-sentence"
|
|
13
|
-
};
|
|
3
|
+
const _hoisted_1 = ["data-testid-modal"];
|
|
4
|
+
const _hoisted_2 = ["data-testid"];
|
|
14
5
|
const _hoisted_3 = { class: "cn-dialog__name" };
|
|
15
|
-
const _hoisted_4 =
|
|
16
|
-
class: "cn-dialog__note",
|
|
17
|
-
role: "note",
|
|
18
|
-
"data-testid": "cn-mass-delete-note"
|
|
19
|
-
};
|
|
6
|
+
const _hoisted_4 = ["data-testid"];
|
|
20
7
|
const _hoisted_5 = { class: "cn-mass-delete__list" };
|
|
21
8
|
const _hoisted_6 = { class: "cn-mass-delete__item-name" };
|
|
22
9
|
const _hoisted_7 = {
|
|
23
10
|
key: 2,
|
|
24
11
|
class: "cn-mass-delete__empty"
|
|
25
12
|
};
|
|
26
|
-
const _hoisted_8 =
|
|
27
|
-
key: 1,
|
|
28
|
-
class: "cn-mass-delete__result",
|
|
29
|
-
"data-testid": "cn-modal",
|
|
30
|
-
"data-testid-modal": "cn-mass-delete-dialog",
|
|
31
|
-
"data-testid-phase": "result"
|
|
32
|
-
};
|
|
13
|
+
const _hoisted_8 = ["data-testid-modal"];
|
|
33
14
|
|
|
34
15
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
35
16
|
const _component_AlertOutline = resolveComponent("AlertOutline");
|
|
@@ -38,7 +19,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
38
19
|
const _component_NcButton = resolveComponent("NcButton");
|
|
39
20
|
const _component_CnConfirmValueField = resolveComponent("CnConfirmValueField");
|
|
40
21
|
const _component_NcLoadingIcon = resolveComponent("NcLoadingIcon");
|
|
41
|
-
const
|
|
22
|
+
const _component_CnIcon = resolveComponent("CnIcon");
|
|
42
23
|
const _component_CnDialog = resolveComponent("CnDialog");
|
|
43
24
|
|
|
44
25
|
return (openBlock(), createBlock(_component_CnDialog, {
|
|
@@ -54,47 +35,70 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
54
35
|
}, {
|
|
55
36
|
actions: withCtx(() => [
|
|
56
37
|
createVNode(_component_NcButton, {
|
|
38
|
+
disabled: $data.loading,
|
|
57
39
|
onClick: _cache[1] || (_cache[1] = $event => (_ctx.$emit('close')))
|
|
58
40
|
}, {
|
|
59
41
|
default: withCtx(() => [
|
|
60
42
|
createTextVNode(toDisplayString($data.result === null ? $props.cancelLabel : $props.closeLabel), 1 /* TEXT */)
|
|
61
43
|
]),
|
|
62
44
|
_: 1 /* STABLE */
|
|
63
|
-
}),
|
|
45
|
+
}, 8 /* PROPS */, ["disabled"]),
|
|
64
46
|
($data.result === null)
|
|
65
47
|
? (openBlock(), createBlock(_component_NcButton, {
|
|
66
48
|
key: 0,
|
|
67
|
-
variant:
|
|
49
|
+
variant: $props.variant,
|
|
68
50
|
class: normalizeClass({ 'cn-dialog__confirm-pending': _ctx.confirmValuePending }),
|
|
69
51
|
disabled: $data.loading || $data.localItems.length === 0 || _ctx.confirmValuePending,
|
|
70
52
|
"aria-disabled": _ctx.confirmValuePending ? 'true' : undefined,
|
|
71
|
-
"data-testid":
|
|
72
|
-
onClick: $options.
|
|
73
|
-
}, {
|
|
74
|
-
icon: withCtx(() => [
|
|
75
|
-
($data.loading)
|
|
76
|
-
? (openBlock(), createBlock(_component_NcLoadingIcon, {
|
|
77
|
-
key: 0,
|
|
78
|
-
size: 20
|
|
79
|
-
}))
|
|
80
|
-
: (openBlock(), createBlock(_component_TrashCanOutline, {
|
|
81
|
-
key: 1,
|
|
82
|
-
size: 20
|
|
83
|
-
}))
|
|
84
|
-
]),
|
|
53
|
+
"data-testid": $options.testidPrefix + '-dialog-confirm',
|
|
54
|
+
onClick: $options.executeConfirm
|
|
55
|
+
}, createSlots({
|
|
85
56
|
default: withCtx(() => [
|
|
86
57
|
createTextVNode(" " + toDisplayString($props.confirmLabel), 1 /* TEXT */)
|
|
87
58
|
]),
|
|
88
|
-
_:
|
|
89
|
-
},
|
|
59
|
+
_: 2 /* DYNAMIC */
|
|
60
|
+
}, [
|
|
61
|
+
($data.loading || $props.confirmIcon)
|
|
62
|
+
? {
|
|
63
|
+
name: "icon",
|
|
64
|
+
fn: withCtx(() => [
|
|
65
|
+
($data.loading)
|
|
66
|
+
? (openBlock(), createBlock(_component_NcLoadingIcon, {
|
|
67
|
+
key: 0,
|
|
68
|
+
size: 20
|
|
69
|
+
}))
|
|
70
|
+
: (typeof $props.confirmIcon === 'string')
|
|
71
|
+
? (openBlock(), createBlock(_component_CnIcon, {
|
|
72
|
+
key: 1,
|
|
73
|
+
name: $props.confirmIcon,
|
|
74
|
+
size: 20
|
|
75
|
+
}, null, 8 /* PROPS */, ["name"]))
|
|
76
|
+
: (openBlock(), createBlock(resolveDynamicComponent($props.confirmIcon), {
|
|
77
|
+
key: 2,
|
|
78
|
+
size: 20
|
|
79
|
+
}))
|
|
80
|
+
]),
|
|
81
|
+
key: "0"
|
|
82
|
+
}
|
|
83
|
+
: undefined
|
|
84
|
+
]), 1032 /* PROPS, DYNAMIC_SLOTS */, ["variant", "class", "disabled", "aria-disabled", "data-testid", "onClick"]))
|
|
90
85
|
: createCommentVNode("v-if", true)
|
|
91
86
|
]),
|
|
92
87
|
default: withCtx(() => [
|
|
93
88
|
($data.result === null)
|
|
94
|
-
? (openBlock(), createElementBlock("div",
|
|
89
|
+
? (openBlock(), createElementBlock("div", {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: "cn-mass-delete__review",
|
|
92
|
+
"data-testid": "cn-modal",
|
|
93
|
+
"data-testid-modal": $options.testidPrefix + '-dialog',
|
|
94
|
+
"data-testid-phase": "review"
|
|
95
|
+
}, [
|
|
95
96
|
(_ctx.isBoardLook)
|
|
96
97
|
? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
97
|
-
createElementVNode("p",
|
|
98
|
+
createElementVNode("p", {
|
|
99
|
+
class: "cn-dialog__sentence",
|
|
100
|
+
"data-testid": $options.testidPrefix + '-sentence'
|
|
101
|
+
}, [
|
|
98
102
|
createTextVNode(toDisplayString($options.sentenceParts[0]), 1 /* TEXT */),
|
|
99
103
|
createElementVNode("strong", _hoisted_3, toDisplayString($options.countLabel), 1 /* TEXT */),
|
|
100
104
|
createTextVNode(toDisplayString($options.sentenceParts[1]) + " ", 1 /* TEXT */),
|
|
@@ -103,14 +107,18 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
103
107
|
createTextVNode(toDisplayString($options.irreversibleText), 1 /* TEXT */)
|
|
104
108
|
], 64 /* STABLE_FRAGMENT */))
|
|
105
109
|
: createCommentVNode("v-if", true)
|
|
106
|
-
]),
|
|
107
|
-
createElementVNode("p",
|
|
110
|
+
], 8 /* PROPS */, _hoisted_2),
|
|
111
|
+
createElementVNode("p", {
|
|
112
|
+
class: "cn-dialog__note",
|
|
113
|
+
role: "note",
|
|
114
|
+
"data-testid": $options.testidPrefix + '-note'
|
|
115
|
+
}, [
|
|
108
116
|
createVNode(_component_AlertOutline, {
|
|
109
117
|
size: 20,
|
|
110
118
|
"aria-hidden": "true"
|
|
111
119
|
}),
|
|
112
120
|
createElementVNode("span", null, toDisplayString($props.warningText), 1 /* TEXT */)
|
|
113
|
-
])
|
|
121
|
+
], 8 /* PROPS */, _hoisted_4)
|
|
114
122
|
], 64 /* STABLE_FRAGMENT */))
|
|
115
123
|
: (openBlock(), createBlock(_component_NcNoteCard, {
|
|
116
124
|
key: 1,
|
|
@@ -153,8 +161,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
153
161
|
label: _ctx.confirmFieldLabel
|
|
154
162
|
}, null, 8 /* PROPS */, ["modelValue", "value", "label"]))
|
|
155
163
|
: createCommentVNode("v-if", true)
|
|
156
|
-
]))
|
|
157
|
-
: (openBlock(), createElementBlock("div",
|
|
164
|
+
], 8 /* PROPS */, _hoisted_1))
|
|
165
|
+
: (openBlock(), createElementBlock("div", {
|
|
166
|
+
key: 1,
|
|
167
|
+
class: "cn-mass-delete__result",
|
|
168
|
+
"data-testid": "cn-modal",
|
|
169
|
+
"data-testid-modal": $options.testidPrefix + '-dialog',
|
|
170
|
+
"data-testid-phase": "result"
|
|
171
|
+
}, [
|
|
158
172
|
($data.result.success)
|
|
159
173
|
? (openBlock(), createBlock(_component_NcNoteCard, {
|
|
160
174
|
key: 0,
|
|
@@ -177,11 +191,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
177
191
|
_: 1 /* STABLE */
|
|
178
192
|
}))
|
|
179
193
|
: createCommentVNode("v-if", true)
|
|
180
|
-
]))
|
|
194
|
+
], 8 /* PROPS */, _hoisted_8))
|
|
181
195
|
]),
|
|
182
196
|
_: 1 /* STABLE */
|
|
183
197
|
}, 8 /* PROPS */, ["look", "width", "eyebrow", "subtitle", "name", "noClose"]))
|
|
184
198
|
}
|
|
185
199
|
|
|
186
200
|
export { render };
|
|
187
|
-
//# sourceMappingURL=
|
|
201
|
+
//# sourceMappingURL=CnMassActionDialog.vue3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CnMassActionDialog.vue3.js","sources":["../../../../src/components/CnMassActionDialog/CnMassActionDialog.vue?vue&type=template&id=60c3bc18&lang.js"],"sourcesContent":["<template>\n\t<CnDialog\n\t\t:look=\"look\"\n\t\t:width=\"width\"\n\t\tdefaultWidth=\"confirm\"\n\t\t:eyebrow=\"eyebrow\"\n\t\t:subtitle=\"subtitle\"\n\t\t:name=\"dialogTitle\"\n\t\tsize=\"normal\"\n\t\t:noClose=\"loading\"\n\t\t@closing=\"$emit('close')\">\n\t\t<!-- Review phase -->\n\t\t<div v-if=\"result === null\"\n\t\t\tclass=\"cn-mass-delete__review\"\n\t\t\tdata-testid=\"cn-modal\"\n\t\t\t:data-testid-modal=\"testidPrefix + '-dialog'\"\n\t\t\tdata-testid-phase=\"review\">\n\t\t\t<template v-if=\"isBoardLook\">\n\t\t\t\t<p class=\"cn-dialog__sentence\" :data-testid=\"testidPrefix + '-sentence'\">\n\t\t\t\t\t{{ sentenceParts[0] }}<strong class=\"cn-dialog__name\">{{ countLabel }}</strong>{{ sentenceParts[1] }}\n\t\t\t\t\t<template v-if=\"irreversible\">\n\t\t\t\t\t\t{{ irreversibleText }}\n\t\t\t\t\t</template>\n\t\t\t\t</p>\n\t\t\t\t<p class=\"cn-dialog__note\"\n\t\t\t\t\trole=\"note\"\n\t\t\t\t\t:data-testid=\"testidPrefix + '-note'\">\n\t\t\t\t\t<AlertOutline :size=\"20\" aria-hidden=\"true\" />\n\t\t\t\t\t<span>{{ warningText }}</span>\n\t\t\t\t</p>\n\t\t\t</template>\n\t\t\t<NcNoteCard v-else type=\"warning\">\n\t\t\t\t{{ warningText }}\n\t\t\t</NcNoteCard>\n\n\t\t\t<div class=\"cn-mass-delete__list\">\n\t\t\t\t<div\n\t\t\t\t\tv-for=\"item in localItems\"\n\t\t\t\t\t:key=\"item.id\"\n\t\t\t\t\tclass=\"cn-mass-delete__item\">\n\t\t\t\t\t<span class=\"cn-mass-delete__item-name\">\n\t\t\t\t\t\t{{ getItemName(item) }}\n\t\t\t\t\t</span>\n\t\t\t\t\t<NcButton\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\t:aria-label=\"removeLabel\"\n\t\t\t\t\t\t@click=\"removeItem(item.id)\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<Close :size=\"16\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</NcButton>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<p v-if=\"localItems.length === 0\" class=\"cn-mass-delete__empty\">\n\t\t\t\t{{ emptyText }}\n\t\t\t</p>\n\t\t\t<CnConfirmValueField v-if=\"confirmValue !== ''\"\n\t\t\t\tv-model=\"typedConfirmValue\"\n\t\t\t\t:value=\"confirmValue\"\n\t\t\t\t:label=\"confirmFieldLabel\" />\n\t\t</div>\n\n\t\t<!-- Result phase -->\n\t\t<div v-else\n\t\t\tclass=\"cn-mass-delete__result\"\n\t\t\tdata-testid=\"cn-modal\"\n\t\t\t:data-testid-modal=\"testidPrefix + '-dialog'\"\n\t\t\tdata-testid-phase=\"result\">\n\t\t\t<NcNoteCard v-if=\"result.success\" type=\"success\">\n\t\t\t\t{{ successText }}\n\t\t\t</NcNoteCard>\n\t\t\t<NcNoteCard v-if=\"result.error\" type=\"error\">\n\t\t\t\t{{ result.error }}\n\t\t\t</NcNoteCard>\n\t\t</div>\n\n\t\t<template #actions>\n\t\t\t<NcButton :disabled=\"loading\" @click=\"$emit('close')\">\n\t\t\t\t{{ result === null ? cancelLabel : closeLabel }}\n\t\t\t</NcButton>\n\t\t\t<NcButton\n\t\t\t\tv-if=\"result === null\"\n\t\t\t\t:variant=\"variant\"\n\t\t\t\t:class=\"{ 'cn-dialog__confirm-pending': confirmValuePending }\"\n\t\t\t\t:disabled=\"loading || localItems.length === 0 || confirmValuePending\"\n\t\t\t\t:aria-disabled=\"confirmValuePending ? 'true' : undefined\"\n\t\t\t\t:data-testid=\"testidPrefix + '-dialog-confirm'\"\n\t\t\t\t@click=\"executeConfirm\">\n\t\t\t\t<template v-if=\"loading || confirmIcon\" #icon>\n\t\t\t\t\t<NcLoadingIcon v-if=\"loading\" :size=\"20\" />\n\t\t\t\t\t<CnIcon v-else-if=\"typeof confirmIcon === 'string'\" :name=\"confirmIcon\" :size=\"20\" />\n\t\t\t\t\t<component :is=\"confirmIcon\" v-else :size=\"20\" />\n\t\t\t\t</template>\n\t\t\t\t{{ confirmLabel }}\n\t\t\t</NcButton>\n\t\t</template>\n\t</CnDialog>\n</template>\n\n<script>\nimport { translatePlural as n, translate as t } from '@nextcloud/l10n'\nimport { NcButton, NcLoadingIcon, NcNoteCard } from '@nextcloud/vue'\nimport AlertOutline from 'vue-material-design-icons/AlertOutline.vue'\nimport Close from 'vue-material-design-icons/Close.vue'\nimport CnConfirmValueField from '../CnConfirmValueField/CnConfirmValueField.vue'\nimport CnDialog from '../CnDialog/CnDialog.vue'\nimport { confirmValueMixin } from '../../mixins/confirmValue.js'\nimport { dialogBoardMixin } from '../../mixins/dialogBoard.js'\nimport { splitAroundPlaceholder } from '../../utils/dialogSentence.js'\nimport { CnIcon } from '../CnIcon/index.js'\n\n/**\n * CnMassActionDialog — two-phase confirmation dialog for one action on many\n * items: publish, lock, validate, restore, delete.\n *\n * Phase 1 (review): shows the items the action applies to, each with a button\n * that takes it off the list. Phase 2 (result): shows success or an error.\n *\n * The dialog does NOT perform the action itself. It emits `confirm` with the\n * ids of the items still on the list; the parent performs the call and\n * reports back through `setResult()` on a ref.\n *\n * ```vue\n * <CnMassActionDialog\n * v-if=\"showPublish\"\n * ref=\"publishDialog\"\n * :items=\"selectedObjects\"\n * :dialog-title=\"t('myapp', 'Publish objects')\"\n * :warning-text=\"t('myapp', 'The following objects will be published.')\"\n * :confirm-label=\"t('myapp', 'Publish')\"\n * confirm-icon=\"Publish\"\n * @confirm=\"onPublishConfirm\"\n * @close=\"showPublish = false\" />\n * ```\n *\n * // In methods:\n * async onPublishConfirm(ids) {\n * try {\n * await store.massPublish(ids)\n * this.$refs.publishDialog.setResult({ success: true })\n * } catch (e) {\n * this.$refs.publishDialog.setResult({ error: e.message })\n * }\n * }\n *\n * `CnMassDeleteDialog` is this dialog with the delete texts, the `error`\n * variant and a trash icon as defaults.\n *\n * @event close Emitted when the dialog should be closed (cancel, close button, or auto-close after success).\n */\nexport default {\n\tname: 'CnMassActionDialog',\n\n\t/** Prefix of the dialog's test ids: `<prefix>-dialog`, `<prefix>-dialog-confirm`, `<prefix>-sentence`, `<prefix>-note`. */\n\ttestidPrefix: 'cn-mass-action',\n\n\tcomponents: {\n\t\tCnDialog,\n\t\tNcButton,\n\t\tNcNoteCard,\n\t\tNcLoadingIcon,\n\t\tCnIcon,\n\t\tClose,\n\t\tAlertOutline,\n\t\tCnConfirmValueField,\n\t},\n\n\tmixins: [dialogBoardMixin, confirmValueMixin],\n\n\tprops: {\n\t\t/** Items the action applies to. Each must have an `id` property. */\n\t\titems: {\n\t\t\ttype: Array,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/** Property name used for display (e.g., 'title', 'name') */\n\t\tnameField: {\n\t\t\ttype: String,\n\t\t\tdefault: 'title',\n\t\t},\n\n\t\t/** Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. */\n\t\tnameFormatter: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/** Dialog title */\n\t\tdialogTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Confirm action'),\n\t\t},\n\n\t\t/** Warning text shown above the item list */\n\t\twarningText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'The action applies to the following items. Remove any items you want to leave out.'),\n\t\t},\n\n\t\t/** Text when all items removed from list */\n\t\temptyText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'No items selected.'),\n\t\t},\n\n\t\t/** Success message */\n\t\tsuccessText: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Done.'),\n\t\t},\n\n\t\t/** Label for the cancel button (visible before the action runs). */\n\t\tcancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },\n\t\t/** Label for the close button (visible after the action completes). */\n\t\tcloseLabel: { type: String, default: () => t('nextcloud-vue', 'Close') },\n\t\t/** Label for the primary button that confirms the action. */\n\t\tconfirmLabel: { type: String, default: () => t('nextcloud-vue', 'Confirm') },\n\t\t/** Aria label for the per-row \"remove from list\" icon button. */\n\t\tremoveLabel: { type: String, default: () => t('nextcloud-vue', 'Remove from list') },\n\n\t\t/**\n\t\t * Visual variant of the primary button. Use `error` for a destructive\n\t\t * action such as delete or purge.\n\t\t */\n\t\tvariant: {\n\t\t\ttype: String,\n\t\t\tdefault: 'primary',\n\t\t\tvalidator: (v) => ['primary', 'error', 'warning', 'success'].includes(v),\n\t\t},\n\n\t\t/**\n\t\t * Icon on the primary button: a CnIcon name (`Publish`) or an icon\n\t\t * component. Empty draws none.\n\t\t *\n\t\t * @type {string|object}\n\t\t */\n\t\tconfirmIcon: { type: [String, Object], default: '' },\n\n\t\t/**\n\t\t * Board look: the question above the list, with `{count}` where the\n\t\t * bold item count goes.\n\t\t */\n\t\tsentence: {\n\t\t\ttype: String,\n\t\t\tdefault: () => t('nextcloud-vue', 'Are you sure you want to continue with {count}?'),\n\t\t},\n\n\t\t/** Board look: end the sentence with \"This action cannot be undone.\" */\n\t\tirreversible: { type: Boolean, default: false },\n\t},\n\n\temits: ['close', 'confirm'],\n\n\tdata() {\n\t\treturn {\n\t\t\tlocalItems: [...this.items],\n\t\t\tloading: false,\n\t\t\tresult: null,\n\t\t\tcloseTimeout: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t/** The board sentence around the bold item count. */\n\t\tsentenceParts() {\n\t\t\treturn splitAroundPlaceholder(this.sentence, 'count')\n\t\t},\n\n\t\t/** Prefix of the test ids, set per preset. */\n\t\ttestidPrefix() {\n\t\t\treturn this.$options.testidPrefix\n\t\t},\n\n\t\tcountLabel() {\n\t\t\treturn n('nextcloud-vue', '%n item', '%n items', this.localItems.length)\n\t\t},\n\n\t\tirreversibleText() {\n\t\t\treturn t('nextcloud-vue', 'This action cannot be undone.')\n\t\t},\n\t},\n\n\twatch: {\n\t\titems(val) {\n\t\t\tthis.localItems = [...val]\n\t\t},\n\t},\n\n\tbeforeUnmount() {\n\t\tif (this.closeTimeout) {\n\t\t\tclearTimeout(this.closeTimeout)\n\t\t}\n\t},\n\n\tmethods: {\n\t\tgetItemName(item) {\n\t\t\tif (this.nameFormatter) {\n\t\t\t\treturn this.nameFormatter(item)\n\t\t\t}\n\t\t\treturn item[this.nameField] || item.name || item.title || item.id\n\t\t},\n\n\t\tremoveItem(id) {\n\t\t\tthis.localItems = this.localItems.filter((i) => i.id !== id)\n\t\t},\n\n\t\texecuteConfirm() {\n\t\t\tif (!this.confirmValueMatches) {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.loading = true\n\t\t\tconst ids = this.localItems.map((i) => i.id)\n\t\t\t/**\n\t\t\t * Emitted when the user confirms the action. Payload: the ids of the items still on the list.\n\t\t\t *\n\t\t\t * @event confirm\n\t\t\t * @type {Array<string|number>}\n\t\t\t */\n\t\t\tthis.$emit('confirm', ids)\n\t\t},\n\n\t\t/**\n\t\t * Set the result of the action. Call this from the parent\n\t\t * after the API call completes.\n\t\t *\n\t\t * @param {{ success?: boolean, error?: string }} resultData - Result data to pass to the dialog\n\t\t * @public\n\t\t */\n\t\tsetResult(resultData) {\n\t\t\tthis.loading = false\n\t\t\tthis.result = resultData\n\t\t\tif (resultData.success) {\n\t\t\t\tthis.closeTimeout = setTimeout(() => {\n\t\t\t\t\t/**\n\t\t\t\t\t * Emitted when the dialog should close: cancel, close button, or 2 seconds after a success.\n\t\t\t\t\t *\n\t\t\t\t\t * @event close\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('close')\n\t\t\t\t}, 2000)\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style scoped>\n/* Every preset keeps the cn-mass-delete class names: apps style against them. */\n.cn-mass-delete__list {\n\tmax-height: 300px;\n\toverflow-y: auto;\n\tmargin-top: 12px;\n}\n\n.cn-mass-delete__item {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 8px 12px;\n\tborder-bottom: 1px solid var(--color-border);\n}\n\n.cn-mass-delete__item:last-child {\n\tborder-bottom: none;\n}\n\n.cn-mass-delete__item-name {\n\tfont-weight: 500;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n.cn-mass-delete__empty {\n\ttext-align: center;\n\tcolor: var(--color-text-maxcontrast);\n\tfont-style: italic;\n\tpadding: 20px;\n}\n</style>\n"],"names":["_createBlock","_createVNode","_createTextVNode","_openBlock","_resolveDynamicComponent","_createElementBlock","_Fragment","_createElementVNode","_toDisplayString","_renderList"],"mappings":";;;;AAmBmC,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,iBAAiB,GAAA;;AAgBlD,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,sBAAsB,GAAA;AAKzB,MAAA,UAAA,GAAA,EAAA,KAAK,EAAC,2BAA2B,GAAA;;;AAcP,EAAA,KAAK,EAAC,uBAAuB;;;;;;;;;;;;;;uBArDjEA,WAgGU,CAAA,mBAAA,EAAA;AA/FR,IAAA,IAAI,EAAE,IAAI,CAAA,IAAA;AACV,IAAA,KAAK,EAAE,IAAK,CAAA,KAAA;AACb,IAAA,Y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FnB,IAAiB,CAAA,iBAAA;+EAAjB,IAAiB,CAAA,iBAAA,IAAA,MAAA,CAAA,CAAA;AACzB,kBAAA,KAAK,EAAE,IAAY,CAAA,YAAA;AACnB,kBAAA,KAAK,EAAE,IAAiB,CAAA,iBAAA;;;;wBAI3BK,kBAWK,CAAA,KAAA,EAAA;;AAVJ,YAAA,KAAK,EAAC,wBAAuB;AAC7B,YAAA,aAAW,EAAC,UAAS;AACpB,YAAA,mBAAiB,EAAE,QAAW,CAAA,YAAA,GAAA,SAAA;AAC/B,YAAA,mBAAiB,EAAC,QAAQ;;AACR,YAAA,CAAA,KAAA,CAAA,MAAM,CAAC,OAAO;8BAAhCL,WAEY,CAAA,qBAAA,EAAA;;AAFsB,kBAAA,IAAI,EAAC,SAAS;;mCAC/C,MAAgB;oDAAb,MAAU,CAAA,WAAA,CAAA,EAAA,CAAA,YAAA;;;;;AAEI,YAAA,CAAA,KAAA,CAAA,MAAM,CAAC,KAAK;8BAA9BA,WAEY,CAAA,qBAAA,EAAA;;AAFoB,kBAAA,IAAI,EAAC,OAAO;;mCAC3C,MAAiB;AAAd,oBAAAE,eAAA,CAAAM,eAAA,CAAA,KAAA,CAAA,MAAM,CAAC;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CnMassDeleteDialog.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CnMassDeleteDialog.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|