@salla.sa/twilight-components 2.12.46 → 2.12.48

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.
@@ -20398,29 +20398,8 @@ const UserIcon = `<!-- Generated by IcoMoon.io -->
20398
20398
  </svg>
20399
20399
  `;
20400
20400
 
20401
- const PhoneIcon = `<!-- Generated by IcoMoon.io -->
20402
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20403
- <title>phone</title>
20404
- <path d="M30.823 21.713l-3.883-3.883c-1.569-1.568-4.12-1.568-5.689 0l-2.568 2.568c-3.063-1.499-5.583-4.019-7.081-7.083l2.568-2.567c0.759-0.76 1.177-1.771 1.177-2.845s-0.419-2.084-1.179-2.844l-3.881-3.881c-1.52-1.521-4.171-1.521-5.689 0l-1.845 1.847c-2.22 2.219-3.183 5.407-2.573 8.527 1.98 10.144 10.125 18.292 20.269 20.271 0.616 0.121 1.236 0.18 1.849 0.18 2.492 0 4.896-0.972 6.677-2.752l1.847-1.847c1.568-1.571 1.568-4.121 0.001-5.691zM28.936 25.517l-1.845 1.847c-1.592 1.592-3.883 2.283-6.132 1.841-9.089-1.776-16.388-9.075-18.163-18.165-0.439-2.247 0.249-4.539 1.841-6.129l1.847-1.847c0.256-0.257 0.596-0.397 0.959-0.397s0.703 0.14 0.959 0.397l3.883 3.883c0.256 0.256 0.397 0.596 0.397 0.959s-0.141 0.703-0.397 0.96l-3.22 3.217c-0.383 0.384-0.496 0.959-0.287 1.457 1.813 4.339 5.343 7.868 9.683 9.684 0.497 0.207 1.073 0.095 1.457-0.288l3.22-3.22c0.529-0.529 1.389-0.528 1.917 0l3.881 3.883c0.528 0.529 0.528 1.389 0 1.919z"></path>
20405
- </svg>
20406
- `;
20407
-
20408
- const MailIcon = `<!-- Generated by IcoMoon.io -->
20409
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20410
- <title>mail</title>
20411
- <path d="M28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.735-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.599-1.333-1.333v-12.685l10.54 4.865c0.888 0.409 1.84 0.613 2.793 0.613s1.907-0.204 2.793-0.615l10.54-4.864zM29.333 9.711l-11.657 5.38c-1.065 0.492-2.288 0.492-3.353 0l-11.656-5.38v-3.044c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>
20412
- </svg>
20413
- `;
20414
-
20415
20401
  const ArrowRightIcon$1 = `<!-- Generated by IcoMoon.io -->
20416
20402
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20417
- <title>keyboard_arrow_right</title>
20418
- <path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>
20419
- </svg>
20420
- `;
20421
-
20422
- const ArrowRightIcon = `<!-- Generated by IcoMoon.io -->
20423
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
20424
20403
  <title>arrow-right</title>
20425
20404
  <path d="M29.217 15.465c-0.019-0.044-0.056-0.077-0.080-0.119-0.067-0.116-0.139-0.227-0.236-0.317-0.011-0.009-0.013-0.024-0.024-0.033l-10.667-9.333c-0.553-0.484-1.396-0.429-1.881 0.125-0.484 0.555-0.428 1.396 0.127 1.881l7.996 6.997h-20.452c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h20.452l-7.996 6.997c-0.555 0.485-0.611 1.327-0.127 1.881 0.264 0.3 0.633 0.455 1.004 0.455 0.312 0 0.625-0.109 0.877-0.331l10.667-9.333c0.011-0.009 0.015-0.024 0.024-0.033 0.097-0.091 0.169-0.201 0.236-0.317 0.024-0.041 0.060-0.075 0.080-0.119 0.073-0.163 0.116-0.343 0.116-0.533s-0.043-0.371-0.116-0.535z"></path>
20426
20405
  </svg>
@@ -20518,7 +20497,13 @@ const SallaLoginModal = class {
20518
20497
  this.browseFromFiles = salla.lang.get('common.uploader.browse');
20519
20498
  this.updateTranslations();
20520
20499
  });
20521
- salla.event.on('login::open', (event) => this.open(event));
20500
+ salla.event.on('login::open', (event) => {
20501
+ if (!this.isEmailAllowed && !this.isMobileAllowed) {
20502
+ salla.logger.warn('Please enable atleast one login type to use this component.');
20503
+ return;
20504
+ }
20505
+ this.open(event);
20506
+ });
20522
20507
  salla.onReady(() => {
20523
20508
  this.isEmailAllowed = salla.config.get('store.settings.auth.email_allowed', this.isEmailAllowed);
20524
20509
  this.isMobileAllowed = salla.config.get('store.settings.auth.mobile_allowed', this.isMobileAllowed);
@@ -20589,15 +20574,12 @@ const SallaLoginModal = class {
20589
20574
  location.reload();
20590
20575
  return;
20591
20576
  }
20592
- if (this.isEmailAllowed && this.isMobileAllowed) {
20593
- this.showTab(this.homeTab);
20577
+ if (this.isMobileAllowed) {
20578
+ this.showTab(this.mobileTab);
20594
20579
  }
20595
20580
  else if (this.isEmailAllowed) {
20596
20581
  this.showTab(this.emailTab);
20597
20582
  }
20598
- else if (this.isMobileAllowed) {
20599
- this.showTab(this.mobileTab);
20600
- }
20601
20583
  return this.modal.open();
20602
20584
  }
20603
20585
  showTab(tab, evt) {
@@ -20672,14 +20654,12 @@ const SallaLoginModal = class {
20672
20654
  render() {
20673
20655
  // @ts-ignore
20674
20656
  // @ts-ignore
20675
- return (index.h("salla-modal", { class: "s-login-modal", "modal-title": this.title, ref: modal => this.modal = modal, width: "xs" }, index.h("span", { slot: 'icon', class: "s-login-modal-header-icon", innerHTML: UserIcon }), index.h("div", { class: "s-login-modal-wrapper" }, this.isEmailAllowed && this.isMobileAllowed ?
20676
- index.h("div", { class: this.generateTabClasses('home'), "data-name": "home", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-modal-sub-title" }, salla.lang.get('blocks.header.select_login_way')), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("span", { class: "s-login-modal-main-btn-icon", innerHTML: PhoneIcon }), index.h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('blocks.header.sms')), index.h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: ArrowRightIcon$1 })), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) }, index.h("span", { class: "s-login-modal-main-btn-icon", innerHTML: MailIcon }), index.h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('common.elements.email')), index.h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: ArrowRightIcon$1 })), index.h("slot", { name: "after-login-type" }))
20677
- : '', this.isMobileAllowed ?
20657
+ return (index.h("salla-modal", { class: "s-login-modal", "modal-title": this.title, ref: modal => this.modal = modal, width: "xs" }, index.h("span", { slot: 'icon', class: "s-login-modal-header-icon", innerHTML: UserIcon }), index.h("div", { class: "s-login-modal-wrapper" }, this.isMobileAllowed ?
20678
20658
  index.h("div", { class: this.generateTabClasses('login-phone'), "data-name": "login-phone", ref: tab => this.mobileTab = tab }, index.h("slot", { name: "before-login-mobile" }), index.h("form", { onSubmit: (event) => this.loginBySMS(event), method: "POST" }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { tabindex: "0", ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e) }), index.h("salla-button", { class: "s-login-modal-enter-button", type: "submit", "loader-position": 'center', width: "wide", ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter'))), this.isEmailAllowed ?
20679
20659
  index.h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_email')) : '', index.h("slot", { name: "after-login-mobile" })) : '', this.isEmailAllowed ?
20680
20660
  index.h("div", { class: this.generateTabClasses('login-email'), "data-name": "login-email", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("form", { onSubmit: () => this.loginByEmail(event), method: "POST" }, index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e), placeholder: "your@email.com", enterkeyhint: "next", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" }), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter'))), this.isMobileAllowed ?
20681
20661
  index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_sms'))
20682
- : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: ArrowRightIcon, slot: "after-footer", href: "#" }), this.isMobileAllowed && this.regType == 'phone' ? index.h("div", { dir: "ltr", class: "s-login-modal-currentPhone", slot: "mobile" }, this.currentPhone) : '', this.isEmailAllowed && this.regType == 'email' ? index.h("div", { dir: "ltr", class: "s-login-modal-currentEmail", slot: "email" }, this.currentEmail) : ''), index.h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: this.generateRegClasses('phone') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { class: this.generateRegClasses('email') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: "s-login-modal-custom-fields", ref: el => this.customFieldsWrapper = el }, this.customFields.map((field) => [
20662
+ : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { display: "inline", "support-web-auth": this.supportWebAuth ? 'true' : 'false', class: this.generateTabClasses('otp'), "data-name": "otp", ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back", innerHTML: ArrowRightIcon$1, slot: "after-footer", href: "#" }), this.isMobileAllowed && this.regType == 'phone' ? index.h("div", { dir: "ltr", class: "s-login-modal-currentPhone", slot: "mobile" }, this.currentPhone) : '', this.isEmailAllowed && this.regType == 'email' ? index.h("div", { dir: "ltr", class: "s-login-modal-currentEmail", slot: "email" }, this.currentEmail) : ''), index.h("div", { "data-name": "registration", class: this.generateTabClasses('registration'), ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", null, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')), index.h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: this.generateRegClasses('phone') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { class: this.generateRegClasses('email') }, index.h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("div", { class: "s-login-modal-custom-fields", ref: el => this.customFieldsWrapper = el }, this.customFields.map((field) => [
20683
20663
  index.h("label", { class: "s-login-modal-label" }, field.label),
20684
20664
  field.type === CustomFieldType.PHOTO
20685
20665
  ? index.h("salla-file-upload", { name: "image", "instant-upload": true, id: `${field.id}`, title: field.label, required: field.required, url: salla.url.get('upload-image'),
@@ -25124,6 +25104,13 @@ const IphoneXIcon = `<!-- Generated by IcoMoon.io -->
25124
25104
  </svg>
