@apia/api 4.0.16 → 4.0.18
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 +47 -22
- package/dist/index.js +234 -116
- package/dist/index.js.map +1 -1
- package/package.json +12 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as react from 'react';
|
|
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 } from '@apia/util';
|
|
5
|
+
import { TModify, TApiaLoad, TApiaFormElement, TApiaFilterOption, TApiaFilter, 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
9
|
import * as lodash from 'lodash';
|
|
10
|
-
import { TResponsiveTableColumn, TResponsiveTableContextProps,
|
|
10
|
+
import { TResponsiveTableColumn, TResponsiveTableContextProps, TResponsiveTableRowsSelectionEvent, TResponsiveTableSortChangeEvent, TResponsiveTableRow } from '@apia/table';
|
|
11
11
|
import * as theme_ui from 'theme-ui';
|
|
12
12
|
|
|
13
13
|
declare function getConfig<LoadType>(outerBehaveConfig?: IApiaApiRequestConfig<LoadType>): IApiaApiRequestConfig<unknown> & IApiaApiRequestConfig<LoadType> & Partial<IApiaApiRequestConfig<unknown>>;
|
|
@@ -225,14 +225,14 @@ type TApiaApiMethodHandler = {
|
|
|
225
225
|
reset: () => void;
|
|
226
226
|
setError: typeof notify;
|
|
227
227
|
setMessage: (message: Record<string, unknown>) => unknown;
|
|
228
|
-
setState:
|
|
228
|
+
setState: react.Dispatch<react.SetStateAction<IApiaApiHandlerState>>;
|
|
229
229
|
state: IApiaApiHandlerState;
|
|
230
230
|
setValue: (name: string, value: string) => void;
|
|
231
231
|
};
|
|
232
232
|
type TApiaApiMethod = (handler: TApiaApiMethodHandler, props: TMethod['props']) => Promise<void> | void;
|
|
233
233
|
type TApiaApiField = TApiaApiMethodHandler & {
|
|
234
234
|
element: TModify<TApiaFormElement, {
|
|
235
|
-
onChange:
|
|
235
|
+
onChange: react.ChangeEventHandler;
|
|
236
236
|
}>;
|
|
237
237
|
};
|
|
238
238
|
type TStoredApiaApiMethod = (props?: TMethod['props']) => unknown;
|
|
@@ -257,7 +257,7 @@ interface IApiaApiHandlerState {
|
|
|
257
257
|
errors: Record<string, string>;
|
|
258
258
|
windowIndex: number;
|
|
259
259
|
}
|
|
260
|
-
declare const ApiaApiHandler:
|
|
260
|
+
declare const ApiaApiHandler: react.MemoExoticComponent<() => react.JSX.Element>;
|
|
261
261
|
|
|
262
262
|
declare global {
|
|
263
263
|
interface Window {
|
|
@@ -272,13 +272,14 @@ declare global {
|
|
|
272
272
|
* Permite cargar en forma asíncrona un modal que se encuentre dentro del
|
|
273
273
|
* directorio /api/modals
|
|
274
274
|
* */
|
|
275
|
-
declare const getModal: (path: string) =>
|
|
275
|
+
declare const getModal: (path: string) => react__default.LazyExoticComponent<react__default.ComponentType<TApiaApiField>>;
|
|
276
276
|
|
|
277
277
|
type TFilter = {
|
|
278
278
|
avoidLabel?: boolean;
|
|
279
279
|
column?: string;
|
|
280
280
|
errorMessage?: string;
|
|
281
281
|
id: string;
|
|
282
|
+
filterToId?: string;
|
|
282
283
|
isAdditional?: boolean;
|
|
283
284
|
isHidden?: boolean;
|
|
284
285
|
onChange?: (queryController: QueryController) => unknown;
|
|
@@ -292,18 +293,27 @@ type TFilter = {
|
|
|
292
293
|
isRange?: boolean;
|
|
293
294
|
type?: 'date' | 'D' | 'S' | 'number' | 'N' | 'apiaNumber' | 'triple' | 'dateHour';
|
|
294
295
|
value: any;
|
|
296
|
+
valueTo?: any;
|
|
295
297
|
isSize?: boolean;
|
|
296
298
|
};
|
|
297
299
|
|
|
298
|
-
type FilterState = TFilter;
|
|
299
300
|
declare class Filter {
|
|
300
|
-
|
|
301
|
-
filterState:
|
|
301
|
+
protected tableName?: string;
|
|
302
|
+
filterState: TFilter;
|
|
302
303
|
focus(): void;
|
|
303
304
|
constructor(properties: TFilter);
|
|
305
|
+
getInputRenderer({ filter }: {
|
|
306
|
+
filter: TApiaFilter;
|
|
307
|
+
}): react.JSX.Element;
|
|
308
|
+
getSelectRenderer({ filter }: {
|
|
309
|
+
filter: TApiaFilter;
|
|
310
|
+
}): react.JSX.Element;
|
|
311
|
+
getRangeRenderer({ filter }: {
|
|
312
|
+
filter: TApiaFilter;
|
|
313
|
+
}): react.JSX.Element;
|
|
304
314
|
Component: (({ filter }: {
|
|
305
315
|
filter: TApiaFilter;
|
|
306
|
-
}) =>
|
|
316
|
+
}) => react.JSX.Element) & {
|
|
307
317
|
displayName: string;
|
|
308
318
|
};
|
|
309
319
|
}
|
|
@@ -356,7 +366,7 @@ declare class FilterTypes {
|
|
|
356
366
|
conditions: TFilterTypesElementConditions[];
|
|
357
367
|
constructor();
|
|
358
368
|
protected getFilterTypes(): Promise<void>;
|
|
359
|
-
Component: () =>
|
|
369
|
+
Component: () => react.JSX.Element;
|
|
360
370
|
initialLoad(): Promise<void>;
|
|
361
371
|
setFilterOptions(): Promise<void>;
|
|
362
372
|
}
|
|
@@ -373,12 +383,12 @@ declare class TableController {
|
|
|
373
383
|
private parseFilters;
|
|
374
384
|
Context: ({ children }: {
|
|
375
385
|
children: React.ReactNode;
|
|
376
|
-
}) =>
|
|
386
|
+
}) => react.JSX.Element;
|
|
377
387
|
getTableName(): string;
|
|
378
|
-
Pagination: (() =>
|
|
388
|
+
Pagination: (() => react.JSX.Element) & {
|
|
379
389
|
displayName: string;
|
|
380
390
|
};
|
|
381
|
-
Table:
|
|
391
|
+
Table: react.MemoExoticComponent<react.ForwardRefExoticComponent<theme_ui.BoxProps & react.RefAttributes<HTMLDivElement>>>;
|
|
382
392
|
on<K extends keyof TableControllerEvents>(ev: K, cb: (e: TableControllerEvents[K]) => unknown): _apia_util.UnSubscriber;
|
|
383
393
|
updateState(newState: Partial<TableControllerState> | ((currentState: TableControllerState) => void)): void;
|
|
384
394
|
}
|
|
@@ -400,6 +410,19 @@ declare class QueryController {
|
|
|
400
410
|
private initializing;
|
|
401
411
|
structure: QueryControllerStructure | null;
|
|
402
412
|
tableController: TableController;
|
|
413
|
+
getTableControllerDefaultProps(): {};
|
|
414
|
+
protected getEventsHandlers(): {
|
|
415
|
+
onChangeSelection: (ev: TResponsiveTableRowsSelectionEvent) => void;
|
|
416
|
+
onFilterBlur: (_ev: TApiaFilter) => void;
|
|
417
|
+
onFilterChange: (_ev: TApiaFilter) => void;
|
|
418
|
+
onFilterPressEnter: (_ev: TApiaFilter) => void;
|
|
419
|
+
onRowClick: (_ev: TResponsiveTableRowsSelectionEvent[number]) => void;
|
|
420
|
+
onSelectRows: (_ev: TResponsiveTableRowsSelectionEvent) => void;
|
|
421
|
+
onSortChange: (ev: TResponsiveTableSortChangeEvent) => void;
|
|
422
|
+
onPage: (num: number) => Promise<void>;
|
|
423
|
+
onRefresh: () => Promise<void | undefined>;
|
|
424
|
+
};
|
|
425
|
+
protected buildTableController(): TableController;
|
|
403
426
|
constructor(ajaxUrl: string);
|
|
404
427
|
protected initEvents(): void;
|
|
405
428
|
protected getLoadStructureParameters(): Record<string, unknown>;
|
|
@@ -431,17 +454,19 @@ type QueryModalControllerEvents = Pick<TableControllerEvents, 'onSelectRows'> &
|
|
|
431
454
|
cancel: null;
|
|
432
455
|
};
|
|
433
456
|
declare class QueryModalController {
|
|
434
|
-
|
|
457
|
+
protected emitter: EventEmitter<QueryModalControllerEvents>;
|
|
435
458
|
protected queryController: QueryController;
|
|
436
459
|
private modalHandler;
|
|
437
|
-
|
|
460
|
+
protected currentSelection: TResponsiveTableRowsSelectionEvent | null;
|
|
438
461
|
private additionalFiltersController;
|
|
439
462
|
constructor(queryController: QueryController);
|
|
440
463
|
protected getModalDefinition(): TOpenModal;
|
|
441
464
|
getQueryController(): QueryController;
|
|
442
|
-
|
|
443
|
-
openModal(properties?: TOpenModal): Promise<
|
|
465
|
+
protected on<K extends keyof QueryModalControllerEvents>(ev: K, cb: (e: QueryModalControllerEvents[K]) => unknown): UnSubscriber;
|
|
466
|
+
openModal<T = QueryModalControllerEvents['onSelectRows']>(properties?: TOpenModal): Promise<T>;
|
|
444
467
|
getModalHandler(): ApiaUtilModalHandler | null;
|
|
468
|
+
protected onConfirm(): void;
|
|
469
|
+
protected onConfirmResolve<T>(): Promise<T>;
|
|
445
470
|
}
|
|
446
471
|
|
|
447
472
|
declare const ApiaUsersModal2: QueryModalController;
|
|
@@ -455,9 +480,9 @@ type TOpenMonDocModal = {
|
|
|
455
480
|
};
|
|
456
481
|
declare class ApiaMonDocModal extends QueryModalController {
|
|
457
482
|
constructor();
|
|
458
|
-
openModal(properties: TOpenModal & {
|
|
483
|
+
openModal<T = TResponsiveTableRowsSelectionEvent>(properties: TOpenModal & {
|
|
459
484
|
monitorProperties: TOpenMonDocModal;
|
|
460
|
-
}): Promise<
|
|
485
|
+
}): Promise<T>;
|
|
461
486
|
}
|
|
462
487
|
declare const ApiaMonDocModal2: ApiaMonDocModal;
|
|
463
488
|
|