@kris701/ez-ui 1.1.3 → 1.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.
|
@@ -3300,6 +3300,7 @@ class EzUITable {
|
|
|
3300
3300
|
showRefresh = false;
|
|
3301
3301
|
showClearFilters = false;
|
|
3302
3302
|
expandable = false;
|
|
3303
|
+
clickable = false;
|
|
3303
3304
|
values = [];
|
|
3304
3305
|
internalValues = [];
|
|
3305
3306
|
displayValues = signal([], /* @ts-ignore */
|
|
@@ -3322,6 +3323,7 @@ class EzUITable {
|
|
|
3322
3323
|
onAddItem = new EventEmitter();
|
|
3323
3324
|
onLoadItems = new EventEmitter();
|
|
3324
3325
|
onRowExpanded = new EventEmitter();
|
|
3326
|
+
onRowClick = new EventEmitter();
|
|
3325
3327
|
onPresetChange = new EventEmitter();
|
|
3326
3328
|
pageSize = signal(25, /* @ts-ignore */
|
|
3327
3329
|
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
@@ -3400,10 +3402,20 @@ class EzUITable {
|
|
|
3400
3402
|
this.applyFilter();
|
|
3401
3403
|
}
|
|
3402
3404
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUITable, deps: [{ token: EzUITableFilterService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3403
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUITable, isStandalone: true, selector: "ezui-table", inputs: { disabled: "disabled", isLoading: "isLoading", showAdd: "showAdd", showRefresh: "showRefresh", showClearFilters: "showClearFilters", expandable: "expandable", values: "values", storageKey: "storageKey", allowPresets: "allowPresets", pageSize: "pageSize" }, outputs: { onAddItem: "onAddItem", onLoadItems: "onLoadItems", onRowExpanded: "onRowExpanded", onPresetChange: "onPresetChange" }, host: { classAttribute: "w-full h-full" }, queries: [{ propertyName: "tableHeader", first: true, predicate: ["tableHeader"], descendants: true }, { propertyName: "tableRows", first: true, predicate: ["tableRows"], descendants: true }, { propertyName: "tableExpandedrow", first: true, predicate: ["tableExpandedrow"], descendants: true }], viewQueries: [{ propertyName: "presetHeader", first: true, predicate: ["presetHeader"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
3405
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: EzUITable, isStandalone: true, selector: "ezui-table", inputs: { disabled: "disabled", isLoading: "isLoading", showAdd: "showAdd", showRefresh: "showRefresh", showClearFilters: "showClearFilters", expandable: "expandable", clickable: "clickable", values: "values", storageKey: "storageKey", allowPresets: "allowPresets", pageSize: "pageSize" }, outputs: { onAddItem: "onAddItem", onLoadItems: "onLoadItems", onRowExpanded: "onRowExpanded", onRowClick: "onRowClick", onPresetChange: "onPresetChange" }, host: { classAttribute: "w-full h-full" }, queries: [{ propertyName: "tableHeader", first: true, predicate: ["tableHeader"], descendants: true }, { propertyName: "tableRows", first: true, predicate: ["tableRows"], descendants: true }, { propertyName: "tableExpandedrow", first: true, predicate: ["tableExpandedrow"], descendants: true }], viewQueries: [{ propertyName: "presetHeader", first: true, predicate: ["presetHeader"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
3404
3406
|
<div class="ezui-table">
|
|
3405
3407
|
<tui-loader [inheritColor]="true" [overlay]="true" size="xxl" [loading]="isLoading()">
|
|
3406
3408
|
@if(values.length == 0){
|
|
3409
|
+
@if(showAdd || showRefresh){
|
|
3410
|
+
<div class="ezui-table-header">
|
|
3411
|
+
@if(showRefresh){
|
|
3412
|
+
<button tuiButton iconStart="rotate-cw" size="s" appearance="info" (click)="onLoadItems.emit()" tuiHint="Refresh the table"></button>
|
|
3413
|
+
}
|
|
3414
|
+
@if(showAdd){
|
|
3415
|
+
<button tuiButton iconStart="plus" size="s" appearance="info" (click)="onAddItem.emit()" tuiHint="Add new item"></button>
|
|
3416
|
+
}
|
|
3417
|
+
</div>
|
|
3418
|
+
}
|
|
3407
3419
|
<tui-block-status>
|
|
3408
3420
|
<tui-icon tuiSlot="top" icon="grid-2x2-x" />
|
|
3409
3421
|
|
|
@@ -3445,7 +3457,7 @@ class EzUITable {
|
|
|
3445
3457
|
@for (item of displayValues(); track page() * pageSize() + i; let i = $index){
|
|
3446
3458
|
@let fullIndex = page() * pageSize() + i;
|
|
3447
3459
|
<tbody tuiTbody>
|
|
3448
|
-
<tr>
|
|
3460
|
+
<tr [class]="{'rowrlickable':clickable}" (click)="onRowClick.emit(item)">
|
|
3449
3461
|
@if(expandable){
|
|
3450
3462
|
<td tuiTd class="ezui-table-expander">
|
|
3451
3463
|
<button
|
|
@@ -3466,7 +3478,7 @@ class EzUITable {
|
|
|
3466
3478
|
|
|
3467
3479
|
<tbody tuiTableExpand [expanded]="state[fullIndex] ?? false">
|
|
3468
3480
|
@if(state[fullIndex] ?? false){
|
|
3469
|
-
<tr>
|
|
3481
|
+
<tr [class]="{'rowrlickable':clickable}" (click)="onRowClick.emit(item)">
|
|
3470
3482
|
<ng-container [ngTemplateOutlet]="tableExpandedrow" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3471
3483
|
</tr>
|
|
3472
3484
|
}
|
|
@@ -3489,7 +3501,7 @@ class EzUITable {
|
|
|
3489
3501
|
}
|
|
3490
3502
|
</tui-loader>
|
|
3491
3503
|
</div>
|
|
3492
|
-
`, isInline: true, styles: [".ezui-table{border:2px solid var(--tui-border-normal);border-radius:var(--tui-radius-l);display:flex;height:100%;width:100%;overflow:hidden}.ezui-table ::ng-deep tui-loader{height:100%;width:100%}.ezui-table .ezui-table-header{background-color:var(--tui-background-base-alt);display:flex;flex-direction:row;gap:10px;padding:5px}.ezui-table .ezui-table-header .seperator{width:2px;background-color:var(--tui-border-normal)}.ezui-table .ezui-table-footer{display:flex;margin-top:.5rem;margin-bottom:.5rem;padding-left:2rem;padding-right:2rem}.ezui-table .ezui-table-footer tui-table-pagination{flex:1}.ezui-table ::ng-deep table{border-radius:var(--tui-radius-l)}.ezui-table ::ng-deep th{background-color:var(--tui-background-base-alt)!important}.ezui-table ::ng-deep .ezui-table-expander{padding:0}.ezui-table th[tuiTh]{align-items:center}.ezui-table .forcefullsize{width:100%!important}.ezui-table tui-block-status{padding-top:20px;padding-bottom:20px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$2.TuiTableDirective, selector: "table[tuiTable]", inputs: ["columns", "size", "direction", "sorter"], outputs: ["directionChange", "sorterChange", "sortChange"] }, { kind: "component", type: i3$2.TuiTableTbody, selector: "tbody[tuiTbody]", inputs: ["heading", "open"], outputs: ["openChange"] }, { kind: "component", type: i3$2.TuiTableTh, selector: "th[tuiTh]", inputs: ["minWidth", "maxWidth", "sorter", "resizable", "sticky", "requiredSort"], outputs: ["sorterChange"] }, { kind: "component", type: i3$2.TuiTableTd, selector: "th[tuiTd], td[tuiTd]" }, { kind: "component", type: i3$2.TuiTableExpand, selector: "tui-table-expand, tbody[tuiTableExpand]", inputs: ["expanded"], outputs: ["expandedChange"] }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "component", type: TuiTablePagination, selector: "tui-table-pagination", inputs: ["items", "total", "page", "size"], outputs: ["pageChange", "sizeChange", "paginationChange"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: i4$2.TuiBlockStatusComponent, selector: "tui-block-status", inputs: ["card", "size"] }, { kind: "directive", type: i4$2.TuiBlockStatusDirective, selector: "[tuiSlot]", inputs: ["tuiSlot"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: EzUITablePresets, selector: "ezui-table-presets", inputs: ["storageKey"], outputs: ["onPresetChange"] }, { kind: "directive", type: i3$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }] });
|
|
3504
|
+
`, isInline: true, styles: [".ezui-table{border:2px solid var(--tui-border-normal);border-radius:var(--tui-radius-l);display:flex;height:100%;width:100%;overflow:hidden}.ezui-table ::ng-deep tui-loader{height:100%;width:100%}.ezui-table .ezui-table-header{background-color:var(--tui-background-base-alt);display:flex;flex-direction:row;gap:10px;padding:5px}.ezui-table .ezui-table-header .seperator{width:2px;background-color:var(--tui-border-normal)}.ezui-table .ezui-table-footer{display:flex;margin-top:.5rem;margin-bottom:.5rem;padding-left:2rem;padding-right:2rem}.ezui-table .ezui-table-footer tui-table-pagination{flex:1}.ezui-table ::ng-deep table{border-radius:var(--tui-radius-l)}.ezui-table ::ng-deep th{background-color:var(--tui-background-base-alt)!important}.ezui-table ::ng-deep .ezui-table-expander{padding:0}.ezui-table th[tuiTh]{align-items:center}.ezui-table .forcefullsize{width:100%!important}.ezui-table tui-block-status{padding-top:20px;padding-bottom:20px}.ezui-table .rowrlickable{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3$2.TuiTableDirective, selector: "table[tuiTable]", inputs: ["columns", "size", "direction", "sorter"], outputs: ["directionChange", "sorterChange", "sortChange"] }, { kind: "component", type: i3$2.TuiTableTbody, selector: "tbody[tuiTbody]", inputs: ["heading", "open"], outputs: ["openChange"] }, { kind: "component", type: i3$2.TuiTableTh, selector: "th[tuiTh]", inputs: ["minWidth", "maxWidth", "sorter", "resizable", "sticky", "requiredSort"], outputs: ["sorterChange"] }, { kind: "component", type: i3$2.TuiTableTd, selector: "th[tuiTd], td[tuiTd]" }, { kind: "component", type: i3$2.TuiTableExpand, selector: "tui-table-expand, tbody[tuiTableExpand]", inputs: ["expanded"], outputs: ["expandedChange"] }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar" }, { kind: "directive", type: TuiButton, selector: "a[tuiButton],button[tuiButton],a[tuiIconButton],button[tuiIconButton]", inputs: ["size"] }, { kind: "directive", type: TuiChevron, selector: "[tuiChevron]", inputs: ["tuiChevron"] }, { kind: "component", type: TuiTablePagination, selector: "tui-table-pagination", inputs: ["items", "total", "page", "size"], outputs: ["pageChange", "sizeChange", "paginationChange"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "loading"] }, { kind: "component", type: i4$2.TuiBlockStatusComponent, selector: "tui-block-status", inputs: ["card", "size"] }, { kind: "directive", type: i4$2.TuiBlockStatusDirective, selector: "[tuiSlot]", inputs: ["tuiSlot"] }, { kind: "component", type: TuiIcon, selector: "tui-icon:not([tuiBadge])", inputs: ["background"] }, { kind: "component", type: EzUITablePresets, selector: "ezui-table-presets", inputs: ["storageKey"], outputs: ["onPresetChange"] }, { kind: "directive", type: i3$1.TuiHintDirective, selector: "[tuiHint]:not(ng-container):not(ng-template)", inputs: ["tuiHint", "tuiHintContext", "tuiHintAppearance"], outputs: ["tuiHintVisible"] }] });
|
|
3493
3505
|
}
|
|
3494
3506
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: EzUITable, decorators: [{
|
|
3495
3507
|
type: Component,
|
|
@@ -3497,6 +3509,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
3497
3509
|
<div class="ezui-table">
|
|
3498
3510
|
<tui-loader [inheritColor]="true" [overlay]="true" size="xxl" [loading]="isLoading()">
|
|
3499
3511
|
@if(values.length == 0){
|
|
3512
|
+
@if(showAdd || showRefresh){
|
|
3513
|
+
<div class="ezui-table-header">
|
|
3514
|
+
@if(showRefresh){
|
|
3515
|
+
<button tuiButton iconStart="rotate-cw" size="s" appearance="info" (click)="onLoadItems.emit()" tuiHint="Refresh the table"></button>
|
|
3516
|
+
}
|
|
3517
|
+
@if(showAdd){
|
|
3518
|
+
<button tuiButton iconStart="plus" size="s" appearance="info" (click)="onAddItem.emit()" tuiHint="Add new item"></button>
|
|
3519
|
+
}
|
|
3520
|
+
</div>
|
|
3521
|
+
}
|
|
3500
3522
|
<tui-block-status>
|
|
3501
3523
|
<tui-icon tuiSlot="top" icon="grid-2x2-x" />
|
|
3502
3524
|
|
|
@@ -3538,7 +3560,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
3538
3560
|
@for (item of displayValues(); track page() * pageSize() + i; let i = $index){
|
|
3539
3561
|
@let fullIndex = page() * pageSize() + i;
|
|
3540
3562
|
<tbody tuiTbody>
|
|
3541
|
-
<tr>
|
|
3563
|
+
<tr [class]="{'rowrlickable':clickable}" (click)="onRowClick.emit(item)">
|
|
3542
3564
|
@if(expandable){
|
|
3543
3565
|
<td tuiTd class="ezui-table-expander">
|
|
3544
3566
|
<button
|
|
@@ -3559,7 +3581,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
3559
3581
|
|
|
3560
3582
|
<tbody tuiTableExpand [expanded]="state[fullIndex] ?? false">
|
|
3561
3583
|
@if(state[fullIndex] ?? false){
|
|
3562
|
-
<tr>
|
|
3584
|
+
<tr [class]="{'rowrlickable':clickable}" (click)="onRowClick.emit(item)">
|
|
3563
3585
|
<ng-container [ngTemplateOutlet]="tableExpandedrow" [ngTemplateOutletContext]="{ $implicit: item }"></ng-container>
|
|
3564
3586
|
</tr>
|
|
3565
3587
|
}
|
|
@@ -3584,7 +3606,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
3584
3606
|
</div>
|
|
3585
3607
|
`, host: {
|
|
3586
3608
|
class: 'w-full h-full'
|
|
3587
|
-
}, styles: [".ezui-table{border:2px solid var(--tui-border-normal);border-radius:var(--tui-radius-l);display:flex;height:100%;width:100%;overflow:hidden}.ezui-table ::ng-deep tui-loader{height:100%;width:100%}.ezui-table .ezui-table-header{background-color:var(--tui-background-base-alt);display:flex;flex-direction:row;gap:10px;padding:5px}.ezui-table .ezui-table-header .seperator{width:2px;background-color:var(--tui-border-normal)}.ezui-table .ezui-table-footer{display:flex;margin-top:.5rem;margin-bottom:.5rem;padding-left:2rem;padding-right:2rem}.ezui-table .ezui-table-footer tui-table-pagination{flex:1}.ezui-table ::ng-deep table{border-radius:var(--tui-radius-l)}.ezui-table ::ng-deep th{background-color:var(--tui-background-base-alt)!important}.ezui-table ::ng-deep .ezui-table-expander{padding:0}.ezui-table th[tuiTh]{align-items:center}.ezui-table .forcefullsize{width:100%!important}.ezui-table tui-block-status{padding-top:20px;padding-bottom:20px}\n"] }]
|
|
3609
|
+
}, styles: [".ezui-table{border:2px solid var(--tui-border-normal);border-radius:var(--tui-radius-l);display:flex;height:100%;width:100%;overflow:hidden}.ezui-table ::ng-deep tui-loader{height:100%;width:100%}.ezui-table .ezui-table-header{background-color:var(--tui-background-base-alt);display:flex;flex-direction:row;gap:10px;padding:5px}.ezui-table .ezui-table-header .seperator{width:2px;background-color:var(--tui-border-normal)}.ezui-table .ezui-table-footer{display:flex;margin-top:.5rem;margin-bottom:.5rem;padding-left:2rem;padding-right:2rem}.ezui-table .ezui-table-footer tui-table-pagination{flex:1}.ezui-table ::ng-deep table{border-radius:var(--tui-radius-l)}.ezui-table ::ng-deep th{background-color:var(--tui-background-base-alt)!important}.ezui-table ::ng-deep .ezui-table-expander{padding:0}.ezui-table th[tuiTh]{align-items:center}.ezui-table .forcefullsize{width:100%!important}.ezui-table tui-block-status{padding-top:20px;padding-bottom:20px}.ezui-table .rowrlickable{cursor:pointer}\n"] }]
|
|
3588
3610
|
}], ctorParameters: () => [{ type: EzUITableFilterService }], propDecorators: { tableHeader: [{
|
|
3589
3611
|
type: ContentChild,
|
|
3590
3612
|
args: ['tableHeader', { static: false }]
|
|
@@ -3609,6 +3631,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
3609
3631
|
type: Input
|
|
3610
3632
|
}], expandable: [{
|
|
3611
3633
|
type: Input
|
|
3634
|
+
}], clickable: [{
|
|
3635
|
+
type: Input
|
|
3612
3636
|
}], values: [{
|
|
3613
3637
|
type: Input
|
|
3614
3638
|
}], storageKey: [{
|
|
@@ -3621,6 +3645,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
3621
3645
|
type: Output
|
|
3622
3646
|
}], onRowExpanded: [{
|
|
3623
3647
|
type: Output
|
|
3648
|
+
}], onRowClick: [{
|
|
3649
|
+
type: Output
|
|
3624
3650
|
}], onPresetChange: [{
|
|
3625
3651
|
type: Output
|
|
3626
3652
|
}], pageSize: [{
|