@m3ui-vue/m3ui-vue 1.4.0 → 1.4.2

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 (95) hide show
  1. package/dist/API.md +295 -11
  2. package/dist/{MButton-DQMTIlaV.js → MButton-D7M324r9.js} +2 -2
  3. package/dist/{MButton-DQMTIlaV.js.map → MButton-D7M324r9.js.map} +1 -1
  4. package/dist/{MDialog-cdgapGfZ.js → MDialog-DuOnNF9s.js} +2 -2
  5. package/dist/{MDialog-cdgapGfZ.js.map → MDialog-DuOnNF9s.js.map} +1 -1
  6. package/dist/{MListItem-ZkSGIIrb.js → MListItem-Bb84X6ex.js} +144 -120
  7. package/dist/{MListItem-ZkSGIIrb.js.map → MListItem-Bb84X6ex.js.map} +1 -1
  8. package/dist/{MLoadingIndicator-U6_oGx8z.js → MLoadingIndicator-BUGRo2Tu.js} +2 -2
  9. package/dist/{MLoadingIndicator-U6_oGx8z.js.map → MLoadingIndicator-BUGRo2Tu.js.map} +1 -1
  10. package/dist/{MSeekBar-DTZVizZg.js → MSeekBar-BQUvUqb9.js} +2 -2
  11. package/dist/{MSeekBar-DTZVizZg.js.map → MSeekBar-BQUvUqb9.js.map} +1 -1
  12. package/dist/{MSlider-CqJkEYRZ.js → MSlider-SFdjE1Hy.js} +2 -2
  13. package/dist/{MSlider-CqJkEYRZ.js.map → MSlider-SFdjE1Hy.js.map} +1 -1
  14. package/dist/{MSpinner-Btgc-0nb.js → MSpinner-DKGNN64_.js} +2 -2
  15. package/dist/{MSpinner-Btgc-0nb.js.map → MSpinner-DKGNN64_.js.map} +1 -1
  16. package/dist/{MTextField-B6M0gJEO.js → MTextField-Utsef6Kk.js} +2 -2
  17. package/dist/{MTextField-B6M0gJEO.js.map → MTextField-Utsef6Kk.js.map} +1 -1
  18. package/dist/{MTooltip-Dspji4XG.js → MTooltip-BhTFQ9Z2.js} +4 -4
  19. package/dist/{MTooltip-Dspji4XG.js.map → MTooltip-BhTFQ9Z2.js.map} +1 -1
  20. package/dist/api.json +1 -1
  21. package/dist/code-editor.js +1 -1
  22. package/dist/components/MAvailabilityCalendar.vue.d.ts +1 -1
  23. package/dist/components/MCalendarHeatmap.vue.d.ts +120 -0
  24. package/dist/components/MCountdown.vue.d.ts +80 -0
  25. package/dist/components/MDatePicker.vue.d.ts +5 -0
  26. package/dist/components/MDatePickerModal.vue.d.ts +5 -0
  27. package/dist/components/MDateRangePicker.vue.d.ts +5 -0
  28. package/dist/components/MDateRangePickerModal.vue.d.ts +5 -0
  29. package/dist/components/MLightbox.vue.d.ts +1 -1
  30. package/dist/components/MListItem.vue.d.ts +10 -6
  31. package/dist/components/MMeterGroup.vue.d.ts +98 -0
  32. package/dist/components/MPhoneInput.vue.d.ts +72 -0
  33. package/dist/components/MSeekBar.vue.d.ts +1 -1
  34. package/dist/components/MTreeTable.vue.d.ts +1 -1
  35. package/dist/components/MTypewriter.vue.d.ts +57 -0
  36. package/dist/components/MVideoPlayer.vue.d.ts +1 -1
  37. package/dist/components/_MMonthYearButton.vue.d.ts +16 -0
  38. package/dist/components/_MYearGrid.vue.d.ts +19 -0
  39. package/dist/composables/_useCalendarMonth.d.ts +7 -0
  40. package/dist/composables/phoneNumber.d.ts +39 -0
  41. package/dist/composables/useLocale.d.ts +18 -0
  42. package/dist/data/phone-countries.d.ts +2 -0
  43. package/dist/draw.js +2 -2
  44. package/dist/flow.js +1 -1
  45. package/dist/gantt.js +1 -1
  46. package/dist/index.d.ts +10 -0
  47. package/dist/locales/index.js +63 -0
  48. package/dist/locales/index.js.map +1 -1
  49. package/dist/m3ui-vue.css +1 -1
  50. package/dist/m3ui.js +5133 -3366
  51. package/dist/m3ui.js.map +1 -1
  52. package/dist/map.js +5 -5
  53. package/dist/media.js +4 -4
  54. package/dist/pdf.js +4 -4
  55. package/dist/rich-text-editor.js +4 -4
  56. package/dist/styles.css +1 -1
  57. package/dist/{useLocale-DLKJIRFi.js → useLocale-B8YKWg-H.js} +10 -1
  58. package/dist/useLocale-B8YKWg-H.js.map +1 -0
  59. package/package.json +1 -1
  60. package/src/__tests__/MCalendarHeatmap.test.ts +79 -0
  61. package/src/__tests__/MCountdown.test.ts +75 -0
  62. package/src/__tests__/MListItemNestedControl.test.ts +88 -0
  63. package/src/__tests__/MMeterGroup.test.ts +43 -0
  64. package/src/__tests__/MPhoneInput.test.ts +97 -0
  65. package/src/__tests__/MTypewriter.test.ts +50 -0
  66. package/src/__tests__/calendarMonth.test.ts +104 -0
  67. package/src/__tests__/clearToNull.test.ts +30 -0
  68. package/src/__tests__/ssr.test.ts +4 -0
  69. package/src/components/MAutocomplete.vue +2 -2
  70. package/src/components/MCalendarHeatmap.vue +349 -0
  71. package/src/components/MCountdown.vue +200 -0
  72. package/src/components/MDatePicker.vue +74 -34
  73. package/src/components/MDatePickerModal.vue +79 -36
  74. package/src/components/MDateRangePicker.vue +73 -33
  75. package/src/components/MDateRangePickerModal.vue +75 -35
  76. package/src/components/MListItem.vue +54 -8
  77. package/src/components/MMeterGroup.vue +196 -0
  78. package/src/components/MPhoneInput.vue +480 -0
  79. package/src/components/MSelect.vue +2 -2
  80. package/src/components/MTypewriter.vue +195 -0
  81. package/src/components/_MMonthYearButton.vue +36 -0
  82. package/src/components/_MYearGrid.vue +106 -0
  83. package/src/composables/_useCalendarMonth.ts +32 -2
  84. package/src/composables/phoneNumber.ts +137 -0
  85. package/src/composables/useLocale.ts +27 -0
  86. package/src/data/phone-countries.ts +62 -0
  87. package/src/index.ts +10 -0
  88. package/src/locales/de.ts +9 -0
  89. package/src/locales/es.ts +9 -0
  90. package/src/locales/fr.ts +9 -0
  91. package/src/locales/ja.ts +9 -0
  92. package/src/locales/ko.ts +9 -0
  93. package/src/locales/pt.ts +9 -0
  94. package/src/locales/zh.ts +9 -0
  95. package/dist/useLocale-DLKJIRFi.js.map +0 -1
