@apia/api 4.0.24 → 4.0.26
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/dist/index.d.ts +80 -83
- package/dist/index.js +610 -516
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,10 @@ import * as react from 'react';
|
|
|
2
2
|
import react__default from 'react';
|
|
3
3
|
import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
4
4
|
import * as _apia_util from '@apia/util';
|
|
5
|
-
import { TModify, TApiaLoad, TApiaFormElement, TApiaFilterOption, TApiaFilter, TApiaFunction, TApiaFunctionPageInfo, EventEmitter, UnSubscriber } from '@apia/util';
|
|
5
|
+
import { TModify, TApiaLoad, TApiaFormElement, TApiaFilterOption, TApiaFilter, Mutex, TApiaFunction, TApiaFunctionPageInfo, EventEmitter, UnSubscriber } from '@apia/util';
|
|
6
6
|
import { TNotificationMessage, notify } from '@apia/notifications';
|
|
7
7
|
import { TModal, TOpenModal, ApiaUtilModalHandler } from '@apia/components';
|
|
8
8
|
import QueryString from 'qs';
|
|
9
|
-
import * as lodash from 'lodash';
|
|
10
9
|
import { TResponsiveTableColumn, TResponsiveTableContextProps, TResponsiveTableRowsSelectionEvent, TResponsiveTableSortChangeEvent, TResponsiveTableRow } from '@apia/table';
|
|
11
10
|
import * as theme_ui from 'theme-ui';
|
|
12
11
|
|
|
@@ -285,6 +284,7 @@ type TFilter = {
|
|
|
285
284
|
onChange?: (queryController: QueryController) => unknown;
|
|
286
285
|
options?: TApiaFilterOption[];
|
|
287
286
|
placeholder?: string;
|
|
287
|
+
multiplier?: number;
|
|
288
288
|
readonly?: boolean;
|
|
289
289
|
required?: boolean;
|
|
290
290
|
runAutomatically?: boolean;
|
|
@@ -297,6 +297,27 @@ type TFilter = {
|
|
|
297
297
|
isSize?: boolean;
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
+
type TFilterTypesElementConditions = {
|
|
301
|
+
onChange: string;
|
|
302
|
+
readonly: boolean;
|
|
303
|
+
name: string;
|
|
304
|
+
valueAsAttribute: boolean;
|
|
305
|
+
disabled: boolean;
|
|
306
|
+
html: boolean;
|
|
307
|
+
text: string;
|
|
308
|
+
id: string;
|
|
309
|
+
title: string;
|
|
310
|
+
type: string;
|
|
311
|
+
value: string;
|
|
312
|
+
selected: boolean;
|
|
313
|
+
options: {
|
|
314
|
+
option: {
|
|
315
|
+
content: string;
|
|
316
|
+
value: string;
|
|
317
|
+
}[];
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
|
|
300
321
|
declare class Filter {
|
|
301
322
|
protected tableName?: string;
|
|
302
323
|
filterState: TFilter;
|
|
@@ -311,6 +332,9 @@ declare class Filter {
|
|
|
311
332
|
getRangeRenderer({ filter }: {
|
|
312
333
|
filter: TApiaFilter;
|
|
313
334
|
}): react.JSX.Element;
|
|
335
|
+
getDateRenderer({ filter }: {
|
|
336
|
+
filter: TApiaFilter;
|
|
337
|
+
}): react.JSX.Element;
|
|
314
338
|
Component: (({ filter }: {
|
|
315
339
|
filter: TApiaFilter;
|
|
316
340
|
}) => react.JSX.Element) & {
|
|
@@ -319,9 +343,10 @@ declare class Filter {
|
|
|
319
343
|
}
|
|
320
344
|
|
|
321
345
|
type TableControllerState = {
|
|
322
|
-
|
|
346
|
+
finishedFirstLoad: boolean;
|
|
323
347
|
columns: Map<string, TResponsiveTableColumn>;
|
|
324
348
|
filters: Map<string | number, Filter>;
|
|
349
|
+
isLoading: boolean;
|
|
325
350
|
pagination: {
|
|
326
351
|
currentPage: number;
|
|
327
352
|
totalPages: number;
|
|
@@ -342,42 +367,10 @@ type TableControllerEvents = {
|
|
|
342
367
|
onSortChange: TResponsiveTableSortChangeEvent;
|
|
343
368
|
};
|
|
344
369
|
|
|
345
|
-
type TFilterTypesElementConditions = {
|
|
346
|
-
onChange: string;
|
|
347
|
-
readonly: boolean;
|
|
348
|
-
name: string;
|
|
349
|
-
valueAsAttribute: boolean;
|
|
350
|
-
disabled: boolean;
|
|
351
|
-
html: boolean;
|
|
352
|
-
text: string;
|
|
353
|
-
id: string;
|
|
354
|
-
title: string;
|
|
355
|
-
type: string;
|
|
356
|
-
value: string;
|
|
357
|
-
selected: boolean;
|
|
358
|
-
options: {
|
|
359
|
-
option: {
|
|
360
|
-
content: string;
|
|
361
|
-
value: string;
|
|
362
|
-
}[];
|
|
363
|
-
};
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
declare class FilterTypes {
|
|
367
|
-
conditions: TFilterTypesElementConditions[];
|
|
368
|
-
constructor();
|
|
369
|
-
protected getFilterTypes(): Promise<void>;
|
|
370
|
-
Component: () => react.JSX.Element;
|
|
371
|
-
initialLoad(): Promise<void>;
|
|
372
|
-
setFilterOptions(): Promise<void>;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
370
|
declare class TableController {
|
|
376
371
|
private emitter;
|
|
377
372
|
private tableName;
|
|
378
|
-
private tableSelectionController;
|
|
379
373
|
private controllerComponent;
|
|
380
|
-
filterTypes: FilterTypes;
|
|
381
374
|
state: TableControllerState;
|
|
382
375
|
constructor(initialState?: Partial<TableControllerState>);
|
|
383
376
|
clearFilters(): void;
|
|
@@ -398,23 +391,33 @@ declare class TableController {
|
|
|
398
391
|
}
|
|
399
392
|
|
|
400
393
|
type QueryControllerStructure = {
|
|
401
|
-
columns: TResponsiveTableColumn[];
|
|
402
394
|
description: string;
|
|
403
|
-
filters: TFilter[];
|
|
404
395
|
hasAdditionalInformation: boolean;
|
|
405
396
|
isDynamic: boolean;
|
|
406
397
|
openFiltersAutomatically: boolean;
|
|
407
398
|
runFiltersAutomatically: boolean;
|
|
408
399
|
hideFilterTypes: boolean;
|
|
409
400
|
title: string;
|
|
401
|
+
columns: TResponsiveTableColumn[];
|
|
402
|
+
filters: TFilter[];
|
|
410
403
|
};
|
|
404
|
+
type StoredQueryControllerStructure = Omit<QueryControllerStructure, 'columns' | 'filters'>;
|
|
411
405
|
declare class QueryController {
|
|
412
406
|
ajaxUrl: string;
|
|
413
407
|
private hasInited;
|
|
414
408
|
private initializing;
|
|
415
|
-
|
|
409
|
+
protected mutex: Mutex;
|
|
410
|
+
structure: StoredQueryControllerStructure | null;
|
|
416
411
|
tableController: TableController;
|
|
417
|
-
|
|
412
|
+
conditions: TFilterTypesElementConditions[];
|
|
413
|
+
constructor(ajaxUrl: string);
|
|
414
|
+
protected actualRefreshMethod(): Promise<void>;
|
|
415
|
+
protected areRequiredFilters(): boolean;
|
|
416
|
+
protected buildTableController(): TableController;
|
|
417
|
+
clearFilters(): Promise<void>;
|
|
418
|
+
private timeout;
|
|
419
|
+
protected executeRefresh(): void;
|
|
420
|
+
getTableControllerDefaultProps(): Omit<TResponsiveTableContextProps, 'FiltersRenderer' | 'SelectionHandler' | 'filters' | 'columns' | 'rows' | keyof TableControllerEvents> & Pick<TResponsiveTableContextProps, 'statesColumns'>;
|
|
418
421
|
protected getEventsHandlers(): {
|
|
419
422
|
onChangeSelection: (ev: TResponsiveTableRowsSelectionEvent) => void;
|
|
420
423
|
onFilterBlur: (_ev: TApiaFilter) => void;
|
|
@@ -424,46 +427,47 @@ declare class QueryController {
|
|
|
424
427
|
onSelectRows: (_ev: TResponsiveTableRowsSelectionEvent) => void;
|
|
425
428
|
onSortChange: (ev: TResponsiveTableSortChangeEvent) => void;
|
|
426
429
|
onPage: (num: number) => Promise<void>;
|
|
427
|
-
onRefresh: () => Promise<void
|
|
430
|
+
onRefresh: () => Promise<void>;
|
|
428
431
|
};
|
|
429
|
-
protected buildTableController(): TableController;
|
|
430
|
-
constructor(ajaxUrl: string);
|
|
431
|
-
protected initEvents(): void;
|
|
432
432
|
protected getLoadStructureParameters(): Record<string, unknown>;
|
|
433
433
|
protected getClearFiltersParameters(): Record<string, unknown>;
|
|
434
434
|
protected getFiltersValuesMap(): Record<string, unknown>;
|
|
435
|
+
get isLoading(): boolean;
|
|
435
436
|
protected getPageParameters(): Record<string, unknown>;
|
|
436
437
|
protected getRefreshParameters(): Record<string, unknown>;
|
|
437
438
|
protected getSortParameters(): Record<string, unknown>;
|
|
438
|
-
protected
|
|
439
|
+
protected getStructure(): Promise<QueryControllerStructure & {
|
|
440
|
+
columns: TResponsiveTableColumn[];
|
|
441
|
+
filters: TFilter[];
|
|
442
|
+
}>;
|
|
443
|
+
protected initEvents(): void;
|
|
444
|
+
initialLoad(): Promise<void>;
|
|
445
|
+
protected loadFilterTypes(): Promise<void>;
|
|
446
|
+
page(num: number): Promise<void>;
|
|
447
|
+
protected parseLoadStructureResponse(response: any): QueryControllerStructure & {
|
|
448
|
+
columns: TResponsiveTableColumn[];
|
|
449
|
+
filters: TFilter[];
|
|
450
|
+
};
|
|
439
451
|
protected parseRefreshResponse(response?: TApiaFunction | null): void;
|
|
440
|
-
protected
|
|
441
|
-
|
|
452
|
+
protected parseStructure(structure: ReturnType<QueryController['parseLoadStructureResponse']>): void;
|
|
453
|
+
refresh(now?: boolean): Promise<void>;
|
|
454
|
+
setFilterOptions(): Promise<void>;
|
|
455
|
+
sort(column: string, orderType: 'Asc' | 'Des'): Promise<void>;
|
|
442
456
|
protected updatePageState(pageInfo?: TApiaFunctionPageInfo): void;
|
|
443
457
|
protected updateRows(rows: TResponsiveTableRow[]): void;
|
|
444
|
-
clearFilters(): Promise<void>;
|
|
445
|
-
initialLoad(): Promise<void>;
|
|
446
|
-
page(num: number): Promise<void>;
|
|
447
|
-
protected areRequiredFilters(): boolean;
|
|
448
|
-
protected actualRefreshMethod(): Promise<void>;
|
|
449
|
-
/**
|
|
450
|
-
* Allows to throttle calls to actual refresh method.
|
|
451
|
-
*/
|
|
452
|
-
protected executeRefresh: lodash.DebouncedFunc<() => Promise<void>>;
|
|
453
|
-
refresh(now?: boolean): Promise<void | undefined>;
|
|
454
|
-
sort(column: string): Promise<void>;
|
|
455
458
|
}
|
|
456
459
|
|
|
457
460
|
type QueryModalControllerEvents = Pick<TableControllerEvents, 'onSelectRows'> & {
|
|
458
461
|
cancel: null;
|
|
459
462
|
};
|
|
460
463
|
declare class QueryModalController {
|
|
464
|
+
protected title?: string | undefined;
|
|
461
465
|
protected emitter: EventEmitter<QueryModalControllerEvents>;
|
|
462
466
|
protected queryController: QueryController;
|
|
463
467
|
private modalHandler;
|
|
464
468
|
protected currentSelection: TResponsiveTableRowsSelectionEvent | null;
|
|
465
469
|
private additionalFiltersController;
|
|
466
|
-
constructor(queryController: QueryController);
|
|
470
|
+
constructor(queryController: QueryController, title?: string | undefined);
|
|
467
471
|
protected getModalDefinition(): TOpenModal;
|
|
468
472
|
getQueryController(): QueryController;
|
|
469
473
|
protected on<K extends keyof QueryModalControllerEvents>(ev: K, cb: (e: QueryModalControllerEvents[K]) => unknown): UnSubscriber;
|
|
@@ -473,42 +477,35 @@ declare class QueryModalController {
|
|
|
473
477
|
protected onConfirmResolve<T>(): Promise<T>;
|
|
474
478
|
}
|
|
475
479
|
|
|
476
|
-
declare const
|
|
480
|
+
declare const makeApiaUsersModal2: () => QueryModalController;
|
|
481
|
+
|
|
482
|
+
declare class GenericListQuery extends QueryController {
|
|
483
|
+
ajaxUrl: string;
|
|
484
|
+
constructor(ajaxUrl: string);
|
|
485
|
+
protected getClearFiltersParameters(): Record<string, unknown>;
|
|
486
|
+
getTableControllerDefaultProps(): Omit<TResponsiveTableContextProps, 'FiltersRenderer' | 'SelectionHandler' | 'filters' | 'columns' | 'rows' | keyof TableControllerEvents> & Pick<TResponsiveTableContextProps, 'statesColumns'>;
|
|
487
|
+
protected getLoadStructureParameters(): {
|
|
488
|
+
action: string;
|
|
489
|
+
};
|
|
490
|
+
protected getRefreshParameters(): Record<string, unknown>;
|
|
491
|
+
protected parseRefreshResponse(response?: TApiaFunction | null): void;
|
|
492
|
+
protected parseLoadStructureResponse(response: any): QueryControllerStructure;
|
|
493
|
+
initialLoad(): Promise<void>;
|
|
494
|
+
}
|
|
477
495
|
|
|
478
|
-
declare const
|
|
496
|
+
declare const makeApiaPoolsModals2: () => QueryModalController;
|
|
479
497
|
|
|
480
498
|
type TOpenMonDocModal = {
|
|
481
499
|
docTypeId: string[];
|
|
482
500
|
docTypeSel: string;
|
|
483
501
|
monDocId: number;
|
|
484
502
|
};
|
|
485
|
-
declare class
|
|
503
|
+
declare class ApiaMonDocModal2 extends QueryModalController {
|
|
486
504
|
constructor();
|
|
487
505
|
openModal<T = TResponsiveTableRowsSelectionEvent>(properties: TOpenModal & {
|
|
488
506
|
monitorProperties: TOpenMonDocModal;
|
|
489
507
|
}): Promise<T>;
|
|
490
508
|
}
|
|
491
|
-
declare const ApiaMonDocModal2: ApiaMonDocModal;
|
|
492
|
-
|
|
493
|
-
declare class GenericListQuery extends QueryController {
|
|
494
|
-
ajaxUrl: string;
|
|
495
|
-
constructor(ajaxUrl: string);
|
|
496
|
-
getTableControllerDefaultProps(): {
|
|
497
|
-
isMultiple: boolean;
|
|
498
|
-
};
|
|
499
|
-
protected getLoadStructureParameters(): {
|
|
500
|
-
action: string;
|
|
501
|
-
};
|
|
502
|
-
protected getRefreshParameters(): Record<string, unknown>;
|
|
503
|
-
protected getSortParameters(): Record<string, unknown>;
|
|
504
|
-
protected getFilterParameters(): Record<string, unknown>;
|
|
505
|
-
protected getFiltersValuesMap(): Record<string, unknown>;
|
|
506
|
-
protected filter(): Promise<void>;
|
|
507
|
-
protected parseLoadStructureResponse(response: any): QueryControllerStructure;
|
|
508
|
-
initialLoad(): Promise<void>;
|
|
509
|
-
refresh(): Promise<void>;
|
|
510
|
-
sort(column: string): Promise<void>;
|
|
511
|
-
}
|
|
512
509
|
|
|
513
|
-
export { ApiaApi, ApiaApiHandler, ApiaMonDocModal2,
|
|
510
|
+
export { ApiaApi, ApiaApiHandler, ApiaMonDocModal2, GenericListQuery, type IApiaApiRequestConfig, QueryController, type QueryControllerStructure, QueryModalController, type TApiaApiAxiosResponse, type TApiaApiMethod, type TApiaApiResult, type TFilter, getFunction, getModal, isHtmlResponse, isXmlResponse, makeApiaPoolsModals2, makeApiaUrl, makeApiaUsersModal2, parseSuccessfulResponse };
|
|
514
511
|
//# sourceMappingURL=index.d.ts.map
|