ngx-tethys 17.0.2 → 17.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/autocomplete/autocomplete.component.d.ts +2 -5
- package/cascader/cascader.component.d.ts +9 -1
- package/cascader/cascader.service.d.ts +3 -0
- package/drag-drop/drag.directive.d.ts +1 -4
- package/drag-drop/drop-container.directive.d.ts +4 -5
- package/dropdown/dropdown-submenu.component.d.ts +3 -6
- package/esm2022/autocomplete/autocomplete.component.mjs +7 -14
- package/esm2022/button/button-group.component.mjs +2 -2
- package/esm2022/cascader/cascader.component.mjs +27 -5
- package/esm2022/cascader/cascader.service.mjs +33 -3
- package/esm2022/core/behaviors/disabled.mjs +2 -2
- package/esm2022/date-picker/abstract-picker.directive.mjs +3 -3
- package/esm2022/date-picker/base-picker.component.mjs +3 -2
- package/esm2022/drag-drop/drag.directive.mjs +3 -7
- package/esm2022/drag-drop/drop-container.directive.mjs +9 -7
- package/esm2022/dropdown/dropdown-submenu.component.mjs +7 -12
- package/esm2022/form/form.directive.mjs +3 -2
- package/esm2022/grid/thy-grid-item.component.mjs +7 -11
- package/esm2022/image/preview/image-preview.component.mjs +9 -13
- package/esm2022/input/input-count.component.mjs +9 -10
- package/esm2022/input/input-group.component.mjs +9 -9
- package/esm2022/nav/nav-item.directive.mjs +7 -13
- package/esm2022/nav/nav.component.mjs +8 -13
- package/esm2022/radio/button/radio-button.component.mjs +2 -2
- package/esm2022/radio/group/radio-group.component.mjs +6 -1
- package/esm2022/radio/radio.component.mjs +2 -2
- package/esm2022/resizable/resizable.directive.mjs +11 -14
- package/esm2022/resizable/resize-handle.component.mjs +8 -13
- package/esm2022/shared/directives/thy-drag-drop.directive.mjs +8 -8
- package/esm2022/space/space.component.mjs +7 -9
- package/esm2022/table/table-column.component.mjs +3 -2
- package/esm2022/table/table.component.mjs +11 -12
- package/esm2022/tabs/tabs.component.mjs +8 -10
- package/esm2022/time-picker/time-picker.utils.mjs +8 -8
- package/esm2022/util/helpers/helpers.mjs +10 -1
- package/esm2022/version.mjs +2 -2
- package/esm2022/watermark/watermark.directive.mjs +9 -14
- package/fesm2022/ngx-tethys-autocomplete.mjs +8 -14
- package/fesm2022/ngx-tethys-autocomplete.mjs.map +1 -1
- package/fesm2022/ngx-tethys-button.mjs +2 -1
- package/fesm2022/ngx-tethys-button.mjs.map +1 -1
- package/fesm2022/ngx-tethys-cascader.mjs +58 -6
- package/fesm2022/ngx-tethys-cascader.mjs.map +1 -1
- package/fesm2022/ngx-tethys-core.mjs +2 -2
- package/fesm2022/ngx-tethys-core.mjs.map +1 -1
- package/fesm2022/ngx-tethys-date-picker.mjs +2 -2
- package/fesm2022/ngx-tethys-date-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-drag-drop.mjs +9 -10
- package/fesm2022/ngx-tethys-drag-drop.mjs.map +1 -1
- package/fesm2022/ngx-tethys-dropdown.mjs +8 -11
- package/fesm2022/ngx-tethys-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-tethys-form.mjs +2 -1
- package/fesm2022/ngx-tethys-form.mjs.map +1 -1
- package/fesm2022/ngx-tethys-grid.mjs +6 -10
- package/fesm2022/ngx-tethys-grid.mjs.map +1 -1
- package/fesm2022/ngx-tethys-image.mjs +10 -12
- package/fesm2022/ngx-tethys-image.mjs.map +1 -1
- package/fesm2022/ngx-tethys-input.mjs +13 -14
- package/fesm2022/ngx-tethys-input.mjs.map +1 -1
- package/fesm2022/ngx-tethys-nav.mjs +11 -21
- package/fesm2022/ngx-tethys-nav.mjs.map +1 -1
- package/fesm2022/ngx-tethys-radio.mjs +6 -1
- package/fesm2022/ngx-tethys-radio.mjs.map +1 -1
- package/fesm2022/ngx-tethys-resizable.mjs +15 -22
- package/fesm2022/ngx-tethys-resizable.mjs.map +1 -1
- package/fesm2022/ngx-tethys-shared.mjs +8 -7
- package/fesm2022/ngx-tethys-shared.mjs.map +1 -1
- package/fesm2022/ngx-tethys-space.mjs +7 -8
- package/fesm2022/ngx-tethys-space.mjs.map +1 -1
- package/fesm2022/ngx-tethys-table.mjs +12 -12
- package/fesm2022/ngx-tethys-table.mjs.map +1 -1
- package/fesm2022/ngx-tethys-tabs.mjs +7 -9
- package/fesm2022/ngx-tethys-tabs.mjs.map +1 -1
- package/fesm2022/ngx-tethys-time-picker.mjs +8 -7
- package/fesm2022/ngx-tethys-time-picker.mjs.map +1 -1
- package/fesm2022/ngx-tethys-util.mjs +9 -0
- package/fesm2022/ngx-tethys-util.mjs.map +1 -1
- package/fesm2022/ngx-tethys-watermark.mjs +8 -13
- package/fesm2022/ngx-tethys-watermark.mjs.map +1 -1
- package/fesm2022/ngx-tethys.mjs +1 -1
- package/fesm2022/ngx-tethys.mjs.map +1 -1
- package/grid/thy-grid-item.component.d.ts +3 -6
- package/image/preview/image-preview.component.d.ts +3 -6
- package/input/input-count.component.d.ts +2 -4
- package/input/input-group.component.d.ts +3 -4
- package/nav/nav-item.directive.d.ts +3 -6
- package/nav/nav.component.d.ts +3 -6
- package/package.json +1 -1
- package/resizable/resizable.directive.d.ts +2 -4
- package/resizable/resize-handle.component.d.ts +3 -6
- package/schematics/version.d.ts +1 -1
- package/schematics/version.js +1 -1
- package/shared/directives/thy-drag-drop.directive.d.ts +2 -4
- package/space/space.component.d.ts +2 -4
- package/table/table.component.d.ts +3 -3
- package/tabs/tabs.component.d.ts +2 -4
- package/util/helpers/helpers.d.ts +12 -0
- package/watermark/watermark.directive.d.ts +3 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-tethys-space.mjs","sources":["../../../src/space/space.component.ts","../../../src/space/space.component.html","../../../src/space/space.module.ts","../../../src/space/ngx-tethys-space.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"ngx-tethys-space.mjs","sources":["../../../src/space/space.component.ts","../../../src/space/space.component.html","../../../src/space/space.module.ts","../../../src/space/ngx-tethys-space.ts"],"sourcesContent":["import { useHostRenderer } from '@tethys/cdk/dom';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport {\n AfterContentInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n DestroyRef,\n Directive,\n HostBinding,\n inject,\n Input,\n OnInit,\n QueryList,\n TemplateRef\n} from '@angular/core';\nimport { ThySpacingSize, getNumericSize } from 'ngx-tethys/core';\nimport { NgFor, NgTemplateOutlet } from '@angular/common';\n\n/**\n * 间距组件项,使用结构性指令 *thySpaceItem 传入模板\n * @name thySpaceItem\n * @order 20\n */\n@Directive({\n selector: '[thySpaceItem]',\n host: {\n class: 'thy-space-item'\n },\n standalone: true\n})\nexport class ThySpaceItemDirective implements OnInit {\n constructor() {}\n\n ngOnInit(): void {}\n}\n\nconst DEFAULT_SIZE: ThySpacingSize = 'md';\n\n/**\n * 间距组件\n * @name thy-space\n * @order 10\n */\n@Component({\n selector: 'thy-space',\n templateUrl: './space.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'thy-space'\n },\n standalone: true,\n imports: [NgFor, NgTemplateOutlet]\n})\nexport class ThySpace implements OnInit, AfterContentInit {\n private readonly destroyRef = inject(DestroyRef);\n\n public space: number = getNumericSize(DEFAULT_SIZE);\n\n private hostRenderer = useHostRenderer();\n\n /**\n * 大小,支持 `zero` | `xxs` | `xs` | `sm` | `md` | `lg` | `xlg` 和自定义数字大小\n * @type string | number\n */\n @Input() set thySize(size: ThySpacingSize) {\n this.space = getNumericSize(size, DEFAULT_SIZE);\n }\n\n /**\n * 间距垂直方向,默认是水平方向\n */\n @HostBinding(`class.thy-space-vertical`)\n @Input({ transform: booleanAttribute })\n thyVertical: boolean = false;\n\n // @ClassBinding(`align-items-{{value}}`)\n /**\n * 对齐方式,可选择 `start` | `end` | `baseline` | `center`\n */\n @Input()\n set thyAlign(align: string) {\n this.hostRenderer.updateClass(align ? [`align-items-${align}`] : []);\n }\n\n @ContentChildren(ThySpaceItemDirective, { read: TemplateRef }) items!: QueryList<TemplateRef<HTMLElement>>;\n\n constructor(private cdr: ChangeDetectorRef) {}\n\n ngOnInit(): void {}\n\n ngAfterContentInit(): void {\n this.items.changes.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.cdr.markForCheck();\n });\n }\n}\n","<ng-content></ng-content>\n\n<ng-template ngFor let-item let-last=\"last\" let-index=\"index\" [ngForOf]=\"items\">\n <div class=\"thy-space-item\" [style.margin-right.px]=\"last ? null : space\">\n <ng-container [ngTemplateOutlet]=\"item\"></ng-container>\n </div>\n</ng-template>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { ThySpace, ThySpaceItemDirective } from './space.component';\n\n@NgModule({\n imports: [CommonModule, ThySpace, ThySpaceItemDirective],\n exports: [ThySpace, ThySpaceItemDirective]\n})\nexport class ThySpaceModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"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"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import * as i2 from 'ngx-tethys/core';
|
|
3
|
-
import { InputCssPixel,
|
|
4
|
-
import {
|
|
3
|
+
import { InputCssPixel, UpdateHostClassService } from 'ngx-tethys/core';
|
|
4
|
+
import { isArray, isObject, get, isString, set, helpers, keyBy } from 'ngx-tethys/util';
|
|
5
5
|
import { merge, fromEvent, EMPTY, of, Observable } from 'rxjs';
|
|
6
|
-
import { delay,
|
|
6
|
+
import { delay, startWith, switchMap } from 'rxjs/operators';
|
|
7
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
7
8
|
import { moveItemInArray, CdkDropList, CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
8
9
|
import * as i1 from '@angular/cdk/overlay';
|
|
9
10
|
import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
|
|
10
11
|
import { NgFor, NgClass, NgIf, NgTemplateOutlet, isPlatformServer, DOCUMENT, NgStyle, CommonModule } from '@angular/common';
|
|
11
12
|
import * as i0 from '@angular/core';
|
|
12
|
-
import { InjectionToken, EventEmitter, booleanAttribute, TemplateRef, Component, ViewEncapsulation, Optional, Inject, Input, Output, ContentChild, Pipe, ChangeDetectionStrategy, ViewChild, PLATFORM_ID, numberAttribute, ElementRef, ViewChildren, HostBinding, ContentChildren, NgModule } from '@angular/core';
|
|
13
|
+
import { InjectionToken, EventEmitter, booleanAttribute, TemplateRef, Component, ViewEncapsulation, Optional, Inject, Input, Output, ContentChild, Pipe, ChangeDetectionStrategy, ViewChild, inject, DestroyRef, PLATFORM_ID, numberAttribute, ElementRef, ViewChildren, HostBinding, ContentChildren, NgModule } from '@angular/core';
|
|
14
|
+
import { coerceCssPixelValue } from '@angular/cdk/coercion';
|
|
13
15
|
import { ThyPagination, ThyPaginationModule } from 'ngx-tethys/pagination';
|
|
14
16
|
import { ThySkeletonRectangle, ThySkeletonCircle, ThySkeletonModule } from 'ngx-tethys/skeleton';
|
|
15
17
|
import { ThyViewOutletDirective, ThyDragDropDirective, ThyContextMenuDirective, ThySharedModule } from 'ngx-tethys/shared';
|
|
@@ -454,13 +456,12 @@ const css = {
|
|
|
454
456
|
tableScrollMiddle: 'thy-table-scroll-middle'
|
|
455
457
|
};
|
|
456
458
|
const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: true });
|
|
457
|
-
const _MixinBase = mixinUnsubscribe(MixinBase);
|
|
458
459
|
/**
|
|
459
460
|
* 表格组件
|
|
460
461
|
* @name thy-table
|
|
461
462
|
* @order 10
|
|
462
463
|
*/
|
|
463
|
-
class ThyTable
|
|
464
|
+
class ThyTable {
|
|
464
465
|
get tableScrollElement() {
|
|
465
466
|
return this.elementRef.nativeElement.getElementsByClassName(css.tableBody)[0];
|
|
466
467
|
}
|
|
@@ -633,7 +634,6 @@ class ThyTable extends _MixinBase {
|
|
|
633
634
|
}
|
|
634
635
|
}
|
|
635
636
|
constructor(elementRef, _differs, viewportRuler, updateHostClassService, document, platformId, ngZone, renderer, cdr) {
|
|
636
|
-
super();
|
|
637
637
|
this.elementRef = elementRef;
|
|
638
638
|
this._differs = _differs;
|
|
639
639
|
this.viewportRuler = viewportRuler;
|
|
@@ -643,6 +643,7 @@ class ThyTable extends _MixinBase {
|
|
|
643
643
|
this.ngZone = ngZone;
|
|
644
644
|
this.renderer = renderer;
|
|
645
645
|
this.cdr = cdr;
|
|
646
|
+
this.destroyRef = inject(DestroyRef);
|
|
646
647
|
this.customType = customType;
|
|
647
648
|
this.model = [];
|
|
648
649
|
this.groups = [];
|
|
@@ -1136,14 +1137,14 @@ class ThyTable extends _MixinBase {
|
|
|
1136
1137
|
this._setClass(true);
|
|
1137
1138
|
this.initialized = true;
|
|
1138
1139
|
merge(this.viewportRuler.change(200), of(null).pipe(delay(200)))
|
|
1139
|
-
.pipe(
|
|
1140
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
1140
1141
|
.subscribe(() => {
|
|
1141
1142
|
this._refreshColumns();
|
|
1142
1143
|
this.updateScrollClass();
|
|
1143
1144
|
this.cdr.detectChanges();
|
|
1144
1145
|
});
|
|
1145
1146
|
this.ngZone.runOutsideAngular(() => {
|
|
1146
|
-
this.scroll$.pipe(
|
|
1147
|
+
this.scroll$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {
|
|
1147
1148
|
this.updateScrollClass();
|
|
1148
1149
|
});
|
|
1149
1150
|
});
|
|
@@ -1179,7 +1180,7 @@ class ThyTable extends _MixinBase {
|
|
|
1179
1180
|
// Note: since Chrome 56 defaults document level `touchstart` listener to passive.
|
|
1180
1181
|
// The element `touchstart` listener is not passive by default
|
|
1181
1182
|
// We never call `preventDefault()` on it, so we're safe making it passive too.
|
|
1182
|
-
passiveEventListenerOptions))).subscribe(subscriber)))),
|
|
1183
|
+
passiveEventListenerOptions))).subscribe(subscriber)))), takeUntilDestroyed(this.destroyRef))
|
|
1183
1184
|
.subscribe(event => {
|
|
1184
1185
|
if (!this.draggable) {
|
|
1185
1186
|
event.stopPropagation();
|
|
@@ -1200,7 +1201,6 @@ class ThyTable extends _MixinBase {
|
|
|
1200
1201
|
}
|
|
1201
1202
|
}
|
|
1202
1203
|
ngOnDestroy() {
|
|
1203
|
-
super.ngOnDestroy();
|
|
1204
1204
|
this._destroyInvalidAttribute();
|
|
1205
1205
|
}
|
|
1206
1206
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ThyTable, deps: [{ token: i0.ElementRef }, { token: i0.IterableDiffers }, { token: i1.ViewportRuler }, { token: i2.UpdateHostClassService }, { token: DOCUMENT }, { token: PLATFORM_ID }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
@@ -1210,7 +1210,7 @@ class ThyTable extends _MixinBase {
|
|
|
1210
1210
|
useExisting: ThyTable
|
|
1211
1211
|
},
|
|
1212
1212
|
UpdateHostClassService
|
|
1213
|
-
], queries: [{ propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "listOfColumnComponents", predicate: ThyTableColumnComponent }], viewQueries: [{ propertyName: "tableElementRef", first: true, predicate: ["table"], descendants: true, static: true }, { propertyName: "rows", predicate: ["rows"], descendants: true, read: ElementRef }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"thy-table-body\"\n cdkScrollable\n [ngClass]=\"{ 'thy-table-fixed': hasFixed, 'thy-table-bordered-theme': theme === 'bordered' && hasFixed }\">\n <table\n #table\n class=\"table\"\n [ngClass]=\"[className]\"\n [class.table-fixed]=\"thyLayoutFixed\"\n [class.table-draggable]=\"draggable\"\n [class.table-group]=\"mode === 'group'\"\n [style.min-width]=\"thyMinWidth\">\n <colgroup>\n <col *ngFor=\"let column of columns\" [width]=\"column.width\" [style.minWidth]=\"hasFixed ? column.width : column.minWidth\" />\n </colgroup>\n\n <thead *ngIf=\"!thyHeadless\">\n <tr>\n <th\n *ngFor=\"let column of columns\"\n [ngClass]=\"column.headerClassName\"\n [class.thy-table-column-sortable]=\"column.sortable\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [style.left.px]=\"column.left\"\n [style.right.px]=\"column.right\"\n (click)=\"onColumnHeaderClick($event, column)\">\n <ng-container *ngIf=\"!column.headerTemplateRef\">\n <span>{{ column.title }}</span>\n </ng-container>\n <ng-container *ngIf=\"column.headerTemplateRef\">\n <ng-template [ngTemplateOutlet]=\"column.headerTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: column }\"></ng-template>\n </ng-container>\n <ng-container *ngIf=\"column.sortable\">\n <thy-icon [ngClass]=\"['thy-table-column-sortable-icon', 'px-1', column.sortDirection]\" thyIconName=\"sort-vertical-tt\">\n </thy-icon>\n </ng-container>\n </th>\n </tr>\n </thead>\n\n <tbody\n *ngIf=\"loadingDone\"\n thyDragDrop\n cdkDropList\n [cdkDropListDisabled]=\"!draggable\"\n [cdkDropListSortPredicate]=\"dropListEnterPredicate\"\n (cdkDropListDropped)=\"onDragDropped($event)\">\n <!-- group -->\n <ng-container *ngIf=\"mode === 'group'\">\n <ng-container *ngFor=\"let group of groups\">\n <tr\n class=\"thy-table-group\"\n (click)=\"expandGroup(group)\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"group\"\n [cdkDragDisabled]=\"group | tableRowDragDisabled : thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragGroupStarted($event)\"\n (cdkDragEnded)=\"onDragGroupEnd($event)\">\n <td [attr.colspan]=\"columns.length\">\n <div class=\"thy-table-group-container\">\n <ng-container *ngIf=\"draggable && !(group | tableRowDragDisabled : thyDragDisabledPredicate)\">\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n </ng-container>\n <thy-icon class=\"expand-icon\" [thyIconName]=\"group.expand ? 'angle-down' : 'angle-right'\"></thy-icon>\n <ng-container *ngIf=\"groupTemplate\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"></ng-template>\n </ng-container>\n </div>\n </td>\n </tr>\n <ng-container *ngIf=\"group.children?.length && group.expand\">\n <ng-container *ngFor=\"let row of group.children; trackBy: trackByFn; let i = index\">\n <ng-template\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- list\u6A21\u5F0F\u4E0B\u6CA1\u6709\u76F4\u63A5\u4F7F\u7528item\u6A21\u677F\uFF0C\u662F\u56E0\u4E3A\u4F7F\u7528\u4E86\u6A21\u677F\u5F71\u54CD\u4E86Angular\u7684\u4F9D\u8D56\u6811\uFF0C\u5BFC\u81F4CdkDragDrop\u6392\u5E8F\u5931\u6548\uFF0C\u76EE\u524D\u8FD9\u6837\u4FEE\u6539\u53EF\u4EE5\u6682\u65F6\u89E3\u51B3\u7EBF\u4E0A\u4E0D\u80FD\u6392\u5E8F\u7684\u95EE\u9898\uFF0CTree\u6A21\u5F0F\u7684\u6392\u5E8F\u6682\u65F6\u4E0D\u652F\u6301 -->\n <ng-container *ngIf=\"mode === 'list'\">\n <tr\n #rows\n *ngFor=\"let row of model; trackBy: trackByFn; let i = index\"\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled : thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n </tr>\n </ng-container>\n\n <ng-container *ngIf=\"mode === 'tree'\">\n <ng-container *ngFor=\"let row of model; trackBy: trackByFn; let i = index\">\n <ng-template [ngTemplateOutlet]=\"trTemplate\" [ngTemplateOutletContext]=\"{ row: row, index: i, level: 0 }\"></ng-template>\n </ng-container>\n </ng-container>\n\n <ng-template #trTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n <tr\n #rows\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled : thyDragDisabledPredicate\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: level + 1\n }\"></ng-template>\n </tr>\n\n <ng-container *ngIf=\"mode === 'tree' && isExpanded(row)\">\n <ng-template\n *ngFor=\"let child of row[thyChildrenKey]; trackBy: trackByFn; let j = index\"\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{ row: child, index: j, level: level + 1 }\"></ng-template>\n </ng-container>\n </ng-template>\n\n <ng-template #tdsTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n <td\n *ngFor=\"let column of columns; let j = index\"\n [ngClass]=\"column.className\"\n [class.thy-operation-links]=\"!!column.operational\"\n [class.thy-table-column-secondary]=\"!!column.secondary\"\n [class.thy-table-checkbox-column]=\"column.type === customType.checkbox\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [style.left.px]=\"column.left\"\n [style.right.px]=\"column.right\"\n [ngStyle]=\"mode === 'tree' && column.expand ? tdIndentComputed(level) : null\">\n <ng-container *ngIf=\"j === 0 && draggable && !(row | tableRowDragDisabled : thyDragDisabledPredicate)\">\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n </ng-container>\n\n <!--template-->\n <ng-container *ngIf=\"isTemplateRef(column.cellTemplateRef)\">\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n *ngIf=\"mode === 'tree' && column.expand\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.left.px]=\"iconIndentComputed(level)\"></thy-icon>\n <ng-template [ngTemplateOutlet]=\"column.cellTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row }\"></ng-template>\n </ng-container>\n\n <!--not template-->\n <ng-container *ngIf=\"!isTemplateRef(column.cellTemplateRef)\">\n <!-- default -->\n <ng-container *ngIf=\"column.model && !column.type\">\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n *ngIf=\"mode === 'tree' && column.expand\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.marginLeft.px]=\"iconIndentComputed(level)\"></thy-icon>\n <ng-container *ngIf=\"getModelValue(row, column.model) | isValidModelValue; else default\">\n {{ getModelValue(row, column.model) }}\n </ng-container>\n <ng-template #default>\n <div *ngIf=\"column.defaultText\" class=\"text-desc\">\n {{ column.defaultText }}\n </div>\n </ng-template>\n </ng-container>\n\n <!-- index -->\n <ng-container *ngIf=\"column.type === customType.index\">\n {{ i + 1 }}\n </ng-container>\n\n <!-- checkbox -->\n <ng-container *ngIf=\"column.type === customType.checkbox\">\n <input\n type=\"checkbox\"\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onCheckboxChange(row, column)\"\n (click)=\"onStopPropagation($event)\"\n [disabled]=\"column.disabled\" />\n </ng-container>\n\n <!-- radio -->\n <ng-container *ngIf=\"column.type === customType.radio\">\n <input\n type=\"radio\"\n [(ngModel)]=\"selectedRadioRow\"\n [value]=\"row\"\n [disabled]=\"column.disabled\"\n (click)=\"onStopPropagation($event)\"\n (change)=\"onRadioSelectChange($event, row)\" />\n </ng-container>\n\n <!-- switch -->\n <ng-container *ngIf=\"column.type === customType.switch\">\n <thy-switch\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onModelChange(row, column)\"\n [disabled]=\"column.disabled\"\n (thyChange)=\"onSwitchChange($event, row, column)\"></thy-switch>\n </ng-container>\n </ng-container>\n </td>\n </ng-template>\n </tbody>\n </table>\n\n <div *ngIf=\"loadingDone && model.length === 0 && groups.length === 0\" class=\"thy-table-empty clear-hover\">\n <ng-container *ngIf=\"emptyTemplate; else defaultEmpty\">\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n <ng-template #defaultEmpty>\n <thy-empty\n [thyMessage]=\"emptyOptions.message\"\n [thyTranslationKey]=\"emptyOptions.translationKey\"\n [thyTranslationValues]=\"emptyOptions.translationValues\"\n [thyEntityName]=\"emptyOptions.entityName\"\n [thyEntityNameTranslateKey]=\"emptyOptions.entityNameTranslateKey\"\n [thyIconName]=\"emptyOptions.iconName\"\n [thySize]=\"emptyOptions.size\"\n [thyMarginTop]=\"emptyOptions.marginTop\"\n [thyTopAuto]=\"emptyOptions.topAuto\"\n [thyContainer]=\"emptyOptions.container\"></thy-empty>\n </ng-template>\n </div>\n\n <thy-table-skeleton\n *ngIf=\"!loadingDone\"\n [thyRowCount]=\"6\"\n [thyHeadless]=\"true\"\n [thyTheme]=\"theme\"\n [thySize]=\"size\"\n [thyMinWidth]=\"thyMinWidth\"\n [thyColumns]=\"skeletonColumns\">\n </thy-table-skeleton>\n\n <div class=\"thy-table-footer\" *ngIf=\"pagination.total > pagination.size\" [class.thy-table-footer-has-padding]=\"theme === 'default'\">\n <thy-pagination\n [thyPageIndex]=\"pagination.index\"\n [thyTotal]=\"pagination.total\"\n [thyPageSize]=\"pagination.size\"\n [thyPageSizeOptions]=\"pagination.sizeOptions\"\n [thyShowSizeChanger]=\"showSizeChanger\"\n [thyShowTotal]=\"showTotal\"\n (thyPageChanged)=\"onPageChange($event)\"\n (thyPageIndexChange)=\"onPageIndexChange($event)\"\n (thyPageSizeChanged)=\"onPageSizeChange($event)\"></thy-pagination>\n </div>\n</div>\n\n<ng-template>\n <ng-content></ng-content>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyDragDropDirective, selector: "[thyDragDrop]" }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: ThyContextMenuDirective, selector: "[thyContextMenu]", outputs: ["thyContextMenu"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThySwitch, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled", "thyLoading"], outputs: ["thyChange"] }, { kind: "component", type: ThyEmpty, selector: "thy-empty", inputs: ["thyMessage", "thyTranslationKey", "thyTranslationValues", "thyEntityName", "thyEntityNameTranslateKey", "thyIconName", "thySize", "thyMarginTop", "thyTopAuto", "thyContainer", "thyImageUrl", "thyImageLoading", "thyImageFetchPriority", "thyDescription"] }, { kind: "component", type: ThyTableSkeleton, selector: "thy-table-skeleton", inputs: ["thyBorderRadius", "thyRowHeight", "thyAnimated", "thyAnimatedInterval", "thyPrimaryColor", "thySecondaryColor", "thyRowCount", "thyHeadless", "thyTheme", "thySize", "thyMinWidth", "thyColumns"] }, { kind: "component", type: ThyPagination, selector: "thy-pagination", inputs: ["thyPageIndex", "thyPageSize", "thyTotal", "thyCustomPages", "thyDisabled", "thyShowQuickJumper", "thyShowTotalPageCount", "thySize", "thyMaxCount", "thyMarginalCount", "thyRangeCount", "thyShowSizeChanger", "thyPageSizeOptions", "thyHideOnSinglePage", "thyShowTotal"], outputs: ["thyPageIndexChange", "thyPageChanged", "thyPageSizeChanged"] }, { kind: "pipe", type: TableIsValidModelValuePipe, name: "isValidModelValue" }, { kind: "pipe", type: TableRowDragDisabledPipe, name: "tableRowDragDisabled" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1213
|
+
], queries: [{ propertyName: "emptyTemplate", first: true, predicate: ["empty"], descendants: true }, { propertyName: "groupTemplate", first: true, predicate: ["group"], descendants: true, static: true }, { propertyName: "listOfColumnComponents", predicate: ThyTableColumnComponent }], viewQueries: [{ propertyName: "tableElementRef", first: true, predicate: ["table"], descendants: true, static: true }, { propertyName: "rows", predicate: ["rows"], descendants: true, read: ElementRef }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"thy-table-body\"\n cdkScrollable\n [ngClass]=\"{ 'thy-table-fixed': hasFixed, 'thy-table-bordered-theme': theme === 'bordered' && hasFixed }\">\n <table\n #table\n class=\"table\"\n [ngClass]=\"[className]\"\n [class.table-fixed]=\"thyLayoutFixed\"\n [class.table-draggable]=\"draggable\"\n [class.table-group]=\"mode === 'group'\"\n [style.min-width]=\"thyMinWidth\">\n <colgroup>\n <col *ngFor=\"let column of columns\" [width]=\"column.width\" [style.minWidth]=\"hasFixed ? column.width : column.minWidth\" />\n </colgroup>\n\n <thead *ngIf=\"!thyHeadless\">\n <tr>\n <th\n *ngFor=\"let column of columns\"\n [ngClass]=\"column.headerClassName\"\n [class.thy-table-column-sortable]=\"column.sortable\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [style.left.px]=\"column.left\"\n [style.right.px]=\"column.right\"\n (click)=\"onColumnHeaderClick($event, column)\">\n <ng-container *ngIf=\"!column.headerTemplateRef\">\n <span>{{ column.title }}</span>\n </ng-container>\n <ng-container *ngIf=\"column.headerTemplateRef\">\n <ng-template [ngTemplateOutlet]=\"column.headerTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: column }\"></ng-template>\n </ng-container>\n <ng-container *ngIf=\"column.sortable\">\n <thy-icon [ngClass]=\"['thy-table-column-sortable-icon', 'px-1', column.sortDirection]\" thyIconName=\"sort-vertical-tt\">\n </thy-icon>\n </ng-container>\n </th>\n </tr>\n </thead>\n\n <tbody\n *ngIf=\"loadingDone\"\n thyDragDrop\n cdkDropList\n [cdkDropListDisabled]=\"!draggable\"\n [cdkDropListSortPredicate]=\"dropListEnterPredicate\"\n (cdkDropListDropped)=\"onDragDropped($event)\">\n <!-- group -->\n <ng-container *ngIf=\"mode === 'group'\">\n <ng-container *ngFor=\"let group of groups\">\n <tr\n class=\"thy-table-group\"\n (click)=\"expandGroup(group)\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"group\"\n [cdkDragDisabled]=\"group | tableRowDragDisabled : thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragGroupStarted($event)\"\n (cdkDragEnded)=\"onDragGroupEnd($event)\">\n <td [attr.colspan]=\"columns.length\">\n <div class=\"thy-table-group-container\">\n <ng-container *ngIf=\"draggable && !(group | tableRowDragDisabled : thyDragDisabledPredicate)\">\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n </ng-container>\n <thy-icon class=\"expand-icon\" [thyIconName]=\"group.expand ? 'angle-down' : 'angle-right'\"></thy-icon>\n <ng-container *ngIf=\"groupTemplate\">\n <ng-template\n [ngTemplateOutlet]=\"groupTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: group.origin, group: group.origin }\"></ng-template>\n </ng-container>\n </div>\n </td>\n </tr>\n <ng-container *ngIf=\"group.children?.length && group.expand\">\n <ng-container *ngFor=\"let row of group.children; trackBy: trackByFn; let i = index\">\n <ng-template\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- list\u6A21\u5F0F\u4E0B\u6CA1\u6709\u76F4\u63A5\u4F7F\u7528item\u6A21\u677F\uFF0C\u662F\u56E0\u4E3A\u4F7F\u7528\u4E86\u6A21\u677F\u5F71\u54CD\u4E86Angular\u7684\u4F9D\u8D56\u6811\uFF0C\u5BFC\u81F4CdkDragDrop\u6392\u5E8F\u5931\u6548\uFF0C\u76EE\u524D\u8FD9\u6837\u4FEE\u6539\u53EF\u4EE5\u6682\u65F6\u89E3\u51B3\u7EBF\u4E0A\u4E0D\u80FD\u6392\u5E8F\u7684\u95EE\u9898\uFF0CTree\u6A21\u5F0F\u7684\u6392\u5E8F\u6682\u65F6\u4E0D\u652F\u6301 -->\n <ng-container *ngIf=\"mode === 'list'\">\n <tr\n #rows\n *ngFor=\"let row of model; trackBy: trackByFn; let i = index\"\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled : thyDragDisabledPredicate\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: 0\n }\"></ng-template>\n </tr>\n </ng-container>\n\n <ng-container *ngIf=\"mode === 'tree'\">\n <ng-container *ngFor=\"let row of model; trackBy: trackByFn; let i = index\">\n <ng-template [ngTemplateOutlet]=\"trTemplate\" [ngTemplateOutletContext]=\"{ row: row, index: i, level: 0 }\"></ng-template>\n </ng-container>\n </ng-container>\n\n <ng-template #trTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n <tr\n #rows\n class=\"thy-sortable-item\"\n cdkDrag\n [cdkDragPreviewClass]=\"dragPreviewClass\"\n [cdkDragData]=\"row\"\n (cdkDragStarted)=\"onDragStarted($event)\"\n [cdkDragDisabled]=\"row | tableRowDragDisabled : thyDragDisabledPredicate\"\n [ngClass]=\"renderRowClassName(row, i)\"\n (click)=\"onRowClick($event, row)\"\n (thyContextMenu)=\"onRowContextMenu($event, row)\">\n <ng-template\n [ngTemplateOutlet]=\"tdsTemplate\"\n [ngTemplateOutletContext]=\"{\n row: row,\n index: i,\n level: level + 1\n }\"></ng-template>\n </tr>\n\n <ng-container *ngIf=\"mode === 'tree' && isExpanded(row)\">\n <ng-template\n *ngFor=\"let child of row[thyChildrenKey]; trackBy: trackByFn; let j = index\"\n [ngTemplateOutlet]=\"trTemplate\"\n [ngTemplateOutletContext]=\"{ row: child, index: j, level: level + 1 }\"></ng-template>\n </ng-container>\n </ng-template>\n\n <ng-template #tdsTemplate let-row=\"row\" let-i=\"index\" let-level=\"level\">\n <td\n *ngFor=\"let column of columns; let j = index\"\n [ngClass]=\"column.className\"\n [class.thy-operation-links]=\"!!column.operational\"\n [class.thy-table-column-secondary]=\"!!column.secondary\"\n [class.thy-table-checkbox-column]=\"column.type === customType.checkbox\"\n [class.thy-table-fixed-column-left]=\"column.fixed === fixedDirection.left\"\n [class.thy-table-fixed-column-right]=\"column.fixed === fixedDirection.right\"\n [style.left.px]=\"column.left\"\n [style.right.px]=\"column.right\"\n [ngStyle]=\"mode === 'tree' && column.expand ? tdIndentComputed(level) : null\">\n <ng-container *ngIf=\"j === 0 && draggable && !(row | tableRowDragDisabled : thyDragDisabledPredicate)\">\n <thy-icon class=\"table-draggable-icon\" thyIconName=\"drag\"></thy-icon>\n </ng-container>\n\n <!--template-->\n <ng-container *ngIf=\"isTemplateRef(column.cellTemplateRef)\">\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n *ngIf=\"mode === 'tree' && column.expand\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.left.px]=\"iconIndentComputed(level)\"></thy-icon>\n <ng-template [ngTemplateOutlet]=\"column.cellTemplateRef\" [ngTemplateOutletContext]=\"{ $implicit: row }\"></ng-template>\n </ng-container>\n\n <!--not template-->\n <ng-container *ngIf=\"!isTemplateRef(column.cellTemplateRef)\">\n <!-- default -->\n <ng-container *ngIf=\"column.model && !column.type\">\n <thy-icon\n class=\"tree-expand-icon cursor-pointer\"\n *ngIf=\"mode === 'tree' && column.expand\"\n [thyIconName]=\"isExpanded(row) ? 'angle-down' : 'angle-right'\"\n [style.visibility]=\"showExpand(row) ? 'visible' : 'hidden'\"\n [style.marginLeft.px]=\"iconIndentComputed(level)\"></thy-icon>\n <ng-container *ngIf=\"getModelValue(row, column.model) | isValidModelValue; else default\">\n {{ getModelValue(row, column.model) }}\n </ng-container>\n <ng-template #default>\n <div *ngIf=\"column.defaultText\" class=\"text-desc\">\n {{ column.defaultText }}\n </div>\n </ng-template>\n </ng-container>\n\n <!-- index -->\n <ng-container *ngIf=\"column.type === customType.index\">\n {{ i + 1 }}\n </ng-container>\n\n <!-- checkbox -->\n <ng-container *ngIf=\"column.type === customType.checkbox\">\n <input\n type=\"checkbox\"\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onCheckboxChange(row, column)\"\n (click)=\"onStopPropagation($event)\"\n [disabled]=\"column.disabled\" />\n </ng-container>\n\n <!-- radio -->\n <ng-container *ngIf=\"column.type === customType.radio\">\n <input\n type=\"radio\"\n [(ngModel)]=\"selectedRadioRow\"\n [value]=\"row\"\n [disabled]=\"column.disabled\"\n (click)=\"onStopPropagation($event)\"\n (change)=\"onRadioSelectChange($event, row)\" />\n </ng-container>\n\n <!-- switch -->\n <ng-container *ngIf=\"column.type === customType.switch\">\n <thy-switch\n [(ngModel)]=\"row[column.key]\"\n (ngModelChange)=\"onModelChange(row, column)\"\n [disabled]=\"column.disabled\"\n (thyChange)=\"onSwitchChange($event, row, column)\"></thy-switch>\n </ng-container>\n </ng-container>\n </td>\n </ng-template>\n </tbody>\n </table>\n\n <div *ngIf=\"loadingDone && model.length === 0 && groups.length === 0\" class=\"thy-table-empty clear-hover\">\n <ng-container *ngIf=\"emptyTemplate; else defaultEmpty\">\n <ng-template [ngTemplateOutlet]=\"emptyTemplate\"></ng-template>\n </ng-container>\n <ng-template #defaultEmpty>\n <thy-empty\n [thyMessage]=\"emptyOptions.message\"\n [thyTranslationKey]=\"emptyOptions.translationKey\"\n [thyTranslationValues]=\"emptyOptions.translationValues\"\n [thyEntityName]=\"emptyOptions.entityName\"\n [thyEntityNameTranslateKey]=\"emptyOptions.entityNameTranslateKey\"\n [thyIconName]=\"emptyOptions.iconName\"\n [thySize]=\"emptyOptions.size\"\n [thyMarginTop]=\"emptyOptions.marginTop\"\n [thyTopAuto]=\"emptyOptions.topAuto\"\n [thyContainer]=\"emptyOptions.container\"></thy-empty>\n </ng-template>\n </div>\n\n <thy-table-skeleton\n *ngIf=\"!loadingDone\"\n [thyRowCount]=\"6\"\n [thyHeadless]=\"true\"\n [thyTheme]=\"theme\"\n [thySize]=\"size\"\n [thyMinWidth]=\"thyMinWidth\"\n [thyColumns]=\"skeletonColumns\">\n </thy-table-skeleton>\n\n <div class=\"thy-table-footer\" *ngIf=\"pagination.total > pagination.size\" [class.thy-table-footer-has-padding]=\"theme === 'default'\">\n <thy-pagination\n [thyPageIndex]=\"pagination.index\"\n [thyTotal]=\"pagination.total\"\n [thyPageSize]=\"pagination.size\"\n [thyPageSizeOptions]=\"pagination.sizeOptions\"\n [thyShowSizeChanger]=\"showSizeChanger\"\n [thyShowTotal]=\"showTotal\"\n (thyPageChanged)=\"onPageChange($event)\"\n (thyPageIndexChange)=\"onPageIndexChange($event)\"\n (thyPageSizeChanged)=\"onPageSizeChange($event)\"></thy-pagination>\n </div>\n</div>\n\n<ng-template>\n <ng-content></ng-content>\n</ng-template>\n", dependencies: [{ kind: "directive", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgFor, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: ThyDragDropDirective, selector: "[thyDragDrop]" }, { kind: "directive", type: CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }, { kind: "directive", type: ThyContextMenuDirective, selector: "[thyContextMenu]", outputs: ["thyContextMenu"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ThySwitch, selector: "thy-switch", inputs: ["thyType", "thySize", "thyDisabled", "thyLoading"], outputs: ["thyChange"] }, { kind: "component", type: ThyEmpty, selector: "thy-empty", inputs: ["thyMessage", "thyTranslationKey", "thyTranslationValues", "thyEntityName", "thyEntityNameTranslateKey", "thyIconName", "thySize", "thyMarginTop", "thyTopAuto", "thyContainer", "thyImageUrl", "thyImageLoading", "thyImageFetchPriority", "thyDescription"] }, { kind: "component", type: ThyTableSkeleton, selector: "thy-table-skeleton", inputs: ["thyBorderRadius", "thyRowHeight", "thyAnimated", "thyAnimatedInterval", "thyPrimaryColor", "thySecondaryColor", "thyRowCount", "thyHeadless", "thyTheme", "thySize", "thyMinWidth", "thyColumns"] }, { kind: "component", type: ThyPagination, selector: "thy-pagination", inputs: ["thyPageIndex", "thyPageSize", "thyTotal", "thyCustomPages", "thyDisabled", "thyShowQuickJumper", "thyShowTotalPageCount", "thySize", "thyMaxCount", "thyMarginalCount", "thyRangeCount", "thyShowSizeChanger", "thyPageSizeOptions", "thyHideOnSinglePage", "thyShowTotal"], outputs: ["thyPageIndexChange", "thyPageChanged", "thyPageSizeChanged"] }, { kind: "pipe", type: TableIsValidModelValuePipe, name: "isValidModelValue" }, { kind: "pipe", type: TableRowDragDisabledPipe, name: "tableRowDragDisabled" }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
1214
1214
|
}
|
|
1215
1215
|
__decorate([
|
|
1216
1216
|
InputCssPixel(),
|