@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.
- package/CHANGELOG.md +21 -1
- package/dist/json/api.json +1414 -45
- package/dist/manifest/components.json +2 -0
- package/dist/ui.css +1374 -5
- package/dist/ui.esm.js +1459 -841
- package/dist/ui.js +1444 -826
- package/dist/ui.min.css +2 -1
- package/dist/ui.min.js +1444 -826
- package/dist/ui.scss +569 -7
- package/esm/components/QField/QField.d.ts.map +1 -1
- package/esm/components/QField/QField.vue.js +1 -1
- package/esm/components/QGauge/QGauge.d.ts +56 -0
- package/esm/components/QGauge/QGauge.d.ts.map +1 -0
- package/esm/components/QGauge/QGauge.vue.js +305 -0
- package/esm/components/QGauge/QGauge2.vue.js +5 -0
- package/esm/components/QGauge/constants.d.ts +6 -0
- package/esm/components/QGauge/constants.d.ts.map +1 -0
- package/esm/components/QGauge/constants.js +8 -0
- package/esm/components/QGauge/index.d.ts +124 -0
- package/esm/components/QGauge/index.d.ts.map +1 -0
- package/esm/components/QGauge/index.js +6 -0
- package/esm/components/QGauge/types.d.ts +146 -0
- package/esm/components/QGauge/types.d.ts.map +1 -0
- package/esm/components/QInputGroup/QInputGroup.d.ts +147 -3
- package/esm/components/QInputGroup/QInputGroup.d.ts.map +1 -1
- package/esm/components/QInputGroup/QInputGroup.vue.js +32 -23
- package/esm/components/QInputGroup/index.d.ts +81 -4
- package/esm/components/QInputGroup/index.d.ts.map +1 -1
- package/esm/components/QList/QList.d.ts.map +1 -1
- package/esm/components/QList/QList.vue.js +3 -1
- package/esm/components/QList/QListItem.d.ts.map +1 -1
- package/esm/components/QList/QListItem.vue.js +24 -28
- package/esm/components/QList/types.d.ts +1 -1
- package/esm/components/QOverlay/types.d.ts +3 -1
- package/esm/components/QOverlay/types.d.ts.map +1 -1
- package/esm/components/QPhoneField/QPhoneField.d.ts +2263 -0
- package/esm/components/QPhoneField/QPhoneField.d.ts.map +1 -0
- package/esm/components/QPhoneField/QPhoneField.vue.js +478 -0
- package/esm/components/QPhoneField/QPhoneField2.vue.js +5 -0
- package/esm/components/QPhoneField/constants.d.ts +11 -0
- package/esm/components/QPhoneField/constants.d.ts.map +1 -0
- package/esm/components/QPhoneField/constants.js +14 -0
- package/esm/components/QPhoneField/index.d.ts +1253 -0
- package/esm/components/QPhoneField/index.d.ts.map +1 -0
- package/esm/components/QPhoneField/index.js +6 -0
- package/esm/components/QPhoneField/types.d.ts +108 -0
- package/esm/components/QPhoneField/types.d.ts.map +1 -0
- package/esm/components/QSelect/QSelect.d.ts +16 -1
- package/esm/components/QSelect/QSelect.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.vue.js +158 -129
- package/esm/components/QSelect/index.d.ts +31 -3
- package/esm/components/QSelect/index.d.ts.map +1 -1
- package/esm/components/QSelect/types.d.ts +13 -0
- package/esm/components/QSelect/types.d.ts.map +1 -1
- package/esm/components/index.d.ts +2 -0
- package/esm/components/index.d.ts.map +1 -1
- package/esm/components/index.js +64 -60
- package/esm/composables/useColor/index.d.ts +8 -0
- package/esm/composables/useColor/index.d.ts.map +1 -1
- package/esm/composables/useColor/index.js +16 -18
- package/esm/composables/useDialog/index.d.ts +2 -88
- package/esm/composables/useDialog/index.d.ts.map +1 -1
- package/esm/composables/useDialog/index.js +6 -6
- package/esm/composables/useDialog/types.d.ts +14 -4
- package/esm/composables/useDialog/types.d.ts.map +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/vendors/country-flag-icons/modules/countries.json.js +4 -0
- package/esm/vendors/country-flag-icons/modules/hasFlag.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouType.js +312 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js +142 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js +145 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.complete.js +45 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.js +258 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouTypeFormatter.util.js +57 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouTypeParser.js +242 -0
- package/esm/vendors/libphonenumber-js/es6/AsYouTypeState.js +115 -0
- package/esm/vendors/libphonenumber-js/es6/ParseError.js +116 -0
- package/esm/vendors/libphonenumber-js/es6/PhoneNumber.js +164 -0
- package/esm/vendors/libphonenumber-js/es6/constants.js +4 -0
- package/esm/vendors/libphonenumber-js/es6/format.js +77 -0
- package/esm/vendors/libphonenumber-js/es6/formatIncompletePhoneNumber.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/getCountries.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/getExampleNumber.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/RFC3966.js +9 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/checkNumberLength.js +21 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js +11 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extension/extractExtension.js +16 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extractCountryCallingCode.js +36 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js +21 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js +18 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extractNationalNumber.js +27 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js +27 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/extractPhoneContext.js +15 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js +11 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/getCountryAndCallingCodeFromOneOfThem.js +13 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/getCountryByCallingCode.js +12 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js +43 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/getIddPrefix.js +10 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/getNumberType.js +61 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js +14 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/isCallingCode.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/isCountryCode.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/isObject.js +7 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/isViablePhoneNumber.js +12 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/matchesEntirely.js +6 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/mergeArrays.js +39 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/parseDigits.js +82 -0
- package/esm/vendors/libphonenumber-js/es6/helpers/stripIddPrefix.js +18 -0
- package/esm/vendors/libphonenumber-js/es6/isPossible.js +32 -0
- package/esm/vendors/libphonenumber-js/es6/isValid.js +11 -0
- package/esm/vendors/libphonenumber-js/es6/metadata.js +474 -0
- package/esm/vendors/libphonenumber-js/es6/normalizeArguments.js +110 -0
- package/esm/vendors/libphonenumber-js/es6/parse.js +103 -0
- package/esm/vendors/libphonenumber-js/es6/parseIncompletePhoneNumber.js +48 -0
- package/esm/vendors/libphonenumber-js/es6/parsePhoneNumber.js +9 -0
- package/esm/vendors/libphonenumber-js/es6/parsePhoneNumberWithError_.js +58 -0
- package/esm/vendors/libphonenumber-js/es6/parsePhoneNumber_.js +66 -0
- package/esm/vendors/libphonenumber-js/es6/tools/semver-compare.js +14 -0
- package/esm/vendors/libphonenumber-js/examples.mobile.json.js +250 -0
- package/esm/vendors/libphonenumber-js/max/exports/AsYouType.js +9 -0
- package/esm/vendors/libphonenumber-js/max/exports/formatIncompletePhoneNumber.js +8 -0
- package/esm/vendors/libphonenumber-js/max/exports/getCountries.js +8 -0
- package/esm/vendors/libphonenumber-js/max/exports/getCountryCallingCode.js +8 -0
- package/esm/vendors/libphonenumber-js/max/exports/getExampleNumber.js +8 -0
- package/esm/vendors/libphonenumber-js/max/exports/isSupportedCountry.js +8 -0
- package/esm/vendors/libphonenumber-js/max/exports/parsePhoneNumber.js +8 -0
- package/esm/vendors/libphonenumber-js/max/exports/withMetadataArgument.js +8 -0
- package/esm/vendors/libphonenumber-js/metadata.max.json.js +10489 -0
- package/package.json +3 -1
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import e from "./helpers/isObject.js";
|
|
2
|
+
import t from "./tools/semver-compare.js";
|
|
3
|
+
import n from "./helpers/isCallingCode.js";
|
|
4
|
+
//#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/metadata.js
|
|
5
|
+
function r(e) {
|
|
6
|
+
"@babel/helpers - typeof";
|
|
7
|
+
return r = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
8
|
+
return typeof e;
|
|
9
|
+
} : function(e) {
|
|
10
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
11
|
+
}, r(e);
|
|
12
|
+
}
|
|
13
|
+
function i(e, t) {
|
|
14
|
+
if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
|
|
15
|
+
}
|
|
16
|
+
function a(e, t) {
|
|
17
|
+
for (var n = 0; n < t.length; n++) {
|
|
18
|
+
var r = t[n];
|
|
19
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, s(r.key), r);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function o(e, t, n) {
|
|
23
|
+
return t && a(e.prototype, t), n && a(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
24
|
+
}
|
|
25
|
+
function s(e) {
|
|
26
|
+
var t = c(e, "string");
|
|
27
|
+
return r(t) == "symbol" ? t : t + "";
|
|
28
|
+
}
|
|
29
|
+
function c(e, t) {
|
|
30
|
+
if (r(e) != "object" || !e) return e;
|
|
31
|
+
var n = e[Symbol.toPrimitive];
|
|
32
|
+
if (n !== void 0) {
|
|
33
|
+
var i = n.call(e, t || "default");
|
|
34
|
+
if (r(i) != "object") return i;
|
|
35
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
36
|
+
}
|
|
37
|
+
return (t === "string" ? String : Number)(e);
|
|
38
|
+
}
|
|
39
|
+
var l = "1.2.0", u = "1.7.35", d = " ext. ", f = /*#__PURE__*/ function() {
|
|
40
|
+
function e(t) {
|
|
41
|
+
i(this, e), v(t), this.metadata = t, S.call(this, t);
|
|
42
|
+
}
|
|
43
|
+
return o(e, [
|
|
44
|
+
{
|
|
45
|
+
key: "getCountries",
|
|
46
|
+
value: function() {
|
|
47
|
+
return Object.keys(this.metadata.countries).filter(function(e) {
|
|
48
|
+
return e !== "001";
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "getCountryMetadata",
|
|
54
|
+
value: function(e) {
|
|
55
|
+
return this.metadata.countries[e];
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
key: "nonGeographic",
|
|
60
|
+
value: function() {
|
|
61
|
+
if (!(this.v1 || this.v2 || this.v3)) return this.metadata.nonGeographic || this.metadata.nonGeographical;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
key: "hasCountry",
|
|
66
|
+
value: function(e) {
|
|
67
|
+
return this.getCountryMetadata(e) !== void 0;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "hasCallingCode",
|
|
72
|
+
value: function(e) {
|
|
73
|
+
if (this.getCountryCodesForCallingCode(e)) return !0;
|
|
74
|
+
if (this.nonGeographic()) {
|
|
75
|
+
if (this.nonGeographic()[e]) return !0;
|
|
76
|
+
} else {
|
|
77
|
+
var t = this.countryCallingCodes()[e];
|
|
78
|
+
if (t && t.length === 1 && t[0] === "001") return !0;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: "isNonGeographicCallingCode",
|
|
84
|
+
value: function(e) {
|
|
85
|
+
return this.nonGeographic() ? !!this.nonGeographic()[e] : !this.getCountryCodesForCallingCode(e);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "country",
|
|
90
|
+
value: function(e) {
|
|
91
|
+
return this.selectNumberingPlan(e);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: "selectNumberingPlan",
|
|
96
|
+
value: function(e, t) {
|
|
97
|
+
var r, i;
|
|
98
|
+
if (e && (n(e) ? i = e : r = e), t && (i = t), r && r !== "001") {
|
|
99
|
+
var a = this.getCountryMetadata(r);
|
|
100
|
+
if (!a) throw Error(`Unknown country: ${r}`);
|
|
101
|
+
this.numberingPlan = new p(a, this);
|
|
102
|
+
} else if (i) {
|
|
103
|
+
if (!this.hasCallingCode(i)) throw Error(`Unknown calling code: ${i}`);
|
|
104
|
+
this.numberingPlan = new p(this.getNumberingPlanMetadata(i), this);
|
|
105
|
+
} else this.numberingPlan = void 0;
|
|
106
|
+
return this;
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
key: "getCountryCodesForCallingCode",
|
|
111
|
+
value: function(e) {
|
|
112
|
+
var t = this.countryCallingCodes()[e];
|
|
113
|
+
if (t) return t.length === 1 && t[0].length === 3 ? void 0 : t;
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: "getCountryCodeForCallingCode",
|
|
118
|
+
value: function(e) {
|
|
119
|
+
var t = this.getCountryCodesForCallingCode(e);
|
|
120
|
+
if (t) return t[0];
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
key: "getNumberingPlanMetadata",
|
|
125
|
+
value: function(e) {
|
|
126
|
+
var t = this.getCountryCodeForCallingCode(e);
|
|
127
|
+
if (t) return this.getCountryMetadata(t);
|
|
128
|
+
if (this.nonGeographic()) {
|
|
129
|
+
var n = this.nonGeographic()[e];
|
|
130
|
+
if (n) return n;
|
|
131
|
+
} else {
|
|
132
|
+
var r = this.countryCallingCodes()[e];
|
|
133
|
+
if (r && r.length === 1 && r[0] === "001") return this.metadata.countries["001"];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
key: "countryCallingCode",
|
|
139
|
+
value: function() {
|
|
140
|
+
return this.numberingPlan.callingCode();
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
key: "IDDPrefix",
|
|
145
|
+
value: function() {
|
|
146
|
+
return this.numberingPlan.IDDPrefix();
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
key: "defaultIDDPrefix",
|
|
151
|
+
value: function() {
|
|
152
|
+
return this.numberingPlan.defaultIDDPrefix();
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
key: "nationalNumberPattern",
|
|
157
|
+
value: function() {
|
|
158
|
+
return this.numberingPlan.nationalNumberPattern();
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: "possibleLengths",
|
|
163
|
+
value: function() {
|
|
164
|
+
return this.numberingPlan.possibleLengths();
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
key: "formats",
|
|
169
|
+
value: function() {
|
|
170
|
+
return this.numberingPlan.formats();
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
key: "nationalPrefixForParsing",
|
|
175
|
+
value: function() {
|
|
176
|
+
return this.numberingPlan.nationalPrefixForParsing();
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: "nationalPrefixTransformRule",
|
|
181
|
+
value: function() {
|
|
182
|
+
return this.numberingPlan.nationalPrefixTransformRule();
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
key: "leadingDigits",
|
|
187
|
+
value: function() {
|
|
188
|
+
return this.numberingPlan.leadingDigits();
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
key: "hasTypes",
|
|
193
|
+
value: function() {
|
|
194
|
+
return this.numberingPlan.hasTypes();
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: "type",
|
|
199
|
+
value: function(e) {
|
|
200
|
+
return this.numberingPlan.type(e);
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
key: "ext",
|
|
205
|
+
value: function() {
|
|
206
|
+
return this.numberingPlan.ext();
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
key: "countryCallingCodes",
|
|
211
|
+
value: function() {
|
|
212
|
+
return this.v1 ? this.metadata.country_phone_code_to_countries : this.metadata.country_calling_codes;
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
key: "chooseCountryByCountryCallingCode",
|
|
217
|
+
value: function(e) {
|
|
218
|
+
return this.selectNumberingPlan(e);
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
key: "hasSelectedNumberingPlan",
|
|
223
|
+
value: function() {
|
|
224
|
+
return this.numberingPlan !== void 0;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
]);
|
|
228
|
+
}(), p = /*#__PURE__*/ function() {
|
|
229
|
+
function e(t, n) {
|
|
230
|
+
i(this, e), this.globalMetadataObject = n, this.metadata = t, S.call(this, n.metadata);
|
|
231
|
+
}
|
|
232
|
+
return o(e, [
|
|
233
|
+
{
|
|
234
|
+
key: "callingCode",
|
|
235
|
+
value: function() {
|
|
236
|
+
return this.metadata[0];
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
key: "_getDefaultCountryMetadataForThisCallingCode",
|
|
241
|
+
value: function() {
|
|
242
|
+
return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
key: "getDefaultCountryMetadataForRegion",
|
|
247
|
+
value: function() {
|
|
248
|
+
return this._getDefaultCountryMetadataForThisCallingCode();
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
key: "IDDPrefix",
|
|
253
|
+
value: function() {
|
|
254
|
+
if (!(this.v1 || this.v2)) return this.metadata[1];
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
key: "defaultIDDPrefix",
|
|
259
|
+
value: function() {
|
|
260
|
+
if (!(this.v1 || this.v2)) return this.metadata[12];
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
key: "nationalNumberPattern",
|
|
265
|
+
value: function() {
|
|
266
|
+
return this.v1 || this.v2 ? this.metadata[1] : this.metadata[2];
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
key: "possibleLengths",
|
|
271
|
+
value: function() {
|
|
272
|
+
if (!this.v1) return this.metadata[this.v2 ? 2 : 3];
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
key: "_getFormats",
|
|
277
|
+
value: function(e) {
|
|
278
|
+
return e[this.v1 ? 2 : this.v2 ? 3 : 4];
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
key: "formats",
|
|
283
|
+
value: function() {
|
|
284
|
+
var e = this;
|
|
285
|
+
return (this._getFormats(this.metadata) || this._getFormats(this._getDefaultCountryMetadataForThisCallingCode()) || []).map(function(t) {
|
|
286
|
+
return new m(t, e);
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
key: "nationalPrefix",
|
|
292
|
+
value: function() {
|
|
293
|
+
return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
key: "_getNationalPrefixFormattingRule",
|
|
298
|
+
value: function(e) {
|
|
299
|
+
return e[this.v1 ? 4 : this.v2 ? 5 : 6];
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
key: "nationalPrefixFormattingRule",
|
|
304
|
+
value: function() {
|
|
305
|
+
return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this._getDefaultCountryMetadataForThisCallingCode());
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
key: "_nationalPrefixForParsing",
|
|
310
|
+
value: function() {
|
|
311
|
+
return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
key: "nationalPrefixForParsing",
|
|
316
|
+
value: function() {
|
|
317
|
+
return this._nationalPrefixForParsing() || this.nationalPrefix();
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
key: "nationalPrefixTransformRule",
|
|
322
|
+
value: function() {
|
|
323
|
+
return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
key: "_getNationalPrefixIsOptionalWhenFormatting",
|
|
328
|
+
value: function() {
|
|
329
|
+
return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
334
|
+
value: function() {
|
|
335
|
+
return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this._getDefaultCountryMetadataForThisCallingCode());
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
key: "leadingDigits",
|
|
340
|
+
value: function() {
|
|
341
|
+
return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
key: "types",
|
|
346
|
+
value: function() {
|
|
347
|
+
return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
key: "hasTypes",
|
|
352
|
+
value: function() {
|
|
353
|
+
return this.types() && this.types().length === 0 ? !1 : !!this.types();
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
key: "type",
|
|
358
|
+
value: function(e) {
|
|
359
|
+
if (this.hasTypes() && _(this.types(), e)) return new g(_(this.types(), e), this);
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
key: "ext",
|
|
364
|
+
value: function() {
|
|
365
|
+
return this.v1 || this.v2 ? d : this.metadata[13] || d;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
]);
|
|
369
|
+
}(), m = /*#__PURE__*/ function() {
|
|
370
|
+
function e(t, n) {
|
|
371
|
+
i(this, e), this._format = t, this.metadata = n;
|
|
372
|
+
}
|
|
373
|
+
return o(e, [
|
|
374
|
+
{
|
|
375
|
+
key: "pattern",
|
|
376
|
+
value: function() {
|
|
377
|
+
return this._format[0];
|
|
378
|
+
}
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
key: "format",
|
|
382
|
+
value: function() {
|
|
383
|
+
return this._format[1];
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
key: "leadingDigitsPatterns",
|
|
388
|
+
value: function() {
|
|
389
|
+
return this._format[2] || [];
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
key: "nationalPrefixFormattingRule",
|
|
394
|
+
value: function() {
|
|
395
|
+
return this._format[3] || this.metadata.nationalPrefixFormattingRule();
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
|
|
400
|
+
value: function() {
|
|
401
|
+
return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
|
|
406
|
+
value: function() {
|
|
407
|
+
return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
key: "usesNationalPrefix",
|
|
412
|
+
value: function() {
|
|
413
|
+
return !!(this.nationalPrefixFormattingRule() && !h.test(this.nationalPrefixFormattingRule()));
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
{
|
|
417
|
+
key: "internationalFormat",
|
|
418
|
+
value: function() {
|
|
419
|
+
return this._format[5] || this.format();
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
]);
|
|
423
|
+
}(), h = /^\(?\$1\)?$/, g = /*#__PURE__*/ function() {
|
|
424
|
+
function e(t, n) {
|
|
425
|
+
i(this, e), this.type = t, this.metadata = n;
|
|
426
|
+
}
|
|
427
|
+
return o(e, [{
|
|
428
|
+
key: "pattern",
|
|
429
|
+
value: function() {
|
|
430
|
+
return this.metadata.v1 ? this.type : this.type[0];
|
|
431
|
+
}
|
|
432
|
+
}, {
|
|
433
|
+
key: "possibleLengths",
|
|
434
|
+
value: function() {
|
|
435
|
+
if (!this.metadata.v1) return this.type[1] || this.metadata.possibleLengths();
|
|
436
|
+
}
|
|
437
|
+
}]);
|
|
438
|
+
}();
|
|
439
|
+
function _(e, t) {
|
|
440
|
+
switch (t) {
|
|
441
|
+
case "FIXED_LINE": return e[0];
|
|
442
|
+
case "MOBILE": return e[1];
|
|
443
|
+
case "TOLL_FREE": return e[2];
|
|
444
|
+
case "PREMIUM_RATE": return e[3];
|
|
445
|
+
case "PERSONAL_NUMBER": return e[4];
|
|
446
|
+
case "VOICEMAIL": return e[5];
|
|
447
|
+
case "UAN": return e[6];
|
|
448
|
+
case "PAGER": return e[7];
|
|
449
|
+
case "VOIP": return e[8];
|
|
450
|
+
case "SHARED_COST": return e[9];
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
function v(t) {
|
|
454
|
+
if (!t) throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
|
|
455
|
+
if (!e(t) || !e(t.countries)) throw Error(`[libphonenumber-js] \`metadata\` argument was passed but it's not a valid metadata. Must be an object having \`.countries\` child object property. Got ${e(t) ? "an object of shape: { " + Object.keys(t).join(", ") + " }" : "a " + y(t) + ": " + t}.`);
|
|
456
|
+
}
|
|
457
|
+
/* istanbul ignore next */
|
|
458
|
+
var y = function(e) {
|
|
459
|
+
return r(e);
|
|
460
|
+
};
|
|
461
|
+
function b(e, t) {
|
|
462
|
+
var n = new f(t);
|
|
463
|
+
if (n.hasCountry(e)) return n.selectNumberingPlan(e).countryCallingCode();
|
|
464
|
+
throw Error(`Unknown country: ${e}`);
|
|
465
|
+
}
|
|
466
|
+
function x(e, t) {
|
|
467
|
+
return t.countries.hasOwnProperty(e);
|
|
468
|
+
}
|
|
469
|
+
function S(e) {
|
|
470
|
+
var n = e.version;
|
|
471
|
+
typeof n == "number" ? (this.v1 = n === 1, this.v2 = n === 2, this.v3 = n === 3, this.v4 = n === 4) : n ? t(n, l) === -1 ? this.v2 = !0 : t(n, u) === -1 ? this.v3 = !0 : this.v4 = !0 : this.v1 = !0;
|
|
472
|
+
}
|
|
473
|
+
//#endregion
|
|
474
|
+
export { f as default, b as getCountryCallingCode, x as isSupportedCountry, v as validateMetadata };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import e from "./helpers/isObject.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/normalizeArguments.js
|
|
3
|
+
function t(e) {
|
|
4
|
+
"@babel/helpers - typeof";
|
|
5
|
+
return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
6
|
+
return typeof e;
|
|
7
|
+
} : function(e) {
|
|
8
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
9
|
+
}, t(e);
|
|
10
|
+
}
|
|
11
|
+
function n(e, t) {
|
|
12
|
+
var n = Object.keys(e);
|
|
13
|
+
if (Object.getOwnPropertySymbols) {
|
|
14
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
15
|
+
t && (r = r.filter(function(t) {
|
|
16
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
17
|
+
})), n.push.apply(n, r);
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
}
|
|
21
|
+
function r(e) {
|
|
22
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
23
|
+
var r = arguments[t] == null ? {} : arguments[t];
|
|
24
|
+
t % 2 ? n(Object(r), !0).forEach(function(t) {
|
|
25
|
+
i(e, t, r[t]);
|
|
26
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : n(Object(r)).forEach(function(t) {
|
|
27
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return e;
|
|
31
|
+
}
|
|
32
|
+
function i(e, t, n) {
|
|
33
|
+
return (t = a(t)) in e ? Object.defineProperty(e, t, {
|
|
34
|
+
value: n,
|
|
35
|
+
enumerable: !0,
|
|
36
|
+
configurable: !0,
|
|
37
|
+
writable: !0
|
|
38
|
+
}) : e[t] = n, e;
|
|
39
|
+
}
|
|
40
|
+
function a(e) {
|
|
41
|
+
var n = o(e, "string");
|
|
42
|
+
return t(n) == "symbol" ? n : n + "";
|
|
43
|
+
}
|
|
44
|
+
function o(e, n) {
|
|
45
|
+
if (t(e) != "object" || !e) return e;
|
|
46
|
+
var r = e[Symbol.toPrimitive];
|
|
47
|
+
if (r !== void 0) {
|
|
48
|
+
var i = r.call(e, n || "default");
|
|
49
|
+
if (t(i) != "object") return i;
|
|
50
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
51
|
+
}
|
|
52
|
+
return (n === "string" ? String : Number)(e);
|
|
53
|
+
}
|
|
54
|
+
function s(e, t) {
|
|
55
|
+
return f(e) || d(e, t) || l(e, t) || c();
|
|
56
|
+
}
|
|
57
|
+
function c() {
|
|
58
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
59
|
+
}
|
|
60
|
+
function l(e, t) {
|
|
61
|
+
if (e) {
|
|
62
|
+
if (typeof e == "string") return u(e, t);
|
|
63
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
64
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? u(e, t) : void 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function u(e, t) {
|
|
68
|
+
(t == null || t > e.length) && (t = e.length);
|
|
69
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
70
|
+
return r;
|
|
71
|
+
}
|
|
72
|
+
function d(e, t) {
|
|
73
|
+
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
74
|
+
if (n != null) {
|
|
75
|
+
var r, i, a, o, s = [], c = !0, l = !1;
|
|
76
|
+
try {
|
|
77
|
+
if (a = (n = n.call(e)).next, t === 0) {
|
|
78
|
+
if (Object(n) !== n) return;
|
|
79
|
+
c = !1;
|
|
80
|
+
} else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
|
|
81
|
+
} catch (e) {
|
|
82
|
+
l = !0, i = e;
|
|
83
|
+
} finally {
|
|
84
|
+
try {
|
|
85
|
+
if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
|
|
86
|
+
} finally {
|
|
87
|
+
if (l) throw i;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return s;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function f(e) {
|
|
94
|
+
if (Array.isArray(e)) return e;
|
|
95
|
+
}
|
|
96
|
+
function p(t) {
|
|
97
|
+
var n = s(Array.prototype.slice.call(t), 4), i = n[0], a = n[1], o = n[2], c = n[3], l, u, d;
|
|
98
|
+
if (typeof i == "string") l = i;
|
|
99
|
+
else throw TypeError("A text for parsing must be a string.");
|
|
100
|
+
if (!a || typeof a == "string") c ? (u = o, d = c) : (u = void 0, d = o), a && (u = r({ defaultCountry: a }, u));
|
|
101
|
+
else if (e(a)) o ? (u = a, d = o) : d = a;
|
|
102
|
+
else throw Error(`Invalid second argument: ${a}`);
|
|
103
|
+
return {
|
|
104
|
+
text: l,
|
|
105
|
+
options: u,
|
|
106
|
+
metadata: d
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { p as default };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { PLUS_CHARS as e, VALID_DIGITS as t } from "./constants.js";
|
|
2
|
+
import n from "./ParseError.js";
|
|
3
|
+
import r from "./metadata.js";
|
|
4
|
+
import i, { isViablePhoneNumberStart as a } from "./helpers/isViablePhoneNumber.js";
|
|
5
|
+
import o from "./helpers/extension/extractExtension.js";
|
|
6
|
+
import s from "./parseIncompletePhoneNumber.js";
|
|
7
|
+
import { isPossibleNumber as c } from "./isPossible.js";
|
|
8
|
+
import l from "./helpers/matchesEntirely.js";
|
|
9
|
+
import u from "./helpers/getCountryByCallingCode.js";
|
|
10
|
+
import d from "./helpers/extractNationalNumber.js";
|
|
11
|
+
import f from "./helpers/extractCountryCallingCode.js";
|
|
12
|
+
import p from "./PhoneNumber.js";
|
|
13
|
+
import m from "./helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js";
|
|
14
|
+
//#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/parse.js
|
|
15
|
+
var h = 250, g = RegExp("[" + e + t + "]"), _ = RegExp("[^" + t + "#]+$"), v = !1;
|
|
16
|
+
function y(e, t, i) {
|
|
17
|
+
t ||= {};
|
|
18
|
+
var a = new r(i);
|
|
19
|
+
if (t.defaultCountry && !a.hasCountry(t.defaultCountry)) throw t.v2 ? new n("INVALID_COUNTRY") : Error(`Unknown country: ${t.defaultCountry}`);
|
|
20
|
+
var o = x(e, t.v2, t.extract), s = o.number, u = o.ext, d = o.error;
|
|
21
|
+
if (!s) {
|
|
22
|
+
if (t.v2) throw d === "TOO_SHORT" ? new n("TOO_SHORT") : new n("NOT_A_NUMBER");
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
var f = C(s, t.defaultCountry, t.defaultCallingCode, a), m = f.country, h = f.nationalNumber, g = f.countryCallingCode, _ = f.countryCallingCodeSource, v = f.carrierCode;
|
|
26
|
+
if (!a.hasSelectedNumberingPlan()) {
|
|
27
|
+
if (t.v2) throw new n("INVALID_COUNTRY");
|
|
28
|
+
return {};
|
|
29
|
+
}
|
|
30
|
+
if (!h || h.length < 2) {
|
|
31
|
+
/* istanbul ignore if */
|
|
32
|
+
if (t.v2) throw new n("TOO_SHORT");
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
if (h.length > 17) {
|
|
36
|
+
if (t.v2) throw new n("TOO_LONG");
|
|
37
|
+
return {};
|
|
38
|
+
}
|
|
39
|
+
if (t.v2) {
|
|
40
|
+
var y = new p(g, h, a.metadata);
|
|
41
|
+
return m && (y.country = m), v && (y.carrierCode = v), u && (y.ext = u), y.__countryCallingCodeSource = _, y;
|
|
42
|
+
}
|
|
43
|
+
var b = (t.extended ? a.hasSelectedNumberingPlan() : m) ? l(h, a.nationalNumberPattern()) : !1;
|
|
44
|
+
return t.extended ? {
|
|
45
|
+
country: m,
|
|
46
|
+
countryCallingCode: g,
|
|
47
|
+
carrierCode: v,
|
|
48
|
+
valid: b,
|
|
49
|
+
possible: b ? !0 : !!(t.extended === !0 && a.possibleLengths() && c(h, a)),
|
|
50
|
+
phone: h,
|
|
51
|
+
ext: u
|
|
52
|
+
} : b ? S(m, h, u) : {};
|
|
53
|
+
}
|
|
54
|
+
function b(e, t, r) {
|
|
55
|
+
if (e) {
|
|
56
|
+
if (e.length > h) {
|
|
57
|
+
if (r) throw new n("TOO_LONG");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (t === !1) return e;
|
|
61
|
+
var i = e.search(g);
|
|
62
|
+
if (!(i < 0)) return e.slice(i).replace(_, "");
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function x(e, t, n) {
|
|
66
|
+
var r = m(e, { extractFormattedPhoneNumber: function(e) {
|
|
67
|
+
return b(e, n, t);
|
|
68
|
+
} });
|
|
69
|
+
if (!r) return {};
|
|
70
|
+
if (!i(r)) return a(r) ? { error: "TOO_SHORT" } : {};
|
|
71
|
+
var s = o(r);
|
|
72
|
+
return s.ext ? s : { number: r };
|
|
73
|
+
}
|
|
74
|
+
function S(e, t, n) {
|
|
75
|
+
var r = {
|
|
76
|
+
country: e,
|
|
77
|
+
phone: t
|
|
78
|
+
};
|
|
79
|
+
return n && (r.ext = n), r;
|
|
80
|
+
}
|
|
81
|
+
function C(e, t, n, r) {
|
|
82
|
+
var i = f(s(e), void 0, t, n, r.metadata), a = i.countryCallingCodeSource, o = i.countryCallingCode, c = i.number, l;
|
|
83
|
+
if (o) r.selectNumberingPlan(o);
|
|
84
|
+
else if (c && (t || n)) t ? (l = t, r.selectNumberingPlan(t), o = r.numberingPlan.callingCode()) : (r.selectNumberingPlan(n), o = n, v && r.isNonGeographicCallingCode(o) && (l = "001"));
|
|
85
|
+
else return {};
|
|
86
|
+
if (!c) return {
|
|
87
|
+
countryCallingCodeSource: a,
|
|
88
|
+
countryCallingCode: o
|
|
89
|
+
};
|
|
90
|
+
var p = d(s(c), void 0, r), m = p.nationalNumber, h = p.carrierCode, g = u(o, {
|
|
91
|
+
nationalNumber: m,
|
|
92
|
+
metadata: r
|
|
93
|
+
});
|
|
94
|
+
return g && (l = g, g === "001" || r.selectNumberingPlan(l)), {
|
|
95
|
+
country: l,
|
|
96
|
+
countryCallingCode: o,
|
|
97
|
+
countryCallingCodeSource: a,
|
|
98
|
+
nationalNumber: m,
|
|
99
|
+
carrierCode: h
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
export { y as default };
|