@bootkit/ng0 0.0.0-alpha.5 → 0.0.0-alpha.51
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 +288 -28
- package/components/accordion/index.d.ts +20 -10
- package/components/button/index.d.ts +7 -10
- package/components/card/index.d.ts +2 -6
- package/components/code/index.d.ts +2 -4
- package/components/collapse/index.d.ts +4 -41
- package/components/confirmation/index.d.ts +14 -16
- 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 +33 -11
- package/components/nav/index.d.ts +34 -32
- package/components/offcanvas/index.d.ts +13 -5
- package/components/pagination/index.d.ts +39 -13
- package/components/popover/index.d.ts +6 -6
- package/components/select/index.d.ts +160 -0
- package/components/sidenav/index.d.ts +122 -0
- package/components/stepper/index.d.ts +3 -4
- package/components/table/index.d.ts +205 -72
- package/components/toast/index.d.ts +14 -8
- package/components/tooltip/index.d.ts +36 -22
- package/components/vertical-menu/index.d.ts +79 -42
- package/data/index.d.ts +98 -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 +38 -33
- package/fesm2022/bootkit-ng0-components-accordion.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-button.mjs +21 -29
- package/fesm2022/bootkit-ng0-components-button.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-card.mjs +18 -26
- package/fesm2022/bootkit-ng0-components-card.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-code.mjs +16 -20
- package/fesm2022/bootkit-ng0-components-code.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-collapse.mjs +20 -132
- package/fesm2022/bootkit-ng0-components-collapse.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-confirmation.mjs +24 -34
- 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 +48 -29
- package/fesm2022/bootkit-ng0-components-modal.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-nav.mjs +60 -68
- 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 +61 -26
- 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 +296 -0
- package/fesm2022/bootkit-ng0-components-sidenav.mjs.map +1 -0
- package/fesm2022/bootkit-ng0-components-stepper.mjs +15 -42
- package/fesm2022/bootkit-ng0-components-stepper.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-table.mjs +323 -165
- package/fesm2022/bootkit-ng0-components-table.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-toast.mjs +62 -84
- package/fesm2022/bootkit-ng0-components-toast.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-tooltip.mjs +87 -74
- package/fesm2022/bootkit-ng0-components-tooltip.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs +171 -114
- package/fesm2022/bootkit-ng0-components-vertical-menu.mjs.map +1 -1
- 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 +575 -264
- package/fesm2022/bootkit-ng0-form.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-http.mjs +61 -34
- 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 +103 -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 +175 -40
- package/fesm2022/bootkit-ng0-security.mjs.map +1 -1
- package/fesm2022/bootkit-ng0-utils.mjs +122 -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 +153 -56
- package/http/index.d.ts +45 -14
- 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 +57 -17
- package/platform/browser/index.d.ts +88 -0
- package/routing/index.d.ts +124 -0
- package/security/index.d.ts +76 -11
- package/utils/index.d.ts +63 -0
|
@@ -1,65 +1,142 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, booleanAttribute, model, signal, TemplateRef, ContentChild, Directive, Input, inject, DestroyRef, numberAttribute, HostBinding, ContentChildren, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i2 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 i4 from '@bootkit/ng0/localization';
|
|
10
|
+
import { LocalizationService, LocalizationModule } from '@bootkit/ng0/localization';
|
|
11
|
+
import { dataSourceAttribute, DataRequest } from '@bootkit/ng0/data';
|
|
12
|
+
import { PaginationComponent } from '@bootkit/ng0/components/pagination';
|
|
13
|
+
import * as i3 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,225 @@ 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 {
|
|
116
|
-
|
|
167
|
+
_ls = inject(LocalizationService);
|
|
168
|
+
_destroyRef = inject(DestroyRef);
|
|
169
|
+
_changeSubscription;
|
|
170
|
+
_columns;
|
|
171
|
+
_detailRow;
|
|
172
|
+
_dataResult = signal(undefined, ...(ngDevMode ? [{ debugName: "_dataResult" }] : []));
|
|
173
|
+
_lastRequest; // The last data request made to the data source
|
|
174
|
+
_loadingRequest; // The current data request being processed
|
|
175
|
+
_rowStates = new Map();
|
|
176
|
+
_formatString = formatString;
|
|
177
|
+
_dataSource;
|
|
178
|
+
_pagingFormatter;
|
|
179
|
+
_lastError;
|
|
117
180
|
/**
|
|
118
181
|
* The data source for the table.
|
|
119
182
|
* This can be an array of data, a function that returns an observable of data,
|
|
120
183
|
* or an instance of DataSource.
|
|
121
184
|
*/
|
|
122
|
-
source = input.required();
|
|
185
|
+
source = input.required(...(ngDevMode ? [{ debugName: "source" }] : []));
|
|
123
186
|
/**
|
|
124
187
|
* If true, the table will automatically load data when initialized.
|
|
125
188
|
* This is useful for tables that need to display data immediately without user interaction.
|
|
126
189
|
*/
|
|
127
|
-
autoLoad = input(true);
|
|
190
|
+
autoLoad = input(true, ...(ngDevMode ? [{ debugName: "autoLoad", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
128
191
|
/**
|
|
129
192
|
* If true, the table will show row numbers.
|
|
130
193
|
* This will add a column to the left of the table with the row numbers.
|
|
131
194
|
*/
|
|
132
|
-
showRowNumbers = input(false);
|
|
195
|
+
showRowNumbers = input(false, ...(ngDevMode ? [{ debugName: "showRowNumbers", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
133
196
|
/**
|
|
134
197
|
* If true, the table will show the header row.
|
|
135
198
|
*/
|
|
136
|
-
showHeader = input(true);
|
|
199
|
+
showHeader = input(true, ...(ngDevMode ? [{ debugName: "showHeader", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
137
200
|
/**
|
|
138
201
|
* If true, the table will support pagination.
|
|
139
|
-
* If false, the table will load all records at once.
|
|
140
202
|
*/
|
|
141
|
-
|
|
203
|
+
pageable = input(false, ...(ngDevMode ? [{ debugName: "pageable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
204
|
+
/**
|
|
205
|
+
* The currently selected page in the table.
|
|
206
|
+
* @default 0
|
|
207
|
+
*/
|
|
208
|
+
pageIndex = model(0, ...(ngDevMode ? [{ debugName: "pageIndex" }] : []));
|
|
209
|
+
/**
|
|
210
|
+
* The number of records to display per page.
|
|
211
|
+
* @default 10
|
|
212
|
+
*/
|
|
213
|
+
pageSize = model(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
214
|
+
/**
|
|
215
|
+
* Maximum number of visible pages in the pagination controls.
|
|
216
|
+
* @default 10
|
|
217
|
+
*/
|
|
218
|
+
maxVisiblePages = input(10, ...(ngDevMode ? [{ debugName: "maxVisiblePages", transform: numberAttribute }] : [{ transform: numberAttribute }]));
|
|
219
|
+
/**
|
|
220
|
+
* If true, the table will show pagination controls at the bottom.
|
|
221
|
+
* This will allow users to navigate between pages of data.
|
|
222
|
+
* @default true
|
|
223
|
+
*/
|
|
224
|
+
showPagingControls = input(true, ...(ngDevMode ? [{ debugName: "showPagingControls", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
225
|
+
/**
|
|
226
|
+
* Whether to show the first and last buttons in the pagination controls.
|
|
227
|
+
* @default true
|
|
228
|
+
*/
|
|
229
|
+
showFirstLastButtons = input(false, ...(ngDevMode ? [{ debugName: "showFirstLastButtons", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
230
|
+
/**
|
|
231
|
+
* Whetheer to show the next and previous buttons in the pagination controls.
|
|
232
|
+
* @default true
|
|
233
|
+
*/
|
|
234
|
+
showNextPreviousButtons = input(false, ...(ngDevMode ? [{ debugName: "showNextPreviousButtons", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
142
235
|
/**
|
|
143
|
-
*
|
|
236
|
+
* Array of page size options to display in the page size selector.
|
|
237
|
+
* If not provided, the default page size options will be used.
|
|
238
|
+
* @default true
|
|
144
239
|
*/
|
|
145
|
-
|
|
240
|
+
pageSizeOptions = input([10, 25, 50, 100], ...(ngDevMode ? [{ debugName: "pageSizeOptions" }] : []));
|
|
146
241
|
/**
|
|
147
|
-
*
|
|
148
|
-
* This
|
|
242
|
+
* Whether to show paging info at the bottom of the table.
|
|
243
|
+
* This will show the number of records displayed and total records.
|
|
244
|
+
* @default true
|
|
149
245
|
*/
|
|
150
|
-
|
|
246
|
+
showPagingInfo = input(true, ...(ngDevMode ? [{ debugName: "showPagingInfo", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
151
247
|
/**
|
|
152
|
-
*
|
|
153
|
-
* This
|
|
154
|
-
* The first page is 0.
|
|
248
|
+
* If true, the table will support sorting.
|
|
249
|
+
* This will add a sort icon to each column header.
|
|
155
250
|
*/
|
|
156
|
-
|
|
251
|
+
sortable = input(true, ...(ngDevMode ? [{ debugName: "sortable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
157
252
|
/**
|
|
158
|
-
* The CSS class to apply to the table element.
|
|
253
|
+
* The CSS class to apply to the internal table element.
|
|
159
254
|
* This can be used to apply custom styles to the table.
|
|
160
255
|
*/
|
|
161
|
-
tableClass = input();
|
|
256
|
+
tableClass = input(...(ngDevMode ? [undefined, { debugName: "tableClass" }] : []));
|
|
162
257
|
/**
|
|
163
258
|
* The CSS class to apply to the header element.
|
|
164
259
|
*/
|
|
165
|
-
headerClass = input();
|
|
260
|
+
headerClass = input(...(ngDevMode ? [undefined, { debugName: "headerClass" }] : []));
|
|
166
261
|
/**
|
|
167
262
|
* The caption of the table.
|
|
168
263
|
*/
|
|
169
|
-
caption = input();
|
|
170
|
-
|
|
264
|
+
caption = input(...(ngDevMode ? [undefined, { debugName: "caption" }] : []));
|
|
265
|
+
/**
|
|
266
|
+
* The height of the table in pixels.
|
|
267
|
+
* This can be used to set a fixed height for the table.
|
|
268
|
+
*/
|
|
269
|
+
height = input(...(ngDevMode ? [undefined, { debugName: "height" }] : []));
|
|
171
270
|
/**
|
|
172
271
|
* If true, the table will support filtering.
|
|
173
272
|
* This will add a filter input to each column header.
|
|
174
273
|
*/
|
|
175
|
-
filterable = input(false);
|
|
274
|
+
filterable = input(false, ...(ngDevMode ? [{ debugName: "filterable", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
275
|
+
/**
|
|
276
|
+
* The indicator to show while the table is loading data for the first time.
|
|
277
|
+
*/
|
|
278
|
+
loadingIndicator = input('spinner', ...(ngDevMode ? [{ debugName: "loadingIndicator", transform: v => {
|
|
279
|
+
if (typeof v === 'boolean') {
|
|
280
|
+
return v ? 'spinner' : 'none';
|
|
281
|
+
}
|
|
282
|
+
return v;
|
|
283
|
+
} }] : [{
|
|
284
|
+
transform: v => {
|
|
285
|
+
if (typeof v === 'boolean') {
|
|
286
|
+
return v ? 'spinner' : 'none';
|
|
287
|
+
}
|
|
288
|
+
return v;
|
|
289
|
+
}
|
|
290
|
+
}]));
|
|
291
|
+
/** If true, the table will show a loading cover while data is being loaded.
|
|
292
|
+
* This can be used to prevent user interaction with the table while loading.
|
|
293
|
+
* This cover is not displayed when the table is loading for the first time.
|
|
294
|
+
* Instead, the table will show a loading based on loadingIndicator settings.
|
|
295
|
+
*/
|
|
296
|
+
loadingCover = input('spinner', ...(ngDevMode ? [{ debugName: "loadingCover", transform: v => {
|
|
297
|
+
if (typeof v === 'boolean') {
|
|
298
|
+
return v ? 'spinner' : 'none';
|
|
299
|
+
}
|
|
300
|
+
return v;
|
|
301
|
+
} }] : [{
|
|
302
|
+
transform: v => {
|
|
303
|
+
if (typeof v === 'boolean') {
|
|
304
|
+
return v ? 'spinner' : 'none';
|
|
305
|
+
}
|
|
306
|
+
return v;
|
|
307
|
+
}
|
|
308
|
+
}]));
|
|
176
309
|
// @Input() rowColor?: (row: any) => BootstrapColor;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
_rowStates = new Map();
|
|
183
|
-
_formatString = formatString;
|
|
184
|
-
_changeSubscription;
|
|
185
|
-
_dataSource;
|
|
186
|
-
constructor(_destroyRef) {
|
|
187
|
-
this._destroyRef = _destroyRef;
|
|
188
|
-
}
|
|
189
|
-
ngOnInit() {
|
|
190
|
-
if (Array.isArray(this.source())) {
|
|
191
|
-
this._dataSource = new ArrayDataSource(this.source());
|
|
192
|
-
}
|
|
193
|
-
else if (typeof this.source() == 'function') {
|
|
194
|
-
this._dataSource = new AsyncDataSource(this.source());
|
|
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
|
-
}
|
|
310
|
+
ngAfterContentInit() {
|
|
311
|
+
this._dataSource = dataSourceAttribute(this.source());
|
|
312
|
+
const locale = this._ls.get();
|
|
313
|
+
this._pagingFormatter = locale?.definition.components?.table?.pagingInfo ??
|
|
314
|
+
((o) => `Showing ${o.firstRecord}-${o.lastRecord} of ${o.totalRecords} records`);
|
|
205
315
|
// this._changeSubscription = this.dataSource().change.pipe(takeUntilDestroyed(this._destroyRef)).subscribe(result => {
|
|
206
316
|
// this.reload();
|
|
207
317
|
// });
|
|
208
|
-
}
|
|
209
|
-
ngAfterContentInit() {
|
|
210
318
|
if (this.autoLoad()) {
|
|
211
|
-
this.
|
|
319
|
+
this.load();
|
|
212
320
|
}
|
|
213
321
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
322
|
+
/**
|
|
323
|
+
* Loads data from the data source based on the current state of the table (pagination, sorting, filtering).
|
|
324
|
+
* This method can be called manually to refresh the data in the table.
|
|
325
|
+
* It will construct a DataRequest object based on the current pagination, sorting, and filtering settings,
|
|
326
|
+
* and then call the load method of the data source with that request.
|
|
327
|
+
*/
|
|
328
|
+
load(pageIndex) {
|
|
329
|
+
let page;
|
|
330
|
+
let filters = [];
|
|
331
|
+
let sort;
|
|
332
|
+
if (this.filterable()) {
|
|
333
|
+
this._columns.forEach(col => {
|
|
334
|
+
if (col.filterable() && col.filterValue() != '' && col.filterValue() != undefined) {
|
|
335
|
+
filters.push({ field: col.fieldName() ?? col.filterField() ?? col.field(), value: col.filterValue(), operator: col.filterOperator() });
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if (this.pageable()) {
|
|
340
|
+
if (pageIndex != undefined) {
|
|
341
|
+
this.pageIndex.set(pageIndex);
|
|
342
|
+
}
|
|
343
|
+
page = {
|
|
344
|
+
index: this.pageIndex(),
|
|
345
|
+
size: this.pageSize(),
|
|
346
|
+
};
|
|
223
347
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
348
|
+
if (this.sortable()) {
|
|
349
|
+
let col = this._columns.find(c => c.sortable() && c.sortDirection() != 'none' && (c.field() != '' || c.fieldName() != ''));
|
|
350
|
+
if (col) {
|
|
351
|
+
sort = {
|
|
352
|
+
field: col.fieldName() ?? col.field(),
|
|
353
|
+
asc: col.sortDirection() === 'asc'
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
this._loadingRequest = new DataRequest({ page, filters, sort, select: [], computeTotal: true });
|
|
358
|
+
this._dataSource.load(this._loadingRequest)
|
|
359
|
+
.pipe(takeUntilDestroyed(this._destroyRef)).subscribe({
|
|
360
|
+
next: result => {
|
|
361
|
+
this._dataResult.set(result);
|
|
362
|
+
this._lastRequest = this._loadingRequest;
|
|
363
|
+
this._loadingRequest = undefined;
|
|
364
|
+
this._lastError = undefined;
|
|
365
|
+
}, error: err => {
|
|
366
|
+
this._lastError = err;
|
|
367
|
+
this._lastRequest = this._loadingRequest;
|
|
368
|
+
this._loadingRequest = undefined;
|
|
369
|
+
}
|
|
229
370
|
});
|
|
230
371
|
}
|
|
231
|
-
|
|
232
|
-
|
|
372
|
+
/**
|
|
373
|
+
* Determines if the table is currently loading data.
|
|
374
|
+
*/
|
|
375
|
+
get isLoading() {
|
|
376
|
+
return this._dataSource.isLoading;
|
|
233
377
|
}
|
|
234
378
|
_getCellValue(row, col) {
|
|
235
|
-
var subFields = col.field.split('.');
|
|
379
|
+
var subFields = col.field().split('.');
|
|
236
380
|
let value = row[subFields[0]];
|
|
237
381
|
for (let i = 1; i < subFields.length; i++) {
|
|
238
382
|
if (value == null)
|
|
@@ -241,15 +385,10 @@ class TableComponent {
|
|
|
241
385
|
}
|
|
242
386
|
return value;
|
|
243
387
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
this.reload();
|
|
247
|
-
}
|
|
248
|
-
onPreviousPageClick() {
|
|
249
|
-
// --this.pageIndex
|
|
250
|
-
this.reload();
|
|
388
|
+
_onPageChange(pageIndex) {
|
|
389
|
+
this.load(pageIndex);
|
|
251
390
|
}
|
|
252
|
-
|
|
391
|
+
_onToggleRowDetailClick(row) {
|
|
253
392
|
var state = this._rowStates.get(row);
|
|
254
393
|
if (!state) {
|
|
255
394
|
this._rowStates.set(row, { expanded: true });
|
|
@@ -262,38 +401,57 @@ class TableComponent {
|
|
|
262
401
|
var state = this._rowStates.get(row);
|
|
263
402
|
return state == undefined ? false : state.expanded;
|
|
264
403
|
}
|
|
404
|
+
_onToggleFilterOperator(col) {
|
|
405
|
+
if (col.showFilterOperators()) {
|
|
406
|
+
col.showFilterOperators.set(false);
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
this._columns.forEach(x => x.showFilterOperators.set(false));
|
|
410
|
+
col.showFilterOperators.set(true);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
_onSelectFilterOperator(col, filterOperator) {
|
|
414
|
+
col.filterOperator.set(filterOperator);
|
|
415
|
+
this._columns.forEach(x => x.showFilterOperators.set(false));
|
|
416
|
+
this.load(0);
|
|
417
|
+
}
|
|
265
418
|
ngOnDestroy() {
|
|
266
419
|
this._changeSubscription?.unsubscribe();
|
|
267
420
|
}
|
|
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" }] });
|
|
421
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
422
|
+
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 }, pageIndex: { classPropertyName: "pageIndex", publicName: "pageIndex", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, maxVisiblePages: { classPropertyName: "maxVisiblePages", publicName: "maxVisiblePages", isSignal: true, isRequired: false, transformFunction: null }, showPagingControls: { classPropertyName: "showPagingControls", publicName: "showPagingControls", isSignal: true, isRequired: false, transformFunction: null }, showFirstLastButtons: { classPropertyName: "showFirstLastButtons", publicName: "showFirstLastButtons", isSignal: true, isRequired: false, transformFunction: null }, showNextPreviousButtons: { classPropertyName: "showNextPreviousButtons", publicName: "showNextPreviousButtons", isSignal: true, isRequired: false, transformFunction: null }, pageSizeOptions: { classPropertyName: "pageSizeOptions", publicName: "pageSizeOptions", isSignal: true, isRequired: false, transformFunction: null }, showPagingInfo: { classPropertyName: "showPagingInfo", publicName: "showPagingInfo", 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 } }, outputs: { pageIndex: "pageIndexChange", pageSize: "pageSizeChange" }, 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 = pageIndex();\n@let $pageSize = pageSize();\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecordIndex = $pageable ? ($pageSize * $pageIndex) : 0;\n@let $lastRecordIndex = $data ? $firstRecordIndex + $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 {{ $firstRecordIndex + $index + 1}}\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 && showPagingControls() && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [showNextPreviousButtons]=\"showNextPreviousButtons()\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"pageSize()\"\n [selectedPage]=\"pageIndex()\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"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 (pageSizeOptions()) {\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 (showPagingInfo()) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecordIndex, lastRecord: $lastRecordIndex, 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;height:100%}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: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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.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: "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: i3.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: i3.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i4.TranslatePipe, name: "ng0Translate" }, { kind: "pipe", type: i4.TranslateEnumPipe, name: "ng0TranslateEnum" }, { kind: "pipe", type: i4.DatePipe, name: "ng0Date" }, { kind: "pipe", type: i4.LocalizeBooleanPipe, name: "ng0LocalizeBool" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
270
423
|
}
|
|
271
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
424
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableComponent, decorators: [{
|
|
272
425
|
type: Component,
|
|
273
|
-
args: [{ selector: 'ng0-table', exportAs: 'ng0Table', standalone: true, imports: [
|
|
426
|
+
args: [{ selector: 'ng0-table', exportAs: 'ng0Table', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
274
427
|
CommonModule,
|
|
275
428
|
FormsModule,
|
|
276
429
|
LocalizationModule,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
430
|
+
PaginationComponent,
|
|
431
|
+
NumberDirective,
|
|
432
|
+
OverlayModule
|
|
433
|
+
], template: "@let $dataResult = _dataResult();\n@let $pageable = pageable();\n@let $pageIndex = pageIndex();\n@let $pageSize = pageSize();\n@let $data = $dataResult?.data;\n@let $anyRecords = $data && $data.length > 0;\n@let $totalRecordsCount = $dataResult?.total;\n@let $firstRecordIndex = $pageable ? ($pageSize * $pageIndex) : 0;\n@let $lastRecordIndex = $data ? $firstRecordIndex + $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 {{ $firstRecordIndex + $index + 1}}\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 && showPagingControls() && $anyRecords && $totalRecordsCount! > 0) {\n <div class=\"ng0-table-pagination me-2\">\n <ng0-pagination\n class=\"mb-0 d-inline-block\"\n [showFirstLastButtons]=\"showFirstLastButtons()\"\n [showNextPreviousButtons]=\"showNextPreviousButtons()\"\n [totalRecords]=\"$totalRecordsCount!\"\n [pageSize]=\"pageSize()\"\n [selectedPage]=\"pageIndex()\"\n (itemClick)=\"_onPageChange($event)\"\n [maxVisiblePages]=\"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 (pageSizeOptions()) {\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 (showPagingInfo()) {\n <div class=\"ng0-table-paging-info ms-auto\">\n <ng-content select=\"paging-info\">\n {{\n _pagingFormatter({firstRecord: $firstRecordIndex, lastRecord: $lastRecordIndex, 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;height:100%}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"] }]
|
|
434
|
+
}], propDecorators: { _columns: [{
|
|
280
435
|
type: ContentChildren,
|
|
281
436
|
args: [TableColumnDirective]
|
|
282
437
|
}], _detailRow: [{
|
|
283
438
|
type: ContentChild,
|
|
284
439
|
args: [TableDetailRowDirective]
|
|
440
|
+
}], 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 }] }], pageIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageIndex", required: false }] }, { type: i0.Output, args: ["pageIndexChange"] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }, { type: i0.Output, args: ["pageSizeChange"] }], maxVisiblePages: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisiblePages", required: false }] }], showPagingControls: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPagingControls", required: false }] }], showFirstLastButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showFirstLastButtons", required: false }] }], showNextPreviousButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showNextPreviousButtons", required: false }] }], pageSizeOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSizeOptions", required: false }] }], showPagingInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPagingInfo", 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 }] }], isLoading: [{
|
|
441
|
+
type: HostBinding,
|
|
442
|
+
args: ['class.ng0-loading']
|
|
285
443
|
}] } });
|
|
286
444
|
|
|
287
445
|
class TableModule {
|
|
288
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
289
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
446
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
447
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: TableModule, imports: [TableComponent,
|
|
290
448
|
TableColumnDirective,
|
|
291
449
|
TableDetailRowDirective], exports: [TableComponent,
|
|
292
450
|
TableColumnDirective,
|
|
293
451
|
TableDetailRowDirective] });
|
|
294
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
452
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableModule, imports: [TableComponent] });
|
|
295
453
|
}
|
|
296
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
454
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: TableModule, decorators: [{
|
|
297
455
|
type: NgModule,
|
|
298
456
|
args: [{
|
|
299
457
|
imports: [
|