@@ -0,0 +1,39 @@
1
+ export interface PhoneCountry {
2
+ /** ISO 3166-1 alpha-2 */
3
+ iso2: string;
4
+ /** Calling code, without the + */
5
+ dial: string;
6
+ /** National number masks, `#` a digit */
7
+ masks: readonly string[];
8
+ }
9
+ export interface ParsedPhone {
10
+ country: PhoneCountry;
11
+ /** National significant number: digits only, no trunk 0 */
12
+ national: string;
13
+ }
14
+ /** Every country, in the data's order */
15
+ export declare function phoneCountries(): PhoneCountry[];
16
+ export declare function phoneCountry(iso2: string): PhoneCountry | undefined;
17
+ /** Digits of a national number as typed: no formatting, no trunk 0 */
18
+ export declare function nationalDigits(input: string, country: PhoneCountry): string;
19
+ /**
20
+ * Splits an international number (`+541123456789`, `00 54 11...`, `+54 9 11 2345-6789`) into its country and
21
+ * national digits. Where a calling code is shared (+1), `prefer` wins if it has it, else the first listed (US).
22
+ */
23
+ export declare function parsePhone(value: string, prefer?: string): ParsedPhone | null;
24
+ /**
25
+ * National digits formatted with the country's masks: the one whose leading digits match (Argentina's 9 for
26
+ * mobiles), else the shortest that holds them. Digits past every mask are appended; countries without masks get
27
+ * groups of three with the last four together.
28
+ */
29
+ export declare function formatNational(national: string, country: PhoneCountry): string;
30
+ /** Whether national digits are a plausible full number for the country */
31
+ export declare function isValidNational(national: string, country: PhoneCountry): boolean;
32
+ /** E.164 (`+541123456789`) from a country and national digits; null when there are none */
33
+ export declare function toE164(national: string, country: PhoneCountry): string | null;
34
+ /** A stored E.164 number for display: `+54 11 2345-6789`; the input back when it isn't one */
35
+ export declare function formatPhone(e164: string, prefer?: string): string;
36
+ /** Whether an E.164 number is a plausible full number for its country */
37
+ export declare function isValidPhone(e164: string, prefer?: string): boolean;
38
+ /** The flag emoji of an ISO 3166-1 alpha-2 code (regional indicator letters) */
39
+ export declare function flagEmoji(iso2: string): string;
@@ -32,6 +32,24 @@ export interface M3Locale {
32
32
  ok: string;
33
33
  dateToggleInput: string;
34
34
  dateToggleCalendar: string;
35
+ /** The date pickers' month/year button: opens the year grid */
36
+ dateSwitchToYear: string;
37
+ /** The same button while the year grid is open: back to the days */
38
+ dateSwitchToDay: string;
39
+ /** Calendar heatmap legend, low end */
40
+ heatmapLess: string;
41
+ /** Calendar heatmap legend, high end */
42
+ heatmapMore: string;
43
+ /** Meter group: what's left of max */
44
+ meterRemaining: string;
45
+ /** Meter group header; {used} and {max} are replaced */
46
+ meterUsedOf: string;
47
+ /** Phone input: the country selector */
48
+ phoneCountry: string;
49
+ /** Phone input: the country search field */
50
+ phoneSearchCountry: string;
51
+ /** Phone input: the number doesn't fit its country's length */
52
+ phoneInvalid: string;
35
53
  dateInputLabel: string;
36
54
  selectTime: string;
37
55
  timeHourSelection: string;
@@ -0,0 +1,2 @@
1
+ export type PhoneCountryData = readonly [iso2: string, dial: string, masks?: readonly string[]];
2
+ export declare const PHONE_COUNTRIES: readonly PhoneCountryData[];
package/dist/draw.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as e } from "./useLocale-DLKJIRFi.js";
1
+ import { i as e } from "./useLocale-B8YKWg-H.js";
2
2
  import { t } from "./MIconButton-DoNotQ9v.js";
