@magic-xpa/angular-material-core 4.1000.0 → 4.1100.0-dev000.0

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 (33) hide show
  1. package/README.md +7 -7
  2. package/esm2022/index.mjs +9 -0
  3. package/{esm2020 → esm2022}/magic-xpa-angular-material-core.mjs +1 -1
  4. package/{esm2020 → esm2022}/src/angular-material.module.mjs +83 -83
  5. package/esm2022/src/components/base-mat-table-magic.component.mjs +62 -0
  6. package/esm2022/src/directives/magic/form-controls/mat-magic-autocomplete.directive.mjs +28 -0
  7. package/esm2022/src/directives/magic/form-controls/mat-magic-checkbox.directive.mjs +101 -0
  8. package/esm2022/src/directives/magic/form-controls/mat-magic-combobox.directive.mjs +30 -0
  9. package/esm2022/src/directives/magic/form-controls/mat-magic-listbox.directive.mjs +27 -0
  10. package/{esm2020 → esm2022}/src/services/mat.magic.providers.mjs +6 -6
  11. package/esm2022/src/services/mattable.magic.service.mjs +138 -0
  12. package/{fesm2020 → fesm2022}/magic-xpa-angular-material-core.mjs +409 -307
  13. package/fesm2022/magic-xpa-angular-material-core.mjs.map +1 -0
  14. package/index.d.ts +8 -8
  15. package/package.json +10 -16
  16. package/src/angular-material.module.d.ts +26 -26
  17. package/src/components/base-mat-table-magic.component.d.ts +19 -19
  18. package/src/directives/magic/form-controls/mat-magic-autocomplete.directive.d.ts +7 -7
  19. package/src/directives/magic/form-controls/mat-magic-checkbox.directive.d.ts +23 -6
  20. package/src/directives/magic/form-controls/mat-magic-combobox.directive.d.ts +9 -9
  21. package/src/directives/magic/form-controls/mat-magic-listbox.directive.d.ts +9 -9
  22. package/src/services/mat.magic.providers.d.ts +38 -38
  23. package/src/services/mattable.magic.service.d.ts +36 -36
  24. package/esm2020/index.mjs +0 -9
  25. package/esm2020/src/components/base-mat-table-magic.component.mjs +0 -54
  26. package/esm2020/src/directives/magic/form-controls/mat-magic-autocomplete.directive.mjs +0 -28
  27. package/esm2020/src/directives/magic/form-controls/mat-magic-checkbox.directive.mjs +0 -16
  28. package/esm2020/src/directives/magic/form-controls/mat-magic-combobox.directive.mjs +0 -30
  29. package/esm2020/src/directives/magic/form-controls/mat-magic-listbox.directive.mjs +0 -26
  30. package/esm2020/src/services/mattable.magic.service.mjs +0 -127
  31. package/fesm2015/magic-xpa-angular-material-core.mjs +0 -367
  32. package/fesm2015/magic-xpa-angular-material-core.mjs.map +0 -1
  33. package/fesm2020/magic-xpa-angular-material-core.mjs.map +0 -1
@@ -1,341 +1,443 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, HostListener, Injectable, Component, ViewChild, NgModule } from '@angular/core';
2
+ import { Directive, HostListener, Input, Injectable, Component, ViewChild, NgModule } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
4
  import { FormsModule } from '@angular/forms';
5
5
  import * as i1 from '@magic-xpa/angular';
6
- import { CheckboxMagicDirective, ComboboxMagicDirective, MagicDirective, TableMagicService, basicMagicProviders, TaskBaseMagicComponent, MagicModule } from '@magic-xpa/angular';
6
+ import { ComboboxMagicDirective, MagicDirective, TableMagicService, basicMagicProviders, TaskBaseMagicComponent, MagicModule } from '@magic-xpa/angular';
7
+ import { filter } from 'rxjs/operators';
8
+ import { HtmlProperties, CommandType } from '@magic-xpa/gui';
9
+ import * as i2 from '@angular/material/checkbox';
10
+ import { MatCheckboxModule } from '@angular/material/checkbox';
11
+ import { getGuiEventObj } from '@magic-xpa/engine';
7
12
  import { MatSort } from '@angular/material/sort';
8
13
  import { MatTableDataSource, MatTableModule } from '@angular/material/table';
9
14
  import { SelectionModel } from '@angular/cdk/collections';
10
- import { getGuiEventObj } from '@magic-xpa/engine';
11
15
  import { isNullOrUndefined } from '@magic-xpa/mscorelib';
12
16
  import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
13
17
  import { MatInputModule } from '@angular/material/input';
14
18
  import { MatButtonModule } from '@angular/material/button';
15
19
  import { MatListModule } from '@angular/material/list';
16
- import { MatCheckboxModule } from '@angular/material/checkbox';
17
20
  import { MatTabsModule } from '@angular/material/tabs';
18
21
  import { MatSelectModule } from '@angular/material/select';
19
22
  import { MatDatepickerModule } from '@angular/material/datepicker';
20
23
  import { MatNativeDateModule } from '@angular/material/core';
