@hummingbirdui/hummingbird
Version:
An open-source system designed for rapid development, without sacrificing the granular control of utility-first CSS.
43 lines (42 loc) • 1.93 kB
JavaScript
import { r as requireEventHandler, a as requireUtil } from "./base-component.js";
import { r as requireSelectorEngine } from "./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(module, exports) {
(function(global, factory) {
factory(exports, requireEventHandler(), requireSelectorEngine(), requireUtil());
})(componentFunctions, function(exports2, 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]();
});
};
exports2.enableDismissTrigger = enableDismissTrigger;
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
});
})(componentFunctions$1, componentFunctions$1.exports);
return componentFunctions$1.exports;
}
export {
requireComponentFunctions as r
};
//# sourceMappingURL=component-functions.js.map