3
- import { n, t as r } from "./MTooltip-Dspji4XG.js";
3
+ import { n, t as r } from "./MTooltip-BhTFQ9Z2.js";
4
4
  import { n as i, t as a } from "./MMenuItem-Bih0h4-n.js";
5
5
  import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, inject as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, provide as ee, ref as w, renderList as T, renderSlot as E, shallowRef as D, toDisplayString as te, unref as O, useId as ne, useModel as k, vModelText as re, watch as ie, withCtx as A, withDirectives as j, withKeys as ae, withModifiers as M } from "vue";
6
6
  //#region src/composables/drawGeometry.ts
package/dist/flow.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-DLKJIRFi.js";
1
+ import { i as e } from "./useLocale-B8YKWg-H.js";
2
2
  import { r as t, t as n, u as r } from "./MIconButton-DoNotQ9v.js";
3
3
  import { a as i, c as a, d as o, i as s, l as c, n as l, o as u, r as d, s as f, t as p, u as m } from "./flowPaths-CcWOKY4Z.js";
4
4
  import { Fragment as h, Transition as g, computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, createElementVNode as x, createTextVNode as S, createVNode as C, defineComponent as w, inject as T, mergeProps as ee, nextTick as E, normalizeClass as D, normalizeStyle as O, onBeforeUnmount as te, onMounted as ne, openBlock as k, provide as re, reactive as ie, ref as A, renderList as ae, renderSlot as oe, shallowReactive as se, shallowRef as ce, toDisplayString as le, toRaw as ue, unref as j, useSlots as de, vShow as fe, watch as pe, withCtx as me, withDirectives as M, withModifiers as he } from "vue";
package/dist/gantt.js CHANGED
@@ -1,4 +1,4 @@
1
- import { i as e } from "./useLocale-DLKJIRFi.js";
1
+ import { i as e } from "./useLocale-B8YKWg-H.js";
2
2
  import { f as t, l as n, t as r, u as i } from "./MIconButton-DoNotQ9v.js";
