mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
Move VERSION
to BaseComponent (#32254)
This commit is contained in:
parent
9eb9d02084
commit
f6a8733741
@ -24,7 +24,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'alert'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.alert'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -48,10 +47,6 @@ const CLASSNAME_SHOW = 'show'
|
||||
class Alert extends BaseComponent {
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get DATA_KEY() {
|
||||
return DATA_KEY
|
||||
}
|
||||
|
@ -7,6 +7,14 @@
|
||||
|
||||
import Data from './dom/data'
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
|
||||
class BaseComponent {
|
||||
constructor(element) {
|
||||
if (!element) {
|
||||
@ -28,6 +36,10 @@ class BaseComponent {
|
||||
return Data.getData(element, this.DATA_KEY)
|
||||
}
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get DATA_KEY() {
|
||||
return null
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'button'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.button'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -37,10 +36,6 @@ const EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`
|
||||
class Button extends BaseComponent {
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get DATA_KEY() {
|
||||
return DATA_KEY
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'carousel'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.carousel'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -129,10 +128,6 @@ class Carousel extends BaseComponent {
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get Default() {
|
||||
return Default
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'collapse'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.collapse'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -108,10 +107,6 @@ class Collapse extends BaseComponent {
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get Default() {
|
||||
return Default
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'dropdown'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.dropdown'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -112,10 +111,6 @@ class Dropdown extends BaseComponent {
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get Default() {
|
||||
return Default
|
||||
}
|
||||
|
@ -29,7 +29,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'modal'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.modal'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -99,10 +98,6 @@ class Modal extends BaseComponent {
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get Default() {
|
||||
return Default
|
||||
}
|
||||
|
@ -17,7 +17,6 @@ import Tooltip from './tooltip'
|
||||
*/
|
||||
|
||||
const NAME = 'popover'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.popover'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const CLASS_PREFIX = 'bs-popover'
|
||||
@ -67,10 +66,6 @@ const SELECTOR_CONTENT = '.popover-body'
|
||||
class Popover extends Tooltip {
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get Default() {
|
||||
return Default
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'scrollspy'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.scrollspy'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -88,10 +87,6 @@ class ScrollSpy extends BaseComponent {
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get Default() {
|
||||
return Default
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'tab'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.tab'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const DATA_API_KEY = '.data-api'
|
||||
@ -60,10 +59,6 @@ const SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active'
|
||||
class Tab extends BaseComponent {
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get DATA_KEY() {
|
||||
return DATA_KEY
|
||||
}
|
||||
|
@ -26,7 +26,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'toast'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.toast'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
|
||||
@ -73,10 +72,6 @@ class Toast extends BaseComponent {
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get DefaultType() {
|
||||
return DefaultType
|
||||
}
|
||||
|
@ -35,7 +35,6 @@ import BaseComponent from './base-component'
|
||||
*/
|
||||
|
||||
const NAME = 'tooltip'
|
||||
const VERSION = '5.0.0-alpha3'
|
||||
const DATA_KEY = 'bs.tooltip'
|
||||
const EVENT_KEY = `.${DATA_KEY}`
|
||||
const CLASS_PREFIX = 'bs-tooltip'
|
||||
@ -150,10 +149,6 @@ class Tooltip extends BaseComponent {
|
||||
|
||||
// Getters
|
||||
|
||||
static get VERSION() {
|
||||
return VERSION
|
||||
}
|
||||
|
||||
static get Default() {
|
||||
return Default
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user