@luftborn/custom-elements 2.2.0 → 2.3.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/demo/index.min.js CHANGED
@@ -3613,7 +3613,9 @@ var Flags2x_1 = require("./Flags2x");
3613
3613
  var IntPhoneFieldElement = /** @class */ (function (_super) {
3614
3614
  __extends(IntPhoneFieldElement, _super);
3615
3615
  function IntPhoneFieldElement() {
3616
- return _super.call(this) || this;
3616
+ var _this = _super.call(this) || this;
3617
+ _this.UTILS_URL = 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/15.0.1/js/utils.js';
3618
+ return _this;
3617
3619
  }
3618
3620
  Object.defineProperty(IntPhoneFieldElement.prototype, "value", {
3619
3621
  get: function () {
@@ -3660,6 +3662,7 @@ var IntPhoneFieldElement = /** @class */ (function (_super) {
3660
3662
  };
3661
3663
  var isIplookUpDisabled = ((_a = this.getAttribute('data-disable-iplookup')) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "true";
3662
3664
  var defaultCountry = isIplookUpDisabled ? 'dk' : 'auto';
3665
+ var utilsUrl = this.getAttribute('data-utils-url');
3663
3666
  var country = (_b = this.getAttribute('data-country')) === null || _b === void 0 ? void 0 : _b.toLowerCase();
3664
3667
  this.intlTelInput = intlTelInput(this.phone, {
3665
3668
  geoIpLookup: isIplookUpDisabled ? null : geoIpLookup,
@@ -3667,7 +3670,7 @@ var IntPhoneFieldElement = /** @class */ (function (_super) {
3667
3670
  initialCountry: country !== null && country !== void 0 ? country : defaultCountry,
3668
3671
  preferredCountries: ["dk", "se", "gb"],
3669
3672
  nationalMode: true,
3670
- utilsScript: 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/15.0.1/js/utils.js',
3673
+ utilsScript: utilsUrl !== null && utilsUrl !== void 0 ? utilsUrl : this.UTILS_URL,
3671
3674
  });
3672
3675
  this.intlTelInput.promise.then(function (e) {
3673
3676
  setTimeout(function () {
@@ -3676,9 +3679,9 @@ var IntPhoneFieldElement = /** @class */ (function (_super) {
3676
3679
  });
3677
3680
  var isLocalFlagEnabled = ((_c = this.getAttribute('data-local-flag')) === null || _c === void 0 ? void 0 : _c.toLowerCase()) === "true";
3678
3681
  if (isLocalFlagEnabled) {
3679
- var flagWrapper = this.shadowRoot.querySelector(".iti__flag");
3680
- if (flagWrapper) {
3681
- flagWrapper.style.backgroundImage = "url(" + (0, Flags_1.default)() + ")";
3682
+ var flagWrappers = this.shadowRoot.querySelectorAll(".iti__flag");
3683
+ if (flagWrappers.length > 0) {
3684
+ flagWrappers.forEach(function (f) { return f.style.backgroundImage = "url(" + (0, Flags_1.default)() + ")"; });
3682
3685
  }
3683
3686
  }
3684
3687
  };