ngx-smz-ui 3.4.21 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/bundles/ngx-smz-ui.umd.js +200 -56
  2. package/bundles/ngx-smz-ui.umd.js.map +1 -1
  3. package/esm2015/lib/builders/common/smz-conditional-builder.js +35 -0
  4. package/esm2015/lib/builders/smz-dialogs/dialog-builder.js +4 -4
  5. package/esm2015/lib/builders/smz-documents/document-base-cell.js +4 -2
  6. package/esm2015/lib/builders/smz-documents/document-builder.js +35 -2
  7. package/esm2015/lib/builders/smz-documents/document-content.js +4 -2
  8. package/esm2015/lib/builders/smz-documents/document-viewer.js +48 -0
  9. package/esm2015/lib/modules/smz-dialogs/features/document-content/document-content.component.js +1 -1
  10. package/esm2015/lib/modules/smz-documents/features/document-viewer/document-viewer.component.js +8 -28
  11. package/esm2015/lib/modules/smz-documents/models/smz-document-config.js +1 -1
  12. package/esm2015/lib/modules/smz-documents/models/smz-document-viewer.js +2 -0
  13. package/esm2015/lib/modules/smz-documents/models/smz-document.js +1 -1
  14. package/esm2015/lib/modules/smz-documents/services/smz-documents.service.js +38 -6
  15. package/fesm2015/ngx-smz-ui.js +165 -40
  16. package/fesm2015/ngx-smz-ui.js.map +1 -1
  17. package/lib/builders/common/smz-conditional-builder.d.ts +8 -0
  18. package/lib/builders/smz-dialogs/dialog-builder.d.ts +4 -2
  19. package/lib/builders/smz-documents/document-base-cell.d.ts +2 -1
  20. package/lib/builders/smz-documents/document-builder.d.ts +4 -1
  21. package/lib/builders/smz-documents/document-content.d.ts +2 -1
  22. package/lib/builders/smz-documents/document-viewer.d.ts +17 -0
  23. package/lib/modules/smz-documents/features/document-viewer/document-viewer.component.d.ts +3 -8
  24. package/lib/modules/smz-documents/models/smz-document-config.d.ts +4 -0
  25. package/lib/modules/smz-documents/models/smz-document-viewer.d.ts +25 -0
  26. package/lib/modules/smz-documents/models/smz-document.d.ts +2 -0
  27. package/lib/modules/smz-documents/services/smz-documents.service.d.ts +13 -2
  28. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ export declare class SmzConditionalBuilder<T> {
2
+ protected that: T;
3
+ protected backup: T;
4
+ private _currentConditionMethod;
5
+ constructor();
6
+ if(condition: boolean): T;
7
+ get endIf(): T;
8
+ }
@@ -5,6 +5,8 @@ import { SmzForm } from '../../modules/smz-forms/models/smz-forms';
5
5
  import { SmzDialog, SmzDialogFeature } from '../../modules/smz-dialogs/models/smz-dialogs';
6
6
  import { SmzDialogButtonsBuilder } from './dialog-buttons-builder';
7
7
  import { SmzDialogUiDefinitionBuilder } from './dialog-ui-definition-builder';
