@tectra-ng/blocks 0.0.0-stage → 0.1.7

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.
Files changed (101) hide show
  1. package/README.md +16 -2
  2. package/action-tile/README.md +33 -0
  3. package/actions-menu/README.md +42 -0
  4. package/app-footer/README.md +30 -0
  5. package/app-layout/README.md +51 -0
  6. package/command-palette/README.md +63 -0
  7. package/console-layout/README.md +70 -0
  8. package/cookie-notice/README.md +45 -0
  9. package/empty-state/README.md +35 -0
  10. package/fesm2022/tectra-ng-blocks-action-tile.mjs +294 -0
  11. package/fesm2022/tectra-ng-blocks-action-tile.mjs.map +1 -0
  12. package/fesm2022/tectra-ng-blocks-actions-menu.mjs +380 -0
  13. package/fesm2022/tectra-ng-blocks-actions-menu.mjs.map +1 -0
  14. package/fesm2022/tectra-ng-blocks-app-footer.mjs +276 -0
  15. package/fesm2022/tectra-ng-blocks-app-footer.mjs.map +1 -0
  16. package/fesm2022/tectra-ng-blocks-app-layout.mjs +544 -0
  17. package/fesm2022/tectra-ng-blocks-app-layout.mjs.map +1 -0
  18. package/fesm2022/tectra-ng-blocks-command-palette.mjs +663 -0
  19. package/fesm2022/tectra-ng-blocks-command-palette.mjs.map +1 -0
  20. package/fesm2022/tectra-ng-blocks-console-layout.mjs +1060 -0
  21. package/fesm2022/tectra-ng-blocks-console-layout.mjs.map +1 -0
  22. package/fesm2022/tectra-ng-blocks-cookie-notice.mjs +416 -0
  23. package/fesm2022/tectra-ng-blocks-cookie-notice.mjs.map +1 -0
  24. package/fesm2022/tectra-ng-blocks-empty-state.mjs +278 -0
  25. package/fesm2022/tectra-ng-blocks-empty-state.mjs.map +1 -0
  26. package/fesm2022/tectra-ng-blocks-filters-panel.mjs +959 -0
  27. package/fesm2022/tectra-ng-blocks-filters-panel.mjs.map +1 -0
  28. package/fesm2022/tectra-ng-blocks-kanban.mjs +864 -0
  29. package/fesm2022/tectra-ng-blocks-kanban.mjs.map +1 -0
  30. package/fesm2022/tectra-ng-blocks-network-status.mjs +303 -0
  31. package/fesm2022/tectra-ng-blocks-network-status.mjs.map +1 -0
  32. package/fesm2022/tectra-ng-blocks-page-header.mjs +195 -0
  33. package/fesm2022/tectra-ng-blocks-page-header.mjs.map +1 -0
  34. package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs +692 -0
  35. package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs.map +1 -0
  36. package/fesm2022/tectra-ng-blocks-public-header.mjs +372 -0
  37. package/fesm2022/tectra-ng-blocks-public-header.mjs.map +1 -0
  38. package/fesm2022/tectra-ng-blocks-qr-code.mjs +487 -0
  39. package/fesm2022/tectra-ng-blocks-qr-code.mjs.map +1 -0
  40. package/fesm2022/tectra-ng-blocks-switch-language.mjs +316 -0
  41. package/fesm2022/tectra-ng-blocks-switch-language.mjs.map +1 -0
  42. package/fesm2022/tectra-ng-blocks-switch-theme.mjs +416 -0
  43. package/fesm2022/tectra-ng-blocks-switch-theme.mjs.map +1 -0
  44. package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs +260 -0
  45. package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs.map +1 -0
  46. package/fesm2022/tectra-ng-blocks-wizard.mjs +1284 -0
  47. package/fesm2022/tectra-ng-blocks-wizard.mjs.map +1 -0
  48. package/fesm2022/tectra-ng-blocks.mjs +4 -0
  49. package/fesm2022/tectra-ng-blocks.mjs.map +1 -0
  50. package/filters-panel/README.md +68 -0
  51. package/kanban/README.md +55 -0
  52. package/network-status/README.md +33 -0
  53. package/package.json +137 -3
  54. package/page-header/README.md +32 -0
  55. package/pinned-tabs/README.md +42 -0
  56. package/public-header/README.md +44 -0
  57. package/qr-code/README.md +52 -0
  58. package/switch-language/README.md +33 -0
  59. package/switch-theme/README.md +32 -0
  60. package/topbar-preferences/README.md +35 -0
  61. package/types/tectra-ng-blocks-action-tile.d.ts +114 -0
  62. package/types/tectra-ng-blocks-action-tile.d.ts.map +1 -0
  63. package/types/tectra-ng-blocks-actions-menu.d.ts +112 -0
  64. package/types/tectra-ng-blocks-actions-menu.d.ts.map +1 -0
  65. package/types/tectra-ng-blocks-app-footer.d.ts +111 -0
  66. package/types/tectra-ng-blocks-app-footer.d.ts.map +1 -0
  67. package/types/tectra-ng-blocks-app-layout.d.ts +212 -0
  68. package/types/tectra-ng-blocks-app-layout.d.ts.map +1 -0
  69. package/types/tectra-ng-blocks-command-palette.d.ts +291 -0
  70. package/types/tectra-ng-blocks-command-palette.d.ts.map +1 -0
  71. package/types/tectra-ng-blocks-console-layout.d.ts +454 -0
  72. package/types/tectra-ng-blocks-console-layout.d.ts.map +1 -0
  73. package/types/tectra-ng-blocks-cookie-notice.d.ts +168 -0
  74. package/types/tectra-ng-blocks-cookie-notice.d.ts.map +1 -0
  75. package/types/tectra-ng-blocks-empty-state.d.ts +138 -0
  76. package/types/tectra-ng-blocks-empty-state.d.ts.map +1 -0
  77. package/types/tectra-ng-blocks-filters-panel.d.ts +314 -0
  78. package/types/tectra-ng-blocks-filters-panel.d.ts.map +1 -0
  79. package/types/tectra-ng-blocks-kanban.d.ts +260 -0
  80. package/types/tectra-ng-blocks-kanban.d.ts.map +1 -0
  81. package/types/tectra-ng-blocks-network-status.d.ts +108 -0
  82. package/types/tectra-ng-blocks-network-status.d.ts.map +1 -0
  83. package/types/tectra-ng-blocks-page-header.d.ts +86 -0
  84. package/types/tectra-ng-blocks-page-header.d.ts.map +1 -0
  85. package/types/tectra-ng-blocks-pinned-tabs.d.ts +159 -0
  86. package/types/tectra-ng-blocks-pinned-tabs.d.ts.map +1 -0
  87. package/types/tectra-ng-blocks-public-header.d.ts +142 -0
  88. package/types/tectra-ng-blocks-public-header.d.ts.map +1 -0
  89. package/types/tectra-ng-blocks-qr-code.d.ts +160 -0
  90. package/types/tectra-ng-blocks-qr-code.d.ts.map +1 -0
  91. package/types/tectra-ng-blocks-switch-language.d.ts +106 -0
  92. package/types/tectra-ng-blocks-switch-language.d.ts.map +1 -0
  93. package/types/tectra-ng-blocks-switch-theme.d.ts +108 -0
  94. package/types/tectra-ng-blocks-switch-theme.d.ts.map +1 -0
  95. package/types/tectra-ng-blocks-topbar-preferences.d.ts +103 -0
  96. package/types/tectra-ng-blocks-topbar-preferences.d.ts.map +1 -0
  97. package/types/tectra-ng-blocks-wizard.d.ts +682 -0
  98. package/types/tectra-ng-blocks-wizard.d.ts.map +1 -0
  99. package/types/tectra-ng-blocks.d.ts +2 -0
  100. package/types/tectra-ng-blocks.d.ts.map +1 -0
  101. package/wizard/README.md +77 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectra-ng-blocks-console-layout.mjs","names":[],"sources":["../../../../packages/blocks/console-layout/src/console-rail-match.ts","../../../../packages/blocks/console-layout/src/console-document.service.ts","../../../../packages/blocks/console-layout/src/console-rail.component.ts","../../../../packages/blocks/console-layout/src/console-layout.component.ts","../../../../packages/blocks/console-layout/src/console-layout.component.html","../../../../packages/blocks/console-layout/src/console-panel.component.ts"],"sourcesContent":["import { IsActiveMatchOptions } from '@angular/router';\n\nexport const TX_CONSOLE_RAIL_EXACT_MATCH: IsActiveMatchOptions = {\n paths: 'exact',\n queryParams: 'ignored',\n matrixParams: 'ignored',\n fragment: 'ignored',\n};\n\nexport const TX_CONSOLE_RAIL_SECTION_MATCH: IsActiveMatchOptions = {\n ...TX_CONSOLE_RAIL_EXACT_MATCH,\n paths: 'subset',\n};\n","import { DOCUMENT, Injectable, OnDestroy, inject } from '@angular/core';\nimport { Title } from '@angular/platform-browser';\n\n@Injectable()\nexport class TxConsoleDocument implements OnDestroy {\n private readonly title = inject(Title);\n private readonly document = inject(DOCUMENT);\n\n private initialTitle: string | null = null;\n private initialFavicon: string | null = null;\n\n setTitle(title: string): void {\n this.initialTitle ??= this.title.getTitle();\n this.title.setTitle(title);\n }\n\n setFavicon(href: string): void {\n const link = this.faviconLink();\n if (!link) {\n return;\n }\n this.initialFavicon ??= link.getAttribute('href') ?? '';\n link.setAttribute('href', href);\n }\n\n ngOnDestroy(): void {\n if (this.initialTitle !== null) {\n this.title.setTitle(this.initialTitle);\n }\n if (this.initialFavicon !== null) {\n this.faviconLink()?.setAttribute('href', this.initialFavicon);\n }\n }\n\n private faviconLink(): HTMLLinkElement | null {\n return this.document.querySelector<HTMLLinkElement>('link[rel=\"icon\"]');\n }\n}\n","import { ChangeDetectionStrategy, Component, booleanAttribute, input } from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TxConsoleRailItem } from './console-layout.types';\nimport { TX_CONSOLE_RAIL_EXACT_MATCH } from './console-rail-match';\n\n@Component({\n selector: 'tx-console-rail',\n imports: [RouterLink, RouterLinkActive, TxIcon],\n template: `\n <nav class=\"tx-console-rail__nav\" [attr.aria-label]=\"label() ?? null\">\n @for (item of items(); track item.label) {\n @if (item.routerLink !== undefined) {\n <a\n class=\"tx-console-rail__item\"\n routerLinkActive=\"tx-console-rail__item--active\"\n ariaCurrentWhenActive=\"page\"\n [class.tx-console-rail__item--active]=\"item.active\"\n [routerLink]=\"item.routerLink\"\n [queryParams]=\"item.queryParams\"\n [routerLinkActiveOptions]=\"item.activeOptions ?? exactMatch\"\n [attr.target]=\"item.target ?? null\"\n >\n <tx-icon class=\"tx-console-rail__icon\" aria-hidden=\"true\" [name]=\"item.icon\" />\n <span class=\"tx-console-rail__label\">{{ item.label }}</span>\n </a>\n } @else if (item.url) {\n <a\n class=\"tx-console-rail__item\"\n [class.tx-console-rail__item--active]=\"item.active\"\n [attr.aria-current]=\"item.active ? 'page' : null\"\n [attr.href]=\"item.url\"\n [attr.target]=\"item.target ?? null\"\n >\n <tx-icon class=\"tx-console-rail__icon\" aria-hidden=\"true\" [name]=\"item.icon\" />\n <span class=\"tx-console-rail__label\">{{ item.label }}</span>\n </a>\n } @else {\n <button\n type=\"button\"\n class=\"tx-console-rail__item\"\n [class.tx-console-rail__item--active]=\"item.active\"\n [attr.aria-current]=\"item.active ? 'page' : null\"\n (click)=\"item.command?.()\"\n >\n <tx-icon class=\"tx-console-rail__icon\" aria-hidden=\"true\" [name]=\"item.icon\" />\n <span class=\"tx-console-rail__label\">{{ item.label }}</span>\n </button>\n }\n }\n </nav>\n `,\n styleUrl: './console-rail.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { class: 'tx-console-rail', '[attr.data-styled]': '!unstyled() || null' },\n})\nexport class TxConsoleRail {\n readonly items = input.required<readonly TxConsoleRailItem[]>();\n readonly label = input<string | undefined>(undefined);\n readonly unstyled = input<boolean, unknown>(false, { transform: booleanAttribute });\n protected readonly exactMatch = TX_CONSOLE_RAIL_EXACT_MATCH;\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal } from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ActivatedRouteSnapshot, NavigationEnd, Router, RouterLink } from '@angular/router';\nimport { TxAppFooter, TxAppFooterLink } from '@tectra-ng/blocks/app-footer';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraConsoleLayoutTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { filter, of } from 'rxjs';\nimport { TxConsoleDocument } from './console-document.service';\nimport { TxConsoleLayoutPart, TxConsoleRailItem, TxConsoleResponsive, TxConsoleTranslate } from './console-layout.types';\nimport { TxConsoleRail } from './console-rail.component';\n\n@Component({\n selector: 'tx-console-layout',\n imports: [NgTemplateOutlet, RouterLink, TxConsoleRail, TxAppFooter],\n templateUrl: './console-layout.component.html',\n styleUrl: './console-layout.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TxConsoleDocument],\n host: {\n class: 'tx-console-layout',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-responsive]': 'responsive()',\n },\n})\nexport class TxConsoleLayout {\n private readonly router = inject(Router, { optional: true });\n private readonly consoleDocument = inject(TxConsoleDocument);\n\n readonly title = input.required<string>();\n readonly titleMuted = input<string | undefined>(undefined);\n readonly logo = input<string | undefined>(undefined);\n readonly homeLink = input<string | readonly unknown[] | undefined>(undefined);\n readonly railItems = input<readonly TxConsoleRailItem[]>([]);\n readonly railLabel = input<string | undefined>(undefined);\n readonly crumbKey = input<string>('crumb');\n readonly crumbs = input<readonly string[] | undefined>(undefined);\n readonly footerName = input<string | undefined>(undefined);\n readonly footerLinks = input<readonly TxAppFooterLink[]>([]);\n readonly documentTitle = input<string | undefined>(undefined);\n readonly favicon = input<string | undefined>(undefined);\n readonly translate = input<TxConsoleTranslate | undefined>(undefined);\n readonly responsive = input<TxConsoleResponsive>('viewport');\n readonly dt = input<TectraDeepPartial<TectraConsoleLayoutTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxConsoleLayoutPart, TxConsoleLayout> | 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('consoleLayout', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n readonly tokenStyle = computed(() => toStyleObject(this.dt(), '--tx-console-layout'));\n readonly hostStyle = computed(() => ({ ...this.tokenStyle(), ...this.passThrough().root?.style }));\n\n private readonly panels = signal(0);\n readonly hasPanel = computed(() => this.panels() > 0);\n\n private readonly navigationEnd = toSignal(this.router ? this.router.events.pipe(filter((event) => event instanceof NavigationEnd)) : of(null), {\n initialValue: null,\n });\n\n readonly visibleCrumbs = computed(() => {\n const own = this.crumbs();\n if (own) {\n return own.map((crumb) => this.text(crumb));\n }\n this.navigationEnd();\n return this.routeCrumbs(this.crumbKey()).map((crumb) => this.text(crumb));\n });\n\n protected readonly visibleRailItems = computed(() => this.railItems().map((item) => ({ ...item, label: this.text(item.label) })));\n readonly visibleFooterLinks = computed(() => this.footerLinks().map((link) => ({ ...link, label: this.text(link.label) })));\n protected readonly railName = computed(() => this.railLabel() ?? this.translations().consoleSections);\n readonly pageTitle = computed(() => [this.visibleCrumbs().at(-1), this.documentTitle()].filter(Boolean).join(' · '));\n\n constructor() {\n effect(() => {\n if (this.documentTitle()) {\n this.consoleDocument.setTitle(this.pageTitle());\n }\n });\n effect(() => {\n const favicon = this.favicon();\n if (favicon) {\n this.consoleDocument.setFavicon(favicon);\n }\n });\n }\n\n registerPanel(): () => void {\n this.panels.update((count) => count + 1);\n return () => this.panels.update((count) => count - 1);\n }\n\n private text(key: string): string {\n return this.translate()?.(key) ?? key;\n }\n\n private routeCrumbs(key: string): string[] {\n const crumbs: string[] = [];\n let current: ActivatedRouteSnapshot | null = this.router?.routerState.snapshot.root ?? null;\n while (current) {\n const crumb: unknown = current.routeConfig?.data?.[key];\n if (typeof crumb === 'string') {\n crumbs.push(crumb);\n }\n current = current.firstChild;\n }\n return crumbs;\n }\n}\n","<header class=\"tx-console-layout__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <div class=\"tx-console-layout__start\">\n <div class=\"tx-console-layout__apps\">\n <ng-content select=\"[txConsoleApps]\" />\n </div>\n <div class=\"tx-console-layout__trail\" [class]=\"passThrough().crumbs?.class\" [style]=\"passThrough().crumbs?.style\">\n <ng-template #brand>\n @if (logo()) {\n <img class=\"tx-console-layout__logo\" alt=\"\" [src]=\"logo()\" [class]=\"passThrough().logo?.class\" [style]=\"passThrough().logo?.style\" />\n }\n <span class=\"tx-console-layout__brand-text\"\n >{{ title() }}\n @if (titleMuted()) {\n <span class=\"tx-console-layout__brand-muted\">{{ titleMuted() }}</span>\n }\n </span>\n </ng-template>\n @if (homeLink() !== undefined) {\n <a class=\"tx-console-layout__brand\" [routerLink]=\"homeLink()\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </a>\n } @else {\n <span class=\"tx-console-layout__brand\" [class]=\"passThrough().brand?.class\" [style]=\"passThrough().brand?.style\">\n <ng-container [ngTemplateOutlet]=\"brand\" />\n </span>\n }\n @for (crumb of visibleCrumbs(); track $index; let last = $last) {\n <span class=\"tx-console-layout__slash\" aria-hidden=\"true\">/</span>\n <span class=\"tx-console-layout__crumb\" [class.tx-console-layout__crumb--current]=\"last\" [attr.aria-current]=\"last ? 'page' : null\">{{ crumb }}</span>\n }\n </div>\n </div>\n <div class=\"tx-console-layout__actions\">\n <ng-content select=\"[txConsoleActions]\" />\n </div>\n</header>\n<div class=\"tx-console-layout__body\">\n <tx-console-rail\n class=\"tx-console-layout__rail\"\n [items]=\"visibleRailItems()\"\n [label]=\"railName()\"\n [unstyled]=\"isUnstyled()\"\n [attr.data-responsive]=\"responsive()\"\n [class]=\"passThrough().rail?.class\"\n [style]=\"passThrough().rail?.style\"\n />\n <div class=\"tx-console-layout__column\">\n <main class=\"tx-console-layout__content\" [class]=\"passThrough().content?.class\" [style]=\"passThrough().content?.style\">\n <ng-content />\n </main>\n @if (footerName() && !hasPanel()) {\n <tx-app-footer\n class=\"tx-console-layout__footer\"\n variant=\"console\"\n [name]=\"footerName() ?? ''\"\n [links]=\"visibleFooterLinks()\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().footer?.class\"\n [style]=\"passThrough().footer?.style\"\n />\n }\n </div>\n</div>\n","import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, computed, inject, input, signal, viewChild } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { TxAppFooter } from '@tectra-ng/blocks/app-footer';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { uniqueId } from '@tectra-ng/core/a11y';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TectraConsoleLayoutTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { filter } from 'rxjs';\nimport { TxConsoleLayout } from './console-layout.component';\nimport { TxConsolePanelPart } from './console-layout.types';\n\n@Component({\n selector: 'tx-console-panel',\n imports: [TxAppFooter, TxIcon],\n template: `\n <aside\n class=\"tx-console-panel__aside\"\n [attr.aria-label]=\"label() ?? null\"\n [class]=\"passThrough().aside?.class\"\n [style]=\"passThrough().aside?.style\"\n >\n <button\n #toggleButton\n type=\"button\"\n class=\"tx-console-panel__toggle\"\n [attr.aria-expanded]=\"expanded()\"\n [attr.aria-controls]=\"id + '-nav'\"\n [class]=\"passThrough().toggle?.class\"\n [style]=\"passThrough().toggle?.style\"\n (click)=\"expanded.set(!expanded())\"\n >\n <tx-icon class=\"tx-console-panel__toggle-icon\" name=\"bars\" aria-hidden=\"true\" />\n <span class=\"tx-console-panel__toggle-label\">{{ label() ?? translations().menu }}</span>\n <tx-icon class=\"tx-console-panel__chevron\" name=\"chevron-down\" aria-hidden=\"true\" />\n </button>\n <div class=\"tx-console-panel__collapse\" [class.tx-console-panel__collapse--open]=\"expanded()\">\n <div\n class=\"tx-console-panel__nav\"\n [id]=\"id + '-nav'\"\n [class]=\"passThrough().nav?.class\"\n [style]=\"passThrough().nav?.style\"\n >\n <div class=\"tx-console-panel__nav-inner\">\n <ng-content select=\"[txConsolePanelAside]\" />\n </div>\n </div>\n </div>\n </aside>\n <div class=\"tx-console-panel__main\" [class]=\"passThrough().main?.class\" [style]=\"passThrough().main?.style\">\n <div class=\"tx-console-panel__content\" [class]=\"passThrough().content?.class\" [style]=\"passThrough().content?.style\">\n <ng-content />\n </div>\n @if (footerName()) {\n <tx-app-footer variant=\"console\" [name]=\"footerName()\" [links]=\"footerLinks()\" [unstyled]=\"isUnstyled()\" />\n }\n </div>\n `,\n styleUrl: './console-panel.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-console-panel',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[attr.data-responsive]': 'responsive()',\n '(click)': 'closeOnLink($event)',\n '(keydown.escape)': 'closeFromKeyboard($event)',\n },\n})\nexport class TxConsolePanel {\n private readonly layout = inject(TxConsoleLayout, { optional: true });\n private readonly toggleButton = viewChild<ElementRef<HTMLButtonElement>>('toggleButton');\n\n readonly label = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraConsoleLayoutTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxConsolePanelPart, TxConsolePanel> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly expanded = signal(false);\n readonly isUnstyled = injectUnstyled(this.unstyled);\n protected readonly translations = injectTranslations();\n protected readonly id = uniqueId('tx-console-panel');\n readonly passThrough = injectPassThrough('consolePanel', this, this.pt, this.ptOptions);\n protected readonly responsive = computed(() => this.layout?.responsive() ?? 'viewport');\n protected readonly footerName = computed(() => this.layout?.footerName() ?? '');\n protected readonly footerLinks = computed(() => this.layout?.visibleFooterLinks() ?? []);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-console-layout'), ...this.passThrough().root?.style }));\n\n constructor() {\n const unregister = this.layout?.registerPanel();\n if (unregister) {\n inject(DestroyRef).onDestroy(unregister);\n }\n inject(Router, { optional: true })\n ?.events.pipe(\n filter((event) => event instanceof NavigationEnd),\n takeUntilDestroyed(),\n )\n .subscribe(() => this.expanded.set(false));\n }\n\n protected closeOnLink(event: Event): void {\n const picked = (event.target as HTMLElement | null)?.closest(\n 'a[href], [role=\"treeitem\"]:not([aria-expanded]), [role=\"menuitem\"], [role=\"option\"]',\n );\n if (picked?.closest('.tx-console-panel__nav')) {\n this.expanded.set(false);\n }\n }\n\n protected closeFromKeyboard(event: Event): void {\n if (this.expanded() && (event.target as HTMLElement | null)?.closest('.tx-console-panel__aside')) {\n this.expanded.set(false);\n this.toggleButton()?.nativeElement.focus();\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAEA,MAAa,8BAAoD;CAC/D,OAAO;CACP,aAAa;CACb,cAAc;CACd,UAAU;AACX;AAED,MAAa,gCAAsD;CACjE,GAAG;CACH,OAAO;AACR;ACRD,IAAa,oBAAb,MAAa,kBAAiB;CACX,QAAQ,OAAO,KAAK;CACpB,WAAW,OAAO,QAAQ;CAEnC,eAA8B;CAC9B,iBAAgC;CAExC,SAAS,OAAa;EACpB,KAAK,iBAAiB,KAAK,MAAM,SAAQ;EACzC,KAAK,MAAM,SAAS,KAAK;CAC3B;CAEA,WAAW,MAAY;EACrB,MAAM,OAAO,KAAK,YAAW;EAC7B,IAAI,CAAC,MACH;EAEF,KAAK,mBAAmB,KAAK,aAAa,MAAM,KAAK;EACrD,KAAK,aAAa,QAAQ,IAAI;CAChC;CAEA,cAAW;EACT,IAAI,KAAK,iBAAiB,MACxB,KAAK,MAAM,SAAS,KAAK,YAAY;EAEvC,IAAI,KAAK,mBAAmB,MAC1B,KAAK,YAAW,CAAE,EAAE,aAAa,QAAQ,KAAK,cAAc;CAEhE;CAEQ,cAAW;EACjB,OAAO,KAAK,SAAS,cAA+B,oBAAkB;CACxE;CAhCW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAiB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAjB,OAAA,QAAA,GAAA,sBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;CAAiB,CAAA;;AAAjB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAiB,YAAA,CAAA,EAD7B,MAAA,WAAA,CAAA;;ACqDD,IAAa,gBAAb,MAAa,cAAa;CACf,Q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,CAAA;CAAA,gBAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,gBAAc,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,OAAA,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"}
@@ -0,0 +1,416 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DOCUMENT, afterNextRender, computed, inject, input, numberAttribute, output, signal } from "@angular/core";
3
+ import { Router, RouterLink } from "@angular/router";
4
+ import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
5
+ import { injectTranslations } from "@tectra-ng/core/i18n";
6
+ import { optionalBoolean } from "@tectra-ng/core/utils";
7
+ import { TxIcon } from "@tectra-ng/icons";
8
+ import { toStyleObject } from "@tectra-ng/themes";
9
+ import { TxButton } from "@tectra-ng/ui/button";
10
+ const DAY_SECONDS = 86400;
11
+ var TxCookieNotice = class TxCookieNotice {
12
+ document = inject(DOCUMENT);
13
+ router = inject(Router, { optional: true });
14
+ title = input(void 0, ...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
15
+ text = input(void 0, ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
16
+ icon = input("shield", ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
17
+ link = input(void 0, ...ngDevMode ? [{ debugName: "link" }] : /* istanbul ignore next */ []);
18
+ href = input(void 0, ...ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []);
19
+ linkLabel = input(void 0, ...ngDevMode ? [{ debugName: "linkLabel" }] : /* istanbul ignore next */ []);
20
+ acceptLabel = input(void 0, ...ngDevMode ? [{ debugName: "acceptLabel" }] : /* istanbul ignore next */ []);
21
+ label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
22
+ cookieName = input("cookieNoticeDismissed", ...ngDevMode ? [{ debugName: "cookieName" }] : /* istanbul ignore next */ []);
23
+ maxAgeDays = input(365, {
24
+ ...ngDevMode ? { debugName: "maxAgeDays" } : /* istanbul ignore next */ {},
25
+ transform: numberAttribute
26
+ });
27
+ sharedDomain = input(void 0, ...ngDevMode ? [{ debugName: "sharedDomain" }] : /* istanbul ignore next */ []);
28
+ dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
29
+ pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
30
+ ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
31
+ unstyled = input(void 0, {
32
+ ...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
33
+ transform: optionalBoolean
34
+ });
35
+ dismissed = output();
36
+ isUnstyled = injectUnstyled(this.unstyled);
37
+ passThrough = injectPassThrough("cookieNotice", this, this.pt, this.ptOptions);
38
+ translations = injectTranslations();
39
+ hostStyle = computed(() => ({
40
+ ...toStyleObject(this.dt(), "--tx-cookie-notice"),
41
+ ...this.passThrough().root?.style
42
+ }), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
43
+ visible = signal(false, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
44
+ constructor() {
45
+ afterNextRender(() => this.visible.set(!this.readDismissed()));
46
+ }
47
+ show() {
48
+ this.visible.set(true);
49
+ }
50
+ dismiss() {
51
+ this.writeDismissed();
52
+ this.visible.set(false);
53
+ this.dismissed.emit();
54
+ }
55
+ readDismissed() {
56
+ const name = `${encodeURIComponent(this.cookieName())}=`;
57
+ return this.document.cookie.split("; ").some((entry) => entry === `${name}1`);
58
+ }
59
+ writeDismissed() {
60
+ const location = this.document.location;
61
+ const shared = this.sharedDomain();
62
+ const domain = shared && location?.hostname.endsWith(`.${shared}`) ? `; domain=.${shared}` : "";
63
+ const secure = location?.protocol === "https:" ? "; secure" : "";
64
+ const maxAge = Math.round(this.maxAgeDays() * DAY_SECONDS);
65
+ this.document.cookie = `${encodeURIComponent(this.cookieName())}=1; max-age=${maxAge}; path=/${domain}${secure}; samesite=lax`;
66
+ }
67
+ static ɵfac = i0.ɵɵngDeclareFactory({
68
+ minVersion: "12.0.0",
69
+ version: "22.2.3",
70
+ ngImport: i0,
71
+ type: TxCookieNotice,
72
+ deps: [],
73
+ target: i0.ɵɵFactoryTarget.Component
74
+ });
75
+ static ɵcmp = i0.ɵɵngDeclareComponent({
76
+ minVersion: "17.0.0",
77
+ version: "22.2.3",
78
+ type: TxCookieNotice,
79
+ isStandalone: true,
80
+ selector: "tx-cookie-notice",
81
+ inputs: {
82
+ title: {
83
+ classPropertyName: "title",
84
+ publicName: "title",
85
+ isSignal: true,
86
+ isRequired: false,
87
+ transformFunction: null
88
+ },
89
+ text: {
90
+ classPropertyName: "text",
91
+ publicName: "text",
92
+ isSignal: true,
93
+ isRequired: false,
94
+ transformFunction: null
95
+ },
96
+ icon: {
97
+ classPropertyName: "icon",
98
+ publicName: "icon",
99
+ isSignal: true,
100
+ isRequired: false,
101
+ transformFunction: null
102
+ },
103
+ link: {
104
+ classPropertyName: "link",
105
+ publicName: "link",
106
+ isSignal: true,
107
+ isRequired: false,
108
+ transformFunction: null
109
+ },
110
+ href: {
111
+ classPropertyName: "href",
112
+ publicName: "href",
113
+ isSignal: true,
114
+ isRequired: false,
115
+ transformFunction: null
116
+ },
117
+ linkLabel: {
118
+ classPropertyName: "linkLabel",
119
+ publicName: "linkLabel",
120
+ isSignal: true,
121
+ isRequired: false,
122
+ transformFunction: null
123
+ },
124
+ acceptLabel: {
125
+ classPropertyName: "acceptLabel",
126
+ publicName: "acceptLabel",
127
+ isSignal: true,
128
+ isRequired: false,
129
+ transformFunction: null
130
+ },
131
+ label: {
132
+ classPropertyName: "label",
133
+ publicName: "label",
134
+ isSignal: true,
135
+ isRequired: false,
136
+ transformFunction: null
137
+ },
138
+ cookieName: {
139
+ classPropertyName: "cookieName",
140
+ publicName: "cookieName",
141
+ isSignal: true,
142
+ isRequired: false,
143
+ transformFunction: null
144
+ },
145
+ maxAgeDays: {
146
+ classPropertyName: "maxAgeDays",
147
+ publicName: "maxAgeDays",
148
+ isSignal: true,
149
+ isRequired: false,
150
+ transformFunction: null
151
+ },
152
+ sharedDomain: {
153
+ classPropertyName: "sharedDomain",
154
+ publicName: "sharedDomain",
155
+ isSignal: true,
156
+ isRequired: false,
157
+ transformFunction: null
158
+ },
159
+ dt: {
160
+ classPropertyName: "dt",
161
+ publicName: "dt",
162
+ isSignal: true,
163
+ isRequired: false,
164
+ transformFunction: null
165
+ },
166
+ pt: {
167
+ classPropertyName: "pt",
168
+ publicName: "pt",
169
+ isSignal: true,
170
+ isRequired: false,
171
+ transformFunction: null
172
+ },
173
+ ptOptions: {
174
+ classPropertyName: "ptOptions",
175
+ publicName: "ptOptions",
176
+ isSignal: true,
177
+ isRequired: false,
178
+ transformFunction: null
179
+ },
180
+ unstyled: {
181
+ classPropertyName: "unstyled",
182
+ publicName: "unstyled",
183
+ isSignal: true,
184
+ isRequired: false,
185
+ transformFunction: null
186
+ }
187
+ },
188
+ outputs: { dismissed: "dismissed" },
189
+ host: {
190
+ properties: {
191
+ "class": "passThrough().root?.class",
192
+ "style": "hostStyle()",
193
+ "attr.data-styled": "!isUnstyled() || null"
194
+ },
195
+ classAttribute: "tx-cookie-notice"
196
+ },
197
+ ngImport: i0,
198
+ template: "@if (visible()) {\n <section\n class=\"tx-cookie-notice__panel\"\n role=\"region\"\n animate.enter=\"tx-cookie-notice__panel--enter\"\n animate.leave=\"tx-cookie-notice__panel--leave\"\n [attr.aria-label]=\"label() ?? translations().cookieLabel\"\n >\n <span class=\"tx-cookie-notice__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"icon()\" />\n </span>\n <div class=\"tx-cookie-notice__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\">\n <p class=\"tx-cookie-notice__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">{{ title() ?? translations().cookieTitle }}</p>\n <p class=\"tx-cookie-notice__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() ?? translations().cookieText }}</p>\n <div class=\"tx-cookie-notice__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n @if (link() !== undefined && router) {\n <a class=\"tx-cookie-notice__link\" [routerLink]=\"link()\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ linkLabel() ?? translations().cookieLearnMore }}</a>\n } @else if (href(); as href) {\n <a class=\"tx-cookie-notice__link\" [href]=\"href\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ linkLabel() ?? translations().cookieLearnMore }}</a>\n }\n <button\n txButton\n type=\"button\"\n size=\"small\"\n class=\"tx-cookie-notice__accept\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().accept?.class\"\n [style]=\"passThrough().accept?.style\"\n (click)=\"dismiss()\"\n >\n {{ acceptLabel() ?? translations().cookieAccept }}\n </button>\n </div>\n </div>\n </section>\n}\n",
199
+ styles: [":host{display:contents}.tx-cookie-notice__panel{position:fixed;display:flex;align-items:flex-start;box-sizing:border-box}.tx-cookie-notice__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center}.tx-cookie-notice__body{display:flex;flex:1;flex-direction:column;min-width:0}.tx-cookie-notice__title,.tx-cookie-notice__text{margin:0}.tx-cookie-notice__actions{display:flex;align-items:center;justify-content:flex-end}.tx-cookie-notice__link{text-decoration:none;text-underline-offset:2px}.tx-cookie-notice__link:hover{text-decoration:underline}:host([data-styled]) .tx-cookie-notice__panel{z-index:var(--tx-cookie-notice-z-index);right:var(--tx-cookie-notice-inset);bottom:var(--tx-cookie-notice-inset);left:var(--tx-cookie-notice-inset);gap:var(--tx-cookie-notice-gap);padding:var(--tx-cookie-notice-padding);border-radius:var(--tx-cookie-notice-border-radius);background:var(--tx-cookie-notice-background);box-shadow:0 0 0 1px var(--tx-cookie-notice-ring-color),var(--tx-cookie-notice-shadow);font-family:var(--tx-font-family);-webkit-backdrop-filter:var(--tx-cookie-notice-backdrop-filter);backdrop-filter:var(--tx-cookie-notice-backdrop-filter)}:host([data-styled]) .tx-cookie-notice__icon{width:var(--tx-cookie-notice-icon-size);height:var(--tx-cookie-notice-icon-size);border-radius:50%;background:var(--tx-cookie-notice-icon-background);color:var(--tx-cookie-notice-icon-color);font-size:var(--tx-cookie-notice-icon-font-size)}:host([data-styled]) .tx-cookie-notice__body{gap:var(--tx-cookie-notice-body-gap)}:host([data-styled]) .tx-cookie-notice__title{color:var(--tx-cookie-notice-title-color);font-size:var(--tx-cookie-notice-title-font-size);font-weight:var(--tx-cookie-notice-title-font-weight)}:host([data-styled]) .tx-cookie-notice__text{color:var(--tx-cookie-notice-text-color);font-size:var(--tx-cookie-notice-text-font-size);line-height:var(--tx-cookie-notice-text-line-height)}:host([data-styled]) .tx-cookie-notice__actions{gap:var(--tx-cookie-notice-actions-gap);margin-top:var(--tx-cookie-notice-actions-margin-top)}:host([data-styled]) .tx-cookie-notice__link{border-radius:2px;color:var(--tx-cookie-notice-link-color);font-size:var(--tx-cookie-notice-link-font-size);font-weight:var(--tx-cookie-notice-link-font-weight)}:host([data-styled]) .tx-cookie-notice__link:focus-visible{outline:none;box-shadow:var(--tx-cookie-notice-link-focus-ring-shadow)}:host([data-styled]) .tx-cookie-notice__panel--enter{animation:tx-cookie-notice-in var(--tx-cookie-notice-motion-enter-duration) var(--tx-cookie-notice-motion-enter-easing) var(--tx-cookie-notice-motion-enter-delay) both}:host([data-styled]) .tx-cookie-notice__panel--leave{animation:tx-cookie-notice-out var(--tx-cookie-notice-motion-leave-duration) ease-in forwards}@media(width>=640px){:host([data-styled]) .tx-cookie-notice__panel{right:auto;bottom:var(--tx-cookie-notice-wide-inset);left:var(--tx-cookie-notice-wide-inset);width:var(--tx-cookie-notice-wide-width)}}@keyframes tx-cookie-notice-in{0%{opacity:0;transform:translateY(16px) scale(.98)}}@keyframes tx-cookie-notice-out{to{opacity:0;transform:translateY(8px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-cookie-notice__panel--enter,:host([data-styled]) .tx-cookie-notice__panel--leave{animation-duration:1ms;animation-delay:0s}}\n"],
200
+ dependencies: [
201
+ {
202
+ kind: "directive",
203
+ type: RouterLink,
204
+ selector: "[routerLink]",
205
+ inputs: [
206
+ "target",
207
+ "queryParams",
208
+ "fragment",
209
+ "queryParamsHandling",
210
+ "state",
211
+ "info",
212
+ "relativeTo",
213
+ "preserveFragment",
214
+ "skipLocationChange",
215
+ "replaceUrl",
216
+ "browserUrl",
217
+ "routerLink"
218
+ ]
219
+ },
220
+ {
221
+ kind: "component",
222
+ type: TxButton,
223
+ selector: "button[txButton], a[txButton]",
224
+ inputs: [
225
+ "label",
226
+ "severity",
227
+ "size",
228
+ "variant",
229
+ "outlined",
230
+ "text",
231
+ "link",
232
+ "rounded",
233
+ "raised",
234
+ "plain",
235
+ "fluid",
236
+ "disabled",
237
+ "tabindex",
238
+ "icon",
239
+ "iconPos",
240
+ "iconOnly",
241
+ "loading",
242
+ "loadingIcon",
243
+ "badge",
244
+ "badgeSeverity",
245
+ "dt",
246
+ "pt",
247
+ "ptOptions",
248
+ "unstyled"
249
+ ]
250
+ },
251
+ {
252
+ kind: "component",
253
+ type: TxIcon,
254
+ selector: "tx-icon",
255
+ inputs: ["name"]
256
+ }
257
+ ],
258
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
259
+ });
260
+ };
261
+ i0.ɵɵngDeclareClassMetadata({
262
+ minVersion: "12.0.0",
263
+ version: "22.2.3",
264
+ ngImport: i0,
265
+ type: TxCookieNotice,
266
+ decorators: [{
267
+ type: Component,
268
+ args: [{
269
+ selector: "tx-cookie-notice",
270
+ imports: [
271
+ RouterLink,
272
+ TxButton,
273
+ TxIcon
274
+ ],
275
+ changeDetection: ChangeDetectionStrategy.OnPush,
276
+ host: {
277
+ class: "tx-cookie-notice",
278
+ "[class]": "passThrough().root?.class",
279
+ "[style]": "hostStyle()",
280
+ "[attr.data-styled]": "!isUnstyled() || null"
281
+ },
282
+ template: "@if (visible()) {\n <section\n class=\"tx-cookie-notice__panel\"\n role=\"region\"\n animate.enter=\"tx-cookie-notice__panel--enter\"\n animate.leave=\"tx-cookie-notice__panel--leave\"\n [attr.aria-label]=\"label() ?? translations().cookieLabel\"\n >\n <span class=\"tx-cookie-notice__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"icon()\" />\n </span>\n <div class=\"tx-cookie-notice__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\">\n <p class=\"tx-cookie-notice__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">{{ title() ?? translations().cookieTitle }}</p>\n <p class=\"tx-cookie-notice__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() ?? translations().cookieText }}</p>\n <div class=\"tx-cookie-notice__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n @if (link() !== undefined && router) {\n <a class=\"tx-cookie-notice__link\" [routerLink]=\"link()\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ linkLabel() ?? translations().cookieLearnMore }}</a>\n } @else if (href(); as href) {\n <a class=\"tx-cookie-notice__link\" [href]=\"href\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ linkLabel() ?? translations().cookieLearnMore }}</a>\n }\n <button\n txButton\n type=\"button\"\n size=\"small\"\n class=\"tx-cookie-notice__accept\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().accept?.class\"\n [style]=\"passThrough().accept?.style\"\n (click)=\"dismiss()\"\n >\n {{ acceptLabel() ?? translations().cookieAccept }}\n </button>\n </div>\n </div>\n </section>\n}\n",
283
+ styles: [":host{display:contents}.tx-cookie-notice__panel{position:fixed;display:flex;align-items:flex-start;box-sizing:border-box}.tx-cookie-notice__icon{display:flex;flex-shrink:0;align-items:center;justify-content:center}.tx-cookie-notice__body{display:flex;flex:1;flex-direction:column;min-width:0}.tx-cookie-notice__title,.tx-cookie-notice__text{margin:0}.tx-cookie-notice__actions{display:flex;align-items:center;justify-content:flex-end}.tx-cookie-notice__link{text-decoration:none;text-underline-offset:2px}.tx-cookie-notice__link:hover{text-decoration:underline}:host([data-styled]) .tx-cookie-notice__panel{z-index:var(--tx-cookie-notice-z-index);right:var(--tx-cookie-notice-inset);bottom:var(--tx-cookie-notice-inset);left:var(--tx-cookie-notice-inset);gap:var(--tx-cookie-notice-gap);padding:var(--tx-cookie-notice-padding);border-radius:var(--tx-cookie-notice-border-radius);background:var(--tx-cookie-notice-background);box-shadow:0 0 0 1px var(--tx-cookie-notice-ring-color),var(--tx-cookie-notice-shadow);font-family:var(--tx-font-family);-webkit-backdrop-filter:var(--tx-cookie-notice-backdrop-filter);backdrop-filter:var(--tx-cookie-notice-backdrop-filter)}:host([data-styled]) .tx-cookie-notice__icon{width:var(--tx-cookie-notice-icon-size);height:var(--tx-cookie-notice-icon-size);border-radius:50%;background:var(--tx-cookie-notice-icon-background);color:var(--tx-cookie-notice-icon-color);font-size:var(--tx-cookie-notice-icon-font-size)}:host([data-styled]) .tx-cookie-notice__body{gap:var(--tx-cookie-notice-body-gap)}:host([data-styled]) .tx-cookie-notice__title{color:var(--tx-cookie-notice-title-color);font-size:var(--tx-cookie-notice-title-font-size);font-weight:var(--tx-cookie-notice-title-font-weight)}:host([data-styled]) .tx-cookie-notice__text{color:var(--tx-cookie-notice-text-color);font-size:var(--tx-cookie-notice-text-font-size);line-height:var(--tx-cookie-notice-text-line-height)}:host([data-styled]) .tx-cookie-notice__actions{gap:var(--tx-cookie-notice-actions-gap);margin-top:var(--tx-cookie-notice-actions-margin-top)}:host([data-styled]) .tx-cookie-notice__link{border-radius:2px;color:var(--tx-cookie-notice-link-color);font-size:var(--tx-cookie-notice-link-font-size);font-weight:var(--tx-cookie-notice-link-font-weight)}:host([data-styled]) .tx-cookie-notice__link:focus-visible{outline:none;box-shadow:var(--tx-cookie-notice-link-focus-ring-shadow)}:host([data-styled]) .tx-cookie-notice__panel--enter{animation:tx-cookie-notice-in var(--tx-cookie-notice-motion-enter-duration) var(--tx-cookie-notice-motion-enter-easing) var(--tx-cookie-notice-motion-enter-delay) both}:host([data-styled]) .tx-cookie-notice__panel--leave{animation:tx-cookie-notice-out var(--tx-cookie-notice-motion-leave-duration) ease-in forwards}@media(width>=640px){:host([data-styled]) .tx-cookie-notice__panel{right:auto;bottom:var(--tx-cookie-notice-wide-inset);left:var(--tx-cookie-notice-wide-inset);width:var(--tx-cookie-notice-wide-width)}}@keyframes tx-cookie-notice-in{0%{opacity:0;transform:translateY(16px) scale(.98)}}@keyframes tx-cookie-notice-out{to{opacity:0;transform:translateY(8px)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-cookie-notice__panel--enter,:host([data-styled]) .tx-cookie-notice__panel--leave{animation-duration:1ms;animation-delay:0s}}\n"]
284
+ }]
285
+ }],
286
+ ctorParameters: () => [],
287
+ propDecorators: {
288
+ title: [{
289
+ type: i0.Input,
290
+ args: [{
291
+ isSignal: true,
292
+ alias: "title",
293
+ required: false
294
+ }]
295
+ }],
296
+ text: [{
297
+ type: i0.Input,
298
+ args: [{
299
+ isSignal: true,
300
+ alias: "text",
301
+ required: false
302
+ }]
303
+ }],
304
+ icon: [{
305
+ type: i0.Input,
306
+ args: [{
307
+ isSignal: true,
308
+ alias: "icon",
309
+ required: false
310
+ }]
311
+ }],
312
+ link: [{
313
+ type: i0.Input,
314
+ args: [{
315
+ isSignal: true,
316
+ alias: "link",
317
+ required: false
318
+ }]
319
+ }],
320
+ href: [{
321
+ type: i0.Input,
322
+ args: [{
323
+ isSignal: true,
324
+ alias: "href",
325
+ required: false
326
+ }]
327
+ }],
328
+ linkLabel: [{
329
+ type: i0.Input,
330
+ args: [{
331
+ isSignal: true,
332
+ alias: "linkLabel",
333
+ required: false
334
+ }]
335
+ }],
336
+ acceptLabel: [{
337
+ type: i0.Input,
338
+ args: [{
339
+ isSignal: true,
340
+ alias: "acceptLabel",
341
+ required: false
342
+ }]
343
+ }],
344
+ label: [{
345
+ type: i0.Input,
346
+ args: [{
347
+ isSignal: true,
348
+ alias: "label",
349
+ required: false
350
+ }]
351
+ }],
352
+ cookieName: [{
353
+ type: i0.Input,
354
+ args: [{
355
+ isSignal: true,
356
+ alias: "cookieName",
357
+ required: false
358
+ }]
359
+ }],
360
+ maxAgeDays: [{
361
+ type: i0.Input,
362
+ args: [{
363
+ isSignal: true,
364
+ alias: "maxAgeDays",
365
+ required: false
366
+ }]
367
+ }],
368
+ sharedDomain: [{
369
+ type: i0.Input,
370
+ args: [{
371
+ isSignal: true,
372
+ alias: "sharedDomain",
373
+ required: false
374
+ }]
375
+ }],
376
+ dt: [{
377
+ type: i0.Input,
378
+ args: [{
379
+ isSignal: true,
380
+ alias: "dt",
381
+ required: false
382
+ }]
383
+ }],
384
+ pt: [{
385
+ type: i0.Input,
386
+ args: [{
387
+ isSignal: true,
388
+ alias: "pt",
389
+ required: false
390
+ }]
391
+ }],
392
+ ptOptions: [{
393
+ type: i0.Input,
394
+ args: [{
395
+ isSignal: true,
396
+ alias: "ptOptions",
397
+ required: false
398
+ }]
399
+ }],
400
+ unstyled: [{
401
+ type: i0.Input,
402
+ args: [{
403
+ isSignal: true,
404
+ alias: "unstyled",
405
+ required: false
406
+ }]
407
+ }],
408
+ dismissed: [{
409
+ type: i0.Output,
410
+ args: ["dismissed"]
411
+ }]
412
+ }
413
+ });
414
+ export { TxCookieNotice };
415
+
416
+ //# sourceMappingURL=tectra-ng-blocks-cookie-notice.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tectra-ng-blocks-cookie-notice.mjs","names":[],"sources":["../../../../packages/blocks/cookie-notice/src/cookie-notice.component.ts","../../../../packages/blocks/cookie-notice/src/cookie-notice.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, DOCUMENT, afterNextRender, computed, inject, input, numberAttribute, output, signal } from '@angular/core';\nimport { Router, RouterLink } from '@angular/router';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxIcon, TxIconName } from '@tectra-ng/icons';\nimport { TectraCookieNoticeTokens, TectraDeepPartial, toStyleObject } from '@tectra-ng/themes';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxCookieNoticePart } from './cookie-notice.types';\n\nconst DAY_SECONDS = 86400;\n\n@Component({\n selector: 'tx-cookie-notice',\n imports: [RouterLink, TxButton, TxIcon],\n templateUrl: './cookie-notice.component.html',\n styleUrl: './cookie-notice.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-cookie-notice',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n})\nexport class TxCookieNotice {\n private readonly document = inject(DOCUMENT);\n protected readonly router = inject(Router, { optional: true });\n\n readonly title = input<string | undefined>(undefined);\n readonly text = input<string | undefined>(undefined);\n readonly icon = input<TxIconName | (string & {})>('shield');\n readonly link = input<string | readonly unknown[] | undefined>(undefined);\n readonly href = input<string | undefined>(undefined);\n readonly linkLabel = input<string | undefined>(undefined);\n readonly acceptLabel = input<string | undefined>(undefined);\n readonly label = input<string | undefined>(undefined);\n readonly cookieName = input<string>('cookieNoticeDismissed');\n readonly maxAgeDays = input<number, unknown>(365, { transform: numberAttribute });\n readonly sharedDomain = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraCookieNoticeTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxCookieNoticePart, TxCookieNotice> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly dismissed = output<void>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('cookieNotice', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-cookie-notice'), ...this.passThrough().root?.style }));\n\n readonly visible = signal(false);\n\n constructor() {\n afterNextRender(() => this.visible.set(!this.readDismissed()));\n }\n\n show(): void {\n this.visible.set(true);\n }\n\n dismiss(): void {\n this.writeDismissed();\n this.visible.set(false);\n this.dismissed.emit();\n }\n\n private readDismissed(): boolean {\n const name = `${encodeURIComponent(this.cookieName())}=`;\n return this.document.cookie.split('; ').some((entry) => entry === `${name}1`);\n }\n\n private writeDismissed(): void {\n const location = this.document.location;\n const shared = this.sharedDomain();\n const domain = shared && location?.hostname.endsWith(`.${shared}`) ? `; domain=.${shared}` : '';\n const secure = location?.protocol === 'https:' ? '; secure' : '';\n const maxAge = Math.round(this.maxAgeDays() * DAY_SECONDS);\n this.document.cookie = `${encodeURIComponent(this.cookieName())}=1; max-age=${maxAge}; path=/${domain}${secure}; samesite=lax`;\n }\n}\n","@if (visible()) {\n <section\n class=\"tx-cookie-notice__panel\"\n role=\"region\"\n animate.enter=\"tx-cookie-notice__panel--enter\"\n animate.leave=\"tx-cookie-notice__panel--leave\"\n [attr.aria-label]=\"label() ?? translations().cookieLabel\"\n >\n <span class=\"tx-cookie-notice__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"icon()\" />\n </span>\n <div class=\"tx-cookie-notice__body\" [class]=\"passThrough().body?.class\" [style]=\"passThrough().body?.style\">\n <p class=\"tx-cookie-notice__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">{{ title() ?? translations().cookieTitle }}</p>\n <p class=\"tx-cookie-notice__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ text() ?? translations().cookieText }}</p>\n <div class=\"tx-cookie-notice__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n @if (link() !== undefined && router) {\n <a class=\"tx-cookie-notice__link\" [routerLink]=\"link()\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ linkLabel() ?? translations().cookieLearnMore }}</a>\n } @else if (href(); as href) {\n <a class=\"tx-cookie-notice__link\" [href]=\"href\" [class]=\"passThrough().link?.class\" [style]=\"passThrough().link?.style\">{{ linkLabel() ?? translations().cookieLearnMore }}</a>\n }\n <button\n txButton\n type=\"button\"\n size=\"small\"\n class=\"tx-cookie-notice__accept\"\n [unstyled]=\"isUnstyled()\"\n [class]=\"passThrough().accept?.class\"\n [style]=\"passThrough().accept?.style\"\n (click)=\"dismiss()\"\n >\n {{ acceptLabel() ?? translations().cookieAccept }}\n </button>\n </div>\n </div>\n </section>\n}\n"],"mappings":";;;;;;;;;AAUA,MAAM,cAAc;AAepB,IAAa,iBAAb,MAAa,eAAc;CACR,WAAW,OAAO,QAAQ;CACxB,SAAS,OAAO,QAAQ,EAAE,UAAU,KAAI,CAAE;CAEpD,QAAQ,MAA0B,QAAU,GA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