@sankhyalabs/sankhyablocks 8.6.0 → 8.8.0-dev.1
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/cjs/{ConfigStorage-bbffce76.js → ConfigStorage-a97ca159.js} +2 -2
- package/dist/cjs/{DataFetcher-0cc561bc.js → DataFetcher-2a99283c.js} +25 -10
- package/dist/cjs/{SnkFormConfigManager-c49af777.js → SnkFormConfigManager-f641f502.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-804ff4c7.js → SnkMultiSelectionListDataSource-56db34ee.js} +11 -0
- package/dist/cjs/{auth-fetcher-fff2319e.js → auth-fetcher-78231356.js} +1 -1
- package/dist/cjs/dataunit-fetcher-4f7d4ee7.js +878 -0
- package/dist/cjs/{form-config-fetcher-35752aad.js → form-config-fetcher-a322a522.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-415eab63.js → pesquisa-fetcher-7ef61508.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/snk-application.cjs.entry.js +17 -8
- package/dist/cjs/snk-attach.cjs.entry.js +16 -3
- package/dist/cjs/snk-crud.cjs.entry.js +6 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -6
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +25 -14
- package/dist/cjs/{snk-guides-viewer-36b39c9c.js → snk-guides-viewer-aab80f66.js} +5 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +19 -9
- package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -92
- package/dist/collection/components/snk-application/snk-application.js +11 -3
- package/dist/collection/components/snk-attach/snk-attach.js +14 -2
- package/dist/collection/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.js +11 -0
- package/dist/collection/components/snk-grid/snk-grid.js +24 -14
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +16 -6
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +25 -10
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +113 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.js +59 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +169 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/{dataunit-fetcher.js → data-unit/dataunit-fetcher.js} +48 -100
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.js +68 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +131 -0
- package/dist/collection/lib/index.js +1 -1
- package/dist/components/DataFetcher.js +26 -11
- package/dist/components/SnkMultiSelectionListDataSource.js +11 -0
- package/dist/components/dataunit-fetcher.js +781 -100
- package/dist/components/snk-actions-button2.js +1 -1
- package/dist/components/snk-application2.js +11 -4
- package/dist/components/snk-attach2.js +13 -1
- package/dist/components/snk-crud.js +1 -1
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-grid2.js +19 -11
- package/dist/components/snk-personalized-filter2.js +16 -6
- package/dist/components/snk-simple-crud2.js +2 -88
- package/dist/esm/{ConfigStorage-80ca14d5.js → ConfigStorage-26f89143.js} +2 -2
- package/dist/esm/{DataFetcher-044e3988.js → DataFetcher-90e91631.js} +26 -11
- package/dist/esm/{SnkFormConfigManager-1a8b3a44.js → SnkFormConfigManager-18948123.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-892f37f9.js → SnkMultiSelectionListDataSource-b9410c72.js} +11 -0
- package/dist/esm/{auth-fetcher-1b378f8e.js → auth-fetcher-a8c8ee7e.js} +1 -1
- package/dist/esm/dataunit-fetcher-1c2ccae2.js +874 -0
- package/dist/esm/{form-config-fetcher-c702e9e3.js → form-config-fetcher-7c3b6273.js} +1 -1
- package/dist/{components/pesquisa-fetcher.js → esm/pesquisa-fetcher-90d6853b.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +4 -3
- package/dist/esm/snk-application.entry.js +17 -8
- package/dist/esm/snk-attach.entry.js +16 -3
- package/dist/esm/snk-crud.entry.js +6 -4
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +8 -6
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid-config.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +26 -15
- package/dist/esm/{snk-guides-viewer-767ad354.js → snk-guides-viewer-62b0fa69.js} +5 -4
- package/dist/esm/snk-guides-viewer.entry.js +8 -6
- package/dist/esm/snk-personalized-filter.entry.js +19 -9
- package/dist/esm/snk-simple-crud.entry.js +7 -91
- package/dist/sankhyablocks/p-193971ad.js +1 -0
- package/dist/sankhyablocks/{p-dacb4c4c.entry.js → p-19cbe6e2.entry.js} +3 -3
- package/dist/sankhyablocks/{p-76926391.js → p-240f5892.js} +2 -2
- package/dist/sankhyablocks/p-2c7c1323.entry.js +1 -0
- package/dist/sankhyablocks/p-3253e7f2.entry.js +1 -0
- package/dist/sankhyablocks/{p-d1cc9007.entry.js → p-57550ddc.entry.js} +1 -1
- package/dist/sankhyablocks/p-5d51bff4.js +1 -0
- package/dist/sankhyablocks/{p-727b8cbe.entry.js → p-5dd52ec5.entry.js} +1 -1
- package/dist/sankhyablocks/p-6541f0df.js +1 -0
- package/dist/sankhyablocks/p-68fbd480.entry.js +1 -0
- package/dist/sankhyablocks/{p-845c7480.entry.js → p-8652f90b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a2c7c45f.js → p-910af03c.js} +1 -1
- package/dist/sankhyablocks/p-992a9d0f.js +1 -0
- package/dist/sankhyablocks/p-acb1374c.entry.js +1 -0
- package/dist/sankhyablocks/p-b36053da.entry.js +1 -0
- package/dist/sankhyablocks/p-b481e5ad.js +1 -0
- package/dist/sankhyablocks/p-d264da22.entry.js +1 -0
- package/dist/sankhyablocks/{p-af86752b.js → p-d47bbee3.js} +1 -1
- package/dist/sankhyablocks/{p-e46dd27b.entry.js → p-d563e451.entry.js} +1 -1
- package/dist/sankhyablocks/p-d56b65e3.entry.js +1 -0
- package/dist/sankhyablocks/p-e473ca13.entry.js +1 -0
- package/dist/sankhyablocks/{p-3ef37b31.entry.js → p-e74e2153.entry.js} +1 -1
- package/dist/sankhyablocks/p-e86d4a53.js +59 -0
- package/dist/sankhyablocks/{p-90c07587.entry.js → p-ebfa6460.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-grid/filtercolumn/SnkMultiSelectionListDataSource.d.ts +1 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +3 -4
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +3 -1
- package/dist/types/components.d.ts +3 -2
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +2 -1
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.d.ts +13 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/ArrayRepository.d.ts +19 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +25 -0
- package/dist/types/lib/http/data-fetcher/fetchers/{dataunit-fetcher.d.ts → data-unit/dataunit-fetcher.d.ts} +5 -3
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataResult.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadDataStrategy.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/ILoadingInfo.d.ts +8 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IRecordField.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/interfaces/IResponseRecord.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DataUnitStrategy.d.ts +9 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.d.ts +15 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +1 -1
- package/dist/types/lib/index.d.ts +1 -1
- package/package.json +3 -3
- package/dist/cjs/dataunit-fetcher-16b32d96.js +0 -356
- package/dist/esm/dataunit-fetcher-e0361781.js +0 -354
- package/dist/esm/pesquisa-fetcher-d1b4e5a2.js +0 -165
- package/dist/sankhyablocks/p-15578509.entry.js +0 -1
- package/dist/sankhyablocks/p-1f32ad9c.entry.js +0 -1
- package/dist/sankhyablocks/p-2043a64f.js +0 -1
- package/dist/sankhyablocks/p-251985c1.entry.js +0 -1
- package/dist/sankhyablocks/p-3c1759ba.entry.js +0 -1
- package/dist/sankhyablocks/p-473c7df4.js +0 -1
- package/dist/sankhyablocks/p-77aebc26.js +0 -1
- package/dist/sankhyablocks/p-867e9b79.js +0 -1
- package/dist/sankhyablocks/p-8d1602f2.entry.js +0 -1
- package/dist/sankhyablocks/p-98ae8ddc.entry.js +0 -1
- package/dist/sankhyablocks/p-9de24cf3.entry.js +0 -1
- package/dist/sankhyablocks/p-b6d54b6c.entry.js +0 -1
- package/dist/sankhyablocks/p-d5b11196.js +0 -76
- package/dist/sankhyablocks/p-fa9d3f73.js +0 -1
@@ -1,14 +1,15 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
3
|
+
import { D as DataFetcher } from './DataFetcher-90e91631.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-90d6853b.js';
|
6
6
|
import './index-1564817d.js';
|
7
7
|
import './ISave-4412b20c.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
|
+
import './dataunit-fetcher-1c2ccae2.js';
|
10
11
|
import './filter-item-type.enum-5028ed3f.js';
|
11
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-7c3b6273.js';
|
12
13
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
13
14
|
import './_commonjsHelpers-9943807e.js';
|
14
15
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -1,18 +1,19 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, OnboardingUtils, DependencyType, ElementIDUtils, DataType, ApplicationContext, ErrorTracking } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
-
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-
|
6
|
-
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-
|
7
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher-
|
8
|
-
import { P as PesquisaFetcher } from './pesquisa-fetcher-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-26f89143.js';
|
5
|
+
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-90e91631.js';
|
6
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-a8c8ee7e.js';
|
7
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-1c2ccae2.js';
|
8
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-90d6853b.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-7ac66e9c.js';
|
10
|
-
import './form-config-fetcher-
|
10
|
+
import './form-config-fetcher-7c3b6273.js';
|
11
11
|
import './filter-item-type.enum-5028ed3f.js';
|
12
12
|
import './_commonjsHelpers-9943807e.js';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
14
|
import './PrintUtils-3e4ff0f5.js';
|
15
15
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
16
|
+
import './ResourceIDUtils-a114189a.js';
|
16
17
|
|
17
18
|
class AppletCaller {
|
18
19
|
static webConnectionCaller(port, methodName, params) {
|
@@ -1105,8 +1106,16 @@ class RequestListenerLoadingBar {
|
|
1105
1106
|
}
|
1106
1107
|
;
|
1107
1108
|
isIgnoreLoadingOnRequest(param) {
|
1108
|
-
|
1109
|
-
|
1109
|
+
if (param == undefined) {
|
1110
|
+
return false;
|
1111
|
+
}
|
1112
|
+
if (param.url.includes("quietMode=true")) {
|
1113
|
+
return true;
|
1114
|
+
}
|
1115
|
+
if (param.requestBody == undefined) {
|
1116
|
+
return false;
|
1117
|
+
}
|
1118
|
+
if (param.requestBody.length == 1) {
|
1110
1119
|
const { name } = param.requestBody[0].variables;
|
1111
1120
|
if (name) {
|
1112
1121
|
const nameParts = name.split(":");
|
@@ -1,14 +1,15 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, DataType, Action } from '@sankhyalabs/core';
|
3
|
-
import { D as DataFetcher } from './DataFetcher-
|
3
|
+
import { D as DataFetcher } from './DataFetcher-90e91631.js';
|
4
4
|
import { S as SaveErrorsEnum } from './ISave-4412b20c.js';
|
5
5
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
6
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher-
|
6
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-1c2ccae2.js';
|
7
7
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
10
|
import './PrintUtils-3e4ff0f5.js';
|
11
11
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
12
|
+
import './ResourceIDUtils-a114189a.js';
|
12
13
|
import './index-1564817d.js';
|
13
14
|
import './index-bdf75557.js';
|
14
15
|
|
@@ -417,13 +418,25 @@ const SnkAttach = class {
|
|
417
418
|
dataUnit.addFilterProvider({ getFilter: () => this._dataUnitBuilder.getFilters(this.registerKey) });
|
418
419
|
dataUnit.addInterceptor({ interceptAction: (action) => this._dataUnitBuilder.getInterceptions(dataUnit, action, this._crudElement) });
|
419
420
|
this.dataUnit = dataUnit;
|
420
|
-
this.dataUnit.loadData()
|
421
|
+
this.dataUnit.loadData().then(() => {
|
422
|
+
this.disableEditFieldsNotInForm();
|
423
|
+
});
|
421
424
|
return this.dataUnit;
|
422
425
|
}
|
423
426
|
catch (error) {
|
424
427
|
throw new Error('There was an error while creating the data unit');
|
425
428
|
}
|
426
429
|
}
|
430
|
+
disableEditFieldsNotInForm() {
|
431
|
+
var _a;
|
432
|
+
(_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid.columns.forEach(column => {
|
433
|
+
var _a;
|
434
|
+
const fieldName = column.name;
|
435
|
+
if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
|
436
|
+
this.dataUnit.disableField(fieldName);
|
437
|
+
}
|
438
|
+
});
|
439
|
+
}
|
427
440
|
componentWillLoad() {
|
428
441
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
429
442
|
this.loadAttachmentDataUnit();
|
@@ -1,19 +1,21 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { StringUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-90e91631.js';
|
5
|
+
import './pesquisa-fetcher-90d6853b.js';
|
6
6
|
import { P as PresentationMode } from './index-1564817d.js';
|
7
7
|
import './ISave-4412b20c.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
|
+
import './dataunit-fetcher-1c2ccae2.js';
|
10
11
|
import './filter-item-type.enum-5028ed3f.js';
|
11
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-7c3b6273.js';
|
12
13
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
13
|
-
import { A as AutorizationType } from './auth-fetcher-
|
14
|
+
import { A as AutorizationType } from './auth-fetcher-a8c8ee7e.js';
|
14
15
|
import './index-bdf75557.js';
|
15
16
|
import './_commonjsHelpers-9943807e.js';
|
16
17
|
import './PrintUtils-3e4ff0f5.js';
|
18
|
+
import './ResourceIDUtils-a114189a.js';
|
17
19
|
|
18
20
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
19
21
|
|
@@ -3,7 +3,7 @@ import { ApplicationContext, ObjectUtils, DataType, ElementIDUtils } from '@sank
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { D as DataExporterOption, a as DataExporterFormat, b as DataExporterType } from './index-1564817d.js';
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-3644f1b6.js';
|
6
|
-
import { D as DataFetcher } from './DataFetcher-
|
6
|
+
import { D as DataFetcher } from './DataFetcher-90e91631.js';
|
7
7
|
import { S as SnkDataUnit } from './snk-data-unit-5eb68408.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,22 +1,24 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
|
2
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
2
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-18948123.js';
|
3
3
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-90e91631.js';
|
5
|
+
import './pesquisa-fetcher-90d6853b.js';
|
6
6
|
import '@sankhyalabs/core';
|
7
7
|
import { P as PresentationMode } from './index-1564817d.js';
|
8
8
|
import './ISave-4412b20c.js';
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
|
+
import './dataunit-fetcher-1c2ccae2.js';
|
11
12
|
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-
|
13
|
+
import './form-config-fetcher-7c3b6273.js';
|
13
14
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
14
15
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
15
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-62b0fa69.js';
|
16
17
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-7ac66e9c.js';
|
17
|
-
import './ConfigStorage-
|
18
|
+
import './ConfigStorage-26f89143.js';
|
18
19
|
import './_commonjsHelpers-9943807e.js';
|
19
20
|
import './PrintUtils-3e4ff0f5.js';
|
21
|
+
import './ResourceIDUtils-a114189a.js';
|
20
22
|
import './index-bdf75557.js';
|
21
23
|
import './taskbar-processor-94402e6e.js';
|
22
24
|
import '@sankhyalabs/core/dist/dataunit/DataUnit';
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DataType, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-26f89143.js';
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
7
7
|
import { F as FilterOperand } from './index-ae591a44.js';
|
8
8
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
9
9
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
|
10
|
-
import './form-config-fetcher-
|
11
|
-
import './DataFetcher-
|
10
|
+
import './form-config-fetcher-7c3b6273.js';
|
11
|
+
import './DataFetcher-90e91631.js';
|
12
12
|
import './_commonjsHelpers-9943807e.js';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
14
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -2,10 +2,10 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { ElementIDUtils, ObjectUtils } from '@sankhyalabs/core';
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
4
4
|
import { E as EPresentationMode } from './presentationMode-783bbf9d.js';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-26f89143.js';
|
6
6
|
import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
|
7
|
-
import './form-config-fetcher-
|
8
|
-
import './DataFetcher-
|
7
|
+
import './form-config-fetcher-7c3b6273.js';
|
8
|
+
import './DataFetcher-90e91631.js';
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -3,10 +3,10 @@ import { d as draggable_bundle } from './draggable.bundle-41d56f06.js';
|
|
3
3
|
import { ObjectUtils, ElementIDUtils, ArrayUtils } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
5
|
import { C as CONFIG_EVENTS, T as TAB_NAMES, A as ACTION_CONFIG, D as DEFAULT_TYPE } from './constants-3644f1b6.js';
|
6
|
-
import { U as UserConfigType } from './form-config-fetcher-
|
6
|
+
import { U as UserConfigType } from './form-config-fetcher-7c3b6273.js';
|
7
7
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
|
-
import './DataFetcher-
|
9
|
+
import './DataFetcher-90e91631.js';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
12
12
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-18948123.js';
|
4
4
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
5
|
-
import './ConfigStorage-
|
6
|
-
import './form-config-fetcher-
|
7
|
-
import './DataFetcher-
|
5
|
+
import './ConfigStorage-26f89143.js';
|
6
|
+
import './form-config-fetcher-7c3b6273.js';
|
7
|
+
import './DataFetcher-90e91631.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
10
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -2,10 +2,10 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-26f89143.js';
|
6
6
|
import { O as ORDER_VALUES } from './constants-3644f1b6.js';
|
7
|
-
import './form-config-fetcher-
|
8
|
-
import './DataFetcher-
|
7
|
+
import './form-config-fetcher-7c3b6273.js';
|
8
|
+
import './DataFetcher-90e91631.js';
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -1,18 +1,21 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import { ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
|
2
|
+
import { SortMode, ElementIDUtils, ApplicationContext, DataType } from '@sankhyalabs/core';
|
3
3
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
4
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
5
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
5
|
+
import { C as ConfigStorage } from './ConfigStorage-26f89143.js';
|
6
6
|
import { P as PresentationMode } from './index-1564817d.js';
|
7
7
|
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
8
8
|
import { s as store } from './index-bdf75557.js';
|
9
|
-
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-
|
9
|
+
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-b9410c72.js';
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
|
-
import './form-config-fetcher-
|
12
|
-
import './DataFetcher-
|
11
|
+
import './form-config-fetcher-7c3b6273.js';
|
12
|
+
import './DataFetcher-90e91631.js';
|
13
13
|
import './_commonjsHelpers-9943807e.js';
|
14
14
|
import './PrintUtils-3e4ff0f5.js';
|
15
15
|
import './filter-item-type.enum-5028ed3f.js';
|
16
|
+
import './dataunit-fetcher-1c2ccae2.js';
|
17
|
+
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
18
|
+
import './ResourceIDUtils-a114189a.js';
|
16
19
|
|
17
20
|
const snkGridCss = ".snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%}.snk-grid__header.sc-snk-grid{display:flex;flex-wrap:nowrap;width:100%}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:300px}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
18
21
|
|
@@ -99,6 +102,18 @@ const SnkGrid = class {
|
|
99
102
|
}
|
100
103
|
setGridConfig(config) {
|
101
104
|
this._gridConfig = config;
|
105
|
+
this.assertDefaultSorting();
|
106
|
+
}
|
107
|
+
assertDefaultSorting() {
|
108
|
+
if (this._gridConfig && this._dataUnit) {
|
109
|
+
this._dataUnit.defaultSorting = this._gridConfig
|
110
|
+
.columns
|
111
|
+
.sort((colA, colB) => colA.orderIndex - colB.orderIndex)
|
112
|
+
.map(({ name: field, ascending }) => {
|
113
|
+
const { dataType } = this._dataUnit.getField(field);
|
114
|
+
return { field, dataType, mode: ascending ? SortMode.ASC : SortMode.DESC };
|
115
|
+
});
|
116
|
+
}
|
102
117
|
}
|
103
118
|
loadConfig() {
|
104
119
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
@@ -224,11 +239,12 @@ const SnkGrid = class {
|
|
224
239
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
225
240
|
}
|
226
241
|
finshLoading() {
|
227
|
-
|
228
|
-
this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
|
242
|
+
this.assertDefaultSorting();
|
229
243
|
this.addElementID();
|
230
|
-
(
|
231
|
-
|
244
|
+
if (this.columnFilterDataSource != undefined) {
|
245
|
+
this.columnFilterDataSource.setApplication(this._application);
|
246
|
+
this.columnFilterDataSource.setDataUnit(this._dataUnit);
|
247
|
+
}
|
232
248
|
}
|
233
249
|
componentWillLoad() {
|
234
250
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -309,18 +325,13 @@ const SnkGrid = class {
|
|
309
325
|
getPrimaryButton() {
|
310
326
|
return this.presentationMode === PresentationMode.PRIMARY ? "INSERT" : "";
|
311
327
|
}
|
312
|
-
onEzGridReady() {
|
313
|
-
var _a;
|
314
|
-
(_a = this._dataUnitLoadLockerResolver) === null || _a === void 0 ? void 0 : _a.call(this);
|
315
|
-
this._dataUnitLoadLockerResolver = undefined;
|
316
|
-
}
|
317
328
|
render() {
|
318
329
|
var _a, _b;
|
319
330
|
if (!this._dataUnit) {
|
320
331
|
return undefined;
|
321
332
|
}
|
322
333
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
323
|
-
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection,
|
334
|
+
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
324
335
|
}
|
325
336
|
get _element() { return getElement(this); }
|
326
337
|
};
|
@@ -1,18 +1,19 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
|
2
2
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-18948123.js';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
6
6
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
7
7
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
8
|
-
import './DataFetcher-
|
9
|
-
import './pesquisa-fetcher-
|
8
|
+
import './DataFetcher-90e91631.js';
|
9
|
+
import './pesquisa-fetcher-90d6853b.js';
|
10
10
|
import { P as PresentationMode } from './index-1564817d.js';
|
11
11
|
import './ISave-4412b20c.js';
|
12
12
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
|
+
import './dataunit-fetcher-1c2ccae2.js';
|
14
15
|
import './filter-item-type.enum-5028ed3f.js';
|
15
|
-
import './form-config-fetcher-
|
16
|
+
import './form-config-fetcher-7c3b6273.js';
|
16
17
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
17
18
|
|
18
19
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
@@ -1,10 +1,10 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-62b0fa69.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
|
-
import './SnkFormConfigManager-
|
5
|
-
import './ConfigStorage-
|
6
|
-
import './form-config-fetcher-
|
7
|
-
import './DataFetcher-
|
4
|
+
import './SnkFormConfigManager-18948123.js';
|
5
|
+
import './ConfigStorage-26f89143.js';
|
6
|
+
import './form-config-fetcher-7c3b6273.js';
|
7
|
+
import './DataFetcher-90e91631.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
10
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -15,7 +15,9 @@ import './taskbar-elements-0a6b8b95.js';
|
|
15
15
|
import './index-1564817d.js';
|
16
16
|
import './index-bdf75557.js';
|
17
17
|
import './constants-3644f1b6.js';
|
18
|
-
import './pesquisa-fetcher-
|
18
|
+
import './pesquisa-fetcher-90d6853b.js';
|
19
19
|
import './ISave-4412b20c.js';
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
21
|
+
import './dataunit-fetcher-1c2ccae2.js';
|
22
|
+
import './ResourceIDUtils-a114189a.js';
|
21
23
|
import '@sankhyalabs/core/dist/dataunit/DataUnit';
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a7d3d3f1.js';
|
2
2
|
import { StringUtils, ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-75fb0106.js';
|
4
|
-
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-26f89143.js';
|
5
5
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
6
6
|
import { a as FilterGroupCondition } from './index-ae591a44.js';
|
7
7
|
import { s as store } from './index-bdf75557.js';
|
8
8
|
import './filter-item-type.enum-5028ed3f.js';
|
9
|
-
import './form-config-fetcher-
|
10
|
-
import './DataFetcher-
|
9
|
+
import './form-config-fetcher-7c3b6273.js';
|
10
|
+
import './DataFetcher-90e91631.js';
|
11
11
|
import './_commonjsHelpers-9943807e.js';
|
12
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
13
13
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -82,7 +82,7 @@ const SnkPersonalizedFilter = class {
|
|
82
82
|
}
|
83
83
|
ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
|
84
84
|
.then((resp) => {
|
85
|
-
const personalizedFilter = this.
|
85
|
+
const personalizedFilter = this.applyDefaultValues(resp);
|
86
86
|
this._filterAssistent = personalizedFilter;
|
87
87
|
this._originalFilterAssistent = ObjectUtils.copy(personalizedFilter);
|
88
88
|
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
@@ -193,20 +193,30 @@ const SnkPersonalizedFilter = class {
|
|
193
193
|
this._filterAssistent = Object.assign(Object.assign({}, this._filterAssistent), { name });
|
194
194
|
this._elButtonSave.enabled = !this.hasChangesToSave();
|
195
195
|
}
|
196
|
-
|
196
|
+
applyDefaultValues(personalizedFilter) {
|
197
|
+
this.addLabelToItems(personalizedFilter);
|
198
|
+
this.addFilterGroupCondition(personalizedFilter);
|
199
|
+
return personalizedFilter;
|
200
|
+
}
|
201
|
+
addFilterGroupCondition(personalizedFilter) {
|
202
|
+
if (!personalizedFilter.assistent.operand) {
|
203
|
+
personalizedFilter.assistent.operand = FilterGroupCondition.AND;
|
204
|
+
}
|
205
|
+
}
|
206
|
+
;
|
207
|
+
addLabelToItems(personalizedFilter) {
|
197
208
|
//Workaround: Alguns filtros foram salvos sem o fieldLabel. Para evitar transtornos
|
198
209
|
//tentamos usar o fieldLabel que pode estar informado no parametro.
|
199
|
-
if (
|
200
|
-
|
210
|
+
if (personalizedFilter.assistent && personalizedFilter.assistent.items && personalizedFilter.assistent.items.length > 0) {
|
211
|
+
personalizedFilter.assistent.items.forEach(item => {
|
201
212
|
if (item.fieldLabel == undefined) {
|
202
|
-
const param = (
|
213
|
+
const param = (personalizedFilter.parameters || []).find(param => param.fieldName === item.fieldName);
|
203
214
|
if (param) {
|
204
215
|
item.fieldLabel = param.label;
|
205
216
|
}
|
206
217
|
}
|
207
218
|
});
|
208
219
|
}
|
209
|
-
return resp;
|
210
220
|
}
|
211
221
|
handleExpressionChangeAdvancedMode(expression) {
|
212
222
|
this._filterAssistent = Object.assign(Object.assign({}, this._filterAssistent), { expression });
|
@@ -1,106 +1,22 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import {
|
2
|
+
import { ObjectUtils, ApplicationContext, DataType, UserInterface } from '@sankhyalabs/core';
|
3
3
|
import { c as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-3644f1b6.js';
|
4
4
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
5
|
-
import './DataFetcher-
|
6
|
-
import './pesquisa-fetcher-
|
5
|
+
import './DataFetcher-90e91631.js';
|
6
|
+
import './pesquisa-fetcher-90d6853b.js';
|
7
7
|
import { P as PresentationMode } from './index-1564817d.js';
|
8
8
|
import './ISave-4412b20c.js';
|
9
9
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
|
+
import { I as InMemoryLoader } from './dataunit-fetcher-1c2ccae2.js';
|
11
12
|
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-
|
13
|
+
import './form-config-fetcher-7c3b6273.js';
|
13
14
|
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
14
|
-
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-
|
15
|
+
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-b9410c72.js';
|
15
16
|
import './index-bdf75557.js';
|
16
17
|
import './_commonjsHelpers-9943807e.js';
|
17
18
|
import './PrintUtils-3e4ff0f5.js';
|
18
|
-
|
19
|
-
class InMemoryLoader {
|
20
|
-
constructor(metadata, records) {
|
21
|
-
this.records = records;
|
22
|
-
this.metadata = metadata;
|
23
|
-
this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
24
|
-
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
25
|
-
this._dataUnit.dataLoader = (dataUnit, request) => defaultDataLoader(dataUnit, request, this.getRecordsToLoad());
|
26
|
-
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
27
|
-
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
28
|
-
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
29
|
-
}
|
30
|
-
getRecordsToLoad() {
|
31
|
-
if (this._initialRecords) {
|
32
|
-
try {
|
33
|
-
return this._initialRecords;
|
34
|
-
}
|
35
|
-
finally {
|
36
|
-
this._initialRecords = undefined;
|
37
|
-
}
|
38
|
-
}
|
39
|
-
return this.dataUnit.records;
|
40
|
-
}
|
41
|
-
get dataUnit() {
|
42
|
-
return this._dataUnit;
|
43
|
-
}
|
44
|
-
get records() {
|
45
|
-
return this.dataUnit.records;
|
46
|
-
}
|
47
|
-
set records(records) {
|
48
|
-
const newRecords = records === null || records === void 0 ? void 0 : records.map(record => {
|
49
|
-
if (!record["__record__id__"]) {
|
50
|
-
record["__record__id__"] = this.generateUniqueId();
|
51
|
-
}
|
52
|
-
return record;
|
53
|
-
});
|
54
|
-
if (this._dataUnit) {
|
55
|
-
this._dataUnit.records = newRecords;
|
56
|
-
}
|
57
|
-
else {
|
58
|
-
this._initialRecords = newRecords;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
get metadata() {
|
62
|
-
return this._metadata;
|
63
|
-
}
|
64
|
-
set metadata(metadata) {
|
65
|
-
this._metadata = metadata;
|
66
|
-
if (this._dataUnit) {
|
67
|
-
this._dataUnit.metadata = this._metadata;
|
68
|
-
}
|
69
|
-
}
|
70
|
-
generateUniqueId() {
|
71
|
-
return StringUtils.generateUUID();
|
72
|
-
}
|
73
|
-
metadaLoader() {
|
74
|
-
return Promise.resolve(this._metadata);
|
75
|
-
}
|
76
|
-
saveLoader(_dataUnit, changes) {
|
77
|
-
return new Promise((resolve) => {
|
78
|
-
let dataUnitRecords = [];
|
79
|
-
changes.forEach(change => {
|
80
|
-
let { record, updatingFields, operation } = change;
|
81
|
-
const changedRecord = Object.assign(Object.assign({}, record), updatingFields);
|
82
|
-
if (operation === ChangeOperation.INSERT ||
|
83
|
-
operation === ChangeOperation.COPY) {
|
84
|
-
changedRecord["__old__id__"] = record["__record__id__"];
|
85
|
-
changedRecord["__record__id__"] = this.generateUniqueId();
|
86
|
-
this.records.push(changedRecord);
|
87
|
-
}
|
88
|
-
else {
|
89
|
-
const recordIndex = this.records.findIndex(r => r["__record__id__"] == changedRecord["__record__id__"]);
|
90
|
-
this.records[recordIndex] = changedRecord;
|
91
|
-
}
|
92
|
-
dataUnitRecords.push(changedRecord);
|
93
|
-
});
|
94
|
-
resolve(dataUnitRecords);
|
95
|
-
});
|
96
|
-
}
|
97
|
-
removeLoader(_dataUnit, recordIds) {
|
98
|
-
return new Promise((resolve) => {
|
99
|
-
resolve(recordIds);
|
100
|
-
});
|
101
|
-
}
|
102
|
-
}
|
103
|
-
InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME = "InMemoryDataUnit";
|
19
|
+
import './ResourceIDUtils-a114189a.js';
|
104
20
|
|
105
21
|
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:max-content;row-gap:12px;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;min-height:300px}ez-form.sc-snk-simple-crud{min-height:300px}";
|
106
22
|
|