@codebards/ik-embeddable-form 0.0.2689347422-qa → 0.0.2689415847-qa
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/dist/embed.js +49 -49
- package/dist/embed.js.map +1 -1
- package/package.json +4 -1
package/dist/embed.js
CHANGED
|
@@ -2677,7 +2677,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
2677
2677
|
user_timezone: context.userTimezone,
|
|
2678
2678
|
v_country: context.vCountry,
|
|
2679
2679
|
phone_number_full: str(formData.phoneNumberFull ?? formData.phone),
|
|
2680
|
-
phone_code: str(formData.phoneCode ?? "
|
|
2680
|
+
phone_code: str(formData.phoneCode ?? ""),
|
|
2681
2681
|
"Event Start Time": str(formData.eventStartTime),
|
|
2682
2682
|
"Event End Time": str(formData.eventEndTime),
|
|
2683
2683
|
"Future Plan": buildFuturePlan(formData) || str(formData.futurePlan ?? ""),
|
|
@@ -8048,7 +8048,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8048
8048
|
var intlTelInputGlobals = {
|
|
8049
8049
|
getInstance: function getInstance(input) {
|
|
8050
8050
|
var id2 = input.getAttribute("data-intl-tel-input-id");
|
|
8051
|
-
return window.
|
|
8051
|
+
return window.__ikIntlTelInputGlobals.instances[id2];
|
|
8052
8052
|
},
|
|
8053
8053
|
instances: {},
|
|
8054
8054
|
// using a global like this allows us to mock it in the tests
|
|
@@ -8056,7 +8056,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8056
8056
|
return document.readyState === "complete";
|
|
8057
8057
|
}
|
|
8058
8058
|
};
|
|
8059
|
-
if (typeof window === "object") window.
|
|
8059
|
+
if (typeof window === "object") window.__ikIntlTelInputGlobals = intlTelInputGlobals;
|
|
8060
8060
|
var id = 0;
|
|
8061
8061
|
var defaults = {
|
|
8062
8062
|
// whether or not to allow the dropdown
|
|
@@ -8104,8 +8104,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8104
8104
|
}
|
|
8105
8105
|
};
|
|
8106
8106
|
var forEachInstance = function forEachInstance2(method) {
|
|
8107
|
-
forEachProp(window.
|
|
8108
|
-
window.
|
|
8107
|
+
forEachProp(window.__ikIntlTelInputGlobals.instances, function(key) {
|
|
8108
|
+
window.__ikIntlTelInputGlobals.instances[key][method]();
|
|
8109
8109
|
});
|
|
8110
8110
|
};
|
|
8111
8111
|
var Iti = /* @__PURE__ */ function() {
|
|
@@ -8447,12 +8447,12 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8447
8447
|
key: "_initRequests",
|
|
8448
8448
|
value: function _initRequests() {
|
|
8449
8449
|
var _this5 = this;
|
|
8450
|
-
if (this.options.utilsScript && !window.
|
|
8451
|
-
if (window.
|
|
8452
|
-
window.
|
|
8450
|
+
if (this.options.utilsScript && !window.__ikIntlTelInputUtils) {
|
|
8451
|
+
if (window.__ikIntlTelInputGlobals.documentReady()) {
|
|
8452
|
+
window.__ikIntlTelInputGlobals.loadUtils(this.options.utilsScript);
|
|
8453
8453
|
} else {
|
|
8454
8454
|
window.addEventListener("load", function() {
|
|
8455
|
-
window.
|
|
8455
|
+
window.__ikIntlTelInputGlobals.loadUtils(_this5.options.utilsScript);
|
|
8456
8456
|
});
|
|
8457
8457
|
}
|
|
8458
8458
|
} else this.resolveUtilsScriptPromise();
|
|
@@ -8462,13 +8462,13 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8462
8462
|
}, {
|
|
8463
8463
|
key: "_loadAutoCountry",
|
|
8464
8464
|
value: function _loadAutoCountry() {
|
|
8465
|
-
if (window.
|
|
8465
|
+
if (window.__ikIntlTelInputGlobals.autoCountry) {
|
|
8466
8466
|
this.handleAutoCountry();
|
|
8467
|
-
} else if (!window.
|
|
8468
|
-
window.
|
|
8467
|
+
} else if (!window.__ikIntlTelInputGlobals.startedLoadingAutoCountry) {
|
|
8468
|
+
window.__ikIntlTelInputGlobals.startedLoadingAutoCountry = true;
|
|
8469
8469
|
if (typeof this.options.geoIpLookup === "function") {
|
|
8470
8470
|
this.options.geoIpLookup(function(countryCode) {
|
|
8471
|
-
window.
|
|
8471
|
+
window.__ikIntlTelInputGlobals.autoCountry = countryCode.toLowerCase();
|
|
8472
8472
|
setTimeout(function() {
|
|
8473
8473
|
return forEachInstance("handleAutoCountry");
|
|
8474
8474
|
});
|
|
@@ -8662,11 +8662,11 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8662
8662
|
key: "_updateValFromNumber",
|
|
8663
8663
|
value: function _updateValFromNumber(originalNumber) {
|
|
8664
8664
|
var number = originalNumber;
|
|
8665
|
-
if (this.options.formatOnDisplay && window.
|
|
8665
|
+
if (this.options.formatOnDisplay && window.__ikIntlTelInputUtils && this.selectedCountryData) {
|
|
8666
8666
|
var useNational = !this.options.separateDialCode && (this.options.nationalMode || number.charAt(0) !== "+");
|
|
8667
|
-
var
|
|
8667
|
+
var ___ikIntlTelInputUtils$nu = __ikIntlTelInputUtils.numberFormat, NATIONAL = ___ikIntlTelInputUtils$nu.NATIONAL, INTERNATIONAL = ___ikIntlTelInputUtils$nu.INTERNATIONAL;
|
|
8668
8668
|
var format = useNational ? NATIONAL : INTERNATIONAL;
|
|
8669
|
-
number =
|
|
8669
|
+
number = __ikIntlTelInputUtils.formatNumber(number, this.selectedCountryData.iso2, format);
|
|
8670
8670
|
}
|
|
8671
8671
|
number = this._beforeSetNumber(number);
|
|
8672
8672
|
this.telInput.value = number;
|
|
@@ -8794,9 +8794,9 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8794
8794
|
key: "_updatePlaceholder",
|
|
8795
8795
|
value: function _updatePlaceholder() {
|
|
8796
8796
|
var shouldSetPlaceholder = this.options.autoPlaceholder === "aggressive" || !this.hadInitialPlaceholder && this.options.autoPlaceholder === "polite";
|
|
8797
|
-
if (window.
|
|
8798
|
-
var numberType2 =
|
|
8799
|
-
var placeholder = this.selectedCountryData.iso2 ?
|
|
8797
|
+
if (window.__ikIntlTelInputUtils && shouldSetPlaceholder) {
|
|
8798
|
+
var numberType2 = __ikIntlTelInputUtils.numberType[this.options.placeholderNumberType];
|
|
8799
|
+
var placeholder = this.selectedCountryData.iso2 ? __ikIntlTelInputUtils.getExampleNumber(this.selectedCountryData.iso2, this.options.nationalMode, numberType2) : "";
|
|
8800
8800
|
placeholder = this._beforeSetNumber(placeholder);
|
|
8801
8801
|
if (typeof this.options.customPlaceholder === "function") {
|
|
8802
8802
|
placeholder = this.options.customPlaceholder(placeholder, this.selectedCountryData);
|
|
@@ -8946,7 +8946,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8946
8946
|
key: "handleAutoCountry",
|
|
8947
8947
|
value: function handleAutoCountry() {
|
|
8948
8948
|
if (this.options.initialCountry === "auto") {
|
|
8949
|
-
this.defaultCountry = window.
|
|
8949
|
+
this.defaultCountry = window.__ikIntlTelInputGlobals.autoCountry;
|
|
8950
8950
|
if (!this.telInput.value) {
|
|
8951
8951
|
this.setCountry(this.defaultCountry);
|
|
8952
8952
|
}
|
|
@@ -8956,7 +8956,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8956
8956
|
}, {
|
|
8957
8957
|
key: "handleUtils",
|
|
8958
8958
|
value: function handleUtils() {
|
|
8959
|
-
if (window.
|
|
8959
|
+
if (window.__ikIntlTelInputUtils) {
|
|
8960
8960
|
if (this.telInput.value) {
|
|
8961
8961
|
this._updateValFromNumber(this.telInput.value);
|
|
8962
8962
|
}
|
|
@@ -8987,30 +8987,30 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
8987
8987
|
var wrapper = this.telInput.parentNode;
|
|
8988
8988
|
wrapper.parentNode.insertBefore(this.telInput, wrapper);
|
|
8989
8989
|
wrapper.parentNode.removeChild(wrapper);
|
|
8990
|
-
delete window.
|
|
8990
|
+
delete window.__ikIntlTelInputGlobals.instances[this.id];
|
|
8991
8991
|
}
|
|
8992
8992
|
}, {
|
|
8993
8993
|
key: "getExtension",
|
|
8994
8994
|
value: function getExtension() {
|
|
8995
|
-
if (window.
|
|
8996
|
-
return
|
|
8995
|
+
if (window.__ikIntlTelInputUtils) {
|
|
8996
|
+
return __ikIntlTelInputUtils.getExtension(this._getFullNumber(), this.selectedCountryData.iso2);
|
|
8997
8997
|
}
|
|
8998
8998
|
return "";
|
|
8999
8999
|
}
|
|
9000
9000
|
}, {
|
|
9001
9001
|
key: "getNumber",
|
|
9002
9002
|
value: function getNumber(format) {
|
|
9003
|
-
if (window.
|
|
9003
|
+
if (window.__ikIntlTelInputUtils) {
|
|
9004
9004
|
var iso2 = this.selectedCountryData.iso2;
|
|
9005
|
-
return
|
|
9005
|
+
return __ikIntlTelInputUtils.formatNumber(this._getFullNumber(), iso2, format);
|
|
9006
9006
|
}
|
|
9007
9007
|
return "";
|
|
9008
9008
|
}
|
|
9009
9009
|
}, {
|
|
9010
9010
|
key: "getNumberType",
|
|
9011
9011
|
value: function getNumberType() {
|
|
9012
|
-
if (window.
|
|
9013
|
-
return
|
|
9012
|
+
if (window.__ikIntlTelInputUtils) {
|
|
9013
|
+
return __ikIntlTelInputUtils.getNumberType(this._getFullNumber(), this.selectedCountryData.iso2);
|
|
9014
9014
|
}
|
|
9015
9015
|
return -99;
|
|
9016
9016
|
}
|
|
@@ -9022,9 +9022,9 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
9022
9022
|
}, {
|
|
9023
9023
|
key: "getValidationError",
|
|
9024
9024
|
value: function getValidationError() {
|
|
9025
|
-
if (window.
|
|
9025
|
+
if (window.__ikIntlTelInputUtils) {
|
|
9026
9026
|
var iso2 = this.selectedCountryData.iso2;
|
|
9027
|
-
return
|
|
9027
|
+
return __ikIntlTelInputUtils.getValidationError(this._getFullNumber(), iso2);
|
|
9028
9028
|
}
|
|
9029
9029
|
return -99;
|
|
9030
9030
|
}
|
|
@@ -9033,7 +9033,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
9033
9033
|
value: function isValidNumber() {
|
|
9034
9034
|
var val = this._getFullNumber().trim();
|
|
9035
9035
|
var countryCode = this.options.nationalMode ? this.selectedCountryData.iso2 : "";
|
|
9036
|
-
return window.
|
|
9036
|
+
return window.__ikIntlTelInputUtils ? __ikIntlTelInputUtils.isValidNumber(val, countryCode) : null;
|
|
9037
9037
|
}
|
|
9038
9038
|
}, {
|
|
9039
9039
|
key: "setCountry",
|
|
@@ -9082,8 +9082,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
9082
9082
|
document.body.appendChild(script);
|
|
9083
9083
|
};
|
|
9084
9084
|
intlTelInputGlobals.loadUtils = function(path) {
|
|
9085
|
-
if (!window.
|
|
9086
|
-
window.
|
|
9085
|
+
if (!window.__ikIntlTelInputUtils && !window.__ikIntlTelInputGlobals.startedLoadingUtilsScript) {
|
|
9086
|
+
window.__ikIntlTelInputGlobals.startedLoadingUtilsScript = true;
|
|
9087
9087
|
if (typeof Promise !== "undefined") {
|
|
9088
9088
|
return new Promise(function(resolve, reject) {
|
|
9089
9089
|
return injectScript(path, resolve, reject);
|
|
@@ -9099,7 +9099,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
9099
9099
|
var iti = new Iti(input, options);
|
|
9100
9100
|
iti._init();
|
|
9101
9101
|
input.setAttribute("data-intl-tel-input-id", iti.id);
|
|
9102
|
-
window.
|
|
9102
|
+
window.__ikIntlTelInputGlobals.instances[iti.id] = iti;
|
|
9103
9103
|
return iti;
|
|
9104
9104
|
};
|
|
9105
9105
|
}();
|
|
@@ -14746,8 +14746,8 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14746
14746
|
function O2(a2, b2) {
|
|
14747
14747
|
return (a2 = "string" == typeof a2 ? b2.match("^(?:" + a2 + ")$") : b2.match(a2)) && a2[0].length == b2.length ? true : false;
|
|
14748
14748
|
}
|
|
14749
|
-
k2("
|
|
14750
|
-
k2("
|
|
14749
|
+
k2("__ikIntlTelInputUtils", {});
|
|
14750
|
+
k2("__ikIntlTelInputUtils.formatNumber", function(a2, b2, c2) {
|
|
14751
14751
|
try {
|
|
14752
14752
|
var d2 = M2.a(), e2 = Z2(d2, a2, b2), f2 = Oa(d2, e2);
|
|
14753
14753
|
return 0 == f2 || 4 == f2 ? La(d2, e2, "undefined" == typeof c2 ? 0 : c2) : a2;
|
|
@@ -14755,7 +14755,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14755
14755
|
return a2;
|
|
14756
14756
|
}
|
|
14757
14757
|
});
|
|
14758
|
-
k2("
|
|
14758
|
+
k2("__ikIntlTelInputUtils.getExampleNumber", function(a2, b2, c2) {
|
|
14759
14759
|
try {
|
|
14760
14760
|
var d2 = M2.a();
|
|
14761
14761
|
a: {
|
|
@@ -14777,14 +14777,14 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14777
14777
|
return "";
|
|
14778
14778
|
}
|
|
14779
14779
|
});
|
|
14780
|
-
k2("
|
|
14780
|
+
k2("__ikIntlTelInputUtils.getExtension", function(a2, b2) {
|
|
14781
14781
|
try {
|
|
14782
14782
|
return r2(Z2(M2.a(), a2, b2), 3);
|
|
14783
14783
|
} catch (c2) {
|
|
14784
14784
|
return "";
|
|
14785
14785
|
}
|
|
14786
14786
|
});
|
|
14787
|
-
k2("
|
|
14787
|
+
k2("__ikIntlTelInputUtils.getNumberType", function(a2, b2) {
|
|
14788
14788
|
try {
|
|
14789
14789
|
var c2 = M2.a();
|
|
14790
14790
|
var d2 = Z2(c2, a2, b2), e2 = Na(c2, d2), f2 = S2(c2, y2(d2, 1), e2);
|
|
@@ -14798,7 +14798,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14798
14798
|
return -99;
|
|
14799
14799
|
}
|
|
14800
14800
|
});
|
|
14801
|
-
k2("
|
|
14801
|
+
k2("__ikIntlTelInputUtils.getValidationError", function(a2, b2) {
|
|
14802
14802
|
try {
|
|
14803
14803
|
var c2 = M2.a(), d2 = Z2(c2, a2, b2);
|
|
14804
14804
|
return Oa(c2, d2);
|
|
@@ -14806,7 +14806,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14806
14806
|
return "Invalid country calling code" == e2.message ? 1 : "The string supplied did not seem to be a phone number" == e2.message ? 4 : "Phone number too short after IDD" == e2.message || "The string supplied is too short to be a phone number" == e2 ? 2 : "The string supplied is too long to be a phone number" == e2.message ? 3 : -99;
|
|
14807
14807
|
}
|
|
14808
14808
|
});
|
|
14809
|
-
k2("
|
|
14809
|
+
k2("__ikIntlTelInputUtils.isValidNumber", function(a2, b2) {
|
|
14810
14810
|
try {
|
|
14811
14811
|
var c2 = M2.a(), d2 = Z2(c2, a2, b2);
|
|
14812
14812
|
var e2 = Na(c2, d2), f2 = y2(d2, 1), g2 = S2(c2, f2, e2), h2;
|
|
@@ -14830,17 +14830,17 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14830
14830
|
return false;
|
|
14831
14831
|
}
|
|
14832
14832
|
});
|
|
14833
|
-
k2("
|
|
14834
|
-
k2("
|
|
14835
|
-
k2("
|
|
14833
|
+
k2("__ikIntlTelInputUtils.numberFormat", { E164: 0, INTERNATIONAL: 1, NATIONAL: 2, RFC3966: 3 });
|
|
14834
|
+
k2("__ikIntlTelInputUtils.numberType", { FIXED_LINE: 0, MOBILE: 1, FIXED_LINE_OR_MOBILE: 2, TOLL_FREE: 3, PREMIUM_RATE: 4, SHARED_COST: 5, VOIP: 6, PERSONAL_NUMBER: 7, PAGER: 8, UAN: 9, VOICEMAIL: 10, UNKNOWN: -1 });
|
|
14835
|
+
k2("__ikIntlTelInputUtils.validationError", { IS_POSSIBLE: 0, INVALID_COUNTRY_CODE: 1, TOO_SHORT: 2, TOO_LONG: 3, NOT_A_NUMBER: 4 });
|
|
14836
14836
|
})();
|
|
14837
14837
|
function hasIntlTelInputUtils() {
|
|
14838
|
-
return typeof
|
|
14838
|
+
return typeof __ikIntlTelInputUtils !== "undefined";
|
|
14839
14839
|
}
|
|
14840
14840
|
function isPlausiblePhoneNumber(number, countryIso2) {
|
|
14841
14841
|
if (!hasIntlTelInputUtils()) return false;
|
|
14842
|
-
const error =
|
|
14843
|
-
return error ===
|
|
14842
|
+
const error = __ikIntlTelInputUtils.getValidationError(number, countryIso2);
|
|
14843
|
+
return error === __ikIntlTelInputUtils.validationError.IS_POSSIBLE;
|
|
14844
14844
|
}
|
|
14845
14845
|
const PhoneInput = D(
|
|
14846
14846
|
({
|
|
@@ -14898,7 +14898,7 @@ var IKEmbeddableFormBundle = function(exports) {
|
|
|
14898
14898
|
const input = inputRef.current;
|
|
14899
14899
|
if (!iti || !input) return "";
|
|
14900
14900
|
if (hasIntlTelInputUtils()) {
|
|
14901
|
-
return iti.getNumber(
|
|
14901
|
+
return iti.getNumber(__ikIntlTelInputUtils.numberFormat.E164) || "";
|
|
14902
14902
|
}
|
|
14903
14903
|
const data = iti.getSelectedCountryData();
|
|
14904
14904
|
const digits = input.value.replace(/\D/g, "");
|
|
@@ -20661,7 +20661,7 @@ ${intlTelStyles}`;
|
|
|
20661
20661
|
destroy();
|
|
20662
20662
|
},
|
|
20663
20663
|
getVersion() {
|
|
20664
|
-
return "1.0.
|
|
20664
|
+
return "1.0.29";
|
|
20665
20665
|
}
|
|
20666
20666
|
};
|
|
20667
20667
|
if (typeof window !== "undefined") {
|