@mozaic-ds/vue 2.6.1 → 2.8.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/README.md +3 -3
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +211 -101
- package/dist/mozaic-vue.js +3034 -1070
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +5 -1
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +10 -7
- package/src/components/Contributing.mdx +1 -1
- package/src/components/GettingStarted.mdx +1 -1
- package/src/components/Introduction.mdx +1 -1
- package/src/components/Support.mdx +1 -1
- package/src/components/avatar/MAvatar.stories.ts +1 -0
- package/src/components/avatar/README.md +16 -0
- package/src/components/breadcrumb/README.md +11 -0
- package/src/components/button/MButton.stories.ts +1 -2
- package/src/components/button/MButton.vue +6 -1
- package/src/components/button/README.md +24 -0
- package/src/components/callout/MCallout.stories.ts +1 -0
- package/src/components/callout/README.md +19 -0
- package/src/components/checkbox/README.md +23 -0
- package/src/components/checkboxgroup/README.md +20 -0
- package/src/components/circularprogressbar/MCircularProgressbar.stories.ts +1 -0
- package/src/components/circularprogressbar/README.md +14 -0
- package/src/components/container/MContainer.stories.ts +8 -0
- package/src/components/container/MContainer.vue +1 -1
- package/src/components/container/README.md +16 -0
- package/src/components/datepicker/MDatepicker.stories.ts +1 -0
- package/src/components/datepicker/README.md +24 -0
- package/src/components/divider/MDivider.stories.ts +1 -0
- package/src/components/divider/README.md +18 -0
- package/src/components/drawer/MDrawer.spec.ts +95 -0
- package/src/components/drawer/MDrawer.stories.ts +1 -0
- package/src/components/drawer/MDrawer.vue +34 -3
- package/src/components/drawer/README.md +30 -0
- package/src/components/field/MField.vue +1 -1
- package/src/components/field/README.md +24 -0
- package/src/components/fieldgroup/README.md +22 -0
- package/src/components/flag/README.md +11 -0
- package/src/components/iconbutton/MIconButton.stories.ts +1 -0
- package/src/components/iconbutton/MIconButton.vue +6 -1
- package/src/components/iconbutton/README.md +21 -0
- package/src/components/linearprogressbarbuffer/MLinearProgressbarBuffer.stories.ts +1 -0
- package/src/components/linearprogressbarbuffer/README.md +11 -0
- package/src/components/linearprogressbarpercentage/MLinearProgressbarPercentage.stories.ts +1 -0
- package/src/components/linearprogressbarpercentage/README.md +10 -0
- package/src/components/link/MLink.vue +0 -2
- package/src/components/link/README.md +23 -0
- package/src/components/loader/MLoader.vue +1 -1
- package/src/components/loader/README.md +12 -0
- package/src/components/loadingoverlay/MLoadingOverlay.stories.ts +1 -1
- package/src/components/loadingoverlay/README.md +11 -0
- package/src/components/modal/MModal.spec.ts +36 -1
- package/src/components/modal/MModal.vue +11 -1
- package/src/components/modal/README.md +29 -0
- package/src/components/numberbadge/README.md +12 -0
- package/src/components/overlay/README.md +17 -0
- package/src/components/pagination/README.md +20 -0
- package/src/components/passwordinput/README.md +25 -0
- package/src/components/phonenumber/MPhoneNumber.spec.ts +294 -0
- package/src/components/phonenumber/MPhoneNumber.stories.ts +88 -0
- package/src/components/phonenumber/MPhoneNumber.vue +271 -0
- package/src/components/phonenumber/README.md +26 -0
- package/src/components/pincode/MPincode.spec.ts +4 -1
- package/src/components/pincode/MPincode.stories.ts +1 -0
- package/src/components/pincode/MPincode.vue +5 -1
- package/src/components/pincode/README.md +22 -0
- package/src/components/quantityselector/MQuantitySelector.stories.ts +0 -7
- package/src/components/quantityselector/README.md +27 -0
- package/src/components/radio/README.md +21 -0
- package/src/components/radiogroup/README.md +21 -0
- package/src/components/segmentedcontrol/MSegmentedControl.spec.ts +116 -0
- package/src/components/segmentedcontrol/MSegmentedControl.stories.ts +78 -0
- package/src/components/segmentedcontrol/MSegmentedControl.vue +92 -0
- package/src/components/segmentedcontrol/README.md +19 -0
- package/src/components/select/README.md +24 -0
- package/src/components/statusbadge/README.md +11 -0
- package/src/components/statusdot/MStatusDot.stories.ts +1 -0
- package/src/components/statusdot/README.md +11 -0
- package/src/components/statusnotification/README.md +25 -0
- package/src/components/tabs/MTabs.stories.ts +23 -1
- package/src/components/tabs/MTabs.vue +8 -0
- package/src/components/tabs/Mtabs.spec.ts +29 -8
- package/src/components/tabs/README.md +20 -0
- package/src/components/tag/README.md +25 -0
- package/src/components/textarea/README.md +25 -0
- package/src/components/textinput/README.md +32 -0
- package/src/components/toaster/MToaster.stories.ts +1 -0
- package/src/components/toaster/README.md +28 -0
- package/src/components/toggle/README.md +21 -0
- package/src/components/togglegroup/MToggleGroup.vue +1 -3
- package/src/components/togglegroup/README.md +20 -0
- package/src/components/tooltip/README.md +19 -0
- package/src/components/usingIcons.mdx +1 -1
- package/src/components/usingPresets.mdx +1 -1
- package/src/main.ts +2 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# MDrawer
|
|
2
|
+
|
|
3
|
+
A drawer is a sliding panel that appears from the side of the screen, providing additional content, settings, or actions without disrupting the main view. It is often used for filtering options, or contextual details. It enhances usability by keeping interfaces clean while offering expandable functionality.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `open` | If `true`, display the drawer. | `boolean` | - |
|
|
11
|
+
| `position` | Position of the drawer. | `"left"` `"right"` | - |
|
|
12
|
+
| `extended` | If `true`, the drawer have a bigger width. | `boolean` | - |
|
|
13
|
+
| `back` | If `true`, display the back button. | `boolean` | - |
|
|
14
|
+
| `title*` | Title of the drawer. | `string` | - |
|
|
15
|
+
| `contentTitle` | Title of the content of the drawer. | `string` | - |
|
|
16
|
+
| `closeOnOverlay` | if `true`, close the drawer when clicking the overlay. | `boolean` | - |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `default` | Use this slot to insert the content of the drawer |
|
|
23
|
+
| `footer` | Use this slot to insert buttons in the footer |
|
|
24
|
+
|
|
25
|
+
## Events
|
|
26
|
+
|
|
27
|
+
| Name | Description | Type |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `back` | Emits when click back button of the drawer. | [] |
|
|
30
|
+
| `update:open` | Emits when the drawer open state changes, updating the modelValue prop. | [value: boolean] |
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<script setup lang="ts">
|
|
30
30
|
import { computed, type VNode } from 'vue';
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* A field label is a text element that identifies the purpose of an input field, providing users with clear guidance on what information to enter. It is typically placed above the input field and may include indicators for required or optional fields. Field Labels improve form usability, accessibility, and data entry accuracy by ensuring users understand the expected input.
|
|
33
33
|
*/
|
|
34
34
|
const props = defineProps<{
|
|
35
35
|
/**
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# MField
|
|
2
|
+
|
|
3
|
+
A field label is a text element that identifies the purpose of an input field, providing users with clear guidance on what information to enter. It is typically placed above the input field and may include indicators for required or optional fields. Field Labels improve form usability, accessibility, and data entry accuracy by ensuring users understand the expected input.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the form field, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `label*` | The text displayed as the label for the form field. | `string` | - |
|
|
12
|
+
| `requirementText` | Additional text displayed alongside the label, typically used to indicate if the form field is required or optional | `string` | - |
|
|
13
|
+
| `helpText` | Text shown below the form field to provide additional context or instructions for the user. | `string` | - |
|
|
14
|
+
| `helpId` | The value of the `id` attribute set on the **helpText** element. _This value is mandatory when using a helpText in order to guarantee the accessibility of the component._ | `string` | - |
|
|
15
|
+
| `isValid` | If `true`, applies a valid state to the form field. | `boolean` | - |
|
|
16
|
+
| `isInvalid` | If `true`, applies an invalid state to the form field. | `boolean` | - |
|
|
17
|
+
| `messageId` | The value of the `id` attribute set on the **validationMessage** element. _This value is mandatory when using a validationMessage in order to guarantee the accessibility of the component._ | `string` | - |
|
|
18
|
+
| `message` | message displayed when the form field has a valid or invalid state, usually indicating validation or errors. | `string` | - |
|
|
19
|
+
|
|
20
|
+
## Slots
|
|
21
|
+
|
|
22
|
+
| Name | Description |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| `default` | Use this slot to insert the form element of your choice |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# MFieldGroup
|
|
2
|
+
|
|
3
|
+
This component creates a structured form field for group field such as Radio Group, Checkbox Group or Toggle Group with a label, optional help text, error and validation message handling.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the form field, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `legend*` | The text displayed as the legend for the form fieldset. | `string` | - |
|
|
12
|
+
| `requirementText` | Additional text displayed alongside the label, typically used to indicate if the form field is required or optional | `string` | - |
|
|
13
|
+
| `helpText` | Text shown below the form field to provide additional context or instructions for the user. | `string` | - |
|
|
14
|
+
| `isValid` | If `true`, applies a valid state to the form field. | `boolean` | - |
|
|
15
|
+
| `isInvalid` | If `true`, applies an invalid state to the form field. | `boolean` | - |
|
|
16
|
+
| `message` | message displayed when the form field has a valid or invalid state, usually indicating validation or errors. | `string` | - |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `default` | Use this slot to insert the form element of your choice |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MFlag
|
|
2
|
+
|
|
3
|
+
A flag is used to display meta-information about a product or service, acting as a visual indicator of the main category of content. It is typically placed at the top of an element to ensure immediate visibility.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `label*` | Label of the Flag. | `string` | - |
|
|
11
|
+
| `appearance` | Allows to define the Flag appearance. | `"standard"` `"inverse"` `"accent"` `"danger"` | - |
|
|
@@ -52,7 +52,7 @@ const props = withDefaults(
|
|
|
52
52
|
|
|
53
53
|
defineSlots<{
|
|
54
54
|
/**
|
|
55
|
-
* Use this slot to insert
|
|
55
|
+
* Use this slot to insert an icon for the Button.
|
|
56
56
|
*/
|
|
57
57
|
icon: VNode;
|
|
58
58
|
}>();
|
|
@@ -70,4 +70,9 @@ const classObject = computed(() => {
|
|
|
70
70
|
|
|
71
71
|
<style lang="scss" scoped>
|
|
72
72
|
@use '@mozaic-ds/styles/components/button';
|
|
73
|
+
|
|
74
|
+
.mc-button__icon::v-deep(svg) {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
}
|
|
73
78
|
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIconButton
|
|
2
|
+
|
|
3
|
+
Buttons are key interactive elements used to perform actions and can be used as standalone element, or as part of another component. Their appearance depends on the type of action required from the user and the context in which they are used.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `appearance` | Defines the visual style of the icon button. | `"standard"` `"inverse"` `"accent"` `"danger"` | `"standard"` |
|
|
11
|
+
| `size` | Determines the size of the icon button. | `"s"` `"m"` `"l"` | `"m"` |
|
|
12
|
+
| `disabled` | If `true`, disables the icon button, making it non-interactive. | `boolean` | - |
|
|
13
|
+
| `ghost` | If `true`, applies a "ghost" style to the icon button. | `boolean` | - |
|
|
14
|
+
| `outlined` | If `true`, the icon button gets an outlined style. | `boolean` | - |
|
|
15
|
+
| `type` | Specifies the button's HTML `type` attribute. | `"button"` `"reset"` `"submit"` | `"button"` |
|
|
16
|
+
|
|
17
|
+
## Slots
|
|
18
|
+
|
|
19
|
+
| Name | Description |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `icon` | Use this slot to insert an icon for the Button. |
|
|
@@ -4,6 +4,7 @@ import MLinearProgressbarBuffer from './MLinearProgressbarBuffer.vue';
|
|
|
4
4
|
const meta: Meta<typeof MLinearProgressbarBuffer> = {
|
|
5
5
|
title: 'Indicators/Linear Progress Bar (Buffer)',
|
|
6
6
|
component: MLinearProgressbarBuffer,
|
|
7
|
+
tags: ['v2'],
|
|
7
8
|
parameters: {
|
|
8
9
|
docs: {
|
|
9
10
|
description: {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MLinearProgressbarBuffer
|
|
2
|
+
|
|
3
|
+
A linear progress bar (Buffer) visually represents the progress of a task along a horizontal track, often indicating both current progress and a secondary buffered state. This type of progress bar is commonly used for loading processes, file uploads, or streaming indicators, where part of the task is completed while another portion is preloaded or buffered. It provides users with real-time feedback on task advancement.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `size` | Allows to define the progress bar size. | `"s"` `"m"` `"l"` | - |
|
|
11
|
+
| `value` | The current value of the progress bar. | `number` | `0` |
|
|
@@ -4,6 +4,7 @@ import MLinearProgressbarPercentage from './MLinearProgressbarPercentage.vue';
|
|
|
4
4
|
const meta: Meta<typeof MLinearProgressbarPercentage> = {
|
|
5
5
|
title: 'Indicators/Linear Progress Bar (Percentage)',
|
|
6
6
|
component: MLinearProgressbarPercentage,
|
|
7
|
+
tags: ['v2'],
|
|
7
8
|
parameters: {
|
|
8
9
|
docs: {
|
|
9
10
|
description: {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# MLinearProgressbarPercentage
|
|
2
|
+
|
|
3
|
+
A linear progress bar (Percentage) visually represents the completion of a task along a horizontal track, displaying the exact progress in percentage within the bar. It is commonly used for file uploads, installations, form completion, or any process requiring user awareness of progress. The percentage label provides clear and immediate feedback, helping users track progress with precision.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `value` | The current value of the progress bar. | `number` | `0` |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# MLink
|
|
2
|
+
|
|
3
|
+
A link is an interactive text element used to navigate between pages, sections, or external resources. It is typically underlined and styled to indicate its clickable nature. Links can be standalone or embedded within text, and they may include icons to reinforce their purpose. They are essential for navigation and content referencing in web and application interfaces.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `iconPosition` | Position of the icon relative to the text. | `"left"` `"right"` | `"left"` |
|
|
11
|
+
| `appearance` | Allows to define the link appearance. | `"standard"` `"inverse"` `"accent"` `"secondary"` | `"standard"` |
|
|
12
|
+
| `size` | Allows to define the link size. | `"s"` `"m"` | `"s"` |
|
|
13
|
+
| `href` | URL for the link (for external links or the `to` prop for `router-link`). | `string` | - |
|
|
14
|
+
| `target` | Where to open the link. | `"_self"` `"_blank"` `"_parent"` `"_top"` | - |
|
|
15
|
+
| `inline` | Specify wether the link is inline. | `boolean` | - |
|
|
16
|
+
| `router` | If `true`, the link will be rendered as a `router-link` for internal navigation (Vue Router). | `boolean` | - |
|
|
17
|
+
|
|
18
|
+
## Slots
|
|
19
|
+
|
|
20
|
+
| Name | Description |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `default` | Use this slot to insert the textual content of the Link. |
|
|
23
|
+
| `icon` | Use this slot to insert an icon for the Link. |
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
<script setup lang="ts">
|
|
23
23
|
import { computed } from 'vue';
|
|
24
24
|
/**
|
|
25
|
-
* A loader
|
|
25
|
+
* A loader is a visual indicator used to inform users that a process is in progress, typically during data fetching, page loading, or background operations. It provides feedback that the system is working, helping to manage user expectations and reduce perceived wait time.
|
|
26
26
|
*/
|
|
27
27
|
const props = withDefaults(
|
|
28
28
|
defineProps<{
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# MLoader
|
|
2
|
+
|
|
3
|
+
A loader is a visual indicator used to inform users that a process is in progress, typically during data fetching, page loading, or background operations. It provides feedback that the system is working, helping to manage user expectations and reduce perceived wait time.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `appearance` | Specifies the visual appearance of the loader. | `"standard"` `"inverse"` `"accent"` | `"standard"` |
|
|
11
|
+
| `size` | Defines the size of the loader. | `"s"` `"m"` `"l"` | `"m"` |
|
|
12
|
+
| `text` | Text to display alongside the loader when using the loader inside an `Overlay`. | `string` | - |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# MLoadingOverlay
|
|
2
|
+
|
|
3
|
+
A loading overlay is a full-screen or container-level layer that indicates a process is in progress, preventing user interaction until the task is completed. It includes a progress indicator, and a message to inform users about the loading state. Loading Overlays are commonly used in data-heavy applications, form submissions, and page transitions to enhance user experience by managing wait times effectively.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `isVisible` | Controls the visibility of the loading overlay. | `boolean` | - |
|
|
11
|
+
| `text` | Text of the loading overlay. | `string` | - |
|
|
@@ -8,7 +8,8 @@ const stubs = {
|
|
|
8
8
|
template: `<button @click="$emit('click')"><slot name="icon"/></button>`,
|
|
9
9
|
},
|
|
10
10
|
MOverlay: {
|
|
11
|
-
|
|
11
|
+
name: 'MOverlay',
|
|
12
|
+
template: `<div class="overlay" @click="$emit('click')"><slot/></div>`,
|
|
12
13
|
},
|
|
13
14
|
};
|
|
14
15
|
|
|
@@ -100,4 +101,38 @@ describe('MModal component', () => {
|
|
|
100
101
|
|
|
101
102
|
expect(wrapper.find('.mc-modal').classes()).toContain('is-open');
|
|
102
103
|
});
|
|
104
|
+
|
|
105
|
+
it('emits update:open with false when overlay clicked and closeOnOverlay is true', async () => {
|
|
106
|
+
const wrapper = mount(MModal, {
|
|
107
|
+
props: { open: true, title: 'Title', closeOnOverlay: true },
|
|
108
|
+
global: { stubs },
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
await wrapper.findComponent({ name: 'MOverlay' }).trigger('click');
|
|
112
|
+
|
|
113
|
+
expect(wrapper.emitted('update:open')).toBeTruthy();
|
|
114
|
+
expect(wrapper.emitted('update:open')![0]).toEqual([false]);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('does not emit update:open when overlay clicked and closeOnOverlay is false', async () => {
|
|
118
|
+
const wrapper = mount(MModal, {
|
|
119
|
+
props: { open: true, title: 'Title', closeOnOverlay: false },
|
|
120
|
+
global: { stubs },
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
await wrapper.findComponent({ name: 'MOverlay' }).trigger('click');
|
|
124
|
+
|
|
125
|
+
expect(wrapper.emitted('update:open')).toBeFalsy();
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('does not emit update:open when overlay clicked and closeOnOverlay is not set', async () => {
|
|
129
|
+
const wrapper = mount(MModal, {
|
|
130
|
+
props: { open: true, title: 'Title' },
|
|
131
|
+
global: { stubs },
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
await wrapper.findComponent({ name: 'MOverlay' }).trigger('click');
|
|
135
|
+
|
|
136
|
+
expect(wrapper.emitted('update:open')).toBeFalsy();
|
|
137
|
+
});
|
|
103
138
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<MOverlay :is-visible="open" dialogLabel="modalTitle">
|
|
2
|
+
<MOverlay :is-visible="open" dialogLabel="modalTitle" @click="onClickOverlay">
|
|
3
3
|
<section
|
|
4
4
|
class="mc-modal"
|
|
5
5
|
:class="classObject"
|
|
@@ -72,6 +72,10 @@ const props = withDefaults(
|
|
|
72
72
|
* if `true`, display the close button.
|
|
73
73
|
*/
|
|
74
74
|
closable?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* if `true`, close the modal when clicking the overlay.
|
|
77
|
+
*/
|
|
78
|
+
closeOnOverlay?: boolean;
|
|
75
79
|
}>(),
|
|
76
80
|
{
|
|
77
81
|
closable: true,
|
|
@@ -110,6 +114,12 @@ watch(
|
|
|
110
114
|
},
|
|
111
115
|
);
|
|
112
116
|
|
|
117
|
+
const onClickOverlay = () => {
|
|
118
|
+
if (props.closeOnOverlay) {
|
|
119
|
+
onClose();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
113
123
|
const onClose = () => {
|
|
114
124
|
emit('update:open', false);
|
|
115
125
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# MModal
|
|
2
|
+
|
|
3
|
+
A modal is a dialog window that appears on top of the main content, requiring user interaction before returning to the main interface. It is used to focus attention on a specific task, provide important information, or request confirmation for an action. Modals typically include a title, description, and primary/secondary actions and should be used for single, focused tasks to avoid disrupting the user experience.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `open` | if `true`, display the modal. | `boolean` | - |
|
|
11
|
+
| `title*` | Title of the modal. | `string` | - |
|
|
12
|
+
| `description` | Description of the modal. | `string` | - |
|
|
13
|
+
| `closable` | if `true`, display the close button. | `boolean` | `true` |
|
|
14
|
+
| `closeOnOverlay` | if `true`, close the modal when clicking the overlay. | `boolean` | - |
|
|
15
|
+
|
|
16
|
+
## Slots
|
|
17
|
+
|
|
18
|
+
| Name | Description |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| `icon` | Use this slot to insert an icon next to the title of the modal. |
|
|
21
|
+
| `default` | Use this slot to insert the content of the modal. |
|
|
22
|
+
| `link` | Use this slot to insert a link in the footer. |
|
|
23
|
+
| `footer` | Use this slot to insert buttons in the footer. |
|
|
24
|
+
|
|
25
|
+
## Events
|
|
26
|
+
|
|
27
|
+
| Name | Description | Type |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| `update:open` | Emits when the modal display changes, updating the modelValue prop. | [value: boolean] |
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# MNumberBadge
|
|
2
|
+
|
|
3
|
+
A Number Badge represents a numeric count, often used to indicate notifications, updates, or items requiring attention. Its distinct appearance makes it easy to spot changes at a glance, ensuring users stay informed without breaking their workflow. Badges are commonly attached to icons, buttons, or tabs to provide contextual awareness.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `label*` | Content of the badge. | `number` | - |
|
|
11
|
+
| `appearance` | Allows to define the badge appearance. | `"standard"` `"inverse"` `"accent"` `"danger"` | `"standard"` |
|
|
12
|
+
| `size` | Allows to define the badge size. | `"s"` `"m"` | `"s"` |
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# MOverlay
|
|
2
|
+
|
|
3
|
+
An overlay is a semi-transparent layer that appears on top of the main content, typically used to dim the background and focus user attention on a specific element. It is often combined with modals, popovers, or loading states to create a visual separation between the foreground and background. Overlays help prevent unintended interactions while keeping the primary content accessible.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `isVisible` | Controls the visibility of the overlay. | `boolean` | - |
|
|
11
|
+
| `dialogLabel` | Accessible label for the overlay dialog. | `string` | - |
|
|
12
|
+
|
|
13
|
+
## Slots
|
|
14
|
+
|
|
15
|
+
| Name | Description |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `default` | Use this slot to insert a centered content inside the overlay. |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MPagination
|
|
2
|
+
|
|
3
|
+
Pagination is a navigation component that allows users to browse through large sets of content by dividing it into discrete pages. It typically includes previous and next buttons, numeric page selectors, or dropdowns to jump between pages efficiently. Pagination improves usability and performance in content-heavy applications such as tables, search results, and articles by preventing long scrolls and reducing page load times.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the pagination. | `string` | - |
|
|
11
|
+
| `modelValue*` | The current value of the selected page. | `number` | - |
|
|
12
|
+
| `compact` | If `true`, display a compact version without the select. | `boolean` | - |
|
|
13
|
+
| `options*` | Define the available choices for the pagination select element. | `{ id?: string` `undefined; text: string; value: number; }[]` | - |
|
|
14
|
+
| `selectLabel` | Accessible label for the select of the pagination. | `string` | - |
|
|
15
|
+
|
|
16
|
+
## Events
|
|
17
|
+
|
|
18
|
+
| Name | Description | Type |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| `update:modelValue` | Emits when the pagination value changes, updating the modelValue prop. | [value: number] |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# MPasswordInput
|
|
2
|
+
|
|
3
|
+
A password input is a specialized input field used to securely enter and manage passwords. It typically masks the characters entered to protect sensitive information from being seen. It includes a toggle button to show or hide the password, improving usability while maintaining security. Password inputs are commonly used in login forms, account creation, and authentication flows.
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
| Name | Description | Type | Default |
|
|
9
|
+
| --- | --- | --- | --- |
|
|
10
|
+
| `id*` | A unique identifier for the password input element, used to associate the label with the form element. | `string` | - |
|
|
11
|
+
| `name` | The name attribute for the password input element, typically used for form submission. | `string` | - |
|
|
12
|
+
| `modelValue` | The current value of the password input field. | `string` `number` | - |
|
|
13
|
+
| `placeholder` | A placeholder text to show in the password input when it is empty. | `string` | - |
|
|
14
|
+
| `isInvalid` | If `true`, applies an invalid state to the password input. | `boolean` | - |
|
|
15
|
+
| `disabled` | If `true`, disables the password input, making it non-interactive. | `boolean` | - |
|
|
16
|
+
| `readonly` | If `true`, the password input is read-only (cannot be edited). | `boolean` | - |
|
|
17
|
+
| `isClearable` | If `true`, a clear button will appear when the password input has a value. | `boolean` | - |
|
|
18
|
+
| `clearLabel` | The label text for the clear button. | `string` | `"Clear content"` |
|
|
19
|
+
| `buttonLabel` | Labels of the button displayed when showing or hiding the password. | `{ show: string; hide: string; }` | `{ show: "Show", hide: "Hide" }` |
|
|
20
|
+
|
|
21
|
+
## Events
|
|
22
|
+
|
|
23
|
+
| Name | Description | Type |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `update:modelValue` | Emits when the input value changes, updating the `modelValue` prop. | [value: string | number] |
|