@quidgest/ui 0.19.0 → 0.20.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 (130) hide show
  1. package/CHANGELOG.md +21 -1
  2. package/dist/json/api.json +1414 -45
  3. package/dist/manifest/components.json +2 -0
  4. package/dist/ui.css +1374 -5
  5. package/dist/ui.esm.js +1459 -841
  6. package/dist/ui.js +1444 -826
  7. package/dist/ui.min.css +2 -1
  8. package/dist/ui.min.js +1444 -826
  9. package/dist/ui.scss +569 -7
  10. package/esm/components/QField/QField.d.ts.map +1 -1
  11. package/esm/components/QField/QField.vue.js +1 -1
  12. package/esm/components/QGauge/QGauge.d.ts +56 -0
  13. package/esm/components/QGauge/QGauge.d.ts.map +1 -0
  14. package/esm/components/QGauge/QGauge.vue.js +305 -0
  15. package/esm/components/QGauge/QGauge2.vue.js +5 -0
  16. package/esm/components/QGauge/constants.d.ts +6 -0
  17. package/esm/components/QGauge/constants.d.ts.map +1 -0
  18. package/esm/components/QGauge/constants.js +8 -0
  19. package/esm/components/QGauge/index.d.ts +124 -0
  20. package/esm/components/QGauge/index.d.ts.map +1 -0
  21. package/esm/components/QGauge/index.js +6 -0
  22. package/esm/components/QGauge/types.d.ts +146 -0
  23. package/esm/components/QGauge/types.d.ts.map +1 -0
  24. package/esm/components/QInputGroup/QInputGroup.d.ts +147 -3
  25. package/esm/components/QInputGroup/QInputGroup.d.ts.map +1 -1
  26. package/esm/components/QInputGroup/QInputGroup.vue.js +32 -23
  27. package/esm/components/QInputGroup/index.d.ts +81 -4
  28. package/esm/components/QInputGroup/index.d.ts.map +1 -1
  29. package/esm/components/QList/QList.d.ts.map +1 -1
  30. package/esm/components/QList/QList.vue.js +3 -1
  31. package/esm/components/QList/QListItem.d.ts.map +1 -1
  32. package/esm/components/QList/QListItem.vue.js +24 -28
  33. package/esm/components/QList/types.d.ts +1 -1
  34. package/esm/components/QOverlay/types.d.ts +3 -1
  35. package/esm/components/QOverlay/types.d.ts.map +1 -1
  36. package/esm/components/QPhoneField/QPhoneField.d.ts +2263 -0
  37. package/esm/components/QPhoneField/QPhoneField.d.ts.map +1 -0
  38. package/esm/components/QPhoneField/QPhoneField.vue.js +478 -0
  39. package/esm/components/QPhoneField/QPhoneField2.vue.js +5 -0
  40. package/esm/components/QPhoneField/constants.d.ts +11 -0
  41. package/esm/components/QPhoneField/constants.d.ts.map +1 -0
  42. package/esm/components/QPhoneField/constants.js +14 -0
  43. package/esm/components/QPhoneField/index.d.ts +1253 -0
  44. package/esm/components/QPhoneField/index.d.ts.map +1 -0
  45. package/esm/components/QPhoneField/index.js +6 -0
  46. package/esm/components/QPhoneField/types.d.ts +108 -0
  47. package/esm/components/QPhoneField/types.d.ts.map +1 -0
  48. package/esm/components/QSelect/QSelect.d.ts +16 -1
  49. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  50. package/esm/components/QSelect/QSelect.vue.js +158 -129
  51. package/esm/components/QSelect/index.d.ts +31 -3
  52. package/esm/components/QSelect/index.d.ts.map +1 -1
  53. package/esm/components/QSelect/types.d.ts +13 -0
  54. package/esm/components/QSelect/types.d.ts.map +1 -1
  55. package/esm/components/index.d.ts +2 -0
  56. package/esm/components/index.d.ts.map +1 -1
  57. package/esm/components/index.js +64 -60
  58. package/esm/composables/useColor/index.d.ts +8 -0
  59. package/esm/composables/useColor/index.d.ts.map +1 -1
  60. package/esm/composables/useColor/index.js +16 -18
  61. package/esm/composables/useDialog/index.d.ts +2 -88
  62. package/esm/composables/useDialog/index.d.ts.map +1 -1
  63. package/esm/composables/useDialog/index.js +6 -6
  64. package/esm/composables/useDialog/types.d.ts +14 -4
  65. package/esm/composables/useDialog/types.d.ts.map +1 -1
  66. package/esm/index.d.ts +2 -0
  67. package/esm/vendors/country-flag-icons/modules/countries.json.js +4 -0
  68. package/esm/vendors/country-flag-icons/modules/hasFlag.js +7 -0
  69. package/esm/vendors/libphonenumber-js/es6/AsYouType.js +312 -0
  70. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +142 -0
  71. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +145 -0
  72. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +45 -0
  73. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.js +258 -0
  74. package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.util.js +57 -0
  75. package/esm/vendors/libphonenumber-js/es6/AsYouTypeParser.js +242 -0
  76. package/esm/vendors/libphonenumber-js/es6/AsYouTypeState.js +115 -0
  77. package/esm/vendors/libphonenumber-js/es6/ParseError.js +116 -0
  78. package/esm/vendors/libphonenumber-js/es6/PhoneNumber.js +164 -0
  79. package/esm/vendors/libphonenumber-js/es6/constants.js +4 -0
  80. package/esm/vendors/libphonenumber-js/es6/format.js +77 -0
  81. package/esm/vendors/libphonenumber-js/es6/formatIncompletePhoneNumber.js +7 -0
  82. package/esm/vendors/libphonenumber-js/es6/getCountries.js +7 -0
  83. package/esm/vendors/libphonenumber-js/es6/getExampleNumber.js +7 -0
  84. package/esm/vendors/libphonenumber-js/es6/helpers/RFC3966.js +9 -0
  85. package/esm/vendors/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +7 -0
  86. package/esm/vendors/libphonenumber-js/es6/helpers/checkNumberLength.js +21 -0
  87. package/esm/vendors/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +11 -0
  88. package/esm/vendors/libphonenumber-js/es6/helpers/extension/extractExtension.js +16 -0
  89. package/esm/vendors/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +36 -0
  90. package/esm/vendors/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +21 -0
  91. package/esm/vendors/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +18 -0
  92. package/esm/vendors/libphonenumber-js/es6/helpers/extractNationalNumber.js +27 -0
  93. package/esm/vendors/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +27 -0
  94. package/esm/vendors/libphonenumber-js/es6/helpers/extractPhoneContext.js +15 -0
  95. package/esm/vendors/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +11 -0
  96. package/esm/vendors/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js +13 -0
  97. package/esm/vendors/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +12 -0
  98. package/esm/vendors/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +43 -0
  99. package/esm/vendors/libphonenumber-js/es6/helpers/getIddPrefix.js +10 -0
  100. package/esm/vendors/libphonenumber-js/es6/helpers/getNumberType.js +61 -0
  101. package/esm/vendors/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +14 -0
  102. package/esm/vendors/libphonenumber-js/es6/helpers/isCallingCode.js +7 -0
  103. package/esm/vendors/libphonenumber-js/es6/helpers/isCountryCode.js +7 -0
  104. package/esm/vendors/libphonenumber-js/es6/helpers/isObject.js +7 -0
  105. package/esm/vendors/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +12 -0
  106. package/esm/vendors/libphonenumber-js/es6/helpers/matchesEntirely.js +6 -0
  107. package/esm/vendors/libphonenumber-js/es6/helpers/mergeArrays.js +39 -0
  108. package/esm/vendors/libphonenumber-js/es6/helpers/parseDigits.js +82 -0
  109. package/esm/vendors/libphonenumber-js/es6/helpers/stripIddPrefix.js +18 -0
  110. package/esm/vendors/libphonenumber-js/es6/isPossible.js +32 -0
  111. package/esm/vendors/libphonenumber-js/es6/isValid.js +11 -0
  112. package/esm/vendors/libphonenumber-js/es6/metadata.js +474 -0
  113. package/esm/vendors/libphonenumber-js/es6/normalizeArguments.js +110 -0
  114. package/esm/vendors/libphonenumber-js/es6/parse.js +103 -0
  115. package/esm/vendors/libphonenumber-js/es6/parseIncompletePhoneNumber.js +48 -0
  116. package/esm/vendors/libphonenumber-js/es6/parsePhoneNumber.js +9 -0
  117. package/esm/vendors/libphonenumber-js/es6/parsePhoneNumberWithError_.js +58 -0
  118. package/esm/vendors/libphonenumber-js/es6/parsePhoneNumber_.js +66 -0
  119. package/esm/vendors/libphonenumber-js/es6/tools/semver-compare.js +14 -0
  120. package/esm/vendors/libphonenumber-js/examples.mobile.json.js +250 -0
  121. package/esm/vendors/libphonenumber-js/max/exports/AsYouType.js +9 -0
  122. package/esm/vendors/libphonenumber-js/max/exports/formatIncompletePhoneNumber.js +8 -0
  123. package/esm/vendors/libphonenumber-js/max/exports/getCountries.js +8 -0
  124. package/esm/vendors/libphonenumber-js/max/exports/getCountryCallingCode.js +8 -0
  125. package/esm/vendors/libphonenumber-js/max/exports/getExampleNumber.js +8 -0
  126. package/esm/vendors/libphonenumber-js/max/exports/isSupportedCountry.js +8 -0
  127. package/esm/vendors/libphonenumber-js/max/exports/parsePhoneNumber.js +8 -0
  128. package/esm/vendors/libphonenumber-js/max/exports/withMetadataArgument.js +8 -0
  129. package/esm/vendors/libphonenumber-js/metadata.max.json.js +10489 -0
  130. package/package.json +3 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QPhoneField.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QPhoneField/QPhoneField.vue"],"names":[],"mappings":"AAwJA;AA4yBC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAY3C,OAAO,KAAK,EACX,iBAAiB,EAEjB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,SAAS,CAAA;AAehB,OAAO,EAAY,QAAQ,EAA+C,MAAM,KAAK,CAAA;AAWrF,KAAK,WAAW,GAAG,gBAAgB,CAAC;AAmnBrC,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAC;CAChB,GAAG,WAAW,CAAC;AAOhB,iBAAS,cAAc;WAiWT,OAAO,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4CAJc,GAAG,8CACxB,GAAC,yBACsB,GAAG,6DAEtB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAJc,GAAG,8CACxB,GAAC,yBACsB,GAAG,6DAEtB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAy+BN,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -0,0 +1,478 @@
