vendor: 2,841 bytes, lines 1-86
1/*! 2 * Bootstrap base-component.js v5.3.8 (https://getbootstrap.com/) 3 * Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5 */ 6(function (global, factory) { 7 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./util/config.js'), require('./util/index.js')) : 8 typeof define === 'function' && define.amd ? define(['./dom/data', './dom/event-handler', './util/config', './util/index'], factory) : 9 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.BaseComponent = factory(global.Data, global.EventHandler, global.Config, global.Index)); 10})(this, (function (Data, EventHandler, Config, index_js) { 'use strict'; 11 12 /** 13 * -------------------------------------------------------------------------- 14 * Bootstrap base-component.js 15 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 16 * -------------------------------------------------------------------------- 17 */ 18 19 20 /** 21 * Constants 22 */ 23 24 const VERSION = '5.3.8'; 25 26 /** 27 * Class definition 28 */ 29 30 class BaseComponent extends Config { 31 constructor(element, config) { 32 super(); 33 element = index_js.getElement(element); 34 if (!element) { 35 return; 36 } 37 this._element = element; 38 this._config = this._getConfig(config); 39 Data.set(this._element, this.constructor.DATA_KEY, this); 40 } 41 42 // Public 43 dispose() { 44 Data.remove(this._element, this.constructor.DATA_KEY); 45 EventHandler.off(this._element, this.constructor.EVENT_KEY); 46 for (const propertyName of Object.getOwnPropertyNames(this)) { 47 this[propertyName] = null; 48 } 49 } 50 51 // Private 52 _queueCallback(callback, element, isAnimated = true) { 53 index_js.executeAfterTransition(callback, element, isAnimated); 54 } 55 _getConfig(config) { 56 config = this._mergeConfigObj(config, this._element); 57 config = this._configAfterMerge(config); 58 this._typeCheckConfig(config); 59 return config; 60 } 61 62 // Static 63 static getInstance(element) { 64 return Data.get(index_js.getElement(element), this.DATA_KEY); 65 } 66 static getOrCreateInstance(element, config = {}) { 67 return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); 68 } 69 static get VERSION() { 70 return VERSION; 71 } 72 static get DATA_KEY() { 73 return `bs.${this.NAME}`; 74 } 75 static get EVENT_KEY() { 76 return `.${this.DATA_KEY}`; 77 } 78 static eventName(name) { 79 return `${name}${this.EVENT_KEY}`; 80 } 81 } 82 83 return BaseComponent; 84 85})); 86//# sourceMappingURL=base-component.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.