@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.
@@ -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 = getCountries();
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], { type: 'region' });
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;
@@ -82,7 +82,7 @@ export const WithIcon: Story = {
82
82
  }),
83
83
  };
84
84
 
85
- export const minValue: Story = {
85
+ export const MinValue: Story = {
86
86
  args: {
87
87
  id: 'minValueId',
88
88
  inputType: 'number',
@@ -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 | enki | mbrand`.
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';