@salla.sa/twilight-components 2.11.23 → 2.11.25

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.
@@ -20852,7 +20852,13 @@ const SallaFileUpload = class {
20852
20852
  this.filepond[key] = value;
20853
20853
  }
20854
20854
  getLabel() {
20855
- return this.labelIdle || `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
20855
+ if (this.labelIdle) {
20856
+ //some times we are passing label before translations is loaded, so here we will make sure that all translations are translated
20857
+ return this.labelIdle
20858
+ .replace('common.uploader.drag_and_drop', salla.lang.get('common.uploader.drag_and_drop'))
20859
+ .replace('common.uploader.browse', salla.lang.get('common.uploader.browse'));
20860
+ }
20861
+ return `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
20856
20862
  }
20857
20863
  /**
20858
20864
  *
@@ -24809,7 +24815,7 @@ const SallaSwiper = class {
24809
24815
  releaseOnEdges: this.host.querySelectorAll('.swiper-slide').length > 1 ? false : true
24810
24816
  },
24811
24817
  pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), (this.pre_defined_config[this.type] || {}));
24812
- if (this.type == 'thumbs') {
24818
+ if (this.type == 'thumbs' && this.thumbsSliderWrapper) {
24813
24819
  for (const slide of this.thumbsSliderWrapper.children) {
24814
24820
  //todo:: use `s-slider-slide`
24815
24821
  slide.classList.add('swiper-slide');
@@ -185,7 +185,13 @@ export class SallaFileUpload {
185
185
  this.filepond[key] = value;
186
186
  }
187
187
  getLabel() {
188
- return this.labelIdle || `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
188
+ if (this.labelIdle) {
189
+ //some times we are passing label before translations is loaded, so here we will make sure that all translations are translated
190
+ return this.labelIdle
191
+ .replace('common.uploader.drag_and_drop', salla.lang.get('common.uploader.drag_and_drop'))
192
+ .replace('common.uploader.browse', salla.lang.get('common.uploader.browse'));
193
+ }
194
+ return `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
189
195
  }
190
196
  /**
191
197
  *
@@ -345,7 +345,7 @@ export class SallaSwiper {
345
345
  releaseOnEdges: this.host.querySelectorAll('.swiper-slide').length > 1 ? false : true
346
346
  },
347
347
  pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), (this.pre_defined_config[this.type] || {}));
348
- if (this.type == 'thumbs') {
348
+ if (this.type == 'thumbs' && this.thumbsSliderWrapper) {
349
349
  for (const slide of this.thumbsSliderWrapper.children) {
350
350
  //todo:: use `s-slider-slide`
351
351
  slide.classList.add('swiper-slide');
@@ -15286,7 +15286,13 @@ const SallaFileUpload = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
15286
15286
  this.filepond[key] = value;
15287
15287
  }
15288
15288
  getLabel() {
15289
- return this.labelIdle || `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
15289
+ if (this.labelIdle) {
15290
+ //some times we are passing label before translations is loaded, so here we will make sure that all translations are translated
15291
+ return this.labelIdle
15292
+ .replace('common.uploader.drag_and_drop', salla.lang.get('common.uploader.drag_and_drop'))
15293
+ .replace('common.uploader.browse', salla.lang.get('common.uploader.browse'));
15294
+ }
15295
+ return `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
15290
15296
  }
15291
15297
  /**
15292
15298
  *
@@ -367,7 +367,7 @@ const SallaSwiper = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
367
367
  releaseOnEdges: this.host.querySelectorAll('.swiper-slide').length > 1 ? false : true
368
368
  },
369
369
  pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), (this.pre_defined_config[this.type] || {}));
370
- if (this.type == 'thumbs') {
370
+ if (this.type == 'thumbs' && this.thumbsSliderWrapper) {
371
371
  for (const slide of this.thumbsSliderWrapper.children) {
372
372
  //todo:: use `s-slider-slide`
373
373
  slide.classList.add('swiper-slide');
@@ -20848,7 +20848,13 @@ const SallaFileUpload = class {
20848
20848
  this.filepond[key] = value;
20849
20849
  }
20850
20850
  getLabel() {
20851
- return this.labelIdle || `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
20851
+ if (this.labelIdle) {
20852
+ //some times we are passing label before translations is loaded, so here we will make sure that all translations are translated
20853
+ return this.labelIdle
20854
+ .replace('common.uploader.drag_and_drop', salla.lang.get('common.uploader.drag_and_drop'))
20855
+ .replace('common.uploader.browse', salla.lang.get('common.uploader.browse'));
20856
+ }
20857
+ return `${salla.lang.get('common.uploader.drag_and_drop')}<span class="filepond--label-action"> ${salla.lang.get('common.uploader.browse')} </span>`;
20852
20858
  }
20853
20859
  /**
20854
20860
  *
@@ -24805,7 +24811,7 @@ const SallaSwiper = class {
24805
24811
  releaseOnEdges: this.host.querySelectorAll('.swiper-slide').length > 1 ? false : true
24806
24812
  },
24807
24813
  pre_defined_config = Object.assign(Object.assign({}, pre_defined_config), (this.pre_defined_config[this.type] || {}));
24808
- if (this.type == 'thumbs') {
24814
+ if (this.type == 'thumbs' && this.thumbsSliderWrapper) {
24809
24815
  for (const slide of this.thumbsSliderWrapper.children) {
24810
24816
  //todo:: use `s-slider-slide`
24811
24817
  slide.classList.add('swiper-slide');