PageSourceSearch

https://www.hillhousehome.com/cdn/shop/t/555/assets/bundled-tabs.directive.js

js hillhousehome.com collected 2026-10-02 10:27:37 UTC 3,062 bytes, 6 lines download raw bytes

1import { D as Directive, b as HostChildren, a as autobind } from './bundled-app.js';
2import { H as HostChild } from './bundled-HostChild.js';
3
4function t(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r}function e(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}class Tabs extends Directive{onAppInit(){this.tabs&&this.tablist&&(this.bindEvents(),this.tabs[0]?.click());}bindEvents(){for(let t=0;t<this.tabs.length;t++)this.tabs[t].addEventListener("click",this.changeTabs);for(let t=0;t<this.tabs.length;t++)this.tabpanels[t].addEventListener("keydown",this.handleKeydown);}changeTabs(t){this.currentTab=t.target,this.currentTabPanel=this.host.querySelector(`#${this.currentTab.getAttribute("aria-controls")}`),this.tablist.querySelectorAll('[aria-selected="true"]').forEach(t=>t.setAttribute("aria-selected","false")),this.tabpanels.forEach(t=>t.setAttribute("hidden","true")),this.currentTab.setAttribute("aria-selected","true"),this.currentTabPanel.removeAttribute("hidden"),this.focusableContent=this.currentTabPanel.querySelectorAll(this.focusableContentSelector),this.lastContent=this.focusableContent[this.focusableContent.length-1];}handleKeydown(t){if("Tab"!==t.key)return;let e=Array.from(this.focusableContent).filter(t=>t.hasAttribute("aria-expanded")),n=e[e.length-1];this.tabs[this.tabs.length-1]!==this.currentTab&&(document.activeElement===n&&"false"===n.getAttribute("aria-expanded")||document.activeElement===this.lastContent)&&(this.currentTab.nextElementSibling.focus(),t.preventDefault());}constructor(...t){super(...t),this.trapFocusObject={exeption:':not([disabled]):not([tabindex="-1"])',focusSelectors:["button",'[role="button"]',"[href]","[tabindex]"]},this.focusableContentSelector=this.trapFocusObject.focusSelectors.join(`${this.trapFocusObject.exeption}, `)+this.trapFocusObject.exeption;}}Tabs.selector="[tabs]",t([HostChild('[role="tablist"'),e("design:type","undefined"==typeof HTMLElement?Object:HTMLElement)],Tabs.prototype,"tablist",void 0),t([HostChildren('[role="tab"]'),e("design:type","undefined"==typeof NodeListOf?Object:NodeListOf)],Tabs.prototype,"tabs",void 0),t([HostChildren('[role="tabpanel"]'),e("design:type","undefined"==typeof NodeListOf?Object:NodeListOf)],Tabs.prototype,"tabpanels",void 0),t([autobind,e("design:type",Function),e("design:paramtypes",[]),e("design:returntype",void 0)],Tabs.prototype,"onAppInit",null),t([autobind,e("design:type",Function),e("design:paramtypes",["undefined"==typeof Event?Object:Event]),e("design:returntype",void 0)],Tabs.prototype,"changeTabs",null),t([autobind,e("design:type",Function),e("design:paramtypes",["undefined"==typeof KeyboardEvent?Object:KeyboardEvent]),e("design:returntype",void 0)],Tabs.prototype,"handleKeydown",null);
5
6export { Tabs };

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.