25125
25105
  `;
25126
25106
 
25107
+ const MailIcon = `<!-- Generated by IcoMoon.io -->
25108
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
25109
+ <title>mail</title>
25110
+ <path d="M28 2.667h-24c-2.205 0-4 1.795-4 4v18.667c0 2.205 1.795 4 4 4h24c2.205 0 4-1.795 4-4v-18.667c0-2.205-1.795-4-4-4zM29.333 25.333c0 0.735-0.599 1.333-1.333 1.333h-24c-0.735 0-1.333-0.599-1.333-1.333v-12.685l10.54 4.865c0.888 0.409 1.84 0.613 2.793 0.613s1.907-0.204 2.793-0.615l10.54-4.864zM29.333 9.711l-11.657 5.38c-1.065 0.492-2.288 0.492-3.353 0l-11.656-5.38v-3.044c0-0.735 0.599-1.333 1.333-1.333h24c0.735 0 1.333 0.599 1.333 1.333z"></path>
25111
+ </svg>
25112
+ `;
25113
+
25127
25114
  const sallaQuickOrderCss = ".s-quick-order-expandable:not(.s-quick-order-shown){overflow:hidden}";
25128
25115
 
25129
25116
  const SallaQuickOrder = class {
@@ -25863,6 +25850,13 @@ const SallaSkeleton = class {
25863
25850
  };
25864
25851
  SallaSkeleton.style = sallaSkeletonCss;
25865
25852
 
25853
+ const ArrowRightIcon = `<!-- Generated by IcoMoon.io -->
25854
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
25855
+ <title>keyboard_arrow_right</title>
25856
+ <path d="M11.438 22.479l6.125-6.125-6.125-6.125 1.875-1.875 8 8-8 8z"></path>
25857
+ </svg>
25858
+ `;
25859
+
25866
25860
  const ArrowLeftIcon = `<!-- Generated by IcoMoon.io -->
