@apia/api 4.0.16 → 4.0.17
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.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 } from 'react';
|
|
4
|
-
import { Box, Label, spacing, getVariant,
|
|
4
|
+
import { Box, Label, spacing, getVariant, Input as Input$1, Select as Select$1 } from '@apia/theme';
|
|
5
5
|
import { debugDispatcher, parseXmlAsync, EventEmitter, arrayOrArray, useMount, encrypt, noNaN, getIndex, getLabel, StatefulEmitter, focus, focusSelector, useLatest } 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';
|
|
@@ -11,10 +11,11 @@ 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,
|
|
14
|
+
import { ResponsiveTableContext, ResponsiveTable, Pagination, Sort, Responsive, Additional, responsiveTableStore, useResponsiveTableContext, getResponsiveTableContext, makeController2, responsiveTableActions, TableContextReproducer } from '@apia/table';
|
|
15
15
|
import { makeObservable, observable, reaction, action, toJS } from 'mobx';
|
|
16
16
|
import { observer } from 'mobx-react-lite';
|
|
17
17
|
import { throttle } from 'lodash-es';
|
|
18
|
+
import { Icon } from '@apia/icons';
|
|
18
19
|
|
|
19
20
|
const ApiaApiId = createContext("apiaApi");
|
|
20
21
|
const ApiaApiContext = ({
|
|
@@ -474,7 +475,6 @@ function makeApiaUrl(props) {
|
|
|
474
475
|
function getModal$1(name) {
|
|
475
476
|
return window[name];
|
|
476
477
|
}
|
|
477
|
-
var ApiaApi$1 = ApiaApi;
|
|
478
478
|
|
|
479
479
|
const ApiaApiCheckbox = (props) => {
|
|
480
480
|
const element = React__default.useMemo(() => props.element, [props.element]);
|
|
@@ -822,7 +822,7 @@ const defaultFetcher = {
|
|
|
822
822
|
(filters ?? []).forEach((currentFilter) => {
|
|
823
823
|
filterValues[currentFilter.id] = currentFilter.currentValue;
|
|
824
824
|
});
|
|
825
|
-
const result = await ApiaApi
|
|
825
|
+
const result = await ApiaApi.post(
|
|
826
826
|
makeApiaUrl({
|
|
827
827
|
react: true,
|
|
828
828
|
action: "filter",
|
|
@@ -840,7 +840,7 @@ const defaultFetcher = {
|
|
|
840
840
|
return parseResult(result?.data);
|
|
841
841
|
},
|
|
842
842
|
async page({ page, path, requestConfig }) {
|
|
843
|
-
const result = await ApiaApi
|
|
843
|
+
const result = await ApiaApi.post(
|
|
844
844
|
makeApiaUrl({
|
|
845
845
|
react: true,
|
|
846
846
|
action: "page",
|
|
@@ -856,7 +856,7 @@ const defaultFetcher = {
|
|
|
856
856
|
return parseResult(result?.data);
|
|
857
857
|
},
|
|
858
858
|
async refresh({ path, requestConfig }) {
|
|
859
|
-
const result = await ApiaApi
|
|
859
|
+
const result = await ApiaApi.post(
|
|
860
860
|
makeApiaUrl({
|
|
861
861
|
react: true,
|
|
862
862
|
action: "refresh",
|
|
@@ -871,7 +871,7 @@ const defaultFetcher = {
|
|
|
871
871
|
return parseResult(result?.data);
|
|
872
872
|
},
|
|
873
873
|
async sort({ path, requestConfig, sort }) {
|
|
874
|
-
const result = await ApiaApi
|
|
874
|
+
const result = await ApiaApi.post(
|
|
875
875
|
makeApiaUrl({
|
|
876
876
|
react: true,
|
|
877
877
|
action: "sort",
|
|
@@ -2809,7 +2809,7 @@ const NonMemoizedApiaApiButtonsContainer = (props) => {
|
|
|
2809
2809
|
...current,
|
|
2810
2810
|
isLoading: true
|
|
2811
2811
|
}));
|
|
2812
|
-
void ApiaApi
|
|
2812
|
+
void ApiaApi.post(url, {
|
|
2813
2813
|
postData: props.state.isMultipart ? formData : QueryString.stringify(
|
|
2814
2814
|
[...formData.entries(), ["isAjax", true]].reduce((accumulated, [name, value]) => {
|
|
2815
2815
|
const retValue = { ...accumulated };
|
|
@@ -3223,6 +3223,93 @@ const ApiaApiHandlerNonMemoized = () => {
|
|
|
3223
3223
|
};
|
|
3224
3224
|
const ApiaApiHandler = React.memo(ApiaApiHandlerNonMemoized);
|
|
3225
3225
|
|
|
3226
|
+
const units = ["B", "KB", "MB", "GB"];
|
|
3227
|
+
const RangeFilterRenderer = observer(
|
|
3228
|
+
({ filter, state }) => {
|
|
3229
|
+
const { onFilterBlur, onFilterPressEnter, onFilterChange } = useResponsiveTableContext();
|
|
3230
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 2, alignItems: "center" }, children: [
|
|
3231
|
+
/* @__PURE__ */ jsx(
|
|
3232
|
+
Input$1,
|
|
3233
|
+
{
|
|
3234
|
+
id: "range-filter-from",
|
|
3235
|
+
value: state.value,
|
|
3236
|
+
onChange: (ev) => {
|
|
3237
|
+
state.value = ev.target.value;
|
|
3238
|
+
onFilterChange?.(filter);
|
|
3239
|
+
},
|
|
3240
|
+
onKeyDown: (ev) => {
|
|
3241
|
+
if (ev.code === "Enter") {
|
|
3242
|
+
onFilterPressEnter?.(filter);
|
|
3243
|
+
}
|
|
3244
|
+
},
|
|
3245
|
+
onBlur: () => {
|
|
3246
|
+
onFilterBlur?.(filter);
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
),
|
|
3250
|
+
"-",
|
|
3251
|
+
/* @__PURE__ */ jsx(
|
|
3252
|
+
Input$1,
|
|
3253
|
+
{
|
|
3254
|
+
tabIndex: 0,
|
|
3255
|
+
id: "range-filter-to",
|
|
3256
|
+
value: state.valueTo || "",
|
|
3257
|
+
onChange: (e) => state.valueTo = e.target.value
|
|
3258
|
+
}
|
|
3259
|
+
),
|
|
3260
|
+
/* @__PURE__ */ jsx(
|
|
3261
|
+
Select$1,
|
|
3262
|
+
{
|
|
3263
|
+
onChange: (ev) => {
|
|
3264
|
+
},
|
|
3265
|
+
value: units[Math.log(1) / 10],
|
|
3266
|
+
children: units.map((c) => /* @__PURE__ */ jsx("option", { value: c, children: c }, c))
|
|
3267
|
+
}
|
|
3268
|
+
)
|
|
3269
|
+
] });
|
|
3270
|
+
}
|
|
3271
|
+
);
|
|
3272
|
+
|
|
3273
|
+
const SelectFilterRenderer = observer(
|
|
3274
|
+
({ filter, state }) => {
|
|
3275
|
+
const { onFilterChange } = useResponsiveTableContext();
|
|
3276
|
+
return /* @__PURE__ */ jsx(
|
|
3277
|
+
Select$1,
|
|
3278
|
+
{
|
|
3279
|
+
value: state.value,
|
|
3280
|
+
onChange: (ev) => {
|
|
3281
|
+
state.value = ev.target.value;
|
|
3282
|
+
onFilterChange?.(filter);
|
|
3283
|
+
},
|
|
3284
|
+
children: arrayOrArray(filter.options).map((c) => /* @__PURE__ */ jsx("option", { value: c.value, children: c.label }, c.value))
|
|
3285
|
+
}
|
|
3286
|
+
);
|
|
3287
|
+
}
|
|
3288
|
+
);
|
|
3289
|
+
|
|
3290
|
+
const InputFilterRenderer = observer(
|
|
3291
|
+
({ filter, state }) => {
|
|
3292
|
+
const { onFilterBlur, onFilterPressEnter } = useResponsiveTableContext();
|
|
3293
|
+
return /* @__PURE__ */ jsx(
|
|
3294
|
+
Input$1,
|
|
3295
|
+
{
|
|
3296
|
+
value: state.value,
|
|
3297
|
+
onChange: (ev) => {
|
|
3298
|
+
state.value = ev.target.value;
|
|
3299
|
+
},
|
|
3300
|
+
onKeyDown: (ev) => {
|
|
3301
|
+
if (ev.code === "Enter") {
|
|
3302
|
+
onFilterPressEnter?.(filter);
|
|
3303
|
+
}
|
|
3304
|
+
},
|
|
3305
|
+
onBlur: () => {
|
|
3306
|
+
onFilterBlur?.(filter);
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3309
|
+
);
|
|
3310
|
+
}
|
|
3311
|
+
);
|
|
3312
|
+
|
|
3226
3313
|
var __defProp$7 = Object.defineProperty;
|
|
3227
3314
|
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3228
3315
|
var __publicField$7 = (obj, key, value) => {
|
|
@@ -3237,50 +3324,15 @@ class Filter {
|
|
|
3237
3324
|
value: ""
|
|
3238
3325
|
});
|
|
3239
3326
|
__publicField$7(this, "Component", observer(({ filter }) => {
|
|
3240
|
-
const {
|
|
3327
|
+
const { name } = useResponsiveTableContext();
|
|
3241
3328
|
this.tableName = name;
|
|
3242
|
-
if (this.filterState
|
|
3243
|
-
return
|
|
3244
|
-
RangeFilter,
|
|
3245
|
-
{
|
|
3246
|
-
filter: {
|
|
3247
|
-
...filter,
|
|
3248
|
-
currentValue: this.filterState.value,
|
|
3249
|
-
isSize: this.filterState.isSize
|
|
3250
|
-
}
|
|
3251
|
-
}
|
|
3252
|
-
);
|
|
3329
|
+
if (this.filterState.isRange) {
|
|
3330
|
+
return this.getRangeRenderer({ filter });
|
|
3253
3331
|
}
|
|
3254
|
-
if (
|
|
3255
|
-
return
|
|
3256
|
-
Select$1,
|
|
3257
|
-
{
|
|
3258
|
-
value: this.filterState.value,
|
|
3259
|
-
onChange: (ev) => {
|
|
3260
|
-
this.filterState.value = ev.target.value;
|
|
3261
|
-
onFilterChange?.(filter);
|
|
3262
|
-
},
|
|
3263
|
-
children: filter.options.map((c) => /* @__PURE__ */ jsx("option", { value: c.value, children: c.label }, c.value))
|
|
3264
|
-
}
|
|
3265
|
-
);
|
|
3332
|
+
if (this.filterState.options) {
|
|
3333
|
+
return this.getSelectRenderer({ filter });
|
|
3266
3334
|
}
|
|
3267
|
-
return
|
|
3268
|
-
Input$1,
|
|
3269
|
-
{
|
|
3270
|
-
value: this.filterState.value,
|
|
3271
|
-
onChange: (ev) => {
|
|
3272
|
-
this.filterState.value = ev.target.value;
|
|
3273
|
-
},
|
|
3274
|
-
onKeyDown: (ev) => {
|
|
3275
|
-
if (ev.code === "Enter") {
|
|
3276
|
-
onFilterPressEnter?.(filter);
|
|
3277
|
-
}
|
|
3278
|
-
},
|
|
3279
|
-
onBlur: () => {
|
|
3280
|
-
onFilterBlur?.(filter);
|
|
3281
|
-
}
|
|
3282
|
-
}
|
|
3283
|
-
);
|
|
3335
|
+
return this.getInputRenderer({ filter });
|
|
3284
3336
|
}));
|
|
3285
3337
|
Object.assign(this.filterState, properties);
|
|
3286
3338
|
makeObservable(this, { filterState: observable });
|
|
@@ -3298,6 +3350,15 @@ class Filter {
|
|
|
3298
3350
|
}
|
|
3299
3351
|
focus() {
|
|
3300
3352
|
}
|
|
3353
|
+
getInputRenderer({ filter }) {
|
|
3354
|
+
return /* @__PURE__ */ jsx(InputFilterRenderer, { filter, state: this.filterState });
|
|
3355
|
+
}
|
|
3356
|
+
getSelectRenderer({ filter }) {
|
|
3357
|
+
return /* @__PURE__ */ jsx(SelectFilterRenderer, { filter, state: this.filterState });
|
|
3358
|
+
}
|
|
3359
|
+
getRangeRenderer({ filter }) {
|
|
3360
|
+
return /* @__PURE__ */ jsx(RangeFilterRenderer, { filter, state: this.filterState });
|
|
3361
|
+
}
|
|
3301
3362
|
}
|
|
3302
3363
|
|
|
3303
3364
|
const FilterTypesComponent = observer(
|
|
@@ -3345,7 +3406,7 @@ class FilterTypes {
|
|
|
3345
3406
|
});
|
|
3346
3407
|
}
|
|
3347
3408
|
async getFilterTypes() {
|
|
3348
|
-
const result = await ApiaApi
|
|
3409
|
+
const result = await ApiaApi.post(
|
|
3349
3410
|
makeApiaUrl({
|
|
3350
3411
|
ajaxUrl: "apia.query.ModalAction.run?",
|
|
3351
3412
|
action: "filterOptions"
|
|
@@ -3359,7 +3420,7 @@ class FilterTypes {
|
|
|
3359
3420
|
await this.getFilterTypes();
|
|
3360
3421
|
}
|
|
3361
3422
|
async setFilterOptions() {
|
|
3362
|
-
const result = await ApiaApi
|
|
3423
|
+
const result = await ApiaApi.post(
|
|
3363
3424
|
makeApiaUrl({
|
|
3364
3425
|
ajaxUrl: "apia.query.ModalAction.run?",
|
|
3365
3426
|
action: "setFilterOptions"
|
|
@@ -3497,7 +3558,9 @@ class TableController {
|
|
|
3497
3558
|
id: c.filterState.id,
|
|
3498
3559
|
column: c.filterState.column,
|
|
3499
3560
|
asAdditional: c.filterState.isAdditional || this.state.columns.get(c.filterState.column || "")?.hidden,
|
|
3500
|
-
options: c.filterState.options
|
|
3561
|
+
options: c.filterState.options,
|
|
3562
|
+
detectOnChange: c.filterState.runAutomatically,
|
|
3563
|
+
runAutomatically: c.filterState.runAutomatically
|
|
3501
3564
|
};
|
|
3502
3565
|
});
|
|
3503
3566
|
}
|
|
@@ -3528,7 +3591,7 @@ class QueryController {
|
|
|
3528
3591
|
__publicField$4(this, "hasInited", false);
|
|
3529
3592
|
__publicField$4(this, "initializing", false);
|
|
3530
3593
|
__publicField$4(this, "structure", null);
|
|
3531
|
-
__publicField$4(this, "tableController"
|
|
3594
|
+
__publicField$4(this, "tableController");
|
|
3532
3595
|
/**
|
|
3533
3596
|
* Allows to throttle calls to actual refresh method.
|
|
3534
3597
|
*/
|
|
@@ -3539,29 +3602,46 @@ class QueryController {
|
|
|
3539
3602
|
300,
|
|
3540
3603
|
{ leading: false, trailing: true }
|
|
3541
3604
|
));
|
|
3605
|
+
this.tableController = this.buildTableController();
|
|
3542
3606
|
this.initEvents();
|
|
3543
3607
|
}
|
|
3608
|
+
getTableControllerDefaultProps() {
|
|
3609
|
+
return {};
|
|
3610
|
+
}
|
|
3611
|
+
getEventsHandlers() {
|
|
3612
|
+
return {
|
|
3613
|
+
onChangeSelection: (ev) => {
|
|
3614
|
+
},
|
|
3615
|
+
onFilterBlur: (_ev) => {
|
|
3616
|
+
},
|
|
3617
|
+
onFilterChange: (_ev) => {
|
|
3618
|
+
const filter = this.tableController.state.filters.get(_ev.id);
|
|
3619
|
+
if (filter?.filterState.runAutomatically) {
|
|
3620
|
+
this.refresh(false);
|
|
3621
|
+
}
|
|
3622
|
+
},
|
|
3623
|
+
onFilterPressEnter: (_ev) => {
|
|
3624
|
+
this.refresh(true);
|
|
3625
|
+
},
|
|
3626
|
+
onRowClick: (_ev) => {
|
|
3627
|
+
},
|
|
3628
|
+
onSelectRows: (_ev) => {
|
|
3629
|
+
},
|
|
3630
|
+
onSortChange: (ev) => {
|
|
3631
|
+
this.sort(String(ev.columnIndex));
|
|
3632
|
+
},
|
|
3633
|
+
onPage: this.page.bind(this),
|
|
3634
|
+
onRefresh: () => this.refresh(true)
|
|
3635
|
+
};
|
|
3636
|
+
}
|
|
3637
|
+
buildTableController() {
|
|
3638
|
+
return new TableController();
|
|
3639
|
+
}
|
|
3544
3640
|
initEvents() {
|
|
3545
|
-
this.
|
|
3546
|
-
|
|
3547
|
-
|
|
3548
|
-
});
|
|
3549
|
-
this.tableController.on("onFilterChange", (ev) => {
|
|
3550
|
-
const filter = this.tableController.state.filters.get(ev.id);
|
|
3551
|
-
if (filter?.filterState.runAutomatically) {
|
|
3552
|
-
this.refresh(false);
|
|
3553
|
-
}
|
|
3554
|
-
});
|
|
3555
|
-
this.tableController.on("onFilterPressEnter", () => this.refresh(true));
|
|
3556
|
-
this.tableController.on("onRowClick", (ev) => {
|
|
3557
|
-
});
|
|
3558
|
-
this.tableController.on("onSelectRows", (ev) => {
|
|
3559
|
-
});
|
|
3560
|
-
this.tableController.on("onSortChange", (ev) => {
|
|
3561
|
-
this.sort(ev.column.name);
|
|
3641
|
+
const handlers = this.getEventsHandlers();
|
|
3642
|
+
Object.entries(handlers).forEach(([eventName, handler]) => {
|
|
3643
|
+
this.tableController.on(eventName, handler.bind(this));
|
|
3562
3644
|
});
|
|
3563
|
-
this.tableController.on("onPage", this.page.bind(this));
|
|
3564
|
-
this.tableController.on("onRefresh", () => this.refresh(true));
|
|
3565
3645
|
}
|
|
3566
3646
|
getLoadStructureParameters() {
|
|
3567
3647
|
return {
|
|
@@ -3579,7 +3659,14 @@ class QueryController {
|
|
|
3579
3659
|
};
|
|
3580
3660
|
}
|
|
3581
3661
|
getFiltersValuesMap() {
|
|
3582
|
-
return [...this.tableController.state.filters.values()].reduce((
|
|
3662
|
+
return [...this.tableController.state.filters.values()].reduce((result, filterWrapper) => {
|
|
3663
|
+
const { id, value, filterToId, valueTo } = filterWrapper.filterState;
|
|
3664
|
+
result[id] = value;
|
|
3665
|
+
if (filterToId !== void 0 && valueTo !== void 0) {
|
|
3666
|
+
result[filterToId] = valueTo;
|
|
3667
|
+
}
|
|
3668
|
+
return result;
|
|
3669
|
+
}, {});
|
|
3583
3670
|
}
|
|
3584
3671
|
getPageParameters() {
|
|
3585
3672
|
return {
|
|
@@ -3629,6 +3716,8 @@ class QueryController {
|
|
|
3629
3716
|
id: `filter${String(i + 1)}`,
|
|
3630
3717
|
// Id generado en APIA
|
|
3631
3718
|
value: f.currentValue,
|
|
3719
|
+
filterToId: f?.filterToId,
|
|
3720
|
+
valueTo: f?.filterToValue,
|
|
3632
3721
|
avoidLabel: false,
|
|
3633
3722
|
column: f.column,
|
|
3634
3723
|
isAdditional: f.asAdditional,
|
|
@@ -3680,7 +3769,7 @@ class QueryController {
|
|
|
3680
3769
|
]);
|
|
3681
3770
|
}
|
|
3682
3771
|
async getStructure() {
|
|
3683
|
-
const result = await ApiaApi
|
|
3772
|
+
const result = await ApiaApi.post(
|
|
3684
3773
|
makeApiaUrl(this.getLoadStructureParameters())
|
|
3685
3774
|
);
|
|
3686
3775
|
if (!result?.data) {
|
|
@@ -3693,9 +3782,14 @@ class QueryController {
|
|
|
3693
3782
|
arrayOrArray(structure.columns).map((c) => [c.name, c])
|
|
3694
3783
|
);
|
|
3695
3784
|
const filters = new Map(
|
|
3696
|
-
arrayOrArray(structure.filters).map((f) =>
|
|
3785
|
+
arrayOrArray(structure.filters).map((f) => {
|
|
3786
|
+
return [f.id, new Filter(f)];
|
|
3787
|
+
})
|
|
3697
3788
|
);
|
|
3698
|
-
this.tableController.updateState({
|
|
3789
|
+
this.tableController.updateState({
|
|
3790
|
+
columns,
|
|
3791
|
+
filters
|
|
3792
|
+
});
|
|
3699
3793
|
}
|
|
3700
3794
|
updatePageState(pageInfo) {
|
|
3701
3795
|
const currentPage = Number(pageInfo?.currentPage ?? 0);
|
|
@@ -3709,7 +3803,7 @@ class QueryController {
|
|
|
3709
3803
|
this.tableController.state.rows = rows;
|
|
3710
3804
|
}
|
|
3711
3805
|
async clearFilters() {
|
|
3712
|
-
const result = await ApiaApi
|
|
3806
|
+
const result = await ApiaApi.post(
|
|
3713
3807
|
makeApiaUrl({ ...this.getClearFiltersParameters() })
|
|
3714
3808
|
);
|
|
3715
3809
|
if (!result?.data)
|
|
@@ -3726,12 +3820,15 @@ class QueryController {
|
|
|
3726
3820
|
if (!this.hasInited) {
|
|
3727
3821
|
this.structure = await this.getStructure();
|
|
3728
3822
|
this.parseStructure(this.structure);
|
|
3823
|
+
this.tableController.updateState({
|
|
3824
|
+
props: this.getTableControllerDefaultProps()
|
|
3825
|
+
});
|
|
3729
3826
|
this.hasInited = true;
|
|
3730
3827
|
this.initializing = false;
|
|
3731
3828
|
}
|
|
3732
3829
|
}
|
|
3733
3830
|
async page(num) {
|
|
3734
|
-
const page = await ApiaApi
|
|
3831
|
+
const page = await ApiaApi.post(
|
|
3735
3832
|
makeApiaUrl({ ...this.getPageParameters(), pageNumber: num })
|
|
3736
3833
|
);
|
|
3737
3834
|
this.parseRefreshResponse(page?.data);
|
|
@@ -3743,7 +3840,7 @@ class QueryController {
|
|
|
3743
3840
|
}
|
|
3744
3841
|
async actualRefreshMethod() {
|
|
3745
3842
|
if (!this.areRequiredFilters()) {
|
|
3746
|
-
const refresh = await ApiaApi
|
|
3843
|
+
const refresh = await ApiaApi.post(
|
|
3747
3844
|
makeApiaUrl(this.getRefreshParameters()),
|
|
3748
3845
|
{
|
|
3749
3846
|
postData: this.getFiltersValuesMap(),
|
|
@@ -3758,7 +3855,7 @@ class QueryController {
|
|
|
3758
3855
|
return now ? this.actualRefreshMethod() : this.executeRefresh();
|
|
3759
3856
|
}
|
|
3760
3857
|
async sort(column) {
|
|
3761
|
-
const result = await ApiaApi
|
|
3858
|
+
const result = await ApiaApi.post(
|
|
3762
3859
|
makeApiaUrl({ ...this.getSortParameters(), orderBy: column })
|
|
3763
3860
|
);
|
|
3764
3861
|
if (result?.data) {
|
|
@@ -3827,7 +3924,7 @@ const AdditionalFiltersComponent = ({
|
|
|
3827
3924
|
var __defProp$3 = Object.defineProperty;
|
|
3828
3925
|
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3829
3926
|
var __publicField$3 = (obj, key, value) => {
|
|
3830
|
-
__defNormalProp$3(obj,
|
|
3927
|
+
__defNormalProp$3(obj, key + "" , value);
|
|
3831
3928
|
return value;
|
|
3832
3929
|
};
|
|
3833
3930
|
class AdditionalFiltersModal {
|
|
@@ -3929,7 +4026,7 @@ class QueryModalController {
|
|
|
3929
4026
|
] }),
|
|
3930
4027
|
title: structure?.title,
|
|
3931
4028
|
onConfirm: () => {
|
|
3932
|
-
this.
|
|
4029
|
+
this.onConfirm();
|
|
3933
4030
|
},
|
|
3934
4031
|
onCancel: () => {
|
|
3935
4032
|
this.additionalFiltersController.closeModal();
|
|
@@ -3986,6 +4083,15 @@ class QueryModalController {
|
|
|
3986
4083
|
...this.getModalDefinition(),
|
|
3987
4084
|
...properties
|
|
3988
4085
|
});
|
|
4086
|
+
return this.onConfirmResolve();
|
|
4087
|
+
}
|
|
4088
|
+
getModalHandler() {
|
|
4089
|
+
return this.modalHandler;
|
|
4090
|
+
}
|
|
4091
|
+
onConfirm() {
|
|
4092
|
+
this.emitter.emit("onSelectRows", this.currentSelection || []);
|
|
4093
|
+
}
|
|
4094
|
+
onConfirmResolve() {
|
|
3989
4095
|
return new Promise((resolve) => {
|
|
3990
4096
|
let uns1 = () => {
|
|
3991
4097
|
}, uns2 = () => {
|
|
@@ -4002,15 +4108,12 @@ class QueryModalController {
|
|
|
4002
4108
|
});
|
|
4003
4109
|
});
|
|
4004
4110
|
}
|
|
4005
|
-
getModalHandler() {
|
|
4006
|
-
return this.modalHandler;
|
|
4007
|
-
}
|
|
4008
4111
|
}
|
|
4009
4112
|
|
|
4010
4113
|
var __defProp$1 = Object.defineProperty;
|
|
4011
4114
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4012
4115
|
var __publicField$1 = (obj, key, value) => {
|
|
4013
|
-
__defNormalProp$1(obj,
|
|
4116
|
+
__defNormalProp$1(obj, key + "" , value);
|
|
4014
4117
|
return value;
|
|
4015
4118
|
};
|
|
4016
4119
|
class GenericListQuery extends QueryController {
|
|
@@ -4044,7 +4147,7 @@ class GenericListQuery extends QueryController {
|
|
|
4044
4147
|
return {};
|
|
4045
4148
|
}
|
|
4046
4149
|
async filter() {
|
|
4047
|
-
const filterResult = await ApiaApi
|
|
4150
|
+
const filterResult = await ApiaApi.post(
|
|
4048
4151
|
makeApiaUrl(this.getFilterParameters()),
|
|
4049
4152
|
{
|
|
4050
4153
|
postData: {
|
|
@@ -4120,7 +4223,7 @@ class GenericListQuery extends QueryController {
|
|
|
4120
4223
|
await this.filter();
|
|
4121
4224
|
}
|
|
4122
4225
|
async sort(column) {
|
|
4123
|
-
const result = await ApiaApi
|
|
4226
|
+
const result = await ApiaApi.post(
|
|
4124
4227
|
makeApiaUrl({ ...this.getSortParameters(), orderBy: column })
|
|
4125
4228
|
);
|
|
4126
4229
|
if (result?.data) {
|
|
@@ -4134,17 +4237,15 @@ class GenericListQuery extends QueryController {
|
|
|
4134
4237
|
const ApiaUsersModal2 = new QueryModalController(
|
|
4135
4238
|
new GenericListQuery("apia.modals.UsersAction.run")
|
|
4136
4239
|
);
|
|
4137
|
-
var ApiaUsersModal2$1 = ApiaUsersModal2;
|
|
4138
4240
|
|
|
4139
4241
|
const ApiaPoolsModals2 = new QueryModalController(
|
|
4140
4242
|
new GenericListQuery("apia.modals.PoolsAction.run")
|
|
4141
4243
|
);
|
|
4142
|
-
var ApiaPoolsModals2$1 = ApiaPoolsModals2;
|
|
4143
4244
|
|
|
4144
4245
|
var __defProp = Object.defineProperty;
|
|
4145
4246
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4146
4247
|
var __publicField = (obj, key, value) => {
|
|
4147
|
-
__defNormalProp(obj,
|
|
4248
|
+
__defNormalProp(obj, key + "" , value);
|
|
4148
4249
|
return value;
|
|
4149
4250
|
};
|
|
4150
4251
|
class MonDocQuery extends QueryController {
|
|
@@ -4153,17 +4254,26 @@ class MonDocQuery extends QueryController {
|
|
|
4153
4254
|
this.ajaxUrl = ajaxUrl;
|
|
4154
4255
|
__publicField(this, "dynamicParams", {});
|
|
4155
4256
|
}
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4257
|
+
getTableControllerDefaultProps() {
|
|
4258
|
+
return {
|
|
4259
|
+
...super.getTableControllerDefaultProps(),
|
|
4260
|
+
isMultiple: false,
|
|
4261
|
+
reserveColumnsForStates: 2,
|
|
4262
|
+
statesColumns: [
|
|
4263
|
+
{
|
|
4264
|
+
Icon: () => /* @__PURE__ */ jsx(Icon, { icon: "Locked", title: "" }),
|
|
4265
|
+
tooltip: getLabel("titDocLock").text
|
|
4266
|
+
},
|
|
4267
|
+
{
|
|
4268
|
+
Icon: () => /* @__PURE__ */ jsx(Icon, { icon: "Readonly", title: "", size: 22 }),
|
|
4269
|
+
tooltip: getLabel("lblReadOnly").text
|
|
4270
|
+
}
|
|
4271
|
+
]
|
|
4272
|
+
};
|
|
4273
|
+
}
|
|
4274
|
+
processFilterChangeEvent(ev) {
|
|
4275
|
+
this.tableController.state.filters.get(ev.id);
|
|
4276
|
+
this.filter();
|
|
4167
4277
|
}
|
|
4168
4278
|
getLoadStructureParameters() {
|
|
4169
4279
|
return {
|
|
@@ -4194,8 +4304,16 @@ class MonDocQuery extends QueryController {
|
|
|
4194
4304
|
isAjax: true
|
|
4195
4305
|
};
|
|
4196
4306
|
}
|
|
4307
|
+
getEventsHandlers() {
|
|
4308
|
+
return {
|
|
4309
|
+
...super.getEventsHandlers(),
|
|
4310
|
+
onFilterChange: () => {
|
|
4311
|
+
this.filter();
|
|
4312
|
+
}
|
|
4313
|
+
};
|
|
4314
|
+
}
|
|
4197
4315
|
async filter() {
|
|
4198
|
-
const filterResult = await ApiaApi
|
|
4316
|
+
const filterResult = await ApiaApi.post(
|
|
4199
4317
|
makeApiaUrl(this.getFilterParameters()),
|
|
4200
4318
|
{
|
|
4201
4319
|
postData: {
|
|
@@ -4207,8 +4325,6 @@ class MonDocQuery extends QueryController {
|
|
|
4207
4325
|
);
|
|
4208
4326
|
if (!filterResult?.data)
|
|
4209
4327
|
return;
|
|
4210
|
-
const structure = this.parseLoadStructureResponse(filterResult.data);
|
|
4211
|
-
this.parseStructure(structure);
|
|
4212
4328
|
setTimeout(() => {
|
|
4213
4329
|
this.parseRefreshResponse(filterResult.data);
|
|
4214
4330
|
}, 200);
|
|
@@ -4222,7 +4338,6 @@ class MonDocQuery extends QueryController {
|
|
|
4222
4338
|
(r) => ({
|
|
4223
4339
|
rowProps: r,
|
|
4224
4340
|
cells: [
|
|
4225
|
-
{},
|
|
4226
4341
|
...arrayOrArray(r.cell).map((c) => {
|
|
4227
4342
|
if (typeof c === "string") {
|
|
4228
4343
|
return { children: c };
|
|
@@ -4249,21 +4364,25 @@ class MonDocQuery extends QueryController {
|
|
|
4249
4364
|
const retrievedFilters = arrayOrArray(typedResponse.filters);
|
|
4250
4365
|
const returnObject = {
|
|
4251
4366
|
columns: retrievedColumns.map((c) => {
|
|
4367
|
+
if (c.name === "docFile")
|
|
4368
|
+
return null;
|
|
4252
4369
|
const column = {
|
|
4253
4370
|
label: c.label,
|
|
4254
4371
|
name: c.name,
|
|
4255
4372
|
allowSorting: c.allowSorting,
|
|
4256
4373
|
dataSortBy: c.dataSortBy,
|
|
4257
|
-
minWidth:
|
|
4374
|
+
minWidth: "25%",
|
|
4258
4375
|
sort: c.sort,
|
|
4259
4376
|
toolTip: c.toolTip,
|
|
4260
|
-
width:
|
|
4377
|
+
width: "25%"
|
|
4261
4378
|
};
|
|
4262
4379
|
return column;
|
|
4263
|
-
}),
|
|
4264
|
-
filters: arrayOrArray(retrievedFilters).map((f
|
|
4380
|
+
}).filter((c) => c !== null),
|
|
4381
|
+
filters: arrayOrArray(retrievedFilters).map((f) => {
|
|
4265
4382
|
const filter = {
|
|
4266
|
-
id:
|
|
4383
|
+
id: f.id,
|
|
4384
|
+
filterToId: f?.filterToId,
|
|
4385
|
+
valueTo: f?.filterToValue,
|
|
4267
4386
|
value: f.currentValue,
|
|
4268
4387
|
avoidLabel: false,
|
|
4269
4388
|
column: f.column,
|
|
@@ -4289,18 +4408,17 @@ class MonDocQuery extends QueryController {
|
|
|
4289
4408
|
hideFilterTypes: false,
|
|
4290
4409
|
isDynamic: false,
|
|
4291
4410
|
openFiltersAutomatically: false,
|
|
4292
|
-
runFiltersAutomatically:
|
|
4411
|
+
runFiltersAutomatically: true,
|
|
4293
4412
|
title: ""
|
|
4294
4413
|
};
|
|
4295
4414
|
return returnObject;
|
|
4296
4415
|
}
|
|
4297
4416
|
async sort(column) {
|
|
4298
|
-
const result = await ApiaApi
|
|
4417
|
+
const result = await ApiaApi.post(
|
|
4299
4418
|
makeApiaUrl({ ...this.getSortParameters(), orderBy: column })
|
|
4300
4419
|
);
|
|
4301
4420
|
if (result?.data) {
|
|
4302
|
-
|
|
4303
|
-
this.parseStructure(structure);
|
|
4421
|
+
this.parseRefreshResponse(result.data);
|
|
4304
4422
|
}
|
|
4305
4423
|
return super.refresh();
|
|
4306
4424
|
}
|
|
@@ -4318,5 +4436,5 @@ class ApiaMonDocModal extends QueryModalController {
|
|
|
4318
4436
|
}
|
|
4319
4437
|
const ApiaMonDocModal2 = new ApiaMonDocModal();
|
|
4320
4438
|
|
|
4321
|
-
export { ApiaApi
|
|
4439
|
+
export { ApiaApi, ApiaApiHandler, ApiaMonDocModal2, ApiaPoolsModals2, ApiaUsersModal2, QueryController, QueryModalController, getFunction, getModal, isHtmlResponse, isXmlResponse, makeApiaUrl, parseSuccessfulResponse };
|
|
4322
4440
|
//# sourceMappingURL=index.js.map
|