mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-09 15:16:51 +02:00
Release v5.0.0-beta3 (#33439)
This commit is contained in:
60
js/dist/base-component.js
vendored
60
js/dist/base-component.js
vendored
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap base-component.js v5.0.0-beta2 (https://getbootstrap.com/)
|
||||
* Bootstrap base-component.js v5.0.0-beta3 (https://getbootstrap.com/)
|
||||
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
*/
|
||||
@@ -13,62 +13,48 @@
|
||||
|
||||
var Data__default = /*#__PURE__*/_interopDefaultLegacy(Data);
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* --------------------------------------------------------------------------
|
||||
* Bootstrap (v5.0.0-beta3): base-component.js
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
/**
|
||||
* ------------------------------------------------------------------------
|
||||
* Constants
|
||||
* ------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var VERSION = '5.0.0-beta2';
|
||||
const VERSION = '5.0.0-beta3';
|
||||
|
||||
class BaseComponent {
|
||||
constructor(element) {
|
||||
element = typeof element === 'string' ? document.querySelector(element) : element;
|
||||
|
||||
var BaseComponent = /*#__PURE__*/function () {
|
||||
function BaseComponent(element) {
|
||||
if (!element) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._element = element;
|
||||
Data__default['default'].setData(element, this.constructor.DATA_KEY, this);
|
||||
Data__default['default'].set(this._element, this.constructor.DATA_KEY, this);
|
||||
}
|
||||
|
||||
var _proto = BaseComponent.prototype;
|
||||
|
||||
_proto.dispose = function dispose() {
|
||||
Data__default['default'].removeData(this._element, this.constructor.DATA_KEY);
|
||||
dispose() {
|
||||
Data__default['default'].remove(this._element, this.constructor.DATA_KEY);
|
||||
this._element = null;
|
||||
}
|
||||
/** Static */
|
||||
;
|
||||
|
||||
BaseComponent.getInstance = function getInstance(element) {
|
||||
return Data__default['default'].getData(element, this.DATA_KEY);
|
||||
};
|
||||
|
||||
_createClass(BaseComponent, null, [{
|
||||
key: "VERSION",
|
||||
get: function get() {
|
||||
return VERSION;
|
||||
}
|
||||
}]);
|
||||
static getInstance(element) {
|
||||
return Data__default['default'].get(element, this.DATA_KEY);
|
||||
}
|
||||
|
||||
return BaseComponent;
|
||||
}();
|
||||
static get VERSION() {
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return BaseComponent;
|
||||
|
||||
|
Reference in New Issue
Block a user