@bootkit/ng0 0.0.0-alpha.4 → 0.0.0-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/common/index.d.ts +263 -7
- package/components/accordion/index.d.ts +13 -3
- package/components/backdrop/index.d.ts +12 -0
- package/components/dropdown/index.d.ts +156 -0
- package/components/form-field/index.d.ts +24 -41
- package/components/list/index.d.ts +260 -0
- package/components/modal/index.d.ts +21 -3
- package/components/nav/index.d.ts +23 -19
- package/components/offcanvas/index.d.ts +13 -5
- package/components/pagination/index.d.ts +34 -8
- package/components/select/index.d.ts +160 -0
- package/components/sidenav/index.d.ts +125 -0
- package/components/table/index.d.ts +191 -59
- package/components/tooltip/index.d.ts +20 -11
- package/components/vertical-menu/index.d.ts +57 -0
- package/data/index.d.ts +103 -38
- package/date/index.d.ts +34 -0
- package/fesm2022/bootkit-ng0-common.mjs +289 -12
- package/fesm2022/bootkit-ng0-common.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-accordion.mjs +34 -27
- package/fesm2022/bootkit-ng0-components-accordion.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-backdrop.mjs +46 -0
- package/fesm2022/bootkit-ng0-components-backdrop.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-button.mjs +12 -12
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-card.mjs +13 -13
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-code.mjs +10 -10
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-collapse.mjs +16 -16
- package/fesm2022/bootkit-ng0-components-collapse.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-confirmation.mjs +14 -14
- package/fesm2022/bootkit-ng0-components-confirmation.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-dropdown.mjs +308 -0
- package/fesm2022/bootkit-ng0-components-dropdown.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-form-field.mjs +62 -84
- package/fesm2022/bootkit-ng0-components-form-field.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-list.mjs +564 -0
- package/fesm2022/bootkit-ng0-components-list.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-modal.mjs +41 -24
- package/fesm2022/bootkit-ng0-components-modal.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-nav.mjs +59 -60
- package/fesm2022/bootkit-ng0-components-nav.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs +20 -13
- package/fesm2022/bootkit-ng0-components-offcanvas.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-overlay.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-pagination.mjs +59 -24
- package/fesm2022/bootkit-ng0-components-pagination.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-popover.mjs +12 -12
- package/fesm2022/bootkit-ng0-components-popover.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-select.mjs +448 -0
- package/fesm2022/bootkit-ng0-components-select.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs +290 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs +15 -15
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-table.mjs +303 -159
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-toast.mjs +7 -7
- package/fesm2022/bootkit-ng0-components-toast.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-tooltip.mjs +41 -22
- package/fesm2022/bootkit-ng0-components-tooltip.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs +148 -0
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-data.mjs +152 -39
- package/fesm2022/bootkit-ng0-data.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-date.mjs +50 -0
- package/fesm2022/bootkit-ng0-date.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-file.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-form.mjs +336 -264
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-http.mjs +40 -5
- package/fesm2022/bootkit-ng0-http.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-layouts-layout1.mjs +317 -0
- package/fesm2022/bootkit-ng0-layouts-layout1.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs +101 -0
- package/fesm2022/bootkit-ng0-localization-locales.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-localization.mjs +431 -105
- package/fesm2022/bootkit-ng0-localization.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-platform-browser.mjs +179 -0
- package/fesm2022/bootkit-ng0-platform-browser.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-routing.mjs +80 -0
- package/fesm2022/bootkit-ng0-routing.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-script.mjs +3 -3
- package/fesm2022/bootkit-ng0-script.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-security.mjs +16 -16
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-utils.mjs +75 -0
- package/fesm2022/bootkit-ng0-utils.mjs.map +1 -0
- package/fesm2022/bootkit-ng0.mjs +2 -2
- package/fesm2022/bootkit-ng0.mjs.map +1 -1
- package/form/index.d.ts +94 -62
- package/http/index.d.ts +35 -4
- package/index.d.ts +2 -2
- package/layouts/layout1/index.d.ts +201 -0
- package/localization/index.d.ts +231 -42
- package/localization/locales/index.d.ts +7 -0
- package/package.json +63 -15
- package/platform/browser/index.d.ts +88 -0
- package/routing/index.d.ts +124 -0
- package/utils/index.d.ts +42 -0
|
@@ -1,65 +1,142 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
2
|
+
import { input, booleanAttribute, model, signal, TemplateRef, ContentChild, Directive, Input, HostBinding, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as
|
|
5
|
+
import * as i3 from '@angular/forms';
|
|
6
6
|
import { FormsModule } from '@angular/forms';
|
|
7
7
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
8
|
-
import * as i3 from '@bootkit/ng0/localization';
|
|
9
|
-
import { LocalizationModule } from '@bootkit/ng0/localization';
|
|
10
8
|
import { formatString } from '@bootkit/ng0/common';
|
|
11
|
-
import
|
|
9
|
+
import * as i1 from '@bootkit/ng0/localization';
|
|
10
|
+
import { LocalizationModule } from '@bootkit/ng0/localization';
|
|
11
|
+
import { dataSourceAttribute, DataRequest } from '@bootkit/ng0/data';
|
|
12
|
+
import { PaginationComponent } from '@bootkit/ng0/components/pagination';
|
|
13
|
+
import * as i4 from '@angular/cdk/overlay';
|
|
14
|
+
import { OverlayModule } from '@angular/cdk/overlay';
|
|
15
|
+
import { NumberDirective } from '@bootkit/ng0/form';
|
|
12
16
|
|
|
13
17
|
class TableColumnDirective {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The field in the data source to bind to. If not set, the column will not display any data.
|
|
20
|
+
*/
|
|
21
|
+
field = input(...(ngDevMode ? [undefined, { debugName: "field" }] : []));
|
|
22
|
+
/**
|
|
23
|
+
* The title of the column. This will be displayed in the header row.
|
|
24
|
+
*/
|
|
25
|
+
title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : []));
|
|
26
|
+
/**
|
|
27
|
+
* Text to display in the cell if the value is null or undefined.
|
|
28
|
+
*/
|
|
29
|
+
emptyCellText = input(...(ngDevMode ? [undefined, { debugName: "emptyCellText" }] : []));
|
|
30
|
+
/**
|
|
31
|
+
* Type of the table cell.
|
|
32
|
+
*/
|
|
33
|
+
type = input('text', ...(ngDevMode ? [{ debugName: "type" }] : []));
|
|
34
|
+
/**
|
|
35
|
+
* CSS class(es) to apply to the table cell.
|
|
36
|
+
*/
|
|
37
|
+
cellClass = input(...(ngDevMode ? [undefined, { debugName: "cellClass" }] : []));
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use `cellClass` instead.
|
|
40
|
+
*/
|
|
41
|
+
bold = input(false, ...(ngDevMode ? [{ debugName: "bold", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Use `cellClass` instead.
|
|
44
|
+
*/
|
|
45
|
+
shrink = input(false, ...(ngDevMode ? [{ debugName: "shrink", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
46
|
+
/**
|
|
47
|
+
* If true, the column will support filtering.
|
|
48
|
+
*/
|
|
49
|
+
filterable = input(false, ...(ngDevMode ? [{ debugName: "filterable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
50
|
+
/**
|
|
51
|
+
* The current filter value of the column.
|
|
52
|
+
*/
|
|
53
|
+
filterValue = model(...(ngDevMode ? [undefined, { debugName: "filterValue" }] : []));
|
|
54
|
+
/**
|
|
55
|
+
* The field to use for filtering. If not set, the `field` property will be used.
|
|
56
|
+
* @deprecated Use `fieldName` instead.
|
|
57
|
+
*/
|
|
58
|
+
filterField = input(...(ngDevMode ? [undefined, { debugName: "filterField" }] : []));
|
|
59
|
+
/**
|
|
60
|
+
* The current filter operator of the column.
|
|
61
|
+
*/
|
|
62
|
+
filterOperator = model(...(ngDevMode ? [undefined, { debugName: "filterOperator" }] : []));
|
|
63
|
+
/**
|
|
64
|
+
* The list of filter operators to show in the filter dropdown. If not set, a default list will be used based on the column type.
|
|
65
|
+
*/
|
|
66
|
+
filterOperators = input(...(ngDevMode ? [undefined, { debugName: "filterOperators" }] : []));
|
|
67
|
+
/**
|
|
68
|
+
* If true, the filter operators dropdown will be shown.
|
|
69
|
+
*/
|
|
70
|
+
showFilterOperators = signal(false, ...(ngDevMode ? [{ debugName: "showFilterOperators" }] : []));
|
|
71
|
+
/**
|
|
72
|
+
* The name of the field in the data source. If not set, the `field` property will be used.
|
|
73
|
+
*/
|
|
74
|
+
fieldName = input(...(ngDevMode ? [undefined, { debugName: "fieldName" }] : []));
|
|
75
|
+
/**
|
|
76
|
+
* If true, the column will support sorting.
|
|
77
|
+
*/
|
|
78
|
+
sortable = input(false, ...(ngDevMode ? [{ debugName: "sortable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
79
|
+
/**
|
|
80
|
+
* The current sort direction of the column.
|
|
81
|
+
*/
|
|
82
|
+
sortDirection = model('none', ...(ngDevMode ? [{ debugName: "sortDirection" }] : []));
|
|
19
83
|
template;
|
|
20
|
-
cellClass;
|
|
21
|
-
shrink = false;
|
|
22
|
-
bold = false;
|
|
23
|
-
badge;
|
|
24
|
-
filterable = false;
|
|
25
|
-
filterValue;
|
|
26
|
-
filterField;
|
|
27
84
|
constructor() {
|
|
28
85
|
}
|
|
29
|
-
|
|
30
|
-
|
|
86
|
+
ngOnInit() {
|
|
87
|
+
if (this.filterOperator() == undefined) {
|
|
88
|
+
this.filterOperator.set(this.type() == 'text' ? 'contains' : 'eq');
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get the list of filter operators to show in the filter dropdown.
|
|
93
|
+
*/
|
|
94
|
+
getFilterOperators() {
|
|
95
|
+
let op = this.filterOperators();
|
|
96
|
+
if (op && op.length > 0)
|
|
97
|
+
return op;
|
|
98
|
+
let type = this.type();
|
|
99
|
+
if (type == 'number' || type == 'currency' || type == 'date' || type == 'time') {
|
|
100
|
+
return ['eq', 'ne', 'gt', 'gte', 'lt', 'lte',];
|
|
101
|
+
}
|
|
102
|
+
else if (type == 'text') {
|
|
103
|
+
return ['contains', 'startsWith', 'endsWith', 'eq', 'ne'];
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Toggle the sort direction of the column.
|
|
111
|
+
* @returns void
|
|
112
|
+
*/
|
|
113
|
+
toggleSortDirection() {
|
|
114
|
+
if (!this.sortable()) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
let dir = this.sortDirection();
|
|
118
|
+
if (dir === 'none') {
|
|
119
|
+
this.sortDirection.set('asc');
|
|
120
|
+
}
|
|
121
|
+
else if (dir === 'asc') {
|
|
122
|
+
this.sortDirection.set('desc');
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.sortDirection.set('none');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
129
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.3.11", type: TableColumnDirective, isStandalone: true, selector: "ng0-table-col", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, emptyCellText: { classPropertyName: "emptyCellText", publicName: "emptyCellText", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, cellClass: { classPropertyName: "cellClass", publicName: "cellClass", isSignal: true, isRequired: false, transformFunction: null }, bold: { classPropertyName: "bold", publicName: "bold", isSignal: true, isRequired: false, transformFunction: null }, shrink: { classPropertyName: "shrink", publicName: "shrink", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, filterValue: { classPropertyName: "filterValue", publicName: "filterValue", isSignal: true, isRequired: false, transformFunction: null }, filterField: { classPropertyName: "filterField", publicName: "filterField", isSignal: true, isRequired: false, transformFunction: null }, filterOperator: { classPropertyName: "filterOperator", publicName: "filterOperator", isSignal: true, isRequired: false, transformFunction: null }, filterOperators: { classPropertyName: "filterOperators", publicName: "filterOperators", isSignal: true, isRequired: false, transformFunction: null }, fieldName: { classPropertyName: "fieldName", publicName: "fieldName", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { filterValue: "filterValueChange", filterOperator: "filterOperatorChange", sortDirection: "sortDirectionChange" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 });
|
|
31
130
|
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableColumnDirective, decorators: [{
|
|
33
132
|
type: Directive,
|
|
34
133
|
args: [{
|
|
35
134
|
selector: 'ng0-table-col',
|
|
36
135
|
standalone: true,
|
|
37
136
|
}]
|
|
38
|
-
}], ctorParameters: () => [], propDecorators: { field: [{
|
|
39
|
-
type: Input
|
|
40
|
-
}], title: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}], emptyCellText: [{
|
|
43
|
-
type: Input
|
|
44
|
-
}], type: [{
|
|
45
|
-
type: Input
|
|
46
|
-
}], template: [{
|
|
137
|
+
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], emptyCellText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyCellText", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], cellClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "cellClass", required: false }] }], bold: [{ type: i0.Input, args: [{ isSignal: true, alias: "bold", required: false }] }], shrink: [{ type: i0.Input, args: [{ isSignal: true, alias: "shrink", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], filterValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterValue", required: false }] }, { type: i0.Output, args: ["filterValueChange"] }], filterField: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterField", required: false }] }], filterOperator: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperator", required: false }] }, { type: i0.Output, args: ["filterOperatorChange"] }], filterOperators: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterOperators", required: false }] }], fieldName: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldName", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }, { type: i0.Output, args: ["sortDirectionChange"] }], template: [{
|
|
47
138
|
type: ContentChild,
|
|
48
139
|
args: [TemplateRef]
|
|
49
|
-
}], cellClass: [{
|
|
50
|
-
type: Input
|
|
51
|
-
}], shrink: [{
|
|
52
|
-
type: Input
|
|
53
|
-
}], bold: [{
|
|
54
|
-
type: Input
|
|
55
|
-
}], badge: [{
|
|
56
|
-
type: Input
|
|
57
|
-
}], filterable: [{
|
|
58
|
-
type: Input
|
|
59
|
-
}], filterValue: [{
|
|
60
|
-
type: Input
|
|
61
|
-
}], filterField: [{
|
|
62
|
-
type: Input
|
|
63
140
|
}] } });
|
|
64
141
|
|
|
65
142
|
class TableDetailRowDirective {
|
|
@@ -68,10 +145,10 @@ class TableDetailRowDirective {
|
|
|
68
145
|
constructor(templateRef) {
|
|
69
146
|
this.templateRef = templateRef;
|
|
70
147
|
}
|
|
71
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
72
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.
|
|
148
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableDetailRowDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
149
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.11", type: TableDetailRowDirective, isStandalone: true, selector: "[ng0-table-detail-row]", inputs: { showCallback: "showCallback" }, ngImport: i0 });
|
|
73
150
|
}
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableDetailRowDirective, decorators: [{
|
|
75
152
|
type: Directive,
|
|
76
153
|
args: [{
|
|
77
154
|
selector: '[ng0-table-detail-row]',
|
|
@@ -81,158 +158,211 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImpor
|
|
|
81
158
|
type: Input
|
|
82
159
|
}] } });
|
|
83
160
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
constructor(_destroyRef) {
|
|
90
|
-
this._destroyRef = _destroyRef;
|
|
91
|
-
}
|
|
92
|
-
ngOnInit() {
|
|
93
|
-
}
|
|
94
|
-
// ngAfterContentInit(): void {
|
|
95
|
-
// }
|
|
96
|
-
ngOnDestroy() {
|
|
97
|
-
}
|
|
98
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TablePagingComponent, deps: [{ token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.0.6", type: TablePagingComponent, isStandalone: true, selector: "ng0-table-paging", inputs: { autoLoad: { classPropertyName: "autoLoad", publicName: "autoLoad", isSignal: false, isRequired: false, transformFunction: null }, rowNumber: { classPropertyName: "rowNumber", publicName: "rowNumber", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type:
|
|
100
|
-
// DateModule,
|
|
101
|
-
LocalizationModule }] });
|
|
102
|
-
}
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.6", ngImport: i0, type: TablePagingComponent, decorators: [{
|
|
104
|
-
type: Component,
|
|
105
|
-
args: [{ selector: 'ng0-table-paging', standalone: true, imports: [
|
|
106
|
-
CommonModule,
|
|
107
|
-
FormsModule,
|
|
108
|
-
// DateModule,
|
|
109
|
-
LocalizationModule
|
|
110
|
-
], template: "" }]
|
|
111
|
-
}], ctorParameters: () => [{ type: i0.DestroyRef }], propDecorators: { autoLoad: [{
|
|
112
|
-
type: Input
|
|
113
|
-
}] } });
|
|
114
|
-
|
|
161
|
+
/**
|
|
162
|
+
* A generic table component that can display data in a tabular format.
|
|
163
|
+
* It supports features like pagination, sorting, filtering, and row details.
|
|
164
|
+
* It can be used with any data source that implements the DataSource interface.
|
|
165
|
+
*/
|
|
115
166
|
class TableComponent {
|
|
167
|
+
_ls;
|
|
116
168
|
_destroyRef;
|
|
117
169
|
/**
|
|
118
170
|
* The data source for the table.
|
|
119
171
|
* This can be an array of data, a function that returns an observable of data,
|
|
120
172
|
* or an instance of DataSource.
|
|
121
173
|
*/
|
|
122
|
-
source = input.required();
|
|
174
|
+
source = input.required(...(ngDevMode ? [{ debugName: "source" }] : []));
|
|
123
175
|
/**
|
|
124
176
|
* If true, the table will automatically load data when initialized.
|
|
125
177
|
* This is useful for tables that need to display data immediately without user interaction.
|
|
126
178
|
*/
|
|
127
|
-
autoLoad = input(true);
|
|
179
|
+
autoLoad = input(true, ...(ngDevMode ? [{ debugName: "autoLoad", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
128
180
|
/**
|
|
129
181
|
* If true, the table will show row numbers.
|
|
130
182
|
* This will add a column to the left of the table with the row numbers.
|
|
131
183
|
*/
|
|
132
|
-
showRowNumbers = input(false);
|
|
184
|
+
showRowNumbers = input(false, ...(ngDevMode ? [{ debugName: "showRowNumbers", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
133
185
|
/**
|
|
134
186
|
* If true, the table will show the header row.
|
|
135
187
|
*/
|
|
136
|
-
showHeader = input(true);
|
|
188
|
+
showHeader = input(true, ...(ngDevMode ? [{ debugName: "showHeader", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
137
189
|
/**
|
|
138
190
|
* If true, the table will support pagination.
|
|
139
191
|
* If false, the table will load all records at once.
|
|
140
192
|
*/
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
193
|
+
pageable = input(undefined, ...(ngDevMode ? [{ debugName: "pageable", transform: v => {
|
|
194
|
+
if (v === undefined || v === null || v === false) {
|
|
195
|
+
return undefined;
|
|
196
|
+
}
|
|
197
|
+
if (v === true) {
|
|
198
|
+
v = {};
|
|
199
|
+
}
|
|
200
|
+
v.pageIndex = v.pageIndex ?? 1;
|
|
201
|
+
v.pageSize = v.pageSize ?? 10;
|
|
202
|
+
v.maxVisiblePages = v.maxVisiblePages ?? 10;
|
|
203
|
+
v.showPagingControls = v.showPagingControls ?? true;
|
|
204
|
+
return v;
|
|
205
|
+
} }] : [{
|
|
206
|
+
transform: v => {
|
|
207
|
+
if (v === undefined || v === null || v === false) {
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
210
|
+
if (v === true) {
|
|
211
|
+
v = {};
|
|
212
|
+
}
|
|
213
|
+
v.pageIndex = v.pageIndex ?? 1;
|
|
214
|
+
v.pageSize = v.pageSize ?? 10;
|
|
215
|
+
v.maxVisiblePages = v.maxVisiblePages ?? 10;
|
|
216
|
+
v.showPagingControls = v.showPagingControls ?? true;
|
|
217
|
+
return v;
|
|
218
|
+
}
|
|
219
|
+
}]));
|
|
151
220
|
/**
|
|
152
|
-
*
|
|
153
|
-
* This
|
|
154
|
-
* The first page is 0.
|
|
221
|
+
* If true, the table will support sorting.
|
|
222
|
+
* This will add a sort icon to each column header.
|
|
155
223
|
*/
|
|
156
|
-
|
|
224
|
+
sortable = input(true, ...(ngDevMode ? [{ debugName: "sortable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
157
225
|
/**
|
|
158
226
|
* The CSS class to apply to the table element.
|
|
159
227
|
* This can be used to apply custom styles to the table.
|
|
160
228
|
*/
|
|
161
|
-
tableClass = input();
|
|
229
|
+
tableClass = input(...(ngDevMode ? [undefined, { debugName: "tableClass" }] : []));
|
|
162
230
|
/**
|
|
163
231
|
* The CSS class to apply to the header element.
|
|
164
232
|
*/
|
|
165
|
-
headerClass = input();
|
|
233
|
+
headerClass = input(...(ngDevMode ? [undefined, { debugName: "headerClass" }] : []));
|
|
166
234
|
/**
|
|
167
235
|
* The caption of the table.
|
|
168
236
|
*/
|
|
169
|
-
caption = input();
|
|
170
|
-
|
|
237
|
+
caption = input(...(ngDevMode ? [undefined, { debugName: "caption" }] : []));
|
|
238
|
+
/**
|
|
239
|
+
* The height of the table in pixels.
|
|
240
|
+
* This can be used to set a fixed height for the table.
|
|
241
|
+
*/
|
|
242
|
+
height = input(...(ngDevMode ? [undefined, { debugName: "height" }] : []));
|
|
171
243
|
/**
|
|
172
244
|
* If true, the table will support filtering.
|
|
173
245
|
* This will add a filter input to each column header.
|
|
174
246
|
*/
|
|
175
|
-
filterable = input(false);
|
|
247
|
+
filterable = input(false, ...(ngDevMode ? [{ debugName: "filterable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
248
|
+
/**
|
|
249
|
+
* The indicator to show while the table is loading data for the first time.
|
|
250
|
+
*/
|
|
251
|
+
loadingIndicator = input('spinner', ...(ngDevMode ? [{ debugName: "loadingIndicator", transform: v => {
|
|
252
|
+
if (typeof v === 'boolean') {
|
|
253
|
+
return v ? 'spinner' : 'none';
|
|
254
|
+
}
|
|
255
|
+
return v;
|
|
256
|
+
} }] : [{
|
|
257
|
+
transform: v => {
|
|
258
|
+
if (typeof v === 'boolean') {
|
|
259
|
+
return v ? 'spinner' : 'none';
|
|
260
|
+
}
|
|
261
|
+
return v;
|
|
262
|
+
}
|
|
263
|
+
}]));
|
|
264
|
+
/** If true, the table will show a loading cover while data is being loaded.
|
|
265
|
+
* This can be used to prevent user interaction with the table while loading.
|
|
266
|
+
* This cover is not displayed when the table is loading for the first time.
|
|
267
|
+
* Instead, the table will show a loading based on loadingIndicator settings.
|
|
268
|
+
*/
|
|
269
|
+
loadingCover = input('spinner', ...(ngDevMode ? [{ debugName: "loadingCover", transform: v => {
|
|
270
|
+
if (typeof v === 'boolean') {
|
|
271
|
+
return v ? 'spinner' : 'none';
|
|
272
|
+
}
|
|
273
|
+
return v;
|
|
274
|
+
} }] : [{
|
|
275
|
+
transform: v => {
|
|
276
|
+
if (typeof v === 'boolean') {
|
|
277
|
+
return v ? 'spinner' : 'none';
|
|
278
|
+
}
|
|
279
|
+
return v;
|
|
280
|
+
}
|
|
281
|
+
}]));
|
|
176
282
|
// @Input() rowColor?: (row: any) => BootstrapColor;
|
|
177
283
|
_columns;
|
|
178
284
|
_detailRow;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
285
|
+
_dataResult = signal(undefined, ...(ngDevMode ? [{ debugName: "_dataResult" }] : []));
|
|
286
|
+
_lastRequest; // The last data request made to the data source
|
|
287
|
+
_loadingRequest; // The current data request being processed
|
|
182
288
|
_rowStates = new Map();
|
|
183
289
|
_formatString = formatString;
|
|
184
290
|
_changeSubscription;
|
|
185
291
|
_dataSource;
|
|
186
|
-
|
|
292
|
+
_pagingFormatter;
|
|
293
|
+
_lastError;
|
|
294
|
+
constructor(_ls, _destroyRef) {
|
|
295
|
+
this._ls = _ls;
|
|
187
296
|
this._destroyRef = _destroyRef;
|
|
188
297
|
}
|
|
189
298
|
ngOnInit() {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
else if (this.source() instanceof DataSource) {
|
|
197
|
-
this._dataSource = this.source();
|
|
198
|
-
}
|
|
199
|
-
else if (this.source() == undefined) {
|
|
200
|
-
this._dataSource = new ArrayDataSource([]);
|
|
201
|
-
}
|
|
202
|
-
else {
|
|
203
|
-
throw new Error('Invalid data source provided to ng0-table.');
|
|
204
|
-
}
|
|
299
|
+
}
|
|
300
|
+
ngAfterContentInit() {
|
|
301
|
+
this._dataSource = dataSourceAttribute(this.source());
|
|
302
|
+
const locale = this._ls.get();
|
|
303
|
+
this._pagingFormatter = locale?.definition.components?.table?.pagingInfo ??
|
|
304
|
+
((o) => `Showing ${o.firstRecord}-${o.lastRecord} of ${o.totalRecords} records`);
|
|
205
305
|
// this._changeSubscription = this.dataSource().change.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(result => {
|
|
206
306
|
// this.reload();
|
|
207
307
|
// });
|
|
208
|
-
}
|
|
209
|
-
ngAfterContentInit() {
|
|
210
308
|
if (this.autoLoad()) {
|
|
211
|
-
this.
|
|
309
|
+
this.load(this.pageable()?.pageIndex);
|
|
212
310
|
}
|
|
213
311
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
let
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
312
|
+
/**
|
|
313
|
+
* Load data for the specified page index (optional).
|
|
314
|
+
* @param pageIndex The page index to load.
|
|
315
|
+
*/
|
|
316
|
+
load(pageIndex) {
|
|
317
|
+
let page;
|
|
318
|
+
let filters = [];
|
|
319
|
+
let sort;
|
|
320
|
+
if (this.filterable()) {
|
|
321
|
+
this._columns.forEach(col => {
|
|
322
|
+
if (col.filterable() && col.filterValue() != '' && col.filterValue() != undefined) {
|
|
323
|
+
filters.push({ field: col.fieldName() ?? col.filterField() ?? col.field(), value: col.filterValue(), operator: col.filterOperator() });
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
if (this.pageable()) {
|
|
328
|
+
page = {
|
|
329
|
+
index: pageIndex || this._lastRequest?.page?.index || 1,
|
|
330
|
+
size: this._lastRequest?.page?.size || 10,
|
|
331
|
+
zeroBased: false
|
|
332
|
+
};
|
|
223
333
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
334
|
+
if (this.sortable()) {
|
|
335
|
+
let col = this._columns.find(c => c.sortable() && c.sortDirection() != 'none' && (c.field() != '' || c.fieldName() != ''));
|
|
336
|
+
if (col) {
|
|
337
|
+
sort = {
|
|
338
|
+
field: col.fieldName() ?? col.field(),
|
|
339
|
+
asc: col.sortDirection() === 'asc'
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
this._loadingRequest = new DataRequest({ page, filters, sort, select: [], computeTotal: true });
|
|
344
|
+
this._dataSource.load(this._loadingRequest)
|
|
345
|
+
.pipe(takeUntilDestroyed(this._destroyRef)).subscribe({
|
|
346
|
+
next: result => {
|
|
347
|
+
this._dataResult.set(result);
|
|
348
|
+
this._lastRequest = this._loadingRequest;
|
|
349
|
+
this._loadingRequest = undefined;
|
|
350
|
+
this._lastError = undefined;
|
|
351
|
+
}, error: err => {
|
|
352
|
+
this._lastError = err;
|
|
353
|
+
this._lastRequest = this._loadingRequest;
|
|
354
|
+
this._loadingRequest = undefined;
|
|
355
|
+
}
|
|
229
356
|
});
|
|
230
357
|
}
|
|
231
|
-
|
|
232
|
-
|
|
358
|
+
/**
|
|
359
|
+
* Determines if the table is currently loading data.
|
|
360
|
+
*/
|
|
361
|
+
get isLoading() {
|
|
362
|
+
return this._dataSource.isLoading;
|
|
233
363
|
}
|
|
234
364
|
_getCellValue(row, col) {
|
|
235
|
-
var subFields = col.field.split('.');
|
|
365
|
+
var subFields = col.field().split('.');
|
|
236
366
|
let value = row[subFields[0]];
|
|
237
367
|
for (let i = 1; i < subFields.length; i++) {
|
|
238
368
|
if (value == null)
|
|
@@ -241,15 +371,10 @@ class TableComponent {
|
|
|
241
371
|
}
|
|
242
372
|
return value;
|
|
243
373
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
this.reload();
|
|
374
|
+
_onPageChange(pageIndex) {
|
|
375
|
+
this.load(pageIndex);
|
|
247
376
|
}
|
|
248
|
-
|
|
249
|
-
// --this.pageIndex
|
|
250
|
-
this.reload();
|
|
251
|
-
}
|
|
252
|
-
onToggleRowDetailClick(row) {
|
|
377
|
+
_onToggleRowDetailClick(row) {
|
|
253
378
|
var state = this._rowStates.get(row);
|
|
254
379
|
if (!state) {
|
|
255
380
|
this._rowStates.set(row, { expanded: true });
|
|
@@ -262,38 +387,57 @@ class TableComponent {
|
|
|
262
387
|
var state = this._rowStates.get(row);
|
|
263
388
|
return state == undefined ? false : state.expanded;
|
|
264
389
|
}
|
|
390
|
+
_onToggleFilterOperator(col) {
|
|
391
|
+
if (col.showFilterOperators()) {
|
|
392
|
+
col.showFilterOperators.set(false);
|
|
393
|
+
}
|
|
394
|
+
else {
|
|
395
|
+
this._columns.forEach(x => x.showFilterOperators.set(false));
|
|
396
|
+
col.showFilterOperators.set(true);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
_onSelectFilterOperator(col, filterOperator) {
|
|
400
|
+
col.filterOperator.set(filterOperator);
|
|
401
|
+
this._columns.forEach(x => x.showFilterOperators.set(false));
|
|
402
|
+
this.load(0);
|
|
403
|
+
}
|
|
265
404
|
ngOnDestroy() {
|
|
266
405
|
this._changeSubscription?.unsubscribe();
|
|
267
406
|
}
|
|
268
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
269
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.6", type: TableComponent, isStandalone: true, selector: "ng0-table", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, autoLoad: { classPropertyName: "autoLoad", publicName: "autoLoad", isSignal: true, isRequired: false, transformFunction: null }, showRowNumbers: { classPropertyName: "showRowNumbers", publicName: "showRowNumbers", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, pagable: { classPropertyName: "pagable", publicName: "pagable", isSignal: true, isRequired: false, transformFunction: null }, showPagination: { classPropertyName: "showPagination", publicName: "showPagination", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, headerClass: { classPropertyName: "headerClass", publicName: "headerClass", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_detailRow", first: true, predicate: TableDetailRowDirective, descendants: true }, { propertyName: "_columns", predicate: TableColumnDirective }], exportAs: ["ng0Table"], ngImport: i0, template: "<div class=\"table-responsive\" [style.height]=\"height()\" [class.table-scrollable]=\"height()! > 0\">\r\n <table class=\"table\" [ngClass]=\"tableClass()\">\r\n @if(caption()) {\r\n <caption>{{caption()}}</caption>\r\n }\r\n\r\n <thead *ngIf=\"showHeader\" [ngClass]=\"headerClass()\">\r\n <tr>\r\n <th *ngIf=\"_detailRow\"></th>\r\n <th *ngIf=\"showRowNumbers()\" class=\"row-number text-muted\">#</th>\r\n <th *ngFor=\"let col of _columns\">{{col.title}}</th>\r\n </tr>\r\n </thead>\r\n <thead *ngIf=\"filterable()\">\r\n <tr>\r\n <th *ngIf=\"_detailRow\"></th>\r\n\r\n @if(showRowNumbers()) {\r\n <th></th>\r\n }\r\n\r\n <th *ngFor=\"let col of _columns\">\r\n @if(col.filterable) {\r\n @if(col.type == 'text') {\r\n <input [name]=\"'datatablecol-' + col.field\"\r\n type=\"text\"\r\n [maxlength]=\"50\"\r\n class=\"form-control form-control-sm\"\r\n [(ngModel)]=\"col.filterValue\"\r\n (keydown.enter)=\"reload()\">\r\n }@else if(col.type == 'number') {\r\n <input [name]=\"'datatablecol-' + col.field\"\r\n type=\"number\"\r\n class=\"form-control form-control-sm\"\r\n [(ngModel)]=\"col.filterValue\"\r\n (keydown.enter)=\"reload()\">\r\n }\r\n }\r\n </th>\r\n </tr>\r\n </thead>\r\n\r\n <tbody>\r\n <ng-container *ngIf=\"_data && _data.length! > 0\">\r\n <ng-container *ngFor=\"let row of _data; let i=index\">\r\n <tr [class.table-active]=\"isRowExpanded(row)\">\r\n <td class=\"detail-row-expander\" *ngIf=\"_detailRow\">\r\n <button class=\"btn\" (click)=\"onToggleRowDetailClick(row)\"\r\n *ngIf=\"_detailRow.showCallback == null || _detailRow.showCallback(row)\">\r\n <ng-template [ngIf]=\"isRowExpanded(row)\" [ngIfElse]=\"collapse\"><i\r\n class=\"far fa-minus\"></i></ng-template>\r\n <ng-template #collapse><i class=\"far fa-plus\"></i> </ng-template>\r\n </button>\r\n </td>\r\n\r\n <td class=\"row-number text-muted\" *ngIf=\"showRowNumbers()\">{{pageSize() * pageIndex() + i + 1}}</td>\r\n\r\n <td *ngFor=\"let col of _columns\" [ngClass]=\"col.cellClass\" [class.shrinked]=\"col.shrink\"\r\n [class.fw-bold]=\"col.bold\">\r\n @if(col.template){\r\n <ng-template [ngIf]=\"col.template\">\r\n <ng-container\r\n *ngTemplateOutlet=\"col.template; context: {$implicit: row}\"></ng-container>\r\n </ng-template>\r\n }@else if(col.field){\r\n @let cellValue = _getCellValue(row, col);\r\n <div\r\n [class.badge]=\"col.badge\"\r\n [class.text-bg-primary]=\"col.badge?.primary && cellValue === col.badge?.primary\"\r\n [class.text-bg-secondary]=\"col.badge?.secondary && cellValue === col.badge?.secondary\"\r\n [class.text-bg-success]=\"col.badge?.success && cellValue === col.badge?.success\"\r\n [class.text-bg-light]=\"col.badge && cellValue !== col.badge.success && cellValue !== col.badge.secondary && cellValue !== col.badge.success \">\r\n\r\n <ng-container *ngIf=\"col.type=='text'\">\r\n {{cellValue}}\r\n </ng-container>\r\n <ng-container *ngIf=\"col.type=='date'\">\r\n <span class=\"date-time\">{{cellValue | ng0Date}}</span>\r\n </ng-container>\r\n <ng-container *ngIf=\"col.type=='number'\">\r\n {{cellValue | number}}\r\n </ng-container>\r\n <ng-container *ngIf=\"col.type=='currency'\">\r\n {{cellValue | number}}\r\n </ng-container>\r\n <ng-container *ngIf=\"$any(col?.type)?.enum\">\r\n {{cellValue | ng0Enum:$any(col.type).enum}}\r\n </ng-container>\r\n <!-- <ng-container *ngIf=\"$any(col?.type)?.boolean\">\r\n {{cellValue | ng0Bool:$any(col.type).boolean}}\r\n </ng-container> -->\r\n <ng-container *ngIf=\"$any(col?.type)?.currency\">\r\n {{cellValue | currency:$any(col?.type)?.currency}}\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"cellValue == null && col.emptyCellText\">\r\n {{col.emptyCellText}}\r\n </ng-container>\r\n\r\n\r\n </div>\r\n }\r\n </td>\r\n </tr>\r\n\r\n <tr class=\"detail-row\" *ngIf=\"_detailRow && isRowExpanded(row)\">\r\n <td [attr.colspan]=\"_columns.length + (showRowNumbers() ? 1 : 0) + 1\" class=\"ps-2 pb-4\">\r\n <ng-container\r\n *ngTemplateOutlet=\"_detailRow.templateRef; context: {$implicit: row}\"></ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n\r\n </ng-container>\r\n\r\n <tr *ngIf=\"_data?.length === 0\">\r\n <td [colSpan]=\"_columns.length + (showRowNumbers() ? 1 : 0)\" class=\"text-center text-muted small p-2\">\r\n {{'noRecords' | ng0Translate}}\r\n </td>\r\n </tr>\r\n <tr *ngIf=\"_dataSource.loading\" class=\"loading-row\">\r\n <td [colSpan]=\"_columns.length + (showRowNumbers() ? 1 : 0)\" class=\"text-center\">\r\n <div class=\"spinner-border text-primary\" role=\"status\"></div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n\r\n<!-- <ng0-table-paging></ng0-table-paging> -->\r\n\r\n<!-- <div class=\"mt-auto\" *ngIf=\"pagination()\">\r\n <div class=\"btn-group me-2\" role=\"group\">\r\n <button type=\"button\"\r\n class=\"btn btn-outline-primary\"\r\n (click)=\"onPreviousPageClick()\"\r\n [disabled]=\"loading || pageIndex() == 0\">\r\n {{'previous' | ng0Translate}}\r\n </button>\r\n <button type=\"button\"\r\n class=\"btn btn-outline-primary\"\r\n (click)=\"onNextPageClick()\"\r\n [disabled]=\"loading || !_totalPages || (pageIndex() == _totalPages-1)\">\r\n {{'next' | ng0Translate}}\r\n </button>\r\n </div>\r\n\r\n <span *ngIf=\"_totalPages\">\r\n {{_formatString( 'dataTablePagination' | ng0Translate, pageIndex()+1, _totalPages) }}\r\n </span>\r\n</div> -->", styles: [":host{display:flex;flex-direction:column;position:relative}td.row-number{width:0}td.shrinked{width:0;white-space:nowrap}tr.loading-row{position:absolute;inset:0;background-color:#00000014;transition:background-color 1s;z-index:1000}tr.loading-row td{border:none;height:100%;display:flex;justify-content:center;align-items:center}.table-scrollable{overflow-y:auto;direction:ltr;scroll-padding:20px}.table-scrollable::-webkit-scrollbar{width:8px}.table-scrollable::-webkit-scrollbar-track{background-color:#00000008}.table-scrollable::-webkit-scrollbar-thumb{background-color:var(--bs-secondary)}.table-scrollable thead th{position:sticky;top:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { 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: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: LocalizationModule }, { kind: "pipe", type: i3.TranslatePipe, name: "ng0Translate" }, { kind: "pipe", type: i3.EnumPipe, name: "ng0Enum" }, { kind: "pipe", type: i3.DatePipe, name: "ng0Date" }] });
|
|
407
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableComponent, deps: [{ token: i1.LocalizationService }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
408
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.11", type: TableComponent, isStandalone: true, selector: "ng0-table", inputs: { source: { classPropertyName: "source", publicName: "source", isSignal: true, isRequired: true, transformFunction: null }, autoLoad: { classPropertyName: "autoLoad", publicName: "autoLoad", isSignal: true, isRequired: false, transformFunction: null }, showRowNumbers: { classPropertyName: "showRowNumbers", publicName: "showRowNumbers", isSignal: true, isRequired: false, transformFunction: null }, showHeader: { classPropertyName: "showHeader", publicName: "showHeader", isSignal: true, isRequired: false, transformFunction: null }, pageable: { classPropertyName: "pageable", publicName: "pageable", isSignal: true, isRequired: false, transformFunction: null }, sortable: { classPropertyName: "sortable", publicName: "sortable", isSignal: true, isRequired: false, transformFunction: null }, tableClass: { classPropertyName: "tableClass", publicName: "tableClass", isSignal: true, isRequired: false, transformFunction: null }, headerClass: { classPropertyName: "headerClass", publicName: "headerClass", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, filterable: { classPropertyName: "filterable", publicName: "filterable", isSignal: true, isRequired: false, transformFunction: null }, loadingIndicator: { classPropertyName: "loadingIndicator", publicName: "loadingIndicator", isSignal: true, isRequired: false, transformFunction: null }, loadingCover: { classPropertyName: "loadingCover", publicName: "loadingCover", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ng0-loading": "this.isLoading" } }, queries: [{ propertyName: "_detailRow", first: true, predicate: TableDetailRowDirective, descendants: true }, { propertyName: "_columns", predicate: TableColumnDirective }], exportAs: ["ng0Table"], ngImport: i0, template: "@let $dataResult = _dataResult();\n@let $pageable = pageable();\n@let $pageIndex = _lastRequest?.page?.index ?? 1;\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecord = $pageable ? ($pageable.pageSize! * ($pageIndex - 1) + 1) : 1;\n@let $lastRecord = $data ? $firstRecord + $data.length - 1 : 1;\n@let $isLoading = _dataSource.isLoading();\n@let $isFirstLoad = $dataResult == undefined;\n@let $columnsCount = _columns.length + (showRowNumbers() ? 1 : 0);\n@let $tableLocale = _ls.get()?.definition?.components?.table;\n\n<div class=\"table-responsive\" [style.height]=\"height()\" [class.table-scrollable]=\"height()! > 0\">\n <table class=\"table\" [ngClass]=\"tableClass()\">\n @if (caption()) {\n <caption>{{caption()}}</caption>\n }\n\n @if (showHeader()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n }\n\n @if (filterable()) {\n <ng-container *ngTemplateOutlet=\"filtersTemplate\"></ng-container>\n }\n\n <tbody>\n @if ($isLoading && $isFirstLoad && loadingIndicator()) {\n <tr class=\"ng0-table-loading-row\">\n <td [attr.colspan]=\"$columnsCount\">\n @switch (loadingIndicator()) {\n @case ('spinner') {\n <div class=\"text-center\">\n <div class=\"spinner-border\" role=\"status\"></div>\n </div>\n }\n }\n </td>\n </tr>\n } @else {\n @if ($data) {\n @if ($data.length > 0) {\n <ng-container *ngTemplateOutlet=\"dataRowsTemplate\"></ng-container>\n } @else {\n <tr class=\"ng0-table-no-records-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"text-center p-2\">\n {{ $tableLocale?.noRecords ?? 'No Records.' }}\n </td>\n </tr>\n }\n } @else if (_lastError) {\n <ng-container *ngTemplateOutlet=\"nowDataTemplate\"></ng-container>\n }\n }\n </tbody>\n </table>\n</div>\n\n<div class=\"ng0-table-footer d-flex align-items-baseline\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n</div>\n\n@if ($isLoading && !$isFirstLoad && loadingCover()) {\n<div class=\"ng0-table-loading-cover text-center\">\n @if (loadingCover() == 'spinner') {\n <div class=\"spinner-border\" role=\"status\"></div>\n }\n</div>\n}\n\n<ng-template #filtersTemplate>\n <thead>\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th></th>\n }\n\n @for (col of _columns; track $index) {\n <th>\n @if(col.filterable() && (col.field() || col.filterValue())) {\n\n <div class=\"input-group\">\n @switch (col.type()) {\n @case ('text') {\n <input [name]=\"'filter-' + col.field\"\n type=\"search\"\n [maxlength]=\"50\"\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n @case ('number') {\n <input [name]=\"'datatablecol-' + col.field\"\n type=\"search\"\n ng0Number\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n }\n\n <button class=\"btn btn-outline-light\"\n style=\"border-color: var(--bs-border-color);\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"_onToggleFilterOperator(col)\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M19 3H5C3.58579 3 2.87868 3 2.43934 3.4122C2 3.8244 2 4.48782 2 5.81466V6.50448C2 7.54232 2 8.06124 2.2596 8.49142C2.5192 8.9216 2.99347 9.18858 3.94202 9.72255L6.85504 11.3624C7.49146 11.7206 7.80967 11.8998 8.03751 12.0976C8.51199 12.5095 8.80408 12.9935 8.93644 13.5872C9 13.8722 9 14.2058 9 14.8729L9 17.5424C9 18.452 9 18.9067 9.25192 19.2613C9.50385 19.6158 9.95128 19.7907 10.8462 20.1406C12.7248 20.875 13.6641 21.2422 14.3321 20.8244C15 20.4066 15 19.4519 15 17.5424V14.8729C15 14.2058 15 13.8722 15.0636 13.5872C15.1959 12.9935 15.488 12.5095 15.9625 12.0976C16.1903 11.8998 16.5085 11.7206 17.145 11.3624L20.058 9.72255C21.0065 9.18858 21.4808 8.9216 21.7404 8.49142C22 8.06124 22 7.54232 22 6.50448V5.81466C22 4.48782 22 3.8244 21.5607 3.4122C21.1213 3 20.4142 3 19 3Z\"\n stroke=\"#1C274C\" stroke-width=\"1.5\" />\n </svg>\n </button>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"col.showFilterOperators()\"\n (overlayOutsideClick)=\"col.showFilterOperators.set(false)\"\n (detach)=\"col.showFilterOperators.set(false)\">\n <ul class=\"dropdown-menu show\" animate.enter=\"fade-in\">\n @for (item of col.getFilterOperators(); track $index) {\n <li>\n <button class=\"dropdown-item\" [class.active]=\"item == col.filterOperator()\"\n (click)=\"_onSelectFilterOperator(col, item)\">\n {{_ls.get()?.definition?.data?.logicalOperators?.[item] ?? item }}\n </button>\n </li>\n }\n </ul>\n </ng-template>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #headerTemplate>\n <thead [ngClass]=\"headerClass()\">\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th class=\"row-number text-muted\">#</th>\n }\n\n @for (col of _columns; track $index) {\n <th\n (click)=\"col.toggleSortDirection(); load()\"\n [class.sortable]=\"sortable() && col.sortable()\"\n [ngClass]=\"{ \n 'sort-asc': col.sortDirection() == 'asc', \n 'sort-desc': col.sortDirection() == 'desc',\n 'sort-none': col.sortDirection() == 'none'\n }\">\n {{ col.title() }}\n\n @if(sortable() && col.sortable()) {\n <svg class=\"ng0-table-sort-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\" fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L12 16\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n <path d=\"M8 13L12 17L16 13\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #dataRowsTemplate>\n @for (row of $data; track $index) {\n <tr [class.table-active]=\"isRowExpanded(row)\">\n @if (_detailRow) {\n <td class=\"detail-row-expander\">\n @if (_detailRow.showCallback == null || _detailRow.showCallback(row)) {\n <button class=\"btn\" (click)=\"_onToggleRowDetailClick(row)\">\n @if (isRowExpanded(row)) {\n <i class=\"far fa-minus\"></i>\n } @else {\n <i class=\"far fa-plus\"></i>\n }\n </button>\n }\n </td>\n }\n\n @if (showRowNumbers()) {\n <td class=\"ng0-table-row-number\">\n {{ $firstRecord + $index }}\n </td>\n }\n\n @for (col of _columns; track $index) {\n <td\n [ngClass]=\"col.cellClass()\"\n [class.shrinked]=\"col.shrink()\"\n [class.fw-bold]=\"col.bold()\">\n @if (col.template) {\n <ng-container *ngTemplateOutlet=\"col.template; context: { $implicit: row }\">\n </ng-container>\n } @else if (col.field()) {\n @let cellValue = _getCellValue(row, col);\n\n @if ((cellValue === null || cellValue === undefined) && col.emptyCellText()) {\n {{ col.emptyCellText() }}\n } @else {\n @if (col.type()) {\n @let type = $any(col.type());\n\n @if (type == \"date\") {\n {{ cellValue | ng0Date }}\n } @else if (type == \"number\") {\n {{ cellValue | number }}\n } @else if (type == \"currency\") {\n {{ cellValue | currency }}\n } @else if (type.enum) {\n {{ cellValue | ng0TranslateEnum: type.enum.name : type.enum.fallback }}\n } @else if (type.boolean || type == \"boolean\") {\n {{ cellValue | ng0LocalizeBool: type.boolean.false ?? \"false\" : type.boolean.false ?? \"true\" }}\n }@else {\n {{ cellValue }}\n }\n }\n }\n }\n </td>\n }\n </tr>\n\n @if (_detailRow && isRowExpanded(row)) {\n <tr class=\"detail-row\">\n <td\n [attr.colspan]=\"_columns.length + (showRowNumbers() ? 1 : 0) + 1\"\n class=\"ps-2 pb-4\">\n <ng-container\n *ngTemplateOutlet=\"_detailRow.templateRef; context: { $implicit: row }\"></ng-container>\n </td>\n </tr>\n }\n }\n</ng-template>\n\n<ng-template #footerTemplate>\n @if ($pageable && $pageable.showPagingControls && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"$pageable.showFirstLastButtons == true\"\n [showNextPreviousButtons]=\"$pageable.showNextPreviousButtons == true\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"$pageable.pageSize!\"\n [selectedPage]=\"$pageIndex\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"$pageable.maxVisiblePages!\">\n <ng-container ngProjectAs=\"first\">\n <ng-content select=\"paging-first\">\n {{ \"first\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"last\">\n <ng-content select=\"paging-last\">\n {{ \"last\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"next\">\n <ng-content select=\"paging-next\">\n {{ \"next\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"previous\">\n <ng-content select=\"paging-previous\">\n {{ \"previous\" | ng0Translate }}\n </ng-content>\n </ng-container>\n </ng0-pagination>\n </div>\n\n @if ($pageable.showPageSizeOptions || $pageable.showPageSizeOptions == undefined) {\n <div class=\"ng0-table-paging-options\">\n <select name=\"pageSizeOptions\" class=\"form-select w-auto d-inline-block\">\n <option [ngValue]=\"10\" selected>10</option>\n </select>\n </div>\n }\n\n @if ($pageable.showPagingInfo == undefined || $pageable.showPagingInfo) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecord, lastRecord: $lastRecord, totalRecords: $totalRecordsCount!,\n currentPage: $pageIndex!})\n }}\n </ng-content>\n </div>\n }\n }\n</ng-template>\n\n<ng-template #nowDataTemplate>\n <tr class=\"ng0-table-error-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"p-2\">\n <div class=\"d-flex align-items-baseline\">\n <span>{{ $tableLocale?.loadError ?? 'Error loading data.' }} </span>\n <button (click)=\"load()\" class=\"btn btn-warning ms-auto\">\n {{ \"retry\" | ng0Translate }}\n </button>\n </div>\n </td>\n </tr>\n</ng-template>", styles: [":host{display:flex;flex-direction:column;position:relative}@starting-style{.ng0-table-loading-cover{background-color:#0000}}table{margin-bottom:0}th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none}th.sortable .ng0-table-sort-icon{transition:transform .2s;opacity:0}th.sortable.sort-none:hover .ng0-table-sort-icon{opacity:.4}th.sortable.sort-asc .ng0-table-sort-icon{transform:rotate(0);opacity:1;color:var(--bs-danger)}th.sortable.sort-desc .ng0-table-sort-icon{transform:rotate(180deg);opacity:1;color:var(--bs-primary)}tbody{position:relative}td.row-number{width:0}td.shrinked{width:0;white-space:nowrap}.ng0-table-loading-cover{position:absolute;inset:0;background-color:#0000000d;transition:background-color .2s;z-index:1000;display:flex;align-items:center;justify-content:center}.table-scrollable{overflow-y:auto;direction:ltr;scroll-padding:20px}.table-scrollable::-webkit-scrollbar{width:8px}.table-scrollable::-webkit-scrollbar-track{background-color:#00000008}.table-scrollable::-webkit-scrollbar-thumb{background-color:var(--bs-secondary)}.table-scrollable thead th{position:sticky;top:0}.ng0-table-footer{margin-top:.5rem}.fade-in{animation:fade-in .5s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: LocalizationModule }, { kind: "component", type: PaginationComponent, selector: "ng0-pagination", inputs: ["totalRecords", "pageSize", "selectedPage", "maxVisiblePages", "showNextPreviousButtons", "showFirstLastButtons"], outputs: ["itemClick"], exportAs: ["ng0Pagination"] }, { kind: "directive", type: NumberDirective, selector: "[ng0Number]", inputs: ["minFractionDigits", "maxFractionDigits", "useGrouping", "numberType"] }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i4.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i4.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "pipe", type: i2.DecimalPipe, name: "number" }, { kind: "pipe", type: i2.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i1.TranslatePipe, name: "ng0Translate" }, { kind: "pipe", type: i1.TranslateEnumPipe, name: "ng0TranslateEnum" }, { kind: "pipe", type: i1.DatePipe, name: "ng0Date" }, { kind: "pipe", type: i1.LocalizeBooleanPipe, name: "ng0LocalizeBool" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
270
409
|
}
|
|
271
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
272
411
|
type: Component,
|
|
273
|
-
args: [{ selector: 'ng0-table', exportAs: 'ng0Table', standalone: true, imports: [
|
|
412
|
+
args: [{ selector: 'ng0-table', exportAs: 'ng0Table', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
274
413
|
CommonModule,
|
|
275
414
|
FormsModule,
|
|
276
415
|
LocalizationModule,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
416
|
+
PaginationComponent,
|
|
417
|
+
NumberDirective,
|
|
418
|
+
OverlayModule
|
|
419
|
+
], template: "@let $dataResult = _dataResult();\n@let $pageable = pageable();\n@let $pageIndex = _lastRequest?.page?.index ?? 1;\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecord = $pageable ? ($pageable.pageSize! * ($pageIndex - 1) + 1) : 1;\n@let $lastRecord = $data ? $firstRecord + $data.length - 1 : 1;\n@let $isLoading = _dataSource.isLoading();\n@let $isFirstLoad = $dataResult == undefined;\n@let $columnsCount = _columns.length + (showRowNumbers() ? 1 : 0);\n@let $tableLocale = _ls.get()?.definition?.components?.table;\n\n<div class=\"table-responsive\" [style.height]=\"height()\" [class.table-scrollable]=\"height()! > 0\">\n <table class=\"table\" [ngClass]=\"tableClass()\">\n @if (caption()) {\n <caption>{{caption()}}</caption>\n }\n\n @if (showHeader()) {\n <ng-container *ngTemplateOutlet=\"headerTemplate\"></ng-container>\n }\n\n @if (filterable()) {\n <ng-container *ngTemplateOutlet=\"filtersTemplate\"></ng-container>\n }\n\n <tbody>\n @if ($isLoading && $isFirstLoad && loadingIndicator()) {\n <tr class=\"ng0-table-loading-row\">\n <td [attr.colspan]=\"$columnsCount\">\n @switch (loadingIndicator()) {\n @case ('spinner') {\n <div class=\"text-center\">\n <div class=\"spinner-border\" role=\"status\"></div>\n </div>\n }\n }\n </td>\n </tr>\n } @else {\n @if ($data) {\n @if ($data.length > 0) {\n <ng-container *ngTemplateOutlet=\"dataRowsTemplate\"></ng-container>\n } @else {\n <tr class=\"ng0-table-no-records-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"text-center p-2\">\n {{ $tableLocale?.noRecords ?? 'No Records.' }}\n </td>\n </tr>\n }\n } @else if (_lastError) {\n <ng-container *ngTemplateOutlet=\"nowDataTemplate\"></ng-container>\n }\n }\n </tbody>\n </table>\n</div>\n\n<div class=\"ng0-table-footer d-flex align-items-baseline\">\n <ng-container *ngTemplateOutlet=\"footerTemplate\"></ng-container>\n</div>\n\n@if ($isLoading && !$isFirstLoad && loadingCover()) {\n<div class=\"ng0-table-loading-cover text-center\">\n @if (loadingCover() == 'spinner') {\n <div class=\"spinner-border\" role=\"status\"></div>\n }\n</div>\n}\n\n<ng-template #filtersTemplate>\n <thead>\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th></th>\n }\n\n @for (col of _columns; track $index) {\n <th>\n @if(col.filterable() && (col.field() || col.filterValue())) {\n\n <div class=\"input-group\">\n @switch (col.type()) {\n @case ('text') {\n <input [name]=\"'filter-' + col.field\"\n type=\"search\"\n [maxlength]=\"50\"\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n @case ('number') {\n <input [name]=\"'datatablecol-' + col.field\"\n type=\"search\"\n ng0Number\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"col.filterValue\"\n (keydown.enter)=\"load(0)\">\n }\n }\n\n <button class=\"btn btn-outline-light\"\n style=\"border-color: var(--bs-border-color);\"\n cdkOverlayOrigin\n #trigger=\"cdkOverlayOrigin\"\n (click)=\"_onToggleFilterOperator(col)\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M19 3H5C3.58579 3 2.87868 3 2.43934 3.4122C2 3.8244 2 4.48782 2 5.81466V6.50448C2 7.54232 2 8.06124 2.2596 8.49142C2.5192 8.9216 2.99347 9.18858 3.94202 9.72255L6.85504 11.3624C7.49146 11.7206 7.80967 11.8998 8.03751 12.0976C8.51199 12.5095 8.80408 12.9935 8.93644 13.5872C9 13.8722 9 14.2058 9 14.8729L9 17.5424C9 18.452 9 18.9067 9.25192 19.2613C9.50385 19.6158 9.95128 19.7907 10.8462 20.1406C12.7248 20.875 13.6641 21.2422 14.3321 20.8244C15 20.4066 15 19.4519 15 17.5424V14.8729C15 14.2058 15 13.8722 15.0636 13.5872C15.1959 12.9935 15.488 12.5095 15.9625 12.0976C16.1903 11.8998 16.5085 11.7206 17.145 11.3624L20.058 9.72255C21.0065 9.18858 21.4808 8.9216 21.7404 8.49142C22 8.06124 22 7.54232 22 6.50448V5.81466C22 4.48782 22 3.8244 21.5607 3.4122C21.1213 3 20.4142 3 19 3Z\"\n stroke=\"#1C274C\" stroke-width=\"1.5\" />\n </svg>\n </button>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"col.showFilterOperators()\"\n (overlayOutsideClick)=\"col.showFilterOperators.set(false)\"\n (detach)=\"col.showFilterOperators.set(false)\">\n <ul class=\"dropdown-menu show\" animate.enter=\"fade-in\">\n @for (item of col.getFilterOperators(); track $index) {\n <li>\n <button class=\"dropdown-item\" [class.active]=\"item == col.filterOperator()\"\n (click)=\"_onSelectFilterOperator(col, item)\">\n {{_ls.get()?.definition?.data?.logicalOperators?.[item] ?? item }}\n </button>\n </li>\n }\n </ul>\n </ng-template>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #headerTemplate>\n <thead [ngClass]=\"headerClass()\">\n <tr>\n @if (_detailRow) {\n <th></th>\n }\n\n @if (showRowNumbers()) {\n <th class=\"row-number text-muted\">#</th>\n }\n\n @for (col of _columns; track $index) {\n <th\n (click)=\"col.toggleSortDirection(); load()\"\n [class.sortable]=\"sortable() && col.sortable()\"\n [ngClass]=\"{ \n 'sort-asc': col.sortDirection() == 'asc', \n 'sort-desc': col.sortDirection() == 'desc',\n 'sort-none': col.sortDirection() == 'none'\n }\">\n {{ col.title() }}\n\n @if(sortable() && col.sortable()) {\n <svg class=\"ng0-table-sort-icon\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\" fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L12 16\" stroke=\"currentColor\" stroke-width=\"1\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\n <path d=\"M8 13L12 17L16 13\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\" />\n </svg>\n }\n </th>\n }\n </tr>\n </thead>\n</ng-template>\n\n<ng-template #dataRowsTemplate>\n @for (row of $data; track $index) {\n <tr [class.table-active]=\"isRowExpanded(row)\">\n @if (_detailRow) {\n <td class=\"detail-row-expander\">\n @if (_detailRow.showCallback == null || _detailRow.showCallback(row)) {\n <button class=\"btn\" (click)=\"_onToggleRowDetailClick(row)\">\n @if (isRowExpanded(row)) {\n <i class=\"far fa-minus\"></i>\n } @else {\n <i class=\"far fa-plus\"></i>\n }\n </button>\n }\n </td>\n }\n\n @if (showRowNumbers()) {\n <td class=\"ng0-table-row-number\">\n {{ $firstRecord + $index }}\n </td>\n }\n\n @for (col of _columns; track $index) {\n <td\n [ngClass]=\"col.cellClass()\"\n [class.shrinked]=\"col.shrink()\"\n [class.fw-bold]=\"col.bold()\">\n @if (col.template) {\n <ng-container *ngTemplateOutlet=\"col.template; context: { $implicit: row }\">\n </ng-container>\n } @else if (col.field()) {\n @let cellValue = _getCellValue(row, col);\n\n @if ((cellValue === null || cellValue === undefined) && col.emptyCellText()) {\n {{ col.emptyCellText() }}\n } @else {\n @if (col.type()) {\n @let type = $any(col.type());\n\n @if (type == \"date\") {\n {{ cellValue | ng0Date }}\n } @else if (type == \"number\") {\n {{ cellValue | number }}\n } @else if (type == \"currency\") {\n {{ cellValue | currency }}\n } @else if (type.enum) {\n {{ cellValue | ng0TranslateEnum: type.enum.name : type.enum.fallback }}\n } @else if (type.boolean || type == \"boolean\") {\n {{ cellValue | ng0LocalizeBool: type.boolean.false ?? \"false\" : type.boolean.false ?? \"true\" }}\n }@else {\n {{ cellValue }}\n }\n }\n }\n }\n </td>\n }\n </tr>\n\n @if (_detailRow && isRowExpanded(row)) {\n <tr class=\"detail-row\">\n <td\n [attr.colspan]=\"_columns.length + (showRowNumbers() ? 1 : 0) + 1\"\n class=\"ps-2 pb-4\">\n <ng-container\n *ngTemplateOutlet=\"_detailRow.templateRef; context: { $implicit: row }\"></ng-container>\n </td>\n </tr>\n }\n }\n</ng-template>\n\n<ng-template #footerTemplate>\n @if ($pageable && $pageable.showPagingControls && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"$pageable.showFirstLastButtons == true\"\n [showNextPreviousButtons]=\"$pageable.showNextPreviousButtons == true\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"$pageable.pageSize!\"\n [selectedPage]=\"$pageIndex\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"$pageable.maxVisiblePages!\">\n <ng-container ngProjectAs=\"first\">\n <ng-content select=\"paging-first\">\n {{ \"first\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"last\">\n <ng-content select=\"paging-last\">\n {{ \"last\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"next\">\n <ng-content select=\"paging-next\">\n {{ \"next\" | ng0Translate }}\n </ng-content>\n </ng-container>\n\n <ng-container ngProjectAs=\"previous\">\n <ng-content select=\"paging-previous\">\n {{ \"previous\" | ng0Translate }}\n </ng-content>\n </ng-container>\n </ng0-pagination>\n </div>\n\n @if ($pageable.showPageSizeOptions || $pageable.showPageSizeOptions == undefined) {\n <div class=\"ng0-table-paging-options\">\n <select name=\"pageSizeOptions\" class=\"form-select w-auto d-inline-block\">\n <option [ngValue]=\"10\" selected>10</option>\n </select>\n </div>\n }\n\n @if ($pageable.showPagingInfo == undefined || $pageable.showPagingInfo) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecord, lastRecord: $lastRecord, totalRecords: $totalRecordsCount!,\n currentPage: $pageIndex!})\n }}\n </ng-content>\n </div>\n }\n }\n</ng-template>\n\n<ng-template #nowDataTemplate>\n <tr class=\"ng0-table-error-row\">\n <td [attr.colSpan]=\"$columnsCount\" class=\"p-2\">\n <div class=\"d-flex align-items-baseline\">\n <span>{{ $tableLocale?.loadError ?? 'Error loading data.' }} </span>\n <button (click)=\"load()\" class=\"btn btn-warning ms-auto\">\n {{ \"retry\" | ng0Translate }}\n </button>\n </div>\n </td>\n </tr>\n</ng-template>", styles: [":host{display:flex;flex-direction:column;position:relative}@starting-style{.ng0-table-loading-cover{background-color:#0000}}table{margin-bottom:0}th.sortable{cursor:pointer;-webkit-user-select:none;user-select:none}th.sortable .ng0-table-sort-icon{transition:transform .2s;opacity:0}th.sortable.sort-none:hover .ng0-table-sort-icon{opacity:.4}th.sortable.sort-asc .ng0-table-sort-icon{transform:rotate(0);opacity:1;color:var(--bs-danger)}th.sortable.sort-desc .ng0-table-sort-icon{transform:rotate(180deg);opacity:1;color:var(--bs-primary)}tbody{position:relative}td.row-number{width:0}td.shrinked{width:0;white-space:nowrap}.ng0-table-loading-cover{position:absolute;inset:0;background-color:#0000000d;transition:background-color .2s;z-index:1000;display:flex;align-items:center;justify-content:center}.table-scrollable{overflow-y:auto;direction:ltr;scroll-padding:20px}.table-scrollable::-webkit-scrollbar{width:8px}.table-scrollable::-webkit-scrollbar-track{background-color:#00000008}.table-scrollable::-webkit-scrollbar-thumb{background-color:var(--bs-secondary)}.table-scrollable thead th{position:sticky;top:0}.ng0-table-footer{margin-top:.5rem}.fade-in{animation:fade-in .5s}@keyframes fade-in{0%{opacity:0}to{opacity:1}}\n"] }]
|
|
420
|
+
}], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.DestroyRef }], propDecorators: { source: [{ type: i0.Input, args: [{ isSignal: true, alias: "source", required: true }] }], autoLoad: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoLoad", required: false }] }], showRowNumbers: [{ type: i0.Input, args: [{ isSignal: true, alias: "showRowNumbers", required: false }] }], showHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "showHeader", required: false }] }], pageable: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageable", required: false }] }], sortable: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortable", required: false }] }], tableClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "tableClass", required: false }] }], headerClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "headerClass", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], filterable: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterable", required: false }] }], loadingIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingIndicator", required: false }] }], loadingCover: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadingCover", required: false }] }], _columns: [{
|
|
280
421
|
type: ContentChildren,
|
|
281
422
|
args: [TableColumnDirective]
|
|
282
423
|
}], _detailRow: [{
|
|
283
424
|
type: ContentChild,
|
|
284
425
|
args: [TableDetailRowDirective]
|
|
426
|
+
}], isLoading: [{
|
|
427
|
+
type: HostBinding,
|
|
428
|
+
args: ['class.ng0-loading']
|
|
285
429
|
}] } });
|
|
286
430
|
|
|
287
431
|
class TableModule {
|
|
288
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
289
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
432
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
433
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: TableModule, imports: [TableComponent,
|
|
290
434
|
TableColumnDirective,
|
|
291
435
|
TableDetailRowDirective], exports: [TableComponent,
|
|
292
436
|
TableColumnDirective,
|
|
293
437
|
TableDetailRowDirective] });
|
|
294
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
438
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableModule, imports: [TableComponent] });
|
|
295
439
|
}
|
|
296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableModule, decorators: [{
|
|
297
441
|
type: NgModule,
|
|
298
442
|
args: [{
|
|
299
443
|
imports: [
|