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.
Files changed (186) hide show
  1. package/dist/assets/{MazDropzone.DJ8au25t.css → MazDropzone.BW2grpTi.css} +1 -1
  2. package/dist/chunks/{MazDrawer.DANxKYxJ.js → MazDrawer.CC8zomfx.js} +2 -2
  3. package/dist/chunks/{MazDropzone.POH3pmfi.js → MazDropzone.Dez5j0WP.js} +2 -2
  4. package/dist/components/MazDrawer.js +1 -1
  5. package/dist/components/MazDropzone.js +1 -1
  6. package/dist/components/MazDropzone.vue.d.ts +2 -2
  7. package/dist/components/MazInputPrice.vue.d.ts +1 -1
  8. package/dist/components/index.js +2 -2
  9. package/docs/README.md +207 -0
  10. package/docs/agents/agents-md.md +52 -0
  11. package/docs/agents/claude-rule.md +52 -0
  12. package/docs/components/maz-accordion.md +76 -0
  13. package/docs/components/maz-alert.md +241 -0
  14. package/docs/components/maz-animated-counter.md +87 -0
  15. package/docs/components/maz-animated-element.md +46 -0
  16. package/docs/components/maz-animated-text.md +53 -0
  17. package/docs/components/maz-avatar.md +193 -0
  18. package/docs/components/maz-backdrop.md +178 -0
  19. package/docs/components/maz-badge.md +167 -0
  20. package/docs/components/maz-bottom-sheet.md +257 -0
  21. package/docs/components/maz-btn-group.md +316 -0
  22. package/docs/components/maz-btn.md +423 -0
  23. package/docs/components/maz-card-spotlight.md +84 -0
  24. package/docs/components/maz-card.md +321 -0
  25. package/docs/components/maz-carousel.md +153 -0
  26. package/docs/components/maz-chart.md +206 -0
  27. package/docs/components/maz-checkbox.md +138 -0
  28. package/docs/components/maz-checklist.md +251 -0
  29. package/docs/components/maz-circular-progress-bar.md +109 -0
  30. package/docs/components/maz-code-highlight.md +155 -0
  31. package/docs/components/maz-container.md +241 -0
  32. package/docs/components/maz-date-picker.md +791 -0
  33. package/docs/components/maz-dialog-confirm.md +215 -0
  34. package/docs/components/maz-dialog.md +143 -0
  35. package/docs/components/maz-drawer.md +106 -0
  36. package/docs/components/maz-dropdown.md +419 -0
  37. package/docs/components/maz-dropzone.md +387 -0
  38. package/docs/components/maz-expand-animation.md +82 -0
  39. package/docs/components/maz-fullscreen-loader.md +58 -0
  40. package/docs/components/maz-gallery.md +79 -0
  41. package/docs/components/maz-icon.md +203 -0
  42. package/docs/components/maz-input-code.md +73 -0
  43. package/docs/components/maz-input-number.md +79 -0
  44. package/docs/components/maz-input-phone-number.md +536 -0
  45. package/docs/components/maz-input-price.md +68 -0
  46. package/docs/components/maz-input-tags.md +112 -0
  47. package/docs/components/maz-input.md +334 -0
  48. package/docs/components/maz-lazy-img.md +113 -0
  49. package/docs/components/maz-link.md +146 -0
  50. package/docs/components/maz-loading-bar.md +38 -0
  51. package/docs/components/maz-markdown-editor.md +320 -0
  52. package/docs/components/maz-pagination.md +82 -0
  53. package/docs/components/maz-popover.md +794 -0
  54. package/docs/components/maz-pull-to-refresh.md +222 -0
  55. package/docs/components/maz-radio-buttons.md +313 -0
  56. package/docs/components/maz-radio.md +119 -0
  57. package/docs/components/maz-read-more.md +209 -0
  58. package/docs/components/maz-reading-progress-bar.md +96 -0
  59. package/docs/components/maz-select-country.md +513 -0
  60. package/docs/components/maz-select.md +318 -0
  61. package/docs/components/maz-sidebar-content.md +25 -0
  62. package/docs/components/maz-sidebar-footer.md +25 -0
  63. package/docs/components/maz-sidebar-group.md +27 -0
  64. package/docs/components/maz-sidebar-header.md +25 -0
  65. package/docs/components/maz-sidebar-menu-button.md +41 -0
  66. package/docs/components/maz-sidebar-menu-item.md +25 -0
  67. package/docs/components/maz-sidebar-menu-sub.md +32 -0
  68. package/docs/components/maz-sidebar-menu.md +25 -0
  69. package/docs/components/maz-sidebar-separator.md +21 -0
  70. package/docs/components/maz-sidebar-trigger.md +25 -0
  71. package/docs/components/maz-sidebar.md +507 -0
  72. package/docs/components/maz-skeleton.md +226 -0
  73. package/docs/components/maz-slider.md +165 -0
  74. package/docs/components/maz-spinner.md +84 -0
  75. package/docs/components/maz-stepper.md +301 -0
  76. package/docs/components/maz-switch.md +86 -0
  77. package/docs/components/maz-table-cell.md +27 -0
  78. package/docs/components/maz-table-row.md +28 -0
  79. package/docs/components/maz-table-title.md +27 -0
  80. package/docs/components/maz-table-virtualizer.md +31 -0
  81. package/docs/components/maz-table.md +426 -0
  82. package/docs/components/maz-tabs-bar.md +43 -0
  83. package/docs/components/maz-tabs-content-item.md +27 -0
  84. package/docs/components/maz-tabs-content.md +27 -0
  85. package/docs/components/maz-tabs.md +308 -0
  86. package/docs/components/maz-textarea.md +255 -0
  87. package/docs/components/maz-ticker.md +427 -0
  88. package/docs/components/maz-timeline.md +304 -0
  89. package/docs/components/maz-ui-provider.md +26 -0
  90. package/docs/components/maz-window-mockup.md +182 -0
  91. package/docs/composables/use-aos.md +41 -0
  92. package/docs/composables/use-breakpoints.md +42 -0
  93. package/docs/composables/use-dialog.md +58 -0
  94. package/docs/composables/use-display-names.md +130 -0
  95. package/docs/composables/use-drag.md +185 -0
  96. package/docs/composables/use-form-validator.md +1123 -0
  97. package/docs/composables/use-idle-timeout.md +172 -0
  98. package/docs/composables/use-pull-to-refresh.md +86 -0
  99. package/docs/composables/use-reading-time.md +132 -0
  100. package/docs/composables/use-string-matching.md +41 -0
  101. package/docs/composables/use-swipe.md +171 -0
  102. package/docs/composables/use-timer.md +104 -0
  103. package/docs/composables/use-toast.md +50 -0
  104. package/docs/composables/use-user-visibility.md +127 -0
  105. package/docs/composables/use-wait.md +50 -0
  106. package/docs/composables/use-window-size.md +25 -0
  107. package/docs/directives/click-outside.md +182 -0
  108. package/docs/directives/fullscreen-img.md +83 -0
  109. package/docs/directives/lazy-img.md +182 -0
  110. package/docs/directives/tooltip.md +298 -0
  111. package/docs/directives/zoom-img.md +100 -0
  112. package/docs/ecosystem/eslint-config.md +289 -0
  113. package/docs/ecosystem/icons/icon-set.md +25 -0
  114. package/docs/ecosystem/icons/index.md +584 -0
  115. package/docs/ecosystem/mcp.md +165 -0
  116. package/docs/ecosystem/node/exec-promise.md +93 -0
  117. package/docs/ecosystem/node/index.md +53 -0
  118. package/docs/ecosystem/node/logger.md +152 -0
  119. package/docs/ecosystem/node/print-banner.md +101 -0
  120. package/docs/ecosystem/node/setup-agents.md +102 -0
  121. package/docs/ecosystem/nuxt.md +551 -0
  122. package/docs/ecosystem/stylelint-config.md +310 -0
  123. package/docs/ecosystem/themes.md +966 -0
  124. package/docs/ecosystem/translations.md +1173 -0
  125. package/docs/ecosystem/utils/camel-case.md +37 -0
  126. package/docs/ecosystem/utils/capitalize.md +37 -0
  127. package/docs/ecosystem/utils/check-availability.md +85 -0
  128. package/docs/ecosystem/utils/cookie.md +86 -0
  129. package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
  130. package/docs/ecosystem/utils/currency.md +53 -0
  131. package/docs/ecosystem/utils/date.md +53 -0
  132. package/docs/ecosystem/utils/debounce-callback.md +44 -0
  133. package/docs/ecosystem/utils/debounce-id.md +75 -0
  134. package/docs/ecosystem/utils/debounce.md +71 -0
  135. package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
  136. package/docs/ecosystem/utils/format-json.md +39 -0
  137. package/docs/ecosystem/utils/format-phone-number.md +43 -0
  138. package/docs/ecosystem/utils/get-browser-locale.md +35 -0
  139. package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
  140. package/docs/ecosystem/utils/get-error-message.md +45 -0
  141. package/docs/ecosystem/utils/idle-timeout.md +96 -0
  142. package/docs/ecosystem/utils/index.md +57 -0
  143. package/docs/ecosystem/utils/is-client.md +38 -0
  144. package/docs/ecosystem/utils/is-equal.md +44 -0
  145. package/docs/ecosystem/utils/is-ios.md +43 -0
  146. package/docs/ecosystem/utils/is-server.md +37 -0
  147. package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
  148. package/docs/ecosystem/utils/kebab-case.md +42 -0
  149. package/docs/ecosystem/utils/normalize-string.md +83 -0
  150. package/docs/ecosystem/utils/number.md +51 -0
  151. package/docs/ecosystem/utils/pascal-case.md +41 -0
  152. package/docs/ecosystem/utils/prevent-ios-input-zoom.md +72 -0
  153. package/docs/ecosystem/utils/script-loader.md +85 -0
  154. package/docs/ecosystem/utils/sleep.md +65 -0
  155. package/docs/ecosystem/utils/snake-case.md +42 -0
  156. package/docs/ecosystem/utils/swipe-handler.md +97 -0
  157. package/docs/ecosystem/utils/textarea-autogrow.md +47 -0
  158. package/docs/ecosystem/utils/throttle-id.md +54 -0
  159. package/docs/ecosystem/utils/throttle.md +63 -0
  160. package/docs/ecosystem/utils/truthy-filter.md +37 -0
  161. package/docs/ecosystem/utils/types/deep-key-of.md +54 -0
  162. package/docs/ecosystem/utils/types/deep-partial.md +48 -0
  163. package/docs/ecosystem/utils/types/deep-required.md +45 -0
  164. package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
  165. package/docs/ecosystem/utils/types/generic-instance-type.md +48 -0
  166. package/docs/ecosystem/utils/types/infer-maybe-ref.md +41 -0
  167. package/docs/ecosystem/utils/upper-first.md +38 -0
  168. package/docs/ecosystem/utils/user-visibility.md +75 -0
  169. package/docs/guide/ai-agents.md +237 -0
  170. package/docs/guide/browser-support.md +88 -0
  171. package/docs/guide/getting-started.md +191 -0
  172. package/docs/guide/global-defaults.md +103 -0
  173. package/docs/guide/maz-ui-provider.md +231 -0
  174. package/docs/guide/migration-v5.md +871 -0
  175. package/docs/guide/resolvers.md +650 -0
  176. package/docs/guide/tailwind.md +483 -0
  177. package/docs/guide/vue.md +286 -0
  178. package/docs/manifest.json +1 -0
  179. package/docs/plugins/aos.md +312 -0
  180. package/docs/plugins/dialog.md +269 -0
  181. package/docs/plugins/toast.md +221 -0
  182. package/docs/plugins/wait.md +78 -0
  183. package/docs/reference/icons.md +46 -0
  184. package/docs/reference/tailwind-tokens.md +191 -0
  185. package/docs/rules.md +57 -0
  186. package/package.json +31 -4