25867
25861
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
25868
25862
  <title>keyboard_arrow_left</title>
@@ -26269,10 +26263,10 @@ const SallaSlider = class {
26269
26263
  : '', index.h("div", { class: "s-slider-block__title-left" }, this.displayAllUrl ?
26270
26264
  index.h("a", { href: this.displayAllUrl, class: "s-slider-block__display-all" }, this.displayAllTitle)
26271
26265
  : '', this.showControls ?
26272
- index.h("div", { class: "s-slider-block__title-nav", dir: "rtl" }, index.h("button", { "aria-label": "Previous Slide", class: "s-slider-prev s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon$1 : ArrowLeftIcon })), index.h("button", { "aria-label": "Next Slide", class: "s-slider-next s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon$1 })))
26266
+ index.h("div", { class: "s-slider-block__title-nav", dir: "rtl" }, index.h("button", { "aria-label": "Previous Slide", class: "s-slider-prev s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon })), index.h("button", { "aria-label": "Next Slide", class: "s-slider-next s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon })))
26273
26267
  : ''))
26274
26268
  : '', index.h("div", { class: "swiper s-slider-container", ref: el => this.sliderContainer = el, dir: this.vertical ? "ltr" : this.direction }, index.h("slot", null), index.h("div", { class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el }, index.h("slot", { name: 'items' })), this.pagination ? index.h("div", { class: "swiper-pagination" }) : ''), this.type == 'thumbs' && this.hasThumbSlot ? index.h("div", { class: "s-slider-thumbs" }, index.h("div", { class: "swiper s-slider-thumbs-container", dir: this.getThumbsDirection(), ref: el => this.thumbsSliderContainer = el }, index.h("div", { class: { "s-slider-swiper-wrapper swiper-wrapper": true, "s-slider-grid-thumbs": this.gridThumbs }, ref: el => this.thumbsSliderWrapper = el }, index.h("slot", { name: "thumbs" })), this.showThumbsControls ?
26275
- index.h("div", { class: "s-slider-thumbs-nav", dir: "rtl" }, index.h("button", { "aria-label": "Previous Slide", class: "s-slider-thumbs-prev s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon$1 : ArrowLeftIcon })), index.h("button", { "aria-label": "Next Slide", class: "s-slider-thumbs-next s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon$1 })))
26269
+ index.h("div", { class: "s-slider-thumbs-nav", dir: "rtl" }, index.h("button", { "aria-label": "Previous Slide", class: "s-slider-thumbs-prev s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowRightIcon : ArrowLeftIcon })), index.h("button", { "aria-label": "Next Slide", class: "s-slider-thumbs-next s-slider-nav-arrow" }, index.h("span", { class: "s-slider-button-icon", innerHTML: this.direction == 'rtl' ? ArrowLeftIcon : ArrowRightIcon })))
26276
26270
  : null))
26277
26271
  : null));
26278
26272
  }