@a.nemreen/dga-ui 0.3.17 → 0.3.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,24 @@ Versions below are the ones published to npm. Work that is only in this reposito
|
|
|
6
6
|
|
|
7
7
|
## 2026-10-18
|
|
8
8
|
|
|
9
|
+
`@a.nemreen/dga-dynamic-form` **0.2.8**
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- `@a.nemreen/dga-dynamic-form` — staged upload browse button uses `variant="primary"` (brand green) instead of `secondary` (gold).
|
|
14
|
+
|
|
15
|
+
`@a.nemreen/dga-tokens` **0.3.9**
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- `@a.nemreen/dga-tokens` — `max-w-sm`…`max-w-7xl` (and `3xs`/`2xs`/`xs`) use `--container-*` widths again via unlayered `max-width-compat.css`. Tailwind v4 was binding those classes to the DGA `--spacing-*` scale (e.g. `max-w-7xl` → 64px), which collapsed page layouts that still use classic Tailwind max-width utilities.
|
|
20
|
+
|
|
21
|
+
`@a.nemreen/dga-ui` **0.3.18**
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- `@a.nemreen/dga-ui` — `dga-switch` renders a visible `label` beside the control (previously aria-only). Use `ariaLabel` when the surrounding layout already shows the title.
|
|
26
|
+
|
|
9
27
|
`@a.nemreen/dga-ui` **0.3.17** · `@a.nemreen/dga-dynamic-form` **0.2.6**
|
|
10
28
|
|
|
11
29
|
### Added
|
|
@@ -89,7 +89,7 @@ import*as s from"@angular/core";import{inject as y,DestroyRef as S,ElementRef as
|
|
|
89
89
|
class="mt-xxs"
|
|
90
90
|
[checked]="draftPrefs()[cat.id] === true"
|
|
91
91
|
[disabled]="!!cat.required"
|
|
92
|
-
[
|
|
92
|
+
[ariaLabel]="cat.label"
|
|
93
93
|
(changed)="onCategoryToggle(cat.id, $event)"
|
|
94
94
|
/>
|
|
95
95
|
</div>
|
|
@@ -149,7 +149,7 @@ import*as s from"@angular/core";import{inject as y,DestroyRef as S,ElementRef as
|
|
|
149
149
|
</div>
|
|
150
150
|
</div>
|
|
151
151
|
}
|
|
152
|
-
`,isInline:!0,styles:["@keyframes dga-cookie-in{0%{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes dga-cookie-out{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(12px) scale(.98)}}.dga-cookies-panel--open{animation:dga-cookie-in .32s cubic-bezier(.22,1,.36,1) both}.dga-cookies-panel--closing{animation:dga-cookie-out .2s ease-in both;pointer-events:none}.dga-cookies-body{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--dga-border-default, #d0d5dd) 70%,transparent) transparent}.dga-cookies-body::-webkit-scrollbar{width:4px}.dga-cookies-body::-webkit-scrollbar-thumb{border-radius:999px;background:color-mix(in srgb,var(--dga-border-default, #d0d5dd) 70%,transparent)}@media(prefers-reduced-motion:reduce){.dga-cookies-panel--open,.dga-cookies-panel--closing{animation:none!important}}\n"],dependencies:[{kind:"directive",type:h,selector:"button[dgaButton], a[dgaButton]",inputs:["variant","size","effect","iconOnly","fullWidth","cooldownMs","loading","dgaButtonClass"]},{kind:"component",type:v,selector:"dga-icon",inputs:["name","glyph","size","tone","label"]},{kind:"component",type:k,selector:"dga-icon-badge",inputs:["size","appearance"]},{kind:"directive",type:x,selector:"a[dgaLink]",inputs:["variant","dropdown"]},{kind:"component",type:N,selector:"dga-switch",inputs:["checked","size","label","disabled"],outputs:["checkedChange","changed"]}],changeDetection:s.ChangeDetectionStrategy.OnPush})}s.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:s,type:n,decorators:[{type:q,args:[{selector:"dga-cookies",standalone:!0,imports:[h,v,k,x,N],template:`
|
|
152
|
+
`,isInline:!0,styles:["@keyframes dga-cookie-in{0%{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes dga-cookie-out{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(12px) scale(.98)}}.dga-cookies-panel--open{animation:dga-cookie-in .32s cubic-bezier(.22,1,.36,1) both}.dga-cookies-panel--closing{animation:dga-cookie-out .2s ease-in both;pointer-events:none}.dga-cookies-body{scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--dga-border-default, #d0d5dd) 70%,transparent) transparent}.dga-cookies-body::-webkit-scrollbar{width:4px}.dga-cookies-body::-webkit-scrollbar-thumb{border-radius:999px;background:color-mix(in srgb,var(--dga-border-default, #d0d5dd) 70%,transparent)}@media(prefers-reduced-motion:reduce){.dga-cookies-panel--open,.dga-cookies-panel--closing{animation:none!important}}\n"],dependencies:[{kind:"directive",type:h,selector:"button[dgaButton], a[dgaButton]",inputs:["variant","size","effect","iconOnly","fullWidth","cooldownMs","loading","dgaButtonClass"]},{kind:"component",type:v,selector:"dga-icon",inputs:["name","glyph","size","tone","label"]},{kind:"component",type:k,selector:"dga-icon-badge",inputs:["size","appearance"]},{kind:"directive",type:x,selector:"a[dgaLink]",inputs:["variant","dropdown"]},{kind:"component",type:N,selector:"dga-switch",inputs:["checked","size","label","ariaLabel","disabled"],outputs:["checkedChange","changed"]}],changeDetection:s.ChangeDetectionStrategy.OnPush})}s.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:s,type:n,decorators:[{type:q,args:[{selector:"dga-cookies",standalone:!0,imports:[h,v,k,x,N],template:`
|
|
153
153
|
@if (mounted()) {
|
|
154
154
|
@if (hasOverlay()) {
|
|
155
155
|
<div
|
|
@@ -240,7 +240,7 @@ import*as s from"@angular/core";import{inject as y,DestroyRef as S,ElementRef as
|
|
|
240
240
|
class="mt-xxs"
|
|
241
241
|
[checked]="draftPrefs()[cat.id] === true"
|
|
242
242
|
[disabled]="!!cat.required"
|
|
243
|
-
[
|
|
243
|
+
[ariaLabel]="cat.label"
|
|
244
244
|
(changed)="onCategoryToggle(cat.id, $event)"
|
|
245
245
|
/>
|
|
246
246
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import*as i from"@angular/core";import{Directive as y,inject as g,ElementRef as Y,input as a,booleanAttribute as D,model as w,output as u,signal as l,contentChild as I,Injector as Q,DOCUMENT as W,DestroyRef as K,viewChild as P,computed as n,effect as L,untracked as z,afterNextRender as S,HostListener as b,ChangeDetectionStrategy as G,Component as Z}from"@angular/core";import{APP_BASE_HREF as X,PlatformLocation as J,NgOptimizedImage as O}from"@angular/common";import{dgaSafeHref as A,dgaCx as c,DgaAvatar as E,DgaBadge as H,DgaField as F,DgaFormControl as $,DgaFormEnd as R,DgaIcon as j,DgaIconBadge as q,DgaModal as V,DgaTooltip as U}from"@a.nemreen/dga-ui";function ee(k,e="/"){if(typeof window>"u")return!1;const t=A(k.trim(),e);if(!t)return!1;try{const o=new URL(t,window.location.origin);return o.protocol!=="http:"&&o.protocol!=="https:"||o.origin!==window.location.origin?!1:(window.location.assign(`${o.pathname}${o.search}${o.hash}`),!0)}catch{return!1}}class h{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:h,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:h,isStandalone:!0,selector:"[dgaHeaderLoginBeforeForm]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:h,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginBeforeForm]",standalone:!0}]}]});class x{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:x,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:x,isStandalone:!0,selector:"[dgaHeaderLoginAfterFields]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:x,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginAfterFields]",standalone:!0}]}]});class p{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:p,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:p,isStandalone:!0,selector:"[dgaHeaderLoginFooter]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:p,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginFooter]",standalone:!0}]}]});class m{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:m,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:m,isStandalone:!0,selector:"[dgaHeaderLoginForm]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:m,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginForm]",standalone:!0}]}]});function te(k,e){const t=k.trim();if(t.endsWith("rem")){const o=Number.parseFloat(t);return Number.isFinite(o)?o*16:e}if(t.endsWith("px")){const o=Number.parseFloat(t);return Number.isFinite(o)?o:e}return e}const T="group relative inline-flex h-(--size-header-portal) shrink-0 cursor-pointer items-center gap-md rounded-sm px-xl font-sans text-body-md font-medium text-fg hover:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",ie="pointer-events-none absolute start-xl end-xl bottom-0 h-[5px] rounded-full",oe="inline-flex min-h-5xl w-full cursor-pointer flex-col justify-center gap-xxs rounded-sm px-xl py-sm text-start text-body-md font-normal text-fg transition-colors hover:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",ne="inline-flex min-h-11xl w-full cursor-pointer flex-col justify-center gap-xs rounded-md border border-border bg-card px-2xl py-xl text-start transition-colors hover:border-primary hover:bg-primary-faint focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",ae="relative flex min-h-7xl w-full cursor-pointer items-center gap-lg rounded-md px-xl py-md text-start text-body-md font-medium text-fg transition-colors hover:bg-neutral-light active:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",se="flex min-h-6xl w-full cursor-pointer flex-col justify-center gap-xxs rounded-md px-xl py-md text-start text-body-md text-fg transition-colors hover:bg-neutral-light active:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";class v{host=g(Y);baseHref=g(X,{optional:!0})??g(J).getBaseHrefFromDOM()??"/";closeTimer=null;dropdownSyncFrame=null;lastDropdownStyleKey="";collapseId="dga-nav-collapse";dropLink=oe;dropTile=ne;mobileLink=se;brand=a("",...ngDevMode?[{debugName:"brand"}]:[]);brandSlogan=a("",...ngDevMode?[{debugName:"brandSlogan"}]:[]);brandLogo=a("",...ngDevMode?[{debugName:"brandLogo"}]:[]);brandLogoAlt=a("شعار الجهة",...ngDevMode?[{debugName:"brandLogoAlt"}]:[]);brandPlaceholder=a(!1,{...ngDevMode?{debugName:"brandPlaceholder"}:{},transform:D});brandHref=a("#",...ngDevMode?[{debugName:"brandHref"}]:[]);navLabel=a("التنقل الرئيسي",...ngDevMode?[{debugName:"navLabel"}]:[]);menuToggleLabel=a("فتح قائمة التنقل",...ngDevMode?[{debugName:"menuToggleLabel"}]:[]);menuCloseLabel=a("إغلاق قائمة التنقل",...ngDevMode?[{debugName:"menuCloseLabel"}]:[]);appearance=a("default",...ngDevMode?[{debugName:"appearance"}]:[]);mobileNav=a("sheet",...ngDevMode?[{debugName:"mobileNav"}]:[]);sticky=a(!0,{...ngDevMode?{debugName:"sticky"}:{},transform:D});items=a([],...ngDevMode?[{debugName:"items"}]:[]);actions=a([],...ngDevMode?[{debugName:"actions"}]:[]);search=a(null,...ngDevMode?[{debugName:"search"}]:[]);searchQuery=w("",...ngDevMode?[{debugName:"searchQuery"}]:[]);notifications=a(null,...ngDevMode?[{debugName:"notifications"}]:[]);login=a(null,...ngDevMode?[{debugName:"login"}]:[]);localeMenu=a(null,...ngDevMode?[{debugName:"localeMenu"}]:[]);user=a(null,...ngDevMode?[{debugName:"user"}]:[]);authenticated=w(!1,...ngDevMode?[{debugName:"authenticated"}]:[]);loginSubmitting=w(!1,...ngDevMode?[{debugName:"loginSubmitting"}]:[]);loginError=w("",...ngDevMode?[{debugName:"loginError"}]:[]);actionClick=u();searchSubmit=u();searchSuggestionSelect=u();searchVoice=u();notificationAction=u();loginSubmit=u();logout=u();userLinkClick=u();localeSelect=u();navLinkClick=u();mobileOpen=l(!1,...ngDevMode?[{debugName:"mobileOpen"}]:[]);openDropdown=l(null,...ngDevMode?[{debugName:"openDropdown"}]:[]);searchOpen=l(!1,...ngDevMode?[{debugName:"searchOpen"}]:[]);notificationsOpen=l(!1,...ngDevMode?[{debugName:"notificationsOpen"}]:[]);localeMenuOpen=l(!1,...ngDevMode?[{debugName:"localeMenuOpen"}]:[]);loginOpen=l(!1,...ngDevMode?[{debugName:"loginOpen"}]:[]);userMenuOpen=l(!1,...ngDevMode?[{debugName:"userMenuOpen"}]:[]);voiceListening=l(!1,...ngDevMode?[{debugName:"voiceListening"}]:[]);expandedNotificationId=l(null,...ngDevMode?[{debugName:"expandedNotificationId"}]:[]);loginEmail=l("",...ngDevMode?[{debugName:"loginEmail"}]:[]);loginPassword=l("",...ngDevMode?[{debugName:"loginPassword"}]:[]);showLoginPassword=l(!1,...ngDevMode?[{debugName:"showLoginPassword"}]:[]);loginEmailError=l("",...ngDevMode?[{debugName:"loginEmailError"}]:[]);loginPasswordError=l("",...ngDevMode?[{debugName:"loginPasswordError"}]:[]);dropdownPanelStyle=l({},...ngDevMode?[{debugName:"dropdownPanelStyle"}]:[]);customLoginForm=I(m,...ngDevMode?[{debugName:"customLoginForm"}]:[]);customLoginFooter=I(p,...ngDevMode?[{debugName:"customLoginFooter"}]:[]);dismissedNotificationIds=l(new Set,...ngDevMode?[{debugName:"dismissedNotificationIds"}]:[]);readNotificationIds=l(new Set,...ngDevMode?[{debugName:"readNotificationIds"}]:[]);dropdownTrigger=null;dropdownActionId=null;injector=g(Q);doc=g(W);destroyRef=g(K);searchInputRef=P("searchInput",...ngDevMode?[{debugName:"searchInputRef"}]:[]);utilLayerRef=P("utilLayer",...ngDevMode?[{debugName:"utilLayerRef"}]:[]);searchPanelId="dga-header-search-panel";notificationsPanelId="dga-header-notifications-panel";localePanelId="dga-header-locale-panel";loginPanelId="dga-header-login-panel";userPanelId="dga-header-user-panel";isPortal=n(()=>this.appearance()==="portal",...ngDevMode?[{debugName:"isPortal"}]:[]);appHref(e){return A(e,this.baseHref)}searchConfig=n(()=>this.search(),...ngDevMode?[{debugName:"searchConfig"}]:[]);searchActionId=n(()=>this.search()?.actionId??"search",...ngDevMode?[{debugName:"searchActionId"}]:[]);notificationsConfig=n(()=>this.notifications(),...ngDevMode?[{debugName:"notificationsConfig"}]:[]);notificationsActionId=n(()=>this.notifications()?.actionId??"notifications",...ngDevMode?[{debugName:"notificationsActionId"}]:[]);localeMenuConfig=n(()=>this.localeMenu(),...ngDevMode?[{debugName:"localeMenuConfig"}]:[]);localeActionId=n(()=>this.localeMenu()?.actionId??"lang",...ngDevMode?[{debugName:"localeActionId"}]:[]);loginConfig=n(()=>this.login(),...ngDevMode?[{debugName:"loginConfig"}]:[]);loginActionId=n(()=>this.login()?.actionId??"login",...ngDevMode?[{debugName:"loginActionId"}]:[]);userConfig=n(()=>this.user(),...ngDevMode?[{debugName:"userConfig"}]:[]);hasCustomLoginForm=n(()=>!!this.customLoginForm(),...ngDevMode?[{debugName:"hasCustomLoginForm"}]:[]);hasCustomLoginFooter=n(()=>!!this.customLoginFooter(),...ngDevMode?[{debugName:"hasCustomLoginFooter"}]:[]);utilityOverlayOpen=n(()=>this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen(),...ngDevMode?[{debugName:"utilityOverlayOpen"}]:[]);visibleNotifications=n(()=>{const e=this.notifications()?.items??[],t=this.dismissedNotificationIds(),o=this.readNotificationIds();return e.filter(s=>!t.has(s.id)).map(s=>({...s,read:!!s.read||o.has(s.id)}))},...ngDevMode?[{debugName:"visibleNotifications"}]:[]);unreadNotificationCount=n(()=>this.visibleNotifications().filter(e=>!e.read).length,...ngDevMode?[{debugName:"unreadNotificationCount"}]:[]);constructor(){this.destroyRef.onDestroy(()=>this.removePortaledUtilLayer()),L(()=>{this.mobileNav(),z(()=>{this.mobileOpen()&&this.closeAll()})}),L(()=>{if(!this.utilityOverlayOpen())return;this.utilLayerRef()?.nativeElement&&this.portalUtilLayer(),S(()=>this.portalUtilLayer(),{injector:this.injector})}),L(()=>{this.authenticated()&&this.loginOpen()&&z(()=>this.closeLogin())})}portalUtilLayer(){const e=this.utilLayerRef()?.nativeElement;!e||e.parentElement===this.doc.body||this.doc.body.appendChild(e)}removePortaledUtilLayer(){const e=this.utilLayerRef()?.nativeElement;e?.parentElement===this.doc.body&&e.remove()}activeWideDropdown=n(()=>{if(!this.hoverMenus()&&this.isMobileViewport())return null;const e=this.openDropdown();if(e===null)return null;const t=this.items()[e];if(!t?.dropdown)return null;const o=this.resolveVariant(t);return o==="menu"?null:{index:e,item:t,variant:o}},...ngDevMode?[{debugName:"activeWideDropdown"}]:[]);hostClasses=n(()=>c("relative block overflow-visible border-b border-border-subtle bg-nav font-sans text-fg",this.sticky()&&"sticky top-0 shadow-md",this.mobileOpen()&&this.mobileNav()!=="push"?"z-urgent":"z-header"),...ngDevMode?[{debugName:"hostClasses"}]:[]);innerClasses=n(()=>c("relative flex w-full gap-lg px-(--wrapper-padding)",this.appearance()==="default"&&"min-h-6xl items-center py-md",this.appearance()==="portal"&&"h-(--size-header-portal) items-stretch"),...ngDevMode?[{debugName:"innerClasses"}]:[]);desktopNavClasses=n(()=>c("min-w-0 flex-1",this.appearance()==="default"&&"flex flex-wrap items-center gap-lg self-center",this.appearance()==="portal"&&"hidden md:flex md:items-stretch"),...ngDevMode?[{debugName:"desktopNavClasses"}]:[]);actionsClasses=n(()=>c("ms-auto flex shrink-0 items-stretch empty:hidden",this.isPortal()&&this.items().length>0&&"max-md:hidden"),...ngDevMode?[{debugName:"actionsClasses"}]:[]);mobilePanelClass(){const e=this.mobileOpen(),t=this.mobileNav();return c("flex flex-col overflow-hidden bg-nav md:hidden",t==="sheet"&&"fixed top-0 bottom-0 end-0 z-urgent w-[min(16rem,70vw)] max-w-[16rem] rounded-s-xl border-s border-border shadow-2xl",t==="fullscreen"&&"fixed inset-0 z-urgent rounded-none border-0 shadow-none",t==="push"&&"absolute inset-x-0 top-full z-20 max-h-[min(70dvh,28rem)] border-b border-border shadow-lg",e?"dga-mobile-nav-open":"dga-mobile-nav-closed",e&&t==="sheet"&&"dga-mobile-sheet-open",e&&t==="fullscreen"&&"dga-mobile-fs-open",e&&t==="push"&&"dga-mobile-push-open")}hoverMenus(){return typeof matchMedia!="function"?!1:matchMedia("(hover: hover) and (pointer: fine)").matches}isMobileViewport(){return typeof matchMedia!="function"?!1:matchMedia("(max-width: 767px)").matches}resolveVariant(e){const t=e.dropdown;return t?t.variant?t.variant:t.featured?"featured":t.columns?.length||t.layout==="columns"||t.layout==="rows"?"mega":"menu":"menu"}resolveLayout(e){const t=e.dropdown;return t?t.layout?t.layout:t.columns?.length?"columns":"list":"list"}colCount(e){return e.dropdown?.columns?.length??0}flatLinks(e){const t=e.dropdown;return t?t.links?.length?t.links:t.columns?.flatMap(o=>o.links)??[]:[]}columnsGridClass(e){return c("grid w-full gap-2xl py-lg",e>1&&"sm:grid-cols-2",e>2&&"lg:grid-cols-3",e>3&&"xl:grid-cols-4")}featuredGridClass(e,t){return c("grid w-full gap-3xl",e==="featured"&&t&&"lg:grid-cols-[minmax(0,1fr)_minmax(14rem,18rem)]")}navItemClass(e,t=!1){return c(T,"justify-center",e&&"text-fg-primary",t&&"bg-neutral-light")}mobileItemClass(e,t=!1){return c(ae,e&&"bg-primary-faint",t&&"bg-neutral-light")}indicatorClass(e){return c(ie,e?"bg-primary group-hover:bg-primary":"bg-transparent group-hover:bg-fg-disabled")}actionClass(e){return c(T,"relative justify-center")}badgeClass(){return c("dga-action-badge absolute top-lg end-md flex h-lg min-w-lg","items-center justify-center rounded-full bg-error px-xxs","text-body-2xs font-medium text-on-color")}isIconOnly(e){return e.iconOnly!==!1}isSearchAction(e){return!!this.search()&&e.id===this.searchActionId()}isNotificationsAction(e){return!!this.notifications()&&e.id===this.notificationsActionId()}isLocaleAction(e){return!!this.localeMenu()&&e.id===this.localeActionId()}isLoginAction(e){return!!this.login()&&e.id===this.loginActionId()}actionTooltip(e){return this.isLoginAction(e)&&this.authenticated()&&this.user()?.name||e.label}actionAriaLabel(e){return this.actionTooltip(e)}actionExpanded(e){return this.isSearchAction(e)?this.searchOpen():this.isNotificationsAction(e)?this.notificationsOpen():this.isLocaleAction(e)?this.localeMenuOpen():this.isLoginAction(e)?this.authenticated()?this.userMenuOpen():this.loginOpen():null}actionControls(e){return this.isSearchAction(e)?this.searchPanelId:this.isNotificationsAction(e)?this.notificationsPanelId:this.isLocaleAction(e)?this.localePanelId:this.isLoginAction(e)?this.authenticated()?this.userPanelId:this.loginPanelId:null}actionIndicatorActive(e){return this.isSearchAction(e)?this.searchOpen():this.isNotificationsAction(e)?this.notificationsOpen():this.isLocaleAction(e)?this.localeMenuOpen():this.isLoginAction(e)?this.authenticated()?this.userMenuOpen():this.loginOpen():!1}clearCloseTimer(){this.closeTimer!==null&&(clearTimeout(this.closeTimer),this.closeTimer=null)}scheduleClose(){this.clearCloseTimer(),this.closeTimer=setTimeout(()=>{this.openDropdown.set(null),this.closeTimer=null},120)}setBodyScrollLocked(e){typeof document>"u"||document.documentElement.classList.toggle("dga-nav-locked",e)}unlockBodyIfIdle(){this.mobileOpen()||this.utilityOverlayOpen()||this.setBodyScrollLocked(!1)}onItemEnter(e){if(!this.isMobileViewport()){if(!this.items()[e]?.dropdown){this.hoverMenus()&&this.scheduleClose();return}this.clearCloseTimer(),this.hoverMenus()&&this.openDropdown.set(e)}}onPanelEnter(){this.clearCloseTimer()}onHostLeave(e){if(!this.hoverMenus()||this.isMobileViewport())return;const t=e.relatedTarget;t&&this.host.nativeElement.contains(t)||this.scheduleClose()}toggleMobile(){this.mobileOpen.update(e=>!e),this.openDropdown.set(null),this.setBodyScrollLocked(this.mobileOpen())}toggleDropdown(e,t){t.stopPropagation(),!(this.hoverMenus()&&!this.isMobileViewport()&&this.openDropdown()===e)&&(this.clearCloseTimer(),this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.openDropdown.update(o=>o===e?null:e))}closeAll(){this.clearCloseTimer(),this.openDropdown.set(null),this.mobileOpen.set(!1),this.closeSearch(!1),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.setBodyScrollLocked(!1)}onAction(e,t){const o=this.triggerFromEvent(t);if(this.isSearchAction(e)){this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleSearch(),this.actionClick.emit(e);return}if(this.isNotificationsAction(e)){this.closeSearch(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleNotifications(o),this.actionClick.emit(e);return}if(this.isLocaleAction(e)){this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.toggleLocaleMenu(o),this.actionClick.emit(e);return}if(this.isLoginAction(e)){this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.authenticated()?(this.closeLogin(),this.toggleUserMenu(o)):(this.closeUserMenu(),this.toggleLogin(o)),this.actionClick.emit(e);return}this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.actionClick.emit(e)}onMobileAction(e,t){const o=this.triggerFromEvent(t);if(this.isSearchAction(e)){this.mobileOpen.set(!1),this.setBodyScrollLocked(!1),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleSearch(),this.actionClick.emit(e);return}if(this.isNotificationsAction(e)){this.mobileOpen.set(!1),this.closeSearch(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleNotifications(o),this.isMobileViewport()&&this.setBodyScrollLocked(!0),this.actionClick.emit(e);return}if(this.isLocaleAction(e)){this.mobileOpen.set(!1),this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.toggleLocaleMenu(o),this.isMobileViewport()&&this.setBodyScrollLocked(!0),this.actionClick.emit(e);return}if(this.isLoginAction(e)){this.mobileOpen.set(!1),this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.authenticated()?(this.closeLogin(),this.toggleUserMenu(o)):(this.closeUserMenu(),this.toggleLogin(o)),this.isMobileViewport()&&this.setBodyScrollLocked(!0),this.actionClick.emit(e);return}this.actionClick.emit(e),this.closeAll()}closeUtilityOverlays(){this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu()}closePortalChromeMenus(){typeof document>"u"||document.dispatchEvent(new CustomEvent("dga-close-portal-chrome-menus"))}onCloseHeaderOverlays(){this.closeUtilityOverlays()}toggleSearch(){if(this.searchOpen()){this.closeSearch();return}this.openDropdown.set(null),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.closePortalChromeMenus(),this.searchOpen.set(!0)}onSearchModalOpenChange(e){if(e){this.searchOpen.set(!0);return}this.closeSearch()}focusSearchInput(){S(()=>this.searchInputRef()?.nativeElement.focus(),{injector:this.injector})}closeSearch(e=!0){this.searchOpen.set(!1),e&&this.stopVoice()}toggleNotifications(e){if(this.notificationsOpen()){this.closeNotifications();return}this.openDropdown.set(null),this.closeSearch(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.closePortalChromeMenus(),this.notificationsOpen.set(!0);const t=this.visibleNotifications()[0];this.expandedNotificationId.set(t?.id??null),this.scheduleDropdownSync(this.notificationsActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeNotifications(){this.notificationsOpen.set(!1),this.expandedNotificationId.set(null),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}toggleLocaleMenu(e){if(this.localeMenuOpen()){this.closeLocaleMenu();return}this.openDropdown.set(null),this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.closePortalChromeMenus(),this.localeMenuOpen.set(!0),this.scheduleDropdownSync(this.localeActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeLocaleMenu(){this.localeMenuOpen.set(!1),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}onLocalePick(e){this.localeSelect.emit(e),this.closeLocaleMenu()}toggleLogin(e){if(this.loginOpen()){this.closeLogin();return}this.openDropdown.set(null),this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeUserMenu(),this.closePortalChromeMenus(),this.loginOpen.set(!0),this.scheduleDropdownSync(this.loginActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeLogin(){this.loginOpen.set(!1),this.loginSubmitting.set(!1),this.loginError.set(""),this.loginEmailError.set(""),this.loginPasswordError.set(""),this.loginEmail.set(""),this.loginPassword.set(""),this.showLoginPassword.set(!1),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}toggleUserMenu(e){if(this.userMenuOpen()){this.closeUserMenu();return}this.openDropdown.set(null),this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closePortalChromeMenus(),this.userMenuOpen.set(!0),this.scheduleDropdownSync(this.loginActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeUserMenu(){this.userMenuOpen.set(!1),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}onLoginEmailInput(e){this.loginEmail.set(e),this.loginEmailError()&&this.loginEmailError.set("")}onLoginPasswordInput(e){this.loginPassword.set(e),this.loginPasswordError()&&this.loginPasswordError.set("")}showLoginRegisterRow(e){return!!(e.registerPrompt||e.registerLabel||e.registerHref)}loginPanelOuterStyle(){const e=this.dropdownPanelStyle();if(this.isMobileViewport())return e;const t=this.loginConfig()?.panelWidth??"24rem";return{...e,width:`min(${t}, calc(100vw - 2rem))`}}loginPanelInnerStyle(){return this.isMobileViewport()?{maxHeight:`min(90svh, ${this.loginConfig()?.maxHeight??"44rem"})`}:{}}onLoginSubmit(e){e.preventDefault();const t=this.loginConfig(),o=this.loginEmail().trim(),s=this.loginPassword();this.loginEmailError.set(""),this.loginPasswordError.set(""),this.loginError.set("");let r=!1;o?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o)||(this.loginEmailError.set(t?.emailInvalidMessage??"Enter a valid email address"),r=!0):(this.loginEmailError.set(t?.emailRequiredMessage??"Email is required"),r=!0),s||(this.loginPasswordError.set(t?.passwordRequiredMessage??"Password is required"),r=!0),!r&&(this.loginSubmitting.set(!0),this.loginSubmit.emit({email:o,password:s}))}onUserLink(e){if(this.userLinkClick.emit(e),e.id==="logout"||e.danger){this.authenticated.set(!1),this.logout.emit(),this.closeUserMenu();return}this.closeUserMenu()}toggleNotificationExpand(e){this.expandedNotificationId.update(t=>t===e.id?null:e.id),this.notificationAction.emit({item:e,action:"select"})}onNotificationAction(e,t){t==="read"&&this.readNotificationIds.update(o=>new Set([...o,e.id])),t==="dismiss"&&(this.dismissedNotificationIds.update(o=>new Set([...o,e.id])),this.expandedNotificationId.update(o=>o===e.id?null:o)),t==="view"&&e.href&&ee(e.href,this.baseHref),this.notificationAction.emit({item:e,action:t})}markAllNotificationsRead(){const e=this.visibleNotifications().map(t=>t.id);this.readNotificationIds.update(t=>new Set([...t,...e]))}clearSearchQuery(){this.searchQuery.set(""),queueMicrotask(()=>this.searchInputRef()?.nativeElement.focus())}applySearchSuggestion(e){const t=e.value??e.label;this.searchQuery.set(t),this.searchSuggestionSelect.emit(e),queueMicrotask(()=>this.searchInputRef()?.nativeElement.focus())}onSearchFormSubmit(e){e.preventDefault();const t=this.searchQuery().trim();this.searchSubmit.emit(t);const o=this.search();if(o?.resultsHref){const s=o.queryParam??"q",r=new URL(o.resultsHref,typeof window<"u"?window.location.origin:"http://localhost");t?r.searchParams.set(s,t):r.searchParams.delete(s),typeof window<"u"&&window.location.assign(`${r.pathname}${r.search}${r.hash}`)}this.closeSearch()}onSearchVoice(){if(this.searchVoice.emit(),typeof window>"u")return;const e=window,t=e.SpeechRecognition||e.webkitSpeechRecognition;if(!t)return;this.stopVoice();const o=new t;o.lang=typeof document<"u"&&document.documentElement.lang?document.documentElement.lang:"ar-SA",o.interimResults=!1,o.maxAlternatives=1,this.voiceListening.set(!0),o.onresult=s=>{const r=s.results[0]?.[0]?.transcript?.trim();r&&this.searchQuery.set(r),this.voiceListening.set(!1)},o.onerror=()=>this.voiceListening.set(!1),o.onend=()=>this.voiceListening.set(!1),this.speechRecognition=o,o.start()}speechRecognition=null;stopVoice(){this.speechRecognition?.stop(),this.speechRecognition=null,this.voiceListening.set(!1)}triggerFromEvent(e){const t=e?.currentTarget;return t instanceof HTMLElement?t:null}scheduleDropdownSync(e,t){this.dropdownActionId=e,this.dropdownTrigger=t??null,S(()=>this.requestDropdownSync(t),{injector:this.injector})}requestDropdownSync(e){if(typeof requestAnimationFrame!="function"){this.syncDropdownPanel(e);return}this.dropdownSyncFrame===null&&(this.dropdownSyncFrame=requestAnimationFrame(()=>{this.dropdownSyncFrame=null,this.syncDropdownPanel(e)}))}clearDropdownAnchor(){this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen()||(this.dropdownTrigger=null,this.dropdownActionId=null,this.lastDropdownStyleKey="",this.dropdownPanelStyle.set({}))}findActionTrigger(e){const t=this.host.nativeElement.querySelectorAll(`[data-dga-action="${CSS.escape(e)}"]`);for(const o of Array.from(t)){const s=o;if(s.getClientRects().length>0)return s}return t[0]??null}activeUtilityPanelWidthPx(){if(typeof window>"u")return 448;const e=window.innerWidth-32;if(this.loginOpen()){const t=this.loginConfig()?.panelWidth??"24rem";return Math.min(te(t,384),e)}return this.userMenuOpen()?Math.min(352,e):this.localeMenuOpen()?Math.min(256,e):(this.notificationsOpen(),Math.min(448,e))}syncDropdownPanel(e){if(typeof window>"u")return;if(this.isMobileViewport()){const d={top:"auto",bottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))",left:"0.75rem",right:"0.75rem",width:"auto",maxWidth:"none"},M=`sheet|${d.bottom}`;if(M===this.lastDropdownStyleKey)return;this.lastDropdownStyleKey=M,this.dropdownPanelStyle.set(d);return}const t=e??this.dropdownTrigger??(this.dropdownActionId?this.findActionTrigger(this.dropdownActionId):null);if(!t)return;this.dropdownTrigger=t;const o=t.getBoundingClientRect();if(o.width<1&&o.height<1)return;const s=getComputedStyle(this.host.nativeElement).direction,_=(typeof document<"u"?document.documentElement.getAttribute("dir"):null)==="rtl"||s==="rtl",B=8,C=this.activeUtilityPanelWidthPx(),f={top:`${Math.round(o.bottom+B)}px`};if(_){let d=Math.round(o.left);d=Math.max(16,Math.min(d,window.innerWidth-C-16)),f.left=`${d}px`,f.right="auto"}else{let d=Math.round(window.innerWidth-o.right);d=Math.max(16,Math.min(d,window.innerWidth-C-16)),f.right=`${d}px`,f.left="auto"}const N=`${f.top}|${f.left??""}|${f.right??""}`;N!==this.lastDropdownStyleKey&&(this.lastDropdownStyleKey=N,this.dropdownPanelStyle.set(f))}onKey(e){e.key==="Escape"&&this.closeAll()}onScroll(){(this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen())&&this.requestDropdownSync()}onResize(){typeof window>"u"||(window.matchMedia("(max-width: 767px)").matches||(this.mobileOpen.set(!1),this.setBodyScrollLocked(!1)),(this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen())&&(this.lastDropdownStyleKey="",this.requestDropdownSync()))}onNavLinkClick(e,t){this.navLinkClick.emit(e),e.href||t.preventDefault()}onDocClick(e){this.searchOpen()||this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen()||this.hoverMenus()&&!this.isMobileViewport()||this.mobileOpen()||this.host.nativeElement.contains(e.target)||this.openDropdown.set(null)}static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:v,deps:[],target:i.ɵɵFactoryTarget.Component});static ɵcmp=i.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"22.1.5",type:v,isStandalone:!0,selector:"dga-header",inputs:{brand:{classPropertyName:"brand",publicName:"brand",isSignal:!0,isRequired:!1,transformFunction:null},brandSlogan:{classPropertyName:"brandSlogan",publicName:"brandSlogan",isSignal:!0,isRequired:!1,transformFunction:null},brandLogo:{classPropertyName:"brandLogo",publicName:"brandLogo",isSignal:!0,isRequired:!1,transformFunction:null},brandLogoAlt:{classPropertyName:"brandLogoAlt",publicName:"brandLogoAlt",isSignal:!0,isRequired:!1,transformFunction:null},brandPlaceholder:{classPropertyName:"brandPlaceholder",publicName:"brandPlaceholder",isSignal:!0,isRequired:!1,transformFunction:null},brandHref:{classPropertyName:"brandHref",publicName:"brandHref",isSignal:!0,isRequired:!1,transformFunction:null},navLabel:{classPropertyName:"navLabel",publicName:"navLabel",isSignal:!0,isRequired:!1,transformFunction:null},menuToggleLabel:{classPropertyName:"menuToggleLabel",publicName:"menuToggleLabel",isSignal:!0,isRequired:!1,transformFunction:null},menuCloseLabel:{classPropertyName:"menuCloseLabel",publicName:"menuCloseLabel",isSignal:!0,isRequired:!1,transformFunction:null},appearance:{classPropertyName:"appearance",publicName:"appearance",isSignal:!0,isRequired:!1,transformFunction:null},mobileNav:{classPropertyName:"mobileNav",publicName:"mobileNav",isSignal:!0,isRequired:!1,transformFunction:null},sticky:{classPropertyName:"sticky",publicName:"sticky",isSignal:!0,isRequired:!1,transformFunction:null},items:{classPropertyName:"items",publicName:"items",isSignal:!0,isRequired:!1,transformFunction:null},actions:{classPropertyName:"actions",publicName:"actions",isSignal:!0,isRequired:!1,transformFunction:null},search:{classPropertyName:"search",publicName:"search",isSignal:!0,isRequired:!1,transformFunction:null},searchQuery:{classPropertyName:"searchQuery",publicName:"searchQuery",isSignal:!0,isRequired:!1,transformFunction:null},notifications:{classPropertyName:"notifications",publicName:"notifications",isSignal:!0,isRequired:!1,transformFunction:null},login:{classPropertyName:"login",publicName:"login",isSignal:!0,isRequired:!1,transformFunction:null},localeMenu:{classPropertyName:"localeMenu",publicName:"localeMenu",isSignal:!0,isRequired:!1,transformFunction:null},user:{classPropertyName:"user",publicName:"user",isSignal:!0,isRequired:!1,transformFunction:null},authenticated:{classPropertyName:"authenticated",publicName:"authenticated",isSignal:!0,isRequired:!1,transformFunction:null},loginSubmitting:{classPropertyName:"loginSubmitting",publicName:"loginSubmitting",isSignal:!0,isRequired:!1,transformFunction:null},loginError:{classPropertyName:"loginError",publicName:"loginError",isSignal:!0,isRequired:!1,transformFunction:null}},outputs:{searchQuery:"searchQueryChange",authenticated:"authenticatedChange",loginSubmitting:"loginSubmittingChange",loginError:"loginErrorChange",actionClick:"actionClick",searchSubmit:"searchSubmit",searchSuggestionSelect:"searchSuggestionSelect",searchVoice:"searchVoice",notificationAction:"notificationAction",loginSubmit:"loginSubmit",logout:"logout",userLinkClick:"userLinkClick",localeSelect:"localeSelect",navLinkClick:"navLinkClick"},host:{attributes:{role:"banner"},listeners:{mouseleave:"onHostLeave($event)","document:dga-close-header-overlays":"onCloseHeaderOverlays()","document:keydown":"onKey($event)","window:scroll":"onScroll()","window:resize":"onResize()","document:click":"onDocClick($event)"},properties:{class:"hostClasses()","attr.data-appearance":"appearance()","attr.data-mobile-nav":"mobileNav()","attr.data-mobile-open":"mobileOpen() || null"}},queries:[{propertyName:"customLoginForm",first:!0,predicate:m,descendants:!0,isSignal:!0},{propertyName:"customLoginFooter",first:!0,predicate:p,descendants:!0,isSignal:!0}],viewQueries:[{propertyName:"searchInputRef",first:!0,predicate:["searchInput"],descendants:!0,isSignal:!0},{propertyName:"utilLayerRef",first:!0,predicate:["utilLayer"],descendants:!0,isSignal:!0}],ngImport:i,template:`
|
|
1
|
+
import*as i from"@angular/core";import{Directive as y,inject as g,ElementRef as Y,input as a,booleanAttribute as D,model as w,output as u,signal as l,contentChild as I,Injector as Q,DOCUMENT as W,DestroyRef as K,viewChild as P,computed as n,effect as L,untracked as z,afterNextRender as S,HostListener as b,ChangeDetectionStrategy as G,Component as Z}from"@angular/core";import{APP_BASE_HREF as X,PlatformLocation as J,NgOptimizedImage as O}from"@angular/common";import{dgaSafeHref as A,dgaCx as c,DgaAvatar as E,DgaBadge as H,DgaField as F,DgaFormControl as $,DgaFormEnd as R,DgaIcon as j,DgaIconBadge as q,DgaModal as V,DgaTooltip as U}from"@a.nemreen/dga-ui";function ee(k,e="/"){if(typeof window>"u")return!1;const t=A(k.trim(),e);if(!t)return!1;try{const o=new URL(t,window.location.origin);return o.protocol!=="http:"&&o.protocol!=="https:"||o.origin!==window.location.origin?!1:(window.location.assign(`${o.pathname}${o.search}${o.hash}`),!0)}catch{return!1}}class h{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:h,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:h,isStandalone:!0,selector:"[dgaHeaderLoginBeforeForm]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:h,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginBeforeForm]",standalone:!0}]}]});class x{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:x,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:x,isStandalone:!0,selector:"[dgaHeaderLoginAfterFields]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:x,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginAfterFields]",standalone:!0}]}]});class p{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:p,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:p,isStandalone:!0,selector:"[dgaHeaderLoginFooter]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:p,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginFooter]",standalone:!0}]}]});class m{static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:m,deps:[],target:i.ɵɵFactoryTarget.Directive});static ɵdir=i.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.1.5",type:m,isStandalone:!0,selector:"[dgaHeaderLoginForm]",ngImport:i})}i.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:m,decorators:[{type:y,args:[{selector:"[dgaHeaderLoginForm]",standalone:!0}]}]});function te(k,e){const t=k.trim();if(t.endsWith("rem")){const o=Number.parseFloat(t);return Number.isFinite(o)?o*16:e}if(t.endsWith("px")){const o=Number.parseFloat(t);return Number.isFinite(o)?o:e}return e}const T="group relative inline-flex h-(--size-header-portal) shrink-0 cursor-pointer items-center gap-md rounded-sm px-xl font-sans text-body-md font-medium text-fg hover:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",ie="pointer-events-none absolute start-xl end-xl bottom-0 h-[5px] rounded-full",oe="inline-flex min-h-5xl w-full cursor-pointer flex-col justify-center gap-xxs rounded-sm px-xl py-sm text-start text-body-md font-normal text-fg transition-colors hover:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",ne="inline-flex min-h-11xl w-full cursor-pointer flex-col justify-center gap-xs rounded-md border border-border bg-card px-2xl py-xl text-start transition-colors hover:border-primary hover:bg-primary-faint focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",ae="relative flex min-h-7xl w-full cursor-pointer items-center gap-lg rounded-md px-xl py-md text-start text-body-md font-medium text-fg transition-colors hover:bg-neutral-light active:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",se="flex min-h-6xl w-full cursor-pointer flex-col justify-center gap-xxs rounded-md px-xl py-md text-start text-body-md text-fg transition-colors hover:bg-neutral-light active:bg-neutral-light focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus";class v{host=g(Y);baseHref=g(X,{optional:!0})??g(J).getBaseHrefFromDOM()??"/";closeTimer=null;dropdownSyncFrame=null;lastDropdownStyleKey="";collapseId="dga-nav-collapse";dropLink=oe;dropTile=ne;mobileLink=se;brand=a("",...ngDevMode?[{debugName:"brand"}]:[]);brandSlogan=a("",...ngDevMode?[{debugName:"brandSlogan"}]:[]);brandLogo=a("",...ngDevMode?[{debugName:"brandLogo"}]:[]);brandLogoAlt=a("شعار الجهة",...ngDevMode?[{debugName:"brandLogoAlt"}]:[]);brandPlaceholder=a(!1,{...ngDevMode?{debugName:"brandPlaceholder"}:{},transform:D});brandHref=a("#",...ngDevMode?[{debugName:"brandHref"}]:[]);navLabel=a("التنقل الرئيسي",...ngDevMode?[{debugName:"navLabel"}]:[]);menuToggleLabel=a("فتح قائمة التنقل",...ngDevMode?[{debugName:"menuToggleLabel"}]:[]);menuCloseLabel=a("إغلاق قائمة التنقل",...ngDevMode?[{debugName:"menuCloseLabel"}]:[]);appearance=a("default",...ngDevMode?[{debugName:"appearance"}]:[]);mobileNav=a("sheet",...ngDevMode?[{debugName:"mobileNav"}]:[]);sticky=a(!0,{...ngDevMode?{debugName:"sticky"}:{},transform:D});items=a([],...ngDevMode?[{debugName:"items"}]:[]);actions=a([],...ngDevMode?[{debugName:"actions"}]:[]);search=a(null,...ngDevMode?[{debugName:"search"}]:[]);searchQuery=w("",...ngDevMode?[{debugName:"searchQuery"}]:[]);notifications=a(null,...ngDevMode?[{debugName:"notifications"}]:[]);login=a(null,...ngDevMode?[{debugName:"login"}]:[]);localeMenu=a(null,...ngDevMode?[{debugName:"localeMenu"}]:[]);user=a(null,...ngDevMode?[{debugName:"user"}]:[]);authenticated=w(!1,...ngDevMode?[{debugName:"authenticated"}]:[]);loginSubmitting=w(!1,...ngDevMode?[{debugName:"loginSubmitting"}]:[]);loginError=w("",...ngDevMode?[{debugName:"loginError"}]:[]);actionClick=u();searchSubmit=u();searchSuggestionSelect=u();searchVoice=u();notificationAction=u();loginSubmit=u();logout=u();userLinkClick=u();localeSelect=u();navLinkClick=u();mobileOpen=l(!1,...ngDevMode?[{debugName:"mobileOpen"}]:[]);openDropdown=l(null,...ngDevMode?[{debugName:"openDropdown"}]:[]);searchOpen=l(!1,...ngDevMode?[{debugName:"searchOpen"}]:[]);notificationsOpen=l(!1,...ngDevMode?[{debugName:"notificationsOpen"}]:[]);localeMenuOpen=l(!1,...ngDevMode?[{debugName:"localeMenuOpen"}]:[]);loginOpen=l(!1,...ngDevMode?[{debugName:"loginOpen"}]:[]);userMenuOpen=l(!1,...ngDevMode?[{debugName:"userMenuOpen"}]:[]);voiceListening=l(!1,...ngDevMode?[{debugName:"voiceListening"}]:[]);expandedNotificationId=l(null,...ngDevMode?[{debugName:"expandedNotificationId"}]:[]);loginEmail=l("",...ngDevMode?[{debugName:"loginEmail"}]:[]);loginPassword=l("",...ngDevMode?[{debugName:"loginPassword"}]:[]);showLoginPassword=l(!1,...ngDevMode?[{debugName:"showLoginPassword"}]:[]);loginEmailError=l("",...ngDevMode?[{debugName:"loginEmailError"}]:[]);loginPasswordError=l("",...ngDevMode?[{debugName:"loginPasswordError"}]:[]);dropdownPanelStyle=l({},...ngDevMode?[{debugName:"dropdownPanelStyle"}]:[]);customLoginForm=I(m,...ngDevMode?[{debugName:"customLoginForm"}]:[]);customLoginFooter=I(p,...ngDevMode?[{debugName:"customLoginFooter"}]:[]);dismissedNotificationIds=l(new Set,...ngDevMode?[{debugName:"dismissedNotificationIds"}]:[]);readNotificationIds=l(new Set,...ngDevMode?[{debugName:"readNotificationIds"}]:[]);dropdownTrigger=null;dropdownActionId=null;injector=g(Q);doc=g(W);destroyRef=g(K);searchInputRef=P("searchInput",...ngDevMode?[{debugName:"searchInputRef"}]:[]);utilLayerRef=P("utilLayer",...ngDevMode?[{debugName:"utilLayerRef"}]:[]);searchPanelId="dga-header-search-panel";notificationsPanelId="dga-header-notifications-panel";localePanelId="dga-header-locale-panel";loginPanelId="dga-header-login-panel";userPanelId="dga-header-user-panel";isPortal=n(()=>this.appearance()==="portal",...ngDevMode?[{debugName:"isPortal"}]:[]);appHref(e){return A(e,this.baseHref)}searchConfig=n(()=>this.search(),...ngDevMode?[{debugName:"searchConfig"}]:[]);searchActionId=n(()=>this.search()?.actionId??"search",...ngDevMode?[{debugName:"searchActionId"}]:[]);notificationsConfig=n(()=>this.notifications(),...ngDevMode?[{debugName:"notificationsConfig"}]:[]);notificationsActionId=n(()=>this.notifications()?.actionId??"notifications",...ngDevMode?[{debugName:"notificationsActionId"}]:[]);localeMenuConfig=n(()=>this.localeMenu(),...ngDevMode?[{debugName:"localeMenuConfig"}]:[]);localeActionId=n(()=>this.localeMenu()?.actionId??"lang",...ngDevMode?[{debugName:"localeActionId"}]:[]);loginConfig=n(()=>this.login(),...ngDevMode?[{debugName:"loginConfig"}]:[]);loginActionId=n(()=>this.login()?.actionId??"login",...ngDevMode?[{debugName:"loginActionId"}]:[]);userConfig=n(()=>this.user(),...ngDevMode?[{debugName:"userConfig"}]:[]);hasCustomLoginForm=n(()=>!!this.customLoginForm(),...ngDevMode?[{debugName:"hasCustomLoginForm"}]:[]);hasCustomLoginFooter=n(()=>!!this.customLoginFooter(),...ngDevMode?[{debugName:"hasCustomLoginFooter"}]:[]);utilityOverlayOpen=n(()=>this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen(),...ngDevMode?[{debugName:"utilityOverlayOpen"}]:[]);visibleNotifications=n(()=>{const e=this.notifications()?.items??[],t=this.dismissedNotificationIds(),o=this.readNotificationIds();return e.filter(s=>!t.has(s.id)).map(s=>({...s,read:!!s.read||o.has(s.id)}))},...ngDevMode?[{debugName:"visibleNotifications"}]:[]);unreadNotificationCount=n(()=>this.visibleNotifications().filter(e=>!e.read).length,...ngDevMode?[{debugName:"unreadNotificationCount"}]:[]);constructor(){this.destroyRef.onDestroy(()=>this.removePortaledUtilLayer()),L(()=>{this.mobileNav(),z(()=>{this.mobileOpen()&&this.closeAll()})}),L(()=>{if(!this.utilityOverlayOpen())return;this.utilLayerRef()?.nativeElement&&this.portalUtilLayer(),S(()=>this.portalUtilLayer(),{injector:this.injector})}),L(()=>{this.authenticated()&&this.loginOpen()&&z(()=>this.closeLogin())})}portalUtilLayer(){const e=this.utilLayerRef()?.nativeElement;!e||e.parentElement===this.doc.body||this.doc.body.appendChild(e)}removePortaledUtilLayer(){const e=this.utilLayerRef()?.nativeElement;e?.parentElement===this.doc.body&&e.remove()}activeWideDropdown=n(()=>{if(!this.hoverMenus()&&this.isMobileViewport())return null;const e=this.openDropdown();if(e===null)return null;const t=this.items()[e];if(!t?.dropdown)return null;const o=this.resolveVariant(t);return o==="menu"?null:{index:e,item:t,variant:o}},...ngDevMode?[{debugName:"activeWideDropdown"}]:[]);hostClasses=n(()=>c("relative block overflow-visible border-b border-border-subtle bg-nav font-sans text-fg",this.sticky()&&"sticky top-0 shadow-md",this.mobileOpen()&&this.mobileNav()!=="push"?"z-urgent":"z-header"),...ngDevMode?[{debugName:"hostClasses"}]:[]);innerClasses=n(()=>c("relative flex w-full gap-lg px-(--wrapper-padding)",this.appearance()==="default"&&"min-h-6xl items-center py-md",this.appearance()==="portal"&&"h-(--size-header-portal) items-stretch"),...ngDevMode?[{debugName:"innerClasses"}]:[]);desktopNavClasses=n(()=>c("min-w-0 flex-1",this.appearance()==="default"&&"flex flex-wrap items-center gap-lg self-center",this.appearance()==="portal"&&"hidden md:flex md:items-stretch"),...ngDevMode?[{debugName:"desktopNavClasses"}]:[]);actionsClasses=n(()=>c("ms-auto flex shrink-0 items-stretch empty:hidden",this.isPortal()&&this.items().length>0&&"max-md:hidden"),...ngDevMode?[{debugName:"actionsClasses"}]:[]);mobilePanelClass(){const e=this.mobileOpen(),t=this.mobileNav();return c("flex flex-col overflow-hidden bg-nav md:hidden",t==="sheet"&&"fixed top-0 bottom-0 end-0 z-urgent w-[min(16rem,70vw)] max-w-[16rem] rounded-s-xl border-s border-border shadow-2xl",t==="fullscreen"&&"fixed inset-0 z-urgent rounded-none border-0 shadow-none",t==="push"&&"absolute inset-x-0 top-full z-20 max-h-[min(70dvh,28rem)] border-b border-border shadow-lg",e?"dga-mobile-nav-open":"dga-mobile-nav-closed",e&&t==="sheet"&&"dga-mobile-sheet-open",e&&t==="fullscreen"&&"dga-mobile-fs-open",e&&t==="push"&&"dga-mobile-push-open")}hoverMenus(){return typeof matchMedia!="function"?!1:matchMedia("(hover: hover) and (pointer: fine)").matches}isMobileViewport(){return typeof matchMedia!="function"?!1:matchMedia("(max-width: 767px)").matches}resolveVariant(e){const t=e.dropdown;return t?t.variant?t.variant:t.featured?"featured":t.columns?.length||t.layout==="columns"||t.layout==="rows"?"mega":"menu":"menu"}resolveLayout(e){const t=e.dropdown;return t?t.layout?t.layout:t.columns?.length?"columns":"list":"list"}colCount(e){return e.dropdown?.columns?.length??0}flatLinks(e){const t=e.dropdown;return t?t.links?.length?t.links:t.columns?.flatMap(o=>o.links)??[]:[]}columnsGridClass(e){return c("grid w-full gap-2xl py-lg",e>1&&"sm:grid-cols-2",e>2&&"lg:grid-cols-3",e>3&&"xl:grid-cols-4")}featuredGridClass(e,t){return c("grid w-full gap-3xl",e==="featured"&&t&&"lg:grid-cols-[minmax(0,1fr)_minmax(14rem,18rem)]")}navItemClass(e,t=!1){return c(T,"justify-center",e&&"text-fg-primary",t&&"bg-neutral-light")}mobileItemClass(e,t=!1){return c(ae,e&&"bg-primary-faint",t&&"bg-neutral-light")}indicatorClass(e){return c(ie,e?"bg-primary group-hover:bg-primary":"bg-transparent group-hover:bg-fg-disabled")}actionClass(e){return c(T,"relative justify-center")}badgeClass(){return c("dga-action-badge absolute top-lg end-md flex h-lg min-w-lg","items-center justify-center rounded-full bg-error px-xxs","text-body-2xs font-medium text-on-color")}isIconOnly(e){return e.iconOnly!==!1}isSearchAction(e){return!!this.search()&&e.id===this.searchActionId()}isNotificationsAction(e){return!!this.notifications()&&e.id===this.notificationsActionId()}isLocaleAction(e){return!!this.localeMenu()&&e.id===this.localeActionId()}isLoginAction(e){return e.id===this.loginActionId()}actionTooltip(e){return this.isLoginAction(e)&&this.authenticated()&&this.user()?.name||e.label}actionAriaLabel(e){return this.actionTooltip(e)}actionExpanded(e){return this.isSearchAction(e)?this.searchOpen():this.isNotificationsAction(e)?this.notificationsOpen():this.isLocaleAction(e)?this.localeMenuOpen():this.isLoginAction(e)?this.authenticated()?this.userMenuOpen():this.loginOpen():null}actionControls(e){return this.isSearchAction(e)?this.searchPanelId:this.isNotificationsAction(e)?this.notificationsPanelId:this.isLocaleAction(e)?this.localePanelId:this.isLoginAction(e)?this.authenticated()?this.userPanelId:this.loginPanelId:null}actionIndicatorActive(e){return this.isSearchAction(e)?this.searchOpen():this.isNotificationsAction(e)?this.notificationsOpen():this.isLocaleAction(e)?this.localeMenuOpen():this.isLoginAction(e)?this.authenticated()?this.userMenuOpen():this.loginOpen():!1}clearCloseTimer(){this.closeTimer!==null&&(clearTimeout(this.closeTimer),this.closeTimer=null)}scheduleClose(){this.clearCloseTimer(),this.closeTimer=setTimeout(()=>{this.openDropdown.set(null),this.closeTimer=null},120)}setBodyScrollLocked(e){typeof document>"u"||document.documentElement.classList.toggle("dga-nav-locked",e)}unlockBodyIfIdle(){this.mobileOpen()||this.utilityOverlayOpen()||this.setBodyScrollLocked(!1)}onItemEnter(e){if(!this.isMobileViewport()){if(!this.items()[e]?.dropdown){this.hoverMenus()&&this.scheduleClose();return}this.clearCloseTimer(),this.hoverMenus()&&this.openDropdown.set(e)}}onPanelEnter(){this.clearCloseTimer()}onHostLeave(e){if(!this.hoverMenus()||this.isMobileViewport())return;const t=e.relatedTarget;t&&this.host.nativeElement.contains(t)||this.scheduleClose()}toggleMobile(){this.mobileOpen.update(e=>!e),this.openDropdown.set(null),this.setBodyScrollLocked(this.mobileOpen())}toggleDropdown(e,t){t.stopPropagation(),!(this.hoverMenus()&&!this.isMobileViewport()&&this.openDropdown()===e)&&(this.clearCloseTimer(),this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.openDropdown.update(o=>o===e?null:e))}closeAll(){this.clearCloseTimer(),this.openDropdown.set(null),this.mobileOpen.set(!1),this.closeSearch(!1),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.setBodyScrollLocked(!1)}onAction(e,t){const o=this.triggerFromEvent(t);if(this.isSearchAction(e)){this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleSearch(),this.actionClick.emit(e);return}if(this.isNotificationsAction(e)){this.closeSearch(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleNotifications(o),this.actionClick.emit(e);return}if(this.isLocaleAction(e)){this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.toggleLocaleMenu(o),this.actionClick.emit(e);return}if(this.isLoginAction(e)){this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.authenticated()?(this.closeLogin(),this.toggleUserMenu(o)):(this.closeUserMenu(),this.toggleLogin(o)),this.actionClick.emit(e);return}this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.actionClick.emit(e)}onMobileAction(e,t){const o=this.triggerFromEvent(t);if(this.isSearchAction(e)){this.mobileOpen.set(!1),this.setBodyScrollLocked(!1),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleSearch(),this.actionClick.emit(e);return}if(this.isNotificationsAction(e)){this.mobileOpen.set(!1),this.closeSearch(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.toggleNotifications(o),this.isMobileViewport()&&this.setBodyScrollLocked(!0),this.actionClick.emit(e);return}if(this.isLocaleAction(e)){this.mobileOpen.set(!1),this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.toggleLocaleMenu(o),this.isMobileViewport()&&this.setBodyScrollLocked(!0),this.actionClick.emit(e);return}if(this.isLoginAction(e)){this.mobileOpen.set(!1),this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.authenticated()?(this.closeLogin(),this.toggleUserMenu(o)):(this.closeUserMenu(),this.toggleLogin(o)),this.isMobileViewport()&&this.setBodyScrollLocked(!0),this.actionClick.emit(e);return}this.actionClick.emit(e),this.closeAll()}closeUtilityOverlays(){this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu()}closePortalChromeMenus(){typeof document>"u"||document.dispatchEvent(new CustomEvent("dga-close-portal-chrome-menus"))}onCloseHeaderOverlays(){this.closeUtilityOverlays()}toggleSearch(){if(this.searchOpen()){this.closeSearch();return}this.openDropdown.set(null),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.closePortalChromeMenus(),this.searchOpen.set(!0)}onSearchModalOpenChange(e){if(e){this.searchOpen.set(!0);return}this.closeSearch()}focusSearchInput(){S(()=>this.searchInputRef()?.nativeElement.focus(),{injector:this.injector})}closeSearch(e=!0){this.searchOpen.set(!1),e&&this.stopVoice()}toggleNotifications(e){if(this.notificationsOpen()){this.closeNotifications();return}this.openDropdown.set(null),this.closeSearch(),this.closeLocaleMenu(),this.closeLogin(),this.closeUserMenu(),this.closePortalChromeMenus(),this.notificationsOpen.set(!0);const t=this.visibleNotifications()[0];this.expandedNotificationId.set(t?.id??null),this.scheduleDropdownSync(this.notificationsActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeNotifications(){this.notificationsOpen.set(!1),this.expandedNotificationId.set(null),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}toggleLocaleMenu(e){if(this.localeMenuOpen()){this.closeLocaleMenu();return}this.openDropdown.set(null),this.closeSearch(),this.closeNotifications(),this.closeLogin(),this.closeUserMenu(),this.closePortalChromeMenus(),this.localeMenuOpen.set(!0),this.scheduleDropdownSync(this.localeActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeLocaleMenu(){this.localeMenuOpen.set(!1),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}onLocalePick(e){this.localeSelect.emit(e),this.closeLocaleMenu()}toggleLogin(e){if(this.loginOpen()){this.closeLogin();return}this.openDropdown.set(null),this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeUserMenu(),this.closePortalChromeMenus(),this.loginOpen.set(!0),this.scheduleDropdownSync(this.loginActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeLogin(){this.loginOpen.set(!1),this.loginSubmitting.set(!1),this.loginError.set(""),this.loginEmailError.set(""),this.loginPasswordError.set(""),this.loginEmail.set(""),this.loginPassword.set(""),this.showLoginPassword.set(!1),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}toggleUserMenu(e){if(this.userMenuOpen()){this.closeUserMenu();return}this.openDropdown.set(null),this.closeSearch(),this.closeNotifications(),this.closeLocaleMenu(),this.closeLogin(),this.closePortalChromeMenus(),this.userMenuOpen.set(!0),this.scheduleDropdownSync(this.loginActionId(),e),this.isMobileViewport()&&this.setBodyScrollLocked(!0)}closeUserMenu(){this.userMenuOpen.set(!1),this.clearDropdownAnchor(),this.unlockBodyIfIdle()}onLoginEmailInput(e){this.loginEmail.set(e),this.loginEmailError()&&this.loginEmailError.set("")}onLoginPasswordInput(e){this.loginPassword.set(e),this.loginPasswordError()&&this.loginPasswordError.set("")}showLoginRegisterRow(e){return!!(e.registerPrompt||e.registerLabel||e.registerHref)}loginPanelOuterStyle(){const e=this.dropdownPanelStyle();if(this.isMobileViewport())return e;const t=this.loginConfig()?.panelWidth??"24rem";return{...e,width:`min(${t}, calc(100vw - 2rem))`}}loginPanelInnerStyle(){return this.isMobileViewport()?{maxHeight:`min(90svh, ${this.loginConfig()?.maxHeight??"44rem"})`}:{}}onLoginSubmit(e){e.preventDefault();const t=this.loginConfig(),o=this.loginEmail().trim(),s=this.loginPassword();this.loginEmailError.set(""),this.loginPasswordError.set(""),this.loginError.set("");let r=!1;o?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o)||(this.loginEmailError.set(t?.emailInvalidMessage??"Enter a valid email address"),r=!0):(this.loginEmailError.set(t?.emailRequiredMessage??"Email is required"),r=!0),s||(this.loginPasswordError.set(t?.passwordRequiredMessage??"Password is required"),r=!0),!r&&(this.loginSubmitting.set(!0),this.loginSubmit.emit({email:o,password:s}))}onUserLink(e){if(this.userLinkClick.emit(e),e.id==="logout"||e.danger){this.authenticated.set(!1),this.logout.emit(),this.closeUserMenu();return}this.closeUserMenu()}toggleNotificationExpand(e){this.expandedNotificationId.update(t=>t===e.id?null:e.id),this.notificationAction.emit({item:e,action:"select"})}onNotificationAction(e,t){t==="read"&&this.readNotificationIds.update(o=>new Set([...o,e.id])),t==="dismiss"&&(this.dismissedNotificationIds.update(o=>new Set([...o,e.id])),this.expandedNotificationId.update(o=>o===e.id?null:o)),t==="view"&&e.href&&ee(e.href,this.baseHref),this.notificationAction.emit({item:e,action:t})}markAllNotificationsRead(){const e=this.visibleNotifications().map(t=>t.id);this.readNotificationIds.update(t=>new Set([...t,...e]))}clearSearchQuery(){this.searchQuery.set(""),queueMicrotask(()=>this.searchInputRef()?.nativeElement.focus())}applySearchSuggestion(e){const t=e.value??e.label;this.searchQuery.set(t),this.searchSuggestionSelect.emit(e),queueMicrotask(()=>this.searchInputRef()?.nativeElement.focus())}onSearchFormSubmit(e){e.preventDefault();const t=this.searchQuery().trim();this.searchSubmit.emit(t);const o=this.search();if(o?.resultsHref){const s=o.queryParam??"q",r=new URL(o.resultsHref,typeof window<"u"?window.location.origin:"http://localhost");t?r.searchParams.set(s,t):r.searchParams.delete(s),typeof window<"u"&&window.location.assign(`${r.pathname}${r.search}${r.hash}`)}this.closeSearch()}onSearchVoice(){if(this.searchVoice.emit(),typeof window>"u")return;const e=window,t=e.SpeechRecognition||e.webkitSpeechRecognition;if(!t)return;this.stopVoice();const o=new t;o.lang=typeof document<"u"&&document.documentElement.lang?document.documentElement.lang:"ar-SA",o.interimResults=!1,o.maxAlternatives=1,this.voiceListening.set(!0),o.onresult=s=>{const r=s.results[0]?.[0]?.transcript?.trim();r&&this.searchQuery.set(r),this.voiceListening.set(!1)},o.onerror=()=>this.voiceListening.set(!1),o.onend=()=>this.voiceListening.set(!1),this.speechRecognition=o,o.start()}speechRecognition=null;stopVoice(){this.speechRecognition?.stop(),this.speechRecognition=null,this.voiceListening.set(!1)}triggerFromEvent(e){const t=e?.currentTarget;return t instanceof HTMLElement?t:null}scheduleDropdownSync(e,t){this.dropdownActionId=e,this.dropdownTrigger=t??null,S(()=>this.requestDropdownSync(t),{injector:this.injector})}requestDropdownSync(e){if(typeof requestAnimationFrame!="function"){this.syncDropdownPanel(e);return}this.dropdownSyncFrame===null&&(this.dropdownSyncFrame=requestAnimationFrame(()=>{this.dropdownSyncFrame=null,this.syncDropdownPanel(e)}))}clearDropdownAnchor(){this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen()||(this.dropdownTrigger=null,this.dropdownActionId=null,this.lastDropdownStyleKey="",this.dropdownPanelStyle.set({}))}findActionTrigger(e){const t=this.host.nativeElement.querySelectorAll(`[data-dga-action="${CSS.escape(e)}"]`);for(const o of Array.from(t)){const s=o;if(s.getClientRects().length>0)return s}return t[0]??null}activeUtilityPanelWidthPx(){if(typeof window>"u")return 448;const e=window.innerWidth-32;if(this.loginOpen()){const t=this.loginConfig()?.panelWidth??"24rem";return Math.min(te(t,384),e)}return this.userMenuOpen()?Math.min(352,e):this.localeMenuOpen()?Math.min(256,e):(this.notificationsOpen(),Math.min(448,e))}syncDropdownPanel(e){if(typeof window>"u")return;if(this.isMobileViewport()){const d={top:"auto",bottom:"max(0.75rem, env(safe-area-inset-bottom, 0px))",left:"0.75rem",right:"0.75rem",width:"auto",maxWidth:"none"},M=`sheet|${d.bottom}`;if(M===this.lastDropdownStyleKey)return;this.lastDropdownStyleKey=M,this.dropdownPanelStyle.set(d);return}const t=e??this.dropdownTrigger??(this.dropdownActionId?this.findActionTrigger(this.dropdownActionId):null);if(!t)return;this.dropdownTrigger=t;const o=t.getBoundingClientRect();if(o.width<1&&o.height<1)return;const s=getComputedStyle(this.host.nativeElement).direction,_=(typeof document<"u"?document.documentElement.getAttribute("dir"):null)==="rtl"||s==="rtl",B=8,C=this.activeUtilityPanelWidthPx(),f={top:`${Math.round(o.bottom+B)}px`};if(_){let d=Math.round(o.left);d=Math.max(16,Math.min(d,window.innerWidth-C-16)),f.left=`${d}px`,f.right="auto"}else{let d=Math.round(window.innerWidth-o.right);d=Math.max(16,Math.min(d,window.innerWidth-C-16)),f.right=`${d}px`,f.left="auto"}const N=`${f.top}|${f.left??""}|${f.right??""}`;N!==this.lastDropdownStyleKey&&(this.lastDropdownStyleKey=N,this.dropdownPanelStyle.set(f))}onKey(e){e.key==="Escape"&&this.closeAll()}onScroll(){(this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen())&&this.requestDropdownSync()}onResize(){typeof window>"u"||(window.matchMedia("(max-width: 767px)").matches||(this.mobileOpen.set(!1),this.setBodyScrollLocked(!1)),(this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen())&&(this.lastDropdownStyleKey="",this.requestDropdownSync()))}onNavLinkClick(e,t){this.navLinkClick.emit(e),e.href||t.preventDefault()}onDocClick(e){this.searchOpen()||this.notificationsOpen()||this.localeMenuOpen()||this.loginOpen()||this.userMenuOpen()||this.hoverMenus()&&!this.isMobileViewport()||this.mobileOpen()||this.host.nativeElement.contains(e.target)||this.openDropdown.set(null)}static ɵfac=i.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:i,type:v,deps:[],target:i.ɵɵFactoryTarget.Component});static ɵcmp=i.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"22.1.5",type:v,isStandalone:!0,selector:"dga-header",inputs:{brand:{classPropertyName:"brand",publicName:"brand",isSignal:!0,isRequired:!1,transformFunction:null},brandSlogan:{classPropertyName:"brandSlogan",publicName:"brandSlogan",isSignal:!0,isRequired:!1,transformFunction:null},brandLogo:{classPropertyName:"brandLogo",publicName:"brandLogo",isSignal:!0,isRequired:!1,transformFunction:null},brandLogoAlt:{classPropertyName:"brandLogoAlt",publicName:"brandLogoAlt",isSignal:!0,isRequired:!1,transformFunction:null},brandPlaceholder:{classPropertyName:"brandPlaceholder",publicName:"brandPlaceholder",isSignal:!0,isRequired:!1,transformFunction:null},brandHref:{classPropertyName:"brandHref",publicName:"brandHref",isSignal:!0,isRequired:!1,transformFunction:null},navLabel:{classPropertyName:"navLabel",publicName:"navLabel",isSignal:!0,isRequired:!1,transformFunction:null},menuToggleLabel:{classPropertyName:"menuToggleLabel",publicName:"menuToggleLabel",isSignal:!0,isRequired:!1,transformFunction:null},menuCloseLabel:{classPropertyName:"menuCloseLabel",publicName:"menuCloseLabel",isSignal:!0,isRequired:!1,transformFunction:null},appearance:{classPropertyName:"appearance",publicName:"appearance",isSignal:!0,isRequired:!1,transformFunction:null},mobileNav:{classPropertyName:"mobileNav",publicName:"mobileNav",isSignal:!0,isRequired:!1,transformFunction:null},sticky:{classPropertyName:"sticky",publicName:"sticky",isSignal:!0,isRequired:!1,transformFunction:null},items:{classPropertyName:"items",publicName:"items",isSignal:!0,isRequired:!1,transformFunction:null},actions:{classPropertyName:"actions",publicName:"actions",isSignal:!0,isRequired:!1,transformFunction:null},search:{classPropertyName:"search",publicName:"search",isSignal:!0,isRequired:!1,transformFunction:null},searchQuery:{classPropertyName:"searchQuery",publicName:"searchQuery",isSignal:!0,isRequired:!1,transformFunction:null},notifications:{classPropertyName:"notifications",publicName:"notifications",isSignal:!0,isRequired:!1,transformFunction:null},login:{classPropertyName:"login",publicName:"login",isSignal:!0,isRequired:!1,transformFunction:null},localeMenu:{classPropertyName:"localeMenu",publicName:"localeMenu",isSignal:!0,isRequired:!1,transformFunction:null},user:{classPropertyName:"user",publicName:"user",isSignal:!0,isRequired:!1,transformFunction:null},authenticated:{classPropertyName:"authenticated",publicName:"authenticated",isSignal:!0,isRequired:!1,transformFunction:null},loginSubmitting:{classPropertyName:"loginSubmitting",publicName:"loginSubmitting",isSignal:!0,isRequired:!1,transformFunction:null},loginError:{classPropertyName:"loginError",publicName:"loginError",isSignal:!0,isRequired:!1,transformFunction:null}},outputs:{searchQuery:"searchQueryChange",authenticated:"authenticatedChange",loginSubmitting:"loginSubmittingChange",loginError:"loginErrorChange",actionClick:"actionClick",searchSubmit:"searchSubmit",searchSuggestionSelect:"searchSuggestionSelect",searchVoice:"searchVoice",notificationAction:"notificationAction",loginSubmit:"loginSubmit",logout:"logout",userLinkClick:"userLinkClick",localeSelect:"localeSelect",navLinkClick:"navLinkClick"},host:{attributes:{role:"banner"},listeners:{mouseleave:"onHostLeave($event)","document:dga-close-header-overlays":"onCloseHeaderOverlays()","document:keydown":"onKey($event)","window:scroll":"onScroll()","window:resize":"onResize()","document:click":"onDocClick($event)"},properties:{class:"hostClasses()","attr.data-appearance":"appearance()","attr.data-mobile-nav":"mobileNav()","attr.data-mobile-open":"mobileOpen() || null"}},queries:[{propertyName:"customLoginForm",first:!0,predicate:m,descendants:!0,isSignal:!0},{propertyName:"customLoginFooter",first:!0,predicate:p,descendants:!0,isSignal:!0}],viewQueries:[{propertyName:"searchInputRef",first:!0,predicate:["searchInput"],descendants:!0,isSignal:!0},{propertyName:"utilLayerRef",first:!0,predicate:["utilLayer"],descendants:!0,isSignal:!0}],ngImport:i,template:`
|
|
2
2
|
<div [class]="innerClasses()">
|
|
3
3
|
<div class="relative flex min-w-0 shrink-0 items-center self-center">
|
|
4
4
|
<ng-content select="[dgaHeaderBrand]" />
|
|
@@ -1091,12 +1091,12 @@ import{DOCUMENT as ja,NgOptimizedImage as U,NgTemplateOutlet as ae,APP_BASE_HREF
|
|
|
1091
1091
|
} @else if (hint()) {
|
|
1092
1092
|
<p class="mt-xs text-body-xs text-muted">{{ hint() }}</p>
|
|
1093
1093
|
}
|
|
1094
|
-
`,changeDetection:h.OnPush,host:{class:"flex w-full flex-col","[attr.data-status]":'status() === "default" ? null : status()'}}]}],propDecorators:{label:[{type:t.Input,args:[{isSignal:!0,alias:"label",required:!1}]}],labelHint:[{type:t.Input,args:[{isSignal:!0,alias:"labelHint",required:!1}]}],hint:[{type:t.Input,args:[{isSignal:!0,alias:"hint",required:!1}]}],error:[{type:t.Input,args:[{isSignal:!0,alias:"error",required:!1}]}],status:[{type:t.Input,args:[{isSignal:!0,alias:"status",required:!1}]}],statusMessage:[{type:t.Input,args:[{isSignal:!0,alias:"statusMessage",required:!1}]}],controlId:[{type:t.Input,args:[{isSignal:!0,alias:"controlId",required:!1}]}],required:[{type:t.Input,args:[{isSignal:!0,alias:"required",required:!1}]}]}});const xr="relative inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed disabled:opacity-50",wr={sm:"h-2xl w-5xl p-xxs",md:"h-3xl w-6xl p-xxs",lg:"h-4xl w-7xl p-xs"},kr={sm:"size-xl",md:"size-2xl",lg:"size-3xl"};class We{checked=S(!1,...ngDevMode?[{debugName:"checked"}]:[]);size=i("md",...ngDevMode?[{debugName:"size"}]:[]);label=i("",...ngDevMode?[{debugName:"label"}]:[]);disabledInput=i(!1,{...ngDevMode?{debugName:"disabledInput"}:{},alias:"disabled",transform:m});cvaDisabled=y(!1,...ngDevMode?[{debugName:"cvaDisabled"}]:[]);disabled=n(()=>this.disabledInput()||this.cvaDisabled(),...ngDevMode?[{debugName:"disabled"}]:[]);changed=w();onChange=()=>{};onTouched=()=>{};trackClasses=n(()=>f(xr,wr[this.size()],this.checked()?"bg-primary justify-end":"bg-border justify-start"),...ngDevMode?[{debugName:"trackClasses"}]:[]);thumbClasses=n(()=>f("inline-block rounded-full bg-on-color shadow-sm transition-transform",kr[this.size()]),...ngDevMode?[{debugName:"thumbClasses"}]:[]);toggle(){if(this.disabled())return;const e=!this.checked();this.checked.set(e),this.changed.emit(e),this.onChange(e)}writeValue(e){this.checked.set(!!e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.cvaDisabled.set(e)}static ɵfac=t.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:t,type:We,deps:[],target:t.ɵɵFactoryTarget.Component});static ɵcmp=t.ɵɵngDeclareComponent({minVersion:"17.1.0",version:"22.1.5",type:We,isStandalone:!0,selector:"dga-switch",inputs:{checked:{classPropertyName:"checked",publicName:"checked",isSignal:!0,isRequired:!1,transformFunction:null},size:{classPropertyName:"size",publicName:"size",isSignal:!0,isRequired:!1,transformFunction:null},label:{classPropertyName:"label",publicName:"label",isSignal:!0,isRequired:!1,transformFunction:null},disabledInput:{classPropertyName:"disabledInput",publicName:"disabled",isSignal:!0,isRequired:!1,transformFunction:null}},outputs:{checked:"checkedChange",changed:"changed"},host:{properties:{"attr.data-size":"size()"},classAttribute:"inline-flex items-center gap-md"},providers:[P(We)],ngImport:t,template:`
|
|
1094
|
+
`,changeDetection:h.OnPush,host:{class:"flex w-full flex-col","[attr.data-status]":'status() === "default" ? null : status()'}}]}],propDecorators:{label:[{type:t.Input,args:[{isSignal:!0,alias:"label",required:!1}]}],labelHint:[{type:t.Input,args:[{isSignal:!0,alias:"labelHint",required:!1}]}],hint:[{type:t.Input,args:[{isSignal:!0,alias:"hint",required:!1}]}],error:[{type:t.Input,args:[{isSignal:!0,alias:"error",required:!1}]}],status:[{type:t.Input,args:[{isSignal:!0,alias:"status",required:!1}]}],statusMessage:[{type:t.Input,args:[{isSignal:!0,alias:"statusMessage",required:!1}]}],controlId:[{type:t.Input,args:[{isSignal:!0,alias:"controlId",required:!1}]}],required:[{type:t.Input,args:[{isSignal:!0,alias:"required",required:!1}]}]}});const xr="relative inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:cursor-not-allowed disabled:opacity-50",wr={sm:"h-2xl w-5xl p-xxs",md:"h-3xl w-6xl p-xxs",lg:"h-4xl w-7xl p-xs"},kr={sm:"size-xl",md:"size-2xl",lg:"size-3xl"};class We{checked=S(!1,...ngDevMode?[{debugName:"checked"}]:[]);size=i("md",...ngDevMode?[{debugName:"size"}]:[]);label=i("",...ngDevMode?[{debugName:"label"}]:[]);ariaLabel=i("",...ngDevMode?[{debugName:"ariaLabel"}]:[]);disabledInput=i(!1,{...ngDevMode?{debugName:"disabledInput"}:{},alias:"disabled",transform:m});cvaDisabled=y(!1,...ngDevMode?[{debugName:"cvaDisabled"}]:[]);disabled=n(()=>this.disabledInput()||this.cvaDisabled(),...ngDevMode?[{debugName:"disabled"}]:[]);resolvedAriaLabel=n(()=>this.ariaLabel()||this.label()||null,...ngDevMode?[{debugName:"resolvedAriaLabel"}]:[]);changed=w();onChange=()=>{};onTouched=()=>{};trackClasses=n(()=>f(xr,wr[this.size()],this.checked()?"bg-primary justify-end":"bg-border justify-start"),...ngDevMode?[{debugName:"trackClasses"}]:[]);thumbClasses=n(()=>f("inline-block rounded-full bg-on-color shadow-sm transition-transform",kr[this.size()]),...ngDevMode?[{debugName:"thumbClasses"}]:[]);toggle(){if(this.disabled())return;const e=!this.checked();this.checked.set(e),this.changed.emit(e),this.onChange(e)}writeValue(e){this.checked.set(!!e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.cvaDisabled.set(e)}static ɵfac=t.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:t,type:We,deps:[],target:t.ɵɵFactoryTarget.Component});static ɵcmp=t.ɵɵngDeclareComponent({minVersion:"17.1.0",version:"22.1.5",type:We,isStandalone:!0,selector:"dga-switch",inputs:{checked:{classPropertyName:"checked",publicName:"checked",isSignal:!0,isRequired:!1,transformFunction:null},size:{classPropertyName:"size",publicName:"size",isSignal:!0,isRequired:!1,transformFunction:null},label:{classPropertyName:"label",publicName:"label",isSignal:!0,isRequired:!1,transformFunction:null},ariaLabel:{classPropertyName:"ariaLabel",publicName:"ariaLabel",isSignal:!0,isRequired:!1,transformFunction:null},disabledInput:{classPropertyName:"disabledInput",publicName:"disabled",isSignal:!0,isRequired:!1,transformFunction:null}},outputs:{checked:"checkedChange",changed:"changed"},host:{properties:{"attr.data-size":"size()"},classAttribute:"inline-flex items-center gap-md"},providers:[P(We)],ngImport:t,template:`
|
|
1095
1095
|
<button
|
|
1096
1096
|
type="button"
|
|
1097
1097
|
role="switch"
|
|
1098
1098
|
[attr.aria-checked]="checked()"
|
|
1099
|
-
[attr.aria-label]="
|
|
1099
|
+
[attr.aria-label]="resolvedAriaLabel()"
|
|
1100
1100
|
[disabled]="disabled()"
|
|
1101
1101
|
[class]="trackClasses()"
|
|
1102
1102
|
(click)="toggle()"
|
|
@@ -1104,12 +1104,13 @@ import{DOCUMENT as ja,NgOptimizedImage as U,NgTemplateOutlet as ae,APP_BASE_HREF
|
|
|
1104
1104
|
>
|
|
1105
1105
|
<span aria-hidden="true" [class]="thumbClasses()"></span>
|
|
1106
1106
|
</button>
|
|
1107
|
+
<span class="text-body-md text-fg" [hidden]="!label()">{{ label() }}</span>
|
|
1107
1108
|
`,isInline:!0,changeDetection:t.ChangeDetectionStrategy.OnPush})}t.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.1.5",ngImport:t,type:We,decorators:[{type:v,args:[{selector:"dga-switch",standalone:!0,template:`
|
|
1108
1109
|
<button
|
|
1109
1110
|
type="button"
|
|
1110
1111
|
role="switch"
|
|
1111
1112
|
[attr.aria-checked]="checked()"
|
|
1112
|
-
[attr.aria-label]="
|
|
1113
|
+
[attr.aria-label]="resolvedAriaLabel()"
|
|
1113
1114
|
[disabled]="disabled()"
|
|
1114
1115
|
[class]="trackClasses()"
|
|
1115
1116
|
(click)="toggle()"
|
|
@@ -1117,7 +1118,8 @@ import{DOCUMENT as ja,NgOptimizedImage as U,NgTemplateOutlet as ae,APP_BASE_HREF
|
|
|
1117
1118
|
>
|
|
1118
1119
|
<span aria-hidden="true" [class]="thumbClasses()"></span>
|
|
1119
1120
|
</button>
|
|
1120
|
-
|
|
1121
|
+
<span class="text-body-md text-fg" [hidden]="!label()">{{ label() }}</span>
|
|
1122
|
+
`,changeDetection:h.OnPush,host:{class:"inline-flex items-center gap-md","[attr.data-size]":"size()"},providers:[P(We)]}]}],propDecorators:{checked:[{type:t.Input,args:[{isSignal:!0,alias:"checked",required:!1}]},{type:t.Output,args:["checkedChange"]}],size:[{type:t.Input,args:[{isSignal:!0,alias:"size",required:!1}]}],label:[{type:t.Input,args:[{isSignal:!0,alias:"label",required:!1}]}],ariaLabel:[{type:t.Input,args:[{isSignal:!0,alias:"ariaLabel",required:!1}]}],disabledInput:[{type:t.Input,args:[{isSignal:!0,alias:"disabled",required:!1}]}],changed:[{type:t.Output,args:["changed"]}]}});class Ye{valueInput=i(0,{...ngDevMode?{debugName:"valueInput"}:{},alias:"value"});value=_e(this.valueInput,...ngDevMode?[{debugName:"value"}]:[]);min=i(Number.NEGATIVE_INFINITY,...ngDevMode?[{debugName:"min"}]:[]);max=i(Number.POSITIVE_INFINITY,...ngDevMode?[{debugName:"max"}]:[]);stepSize=i(1,{...ngDevMode?{debugName:"stepSize"}:{},alias:"step"});size=i("md",...ngDevMode?[{debugName:"size"}]:[]);label=i("",...ngDevMode?[{debugName:"label"}]:[]);controlId=i("",...ngDevMode?[{debugName:"controlId"}]:[]);name=i("",...ngDevMode?[{debugName:"name"}]:[]);incrementLabel=i("زيادة",...ngDevMode?[{debugName:"incrementLabel"}]:[]);decrementLabel=i("إنقاص",...ngDevMode?[{debugName:"decrementLabel"}]:[]);disabledInput=i(!1,{...ngDevMode?{debugName:"disabledInput"}:{},alias:"disabled",transform:m});cvaDisabled=y(!1,...ngDevMode?[{debugName:"cvaDisabled"}]:[]);disabled=n(()=>this.disabledInput()||this.cvaDisabled(),...ngDevMode?[{debugName:"disabled"}]:[]);invalid=i(!1,{...ngDevMode?{debugName:"invalid"}:{},alias:"dgaInvalid",transform:m});status=i("default",...ngDevMode?[{debugName:"status"}]:[]);valueChange=w();onChange=()=>{};onTouched=()=>{};resolvedStatus=n(()=>this.status()!=="default"?this.status():X(this.invalid()),...ngDevMode?[{debugName:"resolvedStatus"}]:[]);wrapClasses=n(()=>{const e=this.size();return f("flex w-full items-stretch border bg-surface text-fg","transition-[border-color,box-shadow,background-color] duration-200",Z(this.resolvedStatus()),e==="sm"&&"min-h-4xl rounded-md text-body-sm",e==="md"&&"min-h-5xl rounded-md text-body-md",e==="lg"&&"min-h-6xl rounded-md text-body-lg",ie(this.resolvedStatus()),this.disabled()&&"pointer-events-none border-border-disabled bg-disabled opacity-70",!this.disabled()&&"hover:border-border-primary-light")},...ngDevMode?[{debugName:"wrapClasses"}]:[]);step(e){this.disabled()||this.commit(this.clamp(this.value()+e*this.stepSize()))}onType(e){const a=Number(e);Number.isNaN(a)||this.commit(this.clamp(a))}finiteOrNull(e){return Number.isFinite(e)?e:null}clamp(e){return Math.min(this.max(),Math.max(this.min(),e))}commit(e){this.value.set(e),this.valueChange.emit(e),this.onChange(e)}writeValue(e){this.value.set(e??0)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.cvaDisabled.set(e)}static ɵfac=t.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.1.5",ngImport:t,type:Ye,deps:[],target:t.ɵɵFactoryTarget.Component});static ɵcmp=t.ɵɵngDeclareComponent({minVersion:"17.1.0",version:"22.1.5",type:Ye,isStandalone:!0,selector:"dga-number-input",inputs:{valueInput:{classPropertyName:"valueInput",publicName:"value",isSignal:!0,isRequired:!1,transformFunction:null},min:{classPropertyName:"min",publicName:"min",isSignal:!0,isRequired:!1,transformFunction:null},max:{classPropertyName:"max",publicName:"max",isSignal:!0,isRequired:!1,transformFunction:null},stepSize:{classPropertyName:"stepSize",publicName:"step",isSignal:!0,isRequired:!1,transformFunction:null},size:{classPropertyName:"size",publicName:"size",isSignal:!0,isRequired:!1,transformFunction:null},label:{classPropertyName:"label",publicName:"label",isSignal:!0,isRequired:!1,transformFunction:null},controlId:{classPropertyName:"controlId",publicName:"controlId",isSignal:!0,isRequired:!1,transformFunction:null},name:{classPropertyName:"name",publicName:"name",isSignal:!0,isRequired:!1,transformFunction:null},incrementLabel:{classPropertyName:"incrementLabel",publicName:"incrementLabel",isSignal:!0,isRequired:!1,transformFunction:null},decrementLabel:{classPropertyName:"decrementLabel",publicName:"decrementLabel",isSignal:!0,isRequired:!1,transformFunction:null},disabledInput:{classPropertyName:"disabledInput",publicName:"disabled",isSignal:!0,isRequired:!1,transformFunction:null},invalid:{classPropertyName:"invalid",publicName:"dgaInvalid",isSignal:!0,isRequired:!1,transformFunction:null},status:{classPropertyName:"status",publicName:"status",isSignal:!0,isRequired:!1,transformFunction:null}},outputs:{valueChange:"valueChange"},host:{properties:{"attr.data-size":"size()"},classAttribute:"block w-full"},providers:[P(Ye)],ngImport:t,template:`
|
|
1121
1123
|
<div [class]="wrapClasses()" [attr.data-status]="resolvedStatus() === 'default' ? null : resolvedStatus()">
|
|
1122
1124
|
<button
|
|
1123
1125
|
type="button"
|
package/package.json
CHANGED
|
@@ -717,9 +717,11 @@ declare class DgaSwitch implements ControlValueAccessor {
|
|
|
717
717
|
readonly checked: _angular_core.ModelSignal<boolean>;
|
|
718
718
|
readonly size: _angular_core.InputSignal<DgaSwitchSize>;
|
|
719
719
|
readonly label: _angular_core.InputSignal<string>;
|
|
720
|
+
readonly ariaLabel: _angular_core.InputSignal<string>;
|
|
720
721
|
readonly disabledInput: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
721
722
|
private readonly cvaDisabled;
|
|
722
723
|
readonly disabled: _angular_core.Signal<boolean>;
|
|
724
|
+
readonly resolvedAriaLabel: _angular_core.Signal<string | null>;
|
|
723
725
|
readonly changed: _angular_core.OutputEmitterRef<boolean>;
|
|
724
726
|
private onChange;
|
|
725
727
|
onTouched: () => void;
|
|
@@ -731,7 +733,7 @@ declare class DgaSwitch implements ControlValueAccessor {
|
|
|
731
733
|
registerOnTouched(fn: () => void): void;
|
|
732
734
|
setDisabledState(isDisabled: boolean): void;
|
|
733
735
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<DgaSwitch, never>;
|
|
734
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DgaSwitch, "dga-switch", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "changed": "changed"; }, never, never, true, never>;
|
|
736
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<DgaSwitch, "dga-switch", never, { "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "disabledInput": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "changed": "changed"; }, never, never, true, never>;
|
|
735
737
|
}
|
|
736
738
|
|
|
737
739
|
declare class DgaNumberInput implements ControlValueAccessor {
|