@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.
- package/README.md +7 -7
- package/esm2022/index.mjs +9 -0
- package/{esm2020 → esm2022}/magic-xpa-angular-material-core.mjs +1 -1
- package/{esm2020 → esm2022}/src/angular-material.module.mjs +83 -83
- package/esm2022/src/components/base-mat-table-magic.component.mjs +62 -0
- package/esm2022/src/directives/magic/form-controls/mat-magic-autocomplete.directive.mjs +28 -0
- package/esm2022/src/directives/magic/form-controls/mat-magic-checkbox.directive.mjs +101 -0
- package/esm2022/src/directives/magic/form-controls/mat-magic-combobox.directive.mjs +30 -0
- package/esm2022/src/directives/magic/form-controls/mat-magic-listbox.directive.mjs +27 -0
- package/{esm2020 → esm2022}/src/services/mat.magic.providers.mjs +6 -6
- package/esm2022/src/services/mattable.magic.service.mjs +138 -0
- package/{fesm2020 → fesm2022}/magic-xpa-angular-material-core.mjs +409 -307
- package/fesm2022/magic-xpa-angular-material-core.mjs.map +1 -0
- package/index.d.ts +8 -8
- package/package.json +10 -16
- package/src/angular-material.module.d.ts +26 -26
- package/src/components/base-mat-table-magic.component.d.ts +19 -19
- package/src/directives/magic/form-controls/mat-magic-autocomplete.directive.d.ts +7 -7
- package/src/directives/magic/form-controls/mat-magic-checkbox.directive.d.ts +23 -6
- package/src/directives/magic/form-controls/mat-magic-combobox.directive.d.ts +9 -9
- package/src/directives/magic/form-controls/mat-magic-listbox.directive.d.ts +9 -9
- package/src/services/mat.magic.providers.d.ts +38 -38
- package/src/services/mattable.magic.service.d.ts +36 -36
- package/esm2020/index.mjs +0 -9
- package/esm2020/src/components/base-mat-table-magic.component.mjs +0 -54
- package/esm2020/src/directives/magic/form-controls/mat-magic-autocomplete.directive.mjs +0 -28
- package/esm2020/src/directives/magic/form-controls/mat-magic-checkbox.directive.mjs +0 -16
- package/esm2020/src/directives/magic/form-controls/mat-magic-combobox.directive.mjs +0 -30
- package/esm2020/src/directives/magic/form-controls/mat-magic-listbox.directive.mjs +0 -26
- package/esm2020/src/services/mattable.magic.service.mjs +0 -127
- package/fesm2015/magic-xpa-angular-material-core.mjs +0 -367
- package/fesm2015/magic-xpa-angular-material-core.mjs.map +0 -1
- 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 {
|
|
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
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
}],
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
(
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.dataSource
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
this.
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.
|
|
89
|
-
this.
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (isNullOrUndefined(this.paginator))
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
this.
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
this.refreshDataSource();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
let guiEvent = getGuiEventObj("
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
this.task.
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
this.task.Records.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
(
|
|
179
|
-
|
|
180
|
-
|
|
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
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
this.magicService
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
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
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
(
|
|
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
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
(
|
|
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 };
|