mat-table-ext 0.0.7 → 0.0.9
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/.editorconfig +16 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +20 -0
- package/.vscode/tasks.json +42 -0
- package/LICENSE +21 -0
- package/angular.json +150 -0
- package/package.json +46 -58
- package/projects/mat-table-ext/.browserslistrc +16 -0
- package/projects/mat-table-ext/README.md +57 -0
- package/projects/mat-table-ext/karma.conf.js +44 -0
- package/projects/mat-table-ext/ng-package.json +9 -0
- package/projects/mat-table-ext/package.json +38 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.html +7 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.scss +9 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.spec.ts +23 -0
- package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.ts +48 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.html +55 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.scss +19 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.spec.ts +23 -0
- package/projects/mat-table-ext/src/lib/components/editing/editing.component.ts +110 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.html +26 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.scss +0 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.spec.ts +23 -0
- package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.ts +54 -0
- package/projects/mat-table-ext/src/lib/directives/resize-column.directive.ts +103 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.component.html +285 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.component.spec.ts +25 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.component.ts +985 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.module.ts +127 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.scss +181 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.service.spec.ts +16 -0
- package/projects/mat-table-ext/src/lib/mat-table-ext.service.ts +12 -0
- package/projects/mat-table-ext/src/lib/models/tableExtModels.ts +85 -0
- package/{public-api.d.ts → projects/mat-table-ext/src/public-api.ts} +5 -1
- package/projects/mat-table-ext/src/test.ts +27 -0
- package/projects/mat-table-ext/tsconfig.lib.json +15 -0
- package/projects/mat-table-ext/tsconfig.lib.prod.json +10 -0
- package/projects/mat-table-ext/tsconfig.spec.json +17 -0
- package/projects/mat-table-ext-example/.browserslistrc +16 -0
- package/projects/mat-table-ext-example/karma.conf.js +44 -0
- package/projects/mat-table-ext-example/src/app/app.component.html +576 -0
- package/projects/mat-table-ext-example/src/app/app.component.scss +0 -0
- package/projects/mat-table-ext-example/src/app/app.component.spec.ts +31 -0
- package/projects/mat-table-ext-example/src/app/app.component.ts +173 -0
- package/projects/mat-table-ext-example/src/app/app.module.ts +40 -0
- package/projects/mat-table-ext-example/src/app/service/custom-table.service.spec.ts +16 -0
- package/projects/mat-table-ext-example/src/app/service/custom-table.service.ts +18 -0
- package/projects/mat-table-ext-example/src/assets/.gitkeep +0 -0
- package/projects/mat-table-ext-example/src/assets/data.json +100003 -0
- package/projects/mat-table-ext-example/src/environments/environment.prod.ts +3 -0
- package/projects/mat-table-ext-example/src/environments/environment.ts +16 -0
- package/projects/mat-table-ext-example/src/favicon.ico +0 -0
- package/projects/mat-table-ext-example/src/index.html +14 -0
- package/projects/mat-table-ext-example/src/main.ts +12 -0
- package/projects/mat-table-ext-example/src/polyfills.ts +53 -0
- package/projects/mat-table-ext-example/src/styles.scss +23 -0
- package/projects/mat-table-ext-example/src/test.ts +26 -0
- package/projects/mat-table-ext-example/tsconfig.app.json +15 -0
- package/projects/mat-table-ext-example/tsconfig.spec.json +18 -0
- package/tsconfig.json +38 -0
- package/esm2020/lib/components/column-pinning/column-pinning.component.mjs +0 -58
- package/esm2020/lib/components/editing/editing.component.mjs +0 -122
- package/esm2020/lib/components/filter-columns-component/filter-columns-component.component.mjs +0 -68
- package/esm2020/lib/directives/resize-column.directive.mjs +0 -99
- package/esm2020/lib/mat-table-ext.component.mjs +0 -1021
- package/esm2020/lib/mat-table-ext.module.mjs +0 -237
- package/esm2020/lib/mat-table-ext.service.mjs +0 -20
- package/esm2020/lib/models/tableExtModels.mjs +0 -2
- package/esm2020/mat-table-ext.mjs +0 -5
- package/esm2020/public-api.mjs +0 -11
- package/fesm2015/mat-table-ext.mjs +0 -1585
- package/fesm2015/mat-table-ext.mjs.map +0 -1
- package/fesm2020/mat-table-ext.mjs +0 -1582
- package/fesm2020/mat-table-ext.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/column-pinning/column-pinning.component.d.ts +0 -27
- package/lib/components/editing/editing.component.d.ts +0 -42
- package/lib/components/filter-columns-component/filter-columns-component.component.d.ts +0 -26
- package/lib/directives/resize-column.directive.d.ts +0 -27
- package/lib/mat-table-ext.component.d.ts +0 -348
- package/lib/mat-table-ext.module.d.ts +0 -58
- package/lib/mat-table-ext.service.d.ts +0 -11
- package/lib/models/tableExtModels.d.ts +0 -76
- /package/{assets → projects/mat-table-ext/assets}/_theming.scss +0 -0
- /package/{assets → projects/mat-table-ext/assets}/pinIcon.svg +0 -0
- /package/{assets → projects/mat-table-ext/assets}/pinLeft.svg +0 -0
- /package/{assets → projects/mat-table-ext/assets}/pinNone.svg +0 -0
- /package/{assets → projects/mat-table-ext/assets}/pinRight.svg +0 -0
- /package/{assets → projects/mat-table-ext/assets}/pinned.svg +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { HttpClientModule } from '@angular/common/http';
|
|
3
|
+
import { MatTableModule } from '@angular/material/table'
|
|
4
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import { MatNativeDateModule } from '@angular/material/core';
|
|
6
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
|
+
import { MatTableExtComponent } from '../lib/mat-table-ext.component';
|
|
8
|
+
import { ResizeColumnDirective } from '../lib/directives/resize-column.directive';
|
|
9
|
+
import { ColumnPinningComponent } from '../lib/components/column-pinning/column-pinning.component';
|
|
10
|
+
import { EditingComponent } from '../lib/components/editing/editing.component';
|
|
11
|
+
import { FilterColumnsComponentComponent } from '../lib/components/filter-columns-component/filter-columns-component.component';
|
|
12
|
+
import { CommonModule } from '@angular/common';
|
|
13
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
14
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
15
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
16
|
+
import { CdkAccordionModule } from '@angular/cdk/accordion';
|
|
17
|
+
import { ClipboardModule } from '@angular/cdk/clipboard';
|
|
18
|
+
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
19
|
+
import { PortalModule } from '@angular/cdk/portal';
|
|
20
|
+
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
21
|
+
import { CdkStepperModule } from '@angular/cdk/stepper';
|
|
22
|
+
import { CdkTableModule } from '@angular/cdk/table';
|
|
23
|
+
import { CdkTreeModule } from '@angular/cdk/tree';
|
|
24
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
25
|
+
import { MatBadgeModule } from '@angular/material/badge';
|
|
26
|
+
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
|
|
27
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
28
|
+
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
29
|
+
import { MatCardModule } from '@angular/material/card';
|
|
30
|
+
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
31
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
32
|
+
import { MatStepperModule } from '@angular/material/stepper';
|
|
33
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
34
|
+
import { MatDialogModule } from '@angular/material/dialog';
|
|
35
|
+
import { MatDividerModule } from '@angular/material/divider';
|
|
36
|
+
import { MatExpansionModule } from '@angular/material/expansion';
|
|
37
|
+
import { MatGridListModule } from '@angular/material/grid-list';
|
|
38
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
39
|
+
import { MatInputModule } from '@angular/material/input';
|
|
40
|
+
import { MatListModule } from '@angular/material/list';
|
|
41
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
42
|
+
import { MatRippleModule } from '@angular/material/core';
|
|
43
|
+
import { MatPaginatorModule } from '@angular/material/paginator';
|
|
44
|
+
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
45
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
46
|
+
import { MatRadioModule } from '@angular/material/radio';
|
|
47
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
48
|
+
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
49
|
+
import { MatSliderModule } from '@angular/material/slider';
|
|
50
|
+
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
51
|
+
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
52
|
+
import { MatSortModule } from '@angular/material/sort';
|
|
53
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
54
|
+
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
55
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
56
|
+
import { MatTreeModule } from '@angular/material/tree';
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
@NgModule({
|
|
60
|
+
declarations: [
|
|
61
|
+
MatTableExtComponent,
|
|
62
|
+
ResizeColumnDirective,
|
|
63
|
+
ColumnPinningComponent,
|
|
64
|
+
EditingComponent,
|
|
65
|
+
FilterColumnsComponentComponent,
|
|
66
|
+
],
|
|
67
|
+
imports: [
|
|
68
|
+
CommonModule,
|
|
69
|
+
TranslateModule.forChild(),
|
|
70
|
+
MatTableModule,
|
|
71
|
+
FormsModule,
|
|
72
|
+
ReactiveFormsModule,
|
|
73
|
+
MatNativeDateModule,
|
|
74
|
+
A11yModule,
|
|
75
|
+
CdkAccordionModule,
|
|
76
|
+
ClipboardModule,
|
|
77
|
+
CdkStepperModule,
|
|
78
|
+
CdkTableModule,
|
|
79
|
+
CdkTreeModule,
|
|
80
|
+
DragDropModule,
|
|
81
|
+
MatAutocompleteModule,
|
|
82
|
+
MatBadgeModule,
|
|
83
|
+
MatBottomSheetModule,
|
|
84
|
+
MatButtonModule,
|
|
85
|
+
MatButtonToggleModule,
|
|
86
|
+
MatCardModule,
|
|
87
|
+
MatCheckboxModule,
|
|
88
|
+
MatChipsModule,
|
|
89
|
+
MatStepperModule,
|
|
90
|
+
MatDatepickerModule,
|
|
91
|
+
MatDialogModule,
|
|
92
|
+
MatDividerModule,
|
|
93
|
+
MatExpansionModule,
|
|
94
|
+
MatGridListModule,
|
|
95
|
+
MatIconModule,
|
|
96
|
+
MatInputModule,
|
|
97
|
+
MatListModule,
|
|
98
|
+
MatMenuModule,
|
|
99
|
+
MatNativeDateModule,
|
|
100
|
+
MatPaginatorModule,
|
|
101
|
+
MatProgressBarModule,
|
|
102
|
+
MatProgressSpinnerModule,
|
|
103
|
+
MatRadioModule,
|
|
104
|
+
MatRippleModule,
|
|
105
|
+
MatSelectModule,
|
|
106
|
+
MatSidenavModule,
|
|
107
|
+
MatSliderModule,
|
|
108
|
+
MatSlideToggleModule,
|
|
109
|
+
MatSnackBarModule,
|
|
110
|
+
MatSortModule,
|
|
111
|
+
MatTabsModule,
|
|
112
|
+
MatToolbarModule,
|
|
113
|
+
MatTooltipModule,
|
|
114
|
+
MatTreeModule,
|
|
115
|
+
PortalModule,
|
|
116
|
+
ScrollingModule,
|
|
117
|
+
MatFormFieldModule
|
|
118
|
+
],
|
|
119
|
+
exports: [
|
|
120
|
+
MatTableExtComponent,
|
|
121
|
+
ResizeColumnDirective,
|
|
122
|
+
ColumnPinningComponent,
|
|
123
|
+
EditingComponent,
|
|
124
|
+
FilterColumnsComponentComponent,
|
|
125
|
+
],
|
|
126
|
+
})
|
|
127
|
+
export class MatTableExtModule { }
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
table {
|
|
2
|
+
min-width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.mat-table-sticky-border-elem-right {
|
|
6
|
+
border-left: 1px solid #e0e0e0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.mat-table-sticky-border-elem-left {
|
|
10
|
+
border-right: 1px solid #e0e0e0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
tr.example-detail-row {
|
|
14
|
+
display: table-row !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.example-element-detail {
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
display: flex;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.hidden {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.stripedRows {
|
|
27
|
+
background: #eaeaea !important;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.hoverClass:hover {
|
|
31
|
+
background: #dbdbdb !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.filters-container {
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
max-height: 0px;
|
|
37
|
+
transition: max-height 0.5s ease-in-out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.animate {
|
|
41
|
+
max-height: 50px !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.resize-handle {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
border-right: 2px solid rgb(140, 140, 140);
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 0;
|
|
49
|
+
right: 0;
|
|
50
|
+
height: 100%;
|
|
51
|
+
cursor: col-resize;
|
|
52
|
+
opacity: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.resize-handle:hover {
|
|
56
|
+
width: 20px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
table th:hover .resize-handle {
|
|
60
|
+
opacity: 1;
|
|
61
|
+
transition: 0.3s ease-in-out;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.mat-table.resizing {
|
|
65
|
+
-moz-user-select: none;
|
|
66
|
+
-ms-user-select: none;
|
|
67
|
+
user-select: none;
|
|
68
|
+
cursor: col-resize;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mat-table .mat-header-cell {
|
|
72
|
+
position: relative;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.mat-table .mat-header-cell:not(:last-child) .resize-holder {
|
|
76
|
+
cursor: col-resize;
|
|
77
|
+
width: 20px;
|
|
78
|
+
height: 100%;
|
|
79
|
+
position: absolute;
|
|
80
|
+
right: -10px;
|
|
81
|
+
top: 0;
|
|
82
|
+
z-index: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.toolbar-container {
|
|
86
|
+
display: flex;
|
|
87
|
+
padding: 0 15px;
|
|
88
|
+
gap: 1rem;
|
|
89
|
+
grid-auto-rows: 10px;
|
|
90
|
+
justify-content: flex-end;
|
|
91
|
+
align-items: center;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.mat-table-ext-container {
|
|
95
|
+
width: 100%;
|
|
96
|
+
max-width: 100%;
|
|
97
|
+
overflow: auto;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.column-headers {
|
|
101
|
+
font-family: Roboto, "Helvetica Neue", sans-serif;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.example-spacer {
|
|
105
|
+
flex: 1 1 auto;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.export-button .mat-button-wrapper {
|
|
109
|
+
display: flex !important;
|
|
110
|
+
width: 8em;
|
|
111
|
+
justify-content: space-around;
|
|
112
|
+
align-items: center;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.toolbar-menu-container {
|
|
116
|
+
display: flex;
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
margin: auto 0.8em;
|
|
119
|
+
width: 15em;
|
|
120
|
+
height: 20em;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.toolbar-menu-item {
|
|
124
|
+
display: flex;
|
|
125
|
+
height: 3em;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.toolbar-menu-checkbox {
|
|
129
|
+
margin-left: 8%;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.toolbar-menu-checkbox.mat-checkbox {
|
|
133
|
+
width: max-content;
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.hide-button .mat-button-wrapper,
|
|
139
|
+
.pin-button .mat-button-wrapper {
|
|
140
|
+
display: flex !important;
|
|
141
|
+
width: 5em;
|
|
142
|
+
justify-content: space-around;
|
|
143
|
+
align-items: center;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.hide-button,
|
|
147
|
+
.pin-button,
|
|
148
|
+
.export-button {
|
|
149
|
+
height: 3em;
|
|
150
|
+
border: 2px solid currentColor !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.showHide-menu-columns-list {
|
|
154
|
+
height: 10em;
|
|
155
|
+
max-height: 10em;
|
|
156
|
+
overflow-y: auto;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.mat-column-select {
|
|
160
|
+
width: 50px !important;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.data-row td {
|
|
164
|
+
border-bottom-width: 0 !important;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.example-expanded-row td {
|
|
168
|
+
border-bottom-width: 0 !important;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.action-column-cells {
|
|
172
|
+
width: 40px;
|
|
173
|
+
height: inherit;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.inline-editing-controls {
|
|
177
|
+
display: flex;
|
|
178
|
+
}
|
|
179
|
+
.global-search-field{
|
|
180
|
+
width: -webkit-fill-available;
|
|
181
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { MatTableExtService } from './mat-table-ext.service';
|
|
4
|
+
|
|
5
|
+
describe('MatTableExtService', () => {
|
|
6
|
+
let service: MatTableExtService;
|
|
7
|
+
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
TestBed.configureTestingModule({});
|
|
10
|
+
service = TestBed.inject(MatTableExtService);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('should be created', () => {
|
|
14
|
+
expect(service).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
|
|
5
|
+
@Injectable({
|
|
6
|
+
providedIn: 'root'
|
|
7
|
+
})
|
|
8
|
+
export class MatTableExtService {
|
|
9
|
+
public selectedRow = new BehaviorSubject<any>(null);
|
|
10
|
+
public selectedRowIndex = new BehaviorSubject<any>(null);
|
|
11
|
+
constructor(public http: HttpClient) { }
|
|
12
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
/** Column definition of mat-table-ext. */
|
|
4
|
+
export interface MTExColumn {
|
|
5
|
+
field: string;
|
|
6
|
+
options?: string[];
|
|
7
|
+
header?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
footerText?: string;
|
|
10
|
+
headerTooltip?: TooltipProp;
|
|
11
|
+
cellTooltip?: TooltipProp;
|
|
12
|
+
pinned?: 'left' | 'right';
|
|
13
|
+
width?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
minWidth?: string;
|
|
16
|
+
maxWidth?: string;
|
|
17
|
+
hide?: boolean;
|
|
18
|
+
type: MTExColumnType;
|
|
19
|
+
cellTemplate?: TemplateRef<any> | null;
|
|
20
|
+
headerTemplate?: TemplateRef<any> | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface DisplayColumn {
|
|
24
|
+
filter: boolean;
|
|
25
|
+
name: string;
|
|
26
|
+
show: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface RowChange {
|
|
29
|
+
row: { [key: string]: any };
|
|
30
|
+
index: number;
|
|
31
|
+
}
|
|
32
|
+
export interface RowSelectionChange {
|
|
33
|
+
row: { [key: string]: any };
|
|
34
|
+
index: number;
|
|
35
|
+
isSelected: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface ExpansionChange {
|
|
38
|
+
data: { [key: string]: any };
|
|
39
|
+
index: number;
|
|
40
|
+
expanded: boolean;
|
|
41
|
+
}
|
|
42
|
+
export interface CellTemplateRefMap {
|
|
43
|
+
[key: string]: TemplateRef<any>;
|
|
44
|
+
}
|
|
45
|
+
/** Possible column type values. */
|
|
46
|
+
export declare type MTExColumnType =
|
|
47
|
+
| 'selection'
|
|
48
|
+
| string
|
|
49
|
+
| boolean
|
|
50
|
+
| number
|
|
51
|
+
| 'date';
|
|
52
|
+
export interface TooltipProp {
|
|
53
|
+
value: string;
|
|
54
|
+
tooltipPosition?: TooltipPosition;
|
|
55
|
+
}
|
|
56
|
+
export declare type TooltipPosition =
|
|
57
|
+
| 'left'
|
|
58
|
+
| 'right'
|
|
59
|
+
| 'above'
|
|
60
|
+
| 'below'
|
|
61
|
+
| 'before'
|
|
62
|
+
| 'after';
|
|
63
|
+
|
|
64
|
+
/** Cell template. */
|
|
65
|
+
export interface MTExCellTemplate {
|
|
66
|
+
[key: string]: TemplateRef<any>;
|
|
67
|
+
}
|
|
68
|
+
export interface FilterSearchValue {
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
}
|
|
71
|
+
export interface MTExRow {
|
|
72
|
+
[key: string]: any;
|
|
73
|
+
}
|
|
74
|
+
export interface ColumnVisibility {
|
|
75
|
+
[key: string]: any;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface MTExColumnPinOption {
|
|
79
|
+
label: string | Observable<string>;
|
|
80
|
+
value: MTExColumnPinValue;
|
|
81
|
+
selected: boolean;
|
|
82
|
+
field: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export declare type MTExColumnPinValue = 'left' | 'right' | null;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of mat-table-ext
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
export * from './lib/mat-table-ext.module';
|
|
2
6
|
export * from './lib/mat-table-ext.service';
|
|
3
7
|
export * from './lib/mat-table-ext.component';
|
|
4
8
|
export * from './lib/components/column-pinning/column-pinning.component';
|
|
5
9
|
export * from './lib/components/editing/editing.component';
|
|
6
10
|
export * from './lib/components/filter-columns-component/filter-columns-component.component';
|
|
7
|
-
export * from './lib/directives/resize-column.directive';
|
|
11
|
+
export * from './lib/directives/resize-column.directive';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
+
|
|
3
|
+
import 'zone.js';
|
|
4
|
+
import 'zone.js/testing';
|
|
5
|
+
import { getTestBed } from '@angular/core/testing';
|
|
6
|
+
import {
|
|
7
|
+
BrowserDynamicTestingModule,
|
|
8
|
+
platformBrowserDynamicTesting
|
|
9
|
+
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
+
|
|
11
|
+
declare const require: {
|
|
12
|
+
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
+
<T>(id: string): T;
|
|
14
|
+
keys(): string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// First, initialize the Angular testing environment.
|
|
19
|
+
getTestBed().initTestEnvironment(
|
|
20
|
+
BrowserDynamicTestingModule,
|
|
21
|
+
platformBrowserDynamicTesting(),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// Then we find all the tests.
|
|
25
|
+
const context = require.context('./', true, /\.spec\.ts$/);
|
|
26
|
+
// And load the modules.
|
|
27
|
+
context.keys().map(context);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/lib",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"types": []
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"src/test.ts",
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/test.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"**/*.spec.ts",
|
|
15
|
+
"**/*.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
|
|
2
|
+
# For additional information regarding the format and rule options, please see:
|
|
3
|
+
# https://github.com/browserslist/browserslist#queries
|
|
4
|
+
|
|
5
|
+
# For the full list of supported browsers by the Angular framework, please see:
|
|
6
|
+
# https://angular.io/guide/browser-support
|
|
7
|
+
|
|
8
|
+
# You can see what browsers were selected by your queries by running:
|
|
9
|
+
# npx browserslist
|
|
10
|
+
|
|
11
|
+
last 1 Chrome version
|
|
12
|
+
last 1 Firefox version
|
|
13
|
+
last 2 Edge major versions
|
|
14
|
+
last 2 Safari major versions
|
|
15
|
+
last 2 iOS major versions
|
|
16
|
+
Firefox ESR
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
|
|
4
|
+
module.exports = function (config) {
|
|
5
|
+
config.set({
|
|
6
|
+
basePath: '',
|
|
7
|
+
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
+
plugins: [
|
|
9
|
+
require('karma-jasmine'),
|
|
10
|
+
require('karma-chrome-launcher'),
|
|
11
|
+
require('karma-jasmine-html-reporter'),
|
|
12
|
+
require('karma-coverage'),
|
|
13
|
+
require('@angular-devkit/build-angular/plugins/karma')
|
|
14
|
+
],
|
|
15
|
+
client: {
|
|
16
|
+
jasmine: {
|
|
17
|
+
// you can add configuration options for Jasmine here
|
|
18
|
+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
19
|
+
// for example, you can disable the random execution with `random: false`
|
|
20
|
+
// or set a specific seed with `seed: 4321`
|
|
21
|
+
},
|
|
22
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
23
|
+
},
|
|
24
|
+
jasmineHtmlReporter: {
|
|
25
|
+
suppressAll: true // removes the duplicated traces
|
|
26
|
+
},
|
|
27
|
+
coverageReporter: {
|
|
28
|
+
dir: require('path').join(__dirname, '../../coverage/mat-table-ext-example'),
|
|
29
|
+
subdir: '.',
|
|
30
|
+
reporters: [
|
|
31
|
+
{ type: 'html' },
|
|
32
|
+
{ type: 'text-summary' }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
reporters: ['progress', 'kjhtml'],
|
|
36
|
+
port: 9876,
|
|
37
|
+
colors: true,
|
|
38
|
+
logLevel: config.LOG_INFO,
|
|
39
|
+
autoWatch: true,
|
|
40
|
+
browsers: ['Chrome'],
|
|
41
|
+
singleRun: false,
|
|
42
|
+
restartOnFileChange: true
|
|
43
|
+
});
|
|
44
|
+
};
|