@hummingbirdui/hummingbird
Version:
An open-source system designed for rapid development, without sacrificing the granular control of utility-first CSS.
42 lines (41 loc) • 1.97 kB
JavaScript
;
const baseComponent = require("./base-component.js");
const selectorEngine = require("./selector-engine.js");
var componentFunctions$1 = { exports: {} };
/*!
* Bootstrap component-functions.js v5.3.8 (https://getbootstrap.com/)
* Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
var componentFunctions = componentFunctions$1.exports;
var hasRequiredComponentFunctions;
function requireComponentFunctions() {
if (hasRequiredComponentFunctions) return componentFunctions$1.exports;
hasRequiredComponentFunctions = 1;
(function(module2, exports2) {
(function(global, factory) {
factory(exports2, baseComponent.requireEventHandler(), selectorEngine.requireSelectorEngine(), baseComponent.requireUtil());
})(componentFunctions, function(exports3, EventHandler, SelectorEngine, index_js) {
const enableDismissTrigger = (component, method = "hide") => {
const clickEvent = `click.dismiss${component.EVENT_KEY}`;
const name = component.NAME;
EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function(event) {
if (["A", "AREA"].includes(this.tagName)) {
event.preventDefault();
}
if (index_js.isDisabled(this)) {
return;
}
const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`);
const instance = component.getOrCreateInstance(target);
instance[method]();
});
};
exports3.enableDismissTrigger = enableDismissTrigger;
Object.defineProperty(exports3, Symbol.toStringTag, { value: "Module" });
});
})(componentFunctions$1, componentFunctions$1.exports);
return componentFunctions$1.exports;
}
exports.requireComponentFunctions = requireComponentFunctions;
//# sourceMappingURL=component-functions.js.map