21
24
 
22
- class MatCheckboxDirective extends CheckboxMagicDirective {
23
- }
24
- MatCheckboxDirective.ɵfac = function () { let ɵMatCheckboxDirective_BaseFactory; return function MatCheckboxDirective_Factory(t) { return (ɵMatCheckboxDirective_BaseFactory || (ɵMatCheckboxDirective_BaseFactory = i0.ɵɵgetInheritedFactory(MatCheckboxDirective)))(t || MatCheckboxDirective); }; }();
25
- MatCheckboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatCheckboxDirective, selectors: [["mat-checkbox", "magic", "", 3, "noFormControl", ""]], features: [i0.ɵɵInheritDefinitionFeature] });
26
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatCheckboxDirective, [{
27
- type: Directive,
28
- args: [{
25
+ class MatCheckboxDirective {
26
+ magicDirective;
27
+ matCheckbox;
28
+ task;
29
+ element;
30
+ threeState = false;
31
+ subscribeRefreshDom = null;
32
+ indeterminate = false;
33
+ constructor(magicDirective, matCheckbox, task, element) {
34
+ this.magicDirective = magicDirective;
35
+ this.matCheckbox = matCheckbox;
36
+ this.task = task;
37
+ this.element = element;
38
+ }
39
+ onChange($event) {
40
+ if (this.threeState) {
41
+ this.handleThreeState();
42
+ }
43
+ else {
44
+ this.magicDirective.task.onCheckChanged($event, this.magicDirective.id, +this.magicDirective.rowId);
45
+ }
46
+ }
47
+ ngOnInit() {
48
+ if (this.threeState) {
49
+ let guiEvent = getGuiEventObj("setAsThreeState", this.magicDirective.id, +this.magicDirective.rowId);
50
+ this.task.insertEvent(guiEvent);
51
+ this.matCheckbox.indeterminate = this.indeterminate = this.task.getProperty(this.magicDirective.id, HtmlProperties.CheckBoxIndeterminate, this.magicDirective.rowId);
52
+ this.regUpdatesUI();
53
+ }
54
+ }
55
+ regUpdatesUI() {
56
+ this.subscribeRefreshDom = this.task
57
+ .refreshDom.pipe(filter(c => this.magicDirective.IsSameElement(c)))
58
+ .subscribe(a => {
59
+ let command = a;
60
+ try {
61
+ this.handleCommand(command);
62
+ }
63
+ catch (ex) {
64
+ console.dir(ex);
65
+ }
66
+ });
67
+ }
68
+ handleCommand(command) {
69
+ if (command.CommandType == CommandType.SET_PROPERTY &&
70
+ command.Operation == HtmlProperties.CheckBoxIndeterminate) {
71
+ this.indeterminate = this.matCheckbox.indeterminate = command.obj1;
72
+ }
73
+ }
74
+ handleThreeState() {
75
+ let value = '';
76
+ let prevCheckedValue = this.task.getValue(this.magicDirective.id, this.magicDirective.rowId);
77
+ if (this.indeterminate) {
78
+ this.indeterminate = this.matCheckbox.indeterminate = false;
79
+ this.matCheckbox.checked = false;
80
+ value = 'unchecked';
81
+ }
82
+ else if (prevCheckedValue) {
83
+ this.indeterminate = this.matCheckbox.indeterminate = true;
84
+ this.matCheckbox.checked = false;
85
+ value = 'indeterminate';
86
+ }
87
+ else if (!prevCheckedValue) {
88
+ this.indeterminate = this.matCheckbox.indeterminate = false;
89
+ this.matCheckbox.checked = true;
90
+ value = 'checked';
91
+ }
92
+ this.magicDirective.task.onCheckChanged(value, this.magicDirective.id, +this.magicDirective.rowId);
93
+ }
94
+ ngOnDestroy() {
95
+ if (this.subscribeRefreshDom !== null)
96
+ this.subscribeRefreshDom.unsubscribe();
97
+ }
98
+ static ɵfac = function MatCheckboxDirective_Factory(t) { return new (t || MatCheckboxDirective)(i0.ɵɵdirectiveInject(i1.MagicDirective), i0.ɵɵdirectiveInject(i2.MatCheckbox), i0.ɵɵdirectiveInject(i1.TaskMagicService), i0.ɵɵdirectiveInject(i0.ElementRef)); };
99
+ static ɵdir = i0.ɵɵdefineDirective({ type: MatCheckboxDirective, selectors: [["mat-checkbox", "magic", "", 3, "noFormControl", ""]], hostBindings: function MatCheckboxDirective_HostBindings(rf, ctx) { if (rf & 1) {
100
+ i0.ɵɵlistener("change", function MatCheckboxDirective_change_HostBindingHandler($event) { return ctx.onChange($event); });
101
+ } }, inputs: { threeState: "threeState" } });
102
+ }
103
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatCheckboxDirective, [{
104
+ type: Directive,
105
+ args: [{
29
106
  selector: `
30
107
  mat-checkbox[magic]:not([noFormControl])
31
- `,
32
- }]
33
- }], null, null); })();
108
+ `,
109
+ }]
110
+ }], () => [{ type: i1.MagicDirective }, { type: i2.MatCheckbox }, { type: i1.TaskMagicService }, { type: i0.ElementRef }], { threeState: [{
111
+ type: Input
112
+ }], onChange: [{
113
+ type: HostListener,
114
+ args: ['change', ['$event']]
115
+ }] }); })();
34
116
 
35
- class MatComboboxDirective extends ComboboxMagicDirective {
36
- onChange($event) {
37
- super.onChange($event);
38
- }
39
- onOpenedChanged($event) {
40
- MagicDirective.opened = $event;
41
- }
42
- onComboboxItemsListChanged() {
43
- }
44
- }
45
- MatComboboxDirective.ɵfac = function () { let ɵMatComboboxDirective_BaseFactory; return function MatComboboxDirective_Factory(t) { return (ɵMatComboboxDirective_BaseFactory || (ɵMatComboboxDirective_BaseFactory = i0.ɵɵgetInheritedFactory(MatComboboxDirective)))(t || MatComboboxDirective); }; }();
46
- MatComboboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatComboboxDirective, selectors: [["mat-select", "magic", ""]], hostBindings: function MatComboboxDirective_HostBindings(rf, ctx) { if (rf & 1) {
47
- i0.ɵɵlistener("selectionChange", function MatComboboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); })("openedChange", function MatComboboxDirective_openedChange_HostBindingHandler($event) { return ctx.onOpenedChanged($event); });
48
- } }, features: [i0.ɵɵInheritDefinitionFeature] });
49
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatComboboxDirective, [{
50
- type: Directive,
51
- args: [{
52
- selector: `mat-select[magic]`,
53
- }]
54
- }], null, { onChange: [{
55
- type: HostListener,
56
- args: ['selectionChange', ['$event']]
57
- }], onOpenedChanged: [{
58
- type: HostListener,
59
- args: ['openedChange', ['$event']]
117
+ class MatComboboxDirective extends ComboboxMagicDirective {
118
+ onChange($event) {
119
+ super.onChange($event);
120
+ }
121
+ onOpenedChanged($event) {
122
+ MagicDirective.opened = $event;
123
+ }
124
+ onComboboxItemsListChanged() {
125
+ }
126
+ static ɵfac = (() => { let ɵMatComboboxDirective_BaseFactory; return function MatComboboxDirective_Factory(t) { return (ɵMatComboboxDirective_BaseFactory || (ɵMatComboboxDirective_BaseFactory = i0.ɵɵgetInheritedFactory(MatComboboxDirective)))(t || MatComboboxDirective); }; })();
127
+ static ɵdir = i0.ɵɵdefineDirective({ type: MatComboboxDirective, selectors: [["mat-select", "magic", ""]], hostBindings: function MatComboboxDirective_HostBindings(rf, ctx) { if (rf & 1) {
128
+ i0.ɵɵlistener("selectionChange", function MatComboboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); })("openedChange", function MatComboboxDirective_openedChange_HostBindingHandler($event) { return ctx.onOpenedChanged($event); });
129
+ } }, features: [i0.ɵɵInheritDefinitionFeature] });
130
+ }
131
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatComboboxDirective, [{
132
+ type: Directive,
133
+ args: [{
134
+ selector: `mat-select[magic]`,
135
+ }]
136
+ }], null, { onChange: [{
137
+ type: HostListener,
138
+ args: ['selectionChange', ['$event']]
139
+ }], onOpenedChanged: [{
140
+ type: HostListener,
141
+ args: ['openedChange', ['$event']]
60
142
  }] }); })();
61
143
 
62
- class MgMatTableService extends TableMagicService {
63
- get DataSource() {
64
- return this.dataSource;
65
- }
66
- set DataSource(dataSource) {
67
- this.dataSource = dataSource;
68
- }
69
- get Selection() {
70
- return this.selection;
71
- }
72
- set Selection(selection) {
73
- this.selection = selection;
74
- }
75
- get Paginator() {
76
- return this.paginator;
77
- }
78
- set Paginator(paginator) {
79
- this.paginator = paginator;
80
- }
81
- constructor(componentList, task) {
82
- super(componentList, task);
83
- this.componentList = componentList;
84
- this.task = task;
85
- }
86
- connect(dataSource, paginator, selection) {
87
- this.dataSource = dataSource;
88
- this.paginator = paginator;
89
- this.selection = selection;
90
- }
91
- refreshDataSource() {
92
- if (!isNullOrUndefined(this.paginator))
93
- this.dataSource.paginator = this.paginator;
94
- this.dataSource.data = (this.task.mgAccessorService.isDataviewEmpty() ? [] : this.task.Records.list);
95
- }
96
- getPageSize() {
97
- if (isNullOrUndefined(this.paginator))
98
- return 10;
99
- return this.paginator.pageSize;
100
- }
101
- selectRow(guiRowid) {
102
- super.selectRow(guiRowid);
103
- this.selection.select(this.task.Records.list[guiRowid]);
104
- this.refreshDataSource();
105
- }
106
- selectPage(pageId) {
107
- if (!isNullOrUndefined(this.paginator))
108
- this.paginator.pageIndex = pageId;
109
- this.refreshDataSource();
110
- }
111
- selectedRow() {
112
- return this.selection.selected[0];
113
- }
114
- mgOnPaginateChange(e, changeSelectedRow) {
115
- if (this.task.oldPageSize != e.pageSize) {
116
- this.handleResize(e.pageIndex, e.previousPageIndex, e.pageSize);
117
- this.task.oldPageSize = e.pageSize;
118
- }
119
- else {
120
- if (changeSelectedRow) {
121
- let evt = (e.pageIndex > e.previousPageIndex) ? "next-page" : "previous-page";
122
- let guiEvent = getGuiEventObj("navigateInTable", "magicRow", 0);
123
- guiEvent.Value = evt;
124
- this.task.insertEvent(guiEvent);
125
- }
126
- else
127
- this.getRowsIfNeeded(e.pageIndex, e.previousPageIndex, e.pageSize);
128
- }
129
- }
130
- handleResize(pageIndex, prevPageIndex, pageSize) {
131
- let requiredGuiRowId = pageIndex * pageSize;
132
- this.task.resize(pageSize, requiredGuiRowId);
133
- }
134
- getRowsIfNeeded(pageIndex, prevPageIndex, pageSize) {
135
- let guiEvent = getGuiEventObj("getRows", "", 0);
136
- guiEvent.Line = pageIndex * pageSize;
137
- this.task.insertEvent(guiEvent);
138
- this.setTableTopIndex(this.task.getDvRowId(pageSize * pageIndex));
139
- }
140
- sortData(e) {
141
- let direction = 0;
142
- if (e.direction === 'asc')
143
- direction = 0;
144
- else if (e.direction === 'desc')
145
- direction = 1;
146
- let guiEvent = getGuiEventObj("columnSort", e.active, direction);
147
- this.task.insertEvent(guiEvent);
148
- }
149
- updateTableSize(size) {
150
- if (size === 0) {
151
- size = 1;
152
- this.task.Records.clearFirstTableRecord(this.task.template);
153
- }
154
- else if (isNullOrUndefined(this.paginator))
155
- size = this.getPageSize();
156
- this.task.formGroups.length = size;
157
- this.task.Records.updateSize(size);
158
- this.task.setIncludesFirst(false);
159
- }
160
- selectPageForGuiRowId(guiRowId) {
161
- let pageToBeSelected = 0;
162
- let prevSelectedRow = this.selectedRow();
163
- pageToBeSelected = Math.floor(guiRowId / this.getPageSize());
164
- if ((isNullOrUndefined(prevSelectedRow) || (!isNullOrUndefined(this.paginator) && pageToBeSelected != this.paginator.pageIndex)))
165
- this.selectPage(pageToBeSelected);
166
- }
167
- setTableTopIndex(value) {
168
- this.task.Records.setGuiTopIndex(value);
169
- if (value >= 0)
170
- this.selectPageForGuiRowId(this.task.getGuiRowId(value, true));
171
- }
172
- getTableTopIndex() {
173
- return this.task.Records.getGuiTopIndex();
174
- }
175
- }
176
- MgMatTableService.ɵfac = function MgMatTableService_Factory(t) { return new (t || MgMatTableService)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i1.TaskMagicService)); };
177
- MgMatTableService.ɵprov = i0.ɵɵdefineInjectable({ token: MgMatTableService, factory: MgMatTableService.ɵfac });
178
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgMatTableService, [{
179
- type: Injectable
180
- }], function () { return [{ type: i1.ComponentListMagicService }, { type: i1.TaskMagicService }]; }, null); })();
144
+ class MgMatTableService extends TableMagicService {
145
+ componentList;
146
+ task;
147
+ dataSource;
148
+ get DataSource() {
149
+ return this.dataSource;
150
+ }
151
+ set DataSource(dataSource) {
152
+ this.dataSource = dataSource;
153
+ }
154
+ selection;
155
+ get Selection() {
156
+ return this.selection;
157
+ }
158
+ set Selection(selection) {
159
+ this.selection = selection;
160
+ }
161
+ paginator;
162
+ get Paginator() {
163
+ return this.paginator;
164
+ }
165
+ set Paginator(paginator) {
166
+ this.paginator = paginator;
167
+ }
168
+ constructor(componentList, task) {
169
+ super(componentList, task);
170
+ this.componentList = componentList;
171
+ this.task = task;
172
+ }
173
+ connect(dataSource, paginator, selection) {
174
+ this.dataSource = dataSource;
175
+ this.paginator = paginator;
176
+ this.selection = selection;
177
+ }
178
+ refreshDataSource() {
179
+ if (!isNullOrUndefined(this.paginator))
180
+ this.dataSource.paginator = this.paginator;
181
+ this.dataSource.data = (this.task.mgAccessorService.isDataviewEmpty() ? [] : this.task.Records.list);
182
+ }
183
+ getPageSize() {
184
+ if (isNullOrUndefined(this.paginator))
185
+ return 10;
186
+ return this.paginator.pageSize;
187
+ }
188
+ selectRow(guiRowid) {
189
+ super.selectRow(guiRowid);
190
+ this.selection.select(this.task.Records.list[guiRowid]);
191
+ this.refreshDataSource();
192
+ }
193
+ selectPage(pageId) {
194
+ if (!isNullOrUndefined(this.paginator))
195
+ this.paginator.pageIndex = pageId;
196
+ this.refreshDataSource();
197
+ }
198
+ selectedRow() {
199
+ return this.selection.selected[0];
200
+ }
201
+ mgOnPaginateChange(e, changeSelectedRow) {
202
+ if (this.task.oldPageSize != e.pageSize) {
203
+ this.handleResize(e.pageIndex, e.previousPageIndex, e.pageSize);
204
+ this.task.oldPageSize = e.pageSize;
205
+ }
206
+ else {
207
+ if (changeSelectedRow) {
208
+ let evt;
209
+ if (e.pageIndex > e.previousPageIndex) {
210
+ evt = (e.pageIndex - e.previousPageIndex === 1) ? "next-page" : "end-table";
211
+ }
212
+ else {
213
+ evt = (e.previousPageIndex - e.pageIndex === 1) ? "previous-page" : "begin-table";
214
+ }
215
+ let guiEvent = getGuiEventObj("navigateInTable", "magicRow", 0);
216
+ guiEvent.Value = evt;
217
+ this.task.insertEvent(guiEvent);
218
+ }
219
+ else
220
+ this.getRowsIfNeeded(e.pageIndex, e.previousPageIndex, e.pageSize);
221
+ }
222
+ }
223
+ handleResize(pageIndex, prevPageIndex, pageSize) {
224
+ let requiredGuiRowId = pageIndex * pageSize;
225
+ this.task.resize(pageSize, requiredGuiRowId);
226
+ }
227
+ getRowsIfNeeded(pageIndex, prevPageIndex, pageSize) {
228
+ let guiEvent = getGuiEventObj("getRows", "", 0);
229
+ guiEvent.Line = pageIndex * pageSize;
230
+ this.task.insertEvent(guiEvent);
231
+ this.setTableTopIndex(this.task.getDvRowId(pageSize * pageIndex));
232
+ }
233
+ sortData(e) {
234
+ let direction = 0;
235
+ if (e.direction === 'asc')
236
+ direction = 0;
237
+ else if (e.direction === 'desc')
238
+ direction = 1;
239
+ let guiEvent = getGuiEventObj("columnSort", e.active, direction);
240
+ this.task.insertEvent(guiEvent);
241
+ }
242
+ updateTableSize(size) {
243
+ if (size === 0) {
244
+ size = 1;
245
+ this.task.Records.clearFirstTableRecord(this.task.template);
246
+ }
247
+ else if (isNullOrUndefined(this.paginator))
248
+ size = this.getPageSize();
249
+ this.task.formGroups.length = size;
250
+ this.task.Records.updateSize(size);
251
+ this.task.setIncludesFirst(false);
252
+ }
253
+ selectPageForGuiRowId(guiRowId) {
254
+ let pageToBeSelected = 0;
255
+ let prevSelectedRow = this.selectedRow();
256
+ pageToBeSelected = Math.floor(guiRowId / this.getPageSize());
257
+ if ((isNullOrUndefined(prevSelectedRow) || (!isNullOrUndefined(this.paginator) && pageToBeSelected != this.paginator.pageIndex)))
258
+ this.selectPage(pageToBeSelected);
259
+ }
260
+ setTableTopIndex(value) {
261
+ this.task.Records.setGuiTopIndex(value);
262
+ if (value >= 0)
263
+ this.selectPageForGuiRowId(this.task.getGuiRowId(value, true));
264
+ }
265
+ getTableTopIndex() {
266
+ return this.task.Records.getGuiTopIndex();
267
+ }
268
+ static ɵfac = function MgMatTableService_Factory(t) { return new (t || MgMatTableService)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i1.TaskMagicService)); };
269
+ static ɵprov = i0.ɵɵdefineInjectable({ token: MgMatTableService, factory: MgMatTableService.ɵfac });
270
+ }
271
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MgMatTableService, [{
272
+ type: Injectable
273
+ }], () => [{ type: i1.ComponentListMagicService }, { type: i1.TaskMagicService }], null); })();
181
274
 
182
- const matMagicProviders = [
183
- ...basicMagicProviders,
184
- { provide: TableMagicService, useClass: MgMatTableService }
275
+ const matMagicProviders = [
276
+ ...basicMagicProviders,
277
+ { provide: TableMagicService, useClass: MgMatTableService }
185
278
  ];
186
279
 
187
- class BaseMatTableMagicComponent extends TaskBaseMagicComponent {
188
- constructor(ref, magicService) {
189
- super(ref, magicService);
190
- this.ref = ref;
191
- this.magicService = magicService;
192
- this.displayedColumns = [];
193
- this.dataSource = new MatTableDataSource(this.task.Records.list);
194
- this.selection = new SelectionModel(false, []);
195
- }
196
- ngOnInit() {
197
- super.ngOnInit();
198
- this.magicService.tableService.connect(this.dataSource, this.paginator, this.selection);
199
- }
200
- ngAfterContentChecked() {
201
- if (!isNullOrUndefined(this.paginator) && !isNullOrUndefined(this.paginator.pageSize) &&
202
- this.paginator.pageSize != this.task.oldPageSize) {
203
- this.magicService.tableService.handleResize(this.paginator.pageIndex, 0, this.paginator.pageSize);
204
- this.task.oldPageSize = this.paginator.pageSize;
205
- }
206
- }
207
- }
208
- BaseMatTableMagicComponent.ɵfac = function BaseMatTableMagicComponent_Factory(t) { return new (t || BaseMatTableMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.MagicServices)); };
209
- BaseMatTableMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMatTableMagicComponent, selectors: [["ng-component"]], viewQuery: function BaseMatTableMagicComponent_Query(rf, ctx) { if (rf & 1) {
210
- i0.ɵɵviewQuery(MatPaginator, 7);
211
- i0.ɵɵviewQuery(MatSort, 7);
212
- } if (rf & 2) {
213
- let _t;
214
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.paginator = _t.first);
215
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.sort = _t.first);
216
- } }, features: [i0.ɵɵProvidersFeature(matMagicProviders), i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function BaseMatTableMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
217
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMatTableMagicComponent, [{
218
- type: Component,
219
- args: [{
220
- providers: matMagicProviders,
221
- template: ''
222
- }]
223
- }], function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.MagicServices }]; }, { paginator: [{
224
- type: ViewChild,
225
- args: [MatPaginator, { static: true }]
226
- }], sort: [{
227
- type: ViewChild,
228
- args: [MatSort, { static: true }]
280
+ class BaseMatTableMagicComponent extends TaskBaseMagicComponent {
281
+ ref;
282
+ magicService;
283
+ paginator;
284
+ sort;
285
+ displayedColumns;
286
+ dataSource;
287
+ selection;
288
+ constructor(ref, magicService) {
289
+ super(ref, magicService);
290
+ this.ref = ref;
291
+ this.magicService = magicService;
292
+ this.displayedColumns = [];
293
+ this.dataSource = new MatTableDataSource(this.task.Records.list);
294
+ this.selection = new SelectionModel(false, []);
295
+ }
296
+ ngOnInit() {
297
+ super.ngOnInit();
298
+ this.magicService.tableService.connect(this.dataSource, this.paginator, this.selection);
299
+ }
300
+ ngAfterContentChecked() {
301
+ if (!isNullOrUndefined(this.paginator) && !isNullOrUndefined(this.paginator.pageSize) &&
302
+ this.paginator.pageSize != this.task.oldPageSize) {
303
+ this.magicService.tableService.handleResize(this.paginator.pageIndex, 0, this.paginator.pageSize);
304
+ this.task.oldPageSize = this.paginator.pageSize;
305
+ }
306
+ }
307
+ static ɵfac = function BaseMatTableMagicComponent_Factory(t) { return new (t || BaseMatTableMagicComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.MagicServices)); };
308
+ static ɵcmp = i0.ɵɵdefineComponent({ type: BaseMatTableMagicComponent, selectors: [["ng-component"]], viewQuery: function BaseMatTableMagicComponent_Query(rf, ctx) { if (rf & 1) {
309
+ i0.ɵɵviewQuery(MatPaginator, 7);
310
+ i0.ɵɵviewQuery(MatSort, 7);
311
+ } if (rf & 2) {
312
+ let _t;
313
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.paginator = _t.first);
314
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.sort = _t.first);
315
+ } }, features: [i0.ɵɵProvidersFeature(matMagicProviders), i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function BaseMatTableMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
316
+ }
317
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseMatTableMagicComponent, [{
318
+ type: Component,
319
+ args: [{
320
+ providers: matMagicProviders,
321
+ template: ''
322
+ }]
323
+ }], () => [{ type: i0.ChangeDetectorRef }, { type: i1.MagicServices }], { paginator: [{
324
+ type: ViewChild,
325
+ args: [MatPaginator, { static: true }]
326
+ }], sort: [{
327
+ type: ViewChild,
328
+ args: [MatSort, { static: true }]
229
329
  }] }); })();
330
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(BaseMatTableMagicComponent, { className: "BaseMatTableMagicComponent", filePath: "src\\components\\base-mat-table-magic.component.ts", lineNumber: 19 }); })();
230
331
 
231
- class MatListboxDirective {
232
- constructor(magicDirective) {
233
- this.magicDirective = magicDirective;
234
- }
235
- onChange($event) {
236
- this.magicDirective.task.onListBoxSelectionChanged($event, this.magicDirective.id);
237
- }
238
- }
239
- MatListboxDirective.ɵfac = function MatListboxDirective_Factory(t) { return new (t || MatListboxDirective)(i0.ɵɵdirectiveInject(i1.MagicDirective)); };
240
- MatListboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatListboxDirective, selectors: [["mat-selection-list", "magic", ""]], hostBindings: function MatListboxDirective_HostBindings(rf, ctx) { if (rf & 1) {
241
- i0.ɵɵlistener("selectionChange", function MatListboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); });
242
- } } });
243
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatListboxDirective, [{
244
- type: Directive,
245
- args: [{
246
- selector: `mat-selection-list[magic]`,
247
- }]
248
- }], function () { return [{ type: i1.MagicDirective }]; }, { onChange: [{
249
- type: HostListener,
250
- args: ['selectionChange', ['$event']]
332
+ class MatListboxDirective {
333
+ magicDirective;
334
+ constructor(magicDirective) {
335
+ this.magicDirective = magicDirective;
336
+ }
337
+ onChange($event) {
338
+ this.magicDirective.task.onListBoxSelectionChanged($event, this.magicDirective.id);
339
+ }
340
+ static ɵfac = function MatListboxDirective_Factory(t) { return new (t || MatListboxDirective)(i0.ɵɵdirectiveInject(i1.MagicDirective)); };
341
+ static ɵdir = i0.ɵɵdefineDirective({ type: MatListboxDirective, selectors: [["mat-selection-list", "magic", ""]], hostBindings: function MatListboxDirective_HostBindings(rf, ctx) { if (rf & 1) {
342
+ i0.ɵɵlistener("selectionChange", function MatListboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); });
343
+ } } });
344
+ }
345
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatListboxDirective, [{
346
+ type: Directive,
347
+ args: [{
348
+ selector: `mat-selection-list[magic]`,
349
+ }]
350
+ }], () => [{ type: i1.MagicDirective }], { onChange: [{
351
+ type: HostListener,
352
+ args: ['selectionChange', ['$event']]
251
353
  }] }); })();
252
354
 
253
- class MatMagicAutocompleteDirective {
254
- onOpenedChanged($event) {
255
- MagicDirective.noOfAutoCompleteBoxesOpened++;
256
- }
257
- onClosedChanged($event) {
258
- MagicDirective.noOfAutoCompleteBoxesOpened--;
259
- }
260
- }
261
- MatMagicAutocompleteDirective.ɵfac = function MatMagicAutocompleteDirective_Factory(t) { return new (t || MatMagicAutocompleteDirective)(); };
262
- MatMagicAutocompleteDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatMagicAutocompleteDirective, selectors: [["mat-autocomplete", "magic", ""]], hostBindings: function MatMagicAutocompleteDirective_HostBindings(rf, ctx) { if (rf & 1) {
263
- i0.ɵɵlistener("opened", function MatMagicAutocompleteDirective_opened_HostBindingHandler($event) { return ctx.onOpenedChanged($event); })("closed", function MatMagicAutocompleteDirective_closed_HostBindingHandler($event) { return ctx.onClosedChanged($event); });
264
- } } });
265
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatMagicAutocompleteDirective, [{
266
- type: Directive,
267
- args: [{
268
- selector: 'mat-autocomplete[magic]'
269
- }]
270
- }], null, { onOpenedChanged: [{
271
- type: HostListener,
272
- args: ['opened', ['$event']]
273
- }], onClosedChanged: [{
274
- type: HostListener,
275
- args: ['closed', ['$event']]
355
+ class MatMagicAutocompleteDirective {
356
+ onOpenedChanged($event) {
357
+ MagicDirective.noOfAutoCompleteBoxesOpened++;
358
+ }
359
+ onClosedChanged($event) {
360
+ MagicDirective.noOfAutoCompleteBoxesOpened--;
361
+ }
362
+ static ɵfac = function MatMagicAutocompleteDirective_Factory(t) { return new (t || MatMagicAutocompleteDirective)(); };
363
+ static ɵdir = i0.ɵɵdefineDirective({ type: MatMagicAutocompleteDirective, selectors: [["mat-autocomplete", "magic", ""]], hostBindings: function MatMagicAutocompleteDirective_HostBindings(rf, ctx) { if (rf & 1) {
364
+ i0.ɵɵlistener("opened", function MatMagicAutocompleteDirective_opened_HostBindingHandler($event) { return ctx.onOpenedChanged($event); })("closed", function MatMagicAutocompleteDirective_closed_HostBindingHandler($event) { return ctx.onClosedChanged($event); });
365
+ } } });
366
+ }
367
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MatMagicAutocompleteDirective, [{
368
+ type: Directive,
369
+ args: [{
370
+ selector: 'mat-autocomplete[magic]'
371
+ }]
372
+ }], null, { onOpenedChanged: [{
373
+ type: HostListener,
374
+ args: ['opened', ['$event']]
375
+ }], onClosedChanged: [{
376
+ type: HostListener,
377
+ args: ['closed', ['$event']]
276
378
  }] }); })();
277
379
 
278
- const materialModules = [
279
- MatTableModule,
280
- MatPaginatorModule,
281
- MatInputModule,
282
- MatButtonModule,
283
- MatListModule,
284
- MatCheckboxModule,
285
- MatTabsModule,
286
- MatSelectModule,
287
- MatDatepickerModule,
288
- MatNativeDateModule,
289
- ];
290
- class MagicAngularMaterialModule {
291
- }
292
- MagicAngularMaterialModule.ɵfac = function MagicAngularMaterialModule_Factory(t) { return new (t || MagicAngularMaterialModule)(); };
293
- MagicAngularMaterialModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicAngularMaterialModule });
294
- MagicAngularMaterialModule.ɵinj = i0.ɵɵdefineInjector({ imports: [CommonModule,
295
- FormsModule, materialModules, MagicModule] });
296
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicAngularMaterialModule, [{
297
- type: NgModule,
298
- args: [{
299
- declarations: [
300
- MatCheckboxDirective,
301
- MatComboboxDirective,
302
- MatListboxDirective,
303
- MatMagicAutocompleteDirective,
304
- BaseMatTableMagicComponent,
305
- ],
306
- exports: [
307
- MatCheckboxDirective,
308
- MatComboboxDirective,
309
- MatListboxDirective,
310
- MatMagicAutocompleteDirective,
311
- BaseMatTableMagicComponent
312
- ],
313
- imports: [
314
- CommonModule,
315
- FormsModule,
316
- ...materialModules,
317
- MagicModule
318
- ]
319
- }]
320
- }], null, null); })();
321
- (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MagicAngularMaterialModule, { declarations: [MatCheckboxDirective,
322
- MatComboboxDirective,
323
- MatListboxDirective,
324
- MatMagicAutocompleteDirective,
325
- BaseMatTableMagicComponent], imports: [CommonModule,
326
- FormsModule, MatTableModule,
327
- MatPaginatorModule,
328
- MatInputModule,
329
- MatButtonModule,
330
- MatListModule,
331
- MatCheckboxModule,
332
- MatTabsModule,
333
- MatSelectModule,
334
- MatDatepickerModule,
335
- MatNativeDateModule, MagicModule], exports: [MatCheckboxDirective,
336
- MatComboboxDirective,
337
- MatListboxDirective,
338
- MatMagicAutocompleteDirective,
380
+ const materialModules = [
381
+ MatTableModule,
382
+ MatPaginatorModule,
383
+ MatInputModule,
384
+ MatButtonModule,
385
+ MatListModule,
386
+ MatCheckboxModule,
387
+ MatTabsModule,
388
+ MatSelectModule,
389
+ MatDatepickerModule,
390
+ MatNativeDateModule,
391
+ ];
392
+ class MagicAngularMaterialModule {
393
+ static ɵfac = function MagicAngularMaterialModule_Factory(t) { return new (t || MagicAngularMaterialModule)(); };
394
+ static ɵmod = i0.ɵɵdefineNgModule({ type: MagicAngularMaterialModule });
395
+ static ɵinj = i0.ɵɵdefineInjector({ imports: [CommonModule,
396
+ FormsModule, materialModules, MagicModule] });
397
+ }
398
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MagicAngularMaterialModule, [{
399
+ type: NgModule,
400
+ args: [{
401
+ declarations: [
402
+ MatCheckboxDirective,
403
+ MatComboboxDirective,
404
+ MatListboxDirective,
405
+ MatMagicAutocompleteDirective,
406
+ BaseMatTableMagicComponent,
407
+ ],
408
+ exports: [
409
+ MatCheckboxDirective,
410
+ MatComboboxDirective,
411
+ MatListboxDirective,
412
+ MatMagicAutocompleteDirective,
413
+ BaseMatTableMagicComponent
414
+ ],
415
+ imports: [
416
+ CommonModule,
417
+ FormsModule,
418
+ ...materialModules,
419
+ MagicModule
420
+ ]
421
+ }]
422
+ }], null, null); })();
423
+ (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MagicAngularMaterialModule, { declarations: [MatCheckboxDirective,
424
+ MatComboboxDirective,
425
+ MatListboxDirective,
426
+ MatMagicAutocompleteDirective,
427
+ BaseMatTableMagicComponent], imports: [CommonModule,
428
+ FormsModule, MatTableModule,
429
+ MatPaginatorModule,
430
+ MatInputModule,
431
+ MatButtonModule,
432
+ MatListModule,
433
+ MatCheckboxModule,
434
+ MatTabsModule,
435
+ MatSelectModule,
436
+ MatDatepickerModule,
437
+ MatNativeDateModule, MagicModule], exports: [MatCheckboxDirective,
438
+ MatComboboxDirective,
439
+ MatListboxDirective,
440
+ MatMagicAutocompleteDirective,
339
441
  BaseMatTableMagicComponent] }); })();
340
442
 
341
443
  export { BaseMatTableMagicComponent, MagicAngularMaterialModule, MatCheckboxDirective, MatComboboxDirective, MatListboxDirective, MatMagicAutocompleteDirective, MgMatTableService, matMagicProviders, materialModules };