@magic-xpa/angular-material-core 4.800.0-dev480.20 → 4.800.0-dev480.200

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 (24) hide show
  1. package/bundles/magic-xpa-angular-material-core.umd.js +21 -152
  2. package/bundles/magic-xpa-angular-material-core.umd.js.map +1 -1
  3. package/bundles/magic-xpa-angular-material-core.umd.min.js +2 -2
  4. package/bundles/magic-xpa-angular-material-core.umd.min.js.map +1 -1
  5. package/esm2015/index.js +1 -1
  6. package/esm2015/magic-xpa-angular-material-core.js +1 -4
  7. package/esm2015/src/angular-material.module.js +4 -10
  8. package/esm2015/src/components/base-mat-table-magic.component.js +4 -16
  9. package/esm2015/src/directives/magic/form-controls/mat-magic-checkbox.directive.js +5 -8
  10. package/esm2015/src/directives/magic/form-controls/mat-magic-combobox.directive.js +5 -12
  11. package/esm2015/src/directives/magic/form-controls/mat-magic-listbox.directive.js +4 -11
  12. package/esm2015/src/services/mat.magic.providers.js +1 -4
  13. package/esm2015/src/services/mattable.magic.service.js +5 -94
  14. package/fesm2015/magic-xpa-angular-material-core.js +21 -152
  15. package/fesm2015/magic-xpa-angular-material-core.js.map +1 -1
  16. package/magic-xpa-angular-material-core.d.ts +0 -3
  17. package/package.json +2 -2
  18. package/src/angular-material.module.d.ts +0 -6
  19. package/src/components/base-mat-table-magic.component.d.ts +0 -27
  20. package/src/directives/magic/form-controls/mat-magic-checkbox.directive.d.ts +0 -3
  21. package/src/directives/magic/form-controls/mat-magic-combobox.directive.d.ts +0 -7
  22. package/src/directives/magic/form-controls/mat-magic-listbox.directive.d.ts +0 -7
  23. package/src/services/mat.magic.providers.d.ts +0 -3
  24. package/src/services/mattable.magic.service.d.ts +0 -99
@@ -296,9 +296,6 @@
296
296
  return value;
297
297
  }
298
298
 
299
- /**
300
- * Directive for material-design checkboxes not on material-design table
301
- */
302
299
  var MatCheckboxDirective = /** @class */ (function (_super) {
303
300
  __extends(MatCheckboxDirective, _super);
304
301
  function MatCheckboxDirective() {
@@ -306,10 +303,10 @@
306
303
  }
307
304
  return MatCheckboxDirective;
308
305
  }(i1.CheckboxMagicDirective));
309
- /** @nocollapse */ MatCheckboxDirective.ɵfac = function MatCheckboxDirective_Factory(t) { return ɵMatCheckboxDirective_BaseFactory(t || MatCheckboxDirective); };
310
- /** @nocollapse */ MatCheckboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatCheckboxDirective, selectors: [["mat-checkbox", "magic", "", 3, "noFormControl", ""]], features: [i0.ɵɵInheritDefinitionFeature] });
311
- var ɵMatCheckboxDirective_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(MatCheckboxDirective);
312
- /*@__PURE__*/ (function () {
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 () {
313
310
  i0.ɵsetClassMetadata(MatCheckboxDirective, [{
314
311
  type: i0.Directive,
315
312
  args: [{
@@ -318,18 +315,11 @@
318
315
  }], null, null);
319
316
  })();
320
317
 
321
- /**
322
- * Directive for material-design comboboxes not on material-design table
323
- */
324
318
  var MatComboboxDirective = /** @class */ (function (_super) {
325
319
  __extends(MatComboboxDirective, _super);
326
320
  function MatComboboxDirective() {
327
321
  return _super !== null && _super.apply(this, arguments) || this;
328
322
  }
329
- /**
330
- * Handles the "selectionChange" event - pass it to the "change" event handler
331
- * @param $event
332
- */
333
323
  MatComboboxDirective.prototype.onChange = function ($event) {
334
324
  _super.prototype.onChange.call(this, $event);
335
325
  };
@@ -338,14 +328,14 @@
338
328
  };
339
329
  return MatComboboxDirective;
340
330
  }(i1.ComboboxMagicDirective));
341
- /** @nocollapse */ MatComboboxDirective.ɵfac = function MatComboboxDirective_Factory(t) { return ɵMatComboboxDirective_BaseFactory(t || MatComboboxDirective); };
342
- /** @nocollapse */ MatComboboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatComboboxDirective, selectors: [["mat-select", "magic", ""]], hostBindings: function MatComboboxDirective_HostBindings(rf, ctx) {
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) {
343
333
  if (rf & 1) {
344
334
  i0.ɵɵlistener("selectionChange", function MatComboboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); })("openedChange", function MatComboboxDirective_openedChange_HostBindingHandler($event) { return ctx.onOpenedChanged($event); });
345
335
  }
346
336
  }, features: [i0.ɵɵInheritDefinitionFeature] });
