@acorex/components 7.11.6 → 7.12.1
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/button/lib/button-item-list.component.d.ts +1 -1
- package/button/lib/button-item.component.d.ts +1 -1
- package/button/lib/button.module.d.ts +1 -1
- package/calendar/lib/calendar.component.d.ts +1 -1
- package/chips/lib/chips.component.d.ts +2 -1
- package/common/lib/classes/datalist.class.d.ts +3 -3
- package/common/lib/common.module.d.ts +1 -2
- package/common/lib/directives/ripple.directive.d.ts +1 -1
- package/data-table/index.d.ts +1 -2
- package/data-table/lib/columns/data-table-column.d.ts +2 -2
- package/data-table/lib/columns/data-text-column.component.d.ts +2 -2
- package/data-table/lib/columns/row-command-column.component.d.ts +5 -5
- package/data-table/lib/columns/row-index-column.component.d.ts +2 -2
- package/data-table/lib/columns/row-select-column.component.d.ts +2 -2
- package/data-table/lib/data-table.component.d.ts +6 -2
- package/datetime-box/lib/datetime-box.component.d.ts +2 -2
- package/esm2022/action-sheet/lib/action-sheet.component.mjs +2 -2
- package/esm2022/alert/lib/alert.component.mjs +2 -2
- package/esm2022/avatar/lib/avatar.component.mjs +2 -2
- package/esm2022/badge/lib/badge.component.mjs +2 -2
- package/esm2022/breadcrumbs/lib/breadcrumbs.component.mjs +2 -2
- package/esm2022/button/lib/button-item-list.component.mjs +32 -20
- package/esm2022/button/lib/button-item.component.mjs +2 -2
- package/esm2022/button/lib/button.component.mjs +2 -2
- package/esm2022/button/lib/button.module.mjs +5 -5
- package/esm2022/button-group/lib/button-group.component.mjs +2 -2
- package/esm2022/calendar/lib/calendar-range.component.mjs +2 -2
- package/esm2022/calendar/lib/calendar.class.mjs +1 -1
- package/esm2022/calendar/lib/calendar.component.mjs +10 -12
- package/esm2022/check-box/lib/check-box.component.mjs +2 -2
- package/esm2022/chips/lib/chips.component.mjs +6 -5
- package/esm2022/circular-progress/lib/circular-progress.component.mjs +2 -2
- package/esm2022/collapse/lib/collapse.component.mjs +3 -3
- package/esm2022/color-box/lib/color-box.component.mjs +2 -2
- package/esm2022/color-box/lib/color-box.module.mjs +1 -1
- package/esm2022/color-palette/lib/color-palette.component.mjs +2 -2
- package/esm2022/common/index.mjs +1 -1
- package/esm2022/common/lib/classes/datalist.class.mjs +3 -3
- package/esm2022/common/lib/classes/datasource.class.mjs +1 -1
- package/esm2022/common/lib/classes/events.class.mjs +1 -1
- package/esm2022/common/lib/common.module.mjs +4 -25
- package/esm2022/common/lib/directives/ripple.directive.mjs +4 -3
- package/esm2022/data-pager/lib/data-pager.component.mjs +2 -2
- package/esm2022/data-table/index.mjs +2 -3
- package/esm2022/data-table/lib/columns/data-table-column.mjs +2 -2
- package/esm2022/data-table/lib/columns/data-text-column.component.mjs +11 -13
- package/esm2022/data-table/lib/columns/row-command-column.component.mjs +87 -78
- package/esm2022/data-table/lib/columns/row-index-column.component.mjs +14 -18
- package/esm2022/data-table/lib/columns/row-select-column.component.mjs +23 -25
- package/esm2022/data-table/lib/data-table.component.mjs +47 -34
- package/esm2022/data-table/lib/data-table.module.mjs +11 -11
- package/esm2022/datetime-box/lib/datetime-box.component.mjs +5 -5
- package/esm2022/datetime-picker/lib/datetime-picker.component.mjs +2 -2
- package/esm2022/dialog/lib/dialog.component.mjs +2 -2
- package/esm2022/drawer/lib/drawer-container.component.mjs +1 -1
- package/esm2022/drawer/lib/drawer.component.mjs +4 -4
- package/esm2022/dropdown/lib/dropdown-panel.component.mjs +8 -8
- package/esm2022/form/lib/form-field.component.mjs +2 -2
- package/esm2022/image/lib/image.component.mjs +2 -2
- package/esm2022/label/lib/label.component.mjs +2 -2
- package/esm2022/list/lib/list.component.mjs +6 -10
- package/esm2022/list/lib/list.module.mjs +2 -2
- package/esm2022/loading/lib/loading.component.mjs +2 -2
- package/esm2022/menu/lib/class/root-menu.class.mjs +1 -1
- package/esm2022/menu/lib/menu-item/menu-item.component.mjs +5 -10
- package/esm2022/menu/lib/menu.component.mjs +13 -47
- package/esm2022/menu/lib/menu.module.mjs +3 -14
- package/esm2022/navbar/lib/navbar.component.mjs +2 -2
- package/esm2022/notification/lib/notification.component.mjs +2 -2
- package/esm2022/number-box/lib/number-box.component.mjs +2 -2
- package/esm2022/otp/lib/otp.component.mjs +5 -5
- package/esm2022/otp/lib/otp.module.mjs +2 -2
- package/esm2022/picker/lib/picker.component.mjs +2 -2
- package/esm2022/popup/lib/popup.component.mjs +2 -2
- package/esm2022/popup/lib/popup.interface.mjs +1 -1
- package/esm2022/popup/lib/popup.service.mjs +2 -2
- package/esm2022/progress-bar/lib/progress-bar.component.mjs +2 -2
- package/esm2022/radio/lib/radio.component.mjs +2 -2
- package/esm2022/range-slider/lib/range-slider.component.mjs +2 -2
- package/esm2022/result/lib/result.component.mjs +2 -2
- package/esm2022/routing-progress/lib/routing-progress.component.mjs +2 -2
- package/esm2022/scheduler/lib/scheduler.component.mjs +2 -2
- package/esm2022/search-box/lib/search-box.component.mjs +2 -2
- package/esm2022/select-box/index.mjs +1 -2
- package/esm2022/select-box/lib/select-box.component.mjs +2 -2
- package/esm2022/select-box/lib/select-box.module.mjs +1 -1
- package/esm2022/selection-list/lib/selection-list.component.mjs +2 -2
- package/esm2022/side-menu/lib/side-menu.component.mjs +2 -2
- package/esm2022/side-menu/lib/side-menu.module.mjs +5 -5
- package/esm2022/skeleton/lib/skeleton.component.mjs +2 -2
- package/esm2022/switch/lib/switch.component.mjs +2 -2
- package/esm2022/tabs/lib/tabs.component.mjs +4 -4
- package/esm2022/tag/lib/tag.component.mjs +2 -2
- package/esm2022/text-area/lib/text-area.component.mjs +7 -4
- package/esm2022/text-box/lib/text-box.component.mjs +5 -4
- package/esm2022/toast/lib/toast.component.mjs +2 -2
- package/esm2022/toast/lib/toast.service.mjs +2 -3
- package/esm2022/tooltip/lib/tooltip.component.mjs +2 -2
- package/esm2022/uploader/lib/uploader-list.component.mjs +3 -3
- package/fesm2022/acorex-components-action-sheet.mjs +2 -2
- package/fesm2022/acorex-components-action-sheet.mjs.map +1 -1
- package/fesm2022/acorex-components-alert.mjs +2 -2
- package/fesm2022/acorex-components-alert.mjs.map +1 -1
- package/fesm2022/acorex-components-avatar.mjs +2 -2
- package/fesm2022/acorex-components-avatar.mjs.map +1 -1
- package/fesm2022/acorex-components-badge.mjs +2 -2
- package/fesm2022/acorex-components-badge.mjs.map +1 -1
- package/fesm2022/acorex-components-breadcrumbs.mjs +2 -2
- package/fesm2022/acorex-components-breadcrumbs.mjs.map +1 -1
- package/fesm2022/acorex-components-button-group.mjs +2 -2
- package/fesm2022/acorex-components-button-group.mjs.map +1 -1
- package/fesm2022/acorex-components-button.mjs +36 -24
- package/fesm2022/acorex-components-button.mjs.map +1 -1
- package/fesm2022/acorex-components-calendar.mjs +11 -13
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +2 -2
- package/fesm2022/acorex-components-chips.mjs +5 -4
- package/fesm2022/acorex-components-chips.mjs.map +1 -1
- package/fesm2022/acorex-components-circular-progress.mjs +2 -2
- package/fesm2022/acorex-components-circular-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-collapse.mjs +2 -2
- package/fesm2022/acorex-components-collapse.mjs.map +1 -1
- package/fesm2022/acorex-components-color-box.mjs +2 -2
- package/fesm2022/acorex-components-color-box.mjs.map +1 -1
- package/fesm2022/acorex-components-color-palette.mjs +2 -2
- package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
- package/fesm2022/acorex-components-common.mjs +46 -65
- package/fesm2022/acorex-components-common.mjs.map +1 -1
- package/fesm2022/acorex-components-data-pager.mjs +2 -2
- package/fesm2022/acorex-components-data-pager.mjs.map +1 -1
- package/fesm2022/acorex-components-data-table.mjs +247 -233
- package/fesm2022/acorex-components-data-table.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-box.mjs +4 -4
- package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +2 -2
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-dialog.mjs +2 -2
- package/fesm2022/acorex-components-dialog.mjs.map +1 -1
- package/fesm2022/acorex-components-drawer.mjs +3 -3
- package/fesm2022/acorex-components-drawer.mjs.map +1 -1
- package/fesm2022/acorex-components-dropdown.mjs +6 -6
- package/fesm2022/acorex-components-dropdown.mjs.map +1 -1
- package/fesm2022/acorex-components-form.mjs +2 -2
- package/fesm2022/acorex-components-form.mjs.map +1 -1
- package/fesm2022/acorex-components-image.mjs +2 -2
- package/fesm2022/acorex-components-image.mjs.map +1 -1
- package/fesm2022/acorex-components-label.mjs +2 -2
- package/fesm2022/acorex-components-label.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +4 -8
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +2 -2
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-menu.mjs +17 -66
- package/fesm2022/acorex-components-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-navbar.mjs +2 -2
- package/fesm2022/acorex-components-navbar.mjs.map +1 -1
- package/fesm2022/acorex-components-notification.mjs +2 -2
- package/fesm2022/acorex-components-notification.mjs.map +1 -1
- package/fesm2022/acorex-components-number-box.mjs +2 -2
- package/fesm2022/acorex-components-number-box.mjs.map +1 -1
- package/fesm2022/acorex-components-otp.mjs +4 -4
- package/fesm2022/acorex-components-otp.mjs.map +1 -1
- package/fesm2022/acorex-components-picker.mjs +2 -2
- package/fesm2022/acorex-components-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-popup.mjs +3 -3
- package/fesm2022/acorex-components-popup.mjs.map +1 -1
- package/fesm2022/acorex-components-progress-bar.mjs +2 -2
- package/fesm2022/acorex-components-progress-bar.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +2 -2
- package/fesm2022/acorex-components-range-slider.mjs +2 -2
- package/fesm2022/acorex-components-range-slider.mjs.map +1 -1
- package/fesm2022/acorex-components-result.mjs +2 -2
- package/fesm2022/acorex-components-result.mjs.map +1 -1
- package/fesm2022/acorex-components-routing-progress.mjs +2 -2
- package/fesm2022/acorex-components-routing-progress.mjs.map +1 -1
- package/fesm2022/acorex-components-scheduler.mjs +2 -2
- package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
- package/fesm2022/acorex-components-search-box.mjs +1 -1
- package/fesm2022/acorex-components-search-box.mjs.map +1 -1
- package/fesm2022/acorex-components-select-box.mjs +2 -2
- package/fesm2022/acorex-components-select-box.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +2 -2
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-side-menu.mjs +6 -6
- package/fesm2022/acorex-components-side-menu.mjs.map +1 -1
- package/fesm2022/acorex-components-skeleton.mjs +2 -2
- package/fesm2022/acorex-components-skeleton.mjs.map +1 -1
- package/fesm2022/acorex-components-switch.mjs +2 -2
- package/fesm2022/acorex-components-switch.mjs.map +1 -1
- package/fesm2022/acorex-components-tabs.mjs +3 -3
- package/fesm2022/acorex-components-tabs.mjs.map +1 -1
- package/fesm2022/acorex-components-tag.mjs +2 -2
- package/fesm2022/acorex-components-tag.mjs.map +1 -1
- package/fesm2022/acorex-components-text-area.mjs +7 -4
- package/fesm2022/acorex-components-text-area.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +5 -4
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/fesm2022/acorex-components-toast.mjs +3 -4
- package/fesm2022/acorex-components-toast.mjs.map +1 -1
- package/fesm2022/acorex-components-tooltip.mjs +2 -2
- package/fesm2022/acorex-components-tooltip.mjs.map +1 -1
- package/fesm2022/acorex-components-uploader.mjs +2 -2
- package/fesm2022/acorex-components-uploader.mjs.map +1 -1
- package/list/lib/list.component.d.ts +1 -1
- package/menu/lib/class/root-menu.class.d.ts +1 -1
- package/menu/lib/menu-item/menu-item.component.d.ts +3 -4
- package/menu/lib/menu.component.d.ts +5 -12
- package/otp/lib/otp.component.d.ts +2 -2
- package/package.json +10 -10
- package/select-box/index.d.ts +0 -1
- package/side-menu/lib/side-menu.module.d.ts +1 -1
- package/text-area/lib/text-area.component.d.ts +2 -1
@@ -4,7 +4,6 @@ import { __decorate, __metadata } from 'tslib';
|
|
4
4
|
import * as i1$1 from '@acorex/core/format';
|
5
5
|
import { AXFormatService, AXFormatModule } from '@acorex/core/format';
|
6
6
|
import { Memorize } from '@acorex/core/memorize';
|
7
|
-
import * as i2$1 from '@acorex/components/common';
|
8
7
|
import { MXBaseComponent, convertArrayToDataSource, AXListDataSource, AXPagedComponent, AXCommonModule } from '@acorex/components/common';
|
9
8
|
import * as i2 from '@angular/cdk/scrolling';
|
10
9
|
import { CdkVirtualScrollViewport, ScrollingModule } from '@angular/cdk/scrolling';
|
@@ -13,7 +12,7 @@ import * as i1 from '@angular/common';
|
|
13
12
|
import { CommonModule } from '@angular/common';
|
14
13
|
import * as i3 from '@acorex/components/result';
|
15
14
|
import { AXResultModule } from '@acorex/components/result';
|
16
|
-
import * as
|
15
|
+
import * as i3$1 from '@acorex/components/decorators';
|
17
16
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
18
17
|
import * as i5 from '@acorex/components/skeleton';
|
19
18
|
import { AXSkeletonModule } from '@acorex/components/skeleton';
|
@@ -21,11 +20,11 @@ import * as i6 from '@acorex/components/button';
|
|
21
20
|
import { AXButtonModule } from '@acorex/components/button';
|
22
21
|
import * as i7 from '@acorex/core/translation';
|
23
22
|
import { AXTranslationModule } from '@acorex/core/translation';
|
24
|
-
import
|
25
|
-
import * as i3$1 from '@acorex/components/loading';
|
23
|
+
import * as i2$1 from '@acorex/components/loading';
|
26
24
|
import { AXLoadingModule } from '@acorex/components/loading';
|
27
|
-
import * as
|
25
|
+
import * as i5$1 from '@acorex/components/dropdown';
|
28
26
|
import { AXDropdownModule } from '@acorex/components/dropdown';
|
27
|
+
import { AXUnsubscriber } from '@acorex/core/utils';
|
29
28
|
|
30
29
|
class AXDataTableColumnComponent {
|
31
30
|
constructor() {
|
@@ -77,10 +76,9 @@ class AXDataTableTextColumnComponent extends AXDataTableColumnComponent {
|
|
77
76
|
return !this.format ? value : this.formatService.format(value, this.format, ...options);
|
78
77
|
}
|
79
78
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXDataTableTextColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
80
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXDataTableTextColumnComponent, selector: "ax-text-column", inputs: { width: "width", caption: "caption", headerTemplate: "headerTemplate", cellTemplate: "cellTemplate", allowSorting: "allowSorting", fixed: "fixed", dataField: "dataField", format: "format", formatOptions: "formatOptions" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXDataTableTextColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
81
|
-
|
82
|
-
|
83
|
-
</ng-template>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
79
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXDataTableTextColumnComponent, selector: "ax-text-column", inputs: { width: "width", caption: "caption", headerTemplate: "headerTemplate", cellTemplate: "cellTemplate", allowSorting: "allowSorting", fixed: "fixed", dataField: "dataField", format: "format", formatOptions: "formatOptions" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXDataTableTextColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: ` <ng-template let-row>
|
80
|
+
{{ getDisplayText(row.data, this.dataField) }}
|
81
|
+
</ng-template>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
84
82
|
}
|
85
83
|
__decorate([
|
86
84
|
Memorize(),
|
@@ -92,10 +90,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImpor
|
|
92
90
|
type: Component,
|
93
91
|
args: [{
|
94
92
|
selector: 'ax-text-column',
|
95
|
-
template: `
|
96
|
-
|
97
|
-
|
98
|
-
</ng-template>`,
|
93
|
+
template: ` <ng-template let-row>
|
94
|
+
{{ getDisplayText(row.data, this.dataField) }}
|
95
|
+
</ng-template>`,
|
99
96
|
encapsulation: ViewEncapsulation.None,
|
100
97
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
101
98
|
providers: [{ provide: AXDataTableColumnComponent, useExisting: AXDataTableTextColumnComponent }],
|
@@ -130,24 +127,24 @@ class AXDataTableComponent extends MXBaseComponent {
|
|
130
127
|
this.selectedRowsChange = new EventEmitter();
|
131
128
|
this._selectedRows = [];
|
132
129
|
this.itemHeight = 40;
|
133
|
-
this.width =
|
134
|
-
this.height =
|
130
|
+
this.width = '100%';
|
131
|
+
this.height = '100%';
|
135
132
|
this.onScrolledIndexChanged = new EventEmitter();
|
136
133
|
}
|
137
134
|
startFixedColumn() {
|
138
|
-
return this.columns?.toArray().filter(c => c.fixed == 'start') ?? [];
|
135
|
+
return this.columns?.toArray().filter((c) => c.fixed == 'start') ?? [];
|
139
136
|
}
|
140
137
|
endFixedColumn() {
|
141
|
-
return this.columns?.toArray().filter(c => c.fixed == 'end') ?? [];
|
138
|
+
return this.columns?.toArray().filter((c) => c.fixed == 'end') ?? [];
|
142
139
|
}
|
143
140
|
notFixedColumn() {
|
144
|
-
return this.columns?.toArray().filter(c => !c.fixed) ?? [];
|
141
|
+
return this.columns?.toArray().filter((c) => !c.fixed) ?? [];
|
145
142
|
}
|
146
143
|
notFixedColumnCount() {
|
147
|
-
return this.columns?.toArray().filter(c => !c.fixed).length ?? 0;
|
144
|
+
return this.columns?.toArray().filter((c) => !c.fixed).length ?? 0;
|
148
145
|
}
|
149
146
|
fixedColumnCount() {
|
150
|
-
return this.columns?.toArray().filter(c => c.fixed).length ?? 0;
|
147
|
+
return this.columns?.toArray().filter((c) => c.fixed).length ?? 0;
|
151
148
|
}
|
152
149
|
get focusedRow() {
|
153
150
|
return this._focusedRow;
|
@@ -167,7 +164,7 @@ class AXDataTableComponent extends MXBaseComponent {
|
|
167
164
|
this.selectedRows = [...this.selectedRows, ...rows];
|
168
165
|
}
|
169
166
|
unSelectRows(...rows) {
|
170
|
-
this.selectedRows = this.selectedRows.filter(c => !rows.includes(c));
|
167
|
+
this.selectedRows = this.selectedRows.filter((c) => !rows.includes(c));
|
171
168
|
}
|
172
169
|
trackByIdx(i) {
|
173
170
|
return i;
|
@@ -177,14 +174,10 @@ class AXDataTableComponent extends MXBaseComponent {
|
|
177
174
|
this.listDataSource = new AXListDataSource({
|
178
175
|
source: this.dataSource,
|
179
176
|
});
|
180
|
-
this.listDataSource.source
|
181
|
-
.onLoadingChanged
|
182
|
-
.subscribe((data) => {
|
177
|
+
this.listDataSource.source.onLoadingChanged.subscribe((data) => {
|
183
178
|
this.isLoading = data;
|
184
179
|
});
|
185
|
-
this.listDataSource.source
|
186
|
-
.onChanged
|
187
|
-
.subscribe((data) => {
|
180
|
+
this.listDataSource.source.onChanged.subscribe((data) => {
|
188
181
|
this.totalRows = data.totalCount;
|
189
182
|
this.hasItems = data.totalCount > 0;
|
190
183
|
setTimeout(() => {
|
@@ -202,27 +195,44 @@ class AXDataTableComponent extends MXBaseComponent {
|
|
202
195
|
}
|
203
196
|
ngDoCheck() {
|
204
197
|
//this.copyFixedColumns();
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
}
|
214
|
-
this.height = `calc(100% - ${((this.headerContainer?.nativeElement.clientHeight ?? 0) + (this.footerContainer?.nativeElement.clientHeight ?? 0))}px)`;
|
198
|
+
this.updateHScroll();
|
199
|
+
//
|
200
|
+
this.updateWidth();
|
201
|
+
this.updateHeight();
|
202
|
+
//
|
203
|
+
this.updateTotalCount();
|
204
|
+
}
|
205
|
+
updateTotalCount() {
|
215
206
|
this.startRowIndex = this.lastIndex;
|
216
207
|
if (this.startRowIndex < 1)
|
217
208
|
this.startRowIndex = 1;
|
218
209
|
if (this.startRowIndex > this.totalRows)
|
219
210
|
this.startRowIndex = this.totalRows;
|
220
211
|
}
|
212
|
+
updateHeight() {
|
213
|
+
this.height = `calc(100% - ${(this.headerContainer?.nativeElement.clientHeight ?? 0) +
|
214
|
+
(this.footerContainer?.nativeElement.clientHeight ?? 0)}px)`;
|
215
|
+
}
|
216
|
+
updateWidth() {
|
217
|
+
if (this.columns && this.columns.length) {
|
218
|
+
const sumPx = sum(this.columns
|
219
|
+
.toArray()
|
220
|
+
.map((c) => (typeof c.width == 'number' ? c.width : Number(c.width.replace('px', '')))));
|
221
|
+
this.width = `${Math.max(sumPx, this.getHostElement().clientWidth - 5)}px`;
|
222
|
+
}
|
223
|
+
}
|
224
|
+
updateHScroll() {
|
225
|
+
if (this.headerContainer) {
|
226
|
+
const headerContainer = this.headerContainer.nativeElement;
|
227
|
+
const left = this.getHostElement().querySelector('.cdk-virtual-scrollable').scrollLeft;
|
228
|
+
headerContainer.style.transform = `translateX(${-left}px)`;
|
229
|
+
}
|
230
|
+
}
|
221
231
|
// Function to copy fixed columns
|
222
232
|
copyFixedColumns() {
|
223
233
|
const originalRows = Array.from(this.viewport._contentWrapper.nativeElement.querySelectorAll('tr'));
|
224
234
|
const fixedColumnTable = this.getHostElement().querySelector('.ax-body-fixed-columns > table > tbody');
|
225
|
-
fixedColumnTable.querySelectorAll('tr').forEach(n => n.remove());
|
235
|
+
fixedColumnTable.querySelectorAll('tr').forEach((n) => n.remove());
|
226
236
|
for (const row of originalRows) {
|
227
237
|
const fixedCells = Array.from(row.querySelectorAll('[data-fixed="start"]'));
|
228
238
|
const fixedRow = document.createElement('tr');
|
@@ -254,7 +264,7 @@ class AXDataTableComponent extends MXBaseComponent {
|
|
254
264
|
}
|
255
265
|
handleColumnClick(e, column) {
|
256
266
|
if (column instanceof AXDataTableTextColumnComponent) {
|
257
|
-
const sort = this.dataSource.query.sort.find(c => c.field == column.dataField);
|
267
|
+
const sort = this.dataSource.query.sort.find((c) => c.field == column.dataField);
|
258
268
|
if (!sort) {
|
259
269
|
this.dataSource.query.sort.push({ field: column.dataField, dir: 'asc' });
|
260
270
|
}
|
@@ -263,7 +273,7 @@ class AXDataTableComponent extends MXBaseComponent {
|
|
263
273
|
sort.dir = 'desc';
|
264
274
|
}
|
265
275
|
else {
|
266
|
-
this.dataSource.query.sort = this.dataSource.query.sort.filter(c => c != sort);
|
276
|
+
this.dataSource.query.sort = this.dataSource.query.sort.filter((c) => c != sort);
|
267
277
|
}
|
268
278
|
}
|
269
279
|
this.refresh();
|
@@ -271,20 +281,20 @@ class AXDataTableComponent extends MXBaseComponent {
|
|
271
281
|
}
|
272
282
|
getSort(column) {
|
273
283
|
if (column instanceof AXDataTableTextColumnComponent) {
|
274
|
-
const sort = this.dataSource.query.sort.find(c => c.field == column.dataField);
|
284
|
+
const sort = this.dataSource.query.sort.find((c) => c.field == column.dataField);
|
275
285
|
return sort ? (sort.dir == 'asc' ? 'ax-icon-arrow-long-down' : 'ax-icon-arrow-long-up') : undefined;
|
276
286
|
}
|
277
287
|
return undefined;
|
278
288
|
}
|
279
|
-
|
280
|
-
|
289
|
+
_handleOnScroll(e) {
|
290
|
+
this.updateHScroll();
|
281
291
|
}
|
282
292
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXDataTableComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
283
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXDataTableComponent, selector: "ax-data-table", inputs: { rowTemplate: "rowTemplate", emptyTemplate: "emptyTemplate", loadingTemplate: "loadingTemplate", showHeader: "showHeader", fetchDataMode: "fetchDataMode", dataSource: "dataSource", focusedRow: "focusedRow", selectedRows: "selectedRows", itemHeight: "itemHeight" }, outputs: { onPageChanged: "onPageChanged", focusedRowChange: "focusedRowChange", selectedRowsChange: "selectedRowsChange", onScrolledIndexChanged: "onScrolledIndexChanged" }, providers: [{ provide: AXPagedComponent, useExisting: AXDataTableComponent }], queries: [{ propertyName: "columns", predicate: AXDataTableColumnComponent }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, static: true }, { propertyName: "headerContainer", first: true, predicate: ["headerContainer"], descendants: true }, { propertyName: "footerContainer", first: true, predicate: ["footerContainer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-header\">\n</ng-content>\n<!------------------- Header contents ------------------->\n<div class=\"ax-header-content\" *ngIf=\"showHeader\">\n <div class=\"ax-header-columns ax-header-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: 10px;\">\n </colgroup>\n <thead>\n <tr>\n <!------------------- start fixed column ------------------->\n <th *ngFor=\"let c of startFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\" class=\"ax-column-fixed\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption }}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <!------------------- not fixed column ------------------->\n <th [attr.colspan]=\"notFixedColumnCount()\">\n\n </th>\n </tr>\n </thead>\n </table>\n </div>\n <div class=\"ax-header-columns\">\n <table tabindex=\"0\" [style.width]=\"width\" #headerContainer>\n <colgroup>\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: auto;\">\n </colgroup>\n <thead>\n <tr>\n <th *ngFor=\"let c of startFixedColumn()\">\n </th>\n <th *ngFor=\"let c of notFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption}}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <th></th>\n </tr>\n </thead>\n </table>\n </div>\n</div>\n<!------------------- Body contents ------------------->\n<div [style.height]=\"height\" class=\"ax-body-content\">\n <div class=\"ax-body-columns ax-body-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n </tbody>\n </table>\n </div>\n <div class=\"ax-body-columns\">\n <div cdkVirtualScrollingElement [style.height]=\"'100%'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.--item-height]=\"itemHeight+'px'\"\n (scrolledIndexChange)=\"_handleOnscrolledIndexChange($event)\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n <ng-container\n *cdkVirtualFor=\"let item of listDataSource; let i = index; trackBy: trackByIdx;let rIndex=index;\"\n (viewChange)=\"onViewChange($event)\">\n <ng-template [ngIf]=\"rowTemplate\" [ngIfElse]=\"rowTpl\">\n <ng-container *ngTemplateOutlet=\"rowTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </ng-template>\n <ng-template #rowTpl>\n <tr [class.ax-state-focused]=\"focusedRow && item===focusedRow\" [attr.data-index]=\"rIndex\"\n [class.ax-state-selected]=\"selectedRows.includes(item)\" (click)=\"handleRowClick($event,item)\">\n <!------------------- start fixed column ------------------->\n <ng-container *ngFor=\"let c of startFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\" [attr.data-fixed]=\"c.fixed\"\n class=\"ax-column-fixed\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <!------------------- Not fixed column ------------------->\n <ng-container *ngFor=\"let c of notFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <td></td>\n </tr>\n </ng-template>\n </ng-container>\n </tbody>\n </table>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n<div class=\"ax-table-footer\" #footerContainer>\n <div class=\"ax-table-info\">\n <div>\n Showing {{startRowIndex}} of {{totalRows}} items\n </div>\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"refresh()\">\n <ax-icon icon=\"ax-icon ax-icon-refresh\"></ax-icon>\n </ax-button>\n </div>\n <ng-content select=\"ax-footer\">\n </ng-content>\n</div>\n\n<!-- Loading Template -->\n<ng-template #loadingTpl>\n <!-- Custom Loading Template -->\n <ng-container *ngIf=\"loadingTemplate;else defaultLoadingTpl\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\n </ng-container>\n </ng-container>\n <!-- Default Loading Template -->\n <ng-template #defaultLoadingTpl>\n <ax-skeleton [animated]=\"true\"></ax-skeleton>\n </ng-template>\n</ng-template>\n<!-- Empty Template -->\n<ng-template #emptyTpl>\n <tr>\n <td [attr.colspan]=\"columns.length\">\n <ng-template [ngIf]=\"emptyTemplate\" [ngIfElse]=\"defaultEmptyTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n </ng-template>\n <ng-template #defaultEmptyTemplate>\n <ax-result type=\"empty\" caption=\" {{'common.no-result-found' | trans }}\"></ax-result>\n </ng-template>\n </td>\n </tr>\n</ng-template>", styles: [".ax-dark ax-data-table .ax-header-content th.ax-interactive:hover{background-color:rgba(var(--ax-color-neutral-500))!important}.ax-dark ax-data-table .ax-body-content tr:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-800))!important;color:rgba(var(--ax-color-primary-fore))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-900))!important;color:rgba(var(--ax-color-primary-fore))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-800))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-950))!important;color:rgba(var(--ax-color-primary-fore))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-800))!important}ax-data-table{border-radius:var(--ax-rounded-border-default);border:1px solid;border-color:rgba(var(--ax-color-border-default));height:100%;font-size:.875rem;overflow-y:hidden;overflow-x:hidden}ax-data-table table{table-layout:fixed}ax-data-table .ax-header-content{height:50px;overflow:hidden;position:relative}ax-data-table .ax-header-content .ax-header-fixed-columns{position:absolute;z-index:1;pointer-events:none}ax-data-table .ax-header-content .ax-header-fixed-columns th.ax-column-fixed{pointer-events:auto}ax-data-table .ax-header-content .ax-header-fixed-columns th:not(.ax-column-fixed){visibility:hidden;background-color:transparent}ax-data-table .ax-header-content .ax-header-columns{height:100%}ax-data-table .ax-header-content .ax-header-columns>table{height:100%;border-start-start-radius:var(--ax-rounded-border-default);border-start-end-radius:var(--ax-rounded-border-default);border-collapse:collapse;overflow:hidden}ax-data-table .ax-header-content .ax-header-columns>table th{text-transform:uppercase;background-color:rgba(var(--ax-color-on-surface));font-weight:500;text-align:start;padding:.875rem 1rem;border-block-end:1px solid;border-inline-end:1px solid;border-color:rgba(var(--ax-color-border-default))}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive{cursor:pointer}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive:hover{background-color:rgba(var(--ax-color-neutral-200))}ax-data-table .ax-header-content .ax-header-columns>table th .ax-caption{display:flex;gap:.5rem;align-items:center}ax-data-table .ax-header-content .ax-header-columns>table th:last-child{border-inline-end:0px solid}ax-data-table .ax-body-content{position:relative}ax-data-table .ax-body-content .ax-body-fixed-columns{position:absolute;z-index:1;pointer-events:none}ax-data-table .ax-body-content .ax-body-columns{height:100%}ax-data-table .ax-body-content .ax-body-columns table{border-collapse:collapse}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) td{background-color:rgba(var(--ax-color-on-surface))}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) ax-skeleton{width:25%}ax-data-table .ax-body-content .ax-body-columns table tr{height:40px}ax-data-table .ax-body-content .ax-body-columns table tr:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-200))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-200));color:rgba(var(--ax-color-primary-fore-lighten))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-300))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-300));color:rgba(var(--ax-color-primary-fore-lighten))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-400));color:rgba(var(--ax-color-primary-fore))}ax-data-table .ax-body-content .ax-body-columns table td{min-width:2rem;padding:.5rem 1rem;border-block-end:1px solid;border-inline-end:1px solid;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface));position:relative}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column{background-color:rgba(var(--ax-color-on-surface))!important}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content{justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content span{text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:100%}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content{position:relative}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content>div{position:absolute;top:50%;transform:translateY(-50%);inset-inline-start:0;display:flex;flex-direction:row;align-items:center;width:100%;justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button{background-color:transparent;border:none;color:rgba(var(--ax-color-ghost-fore));position:relative;padding:.25rem;line-height:1;border-radius:var(--ax-rounded-border-default);font-size:1rem;cursor:pointer;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover:not(ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-selected,ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-disabled){opacity:.75}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:active{opacity:1}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-ripple{background-color:rgba(var(--ax-color-ghost-fore),.5)!important}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-icon{font-size:1.25rem}ax-data-table .ax-body-content .ax-body-columns table td>.ax-content{display:flex;justify-content:flex-start;width:100%}ax-data-table .ax-body-content .ax-body-columns table td:last-child{border-inline-end:0px solid}ax-data-table .ax-body-content .ax-body-columns table td ax-skeleton{height:.875rem;border-radius:calc(var(--ax-rounded-border-default) / 1.5);width:35%}ax-data-table .ax-table-footer{border-top:1px solid;border-color:rgba(var(--ax-color-border-default));border-collapse:collapse;overflow:hidden;padding:.5rem .875rem}ax-data-table .ax-table-footer .ax-table-info{display:flex;flex:1;flex-direction:row;justify-content:space-between;align-items:center}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i2.CdkVirtualScrollableElement, selector: "[cdkVirtualScrollingElement]" }, { kind: "component", type: i3.AXResultComponent, selector: "ax-result", inputs: ["type", "caption", "description"] }, { kind: "component", type: i4.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i5.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: i6.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "trans" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
293
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXDataTableComponent, selector: "ax-data-table", inputs: { rowTemplate: "rowTemplate", emptyTemplate: "emptyTemplate", loadingTemplate: "loadingTemplate", showHeader: "showHeader", fetchDataMode: "fetchDataMode", dataSource: "dataSource", focusedRow: "focusedRow", selectedRows: "selectedRows", itemHeight: "itemHeight" }, outputs: { onPageChanged: "onPageChanged", focusedRowChange: "focusedRowChange", selectedRowsChange: "selectedRowsChange", onScrolledIndexChanged: "onScrolledIndexChanged" }, providers: [{ provide: AXPagedComponent, useExisting: AXDataTableComponent }], queries: [{ propertyName: "columns", predicate: AXDataTableColumnComponent }], viewQueries: [{ propertyName: "viewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true, static: true }, { propertyName: "headerContainer", first: true, predicate: ["headerContainer"], descendants: true }, { propertyName: "footerContainer", first: true, predicate: ["footerContainer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<ng-content select=\"ax-header\">\n</ng-content>\n<!------------------- Header contents ------------------->\n<div class=\"ax-header-content\" *ngIf=\"showHeader\">\n <div class=\"ax-header-columns ax-header-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: 10px;\">\n </colgroup>\n <thead>\n <tr>\n <!------------------- start fixed column ------------------->\n <th *ngFor=\"let c of startFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\" class=\"ax-column-fixed\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption }}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <!------------------- not fixed column ------------------->\n <th [attr.colspan]=\"notFixedColumnCount()\">\n\n </th>\n </tr>\n </thead>\n </table>\n </div>\n <div class=\"ax-header-columns\">\n <table tabindex=\"0\" [style.width]=\"width\" #headerContainer>\n <colgroup>\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: auto;\">\n </colgroup>\n <thead>\n <tr>\n <th *ngFor=\"let c of startFixedColumn()\">\n </th>\n <th *ngFor=\"let c of notFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption}}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <th></th>\n </tr>\n </thead>\n </table>\n </div>\n</div>\n<!------------------- Body contents ------------------->\n<div [style.height]=\"height\" class=\"ax-body-content\">\n <div class=\"ax-body-columns ax-body-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n </tbody>\n </table>\n </div>\n <div class=\"ax-body-columns\">\n <div cdkVirtualScrollingElement [style.height]=\"'100%'\" (scroll)=\"_handleOnScroll($event)\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.--item-height]=\"itemHeight+'px'\"\n (scrolledIndexChange)=\"_handleOnscrolledIndexChange($event)\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n <ng-container\n *cdkVirtualFor=\"let item of listDataSource; let i = index; trackBy: trackByIdx;let rIndex=index;\">\n <ng-template [ngIf]=\"rowTemplate\" [ngIfElse]=\"rowTpl\">\n <ng-container *ngTemplateOutlet=\"rowTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </ng-template>\n <ng-template #rowTpl>\n <tr [class.ax-state-focused]=\"focusedRow && item===focusedRow\" [attr.data-index]=\"rIndex\"\n [class.ax-state-selected]=\"selectedRows.includes(item)\" (click)=\"handleRowClick($event,item)\">\n <!------------------- start fixed column ------------------->\n <ng-container *ngFor=\"let c of startFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\" [attr.data-fixed]=\"c.fixed\"\n class=\"ax-column-fixed\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <!------------------- Not fixed column ------------------->\n <ng-container *ngFor=\"let c of notFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <td></td>\n </tr>\n </ng-template>\n </ng-container>\n </tbody>\n </table>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n<div class=\"ax-table-footer\" #footerContainer>\n <div class=\"ax-table-info\">\n <div>\n Showing {{startRowIndex}} of {{totalRows}} items\n </div>\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"refresh()\">\n <ax-icon icon=\"ax-icon ax-icon-refresh\"></ax-icon>\n </ax-button>\n </div>\n <ng-content select=\"ax-footer\">\n </ng-content>\n</div>\n\n<!-- Loading Template -->\n<ng-template #loadingTpl>\n <!-- Custom Loading Template -->\n <ng-container *ngIf=\"loadingTemplate;else defaultLoadingTpl\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\n </ng-container>\n </ng-container>\n <!-- Default Loading Template -->\n <ng-template #defaultLoadingTpl>\n <ax-skeleton [animated]=\"true\"></ax-skeleton>\n </ng-template>\n</ng-template>\n<!-- Empty Template -->\n<ng-template #emptyTpl>\n <tr>\n <td [attr.colspan]=\"columns.length\">\n <ng-template [ngIf]=\"emptyTemplate\" [ngIfElse]=\"defaultEmptyTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n </ng-template>\n <ng-template #defaultEmptyTemplate>\n <ax-result type=\"empty\" caption=\" {{'common.no-result-found' | trans }}\"></ax-result>\n </ng-template>\n </td>\n </tr>\n</ng-template>", styles: [".ax-dark ax-data-table .ax-header-content th.ax-interactive:hover{--tw-bg-opacity: 1 !important;background-color:rgba(var(--ax-color-neutral),var(--tw-bg-opacity))!important}.ax-dark ax-data-table .ax-body-content tr:hover td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 50%)!important;--tw-text-opacity: 1 !important;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 70%)!important;--tw-text-opacity: 1 !important;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused:hover td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 50%)!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 70%)!important;--tw-text-opacity: 1 !important;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected:hover td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 50%)!important}ax-data-table{height:100%;overflow:hidden;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));font-size:.875rem;line-height:1.25rem}ax-data-table table{table-layout:fixed}ax-data-table .ax-header-content{position:relative;height:3rem;overflow:hidden}ax-data-table .ax-header-content .ax-header-fixed-columns{pointer-events:none;position:absolute;z-index:10}ax-data-table .ax-header-content .ax-header-fixed-columns th.ax-column-fixed{pointer-events:auto}ax-data-table .ax-header-content .ax-header-fixed-columns th:not(.ax-column-fixed){visibility:hidden;background-color:transparent}ax-data-table .ax-header-content .ax-header-columns{height:100%}ax-data-table .ax-header-content .ax-header-columns>table{height:100%;overflow:hidden;border-start-end-radius:var(--ax-rounded-border-default);border-start-start-radius:var(--ax-rounded-border-default)}ax-data-table .ax-header-content .ax-header-columns>table th{border-bottom-width:1px;border-inline-end-width:1px;border-style:solid;border-color:rgba(var(--ax-color-border-default));--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-on-surface),var(--tw-bg-opacity));padding:.75rem 1rem;text-align:start;font-weight:500;text-transform:uppercase}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive{cursor:pointer}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-neutral),var(--tw-bg-opacity)) 30%,white)}ax-data-table .ax-header-content .ax-header-columns>table th .ax-caption{display:flex;align-items:center;gap:.5rem}ax-data-table .ax-header-content .ax-header-columns>table th:last-child{border-inline-end-width:0px}ax-data-table .ax-body-content{position:relative}ax-data-table .ax-body-content .ax-body-fixed-columns{pointer-events:none;position:absolute;z-index:10}ax-data-table .ax-body-content .ax-body-columns{height:100%}ax-data-table .ax-body-content .ax-body-columns table{border-collapse:collapse}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) td{--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-on-surface),var(--tw-bg-opacity))}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) ax-skeleton{width:25%}ax-data-table .ax-body-content .ax-body-columns table tr{height:2.5rem}ax-data-table .ax-body-content .ax-body-columns table tr:hover td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 30%,white)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 30%,white);--tw-text-opacity: 1;color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-text-opacity)),black 30%)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused:hover td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 50%,white)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 50%,white);--tw-text-opacity: 1;color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-text-opacity)),black 30%)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected:hover td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 70%,white);--tw-text-opacity: 1;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))}ax-data-table .ax-body-content .ax-body-columns table td{position:relative;min-width:2rem;border-bottom-width:1px;border-inline-end-width:1px;border-color:rgba(var(--ax-color-border-default));--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem 1rem}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column{--tw-bg-opacity: 1 !important;background-color:rgba(var(--ax-color-on-surface),var(--tw-bg-opacity))!important}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content{justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content span{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content{position:relative}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content>div{position:absolute;inset-inline-start:0px;top:50%;display:flex;width:100%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));align-items:center;justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button{position:relative;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--ax-rounded-border-default);border-style:none;border-color:rgba(var(--ax-color-border-default));background-color:transparent;padding:.25rem;line-height:1;--tw-text-opacity: 1;color:rgba(var(--ax-color-ghost-fore),var(--tw-text-opacity))}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover:not(ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-selected,ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-disabled){opacity:.75}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:active{opacity:1}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-ripple{background-color:rgba(var(--ax-color-ghost-fore),.05)}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-icon{font-size:1.125rem;line-height:1.75rem}ax-data-table .ax-body-content .ax-body-columns table td>.ax-content{display:flex;width:100%;justify-content:flex-start}ax-data-table .ax-body-content .ax-body-columns table td:last-child{border-inline-end-width:0px}ax-data-table .ax-body-content .ax-body-columns table td ax-skeleton{height:.875rem;width:33.333333%;border-radius:.375rem}ax-data-table .ax-table-footer{border-collapse:collapse;overflow:hidden;border-top-width:1px;border-color:rgba(var(--ax-color-border-default));padding:.5rem .875rem}ax-data-table .ax-table-footer .ax-table-info{display:flex;flex:1 1 0%;align-items:center;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: i2.CdkVirtualScrollableElement, selector: "[cdkVirtualScrollingElement]" }, { kind: "component", type: i3.AXResultComponent, selector: "ax-result", inputs: ["type", "caption", "description"] }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i5.AXSkeletonComponent, selector: "ax-skeleton", inputs: ["animated"] }, { kind: "component", type: i6.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange"] }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "trans" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
284
294
|
}
|
285
295
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXDataTableComponent, decorators: [{
|
286
296
|
type: Component,
|
287
|
-
args: [{ selector: 'ax-data-table', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXPagedComponent, useExisting: AXDataTableComponent }], template: "<ng-content select=\"ax-header\">\n</ng-content>\n<!------------------- Header contents ------------------->\n<div class=\"ax-header-content\" *ngIf=\"showHeader\">\n <div class=\"ax-header-columns ax-header-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: 10px;\">\n </colgroup>\n <thead>\n <tr>\n <!------------------- start fixed column ------------------->\n <th *ngFor=\"let c of startFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\" class=\"ax-column-fixed\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption }}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <!------------------- not fixed column ------------------->\n <th [attr.colspan]=\"notFixedColumnCount()\">\n\n </th>\n </tr>\n </thead>\n </table>\n </div>\n <div class=\"ax-header-columns\">\n <table tabindex=\"0\" [style.width]=\"width\" #headerContainer>\n <colgroup>\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: auto;\">\n </colgroup>\n <thead>\n <tr>\n <th *ngFor=\"let c of startFixedColumn()\">\n </th>\n <th *ngFor=\"let c of notFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption}}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <th></th>\n </tr>\n </thead>\n </table>\n </div>\n</div>\n<!------------------- Body contents ------------------->\n<div [style.height]=\"height\" class=\"ax-body-content\">\n <div class=\"ax-body-columns ax-body-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n </tbody>\n </table>\n </div>\n <div class=\"ax-body-columns\">\n <div cdkVirtualScrollingElement [style.height]=\"'100%'\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.--item-height]=\"itemHeight+'px'\"\n (scrolledIndexChange)=\"_handleOnscrolledIndexChange($event)\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n <ng-container\n *cdkVirtualFor=\"let item of listDataSource; let i = index; trackBy: trackByIdx;let rIndex=index;\"\n (viewChange)=\"onViewChange($event)\">\n <ng-template [ngIf]=\"rowTemplate\" [ngIfElse]=\"rowTpl\">\n <ng-container *ngTemplateOutlet=\"rowTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </ng-template>\n <ng-template #rowTpl>\n <tr [class.ax-state-focused]=\"focusedRow && item===focusedRow\" [attr.data-index]=\"rIndex\"\n [class.ax-state-selected]=\"selectedRows.includes(item)\" (click)=\"handleRowClick($event,item)\">\n <!------------------- start fixed column ------------------->\n <ng-container *ngFor=\"let c of startFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\" [attr.data-fixed]=\"c.fixed\"\n class=\"ax-column-fixed\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <!------------------- Not fixed column ------------------->\n <ng-container *ngFor=\"let c of notFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <td></td>\n </tr>\n </ng-template>\n </ng-container>\n </tbody>\n </table>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n<div class=\"ax-table-footer\" #footerContainer>\n <div class=\"ax-table-info\">\n <div>\n Showing {{startRowIndex}} of {{totalRows}} items\n </div>\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"refresh()\">\n <ax-icon icon=\"ax-icon ax-icon-refresh\"></ax-icon>\n </ax-button>\n </div>\n <ng-content select=\"ax-footer\">\n </ng-content>\n</div>\n\n<!-- Loading Template -->\n<ng-template #loadingTpl>\n <!-- Custom Loading Template -->\n <ng-container *ngIf=\"loadingTemplate;else defaultLoadingTpl\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\n </ng-container>\n </ng-container>\n <!-- Default Loading Template -->\n <ng-template #defaultLoadingTpl>\n <ax-skeleton [animated]=\"true\"></ax-skeleton>\n </ng-template>\n</ng-template>\n<!-- Empty Template -->\n<ng-template #emptyTpl>\n <tr>\n <td [attr.colspan]=\"columns.length\">\n <ng-template [ngIf]=\"emptyTemplate\" [ngIfElse]=\"defaultEmptyTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n </ng-template>\n <ng-template #defaultEmptyTemplate>\n <ax-result type=\"empty\" caption=\" {{'common.no-result-found' | trans }}\"></ax-result>\n </ng-template>\n </td>\n </tr>\n</ng-template>", styles: [".ax-dark ax-data-table .ax-header-content th.ax-interactive:hover{background-color:rgba(var(--ax-color-neutral-500))!important}.ax-dark ax-data-table .ax-body-content tr:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-800))!important;color:rgba(var(--ax-color-primary-fore))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-900))!important;color:rgba(var(--ax-color-primary-fore))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-800))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-950))!important;color:rgba(var(--ax-color-primary-fore))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-800))!important}ax-data-table{border-radius:var(--ax-rounded-border-default);border:1px solid;border-color:rgba(var(--ax-color-border-default));height:100%;font-size:.875rem;overflow-y:hidden;overflow-x:hidden}ax-data-table table{table-layout:fixed}ax-data-table .ax-header-content{height:50px;overflow:hidden;position:relative}ax-data-table .ax-header-content .ax-header-fixed-columns{position:absolute;z-index:1;pointer-events:none}ax-data-table .ax-header-content .ax-header-fixed-columns th.ax-column-fixed{pointer-events:auto}ax-data-table .ax-header-content .ax-header-fixed-columns th:not(.ax-column-fixed){visibility:hidden;background-color:transparent}ax-data-table .ax-header-content .ax-header-columns{height:100%}ax-data-table .ax-header-content .ax-header-columns>table{height:100%;border-start-start-radius:var(--ax-rounded-border-default);border-start-end-radius:var(--ax-rounded-border-default);border-collapse:collapse;overflow:hidden}ax-data-table .ax-header-content .ax-header-columns>table th{text-transform:uppercase;background-color:rgba(var(--ax-color-on-surface));font-weight:500;text-align:start;padding:.875rem 1rem;border-block-end:1px solid;border-inline-end:1px solid;border-color:rgba(var(--ax-color-border-default))}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive{cursor:pointer}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive:hover{background-color:rgba(var(--ax-color-neutral-200))}ax-data-table .ax-header-content .ax-header-columns>table th .ax-caption{display:flex;gap:.5rem;align-items:center}ax-data-table .ax-header-content .ax-header-columns>table th:last-child{border-inline-end:0px solid}ax-data-table .ax-body-content{position:relative}ax-data-table .ax-body-content .ax-body-fixed-columns{position:absolute;z-index:1;pointer-events:none}ax-data-table .ax-body-content .ax-body-columns{height:100%}ax-data-table .ax-body-content .ax-body-columns table{border-collapse:collapse}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) td{background-color:rgba(var(--ax-color-on-surface))}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) ax-skeleton{width:25%}ax-data-table .ax-body-content .ax-body-columns table tr{height:40px}ax-data-table .ax-body-content .ax-body-columns table tr:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-200))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-200));color:rgba(var(--ax-color-primary-fore-lighten))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-300))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-300));color:rgba(var(--ax-color-primary-fore-lighten))}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected:hover td:not(.ax-index-column){background-color:rgba(var(--ax-color-primary-400));color:rgba(var(--ax-color-primary-fore))}ax-data-table .ax-body-content .ax-body-columns table td{min-width:2rem;padding:.5rem 1rem;border-block-end:1px solid;border-inline-end:1px solid;border-color:rgba(var(--ax-color-border-default));background-color:rgba(var(--ax-color-surface));position:relative}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column{background-color:rgba(var(--ax-color-on-surface))!important}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content{justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content span{text-align:center;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:100%}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content{position:relative}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content>div{position:absolute;top:50%;transform:translateY(-50%);inset-inline-start:0;display:flex;flex-direction:row;align-items:center;width:100%;justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button{background-color:transparent;border:none;color:rgba(var(--ax-color-ghost-fore));position:relative;padding:.25rem;line-height:1;border-radius:var(--ax-rounded-border-default);font-size:1rem;cursor:pointer;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover:not(ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-selected,ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-disabled){opacity:.75}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:active{opacity:1}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-ripple{background-color:rgba(var(--ax-color-ghost-fore),.5)!important}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-icon{font-size:1.25rem}ax-data-table .ax-body-content .ax-body-columns table td>.ax-content{display:flex;justify-content:flex-start;width:100%}ax-data-table .ax-body-content .ax-body-columns table td:last-child{border-inline-end:0px solid}ax-data-table .ax-body-content .ax-body-columns table td ax-skeleton{height:.875rem;border-radius:calc(var(--ax-rounded-border-default) / 1.5);width:35%}ax-data-table .ax-table-footer{border-top:1px solid;border-color:rgba(var(--ax-color-border-default));border-collapse:collapse;overflow:hidden;padding:.5rem .875rem}ax-data-table .ax-table-footer .ax-table-info{display:flex;flex:1;flex-direction:row;justify-content:space-between;align-items:center}\n"] }]
|
297
|
+
args: [{ selector: 'ax-data-table', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: AXPagedComponent, useExisting: AXDataTableComponent }], template: "<ng-content select=\"ax-header\">\n</ng-content>\n<!------------------- Header contents ------------------->\n<div class=\"ax-header-content\" *ngIf=\"showHeader\">\n <div class=\"ax-header-columns ax-header-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: 10px;\">\n </colgroup>\n <thead>\n <tr>\n <!------------------- start fixed column ------------------->\n <th *ngFor=\"let c of startFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\" class=\"ax-column-fixed\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption }}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <!------------------- not fixed column ------------------->\n <th [attr.colspan]=\"notFixedColumnCount()\">\n\n </th>\n </tr>\n </thead>\n </table>\n </div>\n <div class=\"ax-header-columns\">\n <table tabindex=\"0\" [style.width]=\"width\" #headerContainer>\n <colgroup>\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col style=\"width: auto;\">\n </colgroup>\n <thead>\n <tr>\n <th *ngFor=\"let c of startFixedColumn()\">\n </th>\n <th *ngFor=\"let c of notFixedColumn()\" [class.ax-interactive]=\"c.allowSorting\"\n (click)=\"c.allowSorting ? handleColumnClick($event,c) : null\">\n <ng-template [ngIf]=\"c.headerTemplate\" [ngIfElse]=\"captionTpl\">\n <ng-container *ngTemplateOutlet=\"c.headerTemplate\"></ng-container>\n </ng-template>\n <ng-template #captionTpl>\n <div class=\"ax-caption\">\n {{c.caption}}\n <ax-icon *ngIf=\"getSort(c)\" icon=\"ax-icon {{getSort(c)}}\"></ax-icon>\n </div>\n </ng-template>\n </th>\n <th></th>\n </tr>\n </thead>\n </table>\n </div>\n</div>\n<!------------------- Body contents ------------------->\n<div [style.height]=\"height\" class=\"ax-body-content\">\n <div class=\"ax-body-columns ax-body-fixed-columns\" *ngIf=\"false\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n </tbody>\n </table>\n </div>\n <div class=\"ax-body-columns\">\n <div cdkVirtualScrollingElement [style.height]=\"'100%'\" (scroll)=\"_handleOnScroll($event)\">\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeight\" [style.--item-height]=\"itemHeight+'px'\"\n (scrolledIndexChange)=\"_handleOnscrolledIndexChange($event)\">\n <table tabindex=\"0\" class=\"ax-table-body\" [style.width]=\"width\">\n <colgroup>\n <!------------------- start fixed column ------------------->\n <col *ngFor=\"let c of startFixedColumn()\" [style.width]=\"c.width\">\n <!------------------- not fixed column ------------------->\n <col *ngFor=\"let c of notFixedColumn()\" [style.width]=\"c.width\">\n <col>\n </colgroup>\n <tbody>\n <ng-container\n *cdkVirtualFor=\"let item of listDataSource; let i = index; trackBy: trackByIdx;let rIndex=index;\">\n <ng-template [ngIf]=\"rowTemplate\" [ngIfElse]=\"rowTpl\">\n <ng-container *ngTemplateOutlet=\"rowTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </ng-template>\n <ng-template #rowTpl>\n <tr [class.ax-state-focused]=\"focusedRow && item===focusedRow\" [attr.data-index]=\"rIndex\"\n [class.ax-state-selected]=\"selectedRows.includes(item)\" (click)=\"handleRowClick($event,item)\">\n <!------------------- start fixed column ------------------->\n <ng-container *ngFor=\"let c of startFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\" [attr.data-fixed]=\"c.fixed\"\n class=\"ax-column-fixed\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <!------------------- Not fixed column ------------------->\n <ng-container *ngFor=\"let c of notFixedColumn()\">\n <ng-template [ngIf]=\"c.cellTemplate\" [ngIfElse]=\"cellTpl\">\n <div class=\"ax-content\">\n <ng-container\n *ngTemplateOutlet=\"c.cellTemplate;context: { $implicit: {data:item,rowIndex:rIndex} }\">\n </ng-container>\n </div>\n </ng-template>\n <ng-template #cellTpl>\n <td [attr.data-label]=\"c.caption\" tabindex=\"0\" [class]=\"c.cssClass\">\n <div class=\"ax-content\">\n <ng-container *ngIf=\"item || !c.skeleton;else loadingTpl\">\n <ng-container\n *ngTemplateOutlet=\"c.template; context: { $implicit: {data:item,rowIndex:rIndex} }\"></ng-container>\n </ng-container>\n </div>\n </td>\n </ng-template>\n </ng-container>\n <td></td>\n </tr>\n </ng-template>\n </ng-container>\n </tbody>\n </table>\n </cdk-virtual-scroll-viewport>\n </div>\n </div>\n</div>\n<div class=\"ax-table-footer\" #footerContainer>\n <div class=\"ax-table-info\">\n <div>\n Showing {{startRowIndex}} of {{totalRows}} items\n </div>\n <ax-button look=\"blank\" class=\"ax-sm\" (onClick)=\"refresh()\">\n <ax-icon icon=\"ax-icon ax-icon-refresh\"></ax-icon>\n </ax-button>\n </div>\n <ng-content select=\"ax-footer\">\n </ng-content>\n</div>\n\n<!-- Loading Template -->\n<ng-template #loadingTpl>\n <!-- Custom Loading Template -->\n <ng-container *ngIf=\"loadingTemplate;else defaultLoadingTpl\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\n </ng-container>\n </ng-container>\n <!-- Default Loading Template -->\n <ng-template #defaultLoadingTpl>\n <ax-skeleton [animated]=\"true\"></ax-skeleton>\n </ng-template>\n</ng-template>\n<!-- Empty Template -->\n<ng-template #emptyTpl>\n <tr>\n <td [attr.colspan]=\"columns.length\">\n <ng-template [ngIf]=\"emptyTemplate\" [ngIfElse]=\"defaultEmptyTemplate\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n </ng-template>\n <ng-template #defaultEmptyTemplate>\n <ax-result type=\"empty\" caption=\" {{'common.no-result-found' | trans }}\"></ax-result>\n </ng-template>\n </td>\n </tr>\n</ng-template>", styles: [".ax-dark ax-data-table .ax-header-content th.ax-interactive:hover{--tw-bg-opacity: 1 !important;background-color:rgba(var(--ax-color-neutral),var(--tw-bg-opacity))!important}.ax-dark ax-data-table .ax-body-content tr:hover td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 50%)!important;--tw-text-opacity: 1 !important;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 70%)!important;--tw-text-opacity: 1 !important;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-focused:hover td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 50%)!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 70%)!important;--tw-text-opacity: 1 !important;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))!important}.ax-dark ax-data-table .ax-body-content tr.ax-state-selected:hover td:not(.ax-index-column){--tw-bg-opacity: 1 !important;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)),black 50%)!important}ax-data-table{height:100%;overflow:hidden;border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default));font-size:.875rem;line-height:1.25rem}ax-data-table table{table-layout:fixed}ax-data-table .ax-header-content{position:relative;height:3rem;overflow:hidden}ax-data-table .ax-header-content .ax-header-fixed-columns{pointer-events:none;position:absolute;z-index:10}ax-data-table .ax-header-content .ax-header-fixed-columns th.ax-column-fixed{pointer-events:auto}ax-data-table .ax-header-content .ax-header-fixed-columns th:not(.ax-column-fixed){visibility:hidden;background-color:transparent}ax-data-table .ax-header-content .ax-header-columns{height:100%}ax-data-table .ax-header-content .ax-header-columns>table{height:100%;overflow:hidden;border-start-end-radius:var(--ax-rounded-border-default);border-start-start-radius:var(--ax-rounded-border-default)}ax-data-table .ax-header-content .ax-header-columns>table th{border-bottom-width:1px;border-inline-end-width:1px;border-style:solid;border-color:rgba(var(--ax-color-border-default));--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-on-surface),var(--tw-bg-opacity));padding:.75rem 1rem;text-align:start;font-weight:500;text-transform:uppercase}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive{cursor:pointer}ax-data-table .ax-header-content .ax-header-columns>table th.ax-interactive:hover{--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-neutral),var(--tw-bg-opacity)) 30%,white)}ax-data-table .ax-header-content .ax-header-columns>table th .ax-caption{display:flex;align-items:center;gap:.5rem}ax-data-table .ax-header-content .ax-header-columns>table th:last-child{border-inline-end-width:0px}ax-data-table .ax-body-content{position:relative}ax-data-table .ax-body-content .ax-body-fixed-columns{pointer-events:none;position:absolute;z-index:10}ax-data-table .ax-body-content .ax-body-columns{height:100%}ax-data-table .ax-body-content .ax-body-columns table{border-collapse:collapse}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) td{--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-on-surface),var(--tw-bg-opacity))}ax-data-table .ax-body-content .ax-body-columns table tr:nth-child(odd) ax-skeleton{width:25%}ax-data-table .ax-body-content .ax-body-columns table tr{height:2.5rem}ax-data-table .ax-body-content .ax-body-columns table tr:hover td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 30%,white)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 30%,white);--tw-text-opacity: 1;color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-text-opacity)),black 30%)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-focused:hover td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 50%,white)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 50%,white);--tw-text-opacity: 1;color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-text-opacity)),black 30%)}ax-data-table .ax-body-content .ax-body-columns table tr.ax-state-selected:hover td:not(.ax-index-column){--tw-bg-opacity: 1;background-color:color-mix(in srgb,rgba(var(--ax-color-primary),var(--tw-bg-opacity)) 70%,white);--tw-text-opacity: 1;color:rgba(var(--ax-color-primary-fore),var(--tw-text-opacity))}ax-data-table .ax-body-content .ax-body-columns table td{position:relative;min-width:2rem;border-bottom-width:1px;border-inline-end-width:1px;border-color:rgba(var(--ax-color-border-default));--tw-bg-opacity: 1;background-color:rgba(var(--ax-color-surface),var(--tw-bg-opacity));padding:.5rem 1rem}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column{--tw-bg-opacity: 1 !important;background-color:rgba(var(--ax-color-on-surface),var(--tw-bg-opacity))!important}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content{justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-index-column>.ax-content span{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content{position:relative}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content>div{position:absolute;inset-inline-start:0px;top:50%;display:flex;width:100%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));align-items:center;justify-content:center}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button{position:relative;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--ax-rounded-border-default);border-style:none;border-color:rgba(var(--ax-color-border-default));background-color:transparent;padding:.25rem;line-height:1;--tw-text-opacity: 1;color:rgba(var(--ax-color-ghost-fore),var(--tw-text-opacity))}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover:not(ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-selected,ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:hover.ax-state-disabled){opacity:.75}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button:active{opacity:1}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-ripple{background-color:rgba(var(--ax-color-ghost-fore),.05)}ax-data-table .ax-body-content .ax-body-columns table td.ax-command-column>.ax-content button .ax-icon{font-size:1.125rem;line-height:1.75rem}ax-data-table .ax-body-content .ax-body-columns table td>.ax-content{display:flex;width:100%;justify-content:flex-start}ax-data-table .ax-body-content .ax-body-columns table td:last-child{border-inline-end-width:0px}ax-data-table .ax-body-content .ax-body-columns table td ax-skeleton{height:.875rem;width:33.333333%;border-radius:.375rem}ax-data-table .ax-table-footer{border-collapse:collapse;overflow:hidden;border-top-width:1px;border-color:rgba(var(--ax-color-border-default));padding:.5rem .875rem}ax-data-table .ax-table-footer .ax-table-info{display:flex;flex:1 1 0%;align-items:center;justify-content:space-between}\n"] }]
|
288
298
|
}], propDecorators: { columns: [{
|
289
299
|
type: ContentChildren,
|
290
300
|
args: [AXDataTableColumnComponent]
|
@@ -325,123 +335,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImpor
|
|
325
335
|
args: ['footerContainer']
|
326
336
|
}] } });
|
327
337
|
|
328
|
-
class AXRowIndexColumnComponent extends AXDataTableColumnComponent {
|
329
|
-
constructor() {
|
330
|
-
super(...arguments);
|
331
|
-
this.grid = inject(AXDataTableComponent);
|
332
|
-
this.unsubscriber = inject(AXUnsubscriber);
|
333
|
-
this.padZero = false;
|
334
|
-
this.formatCount = 1;
|
335
|
-
this.allowSorting = false;
|
336
|
-
}
|
337
|
-
get template() {
|
338
|
-
return this._template;
|
339
|
-
}
|
340
|
-
get cssClass() {
|
341
|
-
return 'ax-index-column';
|
342
|
-
}
|
343
|
-
ngOnInit() {
|
344
|
-
if (this.padZero) {
|
345
|
-
this.grid.dataSource.onChanged
|
346
|
-
.pipe(this.unsubscriber.takeUntilDestroy)
|
347
|
-
.subscribe(c => {
|
348
|
-
this.formatCount = c.totalCount.toString().length;
|
349
|
-
});
|
350
|
-
}
|
351
|
-
}
|
352
|
-
get skeleton() {
|
353
|
-
return false;
|
354
|
-
}
|
355
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowIndexColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
356
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowIndexColumnComponent, selector: "ax-index-column", inputs: { width: "width", caption: "caption", fixed: "fixed", padZero: "padZero" }, providers: [
|
357
|
-
AXUnsubscriber,
|
358
|
-
{ provide: AXDataTableColumnComponent, useExisting: AXRowIndexColumnComponent }
|
359
|
-
], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
360
|
-
<ng-template let-row>
|
361
|
-
<span> {{(row.rowIndex + 1) | format:"number":"D"+formatCount}}</span>
|
362
|
-
</ng-template>`, isInline: true, dependencies: [{ kind: "pipe", type: i1$1.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
363
|
-
}
|
364
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowIndexColumnComponent, decorators: [{
|
365
|
-
type: Component,
|
366
|
-
args: [{
|
367
|
-
selector: 'ax-index-column',
|
368
|
-
template: `
|
369
|
-
<ng-template let-row>
|
370
|
-
<span> {{(row.rowIndex + 1) | format:"number":"D"+formatCount}}</span>
|
371
|
-
</ng-template>`,
|
372
|
-
encapsulation: ViewEncapsulation.None,
|
373
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
374
|
-
providers: [
|
375
|
-
AXUnsubscriber,
|
376
|
-
{ provide: AXDataTableColumnComponent, useExisting: AXRowIndexColumnComponent }
|
377
|
-
],
|
378
|
-
inputs: ['width', 'caption', 'fixed'],
|
379
|
-
}]
|
380
|
-
}], propDecorators: { _template: [{
|
381
|
-
type: ViewChild,
|
382
|
-
args: [TemplateRef]
|
383
|
-
}], padZero: [{
|
384
|
-
type: Input
|
385
|
-
}] } });
|
386
|
-
|
387
|
-
class AXRowSelectColumnComponent extends AXDataTableColumnComponent {
|
388
|
-
constructor() {
|
389
|
-
super(...arguments);
|
390
|
-
this.grid = inject(AXDataTableComponent);
|
391
|
-
}
|
392
|
-
get template() {
|
393
|
-
return this._template;
|
394
|
-
}
|
395
|
-
isSelected(item) {
|
396
|
-
return item != null && this.grid.selectedRows.includes(item);
|
397
|
-
}
|
398
|
-
handleChange(item) {
|
399
|
-
if (this.isSelected(item)) {
|
400
|
-
this.grid.unSelectRows(item);
|
401
|
-
}
|
402
|
-
else {
|
403
|
-
this.grid.selectRows(item);
|
404
|
-
}
|
405
|
-
}
|
406
|
-
get skeleton() {
|
407
|
-
return false;
|
408
|
-
}
|
409
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowSelectColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
410
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowSelectColumnComponent, selector: "ax-select-column", inputs: { width: "width", caption: "caption", fixed: "fixed" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowSelectColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
411
|
-
<ng-template let-row>
|
412
|
-
<input
|
413
|
-
class="ax-checkbox"
|
414
|
-
type="checkbox"
|
415
|
-
[disabled]="!row.data"
|
416
|
-
(change)="handleChange(row.data)"
|
417
|
-
[checked]="isSelected(row.data)"
|
418
|
-
/>
|
419
|
-
</ng-template>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
420
|
-
}
|
421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowSelectColumnComponent, decorators: [{
|
422
|
-
type: Component,
|
423
|
-
args: [{
|
424
|
-
selector: 'ax-select-column',
|
425
|
-
template: `
|
426
|
-
<ng-template let-row>
|
427
|
-
<input
|
428
|
-
class="ax-checkbox"
|
429
|
-
type="checkbox"
|
430
|
-
[disabled]="!row.data"
|
431
|
-
(change)="handleChange(row.data)"
|
432
|
-
[checked]="isSelected(row.data)"
|
433
|
-
/>
|
434
|
-
</ng-template>`,
|
435
|
-
encapsulation: ViewEncapsulation.None,
|
436
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
437
|
-
providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowSelectColumnComponent }],
|
438
|
-
inputs: ['width', 'caption', 'fixed']
|
439
|
-
}]
|
440
|
-
}], propDecorators: { _template: [{
|
441
|
-
type: ViewChild,
|
442
|
-
args: [TemplateRef]
|
443
|
-
}] } });
|
444
|
-
|
445
338
|
class AXBaseRowCommandColumnComponent extends AXDataTableColumnComponent {
|
446
339
|
constructor() {
|
447
340
|
super(...arguments);
|
@@ -471,7 +364,7 @@ class AXRowDropdownCommandColumnComponent extends AXBaseRowCommandColumnComponen
|
|
471
364
|
this._items = this.items;
|
472
365
|
}
|
473
366
|
else
|
474
|
-
|
367
|
+
typeof this.items == 'function';
|
475
368
|
{
|
476
369
|
const result = this['items'](rowData);
|
477
370
|
if (Array.isArray(result)) {
|
@@ -492,69 +385,75 @@ class AXRowDropdownCommandColumnComponent extends AXBaseRowCommandColumnComponen
|
|
492
385
|
isUserInteraction: true,
|
493
386
|
nativeEvent: e,
|
494
387
|
data,
|
495
|
-
name: e.name
|
388
|
+
name: e.name,
|
496
389
|
};
|
497
390
|
this.onItemClick.emit(args);
|
498
391
|
}
|
499
392
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowDropdownCommandColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
500
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: { width: "width", caption: "caption", fixed: "fixed", items: "items" }, outputs: { onItemClick: "onItemClick" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowDropdownCommandColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
501
|
-
<
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
</ng-template>
|
515
|
-
</ax-dropdown-panel>
|
516
|
-
</button>
|
517
|
-
</div>
|
518
|
-
<ng-template #loading>
|
393
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowDropdownCommandColumnComponent, selector: "ax-dropdown-command-column", inputs: { width: "width", caption: "caption", fixed: "fixed", items: "items" }, outputs: { onItemClick: "onItemClick" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowDropdownCommandColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: ` <ng-template let-row>
|
394
|
+
<div *ngIf="row.data">
|
395
|
+
<button axRipple>
|
396
|
+
<ax-icon icon="ax-icon ax-icon-more-horizontal"></ax-icon>
|
397
|
+
<ax-dropdown-panel
|
398
|
+
[adaptivityEnabled]="true"
|
399
|
+
(onOpened)="handleOnOpened(row.data)"
|
400
|
+
(onClosed)="handleOnClosed()"
|
401
|
+
>
|
402
|
+
<ng-container *ngIf="_items.length; else loading">
|
403
|
+
<ax-button-item-list (onItemClick)="handleOnItemClick($event, row.data)" [items]="_items">
|
404
|
+
</ax-button-item-list>
|
405
|
+
</ng-container>
|
406
|
+
<ng-template #loading>
|
519
407
|
<div panel style="padding: 0.875rem;">
|
520
|
-
|
408
|
+
<ax-loading></ax-loading>
|
521
409
|
</div>
|
522
|
-
|
523
|
-
|
410
|
+
</ng-template>
|
411
|
+
</ax-dropdown-panel>
|
412
|
+
</button>
|
413
|
+
</div>
|
414
|
+
<ng-template #loading>
|
415
|
+
<div panel style="padding: 0.875rem;">
|
416
|
+
<ax-loading></ax-loading>
|
417
|
+
</div>
|
418
|
+
</ng-template>
|
419
|
+
</ng-template>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i6.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "component", type: i5$1.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
524
420
|
}
|
525
421
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowDropdownCommandColumnComponent, decorators: [{
|
526
422
|
type: Component,
|
527
423
|
args: [{
|
528
424
|
selector: 'ax-dropdown-command-column',
|
529
|
-
template: `
|
530
|
-
<
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
</ng-template>
|
544
|
-
</ax-dropdown-panel>
|
545
|
-
</button>
|
546
|
-
</div>
|
547
|
-
<ng-template #loading>
|
425
|
+
template: ` <ng-template let-row>
|
426
|
+
<div *ngIf="row.data">
|
427
|
+
<button axRipple>
|
428
|
+
<ax-icon icon="ax-icon ax-icon-more-horizontal"></ax-icon>
|
429
|
+
<ax-dropdown-panel
|
430
|
+
[adaptivityEnabled]="true"
|
431
|
+
(onOpened)="handleOnOpened(row.data)"
|
432
|
+
(onClosed)="handleOnClosed()"
|
433
|
+
>
|
434
|
+
<ng-container *ngIf="_items.length; else loading">
|
435
|
+
<ax-button-item-list (onItemClick)="handleOnItemClick($event, row.data)" [items]="_items">
|
436
|
+
</ax-button-item-list>
|
437
|
+
</ng-container>
|
438
|
+
<ng-template #loading>
|
548
439
|
<div panel style="padding: 0.875rem;">
|
549
|
-
|
440
|
+
<ax-loading></ax-loading>
|
550
441
|
</div>
|
551
|
-
|
552
|
-
|
442
|
+
</ng-template>
|
443
|
+
</ax-dropdown-panel>
|
444
|
+
</button>
|
445
|
+
</div>
|
446
|
+
<ng-template #loading>
|
447
|
+
<div panel style="padding: 0.875rem;">
|
448
|
+
<ax-loading></ax-loading>
|
449
|
+
</div>
|
450
|
+
</ng-template>
|
451
|
+
</ng-template>`,
|
553
452
|
encapsulation: ViewEncapsulation.None,
|
554
453
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
555
454
|
providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowDropdownCommandColumnComponent }],
|
556
455
|
inputs: ['width', 'caption', 'fixed'],
|
557
|
-
outputs: ['onItemClick']
|
456
|
+
outputs: ['onItemClick'],
|
558
457
|
}]
|
559
458
|
}], propDecorators: { _template: [{
|
560
459
|
type: ViewChild,
|
@@ -575,7 +474,7 @@ class AXRowCommandColumnComponent extends AXBaseRowCommandColumnComponent {
|
|
575
474
|
return this.items;
|
576
475
|
}
|
577
476
|
else
|
578
|
-
|
477
|
+
typeof this.items == 'function';
|
579
478
|
{
|
580
479
|
return this.items(rowData);
|
581
480
|
}
|
@@ -592,36 +491,40 @@ class AXRowCommandColumnComponent extends AXBaseRowCommandColumnComponent {
|
|
592
491
|
this.onItemClick.emit(args);
|
593
492
|
}
|
594
493
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowCommandColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
595
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowCommandColumnComponent, selector: "ax-command-column", inputs: { width: "width", caption: "caption", fixed: "fixed", items: "items" }, outputs: { onItemClick: "onItemClick" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowCommandColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
596
|
-
<
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
494
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowCommandColumnComponent, selector: "ax-command-column", inputs: { width: "width", caption: "caption", fixed: "fixed", items: "items" }, outputs: { onItemClick: "onItemClick" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowCommandColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: ` <ng-template let-row>
|
495
|
+
<div *ngIf="row.data">
|
496
|
+
<button
|
497
|
+
[style.color]="'rgba(var(--ax-color-' + (item.color ?? 'primary') + '-500))'"
|
498
|
+
axRipple
|
499
|
+
*ngFor="let item of getItems(row.data)"
|
500
|
+
(click)="handleOnItemClick($event, item, row.data)"
|
501
|
+
>
|
502
|
+
<ax-icon [icon]="item.icon"></ax-icon>
|
503
|
+
</button>
|
504
|
+
</div>
|
505
|
+
</ng-template>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
605
506
|
}
|
606
507
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowCommandColumnComponent, decorators: [{
|
607
508
|
type: Component,
|
608
509
|
args: [{
|
609
510
|
selector: 'ax-command-column',
|
610
|
-
template: `
|
611
|
-
<
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
511
|
+
template: ` <ng-template let-row>
|
512
|
+
<div *ngIf="row.data">
|
513
|
+
<button
|
514
|
+
[style.color]="'rgba(var(--ax-color-' + (item.color ?? 'primary') + '-500))'"
|
515
|
+
axRipple
|
516
|
+
*ngFor="let item of getItems(row.data)"
|
517
|
+
(click)="handleOnItemClick($event, item, row.data)"
|
518
|
+
>
|
519
|
+
<ax-icon [icon]="item.icon"></ax-icon>
|
520
|
+
</button>
|
521
|
+
</div>
|
522
|
+
</ng-template>`,
|
620
523
|
encapsulation: ViewEncapsulation.None,
|
621
524
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
622
525
|
providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowCommandColumnComponent }],
|
623
526
|
inputs: ['width', 'caption', 'fixed'],
|
624
|
-
outputs: ['onItemClick']
|
527
|
+
outputs: ['onItemClick'],
|
625
528
|
}]
|
626
529
|
}], propDecorators: { _template: [{
|
627
530
|
type: ViewChild,
|
@@ -630,13 +533,124 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImpor
|
|
630
533
|
type: Input
|
631
534
|
}] } });
|
632
535
|
|
536
|
+
class AXRowIndexColumnComponent extends AXDataTableColumnComponent {
|
537
|
+
constructor() {
|
538
|
+
super(...arguments);
|
539
|
+
this.grid = inject(AXDataTableComponent);
|
540
|
+
this.unsubscriber = inject(AXUnsubscriber);
|
541
|
+
this.padZero = false;
|
542
|
+
this.formatCount = 1;
|
543
|
+
this.allowSorting = false;
|
544
|
+
}
|
545
|
+
get template() {
|
546
|
+
return this._template;
|
547
|
+
}
|
548
|
+
get cssClass() {
|
549
|
+
return 'ax-index-column';
|
550
|
+
}
|
551
|
+
ngOnInit() {
|
552
|
+
if (this.padZero) {
|
553
|
+
this.grid.dataSource.onChanged.pipe(this.unsubscriber.takeUntilDestroy).subscribe((c) => {
|
554
|
+
this.formatCount = c.totalCount.toString().length;
|
555
|
+
});
|
556
|
+
}
|
557
|
+
}
|
558
|
+
get skeleton() {
|
559
|
+
return false;
|
560
|
+
}
|
561
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowIndexColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
562
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowIndexColumnComponent, selector: "ax-index-column", inputs: { width: "width", caption: "caption", fixed: "fixed", padZero: "padZero" }, providers: [
|
563
|
+
AXUnsubscriber,
|
564
|
+
{ provide: AXDataTableColumnComponent, useExisting: AXRowIndexColumnComponent },
|
565
|
+
], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: ` <ng-template let-row>
|
566
|
+
<span> {{ row.rowIndex + 1 | format: 'number' : 'D' + formatCount }}</span>
|
567
|
+
</ng-template>`, isInline: true, dependencies: [{ kind: "pipe", type: i1$1.AXFormatPipe, name: "format" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
568
|
+
}
|
569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowIndexColumnComponent, decorators: [{
|
570
|
+
type: Component,
|
571
|
+
args: [{
|
572
|
+
selector: 'ax-index-column',
|
573
|
+
template: ` <ng-template let-row>
|
574
|
+
<span> {{ row.rowIndex + 1 | format: 'number' : 'D' + formatCount }}</span>
|
575
|
+
</ng-template>`,
|
576
|
+
encapsulation: ViewEncapsulation.None,
|
577
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
578
|
+
providers: [
|
579
|
+
AXUnsubscriber,
|
580
|
+
{ provide: AXDataTableColumnComponent, useExisting: AXRowIndexColumnComponent },
|
581
|
+
],
|
582
|
+
inputs: ['width', 'caption', 'fixed'],
|
583
|
+
}]
|
584
|
+
}], propDecorators: { _template: [{
|
585
|
+
type: ViewChild,
|
586
|
+
args: [TemplateRef]
|
587
|
+
}], padZero: [{
|
588
|
+
type: Input
|
589
|
+
}] } });
|
590
|
+
|
591
|
+
class AXRowSelectColumnComponent extends AXDataTableColumnComponent {
|
592
|
+
constructor() {
|
593
|
+
super(...arguments);
|
594
|
+
this.grid = inject(AXDataTableComponent);
|
595
|
+
}
|
596
|
+
get template() {
|
597
|
+
return this._template;
|
598
|
+
}
|
599
|
+
isSelected(item) {
|
600
|
+
return item != null && this.grid.selectedRows.includes(item);
|
601
|
+
}
|
602
|
+
handleChange(item) {
|
603
|
+
if (this.isSelected(item)) {
|
604
|
+
this.grid.unSelectRows(item);
|
605
|
+
}
|
606
|
+
else {
|
607
|
+
this.grid.selectRows(item);
|
608
|
+
}
|
609
|
+
}
|
610
|
+
get skeleton() {
|
611
|
+
return false;
|
612
|
+
}
|
613
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowSelectColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
614
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.6", type: AXRowSelectColumnComponent, selector: "ax-select-column", inputs: { width: "width", caption: "caption", fixed: "fixed" }, providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowSelectColumnComponent }], viewQueries: [{ propertyName: "_template", first: true, predicate: TemplateRef, descendants: true }], usesInheritance: true, ngImport: i0, template: ` <ng-template let-row>
|
615
|
+
<input
|
616
|
+
class="ax-checkbox"
|
617
|
+
type="checkbox"
|
618
|
+
[disabled]="!row.data"
|
619
|
+
(change)="handleChange(row.data)"
|
620
|
+
[checked]="isSelected(row.data)"
|
621
|
+
/>
|
622
|
+
</ng-template>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
623
|
+
}
|
624
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXRowSelectColumnComponent, decorators: [{
|
625
|
+
type: Component,
|
626
|
+
args: [{
|
627
|
+
selector: 'ax-select-column',
|
628
|
+
template: ` <ng-template let-row>
|
629
|
+
<input
|
630
|
+
class="ax-checkbox"
|
631
|
+
type="checkbox"
|
632
|
+
[disabled]="!row.data"
|
633
|
+
(change)="handleChange(row.data)"
|
634
|
+
[checked]="isSelected(row.data)"
|
635
|
+
/>
|
636
|
+
</ng-template>`,
|
637
|
+
encapsulation: ViewEncapsulation.None,
|
638
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
639
|
+
providers: [{ provide: AXDataTableColumnComponent, useExisting: AXRowSelectColumnComponent }],
|
640
|
+
inputs: ['width', 'caption', 'fixed'],
|
641
|
+
}]
|
642
|
+
}], propDecorators: { _template: [{
|
643
|
+
type: ViewChild,
|
644
|
+
args: [TemplateRef]
|
645
|
+
}] } });
|
646
|
+
|
633
647
|
const COMPONENT = [
|
634
648
|
AXDataTableComponent,
|
635
649
|
AXDataTableTextColumnComponent,
|
636
650
|
AXRowIndexColumnComponent,
|
637
651
|
AXRowSelectColumnComponent,
|
638
652
|
AXRowCommandColumnComponent,
|
639
|
-
AXRowDropdownCommandColumnComponent
|
653
|
+
AXRowDropdownCommandColumnComponent,
|
640
654
|
];
|
641
655
|
const MODULES = [
|
642
656
|
CommonModule,
|
@@ -649,7 +663,7 @@ const MODULES = [
|
|
649
663
|
AXSkeletonModule,
|
650
664
|
AXButtonModule,
|
651
665
|
AXDropdownModule,
|
652
|
-
AXFormatModule
|
666
|
+
AXFormatModule,
|
653
667
|
];
|
654
668
|
class AXDataTableModule {
|
655
669
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.6", ngImport: i0, type: AXDataTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|