@mozaic-ds/vue 2.18.0 → 2.19.1
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 +961 -2085
- package/dist/mozaic-vue.js +1253 -1143
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +6 -6
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +8 -6
- package/src/components/BrandPresets.mdx +20 -2
- package/src/components/accordionlist/MAccordionList.figma.ts +16 -16
- package/src/components/accordionlist/MAccordionList.stories.ts +1 -1
- package/src/components/accordionlistitem/MAccordionListItem.figma.ts +9 -5
- package/src/components/accordionlistitem/MAccordionListItem.vue +4 -1
- package/src/components/accordionlistitem/README.md +2 -0
- package/src/components/actionbottombar/MActionBottomBar.figma.ts +7 -7
- package/src/components/actionlistbox/MActionListbox.figma.ts +11 -11
- package/src/components/actionlistbox/MActionListbox.spec.ts +113 -0
- package/src/components/actionlistbox/MActionListbox.vue +63 -5
- package/src/components/avatar/MAvatar.figma.ts +5 -5
- package/src/components/breadcrumb/MBreadcrumb.figma.ts +7 -7
- package/src/components/breadcrumb/MBreadcrumb.vue +1 -1
- package/src/components/builtinmenu/MBuiltInMenu.figma.ts +8 -5
- package/src/components/builtinmenu/MBuiltInMenu.spec.ts +3 -1
- package/src/components/button/MButton.figma.ts +21 -6
- package/src/components/button/MButton.spec.ts +26 -0
- package/src/components/button/MButton.vue +2 -0
- package/src/components/callout/MCallout.figma.ts +7 -7
- package/src/components/callout/MCallout.stories.ts +0 -3
- package/src/components/callout/MCallout.vue +4 -3
- package/src/components/callout/README.md +2 -2
- package/src/components/carousel/MCarousel.figma.ts +10 -10
- package/src/components/carousel/MCarousel.spec.ts +26 -2
- package/src/components/carousel/MCarousel.vue +10 -4
- package/src/components/checkbox/MCheckbox.figma.ts +10 -10
- package/src/components/checkboxgroup/MCheckboxGroup.figma.ts +7 -7
- package/src/components/checklistmenu/MCheckListMenu.figma.ts +8 -8
- package/src/components/circularprogressbar/MCircularProgressbar.figma.ts +7 -3
- package/src/components/combobox/MCombobox.figma.ts +10 -10
- package/src/components/combobox/MCombobox.vue +7 -0
- package/src/components/container/MContainer.figma.ts +5 -5
- package/src/components/datatable/DataTable.stories.ts +33 -7
- package/src/components/datatable/DataTableCells.stories.ts +2 -2
- package/src/components/datatable/DataTableEmpty.stories.ts +2 -2
- package/src/components/datatable/DataTableExpandable.stories.ts +2 -2
- package/src/components/datatable/DataTableNested.stories.ts +1 -1
- package/src/components/datatable/DataTableSelectable.stories.ts +2 -3
- package/src/components/datatable/DataTableSortable.stories.ts +1 -1
- package/src/components/datepicker/MDatepicker.figma.ts +3 -3
- package/src/components/divider/MDivider.figma.ts +3 -3
- package/src/components/drawer/MDrawer.figma.ts +13 -13
- package/src/components/drawer/MDrawer.spec.ts +102 -3
- package/src/components/drawer/MDrawer.vue +73 -14
- package/src/components/field/MField.figma.ts +9 -5
- package/src/components/field/MField.vue +1 -0
- package/src/components/fileuploader/MFileUploader.figma.ts +3 -3
- package/src/components/fileuploader/MFileUploader.vue +2 -2
- package/src/components/fileuploaderitem/MFileUploaderItem.figma.ts +7 -3
- package/src/components/fileuploaderitem/MFileUploaderItem.vue +2 -7
- package/src/components/flag/MFlag.figma.ts +3 -3
- package/src/components/iconbutton/MIconButton.figma.ts +16 -16
- package/src/components/iconbutton/MIconButton.spec.ts +15 -0
- package/src/components/iconbutton/MIconButton.vue +1 -0
- package/src/components/kpiitem/MKpiItem.figma.ts +8 -3
- package/src/components/kpiitem/MKpiItem.spec.ts +12 -0
- package/src/components/kpiitem/MKpiItem.vue +7 -1
- package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.figma.ts +6 -3
- package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.figma.ts +5 -3
- package/src/components/link/MLink.figma.ts +5 -5
- package/src/components/loader/MLoader.figma.ts +3 -3
- package/src/components/loadingoverlay/MLoadingOverlay.figma.ts +3 -3
- package/src/components/modal/MModal.figma.ts +12 -12
- package/src/components/modal/MModal.spec.ts +115 -3
- package/src/components/modal/MModal.vue +91 -11
- package/src/components/modal/README.md +1 -1
- package/src/components/navigationindicator/MNavigationIndicator.figma.ts +7 -3
- package/src/components/numberbadge/MNumberBadge.figma.ts +7 -3
- package/src/components/optionListbox/MOptionListbox.figma.ts +10 -10
- package/src/components/overlay/MOverlay.figma.ts +5 -5
- package/src/components/overlay/MOverlay.spec.ts +1 -1
- package/src/components/overlay/MOverlay.vue +1 -1
- package/src/components/pageheader/MPageHeader.figma.ts +3 -3
- package/src/components/pagination/MPagination.figma.ts +10 -10
- package/src/components/passwordinput/MPasswordInput.figma.ts +9 -9
- package/src/components/phonenumber/MPhoneNumber.figma.ts +9 -9
- package/src/components/phonenumber/MPhoneNumber.spec.ts +6 -2
- package/src/components/phonenumber/MPhoneNumber.vue +21 -15
- package/src/components/pincode/MPincode.figma.ts +9 -9
- package/src/components/popover/MPopover.figma.ts +15 -15
- package/src/components/quantityselector/MQuantitySelector.figma.ts +12 -12
- package/src/components/radio/MRadio.figma.ts +9 -9
- package/src/components/radiogroup/MRadioGroup.figma.ts +7 -7
- package/src/components/segmentedcontrol/MSegmentedControl.figma.ts +8 -8
- package/src/components/select/MSelect.figma.ts +11 -11
- package/src/components/sidebar/MSidebar.figma.ts +8 -8
- package/src/components/sidebar/MSidebar.vue +1 -0
- package/src/components/sidebarexpandableitem/MSidebarExpandableItem.figma.ts +8 -5
- package/src/components/sidebarexpandableitem/MSidebarExpandableItem.spec.ts +12 -0
- package/src/components/sidebarexpandableitem/MSidebarExpandableItem.vue +1 -0
- package/src/components/sidebarfooter/MSidebarFooter.figma.ts +7 -3
- package/src/components/sidebarheader/MSidebarHeader.figma.ts +3 -3
- package/src/components/sidebarnavitem/MSidebarNavItem.figma.ts +3 -3
- package/src/components/sidebarshortcutitem/MSidebarShortcutItem.figma.ts +3 -3
- package/src/components/starrating/MStarRating.figma.ts +7 -7
- package/src/components/statusbadge/MStatusBadge.figma.ts +3 -3
- package/src/components/statusdot/MStatusDot.figma.ts +3 -3
- package/src/components/statusmessage/MStatusMessage.figma.ts +3 -3
- package/src/components/statusnotification/MStatusNotification.figma.ts +7 -7
- package/src/components/stepperbottombar/MStepperBottomBar.figma.ts +3 -3
- package/src/components/steppercompact/MStepperCompact.figma.ts +8 -3
- package/src/components/steppercompact/MStepperCompact.spec.ts +9 -0
- package/src/components/steppercompact/MStepperCompact.vue +1 -1
- package/src/components/stepperinline/MStepperInline.figma.ts +6 -3
- package/src/components/stepperinline/MStepperInline.spec.ts +11 -0
- package/src/components/stepperinline/MStepperInline.stories.ts +5 -1
- package/src/components/stepperinline/MStepperInline.vue +1 -1
- package/src/components/stepperstacked/MStepperStacked.figma.ts +6 -3
- package/src/components/stepperstacked/MStepperStacked.spec.ts +13 -0
- package/src/components/stepperstacked/MStepperStacked.vue +1 -0
- package/src/components/tabs/MTabs.figma.ts +8 -8
- package/src/components/tag/MTag.figma.ts +3 -3
- package/src/components/textarea/MTextArea.figma.ts +8 -8
- package/src/components/textinput/MTextInput.figma.ts +12 -12
- package/src/components/textinput/MTextInput.vue +2 -2
- package/src/components/textinput/README.md +1 -1
- package/src/components/tile/MTile.figma.ts +5 -5
- package/src/components/tileclickable/MTileClickable.figma.ts +6 -6
- package/src/components/tileexpandable/MTileExpandable.figma.ts +6 -6
- package/src/components/tileselectable/MTileSelectable.figma.ts +9 -5
- package/src/components/toaster/MToaster.figma.ts +3 -3
- package/src/components/toggle/MToggle.figma.ts +9 -9
- package/src/components/toggle/MToggle.vue +1 -1
- package/src/components/togglegroup/MToggleGroup.figma.ts +7 -7
- package/src/components/tooltip/MTooltip.figma.ts +10 -5
|
@@ -17,13 +17,13 @@ figma.connect(
|
|
|
17
17
|
},
|
|
18
18
|
example: ({ appearance }) =>
|
|
19
19
|
html`<script setup>
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import { MCallout } from '@mozaic-ds/vue';
|
|
21
|
+
</script>
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
<MCallout
|
|
24
|
+
title="This is a title, be concise and use the description message to give details."
|
|
25
|
+
description="Description message."
|
|
26
|
+
appearance=${appearance}
|
|
27
|
+
></MCallout>`,
|
|
28
28
|
},
|
|
29
29
|
);
|
|
@@ -18,9 +18,6 @@ const meta: Meta<typeof MCallout> = {
|
|
|
18
18
|
},
|
|
19
19
|
args: {
|
|
20
20
|
icon: '<ImageAlt32 aria-hidden="true" />',
|
|
21
|
-
title:
|
|
22
|
-
'This is a title, be concise and use the description message to give details.',
|
|
23
|
-
description: 'Description message.',
|
|
24
21
|
},
|
|
25
22
|
render: (args) => ({
|
|
26
23
|
components: { MCallout, MButton, MLink, ArrowNext20, ImageAlt32 },
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
</div>
|
|
11
11
|
<div class="mc-callout__content">
|
|
12
12
|
<component
|
|
13
|
+
v-if="title"
|
|
13
14
|
:is="props.tag"
|
|
14
15
|
:id="`callout-title-${id}`"
|
|
15
16
|
class="mc-callout__title"
|
|
16
17
|
>{{ title }}</component
|
|
17
18
|
>
|
|
18
19
|
|
|
19
|
-
<p class="mc-callout__message">
|
|
20
|
+
<p v-if="description" class="mc-callout__message">
|
|
20
21
|
{{ description }}
|
|
21
22
|
</p>
|
|
22
23
|
|
|
@@ -37,11 +38,11 @@ const props = withDefaults(
|
|
|
37
38
|
/**
|
|
38
39
|
* Title of the callout.
|
|
39
40
|
*/
|
|
40
|
-
title
|
|
41
|
+
title?: string;
|
|
41
42
|
/**
|
|
42
43
|
* Description of the callout.
|
|
43
44
|
*/
|
|
44
|
-
description
|
|
45
|
+
description?: string;
|
|
45
46
|
/**
|
|
46
47
|
* Allows to define the callout appearance.
|
|
47
48
|
*/
|
|
@@ -7,8 +7,8 @@ A callout is used to highlight additional information that can assist users with
|
|
|
7
7
|
|
|
8
8
|
| Name | Description | Type | Default |
|
|
9
9
|
| --- | --- | --- | --- |
|
|
10
|
-
| `title
|
|
11
|
-
| `description
|
|
10
|
+
| `title` | Title of the callout. | `string` | - |
|
|
11
|
+
| `description` | Description of the callout. | `string` | - |
|
|
12
12
|
| `appearance` | Allows to define the callout appearance. | `"standard"` `"inverse"` `"accent"` `"tips"` | `"standard"` |
|
|
13
13
|
| `tag` | Heading level for the callout title (h2–h6). Adjust to match the
|
|
14
14
|
heading hierarchy of the page where the callout is used. | `"h2"` `"h1"` `"h3"` `"h4"` `"h5"` `"h6"` | `"h2"` |
|
|
@@ -17,16 +17,16 @@ figma.connect(
|
|
|
17
17
|
},
|
|
18
18
|
example: () =>
|
|
19
19
|
html`<script setup>
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import { MCarousel } from '@mozaic-ds/vue';
|
|
21
|
+
</script>
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
<MCarousel>
|
|
24
|
+
<template #header>
|
|
25
|
+
<h2>Carousel title</h2>
|
|
26
|
+
</template>
|
|
27
|
+
<div>Slide 1</div>
|
|
28
|
+
<div>Slide 2</div>
|
|
29
|
+
<div>Slide 3</div>
|
|
30
|
+
</MCarousel>`,
|
|
31
31
|
},
|
|
32
32
|
);
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { mount } from '@vue/test-utils';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
describe,
|
|
4
|
+
it,
|
|
5
|
+
expect,
|
|
6
|
+
vi,
|
|
7
|
+
beforeAll,
|
|
8
|
+
afterAll,
|
|
9
|
+
beforeEach,
|
|
10
|
+
} from 'vitest';
|
|
3
11
|
import MCarousel from './MCarousel.vue';
|
|
4
12
|
import MIconButton from '../iconbutton/MIconButton.vue';
|
|
5
13
|
import { ChevronLeft20, ChevronRight20 } from '@mozaic-ds/icons-vue';
|
|
6
14
|
|
|
7
15
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
8
16
|
|
|
17
|
+
const observerInstances: MockIntersectionObserver[] = [];
|
|
18
|
+
|
|
9
19
|
class MockIntersectionObserver {
|
|
10
20
|
callback: any;
|
|
11
21
|
options: any;
|
|
12
22
|
constructor(callback: any, options?: any) {
|
|
13
23
|
this.callback = callback;
|
|
14
24
|
this.options = options;
|
|
25
|
+
observerInstances.push(this);
|
|
15
26
|
}
|
|
16
27
|
observe = vi.fn();
|
|
17
28
|
unobserve = vi.fn();
|
|
@@ -21,6 +32,10 @@ class MockIntersectionObserver {
|
|
|
21
32
|
describe('MCarousel component', () => {
|
|
22
33
|
let originalObserver: any;
|
|
23
34
|
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
observerInstances.length = 0;
|
|
37
|
+
});
|
|
38
|
+
|
|
24
39
|
beforeAll(() => {
|
|
25
40
|
originalObserver = global.IntersectionObserver;
|
|
26
41
|
global.IntersectionObserver = MockIntersectionObserver as any;
|
|
@@ -132,6 +147,15 @@ describe('MCarousel component', () => {
|
|
|
132
147
|
const container = wrapper.find('.mc-carousel');
|
|
133
148
|
expect(container.attributes('role')).toBe('group');
|
|
134
149
|
expect(container.attributes('aria-roledescription')).toBe('carousel');
|
|
135
|
-
|
|
150
|
+
// aria-labelledby should point to the headings wrapper (dynamic id)
|
|
151
|
+
const labelledby = container.attributes('aria-labelledby');
|
|
152
|
+
expect(labelledby).toBeDefined();
|
|
153
|
+
expect(wrapper.find(`#${labelledby}`).exists()).toBe(true);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('slide container has aria-live="polite"', () => {
|
|
157
|
+
const wrapper = mountCarousel();
|
|
158
|
+
const content = wrapper.find('.mc-carousel__content');
|
|
159
|
+
expect(content.attributes('aria-live')).toBe('polite');
|
|
136
160
|
});
|
|
137
161
|
});
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
class="mc-carousel"
|
|
4
4
|
role="group"
|
|
5
5
|
aria-roledescription="carousel"
|
|
6
|
-
aria-labelledby="
|
|
6
|
+
:aria-labelledby="titleId"
|
|
7
7
|
>
|
|
8
8
|
<div class="mc-carousel__header">
|
|
9
|
-
<div class="mc-carousel__headings">
|
|
9
|
+
<div :id="titleId" class="mc-carousel__headings">
|
|
10
10
|
<slot name="header" />
|
|
11
11
|
</div>
|
|
12
12
|
<div class="mc-carousel__controls">
|
|
@@ -34,7 +34,12 @@
|
|
|
34
34
|
</MIconButton>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
|
-
<div
|
|
37
|
+
<div
|
|
38
|
+
class="mc-carousel__content"
|
|
39
|
+
ref="contentContainer"
|
|
40
|
+
aria-live="polite"
|
|
41
|
+
aria-atomic="false"
|
|
42
|
+
>
|
|
38
43
|
<template
|
|
39
44
|
v-for="(child, index) in $slots.default?.()"
|
|
40
45
|
:key="`carousel-slide-${index}`"
|
|
@@ -46,7 +51,7 @@
|
|
|
46
51
|
</template>
|
|
47
52
|
|
|
48
53
|
<script setup lang="ts">
|
|
49
|
-
import { computed, onMounted, ref, type VNode } from 'vue';
|
|
54
|
+
import { computed, onMounted, ref, useId, type VNode } from 'vue';
|
|
50
55
|
import MIconButton from '../iconbutton/MIconButton.vue';
|
|
51
56
|
import { ChevronLeft20, ChevronRight20 } from '@mozaic-ds/icons-vue';
|
|
52
57
|
/**
|
|
@@ -80,6 +85,7 @@ defineSlots<{
|
|
|
80
85
|
header: VNode;
|
|
81
86
|
}>();
|
|
82
87
|
|
|
88
|
+
const titleId = useId();
|
|
83
89
|
const activeIndex = ref<number>(0);
|
|
84
90
|
const contentContainer = ref<HTMLElement | null>(null);
|
|
85
91
|
|
|
@@ -30,16 +30,16 @@ figma.connect(
|
|
|
30
30
|
},
|
|
31
31
|
example: ({ modelValue, indeterminate, disabled, isInvalid }) =>
|
|
32
32
|
html`<script setup>
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
import { MCheckbox } from '@mozaic-ds/vue';
|
|
34
|
+
</script>
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
<MCheckbox
|
|
37
|
+
id="checkbox-id"
|
|
38
|
+
label="Checkbox Label"
|
|
39
|
+
:model-value=${modelValue}
|
|
40
|
+
:indeterminate=${indeterminate}
|
|
41
|
+
disabled=${disabled}
|
|
42
|
+
:is-invalid=${isInvalid}
|
|
43
|
+
></MCheckbox>`,
|
|
44
44
|
},
|
|
45
45
|
);
|
|
@@ -15,16 +15,16 @@ figma.connect(
|
|
|
15
15
|
},
|
|
16
16
|
example: ({ inline }) =>
|
|
17
17
|
html`<script setup>
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
import { MCheckboxGroup } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
<MCheckboxGroup
|
|
22
|
+
name="group"
|
|
23
|
+
:options="[
|
|
24
24
|
{ id: '1', label: 'Option 1', value: '1' },
|
|
25
25
|
{ id: '2', label: 'Option 2', value: '2' },
|
|
26
26
|
]"
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
inline=${inline}
|
|
28
|
+
/>`,
|
|
29
29
|
},
|
|
30
30
|
);
|
|
@@ -9,21 +9,21 @@ figma.connect(
|
|
|
9
9
|
{
|
|
10
10
|
props: {
|
|
11
11
|
outlined: figma.enum('is outlined', {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
true: true,
|
|
13
|
+
false: false,
|
|
14
14
|
}),
|
|
15
15
|
},
|
|
16
16
|
example: ({ outlined }) =>
|
|
17
17
|
html`<script setup>
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
import { MCheckListMenu } from '@mozaic-ds/vue';
|
|
19
|
+
</script>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
<MCheckListMenu
|
|
22
|
+
:items="[
|
|
23
23
|
{ label: 'Label', checked: true },
|
|
24
24
|
{ label: 'Label', checked: false },
|
|
25
25
|
]"
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
outlined=${outlined}
|
|
27
|
+
/>`,
|
|
28
28
|
},
|
|
29
29
|
);
|
|
@@ -23,9 +23,13 @@ figma.connect(
|
|
|
23
23
|
},
|
|
24
24
|
example: ({ size, value }) =>
|
|
25
25
|
html`<script setup>
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
import { MCircularProgressbar } from '@mozaic-ds/vue';
|
|
27
|
+
</script>
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
<MCircularProgressbar
|
|
30
|
+
size=${size}
|
|
31
|
+
:value=${value}
|
|
32
|
+
aria-label="Progress bar"
|
|
33
|
+
></MCircularProgressbar>`,
|
|
30
34
|
},
|
|
31
35
|
);
|
|
@@ -33,16 +33,16 @@ figma.connect(
|
|
|
33
33
|
},
|
|
34
34
|
example: ({ size, disabled, readonly, isInvalid }) =>
|
|
35
35
|
html`<script setup>
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
import { MCombobox } from '@mozaic-ds/vue';
|
|
37
|
+
</script>
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
<MCombobox
|
|
40
|
+
id="combobox-id"
|
|
41
|
+
size=${size}
|
|
42
|
+
disabled=${disabled}
|
|
43
|
+
readonly=${readonly}
|
|
44
|
+
:is-invalid=${isInvalid}
|
|
45
|
+
:options="[{ label: 'Option 1', value: 'option1' }, { label: 'Option 2', value: 'option2' }]"
|
|
46
|
+
></MCombobox>`,
|
|
47
47
|
},
|
|
48
48
|
);
|
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
<MOptionListbox
|
|
66
66
|
ref="listbox"
|
|
67
67
|
v-model="selection"
|
|
68
|
+
@update:model-value="onSelectionUpdate"
|
|
68
69
|
:id
|
|
69
70
|
:open="isOpen"
|
|
70
71
|
:multiple
|
|
@@ -267,6 +268,12 @@ function close() {
|
|
|
267
268
|
document.removeEventListener('click', handleClickOutside);
|
|
268
269
|
}
|
|
269
270
|
|
|
271
|
+
function onSelectionUpdate() {
|
|
272
|
+
if (!props.multiple) {
|
|
273
|
+
close();
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
270
277
|
function toggleListbox() {
|
|
271
278
|
return isOpen.value ? close() : open();
|
|
272
279
|
}
|
|
@@ -20,11 +20,11 @@ figma.connect(
|
|
|
20
20
|
},
|
|
21
21
|
example: () =>
|
|
22
22
|
html`<script setup>
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
import { MContainer } from '@mozaic-ds/vue';
|
|
24
|
+
</script>
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
<MContainer>
|
|
27
|
+
<p>Container content</p>
|
|
28
|
+
</MContainer>`,
|
|
29
29
|
},
|
|
30
30
|
);
|
|
@@ -3,10 +3,20 @@ import * as utils from './utils';
|
|
|
3
3
|
|
|
4
4
|
// Components
|
|
5
5
|
import '@mozaic-ds/datatable-vue/style.css';
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
MDataTable,
|
|
8
|
+
MDataTableColumn,
|
|
9
|
+
MDataTableTop,
|
|
10
|
+
} from '@mozaic-ds/datatable-vue';
|
|
7
11
|
import MButton from '../button/MButton.vue';
|
|
8
12
|
import MIconButton from '../iconbutton/MIconButton.vue';
|
|
9
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
Settings24,
|
|
15
|
+
Edit24,
|
|
16
|
+
Download24,
|
|
17
|
+
Filter24,
|
|
18
|
+
Search24,
|
|
19
|
+
} from '@mozaic-ds/icons-vue';
|
|
10
20
|
import MToggle from '../toggle/MToggle.vue';
|
|
11
21
|
import MTextInput from '../textinput/MTextInput.vue';
|
|
12
22
|
import MTag from '../tag/MTag.vue';
|
|
@@ -38,7 +48,7 @@ const meta: Meta<typeof MDataTable> = {
|
|
|
38
48
|
<!-- Status -->
|
|
39
49
|
<MDataTableColumn label="Statut" value="status" />
|
|
40
50
|
<template v-slot:cell.status="{ item }"> {{ item.status.code }} </template>
|
|
41
|
-
|
|
51
|
+
`,
|
|
42
52
|
},
|
|
43
53
|
argTypes: utils.argtypes,
|
|
44
54
|
parameters: {
|
|
@@ -46,7 +56,7 @@ const meta: Meta<typeof MDataTable> = {
|
|
|
46
56
|
backgrounds: utils.backgrounds,
|
|
47
57
|
docs: {
|
|
48
58
|
canvas: { sourceState: 'none' },
|
|
49
|
-
}
|
|
59
|
+
},
|
|
50
60
|
},
|
|
51
61
|
render: (args) => ({
|
|
52
62
|
components: { MDataTable, MDataTableColumn, MDataTableTop, MButton },
|
|
@@ -104,7 +114,15 @@ export const FixedHeader: Story = {
|
|
|
104
114
|
|
|
105
115
|
export const TopbarActions: Story = {
|
|
106
116
|
render: (args) => ({
|
|
107
|
-
components: {
|
|
117
|
+
components: {
|
|
118
|
+
MDataTable,
|
|
119
|
+
MDataTableColumn,
|
|
120
|
+
MDataTableTop,
|
|
121
|
+
MButton,
|
|
122
|
+
Settings24,
|
|
123
|
+
Filter24,
|
|
124
|
+
MToggle,
|
|
125
|
+
},
|
|
108
126
|
setup() {
|
|
109
127
|
return { args };
|
|
110
128
|
},
|
|
@@ -153,7 +171,15 @@ export const TopbarActions: Story = {
|
|
|
153
171
|
|
|
154
172
|
export const TopbarEdition: Story = {
|
|
155
173
|
render: (args) => ({
|
|
156
|
-
components: {
|
|
174
|
+
components: {
|
|
175
|
+
MDataTable,
|
|
176
|
+
MDataTableColumn,
|
|
177
|
+
MDataTableTop,
|
|
178
|
+
MButton,
|
|
179
|
+
MIconButton,
|
|
180
|
+
Edit24,
|
|
181
|
+
Download24,
|
|
182
|
+
},
|
|
157
183
|
setup() {
|
|
158
184
|
return { args };
|
|
159
185
|
},
|
|
@@ -214,7 +240,7 @@ export const TopbarFull: Story = {
|
|
|
214
240
|
Settings24,
|
|
215
241
|
Filter24,
|
|
216
242
|
Search24,
|
|
217
|
-
MTag
|
|
243
|
+
MTag,
|
|
218
244
|
},
|
|
219
245
|
setup() {
|
|
220
246
|
return { args };
|
|
@@ -12,7 +12,7 @@ const meta: Meta<typeof MDataTable> = {
|
|
|
12
12
|
componentName: 'MDataTable',
|
|
13
13
|
docs: {
|
|
14
14
|
canvas: { sourceState: 'none' },
|
|
15
|
-
}
|
|
15
|
+
},
|
|
16
16
|
},
|
|
17
17
|
render: (args) => ({
|
|
18
18
|
components: { MDataTable, MDataTableColumn },
|
|
@@ -92,4 +92,4 @@ export const SpecifiedRows: Story = {
|
|
|
92
92
|
...Default.args,
|
|
93
93
|
expandableList: [1, 7, 9],
|
|
94
94
|
},
|
|
95
|
-
};
|
|
95
|
+
};
|
|
@@ -5,7 +5,6 @@ import * as utils from './utils';
|
|
|
5
5
|
import { MDataTable, MDataTableColumn } from '@mozaic-ds/datatable-vue';
|
|
6
6
|
import MCheckbox from '../checkbox/MCheckbox.vue';
|
|
7
7
|
|
|
8
|
-
|
|
9
8
|
const meta: Meta<typeof MDataTable> = {
|
|
10
9
|
title: 'DataTable/MDataTable Selectable',
|
|
11
10
|
component: MDataTable,
|
|
@@ -14,7 +13,7 @@ const meta: Meta<typeof MDataTable> = {
|
|
|
14
13
|
componentName: 'MDataTable',
|
|
15
14
|
docs: {
|
|
16
15
|
canvas: { sourceState: 'none' },
|
|
17
|
-
}
|
|
16
|
+
},
|
|
18
17
|
},
|
|
19
18
|
render: (args) => ({
|
|
20
19
|
components: { MDataTable, MDataTableColumn },
|
|
@@ -121,4 +120,4 @@ export const SpecifiedRows: Story = {
|
|
|
121
120
|
},
|
|
122
121
|
},
|
|
123
122
|
}),
|
|
124
|
-
};
|
|
123
|
+
};
|
|
@@ -12,9 +12,9 @@ figma.connect(
|
|
|
12
12
|
},
|
|
13
13
|
example: () =>
|
|
14
14
|
html`<script setup>
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
import { MDatepicker } from '@mozaic-ds/vue';
|
|
16
|
+
</script>
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
<MDatepicker id="datepicker" />`,
|
|
19
19
|
},
|
|
20
20
|
);
|
|
@@ -22,9 +22,9 @@ figma.connect(
|
|
|
22
22
|
},
|
|
23
23
|
example: ({ appearance, size }) =>
|
|
24
24
|
html`<script setup>
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
import { MDivider } from '@mozaic-ds/vue';
|
|
26
|
+
</script>
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
<MDivider appearance=${appearance} size=${size} />`,
|
|
29
29
|
},
|
|
30
30
|
);
|
|
@@ -19,19 +19,19 @@ figma.connect(
|
|
|
19
19
|
},
|
|
20
20
|
example: ({ position, extended }) =>
|
|
21
21
|
html`<script setup>
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
import { MDrawer, MButton } from '@mozaic-ds/vue';
|
|
23
|
+
</script>
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
<MDrawer
|
|
26
|
+
open
|
|
27
|
+
title="Drawer title"
|
|
28
|
+
:position=${position}
|
|
29
|
+
:extended=${extended}
|
|
30
|
+
>
|
|
31
|
+
<p>Drawer content</p>
|
|
32
|
+
<template #footer>
|
|
33
|
+
<MButton>Confirm</MButton>
|
|
34
|
+
</template>
|
|
35
|
+
</MDrawer>`,
|
|
36
36
|
},
|
|
37
37
|
);
|