1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-09 23:26:40 +02:00

create a base component

This commit is contained in:
Johann-S
2019-09-04 17:58:29 +03:00
committed by XhmikosR
parent c63aebc86b
commit 9f6b342dc7
23 changed files with 229 additions and 113 deletions

View File

@@ -17,6 +17,7 @@ import {
import Data from './dom/data'
import EventHandler from './dom/event-handler'
import SelectorEngine from './dom/selector-engine'
import BaseComponent from './base-component'
/**
* ------------------------------------------------------------------------
@@ -56,19 +57,17 @@ const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active'
* ------------------------------------------------------------------------
*/
class Tab {
constructor(element) {
this._element = element
Data.setData(this._element, DATA_KEY, this)
}
class Tab extends BaseComponent {
// Getters
static get VERSION() {
return VERSION
}
static get DATA_KEY() {
return DATA_KEY
}
// Public
show() {
@@ -217,10 +216,6 @@ class Tab {
}
})
}
static getInstance(element) {
return Data.getData(element, DATA_KEY)
}
}
/**