@paperless/angular 0.1.0-alpha.194 → 0.1.0-alpha.196

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.
@@ -1,10 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, EventEmitter, Input, Output, ViewChild, Directive, HostListener, ChangeDetectionStrategy, NgModule } from '@angular/core';
2
+ import { Component, EventEmitter, Input, Output, ViewChild, Directive, HostListener, ChangeDetectionStrategy, HostBinding, TemplateRef, ContentChild, ContentChildren, NgModule } from '@angular/core';
3
3
  import { FormControl, FormGroup, FormArray, NG_VALUE_ACCESSOR } from '@angular/forms';
4
4
  import { __decorate } from 'tslib';
5
5
  import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
6
6
  import { timer, fromEvent } from 'rxjs';
7
7
  import { startWith, pairwise, map, filter, debounce } from 'rxjs/operators';
8
+ import { objectGetByPath } from '@paperless/core';
9
+ import * as i1 from '@angular/common';
10
+ import { CommonModule } from '@angular/common';
8
11
 
9
12
  class FormBaseComponent {
10
13
  constructor() {
@@ -356,297 +359,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
356
359
  args: ['focusout']
357
360
  }] } });
358
361
 
359
- class PageSizeSelectDirective extends BaseValueAccessor {
360
- constructor(el) {
361
- super(el);
362
- }
363
- writeValue(value) {
364
- this.el.nativeElement.page = this.lastValue =
365
- value == null ? '' : value;
366
- }
367
- registerOnChange(fn) {
368
- super.registerOnChange((value) => fn(value === '' ? null : parseInt(value, 10)));
369
- }
370
- }
371
- PageSizeSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PageSizeSelectDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
372
- PageSizeSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: PageSizeSelectDirective, selector: "p-page-size-select", host: { listeners: { "sizeChange": "handleChangeEvent($event.detail)" } }, providers: [
373
- {
374
- provide: NG_VALUE_ACCESSOR,
375
- useExisting: PageSizeSelectDirective,
376
- multi: true,
377
- },
378
- ], usesInheritance: true, ngImport: i0 });
379
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PageSizeSelectDirective, decorators: [{
380
- type: Directive,
381
- args: [{
382
- /* tslint:disable-next-line:directive-selector */
383
- selector: 'p-page-size-select',
384
- host: {
385
- '(sizeChange)': 'handleChangeEvent($event.detail)',
386
- },
387
- providers: [
388
- {
389
- provide: NG_VALUE_ACCESSOR,
390
- useExisting: PageSizeSelectDirective,
391
- multi: true,
392
- },
393
- ],
394
- }]
395
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
396
-
397
- class PaginationDirective extends BaseValueAccessor {
398
- constructor(el) {
399
- super(el);
400
- }
401
- writeValue(value) {
402
- this.el.nativeElement.page = this.lastValue =
403
- value == null ? '' : value;
404
- }
405
- registerOnChange(fn) {
406
- super.registerOnChange((value) => fn(value === '' ? null : parseInt(value, 10)));
407
- }
408
- }
409
- PaginationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaginationDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
410
- PaginationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: PaginationDirective, selector: "p-pagination", host: { listeners: { "pageChange": "handleChangeEvent($event.detail)" } }, providers: [
411
- {
412
- provide: NG_VALUE_ACCESSOR,
413
- useExisting: PaginationDirective,
414
- multi: true,
415
- },
416
- ], usesInheritance: true, ngImport: i0 });
417
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaginationDirective, decorators: [{
418
- type: Directive,
419
- args: [{
420
- /* tslint:disable-next-line:directive-selector */
421
- selector: 'p-pagination',
422
- host: {
423
- '(pageChange)': 'handleChangeEvent($event.detail)',
424
- },
425
- providers: [
426
- {
427
- provide: NG_VALUE_ACCESSOR,
428
- useExisting: PaginationDirective,
429
- multi: true,
430
- },
431
- ],
432
- }]
433
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
434
-
435
- class SelectDirective extends BaseValueAccessor {
436
- constructor(el) {
437
- super(el);
438
- console.log(el);
439
- }
440
- writeValue(value) {
441
- console.log(value);
442
- this.el.nativeElement.value = this.lastValue =
443
- value == null ? '' : value;
444
- }
445
- }
446
- SelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: SelectDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
447
- SelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: SelectDirective, selector: "p-select", host: { listeners: { "valueChange": "handleChangeEvent($event.detail)" } }, providers: [
448
- {
449
- provide: NG_VALUE_ACCESSOR,
450
- useExisting: SelectDirective,
451
- multi: true,
452
- },
453
- ], usesInheritance: true, ngImport: i0 });
454
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: SelectDirective, decorators: [{
455
- type: Directive,
456
- args: [{
457
- selector: 'p-select',
458
- host: {
459
- '(valueChange)': 'handleChangeEvent($event.detail)',
460
- },
461
- providers: [
462
- {
463
- provide: NG_VALUE_ACCESSOR,
464
- useExisting: SelectDirective,
465
- multi: true,
466
- },
467
- ],
468
- }]
469
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
470
-
471
- class TableFooterDirective extends BaseValueAccessor {
472
- constructor(el) {
473
- super(el);
474
- this.lastValue = {
475
- page: 1,
476
- pageSize: 12,
477
- };
478
- }
479
- writeValue(value) {
480
- this.el.nativeElement.page = this.lastValue.page =
481
- (value === null || value === void 0 ? void 0 : value.page) == null ? '' : value === null || value === void 0 ? void 0 : value.page;
482
- this.el.nativeElement.pageSize = this.lastValue.pageSize =
483
- (value === null || value === void 0 ? void 0 : value.pageSize) == null ? '' : value === null || value === void 0 ? void 0 : value.pageSize;
484
- }
485
- handleChange(value, type) {
486
- this.handleChangeEvent(Object.assign(Object.assign({}, this.lastValue), { [type]: value }));
487
- }
488
- }
489
- TableFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableFooterDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
490
- TableFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: TableFooterDirective, selector: "p-table-footer", host: { listeners: { "pageChange": "handleChange($event.detail, \"page\")", "pageSizeChange": "handleChange($event.detail, \"pageSize\")" } }, providers: [
491
- {
492
- provide: NG_VALUE_ACCESSOR,
493
- useExisting: TableFooterDirective,
494
- multi: true,
495
- },
496
- ], usesInheritance: true, ngImport: i0 });
497
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableFooterDirective, decorators: [{
498
- type: Directive,
499
- args: [{
500
- /* tslint:disable-next-line:directive-selector */
501
- selector: 'p-table-footer',
502
- host: {
503
- '(pageChange)': 'handleChange($event.detail, "page")',
504
- '(pageSizeChange)': 'handleChange($event.detail, "pageSize")',
505
- },
506
- providers: [
507
- {
508
- provide: NG_VALUE_ACCESSOR,
509
- useExisting: TableFooterDirective,
510
- multi: true,
511
- },
512
- ],
513
- }]
514
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
515
-
516
- class TableHeaderDirective extends BaseValueAccessor {
517
- constructor(el) {
518
- super(el);
519
- this.lastValue = {
520
- query: '',
521
- quickFilter: undefined,
522
- };
523
- }
524
- writeValue(value) {
525
- this.el.nativeElement.query = this.lastValue.query = value === null || value === void 0 ? void 0 : value.query;
526
- this.lastValue.quickFilter = value === null || value === void 0 ? void 0 : value.quickFilter;
527
- if (value === null || value === void 0 ? void 0 : value.quickFilter) {
528
- this._setActiveQuickFilter(value.quickFilter);
529
- }
530
- }
531
- handleChange(value, type) {
532
- this.handleChangeEvent(Object.assign(Object.assign({}, this.lastValue), { [type]: value }));
533
- if (type === 'quickFilter' && typeof value !== 'string') {
534
- this._setActiveQuickFilter(value);
535
- }
536
- }
537
- _setActiveQuickFilter(quickFilter) {
538
- this.el.nativeElement.activeQuickFilterIdentifier =
539
- quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
540
- }
541
- }
542
- TableHeaderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableHeaderDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
543
- TableHeaderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: TableHeaderDirective, selector: "p-table-header", host: { listeners: { "queryChange": "handleChange($event.detail, \"query\")", "quickFilter": "handleChange($event.detail, \"quickFilter\")" } }, providers: [
544
- {
545
- provide: NG_VALUE_ACCESSOR,
546
- useExisting: TableHeaderDirective,
547
- multi: true,
548
- },
549
- ], usesInheritance: true, ngImport: i0 });
550
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableHeaderDirective, decorators: [{
551
- type: Directive,
552
- args: [{
553
- /* tslint:disable-next-line:directive-selector */
554
- selector: 'p-table-header',
555
- host: {
556
- '(queryChange)': 'handleChange($event.detail, "query")',
557
- '(quickFilter)': 'handleChange($event.detail, "quickFilter")',
558
- },
559
- providers: [
560
- {
561
- provide: NG_VALUE_ACCESSOR,
562
- useExisting: TableHeaderDirective,
563
- multi: true,
564
- },
565
- ],
566
- }]
567
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
568
-
569
- class TableDirective extends BaseValueAccessor {
570
- constructor(el) {
571
- super(el);
572
- this.lastValue = {
573
- query: '',
574
- quickFilter: undefined,
575
- page: 1,
576
- pageSize: 12,
577
- selectedRows: [],
578
- };
579
- }
580
- writeValue(value) {
581
- this.el.nativeElement.query = this.lastValue.query = value === null || value === void 0 ? void 0 : value.query;
582
- this.lastValue.quickFilter = value === null || value === void 0 ? void 0 : value.quickFilter;
583
- this.el.nativeElement.page = this.lastValue.page =
584
- (value === null || value === void 0 ? void 0 : value.page) == null ? 1 : value === null || value === void 0 ? void 0 : value.page;
585
- this.el.nativeElement.pageSize = this.lastValue.pageSize =
586
- (value === null || value === void 0 ? void 0 : value.pageSize) == null ? 12 : value === null || value === void 0 ? void 0 : value.pageSize;
587
- this.lastValue.selectedRows =
588
- (value === null || value === void 0 ? void 0 : value.selectedRows) == null ? [] : value === null || value === void 0 ? void 0 : value.selectedRows;
589
- if (value === null || value === void 0 ? void 0 : value.quickFilter) {
590
- this._setActiveQuickFilter(value.quickFilter);
591
- }
592
- }
593
- registerOnChange(fn) {
594
- this.onChange = fn;
595
- }
596
- registerOnTouched(fn) {
597
- this.onTouched = fn;
598
- }
599
- handleChange(value, type) {
600
- this.handleChangeEvent(Object.assign(Object.assign({}, this.lastValue), { [type]: value }));
601
- if (type === 'quickFilter' && typeof value === 'object') {
602
- this._setActiveQuickFilter(value);
603
- }
604
- }
605
- _setActiveQuickFilter(quickFilter) {
606
- this.el.nativeElement.activeQuickFilterIdentifier =
607
- quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
608
- }
609
- }
610
- TableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
611
- TableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: TableDirective, selector: "p-table", host: { listeners: { "queryChange": "handleChange($event.detail, \"query\")", "quickFilter": "handleChange($event.detail, \"quickFilter\")", "pageChange": "handleChange($event.detail, \"page\")", "pageSizeChange": "handleChange($event.detail, \"pageSize\")", "selectedRowsChange": "handleChange($event.detail, \"selectedRows\")" } }, providers: [
612
- {
613
- provide: NG_VALUE_ACCESSOR,
614
- useExisting: TableDirective,
615
- multi: true,
616
- },
617
- ], usesInheritance: true, ngImport: i0 });
618
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableDirective, decorators: [{
619
- type: Directive,
620
- args: [{
621
- /* tslint:disable-next-line:directive-selector */
622
- selector: 'p-table',
623
- host: {
624
- '(queryChange)': 'handleChange($event.detail, "query")',
625
- '(quickFilter)': 'handleChange($event.detail, "quickFilter")',
626
- '(pageChange)': 'handleChange($event.detail, "page")',
627
- '(pageSizeChange)': 'handleChange($event.detail, "pageSize")',
628
- '(selectedRowsChange)': 'handleChange($event.detail, "selectedRows")',
629
- },
630
- providers: [
631
- {
632
- provide: NG_VALUE_ACCESSOR,
633
- useExisting: TableDirective,
634
- multi: true,
635
- },
636
- ],
637
- }]
638
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
639
-
640
- // Custom directives
641
- const CUSTOM_DIRECTIVES = [
642
- PaginationDirective,
643
- PageSizeSelectDirective,
644
- TableFooterDirective,
645
- TableHeaderDirective,
646
- TableDirective,
647
- SelectDirective,
648
- ];
649
-
650
362
  /* eslint-disable */
651
363
  const proxyInputs = (Cmp, inputs) => {
652
364
  const Prototype = Cmp.prototype;
@@ -1139,11 +851,11 @@ let PLabel = class PLabel {
1139
851
  }
1140
852
  };
1141
853
  PLabel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PLabel, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1142
- PLabel.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PLabel, selector: "p-label", inputs: { circle: "circle", size: "size", variant: "variant" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
854
+ PLabel.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PLabel, selector: "p-label", inputs: { circle: "circle", icon: "icon", iconFlip: "iconFlip", iconOnly: "iconOnly", iconRotate: "iconRotate", mobileIcon: "mobileIcon", size: "size", variant: "variant" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1143
855
  PLabel = __decorate([
1144
856
  ProxyCmp({
1145
857
  defineCustomElementFn: undefined,
1146
- inputs: ['circle', 'size', 'variant']
858
+ inputs: ['circle', 'icon', 'iconFlip', 'iconOnly', 'iconRotate', 'mobileIcon', 'size', 'variant']
1147
859
  })
1148
860
  ], PLabel);
1149
861
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PLabel, decorators: [{
@@ -1152,7 +864,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
1152
864
  selector: 'p-label',
1153
865
  changeDetection: ChangeDetectionStrategy.OnPush,
1154
866
  template: '<ng-content></ng-content>',
1155
- inputs: ['circle', 'size', 'variant']
867
+ inputs: ['circle', 'icon', 'iconFlip', 'iconOnly', 'iconRotate', 'mobileIcon', 'size', 'variant']
1156
868
  }]
1157
869
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1158
870
  let PLayout = class PLayout {
@@ -1730,175 +1442,1173 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
1730
1442
  inputs: ['active']
1731
1443
  }]
1732
1444
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1733
- let PTableColumn = class PTableColumn {
1445
+ let PTableContainer = class PTableContainer {
1446
+ constructor(c, r, z) {
1447
+ this.z = z;
1448
+ c.detach();
1449
+ this.el = r.nativeElement;
1450
+ }
1451
+ };
1452
+ PTableContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableContainer, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1453
+ PTableContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableContainer, selector: "p-table-container", ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1454
+ PTableContainer = __decorate([
1455
+ ProxyCmp({
1456
+ defineCustomElementFn: undefined
1457
+ })
1458
+ ], PTableContainer);
1459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableContainer, decorators: [{
1460
+ type: Component,
1461
+ args: [{
1462
+ selector: 'p-table-container',
1463
+ changeDetection: ChangeDetectionStrategy.OnPush,
1464
+ template: '<ng-content></ng-content>'
1465
+ }]
1466
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1467
+ let PTableFooter = class PTableFooter {
1734
1468
  constructor(c, r, z) {
1735
1469
  this.z = z;
1736
1470
  c.detach();
1737
1471
  this.el = r.nativeElement;
1472
+ proxyOutputs(this, this.el, ['pageChange', 'pageSizeChange', 'export']);
1738
1473
  }
1739
1474
  };
1740
- PTableColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableColumn, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1741
- PTableColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableColumn, selector: "p-table-column", inputs: { checkbox: "checkbox", definition: "definition", index: "index", item: "item", rowIndex: "rowIndex", template: "template", value: "value", variant: "variant" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1742
- PTableColumn = __decorate([
1475
+ PTableFooter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableFooter, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1476
+ PTableFooter.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableFooter, selector: "p-table-footer", inputs: { enableExport: "enableExport", enablePageSize: "enablePageSize", enablePagination: "enablePagination", hideOnSinglePage: "hideOnSinglePage", page: "page", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions", total: "total" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1477
+ PTableFooter = __decorate([
1743
1478
  ProxyCmp({
1744
1479
  defineCustomElementFn: undefined,
1745
- inputs: ['checkbox', 'definition', 'index', 'item', 'rowIndex', 'template', 'value', 'variant']
1480
+ inputs: ['enableExport', 'enablePageSize', 'enablePagination', 'hideOnSinglePage', 'page', 'pageSize', 'pageSizeOptions', 'total']
1746
1481
  })
1747
- ], PTableColumn);
1748
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableColumn, decorators: [{
1482
+ ], PTableFooter);
1483
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableFooter, decorators: [{
1749
1484
  type: Component,
1750
1485
  args: [{
1751
- selector: 'p-table-column',
1486
+ selector: 'p-table-footer',
1752
1487
  changeDetection: ChangeDetectionStrategy.OnPush,
1753
1488
  template: '<ng-content></ng-content>',
1754
- inputs: ['checkbox', 'definition', 'index', 'item', 'rowIndex', 'template', 'value', 'variant']
1489
+ inputs: ['enableExport', 'enablePageSize', 'enablePagination', 'hideOnSinglePage', 'page', 'pageSize', 'pageSizeOptions', 'total']
1755
1490
  }]
1756
1491
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1757
- let PTableContainer = class PTableContainer {
1492
+ let PTableHeader = class PTableHeader {
1758
1493
  constructor(c, r, z) {
1759
1494
  this.z = z;
1760
1495
  c.detach();
1761
1496
  this.el = r.nativeElement;
1497
+ proxyOutputs(this, this.el, ['quickFilter', 'queryChange', 'filter', 'edit']);
1762
1498
  }
1763
1499
  };
1764
- PTableContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableContainer, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1765
- PTableContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableContainer, selector: "p-table-container", ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1766
- PTableContainer = __decorate([
1500
+ PTableHeader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableHeader, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1501
+ PTableHeader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableHeader, selector: "p-table-header", inputs: { activeQuickFilterIdentifier: "activeQuickFilterIdentifier", canEdit: "canEdit", editButtonTemplate: "editButtonTemplate", enableEdit: "enableEdit", enableFilter: "enableFilter", enableSearch: "enableSearch", filterButtonTemplate: "filterButtonTemplate", itemsSelectedAmount: "itemsSelectedAmount", query: "query", quickFilters: "quickFilters", selectedFiltersAmount: "selectedFiltersAmount" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1502
+ PTableHeader = __decorate([
1767
1503
  ProxyCmp({
1768
- defineCustomElementFn: undefined
1504
+ defineCustomElementFn: undefined,
1505
+ inputs: ['activeQuickFilterIdentifier', 'canEdit', 'editButtonTemplate', 'enableEdit', 'enableFilter', 'enableSearch', 'filterButtonTemplate', 'itemsSelectedAmount', 'query', 'quickFilters', 'selectedFiltersAmount']
1769
1506
  })
1770
- ], PTableContainer);
1771
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableContainer, decorators: [{
1507
+ ], PTableHeader);
1508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableHeader, decorators: [{
1772
1509
  type: Component,
1773
1510
  args: [{
1774
- selector: 'p-table-container',
1511
+ selector: 'p-table-header',
1775
1512
  changeDetection: ChangeDetectionStrategy.OnPush,
1776
- template: '<ng-content></ng-content>'
1513
+ template: '<ng-content></ng-content>',
1514
+ inputs: ['activeQuickFilterIdentifier', 'canEdit', 'editButtonTemplate', 'enableEdit', 'enableFilter', 'enableSearch', 'filterButtonTemplate', 'itemsSelectedAmount', 'query', 'quickFilters', 'selectedFiltersAmount']
1777
1515
  }]
1778
1516
  }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1779
- let PTableFooter = class PTableFooter {
1517
+ let PTableRow = class PTableRow {
1518
+ constructor(c, r, z) {
1519
+ this.z = z;
1520
+ c.detach();
1521
+ this.el = r.nativeElement;
1522
+ }
1523
+ };
1524
+ PTableRow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableRow, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1525
+ PTableRow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableRow, selector: "p-table-row", inputs: { enableHover: "enableHover", variant: "variant" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1526
+ PTableRow = __decorate([
1527
+ ProxyCmp({
1528
+ defineCustomElementFn: undefined,
1529
+ inputs: ['enableHover', 'variant']
1530
+ })
1531
+ ], PTableRow);
1532
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableRow, decorators: [{
1533
+ type: Component,
1534
+ args: [{
1535
+ selector: 'p-table-row',
1536
+ changeDetection: ChangeDetectionStrategy.OnPush,
1537
+ template: '<ng-content></ng-content>',
1538
+ inputs: ['enableHover', 'variant']
1539
+ }]
1540
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1541
+ let PToastContainer = class PToastContainer {
1542
+ constructor(c, r, z) {
1543
+ this.z = z;
1544
+ c.detach();
1545
+ this.el = r.nativeElement;
1546
+ }
1547
+ };
1548
+ PToastContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PToastContainer, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1549
+ PToastContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PToastContainer, selector: "p-toast-container", inputs: { placement: "placement" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1550
+ PToastContainer = __decorate([
1551
+ ProxyCmp({
1552
+ defineCustomElementFn: undefined,
1553
+ inputs: ['placement']
1554
+ })
1555
+ ], PToastContainer);
1556
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PToastContainer, decorators: [{
1557
+ type: Component,
1558
+ args: [{
1559
+ selector: 'p-toast-container',
1560
+ changeDetection: ChangeDetectionStrategy.OnPush,
1561
+ template: '<ng-content></ng-content>',
1562
+ inputs: ['placement']
1563
+ }]
1564
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1565
+ let PTooltip = class PTooltip {
1566
+ constructor(c, r, z) {
1567
+ this.z = z;
1568
+ c.detach();
1569
+ this.el = r.nativeElement;
1570
+ proxyOutputs(this, this.el, ['isOpen']);
1571
+ }
1572
+ };
1573
+ PTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTooltip, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1574
+ PTooltip.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTooltip, selector: "p-tooltip", inputs: { canManuallyClose: "canManuallyClose", placement: "placement", popover: "popover", show: "show", strategy: "strategy", variant: "variant" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1575
+ PTooltip = __decorate([
1576
+ ProxyCmp({
1577
+ defineCustomElementFn: undefined,
1578
+ inputs: ['canManuallyClose', 'placement', 'popover', 'show', 'strategy', 'variant']
1579
+ })
1580
+ ], PTooltip);
1581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTooltip, decorators: [{
1582
+ type: Component,
1583
+ args: [{
1584
+ selector: 'p-tooltip',
1585
+ changeDetection: ChangeDetectionStrategy.OnPush,
1586
+ template: '<ng-content></ng-content>',
1587
+ inputs: ['canManuallyClose', 'placement', 'popover', 'show', 'strategy', 'variant']
1588
+ }]
1589
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1590
+
1591
+ /* eslint-disable max-len */
1592
+ class TableCell {
1593
+ constructor() {
1594
+ /**
1595
+ * The variant of the column
1596
+ */
1597
+ this.variant = 'default';
1598
+ /**
1599
+ * The index of the column
1600
+ */
1601
+ this.index = 0;
1602
+ /**
1603
+ * The index of the row
1604
+ */
1605
+ this.rowIndex = 0;
1606
+ }
1607
+ get class() {
1608
+ return this.getColumnClasses();
1609
+ }
1610
+ get data() {
1611
+ var _a;
1612
+ if (this.variant === 'header') {
1613
+ return {
1614
+ value: this.value,
1615
+ };
1616
+ }
1617
+ return {
1618
+ value: (_a = this.value) !== null && _a !== void 0 ? _a : objectGetByPath(this.item, this.definition.path),
1619
+ item: this.item,
1620
+ index: this.index,
1621
+ rowIndex: this.rowIndex,
1622
+ };
1623
+ }
1624
+ // render() {
1625
+ // return (
1626
+ // <Host
1627
+ // class={{
1628
+ // 'p-table-column': true,
1629
+ // [`variant-${this.variant}`]: true,
1630
+ // ...this._getColumnClasses(),
1631
+ // }}
1632
+ // >
1633
+ // {this.checkbox}
1634
+ // {this.variant === 'loading' ? (
1635
+ // <p-loader
1636
+ // variant="ghost"
1637
+ // class="rounded flex-1 w-full h-6"
1638
+ // />
1639
+ // ) : (
1640
+ // <div class="flex">
1641
+ // {this.variant === 'header' ? (
1642
+ // this.data.value
1643
+ // ) : this.definition.useSlot ? (
1644
+ // <slot />
1645
+ // ) : (
1646
+ // this.template(this.data as TableDefinitionData)
1647
+ // )}
1648
+ // </div>
1649
+ // )}
1650
+ // </Host>
1651
+ // );
1652
+ // }
1653
+ getColumnClasses() {
1654
+ var _a, _b, _c, _d, _e, _f;
1655
+ const sizes = this.definition ? this._getSizes(this.definition) : {};
1656
+ return Object.assign({ 'justify-start': !((_a = this.definition) === null || _a === void 0 ? void 0 : _a.align) || ((_b = this.definition) === null || _b === void 0 ? void 0 : _b.align) === 'start', 'justify-center': ((_c = this.definition) === null || _c === void 0 ? void 0 : _c.align) === 'center', 'justify-end': ((_d = this.definition) === null || _d === void 0 ? void 0 : _d.align) === 'end', 'font-semibold': this.variant !== 'header' && ((_e = this.definition) === null || _e === void 0 ? void 0 : _e.type) === 'th', 'text-storm-dark': this.variant !== 'header' && ((_f = this.definition) === null || _f === void 0 ? void 0 : _f.type) === 'th' }, sizes);
1657
+ }
1658
+ /*
1659
+ With this, we shall hack the system in ways no one would ever have thought.
1660
+
1661
+ w-1/12 w-2/12 w-3/12 w-4/12 w-5/12 w-6/12 w-7/12 w-8/12 w-9/12 w-10/12 w-11/12 w-12/12
1662
+ tablet:w-1/12 tablet:w-2/12 tablet:w-3/12 tablet:w-4/12 tablet:w-5/12 tablet:w-6/12 tablet:w-7/12 tablet:w-8/12 tablet:w-9/12 tablet:w-10/12 tablet:w-11/12 tablet:w-12/12
1663
+ desktop-xs:w-1/12 desktop-xs:w-2/12 desktop-xs:w-3/12 desktop-xs:w-4/12 desktop-xs:w-5/12 desktop-xs:w-6/12 desktop-xs:w-7/12 desktop-xs:w-8/12 desktop-xs:w-9/12 desktop-xs:w-10/12 desktop-xs:w-11/12 desktop-xs:w-12/12
1664
+ desktop-xs:w-1/12 desktop-xs:w-2/12 desktop-xs:w-3/12 desktop-xs:w-4/12 desktop-xs:w-5/12 desktop-xs:w-6/12 desktop-xs:w-7/12 desktop-xs:w-8/12 desktop-xs:w-9/12 desktop-xs:w-10/12 desktop-xs:w-11/12 desktop-xs:w-12/12
1665
+ desktop-sm:w-1/12 desktop-sm:w-2/12 desktop-sm:w-3/12 desktop-sm:w-4/12 desktop-sm:w-5/12 desktop-sm:w-6/12 desktop-sm:w-7/12 desktop-sm:w-8/12 desktop-sm:w-9/12 desktop-sm:w-10/12 desktop-sm:w-11/12 desktop-sm:w-12/12
1666
+ desktop:w-1/12 desktop:w-2/12 desktop:w-3/12 desktop:w-4/12 desktop:w-5/12 desktop:w-6/12 desktop:w-7/12 desktop:w-8/12 desktop:w-9/12 desktop:w-10/12 desktop:w-11/12 desktop:w-12/12
1667
+ desktop-lg:w-1/12 desktop-lg:w-2/12 desktop-lg:w-3/12 desktop-lg:w-4/12 desktop-lg:w-5/12 desktop-lg:w-6/12 desktop-lg:w-7/12 desktop-lg:w-8/12 desktop-lg:w-9/12 desktop-lg:w-10/12 desktop-lg:w-11/12 desktop-lg:w-12/12
1668
+ desktop-xl:w-1/12 desktop-xl:w-2/12 desktop-xl:w-3/12 desktop-xl:w-4/12 desktop-xl:w-5/12 desktop-xl:w-6/12 desktop-xl:w-7/12 desktop-xl:w-8/12 desktop-xl:w-9/12 desktop-xl:w-10/12 desktop-xl:w-11/12 desktop-xl:w-12/12
1669
+
1670
+
1671
+ ⠀⠀⠀⠀⠀⣠⣴⣶⣿⣿⠿⣷⣶⣤⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣴⣶⣷⠿⣿⣿⣶⣦⣀⠀⠀⠀⠀⠀
1672
+ ⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣶⣦⣬⡉⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠚⢉⣥⣴⣾⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀
1673
+ ⠀⠀⠀⡾⠿⠛⠛⠛⠛⠿⢿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⣿⣿⣿⣿⣿⠿⠿⠛⠛⠛⠛⠿⢧⠀⠀⠀
1674
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠻⣿⣿⣿⣿⣿⡄⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⡿⠟⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1675
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⡄⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1676
+ ⠀⠀⠀⠀⠀⠀⠀⣠⣤⠶⠶⠶⠰⠦⣤⣀⠀⠙⣷⠀⠀⠀⠀⠀⠀⠀⢠⡿⠋⢀⣀⣤⢴⠆⠲⠶⠶⣤⣄⠀⠀⠀⠀⠀⠀⠀
1677
+ ⠀⠘⣆⠀⠀⢠⣾⣫⣶⣾⣿⣿⣿⣿⣷⣯⣿⣦⠈⠃⡇⠀⠀⠀⠀⢸⠘⢁⣶⣿⣵⣾⣿⣿⣿⣿⣷⣦⣝⣷⡄⠀⠀⡰⠂⠀
1678
+ ⠀⠀⣨⣷⣶⣿⣧⣛⣛⠿⠿⣿⢿⣿⣿⣛⣿⡿⠀⠀⡇⠀⠀⠀⠀⢸⠀⠈⢿⣟⣛⠿⢿⡿⢿⢿⢿⣛⣫⣼⡿⣶⣾⣅⡀⠀
1679
+ ⢀⡼⠋⠁⠀⠀⠈⠉⠛⠛⠻⠟⠸⠛⠋⠉⠁⠀⠀⢸⡇⠀⠀⠄⠀⢸⡄⠀⠀⠈⠉⠙⠛⠃⠻⠛⠛⠛⠉⠁⠀⠀⠈⠙⢧⡀
1680
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣿⡇⢠⠀⠀⠀⢸⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1681
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⡇⠀⠀⠀⠀⢸⣿⣷⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1682
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠟⠁⣿⠇⠀⠀⠀⠀⢸⡇⠙⢿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1683
+ ⠀⠰⣄⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⣾⠖⡾⠁⠀⠀⣿⠀⠀⠀⠀⠀⠘⣿⠀⠀⠙⡇⢸⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⣰⠄⠀
1684
+ ⠀⠀⢻⣷⡦⣤⣤⣤⡴⠶⠿⠛⠉⠁⠀⢳⠀⢠⡀⢿⣀⠀⠀⠀⠀⣠⡟⢀⣀⢠⠇⠀⠈⠙⠛⠷⠶⢦⣤⣤⣤⢴⣾⡏⠀⠀
1685
+ ⠀⠀⠈⣿⣧⠙⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀⠀⠘⠛⢊⣙⠛⠒⠒⢛⣋⡚⠛⠉⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⡿⠁⣾⡿⠀⠀⠀
1686
+ ⠀⠀⠀⠘⣿⣇⠈⢿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⡿⢿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⡟⠁⣼⡿⠁⠀⠀⠀
1687
+ ⠀⠀⠀⠀⠘⣿⣦⠀⠻⣿⣷⣦⣤⣤⣶⣶⣶⣿⣿⣿⣿⠏⠀⠀⠻⣿⣿⣿⣿⣶⣶⣶⣦⣤⣴⣿⣿⠏⢀⣼⡿⠁⠀⠀⠀⠀
1688
+ ⠀⠀⠀⠀⠀⠘⢿⣷⣄⠙⠻⠿⠿⠿⠿⠿⢿⣿⣿⣿⣁⣀⣀⣀⣀⣙⣿⣿⣿⠿⠿⠿⠿⠿⠿⠟⠁⣠⣿⡿⠁⠀⠀⠀⠀⠀
1689
+ ⠀⠀⠀⠀⠀⠀⠈⠻⣯⠙⢦⣀⠀⠀⠀⠀⠀⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠀⠀⠀⠀⠀⣠⠴⢋⣾⠟⠀⠀⠀⠀⠀⠀⠀
1690
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠙⢧⡀⠈⠉⠒⠀⠀⠀⠀⠀⠀⣀⠀⠀⠀⠀⢀⠀⠀⠀⠀⠀⠐⠒⠉⠁⢀⡾⠃⠀⠀⠀⠀⠀⠀⠀⠀
1691
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⣄⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⣿⠋⠀⠀⠀⠀⠀⠀⠀⠀⣠⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1692
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢦⡀⠀⠀⠀⠀⠀⠀⠀⣸⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⢀⡴⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1693
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1694
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1695
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1696
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1697
+ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
1698
+ */
1699
+ _getSizes({ sizes } /* Table Definition */) {
1700
+ if (sizes === 'auto' || !sizes) {
1701
+ return {
1702
+ 'w-auto': true,
1703
+ };
1704
+ }
1705
+ if (typeof sizes === 'object') {
1706
+ const classes = {};
1707
+ for (const size of Object.keys(sizes)) {
1708
+ if (size === 'default') {
1709
+ classes[`w-${sizes.default}/12`] = true;
1710
+ continue;
1711
+ }
1712
+ classes[`${size}:w-${sizes[`${size}`]}/12`] = true;
1713
+ }
1714
+ return classes;
1715
+ }
1716
+ // is a number.
1717
+ return {
1718
+ [`w-${sizes}/12`]: true,
1719
+ };
1720
+ }
1721
+ }
1722
+ TableCell.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableCell, deps: [], target: i0.ɵɵFactoryTarget.Component });
1723
+ TableCell.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: TableCell, selector: "p-table-cell-ngx", inputs: { variant: "variant", index: "index", rowIndex: "rowIndex", definition: "definition", item: "item", value: "value", checkbox: "checkbox", template: "template" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<ng-container *ngIf=\"checkbox\">\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\n</ng-container>\n\n<ng-container [ngSwitch]=\"variant\">\n <p-loader\n *ngSwitchCase=\"'loading'\"\n variant=\"ghost\"\n class=\"rounded flex-1 w-full h-6\"\n ></p-loader>\n\n <div *ngSwitchCase=\"'header'\" class=\"flex\">\n <ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n </div>\n\n <div *ngSwitchCase=\"'default'\" class=\"flex\">\n <ng-container *ngIf=\"template; else valueTemplate\">\n <ng-container\n *ngTemplateOutlet=\"template; context: data\"\n ></ng-container>\n </ng-container>\n </div>\n</ng-container>\n\n<ng-template #valueTemplate>\n {{ data.value }}\n</ng-template>\n", styles: [":host{@apply flex gap-4 items-center;}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: PLoader, selector: "p-loader", inputs: ["color", "modalDescription", "modalTitle", "show", "variant"] }] });
1724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableCell, decorators: [{
1725
+ type: Component,
1726
+ args: [{ selector: 'p-table-cell-ngx', template: "<ng-container *ngIf=\"checkbox\">\n <ng-container *ngTemplateOutlet=\"checkbox\"></ng-container>\n</ng-container>\n\n<ng-container [ngSwitch]=\"variant\">\n <p-loader\n *ngSwitchCase=\"'loading'\"\n variant=\"ghost\"\n class=\"rounded flex-1 w-full h-6\"\n ></p-loader>\n\n <div *ngSwitchCase=\"'header'\" class=\"flex\">\n <ng-container *ngTemplateOutlet=\"valueTemplate\"></ng-container>\n </div>\n\n <div *ngSwitchCase=\"'default'\" class=\"flex\">\n <ng-container *ngIf=\"template; else valueTemplate\">\n <ng-container\n *ngTemplateOutlet=\"template; context: data\"\n ></ng-container>\n </ng-container>\n </div>\n</ng-container>\n\n<ng-template #valueTemplate>\n {{ data.value }}\n</ng-template>\n", styles: [":host{@apply flex gap-4 items-center;}\n"] }]
1727
+ }], propDecorators: { variant: [{
1728
+ type: Input
1729
+ }], index: [{
1730
+ type: Input
1731
+ }], rowIndex: [{
1732
+ type: Input
1733
+ }], definition: [{
1734
+ type: Input
1735
+ }], item: [{
1736
+ type: Input
1737
+ }], value: [{
1738
+ type: Input
1739
+ }], checkbox: [{
1740
+ type: Input
1741
+ }], template: [{
1742
+ type: Input
1743
+ }], class: [{
1744
+ type: HostBinding,
1745
+ args: ['class']
1746
+ }] } });
1747
+
1748
+ let TableColumn = class TableColumn {
1780
1749
  constructor(c, r, z) {
1781
1750
  this.z = z;
1782
1751
  c.detach();
1783
1752
  this.el = r.nativeElement;
1784
- proxyOutputs(this, this.el, ['pageChange', 'pageSizeChange', 'export']);
1753
+ console.log(this.el);
1754
+ proxyOutputs(this, this.el, ['tableDefinitionChanged']);
1785
1755
  }
1786
1756
  };
1787
- PTableFooter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableFooter, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1788
- PTableFooter.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableFooter, selector: "p-table-footer", inputs: { enableExport: "enableExport", enablePageSize: "enablePageSize", enablePagination: "enablePagination", hideOnSinglePage: "hideOnSinglePage", page: "page", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions", total: "total" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1789
- PTableFooter = __decorate([
1757
+ TableColumn.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableColumn, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1758
+ TableColumn.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: TableColumn, selector: "p-table-column", inputs: { align: "align", name: "name", path: "path", sizes: "sizes", type: "type", useSlot: "useSlot" }, queries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1759
+ TableColumn = __decorate([
1790
1760
  ProxyCmp({
1791
1761
  defineCustomElementFn: undefined,
1792
- inputs: ['enableExport', 'enablePageSize', 'enablePagination', 'hideOnSinglePage', 'page', 'pageSize', 'pageSizeOptions', 'total']
1762
+ inputs: ['align', 'name', 'path', 'sizes', 'type', 'useSlot'],
1793
1763
  })
1794
- ], PTableFooter);
1795
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableFooter, decorators: [{
1764
+ ], TableColumn);
1765
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableColumn, decorators: [{
1796
1766
  type: Component,
1797
1767
  args: [{
1798
- selector: 'p-table-footer',
1768
+ selector: 'p-table-column',
1799
1769
  changeDetection: ChangeDetectionStrategy.OnPush,
1800
1770
  template: '<ng-content></ng-content>',
1801
- inputs: ['enableExport', 'enablePageSize', 'enablePagination', 'hideOnSinglePage', 'page', 'pageSize', 'pageSizeOptions', 'total']
1771
+ inputs: ['align', 'name', 'path', 'sizes', 'type', 'useSlot'],
1802
1772
  }]
1803
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1804
- let PTableHeader = class PTableHeader {
1805
- constructor(c, r, z) {
1806
- this.z = z;
1807
- c.detach();
1808
- this.el = r.nativeElement;
1809
- proxyOutputs(this, this.el, ['quickFilter', 'queryChange', 'filter', 'edit']);
1773
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { template: [{
1774
+ type: ContentChild,
1775
+ args: [TemplateRef, {
1776
+ read: TemplateRef,
1777
+ static: true,
1778
+ }]
1779
+ }] } });
1780
+
1781
+ const defaultSize = 12;
1782
+ const defaultSizeOptions = [12, 24, 68, 136];
1783
+
1784
+ class TableFooterDirective extends BaseValueAccessor {
1785
+ constructor(el) {
1786
+ super(el);
1787
+ this.lastValue = {
1788
+ page: 1,
1789
+ pageSize: 12,
1790
+ };
1791
+ }
1792
+ writeValue(value) {
1793
+ this.el.nativeElement.page = this.lastValue.page =
1794
+ (value === null || value === void 0 ? void 0 : value.page) == null ? '' : value === null || value === void 0 ? void 0 : value.page;
1795
+ this.el.nativeElement.pageSize = this.lastValue.pageSize =
1796
+ (value === null || value === void 0 ? void 0 : value.pageSize) == null ? '' : value === null || value === void 0 ? void 0 : value.pageSize;
1797
+ }
1798
+ handleChange(value, type) {
1799
+ this.handleChangeEvent(Object.assign(Object.assign({}, this.lastValue), { [type]: value }));
1800
+ }
1801
+ }
1802
+ TableFooterDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableFooterDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1803
+ TableFooterDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: TableFooterDirective, selector: "p-table-footer", host: { listeners: { "pageChange": "handleChange($event.detail, \"page\")", "pageSizeChange": "handleChange($event.detail, \"pageSize\")" } }, providers: [
1804
+ {
1805
+ provide: NG_VALUE_ACCESSOR,
1806
+ useExisting: TableFooterDirective,
1807
+ multi: true,
1808
+ },
1809
+ ], usesInheritance: true, ngImport: i0 });
1810
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableFooterDirective, decorators: [{
1811
+ type: Directive,
1812
+ args: [{
1813
+ /* tslint:disable-next-line:directive-selector */
1814
+ selector: 'p-table-footer',
1815
+ host: {
1816
+ '(pageChange)': 'handleChange($event.detail, "page")',
1817
+ '(pageSizeChange)': 'handleChange($event.detail, "pageSize")',
1818
+ },
1819
+ providers: [
1820
+ {
1821
+ provide: NG_VALUE_ACCESSOR,
1822
+ useExisting: TableFooterDirective,
1823
+ multi: true,
1824
+ },
1825
+ ],
1826
+ }]
1827
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
1828
+
1829
+ class TableHeaderDirective extends BaseValueAccessor {
1830
+ constructor(el) {
1831
+ super(el);
1832
+ this.lastValue = {
1833
+ query: '',
1834
+ quickFilter: undefined,
1835
+ };
1836
+ }
1837
+ writeValue(value) {
1838
+ this.el.nativeElement.query = this.lastValue.query = value === null || value === void 0 ? void 0 : value.query;
1839
+ this.lastValue.quickFilter = value === null || value === void 0 ? void 0 : value.quickFilter;
1840
+ if (value === null || value === void 0 ? void 0 : value.quickFilter) {
1841
+ this._setActiveQuickFilter(value.quickFilter);
1842
+ }
1843
+ }
1844
+ handleChange(value, type) {
1845
+ this.handleChangeEvent(Object.assign(Object.assign({}, this.lastValue), { [type]: value }));
1846
+ if (type === 'quickFilter' && typeof value !== 'string') {
1847
+ this._setActiveQuickFilter(value);
1848
+ }
1849
+ }
1850
+ _setActiveQuickFilter(quickFilter) {
1851
+ this.el.nativeElement.activeQuickFilterIdentifier =
1852
+ quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
1853
+ }
1854
+ }
1855
+ TableHeaderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableHeaderDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
1856
+ TableHeaderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: TableHeaderDirective, selector: "p-table-header", host: { listeners: { "queryChange": "handleChange($event.detail, \"query\")", "quickFilter": "handleChange($event.detail, \"quickFilter\")" } }, providers: [
1857
+ {
1858
+ provide: NG_VALUE_ACCESSOR,
1859
+ useExisting: TableHeaderDirective,
1860
+ multi: true,
1861
+ },
1862
+ ], usesInheritance: true, ngImport: i0 });
1863
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableHeaderDirective, decorators: [{
1864
+ type: Directive,
1865
+ args: [{
1866
+ /* tslint:disable-next-line:directive-selector */
1867
+ selector: 'p-table-header',
1868
+ host: {
1869
+ '(queryChange)': 'handleChange($event.detail, "query")',
1870
+ '(quickFilter)': 'handleChange($event.detail, "quickFilter")',
1871
+ },
1872
+ providers: [
1873
+ {
1874
+ provide: NG_VALUE_ACCESSOR,
1875
+ useExisting: TableHeaderDirective,
1876
+ multi: true,
1877
+ },
1878
+ ],
1879
+ }]
1880
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
1881
+
1882
+ let TableComponent = class TableComponent {
1883
+ constructor() {
1884
+ /**
1885
+ * Wether data is loading
1886
+ */
1887
+ this.loading = false;
1888
+ /**
1889
+ * The amount of loading rows to show
1890
+ */
1891
+ this.amountOfLoadingRows = 4;
1892
+ /**
1893
+ * Wether to enable selection
1894
+ */
1895
+ this.enableRowSelection = true;
1896
+ /**
1897
+ * Wether to enable row clicking
1898
+ */
1899
+ this.enableRowClick = true;
1900
+ /**
1901
+ * The current selection of items
1902
+ */
1903
+ this.selectedRows = [];
1904
+ /**
1905
+ * Event whenever the current selection changes
1906
+ */
1907
+ this.selectedRowsChange = new EventEmitter();
1908
+ /**
1909
+ * Event whenever a row is clicked
1910
+ */
1911
+ this.rowClick = new EventEmitter();
1912
+ /**
1913
+ * Event whenever a row is selected
1914
+ */
1915
+ this.rowSelected = new EventEmitter();
1916
+ /**
1917
+ * Event whenever a row is deselected
1918
+ */
1919
+ this.rowDeselected = new EventEmitter();
1920
+ /** START HEADER */
1921
+ /**
1922
+ * Quick filters to show
1923
+ */
1924
+ this.quickFilters = [];
1925
+ /**
1926
+ * Wether to show the search input
1927
+ */
1928
+ this.enableSearch = true;
1929
+ /**
1930
+ * Wether to show the filter button
1931
+ */
1932
+ this.enableFilter = true;
1933
+ /**
1934
+ * Wether to show the edit button
1935
+ */
1936
+ this.enableEdit = true;
1937
+ /**
1938
+ * Event when one of the quick filters is clicked
1939
+ */
1940
+ this.quickFilter = new EventEmitter();
1941
+ /**
1942
+ * Event when the query changes
1943
+ */
1944
+ this.queryChange = new EventEmitter();
1945
+ /**
1946
+ * Event when the filter button is clicked
1947
+ */
1948
+ this.filter = new EventEmitter();
1949
+ /**
1950
+ * Event when the edit button is clicked
1951
+ */
1952
+ this.edit = new EventEmitter();
1953
+ /** START FOOTER */
1954
+ /**
1955
+ * Wether to enable page size select
1956
+ */
1957
+ this.enablePageSize = true;
1958
+ /**
1959
+ * Wether to enable pagination
1960
+ */
1961
+ this.enablePagination = true;
1962
+ /**
1963
+ * Wether to enable export
1964
+ */
1965
+ this.enableExport = true;
1966
+ /**
1967
+ * The current page
1968
+ */
1969
+ this.page = 1;
1970
+ /**
1971
+ * Event whenever the page changes
1972
+ */
1973
+ this.pageChange = new EventEmitter();
1974
+ /**
1975
+ * The amount of items per page
1976
+ */
1977
+ this.pageSize = defaultSize;
1978
+ /**
1979
+ * The options for the page size
1980
+ */
1981
+ this.pageSizeOptions = defaultSizeOptions;
1982
+ /**
1983
+ * Event whenever the page changes
1984
+ */
1985
+ this.pageSizeChange = new EventEmitter();
1986
+ /**
1987
+ * Event whenever the page changes
1988
+ */
1989
+ this.export = new EventEmitter();
1990
+ /**
1991
+ * Wether to hide when there is only 1 page available
1992
+ */
1993
+ this.hideOnSinglePage = true;
1994
+ this.columns = [];
1995
+ this.parsedItems = [];
1996
+ this.loadingRows = Array.from({
1997
+ length: this.amountOfLoadingRows,
1998
+ });
1999
+ this._ctrlDown = false;
2000
+ }
2001
+ set columnDefinitions(v) {
2002
+ this._columnDefinitions = v;
2003
+ this._generateColumns();
2004
+ }
2005
+ get columnDefinitions() {
2006
+ return this._columnDefinitions;
2007
+ }
2008
+ ngOnInit() {
2009
+ this._parseItems(this.items);
2010
+ // this._generateColumns();
2011
+ }
2012
+ ngOnChanges(changes) {
2013
+ if (changes['items']) {
2014
+ this._parseItems(changes['items'].currentValue);
2015
+ }
2016
+ }
2017
+ // @HostListener('body:tableDefinitionChanged', { target: 'body' })
2018
+ // onTableDefinitionUpdated() {
2019
+ // this._generateColumns();
2020
+ // }
2021
+ keyDown({ key }) {
2022
+ if (key !== 'Control' || this._ctrlDown === true) {
2023
+ return;
2024
+ }
2025
+ this._ctrlDown = true;
2026
+ }
2027
+ keyUp({ key }) {
2028
+ if (key !== 'Control' || this._ctrlDown === false) {
2029
+ return;
2030
+ }
2031
+ this._ctrlDown = false;
2032
+ }
2033
+ visibilityChange() {
2034
+ if (document.visibilityState !== 'hidden' || this._ctrlDown === false) {
2035
+ return;
2036
+ }
2037
+ this._ctrlDown = false;
2038
+ }
2039
+ onQueryChange({ detail }) {
2040
+ this.queryChange.emit(detail);
2041
+ }
2042
+ onQuickFilter({ detail }) {
2043
+ this.quickFilter.emit(detail);
2044
+ }
2045
+ onPageSizeChange({ detail }) {
2046
+ this.pageSizeChange.emit(detail);
2047
+ }
2048
+ onPageChange({ detail }) {
2049
+ this.pageChange.emit(detail);
2050
+ }
2051
+ _parseItems(items) {
2052
+ if (!items) {
2053
+ this.parsedItems = [];
2054
+ return;
2055
+ }
2056
+ if (Array.isArray(items)) {
2057
+ this.parsedItems = items;
2058
+ return;
2059
+ }
2060
+ this.parsedItems = JSON.parse(items);
2061
+ }
2062
+ _generateColumns() {
2063
+ // const definitions =
2064
+ // this._el.nativeElement.querySelectorAll('p-table-definition');
2065
+ this.columns = Array.from(this._columnDefinitions);
2066
+ }
2067
+ // private _getHeader() {
2068
+ // return (
2069
+ // <p-table-row variant="header">
2070
+ // {this._columns.map((col: TableDefinition, index) => (
2071
+ // <p-table-column
2072
+ // definition={col}
2073
+ // value={col.name}
2074
+ // variant="header"
2075
+ // checkbox={this._getCheckbox(index, null, 'header')}
2076
+ // index={index}
2077
+ // ></p-table-column>
2078
+ // ))}
2079
+ // </p-table-row>
2080
+ // );
2081
+ // }
2082
+ // private _getRows() {
2083
+ // if (this.loading) {
2084
+ // return Array.from(
2085
+ // {
2086
+ // length: this.amountOfLoadingRows,
2087
+ // },
2088
+ // (_, i) => (
2089
+ // <p-table-row
2090
+ // enableHover={
2091
+ // this.enableRowSelection || this.enableRowClick
2092
+ // }
2093
+ // >
2094
+ // {this._getLoadingColumns(i)}
2095
+ // </p-table-row>
2096
+ // )
2097
+ // );
2098
+ // }
2099
+ // return this._items.map((item, index) => (
2100
+ // <p-table-row
2101
+ // enableHover={this.enableRowSelection || this.enableRowClick}
2102
+ // onClick={(ev) => this._rowClick(ev, index)}
2103
+ // >
2104
+ // {this._getRowColumns(item, index)}
2105
+ // </p-table-row>
2106
+ // ));
2107
+ // }
2108
+ // private _getRowColumns(item, index) {
2109
+ // return this._columns.map((col: TableDefinition, colIndex) => {
2110
+ // return (
2111
+ // <p-table-column
2112
+ // definition={col}
2113
+ // item={item}
2114
+ // checkbox={this._getCheckbox(colIndex, index)}
2115
+ // index={colIndex}
2116
+ // rowIndex={index}
2117
+ // ></p-table-column>
2118
+ // );
2119
+ // });
2120
+ // }
2121
+ // private _getLoadingColumns(index) {
2122
+ // return this._columns.map((col: TableDefinition, colIndex) => {
2123
+ // return (
2124
+ // <p-table-column
2125
+ // definition={col}
2126
+ // variant="loading"
2127
+ // checkbox={this._getCheckbox(colIndex, index, 'loading')}
2128
+ // index={colIndex}
2129
+ // rowIndex={index}
2130
+ // ></p-table-column>
2131
+ // );
2132
+ // });
2133
+ // }
2134
+ // private _getCheckbox(
2135
+ // index,
2136
+ // rowIndex,
2137
+ // variant: 'header' | 'default' | 'loading' = 'default'
2138
+ // ) {
2139
+ // if (!this.enableRowSelection || !this.selectionKey || index !== 0) {
2140
+ // return;
2141
+ // }
2142
+ // if (variant === 'loading') {
2143
+ // return <p-loader variant="ghost" class="rounded w-6 h-6" />;
2144
+ // }
2145
+ // if (variant === 'header') {
2146
+ // return (
2147
+ // <input
2148
+ // class="p-input"
2149
+ // type="checkbox"
2150
+ // onChange={(ev) => this._selectAllChange(ev)}
2151
+ // checked={this._selectionContainsAll()}
2152
+ // indeterminate={this._selectionIndeterminate()}
2153
+ // />
2154
+ // );
2155
+ // }
2156
+ // const item = this._items[rowIndex];
2157
+ // return (
2158
+ // <input
2159
+ // class="p-input"
2160
+ // type="checkbox"
2161
+ // onChange={(ev) => this._checkboxChange(ev?.target, rowIndex)}
2162
+ // disabled={this.canSelectKey && !item[this.canSelectKey]}
2163
+ // checked={this._selectionContains(item, rowIndex)}
2164
+ // />
2165
+ // );
2166
+ // }
2167
+ _checkboxDisabled(item) {
2168
+ return this.canSelectKey && !item[this.canSelectKey];
2169
+ }
2170
+ _selectAllChange($event) {
2171
+ if (!this.enableRowSelection) {
2172
+ return;
2173
+ }
2174
+ const value = this._getCheckedValue($event.target);
2175
+ if (value) {
2176
+ const toAdd = [];
2177
+ for (let i = 0; i < this.parsedItems.length; i++) {
2178
+ const row = this.parsedItems[i];
2179
+ if (this.canSelectKey && !row[this.canSelectKey]) {
2180
+ continue;
2181
+ }
2182
+ if (this._selectionContains(row, i)) {
2183
+ continue;
2184
+ }
2185
+ toAdd.push(row);
2186
+ this.rowSelected.emit(row);
2187
+ }
2188
+ this.selectedRows = [...this.selectedRows, ...toAdd];
2189
+ this.selectedRowsChange.emit(this.selectedRows);
2190
+ return;
2191
+ }
2192
+ for (let i = 0; i < this.selectedRows.length; i++) {
2193
+ const value = this.selectedRows[i];
2194
+ const row = this.parsedItems.find((d) => this._getSelectionValue(d, i) ===
2195
+ this._getSelectionValue(value, i));
2196
+ if (!row) {
2197
+ continue;
2198
+ }
2199
+ this.rowDeselected.emit(row);
2200
+ }
2201
+ this.selectedRows = [];
2202
+ this.selectedRowsChange.emit(this.selectedRows);
2203
+ }
2204
+ _checkboxChange(target, index) {
2205
+ if (!this.enableRowSelection) {
2206
+ return;
2207
+ }
2208
+ const row = this.parsedItems[index];
2209
+ if (this.canSelectKey && !row[this.canSelectKey]) {
2210
+ target.checked = false;
2211
+ return;
2212
+ }
2213
+ const value = this._getCheckedValue(target);
2214
+ if (value) {
2215
+ this.selectedRows = [...this.selectedRows, row];
2216
+ this.selectedRowsChange.emit(this.selectedRows);
2217
+ this.rowSelected.emit(row);
2218
+ return;
2219
+ }
2220
+ const indexOfToRemove = this._selectionContains(row, index, true);
2221
+ // we need to do this, because splice does not trigger the selection setter.
2222
+ const selection = [...this.selectedRows];
2223
+ selection.splice(indexOfToRemove, 1);
2224
+ this.selectedRows = selection;
2225
+ this.selectedRowsChange.emit(this.selectedRows);
2226
+ this.rowDeselected.emit(row);
2227
+ }
2228
+ _getCheckedValue(target) {
2229
+ return target === null || target === void 0 ? void 0 : target.checked;
2230
+ }
2231
+ _getSelectionValue(row, index) {
2232
+ return this.selectionKey ? (row === null || row === void 0 ? void 0 : row[this.selectionKey]) || index : index;
2233
+ }
2234
+ _selectionContains(row, index, returnIndex = false) {
2235
+ const returnValue = this.selectedRows.findIndex((item) => this._getSelectionValue(row, index) ===
2236
+ this._getSelectionValue(item, index));
2237
+ return !returnIndex ? returnValue >= 0 : returnValue;
2238
+ }
2239
+ _selectionContainsAll() {
2240
+ var _a, _b;
2241
+ let returnValue = true;
2242
+ if (!((_a = this.parsedItems) === null || _a === void 0 ? void 0 : _a.length)) {
2243
+ return false;
2244
+ }
2245
+ for (let i = 0; i < ((_b = this.parsedItems) === null || _b === void 0 ? void 0 : _b.length); i++) {
2246
+ const item = this.parsedItems[i];
2247
+ const contains = this._selectionContains(item, i);
2248
+ if (!contains) {
2249
+ returnValue = false;
2250
+ break;
2251
+ }
2252
+ }
2253
+ return returnValue;
2254
+ }
2255
+ _selectionIndeterminate() {
2256
+ var _a, _b, _c;
2257
+ if (!((_a = this.parsedItems) === null || _a === void 0 ? void 0 : _a.length) || !((_b = this.selectedRows) === null || _b === void 0 ? void 0 : _b.length)) {
2258
+ return false;
2259
+ }
2260
+ let containsCount = 0;
2261
+ for (let i = 0; i < ((_c = this.parsedItems) === null || _c === void 0 ? void 0 : _c.length); i++) {
2262
+ const item = this.parsedItems[i];
2263
+ const contains = this._selectionContains(item, i);
2264
+ if (contains) {
2265
+ containsCount++;
2266
+ }
2267
+ }
2268
+ return containsCount > 0 && containsCount !== this.parsedItems.length;
2269
+ }
2270
+ _rowClick($event, index) {
2271
+ const target = $event.target;
2272
+ if (target.tagName.toLowerCase() === 'input' ||
2273
+ target.type === 'checkbox') {
2274
+ return;
2275
+ }
2276
+ const row = this._findRow($event.target);
2277
+ if (this.enableRowClick) {
2278
+ const action = this._findRowAction($event.target);
2279
+ if (action) {
2280
+ return;
2281
+ }
2282
+ const item = this.parsedItems[index];
2283
+ this.rowClick.emit({
2284
+ item,
2285
+ ctrlDown: this._ctrlDown,
2286
+ });
2287
+ return;
2288
+ }
2289
+ if (!this.enableRowSelection) {
2290
+ return;
2291
+ }
2292
+ const checkbox = row === null || row === void 0 ? void 0 : row.querySelector('input[type="checkbox"]');
2293
+ if (!checkbox) {
2294
+ return;
2295
+ }
2296
+ checkbox.checked = !checkbox.checked;
2297
+ this._checkboxChange(checkbox, index);
2298
+ }
2299
+ _findRow(el) {
2300
+ var _a;
2301
+ if (!el) {
2302
+ return el;
2303
+ }
2304
+ if (((_a = el === null || el === void 0 ? void 0 : el.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'p-table-row') {
2305
+ return el;
2306
+ }
2307
+ return this._findRow(el === null || el === void 0 ? void 0 : el.parentElement);
2308
+ }
2309
+ _findRowAction(el) {
2310
+ var _a;
2311
+ if (!el) {
2312
+ return null;
2313
+ }
2314
+ if (el.getAttribute('data-is-action') !== null &&
2315
+ el.getAttribute('data-is-action') !== 'false') {
2316
+ return el;
2317
+ }
2318
+ if (((_a = el === null || el === void 0 ? void 0 : el.tagName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'p-table-row') {
2319
+ return null;
2320
+ }
2321
+ return this._findRowAction(el === null || el === void 0 ? void 0 : el.parentElement);
2322
+ }
2323
+ };
2324
+ TableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2325
+ TableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: TableComponent, selector: "p-table-ngx", inputs: { items: "items", loading: "loading", amountOfLoadingRows: "amountOfLoadingRows", enableRowSelection: "enableRowSelection", enableRowClick: "enableRowClick", selectedRows: "selectedRows", selectionKey: "selectionKey", canSelectKey: "canSelectKey", quickFilters: "quickFilters", activeQuickFilterIdentifier: "activeQuickFilterIdentifier", enableSearch: "enableSearch", query: "query", enableFilter: "enableFilter", selectedFiltersAmount: "selectedFiltersAmount", filterButtonTemplate: "filterButtonTemplate", enableEdit: "enableEdit", editButtonTemplate: "editButtonTemplate", enablePageSize: "enablePageSize", enablePagination: "enablePagination", enableExport: "enableExport", page: "page", total: "total", pageSize: "pageSize", pageSizeOptions: "pageSizeOptions", hideOnSinglePage: "hideOnSinglePage" }, outputs: { selectedRowsChange: "selectedRowsChange", rowClick: "rowClick", rowSelected: "rowSelected", rowDeselected: "rowDeselected", quickFilter: "quickFilter", queryChange: "queryChange", filter: "filter", edit: "edit", pageChange: "pageChange", pageSizeChange: "pageSizeChange", export: "export" }, host: { listeners: { "document:keydown": "keyDown($event)", "document:keyup": "keyUp($event)", "document:visibilitychange": "visibilityChange($event)" } }, queries: [{ propertyName: "columnDefinitions", predicate: TableColumn }], usesOnChanges: true, ngImport: i0, template: "<p-table-container>\n <p-table-header\n [quickFilters]=\"quickFilters\"\n [activeQuickFilterIdentifier]=\"activeQuickFilterIdentifier\"\n (onQuickFilter)=\"(onQuickFilter)\"\n [enableSearch]=\"enableSearch\"\n [query]=\"query\"\n (onQueryChange)=\"(onQueryChange)\"\n [enableFilter]=\"enableFilter\"\n [selectedFiltersAmount]=\"selectedFiltersAmount\"\n [filterButtonTemplate]=\"filterButtonTemplate\"\n (onFilter)=\"filter.emit()\"\n [enableEdit]=\"enableEdit\"\n [canEdit]=\"!!selectedRows.length\"\n [editButtonTemplate]=\"editButtonTemplate\"\n (onEdit)=\"edit.emit()\"\n [itemsSelectedAmount]=\"selectedRows.length\"\n ></p-table-header>\n\n <p-table-row variant=\"header\">\n <ng-container *ngFor=\"let col of columns; let index = index\">\n <p-table-cell-ngx\n [definition]=\"col\"\n [value]=\"col.name\"\n variant=\"header\"\n [index]=\"index\"\n [checkbox]=\"index === 0 ? checkboxTemplate : undefined\"\n ></p-table-cell-ngx>\n <ng-template #checkboxTemplate>\n <input\n class=\"p-input\"\n type=\"checkbox\"\n (change)=\"_selectAllChange($event)\"\n [checked]=\"_selectionContainsAll()\"\n [indeterminate]=\"_selectionIndeterminate()\"\n />\n </ng-template>\n </ng-container>\n </p-table-row>\n\n <div class=\"flex flex-col\">\n <ng-container *ngIf=\"loading; else contentTemplate\">\n <p-table-row\n *ngFor=\"let r of loadingRows; let rowIndex = index\"\n [enableHover]=\"enableRowSelection || enableRowClick\"\n >\n <ng-container *ngFor=\"let col of columns; let index = index\">\n <p-table-cell-ngx\n [definition]=\"col\"\n variant=\"loading\"\n [checkbox]=\"index === 0 ? checkboxTemplate : undefined\"\n [index]=\"index\"\n [rowIndex]=\"rowIndex\"\n ></p-table-cell-ngx>\n <ng-template #checkboxTemplate>\n <p-loader\n variant=\"ghost\"\n class=\"rounded w-6 h-6\"\n ></p-loader>\n </ng-template>\n </ng-container>\n </p-table-row>\n </ng-container>\n\n <ng-template #contentTemplate>\n <p-table-row\n *ngFor=\"let item of items; let rowIndex = index\"\n [enableHover]=\"enableRowSelection || enableRowClick\"\n (click)=\"_rowClick($event, rowIndex)\"\n >\n <ng-container *ngFor=\"let col of columns; let index = index\">\n <p-table-cell-ngx\n [definition]=\"col\"\n [item]=\"item\"\n [checkbox]=\"index === 0 ? checkboxTemplate : undefined\"\n [index]=\"index\"\n [rowIndex]=\"rowIndex\"\n [template]=\"col.template\"\n ></p-table-cell-ngx>\n\n <ng-template #checkboxTemplate>\n <input\n class=\"p-input\"\n type=\"checkbox\"\n (change)=\"_checkboxChange($event.target, rowIndex)\"\n [disabled]=\"_checkboxDisabled(item)\"\n [checked]=\"_selectionContains(item, rowIndex)\"\n />\n </ng-template>\n </ng-container>\n </p-table-row>\n </ng-template>\n </div>\n\n <p-table-footer\n [hideOnSinglePage]=\"hideOnSinglePage\"\n [enablePageSize]=\"enablePageSize\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (onPageSizeChange)=\"(pageSizeChange)\"\n [enablePagination]=\"enablePagination\"\n [page]=\"page\"\n [total]=\"total\"\n (onPageChange)=\"(pageChange)\"\n [enableExport]=\"enableExport\"\n (onExport)=\"export.emit()\"\n ></p-table-footer>\n</p-table-container>\n", styles: [":host{@apply flex flex-col;}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PLoader, selector: "p-loader", inputs: ["color", "modalDescription", "modalTitle", "show", "variant"] }, { kind: "component", type: PTableContainer, selector: "p-table-container" }, { kind: "component", type: PTableFooter, selector: "p-table-footer", inputs: ["enableExport", "enablePageSize", "enablePagination", "hideOnSinglePage", "page", "pageSize", "pageSizeOptions", "total"] }, { kind: "component", type: PTableHeader, selector: "p-table-header", inputs: ["activeQuickFilterIdentifier", "canEdit", "editButtonTemplate", "enableEdit", "enableFilter", "enableSearch", "filterButtonTemplate", "itemsSelectedAmount", "query", "quickFilters", "selectedFiltersAmount"] }, { kind: "component", type: PTableRow, selector: "p-table-row", inputs: ["enableHover", "variant"] }, { kind: "component", type: TableCell, selector: "p-table-cell-ngx", inputs: ["variant", "index", "rowIndex", "definition", "item", "value", "checkbox", "template"] }, { kind: "directive", type: TableFooterDirective, selector: "p-table-footer" }, { kind: "directive", type: TableHeaderDirective, selector: "p-table-header" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2326
+ TableComponent = __decorate([
2327
+ UntilDestroy({ checkProperties: true })
2328
+ ], TableComponent);
2329
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableComponent, decorators: [{
2330
+ type: Component,
2331
+ args: [{ selector: 'p-table-ngx', changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-table-container>\n <p-table-header\n [quickFilters]=\"quickFilters\"\n [activeQuickFilterIdentifier]=\"activeQuickFilterIdentifier\"\n (onQuickFilter)=\"(onQuickFilter)\"\n [enableSearch]=\"enableSearch\"\n [query]=\"query\"\n (onQueryChange)=\"(onQueryChange)\"\n [enableFilter]=\"enableFilter\"\n [selectedFiltersAmount]=\"selectedFiltersAmount\"\n [filterButtonTemplate]=\"filterButtonTemplate\"\n (onFilter)=\"filter.emit()\"\n [enableEdit]=\"enableEdit\"\n [canEdit]=\"!!selectedRows.length\"\n [editButtonTemplate]=\"editButtonTemplate\"\n (onEdit)=\"edit.emit()\"\n [itemsSelectedAmount]=\"selectedRows.length\"\n ></p-table-header>\n\n <p-table-row variant=\"header\">\n <ng-container *ngFor=\"let col of columns; let index = index\">\n <p-table-cell-ngx\n [definition]=\"col\"\n [value]=\"col.name\"\n variant=\"header\"\n [index]=\"index\"\n [checkbox]=\"index === 0 ? checkboxTemplate : undefined\"\n ></p-table-cell-ngx>\n <ng-template #checkboxTemplate>\n <input\n class=\"p-input\"\n type=\"checkbox\"\n (change)=\"_selectAllChange($event)\"\n [checked]=\"_selectionContainsAll()\"\n [indeterminate]=\"_selectionIndeterminate()\"\n />\n </ng-template>\n </ng-container>\n </p-table-row>\n\n <div class=\"flex flex-col\">\n <ng-container *ngIf=\"loading; else contentTemplate\">\n <p-table-row\n *ngFor=\"let r of loadingRows; let rowIndex = index\"\n [enableHover]=\"enableRowSelection || enableRowClick\"\n >\n <ng-container *ngFor=\"let col of columns; let index = index\">\n <p-table-cell-ngx\n [definition]=\"col\"\n variant=\"loading\"\n [checkbox]=\"index === 0 ? checkboxTemplate : undefined\"\n [index]=\"index\"\n [rowIndex]=\"rowIndex\"\n ></p-table-cell-ngx>\n <ng-template #checkboxTemplate>\n <p-loader\n variant=\"ghost\"\n class=\"rounded w-6 h-6\"\n ></p-loader>\n </ng-template>\n </ng-container>\n </p-table-row>\n </ng-container>\n\n <ng-template #contentTemplate>\n <p-table-row\n *ngFor=\"let item of items; let rowIndex = index\"\n [enableHover]=\"enableRowSelection || enableRowClick\"\n (click)=\"_rowClick($event, rowIndex)\"\n >\n <ng-container *ngFor=\"let col of columns; let index = index\">\n <p-table-cell-ngx\n [definition]=\"col\"\n [item]=\"item\"\n [checkbox]=\"index === 0 ? checkboxTemplate : undefined\"\n [index]=\"index\"\n [rowIndex]=\"rowIndex\"\n [template]=\"col.template\"\n ></p-table-cell-ngx>\n\n <ng-template #checkboxTemplate>\n <input\n class=\"p-input\"\n type=\"checkbox\"\n (change)=\"_checkboxChange($event.target, rowIndex)\"\n [disabled]=\"_checkboxDisabled(item)\"\n [checked]=\"_selectionContains(item, rowIndex)\"\n />\n </ng-template>\n </ng-container>\n </p-table-row>\n </ng-template>\n </div>\n\n <p-table-footer\n [hideOnSinglePage]=\"hideOnSinglePage\"\n [enablePageSize]=\"enablePageSize\"\n [pageSize]=\"pageSize\"\n [pageSizeOptions]=\"pageSizeOptions\"\n (onPageSizeChange)=\"(pageSizeChange)\"\n [enablePagination]=\"enablePagination\"\n [page]=\"page\"\n [total]=\"total\"\n (onPageChange)=\"(pageChange)\"\n [enableExport]=\"enableExport\"\n (onExport)=\"export.emit()\"\n ></p-table-footer>\n</p-table-container>\n", styles: [":host{@apply flex flex-col;}\n"] }]
2332
+ }], ctorParameters: function () { return []; }, propDecorators: { items: [{
2333
+ type: Input
2334
+ }], loading: [{
2335
+ type: Input
2336
+ }], amountOfLoadingRows: [{
2337
+ type: Input
2338
+ }], enableRowSelection: [{
2339
+ type: Input
2340
+ }], enableRowClick: [{
2341
+ type: Input
2342
+ }], selectedRows: [{
2343
+ type: Input
2344
+ }], selectedRowsChange: [{
2345
+ type: Output
2346
+ }], selectionKey: [{
2347
+ type: Input
2348
+ }], canSelectKey: [{
2349
+ type: Input
2350
+ }], rowClick: [{
2351
+ type: Output
2352
+ }], rowSelected: [{
2353
+ type: Output
2354
+ }], rowDeselected: [{
2355
+ type: Output
2356
+ }], quickFilters: [{
2357
+ type: Input
2358
+ }], activeQuickFilterIdentifier: [{
2359
+ type: Input
2360
+ }], enableSearch: [{
2361
+ type: Input
2362
+ }], query: [{
2363
+ type: Input
2364
+ }], enableFilter: [{
2365
+ type: Input
2366
+ }], selectedFiltersAmount: [{
2367
+ type: Input
2368
+ }], filterButtonTemplate: [{
2369
+ type: Input
2370
+ }], enableEdit: [{
2371
+ type: Input
2372
+ }], editButtonTemplate: [{
2373
+ type: Input
2374
+ }], quickFilter: [{
2375
+ type: Output
2376
+ }], queryChange: [{
2377
+ type: Output
2378
+ }], filter: [{
2379
+ type: Output
2380
+ }], edit: [{
2381
+ type: Output
2382
+ }], enablePageSize: [{
2383
+ type: Input
2384
+ }], enablePagination: [{
2385
+ type: Input
2386
+ }], enableExport: [{
2387
+ type: Input
2388
+ }], page: [{
2389
+ type: Input
2390
+ }], total: [{
2391
+ type: Input
2392
+ }], pageChange: [{
2393
+ type: Output
2394
+ }], pageSize: [{
2395
+ type: Input
2396
+ }], pageSizeOptions: [{
2397
+ type: Input
2398
+ }], pageSizeChange: [{
2399
+ type: Output
2400
+ }], export: [{
2401
+ type: Output
2402
+ }], hideOnSinglePage: [{
2403
+ type: Input
2404
+ }], columnDefinitions: [{
2405
+ type: ContentChildren,
2406
+ args: [TableColumn]
2407
+ }], keyDown: [{
2408
+ type: HostListener,
2409
+ args: ['document:keydown', ['$event']]
2410
+ }], keyUp: [{
2411
+ type: HostListener,
2412
+ args: ['document:keyup', ['$event']]
2413
+ }], visibilityChange: [{
2414
+ type: HostListener,
2415
+ args: ['document:visibilitychange', ['$event']]
2416
+ }] } });
2417
+
2418
+ const COMPONENTS = [TableComponent, TableColumn, TableCell];
2419
+
2420
+ class PageSizeSelectDirective extends BaseValueAccessor {
2421
+ constructor(el) {
2422
+ super(el);
2423
+ }
2424
+ writeValue(value) {
2425
+ this.el.nativeElement.page = this.lastValue =
2426
+ value == null ? '' : value;
1810
2427
  }
1811
- };
1812
- PTableHeader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableHeader, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1813
- PTableHeader.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableHeader, selector: "p-table-header", inputs: { activeQuickFilterIdentifier: "activeQuickFilterIdentifier", canEdit: "canEdit", editButtonTemplate: "editButtonTemplate", enableEdit: "enableEdit", enableFilter: "enableFilter", enableSearch: "enableSearch", filterButtonTemplate: "filterButtonTemplate", itemsSelectedAmount: "itemsSelectedAmount", query: "query", quickFilters: "quickFilters", selectedFiltersAmount: "selectedFiltersAmount" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1814
- PTableHeader = __decorate([
1815
- ProxyCmp({
1816
- defineCustomElementFn: undefined,
1817
- inputs: ['activeQuickFilterIdentifier', 'canEdit', 'editButtonTemplate', 'enableEdit', 'enableFilter', 'enableSearch', 'filterButtonTemplate', 'itemsSelectedAmount', 'query', 'quickFilters', 'selectedFiltersAmount']
1818
- })
1819
- ], PTableHeader);
1820
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableHeader, decorators: [{
1821
- type: Component,
2428
+ registerOnChange(fn) {
2429
+ super.registerOnChange((value) => fn(value === '' ? null : parseInt(value, 10)));
2430
+ }
2431
+ }
2432
+ PageSizeSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PageSizeSelectDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
2433
+ PageSizeSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: PageSizeSelectDirective, selector: "p-page-size-select", host: { listeners: { "sizeChange": "handleChangeEvent($event.detail)" } }, providers: [
2434
+ {
2435
+ provide: NG_VALUE_ACCESSOR,
2436
+ useExisting: PageSizeSelectDirective,
2437
+ multi: true,
2438
+ },
2439
+ ], usesInheritance: true, ngImport: i0 });
2440
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PageSizeSelectDirective, decorators: [{
2441
+ type: Directive,
1822
2442
  args: [{
1823
- selector: 'p-table-header',
1824
- changeDetection: ChangeDetectionStrategy.OnPush,
1825
- template: '<ng-content></ng-content>',
1826
- inputs: ['activeQuickFilterIdentifier', 'canEdit', 'editButtonTemplate', 'enableEdit', 'enableFilter', 'enableSearch', 'filterButtonTemplate', 'itemsSelectedAmount', 'query', 'quickFilters', 'selectedFiltersAmount']
2443
+ /* tslint:disable-next-line:directive-selector */
2444
+ selector: 'p-page-size-select',
2445
+ host: {
2446
+ '(sizeChange)': 'handleChangeEvent($event.detail)',
2447
+ },
2448
+ providers: [
2449
+ {
2450
+ provide: NG_VALUE_ACCESSOR,
2451
+ useExisting: PageSizeSelectDirective,
2452
+ multi: true,
2453
+ },
2454
+ ],
1827
2455
  }]
1828
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1829
- let PTableRow = class PTableRow {
1830
- constructor(c, r, z) {
1831
- this.z = z;
1832
- c.detach();
1833
- this.el = r.nativeElement;
2456
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
2457
+
2458
+ class PaginationDirective extends BaseValueAccessor {
2459
+ constructor(el) {
2460
+ super(el);
1834
2461
  }
1835
- };
1836
- PTableRow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableRow, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1837
- PTableRow.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTableRow, selector: "p-table-row", inputs: { enableHover: "enableHover", variant: "variant" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1838
- PTableRow = __decorate([
1839
- ProxyCmp({
1840
- defineCustomElementFn: undefined,
1841
- inputs: ['enableHover', 'variant']
1842
- })
1843
- ], PTableRow);
1844
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTableRow, decorators: [{
1845
- type: Component,
2462
+ writeValue(value) {
2463
+ this.el.nativeElement.page = this.lastValue =
2464
+ value == null ? '' : value;
2465
+ }
2466
+ registerOnChange(fn) {
2467
+ super.registerOnChange((value) => fn(value === '' ? null : parseInt(value, 10)));
2468
+ }
2469
+ }
2470
+ PaginationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaginationDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
2471
+ PaginationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: PaginationDirective, selector: "p-pagination", host: { listeners: { "pageChange": "handleChangeEvent($event.detail)" } }, providers: [
2472
+ {
2473
+ provide: NG_VALUE_ACCESSOR,
2474
+ useExisting: PaginationDirective,
2475
+ multi: true,
2476
+ },
2477
+ ], usesInheritance: true, ngImport: i0 });
2478
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaginationDirective, decorators: [{
2479
+ type: Directive,
1846
2480
  args: [{
1847
- selector: 'p-table-row',
1848
- changeDetection: ChangeDetectionStrategy.OnPush,
1849
- template: '<ng-content></ng-content>',
1850
- inputs: ['enableHover', 'variant']
2481
+ /* tslint:disable-next-line:directive-selector */
2482
+ selector: 'p-pagination',
2483
+ host: {
2484
+ '(pageChange)': 'handleChangeEvent($event.detail)',
2485
+ },
2486
+ providers: [
2487
+ {
2488
+ provide: NG_VALUE_ACCESSOR,
2489
+ useExisting: PaginationDirective,
2490
+ multi: true,
2491
+ },
2492
+ ],
1851
2493
  }]
1852
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1853
- let PToastContainer = class PToastContainer {
1854
- constructor(c, r, z) {
1855
- this.z = z;
1856
- c.detach();
1857
- this.el = r.nativeElement;
2494
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
2495
+
2496
+ class SelectDirective extends BaseValueAccessor {
2497
+ constructor(el) {
2498
+ super(el);
2499
+ console.log(el);
1858
2500
  }
1859
- };
1860
- PToastContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PToastContainer, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1861
- PToastContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PToastContainer, selector: "p-toast-container", inputs: { placement: "placement" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1862
- PToastContainer = __decorate([
1863
- ProxyCmp({
1864
- defineCustomElementFn: undefined,
1865
- inputs: ['placement']
1866
- })
1867
- ], PToastContainer);
1868
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PToastContainer, decorators: [{
1869
- type: Component,
2501
+ writeValue(value) {
2502
+ console.log(value);
2503
+ this.el.nativeElement.value = this.lastValue =
2504
+ value == null ? '' : value;
2505
+ }
2506
+ }
2507
+ SelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: SelectDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
2508
+ SelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: SelectDirective, selector: "p-select", host: { listeners: { "valueChange": "handleChangeEvent($event.detail)" } }, providers: [
2509
+ {
2510
+ provide: NG_VALUE_ACCESSOR,
2511
+ useExisting: SelectDirective,
2512
+ multi: true,
2513
+ },
2514
+ ], usesInheritance: true, ngImport: i0 });
2515
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: SelectDirective, decorators: [{
2516
+ type: Directive,
1870
2517
  args: [{
1871
- selector: 'p-toast-container',
1872
- changeDetection: ChangeDetectionStrategy.OnPush,
1873
- template: '<ng-content></ng-content>',
1874
- inputs: ['placement']
2518
+ selector: 'p-select',
2519
+ host: {
2520
+ '(valueChange)': 'handleChangeEvent($event.detail)',
2521
+ },
2522
+ providers: [
2523
+ {
2524
+ provide: NG_VALUE_ACCESSOR,
2525
+ useExisting: SelectDirective,
2526
+ multi: true,
2527
+ },
2528
+ ],
1875
2529
  }]
1876
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
1877
- let PTooltip = class PTooltip {
1878
- constructor(c, r, z) {
1879
- this.z = z;
1880
- c.detach();
1881
- this.el = r.nativeElement;
1882
- proxyOutputs(this, this.el, ['isOpen']);
2530
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
2531
+
2532
+ class TableDirective extends BaseValueAccessor {
2533
+ constructor(el) {
2534
+ super(el);
2535
+ this.lastValue = {
2536
+ query: '',
2537
+ quickFilter: undefined,
2538
+ page: 1,
2539
+ pageSize: 12,
2540
+ selectedRows: [],
2541
+ };
1883
2542
  }
1884
- };
1885
- PTooltip.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTooltip, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
1886
- PTooltip.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: PTooltip, selector: "p-tooltip", inputs: { canManuallyClose: "canManuallyClose", placement: "placement", popover: "popover", show: "show", strategy: "strategy", variant: "variant" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
1887
- PTooltip = __decorate([
1888
- ProxyCmp({
1889
- defineCustomElementFn: undefined,
1890
- inputs: ['canManuallyClose', 'placement', 'popover', 'show', 'strategy', 'variant']
1891
- })
1892
- ], PTooltip);
1893
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PTooltip, decorators: [{
1894
- type: Component,
2543
+ writeValue(value) {
2544
+ this.el.nativeElement.query = this.lastValue.query = value === null || value === void 0 ? void 0 : value.query;
2545
+ this.lastValue.quickFilter = value === null || value === void 0 ? void 0 : value.quickFilter;
2546
+ this.el.nativeElement.page = this.lastValue.page =
2547
+ (value === null || value === void 0 ? void 0 : value.page) == null ? 1 : value === null || value === void 0 ? void 0 : value.page;
2548
+ this.el.nativeElement.pageSize = this.lastValue.pageSize =
2549
+ (value === null || value === void 0 ? void 0 : value.pageSize) == null ? 12 : value === null || value === void 0 ? void 0 : value.pageSize;
2550
+ this.lastValue.selectedRows =
2551
+ (value === null || value === void 0 ? void 0 : value.selectedRows) == null ? [] : value === null || value === void 0 ? void 0 : value.selectedRows;
2552
+ if (value === null || value === void 0 ? void 0 : value.quickFilter) {
2553
+ this._setActiveQuickFilter(value.quickFilter);
2554
+ }
2555
+ }
2556
+ registerOnChange(fn) {
2557
+ this.onChange = fn;
2558
+ }
2559
+ registerOnTouched(fn) {
2560
+ this.onTouched = fn;
2561
+ }
2562
+ handleChange(value, type) {
2563
+ this.handleChangeEvent(Object.assign(Object.assign({}, this.lastValue), { [type]: value }));
2564
+ if (type === 'quickFilter' && typeof value === 'object') {
2565
+ this._setActiveQuickFilter(value);
2566
+ }
2567
+ }
2568
+ _setActiveQuickFilter(quickFilter) {
2569
+ this.el.nativeElement.activeQuickFilterIdentifier =
2570
+ quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.identifier;
2571
+ }
2572
+ }
2573
+ TableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
2574
+ TableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.7", type: TableDirective, selector: "p-table", host: { listeners: { "queryChange": "handleChange($event.detail, \"query\")", "quickFilter": "handleChange($event.detail, \"quickFilter\")", "pageChange": "handleChange($event.detail, \"page\")", "pageSizeChange": "handleChange($event.detail, \"pageSize\")", "selectedRowsChange": "handleChange($event.detail, \"selectedRows\")" } }, providers: [
2575
+ {
2576
+ provide: NG_VALUE_ACCESSOR,
2577
+ useExisting: TableDirective,
2578
+ multi: true,
2579
+ },
2580
+ ], usesInheritance: true, ngImport: i0 });
2581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TableDirective, decorators: [{
2582
+ type: Directive,
1895
2583
  args: [{
1896
- selector: 'p-tooltip',
1897
- changeDetection: ChangeDetectionStrategy.OnPush,
1898
- template: '<ng-content></ng-content>',
1899
- inputs: ['canManuallyClose', 'placement', 'popover', 'show', 'strategy', 'variant']
2584
+ /* tslint:disable-next-line:directive-selector */
2585
+ selector: 'p-table',
2586
+ host: {
2587
+ '(queryChange)': 'handleChange($event.detail, "query")',
2588
+ '(quickFilter)': 'handleChange($event.detail, "quickFilter")',
2589
+ '(pageChange)': 'handleChange($event.detail, "page")',
2590
+ '(pageSizeChange)': 'handleChange($event.detail, "pageSize")',
2591
+ '(selectedRowsChange)': 'handleChange($event.detail, "selectedRows")',
2592
+ },
2593
+ providers: [
2594
+ {
2595
+ provide: NG_VALUE_ACCESSOR,
2596
+ useExisting: TableDirective,
2597
+ multi: true,
2598
+ },
2599
+ ],
1900
2600
  }]
1901
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }]; } });
2601
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
2602
+
2603
+ // Custom directives
2604
+ const CUSTOM_DIRECTIVES = [
2605
+ PaginationDirective,
2606
+ PageSizeSelectDirective,
2607
+ TableFooterDirective,
2608
+ TableHeaderDirective,
2609
+ TableDirective,
2610
+ SelectDirective,
2611
+ ];
1902
2612
 
1903
2613
  const DIRECTIVES = [
1904
2614
  PAccordion,
@@ -1944,7 +2654,6 @@ const DIRECTIVES = [
1944
2654
  PStepperLine,
1945
2655
  PTabGroup,
1946
2656
  PTabItem,
1947
- PTableColumn,
1948
2657
  PTableContainer,
1949
2658
  PTableFooter,
1950
2659
  PTableHeader,
@@ -1956,13 +2665,14 @@ const DIRECTIVES = [
1956
2665
  class PaperlessModule {
1957
2666
  }
1958
2667
  PaperlessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaperlessModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1959
- PaperlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: PaperlessModule, declarations: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableColumn, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToastContainer, PTooltip, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective, TableDirective, SelectDirective], exports: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableColumn, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToastContainer, PTooltip, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective, TableDirective, SelectDirective] });
1960
- PaperlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaperlessModule });
2668
+ PaperlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: PaperlessModule, declarations: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToastContainer, PTooltip, TableComponent, TableColumn, TableCell, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective, TableDirective, SelectDirective], imports: [CommonModule], exports: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToastContainer, PTooltip, TableComponent, TableColumn, TableCell, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective, TableDirective, SelectDirective] });
2669
+ PaperlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaperlessModule, imports: [CommonModule] });
1961
2670
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: PaperlessModule, decorators: [{
1962
2671
  type: NgModule,
1963
2672
  args: [{
1964
- declarations: [...DIRECTIVES, ...CUSTOM_DIRECTIVES],
1965
- exports: [...DIRECTIVES, ...CUSTOM_DIRECTIVES],
2673
+ imports: [CommonModule],
2674
+ declarations: [...DIRECTIVES, ...COMPONENTS, ...CUSTOM_DIRECTIVES],
2675
+ exports: [...DIRECTIVES, ...COMPONENTS, ...CUSTOM_DIRECTIVES],
1966
2676
  }]
1967
2677
  }] });
1968
2678
 
@@ -1974,5 +2684,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImpor
1974
2684
  * Generated bundle index. Do not edit.
1975
2685
  */
1976
2686
 
1977
- export { BaseTableComponent, BaseUploadComponent, BaseValueAccessor, CUSTOM_DIRECTIVES, FormBaseComponent, PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableColumn, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToastContainer, PTooltip, PageSizeSelectDirective, PaginationDirective, PaperlessModule, SelectDirective, TableDirective, TableFooterDirective, TableHeaderDirective };
2687
+ export { BaseTableComponent, BaseUploadComponent, BaseValueAccessor, COMPONENTS, CUSTOM_DIRECTIVES, FormBaseComponent, PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLabel, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSelect, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTableContainer, PTableFooter, PTableHeader, PTableRow, PToastContainer, PTooltip, PageSizeSelectDirective, PaginationDirective, PaperlessModule, SelectDirective, TableCell, TableColumn, TableComponent, TableDirective, TableFooterDirective, TableHeaderDirective };
1978
2688
  //# sourceMappingURL=paperless-angular.mjs.map