mat-table-ext 0.0.9 → 0.0.10

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.
Files changed (89) hide show
  1. package/esm2020/lib/components/column-pinning/column-pinning.component.mjs +58 -0
  2. package/esm2020/lib/components/editing/editing.component.mjs +122 -0
  3. package/esm2020/lib/components/filter-columns-component/filter-columns-component.component.mjs +68 -0
  4. package/esm2020/lib/directives/resize-column.directive.mjs +99 -0
  5. package/esm2020/lib/mat-table-ext.component.mjs +1020 -0
  6. package/esm2020/lib/mat-table-ext.module.mjs +237 -0
  7. package/esm2020/lib/mat-table-ext.service.mjs +20 -0
  8. package/esm2020/lib/models/tableExtModels.mjs +2 -0
  9. package/esm2020/mat-table-ext.mjs +5 -0
  10. package/esm2020/public-api.mjs +11 -0
  11. package/fesm2015/mat-table-ext.mjs +1584 -0
  12. package/fesm2015/mat-table-ext.mjs.map +1 -0
  13. package/fesm2020/mat-table-ext.mjs +1581 -0
  14. package/fesm2020/mat-table-ext.mjs.map +1 -0
  15. package/index.d.ts +5 -0
  16. package/lib/components/column-pinning/column-pinning.component.d.ts +27 -0
  17. package/lib/components/editing/editing.component.d.ts +42 -0
  18. package/lib/components/filter-columns-component/filter-columns-component.component.d.ts +26 -0
  19. package/lib/directives/resize-column.directive.d.ts +27 -0
  20. package/lib/mat-table-ext.component.d.ts +348 -0
  21. package/lib/mat-table-ext.module.d.ts +58 -0
  22. package/lib/mat-table-ext.service.d.ts +11 -0
  23. package/lib/models/tableExtModels.d.ts +76 -0
  24. package/package.json +58 -46
  25. package/{projects/mat-table-ext/src/public-api.ts → public-api.d.ts} +1 -5
  26. package/.editorconfig +0 -16
  27. package/.vscode/extensions.json +0 -4
  28. package/.vscode/launch.json +0 -20
  29. package/.vscode/tasks.json +0 -42
  30. package/LICENSE +0 -21
  31. package/angular.json +0 -150
  32. package/projects/mat-table-ext/.browserslistrc +0 -16
  33. package/projects/mat-table-ext/README.md +0 -57
  34. package/projects/mat-table-ext/karma.conf.js +0 -44
  35. package/projects/mat-table-ext/ng-package.json +0 -9
  36. package/projects/mat-table-ext/package.json +0 -38
  37. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.html +0 -7
  38. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.scss +0 -9
  39. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.spec.ts +0 -23
  40. package/projects/mat-table-ext/src/lib/components/column-pinning/column-pinning.component.ts +0 -48
  41. package/projects/mat-table-ext/src/lib/components/editing/editing.component.html +0 -55
  42. package/projects/mat-table-ext/src/lib/components/editing/editing.component.scss +0 -19
  43. package/projects/mat-table-ext/src/lib/components/editing/editing.component.spec.ts +0 -23
  44. package/projects/mat-table-ext/src/lib/components/editing/editing.component.ts +0 -110
  45. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.html +0 -26
  46. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.scss +0 -0
  47. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.spec.ts +0 -23
  48. package/projects/mat-table-ext/src/lib/components/filter-columns-component/filter-columns-component.component.ts +0 -54
  49. package/projects/mat-table-ext/src/lib/directives/resize-column.directive.ts +0 -103
  50. package/projects/mat-table-ext/src/lib/mat-table-ext.component.html +0 -285
  51. package/projects/mat-table-ext/src/lib/mat-table-ext.component.spec.ts +0 -25
  52. package/projects/mat-table-ext/src/lib/mat-table-ext.component.ts +0 -985
  53. package/projects/mat-table-ext/src/lib/mat-table-ext.module.ts +0 -127
  54. package/projects/mat-table-ext/src/lib/mat-table-ext.scss +0 -181
  55. package/projects/mat-table-ext/src/lib/mat-table-ext.service.spec.ts +0 -16
  56. package/projects/mat-table-ext/src/lib/mat-table-ext.service.ts +0 -12
  57. package/projects/mat-table-ext/src/lib/models/tableExtModels.ts +0 -85
  58. package/projects/mat-table-ext/src/test.ts +0 -27
  59. package/projects/mat-table-ext/tsconfig.lib.json +0 -15
  60. package/projects/mat-table-ext/tsconfig.lib.prod.json +0 -10
  61. package/projects/mat-table-ext/tsconfig.spec.json +0 -17
  62. package/projects/mat-table-ext-example/.browserslistrc +0 -16
  63. package/projects/mat-table-ext-example/karma.conf.js +0 -44
  64. package/projects/mat-table-ext-example/src/app/app.component.html +0 -576
  65. package/projects/mat-table-ext-example/src/app/app.component.scss +0 -0
  66. package/projects/mat-table-ext-example/src/app/app.component.spec.ts +0 -31
  67. package/projects/mat-table-ext-example/src/app/app.component.ts +0 -173
  68. package/projects/mat-table-ext-example/src/app/app.module.ts +0 -40
  69. package/projects/mat-table-ext-example/src/app/service/custom-table.service.spec.ts +0 -16
  70. package/projects/mat-table-ext-example/src/app/service/custom-table.service.ts +0 -18
  71. package/projects/mat-table-ext-example/src/assets/.gitkeep +0 -0
  72. package/projects/mat-table-ext-example/src/assets/data.json +0 -100003
  73. package/projects/mat-table-ext-example/src/environments/environment.prod.ts +0 -3
  74. package/projects/mat-table-ext-example/src/environments/environment.ts +0 -16
  75. package/projects/mat-table-ext-example/src/favicon.ico +0 -0
  76. package/projects/mat-table-ext-example/src/index.html +0 -14
  77. package/projects/mat-table-ext-example/src/main.ts +0 -12
  78. package/projects/mat-table-ext-example/src/polyfills.ts +0 -53
  79. package/projects/mat-table-ext-example/src/styles.scss +0 -23
  80. package/projects/mat-table-ext-example/src/test.ts +0 -26
  81. package/projects/mat-table-ext-example/tsconfig.app.json +0 -15
  82. package/projects/mat-table-ext-example/tsconfig.spec.json +0 -18
  83. package/tsconfig.json +0 -38
  84. /package/{projects/mat-table-ext/assets → assets}/_theming.scss +0 -0
  85. /package/{projects/mat-table-ext/assets → assets}/pinIcon.svg +0 -0
  86. /package/{projects/mat-table-ext/assets → assets}/pinLeft.svg +0 -0
  87. /package/{projects/mat-table-ext/assets → assets}/pinNone.svg +0 -0
  88. /package/{projects/mat-table-ext/assets → assets}/pinRight.svg +0 -0
  89. /package/{projects/mat-table-ext/assets → assets}/pinned.svg +0 -0