@@ -0,0 +1,791 @@
1
+ ---
2
+ title: "MazDatePicker"
3
+ description: "A powerful and flexible date picker component with support for single dates, date ranges, time selection, and extensive customization options"
4
+ package: "maz-ui"
5
+ url: "https://maz-ui.com/components/maz-date-picker"
6
+ ---
7
+
8
+ # MazDatePicker
9
+
10
+ > A powerful and flexible date picker component with support for single dates, date ranges, time selection, and extensive customization options
11
+
12
+ - Package: `maz-ui`
13
+ - Import: `import MazDatePicker from 'maz-ui/components/MazDatePicker'`
14
+ - Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
15
+ - Web: https://maz-ui.com/components/maz-date-picker
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
+ ## Table of Contents
24
+
25
+ - Basic Usage
26
+ - Date Formats
27
+ - Date Selection
28
+ - Custom Trigger
29
+ - Time Selection
30
+ - Range Selection
31
+ - Internationalization
32
+ - Validation & Constraints
33
+ - Types
34
+ - Props
35
+ - Events
36
+ - Slots
37
+
38
+ ## Basic Usage
39
+
40
+ The simplest way to use MazDatePicker:
41
+
42
+ ```vue
43
+ <template>
44
+ <MazDatePicker
45
+ v-model="date"
46
+ label="Select a date"
47
+ placeholder="Choose your date"
48
+ format="YYYY-MM-DD"
49
+ />
50
+ </template>
51
+
52
+ <script setup>
53
+ import { ref } from 'vue'
54
+
55
+ const date = ref()
56
+ </script>
57
+ ```
58
+
59
+ ## Date Formats
60
+
61
+ Understanding date formats is crucial for using MazDatePicker effectively. The component uses two different format concepts:
62
+
63
+ ### 1. Data Format (`format` prop)
64
+
65
+ This controls how dates are stored and transmitted in your `v-model`. Default is `'YYYY-MM-DD'`.
66
+
67
+ ### 2. Display Format (`input-date-format` prop)
68
+
69
+ This controls how dates appear in the input field using `Intl.DateTimeFormatOptions`.
70
+
71
+ ```vue
72
+ <template>
73
+ <!-- ISO Format (recommended) -->
74
+ <MazDatePicker
75
+ v-model="date1"
76
+ label="ISO Format (YYYY-MM-DD)"
77
+ format="YYYY-MM-DD"
78
+ :input-date-format="{ dateStyle: 'medium' }"
79
+ />
80
+
81
+ <!-- US Format -->
82
+ <MazDatePicker
83
+ v-model="date2"
84
+ label="US Format (MM/DD/YYYY)"
85
+ format="MM/DD/YYYY"
86
+ :input-date-format="{ dateStyle: 'short' }"
87
+ />
88
+
89
+ <!-- European Format -->
90
+ <MazDatePicker
91
+ v-model="date3"
92
+ label="European Format (DD-MM-YYYY)"
93
+ format="DD-MM-YYYY"
94
+ :input-date-format="{ dateStyle: 'medium' }"
95
+ />
96
+ </template>
97
+
98
+ <script setup>
99
+ import { ref } from 'vue'
100
+
101
+ const date1 = ref('2024-03-15') // ISO format
102
+ const date2 = ref('03/15/2024') // US format
103
+ const date3 = ref('15-03-2024') // European format
104
+ </script>
105
+ ```
106
+
107
+ ### Custom Display Transformation
108
+
109
+ Use `inputDateTransformer` to completely customize how dates appear in the input:
110
+
111
+ ```vue
112
+ <template>
113
+ <MazDatePicker
114
+ v-model="date"
115
+ label="Custom Display Format"
116
+ :input-date-transformer="transformDate"
117
+ />
118
+ </template>
119
+
120
+ <script setup>
121
+ import { ref } from 'vue'
122
+ import dayjs from 'dayjs'
123
+
124
+ const date = ref()
125
+
126
+ const transformDate = ({ value }) => {
127
+ return value ? `📅 ${dayjs(value).format('dddd, MMMM Do YYYY')}` : ''
128
+ }
129
+ </script>
130
+ ```
131
+
132
+ ## Date Selection
133
+
134
+ ### Standard Date Picker
135
+
136
+ ```vue
137
+ <template>
138
+ <MazDatePicker
139
+ v-model="date"
140
+ label="Select Date"
141
+ color="primary"
142
+ auto-close
143
+ />
144
+ </template>
145
+
146
+ <script setup>
147
+ import { ref } from 'vue'
148
+
149
+ const date = ref()
150
+ </script>
151
+ ```
152
+
153
+ ### Inline Date Picker
154
+
155
+ Perfect for dashboards or when you want the calendar always visible:
156
+
157
+ ```vue
158
+ <template>
159
+ <MazDatePicker
160
+ v-model="date"
161
+ inline
162
+ color="secondary"
163
+ />
164
+ </template>
165
+
166
+ <script setup>
167
+ import { ref } from 'vue'
168
+
169
+ const date = ref()
170
+ </script>
171
+ ```
172
+
173
+ ### Double Calendar
174
+
175
+ Show two months at once for better date selection:
176
+
177
+ ```vue
178
+ <template>
179
+ <MazDatePicker
180
+ v-model="date"
181
+ label="Double Calendar"
182
+ double
183
+ color="success"
184
+ />
185
+ </template>
186
+
187
+ <script setup>
188
+ import { ref } from 'vue'
189
+
190
+ const date = ref()
191
+ </script>
192
+ ```
193
+
194
+ ## Custom Trigger
195
+
196
+ By default MazDatePicker renders a readonly `MazInput` as the field that opens the calendar. Use the `#trigger` slot to replace it with your own element - a button, a custom input, an icon... Clicking the slotted element opens the calendar automatically (no `@click` needed), and the slot exposes the current open state plus functions for programmatic control.
197
+
198
+ ### Slot bindings
199
+
200
+ | Binding | Type | Description |
201
+ | --- | --- | --- |
202
+ | `is-open` | `boolean` | Whether the calendar is currently open |
203
+ | `open` | `() => void` | Open the calendar programmatically |
204
+ | `close` | `() => void` | Close the calendar programmatically |
205
+ | `toggle` | `() => void` | Toggle the calendar programmatically |
206
+
207
+ ```vue
208
+ <template>
209
+ <MazDatePicker v-model="date" auto-close>
210
+ <!-- Clicking the button opens the picker automatically. -->
211
+ <template #trigger="{ isOpen }">
212
+ <MazBtn color="secondary" :class="{ 'ring-2 ring-secondary': isOpen }">
213
+ {{ date || 'Pick a date' }}
214
+ </MazBtn>
215
+ </template>
216
+ </MazDatePicker>
217
+ </template>
218
+
219
+ <script setup>
220
+ import { ref } from 'vue'
221
+
222
+ const date = ref()
223
+ </script>
224
+ ```
225
+
226
+ **Tip:**
227
+
228
+ The model value is not passed through the slot - use your own `v-model` ref (here `date`) to display the selected value in your custom trigger. The exposed `open` / `close` / `toggle` functions are only needed when you want to drive the picker from your own logic.
229
+
230
+ > In `inline` mode the calendar is always visible, so the `trigger` slot is not rendered. To open the picker from an element rendered outside the component, use the `custom-element-selector` prop instead.
231
+
232
+ ## Time Selection
233
+
234
+ ### Date + Time (24h format)
235
+
236
+ ```vue
237
+ <template>
238
+ <MazDatePicker
239
+ v-model="dateTime"
240
+ label="Date & Time (24h)"
241
+ format="YYYY-MM-DD HH:mm"
242
+ time
243
+ color="info"
244
+ />
245
+ </template>
246
+
247
+ <script setup>
248
+ import { ref } from 'vue'
249
+
250
+ const dateTime = ref()
251
+ </script>
252
+ ```
253
+
254
+ ### Date + Time (12h format)
255
+
256
+ ```vue
257
+ <template>
258
+ <MazDatePicker
259
+ v-model="dateTime"
260
+ label="Date & Time (12h)"
261
+ format="YYYY-MM-DD hh:mm a"
262
+ time
263
+ color="warning"
264
+ />
265
+ </template>
266
+
267
+ <script setup>
268
+ import { ref } from 'vue'
269
+
270
+ const dateTime = ref()
271
+ </script>
272
+ ```
273
+
274
+ ### Time Only Selection
275
+
276
+ ```vue
277
+ <template>
278
+ <!-- 24h format -->
279
+ <MazDatePicker
280
+ v-model="time24"
281
+ label="Time Only (24h)"
282
+ format="HH:mm"
283
+ only-time
284
+ color="accent"
285
+ />
286
+
287
+ <!-- 12h format -->
288
+ <MazDatePicker
289
+ v-model="time12"
290
+ label="Time Only (12h)"
291
+ format="hh:mm a"
292
+ only-time
293
+ color="destructive"
294
+ />
295
+ </template>
296
+
297
+ <script setup>
298
+ import { ref } from 'vue'
299
+
300
+ const time24 = ref('14:30')
301
+ const time12 = ref('02:30 pm')
302
+ </script>
303
+ ```
304
+
305
+ ### Custom Minute Intervals
306
+
307
+ ```vue
308
+ <template>
309
+ <MazDatePicker
310
+ v-model="time1"
311
+ label="5min intervals"
312
+ format="HH:mm"
313
+ :minute-interval="5"
314
+ only-time
315
+ />
316
+
317
+ <MazDatePicker
318
+ v-model="time2"
319
+ label="15min intervals"
320
+ format="HH:mm"
321
+ :minute-interval="15"
322
+ only-time
323
+ />
324
+
325
+ <MazDatePicker
326
+ v-model="time3"
327
+ label="30min intervals"
328
+ format="HH:mm"
329
+ :minute-interval="30"
330
+ only-time
331
+ />
332
+ </template>
333
+
334
+ <script setup>
335
+ import { ref } from 'vue'
336
+
337
+ const time1 = ref()
338
+ const time2 = ref()
339
+ const time3 = ref()
340
+ </script>
341
+ ```
342
+
343
+ ## Range Selection
344
+
345
+ For selecting date ranges, pass an object with `start` and `end` properties:
346
+
347
+ ```vue
348
+ <template>
349
+ <MazDatePicker
350
+ v-model="range"
351
+ label="Select Date Range"
352
+ range
353
+ double
354
+ auto-close
355
+ color="primary"
356
+ />
357
+ </template>
358
+
359
+ <script setup>
360
+ import { ref } from 'vue'
361
+
362
+ const range = ref({
363
+ start: undefined,
364
+ end: undefined
365
+ })
366
+ </script>
367
+ ```
368
+
369
+ ### Range with Shortcuts
370
+
371
+ Provide predefined shortcuts for common date ranges:
372
+
373
+ ```vue
374
+ <template>
375
+ <MazDatePicker
376
+ v-model="range"
377
+ label="Range with Shortcuts"
378
+ range
379
+ double
380
+ :shortcuts="shortcuts"
381
+ color="secondary"
382
+ />
383
+ </template>
384
+
385
+ <script setup>
386
+ import { ref } from 'vue'
387
+ import dayjs from 'dayjs'
388
+
389
+ const range = ref({
390
+ start: undefined,
391
+ end: undefined
392
+ })
393
+
394
+ const shortcuts = [
395
+ {
396
+ label: 'Today',
397
+ identifier: 'today',
398
+ value: {
399
+ start: dayjs().format('YYYY-MM-DD'),
400
+ end: dayjs().format('YYYY-MM-DD')
401
+ }
402
+ },
403
+ {
404
+ label: 'Last 7 days',
405
+ identifier: 'last7days',
406
+ value: {
407
+ start: dayjs().subtract(6, 'day').format('YYYY-MM-DD'),
408
+ end: dayjs().format('YYYY-MM-DD')
409
+ }
410
+ },
411
+ {
412
+ label: 'This month',
413
+ identifier: 'thisMonth',
414
+ value: {
415
+ start: dayjs().startOf('month').format('YYYY-MM-DD'),
416
+ end: dayjs().endOf('month').format('YYYY-MM-DD')
417
+ }
418
+ }
419
+ ]
420
+ </script>
421
+ ```
422
+
423
+ ### Property `shortcuts`
424
+
425
+ #### Model
426
+
427
+ ```ts
428
+ interface MazDatePickerShortcut {
429
+ identifier: string // should be uniq
430
+ label: string
431
+ value: {
432
+ start: string
433
+ end: string
434
+ }
435
+ }
436
+
437
+ type MazDatePickerShortcuts = MazDatePickerShortcut[]
438
+ ```
439
+
440
+ #### Example
441
+
442
+ ```ts
443
+ import type { MazDatePickerShortcut } from 'maz-ui/components'
444
+
445
+ const shortcuts: MazDatePickerShortcut[] = [{
446
+ label: 'Next month',
447
+ identifier: 'nextMonth',
448
+ value: {
449
+ start: dayjs().add(1, 'month').set('date', 1).format('YYYY-MM-DD'),
450
+ end: dayjs()
451
+ .add(1, 'month')
452
+ .set('date', dayjs().add(1, 'month').daysInMonth())
453
+ .format('YYYY-MM-DD'),
454
+ },
455
+ }]
456
+ ```
457
+
458
+ **Details: View default shortcuts**
459
+
460
+ ```ts
461
+ const shortcuts = [
462
+ {
463
+ label: 'Last 7 days',
464
+ identifier: 'last7Days',
465
+ value: {
466
+ start: dayjs().subtract(6, 'day').format('YYYY-MM-DD'),
467
+ end: dayjs().format('YYYY-MM-DD'),
468
+ },
469
+ },
470
+ {
471
+ label: 'Last 30 days',
472
+ identifier: 'last30Days',
473
+ value: {
474
+ start: dayjs().subtract(29, 'day').format('YYYY-MM-DD'),
475
+ end: dayjs().format('YYYY-MM-DD'),
476
+ },
477
+ },
478
+ {
479
+ label: 'This week',
480
+ identifier: 'thisWeek',
481
+ value: {
482
+ start: dayjs().startOf('week').format('YYYY-MM-DD'),
483
+ end: dayjs().endOf('week').format('YYYY-MM-DD'),
484
+ },
485
+ },
486
+ {
487
+ label: 'Last week',
488
+ identifier: 'lastWeek',
489
+ value: {
490
+ start: dayjs()
491
+ .subtract(1, 'week')
492
+ .startOf('week')
493
+ .format('YYYY-MM-DD'),
494
+ end: dayjs().subtract(1, 'week').endOf('week').format('YYYY-MM-DD'),
495
+ },
496
+ },
497
+ {
498
+ label: 'This month',
499
+ identifier: 'thisMonth',
500
+ value: {
501
+ start: dayjs().set('date', 1).format('YYYY-MM-DD'),
502
+ end: dayjs()
503
+ .set('date', dayjs().daysInMonth())
504
+ .format('YYYY-MM-DD'),
505
+ },
506
+ },
507
+ {
508
+ label: 'This year',
509
+ identifier: 'thisYear',
510
+ value: {
511
+ start: dayjs().startOf('year').format('YYYY-MM-DD'),
512
+ end: dayjs().endOf('year').format('YYYY-MM-DD'),
513
+ },
514
+ },
515
+ {
516
+ label: 'Last year',
517
+ identifier: 'lastYear',
518
+ value: {
519
+ start: dayjs()
520
+ .subtract(1, 'year')
521
+ .startOf('year')
522
+ .format('YYYY-MM-DD'),
523
+ end: dayjs().subtract(1, 'year').endOf('year').format('YYYY-MM-DD'),
524
+ },
525
+ },
526
+ ]
527
+ ```
528
+
529
+ ## Validation & Constraints
530
+
531
+ ### Min/Max Dates
532
+
533
+ ```vue
534
+ <template>
535
+ <MazDatePicker
536
+ v-model="date"
537
+ label="Limited Date Range"
538
+ :min-date="minDate"
539
+ :max-date="maxDate"
540
+ color="info"
541
+ />
542
+ </template>
543
+
544
+ <script setup>
545
+ import { ref } from 'vue'
546
+ import dayjs from 'dayjs'
547
+
548
+ const date = ref()
549
+ const minDate = dayjs().subtract(30, 'day').format('YYYY-MM-DD')
550
+ const maxDate = dayjs().add(30, 'day').format('YYYY-MM-DD')
551
+ </script>
552
+ ```
553
+
554
+ #### Property `min-max-auto`
555
+
556
+ Disable min-max auto check to not change the value when it is out of range
557
+
558
+ ```vue
559
+ <template>
560
+ <MazDatePicker
561
+ v-model="date"
562
+ label="Not auto date range"
563
+ :min-date="minDate"
564
+ :max-date="maxDate"
565
+ :min-max-auto="false"
566
+ />
567
+ </template>
568
+
569
+ <script setup>
570
+ import { ref } from 'vue'
571
+ import dayjs from 'dayjs'
572
+
573
+ const date = ref()
574
+ const minDate = dayjs().subtract(30, 'day').format('YYYY-MM-DD')
575
+ const maxDate = dayjs().add(30, 'day').format('YYYY-MM-DD')
576
+ </script>
577
+ ```
578
+
579
+ ### Disabled Days & Dates
580
+
581
+ ```vue
582
+ <template>
583
+ <!-- Disable weekends -->
584
+ <MazDatePicker
585
+ v-model="date1"
586
+ label="Weekends Disabled"
587
+ :disabled-weekly="[0, 6]"
588
+ color="warning"
589
+ />
590
+
591
+ <!-- Disable specific dates -->
592
+ <MazDatePicker
593
+ v-model="date2"
594
+ label="Holidays Disabled"
595
+ :disabled-dates="holidays"
596
+ color="destructive"
597
+ />
598
+ </template>
599
+
600
+ <script setup>
601
+ import { ref } from 'vue'
602
+
603
+ const date1 = ref()
604
+ const date2 = ref()
605
+
606
+ // 0 = Sunday, 6 = Saturday
607
+ const weekends = [0, 6]
608
+
609
+ // Specific holiday dates
610
+ const holidays = [
611
+ dayjs().subtract(2, 'day').format('YYYY-MM-DD'),
612
+ dayjs().subtract(1, 'day').format('YYYY-MM-DD'),
613
+ dayjs().format('YYYY-MM-DD'),
614
+ dayjs().add(1, 'day').format('YYYY-MM-DD'),
615
+ dayjs().add(2, 'day').format('YYYY-MM-DD'),
616
+ dayjs().add(3, 'day').format('YYYY-MM-DD'),
617
+ dayjs().add(4, 'day').format('YYYY-MM-DD'),
618
+ ]
619
+ </script>
620
+ ```
621
+
622
+ ### Disabled Hours
623
+
624
+ ```vue
625
+ <template>
626
+ <MazDatePicker
627
+ v-model="dateTime"
628
+ format="YYYY-MM-DD hh:mm a"
629
+ time
630
+ label="Disabled Hours"
631
+ :disabled-hours="disabledHours"
632
+ color="info"
633
+ />
634
+
635
+ <MazDatePicker
636
+ v-model="time"
637
+ format="HH:mm"
638
+ only-time
639
+ label="Disabled Hours"
640
+ :disabled-hours="disabledHours"
641
+ color="info"
642
+ />
643
+ </template>
644
+
645
+ <script setup>
646
+ import { ref } from 'vue'
647
+
648
+ const date = ref()
649
+ const time = ref()
650
+
651
+ const disabledHours = [0, 1, 2, 11, 22, 23]
652
+ </script>
653
+ ```
654
+
655
+ ## Internationalization
656
+
657
+ MazDatePicker supports full internationalization. **By default, it uses the locale from the [MazUiTranslations](../ecosystem/translations.md) plugin**, but you can override it:
658
+
659
+ ```vue
660
+ <template>
661
+ <!-- French -->
662
+ <MazDatePicker
663
+ v-model="frenchDate"
664
+ label="French Locale"
665
+ locale="fr-FR"
666
+ :first-day-of-week="1"
667
+ color="primary"
668
+ />
669
+
670
+ <!-- German -->
671
+ <MazDatePicker
672
+ v-model="germanDate"
673
+ label="German Locale"
674
+ locale="de-DE"
675
+ :first-day-of-week="1"
676
+ color="secondary"
677
+ />
678
+
679
+ <!-- Japanese -->
680
+ <MazDatePicker
681
+ v-model="japaneseDate"
682
+ label="Japanese Locale"
683
+ locale="ja-JP"
684
+ color="accent"
685
+ />
686
+
687
+ <!-- Arabic -->
688
+ <MazDatePicker
689
+ v-model="arabicDate"
690
+ label="Arabic Locale"
691
+ locale="ar-SA"
692
+ :first-day-of-week="6"
693
+ color="warning"
694
+ />
695
+ </template>
696
+
697
+ <script setup>
698
+ import { ref } from 'vue'
699
+
700
+ const frenchDate = ref()
701
+ const germanDate = ref()
702
+ const japaneseDate = ref()
703
+ const arabicDate = ref()
704
+ </script>
705
+ ```
706
+
707
+ ## Types
708
+
709
+ ```typescript
710
+ // Value types
711
+ type MazDatePickerValue = string | undefined | MazDatePickerPartialRangeValue
712
+
713
+ interface MazDatePickerRangeValue {
714
+ start: string
715
+ end: string
716
+ }
717
+
718
+ type MazDatePickerPartialRangeValue = Partial<MazDatePickerRangeValue>
719
+
720
+ // Shortcut type
721
+ interface MazDatePickerShortcut {
722
+ identifier: string
723
+ label: string
724
+ value: {
725
+ start: string
726
+ end: string
727
+ }
728
+ }
729
+ ```
730
+
731
+ ## Accessibility
732
+
733
+ - The input is a `combobox` opening a `dialog` (`aria-haspopup="dialog"`, `aria-expanded`, `aria-controls`).
734
+ - Each month is a `grid` labelled by the month and the year, the days of the week are its column headers and each day has its full date as label (`aria-current="date"` for today, `aria-selected` on the selected days).
735
+ - **Keyboard** in the calendar: only one day is in the tab sequence, the arrows move by day (← →) and by week (↑ ↓), Home / End go to the start / end of the week, Page Up / Page Down to the previous / next month (with Shift: year). Disabled days are skipped and the calendar follows the focus to the displayed month.
736
+ - The navigation buttons labels come from `@maz-ui/translations` (`aria` namespace).
737
+
738
+ ## MazDatePicker API
739
+
740
+ `import MazDatePicker from 'maz-ui/components/MazDatePicker'`
741
+
742
+ ### Props
743
+
744
+ - `id` (`string`): The unique identifier of the component.
745
+ - `input-props` (`MazInputProps<MazInputValue>`): The props to apply to the input component.
746
+ - `model-value` (`MazDatePickerValue`, `v-model`): The value of the date picker component If an object is provided, the picker will be a range picker.
747
+ - `format` (`string`, default: `"YYYY-MM-DD"`): The format pattern for date display and parsing.
748
+ - `open` (`boolean`, default: `false`, `v-model:open`): Controls whether the picker window is open.
749
+ - `label` (`string`): The label text displayed above the input field.
750
+ - `placeholder` (`string`): The placeholder text shown when no value is selected.
751
+ - `input-date-format` (`Intl.DateTimeFormatOptions`, default: `{ dateStyle: "medium", timeStyle: "short" }`): The Intl.DateTimeFormatOptions for styling the input date display.
752
+ - `input-date-transformer` (`((payload: { formattedDate?: string | undefined; value?: MazDatePickerValue; locale: string; }) => string)`): Custom function to transform the formatted date display.
753
+ - `locale` (`string`, default: `""`, `v-model:locale`): The locale string for date formatting and localization.
754
+ - `hide-header` (`boolean`, default: `false`): Controls whether the calendar header is hidden.
755
+ - `disabled` (`boolean`, default: `false`): Controls whether the component is disabled.
756
+ - `first-day-of-week` (`0 | 1 | 2 | 3 | 4 | 5 | 6`, default: `0`): The first day of the week in the calendar. Values: `'0'`, `'1'`, `'2'`, `'3'`, `'4'`, `'5'`, `'6'` (non exhaustive).
757
+ - `auto-close` (`boolean`, default: `false`): Controls whether the picker closes automatically after date selection.
758
+ - `custom-element-selector` (`string`): CSS selector for a custom element that triggers the picker.
759
+ - `double` (`boolean`, default: `false`): Controls whether the picker displays two months side by side.
760
+ - `inline` (`boolean`, default: `false`): Controls whether the picker is displayed inline without input field.
761
+ - `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"primary"`): The color theme of the component.
762
+ - `picker-position` (`MazPopoverPosition`, default: `"auto"`): The position where the picker popover should appear. Values: `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-end'`, `'bottom-end'`, `'left-end'`, `'right-end'`, `'top-start'`, `'bottom-start'`, `'left-start'`, `'right-start'` (non exhaustive).
763
+ - `picker-prefer-position` (`MazPopoverPreferPosition`, default: `"bottom-start"`): The preferred position of the picker popover. Values: `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-end'`, `'bottom-end'`, `'left-end'`, `'right-end'`, `'top-start'`, `'bottom-start'`, `'left-start'`, `'right-start'` (non exhaustive).
764
+ - `picker-fallback-position` (`MazPopoverFallbackPosition`, default: `"top-start"`): The fallback position of the picker popover. Values: `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-end'`, `'bottom-end'`, `'left-end'`, `'right-end'`, `'top-start'`, `'bottom-start'`, `'left-start'`, `'right-start'` (non exhaustive).
765
+ - `time` (`boolean`, default: `false`): Controls whether the picker includes a time selector.
766
+ - `only-time` (`boolean`, default: `false`): Controls whether the picker shows only time selection (no date).
767
+ - `minute-interval` (`number`, default: `5`): The interval in minutes for the time picker minute selection. Values: `'1'`, `'5'`, `'10'`, `'15'`, `'30'` (non exhaustive).
768
+ - `use-browser-locale` (`boolean`, default: `true`): Controls whether to automatically detect and use the browser's locale.
769
+ - `fetch-local` (`boolean`, default: `true`): Controls whether to fetch locale data dynamically.
770
+ - `shortcuts` (`boolean | MazDatePickerShortcut[]`, default: `true`): Array of predefined date range shortcuts or false to disable.
771
+ - `shortcut` (`string`): The identifier of the currently selected shortcut.
772
+ - `min-date` (`string`): The minimum selectable date in ISO format.
773
+ - `max-date` (`string`): The maximum selectable date in ISO format.
774
+ - `min-max-auto` (`boolean`, default: `true`): When minDate or maxDate are provided, if the current date is not between minDate and maxDate, the current date will be set to the minDate or maxDate.
775
+ - `disabled-weekly` (`number[]`, default: `[]`): Array of weekday numbers to disable (0 = Sunday, 6 = Saturday).
776
+ - `disabled-dates` (`string[]`, default: `[]`): Array of specific dates to disable in ISO format.
777
+ - `disabled-hours` (`number[]`, default: `[]`): Array of hour numbers to disable in the time picker (0-23).
778
+ - `block` (`boolean`, default: `false`): Controls whether the input displays in full width.
779
+ - `range` (`boolean`, default: `false`): Controls whether the picker operates in range selection mode.
780
+ - `transition` (`string`, default: `"scale-fade"`): The transition name of the popover.
781
+
782
+ ### Events
783
+
784
+ - `@update:model-value` (payload: `value: MazDatePickerValue`): Emitted when the picker value changes
785
+ - `@close` (payload: `(void | undefined)?`): Emitted when the picker closes
786
+ - `@update:locale` (payload: `value: string`)
787
+ - `@update:open` (payload: `value: boolean`)
788
+
789
+ ### Slots
790
+
791
+ - `#trigger`: Replace the default input with your own element Bindings: `isOpen: boolean` (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).