@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,294 +1,294 @@
1
- <!--
2
- CnTimelineStages — Visualizes sequential progression through named stages.
3
-
4
- Used in case management, pipeline tracking, and any workflow with discrete
5
- phases. Supports horizontal/vertical orientation, small/medium sizes,
6
- clickable interaction, keyboard navigation (roving tabindex), and ARIA roles.
7
-
8
- All colors use Nextcloud CSS variables so NL Design System theming
9
- applies automatically.
10
- -->
11
- <template>
12
- <div
13
- v-if="stages.length > 0"
14
- :class="rootClasses"
15
- role="list"
16
- :aria-label="ariaLabel">
17
- <div
18
- v-for="(stage, index) in stages"
19
- :key="stage.id"
20
- ref="stageNodes"
21
- :class="stageClasses(index)"
22
- role="listitem"
23
- :aria-current="stageStates[index] === 'current' ? 'step' : undefined"
24
- :tabindex="clickable ? (focusedIndex === index ? 0 : -1) : undefined"
25
- @click="onStageClick(stage, index)"
26
- @keydown="onKeydown($event, stage, index)">
27
- <!-- Indicator -->
28
- <slot
29
- name="indicator"
30
- :stage="stage"
31
- :index="index"
32
- :state="stageStates[index]">
33
- <span class="cn-timeline-stages__indicator">
34
- <!-- Completed: checkmark SVG -->
35
- <svg
36
- v-if="stageStates[index] === 'completed'"
37
- aria-hidden="true"
38
- viewBox="0 0 24 24"
39
- class="cn-timeline-stages__checkmark">
40
- <path
41
- fill="currentColor"
42
- d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" />
43
- </svg>
44
- <!-- Current: filled dot -->
45
- <span
46
- v-else-if="stageStates[index] === 'current'"
47
- class="cn-timeline-stages__dot" />
48
- </span>
49
- </slot>
50
- <!-- Label + Subtitle -->
51
- <slot
52
- name="label"
53
- :stage="stage"
54
- :index="index"
55
- :state="stageStates[index]">
56
- <span class="cn-timeline-stages__label">
57
- {{ stage.label }}
58
- </span>
59
- <span
60
- v-if="stage.subtitle"
61
- class="cn-timeline-stages__subtitle">
62
- {{ stage.subtitle }}
63
- </span>
64
- </slot>
65
- </div>
66
- </div>
67
- </template>
68
-
69
- <script>
70
- import { translate as t } from '@nextcloud/l10n'
71
-
72
- /**
73
- * CnTimelineStages — Timeline/progress stages component.
74
- *
75
- * Renders a sequence of named stages with completed/current/upcoming states,
76
- * connected by a track line. Supports horizontal and vertical layout,
77
- * small and medium sizes, clickable stages, keyboard navigation, and ARIA roles.
78
- *
79
- * @example Basic horizontal timeline
80
- * <CnTimelineStages
81
- * :stages="[
82
- * { id: 'new', label: 'New' },
83
- * { id: 'review', label: 'Review', subtitle: 'Mar 15' },
84
- * { id: 'done', label: 'Done' },
85
- * ]"
86
- * currentStage="review" />
87
- *
88
- * @example Vertical clickable timeline
89
- * <CnTimelineStages
90
- * :stages="pipelineStages"
91
- * :currentStage="deal.stage"
92
- * orientation="vertical"
93
- * :clickable="true"
94
- * v-on:stage-click="onStageClick" />
95
- */
96
- export default {
97
- name: 'CnTimelineStages',
98
-
99
- props: {
100
- /**
101
- * Array of stage objects. Each must have `id` (unique) and `label` (display text).
102
- * Optional `subtitle` for secondary text below the label.
103
- * @type {{ id: string, label: string, subtitle?: string }[]}
104
- */
105
- stages: {
106
- type: Array,
107
- required: true,
108
- validator: (stages) => stages.every((s) => s.id !== undefined && s.label !== undefined),
109
- },
110
- /**
111
- * The `id` of the currently active stage. Stages before it are "completed",
112
- * stages after it are "upcoming". If null/undefined or not matching any id,
113
- * all stages are "upcoming".
114
- * @type {string|number|null}
115
- */
116
- currentStage: {
117
- type: [String, Number],
118
- default: null,
119
- },
120
- /**
121
- * Layout orientation: "horizontal" (left-to-right) or "vertical" (top-to-bottom).
122
- * @type {string}
123
- */
124
- orientation: {
125
- type: String,
126
- default: 'horizontal',
127
- validator: (v) => ['horizontal', 'vertical'].includes(v),
128
- },
129
- /**
130
- * Size variant: "medium" (32px indicators) or "small" (20px indicators).
131
- * @type {string}
132
- */
133
- size: {
134
- type: String,
135
- default: 'medium',
136
- validator: (v) => ['small', 'medium'].includes(v),
137
- },
138
- /**
139
- * Whether stages are clickable. When true, stages emit `stage-click`
140
- * on click/Enter/Space and support keyboard navigation with arrow keys.
141
- * @type {boolean}
142
- */
143
- clickable: {
144
- type: Boolean,
145
- default: false,
146
- },
147
- /**
148
- * Accessible label for the timeline container.
149
- * @type {string}
150
- */
151
- ariaLabel: {
152
- type: String,
153
- default: () => t('nextcloud-vue', 'Progress stages'),
154
- },
155
- },
156
-
157
- data() {
158
- return {
159
- /** @type {number} Index of the currently focused stage (roving tabindex) */
160
- focusedIndex: 0,
161
- }
162
- },
163
-
164
- computed: {
165
- /**
166
- * Root element CSS classes based on orientation and size props.
167
- * @return {object}
168
- */
169
- rootClasses() {
170
- return {
171
- 'cn-timeline-stages': true,
172
- 'cn-timeline-stages--horizontal': this.orientation === 'horizontal',
173
- 'cn-timeline-stages--vertical': this.orientation === 'vertical',
174
- 'cn-timeline-stages--small': this.size === 'small',
175
- 'cn-timeline-stages--clickable': this.clickable,
176
- }
177
- },
178
- /**
179
- * Index of the current stage in the stages array, or -1 if not found.
180
- * @return {number}
181
- */
182
- currentStageIndex() {
183
- if (this.currentStage == null) return -1
184
- return this.stages.findIndex((s) => s.id === this.currentStage)
185
- },
186
- /**
187
- * Pre-calculated states for all stages to avoid repeated stageState() calls in template.
188
- * @return {Array<'completed'|'current'|'upcoming'>}
189
- */
190
- stageStates() {
191
- return this.stages.map((stage, index) => this.stageState(index))
192
- },
193
- },
194
-
195
- mounted() {
196
- this.scrollCurrentIntoView()
197
- },
198
-
199
- methods: {
200
- /**
201
- * Derive the visual state of a stage by its index.
202
- * @param {number} index Stage index
203
- * @return {'completed'|'current'|'upcoming'}
204
- */
205
- stageState(index) {
206
- if (this.currentStageIndex === -1) return 'upcoming'
207
- if (index < this.currentStageIndex) return 'completed'
208
- if (index === this.currentStageIndex) return 'current'
209
- return 'upcoming'
210
- },
211
- /**
212
- * CSS classes for a stage node.
213
- * @param {number} index Stage index
214
- * @return {object}
215
- */
216
- stageClasses(index) {
217
- const state = this.stageState(index)
218
- return {
219
- 'cn-timeline-stages__stage': true,
220
- [`cn-timeline-stages__stage--${state}`]: true,
221
- }
222
- },
223
- /**
224
- * Handle click on a stage node.
225
- * @param {object} stage The stage object
226
- * @param {number} index The stage index
227
- */
228
- onStageClick(stage, index) {
229
- if (!this.clickable) return
230
- /**
231
- * Emitted when a clickable stage is activated (click, Enter, or Space).
232
- * @event stage-click
233
- * @type {{ stage: object, index: number }}
234
- */
235
- this.$emit('stage-click', { stage, index })
236
- },
237
- /**
238
- * Keyboard handler for arrow keys, Enter, and Space.
239
- * Implements roving tabindex pattern.
240
- * @param {KeyboardEvent} event The keyboard event
241
- * @param {object} stage The stage object
242
- * @param {number} index The stage index
243
- */
244
- onKeydown(event, stage, index) {
245
- if (!this.clickable) return
246
-
247
- const isHorizontal = this.orientation === 'horizontal'
248
- const nextKeys = isHorizontal ? ['ArrowRight'] : ['ArrowDown']
249
- const prevKeys = isHorizontal ? ['ArrowLeft'] : ['ArrowUp']
250
-
251
- if (nextKeys.includes(event.key)) {
252
- event.preventDefault()
253
- this.moveFocus(index + 1)
254
- } else if (prevKeys.includes(event.key)) {
255
- event.preventDefault()
256
- this.moveFocus(index - 1)
257
- } else if (event.key === 'Enter' || event.key === ' ') {
258
- event.preventDefault()
259
- this.$emit('stage-click', { stage, index })
260
- }
261
- },
262
- /**
263
- * Move focus to a new stage index (roving tabindex).
264
- * @param {number} newIndex Target index
265
- */
266
- moveFocus(newIndex) {
267
- if (newIndex < 0 || newIndex >= this.stages.length) return
268
- this.focusedIndex = newIndex
269
- this.$nextTick(() => {
270
- const nodes = this.$refs.stageNodes
271
- if (nodes && nodes[newIndex]) {
272
- nodes[newIndex].focus()
273
- }
274
- })
275
- },
276
- /**
277
- * Scroll the current stage into view on mount (horizontal overflow).
278
- */
279
- scrollCurrentIntoView() {
280
- if (this.orientation !== 'horizontal' || this.currentStageIndex === -1) return
281
- this.$nextTick(() => {
282
- const nodes = this.$refs.stageNodes
283
- if (nodes && nodes[this.currentStageIndex]) {
284
- nodes[this.currentStageIndex].scrollIntoView({
285
- behavior: 'smooth',
286
- block: 'nearest',
287
- inline: 'center',
288
- })
289
- }
290
- })
291
- },
292
- },
293
- }
294
- </script>
1
+ <!--
2
+ CnTimelineStages — Visualizes sequential progression through named stages.
3
+
4
+ Used in case management, pipeline tracking, and any workflow with discrete
5
+ phases. Supports horizontal/vertical orientation, small/medium sizes,
6
+ clickable interaction, keyboard navigation (roving tabindex), and ARIA roles.
7
+
8
+ All colors use Nextcloud CSS variables so NL Design System theming
9
+ applies automatically.
10
+ -->
11
+ <template>
12
+ <div
13
+ v-if="stages.length > 0"
14
+ :class="rootClasses"
15
+ role="list"
16
+ :aria-label="ariaLabel">
17
+ <div
18
+ v-for="(stage, index) in stages"
19
+ :key="stage.id"
20
+ ref="stageNodes"
21
+ :class="stageClasses(index)"
22
+ role="listitem"
23
+ :aria-current="stageStates[index] === 'current' ? 'step' : undefined"
24
+ :tabindex="clickable ? (focusedIndex === index ? 0 : -1) : undefined"
25
+ @click="onStageClick(stage, index)"
26
+ @keydown="onKeydown($event, stage, index)">
27
+ <!-- Indicator -->
28
+ <slot
29
+ name="indicator"
30
+ :stage="stage"
31
+ :index="index"
32
+ :state="stageStates[index]">
33
+ <span class="cn-timeline-stages__indicator">
34
+ <!-- Completed: checkmark SVG -->
35
+ <svg
36
+ v-if="stageStates[index] === 'completed'"
37
+ aria-hidden="true"
38
+ viewBox="0 0 24 24"
39
+ class="cn-timeline-stages__checkmark">
40
+ <path
41
+ fill="currentColor"
42
+ d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" />
43
+ </svg>
44
+ <!-- Current: filled dot -->
45
+ <span
46
+ v-else-if="stageStates[index] === 'current'"
47
+ class="cn-timeline-stages__dot" />
48
+ </span>
49
+ </slot>
50
+ <!-- Label + Subtitle -->
51
+ <slot
52
+ name="label"
53
+ :stage="stage"
54
+ :index="index"
55
+ :state="stageStates[index]">
56
+ <span class="cn-timeline-stages__label">
57
+ {{ stage.label }}
58
+ </span>
59
+ <span
60
+ v-if="stage.subtitle"
61
+ class="cn-timeline-stages__subtitle">
62
+ {{ stage.subtitle }}
63
+ </span>
64
+ </slot>
65
+ </div>
66
+ </div>
67
+ </template>
68
+
69
+ <script>
70
+ import { translate as t } from '@nextcloud/l10n'
71
+
72
+ /**
73
+ * CnTimelineStages — Timeline/progress stages component.
74
+ *
75
+ * Renders a sequence of named stages with completed/current/upcoming states,
76
+ * connected by a track line. Supports horizontal and vertical layout,
77
+ * small and medium sizes, clickable stages, keyboard navigation, and ARIA roles.
78
+ *
79
+ * @example Basic horizontal timeline
80
+ * <CnTimelineStages
81
+ * :stages="[
82
+ * { id: 'new', label: 'New' },
83
+ * { id: 'review', label: 'Review', subtitle: 'Mar 15' },
84
+ * { id: 'done', label: 'Done' },
85
+ * ]"
86
+ * currentStage="review" />
87
+ *
88
+ * @example Vertical clickable timeline
89
+ * <CnTimelineStages
90
+ * :stages="pipelineStages"
91
+ * :currentStage="deal.stage"
92
+ * orientation="vertical"
93
+ * :clickable="true"
94
+ * v-on:stage-click="onStageClick" />
95
+ */
96
+ export default {
97
+ name: 'CnTimelineStages',
98
+
99
+ props: {
100
+ /**
101
+ * Array of stage objects. Each must have `id` (unique) and `label` (display text).
102
+ * Optional `subtitle` for secondary text below the label.
103
+ * @type {{ id: string, label: string, subtitle?: string }[]}
104
+ */
105
+ stages: {
106
+ type: Array,
107
+ required: true,
108
+ validator: (stages) => stages.every((s) => s.id !== undefined && s.label !== undefined),
109
+ },
110
+ /**
111
+ * The `id` of the currently active stage. Stages before it are "completed",
112
+ * stages after it are "upcoming". If null/undefined or not matching any id,
113
+ * all stages are "upcoming".
114
+ * @type {string|number|null}
115
+ */
116
+ currentStage: {
117
+ type: [String, Number],
118
+ default: null,
119
+ },
120
+ /**
121
+ * Layout orientation: "horizontal" (left-to-right) or "vertical" (top-to-bottom).
122
+ * @type {string}
123
+ */
124
+ orientation: {
125
+ type: String,
126
+ default: 'horizontal',
127
+ validator: (v) => ['horizontal', 'vertical'].includes(v),
128
+ },
129
+ /**
130
+ * Size variant: "medium" (32px indicators) or "small" (20px indicators).
131
+ * @type {string}
132
+ */
133
+ size: {
134
+ type: String,
135
+ default: 'medium',
136
+ validator: (v) => ['small', 'medium'].includes(v),
137
+ },
138
+ /**
139
+ * Whether stages are clickable. When true, stages emit `stage-click`
140
+ * on click/Enter/Space and support keyboard navigation with arrow keys.
141
+ * @type {boolean}
142
+ */
143
+ clickable: {
144
+ type: Boolean,
145
+ default: false,
146
+ },
147
+ /**
148
+ * Accessible label for the timeline container.
149
+ * @type {string}
150
+ */
151
+ ariaLabel: {
152
+ type: String,
153
+ default: () => t('nextcloud-vue', 'Progress stages'),
154
+ },
155
+ },
156
+
157
+ data() {
158
+ return {
159
+ /** @type {number} Index of the currently focused stage (roving tabindex) */
160
+ focusedIndex: 0,
161
+ }
162
+ },
163
+
164
+ computed: {
165
+ /**
166
+ * Root element CSS classes based on orientation and size props.
167
+ * @return {object}
168
+ */
169
+ rootClasses() {
170
+ return {
171
+ 'cn-timeline-stages': true,
172
+ 'cn-timeline-stages--horizontal': this.orientation === 'horizontal',
173
+ 'cn-timeline-stages--vertical': this.orientation === 'vertical',
174
+ 'cn-timeline-stages--small': this.size === 'small',
175
+ 'cn-timeline-stages--clickable': this.clickable,
176
+ }
177
+ },
178
+ /**
179
+ * Index of the current stage in the stages array, or -1 if not found.
180
+ * @return {number}
181
+ */
182
+ currentStageIndex() {
183
+ if (this.currentStage == null) return -1
184
+ return this.stages.findIndex((s) => s.id === this.currentStage)
185
+ },
186
+ /**
187
+ * Pre-calculated states for all stages to avoid repeated stageState() calls in template.
188
+ * @return {Array<'completed'|'current'|'upcoming'>}
189
+ */
190
+ stageStates() {
191
+ return this.stages.map((stage, index) => this.stageState(index))
192
+ },
193
+ },
194
+
195
+ mounted() {
196
+ this.scrollCurrentIntoView()
197
+ },
198
+
199
+ methods: {
200
+ /**
201
+ * Derive the visual state of a stage by its index.
202
+ * @param {number} index Stage index
203
+ * @return {'completed'|'current'|'upcoming'}
204
+ */
205
+ stageState(index) {
206
+ if (this.currentStageIndex === -1) return 'upcoming'
207
+ if (index < this.currentStageIndex) return 'completed'
208
+ if (index === this.currentStageIndex) return 'current'
209
+ return 'upcoming'
210
+ },
211
+ /**
212
+ * CSS classes for a stage node.
213
+ * @param {number} index Stage index
214
+ * @return {object}
215
+ */
216
+ stageClasses(index) {
217
+ const state = this.stageState(index)
218
+ return {
219
+ 'cn-timeline-stages__stage': true,
220
+ [`cn-timeline-stages__stage--${state}`]: true,
221
+ }
222
+ },
223
+ /**
224
+ * Handle click on a stage node.
225
+ * @param {object} stage The stage object
226
+ * @param {number} index The stage index
227
+ */
228
+ onStageClick(stage, index) {
229
+ if (!this.clickable) return
230
+ /**
231
+ * Emitted when a clickable stage is activated (click, Enter, or Space).
232
+ * @event stage-click
233
+ * @type {{ stage: object, index: number }}
234
+ */
235
+ this.$emit('stage-click', { stage, index })
236
+ },
237
+ /**
238
+ * Keyboard handler for arrow keys, Enter, and Space.
239
+ * Implements roving tabindex pattern.
240
+ * @param {KeyboardEvent} event The keyboard event
241
+ * @param {object} stage The stage object
242
+ * @param {number} index The stage index
243
+ */
244
+ onKeydown(event, stage, index) {
245
+ if (!this.clickable) return
246
+
247
+ const isHorizontal = this.orientation === 'horizontal'
248
+ const nextKeys = isHorizontal ? ['ArrowRight'] : ['ArrowDown']
249
+ const prevKeys = isHorizontal ? ['ArrowLeft'] : ['ArrowUp']
250
+
251
+ if (nextKeys.includes(event.key)) {
252
+ event.preventDefault()
253
+ this.moveFocus(index + 1)
254
+ } else if (prevKeys.includes(event.key)) {
255
+ event.preventDefault()
256
+ this.moveFocus(index - 1)
257
+ } else if (event.key === 'Enter' || event.key === ' ') {
258
+ event.preventDefault()
259
+ this.$emit('stage-click', { stage, index })
260
+ }
261
+ },
262
+ /**
263
+ * Move focus to a new stage index (roving tabindex).
264
+ * @param {number} newIndex Target index
265
+ */
266
+ moveFocus(newIndex) {
267
+ if (newIndex < 0 || newIndex >= this.stages.length) return
268
+ this.focusedIndex = newIndex
269
+ this.$nextTick(() => {
270
+ const nodes = this.$refs.stageNodes
271
+ if (nodes && nodes[newIndex]) {
272
+ nodes[newIndex].focus()
273
+ }
274
+ })
275
+ },
276
+ /**
277
+ * Scroll the current stage into view on mount (horizontal overflow).
278
+ */
279
+ scrollCurrentIntoView() {
280
+ if (this.orientation !== 'horizontal' || this.currentStageIndex === -1) return
281
+ this.$nextTick(() => {
282
+ const nodes = this.$refs.stageNodes
283
+ if (nodes && nodes[this.currentStageIndex]) {
284
+ nodes[this.currentStageIndex].scrollIntoView({
285
+ behavior: 'smooth',
286
+ block: 'nearest',
287
+ inline: 'center',
288
+ })
289
+ }
290
+ })
291
+ },
292
+ },
293
+ }
294
+ </script>