diff options
author | Rohit Sharma <rohit2sharma95@gmail.com> | 2020-11-25 10:13:33 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2020-11-29 21:58:26 +0300 |
commit | f6a87337416f900773268db9fc4307538c7daf88 (patch) | |
tree | 7861690eb460eda9d423dabeb1ce91e609669143 /js | |
parent | 9eb9d02084dc914e614e8844e3ffdee4d0a25126 (diff) |
Move `VERSION` to BaseComponent (#32254)
Diffstat (limited to 'js')
-rw-r--r-- | js/src/alert.js | 5 | ||||
-rw-r--r-- | js/src/base-component.js | 12 | ||||
-rw-r--r-- | js/src/button.js | 5 | ||||
-rw-r--r-- | js/src/carousel.js | 5 | ||||
-rw-r--r-- | js/src/collapse.js | 5 | ||||
-rw-r--r-- | js/src/dropdown.js | 5 | ||||
-rw-r--r-- | js/src/modal.js | 5 | ||||
-rw-r--r-- | js/src/popover.js | 5 | ||||
-rw-r--r-- | js/src/scrollspy.js | 5 | ||||
-rw-r--r-- | js/src/tab.js | 5 | ||||
-rw-r--r-- | js/src/toast.js | 5 | ||||
-rw-r--r-- | js/src/tooltip.js | 5 |
12 files changed, 12 insertions, 55 deletions
diff --git a/js/src/alert.js b/js/src/alert.js index 41cff54db2..f1f612232d 100644 --- a/js/src/alert.js +++ b/js/src/alert.js @@ -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 } diff --git a/js/src/base-component.js b/js/src/base-component.js index b1b85a4ee7..e9b4de6692 100644 --- a/js/src/base-component.js +++ b/js/src/base-component.js @@ -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 } diff --git a/js/src/button.js b/js/src/button.js index 8b7c6c953c..2409955642 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -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 } diff --git a/js/src/carousel.js b/js/src/carousel.js index 35a1848f87..7d2b4dc508 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -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 } diff --git a/js/src/collapse.js b/js/src/collapse.js index 9fb4d5edef..da3e504d18 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -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 } diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 3641d9f9d2..f9c945c33b 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -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 } diff --git a/js/src/modal.js b/js/src/modal.js index 449721caf7..e3fe487a82 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -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 } diff --git a/js/src/popover.js b/js/src/popover.js index bae5537aa2..97db9a3f7d 100644 --- a/js/src/popover.js +++ b/js/src/popover.js @@ -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 } diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index 0df00e8f7b..4e88a2321c 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -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 } diff --git a/js/src/tab.js b/js/src/tab.js index a57d1b12dd..0e9755ea02 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -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 } diff --git a/js/src/toast.js b/js/src/toast.js index 04917869df..065c6c753c 100644 --- a/js/src/toast.js +++ b/js/src/toast.js @@ -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 } diff --git a/js/src/tooltip.js b/js/src/tooltip.js index b844320653..fae6063225 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -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 } |