@salla.sa/twilight-components 2.11.18 → 2.11.19
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/dist/cjs/{app-globals-f49969d2.js → app-globals-f18513f9.js} +39 -2232
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-button_37.cjs.entry.js +7 -2
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/collection/components/salla-file-upload/salla-file-upload.js +3 -0
- package/dist/collection/components/salla-slider/salla-slider.js +4 -2
- package/dist/components/index.js +39 -2232
- package/dist/components/salla-file-upload2.js +3 -0
- package/dist/components/salla-slider2.js +4 -2
- package/dist/esm/{app-globals-fc703675.js → app-globals-9127a6ae.js} +39 -2232
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button_37.entry.js +7 -2
- package/dist/esm/twilight.js +1 -1
- package/dist/esm-es5/app-globals-9127a6ae.js +24 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/salla-button_37.entry.js +4 -4
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-b34f9dfa.system.entry.js → p-1f8a386e.system.entry.js} +5 -5
- package/dist/twilight/{p-c71ec183.system.js → p-5fc3f873.system.js} +1 -1
- package/dist/twilight/p-a6b1a735.js +24 -0
- package/dist/twilight/p-d67689ce.entry.js +36 -0
- package/dist/twilight/p-dddd2139.system.js +24 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/components/salla-slider/salla-slider.d.ts +1 -0
- package/package.json +4 -4
- package/dist/esm-es5/app-globals-fc703675.js +0 -30
- package/dist/twilight/p-20a603e8.entry.js +0 -36
- package/dist/twilight/p-83516eab.js +0 -24
- package/dist/twilight/p-a2bd5187.system.js +0 -30
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -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-
|
|
9
|
+
const appGlobals = require('./app-globals-f18513f9.js');
|
|
10
10
|
require('./_commonjsHelpers-691dd63b.js');
|
|
11
11
|
|
|
12
12
|
/*
|
|
@@ -20815,7 +20815,9 @@ const SallaFileUpload = class {
|
|
|
20815
20815
|
addedHandler(error, file) {
|
|
20816
20816
|
this.added.emit({ error: error, file: file });
|
|
20817
20817
|
//if the file passed on initiate will not have type
|
|
20818
|
+
this.host.querySelector('.filepond--root').classList.remove('s-file-upload-has-error');
|
|
20818
20819
|
if (error || !file.file.type) {
|
|
20820
|
+
this.host.querySelector('.filepond--root').classList.add('s-file-upload-has-error');
|
|
20819
20821
|
return;
|
|
20820
20822
|
}
|
|
20821
20823
|
let container = new DataTransfer;
|
|
@@ -20903,6 +20905,7 @@ const SallaFileUpload = class {
|
|
|
20903
20905
|
} }, index.h("input", { type: "file", name: this.name, value: this.value, ref: ele => this.fileUploader = ele, required: this.required, class: "s-file-upload-wrapper s-file-upload-input", accept: this.accept })));
|
|
20904
20906
|
}
|
|
20905
20907
|
componentDidLoad() {
|
|
20908
|
+
console.log(this.accept);
|
|
20906
20909
|
let files = this.getFiles();
|
|
20907
20910
|
this.filepond = filepond.create(this.fileUploader, {
|
|
20908
20911
|
name: this.payloadName || this.name,
|
|
@@ -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
|
}
|
package/dist/cjs/twilight.cjs.js
CHANGED
|
@@ -148,7 +148,9 @@ export class SallaFileUpload {
|
|
|
148
148
|
addedHandler(error, file) {
|
|
149
149
|
this.added.emit({ error: error, file: file });
|
|
150
150
|
//if the file passed on initiate will not have type
|
|
151
|
+
this.host.querySelector('.filepond--root').classList.remove('s-file-upload-has-error');
|
|
151
152
|
if (error || !file.file.type) {
|
|
153
|
+
this.host.querySelector('.filepond--root').classList.add('s-file-upload-has-error');
|
|
152
154
|
return;
|
|
153
155
|
}
|
|
154
156
|
let container = new DataTransfer;
|
|
@@ -237,6 +239,7 @@ export class SallaFileUpload {
|
|
|
237
239
|
h("input", { type: "file", name: this.name, value: this.value, ref: ele => this.fileUploader = ele, required: this.required, class: "s-file-upload-wrapper s-file-upload-input", accept: this.accept })));
|
|
238
240
|
}
|
|
239
241
|
componentDidLoad() {
|
|
242
|
+
console.log(this.accept);
|
|
240
243
|
let files = this.getFiles();
|
|
241
244
|
this.filepond = FilePond.create(this.fileUploader, {
|
|
242
245
|
name: this.payloadName || this.name,
|
|
@@ -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
|
}
|