@magic-xpa/angular-material-core 4.801.0-dev481.243 → 4.801.0-dev481.249

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 (29) hide show
  1. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/{esm2015/magic-xpa-angular-material-core.js → esm2020/magic-xpa-angular-material-core.mjs} +0 -0
  3. package/esm2020/src/angular-material.module.mjs +90 -0
  4. package/{esm2015/src/components/base-mat-table-magic.component.js → esm2020/src/components/base-mat-table-magic.component.mjs} +5 -5
  5. package/{esm2015/src/directives/magic/form-controls/mat-magic-autocomplete.directive.js → esm2020/src/directives/magic/form-controls/mat-magic-autocomplete.directive.mjs} +2 -2
  6. package/esm2020/src/directives/magic/form-controls/mat-magic-checkbox.directive.mjs +16 -0
  7. package/{esm2015/src/directives/magic/form-controls/mat-magic-combobox.directive.js → esm2020/src/directives/magic/form-controls/mat-magic-combobox.directive.mjs} +3 -4
  8. package/{esm2015/src/directives/magic/form-controls/mat-magic-listbox.directive.js → esm2020/src/directives/magic/form-controls/mat-magic-listbox.directive.mjs} +2 -2
  9. package/{esm2015/src/services/mat.magic.providers.js → esm2020/src/services/mat.magic.providers.mjs} +0 -0
  10. package/{esm2015/src/services/mattable.magic.service.js → esm2020/src/services/mattable.magic.service.mjs} +2 -2
  11. package/fesm2015/magic-xpa-angular-material-core.mjs +370 -0
  12. package/fesm2015/magic-xpa-angular-material-core.mjs.map +1 -0
  13. package/{fesm2015/magic-xpa-angular-material-core.js → fesm2020/magic-xpa-angular-material-core.mjs} +62 -63
  14. package/fesm2020/magic-xpa-angular-material-core.mjs.map +1 -0
  15. package/package.json +22 -9
  16. package/src/angular-material.module.d.ts +4 -6
  17. package/src/components/base-mat-table-magic.component.d.ts +2 -2
  18. package/src/directives/magic/form-controls/mat-magic-autocomplete.directive.d.ts +2 -2
  19. package/src/directives/magic/form-controls/mat-magic-checkbox.directive.d.ts +2 -2
  20. package/src/directives/magic/form-controls/mat-magic-combobox.directive.d.ts +2 -2
  21. package/src/directives/magic/form-controls/mat-magic-listbox.directive.d.ts +2 -2
  22. package/src/services/mattable.magic.service.d.ts +2 -2
  23. package/bundles/magic-xpa-angular-material-core.umd.js +0 -691
  24. package/bundles/magic-xpa-angular-material-core.umd.js.map +0 -1
  25. package/bundles/magic-xpa-angular-material-core.umd.min.js +0 -16
  26. package/bundles/magic-xpa-angular-material-core.umd.min.js.map +0 -1
  27. package/esm2015/src/angular-material.module.js +0 -94
  28. package/esm2015/src/directives/magic/form-controls/mat-magic-checkbox.directive.js +0 -17
  29. package/fesm2015/magic-xpa-angular-material-core.js.map +0 -1
