@tectra-ng/ui 0.1.3 → 0.1.5
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/accordion/README.md +61 -0
- package/breadcrumb/README.md +57 -0
- package/carousel/README.md +53 -0
- package/fesm2022/tectra-ng-ui-accordion.mjs +980 -0
- package/fesm2022/tectra-ng-ui-accordion.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +2 -2
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs +382 -0
- package/fesm2022/tectra-ng-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-carousel.mjs +939 -0
- package/fesm2022/tectra-ng-ui-carousel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chips-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +2 -2
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-file-upload.mjs +1452 -0
- package/fesm2022/tectra-ng-ui-file-upload.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-galleria.mjs +1140 -0
- package/fesm2022/tectra-ng-ui-galleria.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-image.mjs +759 -0
- package/fesm2022/tectra-ng-ui-image.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-input-group.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input-group.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-listbox.mjs +2 -2
- package/fesm2022/tectra-ng-ui-listbox.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-menubar.mjs +742 -0
- package/fesm2022/tectra-ng-ui-menubar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-multiselect.mjs +2 -2
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +610 -0
- package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs +319 -0
- package/fesm2022/tectra-ng-ui-scroll-panel.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-splitter.mjs +750 -0
- package/fesm2022/tectra-ng-ui-splitter.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-stepper.mjs +1166 -0
- package/fesm2022/tectra-ng-ui-stepper.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-table.mjs +194 -50
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tabs.mjs +1218 -0
- package/fesm2022/tectra-ng-ui-tabs.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-textarea.mjs +4 -1
- package/fesm2022/tectra-ng-ui-textarea.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-toolbar.mjs +348 -0
- package/fesm2022/tectra-ng-ui-toolbar.mjs.map +1 -0
- package/fesm2022/tectra-ng-ui-tree-select.mjs +2 -2
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +80 -2
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
- package/field/README.md +1 -1
- package/file-upload/README.md +85 -0
- package/galleria/README.md +62 -0
- package/image/README.md +54 -0
- package/menubar/README.md +51 -0
- package/package.json +56 -4
- package/panel-menu/README.md +45 -0
- package/scroll-panel/README.md +35 -0
- package/splitter/README.md +62 -0
- package/stepper/README.md +66 -0
- package/table/README.md +1 -1
- package/tabs/README.md +69 -0
- package/toolbar/README.md +35 -0
- package/types/tectra-ng-ui-accordion.d.ts +304 -0
- package/types/tectra-ng-ui-accordion.d.ts.map +1 -0
- package/types/tectra-ng-ui-breadcrumb.d.ts +157 -0
- package/types/tectra-ng-ui-breadcrumb.d.ts.map +1 -0
- package/types/tectra-ng-ui-carousel.d.ts +263 -0
- package/types/tectra-ng-ui-carousel.d.ts.map +1 -0
- package/types/tectra-ng-ui-file-upload.d.ts +527 -0
- package/types/tectra-ng-ui-file-upload.d.ts.map +1 -0
- package/types/tectra-ng-ui-galleria.d.ts +407 -0
- package/types/tectra-ng-ui-galleria.d.ts.map +1 -0
- package/types/tectra-ng-ui-image.d.ts +259 -0
- package/types/tectra-ng-ui-image.d.ts.map +1 -0
- package/types/tectra-ng-ui-menubar.d.ts +201 -0
- package/types/tectra-ng-ui-menubar.d.ts.map +1 -0
- package/types/tectra-ng-ui-panel-menu.d.ts +244 -0
- package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -0
- package/types/tectra-ng-ui-scroll-panel.d.ts +94 -0
- package/types/tectra-ng-ui-scroll-panel.d.ts.map +1 -0
- package/types/tectra-ng-ui-splitter.d.ts +226 -0
- package/types/tectra-ng-ui-splitter.d.ts.map +1 -0
- package/types/tectra-ng-ui-stepper.d.ts +446 -0
- package/types/tectra-ng-ui-stepper.d.ts.map +1 -0
- package/types/tectra-ng-ui-table.d.ts +2 -4
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tabs.d.ts +420 -0
- package/types/tectra-ng-ui-tabs.d.ts.map +1 -0
- package/types/tectra-ng-ui-textarea.d.ts +1 -0
- package/types/tectra-ng-ui-textarea.d.ts.map +1 -1
- package/types/tectra-ng-ui-toolbar.d.ts +85 -0
- package/types/tectra-ng-ui-toolbar.d.ts.map +1 -0
- package/types/tectra-ng-ui-tree-table.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tectra-ng-ui-tree-table.mjs","names":[],"sources":["../../../../packages/ui/tree-table/src/tree-table.component.ts","../../../../packages/ui/table/src/table.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Signal, afterNextRender, booleanAttribute, computed, effect, input, linkedSignal, model, output, signal, untracked } from '@angular/core';\nimport { TxResolvedPassThrough, injectPassThrough } from '@tectra-ng/core/config';\nimport { CdkDrag, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxCheckbox } from '@tectra-ng/ui/checkbox';\nimport { TxInput } from '@tectra-ng/ui/input';\nimport { TxInputNumber } from '@tectra-ng/ui/input-number';\nimport { TxMenu, TxMenuItemTemplate } from '@tectra-ng/ui/menu';\nimport { TxPaginator } from '@tectra-ng/ui/paginator';\nimport { TxProgressSpinner } from '@tectra-ng/ui/progress-spinner';\nimport { TxRadioButton } from '@tectra-ng/ui/radio-button';\nimport { TxSelect } from '@tectra-ng/ui/select';\nimport { TxSkeleton } from '@tectra-ng/ui/skeleton';\nimport {\n TX_TABLE,\n TxTable,\n TxTableActionsStore,\n TxTableColumnFilter,\n TxTablePart,\n TxTableRenderRow,\n TxTableSettings,\n filterRows,\n resolveField,\n sortRows,\n} from '@tectra-ng/ui/table';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { TxTreeTableFilterMode, TxTreeTableNode, TxTreeTableNodeEvent } from './tree-table.types';\n\nconst COLLAPSE_DURATION = 400;\n\nexport function flattenTreeTable<T>(nodes: readonly TxTreeTableNode<T>[]): TxTreeTableNode<T>[] {\n const result: TxTreeTableNode<T>[] = [];\n const walk = (items: readonly TxTreeTableNode<T>[]) =>\n items.forEach((node) => {\n result.push(node);\n walk(node.children ?? []);\n });\n walk(nodes);\n return result;\n}\n\nexport function filterTreeTable<T>(nodes: readonly TxTreeTableNode<T>[], matches: (node: TxTreeTableNode<T>) => boolean, mode: TxTreeTableFilterMode = 'lenient'): TxTreeTableNode<T>[] {\n const visit = (node: TxTreeTableNode<T>): TxTreeTableNode<T> | null => {\n const own = matches(node);\n const children = node.children ?? [];\n if (own && (mode === 'lenient' || !children.length)) return node;\n const kept = children.map(visit).filter((child): child is TxTreeTableNode<T> => child !== null);\n if (kept.length) return { ...node, children: kept };\n return own ? { ...node, children: [] } : null;\n };\n return nodes.map(visit).filter((node): node is TxTreeTableNode<T> => node !== null);\n}\n\n@Component({\n selector: 'tx-tree-table',\n imports: [\n NgTemplateOutlet,\n FormsModule,\n CdkDropList,\n CdkDrag,\n CdkDragHandle,\n TxIcon,\n TxTooltip,\n TxSkeleton,\n TxButton,\n TxCheckbox,\n TxInput,\n TxInputNumber,\n TxSelect,\n TxRadioButton,\n TxPaginator,\n TxProgressSpinner,\n TxMenu,\n TxMenuItemTemplate,\n TxTableSettings,\n TxTableColumnFilter,\n ],\n templateUrl: '../../table/src/table.component.html',\n styleUrl: '../../table/src/table.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TxTableActionsStore, { provide: TX_TABLE, useExisting: TxTreeTable }],\n host: { class: 'tx-tree-table' },\n})\nexport class TxTreeTable<T = unknown> extends TxTable<TxTreeTableNode<T>> {\n override readonly isTree = true;\n override readonly responsive = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly expandedKeys = model<unknown[]>([]);\n readonly filterMode = input<TxTreeTableFilterMode>('lenient');\n readonly propagateSelectionUp = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly propagateSelectionDown = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n readonly nodeExpand = output<TxTreeTableNodeEvent<T>>();\n readonly nodeCollapse = output<TxTreeTableNodeEvent<T>>();\n\n override readonly passThrough: Signal<TxResolvedPassThrough<TxTablePart>> = injectPassThrough('treeTable', this, this.pt, this.ptOptions);\n\n private readonly seenKeys = new Set<unknown>();\n readonly pendingKeys = signal<ReadonlySet<unknown>>(new Set());\n readonly mountedKeys = signal<ReadonlySet<unknown>>(new Set());\n\n readonly allNodes = computed(() => flattenTreeTable(this.value() ?? []));\n readonly selectedIds = computed<ReadonlySet<unknown>>(() => {\n const selection = this.selection();\n if (!selection) return new Set();\n return new Set((Array.isArray(selection) ? selection : [selection]).map((node) => this.identityOf(node)));\n });\n private readonly matchedData = computed<ReadonlySet<unknown> | null>(() => {\n if (this.lazy()) return null;\n const data = this.allNodes().map((node) => node.data);\n const fields = this.globalFilterFields() ?? this.visibleColumns().map((column) => column.filterField ?? column.field);\n const matched = filterRows(data, this.filters(), this.columns(), this.globalFilter(), fields, this.localeService.locale().intl);\n return matched.length === data.length ? null : new Set(matched);\n });\n override readonly filteredRows = computed(() => {\n const roots = [...this.allRows()];\n const matched = this.matchedData();\n return matched ? filterTreeTable(roots, (node) => matched.has(node.data), this.filterMode()) : roots;\n });\n readonly filterOpen = linkedSignal<ReadonlySet<unknown>>(() => {\n if (!this.matchedData()) return new Set();\n return new Set(\n flattenTreeTable(this.filteredRows())\n .filter((node) => node.children?.length)\n .map((node) => this.identityOf(node)),\n );\n });\n readonly expandedSet = computed<ReadonlySet<unknown>>(() => (this.matchedData() ? this.filterOpen() : new Set(this.expandedKeys())));\n override readonly sortedRows = computed(() => {\n const roots = this.filteredRows();\n const meta = this.sortMeta();\n if (this.lazy() || this.customSort() || !meta.length) return [...roots];\n const dataMeta = meta.map((item) => ({ ...item, field: `data.${item.field}` }));\n const intl = this.localeService.locale().intl;\n const sort = (nodes: readonly TxTreeTableNode<T>[]): TxTreeTableNode<T>[] =>\n sortRows(nodes, dataMeta, intl).map((node) => (node.children?.length ? { ...node, children: sort(node.children) } : node));\n return sort(roots);\n });\n override readonly renderRows = computed<TxTableRenderRow<TxTreeTableNode<T>>[]>(() => {\n this.editVersion();\n const expanded = this.expandedSet();\n const mounted = this.animatedRows() ? this.mountedKeys() : new Set<unknown>();\n const pending = this.pendingKeys();\n const selected = this.selectedIds();\n const partialOn = this.treeCheckbox() && this.propagateSelectionUp();\n const rowSelectable = this.rowSelectable();\n const offset = this.paginator() && !this.lazy() && this.totalRecords() === undefined ? this.first() : 0;\n const rows: TxTableRenderRow<TxTreeTableNode<T>>[] = [];\n const walk = (nodes: readonly TxTreeTableNode<T>[], level: number, parentKey: unknown, hidden: boolean) =>\n nodes.forEach((node, position) => {\n const key = this.identityOf(node);\n const leaf = node.leaf === false ? false : !node.children?.length;\n const open = !leaf && expanded.has(key);\n const index = offset + rows.length;\n const isSelected = selected.has(key);\n rows.push({\n row: node,\n index,\n key,\n selected: isSelected,\n selectable: node.selectable !== false && (!rowSelectable || rowSelectable(node, index)),\n expanded: false,\n group: null,\n tree: {\n level,\n leaf,\n expanded: open,\n hidden,\n loading: !!node.loading || (pending.has(key) && node.children === undefined),\n partial: partialOn && !isSelected && this.hasSelectedDescendant(node, selected),\n setSize: nodes.length,\n posInSet: position + 1,\n parentKey,\n },\n });\n if ((open || mounted.has(key)) && node.children?.length) walk(node.children, level + 1, key, hidden || !open);\n });\n walk(this.pageRows(), 1, null, false);\n return rows;\n });\n override readonly allSelected = computed(() => {\n const own = this.selectAll();\n if (own !== undefined) return own;\n const nodes = this.allNodes().filter((node) => node.selectable !== false);\n const selected = this.selectedIds();\n return nodes.length > 0 && nodes.every((node) => selected.has(this.identityOf(node)));\n });\n override readonly someSelected = computed(() => {\n if (this.allSelected()) return false;\n const selected = this.selectedIds();\n return this.allNodes().some((node) => selected.has(this.identityOf(node)));\n });\n\n protected override treeRowKey = (item: TxTableRenderRow<TxTreeTableNode<T>>, position: number, event: KeyboardEvent): boolean => {\n const tree = item.tree;\n if (!tree) return false;\n const rows = this.renderRows();\n const shown = rows.map((row, index) => (row.tree?.hidden ? -1 : index)).filter((index) => index >= 0);\n const at = shown.indexOf(position);\n const step: Record<string, number> = { ArrowDown: shown[at + 1], ArrowUp: shown[at - 1], Home: shown[0], End: shown[shown.length - 1] };\n if (event.key in step) {\n event.preventDefault();\n const target = step[event.key];\n if (target !== undefined) this.focusRowAt(target);\n return true;\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (!tree.leaf && !tree.expanded) this.expandNode(item, event);\n else if (tree.expanded && shown[at + 1] !== undefined) this.focusRowAt(shown[at + 1]);\n return true;\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (tree.expanded) this.collapseNode(item, event);\n else if (tree.parentKey !== null) {\n const parent = rows.findIndex((row) => row.key === tree.parentKey);\n if (parent >= 0) this.focusRowAt(parent);\n }\n return true;\n }\n return false;\n };\n\n constructor() {\n super();\n effect(() => {\n const fresh: unknown[] = [];\n this.allNodes().forEach((node) => {\n const key = this.identityOf(node);\n if (this.seenKeys.has(key)) return;\n this.seenKeys.add(key);\n if (node.expanded) fresh.push(key);\n });\n if (fresh.length) untracked(() => this.expandedKeys.update((keys) => [...keys, ...fresh.filter((key) => !keys.includes(key))]));\n });\n }\n\n override dataOf(row: TxTreeTableNode<T>): unknown {\n return row?.data;\n }\n\n override identityOf(row: TxTreeTableNode<T>): unknown {\n if (row?.key !== undefined) return row.key;\n const dataKey = this.dataKey();\n return dataKey ? resolveField(row?.data, dataKey) : row?.data;\n }\n\n override rowsFocusable(): boolean {\n return true;\n }\n\n override toggleNode(item: TxTableRenderRow<TxTreeTableNode<T>>, event: Event): void {\n event.stopPropagation();\n if (!item.tree || item.tree.leaf) return;\n if (item.tree.expanded) this.collapseNode(item, event);\n else this.expandNode(item, event);\n }\n\n expandNode(item: TxTableRenderRow<TxTreeTableNode<T>>, event?: Event): void {\n if (!item.tree || item.tree.leaf || item.tree.expanded) return;\n this.setOpen(item.key, true);\n if (item.row.leaf === false && item.row.children === undefined) this.pendingKeys.update((keys) => new Set([...keys, item.key]));\n this.nodeExpand.emit({ node: item.row, originalEvent: event });\n }\n\n collapseNode(item: TxTableRenderRow<TxTreeTableNode<T>>, event?: Event): void {\n if (!item.tree?.expanded) return;\n this.setOpen(item.key, false);\n this.nodeCollapse.emit({ node: item.row, originalEvent: event });\n }\n\n expandAll(): void {\n this.expandedKeys.set(\n this.allNodes()\n .filter((node) => node.children?.length)\n .map((node) => this.identityOf(node)),\n );\n }\n\n collapseAll(): void {\n this.expandedKeys.set([]);\n }\n\n override toggleRow(item: TxTableRenderRow<TxTreeTableNode<T>>, event?: Event): void {\n if (!this.treeCheckbox()) {\n super.toggleRow(item, event);\n return;\n }\n if (!item.selectable) return;\n const ids = new Set(this.selectedIds());\n const check = !item.selected;\n const affected = this.propagateSelectionDown() ? flattenTreeTable([item.row]).filter((node) => node.selectable !== false) : [item.row];\n affected.forEach((node) => (check ? ids.add(this.identityOf(node)) : ids.delete(this.identityOf(node))));\n if (this.propagateSelectionUp()) this.settle(this.value() ?? [], ids);\n this.selection.set(this.allNodes().filter((node) => ids.has(this.identityOf(node))));\n (check ? this.rowSelect : this.rowUnselect).emit({ row: item.row, index: item.index, originalEvent: event });\n }\n\n override toggleAll(checked: boolean): void {\n this.selectAllChange.emit(checked);\n if (this.selectAll() !== undefined) return;\n this.selection.set(checked ? this.allNodes().filter((node) => node.selectable !== false) : []);\n }\n\n protected override exportRows(): TxTreeTableNode<T>[] {\n return flattenTreeTable(this.sortedRows());\n }\n\n private setOpen(key: unknown, open: boolean): void {\n if (!this.animatedRows()) {\n this.writeOpen(key, open);\n return;\n }\n if (open) {\n if (this.mountedKeys().has(key)) {\n this.writeOpen(key, true);\n return;\n }\n this.mountedKeys.update((keys) => new Set([...keys, key]));\n afterNextRender(\n () => {\n this.host.nativeElement.getBoundingClientRect();\n this.writeOpen(key, true);\n },\n { injector: this.injector },\n );\n return;\n }\n this.mountedKeys.update((keys) => new Set([...keys, key]));\n this.writeOpen(key, false);\n setTimeout(() => {\n if (this.expandedSet().has(key)) return;\n this.mountedKeys.update((keys) => new Set([...keys].filter((other) => other !== key)));\n }, COLLAPSE_DURATION);\n }\n\n private writeOpen(key: unknown, open: boolean): void {\n if (this.matchedData()) {\n this.filterOpen.update((keys) => new Set(open ? [...keys, key] : [...keys].filter((other) => other !== key)));\n return;\n }\n this.expandedKeys.update((keys) => (open ? [...keys, key] : keys.filter((other) => other !== key)));\n }\n\n private settle(nodes: readonly TxTreeTableNode<T>[], ids: Set<unknown>): void {\n const visit = (node: TxTreeTableNode<T>): boolean => {\n const children = (node.children ?? []).filter((child) => child.selectable !== false);\n const key = this.identityOf(node);\n if (!children.length) return ids.has(key);\n const all = children.map(visit).every(Boolean);\n if (all) ids.add(key);\n else ids.delete(key);\n return all;\n };\n nodes.forEach(visit);\n }\n\n private hasSelectedDescendant(node: TxTreeTableNode<T>, selected: ReadonlySet<unknown>): boolean {\n return (node.children ?? []).some((child) => selected.has(this.identityOf(child)) || this.hasSelectedDescendant(child, selected));\n }\n}\n","@if (showToolbar()) {\n <div class=\"tx-table__toolbar\" [class]=\"passThrough().toolbar?.class\" [style]=\"passThrough().toolbar?.style\">\n <div class=\"tx-table__toolbar-slot\"><ng-content select=\"[txTableToolbar]\" /></div>\n @if (showSettings()) {\n <tx-table-settings\n [columns]=\"columns()\"\n [hidden]=\"hidden()\"\n [showColumns]=\"columnSettings()\"\n [showActions]=\"actionsSettings()\"\n [unstyled]=\"isUnstyled()\"\n (columnToggled)=\"toggleColumn($event.field, $event.visible)\"\n />\n }\n </div>\n}\n\n@if (showPaginatorTop()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n}\n\n<div class=\"tx-table__frame\" [class]=\"passThrough().frame?.class\" [style]=\"passThrough().frame?.style\" [attr.aria-busy]=\"loading() || null\">\n @if (cardView() && selectionMode() === 'checkbox' && !empty()) {\n <div class=\"tx-table__select-all\">\n <tx-checkbox\n binary\n [label]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n </div>\n }\n\n @if (loading()) {\n <div class=\"tx-table__loading\" [class]=\"passThrough().loading?.class\" [style]=\"passThrough().loading?.style\">\n <tx-progress-spinner [ariaLabel]=\"translations().loading\" [unstyled]=\"isUnstyled()\" />\n </div>\n }\n\n @if (!cardView()) {\n <div\n class=\"tx-table__scroller\"\n [class.tx-table__scroller--empty]=\"empty()\"\n [class]=\"passThrough().scroller?.class\"\n [style]=\"passThrough().scroller?.style\"\n [style.max-height]=\"scrollHeight()\"\n (scroll)=\"onScroll($event)\"\n >\n <table\n class=\"tx-table__table\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-multiselectable]=\"rowSelection() || treeCheckbox() ? selectionMode() !== 'single' : null\"\n [attr.role]=\"isTree ? 'treegrid' : rowSelection() ? 'grid' : null\"\n >\n <thead class=\"tx-table__thead\" [class]=\"passThrough().thead?.class\" [style]=\"passThrough().thead?.style\">\n <tr\n #headerRow\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"tx-table__header-row\"\n [class]=\"passThrough().headerRow?.class\"\n [style]=\"passThrough().headerRow?.style\"\n [cdkDropListDisabled]=\"!reorderableColumns()\"\n (cdkDropListDropped)=\"dropColumn($event)\"\n >\n @for (item of renderColumns(); track item.column.field; let last = $last) {\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragPreviewClass=\"tx-table__drag-preview\"\n [cdkDragBoundary]=\"headerRow\"\n scope=\"col\"\n class=\"tx-table__th\"\n [class]=\"[item.column.headerClass ?? '', passThrough().headerCell?.class ?? '']\"\n [style]=\"passThrough().headerCell?.style\"\n [style.width]=\"item.style['width']\"\n [style.min-width]=\"item.style['minWidth']\"\n [style.max-width]=\"item.style['maxWidth']\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n [class.tx-table__th--draggable]=\"reorderableColumns() && item.kind === 'data' && item.column.reorderable !== false\"\n [attr.data-field]=\"item.column.field\"\n [attr.data-align]=\"item.column.align ?? null\"\n [attr.aria-sort]=\"item.kind === 'data' ? ariaSort(item.column) : null\"\n [cdkDragDisabled]=\"!reorderableColumns() || item.kind !== 'data' || item.column.reorderable === false\"\n >\n @switch (item.kind) {\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n } @else {\n <span class=\"tx-table__sr-only\">{{ translations().selectRow }}</span>\n }\n }\n @case ('expand') {\n <span class=\"tx-table__sr-only\">{{ translations().expandRow }}</span>\n }\n @case ('actions') {\n <span class=\"tx-table__column-title\">{{ item.column.header }}</span>\n }\n @default {\n <div class=\"tx-table__header-content\">\n @if (treeCheckbox() && item.column.field === treeField()) {\n <tx-checkbox\n binary\n class=\"tx-table__select tx-table__tree-select-all\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n }\n @if (headerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else if (isSortable(item.column)) {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <button\n type=\"button\"\n class=\"tx-table__sort\"\n [class]=\"passThrough().sortButton?.class\"\n [style]=\"passThrough().sortButton?.style\"\n (click)=\"sort(item.column, $event)\"\n (keydown.alt.arrowleft)=\"moveColumnBy(item.column, -1, $event)\"\n (keydown.alt.arrowright)=\"moveColumnBy(item.column, 1, $event)\"\n >\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n @if (sortOrderOf(item.column); as order) {\n <tx-icon\n class=\"tx-table__sort-icon\"\n aria-hidden=\"true\"\n name=\"sort-amount-down\"\n [class.tx-table__sort-icon--desc]=\"order === 'desc'\"\n [class]=\"passThrough().sortIcon?.class\"\n [style]=\"passThrough().sortIcon?.style\"\n />\n @if (sortMode() === 'multiple' && sortMeta().length > 1) {\n <span class=\"tx-table__sort-badge\" aria-hidden=\"true\">{{ sortIndexOf(item.column) + 1 }}</span>\n }\n }\n </button>\n } @else {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n }\n @if (item.column.filter && filterDisplay() === 'menu') {\n <tx-table-column-filter class=\"tx-table__filter\" [column]=\"item.column\" />\n }\n </div>\n }\n }\n @if (resizableColumns() && item.kind === 'data' && item.column.resizable !== false && item.column.width === undefined && !last) {\n <span\n class=\"tx-table__resizer\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [class.tx-table__resizer--active]=\"resizing() === item.column.field\"\n [attr.aria-label]=\"translations().resizeColumn.replace('{column}', label(item.column))\"\n [attr.aria-valuenow]=\"resizeValue(item.column)\"\n [attr.aria-valuemin]=\"resizeMin(item.column)\"\n [attr.aria-valuemax]=\"resizeMax(item.column)\"\n (pointerdown)=\"startResize(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.arrowleft)=\"resizeByKey(item, -10, $event)\"\n (keydown.arrowright)=\"resizeByKey(item, 10, $event)\"\n >\n <span class=\"tx-table__resizer-line\"></span>\n </span>\n }\n </th>\n }\n </tr>\n @if (filterRow()) {\n <tr class=\"tx-table__filter-row\">\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__th tx-table__filter-cell\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n >\n @if (item.kind === 'data' && item.column.filter) {\n <tx-table-column-filter display=\"row\" [column]=\"item.column\" />\n }\n </td>\n }\n </tr>\n }\n </thead>\n @if (frozenRows().length) {\n <tbody class=\"tx-table__frozen-tbody\" [style.top.px]=\"headerHeight()\">\n @for (item of frozenRows(); track item.key; let position = $index) {\n <tr class=\"tx-table__row tx-table__row--frozen\">\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n }\n </tbody>\n }\n <tbody\n #tbody\n cdkDropList\n class=\"tx-table__tbody\"\n [class]=\"passThrough().tbody?.class\"\n [style]=\"passThrough().tbody?.style\"\n [cdkDropListDisabled]=\"!reorderableRows()\"\n (cdkDropListDropped)=\"dropRow($event)\"\n >\n @if (spacerBefore()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerBefore()\"></td>\n </tr>\n }\n @for (item of visibleRows(); track item.key; let windowIndex = $index) {\n @let position = windowRange().start + windowIndex;\n @let odd = position % 2 === 1;\n @if (item.group?.first && rowGroupMode() === 'subheader') {\n <tr class=\"tx-table__group-header\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div class=\"tx-table__group-content\">\n @if (expandableRowGroups()) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"!item.group.collapsed\"\n [attr.aria-label]=\"item.group.collapsed ? translations().expandRow : translations().collapseRow\"\n (click)=\"toggleGroup(item)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"!item.group.collapsed\" />\n </button>\n }\n @if (groupHeaderTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n } @else {\n <span class=\"tx-table__group-title\">{{ item.group.value }}</span>\n <span class=\"tx-table__group-count\">{{ translations().rowGroup.replace('{count}', '' + item.group.size) }}</span>\n }\n </div>\n </td>\n </tr>\n }\n @if (!item.group?.collapsed || animatedGroups()) {\n <tr\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragPreviewContainer=\"parent\"\n class=\"tx-table__row\"\n [class]=\"[rowClassOf(item) ?? '', passThrough().row?.class ?? '']\"\n [style]=\"passThrough().row?.style\"\n [class.tx-table__row--odd]=\"odd\"\n [class.tx-table__row--selected]=\"item.selected\"\n [class.tx-table__row--selectable]=\"rowSelection() && item.selectable\"\n [class.tx-table__row--menu]=\"menuRowKey() === item.key && menuRowKey() !== undefined\"\n [attr.aria-selected]=\"rowSelection() ? item.selected : null\"\n [attr.aria-level]=\"item.tree?.level ?? null\"\n [attr.aria-expanded]=\"item.tree && !item.tree.leaf ? item.tree.expanded : null\"\n [attr.aria-setsize]=\"item.tree?.setSize ?? null\"\n [attr.aria-posinset]=\"item.tree?.posInSet ?? null\"\n [attr.aria-busy]=\"item.tree?.loading || null\"\n [attr.tabindex]=\"rowsFocusable() ? (position === focusedRow() ? 0 : -1) : null\"\n [attr.data-key]=\"item.key\"\n [class.tx-table__row--editing]=\"isRowEditing(item)\"\n [class.tx-table__row--collapsed]=\"isCollapsedRow(item)\"\n [attr.inert]=\"isCollapsedRow(item) ? '' : null\"\n [attr.aria-hidden]=\"isCollapsedRow(item) ? true : null\"\n (click)=\"onRowClick(item, position, $event)\"\n (keydown)=\"onRowKeydown(item, position, $event)\"\n (contextmenu)=\"onRowContextMenu(item, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n @if ((item.expanded || isClosing(item.key)) && !item.group?.collapsed && expansionTemplate(); as expansion) {\n <tr class=\"tx-table__expansion\">\n <td class=\"tx-table__expansion-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div\n class=\"tx-table__expansion-body\"\n [class.tx-table__expansion-body--open]=\"item.expanded\"\n (transitionend)=\"finishClosing(item.key, $event)\"\n >\n <div class=\"tx-table__expansion-inner\">\n <div class=\"tx-table__expansion-content\">\n <ng-container [ngTemplateOutlet]=\"expansion.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n </div>\n </div>\n </td>\n </tr>\n }\n @if (item.group?.last && rowGroupMode() === 'subheader' && groupFooterTemplate(); as footer) {\n <tr class=\"tx-table__group-footer\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <ng-container [ngTemplateOutlet]=\"footer.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n </td>\n </tr>\n }\n }\n }\n @if (spacerAfter()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerAfter()\"></td>\n </tr>\n }\n </tbody>\n @if (hasFooter()) {\n <tfoot class=\"tx-table__tfoot\" [class]=\"passThrough().tfoot?.class\" [style]=\"passThrough().tfoot?.style\">\n <tr>\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__footer-cell\"\n [class]=\"passThrough().footerCell?.class\"\n [style]=\"passThrough().footerCell?.style\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [attr.data-align]=\"item.column.align ?? null\"\n >\n @if (footerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else {\n {{ item.column.footer }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n } @else if (!empty()) {\n <div class=\"tx-table__cards\" role=\"list\" [class]=\"passThrough().cards?.class\" [style]=\"passThrough().cards?.style\" [attr.aria-label]=\"ariaLabel() ?? null\">\n @for (item of renderRows(); track item.key) {\n <div\n role=\"listitem\"\n class=\"tx-table__card\"\n [class]=\"passThrough().card?.class\"\n [style]=\"passThrough().card?.style\"\n [class.tx-table__card--selected]=\"item.selected\"\n [class.tx-table__card--custom]=\"!!cardTemplate()\"\n >\n @if (cardTemplate(); as card) {\n <ng-container [ngTemplateOutlet]=\"card.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n } @else {\n @if (hasSelectColumn()) {\n <div class=\"tx-table__card-select\">\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n </div>\n }\n @if (cardTitleColumn(); as title) {\n <div class=\"tx-table__card-title\" [class.tx-table__card-title--select]=\"hasSelectColumn()\">\n <ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column: title }\" />\n </div>\n }\n @for (column of cardFields(); track column.field) {\n <div class=\"tx-table__card-field\">\n <span class=\"tx-table__card-label\">{{ label(column) }}</span>\n <span class=\"tx-table__card-value\"><ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" /></span>\n </div>\n }\n @if (actionsTemplate(); as actions) {\n <div class=\"tx-table__card-actions\">\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (empty()) {\n <div class=\"tx-table__empty\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataColumnCount() }\" />\n } @else {\n {{ emptyMessage() ?? translations().emptyMessage }}\n }\n </div>\n }\n</div>\n\n@if (showPaginatorBottom()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n}\n\n<ng-content />\n\n<tx-tiered-menu\n #rowMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().rowActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n>\n <ng-template txMenuItem let-menuItem>\n @if (actionTemplate(menuItem); as action) {\n <span class=\"tx-table__menu-action\" aria-hidden=\"true\" [attr.data-action-id]=\"action.id()\">\n <ng-container [ngTemplateOutlet]=\"action.templateRef\" />\n </span>\n } @else if (menuItem.icon) {\n <tx-icon class=\"tx-table__menu-icon\" aria-hidden=\"true\" [name]=\"menuItem.icon\" />\n }\n <span class=\"tx-table__menu-label\">{{ menuItem.label }}</span>\n </ng-template>\n</tx-tiered-menu>\n\n<ng-template #cellContent let-item let-column=\"column\">\n @if (templatesByField().get(column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), row: dataOf(item.row), node: item.row, index: item.index, column, value: cellValue(item.row, column) }\"\n />\n } @else {\n {{ displayValue(item.row, column) }}\n }\n</ng-template>\n\n<ng-template #pager let-position>\n <tx-paginator\n class=\"tx-table__paginator\"\n [class.tx-table__paginator--top]=\"position === 'top'\"\n [class]=\"passThrough().paginator?.class\"\n [style]=\"passThrough().paginator?.style\"\n [first]=\"first()\"\n [rows]=\"rows()\"\n [totalRecords]=\"total()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n [showTotal]=\"showTotal()\"\n [showCurrentPageReport]=\"showCurrentPageReport()\"\n [currentPageReportTemplate]=\"currentPageReportTemplate()\"\n [showFirstLastIcon]=\"showFirstLastIcon()\"\n [showPageLinks]=\"showPageLinks()\"\n [showJumpToPageDropdown]=\"showJumpToPageDropdown()\"\n [showJumpToPageInput]=\"showJumpToPageInput()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [pageLinkSize]=\"pageLinks()\"\n [unstyled]=\"isUnstyled()\"\n (pageChange)=\"onPage($event)\"\n />\n</ng-template>\n\n<ng-template #rowCells let-item let-position=\"position\">\n @for (column of renderColumns(); track column.column.field) {\n @if (!isGroupedCellHidden(item, column)) {\n <td\n class=\"tx-table__td\"\n [class]=\"[column.column.cellClass ?? '', passThrough().cell?.class ?? '']\"\n [style]=\"passThrough().cell?.style\"\n [style.inset-inline-start]=\"frozenStyle(column)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(column)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!column.frozen\"\n [class.tx-table__cell--frozen-last]=\"column.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"column.firstFrozenEnd\"\n [class.tx-table__td--actions]=\"column.kind === 'actions'\"\n [class.tx-table__td--editable]=\"column.kind === 'data' && editMode() === 'cell' && !!column.column.editable\"\n [class.tx-table__td--editing]=\"column.kind === 'data' && isEditing(item, column.column)\"\n [attr.data-field]=\"column.column.field\"\n [attr.data-align]=\"column.column.align ?? null\"\n [attr.rowspan]=\"groupRowspan(item, column)\"\n [attr.tabindex]=\"column.kind === 'data' && editMode() === 'cell' && column.column.editable ? 0 : null\"\n (click)=\"onCellClick(item, column, $event)\"\n (keydown)=\"onCellKeydown(item, column, $event)\"\n (focusout)=\"onCellFocusOut(item, column, $event)\"\n >\n @if (animatedRows()) {\n <div class=\"tx-table__cell-body\">\n <div class=\"tx-table__cell-inner\">\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n }\n </td>\n }\n }\n</ng-template>\n\n<ng-template #cellBody let-item let-column=\"column\" let-position=\"position\">\n @switch (column.kind) {\n @case ('reorder') {\n <button\n type=\"button\"\n cdkDragHandle\n class=\"tx-table__row-handle\"\n [attr.aria-label]=\"translations().moveRow\"\n (keydown.alt.arrowup)=\"moveRowBy(position, -1, $event)\"\n (keydown.alt.arrowdown)=\"moveRowBy(position, 1, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"bars\" />\n </button>\n }\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n class=\"tx-table__select\"\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n }\n @case ('expand') {\n @if (canExpand(item)) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"item.expanded\"\n [attr.aria-label]=\"item.expanded ? translations().collapseRow : translations().expandRow\"\n (click)=\"toggleExpansion(item, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.expanded\" />\n </button>\n }\n }\n @case ('actions') {\n @if (actionsTemplate(); as actions) {\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n }\n }\n @case ('editor') {\n <div class=\"tx-table__row-editor\">\n @if (isRowEditing(item)) {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"success\"\n icon=\"check\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().saveRow\"\n (click)=\"saveRow(item)\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"danger\"\n icon=\"times\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().cancelEdit\"\n (click)=\"cancelRow(item)\"\n ></button>\n } @else {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"secondary\"\n icon=\"pencil\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().editRow\"\n (click)=\"startRowEdit(item)\"\n ></button>\n }\n </div>\n }\n @default {\n @if (item.tree && column.column.field === treeField()) {\n <div class=\"tx-table__tree-cell\" [style.--tx-table-tree-level]=\"item.tree.level - 1\">\n <button\n type=\"button\"\n class=\"tx-table__row-toggle tx-table__tree-toggle\"\n [class.tx-table__tree-toggle--hidden]=\"item.tree.leaf\"\n [attr.tabindex]=\"item.tree.leaf ? -1 : null\"\n [attr.aria-hidden]=\"item.tree.leaf || null\"\n [attr.aria-expanded]=\"item.tree.leaf ? null : item.tree.expanded\"\n [attr.aria-label]=\"item.tree.expanded ? translations().collapseRow : translations().expandRow\"\n [class]=\"passThrough().treeToggle?.class\"\n [style]=\"passThrough().treeToggle?.style\"\n (click)=\"toggleNode(item, $event)\"\n >\n @if (item.tree.loading) {\n <tx-icon aria-hidden=\"true\" name=\"spinner\" class=\"tx-table__tree-toggle-icon--loading\" />\n } @else {\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.tree.expanded\" />\n }\n </button>\n @if (treeCheckbox()) {\n <tx-checkbox\n binary\n class=\"tx-table__tree-checkbox\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n [indeterminate]=\"item.tree.partial\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n }\n <div class=\"tx-table__tree-content\">\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n }\n }\n }\n</ng-template>\n\n<ng-template #dataCell let-item let-column=\"column\">\n @if (isEditing(item, column.column)) {\n <div class=\"tx-table__editor\">\n @if (editorTemplatesByField().get(column.column.field); as editor) {\n <ng-container [ngTemplateOutlet]=\"editor.templateRef\" [ngTemplateOutletContext]=\"editorContext(item, column.column)\" />\n } @else if (column.column.editOptions?.length) {\n <tx-select\n size=\"small\"\n optionLabel=\"label\"\n optionValue=\"value\"\n class=\"tx-table__editor-control\"\n [options]=\"column.column.editOptions\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n } @else {\n @switch (column.column.editType ?? 'text') {\n @case ('numeric') {\n <tx-input-number\n size=\"small\"\n class=\"tx-table__editor-control\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('boolean') {\n <tx-checkbox\n binary\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('date') {\n <input\n txInput\n type=\"date\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"dateInput(draftValue(item, column.column))\"\n (change)=\"setDraft(item, column.column, parseDateInput($any($event.target).value))\"\n />\n }\n @default {\n <input\n txInput\n type=\"text\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"draftValue(item, column.column) ?? ''\"\n (input)=\"setDraft(item, column.column, $any($event.target).value)\"\n />\n }\n }\n }\n </div>\n } @else if (templatesByField().get(column.column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataOf(item.row),\n row: dataOf(item.row),\n node: item.row,\n index: item.index,\n column: column.column,\n value: cellValue(item.row, column.column),\n }\"\n />\n } @else if (isLoadingRow(item)) {\n <tx-skeleton class=\"tx-table__loading-cell\" height=\"14px\" />\n } @else if (cellTooltip()) {\n <span class=\"tx-table__cell-text\" tooltipOverflowOnly [txTooltip]=\"displayValue(item.row, column.column)\">{{ displayValue(item.row, column.column) }}</span>\n } @else {\n {{ displayValue(item.row, column.column) }}\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,oBAAoB;AAE1B,SAAgB,iBAAoB,OAAoC;CACtE,MAAM,SAA+B,CAAA;CACrC,MAAM,QAAQ,UACZ,MAAM,SAAS,SAAQ;EACrB,OAAO,KAAK,IAAI;EAChB,KAAK,KAAK,YAAY,CAAA,CAAE;CAC1B,CAAC;CACH,KAAK,KAAK;CACV,OAAO;AACT;AAEA,SAAgB,gBAAmB,OAAsC,SAAgD,OAA8B,WAAS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;GAAA;EAAA;EAAA,iBAAA,GAAA,wBAAA;CAAA,CAAA;;AAQV,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAW,YAAA,CAAA;EA9BvB,MAAA;EACW,MAAA,CAAA;GAAA,UAAA;GAAe,SAChB;IACP;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACD;GAAA,iBAGgB,wBAAwB;GAAM,WACpC,CAAC,qBAAqB;IAAE,SAAS;IAAU,aAAW;GAAa,CAAE;GAAC,MAC3E,EAAE,OAAO,gBAAe;GAAE,UAAA;GAAA,QAAA,CAAA,8onBAAA;EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"tectra-ng-ui-tree-table.mjs","names":[],"sources":["../../../../packages/ui/tree-table/src/tree-table.component.ts","../../../../packages/ui/table/src/table.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Signal, afterNextRender, booleanAttribute, computed, effect, input, linkedSignal, model, output, signal, untracked } from '@angular/core';\nimport { TxResolvedPassThrough, injectPassThrough } from '@tectra-ng/core/config';\nimport { CdkDrag, CdkDragHandle, CdkDropList } from '@angular/cdk/drag-drop';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { TxIcon } from '@tectra-ng/icons';\nimport { TxButton } from '@tectra-ng/ui/button';\nimport { TxCheckbox } from '@tectra-ng/ui/checkbox';\nimport { TxDatePicker } from '@tectra-ng/ui/datepicker';\nimport { TxInput } from '@tectra-ng/ui/input';\nimport { TxInputNumber } from '@tectra-ng/ui/input-number';\nimport { TxMenu, TxMenuItemTemplate } from '@tectra-ng/ui/menu';\nimport { TxPaginator } from '@tectra-ng/ui/paginator';\nimport { TxProgressSpinner } from '@tectra-ng/ui/progress-spinner';\nimport { TxRadioButton } from '@tectra-ng/ui/radio-button';\nimport { TxSelect } from '@tectra-ng/ui/select';\nimport { TxSkeleton } from '@tectra-ng/ui/skeleton';\nimport {\n TX_TABLE,\n TxTable,\n TxTableActionsStore,\n TxTableColumnFilter,\n TxTablePart,\n TxTableRenderRow,\n TxTableSettings,\n filterRows,\n resolveField,\n sortRows,\n} from '@tectra-ng/ui/table';\nimport { TxTooltip } from '@tectra-ng/ui/tooltip';\nimport { TxTreeTableFilterMode, TxTreeTableNode, TxTreeTableNodeEvent } from './tree-table.types';\n\nconst COLLAPSE_DURATION = 400;\n\nexport function flattenTreeTable<T>(nodes: readonly TxTreeTableNode<T>[]): TxTreeTableNode<T>[] {\n const result: TxTreeTableNode<T>[] = [];\n const walk = (items: readonly TxTreeTableNode<T>[]) =>\n items.forEach((node) => {\n result.push(node);\n walk(node.children ?? []);\n });\n walk(nodes);\n return result;\n}\n\nexport function filterTreeTable<T>(nodes: readonly TxTreeTableNode<T>[], matches: (node: TxTreeTableNode<T>) => boolean, mode: TxTreeTableFilterMode = 'lenient'): TxTreeTableNode<T>[] {\n const visit = (node: TxTreeTableNode<T>): TxTreeTableNode<T> | null => {\n const own = matches(node);\n const children = node.children ?? [];\n if (own && (mode === 'lenient' || !children.length)) return node;\n const kept = children.map(visit).filter((child): child is TxTreeTableNode<T> => child !== null);\n if (kept.length) return { ...node, children: kept };\n return own ? { ...node, children: [] } : null;\n };\n return nodes.map(visit).filter((node): node is TxTreeTableNode<T> => node !== null);\n}\n\n@Component({\n selector: 'tx-tree-table',\n imports: [\n NgTemplateOutlet,\n FormsModule,\n CdkDropList,\n CdkDrag,\n CdkDragHandle,\n TxIcon,\n TxTooltip,\n TxSkeleton,\n TxButton,\n TxCheckbox,\n TxInput,\n TxInputNumber,\n TxDatePicker,\n TxSelect,\n TxRadioButton,\n TxPaginator,\n TxProgressSpinner,\n TxMenu,\n TxMenuItemTemplate,\n TxTableSettings,\n TxTableColumnFilter,\n ],\n templateUrl: '../../table/src/table.component.html',\n styleUrl: '../../table/src/table.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TxTableActionsStore, { provide: TX_TABLE, useExisting: TxTreeTable }],\n host: { class: 'tx-tree-table' },\n})\nexport class TxTreeTable<T = unknown> extends TxTable<TxTreeTableNode<T>> {\n override readonly isTree = true;\n override readonly responsive = input<boolean, unknown>(false, { transform: booleanAttribute });\n readonly expandedKeys = model<unknown[]>([]);\n readonly filterMode = input<TxTreeTableFilterMode>('lenient');\n readonly propagateSelectionUp = input<boolean, unknown>(true, { transform: booleanAttribute });\n readonly propagateSelectionDown = input<boolean, unknown>(true, { transform: booleanAttribute });\n\n readonly nodeExpand = output<TxTreeTableNodeEvent<T>>();\n readonly nodeCollapse = output<TxTreeTableNodeEvent<T>>();\n\n override readonly passThrough: Signal<TxResolvedPassThrough<TxTablePart>> = injectPassThrough('treeTable', this, this.pt, this.ptOptions);\n\n private readonly seenKeys = new Set<unknown>();\n readonly pendingKeys = signal<ReadonlySet<unknown>>(new Set());\n readonly mountedKeys = signal<ReadonlySet<unknown>>(new Set());\n\n readonly allNodes = computed(() => flattenTreeTable(this.value() ?? []));\n readonly selectedIds = computed<ReadonlySet<unknown>>(() => {\n const selection = this.selection();\n if (!selection) return new Set();\n return new Set((Array.isArray(selection) ? selection : [selection]).map((node) => this.identityOf(node)));\n });\n private readonly matchedData = computed<ReadonlySet<unknown> | null>(() => {\n if (this.lazy()) return null;\n const data = this.allNodes().map((node) => node.data);\n const fields = this.globalFilterFields() ?? this.visibleColumns().map((column) => column.filterField ?? column.field);\n const matched = filterRows(data, this.filters(), this.columns(), this.globalFilter(), fields, this.localeService.locale().intl);\n return matched.length === data.length ? null : new Set(matched);\n });\n override readonly filteredRows = computed(() => {\n const roots = [...this.allRows()];\n const matched = this.matchedData();\n return matched ? filterTreeTable(roots, (node) => matched.has(node.data), this.filterMode()) : roots;\n });\n readonly filterOpen = linkedSignal<ReadonlySet<unknown>>(() => {\n if (!this.matchedData()) return new Set();\n return new Set(\n flattenTreeTable(this.filteredRows())\n .filter((node) => node.children?.length)\n .map((node) => this.identityOf(node)),\n );\n });\n readonly expandedSet = computed<ReadonlySet<unknown>>(() => (this.matchedData() ? this.filterOpen() : new Set(this.expandedKeys())));\n override readonly sortedRows = computed(() => {\n const roots = this.filteredRows();\n const meta = this.sortMeta();\n if (this.lazy() || this.customSort() || !meta.length) return [...roots];\n const dataMeta = meta.map((item) => ({ ...item, field: `data.${item.field}` }));\n const intl = this.localeService.locale().intl;\n const sort = (nodes: readonly TxTreeTableNode<T>[]): TxTreeTableNode<T>[] =>\n sortRows(nodes, dataMeta, intl).map((node) => (node.children?.length ? { ...node, children: sort(node.children) } : node));\n return sort(roots);\n });\n override readonly renderRows = computed<TxTableRenderRow<TxTreeTableNode<T>>[]>(() => {\n this.editVersion();\n const expanded = this.expandedSet();\n const mounted = this.animatedRows() ? this.mountedKeys() : new Set<unknown>();\n const pending = this.pendingKeys();\n const selected = this.selectedIds();\n const partialOn = this.treeCheckbox() && this.propagateSelectionUp();\n const rowSelectable = this.rowSelectable();\n const offset = this.paginator() && !this.lazy() && this.totalRecords() === undefined ? this.first() : 0;\n const rows: TxTableRenderRow<TxTreeTableNode<T>>[] = [];\n const walk = (nodes: readonly TxTreeTableNode<T>[], level: number, parentKey: unknown, hidden: boolean) =>\n nodes.forEach((node, position) => {\n const key = this.identityOf(node);\n const leaf = node.leaf === false ? false : !node.children?.length;\n const open = !leaf && expanded.has(key);\n const index = offset + rows.length;\n const isSelected = selected.has(key);\n rows.push({\n row: node,\n index,\n key,\n selected: isSelected,\n selectable: node.selectable !== false && (!rowSelectable || rowSelectable(node, index)),\n expanded: false,\n group: null,\n tree: {\n level,\n leaf,\n expanded: open,\n hidden,\n loading: !!node.loading || (pending.has(key) && node.children === undefined),\n partial: partialOn && !isSelected && this.hasSelectedDescendant(node, selected),\n setSize: nodes.length,\n posInSet: position + 1,\n parentKey,\n },\n });\n if ((open || mounted.has(key)) && node.children?.length) walk(node.children, level + 1, key, hidden || !open);\n });\n walk(this.pageRows(), 1, null, false);\n return rows;\n });\n override readonly allSelected = computed(() => {\n const own = this.selectAll();\n if (own !== undefined) return own;\n const nodes = this.allNodes().filter((node) => node.selectable !== false);\n const selected = this.selectedIds();\n return nodes.length > 0 && nodes.every((node) => selected.has(this.identityOf(node)));\n });\n override readonly someSelected = computed(() => {\n if (this.allSelected()) return false;\n const selected = this.selectedIds();\n return this.allNodes().some((node) => selected.has(this.identityOf(node)));\n });\n\n protected override treeRowKey = (item: TxTableRenderRow<TxTreeTableNode<T>>, position: number, event: KeyboardEvent): boolean => {\n const tree = item.tree;\n if (!tree) return false;\n const rows = this.renderRows();\n const shown = rows.map((row, index) => (row.tree?.hidden ? -1 : index)).filter((index) => index >= 0);\n const at = shown.indexOf(position);\n const step: Record<string, number> = { ArrowDown: shown[at + 1], ArrowUp: shown[at - 1], Home: shown[0], End: shown[shown.length - 1] };\n if (event.key in step) {\n event.preventDefault();\n const target = step[event.key];\n if (target !== undefined) this.focusRowAt(target);\n return true;\n }\n if (event.key === 'ArrowRight') {\n event.preventDefault();\n if (!tree.leaf && !tree.expanded) this.expandNode(item, event);\n else if (tree.expanded && shown[at + 1] !== undefined) this.focusRowAt(shown[at + 1]);\n return true;\n }\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n if (tree.expanded) this.collapseNode(item, event);\n else if (tree.parentKey !== null) {\n const parent = rows.findIndex((row) => row.key === tree.parentKey);\n if (parent >= 0) this.focusRowAt(parent);\n }\n return true;\n }\n return false;\n };\n\n constructor() {\n super();\n effect(() => {\n const fresh: unknown[] = [];\n this.allNodes().forEach((node) => {\n const key = this.identityOf(node);\n if (this.seenKeys.has(key)) return;\n this.seenKeys.add(key);\n if (node.expanded) fresh.push(key);\n });\n if (fresh.length) untracked(() => this.expandedKeys.update((keys) => [...keys, ...fresh.filter((key) => !keys.includes(key))]));\n });\n }\n\n override dataOf(row: TxTreeTableNode<T>): unknown {\n return row?.data;\n }\n\n override identityOf(row: TxTreeTableNode<T>): unknown {\n if (row?.key !== undefined) return row.key;\n const dataKey = this.dataKey();\n return dataKey ? resolveField(row?.data, dataKey) : row?.data;\n }\n\n override rowsFocusable(): boolean {\n return true;\n }\n\n override toggleNode(item: TxTableRenderRow<TxTreeTableNode<T>>, event: Event): void {\n event.stopPropagation();\n if (!item.tree || item.tree.leaf) return;\n if (item.tree.expanded) this.collapseNode(item, event);\n else this.expandNode(item, event);\n }\n\n expandNode(item: TxTableRenderRow<TxTreeTableNode<T>>, event?: Event): void {\n if (!item.tree || item.tree.leaf || item.tree.expanded) return;\n this.setOpen(item.key, true);\n if (item.row.leaf === false && item.row.children === undefined) this.pendingKeys.update((keys) => new Set([...keys, item.key]));\n this.nodeExpand.emit({ node: item.row, originalEvent: event });\n }\n\n collapseNode(item: TxTableRenderRow<TxTreeTableNode<T>>, event?: Event): void {\n if (!item.tree?.expanded) return;\n this.setOpen(item.key, false);\n this.nodeCollapse.emit({ node: item.row, originalEvent: event });\n }\n\n expandAll(): void {\n this.expandedKeys.set(\n this.allNodes()\n .filter((node) => node.children?.length)\n .map((node) => this.identityOf(node)),\n );\n }\n\n collapseAll(): void {\n this.expandedKeys.set([]);\n }\n\n override toggleRow(item: TxTableRenderRow<TxTreeTableNode<T>>, event?: Event): void {\n if (!this.treeCheckbox()) {\n super.toggleRow(item, event);\n return;\n }\n if (!item.selectable) return;\n const ids = new Set(this.selectedIds());\n const check = !item.selected;\n const affected = this.propagateSelectionDown() ? flattenTreeTable([item.row]).filter((node) => node.selectable !== false) : [item.row];\n affected.forEach((node) => (check ? ids.add(this.identityOf(node)) : ids.delete(this.identityOf(node))));\n if (this.propagateSelectionUp()) this.settle(this.value() ?? [], ids);\n this.selection.set(this.allNodes().filter((node) => ids.has(this.identityOf(node))));\n (check ? this.rowSelect : this.rowUnselect).emit({ row: item.row, index: item.index, originalEvent: event });\n }\n\n override toggleAll(checked: boolean): void {\n this.selectAllChange.emit(checked);\n if (this.selectAll() !== undefined) return;\n this.selection.set(checked ? this.allNodes().filter((node) => node.selectable !== false) : []);\n }\n\n protected override exportRows(): TxTreeTableNode<T>[] {\n return flattenTreeTable(this.sortedRows());\n }\n\n private setOpen(key: unknown, open: boolean): void {\n if (!this.animatedRows()) {\n this.writeOpen(key, open);\n return;\n }\n if (open) {\n if (this.mountedKeys().has(key)) {\n this.writeOpen(key, true);\n return;\n }\n this.mountedKeys.update((keys) => new Set([...keys, key]));\n afterNextRender(\n () => {\n this.host.nativeElement.getBoundingClientRect();\n this.writeOpen(key, true);\n },\n { injector: this.injector },\n );\n return;\n }\n this.mountedKeys.update((keys) => new Set([...keys, key]));\n this.writeOpen(key, false);\n setTimeout(() => {\n if (this.expandedSet().has(key)) return;\n this.mountedKeys.update((keys) => new Set([...keys].filter((other) => other !== key)));\n }, COLLAPSE_DURATION);\n }\n\n private writeOpen(key: unknown, open: boolean): void {\n if (this.matchedData()) {\n this.filterOpen.update((keys) => new Set(open ? [...keys, key] : [...keys].filter((other) => other !== key)));\n return;\n }\n this.expandedKeys.update((keys) => (open ? [...keys, key] : keys.filter((other) => other !== key)));\n }\n\n private settle(nodes: readonly TxTreeTableNode<T>[], ids: Set<unknown>): void {\n const visit = (node: TxTreeTableNode<T>): boolean => {\n const children = (node.children ?? []).filter((child) => child.selectable !== false);\n const key = this.identityOf(node);\n if (!children.length) return ids.has(key);\n const all = children.map(visit).every(Boolean);\n if (all) ids.add(key);\n else ids.delete(key);\n return all;\n };\n nodes.forEach(visit);\n }\n\n private hasSelectedDescendant(node: TxTreeTableNode<T>, selected: ReadonlySet<unknown>): boolean {\n return (node.children ?? []).some((child) => selected.has(this.identityOf(child)) || this.hasSelectedDescendant(child, selected));\n }\n}\n","@if (showToolbar()) {\n <div class=\"tx-table__toolbar\" [class]=\"passThrough().toolbar?.class\" [style]=\"passThrough().toolbar?.style\">\n <div class=\"tx-table__toolbar-slot\"><ng-content select=\"[txTableToolbar]\" /></div>\n @if (showSettings()) {\n <tx-table-settings\n [columns]=\"columns()\"\n [hidden]=\"hidden()\"\n [showColumns]=\"columnSettings()\"\n [showActions]=\"actionsSettings()\"\n [unstyled]=\"isUnstyled()\"\n (columnToggled)=\"toggleColumn($event.field, $event.visible)\"\n />\n }\n </div>\n}\n\n@if (showPaginatorTop()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'top' }\" />\n}\n\n<div class=\"tx-table__frame\" [class]=\"passThrough().frame?.class\" [style]=\"passThrough().frame?.style\" [attr.aria-busy]=\"loading() || null\">\n @if (cardView() && selectionMode() === 'checkbox' && !empty()) {\n <div class=\"tx-table__select-all\">\n <tx-checkbox\n binary\n [label]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n </div>\n }\n\n @if (loading()) {\n <div class=\"tx-table__loading\" [class]=\"passThrough().loading?.class\" [style]=\"passThrough().loading?.style\">\n <tx-progress-spinner [ariaLabel]=\"translations().loading\" [unstyled]=\"isUnstyled()\" />\n </div>\n }\n\n @if (!cardView()) {\n <div\n class=\"tx-table__scroller\"\n [class.tx-table__scroller--empty]=\"empty()\"\n [class]=\"passThrough().scroller?.class\"\n [style]=\"passThrough().scroller?.style\"\n [style.max-height]=\"scrollHeight()\"\n (scroll)=\"onScroll($event)\"\n >\n <table\n class=\"tx-table__table\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-multiselectable]=\"rowSelection() || treeCheckbox() ? selectionMode() !== 'single' : null\"\n [attr.role]=\"isTree ? 'treegrid' : rowSelection() ? 'grid' : null\"\n >\n <thead class=\"tx-table__thead\" [class]=\"passThrough().thead?.class\" [style]=\"passThrough().thead?.style\">\n <tr\n #headerRow\n cdkDropList\n cdkDropListOrientation=\"horizontal\"\n class=\"tx-table__header-row\"\n [class]=\"passThrough().headerRow?.class\"\n [style]=\"passThrough().headerRow?.style\"\n [cdkDropListDisabled]=\"!reorderableColumns()\"\n (cdkDropListDropped)=\"dropColumn($event)\"\n >\n @for (item of renderColumns(); track item.column.field; let last = $last) {\n <th\n cdkDrag\n cdkDragLockAxis=\"x\"\n cdkDragPreviewClass=\"tx-table__drag-preview\"\n [cdkDragBoundary]=\"headerRow\"\n scope=\"col\"\n class=\"tx-table__th\"\n [class]=\"[item.column.headerClass ?? '', passThrough().headerCell?.class ?? '']\"\n [style]=\"passThrough().headerCell?.style\"\n [style.width]=\"item.style['width']\"\n [style.min-width]=\"item.style['minWidth']\"\n [style.max-width]=\"item.style['maxWidth']\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n [class.tx-table__th--draggable]=\"reorderableColumns() && item.kind === 'data' && item.column.reorderable !== false\"\n [attr.data-field]=\"item.column.field\"\n [attr.data-align]=\"item.column.align ?? null\"\n [attr.aria-sort]=\"item.kind === 'data' ? ariaSort(item.column) : null\"\n [cdkDragDisabled]=\"!reorderableColumns() || item.kind !== 'data' || item.column.reorderable === false\"\n >\n @switch (item.kind) {\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n } @else {\n <span class=\"tx-table__sr-only\">{{ translations().selectRow }}</span>\n }\n }\n @case ('expand') {\n <span class=\"tx-table__sr-only\">{{ translations().expandRow }}</span>\n }\n @case ('actions') {\n <span class=\"tx-table__column-title\">{{ item.column.header }}</span>\n }\n @default {\n <div class=\"tx-table__header-content\">\n @if (treeCheckbox() && item.column.field === treeField()) {\n <tx-checkbox\n binary\n class=\"tx-table__select tx-table__tree-select-all\"\n [ariaLabel]=\"translations().selectAll\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"allSelected()\"\n [indeterminate]=\"someSelected()\"\n (ngModelChange)=\"toggleAll($event)\"\n />\n }\n @if (headerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else if (isSortable(item.column)) {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <button\n type=\"button\"\n class=\"tx-table__sort\"\n [class]=\"passThrough().sortButton?.class\"\n [style]=\"passThrough().sortButton?.style\"\n (click)=\"sort(item.column, $event)\"\n (keydown.alt.arrowleft)=\"moveColumnBy(item.column, -1, $event)\"\n (keydown.alt.arrowright)=\"moveColumnBy(item.column, 1, $event)\"\n >\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n @if (sortOrderOf(item.column); as order) {\n <tx-icon\n class=\"tx-table__sort-icon\"\n aria-hidden=\"true\"\n name=\"sort-amount-down\"\n [class.tx-table__sort-icon--desc]=\"order === 'desc'\"\n [class]=\"passThrough().sortIcon?.class\"\n [style]=\"passThrough().sortIcon?.style\"\n />\n @if (sortMode() === 'multiple' && sortMeta().length > 1) {\n <span class=\"tx-table__sort-badge\" aria-hidden=\"true\">{{ sortIndexOf(item.column) + 1 }}</span>\n }\n }\n </button>\n } @else {\n @if (reorderableColumns() && item.column.reorderable !== false) {\n <tx-icon class=\"tx-table__grip\" aria-hidden=\"true\" name=\"grip-vertical\" />\n }\n <span class=\"tx-table__column-title\">{{ label(item.column) }}</span>\n }\n @if (item.column.filter && filterDisplay() === 'menu') {\n <tx-table-column-filter class=\"tx-table__filter\" [column]=\"item.column\" />\n }\n </div>\n }\n }\n @if (resizableColumns() && item.kind === 'data' && item.column.resizable !== false && item.column.width === undefined && !last) {\n <span\n class=\"tx-table__resizer\"\n role=\"separator\"\n tabindex=\"0\"\n aria-orientation=\"vertical\"\n [class.tx-table__resizer--active]=\"resizing() === item.column.field\"\n [attr.aria-label]=\"translations().resizeColumn.replace('{column}', label(item.column))\"\n [attr.aria-valuenow]=\"resizeValue(item.column)\"\n [attr.aria-valuemin]=\"resizeMin(item.column)\"\n [attr.aria-valuemax]=\"resizeMax(item.column)\"\n (pointerdown)=\"startResize(item, $event)\"\n (click)=\"$event.stopPropagation()\"\n (keydown.arrowleft)=\"resizeByKey(item, -10, $event)\"\n (keydown.arrowright)=\"resizeByKey(item, 10, $event)\"\n >\n <span class=\"tx-table__resizer-line\"></span>\n </span>\n }\n </th>\n }\n </tr>\n @if (filterRow()) {\n <tr class=\"tx-table__filter-row\">\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__th tx-table__filter-cell\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [class.tx-table__cell--frozen-last]=\"item.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"item.firstFrozenEnd\"\n >\n @if (item.kind === 'data' && item.column.filter) {\n <tx-table-column-filter display=\"row\" [column]=\"item.column\" />\n }\n </td>\n }\n </tr>\n }\n </thead>\n @if (frozenRows().length) {\n <tbody class=\"tx-table__frozen-tbody\" [style.top.px]=\"headerHeight()\">\n @for (item of frozenRows(); track item.key; let position = $index) {\n <tr class=\"tx-table__row tx-table__row--frozen\">\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n }\n </tbody>\n }\n <tbody\n #tbody\n cdkDropList\n class=\"tx-table__tbody\"\n [class]=\"passThrough().tbody?.class\"\n [style]=\"passThrough().tbody?.style\"\n [cdkDropListDisabled]=\"!reorderableRows()\"\n (cdkDropListDropped)=\"dropRow($event)\"\n >\n @if (spacerBefore()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerBefore()\"></td>\n </tr>\n }\n @for (item of visibleRows(); track item.key; let windowIndex = $index) {\n @let position = windowRange().start + windowIndex;\n @let odd = position % 2 === 1;\n @if (item.group?.first && rowGroupMode() === 'subheader') {\n <tr class=\"tx-table__group-header\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div class=\"tx-table__group-content\">\n @if (expandableRowGroups()) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"!item.group.collapsed\"\n [attr.aria-label]=\"item.group.collapsed ? translations().expandRow : translations().collapseRow\"\n (click)=\"toggleGroup(item)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"!item.group.collapsed\" />\n </button>\n }\n @if (groupHeaderTemplate(); as header) {\n <ng-container [ngTemplateOutlet]=\"header.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n } @else {\n <span class=\"tx-table__group-title\">{{ item.group.value }}</span>\n <span class=\"tx-table__group-count\">{{ translations().rowGroup.replace('{count}', '' + item.group.size) }}</span>\n }\n </div>\n </td>\n </tr>\n }\n @if (!item.group?.collapsed || animatedGroups()) {\n <tr\n cdkDrag\n cdkDragLockAxis=\"y\"\n cdkDragPreviewContainer=\"parent\"\n class=\"tx-table__row\"\n [class]=\"[rowClassOf(item) ?? '', passThrough().row?.class ?? '']\"\n [style]=\"passThrough().row?.style\"\n [class.tx-table__row--odd]=\"odd\"\n [class.tx-table__row--selected]=\"item.selected\"\n [class.tx-table__row--selectable]=\"rowSelection() && item.selectable\"\n [class.tx-table__row--menu]=\"menuRowKey() === item.key && menuRowKey() !== undefined\"\n [attr.aria-selected]=\"rowSelection() ? item.selected : null\"\n [attr.aria-level]=\"item.tree?.level ?? null\"\n [attr.aria-expanded]=\"item.tree && !item.tree.leaf ? item.tree.expanded : null\"\n [attr.aria-setsize]=\"item.tree?.setSize ?? null\"\n [attr.aria-posinset]=\"item.tree?.posInSet ?? null\"\n [attr.aria-busy]=\"item.tree?.loading || null\"\n [attr.tabindex]=\"rowsFocusable() ? (position === focusedRow() ? 0 : -1) : null\"\n [attr.data-key]=\"item.key\"\n [class.tx-table__row--editing]=\"isRowEditing(item)\"\n [class.tx-table__row--collapsed]=\"isCollapsedRow(item)\"\n [attr.inert]=\"isCollapsedRow(item) ? '' : null\"\n [attr.aria-hidden]=\"isCollapsedRow(item) ? true : null\"\n (click)=\"onRowClick(item, position, $event)\"\n (keydown)=\"onRowKeydown(item, position, $event)\"\n (contextmenu)=\"onRowContextMenu(item, $event)\"\n >\n <ng-container [ngTemplateOutlet]=\"rowCells\" [ngTemplateOutletContext]=\"{ $implicit: item, position }\" />\n </tr>\n @if ((item.expanded || isClosing(item.key)) && !item.group?.collapsed && expansionTemplate(); as expansion) {\n <tr class=\"tx-table__expansion\">\n <td class=\"tx-table__expansion-cell\" [attr.colspan]=\"dataColumnCount()\">\n <div\n class=\"tx-table__expansion-body\"\n [class.tx-table__expansion-body--open]=\"item.expanded\"\n (transitionend)=\"finishClosing(item.key, $event)\"\n >\n <div class=\"tx-table__expansion-inner\">\n <div class=\"tx-table__expansion-content\">\n <ng-container [ngTemplateOutlet]=\"expansion.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n </div>\n </div>\n </td>\n </tr>\n }\n @if (item.group?.last && rowGroupMode() === 'subheader' && groupFooterTemplate(); as footer) {\n <tr class=\"tx-table__group-footer\">\n <td class=\"tx-table__group-cell\" [attr.colspan]=\"dataColumnCount()\">\n <ng-container [ngTemplateOutlet]=\"footer.templateRef\" [ngTemplateOutletContext]=\"groupContext(item)\" />\n </td>\n </tr>\n }\n }\n }\n @if (spacerAfter()) {\n <tr class=\"tx-table__spacer\" aria-hidden=\"true\">\n <td [attr.colspan]=\"dataColumnCount()\" [style.height.px]=\"spacerAfter()\"></td>\n </tr>\n }\n </tbody>\n @if (hasFooter()) {\n <tfoot class=\"tx-table__tfoot\" [class]=\"passThrough().tfoot?.class\" [style]=\"passThrough().tfoot?.style\">\n <tr>\n @for (item of renderColumns(); track item.column.field) {\n <td\n class=\"tx-table__footer-cell\"\n [class]=\"passThrough().footerCell?.class\"\n [style]=\"passThrough().footerCell?.style\"\n [style.inset-inline-start]=\"frozenStyle(item)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(item)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!item.frozen\"\n [attr.data-align]=\"item.column.align ?? null\"\n >\n @if (footerTemplatesByField().get(item.column.field); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: item.column }\" />\n } @else {\n {{ item.column.footer }}\n }\n </td>\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n } @else if (!empty()) {\n <div class=\"tx-table__cards\" role=\"list\" [class]=\"passThrough().cards?.class\" [style]=\"passThrough().cards?.style\" [attr.aria-label]=\"ariaLabel() ?? null\">\n @for (item of renderRows(); track item.key) {\n <div\n role=\"listitem\"\n class=\"tx-table__card\"\n [class]=\"passThrough().card?.class\"\n [style]=\"passThrough().card?.style\"\n [class.tx-table__card--selected]=\"item.selected\"\n [class.tx-table__card--custom]=\"!!cardTemplate()\"\n >\n @if (cardTemplate(); as card) {\n <ng-container [ngTemplateOutlet]=\"card.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n } @else {\n @if (hasSelectColumn()) {\n <div class=\"tx-table__card-select\">\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n </div>\n }\n @if (cardTitleColumn(); as title) {\n <div class=\"tx-table__card-title\" [class.tx-table__card-title--select]=\"hasSelectColumn()\">\n <ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column: title }\" />\n </div>\n }\n @for (column of cardFields(); track column.field) {\n <div class=\"tx-table__card-field\">\n <span class=\"tx-table__card-label\">{{ label(column) }}</span>\n <span class=\"tx-table__card-value\"><ng-container [ngTemplateOutlet]=\"cellContent\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" /></span>\n </div>\n }\n @if (actionsTemplate(); as actions) {\n <div class=\"tx-table__card-actions\">\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (empty()) {\n <div class=\"tx-table__empty\" [class]=\"passThrough().empty?.class\" [style]=\"passThrough().empty?.style\">\n @if (emptyTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataColumnCount() }\" />\n } @else {\n {{ emptyMessage() ?? translations().emptyMessage }}\n }\n </div>\n }\n</div>\n\n@if (showPaginatorBottom()) {\n <ng-container [ngTemplateOutlet]=\"pager\" [ngTemplateOutletContext]=\"{ $implicit: 'bottom' }\" />\n}\n\n<ng-content />\n\n<tx-tiered-menu\n #rowMenu\n popup\n variant=\"context\"\n placement=\"bottom-start\"\n [offset]=\"0\"\n [model]=\"menuItems()\"\n [ariaLabel]=\"translations().rowActions\"\n [unstyled]=\"isUnstyled()\"\n (closed)=\"onMenuClosed()\"\n>\n <ng-template txMenuItem let-menuItem>\n @if (actionTemplate(menuItem); as action) {\n <span class=\"tx-table__menu-action\" aria-hidden=\"true\" [attr.data-action-id]=\"action.id()\">\n <ng-container [ngTemplateOutlet]=\"action.templateRef\" />\n </span>\n } @else if (menuItem.icon) {\n <tx-icon class=\"tx-table__menu-icon\" aria-hidden=\"true\" [name]=\"menuItem.icon\" />\n }\n <span class=\"tx-table__menu-label\">{{ menuItem.label }}</span>\n </ng-template>\n</tx-tiered-menu>\n\n<ng-template #cellContent let-item let-column=\"column\">\n @if (templatesByField().get(column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), row: dataOf(item.row), node: item.row, index: item.index, column, value: cellValue(item.row, column) }\"\n />\n } @else {\n {{ displayValue(item.row, column) }}\n }\n</ng-template>\n\n<ng-template #pager let-position>\n <tx-paginator\n class=\"tx-table__paginator\"\n [class.tx-table__paginator--top]=\"position === 'top'\"\n [class]=\"passThrough().paginator?.class\"\n [style]=\"passThrough().paginator?.style\"\n [first]=\"first()\"\n [rows]=\"rows()\"\n [totalRecords]=\"total()\"\n [rowsPerPageOptions]=\"rowsPerPageOptions()\"\n [showTotal]=\"showTotal()\"\n [showCurrentPageReport]=\"showCurrentPageReport()\"\n [currentPageReportTemplate]=\"currentPageReportTemplate()\"\n [showFirstLastIcon]=\"showFirstLastIcon()\"\n [showPageLinks]=\"showPageLinks()\"\n [showJumpToPageDropdown]=\"showJumpToPageDropdown()\"\n [showJumpToPageInput]=\"showJumpToPageInput()\"\n [alwaysShow]=\"alwaysShowPaginator()\"\n [pageLinkSize]=\"pageLinks()\"\n [unstyled]=\"isUnstyled()\"\n (pageChange)=\"onPage($event)\"\n />\n</ng-template>\n\n<ng-template #rowCells let-item let-position=\"position\">\n @for (column of renderColumns(); track column.column.field) {\n @if (!isGroupedCellHidden(item, column)) {\n <td\n class=\"tx-table__td\"\n [class]=\"[column.column.cellClass ?? '', passThrough().cell?.class ?? '']\"\n [style]=\"passThrough().cell?.style\"\n [style.inset-inline-start]=\"frozenStyle(column)['insetInlineStart']\"\n [style.inset-inline-end]=\"frozenStyle(column)['insetInlineEnd']\"\n [class.tx-table__cell--frozen]=\"!!column.frozen\"\n [class.tx-table__cell--frozen-last]=\"column.lastFrozenStart\"\n [class.tx-table__cell--frozen-first-end]=\"column.firstFrozenEnd\"\n [class.tx-table__td--actions]=\"column.kind === 'actions'\"\n [class.tx-table__td--editable]=\"column.kind === 'data' && editMode() === 'cell' && !!column.column.editable\"\n [class.tx-table__td--editing]=\"column.kind === 'data' && isEditing(item, column.column)\"\n [attr.data-field]=\"column.column.field\"\n [attr.data-align]=\"column.column.align ?? null\"\n [attr.rowspan]=\"groupRowspan(item, column)\"\n [attr.tabindex]=\"column.kind === 'data' && editMode() === 'cell' && column.column.editable ? 0 : null\"\n (click)=\"onCellClick(item, column, $event)\"\n (keydown)=\"onCellKeydown(item, column, $event)\"\n (focusout)=\"onCellFocusOut(item, column, $event)\"\n >\n @if (animatedRows()) {\n <div class=\"tx-table__cell-body\">\n <div class=\"tx-table__cell-inner\">\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"cellBody\" [ngTemplateOutletContext]=\"{ $implicit: item, column, position }\" />\n }\n </td>\n }\n }\n</ng-template>\n\n<ng-template #cellBody let-item let-column=\"column\" let-position=\"position\">\n @switch (column.kind) {\n @case ('reorder') {\n <button\n type=\"button\"\n cdkDragHandle\n class=\"tx-table__row-handle\"\n [attr.aria-label]=\"translations().moveRow\"\n (keydown.alt.arrowup)=\"moveRowBy(position, -1, $event)\"\n (keydown.alt.arrowdown)=\"moveRowBy(position, 1, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"bars\" />\n </button>\n }\n @case ('select') {\n @if (selectionMode() === 'checkbox') {\n <tx-checkbox\n binary\n class=\"tx-table__select\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n } @else {\n <tx-radio-button\n class=\"tx-table__select\"\n [value]=\"item.key\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"radioValue()\"\n (ngModelChange)=\"selectRadio(item)\"\n />\n }\n }\n @case ('expand') {\n @if (canExpand(item)) {\n <button\n type=\"button\"\n class=\"tx-table__row-toggle\"\n [attr.aria-expanded]=\"item.expanded\"\n [attr.aria-label]=\"item.expanded ? translations().collapseRow : translations().expandRow\"\n (click)=\"toggleExpansion(item, $event)\"\n >\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.expanded\" />\n </button>\n }\n }\n @case ('actions') {\n @if (actionsTemplate(); as actions) {\n <ng-container [ngTemplateOutlet]=\"actions.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: dataOf(item.row), node: item.row, index: item.index }\" />\n }\n }\n @case ('editor') {\n <div class=\"tx-table__row-editor\">\n @if (isRowEditing(item)) {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"success\"\n icon=\"check\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().saveRow\"\n (click)=\"saveRow(item)\"\n ></button>\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"danger\"\n icon=\"times\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().cancelEdit\"\n (click)=\"cancelRow(item)\"\n ></button>\n } @else {\n <button\n txButton\n type=\"button\"\n text\n rounded\n size=\"small\"\n severity=\"secondary\"\n icon=\"pencil\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"translations().editRow\"\n (click)=\"startRowEdit(item)\"\n ></button>\n }\n </div>\n }\n @default {\n @if (item.tree && column.column.field === treeField()) {\n <div class=\"tx-table__tree-cell\" [style.--tx-table-tree-level]=\"item.tree.level - 1\">\n <button\n type=\"button\"\n class=\"tx-table__row-toggle tx-table__tree-toggle\"\n [class.tx-table__tree-toggle--hidden]=\"item.tree.leaf\"\n [attr.tabindex]=\"item.tree.leaf ? -1 : null\"\n [attr.aria-hidden]=\"item.tree.leaf || null\"\n [attr.aria-expanded]=\"item.tree.leaf ? null : item.tree.expanded\"\n [attr.aria-label]=\"item.tree.expanded ? translations().collapseRow : translations().expandRow\"\n [class]=\"passThrough().treeToggle?.class\"\n [style]=\"passThrough().treeToggle?.style\"\n (click)=\"toggleNode(item, $event)\"\n >\n @if (item.tree.loading) {\n <tx-icon aria-hidden=\"true\" name=\"spinner\" class=\"tx-table__tree-toggle-icon--loading\" />\n } @else {\n <tx-icon aria-hidden=\"true\" name=\"chevron-right\" class=\"tx-table__row-toggle-icon\" [class.tx-table__row-toggle-icon--open]=\"item.tree.expanded\" />\n }\n </button>\n @if (treeCheckbox()) {\n <tx-checkbox\n binary\n class=\"tx-table__tree-checkbox\"\n [ariaLabel]=\"translations().selectRow\"\n [disabled]=\"!item.selectable\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"item.selected\"\n [indeterminate]=\"item.tree.partial\"\n (ngModelChange)=\"toggleRow(item)\"\n />\n }\n <div class=\"tx-table__tree-content\">\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n </div>\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"dataCell\" [ngTemplateOutletContext]=\"{ $implicit: item, column }\" />\n }\n }\n }\n</ng-template>\n\n<ng-template #dataCell let-item let-column=\"column\">\n @if (isEditing(item, column.column)) {\n <div class=\"tx-table__editor\">\n @if (editorTemplatesByField().get(column.column.field); as editor) {\n <ng-container [ngTemplateOutlet]=\"editor.templateRef\" [ngTemplateOutletContext]=\"editorContext(item, column.column)\" />\n } @else if (column.column.editOptions?.length) {\n <tx-select\n size=\"small\"\n optionLabel=\"label\"\n optionValue=\"value\"\n class=\"tx-table__editor-control\"\n [options]=\"column.column.editOptions\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n } @else {\n @switch (column.column.editType ?? 'text') {\n @case ('numeric') {\n <tx-input-number\n size=\"small\"\n class=\"tx-table__editor-control\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('boolean') {\n <tx-checkbox\n binary\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"draftValue(item, column.column)\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @case ('date') {\n <tx-datepicker\n size=\"small\"\n class=\"tx-table__editor-control\"\n [ariaLabel]=\"label(column.column)\"\n [unstyled]=\"isUnstyled()\"\n [ngModel]=\"dateDraft(draftValue(item, column.column))\"\n (ngModelChange)=\"setDraft(item, column.column, $event)\"\n />\n }\n @default {\n <input\n txInput\n type=\"text\"\n size=\"small\"\n class=\"tx-table__editor-control\"\n [unstyled]=\"isUnstyled()\"\n [attr.aria-label]=\"label(column.column)\"\n [value]=\"draftValue(item, column.column) ?? ''\"\n (input)=\"setDraft(item, column.column, $any($event.target).value)\"\n />\n }\n }\n }\n </div>\n } @else if (templatesByField().get(column.column.field); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{\n $implicit: dataOf(item.row),\n row: dataOf(item.row),\n node: item.row,\n index: item.index,\n column: column.column,\n value: cellValue(item.row, column.column),\n }\"\n />\n } @else if (isLoadingRow(item)) {\n <tx-skeleton class=\"tx-table__loading-cell\" height=\"14px\" />\n } @else if (cellTooltip()) {\n <span class=\"tx-table__cell-text\" tooltipOverflowOnly [txTooltip]=\"displayValue(item.row, column.column)\">{{ displayValue(item.row, column.column) }}</span>\n } @else {\n {{ displayValue(item.row, column.column) }}\n }\n</ng-template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,oBAAoB;AAE1B,SAAgB,iBAAoB,OAAoC;CACtE,MAAM,SAA+B,CAAA;CACrC,MAAM,QAAQ,UACZ,MAAM,SAAS,SAAQ;EACrB,OAAO,KAAK,IAAI;EAChB,KAAK,KAAK,YAAY,CAAA,CAAE;CAC1B,CAAC;CACH,KAAK,KAAK;CACV,OAAO;AACT;AAEA,SAAgB,gBAAmB,OAAsC,SAAgD,OAA8B,WAAS;CAC9J,MAAM,SAAS,SAAuD;EACpE,MAAM,MAAM,QAAQ,IAAI;EACxB,MAAM,WAAW,KAAK,YAAY,CAAA;EAClC,IAAI,QAAQ,SAAS,aAAa,CAAC,SAAS,SAAS,OAAO;EAC5D,MAAM,OAAO,SAAS,IAAI,KAAK,CAAC,CAAC,QAAQ,UAAuC,UAAU,IAAI;EAC9F,IAAI,KAAK,QAAQ,OAAO;GAAE,GAAG;GAAM,UAAU;EAAI;EACjD,OAAO,MAAM;GAAE,GAAG;GAAM,UAAU,CAAA;EAAE,IAAK;CAC3C;CACA,OAAO,MAAM,IAAI,KAAK,CAAC,CAAC,QAAQ,SAAqC,SAAS,IAAI;AACpF;AAiCA,IAAa,cAAb,MAAa,oBAAiC,QAA2B;CACrD,SAAS;CACT,aAAa,MAAwB,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,aAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAClF,eAAe,MAAiB,CAAA,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CACnC,aAAa,MAA6B,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,aAAA,CAAA,+BAAA,CAAA,CAAA;CACpD,uBAAuB,MAAwB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;GACD;GAAA,iBAGgB,wBAAwB;GAAM,WACpC,CAAC,qBAAqB;IAAE,SAAS;IAAU,aAAW;GAAa,CAAE;GAAC,MAC3E,EAAE,OAAO,gBAAe;GAAE,UAAA;GAAA,QAAA,CAAA,8onBAAA;EAAA,CAAA"}
|
package/field/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Field
|
|
2
2
|
|
|
3
|
-
A form row: label, control, hint and error in one element. It finds the control inside (input, textarea, select, `tx-select`, checkbox, switch, slider…), gives it an id when it has none, points the label at it and adds the hint and the error to its `aria-describedby`. A group (`tx-radio-group`, `tx-checkbox-group`, any `role="radiogroup"` / `role="group"`) or a custom control that is not a native field (`role="slider"`, e.g. `tx-rating`) is named by the label through `aria-labelledby` instead. The error comes from the projected `formControl` / `formControlName` / `ngModel`, or from `control`; `errorText` shows an error from outside the form and turns the control red.
|
|
3
|
+
A form row: label, control, hint and error in one element. It finds the control inside (input, textarea, select, `tx-select`, checkbox, switch, slider…), gives it an id when it has none, points the label at it and adds the hint and the error to its `aria-describedby`. A group (`tx-radio-group`, `tx-checkbox-group`, any `role="radiogroup"` / `role="group"`) or a custom control that is not a native field (`role="slider"`, e.g. `tx-rating`, or an element marked `data-tx-field-control`, e.g. the `tx-file-upload` drop zone) is named by the label through `aria-labelledby` instead. The error comes from the projected `formControl` / `formControlName` / `ngModel`, or from `control`; `errorText` shows an error from outside the form and turns the control red.
|
|
4
4
|
|
|
5
5
|
```html
|
|
6
6
|
<tx-field label="Email" required hint="We never share it">
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# File upload
|
|
2
|
+
|
|
3
|
+
Pick files by dropping them on a zone or browsing for them. The component checks the type, size and count, previews images, shows every file with its size and status, and uploads them — to a `url`, or through your own code with progress. One file replaces the zone with a card; many files collect in a list below it. `mode="basic"` is a single button for places like a profile photo.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-file-upload accept=".csv" [maxFileSize]="10 * 1024 * 1024" description="CSV, up to 10 MB" [(file)]="importFile" />
|
|
7
|
+
|
|
8
|
+
<tx-file-upload multiple accept="image/*" [fileLimit]="5" url="/api/photos" (uploaded)="refresh()" />
|
|
9
|
+
|
|
10
|
+
<tx-file-upload multiple [customUpload]="true" (uploadHandler)="send($event)" />
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
With `customUpload`, `uploadHandler` gives you the files and three callbacks: `progress(value, file?)`, `complete(file?)` and `fail(message?, file?)` — leave out `file` to update all of them. With `url` the files go as one `FormData` request (`HttpClient` when the app provides it, so interceptors apply; `XMLHttpRequest` otherwise).
|
|
14
|
+
|
|
15
|
+
The value of a form control is the `File` (or `null`), or the `File[]` with `multiple`.
|
|
16
|
+
|
|
17
|
+
## Inputs
|
|
18
|
+
| Name | Description |
|
|
19
|
+
|---|---|
|
|
20
|
+
| mode | `advanced` (drop zone, list) or `basic` (a button) |
|
|
21
|
+
| files | Two-way: the picked files that are not uploaded yet |
|
|
22
|
+
| file | Two-way: the picked file without `multiple` |
|
|
23
|
+
| multiple | Many files; new picks are added to the list |
|
|
24
|
+
| accept | Allowed types, checked on pick and drop: extensions (`.csv`), MIME types (`application/pdf`) and wildcards (`image/*`) |
|
|
25
|
+
| maxFileSize | Largest file in bytes |
|
|
26
|
+
| fileLimit | Most files with `multiple`, uploaded ones included |
|
|
27
|
+
| disabled | Turns the control off |
|
|
28
|
+
| invalid | Red outline; follows the form control by default |
|
|
29
|
+
| auto | Uploads right after the files are picked |
|
|
30
|
+
| url | Address to upload to |
|
|
31
|
+
| name | Field name of the files in the `FormData` |
|
|
32
|
+
| method | `post` or `put` |
|
|
33
|
+
| headers | Request headers, `HttpHeaders` or a plain object |
|
|
34
|
+
| withCredentials | Sends cookies with the request |
|
|
35
|
+
| customUpload | Hands the files to `uploadHandler` instead of sending them |
|
|
36
|
+
| description | Hint under the prompt, e.g. the types and the size limit |
|
|
37
|
+
| chooseLabel | Text of the browse link and the basic button |
|
|
38
|
+
| uploadLabel | Text of the Upload button |
|
|
39
|
+
| cancelLabel | Text of the Clear button |
|
|
40
|
+
| chooseIcon | Icon of the basic button |
|
|
41
|
+
| uploadIcon | Icon of the Upload button |
|
|
42
|
+
| cancelIcon | Icon of the Clear button and of the remove buttons in the list |
|
|
43
|
+
| showUploadButton | Shows the Upload button when there is a `url` or `customUpload` and no `auto` |
|
|
44
|
+
| showCancelButton | Shows the Clear button next to it |
|
|
45
|
+
| showMessages | Shows the reasons for rejected files under the zone; turn it off to show them yourself from `rejected` |
|
|
46
|
+
| invalidFileTypeMessage | Own text for a wrong type: `{name}`, `{types}` |
|
|
47
|
+
| invalidFileSizeMessage | Own text for a big file: `{name}`, `{size}` |
|
|
48
|
+
| invalidFileLimitMessage | Own text for too many files: `{limit}` |
|
|
49
|
+
| ariaLabel | Accessible name of the drop zone instead of its prompt |
|
|
50
|
+
| dt | Design tokens of this instance (`fileUpload`) |
|
|
51
|
+
| pt | Classes and styles of the parts: `root`, `dropzone`, `icon`, `prompt`, `hint`, `list`, `file`, `thumbnail`, `fileName`, `fileMeta`, `progress`, `message`, `footer`, `basic` |
|
|
52
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
53
|
+
| unstyled | Removes the tectra styles |
|
|
54
|
+
|
|
55
|
+
`choose()` opens the file dialog, `upload()` sends the waiting files, `clear()` removes them (and stops a running request); `entries()` and `uploadedEntries()` read the files with their status and progress, `uploading()` tells whether a request runs.
|
|
56
|
+
|
|
57
|
+
## Outputs
|
|
58
|
+
| Name | Description |
|
|
59
|
+
|---|---|
|
|
60
|
+
| filesChange | The picked files changed |
|
|
61
|
+
| fileChange | The picked file changed (without `multiple`) |
|
|
62
|
+
| selected | Files were added: `{ originalEvent, files, currentFiles }` |
|
|
63
|
+
| rejected | Files were not added: `[{ file, reason: 'type' \| 'size' \| 'limit', message }]` |
|
|
64
|
+
| removed | A waiting file was removed: `{ originalEvent, file }` |
|
|
65
|
+
| cleared | Clear removed the waiting files |
|
|
66
|
+
| beforeUpload | The `FormData` before the files are added; append more fields here |
|
|
67
|
+
| uploadProgress | `{ progress }` in percent |
|
|
68
|
+
| uploaded | Files were uploaded: `{ originalEvent, files }` |
|
|
69
|
+
| uploadFailed | The upload failed: `{ files, error }` |
|
|
70
|
+
| uploadHandler | `customUpload`: `{ files, progress, complete, fail }` |
|
|
71
|
+
| uploadedFileRemoved | An uploaded file was removed from the list: `{ file, files }` |
|
|
72
|
+
|
|
73
|
+
## Slots
|
|
74
|
+
| Name | Description |
|
|
75
|
+
|---|---|
|
|
76
|
+
| txFileUploadFile | `<ng-template txFileUploadFile let-entry let-remove="remove">` — own file row (`entry.file`, `status`, `progress`, `preview`, `kind`) |
|
|
77
|
+
| txFileUploadDropzone | `<ng-template txFileUploadDropzone let-dragging let-choose="choose">` — own content of the empty drop zone |
|
|
78
|
+
| txFileUploadActions | Content at the start of the footer, next to Clear and Upload |
|
|
79
|
+
|
|
80
|
+
## Keyboard
|
|
81
|
+
| Key | Action |
|
|
82
|
+
|---|---|
|
|
83
|
+
| Tab | Moves to the drop zone, then to the buttons of the files |
|
|
84
|
+
| Enter / Space | On the drop zone: opens the file dialog |
|
|
85
|
+
| Enter / Space | On a button: replaces, removes, retries or uploads |
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Galleria
|
|
2
|
+
|
|
3
|
+
A gallery of images: the active one large, with thumbnails, indicators, a caption, previous and next buttons and a slideshow. It also opens full screen over the page.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-galleria [value]="photos" [numVisible]="5" showItemNavigators />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Items with `src` (`TxGalleriaImage`: `src`, `thumbnailSrc`, `alt`, `title`, `description`, `width`, `height`) render without templates; `width` and `height` keep the space of an image that is still loading. Any other items need `txGalleriaItem` and `txGalleriaThumbnail`.
|
|
10
|
+
|
|
11
|
+
## Inputs
|
|
12
|
+
| Name | Description |
|
|
13
|
+
|---|---|
|
|
14
|
+
| value | Items of the gallery |
|
|
15
|
+
| activeIndex | Index of the active item; two-way with `[(activeIndex)]` |
|
|
16
|
+
| fullScreen | Shows the gallery in a full-screen layer while `visible` is true instead of in the page |
|
|
17
|
+
| visible | Whether the full-screen gallery is open; two-way with `[(visible)]` |
|
|
18
|
+
| numVisible | Number of thumbnails shown at once |
|
|
19
|
+
| responsiveOptions | `numVisible` per `breakpoint` (max width of the window) |
|
|
20
|
+
| showItemNavigators | Shows previous and next buttons over the item |
|
|
21
|
+
| showItemNavigatorsOnHover | Shows those buttons only while the pointer or focus is on the item |
|
|
22
|
+
| showThumbnails | Shows the thumbnails |
|
|
23
|
+
| showThumbnailNavigators | Shows previous and next buttons beside the thumbnails |
|
|
24
|
+
| thumbnailsPosition | `bottom`, `top`, `left` or `right` |
|
|
25
|
+
| verticalThumbnailViewPortHeight | Height of the thumbnails on the left or right |
|
|
26
|
+
| showIndicators | Shows a dot per item |
|
|
27
|
+
| showIndicatorsOnItem | Puts the dots over the item |
|
|
28
|
+
| indicatorsPosition | `bottom`, `top`, `left` or `right` |
|
|
29
|
+
| changeItemOnIndicatorHover | Shows the item of a dot when the pointer moves over it |
|
|
30
|
+
| circular | The last item goes on to the first and back |
|
|
31
|
+
| autoPlay | Starts a slideshow; it pauses on hover and focus |
|
|
32
|
+
| transitionInterval | Milliseconds between slideshow steps |
|
|
33
|
+
| shouldStopAutoplayByClick | Stops the slideshow when the user moves to another item |
|
|
34
|
+
| swipe | Moves between items with a swipe or a mouse drag |
|
|
35
|
+
| effect | How one item replaces another: `slide` (default), `fade`, `zoom`, `blur`, `flip` or `none`; the old and the new item move together |
|
|
36
|
+
| prevIcon | Icon of the previous buttons |
|
|
37
|
+
| nextIcon | Icon of the next buttons |
|
|
38
|
+
| closeIcon | Icon of the full-screen close button |
|
|
39
|
+
| ariaLabel | Accessible name of the gallery |
|
|
40
|
+
| dt | Design tokens of this instance (`galleria`) |
|
|
41
|
+
| pt | Classes and styles of the parts: `root`, `mask`, `closeButton`, `header`, `content`, `items`, `item`, `navigator`, `caption`, `indicators`, `indicator`, `thumbnails`, `thumbnailNavigator`, `thumbnail`, `footer` |
|
|
42
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
43
|
+
| unstyled | Removes the tectra styles |
|
|
44
|
+
|
|
45
|
+
## Slots
|
|
46
|
+
| Name | Description |
|
|
47
|
+
|---|---|
|
|
48
|
+
| txGalleriaItem | `<ng-template txGalleriaItem let-item let-index="index">` — the active item |
|
|
49
|
+
| txGalleriaThumbnail | `<ng-template txGalleriaThumbnail let-item let-index="index" let-active="active">` — one thumbnail; its content names the thumbnail button, so give an image an `alt` |
|
|
50
|
+
| txGalleriaCaption | `<ng-template txGalleriaCaption let-item let-index="index">` — caption over the item; `title` and `description` of an image by default |
|
|
51
|
+
| txGalleriaIndicator | `<ng-template txGalleriaIndicator let-index let-active="active">` — content of a dot |
|
|
52
|
+
| txGalleriaHeader | Content above the gallery |
|
|
53
|
+
| txGalleriaFooter | Content below the gallery |
|
|
54
|
+
|
|
55
|
+
## Keyboard
|
|
56
|
+
| Key | Action |
|
|
57
|
+
|---|---|
|
|
58
|
+
| Tab / Shift + Tab | Moves between the item, its buttons, the current dot and the current thumbnail |
|
|
59
|
+
| Arrow left / Arrow right | On the item: shows the previous or next item |
|
|
60
|
+
| Arrow keys | On the thumbnails or dots: selects the previous or next item |
|
|
61
|
+
| Home / End | On the thumbnails or dots: selects the first or the last item |
|
|
62
|
+
| Escape | Closes the full-screen gallery |
|
package/image/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Image
|
|
2
|
+
|
|
3
|
+
An image with an optional full-screen preview: a dark layer over the page with rotate and zoom controls, zoom by the wheel or a double click, and dragging a zoomed image around.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-image src="/photos/lake-small.jpg" previewSrc="/photos/lake.jpg" alt="Alpine lake" width="320" preview />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Inputs
|
|
10
|
+
| Name | Description |
|
|
11
|
+
|---|---|
|
|
12
|
+
| src | Source of the image |
|
|
13
|
+
| srcSet | `srcset` of the image |
|
|
14
|
+
| sizes | `sizes` of the image |
|
|
15
|
+
| previewSrc | Source shown in the preview, for example a larger file; `src` when empty |
|
|
16
|
+
| previewSrcSet | `srcset` of the preview image |
|
|
17
|
+
| previewSizes | `sizes` of the preview image |
|
|
18
|
+
| alt | Alternative text; also names the preview dialog |
|
|
19
|
+
| width | `width` attribute of the image |
|
|
20
|
+
| height | `height` attribute of the image |
|
|
21
|
+
| loading | `lazy` or `eager` loading of the image |
|
|
22
|
+
| preview | Shows a zoom button over the image that opens the preview |
|
|
23
|
+
| previewIcon | Icon of the zoom button |
|
|
24
|
+
| zoomStep | How much one zoom step changes the scale |
|
|
25
|
+
| minZoom | Smallest scale in the preview |
|
|
26
|
+
| maxZoom | Largest scale in the preview |
|
|
27
|
+
| ariaLabel | Accessible name of the preview dialog when `alt` does not describe it |
|
|
28
|
+
| dt | Design tokens of this instance (`image`) |
|
|
29
|
+
| pt | Classes and styles of the parts: `root`, `image`, `previewButton`, `previewIcon`, `mask`, `toolbar`, `action`, `original` |
|
|
30
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
31
|
+
| unstyled | Removes the tectra styles |
|
|
32
|
+
|
|
33
|
+
## Outputs
|
|
34
|
+
| Name | Description |
|
|
35
|
+
|---|---|
|
|
36
|
+
| opened | The preview opened |
|
|
37
|
+
| closed | The preview closed and its animation ended |
|
|
38
|
+
| imageError | The image failed to load |
|
|
39
|
+
|
|
40
|
+
## Slots
|
|
41
|
+
| Name | Description |
|
|
42
|
+
|---|---|
|
|
43
|
+
| txImageIndicator | `<ng-template txImageIndicator let-src>` — content of the zoom button over the image |
|
|
44
|
+
| txImagePreview | `<ng-template txImagePreview let-src let-style="style" let-close="close">` — own preview content; `style` carries the rotate and zoom transform |
|
|
45
|
+
|
|
46
|
+
## Keyboard
|
|
47
|
+
| Key | Action |
|
|
48
|
+
|---|---|
|
|
49
|
+
| Enter / Space | On the image: opens the preview |
|
|
50
|
+
| Tab / Shift + Tab | Moves through the preview controls; focus stays in the preview |
|
|
51
|
+
| + / = | Zooms in |
|
|
52
|
+
| - | Zooms out |
|
|
53
|
+
| 0 | Resets the zoom |
|
|
54
|
+
| Escape | Closes the preview and returns focus to the image |
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Menubar
|
|
2
|
+
|
|
3
|
+
A horizontal menu bar for the top of an app or a page. Root items open their submenus below (on the kit menu panel), deeper levels open to the side. Below the breakpoint the bar turns into a button with an inline menu where nested items open in place.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<tx-menubar ariaLabel="Editor" [model]="items">
|
|
7
|
+
<img txMenubarStart src="logo.svg" alt="" />
|
|
8
|
+
<tx-avatar txMenubarEnd label="OK" />
|
|
9
|
+
</tx-menubar>
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Items are the kit `TxMenuItem` from `@tectra-ng/ui/menu`: `label`, `icon`, `command`, `routerLink` (+ `queryParams`, `fragment`), `url` + `target`, `disabled`, `visible`, `separator`, `badge`, `title`, `items`, `data`.
|
|
13
|
+
|
|
14
|
+
## Inputs
|
|
15
|
+
| Name | Description |
|
|
16
|
+
|---|---|
|
|
17
|
+
| model | The items, `TxMenuItem[]` |
|
|
18
|
+
| autoDisplay | Opens a root submenu when the pointer is over its item, without the first click |
|
|
19
|
+
| breakpoint | Width below which the bar turns into a button with an inline menu (`960px`) |
|
|
20
|
+
| ariaLabel | Accessible name of the menu bar |
|
|
21
|
+
| ariaLabelledBy | Id of the element that names the menu bar |
|
|
22
|
+
| dt | Design tokens of this instance (`menubar`); submenus use the `menu` tokens |
|
|
23
|
+
| pt | Classes and styles of the parts: `root`, `start`, `end`, `list`, `item`, `icon`, `label`, `badge`, `submenuIcon`, `separator`, `submenu`, `mobileButton` |
|
|
24
|
+
| ptOptions | How `pt` merges with the global pass-through |
|
|
25
|
+
| unstyled | Removes the tectra styles |
|
|
26
|
+
|
|
27
|
+
## Outputs
|
|
28
|
+
| Name | Description |
|
|
29
|
+
|---|---|
|
|
30
|
+
| itemClick | An item without a submenu was picked: `{ item, originalEvent }` |
|
|
31
|
+
| focused | Focus came into the bar |
|
|
32
|
+
| blurred | Focus left the bar |
|
|
33
|
+
|
|
34
|
+
## Slots
|
|
35
|
+
| Name | Description |
|
|
36
|
+
|---|---|
|
|
37
|
+
| txMenubarStart | Content before the items, e.g. a logo |
|
|
38
|
+
| txMenubarEnd | Content at the far end, e.g. a search field or an avatar |
|
|
39
|
+
| txMenubarItem | `<ng-template txMenubarItem let-item let-hasSubmenu="hasSubmenu">` — own item content, root and submenu items |
|
|
40
|
+
|
|
41
|
+
## Keyboard
|
|
42
|
+
| Key | Action |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Tab | Moves focus into the bar (one root item is in the tab order) and out of it |
|
|
45
|
+
| Right / Left arrow | Next / previous root item; inside a submenu, the next / previous root item with its submenu open |
|
|
46
|
+
| Down arrow / Enter / Space | Opens the submenu of a root item and focuses its first item; picks an item without a submenu |
|
|
47
|
+
| Up arrow | Opens the submenu and focuses its last item |
|
|
48
|
+
| Home / End | First / last root item |
|
|
49
|
+
| Escape | Closes the submenu and returns focus to its root item |
|
|
50
|
+
| Letters | Moves to the next item starting with that letter |
|
|
51
|
+
| Mobile menu | Up / Down move, Right opens a nested list, Left closes it or goes to the parent, Escape closes the menu |
|