@apia/api 4.0.30 → 4.0.32
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 +33 -21
- package/dist/index.js +717 -378
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
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
|
-
import { Box, Label, spacing, getVariant, Input as Input$1, Select as Select$1 } from '@apia/theme';
|
|
4
|
+
import { Box, Label, spacing, getVariant, Input as Input$1, Select as Select$1, Spinner } from '@apia/theme';
|
|
5
5
|
import { debugDispatcher, parseXmlAsync, arrayOrArray, EventEmitter, useMount, encrypt, noNaN, getIndex, getLabel, StatefulEmitter, focus, focusSelector, useLatest, useIntermediateValue, formatMessage, getDateFormat, Mutex, uniqueId as uniqueId$1 } 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
|
-
import { Accordion, AccordionItem, useModal, LabelBox, SimpleButton, ApiaUtil, Modal, ProgressBar, DateInput } from '@apia/components';
|
|
8
|
+
import { Accordion, AccordionItem, useModal, LabelBox, SimpleButton, ApiaUtil, Modal, ProgressBar, DateInput, AutocompleteController, Autocomplete, IconButton } from '@apia/components';
|
|
9
9
|
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
13
|
import uniqueId from 'lodash-es/uniqueId';
|
|
14
|
-
import { ResponsiveTableContext, ResponsiveTable, Pagination, Sort, Responsive, Additional, responsiveTableStore, useResponsiveTableContext, getResponsiveTableContext, TableLoadingContext, defaultLabels, makeController2, responsiveTableActions, TableContextReproducer, Grouped } from '@apia/table';
|
|
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';
|
|
17
17
|
import dayjs from 'dayjs';
|
|
@@ -479,7 +479,7 @@ function makeApiaUrl(props) {
|
|
|
479
479
|
if (props?.queryString && props.queryString.includes("timestamp=") || queryString?.includes("timestamp=")) {
|
|
480
480
|
timestamp = "";
|
|
481
481
|
}
|
|
482
|
-
const contextWord = CONTEXT.
|
|
482
|
+
const contextWord = CONTEXT.replace(/^\/?(.+?)\/?$/, "$1");
|
|
483
483
|
actualAjaxUrl = actualAjaxUrl.match(
|
|
484
484
|
new RegExp(`^(?:(?:/?${contextWord})?/)?(.+)$`)
|
|
485
485
|
)?.[1];
|
|
@@ -3237,144 +3237,143 @@ const ApiaApiHandlerNonMemoized = () => {
|
|
|
3237
3237
|
const ApiaApiHandler = React.memo(ApiaApiHandlerNonMemoized);
|
|
3238
3238
|
|
|
3239
3239
|
const units = ["B", "KB", "MB", "GB"];
|
|
3240
|
-
const RangeFilterRenderer = observer(
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
lastEmittedHigh.current = state.valueTo || "";
|
|
3249
|
-
}
|
|
3250
|
-
const emitLow = (currentValue) => {
|
|
3251
|
-
const numberValue = currentValue ?? "";
|
|
3252
|
-
if (lastEmittedLow.current === numberValue && lastEmittedMultiplier.current === multiplier.current) {
|
|
3253
|
-
return;
|
|
3254
|
-
}
|
|
3255
|
-
lastEmittedLow.current = numberValue;
|
|
3256
|
-
lastEmittedMultiplier.current = multiplier.current;
|
|
3257
|
-
const emitValue = numberValue;
|
|
3258
|
-
state.value = emitValue;
|
|
3259
|
-
state.multiplier = multiplier.current;
|
|
3260
|
-
};
|
|
3261
|
-
const emitHigh = (currentValue) => {
|
|
3262
|
-
const numberValue = currentValue ?? "";
|
|
3263
|
-
if (lastEmittedHigh.current === numberValue && lastEmittedMultiplier.current === multiplier.current) {
|
|
3264
|
-
return;
|
|
3265
|
-
}
|
|
3266
|
-
lastEmittedHigh.current = numberValue;
|
|
3267
|
-
lastEmittedMultiplier.current = multiplier.current;
|
|
3268
|
-
const emitValue = numberValue;
|
|
3269
|
-
state.valueTo = emitValue;
|
|
3270
|
-
state.multiplier = multiplier.current;
|
|
3271
|
-
};
|
|
3272
|
-
const [lowValue, setLowValue] = useIntermediateValue(state.value);
|
|
3273
|
-
const [highValue, setHighValue] = useIntermediateValue(state.valueTo);
|
|
3274
|
-
const [unit, setUnit] = useIntermediateValue(state.multiplier);
|
|
3275
|
-
return /* @__PURE__ */ jsxs(
|
|
3276
|
-
Box,
|
|
3277
|
-
{
|
|
3278
|
-
className: `ApiaFilter__Range`,
|
|
3279
|
-
...getVariant("layout.common.components.filters.rangeFilter"),
|
|
3280
|
-
children: [
|
|
3281
|
-
/* @__PURE__ */ jsx(Box, { className: "ApiaFilter__Range__Low", children: /* @__PURE__ */ jsx(
|
|
3282
|
-
Input$1,
|
|
3283
|
-
{
|
|
3284
|
-
onChange: ({ target: { value: currentValue } }) => {
|
|
3285
|
-
setLowValue(currentValue);
|
|
3286
|
-
emitLow(currentValue);
|
|
3287
|
-
},
|
|
3288
|
-
onBlur: ({ target: { value: currentValue } }) => {
|
|
3289
|
-
emitLow(currentValue);
|
|
3290
|
-
},
|
|
3291
|
-
onKeyDown: ({ code, target }) => {
|
|
3292
|
-
if (code === "Enter") {
|
|
3293
|
-
emitLow(target.value);
|
|
3294
|
-
}
|
|
3295
|
-
},
|
|
3296
|
-
value: lowValue
|
|
3297
|
-
}
|
|
3298
|
-
) }),
|
|
3299
|
-
" - ",
|
|
3300
|
-
/* @__PURE__ */ jsx(Box, { className: "ApiaFilter__Range__High", children: /* @__PURE__ */ jsx(
|
|
3301
|
-
Input$1,
|
|
3302
|
-
{
|
|
3303
|
-
onChange: ({ target: { value: currentValue } }) => {
|
|
3304
|
-
setHighValue(currentValue);
|
|
3305
|
-
emitHigh(currentValue);
|
|
3306
|
-
},
|
|
3307
|
-
onBlur: ({ target: { value: currentValue } }) => {
|
|
3308
|
-
emitHigh(currentValue);
|
|
3309
|
-
},
|
|
3310
|
-
onKeyDown: ({ code, target }) => {
|
|
3311
|
-
if (code === "Enter") {
|
|
3312
|
-
emitHigh(target.value);
|
|
3313
|
-
}
|
|
3314
|
-
},
|
|
3315
|
-
value: highValue
|
|
3316
|
-
}
|
|
3317
|
-
) }),
|
|
3318
|
-
filter.isSize && /* @__PURE__ */ jsx(
|
|
3319
|
-
Select$1,
|
|
3320
|
-
{
|
|
3321
|
-
className: "ApiaFilter__Range__UnitSelector",
|
|
3322
|
-
onChange: (ev) => {
|
|
3323
|
-
const unit2 = ev.target.value;
|
|
3324
|
-
const index = units.indexOf(unit2);
|
|
3325
|
-
if (index !== -1) {
|
|
3326
|
-
multiplier.current = 2 ** (index * 10);
|
|
3327
|
-
setUnit(multiplier.current);
|
|
3328
|
-
emitLow(lastEmittedLow.current ?? "");
|
|
3329
|
-
}
|
|
3330
|
-
},
|
|
3331
|
-
value: units[Math.log2(unit || 1) / 10],
|
|
3332
|
-
children: units.map((c) => /* @__PURE__ */ jsx("option", { value: c, children: c }, c))
|
|
3333
|
-
}
|
|
3334
|
-
)
|
|
3335
|
-
]
|
|
3336
|
-
}
|
|
3337
|
-
);
|
|
3240
|
+
const RangeFilterRenderer = observer(({ state }) => {
|
|
3241
|
+
const multiplier = useRef(1);
|
|
3242
|
+
const lastEmittedHigh = useRef(null);
|
|
3243
|
+
const lastEmittedLow = useRef(null);
|
|
3244
|
+
const lastEmittedMultiplier = useRef(1);
|
|
3245
|
+
if (lastEmittedLow.current !== state.value) {
|
|
3246
|
+
lastEmittedLow.current = state.value;
|
|
3247
|
+
lastEmittedHigh.current = state.valueTo || "";
|
|
3338
3248
|
}
|
|
3339
|
-
)
|
|
3249
|
+
const emitLow = (currentValue) => {
|
|
3250
|
+
const numberValue = currentValue ?? "";
|
|
3251
|
+
if (lastEmittedLow.current === numberValue && lastEmittedMultiplier.current === multiplier.current) {
|
|
3252
|
+
return;
|
|
3253
|
+
}
|
|
3254
|
+
lastEmittedLow.current = numberValue;
|
|
3255
|
+
lastEmittedMultiplier.current = multiplier.current;
|
|
3256
|
+
const emitValue = numberValue;
|
|
3257
|
+
state.value = emitValue;
|
|
3258
|
+
state.multiplier = multiplier.current;
|
|
3259
|
+
};
|
|
3260
|
+
const emitHigh = (currentValue) => {
|
|
3261
|
+
const numberValue = currentValue ?? "";
|
|
3262
|
+
if (lastEmittedHigh.current === numberValue && lastEmittedMultiplier.current === multiplier.current) {
|
|
3263
|
+
return;
|
|
3264
|
+
}
|
|
3265
|
+
lastEmittedHigh.current = numberValue;
|
|
3266
|
+
lastEmittedMultiplier.current = multiplier.current;
|
|
3267
|
+
const emitValue = numberValue;
|
|
3268
|
+
state.valueTo = emitValue;
|
|
3269
|
+
state.multiplier = multiplier.current;
|
|
3270
|
+
};
|
|
3271
|
+
const [lowValue, setLowValue] = useIntermediateValue(state.value);
|
|
3272
|
+
const [highValue, setHighValue] = useIntermediateValue(state.valueTo);
|
|
3273
|
+
const [unit, setUnit] = useIntermediateValue(state.multiplier);
|
|
3274
|
+
return /* @__PURE__ */ jsxs(
|
|
3275
|
+
Box,
|
|
3276
|
+
{
|
|
3277
|
+
className: `ApiaFilter__Range`,
|
|
3278
|
+
...getVariant("layout.common.components.filters.rangeFilter"),
|
|
3279
|
+
children: [
|
|
3280
|
+
/* @__PURE__ */ jsx(Box, { className: "ApiaFilter__Range__Low", children: /* @__PURE__ */ jsx(
|
|
3281
|
+
Input$1,
|
|
3282
|
+
{
|
|
3283
|
+
disabled: state.readonly,
|
|
3284
|
+
onChange: ({ target: { value: currentValue } }) => {
|
|
3285
|
+
setLowValue(currentValue);
|
|
3286
|
+
emitLow(currentValue);
|
|
3287
|
+
},
|
|
3288
|
+
onBlur: ({ target: { value: currentValue } }) => {
|
|
3289
|
+
emitLow(currentValue);
|
|
3290
|
+
},
|
|
3291
|
+
onKeyDown: ({ code, target }) => {
|
|
3292
|
+
if (code === "Enter") {
|
|
3293
|
+
emitLow(target.value);
|
|
3294
|
+
}
|
|
3295
|
+
},
|
|
3296
|
+
value: lowValue
|
|
3297
|
+
}
|
|
3298
|
+
) }),
|
|
3299
|
+
" - ",
|
|
3300
|
+
/* @__PURE__ */ jsx(Box, { className: "ApiaFilter__Range__High", children: /* @__PURE__ */ jsx(
|
|
3301
|
+
Input$1,
|
|
3302
|
+
{
|
|
3303
|
+
disabled: state.readonly,
|
|
3304
|
+
onChange: ({ target: { value: currentValue } }) => {
|
|
3305
|
+
setHighValue(currentValue);
|
|
3306
|
+
emitHigh(currentValue);
|
|
3307
|
+
},
|
|
3308
|
+
onBlur: ({ target: { value: currentValue } }) => {
|
|
3309
|
+
emitHigh(currentValue);
|
|
3310
|
+
},
|
|
3311
|
+
onKeyDown: ({ code, target }) => {
|
|
3312
|
+
if (code === "Enter") {
|
|
3313
|
+
emitHigh(target.value);
|
|
3314
|
+
}
|
|
3315
|
+
},
|
|
3316
|
+
value: highValue
|
|
3317
|
+
}
|
|
3318
|
+
) }),
|
|
3319
|
+
state.isSize && /* @__PURE__ */ jsx(
|
|
3320
|
+
Select$1,
|
|
3321
|
+
{
|
|
3322
|
+
disabled: state.readonly,
|
|
3323
|
+
className: "ApiaFilter__Range__UnitSelector",
|
|
3324
|
+
onChange: (ev) => {
|
|
3325
|
+
const unit2 = ev.target.value;
|
|
3326
|
+
const index = units.indexOf(unit2);
|
|
3327
|
+
if (index !== -1) {
|
|
3328
|
+
multiplier.current = 2 ** (index * 10);
|
|
3329
|
+
setUnit(multiplier.current);
|
|
3330
|
+
emitLow(lastEmittedLow.current ?? "");
|
|
3331
|
+
}
|
|
3332
|
+
},
|
|
3333
|
+
value: units[Math.log2(unit || 1) / 10],
|
|
3334
|
+
children: units.map((c) => /* @__PURE__ */ jsx("option", { value: c, children: c }, c))
|
|
3335
|
+
}
|
|
3336
|
+
)
|
|
3337
|
+
]
|
|
3338
|
+
}
|
|
3339
|
+
);
|
|
3340
|
+
});
|
|
3340
3341
|
|
|
3341
|
-
const SelectFilterRenderer = observer(
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
);
|
|
3342
|
+
const SelectFilterRenderer = observer(({ state }) => {
|
|
3343
|
+
return /* @__PURE__ */ jsx(
|
|
3344
|
+
Select$1,
|
|
3345
|
+
{
|
|
3346
|
+
disabled: state.readonly,
|
|
3347
|
+
value: state.value,
|
|
3348
|
+
onChange: (ev) => {
|
|
3349
|
+
state.value = ev.target.value;
|
|
3350
|
+
},
|
|
3351
|
+
children: arrayOrArray(state.options).map((c) => /* @__PURE__ */ jsx("option", { value: c.value, children: c.label }, c.value))
|
|
3352
|
+
}
|
|
3353
|
+
);
|
|
3354
|
+
});
|
|
3355
3355
|
|
|
3356
|
-
const InputFilterRenderer = observer(
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
}
|
|
3370
|
-
},
|
|
3371
|
-
onBlur: () => {
|
|
3372
|
-
onFilterBlur?.(filter);
|
|
3356
|
+
const InputFilterRenderer = observer(({ state }) => {
|
|
3357
|
+
const { onFilterBlur, onFilterPressEnter } = useResponsiveTableContext();
|
|
3358
|
+
return /* @__PURE__ */ jsx(
|
|
3359
|
+
Input$1,
|
|
3360
|
+
{
|
|
3361
|
+
disabled: state.readonly,
|
|
3362
|
+
value: state.value,
|
|
3363
|
+
onChange: (ev) => {
|
|
3364
|
+
state.value = ev.target.value;
|
|
3365
|
+
},
|
|
3366
|
+
onKeyDown: (ev) => {
|
|
3367
|
+
if (ev.code === "Enter") {
|
|
3368
|
+
onFilterPressEnter?.(state);
|
|
3373
3369
|
}
|
|
3370
|
+
},
|
|
3371
|
+
onBlur: () => {
|
|
3372
|
+
onFilterBlur?.(state);
|
|
3374
3373
|
}
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
);
|
|
3374
|
+
}
|
|
3375
|
+
);
|
|
3376
|
+
});
|
|
3378
3377
|
|
|
3379
3378
|
const dateFormat = getDateFormat();
|
|
3380
3379
|
function controlDatesOrder(first, last) {
|
|
@@ -3385,54 +3384,155 @@ function controlDatesOrder(first, last) {
|
|
|
3385
3384
|
}
|
|
3386
3385
|
return true;
|
|
3387
3386
|
}
|
|
3388
|
-
const DateFilterRenderer = observer(
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3387
|
+
const DateFilterRenderer = observer(({ state }) => {
|
|
3388
|
+
const { onFilterBlur, onFilterChange } = useResponsiveTableContext();
|
|
3389
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3390
|
+
/* @__PURE__ */ jsx(Box, { as: "span", children: state?.filterToId ? formatMessage(window.LBL_DATE_FILTER_FROM_TXT, {
|
|
3391
|
+
TOK1: state.title ?? ""
|
|
3392
|
+
}) : state.title }),
|
|
3393
|
+
/* @__PURE__ */ jsx(
|
|
3394
|
+
DateInput,
|
|
3395
|
+
{
|
|
3396
|
+
disabled: state.readonly,
|
|
3397
|
+
value: state.value,
|
|
3398
|
+
onChange: (date) => {
|
|
3399
|
+
state.value = date;
|
|
3400
|
+
onFilterChange?.(state);
|
|
3401
|
+
},
|
|
3402
|
+
onBlur: () => {
|
|
3403
|
+
onFilterBlur?.(state);
|
|
3404
|
+
}
|
|
3405
|
+
}
|
|
3406
|
+
),
|
|
3407
|
+
(state?.isAdditional || state.group) && state?.filterToId && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3408
|
+
/* @__PURE__ */ jsx(Box, { as: "span", children: formatMessage(window.LBL_DATE_FILTER_TO_TXT, {
|
|
3409
|
+
TOK1: state.title ?? ""
|
|
3410
|
+
}) }),
|
|
3395
3411
|
/* @__PURE__ */ jsx(
|
|
3396
3412
|
DateInput,
|
|
3397
3413
|
{
|
|
3398
|
-
|
|
3414
|
+
disabled: state.readonly,
|
|
3415
|
+
value: state.filterToValue,
|
|
3399
3416
|
onChange: (date) => {
|
|
3400
|
-
state.value
|
|
3401
|
-
|
|
3417
|
+
const result = controlDatesOrder(state.value, date);
|
|
3418
|
+
if (result) {
|
|
3419
|
+
state.filterToValue = date;
|
|
3420
|
+
onFilterChange?.(state);
|
|
3421
|
+
} else {
|
|
3422
|
+
state.filterToValue = void 0;
|
|
3423
|
+
ApiaUtil.instance.notifications.notify({
|
|
3424
|
+
message: window.MSG_FEC_FIN_MAY_FEC_INI,
|
|
3425
|
+
type: "warning"
|
|
3426
|
+
});
|
|
3427
|
+
}
|
|
3402
3428
|
},
|
|
3403
3429
|
onBlur: () => {
|
|
3404
|
-
onFilterBlur?.(
|
|
3430
|
+
onFilterBlur?.(state);
|
|
3405
3431
|
}
|
|
3406
3432
|
}
|
|
3407
|
-
)
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3433
|
+
)
|
|
3434
|
+
] })
|
|
3435
|
+
] });
|
|
3436
|
+
});
|
|
3437
|
+
|
|
3438
|
+
async function getOptions(search) {
|
|
3439
|
+
if (!search)
|
|
3440
|
+
return [];
|
|
3441
|
+
const res = await ApiaApi.get(
|
|
3442
|
+
makeApiaUrl({
|
|
3443
|
+
ajaxUrl: "apia/AutoCompleteAction.run",
|
|
3444
|
+
action: "search",
|
|
3445
|
+
object: "doc_free_metadata",
|
|
3446
|
+
filter: "doc_free_metadata_title",
|
|
3447
|
+
id: "doc_free_metadata_title",
|
|
3448
|
+
show: "doc_free_metadata_title",
|
|
3449
|
+
likeSearch: true,
|
|
3450
|
+
allowLive: false,
|
|
3451
|
+
includeEnvId: true,
|
|
3452
|
+
distinctId: true,
|
|
3453
|
+
value: search
|
|
3454
|
+
})
|
|
3455
|
+
);
|
|
3456
|
+
const rows = arrayOrArray(res?.data?.row);
|
|
3457
|
+
return rows.map(({ content, searchId }) => ({
|
|
3458
|
+
label: content,
|
|
3459
|
+
value: searchId
|
|
3460
|
+
}));
|
|
3461
|
+
}
|
|
3462
|
+
const FreeLabelFilterRenderer = observer(
|
|
3463
|
+
({ state }) => {
|
|
3464
|
+
const { onFilterChange } = useResponsiveTableContext();
|
|
3465
|
+
const controller = useMemo(
|
|
3466
|
+
() => new AutocompleteController({
|
|
3467
|
+
value: "",
|
|
3468
|
+
icon: "LetterAutocomplete",
|
|
3469
|
+
options: [],
|
|
3470
|
+
onSearch: async (search, _acController) => {
|
|
3471
|
+
state.value = "";
|
|
3472
|
+
return getOptions(search);
|
|
3473
|
+
},
|
|
3474
|
+
onChange(str) {
|
|
3475
|
+
state.value = str;
|
|
3476
|
+
}
|
|
3477
|
+
}),
|
|
3478
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3479
|
+
[]
|
|
3480
|
+
);
|
|
3481
|
+
useMount(() => {
|
|
3482
|
+
controller.state.options = [];
|
|
3483
|
+
});
|
|
3484
|
+
return /* @__PURE__ */ jsxs(
|
|
3485
|
+
Box,
|
|
3486
|
+
{
|
|
3487
|
+
sx: {
|
|
3488
|
+
display: "flex",
|
|
3489
|
+
flexDirection: "row",
|
|
3490
|
+
gap: 2,
|
|
3491
|
+
width: "100%",
|
|
3492
|
+
alignItems: "end",
|
|
3493
|
+
".autocomplete__downArrow": {
|
|
3494
|
+
height: "46px!important",
|
|
3495
|
+
width: "23px!important",
|
|
3496
|
+
svg: {
|
|
3497
|
+
height: "100%",
|
|
3498
|
+
width: "100%"
|
|
3431
3499
|
}
|
|
3432
3500
|
}
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3501
|
+
},
|
|
3502
|
+
children: [
|
|
3503
|
+
/* @__PURE__ */ jsxs(Box, { sx: { width: "50%" }, children: [
|
|
3504
|
+
getLabel("lblTit").text,
|
|
3505
|
+
/* @__PURE__ */ jsx(Autocomplete, { handler: controller })
|
|
3506
|
+
] }),
|
|
3507
|
+
/* @__PURE__ */ jsxs(Box, { sx: { width: "50%" }, children: [
|
|
3508
|
+
getLabel("lblValue").text,
|
|
3509
|
+
/* @__PURE__ */ jsx(
|
|
3510
|
+
Input$1,
|
|
3511
|
+
{
|
|
3512
|
+
id: state.filterToId,
|
|
3513
|
+
disabled: state.readonly,
|
|
3514
|
+
value: state.filterToValue,
|
|
3515
|
+
onChange: (ev) => {
|
|
3516
|
+
state.filterToValue = ev.target.value;
|
|
3517
|
+
onFilterChange?.(state);
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
)
|
|
3521
|
+
] }),
|
|
3522
|
+
/* @__PURE__ */ jsx(Box, { sx: { height: "50px", width: "50px" }, children: state?.removeFilter && /* @__PURE__ */ jsx(
|
|
3523
|
+
IconButton,
|
|
3524
|
+
{
|
|
3525
|
+
sx: { height: "50px", width: "50px" },
|
|
3526
|
+
icon: "Trash",
|
|
3527
|
+
onClick: () => {
|
|
3528
|
+
if (state?.removeFilter)
|
|
3529
|
+
state.removeFilter();
|
|
3530
|
+
}
|
|
3531
|
+
}
|
|
3532
|
+
) })
|
|
3533
|
+
]
|
|
3534
|
+
}
|
|
3535
|
+
);
|
|
3436
3536
|
}
|
|
3437
3537
|
);
|
|
3438
3538
|
|
|
@@ -3449,19 +3549,22 @@ class Filter {
|
|
|
3449
3549
|
runAutomatically: false,
|
|
3450
3550
|
value: ""
|
|
3451
3551
|
});
|
|
3452
|
-
__publicField$5(this, "Component", observer((
|
|
3552
|
+
__publicField$5(this, "Component", observer(() => {
|
|
3453
3553
|
const { name } = useResponsiveTableContext();
|
|
3454
3554
|
this.tableName = name;
|
|
3455
3555
|
if (this.filterState.isRange) {
|
|
3456
|
-
return this.getRangeRenderer(
|
|
3556
|
+
return this.getRangeRenderer();
|
|
3457
3557
|
}
|
|
3458
3558
|
if (arrayOrArray(this.filterState.options).length > 0) {
|
|
3459
|
-
return this.getSelectRenderer(
|
|
3559
|
+
return this.getSelectRenderer();
|
|
3460
3560
|
}
|
|
3461
3561
|
if (this.filterState.type === "D" || this.filterState.type === "date") {
|
|
3462
|
-
return this.getDateRenderer(
|
|
3562
|
+
return this.getDateRenderer();
|
|
3463
3563
|
}
|
|
3464
|
-
|
|
3564
|
+
if (this.filterState.type === "double") {
|
|
3565
|
+
return this.getDoubleRenderer();
|
|
3566
|
+
}
|
|
3567
|
+
return this.getInputRenderer();
|
|
3465
3568
|
}));
|
|
3466
3569
|
Object.assign(this.filterState, properties);
|
|
3467
3570
|
makeObservable(this, { filterState: observable });
|
|
@@ -3477,7 +3580,7 @@ class Filter {
|
|
|
3477
3580
|
}
|
|
3478
3581
|
);
|
|
3479
3582
|
reaction(
|
|
3480
|
-
() => this.filterState.
|
|
3583
|
+
() => this.filterState.filterToValue,
|
|
3481
3584
|
() => {
|
|
3482
3585
|
if (this.tableName) {
|
|
3483
3586
|
getResponsiveTableContext(this.tableName).onFilterChange?.({
|
|
@@ -3501,17 +3604,20 @@ class Filter {
|
|
|
3501
3604
|
}
|
|
3502
3605
|
focus() {
|
|
3503
3606
|
}
|
|
3504
|
-
getInputRenderer(
|
|
3505
|
-
return /* @__PURE__ */ jsx(InputFilterRenderer, {
|
|
3607
|
+
getInputRenderer() {
|
|
3608
|
+
return /* @__PURE__ */ jsx(InputFilterRenderer, { state: this.filterState });
|
|
3609
|
+
}
|
|
3610
|
+
getSelectRenderer() {
|
|
3611
|
+
return /* @__PURE__ */ jsx(SelectFilterRenderer, { state: this.filterState });
|
|
3506
3612
|
}
|
|
3507
|
-
|
|
3508
|
-
return /* @__PURE__ */ jsx(
|
|
3613
|
+
getRangeRenderer() {
|
|
3614
|
+
return /* @__PURE__ */ jsx(RangeFilterRenderer, { state: this.filterState });
|
|
3509
3615
|
}
|
|
3510
|
-
|
|
3511
|
-
return /* @__PURE__ */ jsx(
|
|
3616
|
+
getDateRenderer() {
|
|
3617
|
+
return /* @__PURE__ */ jsx(DateFilterRenderer, { state: this.filterState });
|
|
3512
3618
|
}
|
|
3513
|
-
|
|
3514
|
-
return /* @__PURE__ */ jsx(
|
|
3619
|
+
getDoubleRenderer() {
|
|
3620
|
+
return /* @__PURE__ */ jsx(FreeLabelFilterRenderer, { state: this.filterState });
|
|
3515
3621
|
}
|
|
3516
3622
|
}
|
|
3517
3623
|
|
|
@@ -3536,6 +3642,8 @@ class TableController {
|
|
|
3536
3642
|
props: {},
|
|
3537
3643
|
rows: []
|
|
3538
3644
|
});
|
|
3645
|
+
// ids de filtros que se consideran "base" (creados en el init)
|
|
3646
|
+
__publicField$4(this, "baseFilterIds", /* @__PURE__ */ new Set());
|
|
3539
3647
|
__publicField$4(this, "Context", observer(({ children }) => {
|
|
3540
3648
|
return /* @__PURE__ */ jsx(
|
|
3541
3649
|
TableLoadingContext.Provider,
|
|
@@ -3553,12 +3661,13 @@ class TableController {
|
|
|
3553
3661
|
() => [...toJS(state.columns).values()],
|
|
3554
3662
|
[state.columns]
|
|
3555
3663
|
);
|
|
3664
|
+
const rows = useMemo(() => [...toJS(state.rows).values()], [state.rows]);
|
|
3556
3665
|
return /* @__PURE__ */ jsx(
|
|
3557
3666
|
ResponsiveTableContext,
|
|
3558
3667
|
{
|
|
3559
3668
|
...props,
|
|
3560
3669
|
columns,
|
|
3561
|
-
rows:
|
|
3670
|
+
rows: rows ?? [],
|
|
3562
3671
|
filters: useMemo(() => this.parseFilters(), [this.state.filters]),
|
|
3563
3672
|
FiltersRenderer: useCallback(
|
|
3564
3673
|
(filterId) => this.state.filters.get(filterId).Component,
|
|
@@ -3673,6 +3782,12 @@ class TableController {
|
|
|
3673
3782
|
on(ev, cb) {
|
|
3674
3783
|
return this.emitter.on(ev, cb);
|
|
3675
3784
|
}
|
|
3785
|
+
updateFilters(newFilters) {
|
|
3786
|
+
newFilters.forEach((c) => {
|
|
3787
|
+
this.state.filters.set(c.filterState.id, c);
|
|
3788
|
+
});
|
|
3789
|
+
this.state.filters = new Map(this.state.filters);
|
|
3790
|
+
}
|
|
3676
3791
|
updateState(newState) {
|
|
3677
3792
|
if (newState instanceof Function) {
|
|
3678
3793
|
newState(this.state);
|
|
@@ -3680,6 +3795,23 @@ class TableController {
|
|
|
3680
3795
|
Object.assign(this.state, newState);
|
|
3681
3796
|
}
|
|
3682
3797
|
}
|
|
3798
|
+
//Marca los filters actuales como los iniciales (llamar tras parseStructure/init).
|
|
3799
|
+
markInitialFilters() {
|
|
3800
|
+
this.baseFilterIds = new Set([...this.state.filters.keys()].map(String));
|
|
3801
|
+
}
|
|
3802
|
+
// Elimina todos los filtros que NO son base (aquellos añadidos después del init).
|
|
3803
|
+
removeAddedFilters() {
|
|
3804
|
+
for (const id of [...this.state.filters.keys()]) {
|
|
3805
|
+
if (!this.baseFilterIds.has(String(id))) {
|
|
3806
|
+
this.state.filters.delete(id);
|
|
3807
|
+
}
|
|
3808
|
+
}
|
|
3809
|
+
this.state.filters = new Map(this.state.filters);
|
|
3810
|
+
}
|
|
3811
|
+
removeFilter(id) {
|
|
3812
|
+
this.state.filters.delete(id);
|
|
3813
|
+
this.state.filters = new Map(this.state.filters);
|
|
3814
|
+
}
|
|
3683
3815
|
}
|
|
3684
3816
|
|
|
3685
3817
|
var __defProp$3 = Object.defineProperty;
|
|
@@ -3711,7 +3843,7 @@ class QueryController {
|
|
|
3711
3843
|
() => this.tableController.state.isLoading = this.mutex.isBusy
|
|
3712
3844
|
);
|
|
3713
3845
|
}
|
|
3714
|
-
async actualRefreshMethod() {
|
|
3846
|
+
async actualRefreshMethod(serverFirstRefresh) {
|
|
3715
3847
|
const newValues = this.getFiltersValuesMap();
|
|
3716
3848
|
if (!this.areRequiredFilters()) {
|
|
3717
3849
|
await this.mutex.acquire();
|
|
@@ -3727,7 +3859,11 @@ class QueryController {
|
|
|
3727
3859
|
);
|
|
3728
3860
|
this.parseRefreshResponse(refresh?.data);
|
|
3729
3861
|
} finally {
|
|
3730
|
-
|
|
3862
|
+
if (serverFirstRefresh) {
|
|
3863
|
+
this.tableController.state.finishedFirstLoad = false;
|
|
3864
|
+
} else {
|
|
3865
|
+
this.tableController.state.finishedFirstLoad = true;
|
|
3866
|
+
}
|
|
3731
3867
|
this.mutex.release();
|
|
3732
3868
|
}
|
|
3733
3869
|
}
|
|
@@ -3743,8 +3879,9 @@ class QueryController {
|
|
|
3743
3879
|
async clearFilters() {
|
|
3744
3880
|
this.tableController.state.filters.forEach((c) => {
|
|
3745
3881
|
c.filterState.value = "";
|
|
3746
|
-
c.filterState.
|
|
3882
|
+
c.filterState.filterToValue = "";
|
|
3747
3883
|
});
|
|
3884
|
+
this.actualRefreshMethod();
|
|
3748
3885
|
}
|
|
3749
3886
|
executeRefresh() {
|
|
3750
3887
|
clearTimeout(this.timeout);
|
|
@@ -3854,6 +3991,7 @@ class QueryController {
|
|
|
3854
3991
|
});
|
|
3855
3992
|
}
|
|
3856
3993
|
async initialLoad() {
|
|
3994
|
+
this.tableController.state.finishedFirstLoad = false;
|
|
3857
3995
|
if (this.initializing && !this.hasInited) {
|
|
3858
3996
|
throw new Error("Cannot initialize the query twice");
|
|
3859
3997
|
}
|
|
@@ -3868,6 +4006,7 @@ class QueryController {
|
|
|
3868
4006
|
this.hasInited = true;
|
|
3869
4007
|
this.initializing = false;
|
|
3870
4008
|
this.loadFilterTypes();
|
|
4009
|
+
this.tableController.markInitialFilters();
|
|
3871
4010
|
if (!this.structure.queryData?.noExecFirstTime)
|
|
3872
4011
|
this.refresh();
|
|
3873
4012
|
}
|
|
@@ -3936,7 +4075,13 @@ class QueryController {
|
|
|
3936
4075
|
hideToFilter: true,
|
|
3937
4076
|
onChange: () => {
|
|
3938
4077
|
},
|
|
3939
|
-
options: [
|
|
4078
|
+
options: f?.filterOption ? [
|
|
4079
|
+
{ value: "", label: "" },
|
|
4080
|
+
...arrayOrArray(f?.filterOption).map((c) => ({
|
|
4081
|
+
label: c.content,
|
|
4082
|
+
value: c.value
|
|
4083
|
+
}))
|
|
4084
|
+
] : void 0,
|
|
3940
4085
|
placeholder: f.title,
|
|
3941
4086
|
readonly: f.readonly,
|
|
3942
4087
|
required: f.required === "true",
|
|
@@ -4080,86 +4225,118 @@ const FilterTypesComponent = observer(
|
|
|
4080
4225
|
}
|
|
4081
4226
|
);
|
|
4082
4227
|
|
|
4083
|
-
const AdditionalFiltersComponent = (
|
|
4084
|
-
queryController
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
tableName: queryController.tableController.getTableName(),
|
|
4105
|
-
children: /* @__PURE__ */ jsxs(Accordion, { className: "additionalFiltersContent", singleExpand: true, children: [
|
|
4106
|
-
hasFilters && /* @__PURE__ */ jsx(
|
|
4107
|
-
AccordionItem,
|
|
4108
|
-
{
|
|
4109
|
-
id: "Responsive",
|
|
4110
|
-
defaultExpanded: true,
|
|
4111
|
-
buttonProps: { ariaLabel: filterTitle, label: filterTitle },
|
|
4112
|
-
children: /* @__PURE__ */ jsx(Responsive, {})
|
|
4113
|
-
}
|
|
4114
|
-
),
|
|
4115
|
-
hasAdditional && /* @__PURE__ */ jsx(
|
|
4116
|
-
AccordionItem,
|
|
4117
|
-
{
|
|
4118
|
-
id: "Additional",
|
|
4119
|
-
buttonProps: {
|
|
4120
|
-
ariaLabel: window.ADDITIONAL_FILTERS_LABEL,
|
|
4121
|
-
label: window.ADDITIONAL_FILTERS_LABEL
|
|
4122
|
-
},
|
|
4123
|
-
children: /* @__PURE__ */ jsx(Additional, {})
|
|
4124
|
-
}
|
|
4125
|
-
),
|
|
4126
|
-
hasGroupFilter && /* @__PURE__ */ jsx(
|
|
4127
|
-
AccordionItem,
|
|
4128
|
-
{
|
|
4129
|
-
id: "Group",
|
|
4130
|
-
buttonProps: {
|
|
4131
|
-
ariaLabel: getLabel("titMetadata").text,
|
|
4132
|
-
label: getLabel("titMetadata").text
|
|
4133
|
-
},
|
|
4134
|
-
children: /* @__PURE__ */ jsx(
|
|
4135
|
-
Grouped,
|
|
4136
|
-
{
|
|
4137
|
-
tableName: queryController.tableController.getTableName(),
|
|
4138
|
-
group: hasGroupFilter?.group ?? ""
|
|
4139
|
-
}
|
|
4140
|
-
)
|
|
4141
|
-
}
|
|
4142
|
-
),
|
|
4143
|
-
hasSortable && /* @__PURE__ */ jsx(
|
|
4144
|
-
AccordionItem,
|
|
4145
|
-
{
|
|
4146
|
-
id: "Sort",
|
|
4147
|
-
buttonProps: { ariaLabel: sortTitle, label: sortTitle },
|
|
4148
|
-
children: /* @__PURE__ */ jsx(Sort, {})
|
|
4149
|
-
}
|
|
4150
|
-
),
|
|
4151
|
-
hasFilters && !queryController.structure?.hideFilterTypes && /* @__PURE__ */ jsx(
|
|
4152
|
-
AccordionItem,
|
|
4153
|
-
{
|
|
4154
|
-
id: "FilterTypes",
|
|
4155
|
-
buttonProps: { ariaLabel: filterTypes, label: filterTypes },
|
|
4156
|
-
children: /* @__PURE__ */ jsx(FilterTypesComponent, { queryController })
|
|
4228
|
+
const AdditionalFiltersComponent = observer(
|
|
4229
|
+
({ queryController }) => {
|
|
4230
|
+
const filterTitle = getLabel("sbtFilters").text;
|
|
4231
|
+
const sortTitle = getLabel("titOrderBy").text;
|
|
4232
|
+
const filterTypes = getLabel("btnFilterType").text;
|
|
4233
|
+
const hasAdditional = !![
|
|
4234
|
+
...queryController.tableController.state.filters.values()
|
|
4235
|
+
].find((f) => f.filterState.isAdditional || !f.filterState.column);
|
|
4236
|
+
const hasFilters = !![
|
|
4237
|
+
...queryController.tableController.state.filters.values()
|
|
4238
|
+
].find((f) => !f.filterState.isAdditional && f.filterState.column);
|
|
4239
|
+
const hasSortable = !![
|
|
4240
|
+
...queryController.tableController.state.columns.values()
|
|
4241
|
+
].find((c) => c.allowSorting !== false);
|
|
4242
|
+
const groupFilters = (() => {
|
|
4243
|
+
const byGroup = /* @__PURE__ */ new Map();
|
|
4244
|
+
[...queryController.tableController.state.filters.values()].forEach(
|
|
4245
|
+
(f) => {
|
|
4246
|
+
const g = f.filterState?.group;
|
|
4247
|
+
if (g && g !== "" && !byGroup.has(g)) {
|
|
4248
|
+
byGroup.set(g, f);
|
|
4157
4249
|
}
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4250
|
+
}
|
|
4251
|
+
);
|
|
4252
|
+
return [...byGroup.values()];
|
|
4253
|
+
})();
|
|
4254
|
+
return /* @__PURE__ */ jsx(
|
|
4255
|
+
TableContextReproducer,
|
|
4256
|
+
{
|
|
4257
|
+
tableName: queryController.tableController.getTableName(),
|
|
4258
|
+
children: /* @__PURE__ */ jsxs(Accordion, { className: "additionalFiltersContent", singleExpand: true, children: [
|
|
4259
|
+
hasFilters && /* @__PURE__ */ jsx(
|
|
4260
|
+
AccordionItem,
|
|
4261
|
+
{
|
|
4262
|
+
id: "Responsive",
|
|
4263
|
+
defaultExpanded: true,
|
|
4264
|
+
buttonProps: { ariaLabel: filterTitle, label: filterTitle },
|
|
4265
|
+
children: /* @__PURE__ */ jsx(Responsive, {})
|
|
4266
|
+
}
|
|
4267
|
+
),
|
|
4268
|
+
hasAdditional && /* @__PURE__ */ jsx(
|
|
4269
|
+
AccordionItem,
|
|
4270
|
+
{
|
|
4271
|
+
id: "Additional",
|
|
4272
|
+
buttonProps: {
|
|
4273
|
+
ariaLabel: window.ADDITIONAL_FILTERS_LABEL,
|
|
4274
|
+
label: window.ADDITIONAL_FILTERS_LABEL
|
|
4275
|
+
},
|
|
4276
|
+
children: /* @__PURE__ */ jsx(Additional, {})
|
|
4277
|
+
}
|
|
4278
|
+
),
|
|
4279
|
+
groupFilters.length > 0 && /* @__PURE__ */ jsx(Fragment, { children: groupFilters.map((g) => /* @__PURE__ */ jsx(
|
|
4280
|
+
AccordionItem,
|
|
4281
|
+
{
|
|
4282
|
+
id: `Group_${g.filterState.group}`,
|
|
4283
|
+
buttonProps: {
|
|
4284
|
+
ariaLabel: getLabel(`${g.filterState.group}`).text,
|
|
4285
|
+
label: getLabel(`${g.filterState.group}`).text
|
|
4286
|
+
},
|
|
4287
|
+
children: /* @__PURE__ */ jsxs(
|
|
4288
|
+
Box,
|
|
4289
|
+
{
|
|
4290
|
+
sx: {
|
|
4291
|
+
display: "flex",
|
|
4292
|
+
flexDirection: "column",
|
|
4293
|
+
alignItems: "end",
|
|
4294
|
+
gap: 3,
|
|
4295
|
+
width: "100%"
|
|
4296
|
+
},
|
|
4297
|
+
children: [
|
|
4298
|
+
/* @__PURE__ */ jsx(
|
|
4299
|
+
Grouped,
|
|
4300
|
+
{
|
|
4301
|
+
tableName: queryController.tableController.getTableName(),
|
|
4302
|
+
group: g.filterState?.group ?? ""
|
|
4303
|
+
},
|
|
4304
|
+
g.filterState.group
|
|
4305
|
+
),
|
|
4306
|
+
g.filterState.addFilter && /* @__PURE__ */ jsx(
|
|
4307
|
+
SimpleButton,
|
|
4308
|
+
{
|
|
4309
|
+
variant: "outline-sm",
|
|
4310
|
+
onClick: g.filterState.addFilter,
|
|
4311
|
+
children: getLabel("lblAddFil").text
|
|
4312
|
+
}
|
|
4313
|
+
)
|
|
4314
|
+
]
|
|
4315
|
+
}
|
|
4316
|
+
)
|
|
4317
|
+
}
|
|
4318
|
+
)) }),
|
|
4319
|
+
hasSortable && /* @__PURE__ */ jsx(
|
|
4320
|
+
AccordionItem,
|
|
4321
|
+
{
|
|
4322
|
+
id: "Sort",
|
|
4323
|
+
buttonProps: { ariaLabel: sortTitle, label: sortTitle },
|
|
4324
|
+
children: /* @__PURE__ */ jsx(Sort, {})
|
|
4325
|
+
}
|
|
4326
|
+
),
|
|
4327
|
+
hasFilters && !queryController.structure?.hideFilterTypes && /* @__PURE__ */ jsx(
|
|
4328
|
+
AccordionItem,
|
|
4329
|
+
{
|
|
4330
|
+
id: "FilterTypes",
|
|
4331
|
+
buttonProps: { ariaLabel: filterTypes, label: filterTypes },
|
|
4332
|
+
children: /* @__PURE__ */ jsx(FilterTypesComponent, { queryController })
|
|
4333
|
+
}
|
|
4334
|
+
)
|
|
4335
|
+
] })
|
|
4336
|
+
}
|
|
4337
|
+
);
|
|
4338
|
+
}
|
|
4339
|
+
);
|
|
4163
4340
|
|
|
4164
4341
|
var __defProp$2 = Object.defineProperty;
|
|
4165
4342
|
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -4232,6 +4409,43 @@ var __publicField$1 = (obj, key, value) => {
|
|
|
4232
4409
|
__defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4233
4410
|
return value;
|
|
4234
4411
|
};
|
|
4412
|
+
const NavBarRenderer = observer(
|
|
4413
|
+
({
|
|
4414
|
+
queryController,
|
|
4415
|
+
additionalFiltersController
|
|
4416
|
+
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4417
|
+
/* @__PURE__ */ jsx(
|
|
4418
|
+
SimpleButton,
|
|
4419
|
+
{
|
|
4420
|
+
variant: "primary-sm",
|
|
4421
|
+
onClick: () => {
|
|
4422
|
+
queryController.refresh();
|
|
4423
|
+
},
|
|
4424
|
+
children: queryController.tableController.state.isLoading ? /* @__PURE__ */ jsx(Spinner, { sx: { color: "white", height: "17px" } }) : getLabel("btnSearch").text
|
|
4425
|
+
}
|
|
4426
|
+
),
|
|
4427
|
+
/* @__PURE__ */ jsx(
|
|
4428
|
+
SimpleButton,
|
|
4429
|
+
{
|
|
4430
|
+
size: "sm",
|
|
4431
|
+
variant: "outline",
|
|
4432
|
+
onClick: async () => {
|
|
4433
|
+
additionalFiltersController.openModal();
|
|
4434
|
+
},
|
|
4435
|
+
children: getLabel("titAdmAdtFilter").text
|
|
4436
|
+
}
|
|
4437
|
+
),
|
|
4438
|
+
/* @__PURE__ */ jsx(
|
|
4439
|
+
SimpleButton,
|
|
4440
|
+
{
|
|
4441
|
+
size: "sm",
|
|
4442
|
+
variant: "outline",
|
|
4443
|
+
onClick: () => queryController.clearFilters(),
|
|
4444
|
+
children: getLabel("btnClearFilter").text
|
|
4445
|
+
}
|
|
4446
|
+
)
|
|
4447
|
+
] })
|
|
4448
|
+
);
|
|
4235
4449
|
class QueryModalController {
|
|
4236
4450
|
constructor(queryController) {
|
|
4237
4451
|
__publicField$1(this, "emitter", new EventEmitter());
|
|
@@ -4239,6 +4453,7 @@ class QueryModalController {
|
|
|
4239
4453
|
__publicField$1(this, "modalHandler", null);
|
|
4240
4454
|
__publicField$1(this, "currentSelection", null);
|
|
4241
4455
|
__publicField$1(this, "additionalFiltersController");
|
|
4456
|
+
__publicField$1(this, "sx", {});
|
|
4242
4457
|
if (!queryController) {
|
|
4243
4458
|
throw new Error("QueryController instance is required");
|
|
4244
4459
|
}
|
|
@@ -4261,54 +4476,30 @@ class QueryModalController {
|
|
|
4261
4476
|
const tableController = this.queryController.tableController;
|
|
4262
4477
|
const structure = this.queryController.structure;
|
|
4263
4478
|
return {
|
|
4264
|
-
children: /* @__PURE__ */ jsxs(tableController.Context, { children: [
|
|
4479
|
+
children: /* @__PURE__ */ jsx(Box, { sx: { height: "100%", ...this.sx }, children: /* @__PURE__ */ jsxs(tableController.Context, { children: [
|
|
4265
4480
|
/* @__PURE__ */ jsx(tableController.Table, {}),
|
|
4266
4481
|
/* @__PURE__ */ jsx(tableController.Pagination, {})
|
|
4267
|
-
] }),
|
|
4482
|
+
] }) }),
|
|
4268
4483
|
title: structure?.title,
|
|
4269
4484
|
onConfirm: () => {
|
|
4270
4485
|
this.onConfirm();
|
|
4271
4486
|
},
|
|
4272
4487
|
onCancel: () => {
|
|
4273
4488
|
this.additionalFiltersController.closeModal();
|
|
4489
|
+
this.queryController.tableController.state.finishedFirstLoad = false;
|
|
4274
4490
|
this.emitter.emit("cancel", null);
|
|
4275
4491
|
},
|
|
4276
4492
|
confirmProps: {
|
|
4277
4493
|
confirmButtonText: getLabel("btnCon").text,
|
|
4278
4494
|
cancelButtonText: getLabel("btnCan").text
|
|
4279
4495
|
},
|
|
4280
|
-
NavBar: /* @__PURE__ */
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
},
|
|
4288
|
-
children: getLabel("btnSearch").text
|
|
4289
|
-
}
|
|
4290
|
-
),
|
|
4291
|
-
/* @__PURE__ */ jsx(
|
|
4292
|
-
SimpleButton,
|
|
4293
|
-
{
|
|
4294
|
-
size: "sm",
|
|
4295
|
-
variant: "outline",
|
|
4296
|
-
onClick: async () => {
|
|
4297
|
-
this.additionalFiltersController.openModal();
|
|
4298
|
-
},
|
|
4299
|
-
children: getLabel("titAdmAdtFilter").text
|
|
4300
|
-
}
|
|
4301
|
-
),
|
|
4302
|
-
/* @__PURE__ */ jsx(
|
|
4303
|
-
SimpleButton,
|
|
4304
|
-
{
|
|
4305
|
-
size: "sm",
|
|
4306
|
-
variant: "outline",
|
|
4307
|
-
onClick: () => this.queryController.clearFilters(),
|
|
4308
|
-
children: getLabel("btnClearFilter").text
|
|
4309
|
-
}
|
|
4310
|
-
)
|
|
4311
|
-
] }),
|
|
4496
|
+
NavBar: /* @__PURE__ */ jsx(
|
|
4497
|
+
NavBarRenderer,
|
|
4498
|
+
{
|
|
4499
|
+
queryController: this.queryController,
|
|
4500
|
+
additionalFiltersController: this.additionalFiltersController
|
|
4501
|
+
}
|
|
4502
|
+
),
|
|
4312
4503
|
size: "finder"
|
|
4313
4504
|
};
|
|
4314
4505
|
}
|
|
@@ -4324,6 +4515,9 @@ class QueryModalController {
|
|
|
4324
4515
|
...this.getModalDefinition(),
|
|
4325
4516
|
...properties
|
|
4326
4517
|
});
|
|
4518
|
+
if (this.queryController.structure?.openFiltersAutomatically) {
|
|
4519
|
+
this.additionalFiltersController.openModal();
|
|
4520
|
+
}
|
|
4327
4521
|
return this.onConfirmResolve();
|
|
4328
4522
|
}
|
|
4329
4523
|
getModalHandler() {
|
|
@@ -4366,7 +4560,10 @@ class GenericListQuery extends QueryController {
|
|
|
4366
4560
|
};
|
|
4367
4561
|
}
|
|
4368
4562
|
getLoadStructureParameters() {
|
|
4369
|
-
return {
|
|
4563
|
+
return {
|
|
4564
|
+
...super.getLoadStructureParameters(),
|
|
4565
|
+
...this.getRefreshParameters()
|
|
4566
|
+
};
|
|
4370
4567
|
}
|
|
4371
4568
|
getRefreshParameters() {
|
|
4372
4569
|
return {
|
|
@@ -4375,14 +4572,32 @@ class GenericListQuery extends QueryController {
|
|
|
4375
4572
|
isAjax: true
|
|
4376
4573
|
};
|
|
4377
4574
|
}
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4575
|
+
async getStructure() {
|
|
4576
|
+
const result = await ApiaApi.post(
|
|
4577
|
+
makeApiaUrl(this.getLoadStructureParameters())
|
|
4578
|
+
);
|
|
4579
|
+
if (!result?.data) {
|
|
4580
|
+
throw new Error("Cannot load Input query structure");
|
|
4581
|
+
}
|
|
4582
|
+
super.parseRefreshResponse(result?.data);
|
|
4583
|
+
return this.parseLoadStructureResponse(result.data);
|
|
4584
|
+
}
|
|
4585
|
+
async initialLoad() {
|
|
4586
|
+
this.tableController.state.finishedFirstLoad = false;
|
|
4587
|
+
if (this.initializing && !this.hasInited) {
|
|
4588
|
+
throw new Error("Cannot initialize the query twice");
|
|
4589
|
+
}
|
|
4590
|
+
this.initializing = true;
|
|
4591
|
+
if (!this.hasInited) {
|
|
4592
|
+
const structure = await this.getStructure();
|
|
4593
|
+
this.structure = structure;
|
|
4594
|
+
this.parseStructure(structure);
|
|
4595
|
+
this.tableController.updateState({
|
|
4596
|
+
props: this.getTableControllerDefaultProps()
|
|
4597
|
+
});
|
|
4598
|
+
this.hasInited = true;
|
|
4599
|
+
this.initializing = false;
|
|
4600
|
+
}
|
|
4386
4601
|
}
|
|
4387
4602
|
parseLoadStructureResponse(response) {
|
|
4388
4603
|
const typedResponse = response;
|
|
@@ -4400,9 +4615,9 @@ class UsersQuery extends GenericListQuery {
|
|
|
4400
4615
|
constructor() {
|
|
4401
4616
|
super("apia.modals.UsersAction.run");
|
|
4402
4617
|
}
|
|
4403
|
-
|
|
4618
|
+
getRefreshParameters() {
|
|
4404
4619
|
return {
|
|
4405
|
-
...super.
|
|
4620
|
+
...super.getRefreshParameters(),
|
|
4406
4621
|
externalUser: false,
|
|
4407
4622
|
selectOnlyOne: false,
|
|
4408
4623
|
globalAndEnv: true,
|
|
@@ -4411,6 +4626,20 @@ class UsersQuery extends GenericListQuery {
|
|
|
4411
4626
|
forCurrentEnv: false
|
|
4412
4627
|
};
|
|
4413
4628
|
}
|
|
4629
|
+
parseRefreshResponse(response) {
|
|
4630
|
+
if (!response)
|
|
4631
|
+
return;
|
|
4632
|
+
const structure = this.parseLoadStructureResponse(response);
|
|
4633
|
+
this.parseStructure(structure);
|
|
4634
|
+
setTimeout(() => {
|
|
4635
|
+
super.parseRefreshResponse(response);
|
|
4636
|
+
}, 0);
|
|
4637
|
+
}
|
|
4638
|
+
getFiltersValuesMap() {
|
|
4639
|
+
return {
|
|
4640
|
+
...super.getFiltersValuesMap()
|
|
4641
|
+
};
|
|
4642
|
+
}
|
|
4414
4643
|
parseLoadStructureResponse(response) {
|
|
4415
4644
|
const structure = { ...super.parseLoadStructureResponse(response) };
|
|
4416
4645
|
structure.hideFilterTypes = true;
|
|
@@ -4420,16 +4649,17 @@ class UsersQuery extends GenericListQuery {
|
|
|
4420
4649
|
const makeApiaUsersModal2 = () => new QueryModalController(new UsersQuery());
|
|
4421
4650
|
|
|
4422
4651
|
class PoolsQuery extends GenericListQuery {
|
|
4423
|
-
constructor() {
|
|
4652
|
+
constructor(config) {
|
|
4424
4653
|
super("apia.modals.PoolsAction.run");
|
|
4654
|
+
this.config = config;
|
|
4425
4655
|
}
|
|
4426
|
-
|
|
4656
|
+
getRefreshParameters() {
|
|
4427
4657
|
return {
|
|
4428
|
-
...super.
|
|
4658
|
+
...super.getRefreshParameters(),
|
|
4429
4659
|
showAutogenerated: false,
|
|
4430
4660
|
showNotAutogenerated: false,
|
|
4431
|
-
showCurrentEnv: true,
|
|
4432
|
-
showGlobal: true,
|
|
4661
|
+
showCurrentEnv: this.config?.showCurrentEnv ?? true,
|
|
4662
|
+
showGlobal: this.config?.showGlobal ?? true,
|
|
4433
4663
|
selectOnlyOne: false,
|
|
4434
4664
|
forHierarchy: false,
|
|
4435
4665
|
showOnlyPoolsInHierarchy: false,
|
|
@@ -4438,29 +4668,64 @@ class PoolsQuery extends GenericListQuery {
|
|
|
4438
4668
|
fetchAllInHierarchy: false
|
|
4439
4669
|
};
|
|
4440
4670
|
}
|
|
4671
|
+
getFiltersValuesMap() {
|
|
4672
|
+
return {
|
|
4673
|
+
...super.getFiltersValuesMap()
|
|
4674
|
+
};
|
|
4675
|
+
}
|
|
4676
|
+
parseRefreshResponse(response) {
|
|
4677
|
+
if (!response)
|
|
4678
|
+
return;
|
|
4679
|
+
const structure = this.parseLoadStructureResponse(response);
|
|
4680
|
+
this.parseStructure(structure);
|
|
4681
|
+
setTimeout(() => {
|
|
4682
|
+
super.parseRefreshResponse(response);
|
|
4683
|
+
}, 0);
|
|
4684
|
+
}
|
|
4441
4685
|
parseLoadStructureResponse(response) {
|
|
4442
4686
|
const structure = { ...super.parseLoadStructureResponse(response) };
|
|
4443
4687
|
structure.hideFilterTypes = true;
|
|
4688
|
+
structure.title = getLabel("btnAddPool").text;
|
|
4444
4689
|
return structure;
|
|
4445
4690
|
}
|
|
4446
4691
|
}
|
|
4447
|
-
const makeApiaPoolsModals2 = () => new QueryModalController(new PoolsQuery());
|
|
4692
|
+
const makeApiaPoolsModals2 = (config) => new QueryModalController(new PoolsQuery(config));
|
|
4448
4693
|
|
|
4449
4694
|
var __defProp = Object.defineProperty;
|
|
4450
4695
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4451
4696
|
var __publicField = (obj, key, value) => {
|
|
4452
|
-
__defNormalProp(obj, key + "" , value);
|
|
4697
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4453
4698
|
return value;
|
|
4454
4699
|
};
|
|
4455
4700
|
class MonDocQuery extends QueryController {
|
|
4456
4701
|
constructor(ajaxUrl) {
|
|
4457
4702
|
super(ajaxUrl);
|
|
4458
4703
|
this.ajaxUrl = ajaxUrl;
|
|
4704
|
+
__publicField(this, "getAdditionalInfo", async (row) => {
|
|
4705
|
+
const result = await ApiaApi.post(
|
|
4706
|
+
makeApiaUrl({
|
|
4707
|
+
ajaxUrl: this.ajaxUrl,
|
|
4708
|
+
action: "adtInfo",
|
|
4709
|
+
isAjax: true,
|
|
4710
|
+
preventAsXmlParameter: true
|
|
4711
|
+
}),
|
|
4712
|
+
{
|
|
4713
|
+
postData: new URLSearchParams({
|
|
4714
|
+
id: row.id.slice(
|
|
4715
|
+
0,
|
|
4716
|
+
row.id.indexOf("$-$") > 0 ? row.id.indexOf("$-$") : row.id.length
|
|
4717
|
+
)
|
|
4718
|
+
}).toString()
|
|
4719
|
+
}
|
|
4720
|
+
);
|
|
4721
|
+
return arrayOrArray(result?.data?.function.messages.row.cell);
|
|
4722
|
+
});
|
|
4459
4723
|
__publicField(this, "dynamicParams", {});
|
|
4460
4724
|
}
|
|
4461
4725
|
getTableControllerDefaultProps() {
|
|
4462
4726
|
return {
|
|
4463
4727
|
...super.getTableControllerDefaultProps(),
|
|
4728
|
+
showFilters: true,
|
|
4464
4729
|
isMultiple: false,
|
|
4465
4730
|
reserveColumnsForStates: 2,
|
|
4466
4731
|
statesColumns: [
|
|
@@ -4475,42 +4740,74 @@ class MonDocQuery extends QueryController {
|
|
|
4475
4740
|
]
|
|
4476
4741
|
};
|
|
4477
4742
|
}
|
|
4743
|
+
addFreeMetadataFilter(filter) {
|
|
4744
|
+
const id = uniqueId$1();
|
|
4745
|
+
const actualFilter = filter || {
|
|
4746
|
+
id,
|
|
4747
|
+
group: "lblFreeMetadata",
|
|
4748
|
+
value: "",
|
|
4749
|
+
filterToValue: "",
|
|
4750
|
+
avoidLabel: true,
|
|
4751
|
+
type: "double",
|
|
4752
|
+
addFilter: () => {
|
|
4753
|
+
this.addFreeMetadataFilter();
|
|
4754
|
+
},
|
|
4755
|
+
removeFilter: () => {
|
|
4756
|
+
this.tableController.removeFilter(id);
|
|
4757
|
+
}
|
|
4758
|
+
};
|
|
4759
|
+
const freeMetadataFilters = arrayOrArray(actualFilter).map((f) => {
|
|
4760
|
+
return new Filter(f);
|
|
4761
|
+
});
|
|
4762
|
+
this.tableController.updateFilters(freeMetadataFilters);
|
|
4763
|
+
}
|
|
4478
4764
|
async initialLoad() {
|
|
4479
4765
|
await super.initialLoad();
|
|
4480
4766
|
await this.loadMetadataFilters();
|
|
4481
4767
|
await this.setFilters();
|
|
4482
4768
|
}
|
|
4483
4769
|
async loadMetadataFilters() {
|
|
4770
|
+
this.tableController.removeAddedFilters();
|
|
4484
4771
|
const res = await ApiaApi.post(
|
|
4485
4772
|
makeApiaUrl({
|
|
4486
4773
|
ajaxUrl: this.ajaxUrl,
|
|
4487
4774
|
action: "loadMetadata",
|
|
4488
|
-
docTypeId:
|
|
4775
|
+
docTypeId: this.tableController.state.filters.get("txtDocTypeId")?.filterState.value || 1
|
|
4489
4776
|
})
|
|
4490
4777
|
);
|
|
4491
4778
|
if (res?.data?.docMetadata?.metadata) {
|
|
4492
|
-
const parsedFilters = res.data.docMetadata.metadata.map(
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
arrayOrArray(parsedFilters).map((f) => {
|
|
4505
|
-
return [f.id, new Filter(f)];
|
|
4506
|
-
})
|
|
4779
|
+
const parsedFilters = arrayOrArray(res.data.docMetadata.metadata).map(
|
|
4780
|
+
(c) => {
|
|
4781
|
+
const filter = {
|
|
4782
|
+
...c,
|
|
4783
|
+
group: "titMetadata",
|
|
4784
|
+
hideToFilter: true,
|
|
4785
|
+
filterToId: `${String(c.id)}i`,
|
|
4786
|
+
filterToValue: c.value2,
|
|
4787
|
+
avoidLabel: c.type === "D"
|
|
4788
|
+
};
|
|
4789
|
+
return filter;
|
|
4790
|
+
}
|
|
4507
4791
|
);
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
...this.tableController.state.filters.entries(),
|
|
4511
|
-
...metadataFilters.entries()
|
|
4512
|
-
])
|
|
4792
|
+
const metadataFilters = arrayOrArray(parsedFilters).map((f) => {
|
|
4793
|
+
return new Filter(f);
|
|
4513
4794
|
});
|
|
4795
|
+
this.tableController.updateFilters(metadataFilters);
|
|
4796
|
+
if (metadataFilters.length > 0) {
|
|
4797
|
+
const id = uniqueId$1();
|
|
4798
|
+
const metadataFilter = {
|
|
4799
|
+
id,
|
|
4800
|
+
group: "lblFreeMetadata",
|
|
4801
|
+
value: "",
|
|
4802
|
+
filterToValue: "",
|
|
4803
|
+
avoidLabel: true,
|
|
4804
|
+
type: "double",
|
|
4805
|
+
addFilter: () => {
|
|
4806
|
+
this.addFreeMetadataFilter();
|
|
4807
|
+
}
|
|
4808
|
+
};
|
|
4809
|
+
this.addFreeMetadataFilter(metadataFilter);
|
|
4810
|
+
}
|
|
4514
4811
|
}
|
|
4515
4812
|
}
|
|
4516
4813
|
async loadFilterTypes() {
|
|
@@ -4544,28 +4841,32 @@ class MonDocQuery extends QueryController {
|
|
|
4544
4841
|
}
|
|
4545
4842
|
getFiltersValuesMap() {
|
|
4546
4843
|
const metadataValues = [];
|
|
4844
|
+
const freeMetadataValues = [];
|
|
4547
4845
|
const filtersValues = [
|
|
4548
4846
|
...this.tableController.state.filters.values()
|
|
4549
4847
|
].reduce((result, filterWrapper) => {
|
|
4550
4848
|
const { id, value, type, group, multiplier, filterToId, filterToValue } = filterWrapper.filterState;
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
const t = type === "apiaNumber" ? "N" : type;
|
|
4849
|
+
switch (group) {
|
|
4850
|
+
case "titMetadata":
|
|
4851
|
+
if (value !== "") {
|
|
4852
|
+
const t = (type === "apiaNumber" ? "N" : type) || "S";
|
|
4556
4853
|
metadataValues.push(
|
|
4557
|
-
`${
|
|
4854
|
+
`${id}${window.PRIMARY_SEPARATOR}${t}${window.PRIMARY_SEPARATOR}${value}`
|
|
4558
4855
|
);
|
|
4559
4856
|
if (filterToValue) {
|
|
4560
4857
|
metadataValues.push(
|
|
4561
|
-
`${
|
|
4858
|
+
`${id}${window.PRIMARY_SEPARATOR}${t}${window.PRIMARY_SEPARATOR}${filterToValue}`
|
|
4562
4859
|
);
|
|
4563
4860
|
}
|
|
4564
|
-
} else {
|
|
4565
|
-
metadataValues.push(`${prefix}${value}`);
|
|
4566
4861
|
}
|
|
4567
|
-
|
|
4568
|
-
|
|
4862
|
+
return result;
|
|
4863
|
+
case "lblFreeMetadata":
|
|
4864
|
+
if (filterToValue !== "") {
|
|
4865
|
+
freeMetadataValues.push(
|
|
4866
|
+
`${value}${window.PRIMARY_SEPARATOR}${filterToValue}`
|
|
4867
|
+
);
|
|
4868
|
+
}
|
|
4869
|
+
return result;
|
|
4569
4870
|
}
|
|
4570
4871
|
result[id] = multiplier ? value * multiplier : value;
|
|
4571
4872
|
if (filterToId !== void 0 && filterToValue != void 0) {
|
|
@@ -4575,7 +4876,8 @@ class MonDocQuery extends QueryController {
|
|
|
4575
4876
|
}, {});
|
|
4576
4877
|
return {
|
|
4577
4878
|
...filtersValues,
|
|
4578
|
-
strDocMetadata: metadataValues.join(";")
|
|
4879
|
+
strDocMetadata: metadataValues.join(";"),
|
|
4880
|
+
strDocFreeMetadata: freeMetadataValues.join(";")
|
|
4579
4881
|
};
|
|
4580
4882
|
}
|
|
4581
4883
|
getEventsHandlers() {
|
|
@@ -4607,7 +4909,9 @@ class MonDocQuery extends QueryController {
|
|
|
4607
4909
|
{
|
|
4608
4910
|
title: getLabel("lblLockedDocument").text,
|
|
4609
4911
|
icon: "Locked",
|
|
4610
|
-
sx: {
|
|
4912
|
+
sx: {
|
|
4913
|
+
display: r.docLock ? "block!important" : "none!important"
|
|
4914
|
+
}
|
|
4611
4915
|
}
|
|
4612
4916
|
),
|
|
4613
4917
|
tooltip: ""
|
|
@@ -4619,7 +4923,9 @@ class MonDocQuery extends QueryController {
|
|
|
4619
4923
|
title: getLabel("lblReadOnly").text,
|
|
4620
4924
|
icon: "Readonly",
|
|
4621
4925
|
size: 22,
|
|
4622
|
-
sx: {
|
|
4926
|
+
sx: {
|
|
4927
|
+
display: r.uneditableTR ? "block!important" : "none!important"
|
|
4928
|
+
}
|
|
4623
4929
|
}
|
|
4624
4930
|
),
|
|
4625
4931
|
tooltip: ""
|
|
@@ -4638,7 +4944,23 @@ class MonDocQuery extends QueryController {
|
|
|
4638
4944
|
return { children: c.content, className: c.classToAdd };
|
|
4639
4945
|
}
|
|
4640
4946
|
if ("elemType" in c) {
|
|
4641
|
-
return {
|
|
4947
|
+
return {
|
|
4948
|
+
children: /* @__PURE__ */ jsx(
|
|
4949
|
+
IconButton,
|
|
4950
|
+
{
|
|
4951
|
+
icon: "Download",
|
|
4952
|
+
onClick: () => {
|
|
4953
|
+
window.open(
|
|
4954
|
+
makeApiaUrl({
|
|
4955
|
+
ajaxUrl: this.ajaxUrl,
|
|
4956
|
+
action: "download",
|
|
4957
|
+
id: r.id
|
|
4958
|
+
})
|
|
4959
|
+
);
|
|
4960
|
+
}
|
|
4961
|
+
}
|
|
4962
|
+
)
|
|
4963
|
+
};
|
|
4642
4964
|
}
|
|
4643
4965
|
}
|
|
4644
4966
|
return { children: c };
|
|
@@ -4654,27 +4976,36 @@ class MonDocQuery extends QueryController {
|
|
|
4654
4976
|
const typedResponse = response;
|
|
4655
4977
|
const retrievedColumns = arrayOrArray(typedResponse.columns);
|
|
4656
4978
|
const retrievedFilters = arrayOrArray(typedResponse.filters);
|
|
4979
|
+
const columns = retrievedColumns.map((c) => {
|
|
4980
|
+
const column = {
|
|
4981
|
+
label: c.label,
|
|
4982
|
+
name: c.name,
|
|
4983
|
+
allowSorting: c.allowSorting,
|
|
4984
|
+
dataSortBy: c.dataSortBy,
|
|
4985
|
+
sort: c.sort,
|
|
4986
|
+
toolTip: c.toolTip,
|
|
4987
|
+
minWidth: c.name === "docFile" ? "50px" : "25%",
|
|
4988
|
+
width: c.name === "docFile" ? "50px" : "25%"
|
|
4989
|
+
};
|
|
4990
|
+
return column;
|
|
4991
|
+
});
|
|
4992
|
+
if (response.additionalInfoInTable) {
|
|
4993
|
+
columns?.push({
|
|
4994
|
+
showAsAdditional: true,
|
|
4995
|
+
label: "moreInfo",
|
|
4996
|
+
name: "moreInfo",
|
|
4997
|
+
Renderer: makeAsyncRenderer((row) => this.getAdditionalInfo(row))
|
|
4998
|
+
});
|
|
4999
|
+
}
|
|
4657
5000
|
const returnObject = {
|
|
4658
|
-
columns:
|
|
4659
|
-
const column = {
|
|
4660
|
-
label: c.label,
|
|
4661
|
-
name: c.name,
|
|
4662
|
-
allowSorting: c.allowSorting,
|
|
4663
|
-
dataSortBy: c.dataSortBy,
|
|
4664
|
-
sort: c.sort,
|
|
4665
|
-
toolTip: c.toolTip,
|
|
4666
|
-
minWidth: c.name === "docFile" ? "50px" : "25%",
|
|
4667
|
-
width: c.name === "docFile" ? "50px" : "25%"
|
|
4668
|
-
};
|
|
4669
|
-
return column;
|
|
4670
|
-
}).filter((c) => c !== null),
|
|
5001
|
+
columns: columns.filter((c) => c !== null),
|
|
4671
5002
|
filters: arrayOrArray(retrievedFilters).map((f) => {
|
|
4672
5003
|
const filter = {
|
|
4673
5004
|
id: f.id,
|
|
4674
5005
|
filterToId: f?.filterToId,
|
|
4675
5006
|
filterToValue: f?.filterToValue,
|
|
4676
5007
|
isAdditional: f.type === "date",
|
|
4677
|
-
value: f?.options?.
|
|
5008
|
+
value: f?.options?.find((c) => c.value === this.dynamicParams.docTypeSel)?.value ?? f.currentValue,
|
|
4678
5009
|
column: f.column,
|
|
4679
5010
|
title: f.title,
|
|
4680
5011
|
tooltip: f.toolTip,
|
|
@@ -4694,12 +5025,12 @@ class MonDocQuery extends QueryController {
|
|
|
4694
5025
|
return filter;
|
|
4695
5026
|
}),
|
|
4696
5027
|
description: "",
|
|
4697
|
-
hasAdditionalInformation:
|
|
4698
|
-
hideFilterTypes:
|
|
5028
|
+
hasAdditionalInformation: true,
|
|
5029
|
+
hideFilterTypes: true,
|
|
4699
5030
|
isDynamic: false,
|
|
4700
5031
|
openFiltersAutomatically: false,
|
|
4701
5032
|
runFiltersAutomatically: true,
|
|
4702
|
-
title:
|
|
5033
|
+
title: response.title,
|
|
4703
5034
|
queryData: { noExecFirstTime: true }
|
|
4704
5035
|
};
|
|
4705
5036
|
return returnObject;
|
|
@@ -4717,6 +5048,14 @@ class MonDocQuery extends QueryController {
|
|
|
4717
5048
|
class ApiaMonDocModal2 extends QueryModalController {
|
|
4718
5049
|
constructor() {
|
|
4719
5050
|
super(new MonDocQuery("/apia.execution.CustMonDocumentAction.run"));
|
|
5051
|
+
__publicField(this, "sx", {
|
|
5052
|
+
"tr.expired[class]": {
|
|
5053
|
+
color: "priorityUrgent",
|
|
5054
|
+
"&:hover": {
|
|
5055
|
+
color: "priorityUrgent"
|
|
5056
|
+
}
|
|
5057
|
+
}
|
|
5058
|
+
});
|
|
4720
5059
|
}
|
|
4721
5060
|
openModal(properties) {
|
|
4722
5061
|
this.queryController.setDynamicParams(
|