maz-ui 5.0.0 → 5.1.0-beta.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/assets/{MazDropzone.DJ8au25t.css → MazDropzone.BW2grpTi.css} +1 -1
- package/dist/chunks/{MazDrawer.DANxKYxJ.js → MazDrawer.CC8zomfx.js} +2 -2
- package/dist/chunks/{MazDropzone.POH3pmfi.js → MazDropzone.Dez5j0WP.js} +2 -2
- package/dist/components/MazDrawer.js +1 -1
- package/dist/components/MazDropzone.js +1 -1
- package/dist/components/MazDropzone.vue.d.ts +2 -2
- package/dist/components/MazInputPrice.vue.d.ts +1 -1
- package/dist/components/index.js +2 -2
- package/docs/README.md +207 -0
- package/docs/agents/agents-md.md +52 -0
- package/docs/agents/claude-rule.md +52 -0
- package/docs/components/maz-accordion.md +76 -0
- package/docs/components/maz-alert.md +241 -0
- package/docs/components/maz-animated-counter.md +87 -0
- package/docs/components/maz-animated-element.md +46 -0
- package/docs/components/maz-animated-text.md +53 -0
- package/docs/components/maz-avatar.md +193 -0
- package/docs/components/maz-backdrop.md +178 -0
- package/docs/components/maz-badge.md +167 -0
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/components/maz-btn-group.md +316 -0
- package/docs/components/maz-btn.md +423 -0
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/components/maz-card.md +321 -0
- package/docs/components/maz-carousel.md +153 -0
- package/docs/components/maz-chart.md +206 -0
- package/docs/components/maz-checkbox.md +138 -0
- package/docs/components/maz-checklist.md +251 -0
- package/docs/components/maz-circular-progress-bar.md +109 -0
- package/docs/components/maz-code-highlight.md +155 -0
- package/docs/components/maz-container.md +241 -0
- package/docs/components/maz-date-picker.md +791 -0
- package/docs/components/maz-dialog-confirm.md +215 -0
- package/docs/components/maz-dialog.md +143 -0
- package/docs/components/maz-drawer.md +106 -0
- package/docs/components/maz-dropdown.md +419 -0
- package/docs/components/maz-dropzone.md +387 -0
- package/docs/components/maz-expand-animation.md +82 -0
- package/docs/components/maz-fullscreen-loader.md +58 -0
- package/docs/components/maz-gallery.md +79 -0
- package/docs/components/maz-icon.md +203 -0
- package/docs/components/maz-input-code.md +73 -0
- package/docs/components/maz-input-number.md +79 -0
- package/docs/components/maz-input-phone-number.md +536 -0
- package/docs/components/maz-input-price.md +68 -0
- package/docs/components/maz-input-tags.md +112 -0
- package/docs/components/maz-input.md +334 -0
- package/docs/components/maz-lazy-img.md +113 -0
- package/docs/components/maz-link.md +146 -0
- package/docs/components/maz-loading-bar.md +38 -0
- package/docs/components/maz-markdown-editor.md +320 -0
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/components/maz-pull-to-refresh.md +222 -0
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/components/maz-read-more.md +209 -0
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/components/maz-select-country.md +513 -0
- package/docs/components/maz-select.md +318 -0
- package/docs/components/maz-sidebar-content.md +25 -0
- package/docs/components/maz-sidebar-footer.md +25 -0
- package/docs/components/maz-sidebar-group.md +27 -0
- package/docs/components/maz-sidebar-header.md +25 -0
- package/docs/components/maz-sidebar-menu-button.md +41 -0
- package/docs/components/maz-sidebar-menu-item.md +25 -0
- package/docs/components/maz-sidebar-menu-sub.md +32 -0
- package/docs/components/maz-sidebar-menu.md +25 -0
- package/docs/components/maz-sidebar-separator.md +21 -0
- package/docs/components/maz-sidebar-trigger.md +25 -0
- package/docs/components/maz-sidebar.md +507 -0
- package/docs/components/maz-skeleton.md +226 -0
- package/docs/components/maz-slider.md +165 -0
- package/docs/components/maz-spinner.md +84 -0
- package/docs/components/maz-stepper.md +301 -0
- package/docs/components/maz-switch.md +86 -0
- package/docs/components/maz-table-cell.md +27 -0
- package/docs/components/maz-table-row.md +28 -0
- package/docs/components/maz-table-title.md +27 -0
- package/docs/components/maz-table-virtualizer.md +31 -0
- package/docs/components/maz-table.md +426 -0
- package/docs/components/maz-tabs-bar.md +43 -0
- package/docs/components/maz-tabs-content-item.md +27 -0
- package/docs/components/maz-tabs-content.md +27 -0
- package/docs/components/maz-tabs.md +308 -0
- package/docs/components/maz-textarea.md +255 -0
- package/docs/components/maz-ticker.md +427 -0
- package/docs/components/maz-timeline.md +304 -0
- package/docs/components/maz-ui-provider.md +26 -0
- package/docs/components/maz-window-mockup.md +182 -0
- package/docs/composables/use-aos.md +41 -0
- package/docs/composables/use-breakpoints.md +42 -0
- package/docs/composables/use-dialog.md +58 -0
- package/docs/composables/use-display-names.md +130 -0
- package/docs/composables/use-drag.md +185 -0
- package/docs/composables/use-form-validator.md +1123 -0
- package/docs/composables/use-idle-timeout.md +172 -0
- package/docs/composables/use-pull-to-refresh.md +86 -0
- package/docs/composables/use-reading-time.md +132 -0
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/composables/use-swipe.md +171 -0
- package/docs/composables/use-timer.md +104 -0
- package/docs/composables/use-toast.md +50 -0
- package/docs/composables/use-user-visibility.md +127 -0
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/directives/click-outside.md +182 -0
- package/docs/directives/fullscreen-img.md +83 -0
- package/docs/directives/lazy-img.md +182 -0
- package/docs/directives/tooltip.md +298 -0
- package/docs/directives/zoom-img.md +100 -0
- package/docs/ecosystem/eslint-config.md +289 -0
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/ecosystem/icons/index.md +584 -0
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/ecosystem/node/exec-promise.md +93 -0
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/ecosystem/node/logger.md +152 -0
- package/docs/ecosystem/node/print-banner.md +101 -0
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/ecosystem/nuxt.md +551 -0
- package/docs/ecosystem/stylelint-config.md +310 -0
- package/docs/ecosystem/themes.md +966 -0
- package/docs/ecosystem/translations.md +1173 -0
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/ecosystem/utils/check-availability.md +85 -0
- package/docs/ecosystem/utils/cookie.md +86 -0
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/ecosystem/utils/currency.md +53 -0
- package/docs/ecosystem/utils/date.md +53 -0
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/ecosystem/utils/debounce-id.md +75 -0
- package/docs/ecosystem/utils/debounce.md +71 -0
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/ecosystem/utils/format-json.md +39 -0
- package/docs/ecosystem/utils/format-phone-number.md +43 -0
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/ecosystem/utils/get-error-message.md +45 -0
- package/docs/ecosystem/utils/idle-timeout.md +96 -0
- package/docs/ecosystem/utils/index.md +57 -0
- package/docs/ecosystem/utils/is-client.md +38 -0
- package/docs/ecosystem/utils/is-equal.md +44 -0
- package/docs/ecosystem/utils/is-ios.md +43 -0
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/ecosystem/utils/kebab-case.md +42 -0
- package/docs/ecosystem/utils/normalize-string.md +83 -0
- package/docs/ecosystem/utils/number.md +51 -0
- package/docs/ecosystem/utils/pascal-case.md +41 -0
- package/docs/ecosystem/utils/prevent-ios-input-zoom.md +72 -0
- package/docs/ecosystem/utils/script-loader.md +85 -0
- package/docs/ecosystem/utils/sleep.md +65 -0
- package/docs/ecosystem/utils/snake-case.md +42 -0
- package/docs/ecosystem/utils/swipe-handler.md +97 -0
- package/docs/ecosystem/utils/textarea-autogrow.md +47 -0
- package/docs/ecosystem/utils/throttle-id.md +54 -0
- package/docs/ecosystem/utils/throttle.md +63 -0
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/ecosystem/utils/types/deep-key-of.md +54 -0
- package/docs/ecosystem/utils/types/deep-partial.md +48 -0
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/ecosystem/utils/types/generic-instance-type.md +48 -0
- package/docs/ecosystem/utils/types/infer-maybe-ref.md +41 -0
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/ecosystem/utils/user-visibility.md +75 -0
- package/docs/guide/ai-agents.md +237 -0
- package/docs/guide/browser-support.md +88 -0
- package/docs/guide/getting-started.md +191 -0
- package/docs/guide/global-defaults.md +103 -0
- package/docs/guide/maz-ui-provider.md +231 -0
- package/docs/guide/migration-v5.md +871 -0
- package/docs/guide/resolvers.md +650 -0
- package/docs/guide/tailwind.md +483 -0
- package/docs/guide/vue.md +286 -0
- package/docs/manifest.json +1 -0
- package/docs/plugins/aos.md +312 -0
- package/docs/plugins/dialog.md +269 -0
- package/docs/plugins/toast.md +221 -0
- package/docs/plugins/wait.md +78 -0
- package/docs/reference/icons.md +46 -0
- package/docs/reference/tailwind-tokens.md +191 -0
- package/docs/rules.md +57 -0
- package/package.json +31 -4
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSelect - with \"multiple\" options"
|
|
3
|
+
description: "MazSelect is a standalone component that replaces the standard html input select with a beautiful design system. There are many options like multiple values, search text field, custom templates options, colors, sizes, disabled, loading, error, warning, valid states, error messages, and icons."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-select"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazSelect - with "multiple" options
|
|
9
|
+
|
|
10
|
+
> MazSelect is a standalone component that replaces the standard html input select with a beautiful design system. There are many options like multiple values, search text field, custom templates options, colors, sizes, disabled, loading, error, warning, valid states, error messages, and icons.
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazSelect from 'maz-ui/components/MazSelect'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-select
|
|
16
|
+
|
|
17
|
+
> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)
|
|
18
|
+
|
|
19
|
+
**Tip:**
|
|
20
|
+
|
|
21
|
+
This component can be translated globally using the [MazUi](../ecosystem/translations.md) plugin.
|
|
22
|
+
|
|
23
|
+
## Basic usage
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<script setup lang="ts">
|
|
27
|
+
import MazSelect from 'maz-ui/components/MazSelect'
|
|
28
|
+
import { ref } from 'vue'
|
|
29
|
+
|
|
30
|
+
const selectedValue = ref()
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<MazSelect
|
|
35
|
+
v-model="selectedValue"
|
|
36
|
+
label="Select color"
|
|
37
|
+
:color="color"
|
|
38
|
+
:options="['primary', 'secondary', 'info', 'success', 'destructive', 'warning']"
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
selectedValue: {{ selectedValue }}
|
|
42
|
+
</template>
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Multiple
|
|
46
|
+
|
|
47
|
+
```html
|
|
48
|
+
<MazSelect v-model="selectedValues" :options="colors" label="Choose options" multiple />
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Search
|
|
52
|
+
|
|
53
|
+
Use `search` property to add a search input in the options list
|
|
54
|
+
|
|
55
|
+
**Tip:**
|
|
56
|
+
|
|
57
|
+
You can use your own template to replace the empty icon when no results are found
|
|
58
|
+
|
|
59
|
+
**Details: View code**
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<MazSelect>
|
|
63
|
+
<template #no-results>
|
|
64
|
+
<div class="p-4 text-center">No result</div>
|
|
65
|
+
</template>
|
|
66
|
+
</MazSelect>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**Note:**
|
|
70
|
+
|
|
71
|
+
You can adjust the search results by using `search-threshold` where 1 is a perfect match and 0 is a match with any character
|
|
72
|
+
|
|
73
|
+
```html
|
|
74
|
+
<MazSelect :search-threshold="0.75" :options="[...]" />
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```html
|
|
78
|
+
<MazSelect v-model="selectedValue" label="Select color" :options="colors" search />
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Custom search function
|
|
82
|
+
|
|
83
|
+
You can provide your own search function to customize the search behavior
|
|
84
|
+
|
|
85
|
+
```vue
|
|
86
|
+
<script lang="ts" setup>
|
|
87
|
+
import MazSelect from 'maz-ui/components/MazSelect'
|
|
88
|
+
|
|
89
|
+
const selectedValue = ref()
|
|
90
|
+
|
|
91
|
+
function customSearchFunction(query: string, options: typeof colors) {
|
|
92
|
+
return options.filter(
|
|
93
|
+
option => option.label.toLowerCase().includes(query.toLowerCase())
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<MazSelect
|
|
100
|
+
v-model="selectedValue"
|
|
101
|
+
placeholder="Select color"
|
|
102
|
+
:options="colors"
|
|
103
|
+
search
|
|
104
|
+
:search-function="customSearchFunction"
|
|
105
|
+
/>
|
|
106
|
+
</template>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Opt Group
|
|
110
|
+
|
|
111
|
+
Group your options like a native optgroup
|
|
112
|
+
|
|
113
|
+
```vue
|
|
114
|
+
<script setup lang="ts">
|
|
115
|
+
import { ref } from 'vue'
|
|
116
|
+
const selectedValue = ref()
|
|
117
|
+
const optGroup = [
|
|
118
|
+
{ label: 'Basic colors', options: ['primary', 'secondary', 'destructive'] },
|
|
119
|
+
{ label: 'Custom colors', options: [{ label: 'third', value: 'third' }] },
|
|
120
|
+
]
|
|
121
|
+
</script>
|
|
122
|
+
|
|
123
|
+
<template>
|
|
124
|
+
<MazSelect
|
|
125
|
+
v-model="optGroupValue"
|
|
126
|
+
label="Select option"
|
|
127
|
+
:options="optGroup"
|
|
128
|
+
multiple
|
|
129
|
+
/>
|
|
130
|
+
</template>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Disabled
|
|
134
|
+
|
|
135
|
+
```html
|
|
136
|
+
<MazSelect
|
|
137
|
+
label="Select color"
|
|
138
|
+
v-model="selectedValue"
|
|
139
|
+
:options="colors"
|
|
140
|
+
disabled
|
|
141
|
+
/>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Size
|
|
145
|
+
|
|
146
|
+
```vue
|
|
147
|
+
<template>
|
|
148
|
+
<MazSelect
|
|
149
|
+
v-for="size in sizes"
|
|
150
|
+
:key="size"
|
|
151
|
+
label="Select color"
|
|
152
|
+
v-model="selectedValue"
|
|
153
|
+
:options="colors"
|
|
154
|
+
:size="size"
|
|
155
|
+
/>
|
|
156
|
+
</template>
|
|
157
|
+
|
|
158
|
+
<script lang="ts" setup>
|
|
159
|
+
import { ref } from 'vue'
|
|
160
|
+
import { MazSelect, type MazSize } from 'maz-ui/components'
|
|
161
|
+
|
|
162
|
+
const selectedValue = ref()
|
|
163
|
+
|
|
164
|
+
const sizes: MazSize[] = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
|
|
165
|
+
</script>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Custom template options
|
|
169
|
+
|
|
170
|
+
Customize the options list with your own template
|
|
171
|
+
|
|
172
|
+
```vue{6}
|
|
173
|
+
<template>
|
|
174
|
+
<MazSelect
|
|
175
|
+
label="Select color"
|
|
176
|
+
v-model="selectedUser"
|
|
177
|
+
:options="customTemplateOptions"
|
|
178
|
+
v-slot="{ option, isSelected }"
|
|
179
|
+
search
|
|
180
|
+
>
|
|
181
|
+
<div class="flex items-center" style="width: 100%; gap: 1rem">
|
|
182
|
+
<MazAvatar size="0.8rem" :src="option.picture" />
|
|
183
|
+
<strong>
|
|
184
|
+
{{ option.label }}
|
|
185
|
+
</strong>
|
|
186
|
+
</div>
|
|
187
|
+
</MazSelect>
|
|
188
|
+
</template>
|
|
189
|
+
|
|
190
|
+
<script lang="ts" setup>
|
|
191
|
+
import { ref } from 'vue'
|
|
192
|
+
import { MazSelect, MazAvatar } from 'maz-ui/components'
|
|
193
|
+
|
|
194
|
+
const selectedUser = ref()
|
|
195
|
+
|
|
196
|
+
const customTemplateOptions = [
|
|
197
|
+
{ picture: 'https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&seed=JamesSmile', label: 'James Smile', value: 1 },
|
|
198
|
+
{ picture: 'https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&seed=BradSmile', label: 'Brad Smile', value: 2 },
|
|
199
|
+
{ picture: 'https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&seed=CedricSmile', label: 'Cedric Smile', value: 3 },
|
|
200
|
+
{ picture: 'https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&seed=HarrySmile', label: 'Harry Smile', value: 4 },
|
|
201
|
+
]
|
|
202
|
+
</script>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Custom options model
|
|
206
|
+
|
|
207
|
+
By default, the options should be an array of `{ value: any, label: string }`
|
|
208
|
+
|
|
209
|
+
If you want custom keys of these options, you can use:
|
|
210
|
+
|
|
211
|
+
- `option-value-key` to override the key of the value in your option
|
|
212
|
+
- `option-label-key` to override the key of the label to show in the option list
|
|
213
|
+
- `option-input-value-key` to override the key of the value to show in the input
|
|
214
|
+
|
|
215
|
+
### Example
|
|
216
|
+
|
|
217
|
+
```vue
|
|
218
|
+
<script lang="ts" setup>
|
|
219
|
+
import { ref } from 'vue'
|
|
220
|
+
const selectedValueCustom = ref('destructive')
|
|
221
|
+
|
|
222
|
+
const customOptions = [
|
|
223
|
+
{ valueOption: 'primary', labelOption: 'primary label', inputLabel: 'primary input', },
|
|
224
|
+
{ valueOption: 'secondary', labelOption: 'secondary label', inputLabel: 'secondary input', },
|
|
225
|
+
{ valueOption: 'info', labelOption: 'info label', inputLabel: 'info input', },
|
|
226
|
+
{ valueOption: 'success', labelOption: 'success label', inputLabel: 'success input', },
|
|
227
|
+
{ valueOption: 'warning', labelOption: 'warning label', inputLabel: 'warning input', },
|
|
228
|
+
{ valueOption: 'destructive', labelOption: 'destructive label', inputLabel: 'destructive input', },
|
|
229
|
+
{ valueOption: 'white', labelOption: 'white label', inputLabel: 'white input', },
|
|
230
|
+
{ valueOption: 'black', labelOption: 'black label', inputLabel: 'black input', },
|
|
231
|
+
]
|
|
232
|
+
</script>
|
|
233
|
+
|
|
234
|
+
<template>
|
|
235
|
+
<MazSelect
|
|
236
|
+
v-model="selectedValueCustom"
|
|
237
|
+
:options="options"
|
|
238
|
+
:color="selectedValueCustom"
|
|
239
|
+
option-value-key="valueOption"
|
|
240
|
+
option-label-key="labelOption"
|
|
241
|
+
option-input-value-key="inputLabel"
|
|
242
|
+
search
|
|
243
|
+
/>
|
|
244
|
+
</template>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Types
|
|
248
|
+
|
|
249
|
+
```ts
|
|
250
|
+
type ModelValueSimple = string | number | null | undefined | boolean
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Accessibility
|
|
254
|
+
|
|
255
|
+
`MazSelect` follows the [WAI-ARIA combobox pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) with a listbox popup:
|
|
256
|
+
|
|
257
|
+
- The input is a `combobox` (`aria-haspopup="listbox"`, `aria-expanded`, `aria-controls`).
|
|
258
|
+
- The list is a `listbox` (`aria-multiselectable` in multiple mode) labelled by the `label`, `top-label` or `placeholder`, each option is an `option` with `aria-selected`.
|
|
259
|
+
- **Keyboard**: ↓ / ↑ / Space or a letter open the list, the arrows move between options, Home / End go to the first / last option, Enter selects, Esc closes.
|
|
260
|
+
- The labels read by screen readers (toggle button, empty results) come from `@maz-ui/translations` (`aria` namespace).
|
|
261
|
+
|
|
262
|
+
## MazSelect API
|
|
263
|
+
|
|
264
|
+
`import MazSelect from 'maz-ui/components/MazSelect'`
|
|
265
|
+
|
|
266
|
+
### Props
|
|
267
|
+
|
|
268
|
+
- `id` (`string`): The id of the select.
|
|
269
|
+
- `label` (`string`): The label of the select.
|
|
270
|
+
- `top-label` (`string`): Static label displayed above the input field. Unlike the floating label, this remains fixed.
|
|
271
|
+
- `placeholder` (`string`): The placeholder of the select.
|
|
272
|
+
- `model-value` (`(Multiple extends true ? Value[] : Value)`, `v-model`): The value of the select.
|
|
273
|
+
- `options` (`Option[]`, required): The options of the select.
|
|
274
|
+
- `option-value-key` (`string`, default: `"value"`): The key of the option value.
|
|
275
|
+
- `option-label-key` (`string`, default: `"label"`): The key of the option label.
|
|
276
|
+
- `option-input-value-key` (`string`, default: `"label"`): The key of the option input value.
|
|
277
|
+
- `list-position` (`MazPopoverPosition`, default: `"auto"`): The position of the list (auto by default - will switch between bottom-start and top-start).
|
|
278
|
+
- `prefer-position` (`MazPopoverPreferPosition`, default: `"bottom-start"`): The prefer position of the list.
|
|
279
|
+
- `fallback-position` (`MazPopoverFallbackPosition`, default: `"top-start"`): The fallback position of the list.
|
|
280
|
+
- `item-height` (`number`): The height of the option list item.
|
|
281
|
+
- `max-list-height` (`number`, default: `240`): The max height of the option list.
|
|
282
|
+
- `max-list-width` (`number`): The max width of the option list.
|
|
283
|
+
- `min-list-height` (`number`): The min height of the option list.
|
|
284
|
+
- `min-list-width` (`number`): The min width of the option list.
|
|
285
|
+
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): The size of the select.
|
|
286
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"primary"`): The color of the select.
|
|
287
|
+
- `search` (`boolean`): Display search input in option list.
|
|
288
|
+
- `search-function` (`((query: string, options: Option[]) => Option[] | undefined)`): Replace the default search function to provide a custom search function.
|
|
289
|
+
- `search-threshold` (`number`, default: `0.75`): The threshold for the search input where 1 is a perfect match and 0 is a match with any character.
|
|
290
|
+
- `multiple` (`Multiple`, default: `false`): Enable the multiple selection.
|
|
291
|
+
- `required` (`boolean`): Make the input required in the form.
|
|
292
|
+
- `disabled` (`boolean`): Disable the component.
|
|
293
|
+
- `block` (`boolean`): The input will be displayed in full width.
|
|
294
|
+
- `autocomplete` (`string`, default: `"off"`): The autocomplete attribute of the input.
|
|
295
|
+
- `translations` (`Partial<{ searchPlaceholder: string; }>`, default: `{ searchPlaceholder: 'Search in options', }`): The translations of the component.
|
|
296
|
+
- `format-input-value` (`((value: Multiple extends true ? Value[] : Value) => string)`): The function to format the input value.
|
|
297
|
+
- `transition` (`string`, default: `"scale-fade"`): The transition name of the panel list options.
|
|
298
|
+
- `open` (`boolean`, default: `false`, `v-model:open`)
|
|
299
|
+
|
|
300
|
+
### Events
|
|
301
|
+
|
|
302
|
+
- `@update:model-value` (payload: `value: Multiple extends true ? Value[] : Value`): On model value update, returns the new value
|
|
303
|
+
- `@open`: On list is opened
|
|
304
|
+
- `@close`: On list is closed
|
|
305
|
+
- `@blur` (payload: `value: Event`): On input blur
|
|
306
|
+
- `@change` (payload: `value: Event`): On input change value
|
|
307
|
+
- `@focus` (payload: `value?: Event | undefined`): On input focus
|
|
308
|
+
- `@input` (payload: `value: Event`): On input value
|
|
309
|
+
- `@selected-option` (payload: `value: Option`): On selected value, returns the option object
|
|
310
|
+
- `@update:open` (payload: `value: boolean`)
|
|
311
|
+
|
|
312
|
+
### Slots
|
|
313
|
+
|
|
314
|
+
- `#start-icon`: Add a custom inline-start icon (left in LTR, right in RTL) Bindings: `isOpen: false` (Current open state of the popover), `close: () => void` (Function to close the popover), `open: () => void` (Function to open the popover), `toggle: () => void` (Function to toggle the popover).
|
|
315
|
+
- `#end-icon`: Add and replace a custom inline-end icon (right in LTR, left in RTL) Bindings: `isOpen: false` (Current open state of the popover), `close: () => void` (Function to close the popover), `open: () => void` (Function to open the popover), `toggle: () => void` (Function to toggle the popover).
|
|
316
|
+
- `#no-results`: No results slot - Displayed when no results corresponding with search query
|
|
317
|
+
- `#optgroup`: Custom optgroup label Bindings: `label: string | number | true` (the label of the optgroup).
|
|
318
|
+
- `#default`: Custom option Bindings: `option: Option` (the option object), `isSelected: boolean` (if the option is selected), `isOpen: false` (if the popover is open), `close: () => void` (function to close the popover), `open: () => void` (function to open the popover), `toggle: () => void` (function to toggle the popover).
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarContent"
|
|
3
|
+
description: "MazSidebarContent component."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarContent
|
|
8
|
+
|
|
9
|
+
> MazSidebarContent component.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarContent from 'maz-ui/components/MazSidebarContent'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
## MazSidebarContent API
|
|
16
|
+
|
|
17
|
+
`import MazSidebarContent from 'maz-ui/components/MazSidebarContent'`
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
|
|
21
|
+
No props.
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
- `#default`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarFooter"
|
|
3
|
+
description: "MazSidebarFooter component."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarFooter
|
|
8
|
+
|
|
9
|
+
> MazSidebarFooter component.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarFooter from 'maz-ui/components/MazSidebarFooter'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
## MazSidebarFooter API
|
|
16
|
+
|
|
17
|
+
`import MazSidebarFooter from 'maz-ui/components/MazSidebarFooter'`
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
|
|
21
|
+
No props.
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
- `#default`
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarGroup"
|
|
3
|
+
description: "MazSidebarGroup is a building block of MazSidebar."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarGroup
|
|
8
|
+
|
|
9
|
+
> MazSidebarGroup is a building block of MazSidebar.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarGroup from 'maz-ui/components/MazSidebarGroup'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
Used inside [MazSidebar](./maz-sidebar.md): read its page for complete examples.
|
|
16
|
+
|
|
17
|
+
## MazSidebarGroup API
|
|
18
|
+
|
|
19
|
+
`import MazSidebarGroup from 'maz-ui/components/MazSidebarGroup'`
|
|
20
|
+
|
|
21
|
+
### Props
|
|
22
|
+
|
|
23
|
+
- `label` (`string`): Optional label for the group.
|
|
24
|
+
|
|
25
|
+
### Slots
|
|
26
|
+
|
|
27
|
+
- `#default`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarHeader"
|
|
3
|
+
description: "MazSidebarHeader component."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarHeader
|
|
8
|
+
|
|
9
|
+
> MazSidebarHeader component.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarHeader from 'maz-ui/components/MazSidebarHeader'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
## MazSidebarHeader API
|
|
16
|
+
|
|
17
|
+
`import MazSidebarHeader from 'maz-ui/components/MazSidebarHeader'`
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
|
|
21
|
+
No props.
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
- `#default`
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarMenuButton"
|
|
3
|
+
description: "MazSidebarMenuButton is a building block of MazSidebar."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarMenuButton
|
|
8
|
+
|
|
9
|
+
> MazSidebarMenuButton is a building block of MazSidebar.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarMenuButton from 'maz-ui/components/MazSidebarMenuButton'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
Used inside [MazSidebar](./maz-sidebar.md): read its page for complete examples.
|
|
16
|
+
|
|
17
|
+
## MazSidebarMenuButton API
|
|
18
|
+
|
|
19
|
+
`import MazSidebarMenuButton from 'maz-ui/components/MazSidebarMenuButton'`
|
|
20
|
+
|
|
21
|
+
### Props
|
|
22
|
+
|
|
23
|
+
- `to` (`string | Record<string, unknown>`): Route for router-link navigation.
|
|
24
|
+
- `href` (`string`): URL for anchor navigation.
|
|
25
|
+
- `icon` (`MazIconLike`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control (size, title, fallback, …).
|
|
26
|
+
- `label` (`string`): Label text.
|
|
27
|
+
- `badge` (`MazSidebarMenuButtonBadge`): Badge content. Pass a `string`/`number` for a simple primary badge, or a full `MazBadgeProps` object (with optional `text`) to customise color, size, outlined, ….
|
|
28
|
+
- `tooltip` (`string`): Tooltip text. When provided, shows a tooltip on hover via the `v-tooltip` directive.
|
|
29
|
+
- `tooltip-mode` (`MazSidebarTooltipMode`): Controls when the tooltip should be displayed. - `always`: tooltip shows on hover regardless of the sidebar state - `closed`: tooltip only shows on hover when the sidebar is collapsed Overrides the parent `MazSidebar`'s `tooltipMode`. Falls back to the sidebar value (which defaults to `always`) when not provided.
|
|
30
|
+
- `active` (`boolean`): Whether the item is active (highlights with `aria-current="page"`).
|
|
31
|
+
- `disabled` (`boolean`): Whether the item is disabled.
|
|
32
|
+
- `size` (`"sm" | "md" | "lg"`, default: `"md"`): Size of the button.
|
|
33
|
+
|
|
34
|
+
### Events
|
|
35
|
+
|
|
36
|
+
- `@click` (payload: `event: MouseEvent`)
|
|
37
|
+
|
|
38
|
+
### Slots
|
|
39
|
+
|
|
40
|
+
- `#icon`
|
|
41
|
+
- `#default`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarMenuItem"
|
|
3
|
+
description: "MazSidebarMenuItem component."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarMenuItem
|
|
8
|
+
|
|
9
|
+
> MazSidebarMenuItem component.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarMenuItem from 'maz-ui/components/MazSidebarMenuItem'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
## MazSidebarMenuItem API
|
|
16
|
+
|
|
17
|
+
`import MazSidebarMenuItem from 'maz-ui/components/MazSidebarMenuItem'`
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
|
|
21
|
+
No props.
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
- `#default`
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarMenuSub"
|
|
3
|
+
description: "MazSidebarMenuSub is a building block of MazSidebar."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarMenuSub
|
|
8
|
+
|
|
9
|
+
> MazSidebarMenuSub is a building block of MazSidebar.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarMenuSub from 'maz-ui/components/MazSidebarMenuSub'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
Used inside [MazSidebar](./maz-sidebar.md): read its page for complete examples.
|
|
16
|
+
|
|
17
|
+
## MazSidebarMenuSub API
|
|
18
|
+
|
|
19
|
+
`import MazSidebarMenuSub from 'maz-ui/components/MazSidebarMenuSub'`
|
|
20
|
+
|
|
21
|
+
### Props
|
|
22
|
+
|
|
23
|
+
- `label` (`string`): Label for the sub-menu trigger button.
|
|
24
|
+
- `icon` (`MazIconLike`): Icon to display before the label. Accepts a bare icon value (Vue component, raw SVG string, URL) or a full `MazIconProps` object for fine-grained control.
|
|
25
|
+
- `default-open` (`boolean`, default: `false`): Whether the sub-menu is open by default.
|
|
26
|
+
|
|
27
|
+
### Slots
|
|
28
|
+
|
|
29
|
+
- `#icon`
|
|
30
|
+
- `#label`
|
|
31
|
+
- `#chevron`
|
|
32
|
+
- `#default`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarMenu"
|
|
3
|
+
description: "MazSidebarMenu component."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarMenu
|
|
8
|
+
|
|
9
|
+
> MazSidebarMenu component.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarMenu from 'maz-ui/components/MazSidebarMenu'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
## MazSidebarMenu API
|
|
16
|
+
|
|
17
|
+
`import MazSidebarMenu from 'maz-ui/components/MazSidebarMenu'`
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
|
|
21
|
+
No props.
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
- `#default`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarSeparator"
|
|
3
|
+
description: "MazSidebarSeparator component."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarSeparator
|
|
8
|
+
|
|
9
|
+
> MazSidebarSeparator component.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarSeparator from 'maz-ui/components/MazSidebarSeparator'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
## MazSidebarSeparator API
|
|
16
|
+
|
|
17
|
+
`import MazSidebarSeparator from 'maz-ui/components/MazSidebarSeparator'`
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
|
|
21
|
+
No props.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazSidebarTrigger"
|
|
3
|
+
description: "MazSidebarTrigger component."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MazSidebarTrigger
|
|
8
|
+
|
|
9
|
+
> MazSidebarTrigger component.
|
|
10
|
+
|
|
11
|
+
- Package: `maz-ui`
|
|
12
|
+
- Import: `import MazSidebarTrigger from 'maz-ui/components/MazSidebarTrigger'`
|
|
13
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
14
|
+
|
|
15
|
+
## MazSidebarTrigger API
|
|
16
|
+
|
|
17
|
+
`import MazSidebarTrigger from 'maz-ui/components/MazSidebarTrigger'`
|
|
18
|
+
|
|
19
|
+
### Props
|
|
20
|
+
|
|
21
|
+
No props.
|
|
22
|
+
|
|
23
|
+
### Slots
|
|
24
|
+
|
|
25
|
+
- `#default`
|