fds-vue-core 4.5.1 → 4.5.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 CHANGED
@@ -85,6 +85,45 @@ After registration, you can use components directly in your templates:
85
85
  </template>
86
86
  ```
87
87
 
88
+ ### FdsWizard (Route-Based)
89
+
90
+ `FdsWizard` is a route-based step component. It only renders the step indicator and emits navigation; **all data lives in the consumer**. Listen to `@go`, call `router.push({ name: payload.route.routeName, params, query })`, and pass the current route name via `activeRouteName` (or rely on vue-router so the component reads `currentRoute.name`).
91
+
92
+ ```vue
93
+ <script setup lang="ts">
94
+ import { ref } from 'vue'
95
+
96
+ const activeRouteName = ref('wizard-start')
97
+
98
+ const wizardRoutes = [
99
+ { id: 'start', name: 'Start', routeName: 'wizard-start' },
100
+ { id: 'details', name: 'Details', routeName: 'wizard-details' },
101
+ { id: 'review', name: 'Review', routeName: 'wizard-review' },
102
+ ]
103
+
104
+ const handleGo = (payload: { route: { routeName: string } }) => {
105
+ activeRouteName.value = payload.route.routeName
106
+ }
107
+ </script>
108
+
109
+ <template>
110
+ <FdsWizard
111
+ :routes="wizardRoutes"
112
+ :activeRouteName="activeRouteName"
113
+ :completedTo="0"
114
+ @go="handleGo"
115
+ >
116
+ <template #default="{ currentRoute, currentStepIndex, nextStep, previousStep }">
117
+ <p>Current step: {{ currentRoute?.name }}</p>
118
+ <button @click="previousStep">Previous</button>
119
+ <button @click="nextStep">Next</button>
120
+ </template>
121
+ </FdsWizard>
122
+ </template>
123
+ ```
124
+
125
+ `routes` items: `id`, `name`, `routeName` (required); `to`, `params`, `query` (optional, for your router); `disabled` (optional).
126
+
88
127
  ### Individual Component Import
89
128
 
90
129
  You can also import specific components:
package/components.d.ts CHANGED
@@ -22,6 +22,7 @@ import type { FdsSpinnerProps } from './src/components/FdsSpinner/types'
22
22
  import type { FdsStickerProps } from './src/components/FdsSticker/types'
23
23
  import type { WrapperProps } from './src/components/FdsTreeView/types'
24
24
  import type { FdsTruncatedTextProps } from './src/components/FdsTruncatedText/types'
25
+ import type { FdsWizardProps } from './src/components/FdsWizard/types'
25
26
  import type { FdsCheckboxProps } from './src/components/Form/FdsCheckbox/types'
26
27
  import type { FdsInputProps } from './src/components/Form/FdsInput/types'
27
28
  import type { FdsRadioProps } from './src/components/Form/FdsRadio/types'
@@ -72,6 +73,7 @@ declare module '@vue/runtime-core' {
72
73
  FdsPagination: DefineComponent<FdsPaginationProps>
73
74
  FdsSearchSelect: DefineComponent<FdsSearchSelectProps>
74
75
  FdsTruncatedText: DefineComponent<FdsTruncatedTextProps>
76
+ FdsWizard: DefineComponent<FdsWizardProps>
75
77
  FdsH1: DefineComponent<FdsH1Props>
76
78
  FdsH2: DefineComponent<FdsH2Props>
77
79
  FdsH3: DefineComponent<FdsH3Props>