@stemy/ngx-utils 19.9.15 → 19.9.17
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/fesm2022/stemy-ngx-utils.mjs +52 -30
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +6 -2
- package/ngx-utils/components/dynamic-table/dynamic-table.component.d.ts +2 -2
- package/ngx-utils/directives/pagination.directive.d.ts +5 -4
- package/ngx-utils/utils/promise.utils.d.ts +1 -0
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
|
@@ -301,7 +301,7 @@ export interface IPaginationData {
|
|
|
301
301
|
items: any[];
|
|
302
302
|
meta?: any;
|
|
303
303
|
}
|
|
304
|
-
export type PaginationDataLoader = (page: number, itemsPerPage: number) => Promise<IPaginationData>;
|
|
304
|
+
export type PaginationDataLoader = (page: number, itemsPerPage: number, controller: AbortController) => Promise<IPaginationData>;
|
|
305
305
|
export declare class PaginationItemContext {
|
|
306
306
|
readonly item: any;
|
|
307
307
|
readonly parallelItem: any;
|
|
@@ -464,6 +464,10 @@ export interface HttpRequestOptions extends HttpClientRequestOptions {
|
|
|
464
464
|
* Specifies when the cache for the request expires as an Observable
|
|
465
465
|
*/
|
|
466
466
|
cache?: Observable<any>;
|
|
467
|
+
/**
|
|
468
|
+
* Specifies an abort controller to make the request abortable
|
|
469
|
+
*/
|
|
470
|
+
controller?: AbortController;
|
|
467
471
|
}
|
|
468
472
|
/**
|
|
469
473
|
* Defines the type of uploadable content
|
|
@@ -577,7 +581,7 @@ export interface ITableDataQuery {
|
|
|
577
581
|
[column: string]: string | string[] | boolean;
|
|
578
582
|
}
|
|
579
583
|
export type TableDataItems = ReadonlyArray<any>;
|
|
580
|
-
export type TableDataLoader = (page: number, rowsPerPage: number, orderBy: string, orderDescending: boolean, filter: string, query: ITableDataQuery) => Promise<IPaginationData>;
|
|
584
|
+
export type TableDataLoader = (page: number, rowsPerPage: number, orderBy: string, orderDescending: boolean, filter: string, query: ITableDataQuery, controller: AbortController) => Promise<IPaginationData>;
|
|
581
585
|
export type DragDropEvent<K extends string = "item", T = any> = {
|
|
582
586
|
[key in K]: T;
|
|
583
587
|
} & {
|
|
@@ -80,9 +80,9 @@ export declare class DynamicTableComponent implements AfterViewInit, OnChanges,
|
|
|
80
80
|
refresh(time?: number): void;
|
|
81
81
|
setFilter(filter: string): void;
|
|
82
82
|
setSorting(column: string, toggle?: DropdownDirective): void;
|
|
83
|
-
setQueryValue(c: string, value
|
|
83
|
+
setQueryValue(c: string, value?: string | boolean): void;
|
|
84
84
|
setItemsPerPage(count: number): void;
|
|
85
|
-
loadData: (page: number, itemsPerPage: number) => Promise<IPaginationData>;
|
|
85
|
+
loadData: (page: number, itemsPerPage: number, controller: AbortController) => Promise<IPaginationData>;
|
|
86
86
|
protected loadLocalData(page: number, rowsPerPage: number, orderBy: string, orderDescending: boolean, filter: string, query: ITableDataQuery): Promise<IPaginationData>;
|
|
87
87
|
static ɵfac: i0.ɵɵFactoryDeclaration<DynamicTableComponent, never>;
|
|
88
88
|
static ɵcmp: i0.ɵɵComponentDeclaration<DynamicTableComponent, "dynamic-table", never, { "dataLoader": { "alias": "dataLoader"; "required": false; }; "data": { "alias": "data"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "page": { "alias": "page"; "required": false; }; "urlParam": { "alias": "urlParam"; "required": false; }; "parallelData": { "alias": "parallelData"; "required": false; }; "columns": { "alias": "columns"; "required": false; }; "showFilter": { "alias": "showFilter"; "required": false; }; "filterLabel": { "alias": "filterLabel"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "showItems": { "alias": "showItems"; "required": false; }; "itemsPerPage": { "alias": "itemsPerPage"; "required": false; }; "updateTime": { "alias": "updateTime"; "required": false; }; "filterTime": { "alias": "filterTime"; "required": false; }; "maxPages": { "alias": "maxPages"; "required": false; }; "directionLinks": { "alias": "directionLinks"; "required": false; }; "boundaryLinks": { "alias": "boundaryLinks"; "required": false; }; "orderBy": { "alias": "orderBy"; "required": false; }; "orderDescending": { "alias": "orderDescending"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "titlePrefix": { "alias": "titlePrefix"; "required": false; }; "dragStartFn": { "alias": "dragStartFn"; "required": false; }; "dragEnterFn": { "alias": "dragEnterFn"; "required": false; }; "dropFn": { "alias": "dropFn"; "required": false; }; "globalTemplatePrefix": { "alias": "globalTemplatePrefix"; "required": false; "isSignal": true; }; }, { "onClick": "onClick"; }, ["fallbackTemplate", "templateDirectives", "rowTemplate", "wrapperTemplate"], ["[table-features-before]", "[table-features-after]", "[table-top]", "[table-bottom]"], false, never>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ElementRef, EventEmitter, NgZone, OnChanges, Renderer2, SimpleChanges } from "@angular/core";
|
|
2
|
-
import { PaginationDataLoader } from "../common-types";
|
|
2
|
+
import { IPaginationData, ITimer, PaginationDataLoader } from "../common-types";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class PaginationDirective implements OnChanges {
|
|
5
5
|
readonly zone: NgZone;
|
|
@@ -15,12 +15,13 @@ export declare class PaginationDirective implements OnChanges {
|
|
|
15
15
|
pageChange: EventEmitter<number>;
|
|
16
16
|
onRefresh: EventEmitter<PaginationDirective>;
|
|
17
17
|
maxPage: number;
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
protected data: IPaginationData;
|
|
19
|
+
protected updateTimer: ITimer;
|
|
20
|
+
protected controller: AbortController;
|
|
20
21
|
constructor(zone: NgZone, renderer: Renderer2, element: ElementRef);
|
|
21
22
|
ngOnChanges(changes: SimpleChanges): void;
|
|
22
23
|
refresh(time?: number): void;
|
|
23
|
-
paginate(page: number): void;
|
|
24
|
+
paginate(page: number, time?: number): void;
|
|
24
25
|
private loadData;
|
|
25
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<PaginationDirective, never>;
|
|
26
27
|
static ɵdir: i0.ɵɵDirectiveDeclaration<PaginationDirective, "[pagination]", ["pagination"], { "loader": { "alias": "pagination"; "required": false; }; "page": { "alias": "page"; "required": false; }; "itemsPerPage": { "alias": "itemsPerPage"; "required": false; }; "updateTime": { "alias": "updateTime"; "required": false; }; "waitFor": { "alias": "waitFor"; "required": false; }; }, { "pageChange": "pageChange"; "onRefresh": "onRefresh"; }, never, never, false, never>;
|
|
@@ -3,3 +3,4 @@ export interface CancelablePromise<T> extends Promise<T> {
|
|
|
3
3
|
}
|
|
4
4
|
export declare function cancelablePromise<T>(source: Promise<T>): CancelablePromise<T>;
|
|
5
5
|
export declare function impatientPromise<T>(factory: () => Promise<T>): () => Promise<T>;
|
|
6
|
+
export declare function promiseTimeout(time?: number): Promise<void>;
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { EPSILON, normalizeRange, clamp, overflow, isEqual, isZero, MathUtils }
|
|
|
25
25
|
export { isBrowser, getRoot, switchClass, getCssVariables, checkTransitions, getComponentDef, parseSelector, selectorMatchesList, provideEntryComponents, provideOptions, provideWithOptions, injectOptions, DiffEntityResult, diffEntities } from "./ngx-utils/utils/misc";
|
|
26
26
|
export { ObjectUtils } from "./ngx-utils/utils/object.utils";
|
|
27
27
|
export { ObservableUtils, ISubscriberInfo } from "./ngx-utils/utils/observable.utils";
|
|
28
|
-
export { CancelablePromise, cancelablePromise, impatientPromise } from "./ngx-utils/utils/promise.utils";
|
|
28
|
+
export { CancelablePromise, cancelablePromise, impatientPromise, promiseTimeout } from "./ngx-utils/utils/promise.utils";
|
|
29
29
|
export { svgToDataUri, StringUtils } from "./ngx-utils/utils/string.utils";
|
|
30
30
|
export { SetUtils } from "./ngx-utils/utils/set.utils";
|
|
31
31
|
export { computedPrevious, cssStyles, cssVariables } from "./ngx-utils/utils/signal-utils";
|