347
- var ɵMatComboboxDirective_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(MatComboboxDirective);
348
- /*@__PURE__*/ (function () {
337
+ var ɵMatComboboxDirective_BaseFactory = i0.ɵɵgetInheritedFactory(MatComboboxDirective);
338
+ (function () {
349
339
  i0.ɵsetClassMetadata(MatComboboxDirective, [{
350
340
  type: i0.Directive,
351
341
  args: [{
@@ -360,14 +350,8 @@
360
350
  }] });
361
351
  })();
362
352
 
363
- /**
364
- * Extends the Magic table service to supply functionality for Material Design tables
365
- */
366
353
  var MgMatTableService = /** @class */ (function (_super) {
367
354
  __extends(MgMatTableService, _super);
368
- /**
369
- * @ignore
370
- */
371
355
  function MgMatTableService(componentList, task) {
372
356
  var _this = _super.call(this, componentList, task) || this;
373
357
  _this.componentList = componentList;
@@ -375,15 +359,9 @@
375
359
  return _this;
376
360
  }
377
361
  Object.defineProperty(MgMatTableService.prototype, "DataSource", {
378
- /**
379
- * @ignore
380
- */
381
362
  get: function () {
382
363
  return this.dataSource;
383
364
  },
384
- /**
385
- * @ignore
386
- */
387
365
  set: function (dataSource) {
388
366
  this.dataSource = dataSource;
389
367
  },
@@ -391,15 +369,9 @@
391
369
  configurable: true
392
370
  });
393
371
  Object.defineProperty(MgMatTableService.prototype, "Selection", {
394
- /**
395
- * @ignore
396
- */
397
372
  get: function () {
398
373
  return this.selection;
399
374
  },
400
- /**
401
- * @ignore
402
- */
403
375
  set: function (selection) {
404
376
  this.selection = selection;
405
377
  },
@@ -407,86 +379,47 @@
407
379
  configurable: true
408
380
  });
409
381
  Object.defineProperty(MgMatTableService.prototype, "Paginator", {
410
- /**
411
- * @ignore
412
- */
413
382
  get: function () {
414
383
  return this.paginator;
415
384
  },
416
- /**
417
- * @ignore
418
- */
419
385
  set: function (paginator) {
420
386
  this.paginator = paginator;
421
387
  },
422
388
  enumerable: false,
423
389
  configurable: true
424
390
  });
425
- /**
426
- * Connects the service to the elements of the table component
427
- * @param dataSource Table data source
428
- * @param paginator Table paginator
429
- * @param selection table SelectionModel
430
- * @param dialog Dialog used for editing values
431
- */
432
391
  MgMatTableService.prototype.connect = function (dataSource, paginator, selection, dialog) {
433
392
  this.dataSource = dataSource;
434
393
  this.paginator = paginator;
435
394
  this.selection = selection;
436
395
  this.dialog = dialog;
437
396
  };
438
- /**
439
- * @ignore
440
- */
441
397
  MgMatTableService.prototype.refreshDataSource = function () {
442
398
  if (!util.isNullOrUndefined(this.paginator))
443
399
  this.dataSource.paginator = this.paginator;
444
400
  this.dataSource.data = (this.task.mgAccessorService.isDataviewEmpty() ? [] : this.task.Records.list);
445
401
  };
446
- /**
447
- * returns the page size of the table
448
- * @returns
449
- */
450
402
  MgMatTableService.prototype.getPageSize = function () {
451
403
  if (util.isNullOrUndefined(this.paginator))
452
404
  return _super.prototype.getPageSize.call(this);
453
405
  return this.paginator.pageSize;
454
406
  };
455
- /**
456
- * Selects a table row
457
- * @param guiRowid Id of row to be selected
458
- */
459
407
  MgMatTableService.prototype.selectRow = function (guiRowid) {
460
408
  _super.prototype.selectRow.call(this, guiRowid);
461
409
  this.selection.select(this.task.Records.list[guiRowid]);
462
410
  this.refreshDataSource();
463
411
  };
464
- /**
465
- * @ignore
466
- */
467
412
  MgMatTableService.prototype.getDialog = function () {
468
413
  return this.dialog;
469
414
  };
470
- /**
471
- * Displays the requested table page
472
- * @param pageId Id of page to be selected
473
- */
474
415
  MgMatTableService.prototype.selectPage = function (pageId) {
475
416
  if (!util.isNullOrUndefined(this.paginator))
476
417
  this.paginator.pageIndex = pageId;
477
418
  this.refreshDataSource();
478
419
  };
479
- /**
480
- * Returns the currently seleted row
481
- * @returns
482
- */
483
420
  MgMatTableService.prototype.selectedRow = function () {
484
421
  return this.selection.selected[0];
485
422
  };
486
- /**
487
- * Handle the paginator's "page" event
488
- * @param e The event received from the UI
489
- */
490
423
  MgMatTableService.prototype.mgOnPaginateChange = function (e) {
491
424
  if (this.task.oldPageSize != e.pageSize) {
492
425
  this.handleResize(e.pageIndex, e.previousPageIndex, e.pageSize);
@@ -495,32 +428,16 @@
495
428
  else
496
429
  this.getRowsIfNeeded(e.pageIndex, e.previousPageIndex, e.pageSize);
497
430
  };
498
- /**
499
- * Handle resize and set table top index.
500
- * @param pageIndex : New page index.
501
- * @param prevPageIndex : Prev page index
502
- * @param pageSize : PageSize
503
- */
504
431
  MgMatTableService.prototype.handleResize = function (pageIndex, prevPageIndex, pageSize) {
505
432
  var requiredGuiRowId = pageIndex * pageSize;
506
433
  this.task.resize(pageSize, requiredGuiRowId);
507
434
  };
508
- /**
509
- * Execute getRows to fetch required chunk of records.
510
- * @param pageIndex : New page index.
511
- * @param prevPageIndex : Prev page index
512
- * @param pageSize : PageSize
513
- */
514
435
  MgMatTableService.prototype.getRowsIfNeeded = function (pageIndex, prevPageIndex, pageSize) {
515
436
  var guiEvent = engine.getGuiEventObj("getRows", "table", 0);
516
437
  guiEvent.Line = pageIndex * pageSize;
517
438
  this.task.insertEvent(guiEvent);
518
439
  this.setTableTopIndex(this.task.getDvRowId(pageSize * pageIndex));
519
440
  };
520
- /**
521
- * Handles the "matSortChange" event
522
- * @param e The event received from the UI
523
- */
524
441
  MgMatTableService.prototype.sortData = function (e) {
525
442
  var direction = 0;
526
443
  if (e.direction === 'asc')
@@ -530,13 +447,8 @@
530
447
  var guiEvent = engine.getGuiEventObj("columnSort", e.active, direction);
531
448
  this.task.insertEvent(guiEvent);
532
449
  };
533
- /**
534
- * Change the number of lines in a table
535
- * @param size New number of lines in table
536
- */
537
450
  MgMatTableService.prototype.updateTableSize = function (size) {
538
- if (size === 0) // never remove row 0 for now
539
- {
451
+ if (size === 0) {
540
452
  size = 1;
541
453
  this.task.Records.clearFirstTableRecord(this.task.template);
542
454
  }
@@ -546,57 +458,37 @@
546
458
  this.task.Records.updateSize(size);
547
459
  this.task.setIncludesFirst(false);
548
460
  };
549
- /**
550
- * Handle the selection of row and if needed move to respective page.
551
- * @param guiRowId New number of lines in table
552
- */
553
461
  MgMatTableService.prototype.selectPageForGuiRowId = function (guiRowId) {
554
462
  var pageToBeSelected = 0;
555
463
  var prevSelectedRow = this.selectedRow();
556
464
  pageToBeSelected = Math.floor(guiRowId / this.getPageSize());
557
- // Explicitly handle selection of page when it's not raised by using pagination
558
465
  if ((util.isNullOrUndefined(prevSelectedRow) || (!util.isNullOrUndefined(this.paginator) && pageToBeSelected != this.paginator.pageIndex)))
559
466
  this.selectPage(pageToBeSelected);
560
467
  };
561
- /**
562
- * @ignore
563
- */
564
468
  MgMatTableService.prototype.setTableTopIndex = function (value) {
565
469
  this.task.Records.setGuiTopIndex(value);
566
470
  if (value >= 0)
567
471
  this.selectPageForGuiRowId(this.task.getGuiRowId(value, true));
568
472
  };
569
- /**
570
- * @ignore
571
- */
572
473
  MgMatTableService.prototype.getTableTopIndex = function () {
573
474
  return this.task.Records.getGuiTopIndex();
574
475
  };
575
476
  return MgMatTableService;
576
477
  }(i1.TableMagicService));
577
- /** @nocollapse */ MgMatTableService.ɵfac = function MgMatTableService_Factory(t) { return new (t || MgMatTableService)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i1.TaskMagicService)); };
578
- /** @nocollapse */ MgMatTableService.ɵprov = i0.ɵɵdefineInjectable({ token: MgMatTableService, factory: MgMatTableService.ɵfac });
579
- /*@__PURE__*/ (function () {
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 () {
580
481
  i0.ɵsetClassMetadata(MgMatTableService, [{
581
482
  type: i0.Injectable
582
483
  }], function () { return [{ type: i1.ComponentListMagicService }, { type: i1.TaskMagicService }]; }, null);
583
484
  })();
584
485
 
585
- /**
586
- * @ignore
587
- */
588
486
  var matMagicProviders = __spread(i1.basicMagicProviders, [
589
487
  { provide: i1.TableMagicService, useClass: MgMatTableService }
590
488
  ]);
591
489
 
592
- /**
593
- * This component is the base component for forms which has a material-design table (grid)
594
- */
595
490
  var BaseMatTableMagicComponent = /** @class */ (function (_super) {
596
491
  __extends(BaseMatTableMagicComponent, _super);
597
- /**
598
- * @ignore
599
- */
600
492
  function BaseMatTableMagicComponent(dialog, ref, magicService) {
601
493
  var _this = _super.call(this, ref, magicService) || this;
602
494
  _this.dialog = dialog;
@@ -607,16 +499,10 @@
607
499
  _this.selection = new collections.SelectionModel(false, []);
608
500
  return _this;
609
501
  }
610
- /**
611
- * Initializer
612
- */
613
502
  BaseMatTableMagicComponent.prototype.ngOnInit = function () {
614
503
  _super.prototype.ngOnInit.call(this);
615
504
  this.magicService.tableService.connect(this.dataSource, this.paginator, this.selection, this.dialog);
616
505
  };
617
- /**
618
- * AfterContentChecked implementation
619
- */
620
506
  BaseMatTableMagicComponent.prototype.ngAfterContentChecked = function () {
621
507
  if (!util.isNullOrUndefined(this.paginator) && !util.isNullOrUndefined(this.paginator.pageSize) &&
622
508
  this.paginator.pageSize != this.task.oldPageSize) {
@@ -626,8 +512,8 @@
626
512
  };
627
513
  return BaseMatTableMagicComponent;
628
514
  }(i1.TaskBaseMagicComponent));
629
- /** @nocollapse */ BaseMatTableMagicComponent.ɵfac = function BaseMatTableMagicComponent_Factory(t) { return new (t || BaseMatTableMagicComponent)(i0.ɵɵdirectiveInject(i1$1.MatDialog), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.MagicServices)); };
630
- /** @nocollapse */ BaseMatTableMagicComponent.ɵcmp = i0.ɵɵdefineComponent({ type: BaseMatTableMagicComponent, selectors: [["ng-component"]], viewQuery: function BaseMatTableMagicComponent_Query(rf, ctx) {
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) {
631
517
  if (rf & 1) {
632
518
  i0.ɵɵstaticViewQuery(paginator.MatPaginator, true);
633
519
  i0.ɵɵstaticViewQuery(sort.MatSort, true);
@@ -638,7 +524,7 @@
638
524
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.sort = _t.first);
639
525
  }
640
526
  }, features: [i0.ɵɵProvidersFeature(matMagicProviders), i0.ɵɵInheritDefinitionFeature], decls: 0, vars: 0, template: function BaseMatTableMagicComponent_Template(rf, ctx) { }, encapsulation: 2 });
641
- /*@__PURE__*/ (function () {
527
+ (function () {
642
528
  i0.ɵsetClassMetadata(BaseMatTableMagicComponent, [{
643
529
  type: i0.Component,
644
530
  args: [{
@@ -654,29 +540,22 @@
654
540
  }] });
655
541
  })();
656
542
 
657
- /**
658
- * Directive for material-design listboxes not on material-design table
659
- */
660
543
  var MatListboxDirective = /** @class */ (function () {
661
544
  function MatListboxDirective(magicDirective) {
662
545
  this.magicDirective = magicDirective;
663
546
  }
664
- /**
665
- * Handles the "selectionChange" event - pass it to the "change" event handler
666
- * @param $event
667
- */
668
547
  MatListboxDirective.prototype.onChange = function ($event) {
669
548
  this.magicDirective.task.onListBoxSelectionChanged($event, this.magicDirective.id);
670
549
  };
671
550
  return MatListboxDirective;
672
551
  }());
673
- /** @nocollapse */ MatListboxDirective.ɵfac = function MatListboxDirective_Factory(t) { return new (t || MatListboxDirective)(i0.ɵɵdirectiveInject(i1.MagicDirective)); };
674
- /** @nocollapse */ MatListboxDirective.ɵdir = i0.ɵɵdefineDirective({ type: MatListboxDirective, selectors: [["mat-selection-list", "magic", ""]], hostBindings: function MatListboxDirective_HostBindings(rf, ctx) {
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) {
675
554
  if (rf & 1) {
676
555
  i0.ɵɵlistener("selectionChange", function MatListboxDirective_selectionChange_HostBindingHandler($event) { return ctx.onChange($event); });
677
556
  }
678
557
  } });
679
- /*@__PURE__*/ (function () {
558
+ (function () {
680
559
  i0.ɵsetClassMetadata(MatListboxDirective, [{
681
560
  type: i0.Directive,
682
561
  args: [{
@@ -688,9 +567,6 @@
688
567
  }] });
689
568
  })();
690
569
 
691
- /**
692
- * @ignore
693
- */
694
570
  var materialModules = [
695
571
  table.MatTableModule,
696
572
  paginator.MatPaginatorModule,
@@ -704,17 +580,14 @@
704
580
  core.MatNativeDateModule,
705
581
  i1$1.MatDialogModule
706
582
  ];
707
- /**
708
- * @ignore
709
- */
710
583
  var MagicAngularMaterialModule = /** @class */ (function () {
711
584
  function MagicAngularMaterialModule(componentList, matdialog) {
712
585
  componentList.dialogs.set('MatDialog', matdialog);
713
586
  }
714
587
  return MagicAngularMaterialModule;
715
588
  }());
716
- /** @nocollapse */ MagicAngularMaterialModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicAngularMaterialModule });
717
- /** @nocollapse */ MagicAngularMaterialModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MagicAngularMaterialModule_Factory(t) { return new (t || MagicAngularMaterialModule)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i1$1.MatDialog)); }, imports: [__spread([
589
+ MagicAngularMaterialModule.ɵmod = i0.ɵɵdefineNgModule({ type: MagicAngularMaterialModule });
590
+ MagicAngularMaterialModule.ɵinj = i0.ɵɵdefineInjector({ factory: function MagicAngularMaterialModule_Factory(t) { return new (t || MagicAngularMaterialModule)(i0.ɵɵinject(i1.ComponentListMagicService), i0.ɵɵinject(i1$1.MatDialog)); }, imports: [__spread([
718
591
  common.CommonModule,
719
592
  forms.FormsModule
720
593
  ], materialModules, [
@@ -740,7 +613,7 @@
740
613
  MatListboxDirective,
741
614
  BaseMatTableMagicComponent] });
742
615
  })();
743
- /*@__PURE__*/ (function () {
616
+ (function () {
744
617
  i0.ɵsetClassMetadata(MagicAngularMaterialModule, [{
745
618
  type: i0.NgModule,
746
619
  args: [{
@@ -766,10 +639,6 @@
766
639
  }], function () { return [{ type: i1.ComponentListMagicService }, { type: i1$1.MatDialog }]; }, null);
767
640
  })();
768
641
 
769
- /**
770
- * Generated bundle index. Do not edit.
771
- */
772
-
773
642
  exports.BaseMatTableMagicComponent = BaseMatTableMagicComponent;
774
643
  exports.MagicAngularMaterialModule = MagicAngularMaterialModule;
775
644
  exports.MatCheckboxDirective = MatCheckboxDirective;