@everymatrix/general-slider 1.52.6 → 1.53.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/dist/cjs/general-slider.cjs.entry.js +10 -10
- package/dist/collection/components/general-slider/general-slider.css +3 -0
- package/dist/collection/components/general-slider/general-slider.js +9 -9
- package/dist/esm/general-slider.entry.js +10 -10
- package/dist/general-slider/general-slider.esm.js +1 -1
- package/dist/general-slider/p-89af433b.entry.js +1 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.d.ts +2 -0
- package/dist/types/Users/maria.bumbar/Desktop/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.dev.d.ts +2 -0
- package/package.json +1 -1
- package/dist/general-slider/p-150eaacc.entry.js +0 -1
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.d.ts +0 -2
- package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/general-slider/.stencil/packages/stencil/general-slider/stencil.config.dev.d.ts +0 -2
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-d1f313c2.js');
|
|
6
6
|
|
|
7
|
-
const generalSliderCss = ":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emw--color-contrast, #07072A);color:var(--emw--color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emw--color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emw--tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
|
|
7
|
+
const generalSliderCss = ":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}.SliderList.Static{transition-duration:0ms}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emw--color-contrast, #07072A);color:var(--emw--color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emw--color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emw--tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
|
|
8
8
|
const GeneralSliderStyle0 = generalSliderCss;
|
|
9
9
|
|
|
10
10
|
const GeneralSlider = class {
|
|
@@ -33,6 +33,7 @@ const GeneralSlider = class {
|
|
|
33
33
|
this.limitStylingAppends = false;
|
|
34
34
|
}
|
|
35
35
|
slide(next) {
|
|
36
|
+
this.sliderEl.classList.remove('Static');
|
|
36
37
|
let slideTo = 0;
|
|
37
38
|
if (next) {
|
|
38
39
|
slideTo = this.currentSlideNumber + this.slideNumber;
|
|
@@ -47,13 +48,14 @@ const GeneralSlider = class {
|
|
|
47
48
|
this.updateListStyle();
|
|
48
49
|
}
|
|
49
50
|
slideTo(page) {
|
|
51
|
+
this.sliderEl.classList.remove('Static');
|
|
50
52
|
this.currentSlideNumber = page * this.slideNumber;
|
|
51
53
|
this.currentPage = page;
|
|
52
54
|
this.updateListStyle();
|
|
53
55
|
}
|
|
54
56
|
updateControls() {
|
|
55
|
-
this.switchControl('Prev',
|
|
56
|
-
this.switchControl('Next',
|
|
57
|
+
this.switchControl('Prev', this.currentSlideNumber === 0 ? false : true);
|
|
58
|
+
this.switchControl('Next', this.currentSlideNumber === this.slidesCount - this.slideShow ? false : true);
|
|
57
59
|
}
|
|
58
60
|
switchControl(type, enabled) {
|
|
59
61
|
if (this.controls[type]) {
|
|
@@ -65,9 +67,6 @@ const GeneralSlider = class {
|
|
|
65
67
|
this.slideNumber = 1;
|
|
66
68
|
if (!this.slideShow)
|
|
67
69
|
this.slideShow = 1;
|
|
68
|
-
if (this.currentPage !== 0) {
|
|
69
|
-
this.slideTo(this.currentPage);
|
|
70
|
-
}
|
|
71
70
|
}
|
|
72
71
|
componentDidLoad() {
|
|
73
72
|
this.slides = this.slotEl.assignedElements();
|
|
@@ -85,6 +84,10 @@ const GeneralSlider = class {
|
|
|
85
84
|
this.setClientStylingURL();
|
|
86
85
|
this.limitStylingAppends = true;
|
|
87
86
|
}
|
|
87
|
+
if (this.currentPage !== 0) {
|
|
88
|
+
this.sliderEl.classList.add('Static');
|
|
89
|
+
this.currentSlideNumber = this.currentPage * this.slideNumber;
|
|
90
|
+
}
|
|
88
91
|
}
|
|
89
92
|
componentDidRender() {
|
|
90
93
|
if (this.slides)
|
|
@@ -148,7 +151,6 @@ const GeneralSlider = class {
|
|
|
148
151
|
this.setSlideAutoInterval();
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
|
-
;
|
|
152
154
|
setSlideAutoInterval() {
|
|
153
155
|
if (this.loopTime == 0) {
|
|
154
156
|
return;
|
|
@@ -199,9 +201,7 @@ const GeneralSlider = class {
|
|
|
199
201
|
});
|
|
200
202
|
}
|
|
201
203
|
render() {
|
|
202
|
-
return (index.h("div", { key: '
|
|
203
|
-
index.h("div", { key: '9346a66e8b64d27a128707e20eb2a36fea43741c', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => index.h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))), this.showArrow &&
|
|
204
|
-
index.h("div", { key: '559e1f4b1afd91f2290d5cf96e6a4ab2e3a4c3af', class: "ArrowButtons" }, index.h("button", { key: 'a2793999d32183b00de551ebe10e9a35480637ea', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), index.h("button", { key: 'b362f458df805531cafb933e1418fc9edac883a3', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<"))));
|
|
204
|
+
return (index.h("div", { key: '8f86541d4454387e01a54b26c0aa6515d47ddb4d', class: "GeneralSlider" }, index.h("div", { key: 'c3e606e98881afeb2b867a58b25f3e7aa3915808', class: "Slider" }, index.h("ul", { key: 'e764fb6ad7fe7a727b7c1f37b5fe26704f2cd390', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => (this.sliderEl = el) }, index.h("slot", { key: 'c61792d98ee4aefeb8fe8e84245eac495ff2f898', ref: (el) => (this.slotEl = el) }))), this.showButton && this.slidesCount > 0 && (index.h("div", { key: '35b1a666ec07535c2b70e8678aff70be5a2eff35', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => (index.h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))))), this.showArrow && (index.h("div", { key: '6e910a7d9013b49bc70160fdc8b193de0c1ee309', class: "ArrowButtons" }, index.h("button", { key: '1d21da8ede99b7ef0c1610334763d15d7a9640c7', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), index.h("button", { key: 'e890b5cb47ba744fb977e492235330f201129f09', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")))));
|
|
205
205
|
}
|
|
206
206
|
get el() { return index.getElement(this); }
|
|
207
207
|
};
|
|
@@ -24,6 +24,7 @@ export class GeneralSlider {
|
|
|
24
24
|
this.limitStylingAppends = false;
|
|
25
25
|
}
|
|
26
26
|
slide(next) {
|
|
27
|
+
this.sliderEl.classList.remove('Static');
|
|
27
28
|
let slideTo = 0;
|
|
28
29
|
if (next) {
|
|
29
30
|
slideTo = this.currentSlideNumber + this.slideNumber;
|
|
@@ -38,13 +39,14 @@ export class GeneralSlider {
|
|
|
38
39
|
this.updateListStyle();
|
|
39
40
|
}
|
|
40
41
|
slideTo(page) {
|
|
42
|
+
this.sliderEl.classList.remove('Static');
|
|
41
43
|
this.currentSlideNumber = page * this.slideNumber;
|
|
42
44
|
this.currentPage = page;
|
|
43
45
|
this.updateListStyle();
|
|
44
46
|
}
|
|
45
47
|
updateControls() {
|
|
46
|
-
this.switchControl('Prev',
|
|
47
|
-
this.switchControl('Next',
|
|
48
|
+
this.switchControl('Prev', this.currentSlideNumber === 0 ? false : true);
|
|
49
|
+
this.switchControl('Next', this.currentSlideNumber === this.slidesCount - this.slideShow ? false : true);
|
|
48
50
|
}
|
|
49
51
|
switchControl(type, enabled) {
|
|
50
52
|
if (this.controls[type]) {
|
|
@@ -56,9 +58,6 @@ export class GeneralSlider {
|
|
|
56
58
|
this.slideNumber = 1;
|
|
57
59
|
if (!this.slideShow)
|
|
58
60
|
this.slideShow = 1;
|
|
59
|
-
if (this.currentPage !== 0) {
|
|
60
|
-
this.slideTo(this.currentPage);
|
|
61
|
-
}
|
|
62
61
|
}
|
|
63
62
|
componentDidLoad() {
|
|
64
63
|
this.slides = this.slotEl.assignedElements();
|
|
@@ -76,6 +75,10 @@ export class GeneralSlider {
|
|
|
76
75
|
this.setClientStylingURL();
|
|
77
76
|
this.limitStylingAppends = true;
|
|
78
77
|
}
|
|
78
|
+
if (this.currentPage !== 0) {
|
|
79
|
+
this.sliderEl.classList.add('Static');
|
|
80
|
+
this.currentSlideNumber = this.currentPage * this.slideNumber;
|
|
81
|
+
}
|
|
79
82
|
}
|
|
80
83
|
componentDidRender() {
|
|
81
84
|
if (this.slides)
|
|
@@ -139,7 +142,6 @@ export class GeneralSlider {
|
|
|
139
142
|
this.setSlideAutoInterval();
|
|
140
143
|
}
|
|
141
144
|
}
|
|
142
|
-
;
|
|
143
145
|
setSlideAutoInterval() {
|
|
144
146
|
if (this.loopTime == 0) {
|
|
145
147
|
return;
|
|
@@ -190,9 +192,7 @@ export class GeneralSlider {
|
|
|
190
192
|
});
|
|
191
193
|
}
|
|
192
194
|
render() {
|
|
193
|
-
return (h("div", { key: '
|
|
194
|
-
h("div", { key: '9346a66e8b64d27a128707e20eb2a36fea43741c', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))), this.showArrow &&
|
|
195
|
-
h("div", { key: '559e1f4b1afd91f2290d5cf96e6a4ab2e3a4c3af', class: "ArrowButtons" }, h("button", { key: 'a2793999d32183b00de551ebe10e9a35480637ea', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { key: 'b362f458df805531cafb933e1418fc9edac883a3', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<"))));
|
|
195
|
+
return (h("div", { key: '8f86541d4454387e01a54b26c0aa6515d47ddb4d', class: "GeneralSlider" }, h("div", { key: 'c3e606e98881afeb2b867a58b25f3e7aa3915808', class: "Slider" }, h("ul", { key: 'e764fb6ad7fe7a727b7c1f37b5fe26704f2cd390', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => (this.sliderEl = el) }, h("slot", { key: 'c61792d98ee4aefeb8fe8e84245eac495ff2f898', ref: (el) => (this.slotEl = el) }))), this.showButton && this.slidesCount > 0 && (h("div", { key: '35b1a666ec07535c2b70e8678aff70be5a2eff35', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => (h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))))), this.showArrow && (h("div", { key: '6e910a7d9013b49bc70160fdc8b193de0c1ee309', class: "ArrowButtons" }, h("button", { key: '1d21da8ede99b7ef0c1610334763d15d7a9640c7', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { key: 'e890b5cb47ba744fb977e492235330f201129f09', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")))));
|
|
196
196
|
}
|
|
197
197
|
static get is() { return "general-slider"; }
|
|
198
198
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement } from './index-d5dd9b7c.js';
|
|
2
2
|
|
|
3
|
-
const generalSliderCss = ":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emw--color-contrast, #07072A);color:var(--emw--color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emw--color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emw--tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
|
|
3
|
+
const generalSliderCss = ":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}.SliderList.Static{transition-duration:0ms}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emw--color-contrast, #07072A);color:var(--emw--color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emw--color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emw--tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
|
|
4
4
|
const GeneralSliderStyle0 = generalSliderCss;
|
|
5
5
|
|
|
6
6
|
const GeneralSlider = class {
|
|
@@ -29,6 +29,7 @@ const GeneralSlider = class {
|
|
|
29
29
|
this.limitStylingAppends = false;
|
|
30
30
|
}
|
|
31
31
|
slide(next) {
|
|
32
|
+
this.sliderEl.classList.remove('Static');
|
|
32
33
|
let slideTo = 0;
|
|
33
34
|
if (next) {
|
|
34
35
|
slideTo = this.currentSlideNumber + this.slideNumber;
|
|
@@ -43,13 +44,14 @@ const GeneralSlider = class {
|
|
|
43
44
|
this.updateListStyle();
|
|
44
45
|
}
|
|
45
46
|
slideTo(page) {
|
|
47
|
+
this.sliderEl.classList.remove('Static');
|
|
46
48
|
this.currentSlideNumber = page * this.slideNumber;
|
|
47
49
|
this.currentPage = page;
|
|
48
50
|
this.updateListStyle();
|
|
49
51
|
}
|
|
50
52
|
updateControls() {
|
|
51
|
-
this.switchControl('Prev',
|
|
52
|
-
this.switchControl('Next',
|
|
53
|
+
this.switchControl('Prev', this.currentSlideNumber === 0 ? false : true);
|
|
54
|
+
this.switchControl('Next', this.currentSlideNumber === this.slidesCount - this.slideShow ? false : true);
|
|
53
55
|
}
|
|
54
56
|
switchControl(type, enabled) {
|
|
55
57
|
if (this.controls[type]) {
|
|
@@ -61,9 +63,6 @@ const GeneralSlider = class {
|
|
|
61
63
|
this.slideNumber = 1;
|
|
62
64
|
if (!this.slideShow)
|
|
63
65
|
this.slideShow = 1;
|
|
64
|
-
if (this.currentPage !== 0) {
|
|
65
|
-
this.slideTo(this.currentPage);
|
|
66
|
-
}
|
|
67
66
|
}
|
|
68
67
|
componentDidLoad() {
|
|
69
68
|
this.slides = this.slotEl.assignedElements();
|
|
@@ -81,6 +80,10 @@ const GeneralSlider = class {
|
|
|
81
80
|
this.setClientStylingURL();
|
|
82
81
|
this.limitStylingAppends = true;
|
|
83
82
|
}
|
|
83
|
+
if (this.currentPage !== 0) {
|
|
84
|
+
this.sliderEl.classList.add('Static');
|
|
85
|
+
this.currentSlideNumber = this.currentPage * this.slideNumber;
|
|
86
|
+
}
|
|
84
87
|
}
|
|
85
88
|
componentDidRender() {
|
|
86
89
|
if (this.slides)
|
|
@@ -144,7 +147,6 @@ const GeneralSlider = class {
|
|
|
144
147
|
this.setSlideAutoInterval();
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
|
-
;
|
|
148
150
|
setSlideAutoInterval() {
|
|
149
151
|
if (this.loopTime == 0) {
|
|
150
152
|
return;
|
|
@@ -195,9 +197,7 @@ const GeneralSlider = class {
|
|
|
195
197
|
});
|
|
196
198
|
}
|
|
197
199
|
render() {
|
|
198
|
-
return (h("div", { key: '
|
|
199
|
-
h("div", { key: '9346a66e8b64d27a128707e20eb2a36fea43741c', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))), this.showArrow &&
|
|
200
|
-
h("div", { key: '559e1f4b1afd91f2290d5cf96e6a4ab2e3a4c3af', class: "ArrowButtons" }, h("button", { key: 'a2793999d32183b00de551ebe10e9a35480637ea', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { key: 'b362f458df805531cafb933e1418fc9edac883a3', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<"))));
|
|
200
|
+
return (h("div", { key: '8f86541d4454387e01a54b26c0aa6515d47ddb4d', class: "GeneralSlider" }, h("div", { key: 'c3e606e98881afeb2b867a58b25f3e7aa3915808', class: "Slider" }, h("ul", { key: 'e764fb6ad7fe7a727b7c1f37b5fe26704f2cd390', class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => (this.sliderEl = el) }, h("slot", { key: 'c61792d98ee4aefeb8fe8e84245eac495ff2f898', ref: (el) => (this.slotEl = el) }))), this.showButton && this.slidesCount > 0 && (h("div", { key: '35b1a666ec07535c2b70e8678aff70be5a2eff35', class: "PageButtons", part: "PageButtons" }, [...Array(this.slidesCount / this.slideNumber)].map((_x, i) => (h("div", { class: `PageButton ${this.currentPage == i ? 'active' : ''}`, title: `page${i}`, onClick: this.slideTo.bind(this, i), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "\u00A0"))))), this.showArrow && (h("div", { key: '6e910a7d9013b49bc70160fdc8b193de0c1ee309', class: "ArrowButtons" }, h("button", { key: '1d21da8ede99b7ef0c1610334763d15d7a9640c7', type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"), h("button", { key: 'e890b5cb47ba744fb977e492235330f201129f09', type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")))));
|
|
201
201
|
}
|
|
202
202
|
get el() { return getElement(this); }
|
|
203
203
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-825871b1.js";export{s as setNonce}from"./p-825871b1.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-
|
|
1
|
+
import{p as e,b as t}from"./p-825871b1.js";export{s as setNonce}from"./p-825871b1.js";import{g as i}from"./p-e1255160.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((async e=>(await i(),t([["p-89af433b",[[1,"general-slider",{slideNumber:[2,"slide-number"],slideShow:[2,"slide-show"],showArrow:[4,"show-arrow"],showButton:[4,"show-button"],autoSlide:[4,"auto-slide"],loopTime:[2,"loop-time"],autoItemHeight:[4,"auto-item-height"],clientStyling:[1,"client-styling"],clientStylingUrl:[1,"client-styling-url"],currentPage:[2,"current-page"],currentSlideNumber:[32],slidesCount:[32],limitStylingAppends:[32]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,g as s}from"./p-825871b1.js";const e=class{constructor(i){t(this,i),this.slides=null,this.slideWidth=0,this.controls={Prev:null,Next:null},this.xDown=null,this.yDown=null,this.slideNumber=3,this.slideShow=3,this.showArrow=!0,this.showButton=!1,this.autoSlide=!1,this.loopTime=1,this.autoItemHeight=!1,this.clientStyling="",this.clientStylingUrl="",this.currentPage=0,this.currentSlideNumber=0,this.slidesCount=0,this.limitStylingAppends=!1}slide(t){this.sliderEl.classList.remove("Static");let i=0;i=t?this.currentSlideNumber+this.slideNumber:this.currentSlideNumber-this.slideNumber,i<0||i>=this.slidesCount||(this.currentSlideNumber=i,this.currentPage=this.currentSlideNumber/this.slideNumber,this.updateListStyle())}slideTo(t){this.sliderEl.classList.remove("Static"),this.currentSlideNumber=t*this.slideNumber,this.currentPage=t,this.updateListStyle()}updateControls(){this.switchControl("Prev",0!==this.currentSlideNumber),this.switchControl("Next",this.currentSlideNumber!==this.slidesCount-this.slideShow)}switchControl(t,i){this.controls[t]&&(this.controls[t].disabled=!i)}componentWillLoad(){this.slideNumber||(this.slideNumber=1),this.slideShow||(this.slideShow=1)}componentDidLoad(){this.slides=this.slotEl.assignedElements(),this.slidesCount=this.slides.length;for(let t in this.controls)this.controls[t]=this.el.shadowRoot.querySelector(".Button"+t);this.autoSlide&&this.setSlideAutoInterval(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0),0!==this.currentPage&&(this.sliderEl.classList.add("Static"),this.currentSlideNumber=this.currentPage*this.slideNumber)}componentDidRender(){this.slides&&(this.slideWidth=this.slides[0].offsetWidth),this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.updateListStyle(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}updateListStyle(){this.autoItemHeight&&null!==this.slides&&this.slides.forEach(((t,i)=>{i>=this.currentPage*this.slideNumber&&i<(this.currentPage+1)*this.slideNumber?t.classList.remove("hide"):t.classList.add("hide")}))}disconnectedCallback(){this.el.removeEventListener("touchstart",this.handleTouchStart),this.el.removeEventListener("touchmove",this.handleTouchMove)}handleTouchStart(t){const i=this.getTouches(t)[0];this.xDown=i.clientX,this.yDown=i.clientY,clearInterval(this.sliderInterval)}getTouches(t){return t.touches||t.originalEvent.touches}handleTouchMove(t){if(!this.xDown||!this.yDown)return;let i=this.xDown-t.touches[0].clientX,s=this.yDown-t.touches[0].clientY;Math.abs(i)>Math.abs(s)&&this.slide(i>0),this.xDown=null,this.yDown=null,this.autoSlide&&this.setSlideAutoInterval()}setSlideAutoInterval(){0!=this.loopTime&&(clearInterval(this.sliderInterval),this.sliderInterval=setInterval((()=>{this.slideTo(this.currentPage+1<this.slidesCount/this.slideNumber?this.currentPage+1:0)}),1e3*Number(this.loopTime)))}componentDidUpdate(){this.sliderEl.style.transform=`translateX(${this.currentSlideNumber*this.slideWidth*-1}px)`,this.updateControls()}switchLoopStatus(t){this.autoSlide&&this.loopTime>0&&(t?clearInterval(this.sliderInterval):this.setSlideAutoInterval())}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"8f86541d4454387e01a54b26c0aa6515d47ddb4d",class:"GeneralSlider"},i("div",{key:"c3e606e98881afeb2b867a58b25f3e7aa3915808",class:"Slider"},i("ul",{key:"e764fb6ad7fe7a727b7c1f37b5fe26704f2cd390",class:`SliderList Col-${this.slideShow}`,part:"SliderList",onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1),ref:t=>this.sliderEl=t},i("slot",{key:"c61792d98ee4aefeb8fe8e84245eac495ff2f898",ref:t=>this.slotEl=t}))),this.showButton&&this.slidesCount>0&&i("div",{key:"35b1a666ec07535c2b70e8678aff70be5a2eff35",class:"PageButtons",part:"PageButtons"},[...Array(this.slidesCount/this.slideNumber)].map(((t,s)=>i("div",{class:"PageButton "+(this.currentPage==s?"active":""),title:`page${s}`,onClick:this.slideTo.bind(this,s),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)}," ")))),this.showArrow&&i("div",{key:"6e910a7d9013b49bc70160fdc8b193de0c1ee309",class:"ArrowButtons"},i("button",{key:"1d21da8ede99b7ef0c1610334763d15d7a9640c7",type:"button",class:"Button ButtonNext",onClick:this.slide.bind(this,!0),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},">"),i("button",{key:"e890b5cb47ba744fb977e492235330f201129f09",type:"button",class:"Button ButtonPrev",onClick:this.slide.bind(this,!1),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},"<")))}get el(){return s(this)}};e.style=":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}.SliderList.Static{transition-duration:0ms}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emw--color-contrast, #07072A);color:var(--emw--color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emw--color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emw--tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";export{e as general_slider}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,g as s}from"./p-825871b1.js";const e=class{constructor(i){t(this,i),this.slides=null,this.slideWidth=0,this.controls={Prev:null,Next:null},this.xDown=null,this.yDown=null,this.slideNumber=3,this.slideShow=3,this.showArrow=!0,this.showButton=!1,this.autoSlide=!1,this.loopTime=1,this.autoItemHeight=!1,this.clientStyling="",this.clientStylingUrl="",this.currentPage=0,this.currentSlideNumber=0,this.slidesCount=0,this.limitStylingAppends=!1}slide(t){let i=0;i=t?this.currentSlideNumber+this.slideNumber:this.currentSlideNumber-this.slideNumber,i<0||i>=this.slidesCount||(this.currentSlideNumber=i,this.currentPage=this.currentSlideNumber/this.slideNumber,this.updateListStyle())}slideTo(t){this.currentSlideNumber=t*this.slideNumber,this.currentPage=t,this.updateListStyle()}updateControls(){this.switchControl("Prev",0!==this.currentSlideNumber),this.switchControl("Next",this.currentSlideNumber!==this.slidesCount-this.slideShow)}switchControl(t,i){this.controls[t]&&(this.controls[t].disabled=!i)}componentWillLoad(){this.slideNumber||(this.slideNumber=1),this.slideShow||(this.slideShow=1),0!==this.currentPage&&this.slideTo(this.currentPage)}componentDidLoad(){this.slides=this.slotEl.assignedElements(),this.slidesCount=this.slides.length;for(let t in this.controls)this.controls[t]=this.el.shadowRoot.querySelector(".Button"+t);this.autoSlide&&this.setSlideAutoInterval(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}componentDidRender(){this.slides&&(this.slideWidth=this.slides[0].offsetWidth),this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.updateListStyle(),!this.limitStylingAppends&&this.el.shadowRoot&&(this.clientStyling&&this.setClientStyling(),this.clientStylingUrl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}updateListStyle(){this.autoItemHeight&&null!==this.slides&&this.slides.forEach(((t,i)=>{i>=this.currentPage*this.slideNumber&&i<(this.currentPage+1)*this.slideNumber?t.classList.remove("hide"):t.classList.add("hide")}))}disconnectedCallback(){this.el.removeEventListener("touchstart",this.handleTouchStart),this.el.removeEventListener("touchmove",this.handleTouchMove)}handleTouchStart(t){const i=this.getTouches(t)[0];this.xDown=i.clientX,this.yDown=i.clientY,clearInterval(this.sliderInterval)}getTouches(t){return t.touches||t.originalEvent.touches}handleTouchMove(t){if(!this.xDown||!this.yDown)return;let i=this.xDown-t.touches[0].clientX,s=this.yDown-t.touches[0].clientY;Math.abs(i)>Math.abs(s)&&this.slide(i>0),this.xDown=null,this.yDown=null,this.autoSlide&&this.setSlideAutoInterval()}setSlideAutoInterval(){0!=this.loopTime&&(clearInterval(this.sliderInterval),this.sliderInterval=setInterval((()=>{this.slideTo(this.currentPage+1<this.slidesCount/this.slideNumber?this.currentPage+1:0)}),1e3*Number(this.loopTime)))}componentDidUpdate(){this.sliderEl.style.transform=`translateX(${this.currentSlideNumber*this.slideWidth*-1}px)`,this.updateControls()}switchLoopStatus(t){this.autoSlide&&this.loopTime>0&&(t?clearInterval(this.sliderInterval):this.setSlideAutoInterval())}setClientStyling(){const t=new CSSStyleSheet;t.replace(this.clientStyling),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,t]}setClientStylingURL(){let t=new URL(this.clientStylingUrl);fetch(t.href).then((t=>t.text())).then((t=>{const i=new CSSStyleSheet;i.replace(t),this.el.shadowRoot.adoptedStyleSheets=[...this.el.shadowRoot.adoptedStyleSheets,i]}))}render(){return i("div",{key:"3a78acee0094c90ebb20c7e8435088b7b2019f9f",class:"GeneralSlider"},i("div",{key:"fbf26d5ab557a209fb9cacc5823f74690b211967",class:"Slider"},i("ul",{key:"8a4dd8156eff50ec96960026e43721db41b80628",class:`SliderList Col-${this.slideShow}`,part:"SliderList",onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1),ref:t=>this.sliderEl=t},i("slot",{key:"a8bf872b513d03fb0bf171c76183673cda291456",ref:t=>this.slotEl=t}))),this.showButton&&this.slidesCount>0&&i("div",{key:"9346a66e8b64d27a128707e20eb2a36fea43741c",class:"PageButtons",part:"PageButtons"},[...Array(this.slidesCount/this.slideNumber)].map(((t,s)=>i("div",{class:"PageButton "+(this.currentPage==s?"active":""),title:`page${s}`,onClick:this.slideTo.bind(this,s),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)}," ")))),this.showArrow&&i("div",{key:"559e1f4b1afd91f2290d5cf96e6a4ab2e3a4c3af",class:"ArrowButtons"},i("button",{key:"a2793999d32183b00de551ebe10e9a35480637ea",type:"button",class:"Button ButtonNext",onClick:this.slide.bind(this,!0),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},">"),i("button",{key:"b362f458df805531cafb933e1418fc9edac883a3",type:"button",class:"Button ButtonPrev",onClick:this.slide.bind(this,!1),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},"<")))}get el(){return s(this)}};e.style=":host{display:block}.GeneralSlider{position:relative}.Slider{position:relative;width:100%;margin:0 auto;overflow:hidden}.SliderList{display:flex;margin:0;padding:0;list-style:none;transition:transform 0.5s ease-in-out}::slotted(li){flex:1 0 auto;width:100%;margin:auto}::slotted(li.hide){visibility:hidden;height:0;transition-delay:500ms}.Col-2 ::slotted(li){flex:2 0 auto;width:50%}.Col-3 ::slotted(li){flex:3 0 auto;width:33.3333333333%}.Col-4 ::slotted(li){flex:4 0 auto;width:25%}.Col-5 ::slotted(li){flex:5 0 auto;width:20%}.Col-6 ::slotted(li){flex:6 0 auto;width:16.6666666667%}.Col-7 ::slotted(li){flex:7 0 auto;width:14.2857142857%}.Col-8 ::slotted(li){flex:8 0 auto;width:12.5%}.Col-9 ::slotted(li){flex:9 0 auto;width:11.1111111111%}.Col-10 ::slotted(li){flex:10 0 auto;width:10%}.Col-11 ::slotted(li){flex:11 0 auto;width:9.0909090909%}.Col-12 ::slotted(li){flex:12 0 auto;width:8.3333333333%}.Button{position:absolute;z-index:1;top:calc(50% - 32px);padding:20px;font-size:20px;line-height:20px;opacity:0.5;border:none;background:var(--emw--color-contrast, #07072A);color:var(--emw--color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emw--color-gray-150, #828282);opacity:0.25}.Button.ButtonNext{right:0}.PageButtons{display:flex;gap:4px;margin-top:8px}.PageButton{width:15px;height:4px;border-radius:4px;background-color:var(--emw--tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";export{e as general_slider}
|