@sumaris-net/ngx-components 18.6.10 → 18.6.11-alpha2

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sumaris-net/ngx-components",
3
3
  "description": "SUMARiS Angular components",
4
- "version": "18.6.10",
4
+ "version": "18.6.11-alpha2",
5
5
  "author": "contact@e-is.pro",
6
6
  "license": "AGPL-3.0",
7
7
  "readmeFilename": "README.md",
package/public_api.d.ts CHANGED
@@ -147,6 +147,7 @@ export * from './src/app/shared/markdown/markdown.service';
147
147
  export * from './src/app/shared/markdown/markdown.directive';
148
148
  export * from './src/app/shared/markdown/markdown.component';
149
149
  export * from './src/app/shared/markdown/markdown.modal';
150
+ export * from './src/app/shared/print/print.service';
150
151
  export * from './src/app/core/core.module';
151
152
  export * from './src/app/core/services/model/account.model';
152
153
  export * from './src/app/core/services/model/token.model';
@@ -17,7 +17,7 @@ export interface InputElement extends FocusableElement {
17
17
  }
18
18
  export declare function isInputElement(object: any): object is InputElement;
19
19
  export declare function asInputElement<T = any>(object: ElementRef<T>): InputElement | undefined;
20
- export declare function tabindexComparator(a: InputElement, b: InputElement): 0 | 1 | -1;
20
+ export declare function tabindexComparator(a: InputElement, b: InputElement): 1 | 0 | -1;
21
21
  export interface CanGainFocusOptions {
22
22
  minTabindex?: number;
23
23
  maxTabindex?: number;
@@ -3,8 +3,9 @@ import { LocalSettingsService } from '../../core/services/local-settings.service
3
3
  import { TranslateService } from '@ngx-translate/core';
4
4
  import { NetworkService } from '../../core/services/network.service';
5
5
  import { MarkdownService } from './markdown.service';
6
- import { NavController } from '@ionic/angular';
6
+ import { NavController, ToastController } from '@ionic/angular';
7
7
  import { ActivatedRoute } from '@angular/router';
8
+ import { PrintService } from '../print/print.service';
8
9
  import * as i0 from "@angular/core";
9
10
  export interface AppMarkdownOptions {
10
11
  data?: string;
@@ -16,13 +17,15 @@ export declare class AppMarkdownContent implements AppMarkdownOptions, OnDestroy
16
17
  protected element: ElementRef<HTMLElement>;
17
18
  private _document;
18
19
  protected route: ActivatedRoute;
19
- private _printIframe;
20
+ private _printId;
20
21
  private _clickSubscription;
21
22
  protected navController: NavController;
22
23
  protected settings: LocalSettingsService;
23
24
  protected translate: TranslateService;
24
25
  protected network: NetworkService;
25
26
  protected markdownService: MarkdownService;
27
+ protected toastController: ToastController;
28
+ protected printService: PrintService;
26
29
  protected loading: boolean;
27
30
  protected error: string;
28
31
  protected baseUrl: string;
@@ -52,13 +55,15 @@ export declare class AppMarkdownContent implements AppMarkdownOptions, OnDestroy
52
55
  ngOnDestroy(): void;
53
56
  goBack(event?: Event): void;
54
57
  get canGoBack(): boolean;
55
- print(event?: Event): void;
56
- markAsLoaded(): void;
57
- markAsLoading(): void;
58
+ print(): Promise<void>;
59
+ markAsLoaded(opts?: {
60
+ emitEvent?: boolean;
61
+ }): void;
62
+ markAsLoading(opts?: {
63
+ emitEvent?: boolean;
64
+ }): void;
58
65
  setError(error: string | Error): void;
59
66
  resetError(): void;
60
- private createPrintHiddenIframe;
61
- private injectAppStylesIntoIframe;
62
67
  protected setData(value: string, opts?: {
63
68
  anchor?: string;
64
69
  addToNavigationHistory?: boolean;
@@ -13,6 +13,8 @@ export interface AppMarkdownModalOptions {
13
13
  showError?: boolean;
14
14
  cssClass?: string;
15
15
  canPrint?: boolean;
16
+ enableNavigationHistory?: boolean;
17
+ debug?: boolean;
16
18
  }
17
19
  export declare class AppMarkdownModal implements AppMarkdownModalOptions {
18
20
  protected injector: Injector;
@@ -22,12 +24,13 @@ export declare class AppMarkdownModal implements AppMarkdownModalOptions {
22
24
  protected translate: TranslateService;
23
25
  protected network: NetworkService;
24
26
  protected cd: ChangeDetectorRef;
25
- debug: boolean;
26
27
  title: string;
27
28
  showError: boolean;
28
29
  canPrint: boolean;
29
30
  data: string;
30
31
  src: string;
32
+ enableNavigationHistory: boolean;
33
+ debug: boolean;
31
34
  content: AppMarkdownContent;
32
35
  static show(modalCtrl: ModalController, options: AppMarkdownModalOptions): Promise<import("@ionic/core").OverlayEventDetail<any>>;
33
36
  constructor(injector: Injector, viewCtrl: ModalController, platform: PlatformService, settings: LocalSettingsService, translate: TranslateService, network: NetworkService, cd: ChangeDetectorRef);
@@ -38,5 +41,9 @@ export declare class AppMarkdownModal implements AppMarkdownModalOptions {
38
41
  protected setError(err: string | Error): void;
39
42
  protected resetError(): void;
40
43
  static ɵfac: i0.ɵɵFactoryDeclaration<AppMarkdownModal, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<AppMarkdownModal, "app-markdown-modal", never, { "debug": { "alias": "debug"; "required": false; }; "title": { "alias": "title"; "required": false; }; "showError": { "alias": "showError"; "required": false; }; "canPrint": { "alias": "canPrint"; "required": false; }; "data": { "alias": "data"; "required": false; }; "src": { "alias": "src"; "required": false; }; }, {}, never, never, false, never>;
44
+ static ɵcmp: i0.ɵɵComponentDeclaration<AppMarkdownModal, "app-markdown-modal", never, { "title": { "alias": "title"; "required": false; }; "showError": { "alias": "showError"; "required": false; }; "canPrint": { "alias": "canPrint"; "required": false; }; "data": { "alias": "data"; "required": false; }; "src": { "alias": "src"; "required": false; }; "enableNavigationHistory": { "alias": "enableNavigationHistory"; "required": false; }; "debug": { "alias": "debug"; "required": false; }; }, {}, never, never, false, never>;
45
+ static ngAcceptInputType_showError: unknown;
46
+ static ngAcceptInputType_canPrint: unknown;
47
+ static ngAcceptInputType_enableNavigationHistory: unknown;
48
+ static ngAcceptInputType_debug: unknown;
42
49
  }
@@ -21,5 +21,6 @@ export declare class MarkdownUtils {
21
21
  absoluteByDefault: boolean;
22
22
  }): string;
23
23
  static isGitlabUrl(url: string): boolean;
24
+ static fixGitlabUrlToRaw(url: string): string;
24
25
  static getRootUrl(url: string): string;
25
26
  }
@@ -1,12 +1,15 @@
1
1
  import { ChangeDetectorRef } from '@angular/core';
2
2
  import { ModalController } from '@ionic/angular';
3
+ import { Environment } from '../../../../environments/environment.class';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class MarkdownTestPage {
5
6
  private modalCtrl;
6
7
  private cd;
8
+ protected environment: Environment;
7
9
  protected markdownModalTitle: string;
10
+ protected debug: boolean;
8
11
  protected markdownUrl: string;
9
- constructor(modalCtrl: ModalController, cd: ChangeDetectorRef);
12
+ constructor(modalCtrl: ModalController, cd: ChangeDetectorRef, environment: Environment);
10
13
  onSubmit(event: Event, newUrl: string | number): void;
11
14
  updateInputUrl(url: string): void;
12
15
  openHelpModal(event: Event): Promise<import("@ionic/core").OverlayEventDetail<any>>;
@@ -0,0 +1,60 @@
1
+ import { ToastController } from '@ionic/angular';
2
+ import { TranslateService } from '@ngx-translate/core';
3
+ import { StorageService } from '../storage/storage.service';
4
+ import * as i0 from "@angular/core";
5
+ export interface PrintOptions {
6
+ id?: string | number;
7
+ title?: string;
8
+ showToast?: boolean;
9
+ toastMessage?: string;
10
+ style?: string;
11
+ }
12
+ export declare const PRINT_LOADING_STORAGE_KEY_PREFIX = "print-loading-";
13
+ export declare class PrintService {
14
+ protected toastController: ToastController;
15
+ protected translate: TranslateService;
16
+ protected storage: StorageService;
17
+ protected document: Document;
18
+ private printId;
19
+ constructor(toastController: ToastController, translate: TranslateService, storage: StorageService, document: Document);
20
+ nextJobId(): number;
21
+ printElement(element: HTMLElement, opts?: PrintOptions): Promise<void>;
22
+ printHTML(html: string, opts?: PrintOptions): Promise<void>;
23
+ printUrl(url: string, opts?: Omit<PrintOptions, 'style'>): Promise<void>;
24
+ printIframe(iframe: HTMLIFrameElement, opts?: PrintOptions): Promise<void>;
25
+ markAsLoading(id: string | number): Promise<void>;
26
+ markAsLoaded(id: string | number): Promise<void>;
27
+ isLoaded(id: string | number): Promise<boolean>;
28
+ isLoading(id: string | number): Promise<boolean>;
29
+ protected createPrintIframeByUrl(url: string): HTMLIFrameElement;
30
+ protected createPrintIframeByHtml(html: string, opts?: {
31
+ title?: string;
32
+ inlineStyle?: string;
33
+ }): HTMLIFrameElement;
34
+ /**
35
+ * Applies the styles from the provided document, including external stylesheets and inline styles,
36
+ * to the specified iframe's document.
37
+ *
38
+ * @param {HTMLIFrameElement} iframe - The iframe to which the styles are applied.
39
+ * @return {void} Does not return a value.
40
+ */
41
+ protected applyDocumentStyleToIframe(iframe: HTMLIFrameElement): void;
42
+ protected waitIdle(iframe: HTMLIFrameElement, opts?: {
43
+ id?: number | string;
44
+ timeout?: number;
45
+ }): Promise<void>;
46
+ /**
47
+ * Triggers the print functionality of the given iframe and resolves or rejects based on the print completion or timeout.
48
+ *
49
+ * @param {HTMLIFrameElement} iframe - The iframe element to be printed.
50
+ * @param {{timeout?: number}} [opts] - An optional configuration object.
51
+ * @param {number} [opts.timeout] - The maximum time in milliseconds to wait for the print to complete before rejecting the promise.
52
+ * @return {Promise<void>} A promise that resolves after the print is completed or rejects if a timeout occurs.
53
+ */
54
+ protected print(iframe: HTMLIFrameElement, opts?: {
55
+ timeout?: number;
56
+ }): Promise<void>;
57
+ private showToast;
58
+ static ɵfac: i0.ɵɵFactoryDeclaration<PrintService, never>;
59
+ static ɵprov: i0.ɵɵInjectableDeclaration<PrintService>;
60
+ }
@@ -635,7 +635,7 @@
635
635
  "FIELD_NOT_EQUALS": "Value not equals",
636
636
  "SPACE_NOT_ALLOW": "Spaces or special characters not allowed",
637
637
  "SCRYPT_ERROR": "Unable to create account keys",
638
- "INVALID_OR_INCOMPLETE_FILL": "Invalid or incomplete fill",
638
+ "INVALID_OR_INCOMPLETE_FILL": "Incomplete or invalid entry",
639
639
  "UNKNOWN_ACCOUNT_EMAIL": "No account matches this email.",
640
640
  "BAD_PASSWORD": "Incorrect password.",
641
641
  "EMAIL_ALREADY_REGISTERED": "Email already registered",
@@ -690,7 +690,8 @@
690
690
  "SUBSCRIBE_ERROR": "Error while subscribe to changes",
691
691
  "FIELD_NOT_EXISTS": "Value doesn't exist",
692
692
  "FIREFOX_NO_STORAGE": "The application cannot run with Firefox in 'private' mode or without keeping navigation history",
693
- "FEATURE_NOT_IMPLEMENTED": "Feature not implemented! <small><br/>Please contact your administrator.</small>"
693
+ "FEATURE_NOT_IMPLEMENTED": "Feature not implemented! <small><br/>Please contact your administrator.</small>",
694
+ "INCOMPATIBLE_WEB_BROWSER": "Feature not compatible with your web browser. <small><br/>Please contact your administrator, or try another web browser.</small>"
694
695
  },
695
696
  "CONFIRM": {
696
697
  "ALERT_HEADER": "Confirmation",
@@ -689,7 +689,8 @@
689
689
  "SUBSCRIBE_ERROR": "Error while subscribe to changes",
690
690
  "FIELD_NOT_EXISTS": "Value doesn't exist",
691
691
  "FIREFOX_NO_STORAGE": "The application cannot run with Firefox in 'private' mode or without keeping navigation history",
692
- "FEATURE_NOT_IMPLEMENTED": "Feature not implemented! <small><br/>Please contact your administrator.</small>"
692
+ "FEATURE_NOT_IMPLEMENTED": "Feature not implemented! <small><br/>Please contact your administrator.</small>",
693
+ "INCOMPATIBLE_WEB_BROWSER": "Feature not compatible with your web browser. <small><br/>Please contact your administrator, or try another web browser.</small>"
693
694
  },
694
695
  "CONFIRM": {
695
696
  "ALERT_HEADER": "Confirmation",
@@ -691,7 +691,8 @@
691
691
  "SUBSCRIBE_ERROR": "Échec de l'abonnement distant aux modifications",
692
692
  "FIELD_NOT_EXISTS": "Cette valeur n'existe pas",
693
693
  "FIREFOX_NO_STORAGE": "L'application ne peut pas fonctionner sur Firefox en mode 'navigation privée' ou si la conservation de l'historique est désactivée",
694
- "FEATURE_NOT_IMPLEMENTED": "Fonctionnalité non implémentée ! <small><br/>Veuillez contacter votre administrateur.</small>"
694
+ "FEATURE_NOT_IMPLEMENTED": "Fonctionnalité non implémentée ! <small><br/>Veuillez contacter votre administrateur.</small>",
695
+ "INCOMPATIBLE_WEB_BROWSER": "Fonctionnalité non compatible avec votre navigateur Internet. <small><br/>Veuillez contacter votre administrateur, ou tester un autre navigateur.</small>"
695
696
  },
696
697
  "CONFIRM": {
697
698
  "ALERT_HEADER": "Confirmation",
@@ -2,7 +2,7 @@
2
2
  "name": "ngx-sumaris-components",
3
3
  "short_name": "ngx-sumaris-components",
4
4
  "manifest_version": 1,
5
- "version": "18.6.10",
5
+ "version": "18.6.11-alpha2",
6
6
  "default_locale": "fr",
7
7
  "description": "Angular components for building beautiful and responsive Apps",
8
8
  "icons": [{