@paperless/angular 0.1.0-alpha.131 → 0.1.0-alpha.132

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.
@@ -530,11 +530,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
530
530
  }]
531
531
  }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
532
532
 
533
+ class TableDirective extends BaseValueAccessor {
534
+ constructor(el) {
535
+ super(el);
536
+ this.lastValue = {
537
+ query: '',
538
+ quickFilter: undefined,
539
+ page: 1,
540
+ pageSize: 12,
541
+ selectedRows: [],
542
+ };
543
+ }
544
+ writeValue(value) {
545
+ this.el.nativeElement.query = this.lastValue.query = value?.query;
546
+ this.lastValue.quickFilter = value?.quickFilter;
547
+ this.el.nativeElement.page = this.lastValue.page =
548
+ value?.page == null ? 1 : value?.page;
549
+ this.el.nativeElement.pageSize = this.lastValue.pageSize =
550
+ value?.pageSize == null ? 12 : value?.pageSize;
551
+ this.lastValue.selectedRows =
552
+ value?.selectedRows == null ? [] : value?.selectedRows;
553
+ if (value?.quickFilter) {
554
+ this._setActiveQuickFilter(value.quickFilter);
555
+ }
556
+ }
557
+ handleChange(value, type) {
558
+ this.handleChangeEvent({
559
+ ...this.lastValue,
560
+ [type]: value,
561
+ });
562
+ if (type === 'quickFilter' && typeof value === 'object') {
563
+ this._setActiveQuickFilter(value);
564
+ }
565
+ }
566
+ _setActiveQuickFilter(quickFilter) {
567
+ this.el.nativeElement.activeQuickFilterIdentifier =
568
+ quickFilter?.identifier;
569
+ }
570
+ }
571
+ TableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: TableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
572
+ TableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", 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: [
573
+ {
574
+ provide: NG_VALUE_ACCESSOR,
575
+ useExisting: TableDirective,
576
+ multi: true,
577
+ },
578
+ ], usesInheritance: true, ngImport: i0 });
579
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: TableDirective, decorators: [{
580
+ type: Directive,
581
+ args: [{
582
+ /* tslint:disable-next-line:directive-selector */
583
+ selector: 'p-table',
584
+ host: {
585
+ '(queryChange)': 'handleChange($event.detail, "query")',
586
+ '(quickFilter)': 'handleChange($event.detail, "quickFilter")',
587
+ '(pageChange)': 'handleChange($event.detail, "page")',
588
+ '(pageSizeChange)': 'handleChange($event.detail, "pageSize")',
589
+ '(selectedRowsChange)': 'handleChange($event.detail, "selectedRows")',
590
+ },
591
+ providers: [
592
+ {
593
+ provide: NG_VALUE_ACCESSOR,
594
+ useExisting: TableDirective,
595
+ multi: true,
596
+ },
597
+ ],
598
+ }]
599
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
600
+
533
601
  const CUSTOM_DIRECTIVES = [
534
602
  PaginationDirective,
535
603
  PageSizeSelectDirective,
536
604
  TableFooterDirective,
537
605
  TableHeaderDirective,
606
+ TableDirective,
538
607
  ];
539
608
 
540
609
  /* eslint-disable */
@@ -1843,7 +1912,7 @@ const DIRECTIVES = [
1843
1912
  class PaperlessModule {
1844
1913
  }
1845
1914
  PaperlessModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: PaperlessModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1846
- PaperlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: PaperlessModule, declarations: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTable, PTableBody, PTableContainer, PTableDefinition, PTableFooter, PTableHeader, PTableRow, PTag, PTooltip, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective], exports: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTable, PTableBody, PTableContainer, PTableDefinition, PTableFooter, PTableHeader, PTableRow, PTag, PTooltip, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective] });
1915
+ PaperlessModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: PaperlessModule, declarations: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTable, PTableBody, PTableContainer, PTableDefinition, PTableFooter, PTableHeader, PTableRow, PTag, PTooltip, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective, TableDirective], exports: [PAccordion, PAvatar, PAvatarGroup, PButton, PCardBody, PCardContainer, PCardHeader, PContentSlider, PCounter, PDivider, PDropdown, PDropdownMenuContainer, PDropdownMenuItem, PHelper, PIcon, PIllustration, PInfoPanel, PInputGroup, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTable, PTableBody, PTableContainer, PTableDefinition, PTableFooter, PTableHeader, PTableRow, PTag, PTooltip, PaginationDirective, PageSizeSelectDirective, TableFooterDirective, TableHeaderDirective, TableDirective] });
1847
1916
  PaperlessModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: PaperlessModule });
1848
1917
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: PaperlessModule, decorators: [{
1849
1918
  type: NgModule,
@@ -1861,5 +1930,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
1861
1930
  * Generated bundle index. Do not edit.
1862
1931
  */
1863
1932
 
1864
- 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, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTable, PTableBody, PTableContainer, PTableDefinition, PTableFooter, PTableHeader, PTableRow, PTag, PTooltip, PageSizeSelectDirective, PaginationDirective, PaperlessModule, TableFooterDirective, TableHeaderDirective };
1933
+ 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, PLayout, PLoader, PModal, PModalBackdrop, PModalBody, PModalContainer, PModalFooter, PModalHeader, PNavbar, PNavigationItem, PPageSizeSelect, PPagination, PPaginationItem, PProfile, PSegmentContainer, PSegmentItem, PSliderIndicator, PStatus, PStepper, PStepperItem, PStepperLine, PTabGroup, PTabItem, PTable, PTableBody, PTableContainer, PTableDefinition, PTableFooter, PTableHeader, PTableRow, PTag, PTooltip, PageSizeSelectDirective, PaginationDirective, PaperlessModule, TableDirective, TableFooterDirective, TableHeaderDirective };
1865
1934
  //# sourceMappingURL=paperless-angular.mjs.map