@inizioevoke/astro-core 2.1.0 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inizioevoke/astro-core",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -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
  ---