Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/dist/base-component.js')
-rw-r--r--js/dist/base-component.js60
1 files changed, 23 insertions, 37 deletions
diff --git a/js/dist/base-component.js b/js/dist/base-component.js
index 80605b5a1a..2b9a4eff2a 100644
--- a/js/dist/base-component.js
+++ b/js/dist/base-component.js
@@ -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;