@sankhyalabs/sankhyablocks 8.8.0-rc.7 → 8.8.0-rc.8
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-bdb539ce.js → ConfigStorage-908ce5bc.js} +2 -2
- package/dist/cjs/{DataFetcher-016f1661.js → DataFetcher-713f0749.js} +2 -2
- package/dist/cjs/{SnkFormConfigManager-c9d38de1.js → SnkFormConfigManager-793ade39.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-49120c1a.js → SnkMultiSelectionListDataSource-f000a53f.js} +1 -1
- package/dist/cjs/{auth-fetcher-73ee0989.js → auth-fetcher-555ff856.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-d2b1e486.js → dataunit-fetcher-e86cba8a.js} +1 -1
- package/dist/cjs/{form-config-fetcher-5e5ec5be.js → form-config-fetcher-17775a75.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-63a8c652.js → pesquisa-fetcher-34922b83.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +4 -4
- package/dist/cjs/snk-application.cjs.entry.js +14 -6
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +19 -4
- 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 +5 -5
- package/dist/cjs/{snk-guides-viewer-724cdac7.js → snk-guides-viewer-f31449a8.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +5 -5
- package/dist/collection/components/snk-application/snk-application.js +1 -0
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +17 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +2 -2
- package/dist/collection/lib/workspace/workspace.js +7 -0
- package/dist/components/DataFetcher.js +2 -2
- package/dist/components/snk-application2.js +8 -0
- package/dist/components/snk-filter-bar2.js +17 -2
- package/dist/esm/{ConfigStorage-9840d004.js → ConfigStorage-48648d45.js} +2 -2
- package/dist/esm/{DataFetcher-07935045.js → DataFetcher-79f78222.js} +2 -2
- package/dist/esm/{SnkFormConfigManager-a7c4ac16.js → SnkFormConfigManager-3c15f319.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-52cd2213.js → SnkMultiSelectionListDataSource-922f0941.js} +1 -1
- package/dist/esm/{auth-fetcher-1afab780.js → auth-fetcher-e260d0cd.js} +1 -1
- package/dist/esm/{dataunit-fetcher-e7cb71d2.js → dataunit-fetcher-ec40608e.js} +1 -1
- package/dist/esm/{form-config-fetcher-5b886892.js → form-config-fetcher-e1603e66.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-7c46996d.js → pesquisa-fetcher-8e922c9d.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +4 -4
- package/dist/esm/snk-application.entry.js +14 -6
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +7 -7
- package/dist/esm/snk-filter-bar.entry.js +20 -5
- 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 +5 -5
- package/dist/esm/{snk-guides-viewer-fbe0c5a6.js → snk-guides-viewer-9ecebfc3.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +5 -5
- package/dist/sankhyablocks/{p-b19c272c.js → p-2b39abbc.js} +1 -1
- package/dist/sankhyablocks/{p-1b985000.entry.js → p-2ecd9a19.entry.js} +1 -1
- package/dist/sankhyablocks/{p-48ec4931.entry.js → p-3307f385.entry.js} +1 -1
- package/dist/sankhyablocks/{p-de9eb242.entry.js → p-395567f3.entry.js} +1 -1
- package/dist/sankhyablocks/p-3c884841.entry.js +11 -0
- package/dist/sankhyablocks/{p-1c32a70d.entry.js → p-3fd5b4c1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-efb2e247.js → p-41d156dd.js} +1 -1
- package/dist/sankhyablocks/{p-aeb2298c.js → p-43cbd6ba.js} +1 -1
- package/dist/sankhyablocks/{p-0f2b03e5.js → p-4651b43f.js} +1 -1
- package/dist/sankhyablocks/p-4f74a21b.entry.js +1 -0
- package/dist/sankhyablocks/{p-54efcc8d.entry.js → p-747043a5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-96dd0c41.js → p-8015cbfb.js} +1 -1
- package/dist/sankhyablocks/{p-562896d0.entry.js → p-80692cbd.entry.js} +1 -1
- package/dist/sankhyablocks/{p-76aa485c.entry.js → p-83954fc0.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b4a0b2e3.js → p-9713c75c.js} +2 -2
- package/dist/sankhyablocks/{p-afdb6ddc.entry.js → p-abff11ef.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9246d7df.entry.js → p-afacdce6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-64e2d600.entry.js → p-c0c48f19.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4f7b9c50.js → p-c9399ce6.js} +1 -1
- package/dist/sankhyablocks/p-d0b36421.js +1 -0
- package/dist/sankhyablocks/{p-13e22fee.entry.js → p-e040c626.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a9de84fc.entry.js → p-efc9b851.entry.js} +1 -1
- package/dist/sankhyablocks/p-f07a5363.entry.js +1 -0
- package/dist/sankhyablocks/{p-61755a99.js → p-f518057c.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/workspace/workspace.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-43f36d85.entry.js +0 -1
- package/dist/sankhyablocks/p-bc6b332c.entry.js +0 -1
- package/dist/sankhyablocks/p-de1196c8.js +0 -1
- package/dist/sankhyablocks/p-f2aba462.entry.js +0 -11
@@ -1,7 +1,7 @@
|
|
1
|
-
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-
|
1
|
+
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-e1603e66.js';
|
2
2
|
import { F as FilterItemType } from './filter-item-type.enum-5028ed3f.js';
|
3
3
|
import { ObjectUtils } from '@sankhyalabs/core';
|
4
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
4
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-79f78222.js';
|
5
5
|
|
6
6
|
class GridConfigFetcher extends ResourceFetcher {
|
7
7
|
constructor() {
|
@@ -6729,9 +6729,9 @@ class DataFetcher {
|
|
6729
6729
|
const urlParams = UrlUtils.getQueryParams(location.search);
|
6730
6730
|
return {
|
6731
6731
|
baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
|
6732
|
-
appName: "SankhyaBlocks",
|
6732
|
+
appName: window['APPLICATION_NAME'] || "SankhyaBlocks",
|
6733
6733
|
mgeSession: `${window['mgeSession'] || urlParams.get("mgeSession")}`,
|
6734
|
-
globalID:
|
6734
|
+
globalID: window['GLOBALID'] || StringUtils.generateUUID(),
|
6735
6735
|
resourceID: (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID))
|
6736
6736
|
};
|
6737
6737
|
}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-48648d45.js';
|
2
2
|
import { ObjectUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-e1603e66.js';
|
4
4
|
|
5
5
|
class SnkFormConfigManager {
|
6
6
|
constructor(configName, resourceID, onConfigChange) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { UserInterface, DateUtils } from '@sankhyalabs/core';
|
2
|
-
import { P as PreloadManager } from './dataunit-fetcher-
|
2
|
+
import { P as PreloadManager } from './dataunit-fetcher-ec40608e.js';
|
3
3
|
|
4
4
|
class SnkMultiSelectionListDataSource {
|
5
5
|
setDataUnit(dataUnit) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ObjectUtils } from '@sankhyalabs/core';
|
2
|
-
import { R as ResourceFetcher } from './form-config-fetcher-
|
2
|
+
import { R as ResourceFetcher } from './form-config-fetcher-e1603e66.js';
|
3
3
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
5
5
|
getData(resourceID) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { FieldComparator, SortMode, DataUnit, defaultDataLoader, DataType, DateUtils, StringUtils, ChangeOperation, UserInterface, DataUnitStorage } from '@sankhyalabs/core';
|
2
|
-
import { D as DataFetcher, d as dist } from './DataFetcher-
|
2
|
+
import { D as DataFetcher, d as dist } from './DataFetcher-79f78222.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
5
5
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
@@ -1,15 +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-79f78222.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-8e922c9d.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-
|
10
|
+
import './dataunit-fetcher-ec40608e.js';
|
11
11
|
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-e1603e66.js';
|
13
13
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
14
14
|
import './_commonjsHelpers-9943807e.js';
|
15
15
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -1,13 +1,13 @@
|
|
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-48648d45.js';
|
5
|
+
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-79f78222.js';
|
6
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-e260d0cd.js';
|
7
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-ec40608e.js';
|
8
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-8e922c9d.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-7ac66e9c.js';
|
10
|
-
import './form-config-fetcher-
|
10
|
+
import './form-config-fetcher-e1603e66.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';
|
@@ -177,6 +177,13 @@ class Workspace {
|
|
177
177
|
var _a;
|
178
178
|
(_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.setScreenToUseOldLayout();
|
179
179
|
}
|
180
|
+
static applicationClick() {
|
181
|
+
var _a, _b;
|
182
|
+
if (!((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.applicationClick)) {
|
183
|
+
return;
|
184
|
+
}
|
185
|
+
(_b = window["workspace"]) === null || _b === void 0 ? void 0 : _b.applicationClick();
|
186
|
+
}
|
180
187
|
}
|
181
188
|
Workspace.resourceID = (_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID;
|
182
189
|
|
@@ -1053,6 +1060,7 @@ const SnkApplication = class {
|
|
1053
1060
|
}, 100);
|
1054
1061
|
ErrorTracking.init();
|
1055
1062
|
ConfigStorage.preload(this.applicationResourceID, this.configName);
|
1063
|
+
document.addEventListener("click", () => Workspace.applicationClick());
|
1056
1064
|
}
|
1057
1065
|
connectedCallback() {
|
1058
1066
|
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
@@ -1,9 +1,9 @@
|
|
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-79f78222.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-ec40608e.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';
|
@@ -1,17 +1,17 @@
|
|
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-79f78222.js';
|
5
|
+
import './pesquisa-fetcher-8e922c9d.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-
|
10
|
+
import './dataunit-fetcher-ec40608e.js';
|
11
11
|
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-e1603e66.js';
|
13
13
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
14
|
-
import { A as AutorizationType } from './auth-fetcher-
|
14
|
+
import { A as AutorizationType } from './auth-fetcher-e260d0cd.js';
|
15
15
|
import './index-bdf75557.js';
|
16
16
|
import './_commonjsHelpers-9943807e.js';
|
17
17
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -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-79f78222.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,21 +1,21 @@
|
|
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-3c15f319.js';
|
3
3
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-79f78222.js';
|
5
|
+
import './pesquisa-fetcher-8e922c9d.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-
|
11
|
+
import './dataunit-fetcher-ec40608e.js';
|
12
12
|
import './filter-item-type.enum-5028ed3f.js';
|
13
|
-
import './form-config-fetcher-
|
13
|
+
import './form-config-fetcher-e1603e66.js';
|
14
14
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
15
15
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-9ecebfc3.js';
|
17
17
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-7ac66e9c.js';
|
18
|
-
import './ConfigStorage-
|
18
|
+
import './ConfigStorage-48648d45.js';
|
19
19
|
import './_commonjsHelpers-9943807e.js';
|
20
20
|
import './PrintUtils-3e4ff0f5.js';
|
21
21
|
import './ResourceIDUtils-a114189a.js';
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import { DataType, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext } from '@sankhyalabs/core';
|
2
|
+
import { DataType, StringUtils, 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-48648d45.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-e1603e66.js';
|
11
|
+
import './DataFetcher-79f78222.js';
|
12
12
|
import './_commonjsHelpers-9943807e.js';
|
13
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
14
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -103,8 +103,11 @@ function buildSearch(item) {
|
|
103
103
|
return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value.value) }] };
|
104
104
|
}
|
105
105
|
function buildText(item) {
|
106
|
-
|
106
|
+
let { id, value, props } = item;
|
107
107
|
const expression = props.expression;
|
108
|
+
if (!StringUtils.isEmpty(props.likeAs)) {
|
109
|
+
value = buildLikeValue(value, props.likeAs);
|
110
|
+
}
|
108
111
|
return { name: id, expression, params: [{ name: id, dataType: DataType.TEXT, value: toString(DataType.TEXT, value) }] };
|
109
112
|
}
|
110
113
|
function buildNumber(item) {
|
@@ -112,6 +115,18 @@ function buildNumber(item) {
|
|
112
115
|
const expression = props.expression;
|
113
116
|
return { name: id, expression, params: [{ name: id, dataType: DataType.NUMBER, value: toString(DataType.NUMBER, value) }] };
|
114
117
|
}
|
118
|
+
function buildLikeValue(valueAsString, likeAs) {
|
119
|
+
if (likeAs === "CONTANIS") {
|
120
|
+
return `%${valueAsString}%`;
|
121
|
+
}
|
122
|
+
else if (likeAs === "STARTS_WITH") {
|
123
|
+
return `${valueAsString}%`;
|
124
|
+
}
|
125
|
+
else if (likeAs === "ENDS_WITH") {
|
126
|
+
return `%${valueAsString}`;
|
127
|
+
}
|
128
|
+
return valueAsString;
|
129
|
+
}
|
115
130
|
function buildPersonalized(item) {
|
116
131
|
const { id, groupedItems = [] } = item;
|
117
132
|
const activeFilters = groupedItems.filter(groupItem => !!groupItem.visible);
|
@@ -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-48648d45.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-e1603e66.js';
|
8
|
+
import './DataFetcher-79f78222.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-e1603e66.js';
|
7
7
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
|
-
import './DataFetcher-
|
9
|
+
import './DataFetcher-79f78222.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-3c15f319.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-48648d45.js';
|
6
|
+
import './form-config-fetcher-e1603e66.js';
|
7
|
+
import './DataFetcher-79f78222.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-48648d45.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-e1603e66.js';
|
8
|
+
import './DataFetcher-79f78222.js';
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -2,18 +2,18 @@ import { r as registerInstance, c as createEvent, h, g as getElement } from './i
|
|
2
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-48648d45.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-922f0941.js';
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
|
-
import './form-config-fetcher-
|
12
|
-
import './DataFetcher-
|
11
|
+
import './form-config-fetcher-e1603e66.js';
|
12
|
+
import './DataFetcher-79f78222.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-
|
16
|
+
import './dataunit-fetcher-ec40608e.js';
|
17
17
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
18
18
|
import './ResourceIDUtils-a114189a.js';
|
19
19
|
|
@@ -1,19 +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-3c15f319.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-79f78222.js';
|
9
|
+
import './pesquisa-fetcher-8e922c9d.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-
|
14
|
+
import './dataunit-fetcher-ec40608e.js';
|
15
15
|
import './filter-item-type.enum-5028ed3f.js';
|
16
|
-
import './form-config-fetcher-
|
16
|
+
import './form-config-fetcher-e1603e66.js';
|
17
17
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
18
18
|
|
19
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-9ecebfc3.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-3c15f319.js';
|
5
|
+
import './ConfigStorage-48648d45.js';
|
6
|
+
import './form-config-fetcher-e1603e66.js';
|
7
|
+
import './DataFetcher-79f78222.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
10
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -15,9 +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-8e922c9d.js';
|
19
19
|
import './ISave-4412b20c.js';
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
21
|
-
import './dataunit-fetcher-
|
21
|
+
import './dataunit-fetcher-ec40608e.js';
|
22
22
|
import './ResourceIDUtils-a114189a.js';
|
23
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-48648d45.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-e1603e66.js';
|
10
|
+
import './DataFetcher-79f78222.js';
|
11
11
|
import './_commonjsHelpers-9943807e.js';
|
12
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
13
13
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -2,17 +2,17 @@ import { r as registerInstance, c as createEvent, h, g as getElement } from './i
|
|
2
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-79f78222.js';
|
6
|
+
import './pesquisa-fetcher-8e922c9d.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-
|
11
|
+
import { I as InMemoryLoader } from './dataunit-fetcher-ec40608e.js';
|
12
12
|
import './filter-item-type.enum-5028ed3f.js';
|
13
|
-
import './form-config-fetcher-
|
13
|
+
import './form-config-fetcher-e1603e66.js';
|
14
14
|
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
15
|
-
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-
|
15
|
+
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-922f0941.js';
|
16
16
|
import './index-bdf75557.js';
|
17
17
|
import './_commonjsHelpers-9943807e.js';
|
18
18
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import{R as e,F as t}from"./p-
|
1
|
+
import{R as e,F as t}from"./p-4651b43f.js";import{F as i}from"./p-584d7212.js";import{ObjectUtils as s}from"@sankhyalabs/core";import{d as r,D as n}from"./p-c9399ce6.js";function a(e,t){if(null==e)return e;if(e instanceof Date)return e.toISOString();if("object"==typeof e){if(e instanceof Array)return e.map((e=>a(i.MULTI_LIST===t?function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(i[s[r]]=e[s[r]])}return i}(e,["label"]):e)));{const i=Object.assign({},e);return Object.keys(e).forEach((s=>{void 0!==e[s]?i[s]=a(e[s],t):delete i[s]})),i}}return e}class l{constructor(){this.templateByQuery=new Map,this.buildTemplates()}resolveURI(e,t){let i="filter-assistent-config://"+e;return t&&(i+="."+t),i}buildTemplates(){this.templateByQuery.set("fetchFilterFields",r.gql`
|
2
2
|
query($name: String!) {
|
3
3
|
$queryAlias$: fetchFilterFields(name: $name){
|
4
4
|
currentLink {
|
@@ -1 +1 @@
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as r}from"./p-d2d301a6.js";import{ElementIDUtils as l,ObjectUtils as o}from"@sankhyalabs/core";import{F as a}from"./p-584d7212.js";import{E as n}from"./p-1a68fb59.js";import{C as d}from"./p-
|
1
|
+
import{r as t,c as i,h as e,H as s,g as r}from"./p-d2d301a6.js";import{ElementIDUtils as l,ObjectUtils as o}from"@sankhyalabs/core";import{F as a}from"./p-584d7212.js";import{E as n}from"./p-1a68fb59.js";import{C as d}from"./p-2b39abbc.js";import{F as h}from"./p-d9804798.js";import"./p-4651b43f.js";import"./p-c9399ce6.js";import"./p-112455b1.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";const c=class{constructor(e){t(this,e),this.filterChange=i(this,"filterChange",7),this.editPersonalizedFilter=i(this,"editPersonalizedFilter",7),this.addPersonalizedFilter=i(this,"addPersonalizedFilter",7),this.filterItem=void 0,this.configName=void 0,this.resourceID=void 0}observeFilterItem(t){var i,e;this._editor&&(this._editor.config=t),null===(e=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===e||e.call(i),this.filterChange.emit(t)}getContentEditorConfig(){const t={presentationMode:n.MODAL};switch(this.filterItem.type){case a.BINARY_SELECT:return{tag:"snk-filter-binary-select",props:t};case a.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case a.PERIOD:return{tag:"snk-filter-period",props:t};case a.SEARCH:return{tag:"snk-filter-search"};case a.NUMBER:return{tag:"snk-filter-number"};case a.PERSONALIZED:return this.buildSnkFilterPersonalizedProps();case a.MULTI_LIST:return{tag:"snk-entity-list",props:{maxHeightList:"640px",rightListSlotBuilder:t=>this.buildRightSlot(t)}}}return{tag:"snk-filter-text"}}buildSnkFilterPersonalizedProps(){return{tag:"snk-personalized-filter-editor",props:{onDeleteFilter:t=>this.handleDeleteFilter(t.detail,a.PERSONALIZED),onEditFilter:t=>this.editPersonalizedFilter.emit(t.detail),onAddFilter:()=>this.addPersonalizedFilter.emit()}}}isVisible(t){return!!this.filterItem.visible||void 0!==t}updateFilterValue(t){const i=void 0!==(null==t?void 0:t.value)?t.value:t;this.filterItem=Object.assign(Object.assign({},this.filterItem),null!=this.filterItem.groupedItems?{visible:i>0,value:i,groupedItems:t.items}:{value:this.filterItem.type===a.SEARCH?t:i,visible:this.isVisible(i)})}handleDeleteFilter(t,i){i===a.PERSONALIZED&&d.removePersonalizedFilter(t,this.resourceID,this.configName)}componentDidLoad(){if(this._element){l.addIDInfo(this._element);const t=this._element.getAttribute(l.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.filterItem.id}`}}buildRightSlot(t){return e("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,e,s;const r=null===(e=null===(i=this.filterItem)||void 0===i?void 0:i.value)||void 0===e?void 0:e.findIndex((({id:i})=>i===t.id)),l=o.copy(this.filterItem);null===(s=null==l?void 0:l.value)||void 0===s||s.splice(r,1),this.updateFilterValue(l.value)}canShowDetailModal(){const{CUSTOM_FILTER:t,OTHER_FILTERS:i}=h;return![t,i].includes(this.filterItem.filterType)&&this.filterItem.type!==a.BINARY_SELECT}render(){const{tag:t,props:i}=this.getContentEditorConfig();return e(s,null,e("div",{class:"ez-flex ez-flex--column grow"},this.canShowDetailModal()&&e("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},e("div",{class:"ez-title ez-title--small ez-title--primary grow"},this.filterItem.detailModal)),e(t,Object.assign({ref:t=>this._editor=t,config:this.filterItem,value:this.filterItem.value,onValueChanged:t=>this.updateFilterValue(t.detail),"data-element-id":this._idContentEditor},i))))}get _element(){return r(this)}static get watchers(){return{filterItem:["observeFilterItem"]}}};c.style=".grow{flex-grow:1}.gap{gap:4px}";export{c as snk_filter_modal_item}
|
@@ -1 +1 @@
|
|
1
|
-
import{r as t,c as e,h as i}from"./p-d2d301a6.js";import{ApplicationContext as s,DataType as n,Action as a}from"@sankhyalabs/core";import{D as r}from"./p-4f7b9c50.js";import{S as o}from"./p-9e7d65a4.js";import{c as h}from"./p-4a78e118.js";import{D as d}from"./p-b4a0b2e3.js";import{T as l}from"./p-c9841939.js";import"./p-112455b1.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-688dcb4c.js";import"./p-5534e08c.js";import"./p-6dc031de.js";class c{constructor(t,e,i){var s;this.entityName=t,this.registerKey=e,this.dataUnitName=i,this.validateFields=t=>{if(t.LINK&&t.NOMEARQUIVO)throw new Error(o.LINK_AND_FILE_AT_THE_SAME_TIME);if(!t.LINK&&!t.NOMEARQUIVO)throw new Error(o.ANY_LINK_OR_FILE_FILLED);if(!this.registerKey)throw new Error("Register key can not be null")},this.resourceID=window.resourceID||(null===(s=window.workspace)||void 0===s?void 0:s.resourceID)}async save(t){var e,i;const s="AnexoSistemaSP.salvar";let{updatingFields:n}=t;n=Object.assign(Object.assign({},n),{NOMEARQUIVO:null===(e=n.NOMEARQUIVO)||void 0===e?void 0:e[0]});try{this.validateFields(n);const t=n.LINK?null:n.NOMEARQUIVO,e={serviceName:s,requestBody:{params:{resourceID:this.resourceID,description:n.DESCRICAO,fileSelect:t?1:0,keySession:null===(i=null==t?void 0:t.properties)||void 0===i?void 0:i.fileNameTmp,nameAttach:null==t?void 0:t.name,link:n.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:n.TIPOACESSO,typeApres:n.TIPOAPRES}}},a=await r.get().callServiceBroker(s,JSON.stringify(e));return Promise.resolve([Object.assign(Object.assign(Object.assign({},a),n),{ARQUIVOOULINK:n.LINK?n.LINK:null==t?void 0:t.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}async edit(t){var e,i,s;const n="AnexoSistemaSP.salvar";let{updatingFields:a,record:o}=t;const h=t=>void 0!==a[t]?a[t]:o[t],d=h("NOMEARQUIVO"),l=null===(i=null===(e=a.NOMEARQUIVO)||void 0===e?void 0:e[0])||void 0===i?void 0:i.downloadURL;a=Object.assign(Object.assign({},a),{DESCRICAO:h("DESCRICAO"),LINK:h("LINK"),TIPOACESSO:h("TIPOACESSO"),TIPOAPRES:h("TIPOAPRES"),CHAVEARQUIVO:o.CHAVEARQUIVO,NOMEARQUIVO:null==d?void 0:d[0]});const c=a.LINK?null:a.NOMEARQUIVO;try{this.validateFields(a);const t={serviceName:n,requestBody:{params:{resourceID:this.resourceID,nuAttach:null==o?void 0:o.NUATTACH,description:a.DESCRICAO,fileSelect:l?1:0,keySession:null===(s=null==c?void 0:c.properties)||void 0===s?void 0:s.fileNameTmp,keyAttach:a.CHAVEARQUIVO,nameAttach:null==c?void 0:c.name,link:a.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:a.TIPOACESSO,typeApres:a.TIPOAPRES}}},e=await r.get().callServiceBroker(n,JSON.stringify(t));return Promise.resolve([Object.assign(Object.assign(Object.assign({},e),a),{ARQUIVOOULINK:a.LINK?a.LINK:null==c?void 0:c.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}delete(t){var e;const i="AnexoSistemaSP.excluir",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDelete:{keyAttach:t.CHAVEARQUIVO,nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}getDownloadKey(t){var e;const i="AnexoSistemaSP.baixar",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDown:{nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO,keyAttach:t.CHAVEARQUIVO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}}class m{constructor(t,e){this.entityName=t,this.getMessage=e,this._application=s.getContextValue("__SNK__APPLICATION__")}initLoaders(t,e,i){this.loader||(this.loader=t.dataLoader),t.dataLoader=(t,e)=>this.dataLoader(t,e),t.saveLoader=(t,s)=>this.saveLoader(s,e).then((t=>(t.length&&i(),t))),t.removeLoader=(t,s)=>this.removeLoader(t,s,e).then((t=>(t.length&&i(),t)))}dataLoader(t,e){return new Promise((i=>{this.loader(t,e).then((t=>{const e=((null==t?void 0:t.records)||[]).map((t=>{let e;return t.LINK||(e=[{name:t.NOMEARQUIVO}]),Object.assign(Object.assign({},t),{ARQUIVOOULINK:t.LINK?t.LINK:t.NOMEARQUIVO,NOMEARQUIVO:e})}));i(Object.assign(Object.assign({},t),{records:e}))}))}))}saveLoader(t,e){return new Promise((i=>{var s;const n=Array.isArray(t)?t[0]:{};((null===(s=null==n?void 0:n.record)||void 0===s?void 0:s.NUATTACH)>=0?e.edit.bind(e):e.save.bind(e))(n).then((t=>{i(t)})).catch((t=>t.message===o.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),i([])):t.message===o.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),i([])):t.message?(this._application.error(t.title||t.name,t.message),i([])):void i([])))}))}removeLoader(t,e,i){return new Promise((s=>{const{records:n}=t.getSelectionInfo();i.delete(n[0]).then((()=>s(e)))}))}getFilters(t){return[{name:"AttachmentsByPK",expression:"this.PKREGISTRO = :PKREGISTRO",params:[{name:"PKREGISTRO",dataType:n.TEXT,value:`${t}_${this.entityName}`}]}]}getInterceptions(t,e,i){return new Promise((s=>e.type===a.EDITION_CANCELED?t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(i.goToView(h.GRID),s(e)):s(void 0))):s(e):e.type===a.DATA_SAVED?(t.loadData(),s(e)):void s(e)))}}const u=s.getContextValue("__SNK__APPLICATION__"),v=t=>{var e,i;return null===(i=null===(e=null==u?void 0:u.messagesBuilder)||void 0===e?void 0:e.getMessage)||void 0===i?void 0:i.call(e,t,null)},A={DOWNLOAD:{hint:v("snkAttach.taskbar.titleDownload"),name:"DOWNLOAD",iconName:"file-download"},LINK:{hint:v("snkAttach.taskbar.titleLink"),name:"LINK",iconName:"launch"}},O=()=>{const t=[l.REMOVE,"DOWNLOAD","LINK"];return{getButtons:(t,e,i)=>{if((null==e?void 0:e.insertionMode)||(null==e?void 0:e.isDirty))return i.reverse();i.splice(i.indexOf(l.REFRESH),1);const{selectedRecord:s}=e||{},n=(null==s?void 0:s.LINK)?A.LINK:A.DOWNLOAD;i.splice(i.indexOf(l.DIVIDER)+1,0,l.REMOVE,n,l.DIVIDER);const a=Array.from(new Set(i.filter((t=>t!==l.CLONE))));return a.splice(a.indexOf(n)+1,0,l.DIVIDER),a},isEnabled:(e,i,s)=>{const n=void 0!==(null==i?void 0:i.selectedRecord);return!(t.includes(s)&&!n)}}},p={grid:{columns:[{name:"ARQUIVOOULINK",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"DHCAD",orderIndex:2,width:0},{name:"DHALTER",orderIndex:3,width:0},{name:"TIPOAPRES",orderIndex:4,width:0},{name:"TIPOACESSO",orderIndex:5,width:0},{name:"CODUSU",orderIndex:6,width:0},{name:"CODUSUALT",orderIndex:7,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",required:!0},{name:"TIPOAPRES",required:!0},{name:"TIPOACESSO",required:!0},{name:"LINK"},{name:"NOMEARQUIVO"}]}},k=class{constructor(i){t(this,i),this.back=e(this,"back",7),this.handleTaskbarClick=({detail:t})=>{if(["DOWNLOAD","LINK"].includes(t))return this.downloadAttachment(this.dataUnit.getSelectedRecord())},this.handleBack=()=>{this.dataUnit.cancelEdition().then((t=>{t&&this.back.emit()}))},this.handleFinish=()=>{if(!this.dataUnit.isDirty())return this.back.emit();this.dataUnit.saveData().then((()=>{this.showFinishedToast(),this.back.emit()}))},this.registerKey=void 0,this.entityName=void 0,this.messagesBuilder=void 0,this.dataUnit=void 0,this.crudConfig=void 0}registerKeyWatcher(t,e){var i;e!==t&&(this.returnToGridMode(),this._attachFetcher=new c(this.entityName,this.registerKey,null===(i=this.dataUnit)||void 0===i?void 0:i.name),this._dataUnitBuilder.initLoaders(this.dataUnit,this._attachFetcher,(()=>{this.returnToGridMode()})),this.dataUnit.loadData())}getMessage(t,e){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,e)}showFinishedToast(){this._application.info(this.getMessage("snkAttach.finishedMessage"),{iconName:"check"})}downloadAttachment(t){if(!t)throw new Error("Nenhum registro selecionado");t.LINK?window.open(`${t.LINK}`):this._attachFetcher.getDownloadKey(t).then((({chave:t})=>{window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${t.valor}&forcarDownload=S`)}))}returnToGridMode(){this.dataUnit.clearSelection(),this._crudElement&&this._crudElement.goToView(h.GRID)}loadAttachmentDataUnit(){var t;try{const e=this.dataUnit||(new d).getDataUnit("AnexoSistema","br.com.sankhya.core.v3.anexoSistema");return this._attachFetcher=new c(this.entityName,this.registerKey,null===(t=this.dataUnit)||void 0===t?void 0:t.name),e.metadata||e.loadMetadata().then((()=>{this.crudConfig=p})),this._dataUnitBuilder=new m(this.entityName,this.getMessage.bind(this)),e.addFilterProvider({getFilter:()=>this._dataUnitBuilder.getFilters(this.registerKey)}),e.addInterceptor({interceptAction:t=>this._dataUnitBuilder.getInterceptions(e,t,this._crudElement)}),this.dataUnit=e,this.dataUnit.loadData().then((()=>{this.disableEditFieldsNotInForm()})),this.dataUnit}catch(t){throw new Error("There was an error while creating the data unit")}}disableEditFieldsNotInForm(){var t;null===(t=this.crudConfig)||void 0===t||t.grid.columns.forEach((t=>{var e;const i=t.name;(null===(e=this.crudConfig)||void 0===e?void 0:e.form.fields.some((t=>t.name===i)))||this.dataUnit.disableField(i)}))}componentWillLoad(){this._application=s.getContextValue("__SNK__APPLICATION__"),this.loadAttachmentDataUnit()}render(){var t,e;return this.dataUnit?i("main",{class:"snk-attach__main"},i("header",{class:"snk-attach__header"},i("snk-simple-bar",{onExit:this.handleBack,messagesBuilder:this.messagesBuilder},i("div",{slot:"rightSlot"},i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkAttach.finish"),onClick:this.handleFinish})))),i("div",{class:"snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column"},i("div",{class:"ez-box__container"},i("snk-simple-crud",{ref:t=>this._crudElement=t,dataUnit:this.dataUnit,taskbarManager:O(),gridConfig:null===(t=this.crudConfig)||void 0===t?void 0:t.grid,formConfig:null===(e=this.crudConfig)||void 0===e?void 0:e.form,useCancelConfirm:!1,onActionClick:this.handleTaskbarClick},i("div",{slot:"snkSimpleCrudHeader"},i("div",{class:"ez-flex ez-flex--column"},i("span",{class:"ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium"},this.getMessage("snkAttach.title")),i("span",{class:"ez-text ez-text--medium ez-text--secondary"},this.getMessage("snkAttach.description")))))))):null}static get watchers(){return{registerKey:["registerKeyWatcher"]}}};k.style=".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}.snk-attach__main.sc-snk-attach{height:85%}.ez-box__container.sc-snk-attach{height:100%}";export{k as snk_attach}
|
1
|
+
import{r as t,c as e,h as i}from"./p-d2d301a6.js";import{ApplicationContext as s,DataType as n,Action as a}from"@sankhyalabs/core";import{D as r}from"./p-c9399ce6.js";import{S as o}from"./p-9e7d65a4.js";import{c as h}from"./p-4a78e118.js";import{D as d}from"./p-9713c75c.js";import{T as l}from"./p-c9841939.js";import"./p-112455b1.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"./p-688dcb4c.js";import"./p-5534e08c.js";import"./p-6dc031de.js";class c{constructor(t,e,i){var s;this.entityName=t,this.registerKey=e,this.dataUnitName=i,this.validateFields=t=>{if(t.LINK&&t.NOMEARQUIVO)throw new Error(o.LINK_AND_FILE_AT_THE_SAME_TIME);if(!t.LINK&&!t.NOMEARQUIVO)throw new Error(o.ANY_LINK_OR_FILE_FILLED);if(!this.registerKey)throw new Error("Register key can not be null")},this.resourceID=window.resourceID||(null===(s=window.workspace)||void 0===s?void 0:s.resourceID)}async save(t){var e,i;const s="AnexoSistemaSP.salvar";let{updatingFields:n}=t;n=Object.assign(Object.assign({},n),{NOMEARQUIVO:null===(e=n.NOMEARQUIVO)||void 0===e?void 0:e[0]});try{this.validateFields(n);const t=n.LINK?null:n.NOMEARQUIVO,e={serviceName:s,requestBody:{params:{resourceID:this.resourceID,description:n.DESCRICAO,fileSelect:t?1:0,keySession:null===(i=null==t?void 0:t.properties)||void 0===i?void 0:i.fileNameTmp,nameAttach:null==t?void 0:t.name,link:n.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:n.TIPOACESSO,typeApres:n.TIPOAPRES}}},a=await r.get().callServiceBroker(s,JSON.stringify(e));return Promise.resolve([Object.assign(Object.assign(Object.assign({},a),n),{ARQUIVOOULINK:n.LINK?n.LINK:null==t?void 0:t.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}async edit(t){var e,i,s;const n="AnexoSistemaSP.salvar";let{updatingFields:a,record:o}=t;const h=t=>void 0!==a[t]?a[t]:o[t],d=h("NOMEARQUIVO"),l=null===(i=null===(e=a.NOMEARQUIVO)||void 0===e?void 0:e[0])||void 0===i?void 0:i.downloadURL;a=Object.assign(Object.assign({},a),{DESCRICAO:h("DESCRICAO"),LINK:h("LINK"),TIPOACESSO:h("TIPOACESSO"),TIPOAPRES:h("TIPOAPRES"),CHAVEARQUIVO:o.CHAVEARQUIVO,NOMEARQUIVO:null==d?void 0:d[0]});const c=a.LINK?null:a.NOMEARQUIVO;try{this.validateFields(a);const t={serviceName:n,requestBody:{params:{resourceID:this.resourceID,nuAttach:null==o?void 0:o.NUATTACH,description:a.DESCRICAO,fileSelect:l?1:0,keySession:null===(s=null==c?void 0:c.properties)||void 0===s?void 0:s.fileNameTmp,keyAttach:a.CHAVEARQUIVO,nameAttach:null==c?void 0:c.name,link:a.LINK,nameEntity:this.entityName,pkEntity:this.registerKey,typeAcess:a.TIPOACESSO,typeApres:a.TIPOAPRES}}},e=await r.get().callServiceBroker(n,JSON.stringify(t));return Promise.resolve([Object.assign(Object.assign(Object.assign({},e),a),{ARQUIVOOULINK:a.LINK?a.LINK:null==c?void 0:c.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}delete(t){var e;const i="AnexoSistemaSP.excluir",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDelete:{keyAttach:t.CHAVEARQUIVO,nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}getDownloadKey(t){var e;const i="AnexoSistemaSP.baixar",s=(null===(e=t.NOMEARQUIVO)||void 0===e?void 0:e[0])||{},n={serviceName:i,requestBody:{paramsDown:{nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO,keyAttach:t.CHAVEARQUIVO}}};return new Promise(((t,e)=>{r.get().callServiceBroker(i,JSON.stringify(n)).then((e=>t(e))).catch((t=>e(t)))}))}}class m{constructor(t,e){this.entityName=t,this.getMessage=e,this._application=s.getContextValue("__SNK__APPLICATION__")}initLoaders(t,e,i){this.loader||(this.loader=t.dataLoader),t.dataLoader=(t,e)=>this.dataLoader(t,e),t.saveLoader=(t,s)=>this.saveLoader(s,e).then((t=>(t.length&&i(),t))),t.removeLoader=(t,s)=>this.removeLoader(t,s,e).then((t=>(t.length&&i(),t)))}dataLoader(t,e){return new Promise((i=>{this.loader(t,e).then((t=>{const e=((null==t?void 0:t.records)||[]).map((t=>{let e;return t.LINK||(e=[{name:t.NOMEARQUIVO}]),Object.assign(Object.assign({},t),{ARQUIVOOULINK:t.LINK?t.LINK:t.NOMEARQUIVO,NOMEARQUIVO:e})}));i(Object.assign(Object.assign({},t),{records:e}))}))}))}saveLoader(t,e){return new Promise((i=>{var s;const n=Array.isArray(t)?t[0]:{};((null===(s=null==n?void 0:n.record)||void 0===s?void 0:s.NUATTACH)>=0?e.edit.bind(e):e.save.bind(e))(n).then((t=>{i(t)})).catch((t=>t.message===o.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),i([])):t.message===o.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),i([])):t.message?(this._application.error(t.title||t.name,t.message),i([])):void i([])))}))}removeLoader(t,e,i){return new Promise((s=>{const{records:n}=t.getSelectionInfo();i.delete(n[0]).then((()=>s(e)))}))}getFilters(t){return[{name:"AttachmentsByPK",expression:"this.PKREGISTRO = :PKREGISTRO",params:[{name:"PKREGISTRO",dataType:n.TEXT,value:`${t}_${this.entityName}`}]}]}getInterceptions(t,e,i){return new Promise((s=>e.type===a.EDITION_CANCELED?t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(i.goToView(h.GRID),s(e)):s(void 0))):s(e):e.type===a.DATA_SAVED?(t.loadData(),s(e)):void s(e)))}}const u=s.getContextValue("__SNK__APPLICATION__"),v=t=>{var e,i;return null===(i=null===(e=null==u?void 0:u.messagesBuilder)||void 0===e?void 0:e.getMessage)||void 0===i?void 0:i.call(e,t,null)},A={DOWNLOAD:{hint:v("snkAttach.taskbar.titleDownload"),name:"DOWNLOAD",iconName:"file-download"},LINK:{hint:v("snkAttach.taskbar.titleLink"),name:"LINK",iconName:"launch"}},O=()=>{const t=[l.REMOVE,"DOWNLOAD","LINK"];return{getButtons:(t,e,i)=>{if((null==e?void 0:e.insertionMode)||(null==e?void 0:e.isDirty))return i.reverse();i.splice(i.indexOf(l.REFRESH),1);const{selectedRecord:s}=e||{},n=(null==s?void 0:s.LINK)?A.LINK:A.DOWNLOAD;i.splice(i.indexOf(l.DIVIDER)+1,0,l.REMOVE,n,l.DIVIDER);const a=Array.from(new Set(i.filter((t=>t!==l.CLONE))));return a.splice(a.indexOf(n)+1,0,l.DIVIDER),a},isEnabled:(e,i,s)=>{const n=void 0!==(null==i?void 0:i.selectedRecord);return!(t.includes(s)&&!n)}}},p={grid:{columns:[{name:"ARQUIVOOULINK",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"DHCAD",orderIndex:2,width:0},{name:"DHALTER",orderIndex:3,width:0},{name:"TIPOAPRES",orderIndex:4,width:0},{name:"TIPOACESSO",orderIndex:5,width:0},{name:"CODUSU",orderIndex:6,width:0},{name:"CODUSUALT",orderIndex:7,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",required:!0},{name:"TIPOAPRES",required:!0},{name:"TIPOACESSO",required:!0},{name:"LINK"},{name:"NOMEARQUIVO"}]}},k=class{constructor(i){t(this,i),this.back=e(this,"back",7),this.handleTaskbarClick=({detail:t})=>{if(["DOWNLOAD","LINK"].includes(t))return this.downloadAttachment(this.dataUnit.getSelectedRecord())},this.handleBack=()=>{this.dataUnit.cancelEdition().then((t=>{t&&this.back.emit()}))},this.handleFinish=()=>{if(!this.dataUnit.isDirty())return this.back.emit();this.dataUnit.saveData().then((()=>{this.showFinishedToast(),this.back.emit()}))},this.registerKey=void 0,this.entityName=void 0,this.messagesBuilder=void 0,this.dataUnit=void 0,this.crudConfig=void 0}registerKeyWatcher(t,e){var i;e!==t&&(this.returnToGridMode(),this._attachFetcher=new c(this.entityName,this.registerKey,null===(i=this.dataUnit)||void 0===i?void 0:i.name),this._dataUnitBuilder.initLoaders(this.dataUnit,this._attachFetcher,(()=>{this.returnToGridMode()})),this.dataUnit.loadData())}getMessage(t,e){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,e)}showFinishedToast(){this._application.info(this.getMessage("snkAttach.finishedMessage"),{iconName:"check"})}downloadAttachment(t){if(!t)throw new Error("Nenhum registro selecionado");t.LINK?window.open(`${t.LINK}`):this._attachFetcher.getDownloadKey(t).then((({chave:t})=>{window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${t.valor}&forcarDownload=S`)}))}returnToGridMode(){this.dataUnit.clearSelection(),this._crudElement&&this._crudElement.goToView(h.GRID)}loadAttachmentDataUnit(){var t;try{const e=this.dataUnit||(new d).getDataUnit("AnexoSistema","br.com.sankhya.core.v3.anexoSistema");return this._attachFetcher=new c(this.entityName,this.registerKey,null===(t=this.dataUnit)||void 0===t?void 0:t.name),e.metadata||e.loadMetadata().then((()=>{this.crudConfig=p})),this._dataUnitBuilder=new m(this.entityName,this.getMessage.bind(this)),e.addFilterProvider({getFilter:()=>this._dataUnitBuilder.getFilters(this.registerKey)}),e.addInterceptor({interceptAction:t=>this._dataUnitBuilder.getInterceptions(e,t,this._crudElement)}),this.dataUnit=e,this.dataUnit.loadData().then((()=>{this.disableEditFieldsNotInForm()})),this.dataUnit}catch(t){throw new Error("There was an error while creating the data unit")}}disableEditFieldsNotInForm(){var t;null===(t=this.crudConfig)||void 0===t||t.grid.columns.forEach((t=>{var e;const i=t.name;(null===(e=this.crudConfig)||void 0===e?void 0:e.form.fields.some((t=>t.name===i)))||this.dataUnit.disableField(i)}))}componentWillLoad(){this._application=s.getContextValue("__SNK__APPLICATION__"),this.loadAttachmentDataUnit()}render(){var t,e;return this.dataUnit?i("main",{class:"snk-attach__main"},i("header",{class:"snk-attach__header"},i("snk-simple-bar",{onExit:this.handleBack,messagesBuilder:this.messagesBuilder},i("div",{slot:"rightSlot"},i("ez-button",{class:"ez-button--primary",label:this.getMessage("snkAttach.finish"),onClick:this.handleFinish})))),i("div",{class:"snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column"},i("div",{class:"ez-box__container"},i("snk-simple-crud",{ref:t=>this._crudElement=t,dataUnit:this.dataUnit,taskbarManager:O(),gridConfig:null===(t=this.crudConfig)||void 0===t?void 0:t.grid,formConfig:null===(e=this.crudConfig)||void 0===e?void 0:e.form,useCancelConfirm:!1,onActionClick:this.handleTaskbarClick},i("div",{slot:"snkSimpleCrudHeader"},i("div",{class:"ez-flex ez-flex--column"},i("span",{class:"ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium"},this.getMessage("snkAttach.title")),i("span",{class:"ez-text ez-text--medium ez-text--secondary"},this.getMessage("snkAttach.description")))))))):null}static get watchers(){return{registerKey:["registerKeyWatcher"]}}};k.style=".snk-attach__header.sc-snk-attach,.snk-attach__crud-section.sc-snk-attach{padding:0 var(--space--lg)}.snk-attach__file-info.sc-snk-attach{padding:var(--space--small);max-width:50%}.snk-attach__main.sc-snk-attach{height:85%}.ez-box__container.sc-snk-attach{height:100%}";export{k as snk_attach}
|