Skip to content

Commit

Permalink
refactor(dropdown-item): change parent clsas to SgdsElement
Browse files Browse the repository at this point in the history
  • Loading branch information
clukhei committed Dec 19, 2024
1 parent d6d031f commit eaacad9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/components/Dropdown/sgds-dropdown-item.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
import { html, nothing } from "lit";
import { query, queryAssignedElements } from "lit/decorators.js";
import { property, queryAssignedElements } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import LinkElement from "../../base/link-element";
import SgdsElement from "../../base/sgds-element";
import SgdsIcon from "../Icon/sgds-icon";
import dropdownItemStyle from "./dropdown-item.css";
import dropdownStyle from "./dropdown.css";
/**
* @summary `SgdsDropdownItem` are navigation links built with `HTMLAnchorElement`. It should be used in the default slot of `SgdsDropdown`
* @slot default - The default slot for SgdsDropdownItem. Pass in a single anchor tag per dropdown item directly for navigation items.
*/
export class SgdsDropdownItem extends LinkElement {
export class SgdsDropdownItem extends SgdsElement {
static styles = [dropdownStyle, dropdownItemStyle];
static dependencies = {
"sgds-icon": SgdsIcon
};

@queryAssignedElements({ flatten: true }) anchor: HTMLAnchorElement[];

/** when true, sets the active stylings of .nav-link */
@property({ type: Boolean })
active = false;

/** Disables the SgdsMainnavItem */
@property({ type: Boolean, reflect: true })
disabled = false;

connectedCallback(): void {
super.connectedCallback();
this.addEventListener("keydown", (e: KeyboardEvent) => {
Expand Down

0 comments on commit eaacad9

Please sign in to comment.