Skip to content

Commit

Permalink
add guard
Browse files Browse the repository at this point in the history
  • Loading branch information
jackocnr committed Aug 23, 2024
1 parent 7947568 commit 41f573b
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build/js/intlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ var factoryOutput = (() => {
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInput.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,7 @@ var factoryOutput = (() => {
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion build/js/intlTelInputWithUtils.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion react/build/IntlTelInput.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ var Iti = class {
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ var Iti = class {
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1763,7 +1763,7 @@ var Iti = class {
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion react/build/IntlTelInputWithUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1727,7 +1727,7 @@ var Iti = class {
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/set-number/set-number-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25314,7 +25314,7 @@
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/simple/simple-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25314,7 +25314,7 @@
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/toggle-disabled/toggle-disabled-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25314,7 +25314,7 @@
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
2 changes: 1 addition & 1 deletion react/demo/validation/validation-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -25314,7 +25314,7 @@
this.options.nationalMode = false;
this.options.countrySearch = true;
}
if (!this.options.showFlags && !this.options.separateDialCode) {
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}
if (this.options.useFullscreenPopup && !this.options.dropdownContainer) {
Expand Down
4 changes: 2 additions & 2 deletions src/js/intl-tel-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ export class Iti {
this.options.countrySearch = true;
}

// if no flags, and no dial code, force nationalMode to false, as it doesn't make sense to show a national number placeholder if there's no way to see which country is selected
if (!this.options.showFlags && !this.options.separateDialCode) {
// if there is a country dropdown, but no flags and no separate dial code, then there are multiple countries to choose from, but no way to see which one is selected, so we force nationalMode to false, as it doesn't make sense to show a national number placeholder if there's no way to see which country is selected
if (this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode) {
this.options.nationalMode = false;
}

Expand Down
2 changes: 1 addition & 1 deletion vue/build/IntlTelInput.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ class j {
}
//* Can't be private as it's called from intlTelInput convenience wrapper.
_init() {
this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.separateDialCode && (this.options.allowDropdown = !0, this.options.nationalMode = !1, this.options.countrySearch = !0), !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...A, ...this.options.i18n };
this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.separateDialCode && (this.options.allowDropdown = !0, this.options.nationalMode = !1, this.options.countrySearch = !0), this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...A, ...this.options.i18n };
const t = new Promise((i, s) => {
this.resolveAutoCountryPromise = i, this.rejectAutoCountryPromise = s;
}), e = new Promise((i, s) => {
Expand Down
2 changes: 1 addition & 1 deletion vue/build/IntlTelInputWithUtils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ class U2 {
}
//* Can't be private as it's called from intlTelInput convenience wrapper.
_init() {
this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.separateDialCode && (this.options.allowDropdown = !0, this.options.nationalMode = !1, this.options.countrySearch = !0), !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...i2, ...this.options.i18n };
this.options.useFullscreenPopup && (this.options.fixDropdownWidth = !1), this.options.separateDialCode && (this.options.allowDropdown = !0, this.options.nationalMode = !1, this.options.countrySearch = !0), this.options.allowDropdown && !this.options.showFlags && !this.options.separateDialCode && (this.options.nationalMode = !1), this.options.useFullscreenPopup && !this.options.dropdownContainer && (this.options.dropdownContainer = document.body), this.isAndroid = typeof navigator < "u" ? /Android/i.test(navigator.userAgent) : !1, this.isRTL = !!this.telInput.closest("[dir=rtl]"), this.options.separateDialCode && (this.isRTL ? this.originalPaddingRight = this.telInput.style.paddingRight : this.originalPaddingLeft = this.telInput.style.paddingLeft), this.options.i18n = { ...i2, ...this.options.i18n };
const e = new Promise((r, u) => {
this.resolveAutoCountryPromise = r, this.rejectAutoCountryPromise = u;
}), i = new Promise((r, u) => {
Expand Down

0 comments on commit 41f573b

Please sign in to comment.