@salla.sa/twilight-components 2.11.18 → 2.11.20

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.
Files changed (30) hide show
  1. package/dist/cjs/{app-globals-f49969d2.js → app-globals-f18513f9.js} +39 -2232
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/salla-button_37.cjs.entry.js +7 -2
  4. package/dist/cjs/twilight.cjs.js +1 -1
  5. package/dist/collection/components/salla-file-upload/salla-file-upload.js +3 -0
  6. package/dist/collection/components/salla-slider/salla-slider.js +4 -2
  7. package/dist/components/index.js +39 -2232
  8. package/dist/components/salla-file-upload2.js +3 -0
  9. package/dist/components/salla-slider2.js +4 -2
  10. package/dist/esm/{app-globals-fc703675.js → app-globals-9127a6ae.js} +39 -2232
  11. package/dist/esm/loader.js +1 -1
  12. package/dist/esm/salla-button_37.entry.js +7 -2
  13. package/dist/esm/twilight.js +1 -1
  14. package/dist/esm-es5/app-globals-9127a6ae.js +24 -0
  15. package/dist/esm-es5/loader.js +1 -1
  16. package/dist/esm-es5/salla-button_37.entry.js +4 -4
  17. package/dist/esm-es5/twilight.js +1 -1
  18. package/dist/twilight/{p-c71ec183.system.js → p-5fc3f873.system.js} +1 -1
  19. package/dist/twilight/p-7182281b.entry.js +36 -0
  20. package/dist/twilight/p-a6b1a735.js +24 -0
  21. package/dist/twilight/{p-b34f9dfa.system.entry.js → p-c46d9ddb.system.entry.js} +5 -5
  22. package/dist/twilight/p-dddd2139.system.js +24 -0
  23. package/dist/twilight/twilight.esm.js +1 -1
  24. package/dist/twilight/twilight.js +1 -1
  25. package/dist/types/components/salla-slider/salla-slider.d.ts +1 -0
  26. package/package.json +4 -4
  27. package/dist/esm-es5/app-globals-fc703675.js +0 -30
  28. package/dist/twilight/p-20a603e8.entry.js +0 -36
  29. package/dist/twilight/p-83516eab.js +0 -24
  30. package/dist/twilight/p-a2bd5187.system.js +0 -30
@@ -6,7 +6,7 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-1d2b3370.js');
9
- const appGlobals = require('./app-globals-f49969d2.js');
9
+ const appGlobals = require('./app-globals-f18513f9.js');
10
10
  require('./_commonjsHelpers-691dd63b.js');
11
11
 
