@conduction/nextcloud-vue 0.1.0-beta.1 → 0.1.0-beta.10
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/README.md +226 -0
- package/css/index.css +5 -0
- package/dist/nextcloud-vue.cjs +67614 -0
- package/dist/nextcloud-vue.cjs.js +76311 -5905
- package/dist/nextcloud-vue.cjs.js.map +1 -1
- package/dist/nextcloud-vue.cjs.map +1 -0
- package/dist/nextcloud-vue.css +3279 -203
- package/dist/nextcloud-vue.esm.js +76240 -5882
- package/dist/nextcloud-vue.esm.js.map +1 -1
- package/package.json +89 -63
- package/src/components/CnActionsBar/CnActionsBar.vue +254 -0
- package/src/components/CnActionsBar/index.js +1 -0
- package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +569 -0
- package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -0
- package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -0
- package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +422 -0
- package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -0
- package/src/components/CnAdvancedFormDialog/index.js +1 -0
- package/src/components/CnCard/CnCard.vue +415 -0
- package/src/components/CnCard/index.js +1 -0
- package/src/components/CnCardGrid/CnCardGrid.vue +23 -20
- package/src/components/CnCardGrid/index.js +1 -1
- package/src/components/CnCellRenderer/index.js +1 -1
- package/src/components/CnChartWidget/CnChartWidget.vue +318 -0
- package/src/components/CnChartWidget/index.js +1 -0
- package/src/components/CnConfigurationCard/index.js +1 -1
- package/src/components/CnContextMenu/CnContextMenu.vue +142 -0
- package/src/components/CnContextMenu/index.js +1 -0
- package/src/components/CnCopyDialog/CnCopyDialog.vue +257 -0
- package/src/components/CnCopyDialog/index.js +1 -0
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +229 -0
- package/src/components/CnDashboardGrid/index.js +1 -0
- package/src/components/CnDashboardPage/CnDashboardPage.vue +396 -0
- package/src/components/CnDashboardPage/index.js +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +24 -16
- package/src/components/CnDataTable/index.js +1 -1
- package/src/components/CnDeleteDialog/CnDeleteDialog.vue +177 -0
- package/src/components/CnDeleteDialog/index.js +1 -0
- package/src/components/CnDetailCard/CnDetailCard.vue +225 -0
- package/src/components/CnDetailCard/index.js +1 -0
- package/src/components/CnDetailGrid/CnDetailGrid.vue +254 -0
- package/src/components/CnDetailGrid/index.js +1 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +431 -0
- package/src/components/CnDetailPage/index.js +1 -0
- package/src/components/CnFacetSidebar/CnFacetSidebar.vue +12 -2
- package/src/components/CnFacetSidebar/index.js +1 -1
- package/src/components/CnFilterBar/index.js +1 -1
- package/src/components/CnFormDialog/CnFormDialog.vue +934 -0
- package/src/components/CnFormDialog/index.js +1 -0
- package/src/components/CnIcon/CnIcon.vue +89 -0
- package/src/components/CnIcon/index.js +1 -0
- package/src/components/CnIndexPage/CnIndexPage.vue +589 -291
- package/src/components/CnIndexPage/index.js +1 -1
- package/src/components/CnIndexSidebar/CnIndexSidebar.vue +535 -0
- package/src/components/CnIndexSidebar/index.js +1 -0
- package/src/components/CnInfoWidget/CnInfoWidget.vue +219 -0
- package/src/components/CnInfoWidget/index.js +1 -0
- package/src/components/CnItemCard/CnItemCard.vue +134 -0
- package/src/components/CnItemCard/index.js +1 -0
- package/src/components/CnJsonViewer/CnJsonViewer.vue +283 -0
- package/src/components/CnJsonViewer/index.js +1 -0
- package/src/components/CnKpiGrid/CnKpiGrid.vue +5 -1
- package/src/components/CnKpiGrid/index.js +1 -1
- package/src/components/CnMassActionBar/CnMassActionBar.vue +6 -5
- package/src/components/CnMassActionBar/index.js +1 -1
- package/src/components/CnMassCopyDialog/CnMassCopyDialog.vue +16 -9
- package/src/components/CnMassCopyDialog/index.js +1 -1
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +16 -9
- package/src/components/CnMassDeleteDialog/index.js +1 -1
- package/src/components/CnMassExportDialog/CnMassExportDialog.vue +8 -7
- package/src/components/CnMassExportDialog/index.js +1 -1
- package/src/components/CnMassImportDialog/CnMassImportDialog.vue +20 -17
- package/src/components/CnMassImportDialog/index.js +1 -1
- package/src/components/CnNoteCard/CnNoteCard.vue +149 -0
- package/src/components/CnNoteCard/index.js +1 -0
- package/src/components/CnNotesCard/CnNotesCard.vue +415 -0
- package/src/components/CnNotesCard/index.js +1 -0
- package/src/components/CnObjectCard/CnObjectCard.vue +3 -1
- package/src/components/CnObjectCard/index.js +1 -1
- package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +853 -0
- package/src/components/CnObjectDataWidget/index.js +1 -0
- package/src/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue +288 -0
- package/src/components/CnObjectMetadataWidget/index.js +1 -0
- package/src/components/CnObjectSidebar/CnAuditTrailTab.vue +368 -0
- package/src/components/CnObjectSidebar/CnFilesTab.vue +286 -0
- package/src/components/CnObjectSidebar/CnNotesTab.vue +249 -0
- package/src/components/CnObjectSidebar/CnObjectSidebar.vue +254 -0
- package/src/components/CnObjectSidebar/CnTagsTab.vue +258 -0
- package/src/components/CnObjectSidebar/CnTasksTab.vue +482 -0
- package/src/components/CnObjectSidebar/index.js +6 -0
- package/src/components/CnPageHeader/CnPageHeader.vue +61 -0
- package/src/components/CnPageHeader/index.js +1 -0
- package/src/components/CnPagination/CnPagination.vue +7 -6
- package/src/components/CnPagination/index.js +1 -1
- package/src/components/CnProgressBar/CnProgressBar.vue +262 -0
- package/src/components/CnProgressBar/index.js +1 -0
- package/src/components/CnRegisterMapping/CnRegisterMapping.vue +792 -0
- package/src/components/CnRegisterMapping/index.js +1 -0
- package/src/components/CnRowActions/CnRowActions.vue +25 -3
- package/src/components/CnRowActions/index.js +1 -1
- package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +226 -0
- package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +787 -0
- package/src/components/CnSchemaFormDialog/CnSchemaPropertiesTab.vue +305 -0
- package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +1398 -0
- package/src/components/CnSchemaFormDialog/CnSchemaSecurityTab.vue +236 -0
- package/src/components/CnSchemaFormDialog/index.js +1 -0
- package/src/components/CnSettingsCard/index.js +1 -1
- package/src/components/CnSettingsSection/index.js +1 -1
- package/src/components/CnStatsBlock/CnStatsBlock.vue +89 -19
- package/src/components/CnStatsBlock/index.js +1 -1
- package/src/components/CnStatsPanel/CnStatsPanel.vue +320 -0
- package/src/components/CnStatsPanel/index.js +1 -0
- package/src/components/CnStatusBadge/CnStatusBadge.vue +15 -2
- package/src/components/CnStatusBadge/index.js +1 -1
- package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +544 -0
- package/src/components/CnTabbedFormDialog/index.js +1 -0
- package/src/components/CnTableWidget/CnTableWidget.vue +332 -0
- package/src/components/CnTableWidget/index.js +1 -0
- package/src/components/CnTasksCard/CnTasksCard.vue +373 -0
- package/src/components/CnTasksCard/index.js +1 -0
- package/src/components/CnTileWidget/CnTileWidget.vue +159 -0
- package/src/components/CnTileWidget/index.js +1 -0
- package/src/components/CnTimelineStages/CnTimelineStages.vue +292 -0
- package/src/components/CnTimelineStages/index.js +1 -0
- package/src/components/CnUserActionMenu/CnUserActionMenu.vue +435 -0
- package/src/components/CnUserActionMenu/index.js +1 -0
- package/src/components/CnVersionInfoCard/index.js +1 -1
- package/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +180 -0
- package/src/components/CnWidgetRenderer/index.js +1 -0
- package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +246 -0
- package/src/components/CnWidgetWrapper/index.js +1 -0
- package/src/components/index.js +57 -25
- package/src/composables/index.js +5 -3
- package/src/composables/useContextMenu.js +126 -0
- package/src/composables/useDashboardView.js +286 -0
- package/src/composables/useDetailView.js +290 -132
- package/src/composables/useListView.js +364 -153
- package/src/composables/useSubResource.js +142 -142
- package/src/constants/metadata.js +30 -0
- package/src/css/CnSchemaFormDialog.css +546 -0
- package/src/css/__sample_nextcloud_tokens.css +110 -0
- package/src/css/actions-bar.css +54 -0
- package/src/css/badge.css +83 -51
- package/src/css/card.css +129 -128
- package/src/css/context-menu.css +20 -0
- package/src/css/dashboard.css +70 -0
- package/src/css/detail-page.css +235 -0
- package/src/css/detail.css +68 -68
- package/src/css/index-page.css +44 -0
- package/src/css/index-sidebar.css +193 -0
- package/src/css/index.css +17 -8
- package/src/css/layout.css +90 -90
- package/src/css/page-header.css +35 -0
- package/src/css/pagination.css +72 -72
- package/src/css/table.css +142 -143
- package/src/css/timeline-stages.css +220 -0
- package/src/css/utilities.css +46 -46
- package/src/index.js +91 -50
- package/src/mixins/gridLayout.js +118 -0
- package/src/store/createCrudStore.js +360 -0
- package/src/store/createSubResourcePlugin.js +125 -135
- package/src/store/index.js +4 -3
- package/src/store/plugins/auditTrails.js +357 -17
- package/src/store/plugins/files.js +250 -186
- package/src/store/plugins/index.js +7 -4
- package/src/store/plugins/lifecycle.js +180 -180
- package/src/store/plugins/registerMapping.js +195 -0
- package/src/store/plugins/relations.js +68 -68
- package/src/store/plugins/search.js +385 -0
- package/src/store/plugins/selection.js +104 -0
- package/src/store/useObjectStore.js +823 -625
- package/src/types/auditTrail.d.ts +32 -32
- package/src/types/file.d.ts +23 -23
- package/src/types/index.d.ts +35 -35
- package/src/types/notification.d.ts +36 -36
- package/src/types/object.d.ts +40 -40
- package/src/types/organisation.d.ts +41 -41
- package/src/types/register.d.ts +25 -25
- package/src/types/schema.d.ts +39 -39
- package/src/types/shared.d.ts +79 -79
- package/src/types/source.d.ts +14 -14
- package/src/types/task.d.ts +31 -31
- package/src/utils/errors.js +96 -96
- package/src/utils/getTheme.js +9 -0
- package/src/utils/headers.js +80 -44
- package/src/utils/id.js +13 -0
- package/src/utils/index.js +4 -3
- package/src/utils/schema.js +422 -287
- package/src/utils/widgetVisibility.js +162 -0
- package/src/components/CnDetailViewLayout/CnDetailViewLayout.vue +0 -88
- package/src/components/CnDetailViewLayout/index.js +0 -1
- package/src/components/CnEmptyState/CnEmptyState.vue +0 -78
- package/src/components/CnEmptyState/index.js +0 -1
- package/src/components/CnListViewLayout/CnListViewLayout.vue +0 -80
- package/src/components/CnListViewLayout/index.js +0 -1
- package/src/components/CnViewModeToggle/CnViewModeToggle.vue +0 -77
- package/src/components/CnViewModeToggle/index.js +0 -1
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
</template>
|
|
73
73
|
|
|
74
74
|
<script>
|
|
75
|
+
import { translate as t } from '@nextcloud/l10n'
|
|
75
76
|
import { NcDialog, NcButton, NcNoteCard, NcLoadingIcon, NcSelect } from '@nextcloud/vue'
|
|
76
77
|
import ContentCopy from 'vue-material-design-icons/ContentCopy.vue'
|
|
77
78
|
import Close from 'vue-material-design-icons/Close.vue'
|
|
@@ -132,30 +133,35 @@ export default {
|
|
|
132
133
|
type: String,
|
|
133
134
|
default: 'title',
|
|
134
135
|
},
|
|
136
|
+
/** Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. */
|
|
137
|
+
nameFormatter: {
|
|
138
|
+
type: Function,
|
|
139
|
+
default: null,
|
|
140
|
+
},
|
|
135
141
|
/** Dialog title */
|
|
136
142
|
dialogTitle: {
|
|
137
143
|
type: String,
|
|
138
|
-
default: 'Copy
|
|
144
|
+
default: () => t('nextcloud-vue', 'Copy items'),
|
|
139
145
|
},
|
|
140
146
|
/** Label for the naming pattern selector */
|
|
141
147
|
patternLabel: {
|
|
142
148
|
type: String,
|
|
143
|
-
default: 'Naming pattern',
|
|
149
|
+
default: () => t('nextcloud-vue', 'Naming pattern'),
|
|
144
150
|
},
|
|
145
151
|
/** Text when all items removed from list */
|
|
146
152
|
emptyText: {
|
|
147
153
|
type: String,
|
|
148
|
-
default: 'No items selected for copying.',
|
|
154
|
+
default: () => t('nextcloud-vue', 'No items selected for copying.'),
|
|
149
155
|
},
|
|
150
156
|
/** Success message */
|
|
151
157
|
successText: {
|
|
152
158
|
type: String,
|
|
153
|
-
default: 'Items successfully copied.',
|
|
159
|
+
default: () => t('nextcloud-vue', 'Items successfully copied.'),
|
|
154
160
|
},
|
|
155
|
-
cancelLabel: { type: String, default: 'Cancel' },
|
|
156
|
-
closeLabel: { type: String, default: 'Close' },
|
|
157
|
-
confirmLabel: { type: String, default: 'Copy' },
|
|
158
|
-
removeLabel: { type: String, default: 'Remove from list' },
|
|
161
|
+
cancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },
|
|
162
|
+
closeLabel: { type: String, default: () => t('nextcloud-vue', 'Close') },
|
|
163
|
+
confirmLabel: { type: String, default: () => t('nextcloud-vue', 'Copy') },
|
|
164
|
+
removeLabel: { type: String, default: () => t('nextcloud-vue', 'Remove from list') },
|
|
159
165
|
},
|
|
160
166
|
|
|
161
167
|
data() {
|
|
@@ -190,6 +196,7 @@ export default {
|
|
|
190
196
|
|
|
191
197
|
methods: {
|
|
192
198
|
getItemName(item) {
|
|
199
|
+
if (this.nameFormatter) return this.nameFormatter(item)
|
|
193
200
|
return item[this.nameField] || item.name || item.title || item.id
|
|
194
201
|
},
|
|
195
202
|
|
|
@@ -240,7 +247,7 @@ export default {
|
|
|
240
247
|
* Set the result of the copy operation. Call this from the parent
|
|
241
248
|
* after the API call completes.
|
|
242
249
|
*
|
|
243
|
-
* @param {{ success?: boolean, error?: string }} resultData
|
|
250
|
+
* @param {{ success?: boolean, error?: string }} resultData - Result data to pass to the dialog
|
|
244
251
|
* @public
|
|
245
252
|
*/
|
|
246
253
|
setResult(resultData) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CnMassCopyDialog } from './CnMassCopyDialog.vue'
|
|
1
|
+
export { default as CnMassCopyDialog } from './CnMassCopyDialog.vue'
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
</template>
|
|
65
65
|
|
|
66
66
|
<script>
|
|
67
|
+
import { translate as t } from '@nextcloud/l10n'
|
|
67
68
|
import { NcDialog, NcButton, NcNoteCard, NcLoadingIcon } from '@nextcloud/vue'
|
|
68
69
|
import TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'
|
|
69
70
|
import Close from 'vue-material-design-icons/Close.vue'
|
|
@@ -119,30 +120,35 @@ export default {
|
|
|
119
120
|
type: String,
|
|
120
121
|
default: 'title',
|
|
121
122
|
},
|
|
123
|
+
/** Optional function to format the item name. Receives the item, returns a string. Overrides nameField when provided. */
|
|
124
|
+
nameFormatter: {
|
|
125
|
+
type: Function,
|
|
126
|
+
default: null,
|
|
127
|
+
},
|
|
122
128
|
/** Dialog title */
|
|
123
129
|
dialogTitle: {
|
|
124
130
|
type: String,
|
|
125
|
-
default: 'Delete
|
|
131
|
+
default: () => t('nextcloud-vue', 'Delete items'),
|
|
126
132
|
},
|
|
127
133
|
/** Warning text shown above the item list */
|
|
128
134
|
warningText: {
|
|
129
135
|
type: String,
|
|
130
|
-
default: 'The following items will be permanently deleted. Remove any items you want to keep.',
|
|
136
|
+
default: () => t('nextcloud-vue', 'The following items will be permanently deleted. Remove any items you want to keep.'),
|
|
131
137
|
},
|
|
132
138
|
/** Text when all items removed from list */
|
|
133
139
|
emptyText: {
|
|
134
140
|
type: String,
|
|
135
|
-
default: 'No items selected for deletion.',
|
|
141
|
+
default: () => t('nextcloud-vue', 'No items selected for deletion.'),
|
|
136
142
|
},
|
|
137
143
|
/** Success message */
|
|
138
144
|
successText: {
|
|
139
145
|
type: String,
|
|
140
|
-
default: 'Items successfully deleted.',
|
|
146
|
+
default: () => t('nextcloud-vue', 'Items successfully deleted.'),
|
|
141
147
|
},
|
|
142
|
-
cancelLabel: { type: String, default: 'Cancel' },
|
|
143
|
-
closeLabel: { type: String, default: 'Close' },
|
|
144
|
-
confirmLabel: { type: String, default: 'Delete' },
|
|
145
|
-
removeLabel: { type: String, default: 'Remove from list' },
|
|
148
|
+
cancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },
|
|
149
|
+
closeLabel: { type: String, default: () => t('nextcloud-vue', 'Close') },
|
|
150
|
+
confirmLabel: { type: String, default: () => t('nextcloud-vue', 'Delete') },
|
|
151
|
+
removeLabel: { type: String, default: () => t('nextcloud-vue', 'Remove from list') },
|
|
146
152
|
},
|
|
147
153
|
|
|
148
154
|
data() {
|
|
@@ -166,6 +172,7 @@ export default {
|
|
|
166
172
|
|
|
167
173
|
methods: {
|
|
168
174
|
getItemName(item) {
|
|
175
|
+
if (this.nameFormatter) return this.nameFormatter(item)
|
|
169
176
|
return item[this.nameField] || item.name || item.title || item.id
|
|
170
177
|
},
|
|
171
178
|
|
|
@@ -187,7 +194,7 @@ export default {
|
|
|
187
194
|
* Set the result of the delete operation. Call this from the parent
|
|
188
195
|
* after the API call completes.
|
|
189
196
|
*
|
|
190
|
-
* @param {{ success?: boolean, error?: string }} resultData
|
|
197
|
+
* @param {{ success?: boolean, error?: string }} resultData - Result data to pass to the dialog
|
|
191
198
|
* @public
|
|
192
199
|
*/
|
|
193
200
|
setResult(resultData) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CnMassDeleteDialog } from './CnMassDeleteDialog.vue'
|
|
1
|
+
export { default as CnMassDeleteDialog } from './CnMassDeleteDialog.vue'
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
</template>
|
|
52
52
|
|
|
53
53
|
<script>
|
|
54
|
+
import { translate as t } from '@nextcloud/l10n'
|
|
54
55
|
import { NcDialog, NcButton, NcNoteCard, NcLoadingIcon, NcSelect } from '@nextcloud/vue'
|
|
55
56
|
import ExportIcon from 'vue-material-design-icons/Export.vue'
|
|
56
57
|
|
|
@@ -101,7 +102,7 @@ export default {
|
|
|
101
102
|
/** Dialog title */
|
|
102
103
|
dialogTitle: {
|
|
103
104
|
type: String,
|
|
104
|
-
default: 'Export
|
|
105
|
+
default: () => t('nextcloud-vue', 'Export objects'),
|
|
105
106
|
},
|
|
106
107
|
/** Description text shown above the format selector */
|
|
107
108
|
description: {
|
|
@@ -124,12 +125,12 @@ export default {
|
|
|
124
125
|
/** Success message */
|
|
125
126
|
successText: {
|
|
126
127
|
type: String,
|
|
127
|
-
default: 'Export completed successfully.',
|
|
128
|
+
default: () => t('nextcloud-vue', 'Export completed successfully.'),
|
|
128
129
|
},
|
|
129
|
-
formatLabel: { type: String, default: 'Export format' },
|
|
130
|
-
cancelLabel: { type: String, default: 'Cancel' },
|
|
131
|
-
closeLabel: { type: String, default: 'Close' },
|
|
132
|
-
confirmLabel: { type: String, default: 'Export' },
|
|
130
|
+
formatLabel: { type: String, default: () => t('nextcloud-vue', 'Export format') },
|
|
131
|
+
cancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },
|
|
132
|
+
closeLabel: { type: String, default: () => t('nextcloud-vue', 'Close') },
|
|
133
|
+
confirmLabel: { type: String, default: () => t('nextcloud-vue', 'Export') },
|
|
133
134
|
},
|
|
134
135
|
|
|
135
136
|
data() {
|
|
@@ -156,7 +157,7 @@ export default {
|
|
|
156
157
|
|
|
157
158
|
/**
|
|
158
159
|
* Set the result of the export operation.
|
|
159
|
-
* @param {{ success?: boolean, error?: string }} resultData
|
|
160
|
+
* @param {{ success?: boolean, error?: string }} resultData - Result data to pass to the dialog
|
|
160
161
|
* @public
|
|
161
162
|
*/
|
|
162
163
|
setResult(resultData) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CnMassExportDialog } from './CnMassExportDialog.vue'
|
|
1
|
+
export { default as CnMassExportDialog } from './CnMassExportDialog.vue'
|
|
@@ -32,7 +32,9 @@
|
|
|
32
32
|
<tbody>
|
|
33
33
|
<template v-for="(sheet, key) in result.summary">
|
|
34
34
|
<tr :key="key">
|
|
35
|
-
<td class="cn-mass-import__sheet-name">
|
|
35
|
+
<td class="cn-mass-import__sheet-name">
|
|
36
|
+
{{ key }}
|
|
37
|
+
</td>
|
|
36
38
|
<td class="cn-mass-import__stat cn-mass-import__stat--found">
|
|
37
39
|
{{ sheet.found || 0 }}
|
|
38
40
|
</td>
|
|
@@ -161,6 +163,7 @@
|
|
|
161
163
|
</template>
|
|
162
164
|
|
|
163
165
|
<script>
|
|
166
|
+
import { translate as t } from '@nextcloud/l10n'
|
|
164
167
|
import { NcDialog, NcButton, NcNoteCard, NcLoadingIcon, NcCheckboxRadioSwitch } from '@nextcloud/vue'
|
|
165
168
|
import Upload from 'vue-material-design-icons/Upload.vue'
|
|
166
169
|
import ImportIcon from 'vue-material-design-icons/Import.vue'
|
|
@@ -254,30 +257,30 @@ export default {
|
|
|
254
257
|
/** Success text when all rows imported without errors */
|
|
255
258
|
successText: {
|
|
256
259
|
type: String,
|
|
257
|
-
default: 'Import completed successfully!',
|
|
260
|
+
default: () => t('nextcloud-vue', 'Import completed successfully!'),
|
|
258
261
|
},
|
|
259
262
|
/** Text when import partially succeeded */
|
|
260
263
|
partialSuccessText: {
|
|
261
264
|
type: String,
|
|
262
|
-
default: 'Import completed with errors. Check the details below.',
|
|
265
|
+
default: () => t('nextcloud-vue', 'Import completed with errors. Check the details below.'),
|
|
263
266
|
},
|
|
264
267
|
/** Text shown while importing */
|
|
265
268
|
loadingText: {
|
|
266
269
|
type: String,
|
|
267
|
-
default: 'Importing data — this may take a moment for large files...',
|
|
270
|
+
default: () => t('nextcloud-vue', 'Importing data — this may take a moment for large files...'),
|
|
268
271
|
},
|
|
269
|
-
summaryTitle: { type: String, default: 'Import
|
|
270
|
-
supportedFormatsLabel: { type: String, default: 'Supported file types:' },
|
|
271
|
-
selectFileLabel: { type: String, default: 'Select File' },
|
|
272
|
-
cancelLabel: { type: String, default: 'Cancel' },
|
|
273
|
-
closeLabel: { type: String, default: 'Close' },
|
|
274
|
-
confirmLabel: { type: String, default: 'Import' },
|
|
275
|
-
sheetLabel: { type: String, default: 'Sheet' },
|
|
276
|
-
foundLabel: { type: String, default: 'Found' },
|
|
277
|
-
createdLabel: { type: String, default: 'Created' },
|
|
278
|
-
updatedLabel: { type: String, default: 'Updated' },
|
|
279
|
-
unchangedLabel: { type: String, default: 'Unchanged' },
|
|
280
|
-
errorsLabel: { type: String, default: 'Errors' },
|
|
272
|
+
summaryTitle: { type: String, default: () => t('nextcloud-vue', 'Import summary') },
|
|
273
|
+
supportedFormatsLabel: { type: String, default: () => t('nextcloud-vue', 'Supported file types:') },
|
|
274
|
+
selectFileLabel: { type: String, default: () => t('nextcloud-vue', 'Select File') },
|
|
275
|
+
cancelLabel: { type: String, default: () => t('nextcloud-vue', 'Cancel') },
|
|
276
|
+
closeLabel: { type: String, default: () => t('nextcloud-vue', 'Close') },
|
|
277
|
+
confirmLabel: { type: String, default: () => t('nextcloud-vue', 'Import') },
|
|
278
|
+
sheetLabel: { type: String, default: () => t('nextcloud-vue', 'Sheet') },
|
|
279
|
+
foundLabel: { type: String, default: () => t('nextcloud-vue', 'Found') },
|
|
280
|
+
createdLabel: { type: String, default: () => t('nextcloud-vue', 'Created') },
|
|
281
|
+
updatedLabel: { type: String, default: () => t('nextcloud-vue', 'Updated') },
|
|
282
|
+
unchangedLabel: { type: String, default: () => t('nextcloud-vue', 'Unchanged') },
|
|
283
|
+
errorsLabel: { type: String, default: () => t('nextcloud-vue', 'Errors') },
|
|
281
284
|
},
|
|
282
285
|
|
|
283
286
|
data() {
|
|
@@ -341,7 +344,7 @@ export default {
|
|
|
341
344
|
|
|
342
345
|
/**
|
|
343
346
|
* Set the result of the import operation.
|
|
344
|
-
* @param {{ success?: boolean, error?: string, summary?: object }} resultData
|
|
347
|
+
* @param {{ success?: boolean, error?: string, summary?: object }} resultData - Result data to pass to the dialog
|
|
345
348
|
* @public
|
|
346
349
|
*/
|
|
347
350
|
setResult(resultData) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CnMassImportDialog } from './CnMassImportDialog.vue'
|
|
1
|
+
export { default as CnMassImportDialog } from './CnMassImportDialog.vue'
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
This code was taken from nextcloud-vue due to certain changes being required but unable to be done as a patch.
|
|
3
|
+
|
|
4
|
+
https://github.com/nextcloud-libraries/nextcloud-vue/blob/main/src/components/NcNoteCard/NcNoteCard.vue
|
|
5
|
+
-->
|
|
6
|
+
<template>
|
|
7
|
+
<div
|
|
8
|
+
class="notecard"
|
|
9
|
+
:class="{
|
|
10
|
+
[`notecard--${type}`]: type,
|
|
11
|
+
}"
|
|
12
|
+
:role="shouldShowAlert ? 'alert' : 'note'">
|
|
13
|
+
<slot name="icon">
|
|
14
|
+
<NcIconSvgWrapper
|
|
15
|
+
:path="iconPath"
|
|
16
|
+
class="notecard__icon"
|
|
17
|
+
:class="{ 'notecard__icon--heading': heading }"
|
|
18
|
+
inline />
|
|
19
|
+
</slot>
|
|
20
|
+
<div>
|
|
21
|
+
<p v-if="heading" class="notecard__heading">
|
|
22
|
+
{{ heading }}
|
|
23
|
+
</p>
|
|
24
|
+
<slot>
|
|
25
|
+
<p class="notecard__text">
|
|
26
|
+
{{ text }}
|
|
27
|
+
</p>
|
|
28
|
+
</slot>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<script>
|
|
34
|
+
import { NcIconSvgWrapper } from '@nextcloud/vue'
|
|
35
|
+
|
|
36
|
+
// hardcoded @mdi/js icons to avoid unnececary package and bundlesize
|
|
37
|
+
// we are only doing this to patch NcNoteCard anyway
|
|
38
|
+
const mdiAlert = 'M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z'
|
|
39
|
+
const mdiAlertDecagram = 'M23,12L20.56,9.22L20.9,5.54L17.29,4.72L15.4,1.54L12,3L8.6,1.54L6.71,4.72L3.1,5.53L3.44,9.21L1,12L3.44,14.78L3.1,18.47L6.71,19.29L8.6,22.47L12,21L15.4,22.46L17.29,19.28L20.9,18.46L20.56,14.78L23,12M13,17H11V15H13V17M13,13H11V7H13V13Z'
|
|
40
|
+
const mdiCheckboxMarkedCircle = 'M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z'
|
|
41
|
+
const mdiInformation = 'M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 12,2Z'
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: 'CnNoteCard',
|
|
45
|
+
components: {
|
|
46
|
+
NcIconSvgWrapper,
|
|
47
|
+
},
|
|
48
|
+
props: {
|
|
49
|
+
/** Optional text to show as a heading of the note card */
|
|
50
|
+
heading: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: undefined,
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* Enforce the `alert` role on the note card.
|
|
56
|
+
*
|
|
57
|
+
* The alert role should only be used for information that requires the user's immediate attention.
|
|
58
|
+
*
|
|
59
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/alert_role
|
|
60
|
+
*/
|
|
61
|
+
showAlert: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: undefined,
|
|
64
|
+
},
|
|
65
|
+
/** The message text of the note card */
|
|
66
|
+
text: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: undefined,
|
|
69
|
+
},
|
|
70
|
+
/** Type or severity of the message */
|
|
71
|
+
type: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: 'warning',
|
|
74
|
+
validator: (value) =>
|
|
75
|
+
['success', 'info', 'warning', 'error'].includes(value),
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
shouldShowAlert() {
|
|
80
|
+
return this.showAlert || this.type === 'error'
|
|
81
|
+
},
|
|
82
|
+
iconPath() {
|
|
83
|
+
switch (this.type) {
|
|
84
|
+
case 'error':
|
|
85
|
+
return mdiAlertDecagram
|
|
86
|
+
case 'success':
|
|
87
|
+
return mdiCheckboxMarkedCircle
|
|
88
|
+
case 'info':
|
|
89
|
+
return mdiInformation
|
|
90
|
+
case 'warning':
|
|
91
|
+
default:
|
|
92
|
+
return mdiAlert
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<!-- we do not have support for scss so this has been translated to css -->
|
|
100
|
+
<!-- @TODO add scss support -->
|
|
101
|
+
<style scoped>
|
|
102
|
+
.notecard {
|
|
103
|
+
--note-card-icon-size: 20px;
|
|
104
|
+
--note-card-padding: calc(2 * var(--default-grid-baseline));
|
|
105
|
+
color: var(--color-main-text) !important;
|
|
106
|
+
background-color: var(--note-background) !important;
|
|
107
|
+
border-inline-start: var(--default-grid-baseline) solid var(--note-theme);
|
|
108
|
+
border-radius: var(--border-radius-small);
|
|
109
|
+
margin: 1rem 0;
|
|
110
|
+
padding: var(--note-card-padding);
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
gap: var(--note-card-padding);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.notecard__heading {
|
|
117
|
+
font-size: var(--note-card-icon-size); /* Same as icon */
|
|
118
|
+
font-weight: 600;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.notecard__icon {
|
|
122
|
+
color: var(--note-theme);
|
|
123
|
+
}
|
|
124
|
+
.notecard__icon--heading {
|
|
125
|
+
font-size: var(--note-card-icon-size);
|
|
126
|
+
/* Ensure icon is on the same height as the heading */
|
|
127
|
+
margin-block: calc((1lh - 1em) / 2) auto;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.notecard--success {
|
|
131
|
+
--note-background: var(--color-success);
|
|
132
|
+
--note-theme: var(--color-success-text);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.notecard--info {
|
|
136
|
+
--note-background: var(--color-info);
|
|
137
|
+
--note-theme: var(--color-info-text);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.notecard--error {
|
|
141
|
+
--note-background: var(--color-error);
|
|
142
|
+
--note-theme: var(--color-error-text);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.notecard--warning {
|
|
146
|
+
--note-background: var(--color-warning);
|
|
147
|
+
--note-theme: var(--color-warning-text);
|
|
148
|
+
}
|
|
149
|
+
</style>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CnNoteCard } from './CnNoteCard.vue'
|