@recursyve/nice-ui-kit.v2 14.0.0-beta.124 → 14.0.0-beta.126

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 (38) hide show
  1. package/esm2020/lib/components/async-typeahead/async-typeahead.component.mjs +6 -2
  2. package/esm2020/lib/components/async-typeahead/providers/async-typeahead.provider.mjs +1 -1
  3. package/esm2020/lib/components/async-typeahead/providers/async-typeahead.service.mjs +73 -63
  4. package/esm2020/lib/components/form-error/control-status.directive.mjs +9 -2
  5. package/esm2020/lib/components/form-error/form-error.component.mjs +1 -1
  6. package/esm2020/lib/components/loading-toast/index.mjs +2 -0
  7. package/esm2020/lib/components/loading-toast/loading-toast.component.mjs +38 -0
  8. package/esm2020/lib/components/loading-toast/loading-toast.constant.mjs +3 -0
  9. package/esm2020/lib/components/loading-toast/loading-toast.directive.mjs +64 -0
  10. package/esm2020/lib/components/loading-toast/loading-toast.module.mjs +62 -0
  11. package/esm2020/lib/components/loading-toast/loading-toast.service.mjs +47 -0
  12. package/esm2020/lib/components/loading-toast/public-api.mjs +6 -0
  13. package/esm2020/lib/components/loading-toast/rxjs/show-loading-toast.operator.mjs +12 -0
  14. package/esm2020/lib/components/public-api.mjs +2 -1
  15. package/esm2020/lib/components/toast/public-api.mjs +3 -1
  16. package/esm2020/lib/components/toast/rxjs/show-success-or-error-toast.operator.mjs +22 -0
  17. package/esm2020/lib/components/toast/rxjs/show-toast.operator.mjs +22 -0
  18. package/fesm2015/recursyve-nice-ui-kit.v2.mjs +420 -158
  19. package/fesm2015/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  20. package/fesm2020/recursyve-nice-ui-kit.v2.mjs +433 -182
  21. package/fesm2020/recursyve-nice-ui-kit.v2.mjs.map +1 -1
  22. package/lib/components/async-typeahead/providers/async-typeahead.provider.d.ts +2 -1
  23. package/lib/components/async-typeahead/providers/async-typeahead.service.d.ts +13 -2
  24. package/lib/components/form-error/control-status.directive.d.ts +4 -2
  25. package/lib/components/form-error/form-error.component.d.ts +1 -1
  26. package/lib/components/loading-toast/index.d.ts +1 -0
  27. package/lib/components/loading-toast/loading-toast.component.d.ts +19 -0
  28. package/lib/components/loading-toast/loading-toast.constant.d.ts +2 -0
  29. package/lib/components/loading-toast/loading-toast.directive.d.ts +18 -0
  30. package/lib/components/loading-toast/loading-toast.module.d.ts +16 -0
  31. package/lib/components/loading-toast/loading-toast.service.d.ts +20 -0
  32. package/lib/components/loading-toast/public-api.d.ts +5 -0
  33. package/lib/components/loading-toast/rxjs/show-loading-toast.operator.d.ts +6 -0
  34. package/lib/components/public-api.d.ts +1 -0
  35. package/lib/components/toast/public-api.d.ts +2 -0
  36. package/lib/components/toast/rxjs/show-success-or-error-toast.operator.d.ts +37 -0
  37. package/lib/components/toast/rxjs/show-toast.operator.d.ts +17 -0
  38. package/package.json +1 -1
@@ -1,10 +1,11 @@
1
+ import { Observable } from "rxjs";
1
2
  export interface NiceAsyncTypeaheadSearchResult<T> {
2
3
  items: T[];
3
4
  nextPage: number | null;
4
5
  }
5
6
  export declare abstract class NiceAsyncTypeaheadProvider<T, ID = number, Options = any> {
6
7
  abstract resource: string;
7
- abstract search(searchQuery: string, page: number, options?: Options): Promise<NiceAsyncTypeaheadSearchResult<T>>;
8
+ abstract search(searchQuery: string, page: number, options?: Options): Observable<NiceAsyncTypeaheadSearchResult<T>> | Promise<NiceAsyncTypeaheadSearchResult<T>>;
8
9
  abstract getById(id: ID, options?: Options): Promise<T>;
9
10
  format(item: T): string;
10
11
  }
