@maz-ui/mcp 5.0.0-canary.ef64a02.0 → 5.0.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 +1 -1
- package/dist/mcp.d.mts +22 -9
- package/dist/mcp.d.ts +22 -9
- package/dist/mcp.mjs +160 -83
- package/docs/generated-docs/maz-avatar.doc.md +30 -30
- package/docs/generated-docs/maz-bottom-sheet.doc.md +16 -13
- package/docs/generated-docs/maz-btn.doc.md +21 -19
- package/docs/generated-docs/maz-checkbox.doc.md +16 -17
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +1 -1
- package/docs/generated-docs/maz-code-highlight.doc.md +11 -0
- package/docs/generated-docs/maz-container.doc.md +1 -0
- package/docs/generated-docs/maz-date-picker.doc.md +41 -41
- package/docs/generated-docs/maz-drawer.doc.md +7 -8
- package/docs/generated-docs/maz-dropdown.doc.md +3 -0
- package/docs/generated-docs/maz-expand-animation.doc.md +4 -4
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +5 -5
- package/docs/generated-docs/maz-gallery.doc.md +15 -15
- package/docs/generated-docs/maz-input-code.doc.md +16 -16
- package/docs/generated-docs/maz-input-phone-number.doc.md +43 -38
- package/docs/generated-docs/maz-input-price.doc.md +14 -14
- package/docs/generated-docs/maz-input-tags.doc.md +16 -16
- package/docs/generated-docs/maz-input.doc.md +33 -33
- package/docs/generated-docs/maz-lazy-img.doc.md +14 -14
- package/docs/generated-docs/maz-loading-bar.doc.md +4 -4
- package/docs/generated-docs/maz-markdown-editor.doc.md +65 -0
- package/docs/generated-docs/maz-popover.doc.md +1 -1
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +39 -20
- package/docs/generated-docs/maz-radio-buttons.doc.md +17 -17
- package/docs/generated-docs/maz-radio.doc.md +16 -16
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +4 -4
- package/docs/generated-docs/maz-select-country.doc.md +27 -26
- package/docs/generated-docs/maz-sidebar-content.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-footer.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-group.doc.md +11 -0
- package/docs/generated-docs/maz-sidebar-header.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +27 -0
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +16 -0
- package/docs/generated-docs/maz-sidebar-menu.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar.doc.md +36 -0
- package/docs/generated-docs/maz-slider.doc.md +1 -1
- package/docs/generated-docs/maz-spinner.doc.md +4 -4
- package/docs/generated-docs/maz-switch.doc.md +14 -14
- package/docs/generated-docs/maz-table-virtualizer.doc.md +20 -0
- package/docs/generated-docs/maz-table.doc.md +43 -37
- package/docs/generated-docs/maz-tabs-bar.doc.md +20 -9
- package/docs/generated-docs/maz-tabs.doc.md +6 -3
- package/docs/generated-docs/maz-textarea.doc.md +27 -24
- package/docs/generated-docs/maz-ticker.doc.md +1 -1
- package/docs/generated-docs/maz-timeline.doc.md +4 -4
- package/docs/generated-docs/maz-window-mockup.doc.md +23 -0
- package/docs/src/blog/v4.md +1 -1
- package/docs/src/blog/v5.md +5 -7
- package/docs/src/components/maz-avatar.md +52 -4
- package/docs/src/components/maz-badge.md +4 -4
- package/docs/src/components/maz-bottom-sheet.md +304 -169
- package/docs/src/components/maz-btn.md +3 -3
- package/docs/src/components/maz-chart.md +8 -0
- package/docs/src/components/maz-checklist.md +10 -10
- package/docs/src/components/maz-code-highlight.md +233 -0
- package/docs/src/components/maz-container.md +2 -2
- package/docs/src/components/maz-date-picker.md +62 -1
- package/docs/src/components/maz-dialog.md +52 -0
- package/docs/src/components/maz-drawer.md +4 -0
- package/docs/src/components/maz-dropdown.md +36 -16
- package/docs/src/components/maz-icon.md +16 -5
- package/docs/src/components/maz-input-phone-number.md +136 -103
- package/docs/src/components/maz-input.md +4 -0
- package/docs/src/components/maz-lazy-img.md +64 -0
- package/docs/src/components/maz-markdown-editor.md +373 -0
- package/docs/src/components/maz-popover.md +2 -1
- package/docs/src/components/maz-pull-to-refresh.md +176 -17
- package/docs/src/components/maz-radio-buttons.md +6 -0
- package/docs/src/components/maz-select-country.md +138 -1
- package/docs/src/components/maz-select.md +9 -0
- package/docs/src/components/maz-sidebar.md +719 -0
- package/docs/src/components/maz-slider.md +6 -0
- package/docs/src/components/maz-stepper.md +4 -0
- package/docs/src/components/maz-table.md +162 -1
- package/docs/src/components/maz-tabs.md +117 -3
- package/docs/src/components/maz-textarea.md +85 -1
- package/docs/src/components/maz-timeline.md +60 -0
- package/docs/src/components/maz-window-mockup.md +249 -0
- package/docs/src/composables/use-drag.md +239 -0
- package/docs/src/composables/use-form-validator.md +297 -16
- package/docs/src/composables/use-pull-to-refresh.md +79 -0
- package/docs/src/composables/use-swipe.md +26 -11
- package/docs/src/directives/click-outside.md +8 -15
- package/docs/src/directives/fullscreen-img.md +1 -1
- package/docs/src/directives/lazy-img.md +44 -11
- package/docs/src/directives/tooltip.md +24 -1
- package/docs/src/directives/zoom-img.md +1 -1
- package/docs/src/ecosystem/eslint-config.md +189 -8
- package/docs/src/{guide/icons.md → ecosystem/icons/index.md} +1 -1
- package/docs/src/ecosystem/node/exec-promise.md +87 -0
- package/docs/src/ecosystem/node/index.md +53 -0
- package/docs/src/ecosystem/node/logger.md +146 -0
- package/docs/src/ecosystem/node/print-banner.md +93 -0
- package/docs/src/{guide → ecosystem}/nuxt.md +107 -47
- package/docs/src/ecosystem/stylelint-config.md +122 -10
- package/docs/src/{guide → ecosystem}/themes.md +152 -71
- package/docs/src/{guide → ecosystem}/translations.md +1 -1
- package/docs/src/ecosystem/utils/camel-case.md +31 -0
- package/docs/src/{helpers → ecosystem/utils}/capitalize.md +2 -3
- package/docs/src/ecosystem/utils/check-availability.md +79 -0
- package/docs/src/ecosystem/utils/cookie.md +80 -0
- package/docs/src/ecosystem/utils/debounce-callback.md +38 -0
- package/docs/src/ecosystem/utils/debounce-id.md +69 -0
- package/docs/src/ecosystem/utils/debounce.md +65 -0
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +33 -0
- package/docs/src/ecosystem/utils/format-json.md +33 -0
- package/docs/src/ecosystem/utils/format-phone-number.md +37 -0
- package/docs/src/ecosystem/utils/get-browser-locale.md +29 -0
- package/docs/src/ecosystem/utils/get-error-message.md +39 -0
- package/docs/src/ecosystem/utils/idle-timeout.md +90 -0
- package/docs/src/ecosystem/utils/index.md +60 -0
- package/docs/src/ecosystem/utils/is-client.md +32 -0
- package/docs/src/ecosystem/utils/is-equal.md +38 -0
- package/docs/src/ecosystem/utils/is-ios.md +37 -0
- package/docs/src/ecosystem/utils/is-server.md +31 -0
- package/docs/src/ecosystem/utils/is-standalone-mode.md +43 -0
- package/docs/src/ecosystem/utils/kebab-case.md +36 -0
- package/docs/src/ecosystem/utils/normalize-string.md +77 -0
- package/docs/src/ecosystem/utils/pascal-case.md +35 -0
- package/docs/src/ecosystem/utils/prevent-ios-input-zoom.md +66 -0
- package/docs/src/ecosystem/utils/script-loader.md +77 -0
- package/docs/src/ecosystem/utils/sleep.md +59 -0
- package/docs/src/ecosystem/utils/snake-case.md +36 -0
- package/docs/src/ecosystem/utils/swipe-handler.md +91 -0
- package/docs/src/ecosystem/utils/textarea-autogrow.md +41 -0
- package/docs/src/ecosystem/utils/throttle-id.md +48 -0
- package/docs/src/ecosystem/utils/throttle.md +57 -0
- package/docs/src/ecosystem/utils/truthy-filter.md +31 -0
- package/docs/src/ecosystem/utils/types/deep-key-of.md +48 -0
- package/docs/src/ecosystem/utils/types/deep-partial.md +42 -0
- package/docs/src/ecosystem/utils/types/deep-required.md +39 -0
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +44 -0
- package/docs/src/ecosystem/utils/types/generic-instance-type.md +42 -0
- package/docs/src/ecosystem/utils/types/infer-maybe-ref.md +35 -0
- package/docs/src/ecosystem/utils/upper-first.md +32 -0
- package/docs/src/ecosystem/utils/user-visibility.md +69 -0
- package/docs/src/guide/getting-started.md +15 -13
- package/docs/src/guide/global-defaults.md +102 -0
- package/docs/src/guide/maz-ui-provider.md +6 -3
- package/docs/src/guide/migration-v4.md +13 -9
- package/docs/src/guide/migration-v5.md +222 -20
- package/docs/src/guide/resolvers.md +8 -8
- package/docs/src/guide/tailwind.md +4 -0
- package/docs/src/guide/vue.md +4 -4
- package/docs/src/index.md +13 -13
- package/docs/src/plugins/aos.md +1 -1
- package/package.json +15 -11
- package/docs/src/helpers/camel-case.md +0 -14
- package/docs/src/helpers/check-availability.md +0 -14
- package/docs/src/helpers/debounce-callback.md +0 -14
- package/docs/src/helpers/debounce-id.md +0 -14
- package/docs/src/helpers/debounce.md +0 -14
- package/docs/src/helpers/is-client.md +0 -14
- package/docs/src/helpers/is-equal.md +0 -14
- package/docs/src/helpers/is-standalone-mode.md +0 -14
- package/docs/src/helpers/kebab-case.md +0 -14
- package/docs/src/helpers/normalize-string.md +0 -14
- package/docs/src/helpers/pascal-case.md +0 -14
- package/docs/src/helpers/script-loader.md +0 -14
- package/docs/src/helpers/sleep.md +0 -14
- package/docs/src/helpers/snake-case.md +0 -14
- package/docs/src/helpers/throttle-id.md +0 -14
- package/docs/src/helpers/throttle.md +0 -14
- /package/docs/src/{guide → ecosystem/icons}/icon-set.md +0 -0
- /package/docs/src/{guide → ecosystem}/mcp.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/country-code-to-unicode-flag.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/currency.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/date.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/get-country-flag-url.md +0 -0
- /package/docs/src/{helpers → ecosystem/utils}/number.md +0 -0
|
@@ -68,34 +68,28 @@ const results = ref<MazInputPhoneNumberData>()
|
|
|
68
68
|
Control which countries appear in the dropdown and their order.
|
|
69
69
|
|
|
70
70
|
<ComponentDemo>
|
|
71
|
-
<div class="maz:
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<MazInputPhoneNumber
|
|
94
|
-
v-model="phone3"
|
|
95
|
-
:ignored-countries="['AF', 'AL', 'DZ']"
|
|
96
|
-
placeholder="Some countries are hidden"
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
71
|
+
<div class="maz:flex maz:flex-col maz:gap-4">
|
|
72
|
+
<MazInputPhoneNumber
|
|
73
|
+
top-label="Preferred Countries"
|
|
74
|
+
assistive-text="Show your most common countries first"
|
|
75
|
+
v-model="phone1"
|
|
76
|
+
:preferred-countries="['US', 'FR', 'GB', 'DE', 'CA']"
|
|
77
|
+
placeholder="Common countries appear first"
|
|
78
|
+
/>
|
|
79
|
+
<MazInputPhoneNumber
|
|
80
|
+
top-label="Only Specific Countries"
|
|
81
|
+
assistive-text="Limit to certain countries only"
|
|
82
|
+
v-model="phone2"
|
|
83
|
+
:only-countries="['US', 'FR', 'GB', 'DE', 'IT', 'ES']"
|
|
84
|
+
placeholder="Only European + North American countries"
|
|
85
|
+
/>
|
|
86
|
+
<MazInputPhoneNumber
|
|
87
|
+
top-label="Ignore Countries"
|
|
88
|
+
assistive-text="Remove unwanted countries"
|
|
89
|
+
v-model="phone3"
|
|
90
|
+
:ignored-countries="['AF', 'AL', 'DZ']"
|
|
91
|
+
placeholder="Some countries are hidden"
|
|
92
|
+
/>
|
|
99
93
|
</div>
|
|
100
94
|
|
|
101
95
|
<template #code>
|
|
@@ -133,22 +127,22 @@ Control which countries appear in the dropdown and their order.
|
|
|
133
127
|
Choose how the country selector and phone input are arranged.
|
|
134
128
|
|
|
135
129
|
<ComponentDemo>
|
|
136
|
-
<div class="maz:
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
130
|
+
<div class="maz:flex maz:flex-col maz:gap-6">
|
|
131
|
+
<MazInputPhoneNumber
|
|
132
|
+
top-label="Responsive"
|
|
133
|
+
assistive-text="Stacks on mobile, side-by-side on desktop"
|
|
134
|
+
orientation="responsive"
|
|
135
|
+
/>
|
|
136
|
+
<MazInputPhoneNumber
|
|
137
|
+
top-label="Always Row"
|
|
138
|
+
assistive-text="Side-by-side on all screen sizes"
|
|
139
|
+
orientation="row"
|
|
140
|
+
/>
|
|
141
|
+
<MazInputPhoneNumber
|
|
142
|
+
top-label="Always Column"
|
|
143
|
+
assistive-text="Stacked on all screen sizes"
|
|
144
|
+
orientation="col"
|
|
145
|
+
/>
|
|
152
146
|
</div>
|
|
153
147
|
|
|
154
148
|
<template #code>
|
|
@@ -156,13 +150,25 @@ Choose how the country selector and phone input are arranged.
|
|
|
156
150
|
```vue
|
|
157
151
|
<template>
|
|
158
152
|
<!-- Responsive layout (default) -->
|
|
159
|
-
<MazInputPhoneNumber
|
|
153
|
+
<MazInputPhoneNumber
|
|
154
|
+
top-label="Responsive"
|
|
155
|
+
assistive-text="Stacks on mobile, side-by-side on desktop"
|
|
156
|
+
orientation="responsive"
|
|
157
|
+
/>
|
|
160
158
|
|
|
161
159
|
<!-- Always side-by-side -->
|
|
162
|
-
<MazInputPhoneNumber
|
|
160
|
+
<MazInputPhoneNumber
|
|
161
|
+
top-label="Always Row"
|
|
162
|
+
assistive-text="Side-by-side on all screen sizes"
|
|
163
|
+
orientation="row"
|
|
164
|
+
/>
|
|
163
165
|
|
|
164
166
|
<!-- Always stacked -->
|
|
165
|
-
<MazInputPhoneNumber
|
|
167
|
+
<MazInputPhoneNumber
|
|
168
|
+
top-label="Always Column"
|
|
169
|
+
assistive-text="Stacked on all screen sizes"
|
|
170
|
+
orientation="col"
|
|
171
|
+
/>
|
|
166
172
|
</template>
|
|
167
173
|
```
|
|
168
174
|
|
|
@@ -174,34 +180,35 @@ Choose how the country selector and phone input are arranged.
|
|
|
174
180
|
Customize what information is shown to users.
|
|
175
181
|
|
|
176
182
|
<ComponentDemo>
|
|
177
|
-
<div class="maz:
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
183
|
+
<div class="maz:flex maz:flex-col maz:gap-4">
|
|
184
|
+
<MazInputPhoneNumber
|
|
185
|
+
top-label="Show Country Names"
|
|
186
|
+
assistive-text="Display country names instead of calling codes"
|
|
187
|
+
display-country-name
|
|
188
|
+
:translations="{
|
|
189
|
+
countrySelect: { placeholder: 'Choose country' }
|
|
190
|
+
}"
|
|
191
|
+
/>
|
|
192
|
+
<MazInputPhoneNumber
|
|
193
|
+
top-label="Show Calling Codes in List"
|
|
194
|
+
assistive-text="Help users see the dialing codes"
|
|
195
|
+
show-code-in-list
|
|
196
|
+
/>
|
|
197
|
+
<MazInputPhoneNumber
|
|
198
|
+
top-label="Hide Phone Examples"
|
|
199
|
+
assistive-text="Remove the example phone number hints (visible when the phone input is focused)"
|
|
200
|
+
:example="false"
|
|
201
|
+
/>
|
|
202
|
+
<MazInputPhoneNumber
|
|
203
|
+
top-label="Hide Country Flags"
|
|
204
|
+
assistive-text="Text-only country selection"
|
|
205
|
+
hide-flags
|
|
206
|
+
/>
|
|
207
|
+
<MazInputPhoneNumber
|
|
208
|
+
top-label="Flags of maz-ui"
|
|
209
|
+
assistive-text="No request to flagcdn.com, works offline"
|
|
210
|
+
:flag-src="loadCountryFlag"
|
|
211
|
+
/>
|
|
205
212
|
</div>
|
|
206
213
|
|
|
207
214
|
<template #code>
|
|
@@ -222,12 +229,36 @@ Customize what information is shown to users.
|
|
|
222
229
|
|
|
223
230
|
<!-- Hide country flags -->
|
|
224
231
|
<MazInputPhoneNumber hide-flags />
|
|
232
|
+
|
|
233
|
+
<!-- Flags of maz-ui, no request to flagcdn.com: import { loadCountryFlag } from 'maz-ui/country-flags' -->
|
|
234
|
+
<MazInputPhoneNumber :flag-src="loadCountryFlag" />
|
|
235
|
+
|
|
236
|
+
<!-- Your own files: public/flags/fr.svg... -->
|
|
237
|
+
<MazInputPhoneNumber flag-src="/flags/{code}.svg" />
|
|
225
238
|
</template>
|
|
226
239
|
```
|
|
227
240
|
|
|
228
241
|
</template>
|
|
229
242
|
</ComponentDemo>
|
|
230
243
|
|
|
244
|
+
### Flags source
|
|
245
|
+
|
|
246
|
+
By default, the flags come from the [flagcdn.com](https://flagcdn.com) CDN. The `flag-src` prop, passed to the country selector, takes:
|
|
247
|
+
|
|
248
|
+
- `loadCountryFlag` from `maz-ui/country-flags`: the flags of `@maz-ui/icons`, without any request to a third party, offline (hybrid apps with Capacitor or Cordova, PWAs);
|
|
249
|
+
- a URL template of your own files: `'/flags/{code}.svg'` (`{CODE}` for uppercase codes);
|
|
250
|
+
- your own function: `(code) => string | undefined | Promise<string | undefined>`.
|
|
251
|
+
|
|
252
|
+
Each flag is loaded only when visible, and a code without flag displays a badge. Set it once for the whole app with `defaults.global.flagSrc` of the MazUi plugin, or `mazUi.flags` of the Nuxt module (`'local'` or a URL template):
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
import { loadCountryFlag } from 'maz-ui/country-flags'
|
|
256
|
+
|
|
257
|
+
app.use(MazUi, { theme: { preset: mazUi }, defaults: { global: { flagSrc: loadCountryFlag } } })
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
See [MazSelectCountry](./maz-select-country.md#flags-source) for the details (bundle, Content Security Policy, PWA precache).
|
|
261
|
+
|
|
231
262
|
## Smart Country Detection
|
|
232
263
|
|
|
233
264
|
Let the component automatically detect the user's country.
|
|
@@ -762,34 +793,35 @@ const mobilePhone = ref()
|
|
|
762
793
|
Understanding what data the component provides.
|
|
763
794
|
|
|
764
795
|
<ComponentDemo>
|
|
765
|
-
<
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
<
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
<
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
<
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
<
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
<
|
|
791
|
-
|
|
792
|
-
|
|
796
|
+
<MazInputPhoneNumber
|
|
797
|
+
v-model="dataPhone"
|
|
798
|
+
v-model:country-code="dataCountry"
|
|
799
|
+
top-label="Your phone number"
|
|
800
|
+
placeholder="Enter a phone number to see data"
|
|
801
|
+
assistive-text="Enter your phone number in international format (e.g. +33612345678)"
|
|
802
|
+
@data="phoneData = $event"
|
|
803
|
+
/>
|
|
804
|
+
|
|
805
|
+
<div v-if="phoneData" class="maz:bg-surface-400 maz:pt-8 maz:rounded-md">
|
|
806
|
+
<h4 class="maz:font-semibold maz:mb-3">📊 Phone Number Data</h4>
|
|
807
|
+
<div class="maz:grid maz:grid-cols-1 maz:md:grid-cols-2 maz:gap-4 maz:text-sm">
|
|
808
|
+
<div>
|
|
809
|
+
<strong>Valid:</strong> {{ phoneData?.isValid ? '✅' : '❌' }}
|
|
810
|
+
</div>
|
|
811
|
+
<div>
|
|
812
|
+
<strong>Country:</strong> {{ phoneData?.countryCode || 'None' }}
|
|
813
|
+
</div>
|
|
814
|
+
<div>
|
|
815
|
+
<strong>National Format:</strong> {{ phoneData?.formatNational || 'None' }}
|
|
816
|
+
</div>
|
|
817
|
+
<div>
|
|
818
|
+
<strong>International:</strong> {{ phoneData?.formatInternational || 'None' }}
|
|
819
|
+
</div>
|
|
820
|
+
<div>
|
|
821
|
+
<strong>E164 Format:</strong> {{ phoneData?.e164 || 'None' }}
|
|
822
|
+
</div>
|
|
823
|
+
<div>
|
|
824
|
+
<strong>Phone Type:</strong> {{ phoneData?.type || 'Unknown' }}
|
|
793
825
|
</div>
|
|
794
826
|
</div>
|
|
795
827
|
</div>
|
|
@@ -883,6 +915,7 @@ interface MazInputPhoneNumberData {
|
|
|
883
915
|
<!--@include: ./../../.vitepress/generated-docs/maz-input-phone-number.doc.md-->
|
|
884
916
|
|
|
885
917
|
<script setup lang="ts">
|
|
918
|
+
import { loadCountryFlag } from 'maz-ui/country-flags'
|
|
886
919
|
import { ref } from 'vue'
|
|
887
920
|
|
|
888
921
|
// Basic usage
|
|
@@ -343,6 +343,10 @@ const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
|
|
|
343
343
|
</template>
|
|
344
344
|
</ComponentDemo>
|
|
345
345
|
|
|
346
|
+
::: info Zoom on iOS
|
|
347
|
+
iOS zooms the page when a focused field has a font size below `16px` (most sizes with a `14px` `base-font-size`). This applies to every form field: `MazInput` and the components built on it, `MazTextarea`, `MazInputCode`... To prevent it without changing the design of the fields, enable the `general.preventIosInputZoom` option of [@maz-ui/nuxt](../ecosystem/nuxt.md), or call [preventIosInputZoom](../ecosystem/utils/prevent-ios-input-zoom.md) from `@maz-ui/utils` in a Vue app.
|
|
348
|
+
:::
|
|
349
|
+
|
|
346
350
|
## Colors
|
|
347
351
|
|
|
348
352
|
::: tip
|
|
@@ -21,4 +21,68 @@ import MazLazyImg from 'maz-ui/components/MazLazyImg'
|
|
|
21
21
|
</template>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
::: tip Performance
|
|
25
|
+
`MazLazyImg` relies on the [`vLazyImg`](./../directives/lazy-img.md) directive, whose `IntersectionObserver`s are pooled and shared across every instance - rendering many images (galleries, lists, avatars) stays cheap.
|
|
26
|
+
:::
|
|
27
|
+
|
|
28
|
+
## Responsive sources
|
|
29
|
+
|
|
30
|
+
Pass an object with `sources` to serve different images depending on the media query (like a native `<picture>`).
|
|
31
|
+
|
|
32
|
+
```vue
|
|
33
|
+
<template>
|
|
34
|
+
<MazLazyImg
|
|
35
|
+
:src="{
|
|
36
|
+
sources: [
|
|
37
|
+
{ srcset: 'https://placedog.net/600/400', media: '(max-width: 600px)' },
|
|
38
|
+
{ srcset: 'https://placedog.net/1500/1000', media: '(min-width: 601px)' },
|
|
39
|
+
],
|
|
40
|
+
}"
|
|
41
|
+
block
|
|
42
|
+
/>
|
|
43
|
+
</template>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Image height full
|
|
47
|
+
|
|
48
|
+
By default the image is displayed with `width: 100%`. Enable `image-height-full` to fill the **height** instead: the image keeps its aspect ratio, fills 100% of the height and overflows/crops horizontally. Handy for wide images or SVGs inside a fixed-height container.
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<template>
|
|
52
|
+
<div style="height: 200px;">
|
|
53
|
+
<MazLazyImg image-height-full src="https://placedog.net/1500/1000" />
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Fallback on error
|
|
59
|
+
|
|
60
|
+
Provide `fallback-src` to swap the image when it fails to load.
|
|
61
|
+
|
|
62
|
+
<MazLazyImg
|
|
63
|
+
block
|
|
64
|
+
src="https://broken-link-image-src.example"
|
|
65
|
+
fallback-src="https://placedog.net/500/500?id=42"
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
```vue
|
|
69
|
+
<template>
|
|
70
|
+
<MazLazyImg
|
|
71
|
+
src="https://broken-link-image-src.example"
|
|
72
|
+
fallback-src="https://placedog.net/500/500"
|
|
73
|
+
block
|
|
74
|
+
/>
|
|
75
|
+
</template>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Without loader
|
|
79
|
+
|
|
80
|
+
Hide the spinner shown while the image is loading with `hide-loader`.
|
|
81
|
+
|
|
82
|
+
```vue
|
|
83
|
+
<template>
|
|
84
|
+
<MazLazyImg src="https://placedog.net/1000/1000" hide-loader block />
|
|
85
|
+
</template>
|
|
86
|
+
```
|
|
87
|
+
|
|
24
88
|
<!--@include: ./../../.vitepress/generated-docs/maz-lazy-img.doc.md-->
|