@inizioevoke/astro-core 2.0.4 → 2.1.1
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/package.json
CHANGED
|
@@ -170,6 +170,30 @@ export class EvoScrollContainerElement extends HTMLElement implements IEvoScroll
|
|
|
170
170
|
this.#updateThumbSize();
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
addEventListener(type: keyof HTMLElementEventMap, listener: (this: EvoScrollContainerElement, ev: any) => void, options?: boolean | AddEventListenerOptions) {
|
|
174
|
+
switch (type) {
|
|
175
|
+
case 'scroll':
|
|
176
|
+
case 'scrollend':
|
|
177
|
+
this.#content.addEventListener(type, listener, options);
|
|
178
|
+
break;
|
|
179
|
+
default:
|
|
180
|
+
super.addEventListener(type, listener, options);
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
removeEventListener(type: keyof HTMLElementEventMap, listener: (this: EvoScrollContainerElement, ev: any) => void) {
|
|
186
|
+
switch (type) {
|
|
187
|
+
case 'scroll':
|
|
188
|
+
case 'scrollend':
|
|
189
|
+
this.#content.removeEventListener(type, listener);
|
|
190
|
+
break;
|
|
191
|
+
default:
|
|
192
|
+
super.removeEventListener(type, listener);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
173
197
|
#updateThumbSize() {
|
|
174
198
|
if (this.#thumbVert && this.#trackVert) {
|
|
175
199
|
const scrollHeight = this.#content.scrollHeight - getPaddingY(this.#content);
|
|
@@ -75,10 +75,17 @@ const tabHtml = tabs.map((tab) => {
|
|
|
75
75
|
tab.class && cssClass.push(tab.class);
|
|
76
76
|
tab.active && cssClass.push('evo-tab-active');
|
|
77
77
|
|
|
78
|
+
const attrs: string[] = [];
|
|
79
|
+
Object.keys(tab)
|
|
80
|
+
.filter(key => !['class','active','title','index'].includes(key))
|
|
81
|
+
.forEach((key) => {
|
|
82
|
+
attrs.push(`${key}="${tab[key as keyof typeof tab].replace(/"/g, '')}"`)
|
|
83
|
+
});
|
|
84
|
+
|
|
78
85
|
if (listType === 'none') {
|
|
79
|
-
return `<button class="${cssClass.join(' ')}" data-tab="${tab.index}" role="tab">${tab.title}</button>`;
|
|
86
|
+
return `<button class="${cssClass.join(' ')}" data-tab="${tab.index}" role="tab" ${attrs.join(' ')}>${tab.title}</button>`;
|
|
80
87
|
} else {
|
|
81
|
-
return `<li class="${cssClass.join(' ')}"><button data-tab="${tab.index}" role="tab">${tab.title}</button></li>`;
|
|
88
|
+
return `<li class="${cssClass.join(' ')}"><button data-tab="${tab.index}" role="tab" ${attrs.join(' ')}>${tab.title}</button></li>`;
|
|
82
89
|
}
|
|
83
90
|
}).join('');
|
|
84
91
|
---
|