@paperless/angular 0.1.0-alpha.204 → 0.1.0-alpha.205
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.
- package/esm2020/lib/animations/index.mjs +2 -0
- package/esm2020/lib/animations/slide.mjs +11 -0
- package/esm2020/lib/base/index.mjs +1 -3
- package/esm2020/lib/directives/index.mjs +2 -15
- package/esm2020/lib/modules/index.mjs +3 -0
- package/esm2020/lib/modules/table/base/form.component.mjs +105 -0
- package/esm2020/lib/modules/table/base/index.mjs +3 -0
- package/esm2020/lib/modules/table/base/table.component.mjs +162 -0
- package/esm2020/lib/modules/table/components/index.mjs +8 -0
- package/esm2020/lib/modules/table/components/table/constants.mjs +3 -0
- package/esm2020/lib/modules/table/components/table/table.component.mjs +544 -0
- package/esm2020/lib/modules/table/components/table-cell/table-cell.component.mjs +167 -0
- package/esm2020/lib/modules/table/components/table-column/table-column.component.mjs +37 -0
- package/esm2020/lib/modules/table/directives/index.mjs +15 -0
- package/esm2020/lib/modules/table/directives/p-table-footer.directive.mjs +52 -0
- package/esm2020/lib/modules/table/directives/p-table-header.directive.mjs +60 -0
- package/esm2020/lib/modules/table/directives/p-table-ngx.directive.mjs +88 -0
- package/esm2020/lib/modules/table/directives/p-table.directive.mjs +78 -0
- package/esm2020/lib/modules/table/index.mjs +5 -0
- package/esm2020/lib/modules/table/table.module.mjs +27 -0
- package/esm2020/lib/modules/toast/components/index.mjs +6 -0
- package/esm2020/lib/modules/toast/components/toast/toast.component.mjs +71 -0
- package/esm2020/lib/modules/toast/components/toast-container/toast-container.component.mjs +34 -0
- package/esm2020/lib/modules/toast/components/toast-container/types.mjs +10 -0
- package/esm2020/lib/modules/toast/index.mjs +4 -0
- package/esm2020/lib/modules/toast/services/index.mjs +4 -0
- package/esm2020/lib/modules/toast/services/toast.service.mjs +47 -0
- package/esm2020/lib/modules/toast/toast.module.mjs +23 -0
- package/esm2020/lib/paperless.module.mjs +25 -27
- package/esm2020/lib/stencil.module.mjs +17 -0
- package/esm2020/public-api.mjs +3 -2
- package/fesm2015/paperless-angular.mjs +501 -297
- package/fesm2015/paperless-angular.mjs.map +1 -1
- package/fesm2020/paperless-angular.mjs +504 -295
- package/fesm2020/paperless-angular.mjs.map +1 -1
- package/lib/animations/index.d.ts +1 -0
- package/lib/animations/slide.d.ts +1 -0
- package/lib/base/index.d.ts +0 -2
- package/lib/directives/index.d.ts +1 -6
- package/lib/modules/index.d.ts +2 -0
- package/lib/{base → modules/table/base}/form.component.d.ts +0 -0
- package/lib/modules/table/base/index.d.ts +2 -0
- package/lib/{base → modules/table/base}/table.component.d.ts +0 -0
- package/lib/{components → modules/table/components}/index.d.ts +2 -2
- package/lib/{components → modules/table/components}/table/constants.d.ts +0 -0
- package/lib/{components → modules/table/components}/table/table.component.d.ts +3 -3
- package/lib/{components → modules/table/components}/table-cell/table-cell.component.d.ts +0 -0
- package/lib/{components → modules/table/components}/table-column/table-column.component.d.ts +0 -0
- package/lib/modules/table/directives/index.d.ts +9 -0
- package/lib/{directives → modules/table/directives}/p-table-footer.directive.d.ts +1 -1
- package/lib/{directives → modules/table/directives}/p-table-header.directive.d.ts +1 -1
- package/lib/{directives → modules/table/directives}/p-table-ngx.directive.d.ts +3 -3
- package/lib/{directives → modules/table/directives}/p-table.directive.d.ts +1 -1
- package/lib/modules/table/index.d.ts +4 -0
- package/lib/modules/table/table.module.d.ts +15 -0
- package/lib/modules/toast/components/index.d.ts +5 -0
- package/lib/modules/toast/components/toast/toast.component.d.ts +22 -0
- package/lib/modules/toast/components/toast-container/toast-container.component.d.ts +17 -0
- package/lib/modules/toast/components/toast-container/types.d.ts +26 -0
- package/lib/modules/toast/index.d.ts +3 -0
- package/lib/modules/toast/services/index.d.ts +3 -0
- package/lib/modules/toast/services/toast.service.d.ts +12 -0
- package/lib/modules/toast/toast.module.d.ts +10 -0
- package/lib/paperless.module.d.ts +11 -16
- package/lib/stencil.module.d.ts +7 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -1
- package/esm2020/lib/base/form.component.mjs +0 -105
- package/esm2020/lib/base/table.component.mjs +0 -162
- package/esm2020/lib/components/index.mjs +0 -8
- package/esm2020/lib/components/table/constants.mjs +0 -3
- package/esm2020/lib/components/table/table.component.mjs +0 -544
- package/esm2020/lib/components/table-cell/table-cell.component.mjs +0 -167
- package/esm2020/lib/components/table-column/table-column.component.mjs +0 -37
- package/esm2020/lib/directives/p-table-footer.directive.mjs +0 -52
- package/esm2020/lib/directives/p-table-header.directive.mjs +0 -60
- package/esm2020/lib/directives/p-table-ngx.directive.mjs +0 -88
- package/esm2020/lib/directives/p-table.directive.mjs +0 -78
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './slide';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SLIDE_IN_BOTTOM_OUT_TOP: import("@angular/animations").AnimationTriggerMetadata;
|
package/lib/base/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export * from './p-page-size-select.directive';
|
|
2
2
|
export * from './p-pagination.directive';
|
|
3
3
|
export * from './p-select.directive';
|
|
4
|
-
export * from './p-table-footer.directive';
|
|
5
|
-
export * from './p-table-header.directive';
|
|
6
|
-
export * from './p-table-ngx.directive';
|
|
7
|
-
export * from './p-table.directive';
|
|
8
4
|
import { SelectDirective } from './p-select.directive';
|
|
9
|
-
|
|
10
|
-
export declare const CUSTOM_DIRECTIVES: (typeof SelectDirective | typeof TableNgxDirective)[];
|
|
5
|
+
export declare const DIRECTIVES: (typeof SelectDirective)[];
|
|
File without changes
|
|
File without changes
|
|
@@ -3,5 +3,5 @@ export * from './table-column/table-column.component';
|
|
|
3
3
|
export * from './table/table.component';
|
|
4
4
|
import { TableCell } from './table-cell/table-cell.component';
|
|
5
5
|
import { TableColumn } from './table-column/table-column.component';
|
|
6
|
-
import {
|
|
7
|
-
export declare const
|
|
6
|
+
import { Table } from './table/table.component';
|
|
7
|
+
export declare const TABLE_COMPONENTS: (typeof TableCell | typeof TableColumn | typeof Table)[];
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import { EventEmitter, OnChanges, OnInit, QueryList, SimpleChanges } from '@angu
|
|
|
2
2
|
import { QuickFilter, RowClickEvent } from '@paperless/core';
|
|
3
3
|
import { TableColumn } from '../table-column/table-column.component';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class Table implements OnInit, OnChanges {
|
|
6
6
|
/**
|
|
7
7
|
* The items to be fed to the table
|
|
8
8
|
*/
|
|
@@ -185,6 +185,6 @@ export declare class TableComponent implements OnInit, OnChanges {
|
|
|
185
185
|
}, index: number): void;
|
|
186
186
|
private _findRow;
|
|
187
187
|
private _findRowAction;
|
|
188
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
|
189
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
|
188
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Table, never>;
|
|
189
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Table, "p-table-ngx", never, { "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"; }, { "selectedRowsChange": "selectedRowsChange"; "rowClick": "rowClick"; "rowSelected": "rowSelected"; "rowDeselected": "rowDeselected"; "quickFilter": "quickFilter"; "queryChange": "queryChange"; "filter": "filter"; "edit": "edit"; "pageChange": "pageChange"; "pageSizeChange": "pageSizeChange"; "export": "export"; }, ["columnDefinitions"], never, false>;
|
|
190
190
|
}
|
|
File without changes
|
package/lib/{components → modules/table/components}/table-column/table-column.component.d.ts
RENAMED
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './p-table-footer.directive';
|
|
2
|
+
export * from './p-table-header.directive';
|
|
3
|
+
export * from './p-table-ngx.directive';
|
|
4
|
+
export * from './p-table.directive';
|
|
5
|
+
import { TableFooterDirective } from './p-table-footer.directive';
|
|
6
|
+
import { TableHeaderDirective } from './p-table-header.directive';
|
|
7
|
+
import { TableNgxDirective } from './p-table-ngx.directive';
|
|
8
|
+
import { TableDirective } from './p-table.directive';
|
|
9
|
+
export declare const TABLE_DIRECTIVES: (typeof TableFooterDirective | typeof TableHeaderDirective | typeof TableNgxDirective | typeof TableDirective)[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
|
-
import { BaseValueAccessor } from '
|
|
2
|
+
import { BaseValueAccessor } from '../../../base';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class TableFooterDirective extends BaseValueAccessor {
|
|
5
5
|
protected lastValue: any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { QuickFilter } from '@paperless/core';
|
|
3
|
-
import { BaseValueAccessor } from '
|
|
3
|
+
import { BaseValueAccessor } from '../../../base';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export interface TableHeaderDirectiveValue {
|
|
6
6
|
query?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { QuickFilter } from '@paperless/core';
|
|
3
|
-
import { BaseValueAccessor } from '
|
|
4
|
-
import {
|
|
3
|
+
import { BaseValueAccessor } from '../../../base';
|
|
4
|
+
import { Table } from '../components/table/table.component';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
export interface TableDirectiveValue {
|
|
7
7
|
query?: string;
|
|
@@ -13,7 +13,7 @@ export interface TableDirectiveValue {
|
|
|
13
13
|
export declare class TableNgxDirective extends BaseValueAccessor {
|
|
14
14
|
private _base;
|
|
15
15
|
protected lastValue: TableDirectiveValue;
|
|
16
|
-
constructor(el: ElementRef, _base:
|
|
16
|
+
constructor(el: ElementRef, _base: Table);
|
|
17
17
|
writeValue(value: TableDirectiveValue): void;
|
|
18
18
|
registerOnChange(fn: (value: any) => void): void;
|
|
19
19
|
registerOnTouched(fn: () => void): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ElementRef } from '@angular/core';
|
|
2
2
|
import { QuickFilter } from '@paperless/core';
|
|
3
|
-
import { BaseValueAccessor } from '
|
|
3
|
+
import { BaseValueAccessor } from '../../../base';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export interface NGXTableDirectiveValue {
|
|
6
6
|
query?: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./components/table/table.component";
|
|
3
|
+
import * as i2 from "./components/table-cell/table-cell.component";
|
|
4
|
+
import * as i3 from "./components/table-column/table-column.component";
|
|
5
|
+
import * as i4 from "./directives/p-table-footer.directive";
|
|
6
|
+
import * as i5 from "./directives/p-table-header.directive";
|
|
7
|
+
import * as i6 from "./directives/p-table.directive";
|
|
8
|
+
import * as i7 from "./directives/p-table-ngx.directive";
|
|
9
|
+
import * as i8 from "@angular/common";
|
|
10
|
+
import * as i9 from "../../stencil.module";
|
|
11
|
+
export declare class PaperlessTableModule {
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaperlessTableModule, never>;
|
|
13
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PaperlessTableModule, [typeof i1.Table, typeof i2.TableCell, typeof i3.TableColumn, typeof i4.TableFooterDirective, typeof i5.TableHeaderDirective, typeof i6.TableDirective, typeof i7.TableNgxDirective], [typeof i8.CommonModule, typeof i9.PaperlessStencilModule], [typeof i1.Table, typeof i2.TableCell, typeof i3.TableColumn, typeof i4.TableFooterDirective, typeof i5.TableHeaderDirective, typeof i6.TableDirective, typeof i7.TableNgxDirective]>;
|
|
14
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PaperlessTableModule>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './toast-container/toast-container.component';
|
|
2
|
+
export * from './toast/toast.component';
|
|
3
|
+
import { ToastContainer } from './toast-container/toast-container.component';
|
|
4
|
+
import { Toast } from './toast/toast.component';
|
|
5
|
+
export declare const TOAST_COMPONENTS: (typeof ToastContainer | typeof Toast)[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnInit } from '@angular/core';
|
|
2
|
+
import { Components } from '@paperless/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare interface PToast extends Components.PToast {
|
|
5
|
+
/**
|
|
6
|
+
* Button click event
|
|
7
|
+
*/
|
|
8
|
+
action: EventEmitter<CustomEvent<MouseEvent>>;
|
|
9
|
+
}
|
|
10
|
+
export declare class Toast implements OnInit {
|
|
11
|
+
protected z: NgZone;
|
|
12
|
+
delay: number | 'infinite';
|
|
13
|
+
index: number;
|
|
14
|
+
dismissOnAction: boolean;
|
|
15
|
+
dismiss: EventEmitter<number>;
|
|
16
|
+
protected el: HTMLElement;
|
|
17
|
+
constructor(c: ChangeDetectorRef, r: ElementRef, z: NgZone);
|
|
18
|
+
ngOnInit(): void;
|
|
19
|
+
doDismiss(): void;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Toast, never>;
|
|
21
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Toast, "p-toast", never, { "actionIcon": "actionIcon"; "actionIconFlip": "actionIconFlip"; "actionIconRotate": "actionIconRotate"; "content": "content"; "enableAction": "enableAction"; "header": "header"; "variant": "variant"; "delay": "delay"; "index": "index"; "dismissOnAction": "dismissOnAction"; }, { "dismiss": "dismiss"; }, never, ["*"], false>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ElementRef, NgZone } from '@angular/core';
|
|
2
|
+
import { Components } from '@paperless/core';
|
|
3
|
+
import { ToastService } from '../../services/toast.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare interface PToastContainer extends Components.PToastContainer {
|
|
6
|
+
placement: 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
|
|
7
|
+
}
|
|
8
|
+
export declare class ToastContainer {
|
|
9
|
+
protected z: NgZone;
|
|
10
|
+
private _toastService;
|
|
11
|
+
toasts$: import("rxjs").BehaviorSubject<import("./types").ToastData[]>;
|
|
12
|
+
protected el: HTMLElement;
|
|
13
|
+
constructor(r: ElementRef, z: NgZone, _toastService: ToastService);
|
|
14
|
+
dismiss(index: number): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastContainer, never>;
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ToastContainer, "p-toast-container", never, { "placement": "placement"; }, {}, never, never, false>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RotateOptions } from '@paperless/core';
|
|
2
|
+
import { IconFlipOptions, IconVariant } from '@paperless/core/dist/types/components/atoms/icon/icon.component';
|
|
3
|
+
export declare enum ToastVariants {
|
|
4
|
+
Success = "positive",
|
|
5
|
+
Warning = "unbiased",
|
|
6
|
+
Error = "negative",
|
|
7
|
+
Positive = "positive",
|
|
8
|
+
Unbiased = "unbiased",
|
|
9
|
+
Negative = "negative"
|
|
10
|
+
}
|
|
11
|
+
export interface ToastOptions {
|
|
12
|
+
delay?: number | 'infinite';
|
|
13
|
+
dismissOnAction?: boolean;
|
|
14
|
+
enableAction?: boolean;
|
|
15
|
+
icon?: {
|
|
16
|
+
variant?: IconVariant;
|
|
17
|
+
flip?: IconFlipOptions;
|
|
18
|
+
rotate?: RotateOptions;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface ToastData {
|
|
22
|
+
variant: ToastVariants;
|
|
23
|
+
header: string;
|
|
24
|
+
content: string;
|
|
25
|
+
options: ToastOptions;
|
|
26
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
|
+
import { ToastData, ToastOptions, ToastVariants } from '../components/toast-container/types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ToastService {
|
|
5
|
+
private _toasts;
|
|
6
|
+
toasts$: BehaviorSubject<ToastData[]>;
|
|
7
|
+
defaultOptions: ToastOptions;
|
|
8
|
+
show(header: string, content: string, variant?: ToastVariants, options?: ToastOptions): void;
|
|
9
|
+
hide(index: number): void;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToastService, never>;
|
|
11
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ToastService>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./components/toast/toast.component";
|
|
3
|
+
import * as i2 from "./components/toast-container/toast-container.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "../../stencil.module";
|
|
6
|
+
export declare class PaperlessToastModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaperlessToastModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PaperlessToastModule, [typeof i1.Toast, typeof i2.ToastContainer], [typeof i3.CommonModule, typeof i4.PaperlessStencilModule], [typeof i1.Toast, typeof i2.ToastContainer]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PaperlessToastModule>;
|
|
10
|
+
}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./
|
|
3
|
-
import * as i2 from "./
|
|
4
|
-
import * as i3 from "./
|
|
5
|
-
import * as i4 from "./
|
|
6
|
-
import * as i5 from "./pipes/
|
|
7
|
-
import * as i6 from "./pipes/
|
|
8
|
-
import * as i7 from "
|
|
9
|
-
import * as i8 from "./
|
|
10
|
-
import * as i9 from "./
|
|
11
|
-
import * as i10 from "./
|
|
12
|
-
import * as i11 from "./directives/p-table-header.directive";
|
|
13
|
-
import * as i12 from "./directives/p-table.directive";
|
|
14
|
-
import * as i13 from "./directives/p-table-ngx.directive";
|
|
15
|
-
import * as i14 from "./directives/p-select.directive";
|
|
16
|
-
import * as i15 from "@angular/common";
|
|
2
|
+
import * as i1 from "./directives/p-pagination.directive";
|
|
3
|
+
import * as i2 from "./directives/p-page-size-select.directive";
|
|
4
|
+
import * as i3 from "./directives/p-select.directive";
|
|
5
|
+
import * as i4 from "./pipes/currency.pipe";
|
|
6
|
+
import * as i5 from "./pipes/date.pipe";
|
|
7
|
+
import * as i6 from "./pipes/safe.pipe";
|
|
8
|
+
import * as i7 from "@angular/common";
|
|
9
|
+
import * as i8 from "./stencil.module";
|
|
10
|
+
import * as i9 from "./modules/table/table.module";
|
|
11
|
+
import * as i10 from "./modules/toast/toast.module";
|
|
17
12
|
export declare class PaperlessModule {
|
|
18
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaperlessModule, never>;
|
|
19
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<PaperlessModule, [typeof i1.
|
|
14
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PaperlessModule, [typeof i1.PaginationDirective, typeof i2.PageSizeSelectDirective, typeof i3.SelectDirective, typeof i4.CustomCurrencyPipe, typeof i5.CustomDatePipe, typeof i6.SafePipe], [typeof i7.CommonModule, typeof i8.PaperlessStencilModule, typeof i9.PaperlessTableModule, typeof i10.PaperlessToastModule], [typeof i1.PaginationDirective, typeof i2.PageSizeSelectDirective, typeof i3.SelectDirective, typeof i4.CustomCurrencyPipe, typeof i5.CustomDatePipe, typeof i6.SafePipe]>;
|
|
20
15
|
static ɵinj: i0.ɵɵInjectorDeclaration<PaperlessModule>;
|
|
21
16
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./stencil/components";
|
|
3
|
+
export declare class PaperlessStencilModule {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PaperlessStencilModule, never>;
|
|
5
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PaperlessStencilModule, [typeof i1.PAccordion, typeof i1.PAvatar, typeof i1.PAvatarGroup, typeof i1.PButton, typeof i1.PCardBody, typeof i1.PCardContainer, typeof i1.PCardHeader, typeof i1.PContentSlider, typeof i1.PCounter, typeof i1.PDivider, typeof i1.PDropdown, typeof i1.PDropdownMenuContainer, typeof i1.PDropdownMenuItem, typeof i1.PHelper, typeof i1.PIcon, typeof i1.PIllustration, typeof i1.PInfoPanel, typeof i1.PInputGroup, typeof i1.PLabel, typeof i1.PLayout, typeof i1.PLoader, typeof i1.PModal, typeof i1.PModalBackdrop, typeof i1.PModalBody, typeof i1.PModalContainer, typeof i1.PModalFooter, typeof i1.PModalHeader, typeof i1.PNavbar, typeof i1.PNavigationItem, typeof i1.PPageSizeSelect, typeof i1.PPagination, typeof i1.PPaginationItem, typeof i1.PProfile, typeof i1.PSegmentContainer, typeof i1.PSegmentItem, typeof i1.PSelect, typeof i1.PSliderIndicator, typeof i1.PStatus, typeof i1.PStepper, typeof i1.PStepperItem, typeof i1.PStepperLine, typeof i1.PTabGroup, typeof i1.PTabItem, typeof i1.PTableContainer, typeof i1.PTableFooter, typeof i1.PTableHeader, typeof i1.PTableRow, typeof i1.PTooltip], never, [typeof i1.PAccordion, typeof i1.PAvatar, typeof i1.PAvatarGroup, typeof i1.PButton, typeof i1.PCardBody, typeof i1.PCardContainer, typeof i1.PCardHeader, typeof i1.PContentSlider, typeof i1.PCounter, typeof i1.PDivider, typeof i1.PDropdown, typeof i1.PDropdownMenuContainer, typeof i1.PDropdownMenuItem, typeof i1.PHelper, typeof i1.PIcon, typeof i1.PIllustration, typeof i1.PInfoPanel, typeof i1.PInputGroup, typeof i1.PLabel, typeof i1.PLayout, typeof i1.PLoader, typeof i1.PModal, typeof i1.PModalBackdrop, typeof i1.PModalBody, typeof i1.PModalContainer, typeof i1.PModalFooter, typeof i1.PModalHeader, typeof i1.PNavbar, typeof i1.PNavigationItem, typeof i1.PPageSizeSelect, typeof i1.PPagination, typeof i1.PPaginationItem, typeof i1.PProfile, typeof i1.PSegmentContainer, typeof i1.PSegmentItem, typeof i1.PSelect, typeof i1.PSliderIndicator, typeof i1.PStatus, typeof i1.PStepper, typeof i1.PStepperItem, typeof i1.PStepperLine, typeof i1.PTabGroup, typeof i1.PTabItem, typeof i1.PTableContainer, typeof i1.PTableFooter, typeof i1.PTableHeader, typeof i1.PTableRow, typeof i1.PTooltip]>;
|
|
6
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PaperlessStencilModule>;
|
|
7
|
+
}
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './lib/base';
|
|
2
|
-
export * from './lib/components';
|
|
3
2
|
export * from './lib/directives';
|
|
3
|
+
export * from './lib/modules';
|
|
4
4
|
export * from './lib/paperless.module';
|
|
5
5
|
export * from './lib/pipes';
|
|
6
|
+
export * from './lib/stencil.module';
|
|
6
7
|
export * from './lib/stencil/components';
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { FormArray, FormControl, FormGroup, } from '@angular/forms';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export class FormBaseComponent {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.markedDirty = false;
|
|
7
|
-
}
|
|
8
|
-
scrollToFirstError() {
|
|
9
|
-
const invalidInputs = Array.from(document.getElementsByClassName('ng-invalid'))
|
|
10
|
-
.filter((e) => e?.nodeName?.toLowerCase() !== 'form')
|
|
11
|
-
.sort((a, b) => a.scrollTop - b.scrollTop);
|
|
12
|
-
const first = invalidInputs[0];
|
|
13
|
-
if (first) {
|
|
14
|
-
first.scrollIntoView({
|
|
15
|
-
behavior: 'smooth',
|
|
16
|
-
block: 'center',
|
|
17
|
-
inline: 'center',
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
markControlDirty(control) {
|
|
22
|
-
if (control instanceof FormControl) {
|
|
23
|
-
control.markAsDirty({ onlySelf: true });
|
|
24
|
-
control.markAsTouched({ onlySelf: true });
|
|
25
|
-
}
|
|
26
|
-
else if (control instanceof FormGroup) {
|
|
27
|
-
control.markAsDirty();
|
|
28
|
-
control.markAsTouched();
|
|
29
|
-
this.markAllDirty(control);
|
|
30
|
-
}
|
|
31
|
-
else if (control instanceof FormArray) {
|
|
32
|
-
control.markAsDirty();
|
|
33
|
-
control.markAsTouched();
|
|
34
|
-
for (const child of control?.controls) {
|
|
35
|
-
this.markControlDirty(child);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
control.updateValueAndValidity();
|
|
39
|
-
}
|
|
40
|
-
markAllDirty(formGroup) {
|
|
41
|
-
this.markedDirty = true;
|
|
42
|
-
for (const field of Object.keys(formGroup.controls)) {
|
|
43
|
-
const control = formGroup.get(field);
|
|
44
|
-
this.markControlDirty(control);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
getControlError(control) {
|
|
48
|
-
if (!this.hasControlError(control)) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
return this.firstControlError(control);
|
|
52
|
-
}
|
|
53
|
-
hasControlError(control, showChildErrors = true) {
|
|
54
|
-
return (control?.dirty && this.firstControlError(control, showChildErrors));
|
|
55
|
-
}
|
|
56
|
-
firstControlError(control, showChildErrors = true) {
|
|
57
|
-
if (control instanceof FormGroup && showChildErrors) {
|
|
58
|
-
const errors = Object.keys(control.controls)
|
|
59
|
-
.map((key) => this.firstControlError(control.controls[key]))
|
|
60
|
-
.filter((val) => !!val);
|
|
61
|
-
return errors[0];
|
|
62
|
-
}
|
|
63
|
-
if (!control?.errors) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const keys = Object.keys(control.errors);
|
|
67
|
-
let err;
|
|
68
|
-
for (const key of keys) {
|
|
69
|
-
if (control.errors[key]) {
|
|
70
|
-
err = key;
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return err;
|
|
75
|
-
}
|
|
76
|
-
resetControl(control) {
|
|
77
|
-
control.setErrors(null);
|
|
78
|
-
control.reset();
|
|
79
|
-
control.markAsPristine();
|
|
80
|
-
if (control instanceof FormGroup) {
|
|
81
|
-
this.resetForm(control);
|
|
82
|
-
}
|
|
83
|
-
else if (control instanceof FormArray) {
|
|
84
|
-
for (const child of control?.controls) {
|
|
85
|
-
this.resetControl(child);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
resetForm(formGroup) {
|
|
90
|
-
for (const field of Object.keys(formGroup.controls)) {
|
|
91
|
-
const control = formGroup.get(field);
|
|
92
|
-
this.resetControl(control);
|
|
93
|
-
}
|
|
94
|
-
this.markedDirty = false;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
FormBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FormBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
98
|
-
FormBaseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: FormBaseComponent, selector: "ng-component", ngImport: i0, template: ``, isInline: true });
|
|
99
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FormBaseComponent, decorators: [{
|
|
100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gICAgICAgICBiZWhhdmlvcjogJ3Ntb290aCcsXG4gICAgICAgICAgICAgICAgYmxvY2s6ICdjZW50ZXInLFxuICAgICAgICAgICAgICAgIGlubGluZTogJ2NlbnRlcicsXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIG1hcmtDb250cm9sRGlydHkoXG4gICAgICAgIGNvbnRyb2w6IEZvcm1Db250cm9sIHwgRm9ybUdyb3VwIHwgRm9ybUFycmF5IHwgQWJzdHJhY3RDb250cm9sXG4gICAgKSB7XG4gICAgICAgIGlmIChjb250cm9sIGluc3RhbmNlb2YgRm9ybUNvbnRyb2wpIHtcbiAgICAgICAgICAgIGNvbnRyb2wubWFya0FzRGlydHkoeyBvbmx5U2VsZjogdHJ1ZSB9KTtcbiAgICAgICAgICAgIGNvbnRyb2wubWFya0FzVG91Y2hlZCh7IG9ubHlTZWxmOiB0cnVlIH0pO1xuICAgICAgICB9IGVsc2UgaWYgKGNvbnRyb2wgaW5zdGFuY2VvZiBGb3JtR3JvdXApIHtcbiAgICAgICAgICAgIGNvbnRyb2wubWFya0FzRGlydHkoKTtcbiAgICAgICAgICAgIGNvbnRyb2wubWFya0FzVG91Y2hlZCgpO1xuICAgICAgICAgICAgdGhpcy5tYXJrQWxsRGlydHkoY29udHJvbCk7XG4gICAgICAgIH0gZWxzZSBpZiAoY29udHJvbCBpbnN0YW5jZW9mIEZvcm1BcnJheSkge1xuICAgICAgICAgICAgY29udHJvbC5tYXJrQXNEaXJ0eSgpO1xuICAgICAgICAgICAgY29udHJvbC5tYXJrQXNUb3VjaGVkKCk7XG4gICAgICAgICAgICBmb3IgKGNvbnN0IGNoaWxkIG9mIGNvbnRyb2w/LmNvbnRyb2xzKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5tYXJrQ29udHJvbERpcnR5KGNoaWxkKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnRyb2wudXBkYXRlVmFsdWVBbmRWYWxpZGl0eSgpO1xuICAgIH1cblxuICAgIG1hcmtBbGxEaXJ0eShmb3JtR3JvdXA6IEZvcm1Hcm91cCkge1xuICAgICAgICB0aGlzLm1hcmtlZERpcnR5ID0gdHJ1ZTtcblxuICAgICAgICBmb3IgKGNvbnN0IGZpZWxkIG9mIE9iamVjdC5rZXlzKGZvcm1Hcm91cC5jb250cm9scykpIHtcbiAgICAgICAgICAgIGNvbnN0IGNvbnRyb2wgPSBmb3JtR3JvdXAuZ2V0KGZpZWxkKTtcbiAgICAgICAgICAgIHRoaXMubWFya0NvbnRyb2xEaXJ0eShjb250cm9sIGFzIEFic3RyYWN0Q29udHJvbCk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBnZXRDb250cm9sRXJyb3IoXG4gICAgICAgIGNvbnRyb2w6IEZvcm1Db250cm9sIHwgQWJzdHJhY3RDb250cm9sIHwgRm9ybUFycmF5IHwgRm9ybUdyb3VwXG4gICAgKSB7XG4gICAgICAgIGlmICghdGhpcy5oYXNDb250cm9sRXJyb3IoY29udHJvbCkpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiB0aGlzLmZpcnN0Q29udHJvbEVycm9yKGNvbnRyb2wpO1xuICAgIH1cblxuICAgIGhhc0NvbnRyb2xFcnJvcihcbiAgICAgICAgY29udHJvbDogRm9ybUNvbnRyb2wgfCBBYnN0cmFjdENvbnRyb2wgfCBGb3JtR3JvdXAgfCBGb3JtQXJyYXksXG4gICAgICAgIHNob3dDaGlsZEVycm9ycyA9IHRydWVcbiAgICApIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIGNvbnRyb2w/LmRpcnR5ICYmIHRoaXMuZmlyc3RDb250cm9sRXJyb3IoY29udHJvbCwgc2hvd0NoaWxkRXJyb3JzKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIGZpcnN0Q29udHJvbEVycm9yKFxuICAgICAgICBjb250cm9sOiBGb3JtQ29udHJvbCB8IEFic3RyYWN0Q29udHJvbCB8IEZvcm1Hcm91cCB8IEZvcm1BcnJheSxcbiAgICAgICAgc2hvd0NoaWxkRXJyb3JzID0gdHJ1ZVxuICAgICk6IHN0cmluZyB8IHVuZGVmaW5lZCB7XG4gICAgICAgIGlmIChjb250cm9sIGluc3RhbmNlb2YgRm9ybUdyb3VwICYmIHNob3dDaGlsZEVycm9ycykge1xuICAgICAgICAgICAgY29uc3QgZXJyb3JzOiBBcnJheTxzdHJpbmcgfCB1bmRlZmluZWQ+ID0gT2JqZWN0LmtleXMoXG4gICAgICAgICAgICAgICAgY29udHJvbC5jb250cm9sc1xuICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgIC5tYXAoKGtleSkgPT4gdGhpcy5maXJzdENvbnRyb2xFcnJvcihjb250cm9sLmNvbnRyb2xzW2tleV0pKVxuICAgICAgICAgICAgICAgIC5maWx0ZXIoKHZhbCkgPT4gISF2YWwpO1xuXG4gICAgICAgICAgICByZXR1cm4gZXJyb3JzWzBdO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFjb250cm9sPy5lcnJvcnMpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuXG4gICAgICAgIGNvbnN0IGtleXMgPSBPYmplY3Qua2V5cyhjb250cm9sLmVycm9ycyk7XG4gICAgICAgIGxldCBlcnI6IHN0cmluZyB8IHVuZGVmaW5lZDtcblxuICAgICAgICBmb3IgKGNvbnN0IGtleSBvZiBrZXlzKSB7XG4gICAgICAgICAgICBpZiAoY29udHJvbC5lcnJvcnNba2V5XSkge1xuICAgICAgICAgICAgICAgIGVyciA9IGtleTtcbiAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBlcnI7XG4gICAgfVxuXG4gICAgcmVzZXRDb250cm9sKFxuICAgICAgICBjb250cm9sOiBGb3JtQ29udHJvbCB8IEZvcm1Hcm91cCB8IEZvcm1BcnJheSB8IEFic3RyYWN0Q29udHJvbFxuICAgICkge1xuICAgICAgICBjb250cm9sLnNldEVycm9ycyhudWxsKTtcbiAgICAgICAgY29udHJvbC5yZXNldCgpO1xuICAgICAgICBjb250cm9sLm1hcmtBc1ByaXN0aW5lKCk7XG5cbiAgICAgICAgaWYgKGNvbnRyb2wgaW5zdGFuY2VvZiBGb3JtR3JvdXApIHtcbiAgICAgICAgICAgIHRoaXMucmVzZXRGb3JtKGNvbnRyb2wpO1xuICAgICAgICB9IGVsc2UgaWYgKGNvbnRyb2wgaW5zdGFuY2VvZiBGb3JtQXJyYXkpIHtcbiAgICAgICAgICAgIGZvciAoY29uc3QgY2hpbGQgb2YgY29udHJvbD8uY29udHJvbHMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnJlc2V0Q29udHJvbChjaGlsZCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXNldEZvcm0oZm9ybUdyb3VwOiBGb3JtR3JvdXApIHtcbiAgICAgICAgZm9yIChjb25zdCBmaWVsZCBvZiBPYmplY3Qua2V5cyhmb3JtR3JvdXAuY29udHJvbHMpKSB7XG4gICAgICAgICAgICBjb25zdCBjb250cm9sID0gZm9ybUdyb3VwLmdldChmaWVsZCk7XG4gICAgICAgICAgICB0aGlzLnJlc2V0Q29udHJvbChjb250cm9sIGFzIEFic3RyYWN0Q29udHJvbCk7XG4gICAgICAgIH1cblxuICAgICAgICB0aGlzLm1hcmtlZERpcnR5ID0gZmFsc2U7XG4gICAgfVxufVxuIl19
|