Skip to content

Commit

Permalink
feat(reports): add paginated list widget
Browse files Browse the repository at this point in the history
  • Loading branch information
trik committed May 31, 2022
1 parent 686d978 commit e123bd1
Show file tree
Hide file tree
Showing 22 changed files with 507 additions and 268 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @license
* Copyright (C) Gnucoop soc. coop.
*
* This file is part of the Advanced JSON forms (ajf).
*
* Advanced JSON forms (ajf) is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the License,
* or (at your option) any later version.
*
* Advanced JSON forms (ajf) is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Advanced JSON forms (ajf).
* If not, see http://www.gnu.org/licenses/.
*
*/

import {AjfPaginatedListWidget} from '../widgets/paginated-list-widget';
import {AjfWidgetWithContentInstance} from './widget-with-content-instance';

export interface AjfPaginatedListWidgetInstance extends AjfWidgetWithContentInstance {
widget: AjfPaginatedListWidget;
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {AjfImageWidgetInstance} from './image-widget-instance';
import {AjfLayoutWidgetInstance} from './layout-widget-instance';
import {AjfMapWidgetInstance} from './map-widget-instance';
import {AjfPageBreakWidgetInstance} from './page-break-widget-instance';
import {AjfPaginatedListWidgetInstance} from './paginated-list-widget-instance';
import {AjfTableWidgetInstance} from './table-widget-instance';
import {AjfTextWidgetInstance} from './text-widget-instance';
import {AjfWidgetWithContentInstance} from './widget-with-content-instance';
Expand All @@ -53,6 +54,7 @@ export type AjfWidgetInstance =
| AjfLayoutWidgetInstance
| AjfMapWidgetInstance
| AjfPageBreakWidgetInstance
| AjfPaginatedListWidgetInstance
| AjfTableWidgetInstance
| AjfTextWidgetInstance
| AjfWidgetWithContentInstance;
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@
* If not, see http://www.gnu.org/licenses/.
*
*/

import {AjfWidgetWithContent} from './widget-with-content';
import {AjfWidgetType} from './widget-type';

export interface AjfPaginatedListWidget extends AjfWidgetWithContent {
widgetType: AjfWidgetType.PaginatedList;
title: string;
pageSize: number;
}
1 change: 1 addition & 0 deletions projects/core/reports/src/interface/widgets/widget-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ export enum AjfWidgetType {
ImageContainer,
DynamicTable,
Graph,
PaginatedList,
LENGTH,
}
2 changes: 2 additions & 0 deletions projects/core/reports/src/interface/widgets/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import {AjfImageContainerWidget} from './image-container-widget';
import {AjfImageWidget} from './image-widget';
import {AjfLayoutWidget} from './layout-widget';
import {AjfPageBreakWidget} from './page-break-widget';
import {AjfPaginatedListWidget} from './paginated-list-widget';
import {AjfMapWidget} from './map-widget';
import {AjfTextWidget} from './text-widget';
import {AjfWidgetWithContent} from './widget-with-content';
Expand All @@ -52,6 +53,7 @@ export type AjfWidget =
| AjfLayoutWidget
| AjfMapWidget
| AjfPageBreakWidget
| AjfPaginatedListWidget
| AjfTextWidget
| AjfUnknownWidget
| AjfWidgetWithContent;
2 changes: 2 additions & 0 deletions projects/core/reports/src/public_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export * from './interface/widgets/image-widget';
export * from './interface/widgets/layout-widget';
export * from './interface/widgets/map-widget';
export * from './interface/widgets/page-break-widget';
export * from './interface/widgets/paginated-list-widget';
export * from './interface/widgets/table-widget';
export * from './interface/widgets/text-widget';
export * from './interface/widgets/widget';
Expand All @@ -68,6 +69,7 @@ export * from './interface/widgets-instances/image-widget-instance';
export * from './interface/widgets-instances/layout-widget-instance';
export * from './interface/widgets-instances/map-widget-instance';
export * from './interface/widgets-instances/page-break-widget-instance';
export * from './interface/widgets-instances/paginated-list-widget-instance';
export * from './interface/widgets-instances/table-widget-instance';
export * from './interface/widgets-instances/text-widget-instance';
export * from './interface/widgets-instances/widget-instance';
Expand Down
2 changes: 1 addition & 1 deletion projects/dev-app/src/ion-widgets/widgets-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {AjfWidgetInstance} from '@ajf/core/reports';
import {TranslocoService} from '@ajf/core/transloco';
import {Component} from '@angular/core';

import {demoWidgets} from './widgets';
import {demoWidgets} from '../widgets';

@Component({
selector: 'widgets-demo',
Expand Down
2 changes: 1 addition & 1 deletion projects/dev-app/src/mat-widgets/widgets-demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {AjfWidgetInstance} from '@ajf/core/reports';
import {TranslocoService} from '@ajf/core/transloco';
import {Component} from '@angular/core';

import {demoWidgets} from './widgets';
import {demoWidgets} from '../widgets';

@Component({
selector: 'widgets-demo',
Expand Down
261 changes: 0 additions & 261 deletions projects/dev-app/src/mat-widgets/widgets.ts

This file was deleted.

0 comments on commit e123bd1

Please sign in to comment.