@@ -1,576 +0,0 @@
1
- <!-- <mat-form-field appearance="legacy">
2
- <mat-label>Legacy form field</mat-label>
3
- <input matInput placeholder="Placeholder">
4
- <mat-icon matSuffix>sentiment_very_satisfied</mat-icon>
5
- <mat-hint>Hint</mat-hint>
6
- </mat-form-field> -->
7
- <mat-card class="result">
8
- <h2 class="example-h2">Table</h2>
9
- <mat-card-content style="display: flex; gap: 50px">
10
- <div style="display: flex; flex-direction: column">
11
- <section class="example-section">
12
- <mat-slide-toggle [(ngModel)]="popupRowEditing" [disabled]="false">
13
- Popup Editing
14
- </mat-slide-toggle>
15
- </section>
16
- <section class="example-section">
17
- <mat-slide-toggle [(ngModel)]="inlineRowEditing" [disabled]="false">
18
- Inline Editing
19
- </mat-slide-toggle>
20
- </section>
21
- <section class="example-section">
22
- <mat-slide-toggle [(ngModel)]="inCellEditing" [disabled]="false">
23
- Cell Editing
24
- </mat-slide-toggle>
25
- </section>
26
- <section class="example-section">
27
- <mat-slide-toggle [(ngModel)]="deleteRow" [disabled]="false">
28
- Delete Row
29
- </mat-slide-toggle>
30
- </section>
31
- <section class="example-section">
32
- <mat-slide-toggle [(ngModel)]="stripedRows" [disabled]="false">
33
- Striped Rows
34
- </mat-slide-toggle>
35
- </section>
36
- <section class="example-section">
37
- <mat-slide-toggle [(ngModel)]="rowSelection" [disabled]="false">
38
- Row Selection
39
- </mat-slide-toggle>
40
- </section>
41
- <section class="example-section">
42
- <mat-slide-toggle [(ngModel)]="multiRowSelection" [disabled]="false">
43
- Multi Row Selection
44
- </mat-slide-toggle>
45
- </section>
46
- <section class="example-section">
47
- <mat-slide-toggle [(ngModel)]="columnResizable" [disabled]="false">
48
- Column Resizable
49
- </mat-slide-toggle>
50
- </section>
51
- <section class="example-section">
52
- <mat-slide-toggle [(ngModel)]="stickyHeader" [disabled]="false">
53
- Sticky Header
54
- </mat-slide-toggle>
55
- </section>
56
- <section class="example-section">
57
- <mat-slide-toggle [(ngModel)]="stickyFooter" [disabled]="false">
58
- Sticky Footer
59
- </mat-slide-toggle>
60
- </section>
61
- </div>
62
- <div style="display: flex; flex-direction: column">
63
- <section class="example-section">
64
- <mat-slide-toggle [(ngModel)]="toolbarToggle" [disabled]="false">
65
- Table Toolbar
66
- </mat-slide-toggle>
67
- </section>
68
- <section class="example-section" style="padding-left: 15px">
69
- <mat-slide-toggle
70
- [(ngModel)]="exportButtonEnable"
71
- [disabled]="!toolbarToggle"
72
- >
73
- Export Button
74
- </mat-slide-toggle>
75
- </section>
76
- <section class="example-section" style="padding-left: 15px">
77
- <mat-slide-toggle
78
- [(ngModel)]="columnPinnable"
79
- [disabled]="!toolbarToggle"
80
- >
81
- Column Pinnable
82
- </mat-slide-toggle>
83
- </section>
84
- <section class="example-section" style="padding-left: 15px">
85
- <mat-slide-toggle
86
- [(ngModel)]="columnHidable"
87
- [disabled]="!toolbarToggle"
88
- >
89
- Column Hide/Show
90
- </mat-slide-toggle>
91
- </section>
92
- <section class="example-section">
93
- <mat-slide-toggle [(ngModel)]="topSearchFilter" [disabled]="false">
94
- Global Search
95
- </mat-slide-toggle>
96
- </section>
97
- <section class="example-section">
98
- <mat-slide-toggle [(ngModel)]="isExpandEnable" [disabled]="false">
99
- Row Expandable
100
- </mat-slide-toggle>
101
- </section>
102
-
103
- <section class="example-section">
104
- <mat-slide-toggle [(ngModel)]="dragEnable" [disabled]="false">
105
- Drag & Drop Columns
106
- </mat-slide-toggle>
107
- </section>
108
- <section class="example-section">
109
- <mat-slide-toggle [(ngModel)]="isLoading" [disabled]="false">
110
- Loading Indicator
111
- </mat-slide-toggle>
112
- </section>
113
- <section class="example-section">
114
- <mat-slide-toggle [(ngModel)]="paginationEnable" [disabled]="false">
115
- Pagination
116
- </mat-slide-toggle>
117
- </section>
118
- <section class="example-section" style="padding-left: 15px">
119
- <mat-slide-toggle
120
- [(ngModel)]="showFirstLastButtons"
121
- [disabled]="!paginationEnable"
122
- >
123
- Show First Last Page Buttons
124
- </mat-slide-toggle>
125
- </section>
126
- </div>
127
- <div style="display: flex; flex-direction: column">
128
- <section class="example-section">
129
- <mat-slide-toggle [(ngModel)]="simpleFilter" [disabled]="false">
130
- Columns Filter
131
- </mat-slide-toggle>
132
- </section>
133
- <section class="example-section">
134
- <mat-slide-toggle [(ngModel)]="sorting" [disabled]="false">
135
- Sorting
136
- </mat-slide-toggle>
137
- </section>
138
- <section class="example-section">
139
- <mat-slide-toggle [(ngModel)]="infiniteScroll" [disabled]="false">
140
- Infinite Scroll
141
- </mat-slide-toggle>
142
- </section>
143
- <section class="example-section">
144
- <mat-slide-toggle [(ngModel)]="scrollbarH" [disabled]="false">
145
- Horizontal Scroll
146
- </mat-slide-toggle>
147
- </section>
148
- <section class="example-section">
149
- <mat-slide-toggle
150
- [(ngModel)]="headerTemplateRefCtrl"
151
- [disabled]="false"
152
- >
153
- Header TemplateRef
154
- </mat-slide-toggle>
155
- </section>
156
- <section class="example-section">
157
- <mat-slide-toggle [(ngModel)]="cellTemplateRefCtrl" [disabled]="false">
158
- Cell TemplateRef
159
- </mat-slide-toggle>
160
- </section>
161
- <section class="example-section">
162
- <mat-slide-toggle
163
- [(ngModel)]="toolbarTemplateRefCtrl"
164
- [disabled]="!toolbarToggle"
165
- >
166
- Toolbar TemplateRef
167
- </mat-slide-toggle>
168
- </section>
169
- <section class="example-section">
170
- <mat-slide-toggle [(ngModel)]="popupTemplateRefCtrl">
171
- Popup Editing TemplateRef
172
- </mat-slide-toggle>
173
- </section>
174
- <section class="example-section">
175
- <mat-slide-toggle [(ngModel)]="inlineTemplateRefCtrl">
176
- Inline Editing TemplateRef
177
- </mat-slide-toggle>
178
- </section>
179
- <section class="example-section">
180
- <mat-slide-toggle [(ngModel)]="cellEditingTemplateRefCtrl">
181
- Cell Editing TemplateRef
182
- </mat-slide-toggle>
183
- </section>
184
- </div>
185
- <div style="display: flex; flex-direction: column">
186
- <section class="example-section">
187
- <mat-form-field class="example-full-width" appearance="outline">
188
- <mat-label>Table Height</mat-label>
189
- <input
190
- matInput
191
- placeholder="Default is 500px"
192
- [(ngModel)]="tableHeight"
193
- [disabled]="false"
194
- />
195
- </mat-form-field>
196
- </section>
197
- <mat-divider></mat-divider>
198
- <section class="example-section">
199
- <mat-form-field class="example-full-width" appearance="outline">
200
- <mat-label>Table Width</mat-label>
201
- <input
202
- matInput
203
- placeholder="Default is 100%"
204
- [(ngModel)]="tableWidth"
205
- [disabled]="false"
206
- />
207
- </mat-form-field>
208
- </section>
209
- <mat-divider></mat-divider>
210
- <section class="example-section">
211
- <mat-form-field
212
- class="example-full-width"
213
- appearance="outline"
214
- disabled
215
- >
216
- <mat-label>Toolbar Height</mat-label>
217
- <input
218
- matInput
219
- placeholder="Default is 50px"
220
- [(ngModel)]="toolbarHeight"
221
- [disabled]="!toolbarToggle"
222
- />
223
- </mat-form-field>
224
- </section>
225
- <mat-divider></mat-divider>
226
- </div>
227
- </mat-card-content>
228
- </mat-card>
229
-
230
- <mat-table-ext
231
- [dataSource]="dataSource"
232
- [columns]="columns"
233
- [columnResizable]="columnResizable"
234
- [inlineRowEditing]="inlineRowEditing"
235
- [inCellEditing]="inCellEditing"
236
- [popupRowEditing]="popupRowEditing"
237
- [enableDelete]="deleteRow"
238
- [rowSelection]="rowSelection"
239
- [multiRowSelection]="multiRowSelection"
240
- [stickyHeader]="stickyHeader"
241
- [stickyFooter]="stickyFooter"
242
- [columnFilter]="simpleFilter"
243
- [showToolbar]="toolbarToggle"
244
- [toolbarHeight]="toolbarHeight"
245
- [globalSearch]="topSearchFilter"
246
- [expandRows]="isExpandEnable"
247
- [expansionTemplateRef]="ex"
248
- [dndColumns]="dragEnable"
249
- [showPaginator]="paginationEnable"
250
- [pageSizeOptions]="[10, 25, 100]"
251
- [showFirstLastButtons]="showFirstLastButtons"
252
- [columnPinnable]="columnPinnable"
253
- [columnHidable]="columnHidable"
254
- [exportButtonEnable]="exportButtonEnable"
255
- [stripedRows]="stripedRows"
256
- [loadingIndicator]="isLoading"
257
- [sorting]="sorting"
258
- [tableHeight]="tableHeight"
259
- [tableWidth]="tableWidth"
260
- [scrollbarH]="scrollbarH"
261
- (inlineChange)="showData($event, 'inline change')"
262
- (popupChange)="showData($event, 'popup change')"
263
- (cellChange)="showData($event, 'Cell change')"
264
- (scroll)="onScroll($event)"
265
- (selectionChanged)="onSelectionChange($event)"
266
- (rowDeleted)="showData($event, 'Delete change')"
267
- [headerTemplateRef]="headerTemplateRefCtrl ? headerTemplate : undefined"
268
- [cellTemplateRef]="cellTemplateRefCtrl ? cellTemplateRef : undefined"
269
- [cellTemplateRefMap]="{ id: cellTemplateID }"
270
- [toolbarTemplateRef]="toolbarTemplateRefCtrl ? toolbarTemplate : undefined"
271
- [popupEditingTemplateRef]="popupTemplateRefCtrl ? popupEditing : undefined"
272
- [inlineEditingTemplateRef]="inlineTemplateRefCtrl ? inlineEditing : undefined"
273
- [cellEditingTemplateRef]="
274
- cellEditingTemplateRefCtrl ? cellEditing : undefined
275
- "
276
- ></mat-table-ext>
277
- <ng-template #headerTemplate let-data="data">
278
- <div style="display: flex">
279
- <mat-icon style="color: purple">bolt</mat-icon
280
- ><span style="font-size: 15px; font-style: italic">{{ data.header }}</span>
281
- </div>
282
- </ng-template>
283
- <ng-template #cellTemplateRef let-column="column" let-row="row">
284
- <div style="display: flex">
285
- <mat-icon style="color: blue">bolt</mat-icon
286
- ><span style="font-size: 15px; font-style: italic">{{
287
- row[column.field]
288
- }}</span>
289
- </div>
290
- </ng-template>
291
- <ng-template #cellTemplate1 let-column="column" let-row="row">
292
- <div style="display: flex">
293
- <mat-icon style="color: green">bolt</mat-icon
294
- ><span style="font-size: 15px; font-style: italic">{{
295
- row[column.field]
296
- }}</span>
297
- </div>
298
- </ng-template>
299
- <ng-template #cellTemplate2 let-column="column" let-row="row">
300
- <div style="display: flex">
301
- <mat-icon style="color: yellow">folder</mat-icon
302
- ><span style="font-size: 15px; font-style: italic">{{
303
- row[column.field]
304
- }}</span>
305
- </div>
306
- </ng-template>
307
- <ng-template #cellTemplateID let-column="column" let-row="row">
308
- <div style="display: flex">
309
- <mat-icon style="color: yellow">folder</mat-icon
310
- ><span style="font-size: 15px; font-style: italic">{{
311
- row[column.field]
312
- }}</span>
313
- </div>
314
- </ng-template>
315
- <ng-template #toolbarTemplate>
316
- <div style="display: flex">
317
- <button mat-button>
318
- <mat-icon style="color: green">sync</mat-icon>
319
- </button>
320
- </div>
321
- </ng-template>
322
- <ng-template
323
- #popupEditing
324
- let-row="data.row"
325
- let-column="data.columns"
326
- let-keys="data.columnKeys"
327
- let-types="data.columnTypes"
328
- let-close="data.closeDialog"
329
- >
330
- <div style="height: 100%" class="main-dialog-container">
331
- <div mat-dialog-title class="dialog-title-container" style="display: flex">
332
- <h2 style="margin: 0">Edit Row</h2>
333
- <span class="example-spacer"></span>
334
- <button
335
- mat-icon-button
336
- aria-label="Example icon button with a vertical three dot icon"
337
- >
338
- <mat-icon mat-dialog-close style="cursor: pointer" fxFlex="5"
339
- >close</mat-icon
340
- >
341
- </button>
342
- </div>
343
- <mat-dialog-content style="margin-right: 20px">
344
- <div style="display: flex; flex-direction: column">
345
- <ng-container *ngFor="let key of keys">
346
- <mat-form-field
347
- *ngIf="types[key] == 'number'"
348
- color="accent"
349
- appearance="outline"
350
- class="inline-editing-field"
351
- >
352
- <mat-label>{{ key | titlecase }}</mat-label>
353
- <input
354
- matInput
355
- type="number"
356
- [(ngModel)]="row[key]"
357
- color="accent"
358
- [ngModelOptions]="{ standalone: true }"
359
- />
360
- </mat-form-field>
361
-
362
- <mat-form-field
363
- *ngIf="types[key] == 'string'"
364
- appearance="outline"
365
- color="accent"
366
- class="inline-editing-field"
367
- >
368
- <mat-label>{{ key | titlecase }}</mat-label>
369
- <input
370
- matInput
371
- type="text"
372
- [(ngModel)]="row[key]"
373
- color="accent"
374
- [ngModelOptions]="{ standalone: true }"
375
- />
376
- </mat-form-field>
377
- <mat-form-field
378
- *ngIf="types[key] == 'date'"
379
- appearance="outline"
380
- color="accent"
381
- class="inline-editing-field"
382
- >
383
- <mat-label>{{ key | titlecase }}</mat-label>
384
- <input
385
- matInput
386
- type="text"
387
- [(ngModel)]="row[key]"
388
- [ngModelOptions]="{ standalone: true }"
389
- />
390
- </mat-form-field>
391
- <mat-form-field
392
- *ngIf="types[key] == 'selection'"
393
- appearance="outline"
394
- color="accent"
395
- class="inline-editing-field"
396
- >
397
- <mat-label>{{ key | titlecase }}</mat-label>
398
- <mat-select [value]="row[key].value" [(ngModel)]="row[key].value">
399
- <mat-option
400
- *ngFor="let option of row[key].options"
401
- [value]="option"
402
- >
403
- {{ option }}
404
- </mat-option>
405
- </mat-select>
406
- </mat-form-field>
407
- <p>
408
- <mat-checkbox
409
- *ngIf="types[key] == 'boolean'"
410
- color="accent"
411
- [(ngModel)]="row[key]"
412
- >
413
- <mat-label>{{ key | titlecase }}</mat-label>
414
- </mat-checkbox>
415
- </p>
416
- </ng-container>
417
- </div>
418
- </mat-dialog-content>
419
- <div class="spacer"></div>
420
- <mat-dialog-actions style="margin-top: 20px" align="end">
421
- <button mat-raised-button color="accent" mat-dialog-close>Cancel</button>
422
- <button mat-raised-button color="primary" [mat-dialog-close]="row">
423
- Save
424
- </button>
425
- </mat-dialog-actions>
426
- </div>
427
- </ng-template>
428
- <ng-template
429
- #inlineEditing
430
- let-row="data.row"
431
- let-column="data.column"
432
- let-updateData="data.updateFunc"
433
- >
434
- <mat-form-field
435
- *ngIf="column.type == 'number'"
436
- appearance="outline"
437
- class="inline-editing-field"
438
- >
439
- <input
440
- matInput
441
- type="number"
442
- [(ngModel)]="row[column.field]"
443
- [ngModelOptions]="{ standalone: true }"
444
- (ngModelChange)="updateData(row)"
445
- />
446
- </mat-form-field>
447
- <mat-form-field
448
- *ngIf="column.type == 'string'"
449
- appearance="outline"
450
- class="inline-editing-field"
451
- >
452
- <input
453
- matInput
454
- type="text"
455
- [(ngModel)]="row[column.field]"
456
- [ngModelOptions]="{ standalone: true }"
457
- (ngModelChange)="updateData(row)"
458
- />
459
- </mat-form-field>
460
- <mat-form-field
461
- *ngIf="column.type == 'date'"
462
- appearance="outline"
463
- class="inline-editing-field"
464
- >
465
- <input
466
- matInput
467
- type="date"
468
- [(ngModel)]="row[column.field]"
469
- [ngModelOptions]="{ standalone: true }"
470
- (ngModelChange)="updateData(row)"
471
- />
472
- </mat-form-field>
473
- <mat-form-field
474
- *ngIf="column.type == 'selection'"
475
- appearance="outline"
476
- class="inline-editing-field"
477
- >
478
- <mat-select
479
- [value]="row[column.field]"
480
- [(ngModel)]="row[column.field]"
481
- (ngModelChange)="updateData(row)"
482
- [ngModelOptions]="{ standalone: true }"
483
- >
484
- <mat-option *ngFor="let option of column.options" [value]="option">
485
- {{ option }}
486
- </mat-option>
487
- </mat-select>
488
- </mat-form-field>
489
- <mat-checkbox
490
- (click)="$event.stopPropagation()"
491
- (ngModelChange)="updateData(row)"
492
- *ngIf="column.type == 'boolean'"
493
- color="primary"
494
- [(ngModel)]="row[column.field]"
495
- ></mat-checkbox>
496
- </ng-template>
497
- <ng-template
498
- #cellEditing
499
- let-row="data.row"
500
- let-column="data.column"
501
- let-updateData="data.updateFunc"
502
- >
503
- <mat-form-field
504
- *ngIf="column.type == 'number'"
505
- color="accent"
506
- appearance="outline"
507
- class="inline-editing-field"
508
- >
509
- <input
510
- matInput
511
- type="number"
512
- [(ngModel)]="row[column.field]"
513
- [ngModelOptions]="{ standalone: true }"
514
- (ngModelChange)="updateData(row)"
515
- />
516
- </mat-form-field>
517
-
518
- <mat-form-field
519
- *ngIf="column.type == 'string'"
520
- color="accent"
521
- appearance="outline"
522
- class="inline-editing-field"
523
- >
524
- <input
525
- matInput
526
- type="text"
527
- [(ngModel)]="row[column.field]"
528
- [ngModelOptions]="{ standalone: true }"
529
- (ngModelChange)="updateData(row)"
530
- />
531
- </mat-form-field>
532
- <mat-form-field
533
- *ngIf="column.type == 'date'"
534
- color="accent"
535
- appearance="outline"
536
- class="inline-editing-field"
537
- >
538
- <input
539
- matInput
540
- type="date"
541
- [(ngModel)]="row[column.field]"
542
- [ngModelOptions]="{ standalone: true }"
543
- (ngModelChange)="updateData(row)"
544
- />
545
- </mat-form-field>
546
- <mat-form-field
547
- *ngIf="column.type == 'selection'"
548
- color="accent"
549
- appearance="outline"
550
- class="inline-editing-field"
551
- >
552
- <mat-select
553
- [value]="row[column.field]"
554
- [(ngModel)]="row[column.field]"
555
- (ngModelChange)="updateData(row)"
556
- [ngModelOptions]="{ standalone: true }"
557
- >
558
- <mat-option *ngFor="let option of column.options" [value]="option">
559
- {{ option }}
560
- </mat-option>
561
- </mat-select>
562
- </mat-form-field>
563
- <mat-checkbox
564
- (click)="$event.stopPropagation()"
565
- color="accent"
566
- (ngModelChange)="updateData(row)"
567
- *ngIf="column.type == 'boolean'"
568
- color="primary"
569
- [(ngModel)]="row[column.field]"
570
- ></mat-checkbox>
571
- </ng-template>
572
- <ng-template #ex>
573
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus accusantium
574
- quod corrupti? Beatae minima natus tempora iure doloremque magnam excepturi
575
- consequatur? Odit ullam eius ea necessitatibus autem aliquam, qui nulla.
576
- </ng-template>
@@ -1,31 +0,0 @@
1
- import { TestBed } from '@angular/core/testing';
2
- import { AppComponent } from './app.component';
3
-
4
- describe('AppComponent', () => {
5
- beforeEach(async () => {
6
- await TestBed.configureTestingModule({
7
- declarations: [
8
- AppComponent
9
- ],
10
- }).compileComponents();
11
- });
12
-
13
- it('should create the app', () => {
14
- const fixture = TestBed.createComponent(AppComponent);
15
- const app = fixture.componentInstance;
16
- expect(app).toBeTruthy();
17
- });
18
-
19
- it(`should have as title 'mat-table-ext-example'`, () => {
20
- const fixture = TestBed.createComponent(AppComponent);
21
- const app = fixture.componentInstance;
22
- expect(app.title).toEqual('mat-table-ext-example');
23
- });
24
-
25
- it('should render title', () => {
26
- const fixture = TestBed.createComponent(AppComponent);
27
- fixture.detectChanges();
28
- const compiled = fixture.nativeElement as HTMLElement;
29
- expect(compiled.querySelector('.content span')?.textContent).toContain('mat-table-ext-example app is running!');
30
- });
31
- });