@mozaic-ds/vue 2.17.0 → 2.18.0
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/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +133 -55
- package/dist/mozaic-vue.js +1533 -4663
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +6 -25
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +14 -8
- package/src/components/Migration.mdx +651 -0
- package/src/components/accordionlistitem/MAccordionListItem.spec.ts +22 -3
- package/src/components/accordionlistitem/MAccordionListItem.vue +38 -28
- package/src/components/builtinmenu/MBuiltInMenu.spec.ts +30 -1
- package/src/components/builtinmenu/MBuiltInMenu.vue +26 -17
- package/src/components/builtinmenu/README.md +2 -0
- package/src/components/callout/MCallout.spec.ts +35 -0
- package/src/components/callout/MCallout.vue +22 -4
- package/src/components/callout/README.md +2 -0
- package/src/components/checklistmenu/MCheckListMenu.spec.ts +12 -1
- package/src/components/checklistmenu/MCheckListMenu.vue +6 -0
- package/src/components/checklistmenu/README.md +2 -0
- package/src/components/datatable/datatable.mdx +3 -2
- package/src/components/navigationindicator/MNavigationIndicator.spec.ts +75 -18
- package/src/components/navigationindicator/MNavigationIndicator.vue +10 -12
- package/src/components/optionListbox/MOptionListbox.vue +16 -1
- package/src/components/popover/MPopover.spec.ts +126 -0
- package/src/components/popover/MPopover.vue +36 -1
- package/src/components/segmentedcontrol/MSegmentedControl.spec.ts +92 -0
- package/src/components/segmentedcontrol/MSegmentedControl.vue +61 -2
- package/src/components/starrating/MStarRating.spec.ts +19 -22
- package/src/components/starrating/MStarRating.vue +3 -2
- package/src/components/tabs/MTabs.vue +90 -4
- package/src/components/tabs/Mtabs.spec.ts +162 -0
- package/src/main.ts +1 -0
- package/src/components/ComponentsMapping.mdx +0 -98
|
@@ -161,6 +161,168 @@ describe('MTabs.vue', () => {
|
|
|
161
161
|
expect(wrapper.emitted('update:modelValue')!.length).toBe(1);
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
+
it('selected tab has tabindex="0", others have tabindex="-1"', () => {
|
|
165
|
+
const wrapper = mount(MTabs, {
|
|
166
|
+
props: { tabs, modelValue: '2' },
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
170
|
+
expect(buttons[0].attributes('tabindex')).toBe('-1');
|
|
171
|
+
expect(buttons[1].attributes('tabindex')).toBe('0');
|
|
172
|
+
expect(buttons[2].attributes('tabindex')).toBe('-1');
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('falls back to first enabled tab for tabindex when selected tab is disabled', () => {
|
|
176
|
+
const wrapper = mount(MTabs, {
|
|
177
|
+
props: {
|
|
178
|
+
tabs: [
|
|
179
|
+
{ id: '1', label: 'Tab 1', disabled: true },
|
|
180
|
+
{ id: '2', label: 'Tab 2' },
|
|
181
|
+
{ id: '3', label: 'Tab 3' },
|
|
182
|
+
],
|
|
183
|
+
modelValue: '1',
|
|
184
|
+
},
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
188
|
+
expect(buttons[0].attributes('tabindex')).toBe('-1');
|
|
189
|
+
expect(buttons[1].attributes('tabindex')).toBe('0');
|
|
190
|
+
expect(buttons[2].attributes('tabindex')).toBe('-1');
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('falls back to first enabled tab for tabindex when modelValue is invalid', () => {
|
|
194
|
+
const wrapper = mount(MTabs, {
|
|
195
|
+
props: {
|
|
196
|
+
tabs,
|
|
197
|
+
modelValue: 'unknown-id',
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
202
|
+
expect(buttons[0].attributes('tabindex')).toBe('0');
|
|
203
|
+
expect(buttons[1].attributes('tabindex')).toBe('-1');
|
|
204
|
+
expect(buttons[2].attributes('tabindex')).toBe('-1');
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('sets disabled and aria-disabled attributes on disabled tabs', () => {
|
|
208
|
+
const wrapper = mount(MTabs, {
|
|
209
|
+
props: {
|
|
210
|
+
tabs: [
|
|
211
|
+
{ id: '1', label: 'Tab 1' },
|
|
212
|
+
{ id: '2', label: 'Tab 2', disabled: true },
|
|
213
|
+
],
|
|
214
|
+
modelValue: '1',
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
219
|
+
expect(buttons[0].attributes('aria-disabled')).toBeUndefined();
|
|
220
|
+
expect(buttons[1].attributes('aria-disabled')).toBe('true');
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it('ArrowRight moves selection to the next tab', async () => {
|
|
224
|
+
const wrapper = mount(MTabs, {
|
|
225
|
+
props: { tabs, modelValue: '1' },
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
229
|
+
await buttons[0].trigger('keydown', { key: 'ArrowRight' });
|
|
230
|
+
|
|
231
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['2']);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('ArrowLeft moves selection to the previous tab', async () => {
|
|
235
|
+
const wrapper = mount(MTabs, {
|
|
236
|
+
props: { tabs, modelValue: '2' },
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
240
|
+
await buttons[1].trigger('keydown', { key: 'ArrowLeft' });
|
|
241
|
+
|
|
242
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['1']);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('ArrowRight wraps from last to first tab', async () => {
|
|
246
|
+
const wrapper = mount(MTabs, {
|
|
247
|
+
props: { tabs, modelValue: '3' },
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
251
|
+
await buttons[2].trigger('keydown', { key: 'ArrowRight' });
|
|
252
|
+
|
|
253
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['1']);
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
it('Home moves selection to the first tab', async () => {
|
|
257
|
+
const wrapper = mount(MTabs, {
|
|
258
|
+
props: { tabs, modelValue: '3' },
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
262
|
+
await buttons[2].trigger('keydown', { key: 'Home' });
|
|
263
|
+
|
|
264
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['1']);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('End moves selection to the last tab', async () => {
|
|
268
|
+
const wrapper = mount(MTabs, {
|
|
269
|
+
props: { tabs, modelValue: '1' },
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
273
|
+
await buttons[0].trigger('keydown', { key: 'End' });
|
|
274
|
+
|
|
275
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['3']);
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it('does not react to ArrowUp and ArrowDown keys', async () => {
|
|
279
|
+
const wrapper = mount(MTabs, {
|
|
280
|
+
props: { tabs, modelValue: '1' },
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
284
|
+
await buttons[0].trigger('keydown', { key: 'ArrowDown' });
|
|
285
|
+
await buttons[0].trigger('keydown', { key: 'ArrowUp' });
|
|
286
|
+
|
|
287
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
it('ArrowRight skips disabled tabs', async () => {
|
|
291
|
+
const wrapper = mount(MTabs, {
|
|
292
|
+
props: {
|
|
293
|
+
tabs: [
|
|
294
|
+
{ id: '1', label: 'Tab 1' },
|
|
295
|
+
{ id: '2', label: 'Tab 2', disabled: true },
|
|
296
|
+
{ id: '3', label: 'Tab 3' },
|
|
297
|
+
],
|
|
298
|
+
modelValue: '1',
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
303
|
+
await buttons[0].trigger('keydown', { key: 'ArrowRight' });
|
|
304
|
+
|
|
305
|
+
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['3']);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
it('does not emit on keydown when all tabs are disabled', async () => {
|
|
309
|
+
const wrapper = mount(MTabs, {
|
|
310
|
+
props: {
|
|
311
|
+
tabs: [
|
|
312
|
+
{ id: '1', label: 'Tab 1', disabled: true },
|
|
313
|
+
{ id: '2', label: 'Tab 2', disabled: true },
|
|
314
|
+
],
|
|
315
|
+
modelValue: '1',
|
|
316
|
+
},
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
const buttons = wrapper.findAll('button.mc-tabs__tab');
|
|
320
|
+
await buttons[0].trigger('keydown', { key: 'ArrowRight' });
|
|
321
|
+
await buttons[0].trigger('keydown', { key: 'Home' });
|
|
322
|
+
|
|
323
|
+
expect(wrapper.emitted('update:modelValue')).toBeUndefined();
|
|
324
|
+
});
|
|
325
|
+
|
|
164
326
|
it('renders icon component when icon prop is provided', () => {
|
|
165
327
|
const DummyIcon = markRaw(
|
|
166
328
|
defineComponent({
|
package/src/main.ts
CHANGED
|
@@ -59,6 +59,7 @@ export { default as MStatusNotification } from './components/statusnotification/
|
|
|
59
59
|
export { default as MStepperBottomBar } from './components/stepperbottombar/MStepperBottomBar.vue';
|
|
60
60
|
export { default as MStepperCompact } from './components/steppercompact/MStepperCompact.vue';
|
|
61
61
|
export { default as MStepperInline } from './components/stepperinline/MStepperInline.vue';
|
|
62
|
+
export { default as MStepperStacked } from './components/stepperstacked/MStepperStacked.vue';
|
|
62
63
|
export { default as MTabs } from './components/tabs/MTabs.vue';
|
|
63
64
|
export { default as MTag } from './components/tag/MTag.vue';
|
|
64
65
|
export { default as MTextArea } from './components/textarea/MTextArea.vue';
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Meta } from '@storybook/addon-docs/blocks';
|
|
2
|
-
|
|
3
|
-
<Meta title="Components v1 → v2" />
|
|
4
|
-
|
|
5
|
-
# Components mapping v1 → v2
|
|
6
|
-
|
|
7
|
-
## Introduction
|
|
8
|
-
|
|
9
|
-
This document summarizes all component changes between the ADS Vue V1 and V2 design system libraries — including renames, splits, merges, removals, and new additions.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
### Mapping Table
|
|
13
|
-
|
|
14
|
-
<table>
|
|
15
|
-
<thead>
|
|
16
|
-
<tr>
|
|
17
|
-
<th>V1 Component</th>
|
|
18
|
-
<th>V2 Component</th>
|
|
19
|
-
<th>Status</th>
|
|
20
|
-
</tr>
|
|
21
|
-
</thead>
|
|
22
|
-
<tbody>
|
|
23
|
-
<tr><td><code>MAccordion</code></td><td><code>MAccordionList</code> + <code>MAccordionListItem</code></td><td>🔀 Split</td></tr>
|
|
24
|
-
<tr><td><code>MActionBar</code> + <code>MBottomBar</code></td><td><code>MActionBottomBar</code></td><td>🔗 Merged</td></tr>
|
|
25
|
-
<tr><td><code>MListBoxActions</code></td><td><code>MActionListBox</code></td><td>🔄 Renamed</td></tr>
|
|
26
|
-
<tr><td>—</td><td><code>MAvatar</code></td><td>✨ New</td></tr>
|
|
27
|
-
<tr><td><code>MBreadcrumb</code></td><td><code>MBreadcrumb</code></td><td>✅ Same name</td></tr>
|
|
28
|
-
<tr><td><code>MMenu</code></td><td><code>MBuiltInMenu</code></td><td>🔄 Renamed</td></tr>
|
|
29
|
-
<tr><td><code>MButton</code></td><td><code>MButton</code></td><td>✅ Same name</td></tr>
|
|
30
|
-
<tr><td>—</td><td><code>MCallout</code></td><td>✨ New</td></tr>
|
|
31
|
-
<tr><td>—</td><td><code>MCarousel</code></td><td>✨ New</td></tr>
|
|
32
|
-
<tr><td><code>MCheckbox</code></td><td><code>MCheckbox</code></td><td>✅ Same name</td></tr>
|
|
33
|
-
<tr><td><code>MCheckboxGroup</code></td><td><code>MCheckboxGroup</code></td><td>✅ Same name</td></tr>
|
|
34
|
-
<tr><td>—</td><td><code>MChecklistMenu</code></td><td>✨ New</td></tr>
|
|
35
|
-
<tr><td>—</td><td><code>MCircularProgressBar</code></td><td>✨ New</td></tr>
|
|
36
|
-
<tr><td><code>MAutocomplete</code> + <code>MDropdown</code></td><td><code>MCombobox</code></td><td>🔗 Merged</td></tr>
|
|
37
|
-
<tr><td><code>MContainer</code></td><td><code>MContainer</code></td><td>✅ Same name</td></tr>
|
|
38
|
-
<tr><td>—</td><td><code>MDatePicker</code></td><td>✨ New</td></tr>
|
|
39
|
-
<tr><td>—</td><td><code>MDivider</code></td><td>✨ New</td></tr>
|
|
40
|
-
<tr><td><code>MLayer</code></td><td><code>MDrawer</code></td><td>🔄 Renamed</td></tr>
|
|
41
|
-
<tr><td><code>MField</code></td><td><code>MField</code></td><td>✅ Same name</td></tr>
|
|
42
|
-
<tr><td>—</td><td><code>MFieldGroup</code></td><td>✨ New</td></tr>
|
|
43
|
-
<tr><td><code>MFileUploader</code></td><td><code>MFileUploader</code></td><td>✅ Same name</td></tr>
|
|
44
|
-
<tr><td>—</td><td><code>MFileUploaderItem</code></td><td>✨ New</td></tr>
|
|
45
|
-
<tr><td><code>MFlag</code></td><td><code>MFlag</code></td><td>✅ Same name</td></tr>
|
|
46
|
-
<tr><td><code>MIcon</code></td><td><em>removed</em></td><td>🗑️ Removed</td></tr>
|
|
47
|
-
<tr><td>—</td><td><code>MIconButton</code></td><td>✨ New</td></tr>
|
|
48
|
-
<tr><td>—</td><td><code>MKpiItem</code></td><td>✨ New</td></tr>
|
|
49
|
-
<tr><td><code>MProgress</code></td><td><code>MLinearProgressBarBuffer</code> + <code>MLinearProgressBarPercentage</code></td><td>🔀 Split</td></tr>
|
|
50
|
-
<tr><td><code>MLink</code></td><td><code>MLink</code></td><td>✅ Same name</td></tr>
|
|
51
|
-
<tr><td><code>MLoader</code></td><td><code>MLoader</code></td><td>✅ Same name</td></tr>
|
|
52
|
-
<tr><td>—</td><td><code>MLoadingOverlay</code></td><td>✨ New</td></tr>
|
|
53
|
-
<tr><td><code>MModal</code></td><td><code>MModal</code></td><td>✅ Same name</td></tr>
|
|
54
|
-
<tr><td>—</td><td><code>MNavigationIndicator</code></td><td>✨ New</td></tr>
|
|
55
|
-
<tr><td><code>MNotification</code></td><td><code>MStatusNotification</code></td><td>🔄 Renamed</td></tr>
|
|
56
|
-
<tr><td>—</td><td><code>MNumberBadge</code></td><td>✨ New</td></tr>
|
|
57
|
-
<tr><td><code>MListbox</code></td><td><code>MOptionListBox</code></td><td>🔄 Renamed</td></tr>
|
|
58
|
-
<tr><td><code>MOverlay</code></td><td><code>MOverlay</code></td><td>✅ Same name</td></tr>
|
|
59
|
-
<tr><td>—</td><td><code>MPageHeader</code></td><td>✨ New</td></tr>
|
|
60
|
-
<tr><td><code>MPagination</code></td><td><code>MPagination</code></td><td>✅ Same name</td></tr>
|
|
61
|
-
<tr><td><code>MPasswordInput</code></td><td><code>MPasswordInput</code></td><td>✅ Same name</td></tr>
|
|
62
|
-
<tr><td><code>MPhoneNumber</code></td><td><code>MPhoneNumber</code></td><td>✅ Same name</td></tr>
|
|
63
|
-
<tr><td>—</td><td><code>MPinCode</code></td><td>✨ New</td></tr>
|
|
64
|
-
<tr><td>—</td><td><code>MPopover</code></td><td>✨ New</td></tr>
|
|
65
|
-
<tr><td><code>MQuantitySelector</code></td><td><code>MQuantitySelector</code></td><td>✅ Same name</td></tr>
|
|
66
|
-
<tr><td><code>MRadio</code></td><td><code>MRadio</code></td><td>✅ Same name</td></tr>
|
|
67
|
-
<tr><td><code>MRadioGroup</code></td><td><code>MRadioGroup</code></td><td>✅ Same name</td></tr>
|
|
68
|
-
<tr><td><code>MSegmentedControl</code></td><td><code>MSegmentedControl</code></td><td>✅ Same name</td></tr>
|
|
69
|
-
<tr><td><code>MSelect</code></td><td><code>MSelect</code></td><td>✅ Same name</td></tr>
|
|
70
|
-
<tr><td><code>MSidebar</code></td><td><code>MSidebar</code> + 6 sub-components</td><td>🔀 Split</td></tr>
|
|
71
|
-
<tr><td>—</td><td><code>MSidebarExpandableItem</code></td><td>✨ New</td></tr>
|
|
72
|
-
<tr><td>—</td><td><code>MSidebarFooter</code></td><td>✨ New</td></tr>
|
|
73
|
-
<tr><td>—</td><td><code>MSidebarHeader</code></td><td>✨ New</td></tr>
|
|
74
|
-
<tr><td>—</td><td><code>MSidebarNavItem</code></td><td>✨ New</td></tr>
|
|
75
|
-
<tr><td>—</td><td><code>MSidebarShortcutItem</code></td><td>✨ New</td></tr>
|
|
76
|
-
<tr><td>—</td><td><code>MSidebarShortcuts</code></td><td>✨ New</td></tr>
|
|
77
|
-
<tr><td>—</td><td><code>MStarRating</code></td><td>✨ New</td></tr>
|
|
78
|
-
<tr><td><code>MBadge</code></td><td><code>MStatusBadge</code></td><td>🔄 Renamed</td></tr>
|
|
79
|
-
<tr><td>—</td><td><code>MStatusDot</code></td><td>✨ New</td></tr>
|
|
80
|
-
<tr><td>—</td><td><code>MStatusMessage</code></td><td>✨ New</td></tr>
|
|
81
|
-
<tr><td><code>MStepper</code> (<code>compact: false</code>)</td><td><code>MStepperInline</code></td><td>🔄 Renamed</td></tr>
|
|
82
|
-
<tr><td><code>MStepper</code> (<code>compact: true</code>)</td><td><code>MStepperCompact</code></td><td>🔄 Renamed</td></tr>
|
|
83
|
-
<tr><td>—</td><td><code>MStepperBottomBar</code></td><td>✨ New</td></tr>
|
|
84
|
-
<tr><td>—</td><td><code>MStepperStacked</code></td><td>✨ New</td></tr>
|
|
85
|
-
<tr><td><code>MTab</code> / <code>MTabsV2</code></td><td><code>MTabs</code></td><td>🔄 Renamed</td></tr>
|
|
86
|
-
<tr><td><code>MTag</code></td><td><code>MTag</code></td><td>✅ Same name</td></tr>
|
|
87
|
-
<tr><td><code>MTextArea</code></td><td><code>MTextArea</code></td><td>✅ Same name</td></tr>
|
|
88
|
-
<tr><td><code>MTextInput</code></td><td><code>MTextInput</code></td><td>✅ Same name</td></tr>
|
|
89
|
-
<tr><td>—</td><td><code>MTile</code></td><td>✨ New</td></tr>
|
|
90
|
-
<tr><td>—</td><td><code>MTileClickable</code></td><td>✨ New</td></tr>
|
|
91
|
-
<tr><td>—</td><td><code>MTileExpandable</code></td><td>✨ New</td></tr>
|
|
92
|
-
<tr><td><code>MOptionCard</code></td><td><code>MTileSelectable</code></td><td>🔄 Renamed</td></tr>
|
|
93
|
-
<tr><td>—</td><td><code>MToaster</code></td><td>✨ New</td></tr>
|
|
94
|
-
<tr><td><code>MToggle</code></td><td><code>MToggle</code></td><td>✅ Same name</td></tr>
|
|
95
|
-
<tr><td>—</td><td><code>MToggleGroup</code></td><td>✨ New</td></tr>
|
|
96
|
-
<tr><td>—</td><td><code>MTooltip</code></td><td>✨ New</td></tr>
|
|
97
|
-
</tbody>
|
|
98
|
-
</table>
|