@apia/api 4.0.45 → 5.0.0
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 +62 -23
- package/dist/index.js +137 -10
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React$1 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,
|
|
6
|
-
import {
|
|
5
|
+
import { TModify, TApiaLoadForm, TApiaFormElement, TApiaFilterOption, TApiaFilter, Mutex, T__LEGACY_SERVER__ApiaFunction, T__LEGACY_SERVER__ApiaFunctionPageInfo, EventEmitter, UnSubscriber } from '@apia/util';
|
|
6
|
+
import { notify } from '@apia/notifications';
|
|
7
7
|
import { TModal, TOpenModal, ApiaUtilModalHandler } from '@apia/components';
|
|
8
8
|
import QueryString from 'qs';
|
|
9
9
|
import { TResponsiveTableColumn, TResponsiveTableContextProps, TResponsiveTableRowsSelectionEvent, TResponsiveTableSortChangeEvent, TResponsiveTableRow } from '@apia/table';
|
|
@@ -15,13 +15,13 @@ declare function isXmlResponse(response: AxiosResponse<unknown>): RegExpMatchArr
|
|
|
15
15
|
declare function isHtmlResponse(response: AxiosResponse<unknown>): RegExpMatchArray | null;
|
|
16
16
|
declare const parseSuccessfulResponse: <LoadType extends Record<string, unknown>>(response: AxiosResponse<string>, currentUrl: string, outerBehaveConfig?: IApiaApiRequestConfig<LoadType>) => Promise<(LoadType & {
|
|
17
17
|
sysMessages: {
|
|
18
|
-
message:
|
|
18
|
+
message: TApiaMessage | TApiaMessage[];
|
|
19
19
|
} | undefined;
|
|
20
20
|
exceptions: {
|
|
21
|
-
exception:
|
|
21
|
+
exception: TApiaMessage | TApiaMessage[];
|
|
22
22
|
} | undefined;
|
|
23
23
|
sysExceptions: {
|
|
24
|
-
exception:
|
|
24
|
+
exception: TApiaMessage | TApiaMessage[];
|
|
25
25
|
} | undefined;
|
|
26
26
|
}) | null>;
|
|
27
27
|
type TApiaApiAxiosResponse<LoadType> = AxiosResponse<LoadType | null> & {
|
|
@@ -205,6 +205,36 @@ interface IApiaApiRequestConfig<DataType> extends IApiaApiConsoleConfig {
|
|
|
205
205
|
stringifyOptions?: QueryString.IStringifyOptions;
|
|
206
206
|
validateResponse?: (response: AxiosResponse<DataType | null>) => Promise<boolean | string> | boolean | string;
|
|
207
207
|
}
|
|
208
|
+
interface TApiaMessage {
|
|
209
|
+
text: string;
|
|
210
|
+
label?: string;
|
|
211
|
+
}
|
|
212
|
+
type TApiaLoad<T extends Record<string, unknown> = TApiaLoadForm> = {
|
|
213
|
+
canClose: boolean;
|
|
214
|
+
type: string;
|
|
215
|
+
} & T;
|
|
216
|
+
interface TMessage {
|
|
217
|
+
text: string;
|
|
218
|
+
content?: string;
|
|
219
|
+
title?: string;
|
|
220
|
+
type?: string;
|
|
221
|
+
}
|
|
222
|
+
interface TNotificationMessage {
|
|
223
|
+
onClose?: string;
|
|
224
|
+
sysMessages?: {
|
|
225
|
+
message: TMessage | TMessage[];
|
|
226
|
+
};
|
|
227
|
+
sysExceptions?: {
|
|
228
|
+
exception: TMessage | TMessage[];
|
|
229
|
+
};
|
|
230
|
+
exceptions?: {
|
|
231
|
+
exception: TMessage | TMessage[];
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
type TApiaApiSectionElement = TApiaFormElement & {
|
|
236
|
+
sectionElementId: string;
|
|
237
|
+
};
|
|
208
238
|
|
|
209
239
|
type TMethod = {
|
|
210
240
|
name: string;
|
|
@@ -218,6 +248,7 @@ type TMethod = {
|
|
|
218
248
|
};
|
|
219
249
|
type TApiaApiMethodHandler = {
|
|
220
250
|
alert: typeof notify;
|
|
251
|
+
assignForm: (newForm: TApiaLoad) => unknown;
|
|
221
252
|
close: () => void;
|
|
222
253
|
configuration?: THandleConfiguration;
|
|
223
254
|
formDefinition: TApiaLoad;
|
|
@@ -225,14 +256,14 @@ type TApiaApiMethodHandler = {
|
|
|
225
256
|
reset: () => void;
|
|
226
257
|
setError: typeof notify;
|
|
227
258
|
setMessage: (message: Record<string, unknown>) => unknown;
|
|
228
|
-
setState:
|
|
259
|
+
setState: React$1.Dispatch<React$1.SetStateAction<IApiaApiHandlerState>>;
|
|
229
260
|
state: IApiaApiHandlerState;
|
|
230
261
|
setValue: (name: string, value: string) => void;
|
|
231
262
|
};
|
|
232
263
|
type TApiaApiMethod = (handler: TApiaApiMethodHandler, props: TMethod['props']) => Promise<void> | void;
|
|
233
264
|
type TApiaApiField = TApiaApiMethodHandler & {
|
|
234
265
|
element: TModify<TApiaFormElement, {
|
|
235
|
-
onChange:
|
|
266
|
+
onChange: React$1.ChangeEventHandler;
|
|
236
267
|
}>;
|
|
237
268
|
};
|
|
238
269
|
type TStoredApiaApiMethod = (props?: TMethod['props']) => unknown;
|
|
@@ -247,6 +278,8 @@ interface IModalConfig {
|
|
|
247
278
|
onMessage?: (message: Record<string, unknown>) => unknown;
|
|
248
279
|
onMessageClose?: () => unknown;
|
|
249
280
|
onSubmitted?: (handler: TApiaApiMethodHandler, response: AxiosResponse<Record<string, unknown> | null> | null) => unknown;
|
|
281
|
+
fieldsRenderer?: (element: TApiaApiSectionElement) => React$1.FC<Pick<TApiaApiMethodHandler, 'assignForm'>> | null;
|
|
282
|
+
onFieldChange?: (element: TApiaApiSectionElement, handler: TApiaApiMethodHandler) => unknown;
|
|
250
283
|
}
|
|
251
284
|
type THandleConfiguration = Partial<Pick<IApiaApiRequestConfig<unknown>, 'modalConfiguration' | 'methodsPath' | 'setModalProps'>>;
|
|
252
285
|
interface IApiaApiHandlerState {
|
|
@@ -257,7 +290,7 @@ interface IApiaApiHandlerState {
|
|
|
257
290
|
errors: Record<string, string>;
|
|
258
291
|
windowIndex: number;
|
|
259
292
|
}
|
|
260
|
-
declare const ApiaApiHandler:
|
|
293
|
+
declare const ApiaApiHandler: React$1.MemoExoticComponent<() => React$1.JSX.Element>;
|
|
261
294
|
|
|
262
295
|
declare global {
|
|
263
296
|
interface Window {
|
|
@@ -272,7 +305,7 @@ declare global {
|
|
|
272
305
|
* Permite cargar en forma asíncrona un modal que se encuentre dentro del
|
|
273
306
|
* directorio /api/modals
|
|
274
307
|
* */
|
|
275
|
-
declare const getModal: (path: string) =>
|
|
308
|
+
declare const getModal: (path: string) => React__default.LazyExoticComponent<React__default.ComponentType<TApiaApiField>>;
|
|
276
309
|
|
|
277
310
|
type TFilter = {
|
|
278
311
|
avoidLabel?: boolean;
|
|
@@ -329,12 +362,12 @@ declare class Filter {
|
|
|
329
362
|
filterState: TFilter;
|
|
330
363
|
focus(): void;
|
|
331
364
|
constructor(properties: TFilter);
|
|
332
|
-
getInputRenderer():
|
|
333
|
-
getSelectRenderer():
|
|
334
|
-
getRangeRenderer():
|
|
335
|
-
getDateRenderer():
|
|
336
|
-
getDoubleRenderer():
|
|
337
|
-
Component: (() =>
|
|
365
|
+
getInputRenderer(): React$1.JSX.Element;
|
|
366
|
+
getSelectRenderer(): React$1.JSX.Element;
|
|
367
|
+
getRangeRenderer(): React$1.JSX.Element;
|
|
368
|
+
getDateRenderer(): React$1.JSX.Element;
|
|
369
|
+
getDoubleRenderer(): React$1.JSX.Element;
|
|
370
|
+
Component: (() => React$1.JSX.Element) & {
|
|
338
371
|
displayName: string;
|
|
339
372
|
};
|
|
340
373
|
}
|
|
@@ -375,15 +408,15 @@ declare class TableController {
|
|
|
375
408
|
private parseFilters;
|
|
376
409
|
Context: (({ children }: {
|
|
377
410
|
children: React.ReactNode;
|
|
378
|
-
}) =>
|
|
411
|
+
}) => React$1.JSX.Element) & {
|
|
379
412
|
displayName: string;
|
|
380
413
|
};
|
|
381
414
|
private TableContext;
|
|
382
415
|
getTableName(): string;
|
|
383
|
-
Pagination: (() =>
|
|
416
|
+
Pagination: (() => React$1.JSX.Element) & {
|
|
384
417
|
displayName: string;
|
|
385
418
|
};
|
|
386
|
-
Table:
|
|
419
|
+
Table: React$1.MemoExoticComponent<React$1.ForwardRefExoticComponent<theme_ui.BoxProps & React$1.RefAttributes<HTMLDivElement>>>;
|
|
387
420
|
on<K extends keyof TableControllerEvents>(ev: K, cb: (e: TableControllerEvents[K]) => unknown): _apia_util.UnSubscriber;
|
|
388
421
|
updateFilters(newFilters: Filter[]): void;
|
|
389
422
|
updateState(newState: Partial<TableControllerState> | ((currentState: TableControllerState) => void)): void;
|
|
@@ -462,12 +495,12 @@ declare class QueryController {
|
|
|
462
495
|
columns: TResponsiveTableColumn[];
|
|
463
496
|
filters: TFilter[];
|
|
464
497
|
};
|
|
465
|
-
protected parseRefreshResponse(response?:
|
|
498
|
+
protected parseRefreshResponse(response?: T__LEGACY_SERVER__ApiaFunction | null): void;
|
|
466
499
|
protected parseStructure(structure: ReturnType<QueryController['parseLoadStructureResponse']>): void;
|
|
467
500
|
refresh(now?: boolean): Promise<void>;
|
|
468
501
|
setFilterOptions(): Promise<void>;
|
|
469
502
|
sort(column: string, orderType: 'Asc' | 'Des'): Promise<void>;
|
|
470
|
-
protected updatePageState(pageInfo?:
|
|
503
|
+
protected updatePageState(pageInfo?: T__LEGACY_SERVER__ApiaFunctionPageInfo): void;
|
|
471
504
|
protected updateRows(rows: TResponsiveTableRow[]): void;
|
|
472
505
|
}
|
|
473
506
|
|
|
@@ -513,6 +546,12 @@ type TPoolsParameters = {
|
|
|
513
546
|
};
|
|
514
547
|
declare const makeApiaPoolsModals2: (config?: TPoolsParameters) => QueryModalController;
|
|
515
548
|
|
|
549
|
+
type TFormsParameters$1 = {};
|
|
550
|
+
declare const makeApiaFormsModal2: (config?: TFormsParameters$1) => QueryModalController;
|
|
551
|
+
|
|
552
|
+
type TFormsParameters = {};
|
|
553
|
+
declare const makeApiaLangsModal2: (config?: TFormsParameters) => QueryModalController;
|
|
554
|
+
|
|
516
555
|
type TOpenMonDocModal = {
|
|
517
556
|
docTypeId: string[];
|
|
518
557
|
docTypeSel: string;
|
|
@@ -533,5 +572,5 @@ declare class ApiaMonDocModal2 extends QueryModalController {
|
|
|
533
572
|
}): Promise<T>;
|
|
534
573
|
}
|
|
535
574
|
|
|
536
|
-
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 };
|
|
575
|
+
export { ApiaApi, ApiaApiHandler, ApiaMonDocModal2, GenericListQuery, type IApiaApiRequestConfig, QueryController, type QueryControllerStructure, QueryModalController, type TApiaApiAxiosResponse, type TApiaApiMethod, type TApiaApiResult, type TFilter, getFunction, getModal, isHtmlResponse, isXmlResponse, makeApiaFormsModal2, makeApiaLangsModal2, makeApiaPoolsModals2, makeApiaUrl, makeApiaUsersModal2, parseSuccessfulResponse };
|
|
537
576
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from '@apia/theme/jsx-runtime';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { createContext, useState, useCallback, useEffect, useId, useRef, useMemo } from 'react';
|
|
4
4
|
import { Box, Label, spacing, getVariant, Input as Input$1, Select as Select$1, Spinner } from '@apia/theme';
|
|
5
|
-
import { debugDispatcher, parseXmlAsync, arrayOrArray, EventEmitter, useMount, encrypt, noNaN, getIndex, getLabel, StatefulEmitter, focus, focusSelector, useLatest, useIntermediateValue, formatMessage, getDateFormat, Mutex
|
|
5
|
+
import { debugDispatcher, parseXmlAsync, arrayOrArray, EventEmitter, useMount, encrypt, noNaN, getIndex, uniqueId, getLabel, StatefulEmitter, focus, focusSelector, useLatest, useIntermediateValue, formatMessage, getDateFormat, Mutex } from '@apia/util';
|
|
6
6
|
import { notify, getNotificationMessageObj, dispatchNotifications } from '@apia/notifications';
|
|
7
7
|
import { classToValidate, Checkbox, FileInput, classToValidationFunction, Input, Radio, Select, Textarea, useFormContext, validationsStore, hasSucceedFormValidation, Form } from '@apia/validations';
|
|
8
8
|
import { Accordion, AccordionItem, useModal, LabelBox, SimpleButton, ApiaUtil, Modal, ProgressBar, DateInput, AutocompleteController, Autocomplete, IconButton } from '@apia/components';
|
|
@@ -10,7 +10,7 @@ import axios, { AxiosError } from 'axios';
|
|
|
10
10
|
import merge from 'lodash-es/merge';
|
|
11
11
|
import QueryString from 'qs';
|
|
12
12
|
import { session } from '@apia/session';
|
|
13
|
-
import uniqueId from 'lodash-es/uniqueId';
|
|
13
|
+
import uniqueId$1 from 'lodash-es/uniqueId';
|
|
14
14
|
import { ResponsiveTableContext, ResponsiveTable, Pagination, Sort, Responsive, Additional, responsiveTableStore, useResponsiveTableContext, getResponsiveTableContext, TableLoadingContext, defaultLabels, makeController2, responsiveTableActions, TableContextReproducer, Grouped, makeAsyncRenderer } from '@apia/table';
|
|
15
15
|
import { makeObservable, observable, reaction, toJS, action, computed } from 'mobx';
|
|
16
16
|
import { observer } from 'mobx-react-lite';
|
|
@@ -1064,6 +1064,7 @@ const ApiaEnvironmentsModal = (props) => {
|
|
|
1064
1064
|
/* @__PURE__ */ jsx(Box, { className: "pagination__wrapper", children: /* @__PURE__ */ jsx(
|
|
1065
1065
|
Pagination,
|
|
1066
1066
|
{
|
|
1067
|
+
listId: uniqueId("apiaenvsmodal"),
|
|
1067
1068
|
currentPage: state.currentPage,
|
|
1068
1069
|
onPageChange: handlePageChange,
|
|
1069
1070
|
onRefresh: handleRefresh,
|
|
@@ -1411,6 +1412,7 @@ const ApiaTasksModal = (props) => {
|
|
|
1411
1412
|
/* @__PURE__ */ jsx(Box, { className: "pagination__wrapper", children: /* @__PURE__ */ jsx(
|
|
1412
1413
|
Pagination,
|
|
1413
1414
|
{
|
|
1415
|
+
listId: uniqueId("apiatasksmodal"),
|
|
1414
1416
|
currentPage: state.currentPage,
|
|
1415
1417
|
onPageChange: handlePageChange,
|
|
1416
1418
|
onRefresh: handleRefresh,
|
|
@@ -1722,6 +1724,7 @@ const ApiaProcessesModal = (props) => {
|
|
|
1722
1724
|
/* @__PURE__ */ jsx(Box, { className: "pagination__wrapper", children: /* @__PURE__ */ jsx(
|
|
1723
1725
|
Pagination,
|
|
1724
1726
|
{
|
|
1727
|
+
listId: uniqueId("apiaprocessesmodal"),
|
|
1725
1728
|
currentPage: state.currentPage,
|
|
1726
1729
|
onPageChange: handlePageChange,
|
|
1727
1730
|
onRefresh: handleRefresh,
|
|
@@ -2034,6 +2037,7 @@ const ApiaPoolsModal = (props) => {
|
|
|
2034
2037
|
/* @__PURE__ */ jsx(Box, { className: "pagination__wrapper", children: /* @__PURE__ */ jsx(
|
|
2035
2038
|
Pagination,
|
|
2036
2039
|
{
|
|
2040
|
+
listId: uniqueId("apiapoolsmodal"),
|
|
2037
2041
|
currentPage: state.currentPage,
|
|
2038
2042
|
onPageChange: handlePageChange,
|
|
2039
2043
|
onRefresh: handleRefresh,
|
|
@@ -2340,6 +2344,7 @@ const ApiaUsersModal = (props) => {
|
|
|
2340
2344
|
Pagination,
|
|
2341
2345
|
{
|
|
2342
2346
|
currentPage: state.currentPage,
|
|
2347
|
+
listId: uniqueId("apiausersmodal"),
|
|
2343
2348
|
onPageChange: handlePageChange,
|
|
2344
2349
|
onRefresh: handleRefresh,
|
|
2345
2350
|
pageCount: state.pageCount,
|
|
@@ -2544,7 +2549,7 @@ const parseApiaApiSections = (elements) => {
|
|
|
2544
2549
|
sectionElements: removeEndingSpacers(elements.slice(start, end)).map(
|
|
2545
2550
|
(currentElement) => ({
|
|
2546
2551
|
...currentElement,
|
|
2547
|
-
sectionElementId: `sectionElement_${currentElement.id || currentElement.name || uniqueId()}`
|
|
2552
|
+
sectionElementId: `sectionElement_${currentElement.id || currentElement.name || uniqueId$1()}`
|
|
2548
2553
|
})
|
|
2549
2554
|
)
|
|
2550
2555
|
});
|
|
@@ -2568,9 +2573,19 @@ const NonMemoizedApiaApiFieldsContainer = (props) => {
|
|
|
2568
2573
|
{
|
|
2569
2574
|
className: isVisible ? "handler__form__elements__section__content" : `handler__form__elements__section__content handler__hidden`,
|
|
2570
2575
|
children: sectionElements.map((current) => {
|
|
2576
|
+
const Renderer = props.configuration?.modalConfiguration?.fieldsRenderer?.(
|
|
2577
|
+
current
|
|
2578
|
+
);
|
|
2579
|
+
if (Renderer) {
|
|
2580
|
+
return /* @__PURE__ */ jsx(Renderer, { assignForm: props.assignForm });
|
|
2581
|
+
}
|
|
2571
2582
|
const element = {
|
|
2572
2583
|
...current,
|
|
2573
|
-
onChange() {
|
|
2584
|
+
onChange(ev) {
|
|
2585
|
+
props.configuration?.modalConfiguration?.onFieldChange?.(
|
|
2586
|
+
{ ...current, value: ev.target.value },
|
|
2587
|
+
props
|
|
2588
|
+
);
|
|
2574
2589
|
getFunction(current.onChange, props).then((onChangeMethod) => {
|
|
2575
2590
|
if (onChangeMethod) {
|
|
2576
2591
|
onChangeMethod();
|
|
@@ -2641,6 +2656,8 @@ const NonMemoizedApiaApiFieldsContainer = (props) => {
|
|
|
2641
2656
|
case "hidden":
|
|
2642
2657
|
case "password":
|
|
2643
2658
|
case "text":
|
|
2659
|
+
case "date":
|
|
2660
|
+
case "number":
|
|
2644
2661
|
return /* @__PURE__ */ jsx(
|
|
2645
2662
|
ApiaApiInput,
|
|
2646
2663
|
{
|
|
@@ -2755,7 +2772,7 @@ ApiaApiFieldsContainer.displayName = "ApiaApiFieldsContainer";
|
|
|
2755
2772
|
const parseButtons = (buttons) => {
|
|
2756
2773
|
return buttons.map((currentButton) => ({
|
|
2757
2774
|
...currentButton,
|
|
2758
|
-
buttonKey: uniqueId(),
|
|
2775
|
+
buttonKey: uniqueId$1(),
|
|
2759
2776
|
type: ["submitAjax", "submit"].includes(currentButton.type) ? "submit" : "button"
|
|
2760
2777
|
}));
|
|
2761
2778
|
};
|
|
@@ -3120,7 +3137,11 @@ const ApiaApiHandlerNonMemoized = () => {
|
|
|
3120
3137
|
},
|
|
3121
3138
|
setState,
|
|
3122
3139
|
state,
|
|
3123
|
-
setValue
|
|
3140
|
+
setValue,
|
|
3141
|
+
assignForm: currentFormDispatcher.emit.bind(
|
|
3142
|
+
currentFormDispatcher,
|
|
3143
|
+
"form"
|
|
3144
|
+
)
|
|
3124
3145
|
};
|
|
3125
3146
|
return newHandler;
|
|
3126
3147
|
}, [close, configuration, currentForm, setError, state, setValue]);
|
|
@@ -4129,7 +4150,7 @@ class QueryController {
|
|
|
4129
4150
|
}))
|
|
4130
4151
|
].filter(Boolean),
|
|
4131
4152
|
className: r.classToAdd,
|
|
4132
|
-
id: r.id ?? uniqueId
|
|
4153
|
+
id: r.id ?? uniqueId("row")
|
|
4133
4154
|
};
|
|
4134
4155
|
})
|
|
4135
4156
|
]);
|
|
@@ -4492,12 +4513,16 @@ class QueryModalController {
|
|
|
4492
4513
|
title: structure?.title,
|
|
4493
4514
|
onConfirm: () => {
|
|
4494
4515
|
this.onConfirm();
|
|
4516
|
+
this.additionalFiltersController.closeModal();
|
|
4495
4517
|
},
|
|
4496
4518
|
onCancel: () => {
|
|
4497
4519
|
this.additionalFiltersController.closeModal();
|
|
4498
4520
|
this.queryController.tableController.state.finishedFirstLoad = false;
|
|
4499
4521
|
this.emitter.emit("cancel", null);
|
|
4500
4522
|
},
|
|
4523
|
+
onClose: () => {
|
|
4524
|
+
this.additionalFiltersController.closeModal();
|
|
4525
|
+
},
|
|
4501
4526
|
confirmProps: {
|
|
4502
4527
|
confirmButtonText: getLabel("btnCon").text,
|
|
4503
4528
|
cancelButtonText: getLabel("btnCan").text
|
|
@@ -4700,6 +4725,108 @@ class PoolsQuery extends GenericListQuery {
|
|
|
4700
4725
|
}
|
|
4701
4726
|
const makeApiaPoolsModals2 = (config) => new QueryModalController(new PoolsQuery(config));
|
|
4702
4727
|
|
|
4728
|
+
class FormsQuery extends GenericListQuery {
|
|
4729
|
+
constructor(config) {
|
|
4730
|
+
super("apia.modals.FormsAction.run");
|
|
4731
|
+
this.config = config;
|
|
4732
|
+
}
|
|
4733
|
+
getRefreshParameters() {
|
|
4734
|
+
return {
|
|
4735
|
+
...super.getRefreshParameters(),
|
|
4736
|
+
selectOnlyOne: false
|
|
4737
|
+
};
|
|
4738
|
+
}
|
|
4739
|
+
getFiltersValuesMap() {
|
|
4740
|
+
return {
|
|
4741
|
+
...super.getFiltersValuesMap()
|
|
4742
|
+
};
|
|
4743
|
+
}
|
|
4744
|
+
parseRefreshResponse(response) {
|
|
4745
|
+
if (!response)
|
|
4746
|
+
return;
|
|
4747
|
+
const structure = this.parseLoadStructureResponse(response);
|
|
4748
|
+
this.parseStructure(structure);
|
|
4749
|
+
setTimeout(() => {
|
|
4750
|
+
super.parseRefreshResponse(response);
|
|
4751
|
+
}, 0);
|
|
4752
|
+
}
|
|
4753
|
+
parseLoadStructureResponse(response) {
|
|
4754
|
+
const structure = { ...super.parseLoadStructureResponse(response) };
|
|
4755
|
+
structure.hideFilterTypes = true;
|
|
4756
|
+
structure.title = getLabel("btnAddPool").text;
|
|
4757
|
+
return {
|
|
4758
|
+
...structure,
|
|
4759
|
+
columns: [
|
|
4760
|
+
{
|
|
4761
|
+
label: getLabel("lblName").text,
|
|
4762
|
+
name: "name"
|
|
4763
|
+
}
|
|
4764
|
+
],
|
|
4765
|
+
filters: [
|
|
4766
|
+
{
|
|
4767
|
+
id: "txtName",
|
|
4768
|
+
value: this.tableController.state.filters.get("txtName")?.filterState.value,
|
|
4769
|
+
column: "name",
|
|
4770
|
+
runAutomatically: true,
|
|
4771
|
+
title: getLabel("lblName").text
|
|
4772
|
+
}
|
|
4773
|
+
]
|
|
4774
|
+
};
|
|
4775
|
+
}
|
|
4776
|
+
}
|
|
4777
|
+
const makeApiaFormsModal2 = (config) => new QueryModalController(new FormsQuery(config));
|
|
4778
|
+
|
|
4779
|
+
class LangsModal extends GenericListQuery {
|
|
4780
|
+
constructor(config) {
|
|
4781
|
+
super("apia.modals.LanguageAction.run");
|
|
4782
|
+
this.config = config;
|
|
4783
|
+
}
|
|
4784
|
+
getRefreshParameters() {
|
|
4785
|
+
return {
|
|
4786
|
+
...super.getRefreshParameters(),
|
|
4787
|
+
selectOnlyOne: false
|
|
4788
|
+
};
|
|
4789
|
+
}
|
|
4790
|
+
getFiltersValuesMap() {
|
|
4791
|
+
return {
|
|
4792
|
+
...super.getFiltersValuesMap()
|
|
4793
|
+
};
|
|
4794
|
+
}
|
|
4795
|
+
parseRefreshResponse(response) {
|
|
4796
|
+
if (!response)
|
|
4797
|
+
return;
|
|
4798
|
+
const structure = this.parseLoadStructureResponse(response);
|
|
4799
|
+
this.parseStructure(structure);
|
|
4800
|
+
setTimeout(() => {
|
|
4801
|
+
super.parseRefreshResponse(response);
|
|
4802
|
+
}, 0);
|
|
4803
|
+
}
|
|
4804
|
+
parseLoadStructureResponse(response) {
|
|
4805
|
+
const structure = { ...super.parseLoadStructureResponse(response) };
|
|
4806
|
+
structure.hideFilterTypes = true;
|
|
4807
|
+
structure.title = getLabel("btnAddPool").text;
|
|
4808
|
+
return {
|
|
4809
|
+
...structure,
|
|
4810
|
+
columns: [
|
|
4811
|
+
{
|
|
4812
|
+
label: getLabel("lblName").text,
|
|
4813
|
+
name: "name"
|
|
4814
|
+
}
|
|
4815
|
+
],
|
|
4816
|
+
filters: [
|
|
4817
|
+
{
|
|
4818
|
+
id: "txtName",
|
|
4819
|
+
value: this.tableController.state.filters.get("txtName")?.filterState.value,
|
|
4820
|
+
column: "name",
|
|
4821
|
+
runAutomatically: true,
|
|
4822
|
+
title: getLabel("lblName").text
|
|
4823
|
+
}
|
|
4824
|
+
]
|
|
4825
|
+
};
|
|
4826
|
+
}
|
|
4827
|
+
}
|
|
4828
|
+
const makeApiaLangsModal2 = (config) => new QueryModalController(new LangsModal(config));
|
|
4829
|
+
|
|
4703
4830
|
var __defProp = Object.defineProperty;
|
|
4704
4831
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4705
4832
|
var __publicField = (obj, key, value) => {
|
|
@@ -4750,7 +4877,7 @@ class MonDocQuery extends QueryController {
|
|
|
4750
4877
|
};
|
|
4751
4878
|
}
|
|
4752
4879
|
addFreeMetadataFilter(filter) {
|
|
4753
|
-
const id = uniqueId
|
|
4880
|
+
const id = uniqueId();
|
|
4754
4881
|
const actualFilter = filter || {
|
|
4755
4882
|
id,
|
|
4756
4883
|
group: "lblFreeMetadata",
|
|
@@ -4804,7 +4931,7 @@ class MonDocQuery extends QueryController {
|
|
|
4804
4931
|
});
|
|
4805
4932
|
this.tableController.updateFilters(metadataFilters);
|
|
4806
4933
|
if (metadataFilters.length > 0) {
|
|
4807
|
-
const id = uniqueId
|
|
4934
|
+
const id = uniqueId();
|
|
4808
4935
|
const metadataFilter = {
|
|
4809
4936
|
id,
|
|
4810
4937
|
group: "lblFreeMetadata",
|
|
@@ -5078,5 +5205,5 @@ class ApiaMonDocModal2 extends QueryModalController {
|
|
|
5078
5205
|
}
|
|
5079
5206
|
}
|
|
5080
5207
|
|
|
5081
|
-
export { ApiaApi, ApiaApiHandler, ApiaMonDocModal2, GenericListQuery, QueryController, QueryModalController, getFunction, getModal, isHtmlResponse, isXmlResponse, makeApiaPoolsModals2, makeApiaUrl, makeApiaUsersModal2, parseSuccessfulResponse };
|
|
5208
|
+
export { ApiaApi, ApiaApiHandler, ApiaMonDocModal2, GenericListQuery, QueryController, QueryModalController, getFunction, getModal, isHtmlResponse, isXmlResponse, makeApiaFormsModal2, makeApiaLangsModal2, makeApiaPoolsModals2, makeApiaUrl, makeApiaUsersModal2, parseSuccessfulResponse };
|
|
5082
5209
|
//# sourceMappingURL=index.js.map
|