@mozaic-ds/vue 2.9.0 → 2.10.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 +4 -6
- package/dist/mozaic-vue.css +1 -1
- package/dist/mozaic-vue.d.ts +317 -250
- package/dist/mozaic-vue.js +1050 -896
- package/dist/mozaic-vue.js.map +1 -1
- package/dist/mozaic-vue.umd.cjs +5 -5
- package/dist/mozaic-vue.umd.cjs.map +1 -1
- package/package.json +14 -13
- package/src/components/carousel/MCarousel.spec.ts +138 -0
- package/src/components/carousel/MCarousel.stories.ts +94 -0
- package/src/components/carousel/MCarousel.vue +154 -0
- package/src/components/carousel/README.md +18 -0
- package/src/components/flag/MFlag.stories.ts +1 -1
- package/src/components/loader/MLoader.spec.ts +2 -2
- package/src/components/loader/MLoader.vue +2 -2
- package/src/components/phonenumber/MPhoneNumber.spec.ts +110 -1
- package/src/components/phonenumber/MPhoneNumber.stories.ts +14 -0
- package/src/components/phonenumber/MPhoneNumber.vue +16 -6
- package/src/components/textinput/MTextInput.stories.ts +1 -1
- package/src/components/usingPresets.mdx +1 -1
- package/src/main.ts +1 -0
|
@@ -116,6 +116,14 @@ const props = withDefaults(
|
|
|
116
116
|
* If `true`, display the country flag selector
|
|
117
117
|
*/
|
|
118
118
|
flag?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Locale for displaying country names (e.g., 'fr', 'en', 'es', 'pt').
|
|
121
|
+
*/
|
|
122
|
+
locale?: string;
|
|
123
|
+
/**
|
|
124
|
+
* List of country codes to display in the selector. If not provided, all countries will be shown.
|
|
125
|
+
*/
|
|
126
|
+
countryCodes?: CountryCode[];
|
|
119
127
|
}>(),
|
|
120
128
|
{
|
|
121
129
|
modelValue: '',
|
|
@@ -123,12 +131,15 @@ const props = withDefaults(
|
|
|
123
131
|
size: 'm',
|
|
124
132
|
prefix: true,
|
|
125
133
|
flag: true,
|
|
134
|
+
locale: 'en',
|
|
126
135
|
},
|
|
127
136
|
);
|
|
128
137
|
|
|
129
138
|
const phoneNumber = ref(props.modelValue);
|
|
130
139
|
const selectedCountry = ref<CountryCode>(props.defaultCountry);
|
|
131
|
-
const countries =
|
|
140
|
+
const countries = computed(() => {
|
|
141
|
+
return props.countryCodes || getCountries();
|
|
142
|
+
});
|
|
132
143
|
|
|
133
144
|
const dynamicPlaceholder = computed(() => {
|
|
134
145
|
if (props.placeholder && props.placeholder.length > 0) {
|
|
@@ -155,12 +166,11 @@ const parsedNumber = computed(() => {
|
|
|
155
166
|
}
|
|
156
167
|
});
|
|
157
168
|
|
|
158
|
-
const getCountryName = (
|
|
159
|
-
countryCode: CountryCode,
|
|
160
|
-
locale: string = 'fr',
|
|
161
|
-
): string => {
|
|
169
|
+
const getCountryName = (countryCode: CountryCode): string => {
|
|
162
170
|
try {
|
|
163
|
-
const regionNames = new Intl.DisplayNames([locale], {
|
|
171
|
+
const regionNames = new Intl.DisplayNames([props.locale], {
|
|
172
|
+
type: 'region',
|
|
173
|
+
});
|
|
164
174
|
return regionNames.of(countryCode) || countryCode;
|
|
165
175
|
} catch {
|
|
166
176
|
return countryCode;
|
|
@@ -39,7 +39,7 @@ All it has to do is insert the following code into its main Sass file (entrypoin
|
|
|
39
39
|
/>
|
|
40
40
|
|
|
41
41
|
> [!NOTE]
|
|
42
|
-
> The `<presetName>` string should be replaced by the name of the preset you want, one of the following values: `adeo |
|
|
42
|
+
> The `<presetName>` string should be replaced by the name of the preset you want, one of the following values: `adeo | mbrand`.
|
|
43
43
|
> As the `leroymerlin` preset is the default preset, you don't need to use this syntax to use it.
|
|
44
44
|
|
|
45
45
|
For example, for ADEO
|
package/src/main.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { default as MAvatar } from './components/avatar/MAvatar.vue';
|
|
|
2
2
|
export { default as MBreadcrumb } from './components/breadcrumb/MBreadcrumb.vue';
|
|
3
3
|
export { default as MButton } from './components/button/MButton.vue';
|
|
4
4
|
export { default as MCallout } from './components/callout/MCallout.vue';
|
|
5
|
+
export { default as MCarousel } from './components/carousel/MCarousel.vue';
|
|
5
6
|
export { default as MCheckbox } from './components/checkbox/MCheckbox.vue';
|
|
6
7
|
export { default as MCheckboxGroup } from './components/checkboxgroup/MCheckboxGroup.vue';
|
|
7
8
|
export { default as MCircularProgressbar } from './components/circularprogressbar/MCircularProgressbar.vue';
|