@maz-ui/mcp 5.0.1-beta.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/README.md +61 -228
- package/bin/maz-ui-mcp.mjs +2 -5
- package/dist/cli.d.mts +7 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.mjs +14 -0
- package/dist/index.d.mts +340 -0
- package/dist/index.d.ts +340 -0
- package/dist/index.mjs +14 -0
- package/dist/shared/mcp.DzqVbCaL.mjs +2346 -0
- 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/{src/components → components}/maz-alert.md +31 -164
- 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/{src/components → components}/maz-badge.md +26 -67
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/{src/components → components}/maz-btn-group.md +26 -189
- package/docs/{src/components → components}/maz-btn.md +60 -245
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/{src/components → components}/maz-card.md +67 -192
- package/docs/components/maz-carousel.md +153 -0
- package/docs/{src/components → components}/maz-chart.md +17 -161
- 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/{src/components → components}/maz-code-highlight.md +15 -93
- package/docs/components/maz-container.md +241 -0
- package/docs/{src/components → components}/maz-date-picker.md +85 -454
- 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/{src/components → components}/maz-dropzone.md +80 -221
- 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/{src/components → components}/maz-icon.md +32 -83
- 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/{src/components → components}/maz-input.md +74 -221
- 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/{src/components → components}/maz-markdown-editor.md +72 -125
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/{src/components → components}/maz-pull-to-refresh.md +59 -45
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/{src/components → components}/maz-read-more.md +31 -122
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/{src/components → components}/maz-select-country.md +80 -340
- package/docs/{src/components → components}/maz-select.md +76 -206
- 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/{src/components → components}/maz-sidebar.md +117 -329
- package/docs/{src/components → components}/maz-skeleton.md +27 -156
- package/docs/{src/components → components}/maz-slider.md +33 -66
- package/docs/components/maz-spinner.md +84 -0
- package/docs/{src/components → components}/maz-stepper.md +43 -185
- 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/{src/components → components}/maz-tabs.md +89 -126
- 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/{src/components → components}/maz-window-mockup.md +38 -105
- 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/{src/composables → composables}/use-display-names.md +12 -59
- package/docs/{src/composables → composables}/use-drag.md +14 -68
- package/docs/{src/composables → composables}/use-form-validator.md +22 -696
- package/docs/{src/composables → composables}/use-idle-timeout.md +13 -97
- package/docs/{src/composables → composables}/use-pull-to-refresh.md +14 -7
- package/docs/{src/composables → composables}/use-reading-time.md +20 -56
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/{src/composables → composables}/use-swipe.md +14 -81
- package/docs/{src/composables → composables}/use-timer.md +12 -38
- package/docs/composables/use-toast.md +50 -0
- package/docs/{src/composables → composables}/use-user-visibility.md +14 -56
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/{src/directives → directives}/click-outside.md +13 -99
- package/docs/{src/directives → directives}/fullscreen-img.md +10 -28
- package/docs/{src/directives → directives}/lazy-img.md +14 -49
- package/docs/{src/directives → directives}/tooltip.md +12 -217
- package/docs/{src/directives → directives}/zoom-img.md +11 -38
- package/docs/{src/ecosystem → ecosystem}/eslint-config.md +37 -29
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/{src/ecosystem → ecosystem}/icons/index.md +22 -16
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/{src/ecosystem → ecosystem}/node/exec-promise.md +12 -6
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/{src/ecosystem → ecosystem}/node/logger.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/node/print-banner.md +12 -4
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/{src/ecosystem → ecosystem}/nuxt.md +46 -19
- package/docs/{src/ecosystem → ecosystem}/stylelint-config.md +33 -25
- package/docs/{src/ecosystem → ecosystem}/themes.md +72 -235
- package/docs/{src/ecosystem → ecosystem}/translations.md +25 -23
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/check-availability.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/cookie.md +18 -12
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/{src/ecosystem → ecosystem}/utils/currency.md +12 -26
- package/docs/{src/ecosystem → ecosystem}/utils/date.md +10 -24
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/{src/ecosystem → ecosystem}/utils/debounce-id.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/debounce.md +14 -8
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/{src/ecosystem → ecosystem}/utils/format-json.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/format-phone-number.md +12 -6
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/{src/ecosystem → ecosystem}/utils/get-error-message.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/idle-timeout.md +15 -9
- package/docs/{src/ecosystem → ecosystem}/utils/index.md +10 -13
- package/docs/{src/ecosystem → ecosystem}/utils/is-client.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/is-equal.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/is-ios.md +12 -6
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/{src/ecosystem → ecosystem}/utils/kebab-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/normalize-string.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/number.md +10 -24
- package/docs/{src/ecosystem → ecosystem}/utils/pascal-case.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/prevent-ios-input-zoom.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/script-loader.md +16 -8
- package/docs/{src/ecosystem → ecosystem}/utils/sleep.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/snake-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/swipe-handler.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/textarea-autogrow.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/utils/throttle-id.md +13 -7
- package/docs/{src/ecosystem → ecosystem}/utils/throttle.md +14 -8
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-key-of.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-partial.md +10 -4
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/generic-instance-type.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/types/infer-maybe-ref.md +10 -4
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/{src/ecosystem → ecosystem}/utils/user-visibility.md +12 -6
- package/docs/guide/ai-agents.md +237 -0
- package/docs/{src/guide → guide}/browser-support.md +22 -15
- package/docs/{src/guide → guide}/getting-started.md +34 -139
- package/docs/{src/guide → guide}/global-defaults.md +12 -11
- package/docs/{src/guide → guide}/maz-ui-provider.md +17 -16
- package/docs/{src/guide → guide}/migration-v5.md +95 -88
- package/docs/{src/guide → guide}/resolvers.md +33 -100
- package/docs/guide/tailwind.md +483 -0
- package/docs/{src/guide → guide}/vue.md +33 -39
- package/docs/manifest.json +1 -0
- package/docs/{src/plugins → plugins}/aos.md +20 -55
- package/docs/{src/plugins → plugins}/dialog.md +14 -161
- 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 +84 -22
- package/dist/mcp.d.mts +0 -153
- package/dist/mcp.d.ts +0 -153
- package/dist/mcp.mjs +0 -1511
- package/docs/generated-docs/maz-accordion.doc.md +0 -21
- package/docs/generated-docs/maz-alert.doc.md +0 -20
- package/docs/generated-docs/maz-animated-counter.doc.md +0 -17
- package/docs/generated-docs/maz-animated-element.doc.md +0 -14
- package/docs/generated-docs/maz-animated-text.doc.md +0 -17
- package/docs/generated-docs/maz-avatar.doc.md +0 -45
- package/docs/generated-docs/maz-backdrop.doc.md +0 -55
- package/docs/generated-docs/maz-badge.doc.md +0 -16
- package/docs/generated-docs/maz-bottom-sheet.doc.md +0 -24
- package/docs/generated-docs/maz-btn-group.doc.md +0 -20
- package/docs/generated-docs/maz-btn.doc.md +0 -33
- package/docs/generated-docs/maz-card-spotlight.doc.md +0 -16
- package/docs/generated-docs/maz-card.doc.md +0 -39
- package/docs/generated-docs/maz-carousel.doc.md +0 -17
- package/docs/generated-docs/maz-chart.doc.md +0 -10
- package/docs/generated-docs/maz-checkbox.doc.md +0 -33
- package/docs/generated-docs/maz-checklist.doc.md +0 -30
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +0 -27
- package/docs/generated-docs/maz-code-highlight.doc.md +0 -11
- package/docs/generated-docs/maz-container.doc.md +0 -26
- package/docs/generated-docs/maz-date-picker.doc.md +0 -56
- package/docs/generated-docs/maz-dialog-confirm.doc.md +0 -24
- package/docs/generated-docs/maz-dialog.doc.md +0 -22
- package/docs/generated-docs/maz-drawer.doc.md +0 -25
- package/docs/generated-docs/maz-dropdown.doc.md +0 -45
- package/docs/generated-docs/maz-dropzone.doc.md +0 -82
- package/docs/generated-docs/maz-expand-animation.doc.md +0 -12
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +0 -13
- package/docs/generated-docs/maz-gallery.doc.md +0 -17
- package/docs/generated-docs/maz-icon.doc.md +0 -16
- package/docs/generated-docs/maz-input-code.doc.md +0 -25
- package/docs/generated-docs/maz-input-number.doc.md +0 -33
- package/docs/generated-docs/maz-input-phone-number.doc.md +0 -62
- package/docs/generated-docs/maz-input-price.doc.md +0 -26
- package/docs/generated-docs/maz-input-tags.doc.md +0 -24
- package/docs/generated-docs/maz-input.doc.md +0 -54
- package/docs/generated-docs/maz-lazy-img.doc.md +0 -49
- package/docs/generated-docs/maz-link.doc.md +0 -31
- package/docs/generated-docs/maz-loading-bar.doc.md +0 -6
- package/docs/generated-docs/maz-markdown-editor.doc.md +0 -65
- package/docs/generated-docs/maz-pagination.doc.md +0 -21
- package/docs/generated-docs/maz-popover.doc.md +0 -79
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +0 -50
- package/docs/generated-docs/maz-radio-buttons.doc.md +0 -34
- package/docs/generated-docs/maz-radio.doc.md +0 -33
- package/docs/generated-docs/maz-read-more.doc.md +0 -18
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +0 -18
- package/docs/generated-docs/maz-select-country.doc.md +0 -45
- package/docs/generated-docs/maz-select.doc.md +0 -32
- package/docs/generated-docs/maz-sidebar-content.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-footer.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-group.doc.md +0 -11
- package/docs/generated-docs/maz-sidebar-header.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +0 -27
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +0 -16
- package/docs/generated-docs/maz-sidebar-menu.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar.doc.md +0 -36
- package/docs/generated-docs/maz-skeleton.doc.md +0 -12
- package/docs/generated-docs/maz-slider.doc.md +0 -20
- package/docs/generated-docs/maz-spinner.doc.md +0 -6
- package/docs/generated-docs/maz-stepper.doc.md +0 -30
- package/docs/generated-docs/maz-switch.doc.md +0 -31
- package/docs/generated-docs/maz-table-cell.doc.md +0 -5
- package/docs/generated-docs/maz-table-row.doc.md +0 -12
- package/docs/generated-docs/maz-table-title.doc.md +0 -5
- package/docs/generated-docs/maz-table-virtualizer.doc.md +0 -20
- package/docs/generated-docs/maz-table.doc.md +0 -72
- package/docs/generated-docs/maz-tabs-bar.doc.md +0 -29
- package/docs/generated-docs/maz-tabs-content-item.doc.md +0 -11
- package/docs/generated-docs/maz-tabs-content.doc.md +0 -5
- package/docs/generated-docs/maz-tabs.doc.md +0 -20
- package/docs/generated-docs/maz-textarea.doc.md +0 -46
- package/docs/generated-docs/maz-ticker.doc.md +0 -25
- package/docs/generated-docs/maz-timeline.doc.md +0 -32
- package/docs/generated-docs/maz-ui-provider.doc.md +0 -12
- package/docs/generated-docs/maz-window-mockup.doc.md +0 -23
- package/docs/src/blog/v4.md +0 -276
- package/docs/src/blog/v5.md +0 -184
- package/docs/src/changelog.md +0 -7
- package/docs/src/components/index.md +0 -8
- package/docs/src/components/maz-accordion.md +0 -80
- package/docs/src/components/maz-animated-counter.md +0 -124
- package/docs/src/components/maz-animated-element.md +0 -36
- package/docs/src/components/maz-animated-text.md +0 -36
- package/docs/src/components/maz-avatar.md +0 -227
- package/docs/src/components/maz-backdrop.md +0 -250
- package/docs/src/components/maz-bottom-sheet.md +0 -533
- package/docs/src/components/maz-card-spotlight.md +0 -163
- package/docs/src/components/maz-carousel.md +0 -231
- package/docs/src/components/maz-checkbox.md +0 -168
- package/docs/src/components/maz-checklist.md +0 -414
- package/docs/src/components/maz-circular-progress-bar.md +0 -145
- package/docs/src/components/maz-container.md +0 -363
- package/docs/src/components/maz-dialog-confirm.md +0 -240
- package/docs/src/components/maz-dialog.md +0 -164
- package/docs/src/components/maz-drawer.md +0 -181
- package/docs/src/components/maz-dropdown.md +0 -691
- package/docs/src/components/maz-expand-animation.md +0 -99
- package/docs/src/components/maz-fullscreen-loader.md +0 -58
- package/docs/src/components/maz-gallery.md +0 -85
- package/docs/src/components/maz-input-code.md +0 -61
- package/docs/src/components/maz-input-number.md +0 -81
- package/docs/src/components/maz-input-phone-number.md +0 -942
- package/docs/src/components/maz-input-price.md +0 -67
- package/docs/src/components/maz-input-tags.md +0 -114
- package/docs/src/components/maz-lazy-img.md +0 -88
- package/docs/src/components/maz-link.md +0 -178
- package/docs/src/components/maz-loading-bar.md +0 -26
- package/docs/src/components/maz-pagination.md +0 -79
- package/docs/src/components/maz-popover.md +0 -1416
- package/docs/src/components/maz-radio-buttons.md +0 -462
- package/docs/src/components/maz-radio.md +0 -142
- package/docs/src/components/maz-reading-progress-bar.md +0 -74
- package/docs/src/components/maz-spinner.md +0 -93
- package/docs/src/components/maz-switch.md +0 -92
- package/docs/src/components/maz-table.md +0 -732
- package/docs/src/components/maz-textarea.md +0 -400
- package/docs/src/components/maz-ticker.md +0 -692
- package/docs/src/components/maz-timeline.md +0 -478
- package/docs/src/composables/use-aos.md +0 -34
- package/docs/src/composables/use-breakpoints.md +0 -35
- package/docs/src/composables/use-dialog.md +0 -88
- package/docs/src/composables/use-string-matching.md +0 -63
- package/docs/src/composables/use-toast.md +0 -71
- package/docs/src/composables/use-wait.md +0 -62
- package/docs/src/composables/use-window-size.md +0 -18
- package/docs/src/ecosystem/icons/icon-set.md +0 -123
- package/docs/src/ecosystem/mcp.md +0 -210
- package/docs/src/ecosystem/node/index.md +0 -53
- package/docs/src/ecosystem/utils/camel-case.md +0 -31
- package/docs/src/ecosystem/utils/capitalize.md +0 -50
- package/docs/src/ecosystem/utils/country-code-to-unicode-flag.md +0 -213
- package/docs/src/ecosystem/utils/debounce-callback.md +0 -38
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +0 -33
- package/docs/src/ecosystem/utils/get-browser-locale.md +0 -29
- package/docs/src/ecosystem/utils/get-country-flag-url.md +0 -156
- package/docs/src/ecosystem/utils/is-server.md +0 -31
- package/docs/src/ecosystem/utils/is-standalone-mode.md +0 -43
- package/docs/src/ecosystem/utils/truthy-filter.md +0 -31
- package/docs/src/ecosystem/utils/types/deep-required.md +0 -39
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +0 -44
- package/docs/src/ecosystem/utils/upper-first.md +0 -32
- package/docs/src/guide/cli.md +0 -144
- package/docs/src/guide/migration-v4.md +0 -925
- package/docs/src/guide/tailwind.md +0 -158
- package/docs/src/index.md +0 -603
- package/docs/src/made-with-maz-ui.md +0 -58
- package/docs/src/plugins/toast.md +0 -349
- package/docs/src/plugins/wait.md +0 -109
- package/docs/src/theme-editor.md +0 -21
|
@@ -1,45 +1,44 @@
|
|
|
1
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
|
|
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"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
#
|
|
8
|
+
# MazDatePicker
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
> A powerful and flexible date picker component with support for single dates, date ranges, time selection, and extensive customization options
|
|
9
11
|
|
|
10
|
-
|
|
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
|
|
11
16
|
|
|
12
|
-
|
|
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.
|
|
13
22
|
|
|
14
23
|
## Table of Contents
|
|
15
24
|
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
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
|
|
28
37
|
|
|
29
38
|
## Basic Usage
|
|
30
39
|
|
|
31
40
|
The simplest way to use MazDatePicker:
|
|
32
41
|
|
|
33
|
-
<ComponentDemo>
|
|
34
|
-
<MazDatePicker
|
|
35
|
-
v-model="basicDate"
|
|
36
|
-
label="Select a date"
|
|
37
|
-
placeholder="Choose your date"
|
|
38
|
-
format="YYYY-MM-DD"
|
|
39
|
-
/>
|
|
40
|
-
|
|
41
|
-
<template #code>
|
|
42
|
-
|
|
43
42
|
```vue
|
|
44
43
|
<template>
|
|
45
44
|
<MazDatePicker
|
|
@@ -57,9 +56,6 @@ const date = ref()
|
|
|
57
56
|
</script>
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
</template>
|
|
61
|
-
</ComponentDemo>
|
|
62
|
-
|
|
63
59
|
## Date Formats
|
|
64
60
|
|
|
65
61
|
Understanding date formats is crucial for using MazDatePicker effectively. The component uses two different format concepts:
|
|
@@ -72,30 +68,6 @@ This controls how dates are stored and transmitted in your `v-model`. Default is
|
|
|
72
68
|
|
|
73
69
|
This controls how dates appear in the input field using `Intl.DateTimeFormatOptions`.
|
|
74
70
|
|
|
75
|
-
<ComponentDemo>
|
|
76
|
-
<div class="maz:grid maz:grid-cols-1 maz:mob-l:grid-cols-3 maz:gap-4">
|
|
77
|
-
<MazDatePicker
|
|
78
|
-
v-model="formatExample1"
|
|
79
|
-
label="ISO Format (YYYY-MM-DD)"
|
|
80
|
-
format="YYYY-MM-DD"
|
|
81
|
-
:input-date-format="{ dateStyle: 'medium' }"
|
|
82
|
-
/>
|
|
83
|
-
<MazDatePicker
|
|
84
|
-
v-model="formatExample2"
|
|
85
|
-
label="US Format (MM/DD/YYYY)"
|
|
86
|
-
format="MM/DD/YYYY"
|
|
87
|
-
:input-date-format="{ dateStyle: 'short' }"
|
|
88
|
-
/>
|
|
89
|
-
<MazDatePicker
|
|
90
|
-
v-model="formatExample3"
|
|
91
|
-
label="European Format (DD-MM-YYYY)"
|
|
92
|
-
format="DD-MM-YYYY"
|
|
93
|
-
:input-date-format="{ dateStyle: 'medium' }"
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<template #code>
|
|
98
|
-
|
|
99
71
|
```vue
|
|
100
72
|
<template>
|
|
101
73
|
<!-- ISO Format (recommended) -->
|
|
@@ -132,22 +104,10 @@ const date3 = ref('15-03-2024') // European format
|
|
|
132
104
|
</script>
|
|
133
105
|
```
|
|
134
106
|
|
|
135
|
-
</template>
|
|
136
|
-
</ComponentDemo>
|
|
137
|
-
|
|
138
107
|
### Custom Display Transformation
|
|
139
108
|
|
|
140
109
|
Use `inputDateTransformer` to completely customize how dates appear in the input:
|
|
141
110
|
|
|
142
|
-
<ComponentDemo>
|
|
143
|
-
<MazDatePicker
|
|
144
|
-
v-model="transformedDate"
|
|
145
|
-
label="Custom Display Format"
|
|
146
|
-
:input-date-transformer="({ value }) => value ? `📅 ${dayjs(value).format('dddd, MMMM Do YYYY')}` : ''"
|
|
147
|
-
/>
|
|
148
|
-
|
|
149
|
-
<template #code>
|
|
150
|
-
|
|
151
111
|
```vue
|
|
152
112
|
<template>
|
|
153
113
|
<MazDatePicker
|
|
@@ -169,25 +129,10 @@ const transformDate = ({ value }) => {
|
|
|
169
129
|
</script>
|
|
170
130
|
```
|
|
171
131
|
|
|
172
|
-
</template>
|
|
173
|
-
</ComponentDemo>
|
|
174
|
-
|
|
175
132
|
## Date Selection
|
|
176
133
|
|
|
177
134
|
### Standard Date Picker
|
|
178
135
|
|
|
179
|
-
<br />
|
|
180
|
-
|
|
181
|
-
<ComponentDemo>
|
|
182
|
-
<MazDatePicker
|
|
183
|
-
v-model="dateSelection"
|
|
184
|
-
label="Select Date"
|
|
185
|
-
color="primary"
|
|
186
|
-
auto-close
|
|
187
|
-
/>
|
|
188
|
-
|
|
189
|
-
<template #code>
|
|
190
|
-
|
|
191
136
|
```vue
|
|
192
137
|
<template>
|
|
193
138
|
<MazDatePicker
|
|
@@ -205,22 +150,10 @@ const date = ref()
|
|
|
205
150
|
</script>
|
|
206
151
|
```
|
|
207
152
|
|
|
208
|
-
</template>
|
|
209
|
-
</ComponentDemo>
|
|
210
|
-
|
|
211
153
|
### Inline Date Picker
|
|
212
154
|
|
|
213
155
|
Perfect for dashboards or when you want the calendar always visible:
|
|
214
156
|
|
|
215
|
-
<ComponentDemo>
|
|
216
|
-
<MazDatePicker
|
|
217
|
-
v-model="inlineDate"
|
|
218
|
-
inline
|
|
219
|
-
color="secondary"
|
|
220
|
-
/>
|
|
221
|
-
|
|
222
|
-
<template #code>
|
|
223
|
-
|
|
224
157
|
```vue
|
|
225
158
|
<template>
|
|
226
159
|
<MazDatePicker
|
|
@@ -237,23 +170,10 @@ const date = ref()
|
|
|
237
170
|
</script>
|
|
238
171
|
```
|
|
239
172
|
|
|
240
|
-
</template>
|
|
241
|
-
</ComponentDemo>
|
|
242
|
-
|
|
243
173
|
### Double Calendar
|
|
244
174
|
|
|
245
175
|
Show two months at once for better date selection:
|
|
246
176
|
|
|
247
|
-
<ComponentDemo>
|
|
248
|
-
<MazDatePicker
|
|
249
|
-
v-model="doubleDate"
|
|
250
|
-
label="Double Calendar"
|
|
251
|
-
double
|
|
252
|
-
color="success"
|
|
253
|
-
/>
|
|
254
|
-
|
|
255
|
-
<template #code>
|
|
256
|
-
|
|
257
177
|
```vue
|
|
258
178
|
<template>
|
|
259
179
|
<MazDatePicker
|
|
@@ -271,9 +191,6 @@ const date = ref()
|
|
|
271
191
|
</script>
|
|
272
192
|
```
|
|
273
193
|
|
|
274
|
-
</template>
|
|
275
|
-
</ComponentDemo>
|
|
276
|
-
|
|
277
194
|
## Custom Trigger
|
|
278
195
|
|
|
279
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.
|
|
@@ -287,23 +204,12 @@ By default MazDatePicker renders a readonly `MazInput` as the field that opens t
|
|
|
287
204
|
| `close` | `() => void` | Close the calendar programmatically |
|
|
288
205
|
| `toggle` | `() => void` | Toggle the calendar programmatically |
|
|
289
206
|
|
|
290
|
-
<ComponentDemo>
|
|
291
|
-
<MazDatePicker v-model="triggerDate" auto-close hide-header>
|
|
292
|
-
<template #trigger="{ isOpen }">
|
|
293
|
-
<MazBtn color="secondary" :class="{ 'maz:ring-2 maz:ring-offset-2 maz:ring-secondary': isOpen }">
|
|
294
|
-
{{ triggerDate || 'Pick a date' }}
|
|
295
|
-
</MazBtn>
|
|
296
|
-
</template>
|
|
297
|
-
</MazDatePicker>
|
|
298
|
-
|
|
299
|
-
<template #code>
|
|
300
|
-
|
|
301
207
|
```vue
|
|
302
208
|
<template>
|
|
303
209
|
<MazDatePicker v-model="date" auto-close>
|
|
304
210
|
<!-- Clicking the button opens the picker automatically. -->
|
|
305
211
|
<template #trigger="{ isOpen }">
|
|
306
|
-
<MazBtn color="secondary" :class="{ '
|
|
212
|
+
<MazBtn color="secondary" :class="{ 'ring-2 ring-secondary': isOpen }">
|
|
307
213
|
{{ date || 'Pick a date' }}
|
|
308
214
|
</MazBtn>
|
|
309
215
|
</template>
|
|
@@ -317,12 +223,9 @@ const date = ref()
|
|
|
317
223
|
</script>
|
|
318
224
|
```
|
|
319
225
|
|
|
320
|
-
|
|
321
|
-
</ComponentDemo>
|
|
226
|
+
**Tip:**
|
|
322
227
|
|
|
323
|
-
::: tip
|
|
324
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.
|
|
325
|
-
:::
|
|
326
229
|
|
|
327
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.
|
|
328
231
|
|
|
@@ -330,17 +233,6 @@ The model value is not passed through the slot - use your own `v-model` ref (her
|
|
|
330
233
|
|
|
331
234
|
### Date + Time (24h format)
|
|
332
235
|
|
|
333
|
-
<ComponentDemo>
|
|
334
|
-
<MazDatePicker
|
|
335
|
-
v-model="dateTime24"
|
|
336
|
-
label="Date & Time (24h)"
|
|
337
|
-
format="YYYY-MM-DD HH:mm"
|
|
338
|
-
time
|
|
339
|
-
color="info"
|
|
340
|
-
/>
|
|
341
|
-
|
|
342
|
-
<template #code>
|
|
343
|
-
|
|
344
236
|
```vue
|
|
345
237
|
<template>
|
|
346
238
|
<MazDatePicker
|
|
@@ -359,22 +251,8 @@ const dateTime = ref()
|
|
|
359
251
|
</script>
|
|
360
252
|
```
|
|
361
253
|
|
|
362
|
-
</template>
|
|
363
|
-
</ComponentDemo>
|
|
364
|
-
|
|
365
254
|
### Date + Time (12h format)
|
|
366
255
|
|
|
367
|
-
<ComponentDemo>
|
|
368
|
-
<MazDatePicker
|
|
369
|
-
v-model="dateTime12"
|
|
370
|
-
label="Date & Time (12h)"
|
|
371
|
-
format="YYYY-MM-DD hh:mm a"
|
|
372
|
-
time
|
|
373
|
-
color="warning"
|
|
374
|
-
/>
|
|
375
|
-
|
|
376
|
-
<template #code>
|
|
377
|
-
|
|
378
256
|
```vue
|
|
379
257
|
<template>
|
|
380
258
|
<MazDatePicker
|
|
@@ -393,31 +271,8 @@ const dateTime = ref()
|
|
|
393
271
|
</script>
|
|
394
272
|
```
|
|
395
273
|
|
|
396
|
-
</template>
|
|
397
|
-
</ComponentDemo>
|
|
398
|
-
|
|
399
274
|
### Time Only Selection
|
|
400
275
|
|
|
401
|
-
<ComponentDemo>
|
|
402
|
-
<div class="maz:grid maz:grid-cols-1 maz:mob-l:grid-cols-2 maz:gap-4">
|
|
403
|
-
<MazDatePicker
|
|
404
|
-
v-model="timeOnly24"
|
|
405
|
-
label="Time Only (24h)"
|
|
406
|
-
format="HH:mm"
|
|
407
|
-
only-time
|
|
408
|
-
color="accent"
|
|
409
|
-
/>
|
|
410
|
-
<MazDatePicker
|
|
411
|
-
v-model="timeOnly12"
|
|
412
|
-
label="Time Only (12h)"
|
|
413
|
-
format="hh:mm a"
|
|
414
|
-
only-time
|
|
415
|
-
color="destructive"
|
|
416
|
-
/>
|
|
417
|
-
</div>
|
|
418
|
-
|
|
419
|
-
<template #code>
|
|
420
|
-
|
|
421
276
|
```vue
|
|
422
277
|
<template>
|
|
423
278
|
<!-- 24h format -->
|
|
@@ -447,38 +302,8 @@ const time12 = ref('02:30 pm')
|
|
|
447
302
|
</script>
|
|
448
303
|
```
|
|
449
304
|
|
|
450
|
-
</template>
|
|
451
|
-
</ComponentDemo>
|
|
452
|
-
|
|
453
305
|
### Custom Minute Intervals
|
|
454
306
|
|
|
455
|
-
<ComponentDemo>
|
|
456
|
-
<div class="maz:grid maz:grid-cols-1 maz:mob-l:grid-cols-3 maz:gap-4">
|
|
457
|
-
<MazDatePicker
|
|
458
|
-
v-model="timeInterval1"
|
|
459
|
-
label="5min intervals"
|
|
460
|
-
format="HH:mm"
|
|
461
|
-
:minute-interval="5"
|
|
462
|
-
only-time
|
|
463
|
-
/>
|
|
464
|
-
<MazDatePicker
|
|
465
|
-
v-model="timeInterval2"
|
|
466
|
-
label="15min intervals"
|
|
467
|
-
format="HH:mm"
|
|
468
|
-
:minute-interval="15"
|
|
469
|
-
only-time
|
|
470
|
-
/>
|
|
471
|
-
<MazDatePicker
|
|
472
|
-
v-model="timeInterval3"
|
|
473
|
-
label="30min intervals"
|
|
474
|
-
format="HH:mm"
|
|
475
|
-
:minute-interval="30"
|
|
476
|
-
only-time
|
|
477
|
-
/>
|
|
478
|
-
</div>
|
|
479
|
-
|
|
480
|
-
<template #code>
|
|
481
|
-
|
|
482
307
|
```vue
|
|
483
308
|
<template>
|
|
484
309
|
<MazDatePicker
|
|
@@ -515,25 +340,10 @@ const time3 = ref()
|
|
|
515
340
|
</script>
|
|
516
341
|
```
|
|
517
342
|
|
|
518
|
-
</template>
|
|
519
|
-
</ComponentDemo>
|
|
520
|
-
|
|
521
343
|
## Range Selection
|
|
522
344
|
|
|
523
345
|
For selecting date ranges, pass an object with `start` and `end` properties:
|
|
524
346
|
|
|
525
|
-
<ComponentDemo>
|
|
526
|
-
<MazDatePicker
|
|
527
|
-
v-model="dateRange"
|
|
528
|
-
label="Select Date Range"
|
|
529
|
-
range
|
|
530
|
-
double
|
|
531
|
-
auto-close
|
|
532
|
-
color="primary"
|
|
533
|
-
/>
|
|
534
|
-
|
|
535
|
-
<template #code>
|
|
536
|
-
|
|
537
347
|
```vue
|
|
538
348
|
<template>
|
|
539
349
|
<MazDatePicker
|
|
@@ -556,25 +366,10 @@ const range = ref({
|
|
|
556
366
|
</script>
|
|
557
367
|
```
|
|
558
368
|
|
|
559
|
-
</template>
|
|
560
|
-
</ComponentDemo>
|
|
561
|
-
|
|
562
369
|
### Range with Shortcuts
|
|
563
370
|
|
|
564
371
|
Provide predefined shortcuts for common date ranges:
|
|
565
372
|
|
|
566
|
-
<ComponentDemo>
|
|
567
|
-
<MazDatePicker
|
|
568
|
-
v-model="rangeWithShortcuts"
|
|
569
|
-
label="Range with Shortcuts"
|
|
570
|
-
range
|
|
571
|
-
double
|
|
572
|
-
:shortcuts="customShortcuts"
|
|
573
|
-
color="secondary"
|
|
574
|
-
/>
|
|
575
|
-
|
|
576
|
-
<template #code>
|
|
577
|
-
|
|
578
373
|
```vue
|
|
579
374
|
<template>
|
|
580
375
|
<MazDatePicker
|
|
@@ -625,9 +420,6 @@ const shortcuts = [
|
|
|
625
420
|
</script>
|
|
626
421
|
```
|
|
627
422
|
|
|
628
|
-
</template>
|
|
629
|
-
</ComponentDemo>
|
|
630
|
-
|
|
631
423
|
### Property `shortcuts`
|
|
632
424
|
|
|
633
425
|
#### Model
|
|
@@ -663,7 +455,7 @@ const shortcuts: MazDatePickerShortcut[] = [{
|
|
|
663
455
|
}]
|
|
664
456
|
```
|
|
665
457
|
|
|
666
|
-
|
|
458
|
+
**Details: View default shortcuts**
|
|
667
459
|
|
|
668
460
|
```ts
|
|
669
461
|
const shortcuts = [
|
|
@@ -734,29 +526,10 @@ const shortcuts = [
|
|
|
734
526
|
]
|
|
735
527
|
```
|
|
736
528
|
|
|
737
|
-
:::
|
|
738
|
-
|
|
739
529
|
## Validation & Constraints
|
|
740
530
|
|
|
741
531
|
### Min/Max Dates
|
|
742
532
|
|
|
743
|
-
<br />
|
|
744
|
-
|
|
745
|
-
<ComponentDemo>
|
|
746
|
-
<MazDatePicker
|
|
747
|
-
v-model="constrainedDate"
|
|
748
|
-
label="Limited Date Range"
|
|
749
|
-
:min-date="minMaxDates.min"
|
|
750
|
-
:max-date="minMaxDates.max"
|
|
751
|
-
color="info"
|
|
752
|
-
@update:model-value="console.log($event)"
|
|
753
|
-
/>
|
|
754
|
-
<p class="maz:text-sm maz:text-muted maz:mt-2">
|
|
755
|
-
Min: {{ minMaxDates.min }} | Max: {{ minMaxDates.max }}
|
|
756
|
-
</p>
|
|
757
|
-
|
|
758
|
-
<template #code>
|
|
759
|
-
|
|
760
533
|
```vue
|
|
761
534
|
<template>
|
|
762
535
|
<MazDatePicker
|
|
@@ -778,24 +551,10 @@ const maxDate = dayjs().add(30, 'day').format('YYYY-MM-DD')
|
|
|
778
551
|
</script>
|
|
779
552
|
```
|
|
780
553
|
|
|
781
|
-
</template>
|
|
782
|
-
</ComponentDemo>
|
|
783
|
-
|
|
784
554
|
#### Property `min-max-auto`
|
|
785
555
|
|
|
786
556
|
Disable min-max auto check to not change the value when it is out of range
|
|
787
557
|
|
|
788
|
-
<ComponentDemo>
|
|
789
|
-
<MazDatePicker
|
|
790
|
-
v-model="constrainedDateMinMaxAuto"
|
|
791
|
-
label="Not auto date range"
|
|
792
|
-
:min-date="minMaxDates.min"
|
|
793
|
-
:max-date="minMaxDates.max"
|
|
794
|
-
:min-max-auto="false"
|
|
795
|
-
/>
|
|
796
|
-
|
|
797
|
-
<template #code>
|
|
798
|
-
|
|
799
558
|
```vue
|
|
800
559
|
<template>
|
|
801
560
|
<MazDatePicker
|
|
@@ -817,32 +576,8 @@ const maxDate = dayjs().add(30, 'day').format('YYYY-MM-DD')
|
|
|
817
576
|
</script>
|
|
818
577
|
```
|
|
819
578
|
|
|
820
|
-
</template>
|
|
821
|
-
</ComponentDemo>
|
|
822
|
-
|
|
823
579
|
### Disabled Days & Dates
|
|
824
580
|
|
|
825
|
-
<br />
|
|
826
|
-
|
|
827
|
-
<ComponentDemo>
|
|
828
|
-
<div class="maz:grid maz:grid-cols-1 maz:mob-l:grid-cols-2 maz:gap-4">
|
|
829
|
-
<MazDatePicker
|
|
830
|
-
v-model="weekendDisabled"
|
|
831
|
-
label="Weekends Disabled"
|
|
832
|
-
:min-date="dayjs().subtract(1, 'day').format('YYYY-MM-DD')"
|
|
833
|
-
:disabled-weekly="[0, 6]"
|
|
834
|
-
color="warning"
|
|
835
|
-
/>
|
|
836
|
-
<MazDatePicker
|
|
837
|
-
v-model="specificDatesDisabled"
|
|
838
|
-
label="Holidays Disabled"
|
|
839
|
-
:disabled-dates="holidays"
|
|
840
|
-
color="destructive"
|
|
841
|
-
/>
|
|
842
|
-
</div>
|
|
843
|
-
|
|
844
|
-
<template #code>
|
|
845
|
-
|
|
846
581
|
```vue
|
|
847
582
|
<template>
|
|
848
583
|
<!-- Disable weekends -->
|
|
@@ -884,35 +619,8 @@ const holidays = [
|
|
|
884
619
|
</script>
|
|
885
620
|
```
|
|
886
621
|
|
|
887
|
-
</template>
|
|
888
|
-
</ComponentDemo>
|
|
889
|
-
|
|
890
622
|
### Disabled Hours
|
|
891
623
|
|
|
892
|
-
<br />
|
|
893
|
-
|
|
894
|
-
<ComponentDemo>
|
|
895
|
-
<div class="maz:grid maz:grid-cols-1 maz:mob-l:grid-cols-2 maz:gap-4">
|
|
896
|
-
<MazDatePicker
|
|
897
|
-
v-model="dateTime"
|
|
898
|
-
format="YYYY-MM-DD hh:mm a"
|
|
899
|
-
time
|
|
900
|
-
label="Disabled Hours"
|
|
901
|
-
:disabled-hours="disabledHours"
|
|
902
|
-
color="info"
|
|
903
|
-
/>
|
|
904
|
-
<MazDatePicker
|
|
905
|
-
v-model="time"
|
|
906
|
-
format="HH:mm"
|
|
907
|
-
only-time
|
|
908
|
-
label="Disabled Hours"
|
|
909
|
-
:disabled-hours="disabledHours"
|
|
910
|
-
color="info"
|
|
911
|
-
/>
|
|
912
|
-
</div>
|
|
913
|
-
|
|
914
|
-
<template #code>
|
|
915
|
-
|
|
916
624
|
```vue
|
|
917
625
|
<template>
|
|
918
626
|
<MazDatePicker
|
|
@@ -944,46 +652,10 @@ const disabledHours = [0, 1, 2, 11, 22, 23]
|
|
|
944
652
|
</script>
|
|
945
653
|
```
|
|
946
654
|
|
|
947
|
-
</template>
|
|
948
|
-
</ComponentDemo>
|
|
949
|
-
|
|
950
655
|
## Internationalization
|
|
951
656
|
|
|
952
657
|
MazDatePicker supports full internationalization. **By default, it uses the locale from the [MazUiTranslations](../ecosystem/translations.md) plugin**, but you can override it:
|
|
953
658
|
|
|
954
|
-
<ComponentDemo>
|
|
955
|
-
<div class="maz:grid maz:grid-cols-1 maz:mob-l:grid-cols-2 maz:gap-4">
|
|
956
|
-
<MazDatePicker
|
|
957
|
-
v-model="frenchDate"
|
|
958
|
-
label="French Locale"
|
|
959
|
-
locale="fr-FR"
|
|
960
|
-
:first-day-of-week="1"
|
|
961
|
-
color="primary"
|
|
962
|
-
/>
|
|
963
|
-
<MazDatePicker
|
|
964
|
-
v-model="germanDate"
|
|
965
|
-
label="German Locale"
|
|
966
|
-
locale="de-DE"
|
|
967
|
-
:first-day-of-week="1"
|
|
968
|
-
color="secondary"
|
|
969
|
-
/>
|
|
970
|
-
<MazDatePicker
|
|
971
|
-
v-model="japaneseDate"
|
|
972
|
-
label="Japanese Locale"
|
|
973
|
-
locale="ja-JP"
|
|
974
|
-
color="accent"
|
|
975
|
-
/>
|
|
976
|
-
<MazDatePicker
|
|
977
|
-
v-model="arabicDate"
|
|
978
|
-
label="Arabic Locale"
|
|
979
|
-
locale="ar-SA"
|
|
980
|
-
:first-day-of-week="6"
|
|
981
|
-
color="warning"
|
|
982
|
-
/>
|
|
983
|
-
</div>
|
|
984
|
-
|
|
985
|
-
<template #code>
|
|
986
|
-
|
|
987
659
|
```vue
|
|
988
660
|
<template>
|
|
989
661
|
<!-- French -->
|
|
@@ -1032,9 +704,6 @@ const arabicDate = ref()
|
|
|
1032
704
|
</script>
|
|
1033
705
|
```
|
|
1034
706
|
|
|
1035
|
-
</template>
|
|
1036
|
-
</ComponentDemo>
|
|
1037
|
-
|
|
1038
707
|
## Types
|
|
1039
708
|
|
|
1040
709
|
```typescript
|
|
@@ -1063,98 +732,60 @@ interface MazDatePickerShortcut {
|
|
|
1063
732
|
|
|
1064
733
|
- The input is a `combobox` opening a `dialog` (`aria-haspopup="dialog"`, `aria-expanded`, `aria-controls`).
|
|
1065
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).
|
|
1066
|
-
- **Keyboard** in the calendar: only one day is in the tab sequence, the arrows move by day (
|
|
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.
|
|
1067
736
|
- The navigation buttons labels come from `@maz-ui/translations` (`aria` namespace).
|
|
1068
737
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
dayjs().add(2, 'day').format('YYYY-MM-DD'),
|
|
1124
|
-
dayjs().add(3, 'day').format('YYYY-MM-DD'),
|
|
1125
|
-
dayjs().add(4, 'day').format('YYYY-MM-DD'),
|
|
1126
|
-
]
|
|
1127
|
-
|
|
1128
|
-
// Disabled hours
|
|
1129
|
-
const dateTime = ref()
|
|
1130
|
-
const time = ref()
|
|
1131
|
-
const disabledHours = [0, 1, 2, 11, 22, 23]
|
|
1132
|
-
|
|
1133
|
-
// Shortcuts
|
|
1134
|
-
const customShortcuts = [
|
|
1135
|
-
{
|
|
1136
|
-
label: 'Today',
|
|
1137
|
-
identifier: 'today',
|
|
1138
|
-
value: {
|
|
1139
|
-
start: dayjs().format('YYYY-MM-DD'),
|
|
1140
|
-
end: dayjs().format('YYYY-MM-DD')
|
|
1141
|
-
}
|
|
1142
|
-
},
|
|
1143
|
-
{
|
|
1144
|
-
label: 'Last 7 days',
|
|
1145
|
-
identifier: 'last7days',
|
|
1146
|
-
value: {
|
|
1147
|
-
start: dayjs().subtract(6, 'day').format('YYYY-MM-DD'),
|
|
1148
|
-
end: dayjs().format('YYYY-MM-DD')
|
|
1149
|
-
}
|
|
1150
|
-
},
|
|
1151
|
-
{
|
|
1152
|
-
label: 'This month',
|
|
1153
|
-
identifier: 'thisMonth',
|
|
1154
|
-
value: {
|
|
1155
|
-
start: dayjs().startOf('month').format('YYYY-MM-DD'),
|
|
1156
|
-
end: dayjs().endOf('month').format('YYYY-MM-DD')
|
|
1157
|
-
}
|
|
1158
|
-
}
|
|
1159
|
-
]
|
|
1160
|
-
</script>
|
|
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).
|