PageSourceSearch

https://www.hillhousehome.com/cdn/shop/t/552/assets/bundled-content-dropdown.directive.js

js hillhousehome.com collected 2026-09-24 22:10:43 UTC 4,231 bytes, 5 lines download raw bytes

1import { D as Directive, g as gsapWithCSS, B as BehaviorSubject, H as HostAttr, a as autobind } from './bundled-app.js';
2
3var t,e;function s(t,e,s,n){var i,o=arguments.length,r=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,n);else for(var d=t.length-1;d>=0;d--)(i=t[d])&&(r=(o<3?i(r):o>3?i(e,s,r):i(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r}function n(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}(e=t||(t={})).Open="open",e.Closed="closed";class ContentDropdownDirective extends Directive{onAppInit(){this.setItemsContainer(),this.bindEvents();}onAppDestroy(){this.unbindEvents();}isOpen(){return this._isOpen}setIsOpen(t,e=!0){this._isOpen=t,this.updateStatus(),e&&this.statusChangedSubject$.next(t);}open(){this.host.setAttribute("content-dropdown","open"),this.host.classList.remove(this.closedClassName),this.host.classList.add(this.openedClassName),this.hasRemoteItems&&this.itemsContainer&&(this.itemsContainer.setAttribute("content-dropdown-open",""),this.a11yEnable(),this.bindItemsContainerEvents()),this._isOpen=!0;}close(){this.host.setAttribute("content-dropdown","closed"),this.host.classList.remove(this.openedClassName),this.host.classList.add(this.closedClassName),this.hasRemoteItems&&this.itemsContainer&&(this.itemsContainer.removeAttribute("content-dropdown-open"),this.a11yDisable(),this.unbindItemsContainerEvents()),this._isOpen=!1;}setItemsContainer(){if(!this.itemsContainer&&this.host.hasAttribute("id")){let t=this.host.getAttribute("id");this.itemsContainer=document.querySelector(`[content-dropdown-items-for="${t}"]`),this.hasRemoteItems=!0;}}bindEvents(){this.triggerEl&&this.triggerEl.addEventListener("click",this.onTriggerClick);}unbindEvents(){this.triggerEl&&this.triggerEl.removeEventListener("click",this.onTriggerClick);}bindItemsContainerEvents(){document.addEventListener("keyup",this.onItemsContainerKeyDown);}unbindItemsContainerEvents(){document.removeEventListener("keyup",this.onItemsContainerKeyDown);}updateStatus(t=this._isOpen){t?this.open():this.close();}onTriggerClick(t){this.setIsOpen(!this._isOpen);}onItemsContainerKeyDown(t){"Escape"===t.key&&this.setIsOpen(!1);let e=this.host.getAttribute("id");document.activeElement.closest(`[content-dropdown-items-for="${e}"]`)||(this.setIsOpen(!1),this.host.focus());}a11yEnable(){let t=this.itemsContainer.querySelectorAll("a, button, input, textarea, select, details");t&&(gsapWithCSS.set(t,{attr:{tabindex:0,"aria-hidden":"false"}}),t[0].focus());}a11yDisable(){let t=this.itemsContainer.querySelectorAll("a, button, input, textarea, select, details");t&&gsapWithCSS.set(t,{attr:{tabindex:-1,"aria-hidden":"true"}});}constructor(...t){super(...t),this.openedClassName="opened",this.closedClassName="closed",this.triggerEl=this.triggerElSelector?this.host.querySelector(this.triggerElSelector):this.host,this.itemsContainer=this.itemsSelector?this.host.querySelector(this.itemsSelector):null,this.hasRemoteItems=!1,this._isOpen=!1,this.statusChangedSubject$=new BehaviorSubject(this._isOpen),this.statusChanged$=this.statusChangedSubject$.asObservable();}}ContentDropdownDirective.selector="[content-dropdown]",s([HostAttr("dropdown-opened-class"),n("design:type",String)],ContentDropdownDirective.prototype,"openedClassName",void 0),s([HostAttr("dropdown-closed-class"),n("design:type",String)],ContentDropdownDirective.prototype,"closedClassName",void 0),s([HostAttr("content-dropdown-trigger"),n("design:type",String)],ContentDropdownDirective.prototype,"triggerElSelector",void 0),s([HostAttr("content-dropdown-items"),n("design:type",String)],ContentDropdownDirective.prototype,"itemsSelector",void 0),s([autobind,n("design:type",Function),n("design:paramtypes",["undefined"==typeof MouseEvent?Object:MouseEvent]),n("design:returntype",void 0)],ContentDropdownDirective.prototype,"onTriggerClick",null),s([autobind,n("design:type",Function),n("design:paramtypes",["undefined"==typeof KeyboardEvent?Object:KeyboardEvent]),n("design:returntype",void 0)],ContentDropdownDirective.prototype,"onItemsContainerKeyDown",null);
4
5export { ContentDropdownDirective };

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.