3
3
  import { t as a } from "./MSegmentedButton-DL9JtJFX.js";
4
4
  import { t as o } from "./flowPaths-CcWOKY4Z.js";
package/dist/index.d.ts CHANGED
@@ -66,6 +66,13 @@ export type { SparkleOptions, SparkleValue } from './directives/vSparkle';
66
66
  export { default as MAbsolute } from './components/MAbsolute.vue';
67
67
  export { default as MAlert } from './components/MAlert.vue';
68
68
  export { default as MAnimatedNumber } from './components/MAnimatedNumber.vue';
69
+ export { default as MCountdown } from './components/MCountdown.vue';
70
+ export type { CountdownUnit, CountdownParts } from './components/MCountdown.vue';
71
+ export { default as MCalendarHeatmap } from './components/MCalendarHeatmap.vue';
72
+ export type { HeatmapDay, HeatmapCell } from './components/MCalendarHeatmap.vue';
73
+ export { default as MMeterGroup } from './components/MMeterGroup.vue';
74
+ export type { MeterItem } from './components/MMeterGroup.vue';
75
+ export { default as MTypewriter } from './components/MTypewriter.vue';
69
76
  export { default as MAutocomplete } from './components/MAutocomplete.vue';
70
77
  export { default as MAppBar } from './components/MAppBar.vue';
71
78
  export { default as MAppBarWithSearch } from './components/MAppBarWithSearch.vue';
@@ -178,6 +185,9 @@ export { default as MBeforeAfter } from './components/MBeforeAfter.vue';
178
185
  export { default as MCreditCardInput } from './components/MCreditCardInput.vue';
179
186
  export type { CreditCardValue, CreditCardField } from './components/MCreditCardInput.vue';
180
187
  export { detectCardBrand, luhnCheck, formatCardNumber, isValidCardNumber, isValidExpiry } from './composables/cardBrand';
188
+ export { default as MPhoneInput } from './components/MPhoneInput.vue';
189
+ export { formatPhone, isValidPhone, parsePhone, phoneCountries, flagEmoji } from './composables/phoneNumber';
190
+ export type { PhoneCountry, ParsedPhone } from './composables/phoneNumber';
181
191
  export type { CardBrand, CardBrandInfo } from './composables/cardBrand';
182
192
  export { default as MPosKeypad } from './components/MPosKeypad.vue';
183
193
  export { default as MOrderTicket } from './components/MOrderTicket.vue';
