@conduction/nextcloud-vue 0.1.0-beta.2 → 0.1.0-beta.4
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 -226
- package/css/index.css +5 -0
- package/dist/nextcloud-vue.cjs.js +60455 -8755
- package/dist/nextcloud-vue.cjs.js.map +1 -1
- package/dist/nextcloud-vue.css +2062 -528
- package/dist/nextcloud-vue.esm.js +60411 -8731
- package/dist/nextcloud-vue.esm.js.map +1 -1
- package/package.json +75 -61
- package/src/components/CnActionsBar/CnActionsBar.vue +235 -225
- package/src/components/CnActionsBar/index.js +1 -1
- package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +579 -0
- package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -0
- package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -0
- package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +418 -0
- package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -0
- package/src/components/CnAdvancedFormDialog/index.js +1 -0
- package/src/components/CnCardGrid/CnCardGrid.vue +152 -152
- package/src/components/CnCardGrid/index.js +1 -1
- package/src/components/CnCellRenderer/CnCellRenderer.vue +132 -132
- package/src/components/CnCellRenderer/index.js +1 -1
- package/src/components/CnChartWidget/CnChartWidget.vue +320 -0
- package/src/components/CnChartWidget/index.js +1 -0
- package/src/components/CnConfigurationCard/CnConfigurationCard.vue +77 -77
- package/src/components/CnConfigurationCard/index.js +1 -1
- package/src/components/CnDashboardGrid/CnDashboardGrid.vue +225 -0
- package/src/components/CnDashboardGrid/index.js +1 -0
- package/src/components/CnDashboardPage/CnDashboardPage.vue +390 -0
- package/src/components/CnDashboardPage/index.js +1 -0
- package/src/components/CnDataTable/CnDataTable.vue +349 -349
- package/src/components/CnDataTable/index.js +1 -1
- package/src/components/CnDetailCard/CnDetailCard.vue +214 -0
- package/src/components/CnDetailCard/index.js +1 -0
- package/src/components/CnDetailPage/CnDetailPage.vue +281 -0
- package/src/components/CnDetailPage/index.js +1 -0
- package/src/components/CnFacetSidebar/CnFacetSidebar.vue +231 -223
- package/src/components/CnFacetSidebar/index.js +1 -1
- package/src/components/CnFilterBar/CnFilterBar.vue +152 -152
- package/src/components/CnFilterBar/index.js +1 -1
- package/src/components/CnIcon/CnIcon.vue +89 -89
- package/src/components/CnIcon/index.js +1 -1
- package/src/components/CnIndexPage/CnIndexPage.vue +874 -816
- package/src/components/CnIndexPage/index.js +1 -1
- package/src/components/CnIndexSidebar/CnIndexSidebar.vue +503 -484
- package/src/components/CnIndexSidebar/index.js +1 -1
- package/src/components/CnItemCard/CnItemCard.vue +132 -0
- package/src/components/CnItemCard/index.js +1 -0
- package/src/components/CnKpiGrid/CnKpiGrid.vue +89 -89
- package/src/components/CnKpiGrid/index.js +1 -1
- package/src/components/CnMassActionBar/CnMassActionBar.vue +160 -160
- package/src/components/CnMassActionBar/index.js +1 -1
- package/src/components/CnMassCopyDialog/CnMassCopyDialog.vue +320 -320
- package/src/components/CnMassCopyDialog/index.js +1 -1
- package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +238 -238
- package/src/components/CnMassDeleteDialog/index.js +1 -1
- package/src/components/CnMassExportDialog/CnMassExportDialog.vue +190 -190
- package/src/components/CnMassExportDialog/index.js +1 -1
- package/src/components/CnMassImportDialog/CnMassImportDialog.vue +491 -491
- 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 +413 -0
- package/src/components/CnNotesCard/index.js +1 -0
- package/src/components/CnObjectCard/CnObjectCard.vue +292 -292
- package/src/components/CnObjectCard/index.js +1 -1
- package/src/components/CnObjectSidebar/CnObjectSidebar.vue +876 -0
- package/src/components/CnObjectSidebar/index.js +1 -0
- package/src/components/CnPageHeader/CnPageHeader.vue +57 -57
- package/src/components/CnPageHeader/index.js +1 -1
- package/src/components/CnPagination/CnPagination.vue +252 -252
- package/src/components/CnPagination/index.js +1 -1
- package/src/components/CnRowActions/CnRowActions.vue +73 -73
- 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/CnSettingsCard.vue +92 -92
- package/src/components/CnSettingsCard/index.js +1 -1
- package/src/components/CnSettingsSection/CnSettingsSection.vue +266 -266
- package/src/components/CnSettingsSection/index.js +1 -1
- package/src/components/CnStatsBlock/CnStatsBlock.vue +420 -366
- package/src/components/CnStatsBlock/index.js +1 -1
- package/src/components/CnStatusBadge/CnStatusBadge.vue +77 -77
- package/src/components/CnStatusBadge/index.js +1 -1
- package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +540 -0
- package/src/components/CnTabbedFormDialog/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/CnVersionInfoCard.vue +312 -312
- 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 +211 -0
- package/src/components/CnWidgetWrapper/index.js +1 -0
- package/src/components/index.js +43 -29
- package/src/composables/index.js +4 -3
- package/src/composables/useDashboardView.js +240 -0
- package/src/composables/useDetailView.js +289 -132
- package/src/composables/useListView.js +363 -153
- package/src/composables/useSubResource.js +142 -142
- package/src/constants/metadata.js +30 -30
- package/src/css/CnSchemaFormDialog.css +546 -0
- package/src/css/__sample_nextcloud_tokens.css +110 -0
- package/src/css/actions-bar.css +48 -48
- package/src/css/badge.css +51 -51
- package/src/css/card.css +128 -128
- package/src/css/dashboard.css +70 -0
- package/src/css/detail-page.css +168 -0
- package/src/css/detail.css +68 -68
- package/src/css/index-page.css +44 -32
- package/src/css/index-sidebar.css +193 -187
- package/src/css/index.css +16 -12
- package/src/css/layout.css +90 -90
- package/src/css/page-header.css +33 -33
- package/src/css/pagination.css +72 -72
- package/src/css/table.css +142 -142
- package/src/css/timeline-stages.css +218 -0
- package/src/css/utilities.css +46 -46
- package/src/index.js +72 -53
- package/src/store/createSubResourcePlugin.js +135 -135
- package/src/store/index.js +3 -3
- package/src/store/plugins/auditTrails.js +17 -17
- package/src/store/plugins/files.js +250 -186
- package/src/store/plugins/index.js +7 -5
- package/src/store/plugins/lifecycle.js +180 -180
- package/src/store/plugins/relations.js +68 -68
- package/src/store/plugins/search.js +372 -0
- package/src/store/plugins/selection.js +104 -0
- package/src/store/useObjectStore.js +829 -686
- 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/headers.js +68 -50
- package/src/utils/id.js +13 -0
- package/src/utils/index.js +3 -3
- package/src/utils/schema.js +422 -419
package/package.json
CHANGED
|
@@ -1,61 +1,75 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@conduction/nextcloud-vue",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
4
|
-
"description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
|
|
5
|
-
"license": "EUPL-1.2",
|
|
6
|
-
"author": "Conduction B.V. <info@conduction.nl>",
|
|
7
|
-
"main": "dist/nextcloud-vue.cjs.js",
|
|
8
|
-
"module": "dist/nextcloud-vue.esm.js",
|
|
9
|
-
"style": "dist/nextcloud-vue.css",
|
|
10
|
-
"types": "src/types/index.d.ts",
|
|
11
|
-
"files": [
|
|
12
|
-
"dist/",
|
|
13
|
-
"src/"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
38
|
-
"@nextcloud/
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"rollup
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"vue
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@conduction/nextcloud-vue",
|
|
3
|
+
"version": "0.1.0-beta.4",
|
|
4
|
+
"description": "Shared Vue component library for Conduction Nextcloud apps — complements @nextcloud/vue with higher-level components, OpenRegister integration, and NL Design System support",
|
|
5
|
+
"license": "EUPL-1.2",
|
|
6
|
+
"author": "Conduction B.V. <info@conduction.nl>",
|
|
7
|
+
"main": "dist/nextcloud-vue.cjs.js",
|
|
8
|
+
"module": "dist/nextcloud-vue.esm.js",
|
|
9
|
+
"style": "dist/nextcloud-vue.css",
|
|
10
|
+
"types": "src/types/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist/",
|
|
13
|
+
"src/",
|
|
14
|
+
"css/"
|
|
15
|
+
],
|
|
16
|
+
"sideEffects": true,
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "rollup -c",
|
|
19
|
+
"dev": "rollup -c -w",
|
|
20
|
+
"test": "jest",
|
|
21
|
+
"lint": "eslint src/",
|
|
22
|
+
"stylelint": "stylelint 'src/**/*.vue' 'src/**/*.css'",
|
|
23
|
+
"prepare": "npm run build",
|
|
24
|
+
"prepublishOnly": "npm run build"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
28
|
+
"@nextcloud/capabilities": "^1.2.1",
|
|
29
|
+
"@nextcloud/dialogs": "^7.3.0",
|
|
30
|
+
"gridstack": "^10.3.1",
|
|
31
|
+
"vue-apexcharts": "^1.7.0",
|
|
32
|
+
"vue-codemirror6": "^1.4.3"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@nextcloud/axios": "^2.0.0",
|
|
36
|
+
"@nextcloud/l10n": "^2.0.0 || ^3.0.0",
|
|
37
|
+
"@nextcloud/router": "^2.0.0 || ^3.0.0",
|
|
38
|
+
"@nextcloud/vue": "^8.0.0",
|
|
39
|
+
"bootstrap-vue": "^2.23.1",
|
|
40
|
+
"pinia": "^2.0.0",
|
|
41
|
+
"vue": "^2.7.0",
|
|
42
|
+
"vue-material-design-icons": "^5.0.0",
|
|
43
|
+
"vue-frag": "^1.4.3"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/core": "^7.29.0",
|
|
47
|
+
"@babel/preset-env": "^7.29.0",
|
|
48
|
+
"@eslint/config-helpers": "^0.4.2",
|
|
49
|
+
"@eslint/eslintrc": "^3.3.4",
|
|
50
|
+
"@eslint/js": "^9.39.3",
|
|
51
|
+
"@nextcloud/browserslist-config": "^3.1.2",
|
|
52
|
+
"@nextcloud/eslint-config": "^8.4.2",
|
|
53
|
+
"@nextcloud/vue": "^8.12.0",
|
|
54
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
55
|
+
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
56
|
+
"@vue/test-utils": "^1.3.6",
|
|
57
|
+
"@vue/vue2-jest": "^29.2.6",
|
|
58
|
+
"babel-jest": "^29.7.0",
|
|
59
|
+
"bootstrap-vue": "^2.23.1",
|
|
60
|
+
"eslint": "^8.56.0",
|
|
61
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
62
|
+
"jest": "^29.7.0",
|
|
63
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
64
|
+
"jest-transform-stub": "^2.0.0",
|
|
65
|
+
"pinia": "^2.1.7",
|
|
66
|
+
"rollup": "^3.29.0",
|
|
67
|
+
"rollup-plugin-postcss": "^4.0.0",
|
|
68
|
+
"rollup-plugin-vue": "^5.1.9",
|
|
69
|
+
"stylelint": "^14.16.1",
|
|
70
|
+
"stylelint-config-recommended": "^9.0.0",
|
|
71
|
+
"stylelint-config-recommended-vue": "^1.5.0",
|
|
72
|
+
"vue": "^2.7.16",
|
|
73
|
+
"vue-material-design-icons": "^5.2.0"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -1,225 +1,235 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="cn-actions-bar">
|
|
3
|
-
<div class="cn-actions-bar__info">
|
|
4
|
-
<span v-if="pagination && pagination.total > 0" class="cn-actions-bar__count">
|
|
5
|
-
{{ countText }}
|
|
6
|
-
</span>
|
|
7
|
-
</div>
|
|
8
|
-
<div class="cn-actions-bar__actions">
|
|
9
|
-
<!-- View mode toggle (Cards / Table) -->
|
|
10
|
-
<div v-if="showViewToggle" class="cn-actions-bar__view-toggle">
|
|
11
|
-
<NcCheckboxRadioSwitch
|
|
12
|
-
:checked="viewMode"
|
|
13
|
-
:button-variant="true"
|
|
14
|
-
value="cards"
|
|
15
|
-
name="cn_view_mode"
|
|
16
|
-
type="radio"
|
|
17
|
-
button-variant-grouped="horizontal"
|
|
18
|
-
@update:checked="$emit('view-mode-change', 'cards')">
|
|
19
|
-
Cards
|
|
20
|
-
</NcCheckboxRadioSwitch>
|
|
21
|
-
<NcCheckboxRadioSwitch
|
|
22
|
-
:checked="viewMode"
|
|
23
|
-
:button-variant="true"
|
|
24
|
-
value="table"
|
|
25
|
-
name="cn_view_mode"
|
|
26
|
-
type="radio"
|
|
27
|
-
button-variant-grouped="horizontal"
|
|
28
|
-
@update:checked="$emit('view-mode-change', 'table')">
|
|
29
|
-
Table
|
|
30
|
-
</NcCheckboxRadioSwitch>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<!-- Add button (primary) -->
|
|
34
|
-
<NcButton type="primary" @click="$emit('add')">
|
|
35
|
-
<template #icon>
|
|
36
|
-
<CnIcon v-if="addIcon" :name="addIcon" :size="20" />
|
|
37
|
-
<Plus v-else :size="20" />
|
|
38
|
-
</template>
|
|
39
|
-
{{ addLabel }}
|
|
40
|
-
</NcButton>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<!--
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
<!--
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
import {
|
|
110
|
-
import
|
|
111
|
-
import
|
|
112
|
-
import
|
|
113
|
-
import
|
|
114
|
-
import
|
|
115
|
-
import
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* :
|
|
124
|
-
*
|
|
125
|
-
* add-
|
|
126
|
-
*
|
|
127
|
-
* @
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cn-actions-bar">
|
|
3
|
+
<div class="cn-actions-bar__info">
|
|
4
|
+
<span v-if="pagination && pagination.total > 0" class="cn-actions-bar__count">
|
|
5
|
+
{{ countText }}
|
|
6
|
+
</span>
|
|
7
|
+
</div>
|
|
8
|
+
<div class="cn-actions-bar__actions">
|
|
9
|
+
<!-- View mode toggle (Cards / Table) -->
|
|
10
|
+
<div v-if="showViewToggle" class="cn-actions-bar__view-toggle">
|
|
11
|
+
<NcCheckboxRadioSwitch
|
|
12
|
+
:checked="viewMode"
|
|
13
|
+
:button-variant="true"
|
|
14
|
+
value="cards"
|
|
15
|
+
name="cn_view_mode"
|
|
16
|
+
type="radio"
|
|
17
|
+
button-variant-grouped="horizontal"
|
|
18
|
+
@update:checked="$emit('view-mode-change', 'cards')">
|
|
19
|
+
Cards
|
|
20
|
+
</NcCheckboxRadioSwitch>
|
|
21
|
+
<NcCheckboxRadioSwitch
|
|
22
|
+
:checked="viewMode"
|
|
23
|
+
:button-variant="true"
|
|
24
|
+
value="table"
|
|
25
|
+
name="cn_view_mode"
|
|
26
|
+
type="radio"
|
|
27
|
+
button-variant-grouped="horizontal"
|
|
28
|
+
@update:checked="$emit('view-mode-change', 'table')">
|
|
29
|
+
Table
|
|
30
|
+
</NcCheckboxRadioSwitch>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<!-- Add button (primary) -->
|
|
34
|
+
<NcButton type="primary" @click="$emit('add')">
|
|
35
|
+
<template #icon>
|
|
36
|
+
<CnIcon v-if="addIcon" :name="addIcon" :size="20" />
|
|
37
|
+
<Plus v-else :size="20" />
|
|
38
|
+
</template>
|
|
39
|
+
{{ addLabel }}
|
|
40
|
+
</NcButton>
|
|
41
|
+
|
|
42
|
+
<slot name="header-actions" />
|
|
43
|
+
|
|
44
|
+
<!-- Actions menu (Refresh, Import, Export, mass actions) -->
|
|
45
|
+
<NcActions
|
|
46
|
+
:force-name="true"
|
|
47
|
+
:inline="0"
|
|
48
|
+
menu-name="Actions">
|
|
49
|
+
<NcActionButton :disabled="refreshing" @click="$emit('refresh')">
|
|
50
|
+
<template #icon>
|
|
51
|
+
<NcLoadingIcon v-if="refreshing" :size="20" />
|
|
52
|
+
<Refresh v-else :size="20" />
|
|
53
|
+
</template>
|
|
54
|
+
{{ refreshing ? 'Refreshing...' : 'Refresh' }}
|
|
55
|
+
</NcActionButton>
|
|
56
|
+
|
|
57
|
+
<!-- Custom primary action items (overflow) -->
|
|
58
|
+
<slot name="action-items" />
|
|
59
|
+
|
|
60
|
+
<!-- Separator between primary and mass actions -->
|
|
61
|
+
<NcActionSeparator v-if="hasMassActions" />
|
|
62
|
+
|
|
63
|
+
<!-- Mass actions (overflow) -->
|
|
64
|
+
<NcActionButton
|
|
65
|
+
v-if="showMassImport"
|
|
66
|
+
@click="$emit('show-import')">
|
|
67
|
+
<template #icon>
|
|
68
|
+
<Import :size="20" />
|
|
69
|
+
</template>
|
|
70
|
+
Import
|
|
71
|
+
</NcActionButton>
|
|
72
|
+
<NcActionButton
|
|
73
|
+
v-if="showMassExport"
|
|
74
|
+
@click="$emit('show-export')">
|
|
75
|
+
<template #icon>
|
|
76
|
+
<Export :size="20" />
|
|
77
|
+
</template>
|
|
78
|
+
Export
|
|
79
|
+
</NcActionButton>
|
|
80
|
+
<NcActionButton
|
|
81
|
+
v-if="showMassCopy"
|
|
82
|
+
:disabled="selectedIds.length < 1"
|
|
83
|
+
:title="selectedIds.length < 1 ? 'Select 1 or more items to copy' : ''"
|
|
84
|
+
@click="$emit('show-copy')">
|
|
85
|
+
<template #icon>
|
|
86
|
+
<ContentCopy :size="20" />
|
|
87
|
+
</template>
|
|
88
|
+
Copy selected
|
|
89
|
+
</NcActionButton>
|
|
90
|
+
<NcActionButton
|
|
91
|
+
v-if="showMassDelete"
|
|
92
|
+
:disabled="selectedIds.length < 1"
|
|
93
|
+
:title="selectedIds.length < 1 ? 'Select 1 or more items to delete' : ''"
|
|
94
|
+
@click="$emit('show-delete')">
|
|
95
|
+
<template #icon>
|
|
96
|
+
<TrashCanOutline :size="20" />
|
|
97
|
+
</template>
|
|
98
|
+
Delete selected
|
|
99
|
+
</NcActionButton>
|
|
100
|
+
|
|
101
|
+
<!-- Custom mass actions (overflow) -->
|
|
102
|
+
<slot name="mass-actions" :count="selectedIds.length" :selected-ids="selectedIds" />
|
|
103
|
+
</NcActions>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<script>
|
|
109
|
+
import { NcActions, NcActionButton, NcActionSeparator, NcButton, NcCheckboxRadioSwitch, NcLoadingIcon } from '@nextcloud/vue'
|
|
110
|
+
import { CnIcon } from '../CnIcon/index.js'
|
|
111
|
+
import Plus from 'vue-material-design-icons/Plus.vue'
|
|
112
|
+
import Refresh from 'vue-material-design-icons/Refresh.vue'
|
|
113
|
+
import ContentCopy from 'vue-material-design-icons/ContentCopy.vue'
|
|
114
|
+
import TrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'
|
|
115
|
+
import Import from 'vue-material-design-icons/Import.vue'
|
|
116
|
+
import Export from 'vue-material-design-icons/Export.vue'
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* CnActionsBar — Reusable actions toolbar with count, mass actions, and primary actions.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* <CnActionsBar
|
|
123
|
+
* :pagination="pagination"
|
|
124
|
+
* :object-count="items.length"
|
|
125
|
+
* add-label="Add Client"
|
|
126
|
+
* add-icon="AccountGroup"
|
|
127
|
+
* @add="createNew"
|
|
128
|
+
* @refresh="reload" />
|
|
129
|
+
*/
|
|
130
|
+
export default {
|
|
131
|
+
name: 'CnActionsBar',
|
|
132
|
+
|
|
133
|
+
components: {
|
|
134
|
+
NcActions,
|
|
135
|
+
NcActionButton,
|
|
136
|
+
NcActionSeparator,
|
|
137
|
+
NcButton,
|
|
138
|
+
NcCheckboxRadioSwitch,
|
|
139
|
+
NcLoadingIcon,
|
|
140
|
+
CnIcon,
|
|
141
|
+
Plus,
|
|
142
|
+
Refresh,
|
|
143
|
+
ContentCopy,
|
|
144
|
+
TrashCanOutline,
|
|
145
|
+
Import,
|
|
146
|
+
Export,
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
props: {
|
|
150
|
+
/** Pagination state: { total, page, pages, limit } */
|
|
151
|
+
pagination: {
|
|
152
|
+
type: Object,
|
|
153
|
+
default: null,
|
|
154
|
+
},
|
|
155
|
+
/** Number of currently visible objects (for "Showing X of Y") */
|
|
156
|
+
objectCount: {
|
|
157
|
+
type: Number,
|
|
158
|
+
default: 0,
|
|
159
|
+
},
|
|
160
|
+
/** Whether rows/cards can be selected */
|
|
161
|
+
selectable: {
|
|
162
|
+
type: Boolean,
|
|
163
|
+
default: true,
|
|
164
|
+
},
|
|
165
|
+
/** Currently selected IDs */
|
|
166
|
+
selectedIds: {
|
|
167
|
+
type: Array,
|
|
168
|
+
default: () => [],
|
|
169
|
+
},
|
|
170
|
+
/** Label for the Add button */
|
|
171
|
+
addLabel: {
|
|
172
|
+
type: String,
|
|
173
|
+
default: 'Add',
|
|
174
|
+
},
|
|
175
|
+
/** MDI icon name for the Add button (e.g. 'AccountGroup'). Falls back to Plus icon. */
|
|
176
|
+
addIcon: {
|
|
177
|
+
type: String,
|
|
178
|
+
default: '',
|
|
179
|
+
},
|
|
180
|
+
/** How many action buttons to show inline (rest go in overflow dropdown) */
|
|
181
|
+
inlineActionCount: {
|
|
182
|
+
type: Number,
|
|
183
|
+
default: 2,
|
|
184
|
+
},
|
|
185
|
+
/** Whether to show the built-in mass Import action */
|
|
186
|
+
showMassImport: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: true,
|
|
189
|
+
},
|
|
190
|
+
/** Whether to show the built-in mass Export action */
|
|
191
|
+
showMassExport: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
default: true,
|
|
194
|
+
},
|
|
195
|
+
/** Whether to show the built-in mass Copy action */
|
|
196
|
+
showMassCopy: {
|
|
197
|
+
type: Boolean,
|
|
198
|
+
default: true,
|
|
199
|
+
},
|
|
200
|
+
/** Whether to show the built-in mass Delete action */
|
|
201
|
+
showMassDelete: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
default: true,
|
|
204
|
+
},
|
|
205
|
+
/** Current view mode: 'table' or 'cards' */
|
|
206
|
+
viewMode: {
|
|
207
|
+
type: String,
|
|
208
|
+
default: 'table',
|
|
209
|
+
validator: (v) => ['table', 'cards'].includes(v),
|
|
210
|
+
},
|
|
211
|
+
/** Whether to show the Cards/Table view toggle */
|
|
212
|
+
showViewToggle: {
|
|
213
|
+
type: Boolean,
|
|
214
|
+
default: true,
|
|
215
|
+
},
|
|
216
|
+
/** Whether the refresh action is currently in progress */
|
|
217
|
+
refreshing: {
|
|
218
|
+
type: Boolean,
|
|
219
|
+
default: false,
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
|
|
223
|
+
computed: {
|
|
224
|
+
countText() {
|
|
225
|
+
if (!this.pagination) return ''
|
|
226
|
+
return `Showing ${this.objectCount} of ${this.pagination.total}`
|
|
227
|
+
},
|
|
228
|
+
hasMassActions() {
|
|
229
|
+
return this.showMassImport || this.showMassExport || this.showMassCopy || this.showMassDelete
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
}
|
|
233
|
+
</script>
|
|
234
|
+
|
|
235
|
+
<!-- Styles in css/actions-bar.css -->
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as CnActionsBar } from './CnActionsBar.vue'
|
|
1
|
+
export { default as CnActionsBar } from './CnActionsBar.vue'
|