@recursyve/nice-ui-kit.v2 14.0.0-beta.125 → 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.
@@ -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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@recursyve/nice-ui-kit.v2",
3
- "version": "14.0.0-beta.125",
3
+ "version": "14.0.0-beta.126",
4
4
  "exports": {
5
5
  ".": {
6
6
  "sass": "./_index.scss",