8
+ import { SmzTableState } from '../../modules/smz-tables/models/table-state';
9
+ import { SmzDocumentState } from '../../modules/smz-documents/models/smz-document';
8
10
  export declare class SmzDialogBuilder<TResponse> {
9
11
  private defaultConfig;
10
12
  _state: SmzDialog<TResponse>;
@@ -30,8 +32,8 @@ export declare class SmzDialogBuilder<TResponse> {
30
32
  component(component: ComponentDataBase | any): SmzDialogComponentBuilder<TResponse>;
31
33
  message(message: string | string[]): SmzDialogBuilder<TResponse>;
32
34
  html(html: string[]): SmzDialogBuilder<TResponse>;
33
- table(items$: Observable<any>, state: any): SmzDialogBuilder<TResponse>;
34
- document(items$: Observable<any>, state: any): SmzDialogBuilder<TResponse>;
35
+ table(items$: Observable<any>, state: SmzTableState): SmzDialogBuilder<TResponse>;
36
+ document(state: SmzDocumentState): SmzDialogBuilder<TResponse>;
35
37
  build(): SmzDialog<TResponse>;
36
38
  }
37
39
  export declare class SmzDialogComponentBuilder<TResponse> {
@@ -1,8 +1,9 @@
1
1
  import { SmzDocumentCell } from '../../modules/smz-documents/models/smz-document';
2
2
  import { SmzDocumentBaseCell } from '../../modules/smz-documents/models/smz-document-features';
3
+ import { SmzConditionalBuilder } from '../common/smz-conditional-builder';
3
4
  import { SmzDocumentBuilder } from './document-builder';
4
5
  import { SmzDocumentRowBuilder } from './document-content';
5
- export declare class SmzDocumentBaseCellBuilder<T> {
6
+ export declare class SmzDocumentBaseCellBuilder<T> extends SmzConditionalBuilder<T> {
6
7
  _rowBuilder: SmzDocumentRowBuilder;
7
8
  _cell: SmzDocumentCell;
8
9
  _data: SmzDocumentBaseCell;
@@ -1,7 +1,9 @@
1
1
  import { SmzDocumentFontFamilies, SmzDocumentState } from '../../modules/smz-documents/models/smz-document';
2
2
  import { SmzDocumentContentBuilder } from './document-content';
3
3
  import { SmzDocumentConfig } from '../../modules/smz-documents/models/smz-document-config';
4
- export declare class SmzDocumentBuilder {
4
+ import { SmzConditionalBuilder } from '../common/smz-conditional-builder';
5
+ import { SmzDocumentViewerBuilder } from './document-viewer';
6
+ export declare class SmzDocumentBuilder extends SmzConditionalBuilder<SmzDocumentBuilder> {
5
7
  private defaultConfig;
6
8
  _colsCount: number;
7
9
  private _isHeaderHeightUpdated;
@@ -10,6 +12,7 @@ export declare class SmzDocumentBuilder {
10
12
  private applyMargin;
11
13
  constructor(state?: SmzDocumentState);
12
14
  overrideDefaultConfigs(newConfig: SmzDocumentConfig): SmzDocumentBuilder;
15
+ viewer(): SmzDocumentViewerBuilder;
13
16
  content(): SmzDocumentContentBuilder;
14
17
  header(): SmzDocumentContentBuilder;
15
18
  debugMode(): SmzDocumentBuilder;
@@ -1,7 +1,8 @@
1
1
  import { SmzDocumentRow, SmzDocumentContent } from '../../modules/smz-documents/models/smz-document';
2
2
  import { SmzDocumentBuilder } from './document-builder';
3
3
  import { SmzCellDividerBuilder, SmzCellFieldBuilder, SmzCellFieldsGroupBuilder, SmzCellImageBuilder, SmzCellSpacerBuilder, SmzCellSubTitleBuilder, SmzCellTableBuilder, SmzCellTitleBuilder } from './document-cells';
4
- export declare class SmzDocumentContentBuilder {
4
+ import { SmzConditionalBuilder } from '../common/smz-conditional-builder';
5
+ export declare class SmzDocumentContentBuilder extends SmzConditionalBuilder<SmzDocumentContentBuilder> {
5
6
  private _documentBuilder;
6
7
  private _content;
7
8
  constructor(_documentBuilder: SmzDocumentBuilder, _content: SmzDocumentContent);
@@ -0,0 +1,17 @@
1
+ import { SmzDocumentBuilder } from './document-builder';
2
+ import { SmzConditionalBuilder } from '../common/smz-conditional-builder';
3
+ import { SmzDocumentViewer } from '../../modules/smz-documents/models/smz-document-viewer';
4
+ export declare class SmzDocumentViewerBuilder extends SmzConditionalBuilder<SmzDocumentViewerBuilder> {
5
+ private _documentBuilder;
6
+ private _viewer;
7
+ constructor(_documentBuilder: SmzDocumentBuilder, _viewer: SmzDocumentViewer);
8
+ setFilename(filename: string): SmzDocumentViewerBuilder;
9
+ overrideContainerStyles(styleClass: string): SmzDocumentViewerBuilder;
10
+ overridePaperStyles(styleClass: string): SmzDocumentViewerBuilder;
11
+ setZoom(initial: number, min?: number, max?: number, variation?: number): SmzDocumentViewerBuilder;
12
+ disableZoomControls(): SmzDocumentViewerBuilder;
13
+ allowOpen(): SmzDocumentViewerBuilder;
14
+ allowPrint(): SmzDocumentViewerBuilder;
15
+ allowDownload(): SmzDocumentViewerBuilder;
16
+ get document(): SmzDocumentBuilder;
17
+ }
@@ -1,10 +1,10 @@
1
- import { OnInit, ChangeDetectorRef, AfterViewInit, Renderer2, ElementRef } from '@angular/core';
1
+ import { OnInit, ChangeDetectorRef, AfterViewInit, Renderer2, ElementRef, OnDestroy } from '@angular/core';
2
2
  import { Location } from '@angular/common';
3
3
  import { SmzDocumentsService } from '../../services/smz-documents.service';
4
4
  import { SmzDocumentState } from '../../models/smz-document';
5
5
  import { Store } from '@ngxs/store';
6
6
  import * as i0 from "@angular/core";
7
- export declare class SmzDocumentViewerComponent implements OnInit, AfterViewInit {
7
+ export declare class SmzDocumentViewerComponent implements OnInit, AfterViewInit, OnDestroy {
8
8
  private el;
9
9
  documentService: SmzDocumentsService;
10
10
  private location;
@@ -13,17 +13,12 @@ export declare class SmzDocumentViewerComponent implements OnInit, AfterViewInit
13
13
  private renderer;
14
14
  paperElement: ElementRef;
15
15
  state: SmzDocumentState;
16
- maxZoom: number;
17
- minZoom: number;
18
16
  now: string;
19
17
  constructor(el: ElementRef, documentService: SmzDocumentsService, location: Location, cdf: ChangeDetectorRef, store: Store, renderer: Renderer2);
20
18
  ngOnInit(): void;
21
19
  ngAfterViewInit(): void;
22
- generate(action: "open" | "print" | "download", element: ElementRef): void;
23
- moreZoom(): void;
24
- lessZoom(): void;
25
- restoreZoom(): void;
26
20
  goBack(): void;
21
+ ngOnDestroy(): void;
27
22
  static ɵfac: i0.ɵɵFactoryDeclaration<SmzDocumentViewerComponent, never>;
28
23
  static ɵcmp: i0.ɵɵComponentDeclaration<SmzDocumentViewerComponent, "document-viewer", never, { "state": "state"; }, {}, never, ["header", "content"]>;
29
24
  }
@@ -1,6 +1,10 @@
1
1
  import { SmzDocumentGlobals } from './smz-document';
2
2
  export interface SmzDocumentConfig {
3
3
  globals: SmzDocumentGlobals;
4
+ viewer: {
5
+ container: string;
6
+ paper: string;
7
+ };
4
8
  paper: {
5
9
  headerHeightCm: number;
6
10
  marginCm: {
@@ -0,0 +1,25 @@
1
+ export interface SmzDocumentViewer {
2
+ filename: string;
3
+ zoom: {
4
+ isEnabled: boolean;
5
+ min: number;
6
+ max: number;
7
+ initial: number;
8
+ variation: number;
9
+ };
10
+ open: {
11
+ isEnabled: boolean;
12
+ };
13
+ print: {
14
+ isEnabled: boolean;
15
+ };
16
+ download: {
17
+ isEnabled: boolean;
18
+ };
19
+ container: {
20
+ styleClass: string;
21
+ };
22
+ paper: {
23
+ styleClass: string;
24
+ };
25
+ }
@@ -1,6 +1,7 @@
1
1
  import { SmzDocumentConfig } from './smz-document-config';
2
2
  import { SmzDocumentFeatures } from './smz-document-features';
3
3
  import { SmzDocumentPaper } from './smz-document-paper';
4
+ import { SmzDocumentViewer } from './smz-document-viewer';
4
5
  export interface SmzDocumentState {
5
6
  isDebug: boolean;
6
7
  header: SmzDocumentContent;
@@ -13,6 +14,7 @@ export interface SmzDocumentState {
13
14
  showPageNumbers: boolean;
14
15
  };
15
16
  paper: SmzDocumentPaper;
17
+ viewer: SmzDocumentViewer;
16
18
  }
17
19
  export declare type SmzDocumentFontFamilies = 'Roboto' | 'Open Sans';
18
20
  export interface SmzDocumentGlobals {
@@ -1,12 +1,23 @@
1
1
  import { ElementRef } from '@angular/core';
2
+ import { Store } from '@ngxs/store';
2
3
  import { SmzDocumentState } from '../models/smz-document';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class SmzDocumentsService {
6
+ private store;
5
7
  showDownloadControl: boolean;
6
8
  showExportControl: boolean;
7
9
  zoom: number;
8
- constructor();
9
- generatePdf(action: 'open' | 'print' | 'download', element: ElementRef, state: SmzDocumentState): Promise<any>;
10
+ filename: string;
11
+ state: SmzDocumentState;
12
+ constructor(store: Store);
13
+ setZoom(zoom: number): void;
14
+ setFilename(filename: string): void;
15
+ setState(state: SmzDocumentState): void;
16
+ generate(action: "open" | "print" | "download", element: ElementRef): void;
17
+ moreZoom(): void;
18
+ lessZoom(): void;
19
+ restoreZoom(): void;
20
+ private generatePdf;
10
21
  static ɵfac: i0.ɵɵFactoryDeclaration<SmzDocumentsService, never>;
11
22
  static ɵprov: i0.ɵɵInjectableDeclaration<SmzDocumentsService>;
12
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-smz-ui",
3
- "version": "3.4.21",
3
+ "version": "3.5.1",
4
4
  "peerDependencies": {
5
5
  "@auth0/angular-jwt": "^4.0.0 || ^5.0.0",
6
6
  "@ngneat/until-destroy": "^8.0.0",