maz-ui 3.18.2 → 3.19.1

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 (125) hide show
  1. package/components/MazAvatar.mjs +1 -1
  2. package/components/MazBottomSheet.mjs +1 -1
  3. package/components/MazBtn.mjs +1 -1
  4. package/components/MazCard.mjs +1 -1
  5. package/components/MazCarousel.mjs +1 -1
  6. package/components/MazCheckbox.mjs +1 -1
  7. package/components/MazDialog.mjs +1 -1
  8. package/components/MazDialogPromise.mjs +1 -1
  9. package/components/MazDrawer.mjs +1 -1
  10. package/components/MazGallery.mjs +1 -1
  11. package/components/MazIcon.mjs +3 -2
  12. package/components/MazInput.mjs +1 -1
  13. package/components/MazInputNumber.mjs +5 -4
  14. package/components/MazInputPrice.mjs +1 -1
  15. package/components/MazInputTags.mjs +1 -1
  16. package/components/MazLazyImg.mjs +1 -1
  17. package/components/MazPhoneNumberInput/{constantes/locales.d.ts → default-locales.d.ts} +1 -2
  18. package/components/MazPhoneNumberInput/types.d.ts +40 -2
  19. package/components/MazPhoneNumberInput/use-libphonenumber.d.ts +32 -0
  20. package/components/MazPhoneNumberInput.d.ts +65 -14
  21. package/components/MazPhoneNumberInput.mjs +1 -1
  22. package/components/MazPicker/utils.d.ts +1 -4
  23. package/components/MazPicker.mjs +1 -1
  24. package/components/MazRadioButtons.mjs +2 -1
  25. package/components/MazSelect.d.ts +2 -0
  26. package/components/MazSelect.mjs +1 -1
  27. package/components/MazSlider.mjs +2 -1
  28. package/components/MazStepper.mjs +1 -1
  29. package/components/MazSwitch.mjs +2 -1
  30. package/components/MazTabs.mjs +2 -1
  31. package/components/MazTabsBar.mjs +1 -1
  32. package/components/MazTabsContentItem.mjs +1 -1
  33. package/components/MazTextarea.mjs +2 -1
  34. package/components/assets/MazPhoneNumberInput.css +1 -1
  35. package/components/assets/MazPickerCalendar.css +1 -1
  36. package/components/assets/MazSelect.css +1 -1
  37. package/components/chunks/{MazAvatar-68e2d653.mjs → MazAvatar-abb04cbe.mjs} +2 -2
  38. package/components/chunks/{MazBottomSheet-1fd128d5.mjs → MazBottomSheet-b78adb87.mjs} +3 -2
  39. package/components/chunks/{MazBtn-ebaa1574.mjs → MazBtn-000f9f66.mjs} +3 -3
  40. package/components/chunks/{MazBtn-80a95ca3.mjs → MazBtn-02b39f75.mjs} +4 -4
  41. package/components/chunks/{MazBtn-7963cdc8.mjs → MazBtn-18894690.mjs} +4 -4
  42. package/components/chunks/{MazBtn-83e85ae7.mjs → MazBtn-21743551.mjs} +4 -4
  43. package/components/chunks/{MazBtn-740fa3f9.mjs → MazBtn-2703c9bd.mjs} +2 -2
  44. package/components/chunks/{MazBtn-113db7ce.mjs → MazBtn-54c47489.mjs} +4 -4
  45. package/components/chunks/{MazBtn-8b76a9b9.mjs → MazBtn-57cb16a1.mjs} +4 -4
  46. package/components/chunks/{MazBtn-aed16fa9.mjs → MazBtn-5a37bfef.mjs} +4 -4
  47. package/components/chunks/{MazBtn-9449d9aa.mjs → MazBtn-67e1fe7b.mjs} +4 -4
  48. package/components/chunks/MazBtn-6e16fbca.mjs +184 -0
  49. package/components/chunks/{MazBtn-360120f0.mjs → MazBtn-9333e80f.mjs} +4 -4
  50. package/components/chunks/{MazBtn-cd553cc1.mjs → MazBtn-9d312f09.mjs} +4 -4
  51. package/components/chunks/MazBtn-a776eb42.mjs +184 -0
  52. package/components/chunks/{MazBtn-875045b0.mjs → MazBtn-b645511d.mjs} +4 -4
  53. package/components/chunks/{MazBtn-9e23a622.mjs → MazBtn-bf133cbc.mjs} +4 -4
  54. package/components/chunks/{MazCard-f0b1207f.mjs → MazCard-d9369776.mjs} +4 -4
  55. package/components/chunks/{MazCarousel-e6c83219.mjs → MazCarousel-06ca7c0b.mjs} +2 -2
  56. package/components/chunks/{MazDialog-5c53a6d7.mjs → MazDialog-d5f6a7d8.mjs} +1 -1
  57. package/components/chunks/{MazDialogPromise-e0a178ee.mjs → MazDialogPromise-23cb2e40.mjs} +2 -2
  58. package/components/chunks/{MazDrawer-682859a4.mjs → MazDrawer-7d6428cf.mjs} +1 -1
  59. package/components/chunks/{MazGallery-345cb883.mjs → MazGallery-c80e96f6.mjs} +2 -2
  60. package/{modules/chunks/MazIcon-1567cfaf.mjs → components/chunks/MazIcon-81176bfa.mjs} +4 -3
  61. package/components/chunks/{MazIcon-146f73d3.mjs → MazIcon-bda198b4.mjs} +3 -2
  62. package/components/chunks/{MazInput-c67999b0.mjs → MazInput-129c8695.mjs} +2 -2
  63. package/components/chunks/{MazInput-0424a850.mjs → MazInput-2a43e4a6.mjs} +3 -3
  64. package/components/chunks/{MazInput-3021f55e.mjs → MazInput-4a02a10a.mjs} +3 -3
  65. package/components/chunks/{MazInput-4b908386.mjs → MazInput-8e284503.mjs} +2 -2
  66. package/components/chunks/{MazInputPrice-50e3ea5d.mjs → MazInputPrice-e88dec74.mjs} +4 -3
  67. package/components/chunks/{MazInputTags-801c15dc.mjs → MazInputTags-872a6fae.mjs} +5 -4
  68. package/components/chunks/{MazLazyImg-a206909b.mjs → MazLazyImg-478c8d2b.mjs} +2 -2
  69. package/components/chunks/{MazLazyImg-13052d11.mjs → MazLazyImg-63de45ce.mjs} +1 -1
  70. package/components/chunks/MazPhoneNumberInput-458455bb.mjs +651 -0
  71. package/components/chunks/{MazPicker-25765233.mjs → MazPicker-6fc29a1c.mjs} +22 -26
  72. package/components/chunks/{MazPickerCalendar-1547bd78.mjs → MazPickerCalendar-6271c78d.mjs} +29 -24
  73. package/components/chunks/{MazPickerHeader-04d6a61f.mjs → MazPickerHeader-4f70f191.mjs} +1 -1
  74. package/components/chunks/{MazPickerMonthSwitcher-791ebc99.mjs → MazPickerMonthSwitcher-674ce015.mjs} +4 -3
  75. package/components/chunks/{MazPickerShortcuts-4bdeae6a.mjs → MazPickerShortcuts-2242854f.mjs} +4 -3
  76. package/components/chunks/{MazPickerTime-0ca05476.mjs → MazPickerTime-bb97786b.mjs} +4 -3
  77. package/components/chunks/{MazPickerYearSwitcher-a338777f.mjs → MazPickerYearSwitcher-47e5444b.mjs} +5 -4
  78. package/components/chunks/{MazSelect-d3d81ae8.mjs → MazSelect-2e7271f3.mjs} +55 -19
  79. package/components/chunks/{MazSelect-c03eaaf8.mjs → MazSelect-41a971ea.mjs} +55 -19
  80. package/components/chunks/{MazSpinner-559fb831.mjs → MazSpinner-232086b5.mjs} +1 -1
  81. package/components/chunks/{MazSpinner-c4d67909.mjs → MazSpinner-25ddb933.mjs} +1 -1
  82. package/components/chunks/{MazSpinner-5be09a6a.mjs → MazSpinner-2cbf1c0a.mjs} +1 -1
  83. package/components/chunks/{MazSpinner-450e5795.mjs → MazSpinner-2fac70be.mjs} +1 -1
  84. package/components/chunks/{MazSpinner-07d6be3a.mjs → MazSpinner-467d514f.mjs} +1 -1
  85. package/components/chunks/MazSpinner-47025e56.mjs +46 -0
  86. package/components/chunks/{MazSpinner-a3fe9ccb.mjs → MazSpinner-4b2a2fda.mjs} +1 -1
  87. package/components/chunks/{MazSpinner-24e65651.mjs → MazSpinner-5368411e.mjs} +1 -1
  88. package/components/chunks/MazSpinner-5921e33f.mjs +46 -0
  89. package/components/chunks/MazSpinner-60ca1f4c.mjs +46 -0
  90. package/components/chunks/{MazSpinner-33f756c4.mjs → MazSpinner-6c664898.mjs} +1 -1
  91. package/components/chunks/{MazSpinner-50959d38.mjs → MazSpinner-984d259a.mjs} +1 -1
  92. package/components/chunks/MazSpinner-a74389bd.mjs +46 -0
  93. package/components/chunks/{MazSpinner-ac676f71.mjs → MazSpinner-bed2bced.mjs} +1 -1
  94. package/components/chunks/{MazSpinner-5baeb3f0.mjs → MazSpinner-d6625983.mjs} +1 -1
  95. package/components/chunks/MazSpinner-f04bbd1e.mjs +46 -0
  96. package/components/chunks/{MazStepper-d61114a7.mjs → MazStepper-293b4be5.mjs} +4 -3
  97. package/components/chunks/{MazTabsBar-6f1ed175.mjs → MazTabsBar-6dffbdde.mjs} +2 -2
  98. package/components/chunks/{MazTransitionExpand-e408307c.mjs → MazTransitionExpand-648e21e0.mjs} +1 -1
  99. package/components/chunks/{MazTransitionExpand-bf4cb245.mjs → MazTransitionExpand-f3018af6.mjs} +1 -1
  100. package/modules/assets/index.css +1 -1
  101. package/modules/chunks/{MazBtn-bf5d1483.mjs → MazBtn-6418f038.mjs} +4 -4
  102. package/{components/chunks/MazIcon-00892ac4.mjs → modules/chunks/MazIcon-c43d744d.mjs} +4 -3
  103. package/modules/chunks/{MazSpinner-dda0b697.mjs → MazSpinner-766c5c8d.mjs} +1 -1
  104. package/modules/chunks/{index-a39534c8.mjs → index-71440a8c.mjs} +10 -8
  105. package/modules/index.mjs +1 -1
  106. package/nuxt/index.json +1 -1
  107. package/package.json +6 -6
  108. package/types/components/MazPhoneNumberInput/{constantes/locales.d.ts → default-locales.d.ts} +1 -2
  109. package/types/components/MazPhoneNumberInput/types.d.ts +40 -2
  110. package/types/components/MazPhoneNumberInput/use-libphonenumber.d.ts +32 -0
  111. package/types/components/MazPhoneNumberInput.vue.d.ts +65 -14
  112. package/types/components/MazPicker/utils.d.ts +1 -4
  113. package/types/components/MazSelect.vue.d.ts +2 -0
  114. package/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +0 -2
  115. package/components/MazPhoneNumberInput/utils/index.d.ts +0 -12
  116. package/components/chunks/MazBtn-a2eeb3f8.mjs +0 -184
  117. package/components/chunks/MazBtn-b191eece.mjs +0 -184
  118. package/components/chunks/MazPhoneNumberInput-59aa8e06.mjs +0 -854
  119. package/components/chunks/MazSpinner-7e5fb76c.mjs +0 -46
  120. package/components/chunks/MazSpinner-87273e1f.mjs +0 -46
  121. package/components/chunks/MazSpinner-d5f2c266.mjs +0 -46
  122. package/components/chunks/MazSpinner-e4d7bbe9.mjs +0 -46
  123. package/components/chunks/MazSpinner-f40ee2c7.mjs +0 -46
  124. package/types/components/MazPhoneNumberInput/utils/countries-name-list-by-iso-code.d.ts +0 -2
  125. package/types/components/MazPhoneNumberInput/utils/index.d.ts +0 -12
