@sankhyalabs/sankhyablocks 8.5.1 → 8.5.2-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-c26705cc.js → ConfigStorage-bbffce76.js} +2 -2
- package/dist/cjs/{DataFetcher-3f9e6ee2.js → DataFetcher-0cc561bc.js} +2 -2
- package/dist/cjs/{SnkFormConfigManager-12cd719b.js → SnkFormConfigManager-c49af777.js} +2 -2
- package/dist/cjs/{auth-fetcher-8ba4a15e.js → auth-fetcher-fff2319e.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-f4023df4.js → dataunit-fetcher-16b32d96.js} +1 -1
- package/dist/cjs/{form-config-fetcher-037d16de.js → form-config-fetcher-35752aad.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-b5b42098.js → pesquisa-fetcher-415eab63.js} +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +3 -3
- package/dist/cjs/snk-application.cjs.entry.js +16 -9
- package/dist/cjs/snk-attach.cjs.entry.js +2 -2
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -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 +3 -3
- package/dist/cjs/{snk-guides-viewer-2c68848e.js → snk-guides-viewer-36b39c9c.js} +4 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +3 -3
- package/dist/collection/components/snk-application/snk-application.js +10 -3
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/index.js +3 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js +3 -2
- package/dist/components/DataFetcher.js +2 -2
- package/dist/components/snk-application2.js +10 -3
- package/dist/components/snk-data-exporter2.js +5 -3
- package/dist/esm/{ConfigStorage-a4720a6a.js → ConfigStorage-80ca14d5.js} +2 -2
- package/dist/esm/{DataFetcher-bc95bc22.js → DataFetcher-044e3988.js} +2 -2
- package/dist/esm/{SnkFormConfigManager-c470c66a.js → SnkFormConfigManager-1a8b3a44.js} +2 -2
- package/dist/esm/{auth-fetcher-c76146d0.js → auth-fetcher-1b378f8e.js} +1 -1
- package/dist/esm/{dataunit-fetcher-b64f839d.js → dataunit-fetcher-e0361781.js} +1 -1
- package/dist/esm/{form-config-fetcher-5df96b19.js → form-config-fetcher-c702e9e3.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-7e282f7e.js → pesquisa-fetcher-d1b4e5a2.js} +1 -1
- package/dist/esm/snk-actions-button.entry.js +3 -3
- package/dist/esm/snk-application.entry.js +16 -9
- package/dist/esm/snk-attach.entry.js +2 -2
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +6 -4
- package/dist/esm/snk-detail-view.entry.js +6 -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 +3 -3
- package/dist/esm/{snk-guides-viewer-b2b75165.js → snk-guides-viewer-767ad354.js} +4 -4
- package/dist/esm/snk-guides-viewer.entry.js +6 -6
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +3 -3
- package/dist/sankhyablocks/{p-a78a4c71.entry.js → p-15578509.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1386c7f8.js → p-2043a64f.js} +1 -1
- package/dist/sankhyablocks/{p-62e95771.entry.js → p-251985c1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5f0a3361.entry.js → p-3c1759ba.entry.js} +1 -1
- package/dist/sankhyablocks/{p-35ae5f31.entry.js → p-3ef37b31.entry.js} +1 -1
- package/dist/sankhyablocks/{p-38faeb78.js → p-473c7df4.js} +1 -1
- package/dist/sankhyablocks/{p-e0c68cfc.entry.js → p-7125c08e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ff7002d5.entry.js → p-727b8cbe.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c5cb4981.js → p-76926391.js} +2 -2
- package/dist/sankhyablocks/{p-d567e5ce.js → p-77aebc26.js} +1 -1
- package/dist/sankhyablocks/{p-c203ce53.entry.js → p-845c7480.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b28f0ae0.js → p-867e9b79.js} +1 -1
- package/dist/sankhyablocks/{p-267e8015.entry.js → p-8d1602f2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2d31c988.entry.js → p-90c07587.entry.js} +1 -1
- package/dist/sankhyablocks/{p-45547a32.entry.js → p-98ae8ddc.entry.js} +1 -1
- package/dist/sankhyablocks/{p-88a24c25.entry.js → p-9de24cf3.entry.js} +1 -1
- package/dist/sankhyablocks/{p-761ccda4.js → p-a2c7c45f.js} +1 -1
- package/dist/sankhyablocks/{p-5bff3564.js → p-af86752b.js} +1 -1
- package/dist/sankhyablocks/p-b6d54b6c.entry.js +1 -0
- package/dist/sankhyablocks/p-cd3171a8.entry.js +1 -0
- package/dist/sankhyablocks/{p-1d63beb6.js → p-d5b11196.js} +1 -1
- package/dist/sankhyablocks/{p-34674758.entry.js → p-e46dd27b.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7b66470d.entry.js → p-e51dd622.entry.js} +2 -2
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +5 -1
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/package.json +1 -1
- package/dist/sankhyablocks/p-376c885b.entry.js +0 -1
- package/dist/sankhyablocks/p-dff866ca.entry.js +0 -1
@@ -6522,7 +6522,6 @@ var __asyncValues = (undefined && undefined.__asyncValues) || function (o) {
|
|
6522
6522
|
};
|
6523
6523
|
class DataFetcher {
|
6524
6524
|
constructor() {
|
6525
|
-
this.GRAPHQL_PATH = `/${window.MGE_MODULE_NAME || 'mgefin-bff'}/graphql`;
|
6526
6525
|
this.ready = true;
|
6527
6526
|
this.watingRequestsById = new Map();
|
6528
6527
|
}
|
@@ -6542,6 +6541,7 @@ class DataFetcher {
|
|
6542
6541
|
}
|
6543
6542
|
}
|
6544
6543
|
this.instance.application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
6544
|
+
this.instance.graphqlPath = `/${this.instance.application.getModuleName()}/graphql`;
|
6545
6545
|
return this.instance;
|
6546
6546
|
}
|
6547
6547
|
static addRequestListener(listener) {
|
@@ -6871,7 +6871,7 @@ class DataFetcher {
|
|
6871
6871
|
let res = undefined;
|
6872
6872
|
let dataResponse = [];
|
6873
6873
|
let errorsResponse = [];
|
6874
|
-
let url = `${this.resolveURL() + this.
|
6874
|
+
let url = `${this.resolveURL() + this.graphqlPath}`;
|
6875
6875
|
const responseExtensions = [];
|
6876
6876
|
if (window['mgeSession']) {
|
6877
6877
|
url += `?mgeSession=${window['mgeSession']}`;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-80ca14d5.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-c702e9e3.js';
|
4
4
|
|
5
5
|
class SnkFormConfigManager {
|
6
6
|
constructor(configName, resourceID, onConfigChange) {
|
@@ -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-c702e9e3.js';
|
3
3
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
5
5
|
getData(resourceID) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { DataUnit, StringUtils, DataType, DataUnitStorage, ChangeOperation } from '@sankhyalabs/core';
|
2
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
2
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-044e3988.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
|
|
@@ -1,14 +1,14 @@
|
|
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-044e3988.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './pesquisa-fetcher-
|
5
|
+
import './pesquisa-fetcher-d1b4e5a2.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
10
|
import './filter-item-type.enum-5028ed3f.js';
|
11
|
-
import './form-config-fetcher-
|
11
|
+
import './form-config-fetcher-c702e9e3.js';
|
12
12
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
13
13
|
import './_commonjsHelpers-9943807e.js';
|
14
14
|
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-80ca14d5.js';
|
5
|
+
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-044e3988.js';
|
6
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-1b378f8e.js';
|
7
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher-e0361781.js';
|
8
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-d1b4e5a2.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
|
10
|
-
import './form-config-fetcher-
|
10
|
+
import './form-config-fetcher-c702e9e3.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';
|
@@ -818,16 +818,23 @@ const SnkApplication = class {
|
|
818
818
|
});
|
819
819
|
}
|
820
820
|
/**
|
821
|
-
|
821
|
+
* Retorna o path relativo da aplicação.
|
822
822
|
*/
|
823
|
-
getApplicationPath() {
|
823
|
+
async getApplicationPath() {
|
824
824
|
return new Promise((resolve) => {
|
825
825
|
if (window['applicationenv'] !== "dev") {
|
826
|
-
resolve(`/${
|
826
|
+
resolve(`/${this.getModuleName()}/labsApps/${window["APPLICATION_NAME"]}/build`);
|
827
|
+
return;
|
827
828
|
}
|
828
829
|
resolve('');
|
829
830
|
});
|
830
831
|
}
|
832
|
+
/**
|
833
|
+
* Retorna o contexto Sankhya-om da aplicação.
|
834
|
+
*/
|
835
|
+
getModuleName() {
|
836
|
+
return window["MGE_MODULE_NAME"] || 'mgefin-bff';
|
837
|
+
}
|
831
838
|
/**
|
832
839
|
* Com base em um campo realiza um "select distinct" respeitando os
|
833
840
|
* filtros atuais do dataUnit e um critério de filtro para a própria
|
@@ -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-044e3988.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-e0361781.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,16 +1,16 @@
|
|
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-044e3988.js';
|
5
|
+
import './pesquisa-fetcher-d1b4e5a2.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
10
|
import './filter-item-type.enum-5028ed3f.js';
|
11
|
-
import './form-config-fetcher-
|
11
|
+
import './form-config-fetcher-c702e9e3.js';
|
12
12
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
13
|
-
import { A as AutorizationType } from './auth-fetcher-
|
13
|
+
import { A as AutorizationType } from './auth-fetcher-1b378f8e.js';
|
14
14
|
import './index-bdf75557.js';
|
15
15
|
import './_commonjsHelpers-9943807e.js';
|
16
16
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
|
-
import {
|
2
|
+
import { ApplicationContext, ObjectUtils, DataType, ElementIDUtils } from '@sankhyalabs/core';
|
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-044e3988.js';
|
7
7
|
import { S as SnkDataUnit } from './snk-data-unit-2d34567d.js';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -163,7 +163,8 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
163
163
|
};
|
164
164
|
function fetchDataExporter(_a) {
|
165
165
|
var { methodName } = _a, requestBody = __rest(_a, ["methodName"]);
|
166
|
-
const
|
166
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
167
|
+
const serviceName = `${application.getModuleName()}@DataExporterSPBean.${methodName}`;
|
167
168
|
const payload = { serviceName, requestBody };
|
168
169
|
return new Promise((resolve, reject) => {
|
169
170
|
DataFetcher.get()
|
@@ -192,7 +193,8 @@ function fileViewer({ fileSessionKey, isDownload }) {
|
|
192
193
|
}
|
193
194
|
|
194
195
|
function getPersonalizedReports(requestBody) {
|
195
|
-
const
|
196
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
197
|
+
const serviceName = `${application.getModuleName()}@DataExporterSPBean.getPersonalizedReports`;
|
196
198
|
const payload = { serviceName, requestBody };
|
197
199
|
return new Promise((resolve, reject) => (DataFetcher.get()
|
198
200
|
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
@@ -1,20 +1,20 @@
|
|
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-1a8b3a44.js';
|
3
3
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
4
|
-
import './DataFetcher-
|
5
|
-
import './pesquisa-fetcher-
|
4
|
+
import './DataFetcher-044e3988.js';
|
5
|
+
import './pesquisa-fetcher-d1b4e5a2.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
11
|
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-c702e9e3.js';
|
13
13
|
import { T as TaskbarElement } from './taskbar-elements-0a6b8b95.js';
|
14
14
|
import { c as VIEW_MODE } from './constants-3644f1b6.js';
|
15
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
15
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-767ad354.js';
|
16
16
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-68c1c25a.js';
|
17
|
-
import './ConfigStorage-
|
17
|
+
import './ConfigStorage-80ca14d5.js';
|
18
18
|
import './_commonjsHelpers-9943807e.js';
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
20
20
|
import './index-bdf75557.js';
|
@@ -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-80ca14d5.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-c702e9e3.js';
|
11
|
+
import './DataFetcher-044e3988.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-80ca14d5.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-c702e9e3.js';
|
8
|
+
import './DataFetcher-044e3988.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-c702e9e3.js';
|
7
7
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
8
8
|
import './_commonjsHelpers-9943807e.js';
|
9
|
-
import './DataFetcher-
|
9
|
+
import './DataFetcher-044e3988.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-1a8b3a44.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-80ca14d5.js';
|
6
|
+
import './form-config-fetcher-c702e9e3.js';
|
7
|
+
import './DataFetcher-044e3988.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-80ca14d5.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-c702e9e3.js';
|
8
|
+
import './DataFetcher-044e3988.js';
|
9
9
|
import './_commonjsHelpers-9943807e.js';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -2,14 +2,14 @@ import { r as registerInstance, c as createEvent, h, g as getElement } from './i
|
|
2
2
|
import { 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-80ca14d5.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
9
|
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-892f37f9.js';
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
|
-
import './form-config-fetcher-
|
12
|
-
import './DataFetcher-
|
11
|
+
import './form-config-fetcher-c702e9e3.js';
|
12
|
+
import './DataFetcher-044e3988.js';
|
13
13
|
import './_commonjsHelpers-9943807e.js';
|
14
14
|
import './PrintUtils-3e4ff0f5.js';
|
15
15
|
import './filter-item-type.enum-5028ed3f.js';
|
@@ -1,18 +1,18 @@
|
|
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-1a8b3a44.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-044e3988.js';
|
9
|
+
import './pesquisa-fetcher-d1b4e5a2.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
14
|
import './filter-item-type.enum-5028ed3f.js';
|
15
|
-
import './form-config-fetcher-
|
15
|
+
import './form-config-fetcher-c702e9e3.js';
|
16
16
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
17
17
|
|
18
18
|
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-767ad354.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-1a8b3a44.js';
|
5
|
+
import './ConfigStorage-80ca14d5.js';
|
6
|
+
import './form-config-fetcher-c702e9e3.js';
|
7
|
+
import './DataFetcher-044e3988.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,7 @@ 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-d1b4e5a2.js';
|
19
19
|
import './ISave-4412b20c.js';
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
21
21
|
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-80ca14d5.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-c702e9e3.js';
|
10
|
+
import './DataFetcher-044e3988.js';
|
11
11
|
import './_commonjsHelpers-9943807e.js';
|
12
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
13
13
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -2,14 +2,14 @@ import { r as registerInstance, c as createEvent, h, g as getElement } from './i
|
|
2
2
|
import { DataUnit, defaultDataLoader, StringUtils, ChangeOperation, 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-044e3988.js';
|
6
|
+
import './pesquisa-fetcher-d1b4e5a2.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
11
|
import './filter-item-type.enum-5028ed3f.js';
|
12
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-c702e9e3.js';
|
13
13
|
import { T as TaskbarProcessor } from './taskbar-processor-94402e6e.js';
|
14
14
|
import { S as SnkMultiSelectionListDataSource } from './SnkMultiSelectionListDataSource-892f37f9.js';
|
15
15
|
import './index-bdf75557.js';
|
@@ -1 +1 @@
|
|
1
|
-
import{r as t,h as s,H as i,g as e}from"./p-d2d301a6.js";import{ApplicationContext as n,StringUtils as o,ErrorException as a,WarningException as c,ObjectUtils as r,DateUtils as l,ArrayUtils as h,ElementIDUtils as u}from"@sankhyalabs/core";import{D as d}from"./p-1386c7f8.js";import{P as p}from"./p-eaad0aa8.js";import"./p-c5cb4981.js";import"./p-5534e08c.js";import"./p-9e7d65a4.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-584d7212.js";import"./p-5bff3564.js";import{R as m}from"./p-688dcb4c.js";import"./p-112455b1.js";import"./p-8d884fab.js";class v{execute(t){var s;const i={actionID:t.actionID,refreshType:null===(s=t.actionConfig.javaCall)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:i,callback:this.callExecJava})}))}callExecJava(t){const s={requestBody:{javaCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeJava",JSON.stringify(s))}}class b{execute(t){var s;const i={actionID:t.actionID,refreshType:null===(s=t.actionConfig.runScript)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:i,callback:this.callExecScript})}))}callExecScript(t){const s={runScript:t};d.get().callServiceBroker("ActionButtonsSP.executeScript",s)}}class k{constructor(){this._application=n.getContextValue("__SNK__APPLICATION__")}async execute(t,s){const i=t.resourceID;if(!i)return;let e=await this.buildLaunchObject(t,s);return this._application.openApp(i,e),null}buildLaunchObject(t,s){return new Promise((i=>{let e=t.actionConfig.params.param;if(e&&e.length>0){let n={},c=[];e.forEach((i=>{const e=i.localField;let r=s.getFieldValue(e);if(!r){let i=s.getField(e).label;throw i=o.isEmpty(s.getField(e).label)?e:i,new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField",{description:t.description,localFieldLabel:i}))}r=o.isEmpty(r.toString())?void 0:r.toString(),n[i.targetField]=r,c.push({fieldName:i.targetField,value:r})})),n.ACTION_PARAMETERS=c,n.call_time=Date.now(),i(n)}i(null)}))}}class f{execute(t){var s,i,e;const n=null===(s=t.actionConfig.dbCall)||void 0===s?void 0:s.name,o=null===(i=t.actionConfig.dbCall)||void 0===i?void 0:i.rootEntity,a={actionID:t.actionID,refreshType:null===(e=t.actionConfig.dbCall)||void 0===e?void 0:e.refreshType,procName:n,rootEntity:o};return new Promise((t=>{t({execSource:a,callback:this.callExecProcedure})}))}callExecProcedure(t){const s={requestBody:{stpCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeSTP",JSON.stringify(s))}}var w,_;!function(t){t.LAUNCH_SCREEN="LC",t.JAVASCRIPT="SC",t.JAVA="RJ",t.PROCEDURE="SP",t.EMBEDDED="EB"}(w||(w={}));class S{constructor(t){this.actionType=t,this._application=n.getContextValue("__SNK__APPLICATION__")}get executor(){switch(this.actionType){case w.LAUNCH_SCREEN:return new k;case w.JAVASCRIPT:return new b;case w.JAVA:return new v;case w.PROCEDURE:return new f;default:throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.nonExistentType",{actionType:this.actionType}))}}}!function(t){t.NONE="NONE",t.PARENT="PARENT",t.MASTER="MASTER",t.ALL="ALL"}(_||(_={}));const y="__MASTER_ROW__";class P{constructor(t,s,i){var e;this._lastValuesCache={},this._actionsExecuteInterface=t,this._dataUnit=s,this._selectedRows=(null===(e=null==s?void 0:s.getSelectionInfo())||void 0===e?void 0:e.isAllRecords())?[]:null==s?void 0:s.getSelectionInfo().records,this._application=n.getContextValue("__SNK__APPLICATION__"),this._appResourceId=i}apply(t,s){this._application.closePopUp(),this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:i,callback:e})=>{this.resolvePromptParams(t,i,s).then((()=>{this.actionExecute(i,e)}))}))}async execute(t){var s;if(!t.actionConfig)throw new c(this._application.messagesBuilder.getMessage("snkActionsButton.title.warning",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.incorrectAction",{description:t.description}));if(null===(s=t.actionConfig.params)||void 0===s?void 0:s.promptParam){const s=t.actionConfig.params.promptParam;let i=!1;for(let t=0;t<s.length;t++)if(!i&&"true"===s[t].saveLast){i=!0;break}i&&(t.actionConfig.params.promptParam=await this.loadSavedValuesIntoParams(t));const e=document.createElement("snk-actions-form");window.document.body.appendChild(e),e.action=r.copy(t),e.applyParameters=t=>{this.apply(t,i)},e.openPopup()}else t.type!=w.LAUNCH_SCREEN?this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:t,callback:s})=>{this.actionExecute(t,s)})):this._actionsExecuteInterface.execute(t,this._dataUnit)}loadSavedValuesIntoParams(t){return this.loadLastValues(t).then((s=>{let i=t.actionConfig.params.promptParam;return s&&s.param.forEach((t=>{i=i.map((s=>s.name!==t.paramName?s:Object.assign(Object.assign({},s),"B"===s.paramType?{value:"S"===t.$}:{value:t.$})))})),i}))}actionExecute(t,s){t.virtualPage=this.buildVirtualPage(),this.prepareAndExecute(t,s),this.recordsReloader(t.refreshType)}resolvePromptParams(t,s,i){return new Promise((e=>{let n=[];t.actionConfig.params.promptParam.forEach((t=>{n.push(this.buildPromptParam(t))})),this.putParamsOnExecSource(n,s),i&&this.saveLastValues(t,n),e()}))}buildPromptParam(t){let s,i,e=t.paramType,n=!1,o=t.value;switch(e){case p.DATE:e="D";break;case p.DATETIME:e="H";break;case p.DECIMAL:e="F",s={"sk-precision":Number(t.precision)};break;case p.BOOLEAN:e="S",n=!0,o=t.value?"S":"N";break;case p.ENTITY:s={"sk-entity-name":t.entityName,"sk-allow-show-hierarchical-mode":t.hierarchyEntity,"sk-data-type":"S"},t.hierarchyEntity&&t.entityPK&&(i=t.entityPK),o=t.value?Number(t.value):null;break;case p.OPTIONS:e="O";let a=t.options.split(";").map((function(t,s){let i,e;if(t.indexOf("=")>-1){let s=t.split("=");i=s[0],e=s[1]}else i=s+1,e=t;return{data:i,value:e}}));s={"sk-options":a}}return{description:t.label,required:"true"==t.required,fieldName:t.name,fieldNameOri:t.name,entityPK:i,paramType:t.paramType,type:e,isCheckbox:n,saveLast:t.saveLast,fieldProp:s,value:o,isGeneratedName:t.isGeneratedName}}putParamsOnExecSource(t,s){s.params={param:[]},t.forEach((t=>{if(t.isGeneratedName&&t.value)throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.emptyParamName",void 0));o.isEmpty(t.value)||s.params.param.push({type:this.getParamDataType(t.paramType),paramName:t.fieldName,$:this.getParamValue(t)})}))}getParamDataType(t){let s;switch(t){case"D":s="F";break;case"DT":case"DH":s="D";break;case"B":case"ENTITY":case"SO":s="S";break;default:s=t}return s}getParamValue(t){let s=t.value;return s?("DT"==t.paramType?s=l.formatDate(s):"DH"==t.paramType&&(s=l.formatDateTime(s)),s):s}async loadLastValues(t){const s=await this.buildResourceId(t.actionID);return new Promise(((t,i)=>{if(this._lastValuesCache[s])t(this._lastValuesCache[s]);else{const e={config:{chave:s,tipo:"T"}};d.get().callServiceBroker("SystemUtilsSP.getConf",e).then((i=>{var e,n;let o;(null===(n=null===(e=i.config)||void 0===e?void 0:e.data)||void 0===n?void 0:n.params)&&(o=i.config.data.params,Array.isArray(o.param)||(o.param=[o.param])),this._lastValuesCache[s]=o,t(o)})).catch((t=>{i(t)}))}}))}async saveLastValues(t,s){if(this._application){let i={params:{param:[]}};s.forEach((t=>{"true"==t.saveLast&&i.params.param.push({paramName:t.fieldName,$:t.value})}));const e=await this.buildResourceId(t.actionID);this._lastValuesCache[e]=i.params,this._application.saveConfig(e,i)}}async buildResourceId(t){return this._appResourceId+".actionconfig."+t}prepareAndExecute(t,s){this.addRows(t),s(t)}addRows(t){const s={row:[]},i=this._selectedRows;for(const t in i){const e=i[t],n={};e.hasOwnProperty(y)&&(n.master="S",n.entityName=e.__ENTITY_NAME__,delete e[y],delete e.__ENTITY_NAME__);for(const t in e)"NUFIN"===t&&(n.field||(n.field=[]),n.field.push({fieldName:t,$:e[t]}));s.row.push(n)}s.row.length>0&&(t.rows=s)}recordsReloader(t){switch(t){case _.NONE:break;case _.PARENT:case _.MASTER:case _.ALL:this._dataUnit.loadData();break;default:this._dataUnit.reloadCurrentRecord()}}buildVirtualPage(){var t,s,i,e;if(null===(s=null===(t=this._dataUnit)||void 0===t?void 0:t.getSelectionInfo())||void 0===s?void 0:s.isAllRecords())return{filters:{filters:null===(i=this._dataUnit)||void 0===i?void 0:i.getAppliedFilters()},orders:{orders:null===(e=this._dataUnit)||void 0===e?void 0:e.getSort()}}}}class A{clientConfirm(t,s){const i=n.getContextValue("__SNK__APPLICATION__");let e="";t.content.event.hasOwnProperty("stpCall")?(s.requestBody=t.content.event.stpCall,e=w.PROCEDURE):t.content.event.hasOwnProperty("runScript")?(s.requestBody=t.content.event.runScript,e=w.JAVASCRIPT):t.content.event.hasOwnProperty("javaCall")&&(s.requestBody=t.content.event.javaCall,e=w.JAVA);let o={type:"S",sequence:t.content.event.sequence};s.requestBody.params?Array.isArray(s.requestBody.params.param)||(s.requestBody.params.param=[s.requestBody.params.param]):s.requestBody.params={param:[]},s.requestBody.params.param.push(o);const a=t.content.event.title.$,c=t.content.event.message.$;let r;switch(e){case w.JAVASCRIPT:r={runScript:s.requestBody};break;case w.PROCEDURE:r={requestBody:{stpCall:s.requestBody}};break;case w.JAVA:r={requestBody:{javaCall:s.requestBody}}}if("S"==t.content.event.showNoOption){o.paramName="__ESCOLHA_SIMNAO__";const t=document.createElement("snk-client-confirm");window.document.body.appendChild(t),t.titleMessage=a,t.message=c,t.accept=()=>{o.$="S",s.reCall(r)},t.cancel=()=>{o.$="N",s.reCall(r)},t.openPopup()}else i.confirm(a,c,null,"warn",{labelCancel:"Cancelar",labelConfirm:"Sim"}).then((t=>{t&&(o.paramName="__CONFIRMACAO__",o.$="S",s.reCall(r))}))}}const N=class{constructor(s){t(this,s),this.CLIENT_EVENT_CONFIRM_NAME="br.com.sankhya.actionbutton.clientconfirm",this.handleClick=t=>{const s=this._actions.find((s=>s.actionID==t.detail.id)),i=new S(s.type).executor;new P(i,this._dataUnit,this._resourceID).execute(Object.assign({},s)),this._showDropdown=!1},this._items=[],this._showDropdown=!1,this._actions=[],this._isOrderActions=!1}async getActions(){let t={param:{entityName:this._entityName,resourceID:this._resourceID}};return d.get().callServiceBroker("ActionButtonsSP.getActions",t).then((t=>{var s;(null===(s=t.actions)||void 0===s?void 0:s.action)&&(this._actions=this._isOrderActions?h.sortAlphabetically(t.actions.action,"description"):t.actions.action)}))}controlDropdown(){this._showDropdown=!this._showDropdown}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}positionDropdown(){var t;const s=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();s&&this._dropdownParent&&(this._dropdownParent.style.top=s.y+s.height+5+"px",this._dropdownParent.style.left=s.x+"px")}closeDropdown(t){const s=null==t?void 0:t.target;s&&(s.closest(".snk-actions-button")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}async componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__"),this._isOrderActions=await this._application.getBooleanParam("global.ordenar.acoes.personalizadas");const t=this._element.parentElement;this._dataUnit=null==t?void 0:t.dataUnit,this._resourceID=null==t?void 0:t.resourceID,this._entityName=this._dataUnit.name.split("/")[2],null==this._resourceID&&(this._resourceID=await m.getResourceID()),this.setEvents(),this.getActions().then((()=>{this.loadItems()}))}async componentDidLoad(){if(this._element&&(u.addIDInfo(this._element),this.positionDropdown(),!await this._application.hasClientEvent(this.CLIENT_EVENT_CONFIRM_NAME))){const t=new A;this._application.addClientEvent(this.CLIENT_EVENT_CONFIRM_NAME,t.clientConfirm)}}componentDidUpdate(){this.positionDropdown()}loadItems(){this._actions&&0!=this._actions.length&&this._actions.forEach((t=>{this._items.push({id:t.actionID,label:t.description})}))}getElementID(t){return{[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:u.getInternalIDInfo(t)}}render(){return s(i,null,this._actions&&this._actions.length>0&&s("div",{class:`ez-padding-left--medium snk-actions-button \n ${this.canShowDropdown()?" snk-actions-button--overlap":""}\n `},s("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"acao",size:"small",mode:"icon",title:this._application.messagesBuilder.getMessage("snkActionsButton.title.actions",void 0),onClick:()=>this.controlDropdown()},this.getElementID("button"))),s("div",Object.assign({ref:t=>this._dropdownParent=t,class:(this.canShowDropdown()?"snk-actions-button__dropdown--show":"snk-actions-button__dropdown")+"\n "},this.getElementID("dropdown")),this.canShowDropdown()&&s("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.handleClick(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&s("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))))}get _element(){return e(this)}};N.style=".sc-snk-actions-button-h{--snk-actions-button--z-index:var(--most-visible, 3);display:flex;width:fit-content;height:fit-content}.snk-actions-button.sc-snk-actions-button{display:flex;width:fit-content;height:fit-content}.snk-actions-button__dropdown--show.sc-snk-actions-button{display:flex;flex-direction:column;position:fixed}.snk-actions-button__dropdown.sc-snk-actions-button>ez-dropdown.sc-snk-actions-button{position:relative}.snk-actions-button--overlap.sc-snk-actions-button{z-index:var(--snk-actions-button--z-index)}.snk-actions-button__dropdown.sc-snk-actions-button{display:none}";export{N as snk_actions_button}
|
1
|
+
import{r as t,h as s,H as i,g as e}from"./p-d2d301a6.js";import{ApplicationContext as n,StringUtils as o,ErrorException as a,WarningException as c,ObjectUtils as r,DateUtils as l,ArrayUtils as h,ElementIDUtils as u}from"@sankhyalabs/core";import{D as d}from"./p-2043a64f.js";import{P as p}from"./p-eaad0aa8.js";import"./p-76926391.js";import"./p-5534e08c.js";import"./p-9e7d65a4.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-584d7212.js";import"./p-af86752b.js";import{R as m}from"./p-688dcb4c.js";import"./p-112455b1.js";import"./p-8d884fab.js";class v{execute(t){var s;const i={actionID:t.actionID,refreshType:null===(s=t.actionConfig.javaCall)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:i,callback:this.callExecJava})}))}callExecJava(t){const s={requestBody:{javaCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeJava",JSON.stringify(s))}}class b{execute(t){var s;const i={actionID:t.actionID,refreshType:null===(s=t.actionConfig.runScript)||void 0===s?void 0:s.refreshType};return new Promise((t=>{t({execSource:i,callback:this.callExecScript})}))}callExecScript(t){const s={runScript:t};d.get().callServiceBroker("ActionButtonsSP.executeScript",s)}}class k{constructor(){this._application=n.getContextValue("__SNK__APPLICATION__")}async execute(t,s){const i=t.resourceID;if(!i)return;let e=await this.buildLaunchObject(t,s);return this._application.openApp(i,e),null}buildLaunchObject(t,s){return new Promise((i=>{let e=t.actionConfig.params.param;if(e&&e.length>0){let n={},c=[];e.forEach((i=>{const e=i.localField;let r=s.getFieldValue(e);if(!r){let i=s.getField(e).label;throw i=o.isEmpty(s.getField(e).label)?e:i,new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.launchScreen.emptyField",{description:t.description,localFieldLabel:i}))}r=o.isEmpty(r.toString())?void 0:r.toString(),n[i.targetField]=r,c.push({fieldName:i.targetField,value:r})})),n.ACTION_PARAMETERS=c,n.call_time=Date.now(),i(n)}i(null)}))}}class w{execute(t){var s,i,e;const n=null===(s=t.actionConfig.dbCall)||void 0===s?void 0:s.name,o=null===(i=t.actionConfig.dbCall)||void 0===i?void 0:i.rootEntity,a={actionID:t.actionID,refreshType:null===(e=t.actionConfig.dbCall)||void 0===e?void 0:e.refreshType,procName:n,rootEntity:o};return new Promise((t=>{t({execSource:a,callback:this.callExecProcedure})}))}callExecProcedure(t){const s={requestBody:{stpCall:t}};d.get().callServiceBroker("ActionButtonsSP.executeSTP",JSON.stringify(s))}}var f,_;!function(t){t.LAUNCH_SCREEN="LC",t.JAVASCRIPT="SC",t.JAVA="RJ",t.PROCEDURE="SP",t.EMBEDDED="EB"}(f||(f={}));class S{constructor(t){this.actionType=t,this._application=n.getContextValue("__SNK__APPLICATION__")}get executor(){switch(this.actionType){case f.LAUNCH_SCREEN:return new k;case f.JAVASCRIPT:return new b;case f.JAVA:return new v;case f.PROCEDURE:return new w;default:throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.nonExistentType",{actionType:this.actionType}))}}}!function(t){t.NONE="NONE",t.PARENT="PARENT",t.MASTER="MASTER",t.ALL="ALL"}(_||(_={}));const y="__MASTER_ROW__";class P{constructor(t,s,i){var e;this._lastValuesCache={},this._actionsExecuteInterface=t,this._dataUnit=s,this._selectedRows=(null===(e=null==s?void 0:s.getSelectionInfo())||void 0===e?void 0:e.isAllRecords())?[]:null==s?void 0:s.getSelectionInfo().records,this._application=n.getContextValue("__SNK__APPLICATION__"),this._appResourceId=i}apply(t,s){this._application.closePopUp(),this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:i,callback:e})=>{this.resolvePromptParams(t,i,s).then((()=>{this.actionExecute(i,e)}))}))}async execute(t){var s;if(!t.actionConfig)throw new c(this._application.messagesBuilder.getMessage("snkActionsButton.title.warning",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.incorrectAction",{description:t.description}));if(null===(s=t.actionConfig.params)||void 0===s?void 0:s.promptParam){const s=t.actionConfig.params.promptParam;let i=!1;for(let t=0;t<s.length;t++)if(!i&&"true"===s[t].saveLast){i=!0;break}i&&(t.actionConfig.params.promptParam=await this.loadSavedValuesIntoParams(t));const e=document.createElement("snk-actions-form");window.document.body.appendChild(e),e.action=r.copy(t),e.applyParameters=t=>{this.apply(t,i)},e.openPopup()}else t.type!=f.LAUNCH_SCREEN?this._actionsExecuteInterface.execute(t,this._dataUnit).then((({execSource:t,callback:s})=>{this.actionExecute(t,s)})):this._actionsExecuteInterface.execute(t,this._dataUnit)}loadSavedValuesIntoParams(t){return this.loadLastValues(t).then((s=>{let i=t.actionConfig.params.promptParam;return s&&s.param.forEach((t=>{i=i.map((s=>s.name!==t.paramName?s:Object.assign(Object.assign({},s),"B"===s.paramType?{value:"S"===t.$}:{value:t.$})))})),i}))}actionExecute(t,s){t.virtualPage=this.buildVirtualPage(),this.prepareAndExecute(t,s),this.recordsReloader(t.refreshType)}resolvePromptParams(t,s,i){return new Promise((e=>{let n=[];t.actionConfig.params.promptParam.forEach((t=>{n.push(this.buildPromptParam(t))})),this.putParamsOnExecSource(n,s),i&&this.saveLastValues(t,n),e()}))}buildPromptParam(t){let s,i,e=t.paramType,n=!1,o=t.value;switch(e){case p.DATE:e="D";break;case p.DATETIME:e="H";break;case p.DECIMAL:e="F",s={"sk-precision":Number(t.precision)};break;case p.BOOLEAN:e="S",n=!0,o=t.value?"S":"N";break;case p.ENTITY:s={"sk-entity-name":t.entityName,"sk-allow-show-hierarchical-mode":t.hierarchyEntity,"sk-data-type":"S"},t.hierarchyEntity&&t.entityPK&&(i=t.entityPK),o=t.value?Number(t.value):null;break;case p.OPTIONS:e="O";let a=t.options.split(";").map((function(t,s){let i,e;if(t.indexOf("=")>-1){let s=t.split("=");i=s[0],e=s[1]}else i=s+1,e=t;return{data:i,value:e}}));s={"sk-options":a}}return{description:t.label,required:"true"==t.required,fieldName:t.name,fieldNameOri:t.name,entityPK:i,paramType:t.paramType,type:e,isCheckbox:n,saveLast:t.saveLast,fieldProp:s,value:o,isGeneratedName:t.isGeneratedName}}putParamsOnExecSource(t,s){s.params={param:[]},t.forEach((t=>{if(t.isGeneratedName&&t.value)throw new a(this._application.messagesBuilder.getMessage("snkActionsButton.title.error",void 0),this._application.messagesBuilder.getMessage("snkActionsButton.action.emptyParamName",void 0));o.isEmpty(t.value)||s.params.param.push({type:this.getParamDataType(t.paramType),paramName:t.fieldName,$:this.getParamValue(t)})}))}getParamDataType(t){let s;switch(t){case"D":s="F";break;case"DT":case"DH":s="D";break;case"B":case"ENTITY":case"SO":s="S";break;default:s=t}return s}getParamValue(t){let s=t.value;return s?("DT"==t.paramType?s=l.formatDate(s):"DH"==t.paramType&&(s=l.formatDateTime(s)),s):s}async loadLastValues(t){const s=await this.buildResourceId(t.actionID);return new Promise(((t,i)=>{if(this._lastValuesCache[s])t(this._lastValuesCache[s]);else{const e={config:{chave:s,tipo:"T"}};d.get().callServiceBroker("SystemUtilsSP.getConf",e).then((i=>{var e,n;let o;(null===(n=null===(e=i.config)||void 0===e?void 0:e.data)||void 0===n?void 0:n.params)&&(o=i.config.data.params,Array.isArray(o.param)||(o.param=[o.param])),this._lastValuesCache[s]=o,t(o)})).catch((t=>{i(t)}))}}))}async saveLastValues(t,s){if(this._application){let i={params:{param:[]}};s.forEach((t=>{"true"==t.saveLast&&i.params.param.push({paramName:t.fieldName,$:t.value})}));const e=await this.buildResourceId(t.actionID);this._lastValuesCache[e]=i.params,this._application.saveConfig(e,i)}}async buildResourceId(t){return this._appResourceId+".actionconfig."+t}prepareAndExecute(t,s){this.addRows(t),s(t)}addRows(t){const s={row:[]},i=this._selectedRows;for(const t in i){const e=i[t],n={};e.hasOwnProperty(y)&&(n.master="S",n.entityName=e.__ENTITY_NAME__,delete e[y],delete e.__ENTITY_NAME__);for(const t in e)"NUFIN"===t&&(n.field||(n.field=[]),n.field.push({fieldName:t,$:e[t]}));s.row.push(n)}s.row.length>0&&(t.rows=s)}recordsReloader(t){switch(t){case _.NONE:break;case _.PARENT:case _.MASTER:case _.ALL:this._dataUnit.loadData();break;default:this._dataUnit.reloadCurrentRecord()}}buildVirtualPage(){var t,s,i,e;if(null===(s=null===(t=this._dataUnit)||void 0===t?void 0:t.getSelectionInfo())||void 0===s?void 0:s.isAllRecords())return{filters:{filters:null===(i=this._dataUnit)||void 0===i?void 0:i.getAppliedFilters()},orders:{orders:null===(e=this._dataUnit)||void 0===e?void 0:e.getSort()}}}}class A{clientConfirm(t,s){const i=n.getContextValue("__SNK__APPLICATION__");let e="";t.content.event.hasOwnProperty("stpCall")?(s.requestBody=t.content.event.stpCall,e=f.PROCEDURE):t.content.event.hasOwnProperty("runScript")?(s.requestBody=t.content.event.runScript,e=f.JAVASCRIPT):t.content.event.hasOwnProperty("javaCall")&&(s.requestBody=t.content.event.javaCall,e=f.JAVA);let o={type:"S",sequence:t.content.event.sequence};s.requestBody.params?Array.isArray(s.requestBody.params.param)||(s.requestBody.params.param=[s.requestBody.params.param]):s.requestBody.params={param:[]},s.requestBody.params.param.push(o);const a=t.content.event.title.$,c=t.content.event.message.$;let r;switch(e){case f.JAVASCRIPT:r={runScript:s.requestBody};break;case f.PROCEDURE:r={requestBody:{stpCall:s.requestBody}};break;case f.JAVA:r={requestBody:{javaCall:s.requestBody}}}if("S"==t.content.event.showNoOption){o.paramName="__ESCOLHA_SIMNAO__";const t=document.createElement("snk-client-confirm");window.document.body.appendChild(t),t.titleMessage=a,t.message=c,t.accept=()=>{o.$="S",s.reCall(r)},t.cancel=()=>{o.$="N",s.reCall(r)},t.openPopup()}else i.confirm(a,c,null,"warn",{labelCancel:"Cancelar",labelConfirm:"Sim"}).then((t=>{t&&(o.paramName="__CONFIRMACAO__",o.$="S",s.reCall(r))}))}}const N=class{constructor(s){t(this,s),this.CLIENT_EVENT_CONFIRM_NAME="br.com.sankhya.actionbutton.clientconfirm",this.handleClick=t=>{const s=this._actions.find((s=>s.actionID==t.detail.id)),i=new S(s.type).executor;new P(i,this._dataUnit,this._resourceID).execute(Object.assign({},s)),this._showDropdown=!1},this._items=[],this._showDropdown=!1,this._actions=[],this._isOrderActions=!1}async getActions(){let t={param:{entityName:this._entityName,resourceID:this._resourceID}};return d.get().callServiceBroker("ActionButtonsSP.getActions",t).then((t=>{var s;(null===(s=t.actions)||void 0===s?void 0:s.action)&&(this._actions=this._isOrderActions?h.sortAlphabetically(t.actions.action,"description"):t.actions.action)}))}controlDropdown(){this._showDropdown=!this._showDropdown}canShowDropdown(){var t;return this._showDropdown&&(null===(t=this._items)||void 0===t?void 0:t.length)>0}positionDropdown(){var t;const s=null===(t=this._ezButton)||void 0===t?void 0:t.getBoundingClientRect();s&&this._dropdownParent&&(this._dropdownParent.style.top=s.y+s.height+5+"px",this._dropdownParent.style.left=s.x+"px")}closeDropdown(t){const s=null==t?void 0:t.target;s&&(s.closest(".snk-actions-button")||(this._showDropdown=!1))}setEvents(){document.removeEventListener("click",this.closeDropdown.bind(this)),document.addEventListener("click",this.closeDropdown.bind(this)),document.removeEventListener("scroll",this.positionDropdown.bind(this)),document.addEventListener("scroll",this.positionDropdown.bind(this))}async componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__"),this._isOrderActions=await this._application.getBooleanParam("global.ordenar.acoes.personalizadas");const t=this._element.parentElement;this._dataUnit=null==t?void 0:t.dataUnit,this._resourceID=null==t?void 0:t.resourceID,this._entityName=this._dataUnit.name.split("/")[2],null==this._resourceID&&(this._resourceID=await m.getResourceID()),this.setEvents(),this.getActions().then((()=>{this.loadItems()}))}async componentDidLoad(){if(this._element&&(u.addIDInfo(this._element),this.positionDropdown(),!await this._application.hasClientEvent(this.CLIENT_EVENT_CONFIRM_NAME))){const t=new A;this._application.addClientEvent(this.CLIENT_EVENT_CONFIRM_NAME,t.clientConfirm)}}componentDidUpdate(){this.positionDropdown()}loadItems(){this._actions&&0!=this._actions.length&&this._actions.forEach((t=>{this._items.push({id:t.actionID,label:t.description})}))}getElementID(t){return{[u.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:u.getInternalIDInfo(t)}}render(){return s(i,null,this._actions&&this._actions.length>0&&s("div",{class:`ez-padding-left--medium snk-actions-button \n ${this.canShowDropdown()?" snk-actions-button--overlap":""}\n `},s("ez-button",Object.assign({ref:t=>this._ezButton=t,iconName:"acao",size:"small",mode:"icon",title:this._application.messagesBuilder.getMessage("snkActionsButton.title.actions",void 0),onClick:()=>this.controlDropdown()},this.getElementID("button"))),s("div",Object.assign({ref:t=>this._dropdownParent=t,class:(this.canShowDropdown()?"snk-actions-button__dropdown--show":"snk-actions-button__dropdown")+"\n "},this.getElementID("dropdown")),this.canShowDropdown()&&s("ez-dropdown",Object.assign({items:this._items,onEzClick:t=>this.handleClick(t)},this.getElementID("dropdown"))))),this.canShowDropdown()&&s("div",Object.assign({class:"ez-scrim ez-scrim--light"},this.getElementID("ezScrim"))))}get _element(){return e(this)}};N.style=".sc-snk-actions-button-h{--snk-actions-button--z-index:var(--most-visible, 3);display:flex;width:fit-content;height:fit-content}.snk-actions-button.sc-snk-actions-button{display:flex;width:fit-content;height:fit-content}.snk-actions-button__dropdown--show.sc-snk-actions-button{display:flex;flex-direction:column;position:fixed}.snk-actions-button__dropdown.sc-snk-actions-button>ez-dropdown.sc-snk-actions-button{position:relative}.snk-actions-button--overlap.sc-snk-actions-button{z-index:var(--snk-actions-button--z-index)}.snk-actions-button__dropdown.sc-snk-actions-button{display:none}";export{N as snk_actions_button}
|