0
0
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:
Rohit Sharma 2020-11-25 12:43:33 +05:30 committed by XhmikosR
parent 9eb9d02084
commit f6a8733741
12 changed files with 12 additions and 55 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}