@@ -552,17 +552,15 @@ function getRangeFormattedDate({
552
552
  function getFirstDayOfMonth(value) {
553
553
  return dayjs(value).startOf("month").day();
554
554
  }
555
- function addDays(date2, days) {
556
- return date2.setDate(date2.getDate() + days);
557
- }
558
- function getWeekDays(locale, offset = 0) {
559
- return Array.from({ length: 7 }, (_v, i) => i + (offset || 0)).map((index) => {
560
- const baseDate = addDays(/* @__PURE__ */ new Date("1970-01-04"), index);
561
- return {
562
- label: date(baseDate, locale, { weekday: "short" }),
563
- dayNumber: new Date(baseDate).getDay()
564
- };
565
- });
555
+ function getDaysOfWeek(locale, firstDayOfWeek) {
556
+ const currentDate = dayjs().locale(locale);
557
+ const days = [];
558
+ for (let i = 0; i < 7; i++) {
559
+ const day = currentDate.day(i + firstDayOfWeek).toDate();
560
+ const dayName = date(day, locale, { weekday: "short" });
561
+ days.push(dayName);
562
+ }
563
+ return days;
566
564
  }
567
565
  function getDaysInMonth(date2) {
568
566
  return dayjs(date2).daysInMonth();
@@ -645,13 +643,9 @@ function getBrowserLocale() {
645
643
  }
646
644
  async function fetchLocale() {
647
645
  try {
648
- const response = await fetch("https://ip2c.org/s");
649
- const responseText = await response.text();
650
- const result = (responseText || "").toString();
651
- if (!result || result[0] !== "1") {
652
- return void 0;
653
- }
654
- return result.split(";")[1];
646
+ const reponse = await fetch("https://ipwho.is");
647
+ const { country_code } = await reponse.json();
648
+ return country_code;
655
649
  } catch (error) {
656
650
  console.error(`[maz-ui](MazPicker)(fetchCountryCode) ${error}`);
657
651
  }
@@ -695,11 +689,12 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
695
689
  disabledDates: { type: Array, required: true }
696
690
  },
697
691
  emits: ["update:model-value", "update:calendar-date", "close"],
698
- setup(__props, { emit: emits }) {
692
+ setup(__props, { emit: __emit }) {
693
+ const MazPickerTime = defineAsyncComponent(() => import("./MazPickerTime-bb97786b.mjs"));
694
+ const MazPickerHeader = defineAsyncComponent(() => import("./MazPickerHeader-4f70f191.mjs"));
695
+ const MazPickerCalendar = defineAsyncComponent(() => import("./MazPickerCalendar-6271c78d.mjs").then((n) => n.M));
699
696
  const props = __props;
700
- const MazPickerTime = defineAsyncComponent(() => import("./MazPickerTime-0ca05476.mjs"));
701
- const MazPickerHeader = defineAsyncComponent(() => import("./MazPickerHeader-04d6a61f.mjs"));
702
- const MazPickerCalendar = defineAsyncComponent(() => import("./MazPickerCalendar-1547bd78.mjs").then((n) => n.M));
697
+ const emits = __emit;
703
698
  const currentDate = computed({
704
699
  get: () => props.modelValue,
705
700
  set: (value) => {
@@ -942,19 +937,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
942
937
  }
943
938
  },
944
939
  emits: ["update:model-value", "close"],
945
- setup(__props, { emit: emits }) {
946
- const props = __props;
940
+ setup(__props, { emit: __emit }) {
947
941
  const ChevronDownIcon = defineAsyncComponent(() => import("./chevron-down-7a070b10.mjs"));
948
- const MazInput = defineAsyncComponent(() => import("./MazInput-0424a850.mjs"));
942
+ const MazInput = defineAsyncComponent(() => import("./MazInput-2a43e4a6.mjs"));
949
943
  dayjs.extend(customParseFormat);
950
944
  dayjs.extend(isBetween);
951
945
  const defaultInputDateStyle = {
952
946
  dateStyle: "full"
953
947
  };
948
+ const props = __props;
954
949
  const instance = getCurrentInstance();
955
950
  const internalLocale = ref(props.locale || "en-US");
956
951
  const currentLocale = computed(() => props.locale ?? internalLocale.value);
957
952
  const containerUniqueId = computed(() => `mazPickerContainer-${instance == null ? void 0 : instance.uid}`);
953
+ const emits = __emit;
958
954
  const MazPicker2 = ref();
959
955
  const hasTime = computed(() => props.time || props.onlyTime);
960
956
  const hasDouble = computed(() => props.double && !props.onlyTime);
@@ -1332,6 +1328,6 @@ export {
1332
1328
  getDaysInMonth as g,
1333
1329
  isSameDay as h,
1334
1330
  isSameDate as i,
1335
- getWeekDays as j,
1331
+ getDaysOfWeek as j,
1336
1332
  scrollToTarget as s
1337
1333
  };
@@ -1,7 +1,7 @@
1
1
  import "../assets/MazPickerCalendar.css";
2
2
  import { openBlock, createElementBlock, createElementVNode, defineComponent, computed, createVNode, withCtx, unref, createTextVNode, toDisplayString, useCssVars, ref, watch, TransitionGroup, Fragment, renderList, normalizeClass, createBlock, defineAsyncComponent, createCommentVNode, Transition } from "vue";
3
- import { d as dayjs, c as capitalize, a as date, _ as _export_sfc, g as getDaysInMonth, b as getFirstDayOfMonth, i as isSameDate, e as isToday, h as isSameDay, j as getWeekDays } from "./MazPicker-25765233.mjs";
4
- import MazBtn from "./MazBtn-80a95ca3.mjs";
3
+ import { d as dayjs, c as capitalize, a as date, _ as _export_sfc, g as getDaysInMonth, b as getFirstDayOfMonth, i as isSameDate, e as isToday, h as isSameDay, j as getDaysOfWeek } from "./MazPicker-6fc29a1c.mjs";
4
+ import MazBtn from "./MazBtn-6e16fbca.mjs";
5
5
  import { d as debounce } from "./debounce-b08199da.mjs";
6
6
  const _hoisted_1$3 = {
7
7
  xmlns: "http://www.w3.org/2000/svg",
@@ -45,8 +45,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
45
45
  "open-year-switcher",
46
46
  "update:calendar-date"
47
47
  ],
48
- setup(__props, { emit: emits }) {
48
+ setup(__props, { emit: __emit }) {
49
49
  const props = __props;
50
+ const emits = __emit;
50
51
  const calendarDate2 = computed(() => dayjs(props.calendarDate));
51
52
  const monthLabel = computed(() => {
52
53
  return props.double ? `${capitalize(
@@ -152,13 +153,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
152
153
  disabled: { type: Boolean, required: true }
153
154
  },
154
155
  emits: ["update:model-value", "update:hoverred-day"],
155
- setup(__props, { emit: emits }) {
156
- const props = __props;
156
+ setup(__props, { emit: __emit }) {
157
157
  useCssVars((_ctx) => ({
158
- "8a026648": hoverColor.value,
159
- "35de6aee": betweenColorAlpha.value,
160
- "37d10850": betweenColor.value
158
+ "5629e3a4": hoverColor.value,
159
+ "4619a326": betweenColorAlpha.value,
160
+ "96dce5d0": betweenColor.value
161
161
  }));
162
+ const props = __props;
163
+ const emits = __emit;
162
164
  const MazPickerGrid = ref();
163
165
  const transitionName = ref("maz-slidenext");
164
166
  const calendarDateArray = computed(() => [props.calendarDate]);
@@ -177,7 +179,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
177
179
  }))
178
180
  );
179
181
  const emptyDaysCount = computed(() => {
180
- return Math.abs(getFirstDayOfMonth(props.calendarDate) - props.firstDayOfWeek);
182
+ const firstDayMonth = getFirstDayOfMonth(props.calendarDate);
183
+ return (firstDayMonth - props.firstDayOfWeek + 7) % 7;
181
184
  });
182
185
  const setHoverredDay = (day) => {
183
186
  const value = props.modelValue;
@@ -422,8 +425,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
422
425
  };
423
426
  }
424
427
  });
425
- const MazPickerCalendarGrid_vue_vue_type_style_index_0_scoped_5167bf42_lang = "";
426
- const MazPickerCalendarGrid = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-5167bf42"]]);
428
+ const MazPickerCalendarGrid_vue_vue_type_style_index_0_scoped_49c6a0ff_lang = "";
429
+ const MazPickerCalendarGrid = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-49c6a0ff"]]);
427
430
  const _hoisted_1$1 = { class: "maz-picker-calendar-days" };
428
431
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
429
432
  __name: "MazPickerCalendarDays",
@@ -433,13 +436,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
433
436
  },
434
437
  setup(__props) {
435
438
  const props = __props;
436
- const days = computed(() => getWeekDays(props.locale, props.firstDayOfWeek));
439
+ const days = computed(() => getDaysOfWeek(props.locale, props.firstDayOfWeek));
437
440
  return (_ctx, _cache) => {
438
441
  return openBlock(), createElementBlock("div", _hoisted_1$1, [
439
442
  (openBlock(true), createElementBlock(
440
443
  Fragment,
441
444
  null,
442
- renderList(days.value, ({ label }) => {
445
+ renderList(days.value, (label) => {
443
446
  return openBlock(), createElementBlock(
444
447
  "span",
445
448
  { key: label },
@@ -455,8 +458,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
455
458
  };
456
459
  }
457
460
  });
458
- const MazPickerCalendarDays_vue_vue_type_style_index_0_scoped_30710867_lang = "";
459
- const MazPickerCalendarDays = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-30710867"]]);
461
+ const MazPickerCalendarDays_vue_vue_type_style_index_0_scoped_a7b7f610_lang = "";
462
+ const MazPickerCalendarDays = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-a7b7f610"]]);
460
463
  const _sfc_main$1 = /* @__PURE__ */ defineComponent({
461
464
  __name: "MazPickerCalendarMonth",
462
465
  props: {
@@ -478,8 +481,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
478
481
  disabled: { type: Boolean, required: true }
479
482
  },
480
483
  emits: ["update:model-value", "update:calendar-date", "update:hoverred-day"],
481
- setup(__props, { emit: emits }) {
484
+ setup(__props, { emit: __emit }) {
482
485
  const props = __props;
486
+ const emits = __emit;
483
487
  const modelValue = computed({
484
488
  get: () => props.modelValue,
485
489
  set: (value) => emits("update:model-value", value)
@@ -531,8 +535,8 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
531
535
  };
532
536
  }
533
537
  });
534
- const MazPickerCalendarMonth_vue_vue_type_style_index_0_scoped_ee77762c_lang = "";
535
- const MazPickerCalendarMonth = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-ee77762c"]]);
538
+ const MazPickerCalendarMonth_vue_vue_type_style_index_0_scoped_19c30331_lang = "";
539
+ const MazPickerCalendarMonth = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-19c30331"]]);
536
540
  const _hoisted_1 = { class: "maz-picker-calendar flex" };
537
541
  const _hoisted_2 = { class: "maz-picker-calendar__months" };
538
542
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -561,11 +565,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
561
565
  disabled: { type: Boolean, required: true }
562
566
  },
563
567
  emits: ["update:model-value", "update:calendar-date"],
564
- setup(__props, { emit: emits }) {
568
+ setup(__props, { emit: __emit }) {
569
+ const MazPickerMonthSwitcher = defineAsyncComponent(() => import("./MazPickerMonthSwitcher-674ce015.mjs"));
570
+ const MazPickerYearSwitcher = defineAsyncComponent(() => import("./MazPickerYearSwitcher-47e5444b.mjs"));
571
+ const MazPickerShortcuts = defineAsyncComponent(() => import("./MazPickerShortcuts-2242854f.mjs"));
565
572
  const props = __props;
566
- const MazPickerMonthSwitcher = defineAsyncComponent(() => import("./MazPickerMonthSwitcher-791ebc99.mjs"));
567
- const MazPickerYearSwitcher = defineAsyncComponent(() => import("./MazPickerYearSwitcher-a338777f.mjs"));
568
- const MazPickerShortcuts = defineAsyncComponent(() => import("./MazPickerShortcuts-4bdeae6a.mjs"));
573
+ const emits = __emit;
569
574
  const hoverredDay = ref();
570
575
  const isRangeMode = computed(() => props.modelValue && typeof props.modelValue === "object");
571
576
  const hasShortcuts = computed(
@@ -673,8 +678,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
673
678
  };
674
679
  }
675
680
  });
676
- const MazPickerCalendar_vue_vue_type_style_index_0_scoped_2c7a4b3f_lang = "";
677
- const MazPickerCalendar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2c7a4b3f"]]);
681
+ const MazPickerCalendar_vue_vue_type_style_index_0_scoped_dd9f0175_lang = "";
682
+ const MazPickerCalendar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-dd9f0175"]]);
678
683
  const MazPickerCalendar$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: MazPickerCalendar }, Symbol.toStringTag, { value: "Module" }));
679
684
  export {
680
685
  ChevronLeftIcon as C,
@@ -1,6 +1,6 @@
1
1
  import "../assets/MazPickerHeader.css";
2
2
  import { defineComponent, computed, ref, watch, openBlock, createElementBlock, normalizeClass, createVNode, TransitionGroup, withCtx, Fragment, renderList, toDisplayString, createCommentVNode } from "vue";
3
- import { a as date, c as capitalize, d as dayjs, _ as _export_sfc } from "./MazPicker-25765233.mjs";
3
+ import { a as date, c as capitalize, d as dayjs, _ as _export_sfc } from "./MazPicker-6fc29a1c.mjs";
4
4
  const _hoisted_1 = {
5
5
  key: 0,
6
6
  class: "m-picker-header__date"
@@ -1,7 +1,7 @@
1
1
  import "../assets/MazPickerMonthSwitcher.css";
2
2
  import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, createVNode, withModifiers, withCtx, unref, normalizeClass, Fragment, renderList, createBlock, createTextVNode, toDisplayString } from "vue";
3
- import { d as dayjs, c as capitalize, a as date, i as isSameDate, _ as _export_sfc } from "./MazPicker-25765233.mjs";
4
- import MazBtn from "./MazBtn-80a95ca3.mjs";
3
+ import { d as dayjs, c as capitalize, a as date, i as isSameDate, _ as _export_sfc } from "./MazPicker-6fc29a1c.mjs";
4
+ import MazBtn from "./MazBtn-6e16fbca.mjs";
5
5
  import { X as XIcon } from "./x-mark-af0cf423.mjs";
6
6
  const _hoisted_1 = { class: "maz-picker-month-switcher" };
7
7
  const _hoisted_2 = { class: "maz-picker-month-switcher__header" };
@@ -14,8 +14,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
14
14
  double: { type: Boolean, required: true }
15
15
  },
16
16
  emits: ["update:calendar-date", "close"],
17
- setup(__props, { emit: emits }) {
17
+ setup(__props, { emit: __emit }) {
18
18
  const props = __props;
19
+ const emits = __emit;
19
20
  const months = computed(() => {
20
21
  return Array.from({ length: 12 }, (_v, i) => i).map((monthNumber) => {
21
22
  const monthDate = dayjs(props.calendarDate).set("month", monthNumber);
@@ -1,7 +1,7 @@
1
1
  import "../assets/MazPickerShortcuts.css";
2
2
  import { defineComponent, ref, watch, openBlock, createElementBlock, Fragment, renderList, createBlock, normalizeClass, withModifiers, withCtx, createTextVNode, toDisplayString } from "vue";
3
- import MazBtn from "./MazBtn-80a95ca3.mjs";
4
- import { _ as _export_sfc } from "./MazPicker-25765233.mjs";
3
+ import MazBtn from "./MazBtn-6e16fbca.mjs";
4
+ import { _ as _export_sfc } from "./MazPicker-6fc29a1c.mjs";
5
5
  const _hoisted_1 = { class: "maz-picker-shortcuts" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "MazPickerShortcuts",
@@ -20,8 +20,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
20
20
  disabled: { type: Boolean, required: true }
21
21
  },
22
22
  emits: ["update:model-value"],
23
- setup(__props, { emit: emits }) {
23
+ setup(__props, { emit: __emit }) {
24
24
  const props = __props;
25
+ const emits = __emit;
25
26
  const selectedShortcut = ref(props.shortcut);
26
27
  const selectShortcut = (value, identifier) => {
27
28
  selectedShortcut.value = identifier;
@@ -1,7 +1,7 @@
1
1
  import "../assets/MazPickerTime.css";
2
2
  import { defineComponent, ref, computed, watch, nextTick, openBlock, createElementBlock, normalizeClass, Fragment, renderList, createElementVNode, normalizeStyle, createBlock, withModifiers, withCtx, createTextVNode, toDisplayString } from "vue";
3
- import { d as dayjs, f as findNearestNumberInList, s as scrollToTarget, _ as _export_sfc } from "./MazPicker-25765233.mjs";
4
- import MazBtn from "./MazBtn-80a95ca3.mjs";
3
+ import { d as dayjs, f as findNearestNumberInList, s as scrollToTarget, _ as _export_sfc } from "./MazPicker-6fc29a1c.mjs";
4
+ import MazBtn from "./MazBtn-6e16fbca.mjs";
5
5
  const _hoisted_1 = { class: "m-picker-time__column__items" };
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
7
7
  __name: "MazPickerTime",
@@ -28,7 +28,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
28
28
  disabled: { type: Boolean, required: true }
29
29
  },
30
30
  emits: ["update:model-value"],
31
- setup(__props, { emit: emits }) {
31
+ setup(__props, { emit: __emit }) {
32
32
  const props = __props;
33
33
  const findNearestHour = (hour) => {
34
34
  if (!props.disabledHours) {
@@ -46,6 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
46
46
  }
47
47
  return nearHour;
48
48
  };
49
+ const emits = __emit;
49
50
  const MazPickerTime2 = ref();
50
51
  const dividerHeight = ref();
51
52
  const currentHour = computed(() => {
@@ -1,9 +1,9 @@
1
1
  import "../assets/MazPickerYearSwitcher.css";
2
2
  import { defineComponent, ref, computed, openBlock, createElementBlock, createElementVNode, createVNode, withModifiers, withCtx, unref, Fragment, renderList, createBlock, normalizeClass, createTextVNode, toDisplayString } from "vue";
3
- import { d as dayjs, a as date, i as isSameDate, _ as _export_sfc } from "./MazPicker-25765233.mjs";
4
- import MazBtn from "./MazBtn-80a95ca3.mjs";
3
+ import { d as dayjs, a as date, i as isSameDate, _ as _export_sfc } from "./MazPicker-6fc29a1c.mjs";
4
+ import MazBtn from "./MazBtn-6e16fbca.mjs";
5
5
  import { X as XIcon } from "./x-mark-af0cf423.mjs";
6
- import { C as ChevronLeftIcon } from "./MazPickerCalendar-1547bd78.mjs";
6
+ import { C as ChevronLeftIcon } from "./MazPickerCalendar-6271c78d.mjs";
7
7
  const _hoisted_1 = { class: "maz-picker-year-switcher" };
8
8
  const _hoisted_2 = { class: "maz-picker-year-switcher__header" };
9
9
  const _hoisted_3 = { class: "maz-flex maz-space-x-2" };
@@ -16,8 +16,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16
16
  calendarDate: { type: String, required: true }
17
17
  },
18
18
  emits: ["update:calendar-date", "close"],
19
- setup(__props, { emit: emits }) {
19
+ setup(__props, { emit: __emit }) {
20
20
  const props = __props;
21
+ const emits = __emit;
21
22
  const currentDateTmp = ref(props.calendarDate);
22
23
  const years = computed(() => {
23
24
  return Array.from({ length: 15 }, (_v, i) => i - 7).map((yearNumber) => {
@@ -1,7 +1,7 @@
1
1
  import "../assets/MazSelect.css";
2
- import { ref, defineComponent, defineAsyncComponent, getCurrentInstance, computed, onBeforeMount, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, unref, withModifiers, withCtx, createElementVNode, Transition, normalizeStyle, createCommentVNode, renderSlot, Fragment, renderList, toDisplayString, nextTick } from "vue";
3
- import MazInput from "./MazInput-3021f55e.mjs";
4
- import { u as useInstanceUniqId, _ as _export_sfc } from "./MazPhoneNumberInput-59aa8e06.mjs";
2
+ import { ref, defineComponent, defineAsyncComponent, getCurrentInstance, computed, onBeforeMount, watch, nextTick, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, unref, withModifiers, withCtx, createElementVNode, Transition, normalizeStyle, createCommentVNode, renderSlot, Fragment, renderList, toDisplayString } from "vue";
3
+ import MazInput from "./MazInput-4a02a10a.mjs";
4
+ import { u as useInstanceUniqId, _ as _export_sfc } from "./MazPhoneNumberInput-458455bb.mjs";
5
5
  ref();
6
6
  ref();
7
7
  ref([]);
@@ -66,13 +66,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
66
  search: { type: Boolean, default: false },
67
67
  searchPlaceholder: { type: String, default: "Search in options" }
68
68
  },
69
- emits: ["close", "open", "update:model-value", "blur", "focus", "change"],
70
- setup(__props, { emit: emits }) {
71
- const props = __props;
69
+ emits: [
70
+ "close",
71
+ "open",
72
+ "blur",
73
+ "focus",
74
+ "change",
75
+ "update:model-value",
76
+ /** On selected value, returns the option object */
77
+ "selected-option"
78
+ ],
79
+ setup(__props, { emit: __emit }) {
72
80
  const SearchIcon = defineAsyncComponent(() => import("./magnifying-glass-6a0dd1a2.mjs"));
73
81
  const ChevronDownIcon = defineAsyncComponent(() => import("./chevron-down-7a070b10.mjs"));
74
82
  const NoSymbolIcon = defineAsyncComponent(() => import("./no-symbol-6173a20b.mjs"));
75
83
  const instance = getCurrentInstance();
84
+ const props = __props;
85
+ const emits = __emit;
76
86
  const listOpened = ref(false);
77
87
  const tmpModelValueIndex = ref();
78
88
  const hasListOpened = computed(() => listOpened.value || props.open);
@@ -117,9 +127,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
117
127
  );
118
128
  const searchQuery = ref("");
119
129
  const query = ref("");
130
+ function normalizeString(str) {
131
+ return str.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[^\dA-Za-z]/g, "");
132
+ }
120
133
  const searchInValue = (value, query2) => {
121
- return query2 && (value == null ? void 0 : value.toString().toLocaleLowerCase().trim().includes(query2.toLocaleLowerCase().trim()));
134
+ return query2 && value && normalizeString(value.toString().toLocaleLowerCase().trim()).includes(
135
+ normalizeString(query2.toLocaleLowerCase().trim())
136
+ );
122
137
  };
138
+ watch(
139
+ () => props.modelValue,
140
+ (value, oldValue) => {
141
+ if (value && value !== oldValue) {
142
+ scrollToSelected();
143
+ updateTmpModelValueIndex();
144
+ }
145
+ }
146
+ );
123
147
  function getFilteredOptionWithQuery(query2) {
124
148
  var _a;
125
149
  return query2 ? (_a = props.options) == null ? void 0 : _a.filter((option) => {
@@ -137,6 +161,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
137
161
  }
138
162
  await nextTick();
139
163
  listOpened.value = false;
164
+ tmpModelValueIndex.value = 0;
140
165
  emits("close", event);
141
166
  };
142
167
  const openList = async (event) => {
@@ -149,7 +174,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
149
174
  emits("open", listOpened.value);
150
175
  };
151
176
  function toggleList(event) {
152
- return listOpened.value ? closeList(event) : openList(event);
177
+ var _a, _b;
178
+ return listOpened.value ? closeList(event) : ((_b = (_a = mazInputComponent.value) == null ? void 0 : _a.$el.querySelector("input")) == null ? void 0 : _b.focus()) ?? openList();
153
179
  }
154
180
  function focusSearchInputAndSetQuery(q) {
155
181
  var _a;
@@ -168,11 +194,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
168
194
  tmpModelValueIndex.value = (_a = optionsList.value) == null ? void 0 : _a.findIndex(
169
195
  (option) => option[props.optionValueKey] === filteredOptions[0][props.optionValueKey]
170
196
  );
171
- scrollToSelected();
197
+ scrollToSelected(tmpModelValueIndex.value);
172
198
  }
173
199
  debounceCallback(() => {
174
200
  query.value = "";
175
- }, 2e3);
201
+ }, 1e3);
176
202
  }
177
203
  const mainInputKeyboardHandler = (event) => {
178
204
  const keyPressed = event.key;
@@ -218,7 +244,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
218
244
  } else {
219
245
  tmpModelValueIndex.value = code === "ArrowDown" ? 0 : optionsLength - 1;
220
246
  }
221
- scrollToSelected();
247
+ scrollToSelected(tmpModelValueIndex.value);
222
248
  };
223
249
  const enterHandler = (event, currentIndex) => {
224
250
  var _a, _b, _c;
@@ -231,16 +257,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
231
257
  updateValue(newValue);
232
258
  }
233
259
  };
234
- async function scrollToSelected(itemIndex = tmpModelValueIndex.value) {
260
+ async function scrollToSelected(index) {
235
261
  var _a, _b, _c;
236
262
  await nextTick();
237
- const selectedIndex = itemIndex ?? ((_a = optionsList.value) == null ? void 0 : _a.findIndex(
263
+ const selectedIndex = index ?? ((_a = optionsList.value) == null ? void 0 : _a.findIndex(
238
264
  (option) => {
239
265
  var _a2;
240
266
  return ((_a2 = selectedOption.value) == null ? void 0 : _a2[props.optionValueKey]) === option[props.optionValueKey];
241
267
  }
242
268
  ));
243
269
  if (typeof selectedIndex === "number") {
270
+ if (!tmpModelValueIndex.value)
271
+ tmpModelValueIndex.value = selectedIndex;
244
272
  (_c = (_b = optionsListElement.value) == null ? void 0 : _b.querySelectorAll(".m-select-list-item")[selectedIndex]) == null ? void 0 : _c.scrollIntoView({
245
273
  behavior: "auto",
246
274
  block: "nearest",
@@ -248,16 +276,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
248
276
  });
249
277
  }
250
278
  }
251
- const updateValue = (selectedOption2, mustCloseList = true) => {
279
+ function updateTmpModelValueIndex() {
252
280
  var _a;
253
- tmpModelValueIndex.value = (_a = optionsList.value) == null ? void 0 : _a.findIndex(
254
- (option) => selectedOption2[props.optionValueKey] === option[props.optionValueKey]
281
+ const index = (_a = optionsList.value) == null ? void 0 : _a.findIndex(
282
+ (option) => selectedOption[props.optionValueKey] === option[props.optionValueKey]
255
283
  );
284
+ tmpModelValueIndex.value = index && index >= 0 ? index : void 0;
285
+ }
286
+ const updateValue = (selectedOption2, mustCloseList = true) => {
256
287
  if (mustCloseList) {
257
288
  nextTick(() => closeList());
258
289
  }
259
290
  searchQuery.value = "";
260
291
  emits("update:model-value", selectedOption2[props.optionValueKey]);
292
+ emits("selected-option", selectedOption2);
293
+ updateTmpModelValueIndex();
261
294
  };
262
295
  return (_ctx, _cache) => {
263
296
  return openBlock(), createElementBlock(
@@ -324,7 +357,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
324
357
  ref_key: "searchInputComponent",
325
358
  ref: searchInputComponent,
326
359
  modelValue: searchQuery.value,
327
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
360
+ "onUpdate:modelValue": [
361
+ _cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
362
+ _cache[2] || (_cache[2] = ($event) => tmpModelValueIndex.value = 0)
363
+ ],
328
364
  size: "sm",
329
365
  color: __props.color,
330
366
  placeholder: __props.searchPlaceholder,
@@ -401,8 +437,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
401
437
  };
402
438
  }
403
439
  });
404
- const MazSelect_vue_vue_type_style_index_0_scoped_982bfd47_lang = "";
405
- const MazSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-982bfd47"]]);
440
+ const MazSelect_vue_vue_type_style_index_0_scoped_2589528b_lang = "";
441
+ const MazSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2589528b"]]);
406
442
  export {
407
443
  MazSelect as default
408
444
  };