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,321 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazCard"
|
|
3
|
+
description: "MazCard is a standalone component to display some texts and images and also add button actions"
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-card"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazCard
|
|
9
|
+
|
|
10
|
+
> MazCard is a standalone component to display some texts and images and also add button actions
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazCard from 'maz-ui/components/MazCard'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-card
|
|
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
|
+
## Basic usage
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<template>
|
|
23
|
+
<MazCard class="vp-raw" title="Cute Kitten">
|
|
24
|
+
<p class="text-muted">
|
|
25
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
|
|
26
|
+
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an
|
|
27
|
+
unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
28
|
+
</p>
|
|
29
|
+
</MazCard>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import MazCard from 'maz-ui/components/MazCard'
|
|
34
|
+
</script>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Advanced usage
|
|
38
|
+
|
|
39
|
+
**Details: View code**
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<template>
|
|
43
|
+
<MazCard
|
|
44
|
+
:gallery="{ images: ['https://placedog.net/520/520'], height: 300, zoom: true }"
|
|
45
|
+
>
|
|
46
|
+
<template #content-title>
|
|
47
|
+
<h3>
|
|
48
|
+
Cute Kitten
|
|
49
|
+
</h3>
|
|
50
|
+
</template>
|
|
51
|
+
<template #subtitle>
|
|
52
|
+
<span>
|
|
53
|
+
Cat
|
|
54
|
+
</span>
|
|
55
|
+
</template>
|
|
56
|
+
<template #content-body>
|
|
57
|
+
<p class="text-muted">
|
|
58
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
59
|
+
</p>
|
|
60
|
+
</template>
|
|
61
|
+
<template #actions>
|
|
62
|
+
<MazBtn
|
|
63
|
+
size="md"
|
|
64
|
+
fab
|
|
65
|
+
color="destructive"
|
|
66
|
+
class="me-2"
|
|
67
|
+
>
|
|
68
|
+
<MazIcon icon="/trash.svg" />
|
|
69
|
+
</MazBtn>
|
|
70
|
+
<MazBtn
|
|
71
|
+
size="md"
|
|
72
|
+
color="contrast"
|
|
73
|
+
>
|
|
74
|
+
<MazIcon icon="/user-plus.svg" />
|
|
75
|
+
</MazBtn>
|
|
76
|
+
</template>
|
|
77
|
+
</MazCard>
|
|
78
|
+
</template>
|
|
79
|
+
|
|
80
|
+
<script lang="ts" setup>
|
|
81
|
+
import MazCard from 'maz-ui/components/MazCard'
|
|
82
|
+
</script>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Orientation
|
|
86
|
+
|
|
87
|
+
When you display images, you can change the orientation of the card, available options include: `column` `row` `row-reverse` `column-reverse`
|
|
88
|
+
|
|
89
|
+
### Row
|
|
90
|
+
|
|
91
|
+
**Details: View code**
|
|
92
|
+
|
|
93
|
+
```html
|
|
94
|
+
<MazCard :gallery="{ images: ['https://placedog.net/450/450'] }" orientation="row">
|
|
95
|
+
<template #content-title>
|
|
96
|
+
<h3> Cute Kitten </h3>
|
|
97
|
+
</template>
|
|
98
|
+
<template #content-body>
|
|
99
|
+
<p class="text-muted">
|
|
100
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
101
|
+
</p>
|
|
102
|
+
</template>
|
|
103
|
+
</MazCard>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Row Reverse
|
|
107
|
+
|
|
108
|
+
**Details: View code**
|
|
109
|
+
|
|
110
|
+
```html
|
|
111
|
+
<MazCard
|
|
112
|
+
:gallery="{ images: ['https://placedog.net/380/380'] }"
|
|
113
|
+
orientation="row-reverse"
|
|
114
|
+
>
|
|
115
|
+
<template #content-title>
|
|
116
|
+
<h3> Cute Kitten </h3>
|
|
117
|
+
</template>
|
|
118
|
+
<template #content-body>
|
|
119
|
+
<p class="text-muted">
|
|
120
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
121
|
+
</p>
|
|
122
|
+
</template>
|
|
123
|
+
</MazCard>
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Column Reverse
|
|
128
|
+
|
|
129
|
+
**Details: View code**
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<MazCard
|
|
133
|
+
:gallery="{ images: ['https://placedog.net/420/420'], height: 300 }"
|
|
134
|
+
orientation="column-reverse"
|
|
135
|
+
>
|
|
136
|
+
<template #content-title>
|
|
137
|
+
<h3> Cute Kitten </h3>
|
|
138
|
+
</template>
|
|
139
|
+
<template #content-body>
|
|
140
|
+
<p class="text-muted">
|
|
141
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
142
|
+
</p>
|
|
143
|
+
</template>
|
|
144
|
+
</MazCard>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Collapsible
|
|
148
|
+
|
|
149
|
+
Use props: `collapsible` & `v-model:collapse-open`
|
|
150
|
+
|
|
151
|
+
**Details: View code**
|
|
152
|
+
|
|
153
|
+
```vue
|
|
154
|
+
<template>
|
|
155
|
+
<MazCard collapsible title="Lorem Ipsum is simply" block style="margin-bottom: 1rem;">
|
|
156
|
+
<p>
|
|
157
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
158
|
+
</p>
|
|
159
|
+
</MazCard>
|
|
160
|
+
|
|
161
|
+
<MazCard collapsible v-model:collapse-open="cardOpen" title="Lorem Ipsum is simply" block>
|
|
162
|
+
<p>
|
|
163
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
164
|
+
</p>
|
|
165
|
+
</MazCard>
|
|
166
|
+
</template>
|
|
167
|
+
|
|
168
|
+
<script setup>
|
|
169
|
+
import { ref } from 'vue'
|
|
170
|
+
|
|
171
|
+
const cardOpen = ref(true)
|
|
172
|
+
</script>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Linked card
|
|
176
|
+
|
|
177
|
+
To access the link, simply click the card.
|
|
178
|
+
|
|
179
|
+
- `href` is the link or `to` if you use router-link or nuxt-link
|
|
180
|
+
- `href-target` is the behavior of the link on click
|
|
181
|
+
- You can use `:scale="false"` to remove the scale animation on hover
|
|
182
|
+
|
|
183
|
+
- [MazCard](./maz-card.md#linked-card)
|
|
184
|
+
|
|
185
|
+
**Details: View code**
|
|
186
|
+
|
|
187
|
+
```html
|
|
188
|
+
<MazCard
|
|
189
|
+
:gallery="{ images: ['https://placedog.net/400/400'], height: 300 }"
|
|
190
|
+
href="/components/maz-card#linked-card"
|
|
191
|
+
href-target="_blank"
|
|
192
|
+
block
|
|
193
|
+
>
|
|
194
|
+
<span>
|
|
195
|
+
Click on the card to follow the href link
|
|
196
|
+
</span>
|
|
197
|
+
</MazCard>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## No bordered
|
|
201
|
+
|
|
202
|
+
**Details: View code**
|
|
203
|
+
|
|
204
|
+
```html
|
|
205
|
+
<MazCard :bordered="false">
|
|
206
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
207
|
+
</MazCard>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
## Elevation
|
|
211
|
+
|
|
212
|
+
**Details: View code**
|
|
213
|
+
|
|
214
|
+
```html
|
|
215
|
+
<MazCard elevation :bordered="false">
|
|
216
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
217
|
+
</MazCard>
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Gallery images
|
|
221
|
+
|
|
222
|
+
**Details: View code**
|
|
223
|
+
|
|
224
|
+
```html
|
|
225
|
+
<MazCard
|
|
226
|
+
:gallery="{
|
|
227
|
+
images: ['https://placedog.net/640/640', 'https://placedog.net/560/560', 'https://placedog.net/720/720', 'https://placedog.net/360/360'],
|
|
228
|
+
displayedCount: 3,
|
|
229
|
+
remaining: true,
|
|
230
|
+
zoom: true,
|
|
231
|
+
}"
|
|
232
|
+
>
|
|
233
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
234
|
+
</MazCard>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Footer slot
|
|
238
|
+
|
|
239
|
+
### Basic
|
|
240
|
+
|
|
241
|
+
**Details: View code**
|
|
242
|
+
|
|
243
|
+
```html
|
|
244
|
+
<MazCard>
|
|
245
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
246
|
+
|
|
247
|
+
<template #footer>
|
|
248
|
+
<MazBtn>
|
|
249
|
+
Button
|
|
250
|
+
</MazBtn>
|
|
251
|
+
</template>
|
|
252
|
+
</MazCard>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Footer aligned on left
|
|
256
|
+
|
|
257
|
+
Use the prop option `footer-align="start"`
|
|
258
|
+
|
|
259
|
+
**Details: View code**
|
|
260
|
+
|
|
261
|
+
```html
|
|
262
|
+
<MazCard footer-align="start">
|
|
263
|
+
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
|
|
264
|
+
|
|
265
|
+
<template #footer>
|
|
266
|
+
<MazBtn>
|
|
267
|
+
Button
|
|
268
|
+
</MazBtn>
|
|
269
|
+
</template>
|
|
270
|
+
</MazCard>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Types
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
type MazGalleryImage =
|
|
277
|
+
| {
|
|
278
|
+
thumbnail?: string
|
|
279
|
+
src: string
|
|
280
|
+
alt?: string
|
|
281
|
+
}
|
|
282
|
+
| string
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
## MazCard API
|
|
286
|
+
|
|
287
|
+
`import MazCard from 'maz-ui/components/MazCard'`
|
|
288
|
+
|
|
289
|
+
### Props
|
|
290
|
+
|
|
291
|
+
- `orientation` (`"row" | "column" | "column-reverse" | "row-reverse"`, default: `"column"`): Card variant: Must be `column | row | row-reverse | column-reverse`.
|
|
292
|
+
- `href` (`string`): Make card a link (footer area excluded).
|
|
293
|
+
- `to` (`string | et | X`): Make card a link with a router-link or nuxt-link (footer area excluded).
|
|
294
|
+
- `href-target` (`string`, default: `"_self"`): Target option of link: Muse be one of `_blank | _self | _parent | _top | framename`.
|
|
295
|
+
- `footer-align` (`"end" | "start"`, default: `"end"`): Footer text alignment along the inline axis: `start | end` (`end` = right in LTR, left in RTL).
|
|
296
|
+
- `gallery` (`MazGalleryProps`, default: `` `{ displayedCount: 3, remaining: false, zoom: !href && !to, width: 200, height: 150 }` If `href` or `to` is set, `zoom` is set to `false` ``): Images gallery props options (see `MazGallery` component).
|
|
297
|
+
- `scale` (`boolean`): scale animation on hover (only linked cards).
|
|
298
|
+
- `elevation` (`boolean`): Set elevation to card (box-shadow).
|
|
299
|
+
- `radius` (`boolean`): Set radius to card.
|
|
300
|
+
- `bordered` (`boolean`): Set border to card (in dark mode, the card is always bordered).
|
|
301
|
+
- `wrapper-class` (`ClassValue`): add classes to wrapper.
|
|
302
|
+
- `padding` (`boolean`): Remove padding from content wrapper.
|
|
303
|
+
- `overflow-hidden` (`boolean`): Hide overflow.
|
|
304
|
+
- `collapsible` (`boolean`, default: `false`): Make card collapsible.
|
|
305
|
+
- `collapse-open` (`boolean`, default: `false`, `v-model:collapse-open`): Card is open by default if `true`.
|
|
306
|
+
- `title` (`string`): Title of the card in header.
|
|
307
|
+
- `block` (`boolean`): The card will be displayed in full width.
|
|
308
|
+
|
|
309
|
+
### Events
|
|
310
|
+
|
|
311
|
+
- `@update:collapseOpen` (payload: `unknown[`): Update the collapseOpen model
|
|
312
|
+
|
|
313
|
+
### Slots
|
|
314
|
+
|
|
315
|
+
- `#title`: The title of the card
|
|
316
|
+
- `#content-title`: The title of the card Bindings: `collapseOpen: boolean` (The collapse open state of the card).
|
|
317
|
+
- `#content-subtitle`: The subtitle of the card
|
|
318
|
+
- `#content-body`: The body of the card
|
|
319
|
+
- `#default`: The content of the card Bindings: `collapseOpen: boolean` (The collapse open state of the card).
|
|
320
|
+
- `#footer`: The footer of the card
|
|
321
|
+
- `#actions`: The actions of the image gallery (only if gallery is displayed)
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazCarousel"
|
|
3
|
+
description: "MazCarousel is a standalone component to display and manage items in a row"
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-carousel"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazCarousel
|
|
9
|
+
|
|
10
|
+
> MazCarousel is a standalone component to display and manage items in a row
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazCarousel from 'maz-ui/components/MazCarousel'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-carousel
|
|
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 lang="ts" setup>
|
|
27
|
+
import MazCarousel from 'maz-ui/components/MazCarousel'
|
|
28
|
+
import MazCard from 'maz-ui/components/MazCard'
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<MazCarousel title="Carousel title">
|
|
33
|
+
<MazCard
|
|
34
|
+
v-for="(item, i) in Array(8)"
|
|
35
|
+
:key="i"
|
|
36
|
+
:gallery="{
|
|
37
|
+
images: [
|
|
38
|
+
'https://placedog.net/250/300?random',
|
|
39
|
+
],
|
|
40
|
+
}"
|
|
41
|
+
style="min-width: 250px;"
|
|
42
|
+
>
|
|
43
|
+
<template #title>
|
|
44
|
+
<h4 class="m-0">
|
|
45
|
+
Doggo
|
|
46
|
+
</h4>
|
|
47
|
+
</template>
|
|
48
|
+
<template #content-body>
|
|
49
|
+
<p class="text-muted" style="margin-bottom: 0;">
|
|
50
|
+
It's a beautifull doggo, no ?
|
|
51
|
+
</p>
|
|
52
|
+
</template>
|
|
53
|
+
</MazCard>
|
|
54
|
+
</MazCarousel>
|
|
55
|
+
</template>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Options
|
|
59
|
+
|
|
60
|
+
### hide-scrollbar
|
|
61
|
+
|
|
62
|
+
This options will display the component without scrollbar only when the component is not hovered, focused or active
|
|
63
|
+
|
|
64
|
+
```vue
|
|
65
|
+
<script lang="ts" setup>
|
|
66
|
+
import MazCarousel from 'maz-ui/components/MazCarousel'
|
|
67
|
+
import MazCard from 'maz-ui/components/MazCard'
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<MazCarousel hide-scrollbar>
|
|
72
|
+
<template #title>
|
|
73
|
+
<h4 class="text-2xl font-bold">Carousel</h4>
|
|
74
|
+
</template>
|
|
75
|
+
<MazCard
|
|
76
|
+
v-for="(item, i) in Array(8)"
|
|
77
|
+
:key="i"
|
|
78
|
+
:gallery="{
|
|
79
|
+
images: [
|
|
80
|
+
'https://placedog.net/400/200?random'
|
|
81
|
+
]
|
|
82
|
+
}"
|
|
83
|
+
style="min-width: 250px;"
|
|
84
|
+
>
|
|
85
|
+
<template #content-title>
|
|
86
|
+
<h4 class="m-0">
|
|
87
|
+
Doggo
|
|
88
|
+
</h4>
|
|
89
|
+
</template>
|
|
90
|
+
<template #content-body>
|
|
91
|
+
<p class="text-muted" style="margin-bottom: 0;">
|
|
92
|
+
It's a beautifull doggo, no ?
|
|
93
|
+
</p>
|
|
94
|
+
</template>
|
|
95
|
+
</MazCard>
|
|
96
|
+
</MazCarousel>
|
|
97
|
+
</template>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### hide-scroll-buttons
|
|
101
|
+
|
|
102
|
+
This options will display the component without scroll buttons
|
|
103
|
+
|
|
104
|
+
```vue
|
|
105
|
+
<script lang="ts" setup>
|
|
106
|
+
import MazCarousel from 'maz-ui/components/MazCarousel'
|
|
107
|
+
import MazCard from 'maz-ui/components/MazCard'
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<template>
|
|
111
|
+
<MazCarousel hide-scroll-buttons title="Carousel without scroll buttons">
|
|
112
|
+
<MazCard
|
|
113
|
+
v-for="(item, i) in Array(8)"
|
|
114
|
+
:key="i"
|
|
115
|
+
:gallery="{
|
|
116
|
+
images: [
|
|
117
|
+
'https://placedog.net/300/200'
|
|
118
|
+
]
|
|
119
|
+
}"
|
|
120
|
+
style="min-width: 250px;"
|
|
121
|
+
>
|
|
122
|
+
<template #content-title>
|
|
123
|
+
<h4 class="m-0">
|
|
124
|
+
Doggo
|
|
125
|
+
</h4>
|
|
126
|
+
</template>
|
|
127
|
+
<template #content-body>
|
|
128
|
+
<p class="text-muted" style="margin-bottom: 0;">
|
|
129
|
+
It's a beautifull doggo, no ?
|
|
130
|
+
</p>
|
|
131
|
+
</template>
|
|
132
|
+
</MazCard>
|
|
133
|
+
</MazCarousel>
|
|
134
|
+
</template>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## MazCarousel API
|
|
138
|
+
|
|
139
|
+
`import MazCarousel from 'maz-ui/components/MazCarousel'`
|
|
140
|
+
|
|
141
|
+
### Props
|
|
142
|
+
|
|
143
|
+
- `hide-scroll-buttons` (`boolean`, default: `false`): Hide display the scroll buttons.
|
|
144
|
+
- `translations` (`{ ariaLabel?: { previousButton?: string | undefined; nextButton?: string | undefined; } | undefined; }`, default: `Translations from`): Translations of the carousel.
|
|
145
|
+
- `hide-scrollbar` (`boolean`, default: `false`): Hide the scrollbar when not active.
|
|
146
|
+
- `title` (`string`): The title of the carousel.
|
|
147
|
+
|
|
148
|
+
### Slots
|
|
149
|
+
|
|
150
|
+
- `#title`
|
|
151
|
+
- `#previous-icon`
|
|
152
|
+
- `#next-icon`
|
|
153
|
+
- `#default`
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazChart"
|
|
3
|
+
description: "MazChart is a standalone component which generates graphics & charts with chart.js"
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-chart"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazChart
|
|
9
|
+
|
|
10
|
+
> MazChart is a standalone component which generates graphics & charts with chart.js
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazChart from 'maz-ui/components/MazChart'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-chart
|
|
16
|
+
|
|
17
|
+
## Documentation
|
|
18
|
+
|
|
19
|
+
Follow the [Chart.JS](https://www.chartjs.org/docs/latest/) documentation to create your own chart.
|
|
20
|
+
|
|
21
|
+
You can use all the plugins of Chart.JS. Follow the examples below.
|
|
22
|
+
|
|
23
|
+
**Tip: Performance**
|
|
24
|
+
|
|
25
|
+
`MazChart` lazy-loads `chart.js` on mount and registers only the controllers, elements and scales needed for the chart `type` you requested. A `<MazChart type="pie">` won't pull `BarController`, `LineElement` or any other unused module. The chart instance is also held outside Vue's reactivity (`shallowRef` + `markRaw`) - this avoids accidental deep proxying of the underlying chart and the freezes that can come with it on large datasets.
|
|
26
|
+
|
|
27
|
+
When `data` or `options` change after the initial render, `chart.update()` is called with `'none'` by default so updates don't animate. Pass `update-mode="default"` (or any other Chart.js update mode) to opt back into animations.
|
|
28
|
+
|
|
29
|
+
## Bar chart
|
|
30
|
+
|
|
31
|
+
**Details: View code**
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
import dataLabels from 'chartjs-plugin-datalabels'
|
|
36
|
+
|
|
37
|
+
const barChart = {
|
|
38
|
+
type: 'bar',
|
|
39
|
+
data: {
|
|
40
|
+
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
|
|
41
|
+
datasets: [{
|
|
42
|
+
label: 'My First Dataset',
|
|
43
|
+
data: [65, 59, 80, 81, 56, 55, 40],
|
|
44
|
+
backgroundColor: [
|
|
45
|
+
'rgba(255, 99, 132, 0.2)',
|
|
46
|
+
'rgba(255, 159, 64, 0.2)',
|
|
47
|
+
'rgba(255, 205, 86, 0.2)',
|
|
48
|
+
'rgba(75, 192, 192, 0.2)',
|
|
49
|
+
'rgba(54, 162, 235, 0.2)',
|
|
50
|
+
'rgba(153, 102, 255, 0.2)',
|
|
51
|
+
'rgba(201, 203, 207, 0.2)'
|
|
52
|
+
],
|
|
53
|
+
borderColor: [
|
|
54
|
+
'rgb(255, 99, 132)',
|
|
55
|
+
'rgb(255, 159, 64)',
|
|
56
|
+
'rgb(255, 205, 86)',
|
|
57
|
+
'rgb(75, 192, 192)',
|
|
58
|
+
'rgb(54, 162, 235)',
|
|
59
|
+
'rgb(153, 102, 255)',
|
|
60
|
+
'rgb(201, 203, 207)'
|
|
61
|
+
],
|
|
62
|
+
borderWidth: 1
|
|
63
|
+
}]
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<template>
|
|
69
|
+
<MazChart
|
|
70
|
+
:type="barChart.type"
|
|
71
|
+
:data="barChart.data"
|
|
72
|
+
:options="barChart.options"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Pie chart
|
|
78
|
+
|
|
79
|
+
**Details: View code**
|
|
80
|
+
|
|
81
|
+
```vue
|
|
82
|
+
<script setup lang="ts">
|
|
83
|
+
const pieChart = {
|
|
84
|
+
type: 'doughnut',
|
|
85
|
+
data: {
|
|
86
|
+
labels: [
|
|
87
|
+
`Perfects - ${40}%`,
|
|
88
|
+
`Bons - ${35}%`,
|
|
89
|
+
`Mauvais - ${25}%`,
|
|
90
|
+
],
|
|
91
|
+
datasets: [
|
|
92
|
+
{
|
|
93
|
+
backgroundColor: [
|
|
94
|
+
'#fcb731',
|
|
95
|
+
'rgb(28 209 161)',
|
|
96
|
+
'rgb(255, 109, 106)',
|
|
97
|
+
],
|
|
98
|
+
data: [
|
|
99
|
+
40,
|
|
100
|
+
35,
|
|
101
|
+
25,
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<template>
|
|
110
|
+
<MazChart
|
|
111
|
+
:type="pieChart.type"
|
|
112
|
+
:data="pieChart.data"
|
|
113
|
+
/>
|
|
114
|
+
</template>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Line chart
|
|
118
|
+
|
|
119
|
+
**Details: View code**
|
|
120
|
+
|
|
121
|
+
```vue
|
|
122
|
+
<script setup lang="ts">
|
|
123
|
+
import dataLabels from 'chartjs-plugin-datalabels'
|
|
124
|
+
|
|
125
|
+
let delayed: boolean
|
|
126
|
+
|
|
127
|
+
const animation = {
|
|
128
|
+
onComplete: () => {
|
|
129
|
+
delayed = true
|
|
130
|
+
},
|
|
131
|
+
delay: (context: Record<string, any>) => {
|
|
132
|
+
let delay = 0
|
|
133
|
+
if (context.type === 'data' && context.mode === 'default' && !delayed) {
|
|
134
|
+
delay = context.dataIndex * 100 + context.datasetIndex * 50
|
|
135
|
+
}
|
|
136
|
+
return delay
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const lineChart = {
|
|
141
|
+
type: 'line',
|
|
142
|
+
// locally registered and available for this chart
|
|
143
|
+
plugins: [dataLabels],
|
|
144
|
+
data: {
|
|
145
|
+
labels: [1, 2, 3, 4, 5, 6],
|
|
146
|
+
datasets: [
|
|
147
|
+
{
|
|
148
|
+
label: 'Moyenne des bons pronos du groupe',
|
|
149
|
+
data: [10, 15, 20, 25, 30, 35],
|
|
150
|
+
fill: false,
|
|
151
|
+
borderColor: 'rgb(28 209 161)',
|
|
152
|
+
tension: 0.5,
|
|
153
|
+
backgroundColor: '#17a2b8',
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: 'Vos bons pronos',
|
|
157
|
+
data: [10, 15, 20, 25, 30, 35],
|
|
158
|
+
fill: false,
|
|
159
|
+
borderColor: '#333',
|
|
160
|
+
tension: 0.5,
|
|
161
|
+
backgroundColor: '#1e90ff',
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
options: {
|
|
166
|
+
plugins: {
|
|
167
|
+
datalabels: {
|
|
168
|
+
backgroundColor: (context: Record<string, any>) => {
|
|
169
|
+
return context.dataset.backgroundColor
|
|
170
|
+
},
|
|
171
|
+
borderRadius: 4,
|
|
172
|
+
color: 'white',
|
|
173
|
+
font: {
|
|
174
|
+
weight: 'bold',
|
|
175
|
+
},
|
|
176
|
+
padding: 6,
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
animation,
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
</script>
|
|
183
|
+
|
|
184
|
+
<template>
|
|
185
|
+
<MazChart v-bind="lineChart" />
|
|
186
|
+
</template>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```vue
|
|
190
|
+
<MazChart type="bar" :data="data" aria-label="Sales by quarter, from 120 to 340 units" />
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
interface MazChartProps<
|
|
195
|
+
T extends ChartType = ChartType,
|
|
196
|
+
TData = DefaultDataPoint<T>,
|
|
197
|
+
TLabel = unknown,
|
|
198
|
+
> {
|
|
199
|
+
type: T
|
|
200
|
+
data: ChartData<T, TData, TLabel>
|
|
201
|
+
options?: ChartOptions<T>
|
|
202
|
+
plugins?: Plugin[]
|
|
203
|
+
datasetIdKey?: string
|
|
204
|
+
updateMode?: UpdateMode
|
|
205
|
+
}
|
|
206
|
+
```
|