@@ -1,691 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@magic-xpa/angular'), require('@angular/material/sort'), require('@angular/material/table'), require('@angular/cdk/collections'), require('@magic-xpa/engine'), require('@magic-xpa/mscorelib'), require('@angular/material/paginator'), require('@angular/material/dialog'), require('@angular/material/input'), require('@angular/material/button'), require('@angular/material/list'), require('@angular/material/checkbox'), require('@angular/material/tabs'), require('@angular/material/select'), require('@angular/material/datepicker'), require('@angular/material/core')) :
3
- typeof define === 'function' && define.amd ? define('@magic-xpa/angular-material-core', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@magic-xpa/angular', '@angular/material/sort', '@angular/material/table', '@angular/cdk/collections', '@magic-xpa/engine', '@magic-xpa/mscorelib', '@angular/material/paginator', '@angular/material/dialog', '@angular/material/input', '@angular/material/button', '@angular/material/list', '@angular/material/checkbox', '@angular/material/tabs', '@angular/material/select', '@angular/material/datepicker', '@angular/material/core'], factory) :
4
- (global = global || self, factory((global['magic-xpa'] = global['magic-xpa'] || {}, global['magic-xpa']['angular-material-core'] = {}), global.ng.core, global.ng.common, global.ng.forms, global.i1, global.ng.material.sort, global.ng.material.table, global.ng.cdk.collections, global.engine, global.mscorelib, global.ng.material.paginator, global.ng.material.dialog, global.ng.material.input, global.ng.material.button, global.ng.material.list, global.ng.material.checkbox, global.ng.material.tabs, global.ng.material.select, global.ng.material.datepicker, global.ng.material.core));
5
- }(this, (function (exports, i0, common, forms, i1, sort, table, collections, engine, mscorelib, paginator, i1$1, input, button, list, checkbox, tabs, select, datepicker, core) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (b.hasOwnProperty(p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
- var __assign = function () {
36
- __assign = Object.assign || function __assign(t) {
37
- for (var s, i = 1, n = arguments.length; i < n; i++) {
38
- s = arguments[i];
39
- for (var p in s)
40
- if (Object.prototype.hasOwnProperty.call(s, p))
41
- t[p] = s[p];
42
- }
43
- return t;
44
- };
45
- return __assign.apply(this, arguments);
46
- };
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s)
50
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- }
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
- r = Reflect.decorate(decorators, target, key, desc);
63
- else
64
- for (var i = decorators.length - 1; i >= 0; i--)
65
- if (d = decorators[i])
66
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
- return c > 3 && r && Object.defineProperty(target, key, r), r;
68
- }
69
- function __param(paramIndex, decorator) {
70
- return function (target, key) { decorator(target, key, paramIndex); };
71
- }
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
- return Reflect.metadata(metadataKey, metadataValue);
75
- }
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
- return new (P || (P = Promise))(function (resolve, reject) {
79
- function fulfilled(value) { try {
80
- step(generator.next(value));
81
- }
82
- catch (e) {
83
- reject(e);
84
- } }
85
- function rejected(value) { try {
86
- step(generator["throw"](value));
87
- }
88
- catch (e) {
89
- reject(e);
90
- } }
91
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
- step((generator = generator.apply(thisArg, _arguments || [])).next());
93
- });
94
- }
95
- function __generator(thisArg, body) {
96
- var _ = { label: 0, sent: function () { if (t[0] & 1)
97
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
98
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
99
- function verb(n) { return function (v) { return step([n, v]); }; }
100
- function step(op) {
101
- if (f)
102
- throw new TypeError("Generator is already executing.");
103
- while (_)
104
- try {
105
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
106
- return t;
107
- if (y = 0, t)
108
- op = [op[0] & 2, t.value];
109
- switch (op[0]) {
110
- case 0:
111
- case 1:
112
- t = op;
113
- break;
114
- case 4:
115
- _.label++;
116
- return { value: op[1], done: false };
117
- case 5:
118
- _.label++;
119
- y = op[1];
120
- op = [0];
121
- continue;
122
- case 7:
123
- op = _.ops.pop();
124
- _.trys.pop();
125
- continue;
126
- default:
127
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
128
- _ = 0;
129
- continue;
130
- }
131
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
132
- _.label = op[1];
133
- break;
134
- }
135
- if (op[0] === 6 && _.label < t[1]) {
136
- _.label = t[1];
137
- t = op;
138
- break;
139
- }
140
- if (t && _.label < t[2]) {
141
- _.label = t[2];
142
- _.ops.push(op);
143
- break;
144
- }
145
- if (t[2])
146
- _.ops.pop();
147
- _.trys.pop();
148
- continue;
149
- }
150
- op = body.call(thisArg, _);
151
- }
152
- catch (e) {
153
- op = [6, e];
154
- y = 0;
155
- }
156
- finally {
157
- f = t = 0;
158
- }
159
- if (op[0] & 5)
160
- throw op[1];
161
- return { value: op[0] ? op[1] : void 0, done: true };
162
- }
163
- }
164
- function __createBinding(o, m, k, k2) {
165
- if (k2 === undefined)
166
- k2 = k;
167
- o[k2] = m[k];
168
- }
169
- function __exportStar(m, exports) {
170
- for (var p in m)
171
- if (p !== "default" && !exports.hasOwnProperty(p))
172
- exports[p] = m[p];
173
- }
174
- function __values(o) {
175
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
176
- if (m)
177
- return m.call(o);
178
- if (o && typeof o.length === "number")
179
- return {
180
- next: function () {
181
- if (o && i >= o.length)
182
- o = void 0;
183
- return { value: o && o[i++], done: !o };
184
- }
185
- };
186
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
187
- }
188
- function __read(o, n) {
189
- var m = typeof Symbol === "function" && o[Symbol.iterator];
190
- if (!m)
191
- return o;
192
- var i = m.call(o), r, ar = [], e;
193
- try {
194
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
195
- ar.push(r.value);
196
- }
197
- catch (error) {
198
- e = { error: error };
199
- }
200
- finally {
201
- try {
202
- if (r && !r.done && (m = i["return"]))
203
- m.call(i);
204
- }
205
- finally {
206
- if (e)
207
- throw e.error;
208
- }
209
- }
210
- return ar;
211
- }
212
- function __spread() {
213
- for (var ar = [], i = 0; i < arguments.length; i++)
214
- ar = ar.concat(__read(arguments[i]));
215
- return ar;
216
- }
217
- function __spreadArrays() {
218
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
219
- s += arguments[i].length;
220
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
221
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
222
- r[k] = a[j];
223
- return r;
224
- }
225
- ;
226
- function __await(v) {
227
- return this instanceof __await ? (this.v = v, this) : new __await(v);
228
- }
229
- function __asyncGenerator(thisArg, _arguments, generator) {
230
- if (!Symbol.asyncIterator)
231
- throw new TypeError("Symbol.asyncIterator is not defined.");
232
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
233
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
234
- function verb(n) { if (g[n])
235
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
236
- function resume(n, v) { try {
237
- step(g[n](v));
238
- }
239
- catch (e) {
240
- settle(q[0][3], e);
241
- } }
242
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
243
- function fulfill(value) { resume("next", value); }
244
- function reject(value) { resume("throw", value); }
245
- function settle(f, v) { if (f(v), q.shift(), q.length)
246
- resume(q[0][0], q[0][1]); }
247
- }
248
- function __asyncDelegator(o) {
249
- var i, p;
250
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
251
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
252
- }
253
- function __asyncValues(o) {
254
- if (!Symbol.asyncIterator)
255
- throw new TypeError("Symbol.asyncIterator is not defined.");
256
- var m = o[Symbol.asyncIterator], i;
257
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
258
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
259
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
260
- }
261
- function __makeTemplateObject(cooked, raw) {
262
- if (Object.defineProperty) {
263
- Object.defineProperty(cooked, "raw", { value: raw });
264
- }
265
- else {
266
- cooked.raw = raw;
267
- }
268
- return cooked;
269
- }
270
- ;
271
- function __importStar(mod) {
272
- if (mod && mod.__esModule)
273
- return mod;
274
- var result = {};
275
- if (mod != null)
276
- for (var k in mod)
277
- if (Object.hasOwnProperty.call(mod, k))
278
- result[k] = mod[k];
279
- result.default = mod;
280
- return result;
281
- }
282
- function __importDefault(mod) {
283
- return (mod && mod.__esModule) ? mod : { default: mod };
284
- }
285
- function __classPrivateFieldGet(receiver, privateMap) {
286
- if (!privateMap.has(receiver)) {
287
- throw new TypeError("attempted to get private field on non-instance");
288
- }
289
- return privateMap.get(receiver);
290
- }
291
- function __classPrivateFieldSet(receiver, privateMap, value) {
292
- if (!privateMap.has(receiver)) {
293
- throw new TypeError("attempted to set private field on non-instance");
294
- }
295
- privateMap.set(receiver, value);
296
- return value;
297
- }
298
-
299
- var MatCheckboxDirective = /** @class */ (function (_super) {
300
- __extends(MatCheckboxDirective, _super);
301
- function MatCheckboxDirective() {
302
- return _super !== null && _super.apply(this, arguments) || this;
303
- }
304
- return MatCheckboxDirective;
305
- }(i1.CheckboxMagicDirective));
306
- MatCheckboxDirective.ɵfac = function MatCheckboxDirective_Factory(t) { return ɵMatCheckboxDirective_BaseFactory(t || MatCheckboxDirective); };
307
- MatCheckboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatCheckboxDirective, selectors: [["mat-checkbox", "magic", "", 3, "noFormControl", ""]], features: [i0.ɵɵInheritDefinitionFeature] });
308
- var ɵMatCheckboxDirective_BaseFactory = i0.ɵɵgetInheritedFactory(MatCheckboxDirective);
309
- (function () {
310
- i0.ɵsetClassMetadata(MatCheckboxDirective, [{
311
- type: i0.Directive,
312
- args: [{
313
- selector: "\n mat-checkbox[magic]:not([noFormControl])\n ",
314
- }]
315
- }], null, null);
316
- })();
317
-
318
- var MatComboboxDirective = /** @class */ (function (_super) {
319
- __extends(MatComboboxDirective, _super);
320
- function MatComboboxDirective() {
321
- return _super !== null && _super.apply(this, arguments) || this;
322
- }
323
- MatComboboxDirective.prototype.onChange = function ($event) {
324
- _super.prototype.onChange.call(this, $event);
325
- };
326
- MatComboboxDirective.prototype.onOpenedChanged = function ($event) {
327
- i1.MagicDirective.opened = $event;
328
- };
329
- return MatComboboxDirective;
330
- }(i1.ComboboxMagicDirective));
331
- MatComboboxDirective.ɵfac = function MatComboboxDirective_Factory(t) { return ɵMatComboboxDirective_BaseFactory(t || MatComboboxDirective); };
332
- MatComboboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatComboboxDirective, selectors: [["mat-select", "magic", ""]], hostBindings: function MatComboboxDirective_HostBindings(rf, ctx) {
333
- if (rf & 1) {
334
- i0.ɵɵlistener("selectionChange", function MatComboboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); })("openedChange", function MatComboboxDirective_openedChange_HostBindingHandler($event) { return ctx.onOpenedChanged($event); });
335
- }
336
- }, features: [i0.ɵɵInheritDefinitionFeature] });
337
- var ɵMatComboboxDirective_BaseFactory = i0.ɵɵgetInheritedFactory(MatComboboxDirective);
338
- (function () {
339
- i0.ɵsetClassMetadata(MatComboboxDirective, [{
340
- type: i0.Directive,
341
- args: [{
342
- selector: "mat-select[magic]",
343
- }]
344
- }], null, { onChange: [{
345
- type: i0.HostListener,
346
- args: ['selectionChange', ['$event']]
347
- }], onOpenedChanged: [{
348
- type: i0.HostListener,
349
- args: ['openedChange', ['$event']]
350
- }] });
351
- })();
352
-
353
- var MgMatTableService = /** @class */ (function (_super) {
354
- __extends(MgMatTableService, _super);
355
- function MgMatTableService(componentList, task) {
356
- var _this = _super.call(this, componentList, task) || this;
357
- _this.componentList = componentList;
358
- _this.task = task;
359
- return _this;
360
- }
361
- Object.defineProperty(MgMatTableService.prototype, "DataSource", {
362
- get: function () {
363
- return this.dataSource;
364
- },
365
- set: function (dataSource) {
366
- this.dataSource = dataSource;
367
- },
368
- enumerable: false,
369
- configurable: true
370
- });
371
- Object.defineProperty(MgMatTableService.prototype, "Selection", {
372
- get: function () {
373
- return this.selection;
374
- },
375
- set: function (selection) {
376
- this.selection = selection;
377
- },
378
- enumerable: false,
379
- configurable: true
380
- });
381
- Object.defineProperty(MgMatTableService.prototype, "Paginator", {
382
- get: function () {
383
- return this.paginator;
384
- },
385
- set: function (paginator) {
386
- this.paginator = paginator;
387
- },
388
- enumerable: false,
389
- configurable: true
390
- });
391
- MgMatTableService.prototype.connect = function (dataSource, paginator, selection, dialog) {
392
- this.dataSource = dataSource;
393
- this.paginator = paginator;
394
- this.selection = selection;
395
- this.dialog = dialog;
396
- };
397
- MgMatTableService.prototype.refreshDataSource = function () {
398
- if (!mscorelib.isNullOrUndefined(this.paginator))
399
- this.dataSource.paginator = this.paginator;
400
- this.dataSource.data = (this.task.mgAccessorService.isDataviewEmpty() ? [] : this.task.Records.list);
401
- };
402
- MgMatTableService.prototype.getPageSize = function () {
403
- if (mscorelib.isNullOrUndefined(this.paginator))
404
- return _super.prototype.getPageSize.call(this);
405
- return this.paginator.pageSize;
406
- };
407
- MgMatTableService.prototype.selectRow = function (guiRowid) {
408
- _super.prototype.selectRow.call(this, guiRowid);
409
- this.selection.select(this.task.Records.list[guiRowid]);
410
- this.refreshDataSource();
411
- };
412
- MgMatTableService.prototype.getDialog = function () {
413
- return this.dialog;
414
- };
415
- MgMatTableService.prototype.selectPage = function (pageId) {
416
- if (!mscorelib.isNullOrUndefined(this.paginator))
417
- this.paginator.pageIndex = pageId;
418
- this.refreshDataSource();
419
- };
420
- MgMatTableService.prototype.selectedRow = function () {
421
- return this.selection.selected[0];
422
- };
423
- MgMatTableService.prototype.mgOnPaginateChange = function (e) {
424
- if (this.task.oldPageSize != e.pageSize) {
425
- this.handleResize(e.pageIndex, e.previousPageIndex, e.pageSize);
426
- this.task.oldPageSize = e.pageSize;
427
- }
428
- else
429
- this.getRowsIfNeeded(e.pageIndex, e.previousPageIndex, e.pageSize);
430
- };
431
- MgMatTableService.prototype.handleResize = function (pageIndex, prevPageIndex, pageSize) {
432
- var requiredGuiRowId = pageIndex * pageSize;
433
- this.task.resize(pageSize, requiredGuiRowId);
434
- };
435
- MgMatTableService.prototype.getRowsIfNeeded = function (pageIndex, prevPageIndex, pageSize) {
436
- var guiEvent = engine.getGuiEventObj("getRows", "table", 0);
437
- guiEvent.Line = pageIndex * pageSize;
438
- this.task.insertEvent(guiEvent);
439
- this.setTableTopIndex(this.task.getDvRowId(pageSize * pageIndex));
440
- };
441
- MgMatTableService.prototype.sortData = function (e) {
442
- var direction = 0;
443
- if (e.direction === 'asc')
444
- direction = 0;
445
- else if (e.direction === 'desc')
446
- direction = 1;
447
- var guiEvent = engine.getGuiEventObj("columnSort", e.active, direction);
448
- this.task.insertEvent(guiEvent);
449
- };
450
- MgMatTableService.prototype.updateTableSize = function (size) {
451
- if (size === 0) {
452
- size = 1;
453
- this.task.Records.clearFirstTableRecord(this.task.template);
454
- }
455
- else if (mscorelib.isNullOrUndefined(this.paginator))
456
- size = this.getPageSize();
457
- this.task.formGroups.length = size;
458
- this.task.Records.updateSize(size);
459
- this.task.setIncludesFirst(false);
460
- };
461
- MgMatTableService.prototype.selectPageForGuiRowId = function (guiRowId) {
462
- var pageToBeSelected = 0;
463
- var prevSelectedRow = this.selectedRow();
464
- pageToBeSelected = Math.floor(guiRowId / this.getPageSize());
465
- if ((mscorelib.isNullOrUndefined(prevSelectedRow) || (!mscorelib.isNullOrUndefined(this.paginator) && pageToBeSelected != this.paginator.pageIndex)))
466
- this.selectPage(pageToBeSelected);
467
- };
468
- MgMatTableService.prototype.setTableTopIndex = function (value) {
469
- this.task.Records.setGuiTopIndex(value);
470
- if (value >= 0)
471
- this.selectPageForGuiRowId(this.task.getGuiRowId(value, true));
472
- };
473
- MgMatTableService.prototype.getTableTopIndex = function () {
474
- return this.task.Records.getGuiTopIndex();
475
- };
476
- return MgMatTableService;
477
- }(i1.TableMagicService));
478
- MgMatTableService.ɵfac = function MgMatTableService_Factory(t) { return new (t || MgMatTableService)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i1.TaskMagicService)); };
479
- MgMatTableService.ɵprov = i0.ɵɵdefineInjectable({ token: MgMatTableService, factory: MgMatTableService.ɵfac });
480
- (function () {
481
- i0.ɵsetClassMetadata(MgMatTableService, [{
482
- type: i0.Injectable
483
- }], function () { return [{ type: i1.ComponentListMagicService }, { type: i1.TaskMagicService }]; }, null);
484
- })();
485
-
486
- var matMagicProviders = __spread(i1.basicMagicProviders, [
487
- { provide: i1.TableMagicService, useClass: MgMatTableService }
488
- ]);
489
-
490
- var BaseMatTableMagicComponent = /** @class */ (function (_super) {
491
- __extends(BaseMatTableMagicComponent, _super);
492
- function BaseMatTableMagicComponent(dialog, ref, magicService) {
493
- var _this = _super.call(this, ref, magicService) || this;
494
- _this.dialog = dialog;
495
- _this.ref = ref;
496
- _this.magicService = magicService;
497
- _this.displayedColumns = [];
498
- _this.dataSource = new table.MatTableDataSource(_this.task.Records.list);
499
- _this.selection = new collections.SelectionModel(false, []);
500
- return _this;
501
- }
502
- BaseMatTableMagicComponent.prototype.ngOnInit = function () {
503
- _super.prototype.ngOnInit.call(this);
504
- this.magicService.tableService.connect(this.dataSource, this.paginator, this.selection, this.dialog);
505
- };
506
- BaseMatTableMagicComponent.prototype.ngAfterContentChecked = function () {
507
- if (!mscorelib.isNullOrUndefined(this.paginator) && !mscorelib.isNullOrUndefined(this.paginator.pageSize) &&
508
- this.paginator.pageSize != this.task.oldPageSize) {
509
- this.magicService.tableService.handleResize(this.paginator.pageIndex, 0, this.paginator.pageSize);
510
- this.task.oldPageSize = this.paginator.pageSize;
511
- }
512
- };
513
- return BaseMatTableMagicComponent;
514
- }(i1.TaskBaseMagicComponent));
515
- BaseMatTableMagicComponent.ɵfac = function BaseMatTableMagicComponent_Factory(t) { return new (t || BaseMatTableMagicComponent)(i0.ɵɵdirectiveInject(i1$1.MatDialog), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.MagicServices)); };
516
- BaseMatTableMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMatTableMagicComponent, selectors: [["ng-component"]], viewQuery: function BaseMatTableMagicComponent_Query(rf, ctx) {
517
- if (rf & 1) {
518
- i0.ɵɵstaticViewQuery(paginator.MatPaginator, true);
519
- i0.ɵɵstaticViewQuery(sort.MatSort, true);
520
- }
521
- if (rf & 2) {
522
- var _t;
523
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.paginator = _t.first);
524
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.sort = _t.first);
525
- }
526
- }, features: [i0.ɵɵProvidersFeature(matMagicProviders), i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function BaseMatTableMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
527
- (function () {
528
- i0.ɵsetClassMetadata(BaseMatTableMagicComponent, [{
529
- type: i0.Component,
530
- args: [{
531
- providers: matMagicProviders,
532
- template: ''
533
- }]
534
- }], function () { return [{ type: i1$1.MatDialog }, { type: i0.ChangeDetectorRef }, { type: i1.MagicServices }]; }, { paginator: [{
535
- type: i0.ViewChild,
536
- args: [paginator.MatPaginator, { static: true }]
537
- }], sort: [{
538
- type: i0.ViewChild,
539
- args: [sort.MatSort, { static: true }]
540
- }] });
541
- })();
542
-
543
- var MatListboxDirective = /** @class */ (function () {
544
- function MatListboxDirective(magicDirective) {
545
- this.magicDirective = magicDirective;
546
- }
547
- MatListboxDirective.prototype.onChange = function ($event) {
548
- this.magicDirective.task.onListBoxSelectionChanged($event, this.magicDirective.id);
549
- };
550
- return MatListboxDirective;
551
- }());
552
- MatListboxDirective.ɵfac = function MatListboxDirective_Factory(t) { return new (t || MatListboxDirective)(i0.ɵɵdirectiveInject(i1.MagicDirective)); };
553
- MatListboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatListboxDirective, selectors: [["mat-selection-list", "magic", ""]], hostBindings: function MatListboxDirective_HostBindings(rf, ctx) {
554
- if (rf & 1) {
555
- i0.ɵɵlistener("selectionChange", function MatListboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); });
556
- }
557
- } });
558
- (function () {
559
- i0.ɵsetClassMetadata(MatListboxDirective, [{
560
- type: i0.Directive,
561
- args: [{
562
- selector: "mat-selection-list[magic]",
563
- }]
564
- }], function () { return [{ type: i1.MagicDirective }]; }, { onChange: [{
565
- type: i0.HostListener,
566
- args: ['selectionChange', ['$event']]
567
- }] });
568
- })();
569
-
570
- var MatMagicAutocompleteDirective = /** @class */ (function () {
571
- function MatMagicAutocompleteDirective() {
572
- }
573
- MatMagicAutocompleteDirective.prototype.onOpenedChanged = function ($event) {
574
- i1.MagicDirective.noOfAutoCompleteBoxesOpened++;
575
- };
576
- MatMagicAutocompleteDirective.prototype.onClosedChanged = function ($event) {
577
- i1.MagicDirective.noOfAutoCompleteBoxesOpened--;
578
- };
579
- return MatMagicAutocompleteDirective;
580
- }());
581
- MatMagicAutocompleteDirective.ɵfac = function MatMagicAutocompleteDirective_Factory(t) { return new (t || MatMagicAutocompleteDirective)(); };
582
- MatMagicAutocompleteDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatMagicAutocompleteDirective, selectors: [["mat-autocomplete", "magic", ""]], hostBindings: function MatMagicAutocompleteDirective_HostBindings(rf, ctx) {
583
- if (rf & 1) {
584
- i0.ɵɵlistener("opened", function MatMagicAutocompleteDirective_opened_HostBindingHandler($event) { return ctx.onOpenedChanged($event); })("closed", function MatMagicAutocompleteDirective_closed_HostBindingHandler($event) { return ctx.onClosedChanged($event); });
585
- }
586
- } });
587
- (function () {
588
- i0.ɵsetClassMetadata(MatMagicAutocompleteDirective, [{
589
- type: i0.Directive,
590
- args: [{
591
- selector: 'mat-autocomplete[magic]'
592
- }]
593
- }], null, { onOpenedChanged: [{
594
- type: i0.HostListener,
595
- args: ['opened', ['$event']]
596
- }], onClosedChanged: [{
597
- type: i0.HostListener,
598
- args: ['closed', ['$event']]
599
- }] });
600
- })();
601
-
602
- var materialModules = [
603
- table.MatTableModule,
604
- paginator.MatPaginatorModule,
605
- input.MatInputModule,
606
- button.MatButtonModule,
607
- list.MatListModule,
608
- checkbox.MatCheckboxModule,
609
- tabs.MatTabsModule,
610
- select.MatSelectModule,
611
- datepicker.MatDatepickerModule,
612
- core.MatNativeDateModule,
613
- i1$1.MatDialogModule
614
- ];
615
- var MagicAngularMaterialModule = /** @class */ (function () {
616
- function MagicAngularMaterialModule(componentList, matdialog) {
617
- componentList.dialogs.set('MatDialog', matdialog);
618
- }
619
- return MagicAngularMaterialModule;
620
- }());
621
- MagicAngularMaterialModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicAngularMaterialModule });
622
- MagicAngularMaterialModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MagicAngularMaterialModule_Factory(t) { return new (t || MagicAngularMaterialModule)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i1$1.MatDialog)); }, imports: [__spread([
623
- common.CommonModule,
624
- forms.FormsModule
625
- ], materialModules, [
626
- i1.MagicModule
627
- ])] });
628
- (function () {
629
- (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(MagicAngularMaterialModule, { declarations: [MatCheckboxDirective,
630
- MatComboboxDirective,
631
- MatListboxDirective,
632
- MatMagicAutocompleteDirective,
633
- BaseMatTableMagicComponent], imports: [common.CommonModule,
634
- forms.FormsModule, table.MatTableModule,
635
- paginator.MatPaginatorModule,
636
- input.MatInputModule,
637
- button.MatButtonModule,
638
- list.MatListModule,
639
- checkbox.MatCheckboxModule,
640
- tabs.MatTabsModule,
641
- select.MatSelectModule,
642
- datepicker.MatDatepickerModule,
643
- core.MatNativeDateModule,
644
- i1$1.MatDialogModule, i1.MagicModule], exports: [MatCheckboxDirective,
645
- MatComboboxDirective,
646
- MatListboxDirective,
647
- MatMagicAutocompleteDirective,
648
- BaseMatTableMagicComponent] });
649
- })();
650
- (function () {
651
- i0.ɵsetClassMetadata(MagicAngularMaterialModule, [{
652
- type: i0.NgModule,
653
- args: [{
654
- declarations: [
655
- MatCheckboxDirective,
656
- MatComboboxDirective,
657
- MatListboxDirective,
658
- MatMagicAutocompleteDirective,
659
- BaseMatTableMagicComponent,
660
- ],
661
- exports: [
662
- MatCheckboxDirective,
663
- MatComboboxDirective,
664
- MatListboxDirective,
665
- MatMagicAutocompleteDirective,
666
- BaseMatTableMagicComponent
667
- ],
668
- imports: __spread([
669
- common.CommonModule,
670
- forms.FormsModule
671
- ], materialModules, [
672
- i1.MagicModule
673
- ])
674
- }]
675
- }], function () { return [{ type: i1.ComponentListMagicService }, { type: i1$1.MatDialog }]; }, null);
676
- })();
677
-
678
- exports.BaseMatTableMagicComponent = BaseMatTableMagicComponent;
679
- exports.MagicAngularMaterialModule = MagicAngularMaterialModule;
680
- exports.MatCheckboxDirective = MatCheckboxDirective;
681
- exports.MatComboboxDirective = MatComboboxDirective;
682
- exports.MatListboxDirective = MatListboxDirective;
683
- exports.MatMagicAutocompleteDirective = MatMagicAutocompleteDirective;
684
- exports.MgMatTableService = MgMatTableService;
685
- exports.matMagicProviders = matMagicProviders;
686
- exports.materialModules = materialModules;
687
-
688
- Object.defineProperty(exports, '__esModule', { value: true });
689
-
690
- })));
691
- //# sourceMappingURL=magic-xpa-angular-material-core.umd.js.map