@conduction/nextcloud-vue 0.1.0-beta.11 → 0.1.0-beta.12

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 (78) hide show
  1. package/dist/nextcloud-vue.cjs +67614 -0
  2. package/dist/nextcloud-vue.cjs.js +13518 -13617
  3. package/dist/nextcloud-vue.cjs.js.map +1 -1
  4. package/dist/nextcloud-vue.cjs.map +1 -0
  5. package/dist/nextcloud-vue.css +1796 -1800
  6. package/dist/nextcloud-vue.esm.js +13518 -13617
  7. package/dist/nextcloud-vue.esm.js.map +1 -1
  8. package/package.json +3 -2
  9. package/src/components/CnActionsBar/CnActionsBar.vue +254 -254
  10. package/src/components/CnAdvancedFormDialog/CnAdvancedFormDialog.vue +570 -570
  11. package/src/components/CnAdvancedFormDialog/CnDataTab.vue +217 -217
  12. package/src/components/CnAdvancedFormDialog/CnMetadataTab.vue +121 -121
  13. package/src/components/CnAdvancedFormDialog/CnPropertiesTab.vue +422 -422
  14. package/src/components/CnAdvancedFormDialog/CnPropertyValueCell.vue +247 -247
  15. package/src/components/CnCard/CnCard.vue +415 -415
  16. package/src/components/CnCardGrid/CnCardGrid.vue +156 -156
  17. package/src/components/CnCellRenderer/CnCellRenderer.vue +132 -132
  18. package/src/components/CnChartWidget/CnChartWidget.vue +346 -346
  19. package/src/components/CnConfigurationCard/CnConfigurationCard.vue +77 -77
  20. package/src/components/CnContextMenu/CnContextMenu.vue +142 -142
  21. package/src/components/CnCopyDialog/CnCopyDialog.vue +266 -266
  22. package/src/components/CnDashboardGrid/CnDashboardGrid.vue +229 -229
  23. package/src/components/CnDashboardPage/CnDashboardPage.vue +397 -397
  24. package/src/components/CnDataTable/CnDataTable.vue +362 -362
  25. package/src/components/CnDeleteDialog/CnDeleteDialog.vue +177 -177
  26. package/src/components/CnDetailCard/CnDetailCard.vue +225 -225
  27. package/src/components/CnDetailGrid/CnDetailGrid.vue +256 -256
  28. package/src/components/CnDetailPage/CnDetailPage.vue +432 -432
  29. package/src/components/CnFacetSidebar/CnFacetSidebar.vue +234 -234
  30. package/src/components/CnFilterBar/CnFilterBar.vue +153 -153
  31. package/src/components/CnFormDialog/CnFormDialog.vue +1047 -1047
  32. package/src/components/CnIcon/CnIcon.vue +89 -89
  33. package/src/components/CnIndexPage/CnIndexPage.vue +981 -980
  34. package/src/components/CnIndexSidebar/CnIndexSidebar.vue +536 -536
  35. package/src/components/CnInfoWidget/CnInfoWidget.vue +219 -219
  36. package/src/components/CnItemCard/CnItemCard.vue +134 -134
  37. package/src/components/CnJsonViewer/CnJsonViewer.vue +312 -312
  38. package/src/components/CnKpiGrid/CnKpiGrid.vue +93 -93
  39. package/src/components/CnMassActionBar/CnMassActionBar.vue +161 -161
  40. package/src/components/CnMassCopyDialog/CnMassCopyDialog.vue +327 -327
  41. package/src/components/CnMassDeleteDialog/CnMassDeleteDialog.vue +245 -245
  42. package/src/components/CnMassExportDialog/CnMassExportDialog.vue +191 -191
  43. package/src/components/CnMassImportDialog/CnMassImportDialog.vue +494 -494
  44. package/src/components/CnNoteCard/CnNoteCard.vue +149 -149
  45. package/src/components/CnNotesCard/CnNotesCard.vue +416 -416
  46. package/src/components/CnObjectCard/CnObjectCard.vue +294 -294
  47. package/src/components/CnObjectDataWidget/CnObjectDataWidget.vue +854 -854
  48. package/src/components/CnObjectMetadataWidget/CnObjectMetadataWidget.vue +289 -289
  49. package/src/components/CnObjectSidebar/CnAuditTrailTab.vue +369 -369
  50. package/src/components/CnObjectSidebar/CnFilesTab.vue +287 -287
  51. package/src/components/CnObjectSidebar/CnNotesTab.vue +250 -250
  52. package/src/components/CnObjectSidebar/CnObjectSidebar.vue +255 -255
  53. package/src/components/CnObjectSidebar/CnTagsTab.vue +259 -259
  54. package/src/components/CnObjectSidebar/CnTasksTab.vue +483 -483
  55. package/src/components/CnPageHeader/CnPageHeader.vue +61 -61
  56. package/src/components/CnPagination/CnPagination.vue +253 -253
  57. package/src/components/CnProgressBar/CnProgressBar.vue +262 -262
  58. package/src/components/CnRegisterMapping/CnRegisterMapping.vue +793 -793
  59. package/src/components/CnRowActions/CnRowActions.vue +95 -95
  60. package/src/components/CnSchemaFormDialog/CnSchemaConfigurationTab.vue +226 -226
  61. package/src/components/CnSchemaFormDialog/CnSchemaFormDialog.vue +788 -788
  62. package/src/components/CnSchemaFormDialog/CnSchemaPropertiesTab.vue +305 -305
  63. package/src/components/CnSchemaFormDialog/CnSchemaPropertyActions.vue +1398 -1398
  64. package/src/components/CnSchemaFormDialog/CnSchemaSecurityTab.vue +236 -236
  65. package/src/components/CnSettingsCard/CnSettingsCard.vue +92 -92
  66. package/src/components/CnSettingsSection/CnSettingsSection.vue +267 -267
  67. package/src/components/CnStatsBlock/CnStatsBlock.vue +437 -437
  68. package/src/components/CnStatsPanel/CnStatsPanel.vue +321 -321
  69. package/src/components/CnStatusBadge/CnStatusBadge.vue +90 -90
  70. package/src/components/CnTabbedFormDialog/CnTabbedFormDialog.vue +545 -545
  71. package/src/components/CnTableWidget/CnTableWidget.vue +333 -333
  72. package/src/components/CnTasksCard/CnTasksCard.vue +374 -374
  73. package/src/components/CnTileWidget/CnTileWidget.vue +159 -159
  74. package/src/components/CnTimelineStages/CnTimelineStages.vue +294 -294
  75. package/src/components/CnUserActionMenu/CnUserActionMenu.vue +436 -436
  76. package/src/components/CnVersionInfoCard/CnVersionInfoCard.vue +313 -313
  77. package/src/components/CnWidgetRenderer/CnWidgetRenderer.vue +180 -180
  78. package/src/components/CnWidgetWrapper/CnWidgetWrapper.vue +248 -248