@@ -12,6 +12,12 @@ export declare class AsyncTypeaheadState {
12
12
  searchQuery?: string;
13
13
  excludedIds: any[];
14
14
  }
15
+ export declare type AsyncTypeaheadRequests = {
16
+ resource: string;
17
+ page: number;
18
+ searchQuery?: string;
19
+ searchOptions?: any;
20
+ };
15
21
  export declare class NiceAsyncTypeaheadService {
16
22
  private readonly apis;
17
23
  private state$;
@@ -20,10 +26,15 @@ export declare class NiceAsyncTypeaheadService {
20
26
  active$: Observable<any>;
21
27
  items$: Observable<any[]>;
22
28
  filteredItems$: Observable<any[]>;
29
+ private requests$;
30
+ private requestsSubscription$;
23
31
  constructor(apis: NiceAsyncTypeaheadProvider<any>[]);
32
+ listenForRequest(): void;
33
+ closeRequestSubscription(): void;
24
34
  initialize(resource: string, options?: any): Promise<void>;
25
- search(resource: string, searchQuery: string, options?: any): Promise<void>;
26
- loadMore(resource: string, options?: any): Promise<void>;
35
+ sendRequest(request: AsyncTypeaheadRequests): Observable<void>;
36
+ search(resource: string, searchQuery: string, options?: any): void;
37
+ loadMore(resource: string, options?: any): void;
27
38
  getActive(): any;
28
39
  getInitialized(): boolean;
29
40
  setActive(entity: any | undefined): void;
@@ -1,16 +1,18 @@
1
- import { AfterViewInit, ElementRef, ViewContainerRef } from "@angular/core";
1
+ import { AfterViewInit, ElementRef, OnDestroy, ViewContainerRef } from "@angular/core";
2
2
  import { MatFormField } from "@angular/material/form-field";
3
3
  import { TranslateService } from "@ngx-translate/core";
4
4
  import * as i0 from "@angular/core";
5
- export declare class NiceControlStatusDirective implements AfterViewInit {
5
+ export declare class NiceControlStatusDirective implements AfterViewInit, OnDestroy {
6
6
  private el;
7
7
  private vcr;
8
8
  private formField;
9
9
  private translateService;
10
10
  private ref;
11
11
  private control;
12
+ private unsubscribeAll$;
12
13
  constructor(el: ElementRef<HTMLElement>, vcr: ViewContainerRef, formField: MatFormField, translateService: TranslateService);
13
14
  ngAfterViewInit(): void;
15
+ ngOnDestroy(): void;
14
16
  onChange(): void;
15
17
  setError(text: string): void;
16
18
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceControlStatusDirective, never>;
@@ -2,7 +2,7 @@ import * as i0 from "@angular/core";
2
2
  export declare class NiceFormErrorComponent {
3
3
  message: string;
4
4
  increment: number;
5
- set error(value: any);
5
+ set error(value: string);
6
6
  static ɵfac: i0.ɵɵFactoryDeclaration<NiceFormErrorComponent, never>;
7
7
  static ɵcmp: i0.ɵɵComponentDeclaration<NiceFormErrorComponent, "[form-error]", never, { "error": "error"; }, {}, never, never, false>;
8
8
  }
@@ -0,0 +1 @@
1
+ export * from "./public-api";
@@ -0,0 +1,19 @@
1
+ import { NiceAlertAppearance, NiceAlertColor, NiceAlertType } from "../alert";
2
+ import { NiceLoadingToastOptions } from "./loading-toast.service";
3
+ import * as i0 from "@angular/core";
4
+ export interface NiceLoadingToastData {
5
+ message: string;
6
+ options?: NiceLoadingToastOptions;
7
+ }
8
+ export declare class NiceLoadingToastComponent {
9
+ data?: NiceLoadingToastData;
10
+ message: string;
11
+ options: NiceLoadingToastOptions;
12
+ get appearance(): NiceAlertAppearance;
13
+ get color(): NiceAlertColor;
14
+ get showIcon(): boolean;
15
+ get type(): NiceAlertType;
16
+ constructor(data?: NiceLoadingToastData);
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastComponent, [{ optional: true; }]>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<NiceLoadingToastComponent, "nice-loading-toast", never, { "message": "message"; "options": "options"; }, {}, never, never, false>;
19
+ }
@@ -0,0 +1,2 @@
1
+ import { InjectionToken } from "@angular/core";
2
+ export declare const NICE_LOADING_TOAST_OPTIONS: InjectionToken<unknown>;
@@ -0,0 +1,18 @@
1
+ import { BooleanInput } from "@angular/cdk/coercion";
2
+ import { Overlay } from "@angular/cdk/overlay";
3
+ import { NiceLoadingToastOptions } from "./loading-toast.service";
4
+ import * as i0 from "@angular/core";
5
+ export declare class NiceLoadingToastDirective {
6
+ private options;
7
+ private overlay;
8
+ static ngAcceptInputType_niceLoadingDisableUserInteraction: BooleanInput;
9
+ private overlayRef;
10
+ private _loading;
11
+ private _niceLoadingDisableUserInteraction;
12
+ niceLoadingMessage: string;
13
+ set niceLoadingDisableUserInteraction(disableUserInteraction: boolean);
14
+ set loading(loading: boolean | null);
15
+ constructor(options: NiceLoadingToastOptions, overlay: Overlay);
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastDirective, [{ optional: true; }, null]>;
17
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NiceLoadingToastDirective, "[niceLoadingToast]", never, { "niceLoadingMessage": "niceLoadingMessage"; "niceLoadingDisableUserInteraction": "niceLoadingDisableUserInteraction"; "loading": "niceLoadingToast"; }, {}, never, never, false>;
18
+ }
@@ -0,0 +1,16 @@
1
+ import { ModuleWithProviders } from "@angular/core";
2
+ import { NiceLoadingToastOptions } from "./loading-toast.service";
3
+ import * as i0 from "@angular/core";
4
+ import * as i1 from "./loading-toast.component";
5
+ import * as i2 from "./loading-toast.directive";
6
+ import * as i3 from "@angular/common";
7
+ import * as i4 from "@angular/material/snack-bar";
8
+ import * as i5 from "@angular/material/progress-spinner";
9
+ import * as i6 from "../alert/alert.module";
10
+ export declare class NiceLoadingToastModule {
11
+ static forRoot(options?: NiceLoadingToastOptions): ModuleWithProviders<NiceLoadingToastModule>;
12
+ static forFeature(options: NiceLoadingToastOptions): ModuleWithProviders<NiceLoadingToastModule>;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<NiceLoadingToastModule, [typeof i1.NiceLoadingToastComponent, typeof i2.NiceLoadingToastDirective], [typeof i3.CommonModule, typeof i4.MatSnackBarModule, typeof i5.MatProgressSpinnerModule, typeof i6.NiceAlertModule], [typeof i2.NiceLoadingToastDirective]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<NiceLoadingToastModule>;
16
+ }
@@ -0,0 +1,20 @@
1
+ import { MatSnackBar, MatSnackBarRef } from "@angular/material/snack-bar";
2
+ import { TranslateService } from "@ngx-translate/core";
3
+ import { NiceAlertAppearance, NiceAlertColor, NiceAlertType } from "../alert";
4
+ import * as i0 from "@angular/core";
5
+ export interface NiceLoadingToastOptions {
6
+ appearance?: NiceAlertAppearance;
7
+ showIcon?: boolean;
8
+ type?: NiceAlertType;
9
+ color?: NiceAlertColor;
10
+ }
11
+ export declare class NiceLoadingToastService {
12
+ private options;
13
+ private snackbar;
14
+ private translateService;
15
+ constructor(options: NiceLoadingToastOptions, snackbar: MatSnackBar, translateService: TranslateService);
16
+ showLoadingToast(messageKey: string, params?: object): MatSnackBarRef<any>;
17
+ private getTranslations;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<NiceLoadingToastService, [{ optional: true; }, null, null]>;
19
+ static ɵprov: i0.ɵɵInjectableDeclaration<NiceLoadingToastService>;
20
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./loading-toast.component";
2
+ export * from "./loading-toast.directive";
3
+ export * from "./loading-toast.module";
4
+ export * from "./loading-toast.service";
5
+ export * from "./rxjs/show-loading-toast.operator";
@@ -0,0 +1,6 @@
1
+ import { MonoTypeOperatorFunction } from "rxjs";
2
+ import { NiceLoadingToastService } from "../loading-toast.service";
3
+ export interface ShowLoadingToastOperatorOptions {
4
+ minDuration?: number;
5
+ }
6
+ export declare function showLoadingToast<T>(loadingToastService: NiceLoadingToastService, key: string, options?: ShowLoadingToastOperatorOptions): MonoTypeOperatorFunction<T>;
@@ -13,6 +13,7 @@ export * from "./horizontal-stepper";
13
13
  export * from "./image-cropper";
14
14
  export * from "./layout";
15
15
  export * from "./loading-spinner";
16
+ export * from "./loading-toast";
16
17
  export * from "./lottie";
17
18
  export * from "./navigation";
18
19
  export * from "./search-bar";
@@ -1,3 +1,5 @@
1
1
  export * from "./toast.component";
2
2
  export * from "./toast.module";
3
3
  export * from "./toast.service";
4
+ export * from "./rxjs/show-toast.operator";
5
+ export * from "./rxjs/show-success-or-error-toast.operator";
@@ -0,0 +1,37 @@
1
+ import { MonoTypeOperatorFunction } from "rxjs";
2
+ import { NiceToastService } from "../toast.service";
3
+ interface ShowToastOperatorCommonKeysOptionsWithoutTitle {
4
+ messageKey: string;
5
+ titleKey?: string;
6
+ params?: object;
7
+ }
8
+ interface ShowToastOperatorCommonKeysOptionsWithoutMessage {
9
+ titleKey: string;
10
+ messageKey?: string;
11
+ params?: object;
12
+ }
13
+ interface ShowToastOperatorOptionsWithoutMessage {
14
+ title: {
15
+ success: string;
16
+ error: string;
17
+ };
18
+ message?: {
19
+ success: string;
20
+ error: string;
21
+ };
22
+ params?: object;
23
+ }
24
+ interface ShowToastOperatorOptionsWithoutTitle {
25
+ message: {
26
+ success: string;
27
+ error: string;
28
+ };
29
+ title?: {
30
+ success: string;
31
+ error: string;
32
+ };
33
+ params?: object;
34
+ }
35
+ export declare type ShowSuccessOrErrorToastOperatorOptions = ShowToastOperatorCommonKeysOptionsWithoutTitle | ShowToastOperatorCommonKeysOptionsWithoutMessage | ShowToastOperatorOptionsWithoutMessage | ShowToastOperatorOptionsWithoutTitle;
36
+ export declare function showSuccessOrErrorToast<T>(loadingToastService: NiceToastService, options: ShowSuccessOrErrorToastOperatorOptions): MonoTypeOperatorFunction<T>;
37
+ export {};
@@ -0,0 +1,17 @@
1
+ import { MonoTypeOperatorFunction } from "rxjs";
2
+ import { NiceToastService } from "../toast.service";
3
+ export interface ShowToastOperatorOptionsWithoutTitle {
4
+ messageKey: string;
5
+ titleKey?: string;
6
+ params?: object;
7
+ }
8
+ export interface ShowToastOperatorOptionsWithoutMessage {
9
+ titleKey: string;
10
+ messageKey?: string;
11
+ params?: object;
12
+ }
13
+ export declare type ShowToastOperatorOptions = ShowToastOperatorOptionsWithoutTitle | ShowToastOperatorOptionsWithoutMessage;
14
+ export declare function showSuccessToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
15
+ export declare function showErrorToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
16
+ export declare function showInfoToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
17
+ export declare function showWarningToast<T>(loadingToastService: NiceToastService, options: ShowToastOperatorOptions): MonoTypeOperatorFunction<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nice-ui-kit.v2",
3
- "version": "14.0.0-beta.124",
3
+ "version": "14.0.0-beta.126",
4
4
  "exports": {
5
5
  ".": {
6
6
  "sass": "./_index.scss",