@everymatrix/general-slider 1.29.1 → 1.29.4
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 +77 -12
- package/dist/cjs/general-slider.cjs.js +2 -2
- package/dist/cjs/{index-86ebe85a.js → index-813e9dd4.js} +18 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/general-slider/general-slider.js +123 -38
- package/dist/components/general-slider.js +81 -13
- package/dist/esm/general-slider.entry.js +77 -12
- package/dist/esm/general-slider.js +2 -2
- package/dist/esm/{index-d8114a95.js → index-3bef6f6d.js} +18 -0
- package/dist/esm/loader.js +2 -2
- package/dist/general-slider/general-slider.esm.js +1 -1
- package/dist/general-slider/p-1d97b302.js +1 -0
- package/dist/general-slider/p-20e28994.entry.js +1 -0
- package/dist/types/components/general-slider/general-slider.d.ts +35 -3
- package/dist/types/components.d.ts +58 -2
- package/package.json +4 -1
- package/dist/general-slider/p-3899d032.entry.js +0 -1
- package/dist/general-slider/p-95e8d88b.js +0 -1
|
@@ -2,23 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-813e9dd4.js');
|
|
6
6
|
|
|
7
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(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-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(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
|
|
8
8
|
|
|
9
9
|
const GeneralSlider = class {
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Slide Count
|
|
14
|
+
*/
|
|
13
15
|
this.slideNumber = 3;
|
|
16
|
+
/**
|
|
17
|
+
* Slides to show
|
|
18
|
+
*/
|
|
14
19
|
this.slideShow = 3;
|
|
20
|
+
/**
|
|
21
|
+
* Display the arrow icon
|
|
22
|
+
*/
|
|
15
23
|
this.showArrow = true;
|
|
24
|
+
/**
|
|
25
|
+
* Display the button
|
|
26
|
+
*/
|
|
16
27
|
this.showButton = false;
|
|
28
|
+
/**
|
|
29
|
+
* Auto Slide
|
|
30
|
+
*/
|
|
17
31
|
this.autoSlide = false;
|
|
32
|
+
/**
|
|
33
|
+
* Auto Slide loop time
|
|
34
|
+
*/
|
|
18
35
|
this.loopTime = 1;
|
|
36
|
+
/**
|
|
37
|
+
* Auto fill the Item height
|
|
38
|
+
*/
|
|
19
39
|
this.autoItemHeight = false;
|
|
40
|
+
/**
|
|
41
|
+
* Client custom styling via inline styles
|
|
42
|
+
*/
|
|
43
|
+
this.clientStyling = '';
|
|
44
|
+
/**
|
|
45
|
+
* Client custom styling via url
|
|
46
|
+
*/
|
|
47
|
+
this.clientStylingUrl = '';
|
|
20
48
|
this.currentSlideNumber = 0;
|
|
21
49
|
this.slidesCount = 0;
|
|
50
|
+
this.limitStylingAppends = false;
|
|
51
|
+
this.slides = null;
|
|
22
52
|
this.slideWidth = 0;
|
|
23
53
|
this.currentPage = 0;
|
|
24
54
|
this.controls = {
|
|
@@ -57,38 +87,54 @@ const GeneralSlider = class {
|
|
|
57
87
|
}
|
|
58
88
|
}
|
|
59
89
|
componentWillLoad() {
|
|
60
|
-
this.slides = this.el.querySelectorAll('li');
|
|
61
|
-
this.slidesCount = this.slides.length;
|
|
62
90
|
if (!this.slideNumber)
|
|
63
91
|
this.slideNumber = 1;
|
|
64
92
|
if (!this.slideShow)
|
|
65
93
|
this.slideShow = 1;
|
|
66
94
|
}
|
|
67
95
|
componentDidLoad() {
|
|
68
|
-
this.
|
|
69
|
-
this.
|
|
96
|
+
this.slides = this.slotEl.assignedElements();
|
|
97
|
+
this.slidesCount = this.slides.length;
|
|
70
98
|
for (let type in this.controls) {
|
|
71
99
|
this.controls[type] = this.el.shadowRoot.querySelector('.Button' + type);
|
|
72
100
|
}
|
|
73
|
-
this.updateControls();
|
|
74
101
|
if (this.autoSlide) {
|
|
75
102
|
this.setSlideAutoInterval();
|
|
76
103
|
}
|
|
104
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
105
|
+
if (this.clientStyling)
|
|
106
|
+
this.setClientStyling();
|
|
107
|
+
if (this.clientStylingUrl)
|
|
108
|
+
this.setClientStylingURL();
|
|
109
|
+
this.limitStylingAppends = true;
|
|
110
|
+
}
|
|
77
111
|
}
|
|
78
112
|
componentDidRender() {
|
|
113
|
+
if (this.slides)
|
|
114
|
+
this.slideWidth = this.slides[0].offsetWidth;
|
|
79
115
|
this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
|
|
80
116
|
this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
|
|
81
117
|
this.updateListStyle();
|
|
118
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
119
|
+
if (this.clientStyling)
|
|
120
|
+
this.setClientStyling();
|
|
121
|
+
if (this.clientStylingUrl)
|
|
122
|
+
this.setClientStylingURL();
|
|
123
|
+
this.limitStylingAppends = true;
|
|
124
|
+
}
|
|
82
125
|
}
|
|
83
126
|
updateListStyle() {
|
|
84
127
|
if (!this.autoItemHeight)
|
|
85
128
|
return;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
129
|
+
if (this.slides === null)
|
|
130
|
+
return;
|
|
131
|
+
this.slides.forEach((li, index) => {
|
|
89
132
|
if (index >= this.currentPage * this.slideNumber && index < (this.currentPage + 1) * this.slideNumber) {
|
|
90
133
|
li.classList.remove('hide');
|
|
91
134
|
}
|
|
135
|
+
else {
|
|
136
|
+
li.classList.add('hide');
|
|
137
|
+
}
|
|
92
138
|
});
|
|
93
139
|
}
|
|
94
140
|
disconnectedCallback() {
|
|
@@ -141,7 +187,7 @@ const GeneralSlider = class {
|
|
|
141
187
|
}, Number(this.loopTime) * 1000);
|
|
142
188
|
}
|
|
143
189
|
componentDidUpdate() {
|
|
144
|
-
this.
|
|
190
|
+
this.sliderEl.style.transform = `translateX(${this.currentSlideNumber * this.slideWidth * -1}px)`;
|
|
145
191
|
this.updateControls();
|
|
146
192
|
}
|
|
147
193
|
switchLoopStatus(isMouseMoveEnter) {
|
|
@@ -156,9 +202,28 @@ const GeneralSlider = class {
|
|
|
156
202
|
}
|
|
157
203
|
}
|
|
158
204
|
}
|
|
205
|
+
setClientStyling() {
|
|
206
|
+
const sheet = new CSSStyleSheet();
|
|
207
|
+
// @ts-ignore
|
|
208
|
+
sheet.replace(this.clientStyling);
|
|
209
|
+
// @ts-ignore
|
|
210
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
211
|
+
}
|
|
212
|
+
setClientStylingURL() {
|
|
213
|
+
let url = new URL(this.clientStylingUrl);
|
|
214
|
+
fetch(url.href)
|
|
215
|
+
.then((res) => res.text())
|
|
216
|
+
.then((data) => {
|
|
217
|
+
const sheet = new CSSStyleSheet();
|
|
218
|
+
// @ts-ignore
|
|
219
|
+
sheet.replace(data);
|
|
220
|
+
// @ts-ignore
|
|
221
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
222
|
+
});
|
|
223
|
+
}
|
|
159
224
|
render() {
|
|
160
225
|
return (index.h("div", { class: "GeneralSlider" }, index.h("div", { class: "Slider" }, this.showArrow &&
|
|
161
|
-
index.h("div", null, index.h("button", { 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", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), index.h("ul", { class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, index.h("slot",
|
|
226
|
+
index.h("div", null, index.h("button", { 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", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), index.h("ul", { 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", { ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
|
|
162
227
|
index.h("div", { 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")))));
|
|
163
228
|
}
|
|
164
229
|
get el() { return index.getElement(this); }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-813e9dd4.js');
|
|
4
4
|
|
|
5
5
|
/*
|
|
6
6
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["general-slider.cjs",[[1,"general-slider",{"
|
|
18
|
+
return index.bootstrapLazy([["general-slider.cjs",[[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"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
|
|
19
19
|
});
|
|
@@ -234,6 +234,12 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
234
234
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
235
235
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
236
236
|
}
|
|
237
|
+
else if (memberName === 'ref') {
|
|
238
|
+
// minifier will clean this up
|
|
239
|
+
if (newValue) {
|
|
240
|
+
newValue(elm);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
237
243
|
else if ((!isProp ) &&
|
|
238
244
|
memberName[0] === 'o' &&
|
|
239
245
|
memberName[1] === 'n') {
|
|
@@ -390,6 +396,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
390
396
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
391
397
|
if ((vnode = vnodes[startIdx])) {
|
|
392
398
|
elm = vnode.$elm$;
|
|
399
|
+
callNodeRefs(vnode);
|
|
393
400
|
// remove the vnode's element from the dom
|
|
394
401
|
elm.remove();
|
|
395
402
|
}
|
|
@@ -511,6 +518,12 @@ const patch = (oldVNode, newVNode) => {
|
|
|
511
518
|
elm.data = text;
|
|
512
519
|
}
|
|
513
520
|
};
|
|
521
|
+
const callNodeRefs = (vNode) => {
|
|
522
|
+
{
|
|
523
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
524
|
+
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
525
|
+
}
|
|
526
|
+
};
|
|
514
527
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
515
528
|
const hostElm = hostRef.$hostElement$;
|
|
516
529
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -738,6 +751,11 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
738
751
|
// force it to be a number
|
|
739
752
|
return parseFloat(propValue);
|
|
740
753
|
}
|
|
754
|
+
if (propType & 1 /* String */) {
|
|
755
|
+
// could have been passed as a number or boolean
|
|
756
|
+
// but we still want it as a string
|
|
757
|
+
return String(propValue);
|
|
758
|
+
}
|
|
741
759
|
// redundant return here for better minification
|
|
742
760
|
return propValue;
|
|
743
761
|
}
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-813e9dd4.js');
|
|
6
6
|
|
|
7
7
|
/*
|
|
8
8
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["general-slider.cjs",[[1,"general-slider",{"
|
|
17
|
+
return index.bootstrapLazy([["general-slider.cjs",[[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"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,16 +1,46 @@
|
|
|
1
1
|
import { Component, Prop, h, Element, State } from '@stencil/core';
|
|
2
2
|
export class GeneralSlider {
|
|
3
3
|
constructor() {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Slide Count
|
|
6
|
+
*/
|
|
5
7
|
this.slideNumber = 3;
|
|
8
|
+
/**
|
|
9
|
+
* Slides to show
|
|
10
|
+
*/
|
|
6
11
|
this.slideShow = 3;
|
|
12
|
+
/**
|
|
13
|
+
* Display the arrow icon
|
|
14
|
+
*/
|
|
7
15
|
this.showArrow = true;
|
|
16
|
+
/**
|
|
17
|
+
* Display the button
|
|
18
|
+
*/
|
|
8
19
|
this.showButton = false;
|
|
20
|
+
/**
|
|
21
|
+
* Auto Slide
|
|
22
|
+
*/
|
|
9
23
|
this.autoSlide = false;
|
|
24
|
+
/**
|
|
25
|
+
* Auto Slide loop time
|
|
26
|
+
*/
|
|
10
27
|
this.loopTime = 1;
|
|
28
|
+
/**
|
|
29
|
+
* Auto fill the Item height
|
|
30
|
+
*/
|
|
11
31
|
this.autoItemHeight = false;
|
|
32
|
+
/**
|
|
33
|
+
* Client custom styling via inline styles
|
|
34
|
+
*/
|
|
35
|
+
this.clientStyling = '';
|
|
36
|
+
/**
|
|
37
|
+
* Client custom styling via url
|
|
38
|
+
*/
|
|
39
|
+
this.clientStylingUrl = '';
|
|
12
40
|
this.currentSlideNumber = 0;
|
|
13
41
|
this.slidesCount = 0;
|
|
42
|
+
this.limitStylingAppends = false;
|
|
43
|
+
this.slides = null;
|
|
14
44
|
this.slideWidth = 0;
|
|
15
45
|
this.currentPage = 0;
|
|
16
46
|
this.controls = {
|
|
@@ -49,38 +79,54 @@ export class GeneralSlider {
|
|
|
49
79
|
}
|
|
50
80
|
}
|
|
51
81
|
componentWillLoad() {
|
|
52
|
-
this.slides = this.el.querySelectorAll('li');
|
|
53
|
-
this.slidesCount = this.slides.length;
|
|
54
82
|
if (!this.slideNumber)
|
|
55
83
|
this.slideNumber = 1;
|
|
56
84
|
if (!this.slideShow)
|
|
57
85
|
this.slideShow = 1;
|
|
58
86
|
}
|
|
59
87
|
componentDidLoad() {
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
88
|
+
this.slides = this.slotEl.assignedElements();
|
|
89
|
+
this.slidesCount = this.slides.length;
|
|
62
90
|
for (let type in this.controls) {
|
|
63
91
|
this.controls[type] = this.el.shadowRoot.querySelector('.Button' + type);
|
|
64
92
|
}
|
|
65
|
-
this.updateControls();
|
|
66
93
|
if (this.autoSlide) {
|
|
67
94
|
this.setSlideAutoInterval();
|
|
68
95
|
}
|
|
96
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
97
|
+
if (this.clientStyling)
|
|
98
|
+
this.setClientStyling();
|
|
99
|
+
if (this.clientStylingUrl)
|
|
100
|
+
this.setClientStylingURL();
|
|
101
|
+
this.limitStylingAppends = true;
|
|
102
|
+
}
|
|
69
103
|
}
|
|
70
104
|
componentDidRender() {
|
|
105
|
+
if (this.slides)
|
|
106
|
+
this.slideWidth = this.slides[0].offsetWidth;
|
|
71
107
|
this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
|
|
72
108
|
this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
|
|
73
109
|
this.updateListStyle();
|
|
110
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
111
|
+
if (this.clientStyling)
|
|
112
|
+
this.setClientStyling();
|
|
113
|
+
if (this.clientStylingUrl)
|
|
114
|
+
this.setClientStylingURL();
|
|
115
|
+
this.limitStylingAppends = true;
|
|
116
|
+
}
|
|
74
117
|
}
|
|
75
118
|
updateListStyle() {
|
|
76
119
|
if (!this.autoItemHeight)
|
|
77
120
|
return;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
121
|
+
if (this.slides === null)
|
|
122
|
+
return;
|
|
123
|
+
this.slides.forEach((li, index) => {
|
|
81
124
|
if (index >= this.currentPage * this.slideNumber && index < (this.currentPage + 1) * this.slideNumber) {
|
|
82
125
|
li.classList.remove('hide');
|
|
83
126
|
}
|
|
127
|
+
else {
|
|
128
|
+
li.classList.add('hide');
|
|
129
|
+
}
|
|
84
130
|
});
|
|
85
131
|
}
|
|
86
132
|
disconnectedCallback() {
|
|
@@ -133,7 +179,7 @@ export class GeneralSlider {
|
|
|
133
179
|
}, Number(this.loopTime) * 1000);
|
|
134
180
|
}
|
|
135
181
|
componentDidUpdate() {
|
|
136
|
-
this.
|
|
182
|
+
this.sliderEl.style.transform = `translateX(${this.currentSlideNumber * this.slideWidth * -1}px)`;
|
|
137
183
|
this.updateControls();
|
|
138
184
|
}
|
|
139
185
|
switchLoopStatus(isMouseMoveEnter) {
|
|
@@ -148,6 +194,25 @@ export class GeneralSlider {
|
|
|
148
194
|
}
|
|
149
195
|
}
|
|
150
196
|
}
|
|
197
|
+
setClientStyling() {
|
|
198
|
+
const sheet = new CSSStyleSheet();
|
|
199
|
+
// @ts-ignore
|
|
200
|
+
sheet.replace(this.clientStyling);
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
203
|
+
}
|
|
204
|
+
setClientStylingURL() {
|
|
205
|
+
let url = new URL(this.clientStylingUrl);
|
|
206
|
+
fetch(url.href)
|
|
207
|
+
.then((res) => res.text())
|
|
208
|
+
.then((data) => {
|
|
209
|
+
const sheet = new CSSStyleSheet();
|
|
210
|
+
// @ts-ignore
|
|
211
|
+
sheet.replace(data);
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
214
|
+
});
|
|
215
|
+
}
|
|
151
216
|
render() {
|
|
152
217
|
return (h("div", { class: "GeneralSlider" },
|
|
153
218
|
h("div", { class: "Slider" },
|
|
@@ -155,8 +220,8 @@ export class GeneralSlider {
|
|
|
155
220
|
h("div", null,
|
|
156
221
|
h("button", { type: "button", class: "Button ButtonNext", onClick: this.slide.bind(this, true), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, ">"),
|
|
157
222
|
h("button", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")),
|
|
158
|
-
h("ul", { class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) },
|
|
159
|
-
h("slot",
|
|
223
|
+
h("ul", { class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false), ref: (el) => this.sliderEl = el },
|
|
224
|
+
h("slot", { ref: (el) => this.slotEl = el }))),
|
|
160
225
|
this.showButton && this.slidesCount > 0 &&
|
|
161
226
|
h("div", { 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")))));
|
|
162
227
|
}
|
|
@@ -169,24 +234,6 @@ export class GeneralSlider {
|
|
|
169
234
|
"$": ["general-slider.css"]
|
|
170
235
|
}; }
|
|
171
236
|
static get properties() { return {
|
|
172
|
-
"showStatus": {
|
|
173
|
-
"type": "boolean",
|
|
174
|
-
"mutable": false,
|
|
175
|
-
"complexType": {
|
|
176
|
-
"original": "boolean",
|
|
177
|
-
"resolved": "boolean",
|
|
178
|
-
"references": {}
|
|
179
|
-
},
|
|
180
|
-
"required": false,
|
|
181
|
-
"optional": false,
|
|
182
|
-
"docs": {
|
|
183
|
-
"tags": [],
|
|
184
|
-
"text": ""
|
|
185
|
-
},
|
|
186
|
-
"attribute": "show-status",
|
|
187
|
-
"reflect": false,
|
|
188
|
-
"defaultValue": "false"
|
|
189
|
-
},
|
|
190
237
|
"slideNumber": {
|
|
191
238
|
"type": "number",
|
|
192
239
|
"mutable": false,
|
|
@@ -199,7 +246,7 @@ export class GeneralSlider {
|
|
|
199
246
|
"optional": false,
|
|
200
247
|
"docs": {
|
|
201
248
|
"tags": [],
|
|
202
|
-
"text": ""
|
|
249
|
+
"text": "Slide Count"
|
|
203
250
|
},
|
|
204
251
|
"attribute": "slide-number",
|
|
205
252
|
"reflect": false,
|
|
@@ -217,7 +264,7 @@ export class GeneralSlider {
|
|
|
217
264
|
"optional": false,
|
|
218
265
|
"docs": {
|
|
219
266
|
"tags": [],
|
|
220
|
-
"text": ""
|
|
267
|
+
"text": "Slides to show"
|
|
221
268
|
},
|
|
222
269
|
"attribute": "slide-show",
|
|
223
270
|
"reflect": false,
|
|
@@ -235,7 +282,7 @@ export class GeneralSlider {
|
|
|
235
282
|
"optional": false,
|
|
236
283
|
"docs": {
|
|
237
284
|
"tags": [],
|
|
238
|
-
"text": ""
|
|
285
|
+
"text": "Display the arrow icon"
|
|
239
286
|
},
|
|
240
287
|
"attribute": "show-arrow",
|
|
241
288
|
"reflect": false,
|
|
@@ -253,7 +300,7 @@ export class GeneralSlider {
|
|
|
253
300
|
"optional": false,
|
|
254
301
|
"docs": {
|
|
255
302
|
"tags": [],
|
|
256
|
-
"text": ""
|
|
303
|
+
"text": "Display the button"
|
|
257
304
|
},
|
|
258
305
|
"attribute": "show-button",
|
|
259
306
|
"reflect": false,
|
|
@@ -271,7 +318,7 @@ export class GeneralSlider {
|
|
|
271
318
|
"optional": false,
|
|
272
319
|
"docs": {
|
|
273
320
|
"tags": [],
|
|
274
|
-
"text": ""
|
|
321
|
+
"text": "Auto Slide"
|
|
275
322
|
},
|
|
276
323
|
"attribute": "auto-slide",
|
|
277
324
|
"reflect": false,
|
|
@@ -289,7 +336,7 @@ export class GeneralSlider {
|
|
|
289
336
|
"optional": false,
|
|
290
337
|
"docs": {
|
|
291
338
|
"tags": [],
|
|
292
|
-
"text": ""
|
|
339
|
+
"text": "Auto Slide loop time"
|
|
293
340
|
},
|
|
294
341
|
"attribute": "loop-time",
|
|
295
342
|
"reflect": false,
|
|
@@ -307,15 +354,53 @@ export class GeneralSlider {
|
|
|
307
354
|
"optional": false,
|
|
308
355
|
"docs": {
|
|
309
356
|
"tags": [],
|
|
310
|
-
"text": ""
|
|
357
|
+
"text": "Auto fill the Item height"
|
|
311
358
|
},
|
|
312
359
|
"attribute": "auto-item-height",
|
|
313
360
|
"reflect": false,
|
|
314
361
|
"defaultValue": "false"
|
|
362
|
+
},
|
|
363
|
+
"clientStyling": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"mutable": false,
|
|
366
|
+
"complexType": {
|
|
367
|
+
"original": "string",
|
|
368
|
+
"resolved": "string",
|
|
369
|
+
"references": {}
|
|
370
|
+
},
|
|
371
|
+
"required": false,
|
|
372
|
+
"optional": true,
|
|
373
|
+
"docs": {
|
|
374
|
+
"tags": [],
|
|
375
|
+
"text": "Client custom styling via inline styles"
|
|
376
|
+
},
|
|
377
|
+
"attribute": "client-styling",
|
|
378
|
+
"reflect": false,
|
|
379
|
+
"defaultValue": "''"
|
|
380
|
+
},
|
|
381
|
+
"clientStylingUrl": {
|
|
382
|
+
"type": "string",
|
|
383
|
+
"mutable": false,
|
|
384
|
+
"complexType": {
|
|
385
|
+
"original": "string",
|
|
386
|
+
"resolved": "string",
|
|
387
|
+
"references": {}
|
|
388
|
+
},
|
|
389
|
+
"required": false,
|
|
390
|
+
"optional": true,
|
|
391
|
+
"docs": {
|
|
392
|
+
"tags": [],
|
|
393
|
+
"text": "Client custom styling via url"
|
|
394
|
+
},
|
|
395
|
+
"attribute": "client-styling-url",
|
|
396
|
+
"reflect": false,
|
|
397
|
+
"defaultValue": "''"
|
|
315
398
|
}
|
|
316
399
|
}; }
|
|
317
400
|
static get states() { return {
|
|
318
|
-
"currentSlideNumber": {}
|
|
401
|
+
"currentSlideNumber": {},
|
|
402
|
+
"slidesCount": {},
|
|
403
|
+
"limitStylingAppends": {}
|
|
319
404
|
}; }
|
|
320
405
|
static get elementRef() { return "el"; }
|
|
321
406
|
}
|
|
@@ -7,16 +7,46 @@ const GeneralSlider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
7
7
|
super();
|
|
8
8
|
this.__registerHost();
|
|
9
9
|
this.__attachShadow();
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Slide Count
|
|
12
|
+
*/
|
|
11
13
|
this.slideNumber = 3;
|
|
14
|
+
/**
|
|
15
|
+
* Slides to show
|
|
16
|
+
*/
|
|
12
17
|
this.slideShow = 3;
|
|
18
|
+
/**
|
|
19
|
+
* Display the arrow icon
|
|
20
|
+
*/
|
|
13
21
|
this.showArrow = true;
|
|
22
|
+
/**
|
|
23
|
+
* Display the button
|
|
24
|
+
*/
|
|
14
25
|
this.showButton = false;
|
|
26
|
+
/**
|
|
27
|
+
* Auto Slide
|
|
28
|
+
*/
|
|
15
29
|
this.autoSlide = false;
|
|
30
|
+
/**
|
|
31
|
+
* Auto Slide loop time
|
|
32
|
+
*/
|
|
16
33
|
this.loopTime = 1;
|
|
34
|
+
/**
|
|
35
|
+
* Auto fill the Item height
|
|
36
|
+
*/
|
|
17
37
|
this.autoItemHeight = false;
|
|
38
|
+
/**
|
|
39
|
+
* Client custom styling via inline styles
|
|
40
|
+
*/
|
|
41
|
+
this.clientStyling = '';
|
|
42
|
+
/**
|
|
43
|
+
* Client custom styling via url
|
|
44
|
+
*/
|
|
45
|
+
this.clientStylingUrl = '';
|
|
18
46
|
this.currentSlideNumber = 0;
|
|
19
47
|
this.slidesCount = 0;
|
|
48
|
+
this.limitStylingAppends = false;
|
|
49
|
+
this.slides = null;
|
|
20
50
|
this.slideWidth = 0;
|
|
21
51
|
this.currentPage = 0;
|
|
22
52
|
this.controls = {
|
|
@@ -55,38 +85,54 @@ const GeneralSlider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
55
85
|
}
|
|
56
86
|
}
|
|
57
87
|
componentWillLoad() {
|
|
58
|
-
this.slides = this.el.querySelectorAll('li');
|
|
59
|
-
this.slidesCount = this.slides.length;
|
|
60
88
|
if (!this.slideNumber)
|
|
61
89
|
this.slideNumber = 1;
|
|
62
90
|
if (!this.slideShow)
|
|
63
91
|
this.slideShow = 1;
|
|
64
92
|
}
|
|
65
93
|
componentDidLoad() {
|
|
66
|
-
this.
|
|
67
|
-
this.
|
|
94
|
+
this.slides = this.slotEl.assignedElements();
|
|
95
|
+
this.slidesCount = this.slides.length;
|
|
68
96
|
for (let type in this.controls) {
|
|
69
97
|
this.controls[type] = this.el.shadowRoot.querySelector('.Button' + type);
|
|
70
98
|
}
|
|
71
|
-
this.updateControls();
|
|
72
99
|
if (this.autoSlide) {
|
|
73
100
|
this.setSlideAutoInterval();
|
|
74
101
|
}
|
|
102
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
103
|
+
if (this.clientStyling)
|
|
104
|
+
this.setClientStyling();
|
|
105
|
+
if (this.clientStylingUrl)
|
|
106
|
+
this.setClientStylingURL();
|
|
107
|
+
this.limitStylingAppends = true;
|
|
108
|
+
}
|
|
75
109
|
}
|
|
76
110
|
componentDidRender() {
|
|
111
|
+
if (this.slides)
|
|
112
|
+
this.slideWidth = this.slides[0].offsetWidth;
|
|
77
113
|
this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
|
|
78
114
|
this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
|
|
79
115
|
this.updateListStyle();
|
|
116
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
117
|
+
if (this.clientStyling)
|
|
118
|
+
this.setClientStyling();
|
|
119
|
+
if (this.clientStylingUrl)
|
|
120
|
+
this.setClientStylingURL();
|
|
121
|
+
this.limitStylingAppends = true;
|
|
122
|
+
}
|
|
80
123
|
}
|
|
81
124
|
updateListStyle() {
|
|
82
125
|
if (!this.autoItemHeight)
|
|
83
126
|
return;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
127
|
+
if (this.slides === null)
|
|
128
|
+
return;
|
|
129
|
+
this.slides.forEach((li, index) => {
|
|
87
130
|
if (index >= this.currentPage * this.slideNumber && index < (this.currentPage + 1) * this.slideNumber) {
|
|
88
131
|
li.classList.remove('hide');
|
|
89
132
|
}
|
|
133
|
+
else {
|
|
134
|
+
li.classList.add('hide');
|
|
135
|
+
}
|
|
90
136
|
});
|
|
91
137
|
}
|
|
92
138
|
disconnectedCallback() {
|
|
@@ -139,7 +185,7 @@ const GeneralSlider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
139
185
|
}, Number(this.loopTime) * 1000);
|
|
140
186
|
}
|
|
141
187
|
componentDidUpdate() {
|
|
142
|
-
this.
|
|
188
|
+
this.sliderEl.style.transform = `translateX(${this.currentSlideNumber * this.slideWidth * -1}px)`;
|
|
143
189
|
this.updateControls();
|
|
144
190
|
}
|
|
145
191
|
switchLoopStatus(isMouseMoveEnter) {
|
|
@@ -154,15 +200,33 @@ const GeneralSlider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
154
200
|
}
|
|
155
201
|
}
|
|
156
202
|
}
|
|
203
|
+
setClientStyling() {
|
|
204
|
+
const sheet = new CSSStyleSheet();
|
|
205
|
+
// @ts-ignore
|
|
206
|
+
sheet.replace(this.clientStyling);
|
|
207
|
+
// @ts-ignore
|
|
208
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
209
|
+
}
|
|
210
|
+
setClientStylingURL() {
|
|
211
|
+
let url = new URL(this.clientStylingUrl);
|
|
212
|
+
fetch(url.href)
|
|
213
|
+
.then((res) => res.text())
|
|
214
|
+
.then((data) => {
|
|
215
|
+
const sheet = new CSSStyleSheet();
|
|
216
|
+
// @ts-ignore
|
|
217
|
+
sheet.replace(data);
|
|
218
|
+
// @ts-ignore
|
|
219
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
220
|
+
});
|
|
221
|
+
}
|
|
157
222
|
render() {
|
|
158
223
|
return (h("div", { class: "GeneralSlider" }, h("div", { class: "Slider" }, this.showArrow &&
|
|
159
|
-
h("div", null, h("button", { 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", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), h("ul", { class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, h("slot",
|
|
224
|
+
h("div", null, h("button", { 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", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), h("ul", { 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", { ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
|
|
160
225
|
h("div", { 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")))));
|
|
161
226
|
}
|
|
162
227
|
get el() { return this; }
|
|
163
228
|
static get style() { return generalSliderCss; }
|
|
164
229
|
}, [1, "general-slider", {
|
|
165
|
-
"showStatus": [4, "show-status"],
|
|
166
230
|
"slideNumber": [2, "slide-number"],
|
|
167
231
|
"slideShow": [2, "slide-show"],
|
|
168
232
|
"showArrow": [4, "show-arrow"],
|
|
@@ -170,7 +234,11 @@ const GeneralSlider$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
170
234
|
"autoSlide": [4, "auto-slide"],
|
|
171
235
|
"loopTime": [2, "loop-time"],
|
|
172
236
|
"autoItemHeight": [4, "auto-item-height"],
|
|
173
|
-
"
|
|
237
|
+
"clientStyling": [1, "client-styling"],
|
|
238
|
+
"clientStylingUrl": [1, "client-styling-url"],
|
|
239
|
+
"currentSlideNumber": [32],
|
|
240
|
+
"slidesCount": [32],
|
|
241
|
+
"limitStylingAppends": [32]
|
|
174
242
|
}]);
|
|
175
243
|
function defineCustomElement$1() {
|
|
176
244
|
if (typeof customElements === "undefined") {
|
|
@@ -1,20 +1,50 @@
|
|
|
1
|
-
import { r as registerInstance, h, g as getElement } from './index-
|
|
1
|
+
import { r as registerInstance, h, g as getElement } from './index-3bef6f6d.js';
|
|
2
2
|
|
|
3
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(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-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(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";
|
|
4
4
|
|
|
5
5
|
const GeneralSlider = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Slide Count
|
|
10
|
+
*/
|
|
9
11
|
this.slideNumber = 3;
|
|
12
|
+
/**
|
|
13
|
+
* Slides to show
|
|
14
|
+
*/
|
|
10
15
|
this.slideShow = 3;
|
|
16
|
+
/**
|
|
17
|
+
* Display the arrow icon
|
|
18
|
+
*/
|
|
11
19
|
this.showArrow = true;
|
|
20
|
+
/**
|
|
21
|
+
* Display the button
|
|
22
|
+
*/
|
|
12
23
|
this.showButton = false;
|
|
24
|
+
/**
|
|
25
|
+
* Auto Slide
|
|
26
|
+
*/
|
|
13
27
|
this.autoSlide = false;
|
|
28
|
+
/**
|
|
29
|
+
* Auto Slide loop time
|
|
30
|
+
*/
|
|
14
31
|
this.loopTime = 1;
|
|
32
|
+
/**
|
|
33
|
+
* Auto fill the Item height
|
|
34
|
+
*/
|
|
15
35
|
this.autoItemHeight = false;
|
|
36
|
+
/**
|
|
37
|
+
* Client custom styling via inline styles
|
|
38
|
+
*/
|
|
39
|
+
this.clientStyling = '';
|
|
40
|
+
/**
|
|
41
|
+
* Client custom styling via url
|
|
42
|
+
*/
|
|
43
|
+
this.clientStylingUrl = '';
|
|
16
44
|
this.currentSlideNumber = 0;
|
|
17
45
|
this.slidesCount = 0;
|
|
46
|
+
this.limitStylingAppends = false;
|
|
47
|
+
this.slides = null;
|
|
18
48
|
this.slideWidth = 0;
|
|
19
49
|
this.currentPage = 0;
|
|
20
50
|
this.controls = {
|
|
@@ -53,38 +83,54 @@ const GeneralSlider = class {
|
|
|
53
83
|
}
|
|
54
84
|
}
|
|
55
85
|
componentWillLoad() {
|
|
56
|
-
this.slides = this.el.querySelectorAll('li');
|
|
57
|
-
this.slidesCount = this.slides.length;
|
|
58
86
|
if (!this.slideNumber)
|
|
59
87
|
this.slideNumber = 1;
|
|
60
88
|
if (!this.slideShow)
|
|
61
89
|
this.slideShow = 1;
|
|
62
90
|
}
|
|
63
91
|
componentDidLoad() {
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
92
|
+
this.slides = this.slotEl.assignedElements();
|
|
93
|
+
this.slidesCount = this.slides.length;
|
|
66
94
|
for (let type in this.controls) {
|
|
67
95
|
this.controls[type] = this.el.shadowRoot.querySelector('.Button' + type);
|
|
68
96
|
}
|
|
69
|
-
this.updateControls();
|
|
70
97
|
if (this.autoSlide) {
|
|
71
98
|
this.setSlideAutoInterval();
|
|
72
99
|
}
|
|
100
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
101
|
+
if (this.clientStyling)
|
|
102
|
+
this.setClientStyling();
|
|
103
|
+
if (this.clientStylingUrl)
|
|
104
|
+
this.setClientStylingURL();
|
|
105
|
+
this.limitStylingAppends = true;
|
|
106
|
+
}
|
|
73
107
|
}
|
|
74
108
|
componentDidRender() {
|
|
109
|
+
if (this.slides)
|
|
110
|
+
this.slideWidth = this.slides[0].offsetWidth;
|
|
75
111
|
this.el.addEventListener('touchstart', this.handleTouchStart.bind(this), { passive: true });
|
|
76
112
|
this.el.addEventListener('touchmove', this.handleTouchMove.bind(this), { passive: true });
|
|
77
113
|
this.updateListStyle();
|
|
114
|
+
if (!this.limitStylingAppends && this.el.shadowRoot) {
|
|
115
|
+
if (this.clientStyling)
|
|
116
|
+
this.setClientStyling();
|
|
117
|
+
if (this.clientStylingUrl)
|
|
118
|
+
this.setClientStylingURL();
|
|
119
|
+
this.limitStylingAppends = true;
|
|
120
|
+
}
|
|
78
121
|
}
|
|
79
122
|
updateListStyle() {
|
|
80
123
|
if (!this.autoItemHeight)
|
|
81
124
|
return;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
125
|
+
if (this.slides === null)
|
|
126
|
+
return;
|
|
127
|
+
this.slides.forEach((li, index) => {
|
|
85
128
|
if (index >= this.currentPage * this.slideNumber && index < (this.currentPage + 1) * this.slideNumber) {
|
|
86
129
|
li.classList.remove('hide');
|
|
87
130
|
}
|
|
131
|
+
else {
|
|
132
|
+
li.classList.add('hide');
|
|
133
|
+
}
|
|
88
134
|
});
|
|
89
135
|
}
|
|
90
136
|
disconnectedCallback() {
|
|
@@ -137,7 +183,7 @@ const GeneralSlider = class {
|
|
|
137
183
|
}, Number(this.loopTime) * 1000);
|
|
138
184
|
}
|
|
139
185
|
componentDidUpdate() {
|
|
140
|
-
this.
|
|
186
|
+
this.sliderEl.style.transform = `translateX(${this.currentSlideNumber * this.slideWidth * -1}px)`;
|
|
141
187
|
this.updateControls();
|
|
142
188
|
}
|
|
143
189
|
switchLoopStatus(isMouseMoveEnter) {
|
|
@@ -152,9 +198,28 @@ const GeneralSlider = class {
|
|
|
152
198
|
}
|
|
153
199
|
}
|
|
154
200
|
}
|
|
201
|
+
setClientStyling() {
|
|
202
|
+
const sheet = new CSSStyleSheet();
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
sheet.replace(this.clientStyling);
|
|
205
|
+
// @ts-ignore
|
|
206
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
207
|
+
}
|
|
208
|
+
setClientStylingURL() {
|
|
209
|
+
let url = new URL(this.clientStylingUrl);
|
|
210
|
+
fetch(url.href)
|
|
211
|
+
.then((res) => res.text())
|
|
212
|
+
.then((data) => {
|
|
213
|
+
const sheet = new CSSStyleSheet();
|
|
214
|
+
// @ts-ignore
|
|
215
|
+
sheet.replace(data);
|
|
216
|
+
// @ts-ignore
|
|
217
|
+
this.el.shadowRoot.adoptedStyleSheets = [...this.el.shadowRoot.adoptedStyleSheets, sheet];
|
|
218
|
+
});
|
|
219
|
+
}
|
|
155
220
|
render() {
|
|
156
221
|
return (h("div", { class: "GeneralSlider" }, h("div", { class: "Slider" }, this.showArrow &&
|
|
157
|
-
h("div", null, h("button", { 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", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), h("ul", { class: `SliderList Col-${this.slideShow}`, part: "SliderList", onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, h("slot",
|
|
222
|
+
h("div", null, h("button", { 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", { type: "button", class: "Button ButtonPrev", onClick: this.slide.bind(this, false), onMouseEnter: this.switchLoopStatus.bind(this, true), onMouseLeave: this.switchLoopStatus.bind(this, false) }, "<")), h("ul", { 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", { ref: (el) => this.slotEl = el }))), this.showButton && this.slidesCount > 0 &&
|
|
158
223
|
h("div", { 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")))));
|
|
159
224
|
}
|
|
160
225
|
get el() { return getElement(this); }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-3bef6f6d.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["general-slider",[[1,"general-slider",{"
|
|
16
|
+
return bootstrapLazy([["general-slider",[[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"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
|
|
17
17
|
});
|
|
@@ -212,6 +212,12 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
212
212
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
213
213
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
214
214
|
}
|
|
215
|
+
else if (memberName === 'ref') {
|
|
216
|
+
// minifier will clean this up
|
|
217
|
+
if (newValue) {
|
|
218
|
+
newValue(elm);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
215
221
|
else if ((!isProp ) &&
|
|
216
222
|
memberName[0] === 'o' &&
|
|
217
223
|
memberName[1] === 'n') {
|
|
@@ -368,6 +374,7 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
368
374
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
369
375
|
if ((vnode = vnodes[startIdx])) {
|
|
370
376
|
elm = vnode.$elm$;
|
|
377
|
+
callNodeRefs(vnode);
|
|
371
378
|
// remove the vnode's element from the dom
|
|
372
379
|
elm.remove();
|
|
373
380
|
}
|
|
@@ -489,6 +496,12 @@ const patch = (oldVNode, newVNode) => {
|
|
|
489
496
|
elm.data = text;
|
|
490
497
|
}
|
|
491
498
|
};
|
|
499
|
+
const callNodeRefs = (vNode) => {
|
|
500
|
+
{
|
|
501
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
502
|
+
vNode.$children$ && vNode.$children$.map(callNodeRefs);
|
|
503
|
+
}
|
|
504
|
+
};
|
|
492
505
|
const renderVdom = (hostRef, renderFnResults) => {
|
|
493
506
|
const hostElm = hostRef.$hostElement$;
|
|
494
507
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
@@ -716,6 +729,11 @@ const parsePropertyValue = (propValue, propType) => {
|
|
|
716
729
|
// force it to be a number
|
|
717
730
|
return parseFloat(propValue);
|
|
718
731
|
}
|
|
732
|
+
if (propType & 1 /* String */) {
|
|
733
|
+
// could have been passed as a number or boolean
|
|
734
|
+
// but we still want it as a string
|
|
735
|
+
return String(propValue);
|
|
736
|
+
}
|
|
719
737
|
// redundant return here for better minification
|
|
720
738
|
return propValue;
|
|
721
739
|
}
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-3bef6f6d.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.15.2 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["general-slider",[[1,"general-slider",{"
|
|
13
|
+
return bootstrapLazy([["general-slider",[[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"],"currentSlideNumber":[32],"slidesCount":[32],"limitStylingAppends":[32]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as
|
|
1
|
+
import{p as e,b as t}from"./p-1d97b302.js";(()=>{const t=import.meta.url,i={};return""!==t&&(i.resourcesUrl=new URL(".",t).href),e(i)})().then((e=>t([["p-20e28994",[[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"],currentSlideNumber:[32],slidesCount:[32],limitStylingAppends:[32]}]]]],e)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=new WeakMap,a=e=>"sc-"+e.o,u={},f=e=>"object"==(e=typeof e)||"function"===e,d=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?p(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=p(e,null);return c.u=t,r.length>0&&(c.p=r),c},p=(e,t)=>({t:0,$:e,i:t,h:null,p:null,u:null}),$={},h=(e,t,n,s,r,i)=>{if(n!==s){let c=V(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,l=y(n),o=y(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if("ref"===t)s&&s(e);else if(c||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((c||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?c=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):V(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},m=/\s/,y=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.h.nodeType&&t.h.host?t.h.host:t.h,o=e&&e.u||u,r=t.u||u;for(l in o)l in r||h(s,l,o[l],void 0,n,t.t);for(l in r)h(s,l,o[l],r[l],n,t.t)},w=(t,n,l)=>{let o,r,i=n.p[l],c=0;if(null!==i.i)o=i.h=s.createTextNode(i.i);else if(o=i.h=s.createElement(i.$),b(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.p)for(c=0;c<i.p.length;++c)r=w(t,i,c),r&&o.appendChild(r);return o},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=w(null,l,o),i&&(s[o].h=i,c.insertBefore(i,n)))},g=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.h,k(l),s.remove())},j=(e,t)=>e.$===t.$,M=(e,t)=>{const n=t.h=e.h,l=e.p,s=t.p,o=t.i;null===o?("slot"===t.$||b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],a=t[i],u=l.length-1,f=l[0],d=l[u];for(;o<=i&&r<=u;)null==c?c=t[++o]:null==a?a=t[--i]:null==f?f=l[++r]:null==d?d=l[--u]:j(c,f)?(M(c,f),c=t[++o],f=l[++r]):j(a,d)?(M(a,d),a=t[--i],d=l[--u]):j(c,d)?(M(c,d),e.insertBefore(c.h,a.h.nextSibling),c=t[++o],d=l[--u]):j(a,f)?(M(a,f),e.insertBefore(a.h,c.h),a=t[--i],f=l[++r]):(s=w(t&&t[r],n,r),f=l[++r],s&&c.h.parentNode.insertBefore(s,c.h));o>i?S(e,null==l[u+1]?null:l[u+1].h,n,l,r,u):r>u&&g(t,o,i)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},k=e=>{e.u&&e.u.ref&&e.u.ref(null),e.p&&e.p.map(k)},v=e=>F(e).m,C=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},O=(e,t)=>{if(e.t|=16,!(4&e.t))return C(e,e.g),Z((()=>L(e,t)));e.t|=512},L=(e,t)=>{const n=e.j;let l;return t&&(l=N(n,"componentWillLoad")),R(l,(()=>P(e,n,t)))},P=async(e,t,n)=>{const l=e.m,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.m,l=t.t,o=((e,t)=>{let n=a(t),l=G.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=c.get(e=e.head||e);o||c.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);x(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>D(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},x=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.m,o=n.k||p(null,null),r=(e=>e&&e.$===$)(l)?l:d(null,null,l);t=s.tagName,r.$=null,r.t|=4,n.k=r,r.h=o.h=s.shadowRoot||s,e=s["s-sc"],M(o,r)})(n,l)}catch(e){_(e,n.m)}return null},D=e=>{const t=e.m,n=e.j,l=e.g;N(n,"componentDidRender"),64&e.t?N(n,"componentDidUpdate"):(e.t|=64,T(t),N(n,"componentDidLoad"),e.v(t),l||E()),e.S&&(e.S(),e.S=void 0),512&e.t&&Y((()=>O(e,!1))),e.t&=-517},E=()=>{T(s.documentElement),Y((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"general-slider"}});return e.dispatchEvent(t),t})(l)))},N=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){_(e)}},R=(e,t)=>e&&e.then?e.then(t):t(),T=e=>e.classList.add("hydrated"),U=(e,t,n)=>{if(t.C){const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>F(this).O.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=F(e),o=s.O.get(t),r=s.t,i=s.j;n=((e,t)=>null==e||f(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.C[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.O.set(t,n),i&&2==(18&r)&&O(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},W=(e,t={})=>{const n=[],r=t.exclude||[],c=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),d=s.createElement("style"),p=[];let $,h=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],C:t[2],L:t[3]};l.C=t[2];const s=l.o,u=class extends HTMLElement{constructor(e){super(e),H(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){$&&(clearTimeout($),$=null),h?p.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=F(e),n=t.M,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){C(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=B(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(U(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){_(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=a(n);if(!G.has(t)){const l=()=>{};((e,t,n)=>{let l=G.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,G.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,r=()=>O(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{0==(1&o.t)&&N(F(this).j,"disconnectedCallback")})()))}componentOnReady(){return F(this).P}};l.D=e[0],r.includes(s)||c.get(s)||(n.push(s),c.define(s,U(u,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),u.insertBefore(d,f?f.nextSibling:u.firstChild),h=!1,p.length?p.map((e=>e.connectedCallback())):o.jmp((()=>$=setTimeout(E,30)))},A=new WeakMap,F=e=>A.get(e),q=(e,t)=>A.set(t.j=e,t),H=(e,t)=>{const n={t:0,m:e,M:t,O:new Map};return n.P=new Promise((e=>n.v=e)),e["s-p"]=[],e["s-rc"]=[],A.set(e,n)},V=(e,t)=>t in e,_=(e,t)=>(0,console.error)(e,t),z=new Map,B=e=>{const t=e.o.replace(/-/g,"_"),n=e.D,l=z.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(z.set(n,e),e[t])),_)},G=new Map,I=[],J=[],K=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?Y(X):o.raf(X))},Q=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){_(e)}e.length=0},X=()=>{Q(I),Q(J),(n=I.length>0)&&o.raf(X)},Y=e=>r().then(e),Z=K(J,!0);export{W as b,v as g,d as h,r as p,q as r}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,g as s}from"./p-1d97b302.js";const h=class{constructor(i){t(this,i),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.currentSlideNumber=0,this.slidesCount=0,this.limitStylingAppends=!1,this.slides=null,this.slideWidth=0,this.currentPage=0,this.controls={Prev:null,Next:null},this.xDown=null,this.yDown=null}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)}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",{class:"GeneralSlider"},i("div",{class:"Slider"},this.showArrow&&i("div",null,i("button",{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",{type:"button",class:"Button ButtonPrev",onClick:this.slide.bind(this,!1),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},"<")),i("ul",{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",{ref:t=>this.slotEl=t}))),this.showButton&&this.slidesCount>0&&i("div",{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)}," ")))))}get el(){return s(this)}};h.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(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-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(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";export{h as general_slider}
|
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
export declare class GeneralSlider {
|
|
2
2
|
el: HTMLElement;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Slide Count
|
|
5
|
+
*/
|
|
4
6
|
slideNumber: number;
|
|
7
|
+
/**
|
|
8
|
+
* Slides to show
|
|
9
|
+
*/
|
|
5
10
|
slideShow: number;
|
|
11
|
+
/**
|
|
12
|
+
* Display the arrow icon
|
|
13
|
+
*/
|
|
6
14
|
showArrow: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Display the button
|
|
17
|
+
*/
|
|
7
18
|
showButton: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Auto Slide
|
|
21
|
+
*/
|
|
8
22
|
autoSlide: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Auto Slide loop time
|
|
25
|
+
*/
|
|
9
26
|
loopTime: number;
|
|
27
|
+
/**
|
|
28
|
+
* Auto fill the Item height
|
|
29
|
+
*/
|
|
10
30
|
autoItemHeight: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Client custom styling via inline styles
|
|
33
|
+
*/
|
|
34
|
+
clientStyling?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Client custom styling via url
|
|
37
|
+
*/
|
|
38
|
+
clientStylingUrl?: string;
|
|
11
39
|
currentSlideNumber: number;
|
|
12
|
-
|
|
40
|
+
slidesCount: number;
|
|
41
|
+
private limitStylingAppends;
|
|
42
|
+
private sliderEl;
|
|
43
|
+
private slotEl;
|
|
13
44
|
private slides;
|
|
14
|
-
private sliderList;
|
|
15
45
|
private slideWidth;
|
|
16
46
|
private sliderInterval;
|
|
17
47
|
private currentPage;
|
|
@@ -33,5 +63,7 @@ export declare class GeneralSlider {
|
|
|
33
63
|
setSlideAutoInterval(): void;
|
|
34
64
|
componentDidUpdate(): void;
|
|
35
65
|
switchLoopStatus(isMouseMoveEnter: any): void;
|
|
66
|
+
setClientStyling(): void;
|
|
67
|
+
setClientStylingURL(): void;
|
|
36
68
|
render(): any;
|
|
37
69
|
}
|
|
@@ -7,13 +7,41 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
export namespace Components {
|
|
9
9
|
interface GeneralSlider {
|
|
10
|
+
/**
|
|
11
|
+
* Auto fill the Item height
|
|
12
|
+
*/
|
|
10
13
|
"autoItemHeight": boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Auto Slide
|
|
16
|
+
*/
|
|
11
17
|
"autoSlide": boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Client custom styling via inline styles
|
|
20
|
+
*/
|
|
21
|
+
"clientStyling"?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Client custom styling via url
|
|
24
|
+
*/
|
|
25
|
+
"clientStylingUrl"?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Auto Slide loop time
|
|
28
|
+
*/
|
|
12
29
|
"loopTime": number;
|
|
30
|
+
/**
|
|
31
|
+
* Display the arrow icon
|
|
32
|
+
*/
|
|
13
33
|
"showArrow": boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Display the button
|
|
36
|
+
*/
|
|
14
37
|
"showButton": boolean;
|
|
15
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Slide Count
|
|
40
|
+
*/
|
|
16
41
|
"slideNumber": number;
|
|
42
|
+
/**
|
|
43
|
+
* Slides to show
|
|
44
|
+
*/
|
|
17
45
|
"slideShow": number;
|
|
18
46
|
}
|
|
19
47
|
}
|
|
@@ -30,13 +58,41 @@ declare global {
|
|
|
30
58
|
}
|
|
31
59
|
declare namespace LocalJSX {
|
|
32
60
|
interface GeneralSlider {
|
|
61
|
+
/**
|
|
62
|
+
* Auto fill the Item height
|
|
63
|
+
*/
|
|
33
64
|
"autoItemHeight"?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Auto Slide
|
|
67
|
+
*/
|
|
34
68
|
"autoSlide"?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Client custom styling via inline styles
|
|
71
|
+
*/
|
|
72
|
+
"clientStyling"?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Client custom styling via url
|
|
75
|
+
*/
|
|
76
|
+
"clientStylingUrl"?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Auto Slide loop time
|
|
79
|
+
*/
|
|
35
80
|
"loopTime"?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Display the arrow icon
|
|
83
|
+
*/
|
|
36
84
|
"showArrow"?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Display the button
|
|
87
|
+
*/
|
|
37
88
|
"showButton"?: boolean;
|
|
38
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Slide Count
|
|
91
|
+
*/
|
|
39
92
|
"slideNumber"?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Slides to show
|
|
95
|
+
*/
|
|
40
96
|
"slideShow"?: number;
|
|
41
97
|
}
|
|
42
98
|
interface IntrinsicElements {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everymatrix/general-slider",
|
|
3
|
-
"version": "1.29.
|
|
3
|
+
"version": "1.29.4",
|
|
4
4
|
"main": "./dist/index.cjs.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"es2015": "./dist/esm/index.mjs",
|
|
@@ -15,5 +15,8 @@
|
|
|
15
15
|
],
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@everymatrix/general-slider": "*"
|
|
18
21
|
}
|
|
19
22
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as i,g as s}from"./p-95e8d88b.js";const h=class{constructor(i){t(this,i),this.showStatus=!1,this.slideNumber=3,this.slideShow=3,this.showArrow=!0,this.showButton=!1,this.autoSlide=!1,this.loopTime=1,this.autoItemHeight=!1,this.currentSlideNumber=0,this.slidesCount=0,this.slideWidth=0,this.currentPage=0,this.controls={Prev:null,Next:null},this.xDown=null,this.yDown=null}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.slides=this.el.querySelectorAll("li"),this.slidesCount=this.slides.length,this.slideNumber||(this.slideNumber=1),this.slideShow||(this.slideShow=1)}componentDidLoad(){this.sliderList=this.el.shadowRoot.querySelector("ul"),this.slideWidth=this.slides[0].offsetWidth;for(let t in this.controls)this.controls[t]=this.el.shadowRoot.querySelector(".Button"+t);this.updateControls(),this.autoSlide&&this.setSlideAutoInterval()}componentDidRender(){this.el.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.el.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.updateListStyle()}updateListStyle(){this.autoItemHeight&&this.el.querySelectorAll("li").forEach(((t,i)=>{t.classList.add("hide"),i>=this.currentPage*this.slideNumber&&i<(this.currentPage+1)*this.slideNumber&&t.classList.remove("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.sliderList.style.transform=`translateX(${this.currentSlideNumber*this.slideWidth*-1}px)`,this.updateControls()}switchLoopStatus(t){this.autoSlide&&this.loopTime>0&&(t?clearInterval(this.sliderInterval):this.setSlideAutoInterval())}render(){return i("div",{class:"GeneralSlider"},i("div",{class:"Slider"},this.showArrow&&i("div",null,i("button",{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",{type:"button",class:"Button ButtonPrev",onClick:this.slide.bind(this,!1),onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},"<")),i("ul",{class:`SliderList Col-${this.slideShow}`,part:"SliderList",onMouseEnter:this.switchLoopStatus.bind(this,!0),onMouseLeave:this.switchLoopStatus.bind(this,!1)},i("slot",null))),this.showButton&&this.slidesCount>0&&i("div",{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)}," ")))))}get el(){return s(this)}};h.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(--emfe-w-color-contrast, #07072A);color:var(--emfe-w-color-white, #FFFFFF);cursor:pointer}.Button:hover{opacity:1;transition:opacity 0.5s ease-in-out}.Button[disabled],.Button[disabled]:hover{color:var(--emfe-w-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(--emfe-w-tournament-color-primary, #0072ed);opacity:0.2;cursor:pointer;float:right}.PageButton.active{width:45px;opacity:1}";export{h as general_slider}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e,t,n=!1;const l="undefined"!=typeof window?window:{},s=l.document||{head:{}},o={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},r=e=>Promise.resolve(e),i=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replace}catch(e){}return!1})(),c=new WeakMap,a=e=>"sc-"+e.o,u={},f=e=>"object"==(e=typeof e)||"function"===e,d=(e,t,...n)=>{let l=null,s=!1,o=!1,r=[];const i=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?i(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!f(l))&&(l+=""),s&&o?r[r.length-1].i+=l:r.push(s?p(null,l):l),o=s)};if(i(n),t){const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}const c=p(e,null);return c.u=t,r.length>0&&(c.p=r),c},p=(e,t)=>({t:0,$:e,i:t,h:null,p:null,u:null}),$={},h=(e,t,n,s,r,i)=>{if(n!==s){let c=H(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,l=y(n),o=y(s);t.remove(...l.filter((e=>e&&!o.includes(e)))),t.add(...o.filter((e=>e&&!l.includes(e))))}else if(c||"o"!==t[0]||"n"!==t[1]){const l=f(s);if((c||l&&null!==s)&&!r)try{if(e.tagName.includes("-"))e[t]=s;else{let l=null==s?"":s;"list"===t?c=!1:null!=n&&e[t]==l||(e[t]=l)}}catch(e){}null==s||!1===s?!1===s&&""!==e.getAttribute(t)||e.removeAttribute(t):(!c||4&i||r)&&!l&&e.setAttribute(t,s=!0===s?"":s)}else t="-"===t[2]?t.slice(3):H(l,a)?a.slice(2):a[2]+t.slice(3),n&&o.rel(e,t,n,!1),s&&o.ael(e,t,s,!1)}},m=/\s/,y=e=>e?e.split(m):[],b=(e,t,n,l)=>{const s=11===t.h.nodeType&&t.h.host?t.h.host:t.h,o=e&&e.u||u,r=t.u||u;for(l in o)l in r||h(s,l,o[l],void 0,n,t.t);for(l in r)h(s,l,o[l],r[l],n,t.t)},w=(t,n,l)=>{let o,r,i=n.p[l],c=0;if(null!==i.i)o=i.h=s.createTextNode(i.i);else if(o=i.h=s.createElement(i.$),b(null,i,!1),null!=e&&o["s-si"]!==e&&o.classList.add(o["s-si"]=e),i.p)for(c=0;c<i.p.length;++c)r=w(t,i,c),r&&o.appendChild(r);return o},S=(e,n,l,s,o,r)=>{let i,c=e;for(c.shadowRoot&&c.tagName===t&&(c=c.shadowRoot);o<=r;++o)s[o]&&(i=w(null,l,o),i&&(s[o].h=i,c.insertBefore(i,n)))},g=(e,t,n,l)=>{for(;t<=n;++t)(l=e[t])&&l.h.remove()},j=(e,t)=>e.$===t.$,M=(e,t)=>{const n=t.h=e.h,l=e.p,s=t.p,o=t.i;null===o?("slot"===t.$||b(e,t,!1),null!==l&&null!==s?((e,t,n,l)=>{let s,o=0,r=0,i=t.length-1,c=t[0],a=t[i],u=l.length-1,f=l[0],d=l[u];for(;o<=i&&r<=u;)null==c?c=t[++o]:null==a?a=t[--i]:null==f?f=l[++r]:null==d?d=l[--u]:j(c,f)?(M(c,f),c=t[++o],f=l[++r]):j(a,d)?(M(a,d),a=t[--i],d=l[--u]):j(c,d)?(M(c,d),e.insertBefore(c.h,a.h.nextSibling),c=t[++o],d=l[--u]):j(a,f)?(M(a,f),e.insertBefore(a.h,c.h),a=t[--i],f=l[++r]):(s=w(t&&t[r],n,r),f=l[++r],s&&c.h.parentNode.insertBefore(s,c.h));o>i?S(e,null==l[u+1]?null:l[u+1].h,n,l,r,u):r>u&&g(t,o,i)})(n,l,t,s):null!==s?(null!==e.i&&(n.textContent=""),S(n,null,t,s,0,s.length-1)):null!==l&&g(l,0,l.length-1)):e.i!==o&&(n.data=o)},k=e=>A(e).m,v=(e,t)=>{t&&!e.S&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.S=t)))},C=(e,t)=>{if(e.t|=16,!(4&e.t))return v(e,e.g),Y((()=>O(e,t)));e.t|=512},O=(e,t)=>{const n=e.j;let l;return t&&(l=E(n,"componentWillLoad")),N(l,(()=>L(e,n,t)))},L=async(e,t,n)=>{const l=e.m,o=l["s-rc"];n&&(e=>{const t=e.M,n=e.m,l=t.t,o=((e,t)=>{let n=a(t),l=B.get(n);if(e=11===e.nodeType?e:s,l)if("string"==typeof l){let t,o=c.get(e=e.head||e);o||c.set(e,o=new Set),o.has(n)||(t=s.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);P(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>x(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},P=(n,l)=>{try{l=l.render(),n.t&=-17,n.t|=2,((n,l)=>{const s=n.m,o=n.k||p(null,null),r=(e=>e&&e.$===$)(l)?l:d(null,null,l);t=s.tagName,r.$=null,r.t|=4,n.k=r,r.h=o.h=s.shadowRoot||s,e=s["s-sc"],M(o,r)})(n,l)}catch(e){V(e,n.m)}return null},x=e=>{const t=e.m,n=e.j,l=e.g;E(n,"componentDidRender"),64&e.t?E(n,"componentDidUpdate"):(e.t|=64,R(t),E(n,"componentDidLoad"),e.v(t),l||D()),e.S&&(e.S(),e.S=void 0),512&e.t&&X((()=>C(e,!1))),e.t&=-517},D=()=>{R(s.documentElement),X((()=>(e=>{const t=o.ce("appload",{detail:{namespace:"general-slider"}});return e.dispatchEvent(t),t})(l)))},E=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){V(e)}},N=(e,t)=>e&&e.then?e.then(t):t(),R=e=>e.classList.add("hydrated"),T=(e,t,n)=>{if(t.C){const l=Object.entries(t.C),s=e.prototype;if(l.map((([e,[l]])=>{(31&l||2&n&&32&l)&&Object.defineProperty(s,e,{get(){return((e,t)=>A(this).O.get(t))(0,e)},set(n){((e,t,n,l)=>{const s=A(e),o=s.O.get(t),r=s.t,i=s.j;n=((e,t)=>null==e||f(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):e)(n,l.C[t][0]),8&r&&void 0!==o||n===o||Number.isNaN(o)&&Number.isNaN(n)||(s.O.set(t,n),i&&2==(18&r)&&C(s,!1))})(this,e,n,t)},configurable:!0,enumerable:!0})})),1&n){const t=new Map;s.attributeChangedCallback=function(e,n,l){o.jmp((()=>{const n=t.get(e);if(this.hasOwnProperty(n))l=this[n],delete this[n];else if(s.hasOwnProperty(n)&&"number"==typeof this[n]&&this[n]==l)return;this[n]=(null!==l||"boolean"!=typeof this[n])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,n])=>{const l=n[1]||e;return t.set(l,e),l}))}}return e},U=(e,t={})=>{const n=[],r=t.exclude||[],c=l.customElements,u=s.head,f=u.querySelector("meta[charset]"),d=s.createElement("style"),p=[];let $,h=!0;Object.assign(o,t),o.l=new URL(t.resourcesUrl||"./",s.baseURI).href,e.map((e=>{e[1].map((t=>{const l={t:t[0],o:t[1],C:t[2],L:t[3]};l.C=t[2];const s=l.o,u=class extends HTMLElement{constructor(e){super(e),q(e=this,l),1&l.t&&e.attachShadow({mode:"open"})}connectedCallback(){$&&(clearTimeout($),$=null),h?p.push(this):o.jmp((()=>(e=>{if(0==(1&o.t)){const t=A(e),n=t.M,l=()=>{};if(!(1&t.t)){t.t|=1;{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){v(t,t.g=n);break}}n.C&&Object.entries(n.C).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,s)=>{if(0==(32&t.t)){{if(t.t|=32,(s=z(n)).then){const e=()=>{};s=await s,e()}s.isProxied||(T(s,n,2),s.isProxied=!0);const e=()=>{};t.t|=8;try{new s(t)}catch(e){V(e)}t.t&=-9,e()}if(s.style){let e=s.style;const t=a(n);if(!B.has(t)){const l=()=>{};((e,t,n)=>{let l=B.get(e);i&&n?(l=l||new CSSStyleSheet,l.replace(t)):l=t,B.set(e,l)})(t,e,!!(1&n.t)),l()}}}const o=t.g,r=()=>C(t,!0);o&&o["s-rc"]?o["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){o.jmp((()=>(()=>{0==(1&o.t)&&E(A(this).j,"disconnectedCallback")})()))}componentOnReady(){return A(this).P}};l.D=e[0],r.includes(s)||c.get(s)||(n.push(s),c.define(s,T(u,l,1)))}))})),d.innerHTML=n+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles",""),u.insertBefore(d,f?f.nextSibling:u.firstChild),h=!1,p.length?p.map((e=>e.connectedCallback())):o.jmp((()=>$=setTimeout(D,30)))},W=new WeakMap,A=e=>W.get(e),F=(e,t)=>W.set(t.j=e,t),q=(e,t)=>{const n={t:0,m:e,M:t,O:new Map};return n.P=new Promise((e=>n.v=e)),e["s-p"]=[],e["s-rc"]=[],W.set(e,n)},H=(e,t)=>t in e,V=(e,t)=>(0,console.error)(e,t),_=new Map,z=e=>{const t=e.o.replace(/-/g,"_"),n=e.D,l=_.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>(_.set(n,e),e[t])),V)},B=new Map,G=[],I=[],J=(e,t)=>l=>{e.push(l),n||(n=!0,t&&4&o.t?X(Q):o.raf(Q))},K=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){V(e)}e.length=0},Q=()=>{K(G),K(I),(n=G.length>0)&&o.raf(Q)},X=e=>r().then(e),Y=J(I,!0);export{U as b,k as g,d as h,r as p,F as r}
|