@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.
- package/README.md +16 -2
- package/action-tile/README.md +33 -0
- package/actions-menu/README.md +42 -0
- package/app-footer/README.md +30 -0
- package/app-layout/README.md +51 -0
- package/command-palette/README.md +63 -0
- package/console-layout/README.md +70 -0
- package/cookie-notice/README.md +45 -0
- package/empty-state/README.md +35 -0
- package/fesm2022/tectra-ng-blocks-action-tile.mjs +294 -0
- package/fesm2022/tectra-ng-blocks-action-tile.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-actions-menu.mjs +380 -0
- package/fesm2022/tectra-ng-blocks-actions-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-app-footer.mjs +276 -0
- package/fesm2022/tectra-ng-blocks-app-footer.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-app-layout.mjs +544 -0
- package/fesm2022/tectra-ng-blocks-app-layout.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-command-palette.mjs +663 -0
- package/fesm2022/tectra-ng-blocks-command-palette.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-console-layout.mjs +1060 -0
- package/fesm2022/tectra-ng-blocks-console-layout.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs +416 -0
- package/fesm2022/tectra-ng-blocks-cookie-notice.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-empty-state.mjs +278 -0
- package/fesm2022/tectra-ng-blocks-empty-state.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs +959 -0
- package/fesm2022/tectra-ng-blocks-filters-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-kanban.mjs +864 -0
- package/fesm2022/tectra-ng-blocks-kanban.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-network-status.mjs +303 -0
- package/fesm2022/tectra-ng-blocks-network-status.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-page-header.mjs +195 -0
- package/fesm2022/tectra-ng-blocks-page-header.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs +692 -0
- package/fesm2022/tectra-ng-blocks-pinned-tabs.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-public-header.mjs +372 -0
- package/fesm2022/tectra-ng-blocks-public-header.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-qr-code.mjs +487 -0
- package/fesm2022/tectra-ng-blocks-qr-code.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-switch-language.mjs +316 -0
- package/fesm2022/tectra-ng-blocks-switch-language.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-switch-theme.mjs +416 -0
- package/fesm2022/tectra-ng-blocks-switch-theme.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs +260 -0
- package/fesm2022/tectra-ng-blocks-topbar-preferences.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks-wizard.mjs +1284 -0
- package/fesm2022/tectra-ng-blocks-wizard.mjs.map +1 -0
- package/fesm2022/tectra-ng-blocks.mjs +4 -0
- package/fesm2022/tectra-ng-blocks.mjs.map +1 -0
- package/filters-panel/README.md +68 -0
- package/kanban/README.md +55 -0
- package/network-status/README.md +33 -0
- package/package.json +137 -3
- package/page-header/README.md +32 -0
- package/pinned-tabs/README.md +42 -0
- package/public-header/README.md +44 -0
- package/qr-code/README.md +52 -0
- package/switch-language/README.md +33 -0
- package/switch-theme/README.md +32 -0
- package/topbar-preferences/README.md +35 -0
- package/types/tectra-ng-blocks-action-tile.d.ts +114 -0
- package/types/tectra-ng-blocks-action-tile.d.ts.map +1 -0
- package/types/tectra-ng-blocks-actions-menu.d.ts +112 -0
- package/types/tectra-ng-blocks-actions-menu.d.ts.map +1 -0
- package/types/tectra-ng-blocks-app-footer.d.ts +111 -0
- package/types/tectra-ng-blocks-app-footer.d.ts.map +1 -0
- package/types/tectra-ng-blocks-app-layout.d.ts +212 -0
- package/types/tectra-ng-blocks-app-layout.d.ts.map +1 -0
- package/types/tectra-ng-blocks-command-palette.d.ts +291 -0
- package/types/tectra-ng-blocks-command-palette.d.ts.map +1 -0
- package/types/tectra-ng-blocks-console-layout.d.ts +454 -0
- package/types/tectra-ng-blocks-console-layout.d.ts.map +1 -0
- package/types/tectra-ng-blocks-cookie-notice.d.ts +168 -0
- package/types/tectra-ng-blocks-cookie-notice.d.ts.map +1 -0
- package/types/tectra-ng-blocks-empty-state.d.ts +138 -0
- package/types/tectra-ng-blocks-empty-state.d.ts.map +1 -0
- package/types/tectra-ng-blocks-filters-panel.d.ts +314 -0
- package/types/tectra-ng-blocks-filters-panel.d.ts.map +1 -0
- package/types/tectra-ng-blocks-kanban.d.ts +260 -0
- package/types/tectra-ng-blocks-kanban.d.ts.map +1 -0
- package/types/tectra-ng-blocks-network-status.d.ts +108 -0
- package/types/tectra-ng-blocks-network-status.d.ts.map +1 -0
- package/types/tectra-ng-blocks-page-header.d.ts +86 -0
- package/types/tectra-ng-blocks-page-header.d.ts.map +1 -0
- package/types/tectra-ng-blocks-pinned-tabs.d.ts +159 -0
- package/types/tectra-ng-blocks-pinned-tabs.d.ts.map +1 -0
- package/types/tectra-ng-blocks-public-header.d.ts +142 -0
- package/types/tectra-ng-blocks-public-header.d.ts.map +1 -0
- package/types/tectra-ng-blocks-qr-code.d.ts +160 -0
- package/types/tectra-ng-blocks-qr-code.d.ts.map +1 -0
- package/types/tectra-ng-blocks-switch-language.d.ts +106 -0
- package/types/tectra-ng-blocks-switch-language.d.ts.map +1 -0
- package/types/tectra-ng-blocks-switch-theme.d.ts +108 -0
- package/types/tectra-ng-blocks-switch-theme.d.ts.map +1 -0
- package/types/tectra-ng-blocks-topbar-preferences.d.ts +103 -0
- package/types/tectra-ng-blocks-topbar-preferences.d.ts.map +1 -0
- package/types/tectra-ng-blocks-wizard.d.ts +682 -0
- package/types/tectra-ng-blocks-wizard.d.ts.map +1 -0
- package/types/tectra-ng-blocks.d.ts +2 -0
- package/types/tectra-ng-blocks.d.ts.map +1 -0
- package/wizard/README.md +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-kanban.mjs","names":[],"sources":["../../../../packages/blocks/kanban/src/kanban-templates.directive.ts","../../../../packages/blocks/kanban/src/kanban.component.ts","../../../../packages/blocks/kanban/src/kanban.component.html"],"sourcesContent":["import { Directive, TemplateRef, inject } from '@angular/core';\nimport { TxKanbanCardContext, TxKanbanColumnContext } from './kanban.types';\n\n@Directive({ selector: 'ng-template[txKanbanCard]' })\nexport class TxKanbanCard<T> {\n readonly template = inject<TemplateRef<TxKanbanCardContext<T>>>(TemplateRef);\n\n static ngTemplateContextGuard<T>(\n _directive: TxKanbanCard<T>,\n context: unknown,\n ): context is TxKanbanCardContext<T> {\n return !!context;\n }\n}\n\n@Directive({ selector: 'ng-template[txKanbanColumnHeader]' })\nexport class TxKanbanColumnHeader<T> {\n readonly template = inject<TemplateRef<TxKanbanColumnContext<T>>>(TemplateRef);\n\n static ngTemplateContextGuard<T>(\n _directive: TxKanbanColumnHeader<T>,\n context: unknown,\n ): context is TxKanbanColumnContext<T> {\n return !!context;\n }\n}\n\n@Directive({ selector: 'ng-template[txKanbanColumnTop]' })\nexport class TxKanbanColumnTop<T> {\n readonly template = inject<TemplateRef<TxKanbanColumnContext<T>>>(TemplateRef);\n\n static ngTemplateContextGuard<T>(\n _directive: TxKanbanColumnTop<T>,\n context: unknown,\n ): context is TxKanbanColumnContext<T> {\n return !!context;\n }\n}\n\n@Directive({ selector: 'ng-template[txKanbanColumnFooter]' })\nexport class TxKanbanColumnFooter<T> {\n readonly template = inject<TemplateRef<TxKanbanColumnContext<T>>>(TemplateRef);\n\n static ngTemplateContextGuard<T>(\n _directive: TxKanbanColumnFooter<T>,\n context: unknown,\n ): context is TxKanbanColumnContext<T> {\n return !!context;\n }\n}\n\n@Directive({ selector: 'ng-template[txKanbanEmpty]' })\nexport class TxKanbanEmpty<T> {\n readonly template = inject<TemplateRef<TxKanbanColumnContext<T>>>(TemplateRef);\n\n static ngTemplateContextGuard<T>(\n _directive: TxKanbanEmpty<T>,\n context: unknown,\n ): context is TxKanbanColumnContext<T> {\n return !!context;\n }\n}\n","import {\n CdkDrag,\n CdkDragDrop,\n CdkDragHandle,\n CdkDragPlaceholder,\n CdkDropList,\n} from '@angular/cdk/drag-drop';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DOCUMENT,\n ElementRef,\n Injector,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChild,\n inject,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport { TxAnnouncer, uniqueId } from '@tectra-ng/core/a11y';\nimport {\n TxPassThrough,\n TxPassThroughOptions,\n injectPassThrough,\n injectUnstyled,\n} from '@tectra-ng/core/config';\nimport { TxLocaleService, injectTranslations } from '@tectra-ng/core/i18n';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraKanbanTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxPill } from '@tectra-ng/ui/pill';\nimport {\n TxKanbanCard,\n TxKanbanColumnFooter,\n TxKanbanColumnHeader,\n TxKanbanColumnTop,\n TxKanbanEmpty,\n} from './kanban-templates.directive';\nimport {\n TxKanbanColumn,\n TxKanbanColumnDrop,\n TxKanbanColumnView,\n TxKanbanItemDrop,\n TxKanbanItemId,\n TxKanbanPart,\n} from './kanban.types';\n\nconst DRAG_SCROLL_IGNORE =\n '[data-drag-ignore], button, a, input, textarea, select, [contenteditable=\"true\"]';\n\n@Component({\n selector: 'tx-kanban',\n imports: [\n NgTemplateOutlet,\n CdkDropList,\n CdkDrag,\n CdkDragHandle,\n CdkDragPlaceholder,\n TxButton,\n TxIcon,\n TxPill,\n ],\n templateUrl: './kanban.component.html',\n styleUrl: './kanban.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-kanban',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n '[class.tx-kanban--fixed]': '!!height()',\n },\n})\nexport class TxKanban<T> {\n private readonly document = inject(DOCUMENT);\n private readonly injector = inject(Injector);\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly announcer = inject(TxAnnouncer);\n private readonly locale = inject(TxLocaleService);\n\n readonly columns = input.required<readonly TxKanbanColumn<T>[]>();\n readonly itemId = input.required<TxKanbanItemId<T>>();\n readonly itemsDraggable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly columnsDraggable = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly focusableCards = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly columnWidth = input<string | undefined>(undefined);\n readonly label = input<string | undefined>(undefined);\n readonly emptyText = input<string | undefined>(undefined);\n readonly columnDragLabel = input<string | undefined>(undefined);\n readonly pageSize = input<number, unknown>(30, { transform: numberAttribute });\n readonly height = input<string | undefined>(undefined);\n readonly dt = input<TectraDeepPartial<TectraKanbanTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxKanbanPart, TxKanban<T>> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, {\n transform: optionalBoolean,\n });\n\n readonly itemDropped = output<TxKanbanItemDrop>();\n readonly columnDropped = output<TxKanbanColumnDrop>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('kanban', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n protected readonly id = uniqueId('tx-kanban');\n readonly hostStyle = computed(() => ({\n ...toStyleObject(this.dt(), '--tx-kanban'),\n ...this.passThrough().root?.style,\n }));\n\n protected readonly cardTemplate = contentChild.required(TxKanbanCard<T>);\n protected readonly headerTemplate = contentChild(TxKanbanColumnHeader<T>);\n protected readonly topTemplate = contentChild(TxKanbanColumnTop<T>);\n protected readonly footerTemplate = contentChild(TxKanbanColumnFooter<T>);\n protected readonly emptyTemplate = contentChild(TxKanbanEmpty<T>);\n\n private readonly shown = signal<Record<string, number>>({});\n protected readonly views = computed<TxKanbanColumnView<T>[]>(() => {\n const pageSize = this.pageSize();\n const shown = this.shown();\n return this.columns().map((column) => {\n const limit = pageSize ? (shown[column.id] ?? pageSize) : column.items.length;\n return {\n column,\n items: column.items.slice(0, limit),\n hidden: Math.max(0, column.items.length - limit),\n };\n });\n });\n protected readonly listIds = computed(() =>\n this.columns().map((column) => `${this.id}-${column.id}`),\n );\n protected readonly boardName = computed(() => this.label() ?? this.translations().board);\n protected readonly handleName = computed(\n () => this.columnDragLabel() ?? this.translations().moveColumn,\n );\n\n private dragScroll: { x: number; left: number; pointer: number } | null = null;\n\n showMore(columnId: string): void {\n const pageSize = this.pageSize();\n const index = this.columns().findIndex((column) => column.id === columnId);\n const before = this.views()[index]?.items.length ?? 0;\n this.shown.update((shown) => ({\n ...shown,\n [columnId]: (shown[columnId] ?? pageSize) + pageSize,\n }));\n afterNextRender(() => this.revealCard(this.listIds()[index], before), {\n injector: this.injector,\n });\n }\n\n protected showMoreLabel(count: number): string {\n return this.locale.translate('showMore', { count });\n }\n\n protected dropItem(event: CdkDragDrop<TxKanbanColumnView<T>>): void {\n if (event.previousContainer === event.container && event.previousIndex === event.currentIndex) {\n return;\n }\n const idOf = this.itemId();\n const itemId = idOf(event.item.data as T);\n const rest = event.container.data.items.filter((item) => idOf(item) !== itemId);\n this.itemDropped.emit(\n this.itemDrop(\n itemId,\n event.previousContainer.data.column.id,\n event.container.data.column.id,\n rest,\n event.currentIndex,\n ),\n );\n }\n\n protected dropColumn(event: CdkDragDrop<readonly TxKanbanColumn<T>[]>): void {\n if (event.previousIndex === event.currentIndex) {\n return;\n }\n const moved = event.item.data as TxKanbanColumn<T>;\n this.columnDropped.emit(this.columnDrop(moved.id, event.currentIndex));\n }\n\n protected onCardKeydown(event: KeyboardEvent, columnIndex: number, itemIndex: number): void {\n const origin = event.target as HTMLElement | null;\n if (\n !this.itemsDraggable() ||\n !event.altKey ||\n !event.key.startsWith('Arrow') ||\n origin?.closest('input, textarea, select, [contenteditable=\"true\"]')\n ) {\n return;\n }\n const views = this.views();\n const from = views[columnIndex];\n const idOf = this.itemId();\n const itemId = idOf(from.items[itemIndex]);\n let targetColumn = columnIndex;\n let targetIndex = itemIndex;\n if (event.key === 'ArrowUp') {\n targetIndex = itemIndex - 1;\n } else if (event.key === 'ArrowDown') {\n targetIndex = itemIndex + 1;\n } else {\n targetColumn = columnIndex + (event.key === 'ArrowLeft' ? -1 : 1);\n }\n const target = views[targetColumn];\n if (!target) {\n return;\n }\n const rest = target.items.filter((item) => idOf(item) !== itemId);\n targetIndex = Math.min(Math.max(targetIndex, 0), rest.length);\n if (targetColumn === columnIndex && targetIndex === itemIndex) {\n return;\n }\n event.preventDefault();\n this.itemDropped.emit(\n this.itemDrop(itemId, from.column.id, target.column.id, rest, targetIndex),\n );\n void this.announcer.announce(\n this.locale.translate('kanbanMoved', {\n column: target.column.title,\n position: targetIndex + 1,\n }),\n );\n this.refocus('data-kanban-card', itemId);\n }\n\n protected onHandleKeydown(event: KeyboardEvent, columnIndex: number): void {\n if (!event.altKey || (event.key !== 'ArrowLeft' && event.key !== 'ArrowRight')) {\n return;\n }\n const columns = this.columns();\n const target = columnIndex + (event.key === 'ArrowLeft' ? -1 : 1);\n if (target < 0 || target >= columns.length) {\n return;\n }\n event.preventDefault();\n const id = columns[columnIndex].id;\n this.columnDropped.emit(this.columnDrop(id, target));\n void this.announcer.announce(\n this.locale.translate('kanbanMoved', { column: this.boardName(), position: target + 1 }),\n );\n this.refocus('data-kanban-handle', id);\n }\n\n protected onPointerDown(event: PointerEvent): void {\n const target = event.target as HTMLElement | null;\n if (\n event.button !== 0 ||\n event.pointerType !== 'mouse' ||\n target?.closest(DRAG_SCROLL_IGNORE)\n ) {\n return;\n }\n const board = event.currentTarget as HTMLElement;\n this.dragScroll = { x: event.clientX, left: board.scrollLeft, pointer: event.pointerId };\n board.setPointerCapture?.(event.pointerId);\n }\n\n protected onPointerMove(event: PointerEvent): void {\n if (!this.dragScroll || event.pointerId !== this.dragScroll.pointer) {\n return;\n }\n (event.currentTarget as HTMLElement).scrollLeft =\n this.dragScroll.left - (event.clientX - this.dragScroll.x);\n }\n\n protected onPointerUp(): void {\n this.dragScroll = null;\n }\n\n private itemDrop(\n itemId: string,\n fromColumnId: string,\n toColumnId: string,\n rest: readonly T[],\n index: number,\n ): TxKanbanItemDrop {\n const idOf = this.itemId();\n const before = rest[index];\n const after = rest[index - 1];\n return {\n itemId,\n fromColumnId,\n toColumnId,\n beforeId: before ? idOf(before) : null,\n afterId: after ? idOf(after) : null,\n };\n }\n\n private columnDrop(columnId: string, index: number): TxKanbanColumnDrop {\n const rest = this.columns().filter((column) => column.id !== columnId);\n return { columnId, beforeId: rest[index]?.id ?? null, afterId: rest[index - 1]?.id ?? null };\n }\n\n private revealCard(listId: string | undefined, index: number): void {\n const list = listId ? this.document.getElementById(listId) : null;\n const card = list?.querySelectorAll<HTMLElement>(':scope > .tx-kanban__card')[index];\n if (!list || !card) {\n return;\n }\n const target = card.hasAttribute('tabindex')\n ? card\n : card.querySelector<HTMLElement>('[tabindex=\"0\"], button, a[href]');\n target?.focus({ preventScroll: true });\n const reduced = this.document.defaultView?.matchMedia?.(\n '(prefers-reduced-motion: reduce)',\n ).matches;\n const behavior: ScrollBehavior = reduced ? 'auto' : 'smooth';\n if (list.scrollHeight > list.clientHeight) {\n const top =\n list.scrollTop + card.getBoundingClientRect().top - list.getBoundingClientRect().top;\n list.scrollTo?.({\n top: top - parseFloat(this.document.defaultView?.getComputedStyle(list).paddingTop ?? '0'),\n behavior,\n });\n } else {\n card.scrollIntoView?.({ block: 'nearest', behavior });\n }\n }\n\n private refocus(attribute: string, value: string): void {\n afterNextRender(\n () => {\n const elements = Array.from(\n this.host.nativeElement.querySelectorAll<HTMLElement>(`[${attribute}]`),\n );\n const element = elements.find((item) => item.getAttribute(attribute) === value);\n const focusable =\n element?.hasAttribute('tabindex') || element?.tagName === 'BUTTON'\n ? element\n : element?.querySelector<HTMLElement>('[tabindex=\"0\"], button, a[href]');\n focusable?.focus();\n },\n { injector: this.injector },\n );\n }\n}\n","<div\n class=\"tx-kanban__board\"\n role=\"region\"\n tabindex=\"0\"\n [attr.aria-label]=\"boardName()\"\n (pointerdown)=\"onPointerDown($event)\"\n (pointermove)=\"onPointerMove($event)\"\n (pointerup)=\"onPointerUp()\"\n (pointercancel)=\"onPointerUp()\"\n>\n <div\n class=\"tx-kanban__track\"\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n [style.height]=\"height() || null\"\n [cdkDropListData]=\"columns()\"\n [cdkDropListDisabled]=\"!columnsDraggable()\"\n (cdkDropListDropped)=\"dropColumn($event)\"\n >\n @for (view of views(); track view.column.id; let columnIndex = $index) {\n @let column = view.column;\n <section\n class=\"tx-kanban__column\"\n cdkDrag\n [cdkDragData]=\"column\"\n [cdkDragDisabled]=\"!columnsDraggable()\"\n [style.width]=\"columnWidth() || null\"\n [attr.aria-label]=\"column.title\"\n [class]=\"passThrough().column?.class\"\n [style]=\"passThrough().column?.style\"\n >\n <div class=\"tx-kanban__column-placeholder\" *cdkDragPlaceholder [style.width]=\"columnWidth() || null\"></div>\n <header class=\"tx-kanban__head\" data-drag-ignore [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n @if (columnsDraggable()) {\n <button\n type=\"button\"\n class=\"tx-kanban__handle\"\n cdkDragHandle\n [attr.data-kanban-handle]=\"column.id\"\n [attr.aria-label]=\"handleName() + ': ' + column.title\"\n [attr.aria-description]=\"translations().kanbanMoveHint\"\n [title]=\"handleName()\"\n (keydown)=\"onHandleKeydown($event, columnIndex)\"\n >\n <tx-icon name=\"bars\" aria-hidden=\"true\" />\n </button>\n }\n @if (headerTemplate(); as header) {\n <ng-container *ngTemplateOutlet=\"header.template; context: { $implicit: column }\" />\n } @else {\n <h3 class=\"tx-kanban__title\">{{ column.title }}</h3>\n <tx-pill size=\"small\" [value]=\"column.items.length\" [unstyled]=\"isUnstyled()\" />\n }\n </header>\n @if (topTemplate(); as top) {\n <div class=\"tx-kanban__slot\" data-drag-ignore>\n <ng-container *ngTemplateOutlet=\"top.template; context: { $implicit: column }\" />\n </div>\n }\n <div\n class=\"tx-kanban__list\"\n cdkDropList\n [attr.role]=\"view.items.length ? 'list' : null\"\n [attr.tabindex]=\"height() ? 0 : null\"\n [attr.aria-label]=\"column.title\"\n [id]=\"listIds()[columnIndex]\"\n [cdkDropListData]=\"view\"\n [cdkDropListConnectedTo]=\"listIds()\"\n [cdkDropListDisabled]=\"!itemsDraggable()\"\n [class]=\"passThrough().list?.class\"\n [style]=\"passThrough().list?.style\"\n (cdkDropListDropped)=\"dropItem($event)\"\n >\n @for (item of view.items; track itemId()(item); let itemIndex = $index) {\n <div\n class=\"tx-kanban__card\"\n role=\"listitem\"\n cdkDrag\n data-drag-ignore\n [attr.tabindex]=\"itemsDraggable() && focusableCards() ? 0 : null\"\n [attr.data-kanban-card]=\"itemId()(item)\"\n [attr.aria-description]=\"itemsDraggable() && focusableCards() ? translations().kanbanMoveHint : null\"\n [cdkDragData]=\"item\"\n [class]=\"passThrough().card?.class\"\n [style]=\"passThrough().card?.style\"\n (keydown)=\"onCardKeydown($event, columnIndex, itemIndex)\"\n >\n <div class=\"tx-kanban__card-placeholder\" *cdkDragPlaceholder></div>\n <ng-container *ngTemplateOutlet=\"cardTemplate().template; context: { $implicit: item, column: column }\" />\n </div>\n } @empty {\n @if (emptyTemplate(); as empty) {\n <ng-container *ngTemplateOutlet=\"empty.template; context: { $implicit: column }\" />\n } @else {\n <div class=\"tx-kanban__empty\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n {{ emptyText() ?? translations().noCards }}\n </div>\n }\n }\n </div>\n @if (view.hidden) {\n <button\n txButton\n type=\"button\"\n class=\"tx-kanban__more\"\n data-drag-ignore\n text\n severity=\"secondary\"\n icon=\"angle-down\"\n [unstyled]=\"isUnstyled()\"\n (click)=\"showMore(column.id)\"\n >\n {{ showMoreLabel(view.hidden) }}\n </button>\n }\n @if (footerTemplate(); as footer) {\n <div class=\"tx-kanban__slot\" data-drag-ignore>\n <ng-container *ngTemplateOutlet=\"footer.template; context: { $implicit: column }\" />\n </div>\n }\n </section>\n }\n <div class=\"tx-kanban__after\" data-drag-ignore>\n <ng-content />\n </div>\n </div>\n</div>\n"],"mappings":";;;;;;;;;;;;AAIA,IAAa,eAAb,MAAa,aAAY;CACd,WAAW,OAA4C,WAAW;CAE3E,OAAO,uBACL,YACA,SAAgB;EAEhB,OAAO,CAAC,CAAC;CACX;CARW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAY,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAZ,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAY,cAAA;EAAA,UAAA;EAAA,UAAA;CAAA,CAAA;;AAAZ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAY,YAAA,CAAA;EADxB,MAAA;EAAU,MAAA,CAAA,EAAE,UAAU,4BAA2B,CAAE;;;AAapD,IAAa,uBAAb,MAAa,qBAAoB;CACtB,WAAW,OAA8C,WAAW;CAE7E,OAAO,uBACL,YACA,SAAgB;EAEhB,OAAO,CAAC,CAAC;CACX;CARW,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAoB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAApB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAoB,cAAA;EAAA,UAAA;EAAA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AA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,YAAe,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACtB,oBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAC1B,iBAAoB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACjB,oBAAuB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBACxB,aAAgB,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, afterNextRender, computed, effect, inject, input, numberAttribute, output, signal } from "@angular/core";
|
|
3
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
4
|
+
import { injectTranslations } from "@tectra-ng/core/i18n";
|
|
5
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
6
|
+
import { TxIcon } from "@tectra-ng/icons";
|
|
7
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
8
|
+
var TxNetworkStatus = class TxNetworkStatus {
|
|
9
|
+
document = inject(DOCUMENT);
|
|
10
|
+
restoreTimer;
|
|
11
|
+
offlineText = input(void 0, ...ngDevMode ? [{ debugName: "offlineText" }] : /* istanbul ignore next */ []);
|
|
12
|
+
restoredText = input(void 0, ...ngDevMode ? [{ debugName: "restoredText" }] : /* istanbul ignore next */ []);
|
|
13
|
+
restoredDuration = input(3e3, {
|
|
14
|
+
...ngDevMode ? { debugName: "restoredDuration" } : /* istanbul ignore next */ {},
|
|
15
|
+
transform: numberAttribute
|
|
16
|
+
});
|
|
17
|
+
bodyClass = input("tx-offline", ...ngDevMode ? [{ debugName: "bodyClass" }] : /* istanbul ignore next */ []);
|
|
18
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
19
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
20
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
21
|
+
unstyled = input(void 0, {
|
|
22
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
23
|
+
transform: optionalBoolean
|
|
24
|
+
});
|
|
25
|
+
statusChange = output();
|
|
26
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
27
|
+
passThrough = injectPassThrough("networkStatus", this, this.pt, this.ptOptions);
|
|
28
|
+
translations = injectTranslations();
|
|
29
|
+
hostStyle = computed(() => ({
|
|
30
|
+
...toStyleObject(this.dt(), "--tx-network-status"),
|
|
31
|
+
...this.passThrough().root?.style
|
|
32
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
33
|
+
status = signal("online", ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []);
|
|
34
|
+
visible = computed(() => this.status() !== "online", ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
|
|
35
|
+
message = computed(() => this.status() === "restored" ? this.restoredText() ?? this.translations().connectionRestored : this.offlineText() ?? this.translations().offline, ...ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []);
|
|
36
|
+
constructor() {
|
|
37
|
+
const destroyRef = inject(DestroyRef);
|
|
38
|
+
afterNextRender(() => {
|
|
39
|
+
const view = this.document.defaultView;
|
|
40
|
+
if (!view) return;
|
|
41
|
+
if (view.navigator?.onLine === false) this.setStatus("offline");
|
|
42
|
+
const offline = () => this.onOffline();
|
|
43
|
+
const online = () => this.onOnline();
|
|
44
|
+
view.addEventListener("offline", offline);
|
|
45
|
+
view.addEventListener("online", online);
|
|
46
|
+
destroyRef.onDestroy(() => {
|
|
47
|
+
view.removeEventListener("offline", offline);
|
|
48
|
+
view.removeEventListener("online", online);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
effect((onCleanup) => {
|
|
52
|
+
const name = this.bodyClass();
|
|
53
|
+
const body = this.document.body;
|
|
54
|
+
if (!name || !body) return;
|
|
55
|
+
body.classList.toggle(name, this.visible());
|
|
56
|
+
onCleanup(() => body.classList.remove(name));
|
|
57
|
+
});
|
|
58
|
+
destroyRef.onDestroy(() => clearTimeout(this.restoreTimer));
|
|
59
|
+
}
|
|
60
|
+
onOffline() {
|
|
61
|
+
clearTimeout(this.restoreTimer);
|
|
62
|
+
this.setStatus("offline");
|
|
63
|
+
}
|
|
64
|
+
onOnline() {
|
|
65
|
+
if (this.status() !== "offline") return;
|
|
66
|
+
this.setStatus("restored");
|
|
67
|
+
clearTimeout(this.restoreTimer);
|
|
68
|
+
this.restoreTimer = setTimeout(() => {
|
|
69
|
+
if (this.status() === "restored") this.setStatus("online");
|
|
70
|
+
}, this.restoredDuration());
|
|
71
|
+
}
|
|
72
|
+
setStatus(status) {
|
|
73
|
+
if (this.status() !== status) {
|
|
74
|
+
this.status.set(status);
|
|
75
|
+
this.statusChange.emit(status);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
79
|
+
minVersion: "12.0.0",
|
|
80
|
+
version: "22.2.3",
|
|
81
|
+
ngImport: i0,
|
|
82
|
+
type: TxNetworkStatus,
|
|
83
|
+
deps: [],
|
|
84
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
85
|
+
});
|
|
86
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
87
|
+
minVersion: "17.0.0",
|
|
88
|
+
version: "22.2.3",
|
|
89
|
+
type: TxNetworkStatus,
|
|
90
|
+
isStandalone: true,
|
|
91
|
+
selector: "tx-network-status",
|
|
92
|
+
inputs: {
|
|
93
|
+
offlineText: {
|
|
94
|
+
classPropertyName: "offlineText",
|
|
95
|
+
publicName: "offlineText",
|
|
96
|
+
isSignal: true,
|
|
97
|
+
isRequired: false,
|
|
98
|
+
transformFunction: null
|
|
99
|
+
},
|
|
100
|
+
restoredText: {
|
|
101
|
+
classPropertyName: "restoredText",
|
|
102
|
+
publicName: "restoredText",
|
|
103
|
+
isSignal: true,
|
|
104
|
+
isRequired: false,
|
|
105
|
+
transformFunction: null
|
|
106
|
+
},
|
|
107
|
+
restoredDuration: {
|
|
108
|
+
classPropertyName: "restoredDuration",
|
|
109
|
+
publicName: "restoredDuration",
|
|
110
|
+
isSignal: true,
|
|
111
|
+
isRequired: false,
|
|
112
|
+
transformFunction: null
|
|
113
|
+
},
|
|
114
|
+
bodyClass: {
|
|
115
|
+
classPropertyName: "bodyClass",
|
|
116
|
+
publicName: "bodyClass",
|
|
117
|
+
isSignal: true,
|
|
118
|
+
isRequired: false,
|
|
119
|
+
transformFunction: null
|
|
120
|
+
},
|
|
121
|
+
dt: {
|
|
122
|
+
classPropertyName: "dt",
|
|
123
|
+
publicName: "dt",
|
|
124
|
+
isSignal: true,
|
|
125
|
+
isRequired: false,
|
|
126
|
+
transformFunction: null
|
|
127
|
+
},
|
|
128
|
+
pt: {
|
|
129
|
+
classPropertyName: "pt",
|
|
130
|
+
publicName: "pt",
|
|
131
|
+
isSignal: true,
|
|
132
|
+
isRequired: false,
|
|
133
|
+
transformFunction: null
|
|
134
|
+
},
|
|
135
|
+
ptOptions: {
|
|
136
|
+
classPropertyName: "ptOptions",
|
|
137
|
+
publicName: "ptOptions",
|
|
138
|
+
isSignal: true,
|
|
139
|
+
isRequired: false,
|
|
140
|
+
transformFunction: null
|
|
141
|
+
},
|
|
142
|
+
unstyled: {
|
|
143
|
+
classPropertyName: "unstyled",
|
|
144
|
+
publicName: "unstyled",
|
|
145
|
+
isSignal: true,
|
|
146
|
+
isRequired: false,
|
|
147
|
+
transformFunction: null
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
outputs: { statusChange: "statusChange" },
|
|
151
|
+
host: {
|
|
152
|
+
properties: {
|
|
153
|
+
"class": "passThrough().root?.class",
|
|
154
|
+
"style": "hostStyle()",
|
|
155
|
+
"attr.data-styled": "!isUnstyled() || null"
|
|
156
|
+
},
|
|
157
|
+
classAttribute: "tx-network-status"
|
|
158
|
+
},
|
|
159
|
+
ngImport: i0,
|
|
160
|
+
template: `
|
|
161
|
+
<div class="tx-network-status__region" role="status" aria-live="polite">
|
|
162
|
+
@if (visible()) {
|
|
163
|
+
<div
|
|
164
|
+
class="tx-network-status__pill"
|
|
165
|
+
animate.enter="tx-network-status__pill--enter"
|
|
166
|
+
animate.leave="tx-network-status__pill--leave"
|
|
167
|
+
[attr.data-status]="status()"
|
|
168
|
+
[class]="passThrough().pill?.class"
|
|
169
|
+
[style]="passThrough().pill?.style"
|
|
170
|
+
>
|
|
171
|
+
<span class="tx-network-status__icon" aria-hidden="true" [class]="passThrough().icon?.class" [style]="passThrough().icon?.style">
|
|
172
|
+
<tx-icon [name]="status() === 'restored' ? 'check' : 'wifi'" />
|
|
173
|
+
</span>
|
|
174
|
+
<span class="tx-network-status__text" [class]="passThrough().text?.class" [style]="passThrough().text?.style">{{ message() }}</span>
|
|
175
|
+
</div>
|
|
176
|
+
}
|
|
177
|
+
</div>
|
|
178
|
+
`,
|
|
179
|
+
isInline: true,
|
|
180
|
+
styles: [":host{display:contents}.tx-network-status__region{position:fixed;left:50%;transform:translate(-50%);pointer-events:none}.tx-network-status__pill{display:flex;align-items:center;white-space:nowrap;pointer-events:auto}.tx-network-status__icon{display:grid;place-items:center}:host([data-styled]) .tx-network-status__region{z-index:var(--tx-network-status-z-index);bottom:var(--tx-network-status-bottom)}:host([data-styled]) .tx-network-status__pill{--tx-network-status-tone: var(--tx-network-status-offline-color);gap:var(--tx-network-status-gap);padding:var(--tx-network-status-padding);border-radius:var(--tx-network-status-border-radius);background:var(--tx-network-status-background);box-shadow:0 0 0 1px var(--tx-network-status-ring-color),var(--tx-network-status-shadow);color:var(--tx-network-status-color);font-family:var(--tx-font-family);font-size:var(--tx-network-status-font-size);font-weight:var(--tx-network-status-font-weight);-webkit-backdrop-filter:var(--tx-network-status-backdrop-filter);backdrop-filter:var(--tx-network-status-backdrop-filter)}:host([data-styled]) .tx-network-status__pill[data-status=restored]{--tx-network-status-tone: var(--tx-network-status-restored-color)}:host([data-styled]) .tx-network-status__icon{width:var(--tx-network-status-icon-size);height:var(--tx-network-status-icon-size);border-radius:50%;background:color-mix(in srgb,var(--tx-network-status-tone) var(--tx-network-status-icon-tint),transparent);color:var(--tx-network-status-tone);font-size:var(--tx-network-status-icon-font-size)}:host([data-styled]) .tx-network-status__pill--enter{animation:tx-network-status-in var(--tx-network-status-motion-enter-duration) var(--tx-network-status-motion-enter-easing)}:host([data-styled]) .tx-network-status__pill--leave{animation:tx-network-status-out var(--tx-network-status-motion-leave-duration) ease-in forwards}@keyframes tx-network-status-in{0%{opacity:0;transform:translateY(16px) scale(.96)}}@keyframes tx-network-status-out{to{opacity:0;transform:translateY(12px) scale(.98)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-network-status__pill--enter,:host([data-styled]) .tx-network-status__pill--leave{animation-duration:1ms}}\n"],
|
|
181
|
+
dependencies: [{
|
|
182
|
+
kind: "component",
|
|
183
|
+
type: TxIcon,
|
|
184
|
+
selector: "tx-icon",
|
|
185
|
+
inputs: ["name"]
|
|
186
|
+
}],
|
|
187
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
188
|
+
});
|
|
189
|
+
};
|
|
190
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
191
|
+
minVersion: "12.0.0",
|
|
192
|
+
version: "22.2.3",
|
|
193
|
+
ngImport: i0,
|
|
194
|
+
type: TxNetworkStatus,
|
|
195
|
+
decorators: [{
|
|
196
|
+
type: Component,
|
|
197
|
+
args: [{
|
|
198
|
+
selector: "tx-network-status",
|
|
199
|
+
imports: [TxIcon],
|
|
200
|
+
template: `
|
|
201
|
+
<div class="tx-network-status__region" role="status" aria-live="polite">
|
|
202
|
+
@if (visible()) {
|
|
203
|
+
<div
|
|
204
|
+
class="tx-network-status__pill"
|
|
205
|
+
animate.enter="tx-network-status__pill--enter"
|
|
206
|
+
animate.leave="tx-network-status__pill--leave"
|
|
207
|
+
[attr.data-status]="status()"
|
|
208
|
+
[class]="passThrough().pill?.class"
|
|
209
|
+
[style]="passThrough().pill?.style"
|
|
210
|
+
>
|
|
211
|
+
<span class="tx-network-status__icon" aria-hidden="true" [class]="passThrough().icon?.class" [style]="passThrough().icon?.style">
|
|
212
|
+
<tx-icon [name]="status() === 'restored' ? 'check' : 'wifi'" />
|
|
213
|
+
</span>
|
|
214
|
+
<span class="tx-network-status__text" [class]="passThrough().text?.class" [style]="passThrough().text?.style">{{ message() }}</span>
|
|
215
|
+
</div>
|
|
216
|
+
}
|
|
217
|
+
</div>
|
|
218
|
+
`,
|
|
219
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
220
|
+
host: {
|
|
221
|
+
class: "tx-network-status",
|
|
222
|
+
"[class]": "passThrough().root?.class",
|
|
223
|
+
"[style]": "hostStyle()",
|
|
224
|
+
"[attr.data-styled]": "!isUnstyled() || null"
|
|
225
|
+
},
|
|
226
|
+
styles: [":host{display:contents}.tx-network-status__region{position:fixed;left:50%;transform:translate(-50%);pointer-events:none}.tx-network-status__pill{display:flex;align-items:center;white-space:nowrap;pointer-events:auto}.tx-network-status__icon{display:grid;place-items:center}:host([data-styled]) .tx-network-status__region{z-index:var(--tx-network-status-z-index);bottom:var(--tx-network-status-bottom)}:host([data-styled]) .tx-network-status__pill{--tx-network-status-tone: var(--tx-network-status-offline-color);gap:var(--tx-network-status-gap);padding:var(--tx-network-status-padding);border-radius:var(--tx-network-status-border-radius);background:var(--tx-network-status-background);box-shadow:0 0 0 1px var(--tx-network-status-ring-color),var(--tx-network-status-shadow);color:var(--tx-network-status-color);font-family:var(--tx-font-family);font-size:var(--tx-network-status-font-size);font-weight:var(--tx-network-status-font-weight);-webkit-backdrop-filter:var(--tx-network-status-backdrop-filter);backdrop-filter:var(--tx-network-status-backdrop-filter)}:host([data-styled]) .tx-network-status__pill[data-status=restored]{--tx-network-status-tone: var(--tx-network-status-restored-color)}:host([data-styled]) .tx-network-status__icon{width:var(--tx-network-status-icon-size);height:var(--tx-network-status-icon-size);border-radius:50%;background:color-mix(in srgb,var(--tx-network-status-tone) var(--tx-network-status-icon-tint),transparent);color:var(--tx-network-status-tone);font-size:var(--tx-network-status-icon-font-size)}:host([data-styled]) .tx-network-status__pill--enter{animation:tx-network-status-in var(--tx-network-status-motion-enter-duration) var(--tx-network-status-motion-enter-easing)}:host([data-styled]) .tx-network-status__pill--leave{animation:tx-network-status-out var(--tx-network-status-motion-leave-duration) ease-in forwards}@keyframes tx-network-status-in{0%{opacity:0;transform:translateY(16px) scale(.96)}}@keyframes tx-network-status-out{to{opacity:0;transform:translateY(12px) scale(.98)}}@media(prefers-reduced-motion:reduce){:host([data-styled]) .tx-network-status__pill--enter,:host([data-styled]) .tx-network-status__pill--leave{animation-duration:1ms}}\n"]
|
|
227
|
+
}]
|
|
228
|
+
}],
|
|
229
|
+
ctorParameters: () => [],
|
|
230
|
+
propDecorators: {
|
|
231
|
+
offlineText: [{
|
|
232
|
+
type: i0.Input,
|
|
233
|
+
args: [{
|
|
234
|
+
isSignal: true,
|
|
235
|
+
alias: "offlineText",
|
|
236
|
+
required: false
|
|
237
|
+
}]
|
|
238
|
+
}],
|
|
239
|
+
restoredText: [{
|
|
240
|
+
type: i0.Input,
|
|
241
|
+
args: [{
|
|
242
|
+
isSignal: true,
|
|
243
|
+
alias: "restoredText",
|
|
244
|
+
required: false
|
|
245
|
+
}]
|
|
246
|
+
}],
|
|
247
|
+
restoredDuration: [{
|
|
248
|
+
type: i0.Input,
|
|
249
|
+
args: [{
|
|
250
|
+
isSignal: true,
|
|
251
|
+
alias: "restoredDuration",
|
|
252
|
+
required: false
|
|
253
|
+
}]
|
|
254
|
+
}],
|
|
255
|
+
bodyClass: [{
|
|
256
|
+
type: i0.Input,
|
|
257
|
+
args: [{
|
|
258
|
+
isSignal: true,
|
|
259
|
+
alias: "bodyClass",
|
|
260
|
+
required: false
|
|
261
|
+
}]
|
|
262
|
+
}],
|
|
263
|
+
dt: [{
|
|
264
|
+
type: i0.Input,
|
|
265
|
+
args: [{
|
|
266
|
+
isSignal: true,
|
|
267
|
+
alias: "dt",
|
|
268
|
+
required: false
|
|
269
|
+
}]
|
|
270
|
+
}],
|
|
271
|
+
pt: [{
|
|
272
|
+
type: i0.Input,
|
|
273
|
+
args: [{
|
|
274
|
+
isSignal: true,
|
|
275
|
+
alias: "pt",
|
|
276
|
+
required: false
|
|
277
|
+
}]
|
|
278
|
+
}],
|
|
279
|
+
ptOptions: [{
|
|
280
|
+
type: i0.Input,
|
|
281
|
+
args: [{
|
|
282
|
+
isSignal: true,
|
|
283
|
+
alias: "ptOptions",
|
|
284
|
+
required: false
|
|
285
|
+
}]
|
|
286
|
+
}],
|
|
287
|
+
unstyled: [{
|
|
288
|
+
type: i0.Input,
|
|
289
|
+
args: [{
|
|
290
|
+
isSignal: true,
|
|
291
|
+
alias: "unstyled",
|
|
292
|
+
required: false
|
|
293
|
+
}]
|
|
294
|
+
}],
|
|
295
|
+
statusChange: [{
|
|
296
|
+
type: i0.Output,
|
|
297
|
+
args: ["statusChange"]
|
|
298
|
+
}]
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
export { TxNetworkStatus };
|
|
302
|
+
|
|
303
|
+
//# sourceMappingURL=tectra-ng-blocks-network-status.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-network-status.mjs","names":[],"sources":["../../../../packages/blocks/network-status/src/network-status.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, DOCUMENT, DestroyRef, afterNextRender, computed, effect, inject, input, numberAttribute, output, signal } from '@angular/core';\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 } from '@tectra-ng/icons';\nimport { TectraDeepPartial, TectraNetworkStatusTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxNetworkState, TxNetworkStatusPart } from './network-status.types';\n\n@Component({\n selector: 'tx-network-status',\n imports: [TxIcon],\n template: `\n <div class=\"tx-network-status__region\" role=\"status\" aria-live=\"polite\">\n @if (visible()) {\n <div\n class=\"tx-network-status__pill\"\n animate.enter=\"tx-network-status__pill--enter\"\n animate.leave=\"tx-network-status__pill--leave\"\n [attr.data-status]=\"status()\"\n [class]=\"passThrough().pill?.class\"\n [style]=\"passThrough().pill?.style\"\n >\n <span class=\"tx-network-status__icon\" aria-hidden=\"true\" [class]=\"passThrough().icon?.class\" [style]=\"passThrough().icon?.style\">\n <tx-icon [name]=\"status() === 'restored' ? 'check' : 'wifi'\" />\n </span>\n <span class=\"tx-network-status__text\" [class]=\"passThrough().text?.class\" [style]=\"passThrough().text?.style\">{{ message() }}</span>\n </div>\n }\n </div>\n `,\n styleUrl: './network-status.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-network-status',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n})\nexport class TxNetworkStatus {\n private readonly document = inject(DOCUMENT);\n private restoreTimer: ReturnType<typeof setTimeout> | undefined;\n\n readonly offlineText = input<string | undefined>(undefined);\n readonly restoredText = input<string | undefined>(undefined);\n readonly restoredDuration = input<number, unknown>(3000, { transform: numberAttribute });\n readonly bodyClass = input<string>('tx-offline');\n readonly dt = input<TectraDeepPartial<TectraNetworkStatusTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxNetworkStatusPart, TxNetworkStatus> | undefined>(undefined);\n readonly ptOptions = input<TxPassThroughOptions | undefined>(undefined);\n readonly unstyled = input<boolean | undefined, unknown>(undefined, { transform: optionalBoolean });\n\n readonly statusChange = output<TxNetworkState>();\n\n readonly isUnstyled = injectUnstyled(this.unstyled);\n readonly passThrough = injectPassThrough('networkStatus', this, this.pt, this.ptOptions);\n protected readonly translations = injectTranslations();\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-network-status'), ...this.passThrough().root?.style }));\n\n readonly status = signal<TxNetworkState>('online');\n protected readonly visible = computed(() => this.status() !== 'online');\n protected readonly message = computed(() =>\n this.status() === 'restored' ? (this.restoredText() ?? this.translations().connectionRestored) : (this.offlineText() ?? this.translations().offline),\n );\n\n constructor() {\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const view = this.document.defaultView;\n if (!view) {\n return;\n }\n if (view.navigator?.onLine === false) {\n this.setStatus('offline');\n }\n const offline = () => this.onOffline();\n const online = () => this.onOnline();\n view.addEventListener('offline', offline);\n view.addEventListener('online', online);\n destroyRef.onDestroy(() => {\n view.removeEventListener('offline', offline);\n view.removeEventListener('online', online);\n });\n });\n effect((onCleanup) => {\n const name = this.bodyClass();\n const body = this.document.body;\n if (!name || !body) {\n return;\n }\n body.classList.toggle(name, this.visible());\n onCleanup(() => body.classList.remove(name));\n });\n destroyRef.onDestroy(() => clearTimeout(this.restoreTimer));\n }\n\n onOffline(): void {\n clearTimeout(this.restoreTimer);\n this.setStatus('offline');\n }\n\n onOnline(): void {\n if (this.status() !== 'offline') {\n return;\n }\n this.setStatus('restored');\n clearTimeout(this.restoreTimer);\n this.restoreTimer = setTimeout(() => {\n if (this.status() === 'restored') {\n this.setStatus('online');\n }\n }, this.restoredDuration());\n }\n\n private setStatus(status: TxNetworkState): void {\n if (this.status() !== status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;;;;;;;;;;;;EAkBT,UAAA;EAAA,QAAA,CAAA,0pEAAA;EAAA,cAAA,CAAA;GAAA,MAAA;GAAA,MAnBS;GAAM,UAAA;GAAA,QAAA,CAAA,MAAA;EAAA,CAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AA6BL,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EA/B3B,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAmB,SACpB,CAAC,MAAM;GAAC,UACP;;;;;;;;;;;;;;;;;;;GAkBT,iBAEgB,wBAAwB;GAAM,MACzC;IACJ,OAAO;IACP,WAAW;IACX,WAAW;IACX,sBAAsB;GACvB;GAAA,QAAA,CAAA,0pEAAA;EAAA,CAAA"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, computed, input } from "@angular/core";
|
|
4
|
+
import { injectPassThrough, injectUnstyled } from "@tectra-ng/core/config";
|
|
5
|
+
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
6
|
+
import { toStyleObject } from "@tectra-ng/themes";
|
|
7
|
+
var TxPageHeader = class TxPageHeader {
|
|
8
|
+
title = input.required(...ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []);
|
|
9
|
+
subtitle = input(void 0, ...ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []);
|
|
10
|
+
headingLevel = input(1, ...ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []);
|
|
11
|
+
dt = input(void 0, ...ngDevMode ? [{ debugName: "dt" }] : /* istanbul ignore next */ []);
|
|
12
|
+
pt = input(void 0, ...ngDevMode ? [{ debugName: "pt" }] : /* istanbul ignore next */ []);
|
|
13
|
+
ptOptions = input(void 0, ...ngDevMode ? [{ debugName: "ptOptions" }] : /* istanbul ignore next */ []);
|
|
14
|
+
unstyled = input(void 0, {
|
|
15
|
+
...ngDevMode ? { debugName: "unstyled" } : /* istanbul ignore next */ {},
|
|
16
|
+
transform: optionalBoolean
|
|
17
|
+
});
|
|
18
|
+
isUnstyled = injectUnstyled(this.unstyled);
|
|
19
|
+
passThrough = injectPassThrough("pageHeader", this, this.pt, this.ptOptions);
|
|
20
|
+
hostStyle = computed(() => ({
|
|
21
|
+
...toStyleObject(this.dt(), "--tx-page-header"),
|
|
22
|
+
...this.passThrough().root?.style
|
|
23
|
+
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
25
|
+
minVersion: "12.0.0",
|
|
26
|
+
version: "22.2.3",
|
|
27
|
+
ngImport: i0,
|
|
28
|
+
type: TxPageHeader,
|
|
29
|
+
deps: [],
|
|
30
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
31
|
+
});
|
|
32
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
33
|
+
minVersion: "17.0.0",
|
|
34
|
+
version: "22.2.3",
|
|
35
|
+
type: TxPageHeader,
|
|
36
|
+
isStandalone: true,
|
|
37
|
+
selector: "tx-page-header",
|
|
38
|
+
inputs: {
|
|
39
|
+
title: {
|
|
40
|
+
classPropertyName: "title",
|
|
41
|
+
publicName: "title",
|
|
42
|
+
isSignal: true,
|
|
43
|
+
isRequired: true,
|
|
44
|
+
transformFunction: null
|
|
45
|
+
},
|
|
46
|
+
subtitle: {
|
|
47
|
+
classPropertyName: "subtitle",
|
|
48
|
+
publicName: "subtitle",
|
|
49
|
+
isSignal: true,
|
|
50
|
+
isRequired: false,
|
|
51
|
+
transformFunction: null
|
|
52
|
+
},
|
|
53
|
+
headingLevel: {
|
|
54
|
+
classPropertyName: "headingLevel",
|
|
55
|
+
publicName: "headingLevel",
|
|
56
|
+
isSignal: true,
|
|
57
|
+
isRequired: false,
|
|
58
|
+
transformFunction: null
|
|
59
|
+
},
|
|
60
|
+
dt: {
|
|
61
|
+
classPropertyName: "dt",
|
|
62
|
+
publicName: "dt",
|
|
63
|
+
isSignal: true,
|
|
64
|
+
isRequired: false,
|
|
65
|
+
transformFunction: null
|
|
66
|
+
},
|
|
67
|
+
pt: {
|
|
68
|
+
classPropertyName: "pt",
|
|
69
|
+
publicName: "pt",
|
|
70
|
+
isSignal: true,
|
|
71
|
+
isRequired: false,
|
|
72
|
+
transformFunction: null
|
|
73
|
+
},
|
|
74
|
+
ptOptions: {
|
|
75
|
+
classPropertyName: "ptOptions",
|
|
76
|
+
publicName: "ptOptions",
|
|
77
|
+
isSignal: true,
|
|
78
|
+
isRequired: false,
|
|
79
|
+
transformFunction: null
|
|
80
|
+
},
|
|
81
|
+
unstyled: {
|
|
82
|
+
classPropertyName: "unstyled",
|
|
83
|
+
publicName: "unstyled",
|
|
84
|
+
isSignal: true,
|
|
85
|
+
isRequired: false,
|
|
86
|
+
transformFunction: null
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
host: {
|
|
90
|
+
properties: {
|
|
91
|
+
"class": "passThrough().root?.class",
|
|
92
|
+
"style": "hostStyle()",
|
|
93
|
+
"attr.data-styled": "!isUnstyled() || null"
|
|
94
|
+
},
|
|
95
|
+
classAttribute: "tx-page-header"
|
|
96
|
+
},
|
|
97
|
+
ngImport: i0,
|
|
98
|
+
template: "<div class=\"tx-page-header__heading\" [class]=\"passThrough().heading?.class\" [style]=\"passThrough().heading?.style\">\n <ng-template #titleText>{{ title() }}</ng-template>\n @switch (headingLevel()) {\n @case (2) {\n <h2 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h2>\n }\n @case (3) {\n <h3 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h3>\n }\n @case (4) {\n <h4 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h4>\n }\n @case (5) {\n <h5 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h5>\n }\n @case (6) {\n <h6 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h6>\n }\n @default {\n <h1 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h1>\n }\n }\n @if (subtitle()) {\n <p class=\"tx-page-header__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n</div>\n<div class=\"tx-page-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content />\n</div>\n",
|
|
99
|
+
styles: [":host{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between}.tx-page-header__heading{display:flex;flex-direction:column;min-width:0}.tx-page-header__title,.tx-page-header__subtitle{margin:0}.tx-page-header__actions{display:flex;flex-wrap:wrap;align-items:center}.tx-page-header__actions:empty{display:none}:host([data-styled]){gap:var(--tx-page-header-gap);font-family:var(--tx-font-family)}:host([data-styled]) .tx-page-header__heading{gap:var(--tx-page-header-heading-gap)}:host([data-styled]) .tx-page-header__title{color:var(--tx-page-header-title-color);font-size:var(--tx-page-header-title-font-size);font-weight:var(--tx-page-header-title-font-weight);line-height:var(--tx-page-header-title-line-height);letter-spacing:var(--tx-page-header-title-letter-spacing)}:host([data-styled]) .tx-page-header__subtitle{color:var(--tx-page-header-subtitle-color);font-size:var(--tx-page-header-subtitle-font-size);font-variant-numeric:tabular-nums;line-height:var(--tx-page-header-subtitle-line-height)}:host([data-styled]) .tx-page-header__actions{--tx-button-secondary-background: var(--tx-page-header-secondary-button-background);--tx-button-secondary-hover-background: var(--tx-page-header-secondary-button-hover-background);--tx-button-secondary-active-background: var(--tx-page-header-secondary-button-active-background);--tx-button-secondary-border-color: var(--tx-page-header-secondary-button-border-color);--tx-button-secondary-hover-border-color: var(--tx-page-header-secondary-button-border-color);--tx-button-secondary-active-border-color: var(--tx-page-header-secondary-button-border-color);gap:var(--tx-page-header-actions-gap)}\n"],
|
|
100
|
+
dependencies: [{
|
|
101
|
+
kind: "directive",
|
|
102
|
+
type: NgTemplateOutlet,
|
|
103
|
+
selector: "[ngTemplateOutlet]",
|
|
104
|
+
inputs: [
|
|
105
|
+
"ngTemplateOutletContext",
|
|
106
|
+
"ngTemplateOutlet",
|
|
107
|
+
"ngTemplateOutletInjector"
|
|
108
|
+
]
|
|
109
|
+
}],
|
|
110
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
114
|
+
minVersion: "12.0.0",
|
|
115
|
+
version: "22.2.3",
|
|
116
|
+
ngImport: i0,
|
|
117
|
+
type: TxPageHeader,
|
|
118
|
+
decorators: [{
|
|
119
|
+
type: Component,
|
|
120
|
+
args: [{
|
|
121
|
+
selector: "tx-page-header",
|
|
122
|
+
imports: [NgTemplateOutlet],
|
|
123
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
124
|
+
host: {
|
|
125
|
+
class: "tx-page-header",
|
|
126
|
+
"[class]": "passThrough().root?.class",
|
|
127
|
+
"[style]": "hostStyle()",
|
|
128
|
+
"[attr.data-styled]": "!isUnstyled() || null"
|
|
129
|
+
},
|
|
130
|
+
template: "<div class=\"tx-page-header__heading\" [class]=\"passThrough().heading?.class\" [style]=\"passThrough().heading?.style\">\n <ng-template #titleText>{{ title() }}</ng-template>\n @switch (headingLevel()) {\n @case (2) {\n <h2 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h2>\n }\n @case (3) {\n <h3 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h3>\n }\n @case (4) {\n <h4 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h4>\n }\n @case (5) {\n <h5 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h5>\n }\n @case (6) {\n <h6 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h6>\n }\n @default {\n <h1 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h1>\n }\n }\n @if (subtitle()) {\n <p class=\"tx-page-header__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>\n }\n</div>\n<div class=\"tx-page-header__actions\" [class]=\"passThrough().actions?.class\" [style]=\"passThrough().actions?.style\">\n <ng-content />\n</div>\n",
|
|
131
|
+
styles: [":host{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between}.tx-page-header__heading{display:flex;flex-direction:column;min-width:0}.tx-page-header__title,.tx-page-header__subtitle{margin:0}.tx-page-header__actions{display:flex;flex-wrap:wrap;align-items:center}.tx-page-header__actions:empty{display:none}:host([data-styled]){gap:var(--tx-page-header-gap);font-family:var(--tx-font-family)}:host([data-styled]) .tx-page-header__heading{gap:var(--tx-page-header-heading-gap)}:host([data-styled]) .tx-page-header__title{color:var(--tx-page-header-title-color);font-size:var(--tx-page-header-title-font-size);font-weight:var(--tx-page-header-title-font-weight);line-height:var(--tx-page-header-title-line-height);letter-spacing:var(--tx-page-header-title-letter-spacing)}:host([data-styled]) .tx-page-header__subtitle{color:var(--tx-page-header-subtitle-color);font-size:var(--tx-page-header-subtitle-font-size);font-variant-numeric:tabular-nums;line-height:var(--tx-page-header-subtitle-line-height)}:host([data-styled]) .tx-page-header__actions{--tx-button-secondary-background: var(--tx-page-header-secondary-button-background);--tx-button-secondary-hover-background: var(--tx-page-header-secondary-button-hover-background);--tx-button-secondary-active-background: var(--tx-page-header-secondary-button-active-background);--tx-button-secondary-border-color: var(--tx-page-header-secondary-button-border-color);--tx-button-secondary-hover-border-color: var(--tx-page-header-secondary-button-border-color);--tx-button-secondary-active-border-color: var(--tx-page-header-secondary-button-border-color);gap:var(--tx-page-header-actions-gap)}\n"]
|
|
132
|
+
}]
|
|
133
|
+
}],
|
|
134
|
+
propDecorators: {
|
|
135
|
+
title: [{
|
|
136
|
+
type: i0.Input,
|
|
137
|
+
args: [{
|
|
138
|
+
isSignal: true,
|
|
139
|
+
alias: "title",
|
|
140
|
+
required: true
|
|
141
|
+
}]
|
|
142
|
+
}],
|
|
143
|
+
subtitle: [{
|
|
144
|
+
type: i0.Input,
|
|
145
|
+
args: [{
|
|
146
|
+
isSignal: true,
|
|
147
|
+
alias: "subtitle",
|
|
148
|
+
required: false
|
|
149
|
+
}]
|
|
150
|
+
}],
|
|
151
|
+
headingLevel: [{
|
|
152
|
+
type: i0.Input,
|
|
153
|
+
args: [{
|
|
154
|
+
isSignal: true,
|
|
155
|
+
alias: "headingLevel",
|
|
156
|
+
required: false
|
|
157
|
+
}]
|
|
158
|
+
}],
|
|
159
|
+
dt: [{
|
|
160
|
+
type: i0.Input,
|
|
161
|
+
args: [{
|
|
162
|
+
isSignal: true,
|
|
163
|
+
alias: "dt",
|
|
164
|
+
required: false
|
|
165
|
+
}]
|
|
166
|
+
}],
|
|
167
|
+
pt: [{
|
|
168
|
+
type: i0.Input,
|
|
169
|
+
args: [{
|
|
170
|
+
isSignal: true,
|
|
171
|
+
alias: "pt",
|
|
172
|
+
required: false
|
|
173
|
+
}]
|
|
174
|
+
}],
|
|
175
|
+
ptOptions: [{
|
|
176
|
+
type: i0.Input,
|
|
177
|
+
args: [{
|
|
178
|
+
isSignal: true,
|
|
179
|
+
alias: "ptOptions",
|
|
180
|
+
required: false
|
|
181
|
+
}]
|
|
182
|
+
}],
|
|
183
|
+
unstyled: [{
|
|
184
|
+
type: i0.Input,
|
|
185
|
+
args: [{
|
|
186
|
+
isSignal: true,
|
|
187
|
+
alias: "unstyled",
|
|
188
|
+
required: false
|
|
189
|
+
}]
|
|
190
|
+
}]
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
export { TxPageHeader };
|
|
194
|
+
|
|
195
|
+
//# sourceMappingURL=tectra-ng-blocks-page-header.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tectra-ng-blocks-page-header.mjs","names":[],"sources":["../../../../packages/blocks/page-header/src/page-header.component.ts","../../../../packages/blocks/page-header/src/page-header.component.html"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { TxPassThrough, TxPassThroughOptions, injectPassThrough, injectUnstyled } from '@tectra-ng/core/config';\nimport { optionalBoolean } from '@tectra-ng/core/utils';\nimport { TectraDeepPartial, TectraPageHeaderTokens, toStyleObject } from '@tectra-ng/themes';\nimport { TxPageHeaderLevel, TxPageHeaderPart } from './page-header.types';\n\n@Component({\n selector: 'tx-page-header',\n imports: [NgTemplateOutlet],\n templateUrl: './page-header.component.html',\n styleUrl: './page-header.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'tx-page-header',\n '[class]': 'passThrough().root?.class',\n '[style]': 'hostStyle()',\n '[attr.data-styled]': '!isUnstyled() || null',\n },\n})\nexport class TxPageHeader {\n readonly title = input.required<string>();\n readonly subtitle = input<string | undefined>(undefined);\n readonly headingLevel = input<TxPageHeaderLevel>(1);\n readonly dt = input<TectraDeepPartial<TectraPageHeaderTokens> | undefined>(undefined);\n readonly pt = input<TxPassThrough<TxPageHeaderPart, TxPageHeader> | 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('pageHeader', this, this.pt, this.ptOptions);\n readonly hostStyle = computed(() => ({ ...toStyleObject(this.dt(), '--tx-page-header'), ...this.passThrough().root?.style }));\n}\n","<div class=\"tx-page-header__heading\" [class]=\"passThrough().heading?.class\" [style]=\"passThrough().heading?.style\">\n <ng-template #titleText>{{ title() }}</ng-template>\n @switch (headingLevel()) {\n @case (2) {\n <h2 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h2>\n }\n @case (3) {\n <h3 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h3>\n }\n @case (4) {\n <h4 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h4>\n }\n @case (5) {\n <h5 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h5>\n }\n @case (6) {\n <h6 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h6>\n }\n @default {\n <h1 class=\"tx-page-header__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\"><ng-container [ngTemplateOutlet]=\"titleText\" /></h1>\n }\n }\n @if (subtitle()) {\n <p class=\"tx-page-header__subtitle\" [class]=\"passThrough().subtitle?.class\" [style]=\"passThrough().subtitle?.style\">{{ subtitle() }}</p>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