@apia/api 4.0.25 → 4.0.27
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 +93 -84
- package/dist/index.js +785 -522
- package/dist/index.js.map +1 -1
- package/package.json +10 -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
|
|
|
@@ -280,23 +279,48 @@ type TFilter = {
|
|
|
280
279
|
errorMessage?: string;
|
|
281
280
|
id: string;
|
|
282
281
|
filterToId?: string;
|
|
282
|
+
filterToValue?: string;
|
|
283
|
+
hideToFilter?: true;
|
|
283
284
|
isAdditional?: boolean;
|
|
284
285
|
isHidden?: boolean;
|
|
285
286
|
onChange?: (queryController: QueryController) => unknown;
|
|
286
287
|
options?: TApiaFilterOption[];
|
|
287
288
|
placeholder?: string;
|
|
289
|
+
multiplier?: number;
|
|
288
290
|
readonly?: boolean;
|
|
289
291
|
required?: boolean;
|
|
290
292
|
runAutomatically?: boolean;
|
|
291
293
|
title?: string;
|
|
292
294
|
tooltip?: string;
|
|
293
295
|
isRange?: boolean;
|
|
296
|
+
group?: string;
|
|
294
297
|
type?: 'date' | 'D' | 'S' | 'number' | 'N' | 'apiaNumber' | 'triple' | 'dateHour';
|
|
295
298
|
value: any;
|
|
296
299
|
valueTo?: any;
|
|
297
300
|
isSize?: boolean;
|
|
298
301
|
};
|
|
299
302
|
|
|
303
|
+
type TFilterTypesElementConditions = {
|
|
304
|
+
onChange: string;
|
|
305
|
+
readonly: boolean;
|
|
306
|
+
name: string;
|
|
307
|
+
valueAsAttribute: boolean;
|
|
308
|
+
disabled: boolean;
|
|
309
|
+
html: boolean;
|
|
310
|
+
text: string;
|
|
311
|
+
id: string;
|
|
312
|
+
title: string;
|
|
313
|
+
type: string;
|
|
314
|
+
value: string;
|
|
315
|
+
selected: boolean;
|
|
316
|
+
options: {
|
|
317
|
+
option: {
|
|
318
|
+
content: string;
|
|
319
|
+
value: string;
|
|
320
|
+
}[];
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
|
|
300
324
|
declare class Filter {
|
|
301
325
|
protected tableName?: string;
|
|
302
326
|
filterState: TFilter;
|
|
@@ -311,6 +335,9 @@ declare class Filter {
|
|
|
311
335
|
getRangeRenderer({ filter }: {
|
|
312
336
|
filter: TApiaFilter;
|
|
313
337
|
}): react.JSX.Element;
|
|
338
|
+
getDateRenderer({ filter }: {
|
|
339
|
+
filter: TApiaFilter;
|
|
340
|
+
}): react.JSX.Element;
|
|
314
341
|
Component: (({ filter }: {
|
|
315
342
|
filter: TApiaFilter;
|
|
316
343
|
}) => react.JSX.Element) & {
|
|
@@ -319,9 +346,10 @@ declare class Filter {
|
|
|
319
346
|
}
|
|
320
347
|
|
|
321
348
|
type TableControllerState = {
|
|
322
|
-
|
|
349
|
+
finishedFirstLoad: boolean;
|
|
323
350
|
columns: Map<string, TResponsiveTableColumn>;
|
|
324
351
|
filters: Map<string | number, Filter>;
|
|
352
|
+
isLoading: boolean;
|
|
325
353
|
pagination: {
|
|
326
354
|
currentPage: number;
|
|
327
355
|
totalPages: number;
|
|
@@ -342,42 +370,10 @@ type TableControllerEvents = {
|
|
|
342
370
|
onSortChange: TResponsiveTableSortChangeEvent;
|
|
343
371
|
};
|
|
344
372
|
|
|
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
373
|
declare class TableController {
|
|
376
374
|
private emitter;
|
|
377
375
|
private tableName;
|
|
378
|
-
private tableSelectionController;
|
|
379
376
|
private controllerComponent;
|
|
380
|
-
filterTypes: FilterTypes;
|
|
381
377
|
state: TableControllerState;
|
|
382
378
|
constructor(initialState?: Partial<TableControllerState>);
|
|
383
379
|
clearFilters(): void;
|
|
@@ -398,23 +394,44 @@ declare class TableController {
|
|
|
398
394
|
}
|
|
399
395
|
|
|
400
396
|
type QueryControllerStructure = {
|
|
401
|
-
columns: TResponsiveTableColumn[];
|
|
402
397
|
description: string;
|
|
403
|
-
filters: TFilter[];
|
|
404
398
|
hasAdditionalInformation: boolean;
|
|
405
399
|
isDynamic: boolean;
|
|
406
400
|
openFiltersAutomatically: boolean;
|
|
407
401
|
runFiltersAutomatically: boolean;
|
|
408
402
|
hideFilterTypes: boolean;
|
|
409
403
|
title: string;
|
|
404
|
+
columns: TResponsiveTableColumn[];
|
|
405
|
+
filters: TFilter[];
|
|
406
|
+
queryData?: {
|
|
407
|
+
noExecFirstTime?: boolean;
|
|
408
|
+
autoFilter?: boolean;
|
|
409
|
+
showAllAttributes?: boolean;
|
|
410
|
+
showColumn?: string;
|
|
411
|
+
name?: string;
|
|
412
|
+
hideCount?: boolean;
|
|
413
|
+
description?: string;
|
|
414
|
+
storeColumn?: string;
|
|
415
|
+
title?: string;
|
|
416
|
+
};
|
|
410
417
|
};
|
|
418
|
+
type StoredQueryControllerStructure = Omit<QueryControllerStructure, 'columns' | 'filters'>;
|
|
411
419
|
declare class QueryController {
|
|
412
420
|
ajaxUrl: string;
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
421
|
+
protected hasInited: boolean;
|
|
422
|
+
protected initializing: boolean;
|
|
423
|
+
protected mutex: Mutex;
|
|
424
|
+
structure: StoredQueryControllerStructure | null;
|
|
416
425
|
tableController: TableController;
|
|
417
|
-
|
|
426
|
+
conditions: TFilterTypesElementConditions[];
|
|
427
|
+
constructor(ajaxUrl: string);
|
|
428
|
+
protected actualRefreshMethod(): Promise<void>;
|
|
429
|
+
protected areRequiredFilters(): boolean;
|
|
430
|
+
protected buildTableController(): TableController;
|
|
431
|
+
clearFilters(): Promise<void>;
|
|
432
|
+
private timeout;
|
|
433
|
+
protected executeRefresh(): void;
|
|
434
|
+
getTableControllerDefaultProps(): Omit<TResponsiveTableContextProps, 'FiltersRenderer' | 'SelectionHandler' | 'filters' | 'columns' | 'rows' | keyof TableControllerEvents> & Pick<TResponsiveTableContextProps, 'statesColumns'>;
|
|
418
435
|
protected getEventsHandlers(): {
|
|
419
436
|
onChangeSelection: (ev: TResponsiveTableRowsSelectionEvent) => void;
|
|
420
437
|
onFilterBlur: (_ev: TApiaFilter) => void;
|
|
@@ -424,34 +441,34 @@ declare class QueryController {
|
|
|
424
441
|
onSelectRows: (_ev: TResponsiveTableRowsSelectionEvent) => void;
|
|
425
442
|
onSortChange: (ev: TResponsiveTableSortChangeEvent) => void;
|
|
426
443
|
onPage: (num: number) => Promise<void>;
|
|
427
|
-
onRefresh: () => Promise<void
|
|
444
|
+
onRefresh: () => Promise<void>;
|
|
428
445
|
};
|
|
429
|
-
protected buildTableController(): TableController;
|
|
430
|
-
constructor(ajaxUrl: string);
|
|
431
|
-
protected initEvents(): void;
|
|
432
446
|
protected getLoadStructureParameters(): Record<string, unknown>;
|
|
433
447
|
protected getClearFiltersParameters(): Record<string, unknown>;
|
|
434
448
|
protected getFiltersValuesMap(): Record<string, unknown>;
|
|
449
|
+
get isLoading(): boolean;
|
|
435
450
|
protected getPageParameters(): Record<string, unknown>;
|
|
436
451
|
protected getRefreshParameters(): Record<string, unknown>;
|
|
437
452
|
protected getSortParameters(): Record<string, unknown>;
|
|
438
|
-
protected
|
|
453
|
+
protected getStructure(): Promise<QueryControllerStructure & {
|
|
454
|
+
columns: TResponsiveTableColumn[];
|
|
455
|
+
filters: TFilter[];
|
|
456
|
+
}>;
|
|
457
|
+
protected initEvents(): void;
|
|
458
|
+
initialLoad(): Promise<void>;
|
|
459
|
+
protected loadFilterTypes(): Promise<void>;
|
|
460
|
+
page(num: number): Promise<void>;
|
|
461
|
+
protected parseLoadStructureResponse(response: any): QueryControllerStructure & {
|
|
462
|
+
columns: TResponsiveTableColumn[];
|
|
463
|
+
filters: TFilter[];
|
|
464
|
+
};
|
|
439
465
|
protected parseRefreshResponse(response?: TApiaFunction | null): void;
|
|
440
|
-
protected
|
|
441
|
-
|
|
466
|
+
protected parseStructure(structure: ReturnType<QueryController['parseLoadStructureResponse']>): void;
|
|
467
|
+
refresh(now?: boolean): Promise<void>;
|
|
468
|
+
setFilterOptions(): Promise<void>;
|
|
469
|
+
sort(column: string, orderType: 'Asc' | 'Des'): Promise<void>;
|
|
442
470
|
protected updatePageState(pageInfo?: TApiaFunctionPageInfo): void;
|
|
443
471
|
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
472
|
}
|
|
456
473
|
|
|
457
474
|
type QueryModalControllerEvents = Pick<TableControllerEvents, 'onSelectRows'> & {
|
|
@@ -473,42 +490,34 @@ declare class QueryModalController {
|
|
|
473
490
|
protected onConfirmResolve<T>(): Promise<T>;
|
|
474
491
|
}
|
|
475
492
|
|
|
476
|
-
declare const
|
|
493
|
+
declare const makeApiaUsersModal2: () => QueryModalController;
|
|
477
494
|
|
|
478
|
-
declare
|
|
495
|
+
declare class GenericListQuery extends QueryController {
|
|
496
|
+
ajaxUrl: string;
|
|
497
|
+
constructor(ajaxUrl: string);
|
|
498
|
+
protected getClearFiltersParameters(): Record<string, unknown>;
|
|
499
|
+
getTableControllerDefaultProps(): Omit<TResponsiveTableContextProps, 'FiltersRenderer' | 'SelectionHandler' | 'filters' | 'columns' | 'rows' | keyof TableControllerEvents> & Pick<TResponsiveTableContextProps, 'statesColumns'>;
|
|
500
|
+
protected getLoadStructureParameters(): {
|
|
501
|
+
action: string;
|
|
502
|
+
};
|
|
503
|
+
protected getRefreshParameters(): Record<string, unknown>;
|
|
504
|
+
protected parseRefreshResponse(response?: TApiaFunction | null): void;
|
|
505
|
+
protected parseLoadStructureResponse(response: any): QueryControllerStructure;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
declare const makeApiaPoolsModals2: () => QueryModalController;
|
|
479
509
|
|
|
480
510
|
type TOpenMonDocModal = {
|
|
481
511
|
docTypeId: string[];
|
|
482
512
|
docTypeSel: string;
|
|
483
513
|
monDocId: number;
|
|
484
514
|
};
|
|
485
|
-
declare class
|
|
515
|
+
declare class ApiaMonDocModal2 extends QueryModalController {
|
|
486
516
|
constructor();
|
|
487
517
|
openModal<T = TResponsiveTableRowsSelectionEvent>(properties: TOpenModal & {
|
|
488
518
|
monitorProperties: TOpenMonDocModal;
|
|
489
519
|
}): Promise<T>;
|
|
490
520
|
}
|
|
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
521
|
|
|
513
|
-
export { ApiaApi, ApiaApiHandler, ApiaMonDocModal2,
|
|
522
|
+
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
523
|
//# sourceMappingURL=index.d.ts.map
|