@@ -29,6 +29,15 @@ var e = {
29
29
  ok: "Aceptar",
30
30
  dateToggleInput: "Cambiar a entrada de texto",
31
31
  dateToggleCalendar: "Cambiar a calendario",
32
+ dateSwitchToYear: "Cambiar a selección de año",
33
+ dateSwitchToDay: "Cambiar a selección de día",
34
+ heatmapLess: "Menos",
35
+ heatmapMore: "Más",
36
+ meterRemaining: "Disponible",
37
+ meterUsedOf: "{used} de {max}",
38
+ phoneCountry: "País",
39
+ phoneSearchCountry: "Buscar país",
40
+ phoneInvalid: "Número de teléfono incompleto",
32
41
  dateInputLabel: "Fecha",
33
42
  selectTime: "Seleccionar hora",
34
43
  timeHourSelection: "Seleccionar hora",
@@ -563,6 +572,15 @@ var e = {
563
572
  ok: "OK",
564
573
  dateToggleInput: "Passer à la saisie de texte",
565
574
  dateToggleCalendar: "Passer au calendrier",
575
+ dateSwitchToYear: "Passer à la sélection de l'année",
576
+ dateSwitchToDay: "Passer à la sélection du jour",
577
+ heatmapLess: "Moins",
578
+ heatmapMore: "Plus",
579
+ meterRemaining: "Disponible",
580
+ meterUsedOf: "{used} sur {max}",
581
+ phoneCountry: "Pays",
582
+ phoneSearchCountry: "Rechercher un pays",
583
+ phoneInvalid: "Numéro de téléphone incomplet",
566
584
  dateInputLabel: "Date",
567
585
  selectTime: "Sélectionner l'heure",
568
586
  timeHourSelection: "Sélectionner l'heure",
@@ -1097,6 +1115,15 @@ var e = {
1097
1115
  ok: "OK",
1098
1116
  dateToggleInput: "Mudar para entrada de texto",
1099
1117
  dateToggleCalendar: "Mudar para calendário",
1118
+ dateSwitchToYear: "Mudar para seleção de ano",
1119
+ dateSwitchToDay: "Mudar para seleção de dia",
1120
+ heatmapLess: "Menos",
1121
+ heatmapMore: "Mais",
1122
+ meterRemaining: "Disponível",
1123
+ meterUsedOf: "{used} de {max}",
1124
+ phoneCountry: "País",
1125
+ phoneSearchCountry: "Pesquisar país",
1126
+ phoneInvalid: "Número de telefone incompleto",
1100
1127
  dateInputLabel: "Data",
1101
1128
  selectTime: "Selecionar hora",
1102
1129
  timeHourSelection: "Selecionar hora",
@@ -1631,6 +1658,15 @@ var e = {
1631
1658
  ok: "OK",
1632
1659
  dateToggleInput: "Zur Texteingabe wechseln",
1633
1660
  dateToggleCalendar: "Zum Kalender wechseln",
1661
+ dateSwitchToYear: "Zur Jahresauswahl wechseln",
1662
+ dateSwitchToDay: "Zur Tagesauswahl wechseln",
1663
+ heatmapLess: "Weniger",
1664
+ heatmapMore: "Mehr",
1665
+ meterRemaining: "Verfügbar",
1666
+ meterUsedOf: "{used} von {max}",
1667
+ phoneCountry: "Land",
1668
+ phoneSearchCountry: "Land suchen",
1669
+ phoneInvalid: "Unvollständige Telefonnummer",
1634
1670
  dateInputLabel: "Datum",
1635
1671
  selectTime: "Uhrzeit auswählen",
1636
1672
  timeHourSelection: "Stunde auswählen",
@@ -2165,6 +2201,15 @@ var e = {
2165
2201
  ok: "OK",
2166
2202
  dateToggleInput: "テキスト入力に切り替え",
2167
2203
  dateToggleCalendar: "カレンダーに切り替え",
2204
+ dateSwitchToYear: "年の選択に切り替え",
2205
+ dateSwitchToDay: "日の選択に切り替え",
2206
+ heatmapLess: "少ない",
2207
+ heatmapMore: "多い",
2208
+ meterRemaining: "空き",
2209
+ meterUsedOf: "{used} / {max}",
2210
+ phoneCountry: "国・地域",
2211
+ phoneSearchCountry: "国・地域を検索",
2212
+ phoneInvalid: "電話番号が不完全です",
2168
2213
  dateInputLabel: "日付",
2169
2214
  selectTime: "時刻を選択",
2170
2215
  timeHourSelection: "時間を選択",
@@ -2699,6 +2744,15 @@ var e = {
2699
2744
  ok: "确定",
2700
2745
  dateToggleInput: "切换到文本输入",
2701
2746
  dateToggleCalendar: "切换到日历",
2747
+ dateSwitchToYear: "切换到年份选择",
2748
+ dateSwitchToDay: "切换到日期选择",
2749
+ heatmapLess: "少",
2750
+ heatmapMore: "多",
2751
+ meterRemaining: "可用",
2752
+ meterUsedOf: "{used} / {max}",
2753
+ phoneCountry: "国家/地区",
2754
+ phoneSearchCountry: "搜索国家/地区",
2755
+ phoneInvalid: "电话号码不完整",
2702
2756
  dateInputLabel: "日期",
2703
2757
  selectTime: "选择时间",
2704
2758
  timeHourSelection: "选择小时",
@@ -3233,6 +3287,15 @@ var e = {
3233
3287
  ok: "확인",
3234
3288
  dateToggleInput: "텍스트 입력으로 전환",
3235
3289
  dateToggleCalendar: "달력으로 전환",
3290
+ dateSwitchToYear: "연도 선택으로 전환",
3291
+ dateSwitchToDay: "날짜 선택으로 전환",
3292
+ heatmapLess: "적음",
3293
+ heatmapMore: "많음",
3294
+ meterRemaining: "남음",
3295
+ meterUsedOf: "{used} / {max}",
3296
+ phoneCountry: "국가",
3297
+ phoneSearchCountry: "국가 검색",
3298
+ phoneInvalid: "전화번호가 완전하지 않습니다",
3236
3299
  dateInputLabel: "날짜",
3237
3300
  selectTime: "시간 선택",
3238
3301
  timeHourSelection: "시간 선택",