1
+ import { useId as e } from "../../composables/uid.js";
2
+ import { QClearButton as t } from "../__internal__/QClearButton/index.js";
3
+ import { QTextField as n } from "../QTextField/index.js";
4
+ import { QInputGroup as r } from "../QInputGroup/index.js";
5
+ import { DEFAULT_TEXTS as i } from "./constants.js";
6
+ import { QSelect as a } from "../QSelect/index.js";
7
+ import o from "../../vendors/country-flag-icons/modules/hasFlag.js";
8
+ import s from "../../vendors/libphonenumber-js/examples.mobile.json.js";
9
+ import c from "../../vendors/libphonenumber-js/es6/parseIncompletePhoneNumber.js";
10
+ import { parsePhoneNumber as l } from "../../vendors/libphonenumber-js/max/exports/parsePhoneNumber.js";
11
+ import { AsYouType as u } from "../../vendors/libphonenumber-js/max/exports/AsYouType.js";
12
+ import { isSupportedCountry as d } from "../../vendors/libphonenumber-js/max/exports/isSupportedCountry.js";
13
+ import { getCountries as ee } from "../../vendors/libphonenumber-js/max/exports/getCountries.js";
14
+ import { getCountryCallingCode as f } from "../../vendors/libphonenumber-js/max/exports/getCountryCallingCode.js";
15
+ import { getExampleNumber as te } from "../../vendors/libphonenumber-js/max/exports/getExampleNumber.js";
16
+ import { formatIncompletePhoneNumber as ne } from "../../vendors/libphonenumber-js/max/exports/formatIncompletePhoneNumber.js";
17
+ import { computed as p, createBlock as re, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createSlots as ie, createVNode as _, defineComponent as ae, mergeModels as v, mergeProps as oe, nextTick as y, normalizeClass as b, openBlock as x, ref as S, renderSlot as C, toDisplayString as w, toRef as se, unref as T, useAttrs as ce, useModel as E, useSlots as le, useTemplateRef as D, watch as O, withCtx as k } from "vue";
18
+ //#region src/components/QPhoneField/QPhoneField.vue?vue&type=script&setup=true&lang.ts
19
+ var ue = { class: "q-phone-field__flag-code" }, de = {
20
+ key: 1,
21
+ class: "q-phone-field__flag-fallback",
22
+ "aria-hidden": "true"
23
+ }, fe = { class: "q-phone-field__country-code" }, pe = { class: "q-phone-field__flag-code" }, me = {
24
+ key: 1,
25
+ class: "q-phone-field__flag-fallback",
26
+ "aria-hidden": "true"
27
+ }, he = { class: "q-phone-field__country-name" }, ge = { class: "q-phone-field__item-code" }, _e = {
28
+ key: 0,
29
+ class: "q-phone-field__empty"
30
+ }, ve = [
31
+ "name",
32
+ "value",
33
+ "form",
34
+ "disabled"
35
+ ], ye = ["id"], be = {
36
+ key: 0,
37
+ class: "q-phone-field__validation-message",
38
+ role: "alert"
39
+ }, A = /*@__PURE__*/ ae({
40
+ inheritAttrs: !1,
41
+ __name: "QPhoneField",
42
+ props: /*@__PURE__*/ v({
43
+ id: {},
44
+ class: {},
45
+ label: {},
46
+ required: { type: Boolean },
47
+ for: {},
48
+ labelPosition: {},
49
+ size: {},
50
+ readonly: { type: Boolean },
51
+ disabled: { type: Boolean },
52
+ invalid: { type: Boolean },
53
+ placeholder: {},
54
+ defaultCountry: {},
55
+ countries: {},
56
+ locale: { default: "en-US" },
57
+ clearable: { type: Boolean },
58
+ autoValidate: {
59
+ type: Boolean,
60
+ default: !0
61
+ },
62
+ inline: { type: Boolean },
63
+ texts: { default: () => i }
64
+ }, {
65
+ modelValue: { default: "" },
66
+ modelModifiers: {},
67
+ country: {},
68
+ countryModifiers: {},
69
+ open: {
70
+ type: Boolean,
71
+ default: !1
72
+ },
73
+ openModifiers: {}
74
+ }),
75
+ emits: /*@__PURE__*/ v(["click:clear", "validity-change"], [
76
+ "update:modelValue",
77
+ "update:country",
78
+ "update:open"
79
+ ]),
80
+ setup(i, { expose: ae, emit: v }) {
81
+ let A = i, xe = v, Se = le(), j = E(i, "modelValue"), M = E(i, "country"), N = E(i, "open"), Ce = /^[+\d\s().-]+$/;
82
+ function we(e) {
83
+ let t = e?.toUpperCase();
84
+ return t && d(t) ? t : void 0;
85
+ }
86
+ function Te(e) {
87
+ if (e) return we(e.split(/[-_]/).slice(1).find((e) => /^[A-Za-z]{2}$/.test(e)));
88
+ }
89
+ let P = ce(), F = e(se(A, "id")), Ee = p(() => `${F.value}_country`), I = p(() => `${F.value}_validation`), De = p(() => typeof P.name == "string" && P.name ? P.name : void 0), Oe = p(() => typeof P.form == "string" && P.form ? P.form : void 0), ke = p(() => Object.fromEntries(Object.entries(P).filter(([e]) => ![
90
+ "aria-describedby",
91
+ "aria-label",
92
+ "name"
93
+ ].includes(e)))), Ae = p(() => {
94
+ let e = P["aria-label"];
95
+ return typeof e == "string" && e ? e : A.label ? void 0 : A.texts.phoneNumber;
96
+ }), je = D("field"), Me = D("input"), Ne = D("countrySelect"), Pe = D("searchField"), Fe = p(() => je.value?.fieldRef ?? null), L = p(() => Me.value?.inputRef ?? null), R = S(""), z = S(""), B = S(), V = S(""), Ie = S(!1), H = !1, Le = p(() => {
97
+ try {
98
+ return new Intl.DisplayNames([A.locale], { type: "region" });
99
+ } catch {
100
+ return new Intl.DisplayNames(["en-US"], { type: "region" });
101
+ }
102
+ });
103
+ function U(e) {
104
+ let t = Le.value.of(e);
105
+ return !t || t === e ? e : t;
106
+ }
107
+ let W = p(() => {
108
+ let e = A.countries ?? ee(), t = e.filter((t, n) => d(t) && e.indexOf(t) === n);
109
+ return A.countries ? t : t.sort(Je);
110
+ }), Re = p(() => W.value.map((e) => {
111
+ let t = U(e), n = f(e);
112
+ return {
113
+ key: e,
114
+ label: `${t} (+${n})`,
115
+ name: t,
116
+ callingCode: n,
117
+ hasFlag: o(e),
118
+ searchValue: qe(`${t} ${e} +${n}`)
119
+ };
120
+ })), ze = p(() => {
121
+ let e = qe(z.value);
122
+ return e ? Re.value.filter((t) => t.searchValue.includes(e)) : Re.value;
123
+ }), G = p(() => B.value ? f(B.value) : V.value), Be = p(() => B.value ? o(B.value) : !1), Ve = p({
124
+ get: () => B.value,
125
+ set: (e) => {
126
+ e && lt(e);
127
+ }
128
+ }), He = p(() => !B.value || !G.value ? A.texts.selectCountry : `${A.texts.selectCountry}: ${U(B.value)} (+${G.value})`), Ue = p(() => {
129
+ if (A.readonly || A.disabled) return;
130
+ if (A.placeholder !== void 0) return A.placeholder;
131
+ if (!B.value) return;
132
+ let e = te(B.value, s);
133
+ if (e) return Y(e.formatInternational(), e.countryCallingCode).replace(/\d/g, "0");
134
+ }), We = p(() => A.clearable && !!j.value && !A.readonly && !A.disabled), K = p(() => {
135
+ let e = j.value ? l(j.value, { extract: !1 }) : void 0, t = e?.country ?? B.value, n = e?.countryCallingCode ?? G.value, r = e && !e.country && e.countryCallingCode && (e.isPossible() || e.isValid()) ? A.countries === void 0 : t ? W.value.includes(t) : !!n && W.value.some((e) => f(e) === n);
136
+ return {
137
+ isPossible: !!e?.isPossible(),
138
+ isValid: !!e?.isValid(),
139
+ isAllowedCountry: r
140
+ };
141
+ }), Ge = p(() => A.autoValidate && Ie.value && !A.readonly && !A.disabled && (A.required && !j.value || !!j.value && (!K.value.isValid || !K.value.isAllowedCountry))), q = p(() => A.invalid || Ge.value), J = p(() => {
142
+ if (Ge.value) return j.value ? K.value.isValid ? A.texts.unsupportedCountry : A.texts.invalidNumber : A.texts.requiredNumber;
143
+ }), Ke = p(() => [P["aria-describedby"], J.value || Se.extras ? I.value : void 0].filter(Boolean).join(" ") || void 0);
144
+ function qe(e) {
145
+ return e.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().trim();
146
+ }
147
+ function Je(e, t) {
148
+ try {
149
+ return U(e).localeCompare(U(t), A.locale);
150
+ } catch {
151
+ return U(e).localeCompare(U(t), "en-US");
152
+ }
153
+ }
154
+ function Ye(e) {
155
+ return c(e.trim().replace(/^00/, "+"));
156
+ }
157
+ function Xe(e, t) {
158
+ let n = e.getNumber(), r = e.getCountry() ?? n?.country;
159
+ if (r) return r;
160
+ let i = e.getCallingCode(), a = n?.nationalNumber ?? "", o = n?.getPossibleCountries() ?? [];
161
+ return t && (o.includes(t) || a && i && f(t) === i) ? t : o.length === 1 ? o[0] : void 0;
162
+ }
163
+ function Ze(e, t, n) {
164
+ if (!e) return "";
165
+ let r = n ? l(n, { extract: !1 }) : void 0;
166
+ if (r && (r.isPossible() || r.isValid())) return Y(r.formatInternational(), r.countryCallingCode);
167
+ if (!t) return ne(e);
168
+ let i = f(t);
169
+ return Y(new u().input(`+${i}${e}`), i);
170
+ }
171
+ function Y(e, t) {
172
+ return e.slice(`+${t}`.length).trim();
173
+ }
174
+ function Qe(e) {
175
+ let t = e.trim();
176
+ return /\d/.test(t) && Ce.test(t) && (t.match(/\+/g) ?? []).length <= 1 && (!t.includes("+") || t.startsWith("+"));
177
+ }
178
+ let X;
179
+ function Z(e) {
180
+ j.value !== e && (X = e, j.value = e, j.value === e && (X = void 0));
181
+ }
182
+ function $e(e) {
183
+ M.value !== e && (M.value = e);
184
+ }
185
+ function Q(e, t = "") {
186
+ B.value = e, V.value = e ? f(e) : t, $e(e);
187
+ }
188
+ function et() {
189
+ if (M.value && W.value.includes(M.value)) return M.value;
190
+ if (A.defaultCountry && W.value.includes(A.defaultCountry)) return A.defaultCountry;
191
+ let e = Te(A.locale);
192
+ return e && W.value.includes(e) ? e : W.value[0];
193
+ }
194
+ function tt(e, t) {
195
+ let n = Ye(e);
196
+ if (!n) {
197
+ R.value = "", t && Z("");
198
+ return;
199
+ }
200
+ let r = new u();
201
+ r.input(n);
202
+ let i = r.getNumber(), a = r.getCallingCode() ?? "", o = Xe(r, B.value), s = r.getNumberValue()?.toString() ?? n, c = i?.nationalNumber ?? (a ? n.slice(`+${a}`.length) : n);
203
+ Q(o, a), R.value = Ze(c, o, s), t && Z(s);
204
+ }
205
+ function nt(e) {
206
+ if (B.value || Q(et()), !e) {
207
+ R.value = "";
208
+ return;
209
+ }
210
+ let t = e.trim();
211
+ if (t.startsWith("+") || t.startsWith("00")) {
212
+ tt(t, !0);
213
+ return;
214
+ }
215
+ rt(t);
216
+ }
217
+ function rt(e, t) {
218
+ let n = c(e).replace(/^\+/, "").replace(/\D/g, "");
219
+ if (!n) {
220
+ R.value = "", Z(""), $(t);
221
+ return;
222
+ }
223
+ let r = B.value;
224
+ R.value = (r ? new u(r) : new u(V.value ? { defaultCallingCode: V.value } : void 0)).input(n);
225
+ let i = r ? f(r) : V.value;
226
+ Z(i ? `+${i}${n}` : `+${n}`), $(t);
227
+ }
228
+ function it(e) {
229
+ let t = e.selectionStart ?? e.value.length;
230
+ return {
231
+ digitOffset: (e.value.slice(0, t).match(/\d/g) ?? []).length,
232
+ atEnd: t === e.value.length
233
+ };
234
+ }
235
+ async function $(e) {
236
+ if (!e) return;
237
+ await y();
238
+ let t = L.value;
239
+ if (!t) return;
240
+ if (e.atEnd) {
241
+ t.setSelectionRange(t.value.length, t.value.length);
242
+ return;
243
+ }
244
+ if (e.digitOffset === 0) {
245
+ t.setSelectionRange(0, 0);
246
+ return;
247
+ }
248
+ let n = 0, r = 0;
249
+ for (let [i, a] of [...t.value].entries()) if (/\d/.test(a) && (n += 1), r = i + 1, n >= e.digitOffset) break;
250
+ t.setSelectionRange(r, r);
251
+ }
252
+ function at(e) {
253
+ let t = e.value, n = it(e);
254
+ if (t.trim().startsWith("+") || t.trim().startsWith("00")) {
255
+ tt(t, !0), e.value = R.value, $(n);
256
+ return;
257
+ }
258
+ rt(t, n), e.value = R.value;
259
+ }
260
+ function ot(e) {
261
+ at(e.target);
262
+ }
263
+ function st(e) {
264
+ if (A.readonly || A.disabled) {
265
+ e.preventDefault();
266
+ return;
267
+ }
268
+ let t = e.clipboardData?.getData("text/plain") ?? e.clipboardData?.getData("text");
269
+ if (t === void 0 || (e.preventDefault(), !Qe(t))) return;
270
+ let n = e.currentTarget, r = n.selectionStart ?? n.value.length, i = n.selectionEnd ?? r, a = `${n.value.slice(0, r)}${t}${n.value.slice(i)}`;
271
+ if (!Qe(a)) return;
272
+ n.value = a;
273
+ let o = r + t.length;
274
+ n.setSelectionRange(o, o), at(n);
275
+ }
276
+ function ct() {
277
+ return (j.value ? l(j.value, { extract: !1 }) : void 0)?.nationalNumber ?? R.value.replace(/\D/g, "");
278
+ }
279
+ function lt(e) {
280
+ if (A.readonly || A.disabled || !W.value.includes(e)) return;
281
+ let t = ct(), n = f(e);
282
+ if (H = N.value, t) {
283
+ let r = `+${n}${t}`, i = new u();
284
+ i.input(r);
285
+ let a = Xe(i, e) ?? e;
286
+ Q(a, n), R.value = Ze(t, a, r), Z(r);
287
+ } else Q(e, n);
288
+ N.value = !1;
289
+ }
290
+ function ut(e) {
291
+ ["ArrowDown", "ArrowUp"].includes(e.key) && (e.preventDefault(), Ne.value?.focusList());
292
+ }
293
+ async function dt() {
294
+ await y(), Pe.value?.inputRef?.focus();
295
+ }
296
+ function ft() {
297
+ z.value = "", H && (H = !1, y(() => L.value?.focus()));
298
+ }
299
+ function pt() {
300
+ Ie.value = !0;
301
+ }
302
+ function mt(e) {
303
+ R.value = "", Z(""), xe("click:clear", e), y(() => L.value?.focus());
304
+ }
305
+ return O(j, (e) => {
306
+ if (e === X) {
307
+ X = void 0;
308
+ return;
309
+ }
310
+ X = void 0, nt(e);
311
+ }, {
312
+ immediate: !0,
313
+ flush: "sync"
314
+ }), O(M, (e) => {
315
+ e && d(e) && W.value.includes(e) && e !== B.value && lt(e);
316
+ }, { flush: "sync" }), O(W, () => {
317
+ !j.value && !W.value.includes(B.value) && Q(et());
318
+ }), O(K, (e) => xe("validity-change", e), { immediate: !0 }), ae({
319
+ fieldRef: Fe,
320
+ inputRef: L,
321
+ validity: K
322
+ }), (e, i) => (x(), re(T(r), {
323
+ ref: "field",
324
+ class: b(["q-phone-field", A.class]),
325
+ for: T(F),
326
+ label: A.label,
327
+ "label-position": A.labelPosition,
328
+ size: A.size,
329
+ required: A.required,
330
+ readonly: A.readonly,
331
+ disabled: A.disabled,
332
+ invalid: q.value
333
+ }, ie({
334
+ "label.prepend": k(() => [C(e.$slots, "label.prepend")]),
335
+ "label.append": k(() => [C(e.$slots, "label.append")]),
336
+ default: k(() => [
337
+ _(T(a), {
338
+ id: Ee.value,
339
+ ref: "countrySelect",
340
+ modelValue: Ve.value,
341
+ "onUpdate:modelValue": i[1] ||= (e) => Ve.value = e,
342
+ open: N.value,
343
+ "onUpdate:open": i[2] ||= (e) => N.value = e,
344
+ class: "q-phone-field__country-select",
345
+ "item-label": "label",
346
+ "item-value": "key",
347
+ size: "mini",
348
+ items: ze.value,
349
+ "overlay-anchor": Fe.value,
350
+ readonly: A.readonly,
351
+ disabled: A.disabled || W.value.length === 0,
352
+ inline: A.inline,
353
+ "select-on-tab": !1,
354
+ "aria-label": He.value,
355
+ onShow: dt,
356
+ onHide: ft
357
+ }, {
358
+ prepend: k(() => [Be.value && B.value ? (x(), h("span", {
359
+ key: 0,
360
+ class: b(["q-phone-field__flag", `flag:${B.value}`]),
361
+ "aria-hidden": "true"
362
+ }, [g("span", ue, w(B.value), 1)], 2)) : B.value ? (x(), h("span", de, w(B.value), 1)) : m("v-if", !0)]),
363
+ value: k(() => [g("span", fe, w(G.value ? `+${G.value}` : "-"), 1)]),
364
+ "body.prepend": k(() => [_(T(n), {
365
+ ref: "searchField",
366
+ modelValue: z.value,
367
+ "onUpdate:modelValue": i[0] ||= (e) => z.value = e,
368
+ class: "q-phone-field__search",
369
+ size: "block",
370
+ clearable: "",
371
+ autocomplete: "off",
372
+ "aria-label": A.texts.searchCountry,
373
+ placeholder: A.texts.searchCountry,
374
+ texts: A.texts,
375
+ onKeydown: ut
376
+ }, null, 8, [
377
+ "modelValue",
378
+ "aria-label",
379
+ "placeholder",
380
+ "texts"
381
+ ])]),
382
+ item: k(({ item: e }) => [
383
+ e.hasFlag ? (x(), h("span", {
384
+ key: 0,
385
+ class: b(["q-phone-field__flag", `flag:${e.key}`]),
386
+ "aria-hidden": "true"
387
+ }, [g("span", pe, w(e.key), 1)], 2)) : (x(), h("span", me, w(e.key), 1)),
388
+ g("span", he, w(e.name), 1),
389
+ g("span", ge, "+" + w(e.callingCode), 1)
390
+ ]),
391
+ "body.append": k(() => [ze.value.length === 0 ? (x(), h("div", _e, w(A.texts.noCountries), 1)) : m("v-if", !0)]),
392
+ _: 1
393
+ }, 8, [
394
+ "id",
395
+ "modelValue",
396
+ "open",
397
+ "items",
398
+ "overlay-anchor",
399
+ "readonly",
400
+ "disabled",
401
+ "inline",
402
+ "aria-label"
403
+ ]),
404
+ _(T(n), oe(ke.value, {
405
+ id: T(F),
406
+ ref: "input",
407
+ modelValue: R.value,
408
+ "onUpdate:modelValue": i[3] ||= (e) => R.value = e,
409
+ class: "q-phone-field__input",
410
+ type: "tel",
411
+ inputmode: "tel",
412
+ autocomplete: "tel",
413
+ size: "block",
414
+ required: A.required,
415
+ placeholder: Ue.value,
416
+ readonly: A.readonly,
417
+ disabled: A.disabled,
418
+ invalid: q.value,
419
+ "aria-label": Ae.value,
420
+ "aria-invalid": q.value || void 0,
421
+ "aria-describedby": Ke.value,
422
+ onInput: ot,
423
+ onPaste: st,
424
+ onBlur: pt
425
+ }), ie({ _: 2 }, [e.$slots.append || We.value ? {
426
+ name: "append",
427
+ fn: k(() => [C(e.$slots, "append"), We.value ? (x(), re(T(t), {
428
+ key: 0,
429
+ "data-testid": "q-phone-field__clear-button",
430
+ texts: A.texts,
431
+ onClick: mt
432
+ }, null, 8, ["texts"])) : m("v-if", !0)]),
433
+ key: "0"
434
+ } : void 0]), 1040, [
435
+ "id",
436
+ "modelValue",
437
+ "required",
438
+ "placeholder",
439
+ "readonly",
440
+ "disabled",
441
+ "invalid",
442
+ "aria-label",
443
+ "aria-invalid",
444
+ "aria-describedby"
445
+ ]),
446
+ De.value ? (x(), h("input", {
447
+ key: 0,
448
+ type: "hidden",
449
+ name: De.value,
450
+ value: j.value,
451
+ form: Oe.value,
452
+ disabled: A.disabled
453
+ }, null, 8, ve)) : m("v-if", !0)
454
+ ]),
455
+ _: 2
456
+ }, [e.$slots.extras || J.value ? {
457
+ name: "extras",
458
+ fn: k(() => [g("div", { id: I.value }, [C(e.$slots, "extras", {
459
+ message: J.value,
460
+ validity: K.value,
461
+ validationId: I.value
462
+ }, () => [J.value ? (x(), h("span", be, w(J.value), 1)) : m("v-if", !0)])], 8, ye)]),
463
+ key: "0"
464
+ } : void 0]), 1032, [
465
+ "class",
466
+ "for",
467
+ "label",
468
+ "label-position",
469
+ "size",
470
+ "required",
471
+ "readonly",
472
+ "disabled",
473
+ "invalid"
474
+ ]));
475
+ }
476
+ });
477
+ //#endregion
478
+ export { A as default };
@@ -0,0 +1,5 @@
1
+ import e from "./QPhoneField.vue.js";
2
+ //#region src/components/QPhoneField/QPhoneField.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,11 @@
1
+ export declare const DEFAULT_TEXTS: {
2
+ phoneNumber: string;
3
+ selectCountry: string;
4
+ searchCountry: string;
5
+ noCountries: string;
6
+ requiredNumber: string;
7
+ invalidNumber: string;
8
+ unsupportedCountry: string;
9
+ clearValue: string;
10
+ };
11
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/components/QPhoneField/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;;;;;;;CASQ,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { DEFAULT_TEXTS as e } from "../__internal__/QClearButton/constants.js";
2
+ //#region src/components/QPhoneField/constants.ts
3
+ var t = {
4
+ ...e,
5
+ phoneNumber: "Phone number",
6
+ selectCountry: "Select country",
7
+ searchCountry: "Search by country or calling code",
8
+ noCountries: "No countries found",
9
+ requiredNumber: "The phone number is required.",
10
+ invalidNumber: "Enter a valid phone number.",
11
+ unsupportedCountry: "This number country is not available."
12
+ };
13
+ //#endregion
14
+ export { t as DEFAULT_TEXTS };