@quidgest/ui 0.19.0 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/json/api.json +1109 -3
- package/dist/manifest/components.json +1 -0
- package/dist/ui.css +1181 -5
- package/dist/ui.esm.js +1444 -843
- package/dist/ui.js +1405 -804
- package/dist/ui.min.css +2 -1
- package/dist/ui.min.js +1405 -804
- package/dist/ui.scss +373 -7
- package/esm/components/QField/QField.d.ts.map +1 -1
- package/esm/components/QField/QField.vue.js +1 -1
- 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 +1 -0
- package/esm/components/index.d.ts.map +1 -1
- package/esm/components/index.js +36 -34
- 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 +1 -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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { QFieldProps } from '../QField';
|
|
2
2
|
import { Group, Item } from '../QList/types';
|
|
3
|
+
import { QOverlayAnchor } from '../QOverlay';
|
|
3
4
|
import { DEFAULT_ICONS, DEFAULT_TEXTS } from './constants';
|
|
4
5
|
export type QSelectProps = QFieldProps & {
|
|
5
6
|
/**
|
|
@@ -26,6 +27,18 @@ export type QSelectProps = QFieldProps & {
|
|
|
26
27
|
* @category Behavior
|
|
27
28
|
*/
|
|
28
29
|
inline?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* An alternative element used to anchor and size the options overlay.
|
|
32
|
+
*
|
|
33
|
+
* @category Identification
|
|
34
|
+
*/
|
|
35
|
+
overlayAnchor?: QOverlayAnchor;
|
|
36
|
+
/**
|
|
37
|
+
* Whether pressing Tab while an option is focused selects it before focus moves away.
|
|
38
|
+
*
|
|
39
|
+
* @category Behavior
|
|
40
|
+
*/
|
|
41
|
+
selectOnTab?: boolean;
|
|
29
42
|
/**
|
|
30
43
|
* Whether multiple options can be selected.
|
|
31
44
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE/D,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IAEd;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IAEH,UAAU,CAAC,EAAE,GAAG,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE/D,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IAEd;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,aAAa,CAAC,EAAE,cAAc,CAAA;IAE9B;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IAEH,UAAU,CAAC,EAAE,GAAG,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA"}
|
|
@@ -29,6 +29,7 @@ export * from './QMeter';
|
|
|
29
29
|
export * from './QObfuscation';
|
|
30
30
|
export * from './QOverlay';
|
|
31
31
|
export * from './QPasswordField';
|
|
32
|
+
export * from './QPhoneField';
|
|
32
33
|
export * from './QPopover';
|
|
33
34
|
export * from './QPropertyList';
|
|
34
35
|
export * from './QRadioGroup';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
|
package/esm/components/index.js
CHANGED
|
@@ -36,20 +36,21 @@ import { QMeter as U } from "./QMeter/index.js";
|
|
|
36
36
|
import { QObfuscation as W } from "./QObfuscation/index.js";
|
|
37
37
|
import { QPasswordField as G } from "./QPasswordField/index.js";
|
|
38
38
|
import { QPopover as K } from "./QPopover/index.js";
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
39
|
+
import { QSelect as q } from "./QSelect/index.js";
|
|
40
|
+
import { QPhoneField as J } from "./QPhoneField/index.js";
|
|
41
|
+
import { QPropertyList as Y, QPropertyListGroup as X, QPropertyListPanel as Z, QPropertyListRow as Q } from "./QPropertyList/index.js";
|
|
42
|
+
import { QRadioButton as $, QRadioGroup as ne } from "./QRadioGroup/index.js";
|
|
43
|
+
import { QSection as re } from "./QSection/index.js";
|
|
44
|
+
import { QToggle as ie } from "./QToggle/index.js";
|
|
45
|
+
import { QSidebar as ae, QSidebarItem as oe } from "./QSidebar/index.js";
|
|
46
|
+
import { QTab as se, QTabs as ce } from "./QTabs/index.js";
|
|
47
|
+
import { QTextArea as le } from "./QTextArea/index.js";
|
|
48
|
+
import { QThemeProvider as ue } from "./QThemeProvider/index.js";
|
|
49
|
+
import { QToast as de, QToaster as fe } from "./QToast/index.js";
|
|
50
|
+
import { QToggleGroup as pe, QToggleGroupItem as me } from "./QToggleGroup/index.js";
|
|
51
|
+
import { QTooltip as he } from "./QTooltip/index.js";
|
|
51
52
|
//#region src/components/index.ts
|
|
52
|
-
var
|
|
53
|
+
var ge = /* @__PURE__ */ ee({
|
|
53
54
|
DEFAULT_TEXTS: () => b,
|
|
54
55
|
QAccordion: () => c,
|
|
55
56
|
QAccordionItem: () => l,
|
|
@@ -91,33 +92,34 @@ var he = /* @__PURE__ */ ee({
|
|
|
91
92
|
QObfuscation: () => W,
|
|
92
93
|
QOverlay: () => O,
|
|
93
94
|
QPasswordField: () => G,
|
|
95
|
+
QPhoneField: () => J,
|
|
94
96
|
QPopover: () => K,
|
|
95
|
-
QPropertyList: () =>
|
|
96
|
-
QPropertyListGroup: () =>
|
|
97
|
-
QPropertyListPanel: () =>
|
|
98
|
-
QPropertyListRow: () =>
|
|
99
|
-
QRadioButton: () =>
|
|
100
|
-
QRadioGroup: () =>
|
|
97
|
+
QPropertyList: () => Y,
|
|
98
|
+
QPropertyListGroup: () => X,
|
|
99
|
+
QPropertyListPanel: () => Z,
|
|
100
|
+
QPropertyListRow: () => Q,
|
|
101
|
+
QRadioButton: () => $,
|
|
102
|
+
QRadioGroup: () => ne,
|
|
101
103
|
QRow: () => z,
|
|
102
|
-
QSection: () =>
|
|
103
|
-
QSelect: () =>
|
|
104
|
-
QSidebar: () =>
|
|
105
|
-
QSidebarItem: () =>
|
|
104
|
+
QSection: () => re,
|
|
105
|
+
QSelect: () => q,
|
|
106
|
+
QSidebar: () => ae,
|
|
107
|
+
QSidebarItem: () => oe,
|
|
106
108
|
QSkeletonLoader: () => m,
|
|
107
109
|
QSpacer: () => B,
|
|
108
110
|
QSpinnerLoader: () => e,
|
|
109
111
|
QSwitch: () => A,
|
|
110
|
-
QTab: () =>
|
|
111
|
-
QTabs: () =>
|
|
112
|
-
QTextArea: () =>
|
|
112
|
+
QTab: () => se,
|
|
113
|
+
QTabs: () => ce,
|
|
114
|
+
QTextArea: () => le,
|
|
113
115
|
QTextField: () => x,
|
|
114
|
-
QThemeProvider: () =>
|
|
115
|
-
QToast: () =>
|
|
116
|
-
QToaster: () =>
|
|
117
|
-
QToggle: () =>
|
|
118
|
-
QToggleGroup: () =>
|
|
119
|
-
QToggleGroupItem: () =>
|
|
120
|
-
QTooltip: () =>
|
|
116
|
+
QThemeProvider: () => ue,
|
|
117
|
+
QToast: () => de,
|
|
118
|
+
QToaster: () => fe,
|
|
119
|
+
QToggle: () => ie,
|
|
120
|
+
QToggleGroup: () => pe,
|
|
121
|
+
QToggleGroupItem: () => me,
|
|
122
|
+
QTooltip: () => he
|
|
121
123
|
});
|
|
122
124
|
//#endregion
|
|
123
|
-
export { b as DEFAULT_TEXTS, c as QAccordion, l as QAccordionItem, u as QAvatar, f as QBadge, p as QBadgeIndicator, t as QButton, d as QButtonGroup, n as QCard, h as QCarousel, _ as QCheckbox, v as QCheckboxLabel, L as QCol, s as QCollapsible, S as QColorPicker, k as QCombobox, R as QContainer, j as QDateTimePicker, M as QDefaultsProvider, N as QDialog, P as QDialogProvider, E as QDismissibleLayer, F as QDivider, te as QDropdownMenu, y as QField, I as QFileUpload, D as QFocusWrap, r as QIcon, i as QIconFont, a as QIconImg, o as QIconSvg, V as QInputGroup, g as QLabel, H as QLineLoader, C as QList, w as QListItem, T as QListItemGroup, U as QMeter, W as QObfuscation, O as QOverlay, G as QPasswordField, K as QPopover,
|
|
125
|
+
export { b as DEFAULT_TEXTS, c as QAccordion, l as QAccordionItem, u as QAvatar, f as QBadge, p as QBadgeIndicator, t as QButton, d as QButtonGroup, n as QCard, h as QCarousel, _ as QCheckbox, v as QCheckboxLabel, L as QCol, s as QCollapsible, S as QColorPicker, k as QCombobox, R as QContainer, j as QDateTimePicker, M as QDefaultsProvider, N as QDialog, P as QDialogProvider, E as QDismissibleLayer, F as QDivider, te as QDropdownMenu, y as QField, I as QFileUpload, D as QFocusWrap, r as QIcon, i as QIconFont, a as QIconImg, o as QIconSvg, V as QInputGroup, g as QLabel, H as QLineLoader, C as QList, w as QListItem, T as QListItemGroup, U as QMeter, W as QObfuscation, O as QOverlay, G as QPasswordField, J as QPhoneField, K as QPopover, Y as QPropertyList, X as QPropertyListGroup, Z as QPropertyListPanel, Q as QPropertyListRow, $ as QRadioButton, ne as QRadioGroup, z as QRow, re as QSection, q as QSelect, ae as QSidebar, oe as QSidebarItem, m as QSkeletonLoader, B as QSpacer, e as QSpinnerLoader, A as QSwitch, se as QTab, ce as QTabs, le as QTextArea, x as QTextField, ue as QThemeProvider, de as QToast, fe as QToaster, ie as QToggle, pe as QToggleGroup, me as QToggleGroupItem, he as QTooltip, ge as components_exports };
|
|
@@ -1,94 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UseDialogReturn } from './types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Manager for dialog models
|
|
4
4
|
*
|
|
5
5
|
* @returns Dialog state and functions
|
|
6
6
|
*/
|
|
7
|
-
export declare function useDialog():
|
|
8
|
-
addDialog: (props: QDialogProps, id?: string, options?: QDialogOptions, handlers?: QDialogHandlers) => string;
|
|
9
|
-
removeDialog: (id: string) => void;
|
|
10
|
-
dialogs: {
|
|
11
|
-
id: string;
|
|
12
|
-
props: {
|
|
13
|
-
id?: string | undefined;
|
|
14
|
-
class?: string | unknown[] | undefined;
|
|
15
|
-
modelValue?: boolean | undefined;
|
|
16
|
-
title?: string | undefined;
|
|
17
|
-
text?: string | undefined;
|
|
18
|
-
icon?: {
|
|
19
|
-
id?: string | undefined;
|
|
20
|
-
class?: string | unknown[] | undefined;
|
|
21
|
-
icon: string;
|
|
22
|
-
size?: number | undefined;
|
|
23
|
-
color?: string | undefined;
|
|
24
|
-
type?: "svg" | "font" | "img" | undefined;
|
|
25
|
-
} | undefined;
|
|
26
|
-
buttons?: {
|
|
27
|
-
id: string;
|
|
28
|
-
icon?: {
|
|
29
|
-
id?: string | undefined;
|
|
30
|
-
class?: string | unknown[] | undefined;
|
|
31
|
-
icon: string;
|
|
32
|
-
size?: number | undefined;
|
|
33
|
-
color?: string | undefined;
|
|
34
|
-
type?: "svg" | "font" | "img" | undefined;
|
|
35
|
-
} | undefined;
|
|
36
|
-
action?: {
|
|
37
|
-
(value?: string): void;
|
|
38
|
-
} | undefined;
|
|
39
|
-
props: {
|
|
40
|
-
id?: string | undefined;
|
|
41
|
-
class?: string | unknown[] | undefined;
|
|
42
|
-
label?: string | undefined;
|
|
43
|
-
variant?: import('../../components/index.ts').QButtonVariant | undefined;
|
|
44
|
-
color?: string | undefined;
|
|
45
|
-
borderless?: boolean | undefined;
|
|
46
|
-
elevated?: boolean | undefined;
|
|
47
|
-
block?: boolean | undefined;
|
|
48
|
-
size?: import('../../components/index.ts').QButtonSize | undefined;
|
|
49
|
-
iconPos?: import('../../components/index.ts').QButtonIconPosition | undefined;
|
|
50
|
-
pill?: boolean | undefined;
|
|
51
|
-
disabled?: boolean | undefined;
|
|
52
|
-
loading?: boolean | undefined;
|
|
53
|
-
};
|
|
54
|
-
}[] | undefined;
|
|
55
|
-
backdropBlur?: boolean | undefined;
|
|
56
|
-
size?: import('../../components/index.ts').QDialogSize | undefined;
|
|
57
|
-
centerVertically?: boolean | undefined;
|
|
58
|
-
attach?: string | undefined;
|
|
59
|
-
inline?: boolean | undefined;
|
|
60
|
-
focusWrap?: boolean | undefined;
|
|
61
|
-
initialFocus?: (HTMLElement | string | null) | undefined;
|
|
62
|
-
focusWithinOnActivate?: boolean | undefined;
|
|
63
|
-
closingFocus?: (HTMLElement | string) | undefined;
|
|
64
|
-
returnFocusOnDeactivate?: boolean | undefined;
|
|
65
|
-
dismissible?: boolean | undefined;
|
|
66
|
-
html?: boolean | undefined;
|
|
67
|
-
input?: {
|
|
68
|
-
type: string;
|
|
69
|
-
placeholder?: string | undefined;
|
|
70
|
-
validator?: ((value: string) => string | undefined) | undefined;
|
|
71
|
-
} | undefined;
|
|
72
|
-
icons?: {
|
|
73
|
-
close: {
|
|
74
|
-
icon: string;
|
|
75
|
-
};
|
|
76
|
-
} | undefined;
|
|
77
|
-
};
|
|
78
|
-
options?: {
|
|
79
|
-
size?: import('../../components/index.ts').QDialogSize | undefined;
|
|
80
|
-
dismissible?: boolean | undefined;
|
|
81
|
-
input?: {
|
|
82
|
-
type: string;
|
|
83
|
-
placeholder?: string | undefined;
|
|
84
|
-
validator?: ((value: string) => string | undefined) | undefined;
|
|
85
|
-
} | undefined;
|
|
86
|
-
} | undefined;
|
|
87
|
-
handlers?: {
|
|
88
|
-
onEnter?: (() => void) | undefined;
|
|
89
|
-
onLeave?: (() => boolean | void) | undefined;
|
|
90
|
-
onAction?: ((val: string) => void) | undefined;
|
|
91
|
-
} | undefined;
|
|
92
|
-
}[];
|
|
93
|
-
};
|
|
7
|
+
export declare function useDialog(): UseDialogReturn;
|
|
94
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,YAAY,CAAA;AAQjE;;;;GAIG;AACH,wBAAgB,SAAS,IAAI,eAAe,CAyD3C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useId as e } from "../uid.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ref as t } from "vue";
|
|
3
3
|
//#region src/composables/useDialog/index.ts
|
|
4
|
-
var n = t(
|
|
4
|
+
var n = t([]);
|
|
5
5
|
function r() {
|
|
6
6
|
function t(t, r, i, a) {
|
|
7
7
|
let o = e(r).value;
|
|
8
|
-
return n.
|
|
8
|
+
return n.value.push({
|
|
9
9
|
id: o,
|
|
10
10
|
props: {
|
|
11
11
|
...t,
|
|
@@ -16,11 +16,11 @@ function r() {
|
|
|
16
16
|
}), a?.onEnter && a.onEnter(), o;
|
|
17
17
|
}
|
|
18
18
|
function r(e) {
|
|
19
|
-
let t = n.
|
|
20
|
-
t !== -1 && (n.
|
|
19
|
+
let t = n.value.findIndex((t) => t.id === e);
|
|
20
|
+
t !== -1 && (n.value[t]?.handlers?.onLeave?.() ?? !0) && n.value.splice(t, 1);
|
|
21
21
|
}
|
|
22
22
|
return {
|
|
23
|
-
|
|
23
|
+
dialogs: n,
|
|
24
24
|
addDialog: t,
|
|
25
25
|
removeDialog: r
|
|
26
26
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
1
2
|
import { QDialogProps, QDialogOptions, QDialogHandlers } from '../../components/QDialog/types.ts';
|
|
2
3
|
/**
|
|
3
4
|
* Represents an instance of a dialog component.
|
|
@@ -21,12 +22,21 @@ export type DialogInstance = {
|
|
|
21
22
|
handlers?: QDialogHandlers;
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
|
-
* Represents the
|
|
25
|
+
* Represents the return type of the `useDialog` composable, providing methods and state
|
|
26
|
+
* for managing dialog instances.
|
|
25
27
|
*/
|
|
26
|
-
export type
|
|
28
|
+
export type UseDialogReturn = {
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
30
|
+
* A Vue Ref containing the list of currently active dialog instances.
|
|
29
31
|
*/
|
|
30
|
-
dialogs: DialogInstance[]
|
|
32
|
+
dialogs: Ref<DialogInstance[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Adds a new dialog to the state with the specified properties and an optional custom ID.
|
|
35
|
+
*/
|
|
36
|
+
addDialog(props: QDialogProps, id?: string, options?: QDialogOptions, handlers?: QDialogHandlers): string;
|
|
37
|
+
/**
|
|
38
|
+
* Removes a dialog from the state by its unique identifier.
|
|
39
|
+
*/
|
|
40
|
+
removeDialog(id: string): void;
|
|
31
41
|
};
|
|
32
42
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,mCAAmC,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,KAAK,EAAE,YAAY,CAAA;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC1B,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC9B,OAAO,KAAK,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,MAAM,mCAAmC,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,KAAK,EAAE,YAAY,CAAA;IAEnB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B;;OAEG;IACH,OAAO,EAAE,GAAG,CAAC,cAAc,EAAE,CAAC,CAAA;IAE9B;;OAEG;IACH,SAAS,CACR,KAAK,EAAE,YAAY,EACnB,EAAE,CAAC,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,cAAc,EACxB,QAAQ,CAAC,EAAE,eAAe,GACxB,MAAM,CAAA;IAET;;OAEG;IACH,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B,CAAA"}
|
package/esm/index.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ declare module '@vue/runtime-core' {
|
|
|
50
50
|
QObfuscation: typeof import('@quidgest/ui/components')['QObfuscation']
|
|
51
51
|
QOverlay: typeof import('@quidgest/ui/components')['QOverlay']
|
|
52
52
|
QPasswordField: typeof import('@quidgest/ui/components')['QPasswordField']
|
|
53
|
+
QPhoneField: typeof import('@quidgest/ui/components')['QPhoneField']
|
|
53
54
|
QPopover: typeof import('@quidgest/ui/components')['QPopover']
|
|
54
55
|
QPropertyList: typeof import('@quidgest/ui/components')['QPropertyList']
|
|
55
56
|
QPropertyListRow: typeof import('@quidgest/ui/components')['QPropertyListRow']
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/country-flag-icons@1.6.19/node_modules/country-flag-icons/modules/countries.json.js
|
|
2
|
+
var e = /* @__PURE__ */ "AC.AD.AE.AF.AG.AI.AL.AM.AO.AQ.AR.AS.AT.AU.AW.AX.AZ.BA.BB.BD.BE.BF.BG.BH.BI.BJ.BL.BM.BN.BO.BQ-BO.BQ-SA.BQ-SE.BQ.BR.BS.BT.BV.BW.BY.BZ.CA.CC.CD.CF.CG.CH.CI.CK.CL.CM.CN.CO.CR.CU.CV.CW.CX.CY.CZ.DE.DJ.DK.DM.DO.DZ.EC.EE.EG.EH.ER.ES-CT.ES.ET.EU.FI.FJ.FK.FM.FO.FR.GA.GB-ENG.GB-NIR.GB-SCT.GB-WLS.GB.GD.GE.GF.GG.GH.GI.GL.GM.GN.GP.GQ.GR.GS.GT.GU.GW.GY.HK.HM.HN.HR.HT.HU.IC.ID.IE.IL.IM.IN.IO.IQ.IR.IS.IT.JE.JM.JO.JP.KE.KG.KH.KI.KM.KN.KP.KR.KW.KY.KZ.LA.LB.LC.LI.LK.LR.LS.LT.LU.LV.LY.MA.MC.MD.ME.MF.MG.MH.MK.ML.MM.MN.MO.MP.MQ.MR.MS.MT.MU.MV.MW.MX.MY.MZ.NA.NC.NE.NF.NG.NI.NL.NO.NP.NR.NU.NZ.OM.PA.PE.PF.PG.PH.PK.PL.PM.PN.PR.PS.PT.PW.PY.QA.RE.RO.RS.RU.RW.SA.SB.SC.SD.SE.SG.SH.SI.SJ.SK.SL.SM.SN.SO.SR.SS.ST.SV.SX.SY.SZ.TA.TC.TD.TF.TG.TH.TJ.TK.TL.TM.TN.TO.TR.TT.TV.TW.TZ.UA.UG.UM.US.UY.UZ.VA.VC.VE.VG.VI.VN.VU.WF.WS.XA.XC.XK.XO.YE.YT.ZA.ZM.ZW".split(".");
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as default };
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import e from "./helpers/isObject.js";
|
|
2
|
+
import t from "./metadata.js";
|
|
3
|
+
import n from "./helpers/checkNumberLength.js";
|
|
4
|
+
import r from "./helpers/getCountryByNationalNumber.js";
|
|
5
|
+
import i from "./helpers/getCountryByCallingCode.js";
|
|
6
|
+
import a from "./PhoneNumber.js";
|
|
7
|
+
import o from "./AsYouTypeState.js";
|
|
8
|
+
import s from "./AsYouTypeFormatter.js";
|
|
9
|
+
import c from "./AsYouTypeParser.js";
|
|
10
|
+
//#region ../../node_modules/.pnpm/libphonenumber-js@1.13.7/node_modules/libphonenumber-js/es6/AsYouType.js
|
|
11
|
+
function l(e) {
|
|
12
|
+
"@babel/helpers - typeof";
|
|
13
|
+
return l = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
14
|
+
return typeof e;
|
|
15
|
+
} : function(e) {
|
|
16
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
17
|
+
}, l(e);
|
|
18
|
+
}
|
|
19
|
+
function u(e, t) {
|
|
20
|
+
return h(e) || m(e, t) || f(e, t) || d();
|
|
21
|
+
}
|
|
22
|
+
function d() {
|
|
23
|
+
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
24
|
+
}
|
|
25
|
+
function f(e, t) {
|
|
26
|
+
if (e) {
|
|
27
|
+
if (typeof e == "string") return p(e, t);
|
|
28
|
+
var n = {}.toString.call(e).slice(8, -1);
|
|
29
|
+
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) ? p(e, t) : void 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function p(e, t) {
|
|
33
|
+
(t == null || t > e.length) && (t = e.length);
|
|
34
|
+
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
35
|
+
return r;
|
|
36
|
+
}
|
|
37
|
+
function m(e, t) {
|
|
38
|
+
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
39
|
+
if (n != null) {
|
|
40
|
+
var r, i, a, o, s = [], c = !0, l = !1;
|
|
41
|
+
try {
|
|
42
|
+
if (a = (n = n.call(e)).next, t === 0) {
|
|
43
|
+
if (Object(n) !== n) return;
|
|
44
|
+
c = !1;
|
|
45
|
+
} else for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
|
|
46
|
+
} catch (e) {
|
|
47
|
+
l = !0, i = e;
|
|
48
|
+
} finally {
|
|
49
|
+
try {
|
|
50
|
+
if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
|
|
51
|
+
} finally {
|
|
52
|
+
if (l) throw i;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return s;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function h(e) {
|
|
59
|
+
if (Array.isArray(e)) return e;
|
|
60
|
+
}
|
|
61
|
+
function g(e, t) {
|
|
62
|
+
if (!(e instanceof t)) throw TypeError("Cannot call a class as a function");
|
|
63
|
+
}
|
|
64
|
+
function _(e, t) {
|
|
65
|
+
for (var n = 0; n < t.length; n++) {
|
|
66
|
+
var r = t[n];
|
|
67
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, y(r.key), r);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function v(e, t, n) {
|
|
71
|
+
return t && _(e.prototype, t), n && _(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
72
|
+
}
|
|
73
|
+
function y(e) {
|
|
74
|
+
var t = b(e, "string");
|
|
75
|
+
return l(t) == "symbol" ? t : t + "";
|
|
76
|
+
}
|
|
77
|
+
function b(e, t) {
|
|
78
|
+
if (l(e) != "object" || !e) return e;
|
|
79
|
+
var n = e[Symbol.toPrimitive];
|
|
80
|
+
if (n !== void 0) {
|
|
81
|
+
var r = n.call(e, t || "default");
|
|
82
|
+
if (l(r) != "object") return r;
|
|
83
|
+
throw TypeError("@@toPrimitive must return a primitive value.");
|
|
84
|
+
}
|
|
85
|
+
return (t === "string" ? String : Number)(e);
|
|
86
|
+
}
|
|
87
|
+
var x = !1, S = /*#__PURE__*/ function() {
|
|
88
|
+
function r(e, n) {
|
|
89
|
+
g(this, r), this.metadata = new t(n);
|
|
90
|
+
var i = u(this.getCountryAndCallingCode(e), 2), a = i[0], o = i[1];
|
|
91
|
+
this.defaultCountry = a, this.defaultCallingCode = o, this.reset();
|
|
92
|
+
}
|
|
93
|
+
return v(r, [
|
|
94
|
+
{
|
|
95
|
+
key: "getCountryAndCallingCode",
|
|
96
|
+
value: function(t) {
|
|
97
|
+
var n, r;
|
|
98
|
+
return t && (e(t) ? (n = t.defaultCountry, r = t.defaultCallingCode) : n = t), n && !this.metadata.hasCountry(n) && (n = void 0), r && x && this.metadata.isNonGeographicCallingCode(r) && (n = "001"), [n, r];
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
key: "input",
|
|
103
|
+
value: function(e) {
|
|
104
|
+
var t = this.parser.input(e, this.state), n = t.digits;
|
|
105
|
+
if (t.justLeadingPlus) this.formattedOutput = "+";
|
|
106
|
+
else if (n) {
|
|
107
|
+
this.determineTheCountryIfNeeded(), this.state.nationalSignificantNumber && this.formatter.narrowDownMatchingFormats(this.state);
|
|
108
|
+
var r;
|
|
109
|
+
if (this.metadata.hasSelectedNumberingPlan() && (r = this.formatter.format(n, this.state)), r === void 0 && this.parser.reExtractNationalSignificantNumber(this.state)) {
|
|
110
|
+
this.determineTheCountryIfNeeded();
|
|
111
|
+
var i = this.state.getNationalDigits();
|
|
112
|
+
i && (r = this.formatter.format(i, this.state));
|
|
113
|
+
}
|
|
114
|
+
this.formattedOutput = r ? this.getFullNumber(r) : this.getNonFormattedNumber();
|
|
115
|
+
}
|
|
116
|
+
return this.formattedOutput;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
key: "reset",
|
|
121
|
+
value: function() {
|
|
122
|
+
var e = this;
|
|
123
|
+
return this.state = new o({
|
|
124
|
+
onCountryChange: function(t) {
|
|
125
|
+
e.country = t;
|
|
126
|
+
},
|
|
127
|
+
onCallingCodeChange: function(t, n) {
|
|
128
|
+
e.metadata.selectNumberingPlan(n || t), e.formatter.reset(e.metadata.numberingPlan, e.state), e.parser.reset(e.metadata.numberingPlan);
|
|
129
|
+
}
|
|
130
|
+
}), this.formatter = new s({
|
|
131
|
+
state: this.state,
|
|
132
|
+
metadata: this.metadata
|
|
133
|
+
}), this.parser = new c({
|
|
134
|
+
defaultCountry: this.defaultCountry,
|
|
135
|
+
defaultCallingCode: this.defaultCallingCode,
|
|
136
|
+
metadata: this.metadata,
|
|
137
|
+
state: this.state,
|
|
138
|
+
onNationalSignificantNumberChange: function() {
|
|
139
|
+
e.determineTheCountryIfNeeded(), e.formatter.reset(e.metadata.numberingPlan, e.state);
|
|
140
|
+
}
|
|
141
|
+
}), this.state.reset({
|
|
142
|
+
country: this.defaultCountry,
|
|
143
|
+
callingCode: this.defaultCallingCode
|
|
144
|
+
}), this.formattedOutput = "", this;
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
key: "isInternational",
|
|
149
|
+
value: function() {
|
|
150
|
+
return this.state.international;
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: "getCallingCode",
|
|
155
|
+
value: function() {
|
|
156
|
+
if (this.isInternational()) return this.state.callingCode;
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
key: "getCountryCallingCode",
|
|
161
|
+
value: function() {
|
|
162
|
+
return this.getCallingCode();
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
key: "getCountry",
|
|
167
|
+
value: function() {
|
|
168
|
+
if (this.state.digits) return this._getCountry();
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
key: "_getCountry",
|
|
173
|
+
value: function() {
|
|
174
|
+
var e = this.state.country;
|
|
175
|
+
if (!(x && e === "001")) return e;
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
key: "determineTheCountryIfNeeded",
|
|
180
|
+
value: function() {
|
|
181
|
+
(!this.state.country || this.isCountryCallingCodeAmbiguous()) && this.determineTheCountry();
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
key: "getFullNumber",
|
|
186
|
+
value: function(e) {
|
|
187
|
+
var t = this;
|
|
188
|
+
if (this.isInternational()) {
|
|
189
|
+
var n = function(e) {
|
|
190
|
+
return t.formatter.getInternationalPrefixBeforeCountryCallingCode(t.state, { spacing: !!e }) + e;
|
|
191
|
+
}, r = this.state.callingCode;
|
|
192
|
+
return n(r ? e ? `${r} ${e}` : r : `${this.state.getDigitsWithoutInternationalPrefix()}`);
|
|
193
|
+
}
|
|
194
|
+
return e;
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: "getNonFormattedNationalNumberWithPrefix",
|
|
199
|
+
value: function() {
|
|
200
|
+
var e = this.state, t = e.nationalSignificantNumber, n = e.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix, r = e.nationalPrefix, i = t, a = n || r;
|
|
201
|
+
return a && (i = a + i), i;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
key: "getNonFormattedNumber",
|
|
206
|
+
value: function() {
|
|
207
|
+
var e = this.state.nationalSignificantNumberIsModified;
|
|
208
|
+
return this.getFullNumber(e ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
key: "getNonFormattedTemplate",
|
|
213
|
+
value: function() {
|
|
214
|
+
var e = this.getNonFormattedNumber();
|
|
215
|
+
if (e) return e.replace(/[\+\d]/g, "x");
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
key: "isCountryCallingCodeAmbiguous",
|
|
220
|
+
value: function() {
|
|
221
|
+
var e = this.state.callingCode, t = this.metadata.getCountryCodesForCallingCode(e);
|
|
222
|
+
return t && t.length > 1;
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
key: "determineTheCountry",
|
|
227
|
+
value: function() {
|
|
228
|
+
var e = i(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
|
|
229
|
+
nationalNumber: this.state.nationalSignificantNumber,
|
|
230
|
+
metadata: this.metadata
|
|
231
|
+
});
|
|
232
|
+
e !== this.state.country && (this.state.setCountry(e), e && this.metadata.selectNumberingPlan(e));
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
key: "getNumberValue",
|
|
237
|
+
value: function() {
|
|
238
|
+
var e = this.state, t = e.digits, n = e.callingCode, r = e.country, i = e.nationalSignificantNumber;
|
|
239
|
+
if (t) {
|
|
240
|
+
if (this.isInternational()) return n ? "+" + n + i : "+" + t;
|
|
241
|
+
if (r || n) return "+" + (r ? this.metadata.countryCallingCode() : n) + i;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
key: "getNumber",
|
|
247
|
+
value: function() {
|
|
248
|
+
var e = this.state, t = e.nationalSignificantNumber, n = e.carrierCode, r = e.callingCode;
|
|
249
|
+
if (t) {
|
|
250
|
+
var i = this._getCountry();
|
|
251
|
+
if (!(!i && !r)) {
|
|
252
|
+
if (i && i === this.defaultCountry) {
|
|
253
|
+
var o = C(this.metadata.numberingPlan.callingCode(), t, this.metadata);
|
|
254
|
+
o && (i = o);
|
|
255
|
+
}
|
|
256
|
+
var s = new a(i || r, t, this.metadata.metadata);
|
|
257
|
+
return n && (s.carrierCode = n), s;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
key: "isPossible",
|
|
264
|
+
value: function() {
|
|
265
|
+
var e = this.getNumber();
|
|
266
|
+
return e ? e.isPossible() : !1;
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
key: "isValid",
|
|
271
|
+
value: function() {
|
|
272
|
+
var e = this.getNumber();
|
|
273
|
+
return e ? e.isValid() : !1;
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
key: "validateLength",
|
|
278
|
+
value: function() {
|
|
279
|
+
var e = this.state, t = e.digits, r = e.nationalSignificantNumber;
|
|
280
|
+
if (!t) return "NOT_A_NUMBER";
|
|
281
|
+
if (!this.metadata.numberingPlan) return "INVALID_COUNTRY";
|
|
282
|
+
if (!r) return "TOO_SHORT";
|
|
283
|
+
var i = n(r, void 0, this.metadata);
|
|
284
|
+
if (i !== "IS_POSSIBLE") return i;
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
key: "getNationalNumber",
|
|
289
|
+
value: function() {
|
|
290
|
+
return this.state.nationalSignificantNumber;
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
key: "getChars",
|
|
295
|
+
value: function() {
|
|
296
|
+
return (this.state.international ? "+" : "") + this.state.digits;
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
key: "getTemplate",
|
|
301
|
+
value: function() {
|
|
302
|
+
return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || "";
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
]);
|
|
306
|
+
}();
|
|
307
|
+
function C(e, t, n) {
|
|
308
|
+
var i = n.getCountryCodesForCallingCode(e);
|
|
309
|
+
if (i.length > 1) return r(t, i, n.metadata);
|
|
310
|
+
}
|
|
311
|
+
//#endregion
|
|
312
|
+
export { S as default };
|