/*! * Bootstrap Native Dropdown v5.1.10 (https://thednp.github.io/bootstrap.native/) * Copyright 2026 © thednp * Licensed under MIT (https://github.com/thednp/bootstrap.native/blob/master/LICENSE) */ "use strict"; import { Data, ObjectAssign, ObjectKeys, addClass, ariaExpanded, closest, createCustomEvent, dispatchEvent, focus, focusEvent, getAttribute, getBoundingClientRect, getDocument, getDocumentElement, getElementStyle, getElementsByClassName, getInstance, hasAttribute, hasClass, isElement, isHTMLElement, isRTL, isString, keyArrowDown, keyArrowUp, keyEscape, keydownEvent, keyupEvent, mouseclickEvent, mousedownEvent, normalizeOptions, querySelector, removeClass, setAttribute, setElementStyle } from "@thednp/shorty"; import { addListener, removeListener } from "@thednp/event-listener"; import PositionObserver from "@thednp/position-observer"; //#region src/strings/showClass.ts /** * Global namespace for most components `show` class. */ const showClass = "show"; //#endregion //#region src/strings/dataBsToggle.ts /** * Global namespace for most components `toggle` option. */ const dataBsToggle = "data-bs-toggle"; //#endregion //#region src/strings/dropdownClasses.ts /** * Global namespace for `Dropdown` types / classes. */ const dropdownMenuClasses = [ "dropdown", "dropup", "dropstart", "dropend" ]; //#endregion //#region src/strings/dropdownComponent.ts /** @type {string} */ const dropdownComponent = "Dropdown"; //#endregion //#region src/strings/dropdownMenuClass.ts /** * Global namespace for `.dropdown-menu`. */ const dropdownMenuClass = "dropdown-menu"; //#endregion //#region src/util/isEmptyAnchor.ts /** * Checks if an *event.target* or its parent has an `href="#"` value. * We need to prevent jumping around onclick, don't we? * * @param element the target element * @returns the query result */ const isEmptyAnchor = (element) => { const parentAnchor = closest(element, "A"); return element.tagName === "A" && hasAttribute(element, "href") && getAttribute(element, "href")?.slice(-1) === "#" || parentAnchor && hasAttribute(parentAnchor, "href") && getAttribute(parentAnchor, "href")?.slice(-1) === "#"; }; //#endregion //#region src/util/isDisabled.ts /** * Check if interactive element is disabled. * @param target either a `