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