12
12
  /*
@@ -20785,6 +20785,7 @@ const SallaFileUpload = class {
20785
20785
  this.instantUpload = true;
20786
20786
  }
20787
20787
  if (!this.url && this.profileImage) {
20788
+ this.accept = 'image/png,image/jpeg,image/jpg';
20788
20789
  this.url = salla.url.api('profile/update');
20789
20790
  this.instantUpload = true;
20790
20791
  this.host.hasAttribute('name') || (this.name = 'avatar');
@@ -20815,7 +20816,9 @@ const SallaFileUpload = class {
20815
20816
  addedHandler(error, file) {
20816
20817
  this.added.emit({ error: error, file: file });
20817
20818
  //if the file passed on initiate will not have type
20819
+ this.host.querySelector('.filepond--root').classList.remove('s-file-upload-has-error');
20818
20820
  if (error || !file.file.type) {
20821
+ this.host.querySelector('.filepond--root').classList.add('s-file-upload-has-error');
20819
20822
  return;
20820
20823
  }
20821
20824
  let container = new DataTransfer;
@@ -24570,6 +24573,7 @@ const SallaSwiper = class {
24570
24573
  this.isEnd = false;
24571
24574
  this.isBeginning = true;
24572
24575
  this.isRTL = document.documentElement.dir === 'rtl';
24576
+ this.hasThumbSlot = false;
24573
24577
  this.pre_defined_config = {
24574
24578
  carousel: {
24575
24579
  speed: 300,
@@ -24730,6 +24734,7 @@ const SallaSwiper = class {
24730
24734
  salla.lang.onLoaded(() => {
24731
24735
  this.displayAllTitle = salla.lang.get('blocks.home.display_all');
24732
24736
  });
24737
+ this.hasThumbSlot = !!this.host.querySelector('[slot="thumbs"]');
24733
24738
  // if (this.enableCallToSlide) {
24734
24739
  // salla.event.on('product-options::goToSlide', data => {
24735
24740
  // const slideIndex = this.sliderWrapper.querySelector(`[data-img-id="${data}"]`).getAttribute('data-slid-index');
@@ -24886,14 +24891,14 @@ const SallaSwiper = class {
24886
24891
  : '', this.showControls ?
24887
24892
  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.isRTL ? 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.isRTL ? ArrowLeftIcon : ArrowRightIcon$1 })))
24888
24893
  : ''))
24889
- : '', index.h("div", { class: "swiper s-slider-container", ref: el => this.sliderContainer = el, dir: this.vertical ? "ltr" : '' }, 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' ? index.h("div", { class: "s-slider-thumbs" }, index.h("div", { class: "swiper s-slider-thumbs-container", dir: this.verticalThumbs ? "ltr" : '', ref: el => this.thumbsSliderContainer = el }, index.h("div", { class: "s-slider-swiper-wrapper swiper-wrapper", ref: el => this.thumbsSliderWrapper = el }, index.h("slot", { name: "thumbs" })), this.showThumbsControls ?
24894
+ : '', index.h("div", { class: "swiper s-slider-container", ref: el => this.sliderContainer = el, dir: this.vertical ? "ltr" : '' }, 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.verticalThumbs ? "ltr" : '', ref: el => this.thumbsSliderContainer = el }, index.h("div", { class: "s-slider-swiper-wrapper swiper-wrapper", ref: el => this.thumbsSliderWrapper = el }, index.h("slot", { name: "thumbs" })), this.showThumbsControls ?
24890
24895
  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.isRTL ? 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.isRTL ? ArrowLeftIcon : ArrowRightIcon$1 })))
24891
24896
  : '')) : ''));
24892
24897
  }
24893
24898
  componentDidLoad() {
24894
24899
  let itemsSlot = this.sliderWrapper.querySelector('div[slot="items"]');
24895
24900
  !!itemsSlot ? itemsSlot.replaceWith(...itemsSlot.children) : null;
24896
- if (this.type == 'thumbs') {
24901
+ if (this.type == 'thumbs' && this.hasThumbSlot) {
24897
24902
  let thumbsSlot = this.thumbsSliderWrapper.querySelector('div[slot="thumbs"]');
24898
24903
  !!thumbsSlot ? thumbsSlot.replaceWith(...thumbsSlot.children) : null;
24899
24904
  }
@@ -4,7 +4,7 @@
4
4
  'use strict';
5
5
 
6
6
  const index = require('./index-1d2b3370.js');
7
- const appGlobals = require('./app-globals-f49969d2.js');
7
+ const appGlobals = require('./app-globals-f18513f9.js');
8
8
  require('./_commonjsHelpers-691dd63b.js');
9
9
 
10
10
  /*
@@ -118,6 +118,7 @@ export class SallaFileUpload {
118
118
  this.instantUpload = true;
119
119
  }
120
120
  if (!this.url && this.profileImage) {
121
+ this.accept = 'image/png,image/jpeg,image/jpg';
121
122
  this.url = salla.url.api('profile/update');
122
123
  this.instantUpload = true;
123
124
  this.host.hasAttribute('name') || (this.name = 'avatar');
@@ -148,7 +149,9 @@ export class SallaFileUpload {
148
149
  addedHandler(error, file) {
149
150
  this.added.emit({ error: error, file: file });
150
151
  //if the file passed on initiate will not have type
152
+ this.host.querySelector('.filepond--root').classList.remove('s-file-upload-has-error');
151
153
  if (error || !file.file.type) {
154
+ this.host.querySelector('.filepond--root').classList.add('s-file-upload-has-error');
152
155
  return;
153
156
  }
154
157
  let container = new DataTransfer;
@@ -108,6 +108,7 @@ export class SallaSwiper {
108
108
  this.isEnd = false;
109
109
  this.isBeginning = true;
110
110
  this.isRTL = document.documentElement.dir === 'rtl';
111
+ this.hasThumbSlot = false;
111
112
  this.pre_defined_config = {
112
113
  carousel: {
113
114
  speed: 300,
@@ -268,6 +269,7 @@ export class SallaSwiper {
268
269
  salla.lang.onLoaded(() => {
269
270
  this.displayAllTitle = salla.lang.get('blocks.home.display_all');
270
271
  });
272
+ this.hasThumbSlot = !!this.host.querySelector('[slot="thumbs"]');
271
273
  // if (this.enableCallToSlide) {
272
274
  // salla.event.on('product-options::goToSlide', data => {
273
275
  // const slideIndex = this.sliderWrapper.querySelector(`[data-img-id="${data}"]`).getAttribute('data-slid-index');
@@ -441,7 +443,7 @@ export class SallaSwiper {
441
443
  h("div", { class: "swiper-wrapper s-slider-swiper-wrapper", ref: el => this.sliderWrapper = el },
442
444
  h("slot", { name: 'items' })),
443
445
  this.pagination ? h("div", { class: "swiper-pagination" }) : ''),
444
- this.type == 'thumbs' ? h("div", { class: "s-slider-thumbs" },
446
+ this.type == 'thumbs' && this.hasThumbSlot ? h("div", { class: "s-slider-thumbs" },
445
447
  h("div", { class: "swiper s-slider-thumbs-container", dir: this.verticalThumbs ? "ltr" : '', ref: el => this.thumbsSliderContainer = el },
446
448
  h("div", { class: "s-slider-swiper-wrapper swiper-wrapper", ref: el => this.thumbsSliderWrapper = el },
447
449
  h("slot", { name: "thumbs" })),
@@ -456,7 +458,7 @@ export class SallaSwiper {
456
458
  componentDidLoad() {
457
459
  let itemsSlot = this.sliderWrapper.querySelector('div[slot="items"]');
458
460
  !!itemsSlot ? itemsSlot.replaceWith(...itemsSlot.children) : null;
459
- if (this.type == 'thumbs') {
461
+ if (this.type == 'thumbs' && this.hasThumbSlot) {
460
462
  let thumbsSlot = this.thumbsSliderWrapper.querySelector('div[slot="thumbs"]');
461
463
  !!thumbsSlot ? thumbsSlot.replaceWith(...thumbsSlot.children) : null;
462
464
  }