@tectra-ng/blocks 0.4.0 → 0.4.2
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/cookie-notice/README.md +3 -1
- package/fesm2022/tectra-ng-blocks-action-tile.mjs +2 -0
- package/fesm2022/tectra-ng-blocks-action-tile.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-app-layout.mjs +4 -2
- package/fesm2022/tectra-ng-blocks-app-layout.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-command-palette.mjs +2 -2
- package/fesm2022/tectra-ng-blocks-command-palette.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-console-layout.mjs +2 -0
- package/fesm2022/tectra-ng-blocks-console-layout.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs +53 -7
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-empty-state.mjs +2 -0
- package/fesm2022/tectra-ng-blocks-empty-state.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs +2 -2
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-network-status.mjs +114 -34
- package/fesm2022/tectra-ng-blocks-network-status.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-page-header.mjs +4 -2
- package/fesm2022/tectra-ng-blocks-page-header.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs +41 -6
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-public-header.mjs +4 -4
- package/fesm2022/tectra-ng-blocks-public-header.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks-theme-configurator.mjs +414 -0
- package/fesm2022/tectra-ng-blocks-theme-configurator.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-wizard.mjs +55 -25
- package/fesm2022/tectra-ng-blocks-wizard.mjs.map +1 -1
- package/fesm2022/tectra-ng-blocks.mjs +1 -1
- package/network-status/README.md +20 -4
- package/package.json +11 -6
- package/pinned-tabs/README.md +5 -1
- package/theme-configurator/README.md +59 -0
- package/types/tectra-ng-blocks-action-tile.d.ts.map +1 -1
- package/types/tectra-ng-blocks-app-layout.d.ts.map +1 -1
- package/types/tectra-ng-blocks-console-layout.d.ts.map +1 -1
- package/types/tectra-ng-blocks-cookie-notice.d.ts +15 -0
- package/types/tectra-ng-blocks-cookie-notice.d.ts.map +1 -1
- package/types/tectra-ng-blocks-empty-state.d.ts.map +1 -1
- package/types/tectra-ng-blocks-network-status.d.ts +29 -7
- package/types/tectra-ng-blocks-network-status.d.ts.map +1 -1
- package/types/tectra-ng-blocks-page-header.d.ts.map +1 -1
- package/types/tectra-ng-blocks-pinned-tabs.d.ts +15 -0
- package/types/tectra-ng-blocks-pinned-tabs.d.ts.map +1 -1
- package/types/tectra-ng-blocks-theme-configurator.d.ts +98 -0
- package/types/tectra-ng-blocks-theme-configurator.d.ts.map +1 -0
- package/types/tectra-ng-blocks-wizard.d.ts +2 -0
- package/types/tectra-ng-blocks-wizard.d.ts.map +1 -1
- package/types/tectra-ng-blocks.d.ts +1 -1
- package/wizard/README.md +1 -1
|
@@ -253,8 +253,8 @@ var TxPublicHeader = class TxPublicHeader {
|
|
|
253
253
|
isSignal: true
|
|
254
254
|
}],
|
|
255
255
|
ngImport: i0,
|
|
256
|
-
template: "<ng-template #brandContent>\n @if (brandSlot()) {\n <ng-content select=\"[txPublicHeaderBrand]\" />\n } @else {\n @if (logo(); as logo) {\n <img class=\"tx-public-header__logo\" alt=\"\" [src]=\"logo\" [class]=\"passThrough().logo?.class\" [style]=\"passThrough().logo?.style\" />\n }\n <span>{{ brand() }}</span>\n }\n</ng-template>\n<header class=\"tx-public-header__bar\" [class]=\"passThrough().bar?.class\" [style]=\"passThrough().bar?.style\">\n <div class=\"tx-public-header__inner\">\n @if (router) {\n <a\n class=\"tx-public-header__brand\"\n [routerLink]=\"homeLink()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n (click)=\"close()\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n } @else {\n <a\n class=\"tx-public-header__brand\"\n [href]=\"homeHref()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- closes the menu after a link or a button inside was used; they handle the keyboard themselves -->\n <div class=\"tx-public-header__panel\" [id]=\"panelId\" [class]=\"passThrough().panel?.class\" [style]=\"passThrough().panel?.style\" (click)=\"onPanelClick($event)\" (animationend)=\"onPanelAnimationEnd($event)\">\n <div class=\"tx-public-header__nav\" [class]=\"passThrough().nav?.class\" [style]=\"passThrough().nav?.style\">\n <ng-content select=\"[txPublicHeaderNav]\" />\n </div>\n <div class=\"tx-public-header__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\">\n @if (preferences()) {\n <tx-topbar-preferences class=\"tx-public-header__preferences\" [layout]=\"compact() ? 'stacked' : 'inline'\" [unstyled]=\"isUnstyled()\" />\n }\n <div class=\"tx-public-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPublicHeaderActions]\" />\n </div>\n </div>\n </div>\n\n <button\n #menuButton\n type=\"button\"\n class=\"tx-public-header__toggle\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"open() ? translations().closeMenu : translations().openMenu\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n (click)=\"toggle()\"\n >\n <tx-icon aria-hidden=\"true\" [name]=\"open() ? 'times' : 'bars'\" />\n </button>\n </div>\n</header>\n",
|
|
257
|
-
styles: [":host{position:sticky;top:0;display:block}:host([data-responsive=container]){container:tx-public-header/inline-size;contain:layout}.tx-public-header__bar{position:relative}.tx-public-header__inner{display:flex;align-items:center;box-sizing:border-box;margin:0 auto}.tx-public-header__brand{display:flex;flex-shrink:0;align-items:center;color:inherit;text-decoration:none}.tx-public-header__logo{height:auto}.tx-public-header__panel{display:flex;flex:1;align-items:center;min-width:0}.tx-public-header__nav{display:flex;align-items:center;min-width:0}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]{display:flex;align-items:center}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{text-decoration:none}.tx-public-header__end{display:flex;flex-shrink:0;align-items:center;margin-left:auto}.tx-public-header__actions{display:flex;flex-shrink:0;align-items:center}.tx-public-header__actions ::ng-deep [txPublicHeaderActions]{display:flex;align-items:center}.tx-public-header__toggle{display:none;place-items:center;margin:0 0 0 auto;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}:host([data-styled]){z-index:var(--tx-public-header-z-index);font-family:var(--tx-font-family)}:host([data-styled]) .tx-public-header__bar{border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-background);-webkit-backdrop-filter:var(--tx-public-header-backdrop-filter);backdrop-filter:var(--tx-public-header-backdrop-filter)}:host([data-styled]) .tx-public-header__inner{gap:var(--tx-public-header-gap);max-width:var(--tx-public-header-max-width);height:var(--tx-public-header-height);padding:0 var(--tx-public-header-padding-x)}:host([data-styled]) .tx-public-header__brand{gap:var(--tx-public-header-brand-gap);border-radius:var(--tx-public-header-brand-border-radius);color:var(--tx-public-header-brand-color);font-size:var(--tx-public-header-brand-font-size);font-weight:var(--tx-public-header-brand-font-weight);letter-spacing:var(--tx-public-header-brand-letter-spacing)}:host([data-styled]) .tx-public-header__brand:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__logo{width:var(--tx-public-header-brand-logo-width)}:host([data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:var(--tx-public-header-nav-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-nav-link-padding-y) var(--tx-public-header-nav-link-padding-x);border-radius:var(--tx-public-header-nav-link-border-radius);color:var(--tx-public-header-nav-link-color);font-size:var(--tx-public-header-nav-link-font-size);transition:color var(--tx-public-header-panel-duration),background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:hover{background:var(--tx-public-header-nav-link-hover-background);color:var(--tx-public-header-nav-link-hover-color)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__end{gap:var(--tx-public-header-end-gap)}:host([data-styled]) .tx-public-header__actions,:host([data-styled]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{gap:var(--tx-public-header-end-actions-gap)}:host([data-styled]) .tx-public-header__toggle{width:var(--tx-public-header-toggle-size);height:var(--tx-public-header-toggle-size);border-radius:50%;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color);color:var(--tx-public-header-toggle-color);font-size:var(--tx-public-header-toggle-icon-size);transition:background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__toggle:hover{background:var(--tx-public-header-toggle-hover-background)}:host([data-styled]) .tx-public-header__toggle:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color),var(--tx-public-header-focus-ring-shadow)}@media(width<768px){:host([data-responsive=viewport]) .tx-public-header__toggle{display:grid}:host([data-responsive=viewport]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=viewport].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=viewport].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=viewport]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=viewport]) .tx-public-header__actions,:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=viewport][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=viewport][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=viewport][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@container tx-public-header (width < 768px){:host([data-responsive=container]) .tx-public-header__toggle{display:grid}:host([data-responsive=container]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=container].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=container].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=container]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=container]) .tx-public-header__actions,:host([data-responsive=container]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=container][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=container][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=container][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=container][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=container]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@keyframes tx-public-header-panel-in{0%{opacity:0;transform:translateY(-6px)}}@keyframes tx-public-header-panel-out{to{opacity:0;transform:translateY(-6px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-public-header__panel{animation:none!important}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a,:host([data-styled]) .tx-public-header__toggle{transition:none}}\n"],
|
|
256
|
+
template: "<ng-template #brandContent>\n @if (brandSlot()) {\n <ng-content select=\"[txPublicHeaderBrand]\" />\n } @else {\n @if (logo(); as logo) {\n <img class=\"tx-public-header__logo\" alt=\"\" [src]=\"logo\" [class]=\"passThrough().logo?.class\" [style]=\"passThrough().logo?.style\" />\n }\n <span class=\"tx-public-header__name\">{{ brand() }}</span>\n }\n</ng-template>\n<header class=\"tx-public-header__bar\" [class]=\"passThrough().bar?.class\" [style]=\"passThrough().bar?.style\">\n <div class=\"tx-public-header__inner\">\n @if (router) {\n <a\n class=\"tx-public-header__brand\"\n [routerLink]=\"homeLink()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n (click)=\"close()\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n } @else {\n <a\n class=\"tx-public-header__brand\"\n [href]=\"homeHref()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- closes the menu after a link or a button inside was used; they handle the keyboard themselves -->\n <div class=\"tx-public-header__panel\" [id]=\"panelId\" [class]=\"passThrough().panel?.class\" [style]=\"passThrough().panel?.style\" (click)=\"onPanelClick($event)\" (animationend)=\"onPanelAnimationEnd($event)\">\n <div class=\"tx-public-header__nav\" [class]=\"passThrough().nav?.class\" [style]=\"passThrough().nav?.style\">\n <ng-content select=\"[txPublicHeaderNav]\" />\n </div>\n <div class=\"tx-public-header__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\">\n @if (preferences()) {\n <tx-topbar-preferences class=\"tx-public-header__preferences\" [layout]=\"compact() ? 'stacked' : 'inline'\" [unstyled]=\"isUnstyled()\" />\n }\n <div class=\"tx-public-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPublicHeaderActions]\" />\n </div>\n </div>\n </div>\n\n <button\n #menuButton\n type=\"button\"\n class=\"tx-public-header__toggle\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"open() ? translations().closeMenu : translations().openMenu\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n (click)=\"toggle()\"\n >\n <tx-icon aria-hidden=\"true\" [name]=\"open() ? 'times' : 'bars'\" />\n </button>\n </div>\n</header>\n",
|
|
257
|
+
styles: [":host{position:sticky;top:0;display:block}:host([data-responsive=container]){container:tx-public-header/inline-size;contain:layout}.tx-public-header__bar{position:relative}.tx-public-header__inner{display:flex;align-items:center;box-sizing:border-box;margin:0 auto}.tx-public-header__brand{display:flex;flex-shrink:0;align-items:center;color:inherit;text-decoration:none}.tx-public-header__logo{height:auto}.tx-public-header__name{text-box:trim-both cap alphabetic}.tx-public-header__panel{display:flex;flex:1;align-items:center;min-width:0}.tx-public-header__nav{display:flex;align-items:center;min-width:0}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]{display:flex;align-items:center}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{text-decoration:none}.tx-public-header__end{display:flex;flex-shrink:0;align-items:center;margin-left:auto}.tx-public-header__actions{display:flex;flex-shrink:0;align-items:center}.tx-public-header__actions ::ng-deep [txPublicHeaderActions]{display:flex;align-items:center}.tx-public-header__toggle{display:none;place-items:center;margin:0 0 0 auto;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}:host([data-styled]){z-index:var(--tx-public-header-z-index);font-family:var(--tx-font-family)}:host([data-styled]) .tx-public-header__bar{border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-background);-webkit-backdrop-filter:var(--tx-public-header-backdrop-filter);backdrop-filter:var(--tx-public-header-backdrop-filter)}:host([data-styled]) .tx-public-header__inner{gap:var(--tx-public-header-gap);max-width:var(--tx-public-header-max-width);height:var(--tx-public-header-height);padding:0 var(--tx-public-header-padding-x)}:host([data-styled]) .tx-public-header__brand{gap:var(--tx-public-header-brand-gap);border-radius:var(--tx-public-header-brand-border-radius);color:var(--tx-public-header-brand-color);font-size:var(--tx-public-header-brand-font-size);font-weight:var(--tx-public-header-brand-font-weight);letter-spacing:var(--tx-public-header-brand-letter-spacing)}:host([data-styled]) .tx-public-header__brand:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__logo{width:var(--tx-public-header-brand-logo-width)}:host([data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:var(--tx-public-header-nav-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-nav-link-padding-y) var(--tx-public-header-nav-link-padding-x);border-radius:var(--tx-public-header-nav-link-border-radius);color:var(--tx-public-header-nav-link-color);font-size:var(--tx-public-header-nav-link-font-size);transition:color var(--tx-public-header-panel-duration),background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:hover{background:var(--tx-public-header-nav-link-hover-background);color:var(--tx-public-header-nav-link-hover-color)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__end{gap:var(--tx-public-header-end-gap)}:host([data-styled]) .tx-public-header__actions,:host([data-styled]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{gap:var(--tx-public-header-end-actions-gap)}:host([data-styled]) .tx-public-header__toggle{width:var(--tx-public-header-toggle-size);height:var(--tx-public-header-toggle-size);border-radius:50%;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color);color:var(--tx-public-header-toggle-color);font-size:var(--tx-public-header-toggle-icon-size);transition:background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__toggle:hover{background:var(--tx-public-header-toggle-hover-background)}:host([data-styled]) .tx-public-header__toggle:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color),var(--tx-public-header-focus-ring-shadow)}@media(width<768px){:host([data-responsive=viewport]) .tx-public-header__toggle{display:grid}:host([data-responsive=viewport]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=viewport].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=viewport].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=viewport]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=viewport]) .tx-public-header__actions,:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=viewport][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=viewport][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=viewport][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@container tx-public-header (width < 768px){:host([data-responsive=container]) .tx-public-header__toggle{display:grid}:host([data-responsive=container]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=container].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=container].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=container]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=container]) .tx-public-header__actions,:host([data-responsive=container]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=container][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=container][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=container][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=container][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=container]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@keyframes tx-public-header-panel-in{0%{opacity:0;transform:translateY(-6px)}}@keyframes tx-public-header-panel-out{to{opacity:0;transform:translateY(-6px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-public-header__panel{animation:none!important}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a,:host([data-styled]) .tx-public-header__toggle{transition:none}}\n"],
|
|
258
258
|
dependencies: [
|
|
259
259
|
{
|
|
260
260
|
kind: "directive",
|
|
@@ -339,8 +339,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
339
339
|
"(document:keydown.escape)": "onEscape()"
|
|
340
340
|
},
|
|
341
341
|
viewProviders: [provideTxIconDefaults(PUBLIC_HEADER_ICON_DEFAULTS)],
|
|
342
|
-
template: "<ng-template #brandContent>\n @if (brandSlot()) {\n <ng-content select=\"[txPublicHeaderBrand]\" />\n } @else {\n @if (logo(); as logo) {\n <img class=\"tx-public-header__logo\" alt=\"\" [src]=\"logo\" [class]=\"passThrough().logo?.class\" [style]=\"passThrough().logo?.style\" />\n }\n <span>{{ brand() }}</span>\n }\n</ng-template>\n<header class=\"tx-public-header__bar\" [class]=\"passThrough().bar?.class\" [style]=\"passThrough().bar?.style\">\n <div class=\"tx-public-header__inner\">\n @if (router) {\n <a\n class=\"tx-public-header__brand\"\n [routerLink]=\"homeLink()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n (click)=\"close()\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n } @else {\n <a\n class=\"tx-public-header__brand\"\n [href]=\"homeHref()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- closes the menu after a link or a button inside was used; they handle the keyboard themselves -->\n <div class=\"tx-public-header__panel\" [id]=\"panelId\" [class]=\"passThrough().panel?.class\" [style]=\"passThrough().panel?.style\" (click)=\"onPanelClick($event)\" (animationend)=\"onPanelAnimationEnd($event)\">\n <div class=\"tx-public-header__nav\" [class]=\"passThrough().nav?.class\" [style]=\"passThrough().nav?.style\">\n <ng-content select=\"[txPublicHeaderNav]\" />\n </div>\n <div class=\"tx-public-header__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\">\n @if (preferences()) {\n <tx-topbar-preferences class=\"tx-public-header__preferences\" [layout]=\"compact() ? 'stacked' : 'inline'\" [unstyled]=\"isUnstyled()\" />\n }\n <div class=\"tx-public-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPublicHeaderActions]\" />\n </div>\n </div>\n </div>\n\n <button\n #menuButton\n type=\"button\"\n class=\"tx-public-header__toggle\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"open() ? translations().closeMenu : translations().openMenu\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n (click)=\"toggle()\"\n >\n <tx-icon aria-hidden=\"true\" [name]=\"open() ? 'times' : 'bars'\" />\n </button>\n </div>\n</header>\n",
|
|
343
|
-
styles: [":host{position:sticky;top:0;display:block}:host([data-responsive=container]){container:tx-public-header/inline-size;contain:layout}.tx-public-header__bar{position:relative}.tx-public-header__inner{display:flex;align-items:center;box-sizing:border-box;margin:0 auto}.tx-public-header__brand{display:flex;flex-shrink:0;align-items:center;color:inherit;text-decoration:none}.tx-public-header__logo{height:auto}.tx-public-header__panel{display:flex;flex:1;align-items:center;min-width:0}.tx-public-header__nav{display:flex;align-items:center;min-width:0}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]{display:flex;align-items:center}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{text-decoration:none}.tx-public-header__end{display:flex;flex-shrink:0;align-items:center;margin-left:auto}.tx-public-header__actions{display:flex;flex-shrink:0;align-items:center}.tx-public-header__actions ::ng-deep [txPublicHeaderActions]{display:flex;align-items:center}.tx-public-header__toggle{display:none;place-items:center;margin:0 0 0 auto;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}:host([data-styled]){z-index:var(--tx-public-header-z-index);font-family:var(--tx-font-family)}:host([data-styled]) .tx-public-header__bar{border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-background);-webkit-backdrop-filter:var(--tx-public-header-backdrop-filter);backdrop-filter:var(--tx-public-header-backdrop-filter)}:host([data-styled]) .tx-public-header__inner{gap:var(--tx-public-header-gap);max-width:var(--tx-public-header-max-width);height:var(--tx-public-header-height);padding:0 var(--tx-public-header-padding-x)}:host([data-styled]) .tx-public-header__brand{gap:var(--tx-public-header-brand-gap);border-radius:var(--tx-public-header-brand-border-radius);color:var(--tx-public-header-brand-color);font-size:var(--tx-public-header-brand-font-size);font-weight:var(--tx-public-header-brand-font-weight);letter-spacing:var(--tx-public-header-brand-letter-spacing)}:host([data-styled]) .tx-public-header__brand:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__logo{width:var(--tx-public-header-brand-logo-width)}:host([data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:var(--tx-public-header-nav-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-nav-link-padding-y) var(--tx-public-header-nav-link-padding-x);border-radius:var(--tx-public-header-nav-link-border-radius);color:var(--tx-public-header-nav-link-color);font-size:var(--tx-public-header-nav-link-font-size);transition:color var(--tx-public-header-panel-duration),background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:hover{background:var(--tx-public-header-nav-link-hover-background);color:var(--tx-public-header-nav-link-hover-color)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__end{gap:var(--tx-public-header-end-gap)}:host([data-styled]) .tx-public-header__actions,:host([data-styled]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{gap:var(--tx-public-header-end-actions-gap)}:host([data-styled]) .tx-public-header__toggle{width:var(--tx-public-header-toggle-size);height:var(--tx-public-header-toggle-size);border-radius:50%;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color);color:var(--tx-public-header-toggle-color);font-size:var(--tx-public-header-toggle-icon-size);transition:background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__toggle:hover{background:var(--tx-public-header-toggle-hover-background)}:host([data-styled]) .tx-public-header__toggle:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color),var(--tx-public-header-focus-ring-shadow)}@media(width<768px){:host([data-responsive=viewport]) .tx-public-header__toggle{display:grid}:host([data-responsive=viewport]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=viewport].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=viewport].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=viewport]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=viewport]) .tx-public-header__actions,:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=viewport][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=viewport][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=viewport][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@container tx-public-header (width < 768px){:host([data-responsive=container]) .tx-public-header__toggle{display:grid}:host([data-responsive=container]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=container].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=container].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=container]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=container]) .tx-public-header__actions,:host([data-responsive=container]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=container][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=container][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=container][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=container][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=container]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@keyframes tx-public-header-panel-in{0%{opacity:0;transform:translateY(-6px)}}@keyframes tx-public-header-panel-out{to{opacity:0;transform:translateY(-6px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-public-header__panel{animation:none!important}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a,:host([data-styled]) .tx-public-header__toggle{transition:none}}\n"]
|
|
342
|
+
template: "<ng-template #brandContent>\n @if (brandSlot()) {\n <ng-content select=\"[txPublicHeaderBrand]\" />\n } @else {\n @if (logo(); as logo) {\n <img class=\"tx-public-header__logo\" alt=\"\" [src]=\"logo\" [class]=\"passThrough().logo?.class\" [style]=\"passThrough().logo?.style\" />\n }\n <span class=\"tx-public-header__name\">{{ brand() }}</span>\n }\n</ng-template>\n<header class=\"tx-public-header__bar\" [class]=\"passThrough().bar?.class\" [style]=\"passThrough().bar?.style\">\n <div class=\"tx-public-header__inner\">\n @if (router) {\n <a\n class=\"tx-public-header__brand\"\n [routerLink]=\"homeLink()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n (click)=\"close()\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n } @else {\n <a\n class=\"tx-public-header__brand\"\n [href]=\"homeHref()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- closes the menu after a link or a button inside was used; they handle the keyboard themselves -->\n <div class=\"tx-public-header__panel\" [id]=\"panelId\" [class]=\"passThrough().panel?.class\" [style]=\"passThrough().panel?.style\" (click)=\"onPanelClick($event)\" (animationend)=\"onPanelAnimationEnd($event)\">\n <div class=\"tx-public-header__nav\" [class]=\"passThrough().nav?.class\" [style]=\"passThrough().nav?.style\">\n <ng-content select=\"[txPublicHeaderNav]\" />\n </div>\n <div class=\"tx-public-header__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\">\n @if (preferences()) {\n <tx-topbar-preferences class=\"tx-public-header__preferences\" [layout]=\"compact() ? 'stacked' : 'inline'\" [unstyled]=\"isUnstyled()\" />\n }\n <div class=\"tx-public-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPublicHeaderActions]\" />\n </div>\n </div>\n </div>\n\n <button\n #menuButton\n type=\"button\"\n class=\"tx-public-header__toggle\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"open() ? translations().closeMenu : translations().openMenu\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n (click)=\"toggle()\"\n >\n <tx-icon aria-hidden=\"true\" [name]=\"open() ? 'times' : 'bars'\" />\n </button>\n </div>\n</header>\n",
|
|
343
|
+
styles: [":host{position:sticky;top:0;display:block}:host([data-responsive=container]){container:tx-public-header/inline-size;contain:layout}.tx-public-header__bar{position:relative}.tx-public-header__inner{display:flex;align-items:center;box-sizing:border-box;margin:0 auto}.tx-public-header__brand{display:flex;flex-shrink:0;align-items:center;color:inherit;text-decoration:none}.tx-public-header__logo{height:auto}.tx-public-header__name{text-box:trim-both cap alphabetic}.tx-public-header__panel{display:flex;flex:1;align-items:center;min-width:0}.tx-public-header__nav{display:flex;align-items:center;min-width:0}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]{display:flex;align-items:center}.tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{text-decoration:none}.tx-public-header__end{display:flex;flex-shrink:0;align-items:center;margin-left:auto}.tx-public-header__actions{display:flex;flex-shrink:0;align-items:center}.tx-public-header__actions ::ng-deep [txPublicHeaderActions]{display:flex;align-items:center}.tx-public-header__toggle{display:none;place-items:center;margin:0 0 0 auto;padding:0;border:0;background:transparent;color:inherit;cursor:pointer}:host([data-styled]){z-index:var(--tx-public-header-z-index);font-family:var(--tx-font-family)}:host([data-styled]) .tx-public-header__bar{border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-background);-webkit-backdrop-filter:var(--tx-public-header-backdrop-filter);backdrop-filter:var(--tx-public-header-backdrop-filter)}:host([data-styled]) .tx-public-header__inner{gap:var(--tx-public-header-gap);max-width:var(--tx-public-header-max-width);height:var(--tx-public-header-height);padding:0 var(--tx-public-header-padding-x)}:host([data-styled]) .tx-public-header__brand{gap:var(--tx-public-header-brand-gap);border-radius:var(--tx-public-header-brand-border-radius);color:var(--tx-public-header-brand-color);font-size:var(--tx-public-header-brand-font-size);font-weight:var(--tx-public-header-brand-font-weight);letter-spacing:var(--tx-public-header-brand-letter-spacing)}:host([data-styled]) .tx-public-header__brand:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__logo{width:var(--tx-public-header-brand-logo-width)}:host([data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:var(--tx-public-header-nav-gap)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-nav-link-padding-y) var(--tx-public-header-nav-link-padding-x);border-radius:var(--tx-public-header-nav-link-border-radius);color:var(--tx-public-header-nav-link-color);font-size:var(--tx-public-header-nav-link-font-size);transition:color var(--tx-public-header-panel-duration),background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:hover{background:var(--tx-public-header-nav-link-hover-background);color:var(--tx-public-header-nav-link-hover-color)}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a:focus-visible{outline:none;box-shadow:var(--tx-public-header-focus-ring-shadow)}:host([data-styled]) .tx-public-header__end{gap:var(--tx-public-header-end-gap)}:host([data-styled]) .tx-public-header__actions,:host([data-styled]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{gap:var(--tx-public-header-end-actions-gap)}:host([data-styled]) .tx-public-header__toggle{width:var(--tx-public-header-toggle-size);height:var(--tx-public-header-toggle-size);border-radius:50%;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color);color:var(--tx-public-header-toggle-color);font-size:var(--tx-public-header-toggle-icon-size);transition:background-color var(--tx-public-header-panel-duration)}:host([data-styled]) .tx-public-header__toggle:hover{background:var(--tx-public-header-toggle-hover-background)}:host([data-styled]) .tx-public-header__toggle:focus-visible{outline:none;box-shadow:inset 0 0 0 1px var(--tx-public-header-toggle-ring-color),var(--tx-public-header-focus-ring-shadow)}@media(width<768px){:host([data-responsive=viewport]) .tx-public-header__toggle{display:grid}:host([data-responsive=viewport]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=viewport].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=viewport].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=viewport]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=viewport]) .tx-public-header__actions,:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=viewport][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=viewport][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=viewport][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=viewport][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=viewport][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=viewport]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@container tx-public-header (width < 768px){:host([data-responsive=container]) .tx-public-header__toggle{display:grid}:host([data-responsive=container]) .tx-public-header__panel{position:absolute;top:100%;right:0;left:0;display:none;flex-direction:column;align-items:stretch}:host([data-responsive=container].tx-public-header--open) .tx-public-header__panel,:host([data-responsive=container].tx-public-header--closing) .tx-public-header__panel{display:flex}:host([data-responsive=container]) .tx-public-header__nav{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{flex-direction:column;align-items:stretch}:host([data-responsive=container]) .tx-public-header__end{flex-direction:column;align-items:stretch;margin-left:0}:host([data-responsive=container]) .tx-public-header__actions,:host([data-responsive=container]) .tx-public-header__actions ::ng-deep [txPublicHeaderActions]{flex-direction:column;align-items:stretch}:host([data-responsive=container][data-styled]) .tx-public-header__panel{gap:var(--tx-public-header-panel-gap);padding:var(--tx-public-header-panel-padding);border-bottom:1px solid var(--tx-public-header-border-color);background:var(--tx-public-header-panel-background);box-shadow:var(--tx-public-header-panel-shadow)}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]{gap:0}:host([data-responsive=container][data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a{padding:var(--tx-public-header-panel-link-padding);border-bottom:1px solid var(--tx-public-header-border-color);border-radius:var(--tx-public-header-panel-link-border-radius);color:var(--tx-public-header-panel-link-color);font-size:var(--tx-public-header-panel-link-font-size)}:host([data-responsive=container][data-styled]) .tx-public-header__end{gap:var(--tx-public-header-panel-gap)}:host([data-responsive=container][data-styled].tx-public-header--open) .tx-public-header__panel{animation:tx-public-header-panel-in var(--tx-public-header-panel-duration) ease-out}:host([data-responsive=container][data-styled].tx-public-header--closing) .tx-public-header__panel{animation:tx-public-header-panel-out var(--tx-public-header-panel-duration) ease-in forwards}:host([data-responsive=container]) .tx-public-header__actions ::ng-deep .tx-button{justify-content:center;width:100%}}@keyframes tx-public-header-panel-in{0%{opacity:0;transform:translateY(-6px)}}@keyframes tx-public-header-panel-out{to{opacity:0;transform:translateY(-6px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-public-header__panel{animation:none!important}:host([data-styled]) .tx-public-header__nav ::ng-deep [txPublicHeaderNav]>a,:host([data-styled]) .tx-public-header__toggle{transition:none}}\n"]
|
|
344
344
|
}]
|
|
345
345
|
}],
|
|
346
346
|
ctorParameters: () => [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-blocks-public-header.mjs","names":[],"sources":["../../../../packages/blocks/public-header/src/public-header-brand.directive.ts","../../../../packages/blocks/public-header/src/public-header.icons.ts","../../../../packages/blocks/public-header/src/public-header.theme.ts","../../../../packages/blocks/public-header/src/public-header.component.ts","../../../../packages/blocks/public-header/src/public-header.component.html"],"sourcesContent":["import { Directive } from '@angular/core';\n\n@Directive({ selector: '[txPublicHeaderBrand]' })\nexport class TxPublicHeaderBrand {}\n","import { TxIconSet, txIconBars, txIconTimes } from '@tectra-ng/icons';\n\nexport const PUBLIC_HEADER_ICON_DEFAULTS: TxIconSet = {\n bars: txIconBars,\n times: txIconTimes,\n};\n","import { publicHeaderTokens } from '@tectra-ng/themes';\n\nexport const PUBLIC_HEADER_THEME = {\n publicHeader: publicHeaderTokens,\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n DOCUMENT,\n DestroyRef,\n ElementRef,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPublicHeaderTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxTopbarPreferences } from '@tectra-ng/blocks/topbar-preferences';\nimport { TxPublicHeaderBrand } from './public-header-brand.directive';\nimport { TxPublicHeaderPart, TxPublicHeaderResponsive } from './public-header.types';\nimport { PUBLIC_HEADER_ICON_DEFAULTS } from './public-header.icons';\nimport { PUBLIC_HEADER_THEME } from './public-header.theme';\n\nconst COMPACT_WIDTH = 768;\nconst CLOSE_FALLBACK_MS = 600;\n\n@Component({\n selector: 'tx-public-header',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxTopbarPreferences],\n templateUrl: './public-header.component.html',\n styleUrl: './public-header.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-public-header',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-responsive]': 'responsive()',\n '[class.tx-public-header--open]': 'open()',\n '[class.tx-public-header--closing]': 'closing()',\n '(document:keydown.escape)': 'onEscape()',\n },\n viewProviders: [provideTxIconDefaults(PUBLIC_HEADER_ICON_DEFAULTS)],\n})\nexport class TxPublicHeader {\n private readonly publicHeaderTheme = injectTokens(PUBLIC_HEADER_THEME);\n\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly toggleButton = viewChild<ElementRef<HTMLButtonElement>>('menuButton');\n protected readonly router = inject(ActivatedRoute, { optional: true }) ? inject(Router) : null;\n protected readonly brandSlot = contentChild(TxPublicHeaderBrand);\n\n readonly brand = input.required<string>();\n readonly logo = input<string | undefined>(undefined);\n readonly homeLink = input<string | readonly unknown[]>('/');\n readonly preferences = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly responsive = input<TxPublicHeaderResponsive>('viewport');\n readonly dt = input<TectraDeepPartial<TectraPublicHeaderTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPublicHeaderPart, TxPublicHeader> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('publicHeader', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly panelId = uniqueId('tx-public-header-panel');\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-public-header'), ...this.passThrough().root?.style }));\n protected readonly homeHref = computed(() => {\n const link = this.homeLink();\n return typeof link === 'string' ? link : '/' + link.join('/');\n });\n\n readonly open = signal(false);\n readonly compact = signal(false);\n protected readonly closing = signal(false);\n private closingTimer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => clearTimeout(this.closingTimer));\n afterNextRender(() => {\n const view = this.document.defaultView;\n if (!view) {\n return;\n }\n const update = (compact: boolean) => {\n this.compact.set(compact);\n if (!compact) {\n this.open.set(false);\n this.finishClosing();\n }\n };\n if (this.responsive() === 'container' && 'ResizeObserver' in view) {\n const observer = new view.ResizeObserver(([entry]) => update(entry.contentRect.width < COMPACT_WIDTH));\n observer.observe(this.host.nativeElement);\n destroyRef.onDestroy(() => observer.disconnect());\n return;\n }\n const media = view.matchMedia?.(`(width < ${COMPACT_WIDTH}px)`);\n if (media) {\n const change = () => update(media.matches);\n change();\n media.addEventListener?.('change', change);\n destroyRef.onDestroy(() => media.removeEventListener?.('change', change));\n }\n });\n }\n\n toggle(): void {\n if (this.open()) {\n this.close();\n return;\n }\n this.finishClosing();\n this.open.set(true);\n }\n\n close(): void {\n if (!this.open()) {\n return;\n }\n this.open.set(false);\n if (this.compact() && !this.isUnstyled() && !this.reducedMotion()) {\n this.closing.set(true);\n clearTimeout(this.closingTimer);\n this.closingTimer = setTimeout(() => this.finishClosing(), CLOSE_FALLBACK_MS);\n }\n }\n\n protected onPanelAnimationEnd(event: AnimationEvent): void {\n if (event.target === event.currentTarget && this.closing()) {\n this.finishClosing();\n }\n }\n\n private finishClosing(): void {\n clearTimeout(this.closingTimer);\n this.closing.set(false);\n }\n\n private reducedMotion(): boolean {\n return !!this.document.defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n }\n\n protected onEscape(): void {\n if (this.open()) {\n this.close();\n this.toggleButton()?.nativeElement.focus();\n }\n }\n\n protected onPanelClick(event: MouseEvent): void {\n const target = event.target as HTMLElement | null;\n if (target?.closest('a, button') && !target.closest('.tx-public-header__preferences')) {\n this.close();\n }\n }\n}\n","<ng-template #brandContent>\n @if (brandSlot()) {\n <ng-content select=\"[txPublicHeaderBrand]\" />\n } @else {\n @if (logo(); as logo) {\n <img class=\"tx-public-header__logo\" alt=\"\" [src]=\"logo\" [class]=\"passThrough().logo?.class\" [style]=\"passThrough().logo?.style\" />\n }\n <span>{{ brand() }}</span>\n }\n</ng-template>\n<header class=\"tx-public-header__bar\" [class]=\"passThrough().bar?.class\" [style]=\"passThrough().bar?.style\">\n <div class=\"tx-public-header__inner\">\n @if (router) {\n <a\n class=\"tx-public-header__brand\"\n [routerLink]=\"homeLink()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n (click)=\"close()\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n } @else {\n <a\n class=\"tx-public-header__brand\"\n [href]=\"homeHref()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- closes the menu after a link or a button inside was used; they handle the keyboard themselves -->\n <div class=\"tx-public-header__panel\" [id]=\"panelId\" [class]=\"passThrough().panel?.class\" [style]=\"passThrough().panel?.style\" (click)=\"onPanelClick($event)\" (animationend)=\"onPanelAnimationEnd($event)\">\n <div class=\"tx-public-header__nav\" [class]=\"passThrough().nav?.class\" [style]=\"passThrough().nav?.style\">\n <ng-content select=\"[txPublicHeaderNav]\" />\n </div>\n <div class=\"tx-public-header__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\">\n @if (preferences()) {\n <tx-topbar-preferences class=\"tx-public-header__preferences\" [layout]=\"compact() ? 'stacked' : 'inline'\" [unstyled]=\"isUnstyled()\" />\n }\n <div class=\"tx-public-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPublicHeaderActions]\" />\n </div>\n </div>\n </div>\n\n <button\n #menuButton\n type=\"button\"\n class=\"tx-public-header__toggle\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"open() ? translations().closeMenu : translations().openMenu\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n (click)=\"toggle()\"\n >\n <tx-icon aria-hidden=\"true\" [name]=\"open() ? 'times' : 'bars'\" />\n </button>\n </div>\n</header>\n"],"mappings":";;;;;;;;;;;AAGA,IAAa,sBAAb,MAAa,oBAAmB;CAAnB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAmB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAnB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAmB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAD/B,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,wBAAuB,CAAE;;;ACAhD,MAAa,8BAAyC;CACpD,MAAM;CACN,OAAO;AACR;ACHD,MAAa,sBAAsB,EACjC,cAAc,mBACf;ACyBD,MAAM,gBAAgB;AACtB,MAAM,oBAAoB;AAoB1B,IAAa,iBAAb,MAAa,eAAc;CACR,oBAAoB,aAAa,mBAAmB;CAEpD,WAAW,OAAO,QAAQ;CAC1B,OAAO,OAAgC,UAAU;CACjD,eAAe,UAAyC,cAAa,GAAA,YAAA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CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-public-header.mjs","names":[],"sources":["../../../../packages/blocks/public-header/src/public-header-brand.directive.ts","../../../../packages/blocks/public-header/src/public-header.icons.ts","../../../../packages/blocks/public-header/src/public-header.theme.ts","../../../../packages/blocks/public-header/src/public-header.component.ts","../../../../packages/blocks/public-header/src/public-header.component.html"],"sourcesContent":["import { Directive } from '@angular/core';\n\n@Directive({ selector: '[txPublicHeaderBrand]' })\nexport class TxPublicHeaderBrand {}\n","import { TxIconSet, txIconBars, txIconTimes } from '@tectra-ng/icons';\n\nexport const PUBLIC_HEADER_ICON_DEFAULTS: TxIconSet = {\n bars: txIconBars,\n times: txIconTimes,\n};\n","import { publicHeaderTokens } from '@tectra-ng/themes';\n\nexport const PUBLIC_HEADER_THEME = {\n publicHeader: publicHeaderTokens,\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n DOCUMENT,\n DestroyRef,\n ElementRef,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectPassThrough, injectTokens, injectUnstyled, TxPassThrough, TxPassThroughOptions } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { provideTxIconDefaults, TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraPublicHeaderTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxTopbarPreferences } from '@tectra-ng/blocks/topbar-preferences';\nimport { TxPublicHeaderBrand } from './public-header-brand.directive';\nimport { TxPublicHeaderPart, TxPublicHeaderResponsive } from './public-header.types';\nimport { PUBLIC_HEADER_ICON_DEFAULTS } from './public-header.icons';\nimport { PUBLIC_HEADER_THEME } from './public-header.theme';\n\nconst COMPACT_WIDTH = 768;\nconst CLOSE_FALLBACK_MS = 600;\n\n@Component({\n selector: 'tx-public-header',\n imports: [NgTemplateOutlet, RouterLink, TxIcon, TxTopbarPreferences],\n templateUrl: './public-header.component.html',\n styleUrl: './public-header.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-public-header',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-responsive]': 'responsive()',\n '[class.tx-public-header--open]': 'open()',\n '[class.tx-public-header--closing]': 'closing()',\n '(document:keydown.escape)': 'onEscape()',\n },\n viewProviders: [provideTxIconDefaults(PUBLIC_HEADER_ICON_DEFAULTS)],\n})\nexport class TxPublicHeader {\n private readonly publicHeaderTheme = injectTokens(PUBLIC_HEADER_THEME);\n\n private readonly document = inject(DOCUMENT);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly toggleButton = viewChild<ElementRef<HTMLButtonElement>>('menuButton');\n protected readonly router = inject(ActivatedRoute, { optional: true }) ? inject(Router) : null;\n protected readonly brandSlot = contentChild(TxPublicHeaderBrand);\n\n readonly brand = input.required<string>();\n readonly logo = input<string | undefined>(undefined);\n readonly homeLink = input<string | readonly unknown[]>('/');\n readonly preferences = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly responsive = input<TxPublicHeaderResponsive>('viewport');\n readonly dt = input<TectraDeepPartial<TectraPublicHeaderTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPublicHeaderPart, TxPublicHeader> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('publicHeader', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly panelId = uniqueId('tx-public-header-panel');\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-public-header'), ...this.passThrough().root?.style }));\n protected readonly homeHref = computed(() => {\n const link = this.homeLink();\n return typeof link === 'string' ? link : '/' + link.join('/');\n });\n\n readonly open = signal(false);\n readonly compact = signal(false);\n protected readonly closing = signal(false);\n private closingTimer: ReturnType<typeof setTimeout> | undefined;\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n destroyRef.onDestroy(() => clearTimeout(this.closingTimer));\n afterNextRender(() => {\n const view = this.document.defaultView;\n if (!view) {\n return;\n }\n const update = (compact: boolean) => {\n this.compact.set(compact);\n if (!compact) {\n this.open.set(false);\n this.finishClosing();\n }\n };\n if (this.responsive() === 'container' && 'ResizeObserver' in view) {\n const observer = new view.ResizeObserver(([entry]) => update(entry.contentRect.width < COMPACT_WIDTH));\n observer.observe(this.host.nativeElement);\n destroyRef.onDestroy(() => observer.disconnect());\n return;\n }\n const media = view.matchMedia?.(`(width < ${COMPACT_WIDTH}px)`);\n if (media) {\n const change = () => update(media.matches);\n change();\n media.addEventListener?.('change', change);\n destroyRef.onDestroy(() => media.removeEventListener?.('change', change));\n }\n });\n }\n\n toggle(): void {\n if (this.open()) {\n this.close();\n return;\n }\n this.finishClosing();\n this.open.set(true);\n }\n\n close(): void {\n if (!this.open()) {\n return;\n }\n this.open.set(false);\n if (this.compact() && !this.isUnstyled() && !this.reducedMotion()) {\n this.closing.set(true);\n clearTimeout(this.closingTimer);\n this.closingTimer = setTimeout(() => this.finishClosing(), CLOSE_FALLBACK_MS);\n }\n }\n\n protected onPanelAnimationEnd(event: AnimationEvent): void {\n if (event.target === event.currentTarget && this.closing()) {\n this.finishClosing();\n }\n }\n\n private finishClosing(): void {\n clearTimeout(this.closingTimer);\n this.closing.set(false);\n }\n\n private reducedMotion(): boolean {\n return !!this.document.defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n }\n\n protected onEscape(): void {\n if (this.open()) {\n this.close();\n this.toggleButton()?.nativeElement.focus();\n }\n }\n\n protected onPanelClick(event: MouseEvent): void {\n const target = event.target as HTMLElement | null;\n if (target?.closest('a, button') && !target.closest('.tx-public-header__preferences')) {\n this.close();\n }\n }\n}\n","<ng-template #brandContent>\n @if (brandSlot()) {\n <ng-content select=\"[txPublicHeaderBrand]\" />\n } @else {\n @if (logo(); as logo) {\n <img class=\"tx-public-header__logo\" alt=\"\" [src]=\"logo\" [class]=\"passThrough().logo?.class\" [style]=\"passThrough().logo?.style\" />\n }\n <span class=\"tx-public-header__name\">{{ brand() }}</span>\n }\n</ng-template>\n<header class=\"tx-public-header__bar\" [class]=\"passThrough().bar?.class\" [style]=\"passThrough().bar?.style\">\n <div class=\"tx-public-header__inner\">\n @if (router) {\n <a\n class=\"tx-public-header__brand\"\n [routerLink]=\"homeLink()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n (click)=\"close()\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n } @else {\n <a\n class=\"tx-public-header__brand\"\n [href]=\"homeHref()\"\n [attr.aria-label]=\"brandSlot() ? brand() : null\"\n [class]=\"passThrough().brand?.class\"\n [style]=\"passThrough().brand?.style\"\n >\n <ng-container *ngTemplateOutlet=\"brandContent\" />\n </a>\n }\n\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -- closes the menu after a link or a button inside was used; they handle the keyboard themselves -->\n <div class=\"tx-public-header__panel\" [id]=\"panelId\" [class]=\"passThrough().panel?.class\" [style]=\"passThrough().panel?.style\" (click)=\"onPanelClick($event)\" (animationend)=\"onPanelAnimationEnd($event)\">\n <div class=\"tx-public-header__nav\" [class]=\"passThrough().nav?.class\" [style]=\"passThrough().nav?.style\">\n <ng-content select=\"[txPublicHeaderNav]\" />\n </div>\n <div class=\"tx-public-header__end\" [class]=\"passThrough().end?.class\" [style]=\"passThrough().end?.style\">\n @if (preferences()) {\n <tx-topbar-preferences class=\"tx-public-header__preferences\" [layout]=\"compact() ? 'stacked' : 'inline'\" [unstyled]=\"isUnstyled()\" />\n }\n <div class=\"tx-public-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content select=\"[txPublicHeaderActions]\" />\n </div>\n </div>\n </div>\n\n <button\n #menuButton\n type=\"button\"\n class=\"tx-public-header__toggle\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-label]=\"open() ? translations().closeMenu : translations().openMenu\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n (click)=\"toggle()\"\n >\n <tx-icon aria-hidden=\"true\" [name]=\"open() ? 'times' : 'bars'\" />\n </button>\n </div>\n</header>\n"],"mappings":";;;;;;;;;;;AAGA,IAAa,sBAAb,MAAa,oBAAmB;CAAnB,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAmB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAnB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAmB,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAnB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAmB,YAAA,CAAA;EAD/B,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,wBAAuB,CAAE;;;ACAhD,MAAa,8BAAyC;CACpD,MAAM;CACN,OAAO;AACR;ACHD,MAAa,sBAAsB,EACjC,cAAc,mBACf;ACyBD,MAAM,gBAAgB;AACtB,MAAM,oBAAoB;AAoB1B,IAAa,iBAAb,MAAa,eAAc;CACR,oBAAoB,aAAa,mBAAmB;CAEpD,WAAW,OAAO,QAAQ;CAC1B,OAAO,OAAgC,UAAU;CACjD,eAAe,UAAyC,cAAa,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACnE,SAAS,OAAO,gBAAgB,EAAE,UAAU,KAAI,CAAE,IAAI,OAAO,MAAM,IAAI;CACvE,YAAY,aAAa,qBAAoB,GAAA,YAAA,CAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;CAEvD,QAAQ,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAChC,OAAO,MAA0B,QAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAA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AA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,IAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, ElementRef, booleanAttribute, computed, inject, input, numberAttribute, output, viewChildren } from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/forms";
|
|
4
|
+
import { FormsModule } from "@angular/forms";
|
|
5
|
+
import { uniqueId } from "@tectra-ng/core/a11y";
|
|
6
|
+
import { TxThemeService, injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core/config";
|
|
7
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
8
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
9
|
+
import { tectraPrimaryChoices, tectraSurfaceChoices, themeConfiguratorTokens, toStyleObject } from "@tectra-ng/themes";
|
|
10
|
+
import { TxButton } from "@tectra-ng/ui/button";
|
|
11
|
+
import { TxButtonGroup } from "@tectra-ng/ui/button-group";
|
|
12
|
+
import { TxColorSwatches } from "@tectra-ng/ui/color-swatches";
|
|
13
|
+
import { TxToggleSwitch } from "@tectra-ng/ui/toggle-switch";
|
|
14
|
+
const THEME_CONFIGURATOR_THEME = { themeConfigurator: themeConfiguratorTokens };
|
|
15
|
+
const STEPS = {
|
|
16
|
+
ArrowRight: 1,
|
|
17
|
+
ArrowDown: 1,
|
|
18
|
+
ArrowLeft: -1,
|
|
19
|
+
ArrowUp: -1
|
|
20
|
+
};
|
|
21
|
+
const ALL_PRIMARIES = tectraPrimaryChoices();
|
|
22
|
+
const ALL_SURFACES = tectraSurfaceChoices();
|
|
23
|
+
var TxThemeConfigurator = class TxThemeConfigurator {
|
|
24
|
+
themeConfiguratorTheme = injectTokens(THEME_CONFIGURATOR_THEME);
|
|
25
|
+
theme = inject(TxThemeService);
|
|
26
|
+
styles = input([], ...ngDevMode ? [{ debugName: "styles" }] : /* istanbul ignore next */ []);
|
|
27
|
+
primaries = input(ALL_PRIMARIES, ...ngDevMode ? [{ debugName: "primaries" }] : /* istanbul ignore next */ []);
|
|
28
|
+
surfaces = input(ALL_SURFACES, ...ngDevMode ? [{ debugName: "surfaces" }] : /* istanbul ignore next */ []);
|
|
29
|
+
columns = input(9, {
|
|
30
|
+
...ngDevMode ? { debugName: "columns" } : /* istanbul ignore next */ {},
|
|
31
|
+
transform: numberAttribute
|
|
32
|
+
});
|
|
33
|
+
showRipple = input(true, {
|
|
34
|
+
...ngDevMode ? { debugName: "showRipple" } : /* istanbul ignore next */ {},
|
|
35
|
+
transform: booleanAttribute
|
|
36
|
+
});
|
|
37
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
38
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
39
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
40
|
+
unstyled = input(void 0, {
|
|
41
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
42
|
+
transform: optionalBoolean
|
|
43
|
+
});
|
|
44
|
+
themeChange = output();
|
|
45
|
+
rippleChange = output();
|
|
46
|
+
segmentButtons = viewChildren("segment", {
|
|
47
|
+
...ngDevMode ? { debugName: "segmentButtons" } : /* istanbul ignore next */ {},
|
|
48
|
+
read: ElementRef
|
|
49
|
+
});
|
|
50
|
+
id = uniqueId("tx-theme-configurator");
|
|
51
|
+
translations = injectTranslations();
|
|
52
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
53
|
+
passThrough = injectPassThrough("themeConfigurator", this, this.pt, this.ptOptions);
|
|
54
|
+
hostStyle = computed(() => ({
|
|
55
|
+
...toStyleObject(this.dt(), "--tx-theme-configurator"),
|
|
56
|
+
...this.passThrough().root?.style
|
|
57
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
58
|
+
styleIndex = computed(() => this.styles().findIndex((style) => style.name === this.theme.style().name), ...ngDevMode ? [{ debugName: "styleIndex" }] : /* istanbul ignore next */ []);
|
|
59
|
+
update(choice) {
|
|
60
|
+
this.theme.updateTheme(choice);
|
|
61
|
+
this.themeChange.emit({
|
|
62
|
+
style: this.theme.style(),
|
|
63
|
+
primary: this.theme.primary(),
|
|
64
|
+
surface: this.theme.surface()
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
setRipple(enabled) {
|
|
68
|
+
this.theme.setRipple(enabled);
|
|
69
|
+
this.rippleChange.emit(enabled);
|
|
70
|
+
}
|
|
71
|
+
selectStyle(index) {
|
|
72
|
+
if (index !== this.styleIndex()) this.update({ style: this.styles()[index] });
|
|
73
|
+
}
|
|
74
|
+
onSegmentKeydown(event, index) {
|
|
75
|
+
const count = this.styles().length;
|
|
76
|
+
const next = event.key === "Home" ? 0 : event.key === "End" ? count - 1 : event.key in STEPS ? (index + STEPS[event.key] + count) % count : -1;
|
|
77
|
+
if (next < 0) return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
this.segmentButtons()[next].nativeElement.focus();
|
|
80
|
+
this.selectStyle(next);
|
|
81
|
+
}
|
|
82
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
83
|
+
minVersion: "12.0.0",
|
|
84
|
+
version: "22.2.5",
|
|
85
|
+
ngImport: i0,
|
|
86
|
+
type: TxThemeConfigurator,
|
|
87
|
+
deps: [],
|
|
88
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
89
|
+
});
|
|
90
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
91
|
+
minVersion: "17.0.0",
|
|
92
|
+
version: "22.2.5",
|
|
93
|
+
type: TxThemeConfigurator,
|
|
94
|
+
isStandalone: true,
|
|
95
|
+
selector: "tx-theme-configurator",
|
|
96
|
+
inputs: {
|
|
97
|
+
styles: {
|
|
98
|
+
classPropertyName: "styles",
|
|
99
|
+
publicName: "styles",
|
|
100
|
+
isSignal: true,
|
|
101
|
+
isRequired: false,
|
|
102
|
+
transformFunction: null
|
|
103
|
+
},
|
|
104
|
+
primaries: {
|
|
105
|
+
classPropertyName: "primaries",
|
|
106
|
+
publicName: "primaries",
|
|
107
|
+
isSignal: true,
|
|
108
|
+
isRequired: false,
|
|
109
|
+
transformFunction: null
|
|
110
|
+
},
|
|
111
|
+
surfaces: {
|
|
112
|
+
classPropertyName: "surfaces",
|
|
113
|
+
publicName: "surfaces",
|
|
114
|
+
isSignal: true,
|
|
115
|
+
isRequired: false,
|
|
116
|
+
transformFunction: null
|
|
117
|
+
},
|
|
118
|
+
columns: {
|
|
119
|
+
classPropertyName: "columns",
|
|
120
|
+
publicName: "columns",
|
|
121
|
+
isSignal: true,
|
|
122
|
+
isRequired: false,
|
|
123
|
+
transformFunction: null
|
|
124
|
+
},
|
|
125
|
+
showRipple: {
|
|
126
|
+
classPropertyName: "showRipple",
|
|
127
|
+
publicName: "showRipple",
|
|
128
|
+
isSignal: true,
|
|
129
|
+
isRequired: false,
|
|
130
|
+
transformFunction: null
|
|
131
|
+
},
|
|
132
|
+
dt: {
|
|
133
|
+
classPropertyName: "dt",
|
|
134
|
+
publicName: "dt",
|
|
135
|
+
isSignal: true,
|
|
136
|
+
isRequired: false,
|
|
137
|
+
transformFunction: null
|
|
138
|
+
},
|
|
139
|
+
pt: {
|
|
140
|
+
classPropertyName: "pt",
|
|
141
|
+
publicName: "pt",
|
|
142
|
+
isSignal: true,
|
|
143
|
+
isRequired: false,
|
|
144
|
+
transformFunction: null
|
|
145
|
+
},
|
|
146
|
+
ptOptions: {
|
|
147
|
+
classPropertyName: "ptOptions",
|
|
148
|
+
publicName: "ptOptions",
|
|
149
|
+
isSignal: true,
|
|
150
|
+
isRequired: false,
|
|
151
|
+
transformFunction: null
|
|
152
|
+
},
|
|
153
|
+
unstyled: {
|
|
154
|
+
classPropertyName: "unstyled",
|
|
155
|
+
publicName: "unstyled",
|
|
156
|
+
isSignal: true,
|
|
157
|
+
isRequired: false,
|
|
158
|
+
transformFunction: null
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
outputs: {
|
|
162
|
+
themeChange: "themeChange",
|
|
163
|
+
rippleChange: "rippleChange"
|
|
164
|
+
},
|
|
165
|
+
host: {
|
|
166
|
+
properties: {
|
|
167
|
+
"class": "passThrough().root?.class",
|
|
168
|
+
"style": "hostStyle()",
|
|
169
|
+
"attr.data-styled": "!isUnstyled() || null"
|
|
170
|
+
},
|
|
171
|
+
classAttribute: "tx-theme-configurator"
|
|
172
|
+
},
|
|
173
|
+
viewQueries: [{
|
|
174
|
+
propertyName: "segmentButtons",
|
|
175
|
+
predicate: ["segment"],
|
|
176
|
+
descendants: true,
|
|
177
|
+
read: ElementRef,
|
|
178
|
+
isSignal: true
|
|
179
|
+
}],
|
|
180
|
+
ngImport: i0,
|
|
181
|
+
template: "@if (primaries().length) {\n <div class=\"tx-theme-configurator__section\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-primary'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themePrimary }}</span>\n <tx-color-swatches\n class=\"tx-theme-configurator__swatches\"\n [class]=\"passThrough().swatches?.class\"\n [style]=\"passThrough().swatches?.style\"\n [options]=\"primaries()\"\n [columns]=\"columns()\"\n [ariaLabelledBy]=\"id + '-primary'\"\n [ngModel]=\"theme.primary()\"\n (ngModelChange)=\"update({ primary: $event })\"\n />\n </div>\n}\n@if (surfaces().length) {\n <div class=\"tx-theme-configurator__section\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-surface'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themeSurface }}</span>\n <tx-color-swatches\n class=\"tx-theme-configurator__swatches\"\n [class]=\"passThrough().swatches?.class\"\n [style]=\"passThrough().swatches?.style\"\n [options]=\"surfaces()\"\n [columns]=\"columns()\"\n [ariaLabelledBy]=\"id + '-surface'\"\n [ngModel]=\"theme.surface()\"\n (ngModelChange)=\"update({ surface: $event })\"\n />\n </div>\n}\n@if (styles().length > 1) {\n <div class=\"tx-theme-configurator__section\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-style'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themeStyle }}</span>\n <div class=\"tx-theme-configurator__segments\" role=\"radiogroup\" [attr.aria-labelledby]=\"id + '-style'\" [class]=\"passThrough().segments?.class\" [style]=\"passThrough().segments?.style\">\n <tx-button-group>\n @for (style of styles(); track style.name; let index = $index) {\n <button\n #segment\n txButton\n type=\"button\"\n role=\"radio\"\n size=\"small\"\n class=\"tx-theme-configurator__segment\"\n [class]=\"passThrough().segment?.class\"\n [style]=\"passThrough().segment?.style\"\n [severity]=\"index === styleIndex() ? 'primary' : 'secondary'\"\n [outlined]=\"index !== styleIndex()\"\n [attr.aria-checked]=\"index === styleIndex()\"\n [tabindex]=\"index === styleIndex() || (styleIndex() < 0 && index === 0) ? 0 : -1\"\n (click)=\"selectStyle(index)\"\n (keydown)=\"onSegmentKeydown($event, index)\"\n >\n {{ style.label }}\n </button>\n }\n </tx-button-group>\n </div>\n </div>\n}\n@if (showRipple()) {\n <div class=\"tx-theme-configurator__section tx-theme-configurator__section--row\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-ripple'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themeRipple }}</span>\n <tx-toggle-switch [ariaLabelledBy]=\"id + '-ripple'\" [ngModel]=\"theme.ripple()\" (ngModelChange)=\"setRipple($event)\" />\n </div>\n}\n",
|
|
182
|
+
styles: [":host{display:flex;flex-direction:column}.tx-theme-configurator__section{display:flex;flex-direction:column}.tx-theme-configurator__section--row{flex-direction:row;align-items:center;justify-content:space-between}.tx-theme-configurator__segments tx-button-group{display:flex}.tx-theme-configurator__segment{flex:1 1 0;min-width:0}:host([data-styled]){gap:var(--tx-theme-configurator-gap);width:var(--tx-theme-configurator-width);max-width:100%}:host([data-styled]) .tx-theme-configurator__section{gap:var(--tx-theme-configurator-section-gap)}:host([data-styled]) .tx-theme-configurator__label{color:var(--tx-theme-configurator-label-color);font-size:var(--tx-theme-configurator-label-font-size);font-weight:var(--tx-theme-configurator-label-font-weight)}\n"],
|
|
183
|
+
dependencies: [
|
|
184
|
+
{
|
|
185
|
+
kind: "ngmodule",
|
|
186
|
+
type: FormsModule
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
kind: "directive",
|
|
190
|
+
type: i1.NgControlStatus,
|
|
191
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
kind: "directive",
|
|
195
|
+
type: i1.NgModel,
|
|
196
|
+
selector: "[ngModel]:not([formControlName]):not([formControl])",
|
|
197
|
+
inputs: [
|
|
198
|
+
"name",
|
|
199
|
+
"disabled",
|
|
200
|
+
"ngModel",
|
|
201
|
+
"ngModelOptions"
|
|
202
|
+
],
|
|
203
|
+
outputs: ["ngModelChange"],
|
|
204
|
+
exportAs: ["ngModel"]
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
kind: "component",
|
|
208
|
+
type: TxButton,
|
|
209
|
+
selector: "button[txButton], a[txButton]",
|
|
210
|
+
inputs: [
|
|
211
|
+
"label",
|
|
212
|
+
"severity",
|
|
213
|
+
"size",
|
|
214
|
+
"variant",
|
|
215
|
+
"outlined",
|
|
216
|
+
"text",
|
|
217
|
+
"link",
|
|
218
|
+
"rounded",
|
|
219
|
+
"raised",
|
|
220
|
+
"plain",
|
|
221
|
+
"fluid",
|
|
222
|
+
"disabled",
|
|
223
|
+
"tabindex",
|
|
224
|
+
"icon",
|
|
225
|
+
"iconPos",
|
|
226
|
+
"iconOnly",
|
|
227
|
+
"loading",
|
|
228
|
+
"loadingIcon",
|
|
229
|
+
"badge",
|
|
230
|
+
"badgeSeverity",
|
|
231
|
+
"dt",
|
|
232
|
+
"pt",
|
|
233
|
+
"ptOptions",
|
|
234
|
+
"unstyled"
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
kind: "component",
|
|
239
|
+
type: TxButtonGroup,
|
|
240
|
+
selector: "tx-button-group"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
kind: "component",
|
|
244
|
+
type: TxColorSwatches,
|
|
245
|
+
selector: "tx-color-swatches",
|
|
246
|
+
inputs: [
|
|
247
|
+
"options",
|
|
248
|
+
"columns",
|
|
249
|
+
"size",
|
|
250
|
+
"invalid",
|
|
251
|
+
"disabled",
|
|
252
|
+
"readonly",
|
|
253
|
+
"ariaLabel",
|
|
254
|
+
"ariaLabelledBy",
|
|
255
|
+
"dt",
|
|
256
|
+
"pt",
|
|
257
|
+
"ptOptions",
|
|
258
|
+
"unstyled"
|
|
259
|
+
],
|
|
260
|
+
outputs: ["changed"]
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
kind: "component",
|
|
264
|
+
type: TxToggleSwitch,
|
|
265
|
+
selector: "tx-toggle-switch",
|
|
266
|
+
inputs: [
|
|
267
|
+
"label",
|
|
268
|
+
"description",
|
|
269
|
+
"labelPosition",
|
|
270
|
+
"trueValue",
|
|
271
|
+
"falseValue",
|
|
272
|
+
"onIcon",
|
|
273
|
+
"offIcon",
|
|
274
|
+
"size",
|
|
275
|
+
"invalid",
|
|
276
|
+
"disabled",
|
|
277
|
+
"readonly",
|
|
278
|
+
"required",
|
|
279
|
+
"name",
|
|
280
|
+
"inputId",
|
|
281
|
+
"ariaLabel",
|
|
282
|
+
"ariaLabelledBy",
|
|
283
|
+
"tabindex",
|
|
284
|
+
"dt",
|
|
285
|
+
"pt",
|
|
286
|
+
"ptOptions",
|
|
287
|
+
"unstyled"
|
|
288
|
+
],
|
|
289
|
+
outputs: ["changed"]
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
296
|
+
minVersion: "12.0.0",
|
|
297
|
+
version: "22.2.5",
|
|
298
|
+
ngImport: i0,
|
|
299
|
+
type: TxThemeConfigurator,
|
|
300
|
+
decorators: [{
|
|
301
|
+
type: Component,
|
|
302
|
+
args: [{
|
|
303
|
+
selector: "tx-theme-configurator",
|
|
304
|
+
imports: [
|
|
305
|
+
FormsModule,
|
|
306
|
+
TxButton,
|
|
307
|
+
TxButtonGroup,
|
|
308
|
+
TxColorSwatches,
|
|
309
|
+
TxToggleSwitch
|
|
310
|
+
],
|
|
311
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
312
|
+
host: {
|
|
313
|
+
class: "tx-theme-configurator",
|
|
314
|
+
"[class]": "passThrough().root?.class",
|
|
315
|
+
"[style]": "hostStyle()",
|
|
316
|
+
"[attr.data-styled]": "!isUnstyled() || null"
|
|
317
|
+
},
|
|
318
|
+
template: "@if (primaries().length) {\n <div class=\"tx-theme-configurator__section\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-primary'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themePrimary }}</span>\n <tx-color-swatches\n class=\"tx-theme-configurator__swatches\"\n [class]=\"passThrough().swatches?.class\"\n [style]=\"passThrough().swatches?.style\"\n [options]=\"primaries()\"\n [columns]=\"columns()\"\n [ariaLabelledBy]=\"id + '-primary'\"\n [ngModel]=\"theme.primary()\"\n (ngModelChange)=\"update({ primary: $event })\"\n />\n </div>\n}\n@if (surfaces().length) {\n <div class=\"tx-theme-configurator__section\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-surface'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themeSurface }}</span>\n <tx-color-swatches\n class=\"tx-theme-configurator__swatches\"\n [class]=\"passThrough().swatches?.class\"\n [style]=\"passThrough().swatches?.style\"\n [options]=\"surfaces()\"\n [columns]=\"columns()\"\n [ariaLabelledBy]=\"id + '-surface'\"\n [ngModel]=\"theme.surface()\"\n (ngModelChange)=\"update({ surface: $event })\"\n />\n </div>\n}\n@if (styles().length > 1) {\n <div class=\"tx-theme-configurator__section\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-style'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themeStyle }}</span>\n <div class=\"tx-theme-configurator__segments\" role=\"radiogroup\" [attr.aria-labelledby]=\"id + '-style'\" [class]=\"passThrough().segments?.class\" [style]=\"passThrough().segments?.style\">\n <tx-button-group>\n @for (style of styles(); track style.name; let index = $index) {\n <button\n #segment\n txButton\n type=\"button\"\n role=\"radio\"\n size=\"small\"\n class=\"tx-theme-configurator__segment\"\n [class]=\"passThrough().segment?.class\"\n [style]=\"passThrough().segment?.style\"\n [severity]=\"index === styleIndex() ? 'primary' : 'secondary'\"\n [outlined]=\"index !== styleIndex()\"\n [attr.aria-checked]=\"index === styleIndex()\"\n [tabindex]=\"index === styleIndex() || (styleIndex() < 0 && index === 0) ? 0 : -1\"\n (click)=\"selectStyle(index)\"\n (keydown)=\"onSegmentKeydown($event, index)\"\n >\n {{ style.label }}\n </button>\n }\n </tx-button-group>\n </div>\n </div>\n}\n@if (showRipple()) {\n <div class=\"tx-theme-configurator__section tx-theme-configurator__section--row\" [class]=\"passThrough().section?.class\" [style]=\"passThrough().section?.style\">\n <span class=\"tx-theme-configurator__label\" [id]=\"id + '-ripple'\" [class]=\"passThrough().label?.class\" [style]=\"passThrough().label?.style\">{{ translations().themeRipple }}</span>\n <tx-toggle-switch [ariaLabelledBy]=\"id + '-ripple'\" [ngModel]=\"theme.ripple()\" (ngModelChange)=\"setRipple($event)\" />\n </div>\n}\n",
|
|
319
|
+
styles: [":host{display:flex;flex-direction:column}.tx-theme-configurator__section{display:flex;flex-direction:column}.tx-theme-configurator__section--row{flex-direction:row;align-items:center;justify-content:space-between}.tx-theme-configurator__segments tx-button-group{display:flex}.tx-theme-configurator__segment{flex:1 1 0;min-width:0}:host([data-styled]){gap:var(--tx-theme-configurator-gap);width:var(--tx-theme-configurator-width);max-width:100%}:host([data-styled]) .tx-theme-configurator__section{gap:var(--tx-theme-configurator-section-gap)}:host([data-styled]) .tx-theme-configurator__label{color:var(--tx-theme-configurator-label-color);font-size:var(--tx-theme-configurator-label-font-size);font-weight:var(--tx-theme-configurator-label-font-weight)}\n"]
|
|
320
|
+
}]
|
|
321
|
+
}],
|
|
322
|
+
propDecorators: {
|
|
323
|
+
styles: [{
|
|
324
|
+
type: i0.Input,
|
|
325
|
+
args: [{
|
|
326
|
+
isSignal: true,
|
|
327
|
+
alias: "styles",
|
|
328
|
+
required: false
|
|
329
|
+
}]
|
|
330
|
+
}],
|
|
331
|
+
primaries: [{
|
|
332
|
+
type: i0.Input,
|
|
333
|
+
args: [{
|
|
334
|
+
isSignal: true,
|
|
335
|
+
alias: "primaries",
|
|
336
|
+
required: false
|
|
337
|
+
}]
|
|
338
|
+
}],
|
|
339
|
+
surfaces: [{
|
|
340
|
+
type: i0.Input,
|
|
341
|
+
args: [{
|
|
342
|
+
isSignal: true,
|
|
343
|
+
alias: "surfaces",
|
|
344
|
+
required: false
|
|
345
|
+
}]
|
|
346
|
+
}],
|
|
347
|
+
columns: [{
|
|
348
|
+
type: i0.Input,
|
|
349
|
+
args: [{
|
|
350
|
+
isSignal: true,
|
|
351
|
+
alias: "columns",
|
|
352
|
+
required: false
|
|
353
|
+
}]
|
|
354
|
+
}],
|
|
355
|
+
showRipple: [{
|
|
356
|
+
type: i0.Input,
|
|
357
|
+
args: [{
|
|
358
|
+
isSignal: true,
|
|
359
|
+
alias: "showRipple",
|
|
360
|
+
required: false
|
|
361
|
+
}]
|
|
362
|
+
}],
|
|
363
|
+
dt: [{
|
|
364
|
+
type: i0.Input,
|
|
365
|
+
args: [{
|
|
366
|
+
isSignal: true,
|
|
367
|
+
alias: "dt",
|
|
368
|
+
required: false
|
|
369
|
+
}]
|
|
370
|
+
}],
|
|
371
|
+
pt: [{
|
|
372
|
+
type: i0.Input,
|
|
373
|
+
args: [{
|
|
374
|
+
isSignal: true,
|
|
375
|
+
alias: "pt",
|
|
376
|
+
required: false
|
|
377
|
+
}]
|
|
378
|
+
}],
|
|
379
|
+
ptOptions: [{
|
|
380
|
+
type: i0.Input,
|
|
381
|
+
args: [{
|
|
382
|
+
isSignal: true,
|
|
383
|
+
alias: "ptOptions",
|
|
384
|
+
required: false
|
|
385
|
+
}]
|
|
386
|
+
}],
|
|
387
|
+
unstyled: [{
|
|
388
|
+
type: i0.Input,
|
|
389
|
+
args: [{
|
|
390
|
+
isSignal: true,
|
|
391
|
+
alias: "unstyled",
|
|
392
|
+
required: false
|
|
393
|
+
}]
|
|
394
|
+
}],
|
|
395
|
+
themeChange: [{
|
|
396
|
+
type: i0.Output,
|
|
397
|
+
args: ["themeChange"]
|
|
398
|
+
}],
|
|
399
|
+
rippleChange: [{
|
|
400
|
+
type: i0.Output,
|
|
401
|
+
args: ["rippleChange"]
|
|
402
|
+
}],
|
|
403
|
+
segmentButtons: [{
|
|
404
|
+
type: i0.ViewChildren,
|
|
405
|
+
args: ["segment", {
|
|
406
|
+
read: ElementRef,
|
|
407
|
+
isSignal: true
|
|
408
|
+
}]
|
|
409
|
+
}]
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
export { TxThemeConfigurator };
|
|
413
|
+
|
|
414
|
+
//# sourceMappingURL=tectra-ng-blocks-theme-configurator.mjs.map
|