@@ -1,61 +1,61 @@
1
- <template>
2
- <div class="cn-page-header">
3
- <div v-if="icon || $slots.icon" class="cn-page-header__icon">
4
- <slot name="icon">
5
- <CnIcon :name="icon" :size="iconSize" />
6
- </slot>
7
- </div>
8
- <div class="cn-page-header__text">
9
- <h1 class="cn-page-header__title">
10
- {{ title }}
11
- </h1>
12
- <p v-if="description" class="cn-page-header__description">
13
- {{ description }}
14
- </p>
15
- </div>
16
- <slot name="extra" />
17
- </div>
18
- </template>
19
-
20
- <script>
21
- import { CnIcon } from '../CnIcon/index.js'
22
-
23
- /**
24
- * CnPageHeader — Reusable page header with optional icon, title, and description.
25
- *
26
- * @example
27
- * <CnPageHeader title="Clients" description="Manage your clients" icon="AccountGroup" />
28
- */
29
- export default {
30
- name: 'CnPageHeader',
31
-
32
- components: {
33
- CnIcon,
34
- },
35
-
36
- props: {
37
- /** Page title text */
38
- title: {
39
- type: String,
40
- required: true,
41
- },
42
- /** Optional description shown below the title */
43
- description: {
44
- type: String,
45
- default: '',
46
- },
47
- /** Optional MDI icon name (rendered via CnIcon) */
48
- icon: {
49
- type: String,
50
- default: '',
51
- },
52
- /** Icon size in pixels */
53
- iconSize: {
54
- type: Number,
55
- default: 28,
56
- },
57
- },
58
- }
59
- </script>
60
-
61
- <!-- Styles in css/page-header.css -->
1
+ <template>
2
+ <div class="cn-page-header">
3
+ <div v-if="icon || $slots.icon" class="cn-page-header__icon">
4
+ <slot name="icon">
5
+ <CnIcon :name="icon" :size="iconSize" />
6
+ </slot>
7
+ </div>
8
+ <div class="cn-page-header__text">
9
+ <h1 class="cn-page-header__title">
10
+ {{ title }}
11
+ </h1>
12
+ <p v-if="description" class="cn-page-header__description">
13
+ {{ description }}
14
+ </p>
15
+ </div>
16
+ <slot name="extra" />
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ import { CnIcon } from '../CnIcon/index.js'
22
+
23
+ /**
24
+ * CnPageHeader — Reusable page header with optional icon, title, and description.
25
+ *
26
+ * @example
27
+ * <CnPageHeader title="Clients" description="Manage your clients" icon="AccountGroup" />
28
+ */
29
+ export default {
30
+ name: 'CnPageHeader',
31
+
32
+ components: {
33
+ CnIcon,
34
+ },
35
+
36
+ props: {
37
+ /** Page title text */
38
+ title: {
39
+ type: String,
40
+ required: true,
41
+ },
42
+ /** Optional description shown below the title */
43
+ description: {
44
+ type: String,
45
+ default: '',
46
+ },
47
+ /** Optional MDI icon name (rendered via CnIcon) */
48
+ icon: {
49
+ type: String,
50
+ default: '',
51
+ },
52
+ /** Icon size in pixels */
53
+ iconSize: {
54
+ type: Number,
55
+ default: 28,
56
+ },
57
+ },
58
+ }
59
+ </script>
60
+
61
+ <!-- Styles in css/page-header.css -->
@@ -1,253 +1,253 @@
1
- <template>
2
- <div v-if="totalPages > 1 || totalItems > minItemsToShow" class="cn-pagination">
3
- <!-- Page info -->
4
- <div class="cn-pagination__info">
5
- <span class="cn-pagination__page-info">
6
- {{ pageInfoText }}
7
- </span>
8
- </div>
9
-
10
- <!-- Page navigation -->
11
- <div v-if="totalPages > 1" class="cn-pagination__nav">
12
- <NcButton
13
- :disabled="currentPage === 1"
14
- @click="changePage(1)">
15
- {{ firstLabel }}
16
- </NcButton>
17
-
18
- <NcButton
19
- :disabled="currentPage === 1"
20
- @click="changePage(currentPage - 1)">
21
- {{ previousLabel }}
22
- </NcButton>
23
-
24
- <div class="cn-pagination__numbers">
25
- <template v-for="page in visiblePages">
26
- <span v-if="page === '...'" :key="'ellipsis-' + page" class="cn-pagination__ellipsis">...</span>
27
- <NcButton
28
- v-else
29
- :key="page"
30
- :type="page === currentPage ? 'primary' : 'secondary'"
31
- :disabled="page === currentPage"
32
- @click="changePage(page)">
33
- {{ page }}
34
- </NcButton>
35
- </template>
36
- </div>
37
-
38
- <NcButton
39
- :disabled="currentPage === totalPages"
40
- @click="changePage(currentPage + 1)">
41
- {{ nextLabel }}
42
- </NcButton>
43
-
44
- <NcButton
45
- :disabled="currentPage === totalPages"
46
- @click="changePage(totalPages)">
47
- {{ lastLabel }}
48
- </NcButton>
49
- </div>
50
-
51
- <!-- Page size selector -->
52
- <div class="cn-pagination__page-size">
53
- <label :for="pageSizeId">{{ itemsPerPageLabel }}</label>
54
- <NcSelect
55
- :input-id="pageSizeId"
56
- class="cn-pagination__page-size-select"
57
- :value="currentPageSizeOption"
58
- :options="pageSizeOptions"
59
- :clearable="false"
60
- :input-label="itemsPerPageLabel"
61
- @option:selected="changePageSize" />
62
- </div>
63
- </div>
64
- </template>
65
-
66
- <script>
67
- import { translate as t } from '@nextcloud/l10n'
68
- import { NcButton, NcSelect } from '@nextcloud/vue'
69
-
70
- /**
71
- * CnPagination — Full pagination with page numbers, navigation, and page size selector.
72
- *
73
- * Extracted from OpenRegister's PaginationComponent. Zero store dependencies.
74
- * Supports First/Previous/Next/Last buttons, smart page number display with
75
- * ellipsis, and configurable page size.
76
- *
77
- * NL Design tokens used:
78
- * - Inherits from cn-pagination CSS class (see css/pagination.css)
79
- *
80
- * @example
81
- * <CnPagination
82
- * :current-page="page"
83
- * :total-pages="totalPages"
84
- * :total-items="totalItems"
85
- * :current-page-size="limit"
86
- * @page-changed="onPageChange"
87
- * @page-size-changed="onPageSizeChange" />
88
- */
89
- export default {
90
- name: 'CnPagination',
91
-
92
- components: {
93
- NcButton,
94
- NcSelect,
95
- },
96
-
97
- props: {
98
- /** Current page number (1-based) */
99
- currentPage: {
100
- type: Number,
101
- default: 1,
102
- },
103
- /** Total number of pages */
104
- totalPages: {
105
- type: Number,
106
- default: 1,
107
- },
108
- /** Total number of items across all pages */
109
- totalItems: {
110
- type: Number,
111
- default: 0,
112
- },
113
- /** Current items per page */
114
- currentPageSize: {
115
- type: Number,
116
- default: 20,
117
- },
118
- /** Available page size options */
119
- pageSizeOptions: {
120
- type: Array,
121
- default: () => [
122
- { value: 10, label: '10' },
123
- { value: 20, label: '20' },
124
- { value: 50, label: '50' },
125
- { value: 100, label: '100' },
126
- { value: 250, label: '250' },
127
- { value: 500, label: '500' },
128
- { value: 1000, label: '1000' },
129
- ],
130
- },
131
- /** Minimum items before pagination is shown */
132
- minItemsToShow: {
133
- type: Number,
134
- default: 10,
135
- },
136
- /** Label for "First" button */
137
- firstLabel: {
138
- type: String,
139
- default: () => t('nextcloud-vue', 'First'),
140
- },
141
- /** Label for "Previous" button */
142
- previousLabel: {
143
- type: String,
144
- default: () => t('nextcloud-vue', 'Previous'),
145
- },
146
- /** Label for "Next" button */
147
- nextLabel: {
148
- type: String,
149
- default: () => t('nextcloud-vue', 'Next'),
150
- },
151
- /** Label for "Last" button */
152
- lastLabel: {
153
- type: String,
154
- default: () => t('nextcloud-vue', 'Last'),
155
- },
156
- /** Label for "Items per page:" */
157
- itemsPerPageLabel: {
158
- type: String,
159
- default: () => t('nextcloud-vue', 'Items per page:'),
160
- },
161
- /**
162
- * Page info format string. Use {current} and {total} as placeholders.
163
- * @example "Page {current} of {total}"
164
- */
165
- pageInfoFormat: {
166
- type: String,
167
- default: () => t('nextcloud-vue', 'Page {current} of {total}'),
168
- },
169
- },
170
-
171
- computed: {
172
- pageSizeId() {
173
- return 'cn-page-size-' + this._uid
174
- },
175
-
176
- currentPageSizeOption() {
177
- return this.pageSizeOptions.find(
178
- (option) => option.value === this.currentPageSize,
179
- ) || this.pageSizeOptions[1]
180
- },
181
-
182
- pageInfoText() {
183
- return this.pageInfoFormat
184
- .replace('{current}', this.currentPage)
185
- .replace('{total}', this.totalPages)
186
- },
187
-
188
- /**
189
- * Calculate visible page numbers with ellipsis for large page counts.
190
- * Shows up to 7 page numbers at a time.
191
- */
192
- visiblePages() {
193
- const current = this.currentPage
194
- const total = this.totalPages
195
- const pages = []
196
-
197
- if (total <= 7) {
198
- for (let i = 1; i <= total; i++) {
199
- pages.push(i)
200
- }
201
- } else {
202
- pages.push(1)
203
-
204
- if (current <= 4) {
205
- for (let i = 2; i <= 5; i++) {
206
- pages.push(i)
207
- }
208
- pages.push('...')
209
- pages.push(total)
210
- } else if (current >= total - 3) {
211
- pages.push('...')
212
- for (let i = total - 4; i <= total; i++) {
213
- pages.push(i)
214
- }
215
- } else {
216
- pages.push('...')
217
- for (let i = current - 1; i <= current + 1; i++) {
218
- pages.push(i)
219
- }
220
- pages.push('...')
221
- pages.push(total)
222
- }
223
- }
224
-
225
- return pages
226
- },
227
- },
228
-
229
- methods: {
230
- /**
231
- * Navigate to a specific page.
232
- * @param {number} page Target page number
233
- */
234
- changePage(page) {
235
- if (page !== this.currentPage && page >= 1 && page <= this.totalPages) {
236
- /** @event page-changed Emitted when page changes. Payload: new page number. */
237
- this.$emit('page-changed', page)
238
- }
239
- },
240
-
241
- /**
242
- * Change the page size.
243
- * @param {object} option Selected page size option { value, label }
244
- */
245
- changePageSize(option) {
246
- if (option.value !== this.currentPageSize) {
247
- /** @event page-size-changed Emitted when page size changes. Payload: new page size. */
248
- this.$emit('page-size-changed', option.value)
249
- }
250
- },
251
- },
252
- }
253
- </script>
1
+ <template>
2
+ <div v-if="totalPages > 1 || totalItems > minItemsToShow" class="cn-pagination">
3
+ <!-- Page info -->
4
+ <div class="cn-pagination__info">
5
+ <span class="cn-pagination__page-info">
6
+ {{ pageInfoText }}
7
+ </span>
8
+ </div>
9
+
10
+ <!-- Page navigation -->
11
+ <div v-if="totalPages > 1" class="cn-pagination__nav">
12
+ <NcButton
13
+ :disabled="currentPage === 1"
14
+ @click="changePage(1)">
15
+ {{ firstLabel }}
16
+ </NcButton>
17
+
18
+ <NcButton
19
+ :disabled="currentPage === 1"
20
+ @click="changePage(currentPage - 1)">
21
+ {{ previousLabel }}
22
+ </NcButton>
23
+
24
+ <div class="cn-pagination__numbers">
25
+ <template v-for="page in visiblePages">
26
+ <span v-if="page === '...'" :key="'ellipsis-' + page" class="cn-pagination__ellipsis">...</span>
27
+ <NcButton
28
+ v-else
29
+ :key="page"
30
+ :type="page === currentPage ? 'primary' : 'secondary'"
31
+ :disabled="page === currentPage"
32
+ @click="changePage(page)">
33
+ {{ page }}
34
+ </NcButton>
35
+ </template>
36
+ </div>
37
+
38
+ <NcButton
39
+ :disabled="currentPage === totalPages"
40
+ @click="changePage(currentPage + 1)">
41
+ {{ nextLabel }}
42
+ </NcButton>
43
+
44
+ <NcButton
45
+ :disabled="currentPage === totalPages"
46
+ @click="changePage(totalPages)">
47
+ {{ lastLabel }}
48
+ </NcButton>
49
+ </div>
50
+
51
+ <!-- Page size selector -->
52
+ <div class="cn-pagination__page-size">
53
+ <label :for="pageSizeId">{{ itemsPerPageLabel }}</label>
54
+ <NcSelect
55
+ :input-id="pageSizeId"
56
+ class="cn-pagination__page-size-select"
57
+ :value="currentPageSizeOption"
58
+ :options="pageSizeOptions"
59
+ :clearable="false"
60
+ :input-label="itemsPerPageLabel"
61
+ @option:selected="changePageSize" />
62
+ </div>
63
+ </div>
64
+ </template>
65
+
66
+ <script>
67
+ import { translate as t } from '@nextcloud/l10n'
68
+ import { NcButton, NcSelect } from '@nextcloud/vue'
69
+
70
+ /**
71
+ * CnPagination — Full pagination with page numbers, navigation, and page size selector.
72
+ *
73
+ * Extracted from OpenRegister's PaginationComponent. Zero store dependencies.
74
+ * Supports First/Previous/Next/Last buttons, smart page number display with
75
+ * ellipsis, and configurable page size.
76
+ *
77
+ * NL Design tokens used:
78
+ * - Inherits from cn-pagination CSS class (see css/pagination.css)
79
+ *
80
+ * @example
81
+ * <CnPagination
82
+ * :current-page="page"
83
+ * :total-pages="totalPages"
84
+ * :total-items="totalItems"
85
+ * :current-page-size="limit"
86
+ * @page-changed="onPageChange"
87
+ * @page-size-changed="onPageSizeChange" />
88
+ */
89
+ export default {
90
+ name: 'CnPagination',
91
+
92
+ components: {
93
+ NcButton,
94
+ NcSelect,
95
+ },
96
+
97
+ props: {
98
+ /** Current page number (1-based) */
99
+ currentPage: {
100
+ type: Number,
101
+ default: 1,
102
+ },
103
+ /** Total number of pages */
104
+ totalPages: {
105
+ type: Number,
106
+ default: 1,
107
+ },
108
+ /** Total number of items across all pages */
109
+ totalItems: {
110
+ type: Number,
111
+ default: 0,
112
+ },
113
+ /** Current items per page */
114
+ currentPageSize: {
115
+ type: Number,
116
+ default: 20,
117
+ },
118
+ /** Available page size options */
119
+ pageSizeOptions: {
120
+ type: Array,
121
+ default: () => [
122
+ { value: 10, label: '10' },
123
+ { value: 20, label: '20' },
124
+ { value: 50, label: '50' },
125
+ { value: 100, label: '100' },
126
+ { value: 250, label: '250' },
127
+ { value: 500, label: '500' },
128
+ { value: 1000, label: '1000' },
129
+ ],
130
+ },
131
+ /** Minimum items before pagination is shown */
132
+ minItemsToShow: {
133
+ type: Number,
134
+ default: 10,
135
+ },
136
+ /** Label for "First" button */
137
+ firstLabel: {
138
+ type: String,
139
+ default: () => t('nextcloud-vue', 'First'),
140
+ },
141
+ /** Label for "Previous" button */
142
+ previousLabel: {
143
+ type: String,
144
+ default: () => t('nextcloud-vue', 'Previous'),
145
+ },
146
+ /** Label for "Next" button */
147
+ nextLabel: {
148
+ type: String,
149
+ default: () => t('nextcloud-vue', 'Next'),
150
+ },
151
+ /** Label for "Last" button */
152
+ lastLabel: {
153
+ type: String,
154
+ default: () => t('nextcloud-vue', 'Last'),
155
+ },
156
+ /** Label for "Items per page:" */
157
+ itemsPerPageLabel: {
158
+ type: String,
159
+ default: () => t('nextcloud-vue', 'Items per page:'),
160
+ },
161
+ /**
162
+ * Page info format string. Use {current} and {total} as placeholders.
163
+ * @example "Page {current} of {total}"
164
+ */
165
+ pageInfoFormat: {
166
+ type: String,
167
+ default: () => t('nextcloud-vue', 'Page {current} of {total}'),
168
+ },
169
+ },
170
+
171
+ computed: {
172
+ pageSizeId() {
173
+ return 'cn-page-size-' + this._uid
174
+ },
175
+
176
+ currentPageSizeOption() {
177
+ return this.pageSizeOptions.find(
178
+ (option) => option.value === this.currentPageSize,
179
+ ) || this.pageSizeOptions[1]
180
+ },
181
+
182
+ pageInfoText() {
183
+ return this.pageInfoFormat
184
+ .replace('{current}', this.currentPage)
185
+ .replace('{total}', this.totalPages)
186
+ },
187
+
188
+ /**
189
+ * Calculate visible page numbers with ellipsis for large page counts.
190
+ * Shows up to 7 page numbers at a time.
191
+ */
192
+ visiblePages() {
193
+ const current = this.currentPage
194
+ const total = this.totalPages
195
+ const pages = []
196
+
197
+ if (total <= 7) {
198
+ for (let i = 1; i <= total; i++) {
199
+ pages.push(i)
200
+ }
201
+ } else {
202
+ pages.push(1)
203
+
204
+ if (current <= 4) {
205
+ for (let i = 2; i <= 5; i++) {
206
+ pages.push(i)
207
+ }
208
+ pages.push('...')
209
+ pages.push(total)
210
+ } else if (current >= total - 3) {
211
+ pages.push('...')
212
+ for (let i = total - 4; i <= total; i++) {
213
+ pages.push(i)
214
+ }
215
+ } else {
216
+ pages.push('...')
217
+ for (let i = current - 1; i <= current + 1; i++) {
218
+ pages.push(i)
219
+ }
220
+ pages.push('...')
221
+ pages.push(total)
222
+ }
223
+ }
224
+
225
+ return pages
226
+ },
227
+ },
228
+
229
+ methods: {
230
+ /**
231
+ * Navigate to a specific page.
232
+ * @param {number} page Target page number
233
+ */
234
+ changePage(page) {
235
+ if (page !== this.currentPage && page >= 1 && page <= this.totalPages) {
236
+ /** @event page-changed Emitted when page changes. Payload: new page number. */
237
+ this.$emit('page-changed', page)
238
+ }
239
+ },
240
+
241
+ /**
242
+ * Change the page size.
243
+ * @param {object} option Selected page size option { value, label }
244
+ */
245
+ changePageSize(option) {
246
+ if (option.value !== this.currentPageSize) {
247
+ /** @event page-size-changed Emitted when page size changes. Payload: new page size. */
248
+ this.$emit('page-size-changed', option.value)
249
+ }
250
+ },
251
+ },
252
+ }
253
+ </script>