@sankhyalabs/sankhyablocks 8.16.0-dev.97 → 8.16.0-dev.98
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{ClientSideExporterProvider-9bd6fa5a.js → ClientSideExporterProvider-cc82b68a.js} +2 -3
- package/dist/cjs/{ConfigStorage-6b633b10.js → ConfigStorage-2235f35e.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-30cab386.js → ISave-62fbb1dd.js} +8 -0
- package/dist/cjs/{SnkFormConfigManager-d680be08.js → SnkFormConfigManager-6637cd6b.js} +2 -2
- package/dist/cjs/{auth-fetcher-24ba4135.js → auth-fetcher-abad589f.js} +1 -1
- package/dist/cjs/{form-config-fetcher-e0a512c3.js → form-config-fetcher-db332748.js} +14 -0
- package/dist/cjs/index-f9e81701.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +3 -4
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_5.cjs.entry.js → snk-actions-button_7.cjs.entry.js} +63 -4
- package/dist/cjs/snk-application.cjs.entry.js +48 -5
- package/dist/cjs/snk-attach.cjs.entry.js +3 -4
- package/dist/cjs/snk-config-options_3.cjs.entry.js +3 -3
- package/dist/cjs/snk-configurator.cjs.entry.js +8 -1
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +5 -6
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid.cjs.entry.js +4 -5
- package/dist/cjs/{snk-guides-viewer-c588a295.js → snk-guides-viewer-0e4f3b1a.js} +3 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +2 -2
- package/dist/cjs/snk-pesquisa.cjs.entry.js +9 -10
- package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -7
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/snk-application/snk-application.js +41 -0
- package/dist/collection/components/snk-configurator/snk-configurator.js +26 -1
- package/dist/collection/components/snk-crud/snk-crud.js +20 -1
- package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.css +3 -0
- package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +73 -0
- package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.css +78 -0
- package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +57 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +20 -1
- package/dist/collection/lib/configs/LayoutFormConfig.js +25 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +14 -0
- package/dist/components/form-config-fetcher.js +14 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/snk-application2.js +45 -0
- package/dist/components/snk-attach2.js +34 -22
- package/dist/components/snk-configurator2.js +22 -2
- package/dist/components/snk-crud.js +76 -62
- package/dist/components/snk-detail-view2.js +105 -83
- package/dist/components/snk-layout-form-config.d.ts +11 -0
- package/dist/components/snk-layout-form-config.js +6 -0
- package/dist/components/snk-layout-form-config2.js +73 -0
- package/dist/components/snk-simple-crud2.js +33 -19
- package/dist/components/snk-view-representation.d.ts +11 -0
- package/dist/components/snk-view-representation.js +6 -0
- package/dist/components/snk-view-representation2.js +41 -0
- package/dist/esm/{ClientSideExporterProvider-e42c5a48.js → ClientSideExporterProvider-8191676b.js} +2 -3
- package/dist/esm/{ConfigStorage-e5c1f4c0.js → ConfigStorage-9bd805d6.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-e26c3295.js → ISave-7d546dce.js} +9 -1
- package/dist/esm/{SnkFormConfigManager-1efd102b.js → SnkFormConfigManager-fbc6a9a8.js} +2 -2
- package/dist/esm/{auth-fetcher-9987c66e.js → auth-fetcher-07d33333.js} +1 -1
- package/dist/esm/{form-config-fetcher-34becd23.js → form-config-fetcher-ac17cff4.js} +14 -0
- package/dist/esm/index-a7d3d3f1.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +2 -3
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_5.entry.js → snk-actions-button_7.entry.js} +63 -6
- package/dist/esm/snk-application.entry.js +47 -4
- package/dist/esm/snk-attach.entry.js +3 -4
- package/dist/esm/snk-config-options_3.entry.js +3 -3
- package/dist/esm/snk-configurator.entry.js +8 -1
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +2 -3
- package/dist/esm/snk-detail-view.entry.js +5 -6
- package/dist/esm/snk-filter-bar_4.entry.js +2 -2
- package/dist/esm/snk-filter-modal-item.entry.js +2 -2
- package/dist/esm/snk-grid.entry.js +4 -5
- package/dist/esm/{snk-guides-viewer-c38641c5.js → snk-guides-viewer-80a8709c.js} +3 -4
- package/dist/esm/snk-guides-viewer.entry.js +5 -6
- package/dist/esm/snk-personalized-filter.entry.js +2 -2
- package/dist/esm/snk-pesquisa.entry.js +2 -3
- package/dist/esm/snk-simple-crud.entry.js +7 -7
- package/dist/sankhyablocks/p-01512409.js +26 -0
- package/dist/sankhyablocks/p-02c6dc9f.entry.js +1 -0
- package/dist/sankhyablocks/{p-6c43fcde.entry.js → p-0bcd4757.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ef076eea.js → p-108fee57.js} +2 -2
- package/dist/sankhyablocks/{p-3fcb90d6.js → p-13f17dab.js} +1 -1
- package/dist/sankhyablocks/{p-d3b9b377.entry.js → p-340e2447.entry.js} +1 -1
- package/dist/sankhyablocks/p-35fcf37e.js +1 -0
- package/dist/sankhyablocks/p-3a36d4b3.entry.js +1 -0
- package/dist/sankhyablocks/{p-a77bdadc.js → p-48729c8c.js} +1 -1
- package/dist/sankhyablocks/p-513af002.entry.js +1 -0
- package/dist/sankhyablocks/{p-e5657d22.entry.js → p-6c0afbce.entry.js} +1 -1
- package/dist/sankhyablocks/p-950e3cbe.entry.js +1 -0
- package/dist/sankhyablocks/p-9907cf67.entry.js +1 -0
- package/dist/sankhyablocks/p-af58c9d7.entry.js +1 -0
- package/dist/sankhyablocks/p-c5acb7ba.entry.js +11 -0
- package/dist/sankhyablocks/p-c7c6eab7.entry.js +1 -0
- package/dist/sankhyablocks/{p-3ce68be5.js → p-cb9d725a.js} +1 -1
- package/dist/sankhyablocks/p-d1f04e2c.js +1 -0
- package/dist/sankhyablocks/p-d2065bb4.entry.js +1 -0
- package/dist/sankhyablocks/p-dc617b0c.entry.js +1 -0
- package/dist/sankhyablocks/p-e5d8891d.entry.js +1 -0
- package/dist/sankhyablocks/{p-e66bcb5c.entry.js → p-f467153c.entry.js} +1 -1
- package/dist/sankhyablocks/p-f861bfcb.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +10 -0
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +6 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-layout-form-config/snk-layout-form-config.d.ts +15 -0
- package/dist/types/components/snk-layout-form-config/snk-view-representation/snk-view-representation.d.ts +10 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components.d.ts +69 -1
- package/dist/types/lib/configs/LayoutFormConfig.d.ts +11 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +6 -0
- package/package.json +1 -1
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/ISave-e91b70a7.js +0 -9
- package/dist/esm/ISave-d8c8bc59.js +0 -9
- package/dist/sankhyablocks/p-04acdc3a.entry.js +0 -1
- package/dist/sankhyablocks/p-04b96ffe.js +0 -1
- package/dist/sankhyablocks/p-05fda408.entry.js +0 -1
- package/dist/sankhyablocks/p-17af0b1c.entry.js +0 -1
- package/dist/sankhyablocks/p-21749402.js +0 -1
- package/dist/sankhyablocks/p-22ddc147.js +0 -26
- package/dist/sankhyablocks/p-27d12f8f.entry.js +0 -1
- package/dist/sankhyablocks/p-3bab7e9c.entry.js +0 -1
- package/dist/sankhyablocks/p-4b01cbad.entry.js +0 -11
- package/dist/sankhyablocks/p-4c9adf1c.entry.js +0 -1
- package/dist/sankhyablocks/p-6b898a51.entry.js +0 -1
- package/dist/sankhyablocks/p-9523fc40.entry.js +0 -1
- package/dist/sankhyablocks/p-99ab1e1d.entry.js +0 -1
- package/dist/sankhyablocks/p-a18de25e.js +0 -1
- package/dist/sankhyablocks/p-be2e5f36.entry.js +0 -1
- package/dist/sankhyablocks/p-d571e243.entry.js +0 -1
@@ -2,20 +2,19 @@ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent
|
|
2
2
|
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ServiceUtils, StorageType, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
3
|
import { D as DataFetcher } from './DataFetcher-ecf5f903.js';
|
4
4
|
import { P as ParamType } from './ParamType-d5152b06.js';
|
5
|
-
import './
|
5
|
+
import './ISave-7d546dce.js';
|
6
6
|
import './index-b40568ff.js';
|
7
|
-
import './ISave-d8c8bc59.js';
|
8
7
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
8
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
9
|
import './dataunit-fetcher-ed6e65ef.js';
|
11
10
|
import './filter-item-type.enum-d45e026f.js';
|
12
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
11
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-ac17cff4.js';
|
13
12
|
import { O as ORDER_VALUES } from './constants-75abb876.js';
|
14
13
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
|
15
14
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
16
|
-
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
15
|
+
import { ApplicationUtils, DialogType, FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
|
17
16
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/components/ez-check/CheckMode';
|
18
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
17
|
+
import { C as ConfigStorage } from './ConfigStorage-9bd805d6.js';
|
19
18
|
import './PrintUtils-3e4ff0f5.js';
|
20
19
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
21
20
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
@@ -1216,6 +1215,43 @@ const SnkGridConfig = class {
|
|
1216
1215
|
};
|
1217
1216
|
SnkGridConfig.style = snkGridConfigCss;
|
1218
1217
|
|
1218
|
+
const snkLayoutFormConfigCss = ".sc-snk-layout-form-config-h{display:block}";
|
1219
|
+
|
1220
|
+
const FORM_COL_CONFIG_PREFIX = 'formColCfg.';
|
1221
|
+
const SnkLayoutFormConfig = class {
|
1222
|
+
constructor(hostRef) {
|
1223
|
+
registerInstance(this, hostRef);
|
1224
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
1225
|
+
this.layoutType = FormLayout.CASCADE;
|
1226
|
+
}
|
1227
|
+
/**
|
1228
|
+
* Salva o tipo de layout escolhido. Sem retorno.
|
1229
|
+
*/
|
1230
|
+
async save() {
|
1231
|
+
this._LayoutFormConfigSingleton.setConfig(this.layoutType);
|
1232
|
+
this._formConfigFetcher.saveLayoutFormConfig(FORM_COL_CONFIG_PREFIX + this._resourceID, { config: this.layoutType, newConfig: true });
|
1233
|
+
}
|
1234
|
+
async componentWillLoad() {
|
1235
|
+
const _application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
1236
|
+
this._LayoutFormConfigSingleton = await (_application === null || _application === void 0 ? void 0 : _application.getLayoutFormConfig());
|
1237
|
+
this._resourceID = await (_application === null || _application === void 0 ? void 0 : _application.getResourceID());
|
1238
|
+
this.setLayoutInit();
|
1239
|
+
}
|
1240
|
+
setLayoutInit() {
|
1241
|
+
if (!this._LayoutFormConfigSingleton)
|
1242
|
+
return;
|
1243
|
+
const { config } = this._LayoutFormConfigSingleton;
|
1244
|
+
this.layoutType = Number(config) in FormLayout ? Number(config) : FormLayout.CASCADE;
|
1245
|
+
}
|
1246
|
+
toggleLayout(key) {
|
1247
|
+
this.layoutType = key;
|
1248
|
+
}
|
1249
|
+
render() {
|
1250
|
+
return (h("div", { class: "ez-flex ez-flex--column" }, h("div", { class: "ez-margin-bottom--small" }, h("ez-check", { label: "Layout em cascata", class: "ez-margin-bottom--small", onEzChange: () => this.toggleLayout(FormLayout.CASCADE), value: this.layoutType === FormLayout.CASCADE }), h("snk-view-representation", { mode: FormLayout.CASCADE }), h("label", { class: "ez-label ez-margin--small ez-flex ez-text--medium" }, "Todos os campos ser\u00E3o organizados em uma coluna \u00FAnica.")), h("div", null, h("ez-check", { label: "Layout lado a lado", class: "ez-margin-bottom--small", onEzChange: () => this.toggleLayout(FormLayout.SIDE_BY_SIDE), value: this.layoutType === FormLayout.SIDE_BY_SIDE }), h("snk-view-representation", { mode: FormLayout.SIDE_BY_SIDE }), h("label", { class: "ez-label ez-margin--small ez-flex ez-text--medium" }, "Todos os campos ser\u00E3o dispostos lado a lado, ajustando-se automaticamente \u00E0 largura da tela."))));
|
1251
|
+
}
|
1252
|
+
};
|
1253
|
+
SnkLayoutFormConfig.style = snkLayoutFormConfigCss;
|
1254
|
+
|
1219
1255
|
const snkSelectBoxCss = "ez-combo-box{width:100px}.grid-config-combo{--ez-text-input--height:28px;--ez-text-input__input--background-color:#fff;--ez-text-input__input--border-color:#dce0e8}";
|
1220
1256
|
|
1221
1257
|
const SelectBox = class {
|
@@ -1322,6 +1358,27 @@ const SnkSimpleFormConfig = class {
|
|
1322
1358
|
};
|
1323
1359
|
SnkSimpleFormConfig.style = snkSimpleFormConfigCss;
|
1324
1360
|
|
1361
|
+
const snkViewRepresentationCss = ".sc-snk-view-representation-h{display:block}.svg-container.sc-snk-view-representation{display:flex;width:185px;height:125px;border-radius:8px;background-color:#f7f7f7;padding:10px 12px;box-sizing:border-box;position:relative}.svg-container__background.sc-snk-view-representation{display:flex;flex-direction:column;width:100%}.svg-container__header.sc-snk-view-representation{display:flex;gap:2px;margin-bottom:12px}.svg-container__circle.sc-snk-view-representation{width:9px;height:9px;border-radius:50%}.svg-container__circle--red.sc-snk-view-representation{background-color:#ed7678}.svg-container__circle--yellow.sc-snk-view-representation{background-color:#eddb76}.svg-container__circle--green.sc-snk-view-representation{background-color:#7ad08e}.svg-container__section.sc-snk-view-representation{width:100%}.svg-container__collumn.sc-snk-view-representation{width:100%;display:flex;flex-direction:column}.svg-container__inline.sc-snk-view-representation{display:flex;flex-direction:row;gap:6px}.svg-container__line.sc-snk-view-representation{height:13px;border-radius:4px;background-color:#d9d9d9;margin-bottom:4px}.svg-container__line--short.sc-snk-view-representation{width:39.68px;height:7px;border-radius:3.5px}.svg-container__line--long.sc-snk-view-representation{width:100%}";
|
1362
|
+
|
1363
|
+
const SnkViewRepresentation = class {
|
1364
|
+
constructor(hostRef) {
|
1365
|
+
registerInstance(this, hostRef);
|
1366
|
+
this.mode = FormLayout.SIDE_BY_SIDE;
|
1367
|
+
}
|
1368
|
+
renderCascadeLayout() {
|
1369
|
+
return (h("div", { class: "svg-container__collumn" }, [...Array(3)].map(() => (h("div", { class: "svg-container__section" }, h("div", { class: "svg-container__line svg-container__line--short" }), h("div", { class: "svg-container__line svg-container__line--long" }))))));
|
1370
|
+
}
|
1371
|
+
renderSideBySideLayout() {
|
1372
|
+
return (h("div", { class: "svg-container__inline" }, [...Array(2)].map(() => this.renderCascadeLayout())));
|
1373
|
+
}
|
1374
|
+
render() {
|
1375
|
+
return (h("div", { class: "svg-container ez-margin-left--small" }, h("div", { class: "svg-container__background" }, h("div", { class: "svg-container__header" }, h("div", { class: "svg-container__circle svg-container__circle--red" }), h("div", { class: "svg-container__circle svg-container__circle--yellow" }), h("div", { class: "svg-container__circle svg-container__circle--green" })), this.mode === FormLayout.CASCADE
|
1376
|
+
? this.renderCascadeLayout()
|
1377
|
+
: this.renderSideBySideLayout())));
|
1378
|
+
}
|
1379
|
+
};
|
1380
|
+
SnkViewRepresentation.style = snkViewRepresentationCss;
|
1381
|
+
|
1325
1382
|
const taskbarActionsButtonCss = ".sc-taskbar-actions-button-h{display:flex;width:fit-content;height:fit-content}";
|
1326
1383
|
|
1327
1384
|
const TaskbarActionsButton = class {
|
@@ -1453,4 +1510,4 @@ const TaskbarActionsButton = class {
|
|
1453
1510
|
};
|
1454
1511
|
TaskbarActionsButton.style = taskbarActionsButtonCss;
|
1455
1512
|
|
1456
|
-
export { SnkActionsButton as snk_actions_button, SnkGridConfig as snk_grid_config, SelectBox as snk_select_box, SnkSimpleFormConfig as snk_simple_form_config, TaskbarActionsButton as taskbar_actions_button };
|
1513
|
+
export { SnkActionsButton as snk_actions_button, SnkGridConfig as snk_grid_config, SnkLayoutFormConfig as snk_layout_form_config, SelectBox as snk_select_box, SnkSimpleFormConfig as snk_simple_form_config, SnkViewRepresentation as snk_view_representation, TaskbarActionsButton as taskbar_actions_button };
|
@@ -1,15 +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 { DateUtils, StringUtils, ObjectUtils, WaitingChangeException, WarningException, ErrorException, KeyboardManager, OnboardingUtils, DependencyType, ArrayUtils, SearchUtils, ElementIDUtils, ApplicationContext, DataType, ErrorTracking, UserAgentUtils, LockManager, LockManagerOperation } from '@sankhyalabs/core';
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-9bd805d6.js';
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-ecf5f903.js';
|
6
|
-
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-
|
6
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-07d33333.js';
|
7
7
|
import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-ed6e65ef.js';
|
8
|
-
import { P as PesquisaFetcher } from './
|
8
|
+
import { P as PesquisaFetcher } from './ISave-7d546dce.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
10
10
|
import { T as TEMPLATES_SKELETON } from './constants-75abb876.js';
|
11
|
-
import './
|
11
|
+
import './index-b40568ff.js';
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|
13
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-ac17cff4.js';
|
13
14
|
import './PrintUtils-3e4ff0f5.js';
|
14
15
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
15
16
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
@@ -382,6 +383,32 @@ class RequestListenerFactory {
|
|
382
383
|
}
|
383
384
|
}
|
384
385
|
|
386
|
+
class LayoutFormConfig {
|
387
|
+
constructor() {
|
388
|
+
this._config = null;
|
389
|
+
this.listeners = [];
|
390
|
+
}
|
391
|
+
static getInstance() {
|
392
|
+
if (!LayoutFormConfig.instance) {
|
393
|
+
LayoutFormConfig.instance = new LayoutFormConfig();
|
394
|
+
}
|
395
|
+
return LayoutFormConfig.instance;
|
396
|
+
}
|
397
|
+
get config() {
|
398
|
+
return this._config;
|
399
|
+
}
|
400
|
+
setConfig(newConfig) {
|
401
|
+
this._config = newConfig;
|
402
|
+
this.notifyListeners();
|
403
|
+
}
|
404
|
+
onConfigChange(listener) {
|
405
|
+
this.listeners.push(listener);
|
406
|
+
}
|
407
|
+
notifyListeners() {
|
408
|
+
this.listeners.forEach(listener => listener(this._config));
|
409
|
+
}
|
410
|
+
}
|
411
|
+
|
385
412
|
const snkApplicationCss = ".sc-snk-application-h{--scrim-z-index:var(--elevation--100, 100);display:flex;flex-direction:column;height:100%}.sc-snk-application-h>.loading-hidden.sc-snk-application{display:none;pointer-events:none}.skeleton-content-left.sc-snk-application{width:300px;padding-right:5px}.skeleton-content.sc-snk-application{height:calc(100vh - 310px)}.spinner.sc-snk-application{height:100vh;gap:10px}.spinner.sc-snk-application>.spin.sc-snk-application{animation-name:spin;animation-duration:5000ms;animation-iteration-count:infinite;animation-timing-function:linear}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}";
|
386
413
|
|
387
414
|
const SnkApplication = class {
|
@@ -401,6 +428,8 @@ const SnkApplication = class {
|
|
401
428
|
this._pendingActions = new Map;
|
402
429
|
this._loadPkParameter = null;
|
403
430
|
this._isLoadedByPk = false;
|
431
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
432
|
+
this._LayoutFormConfigSingleton = LayoutFormConfig.getInstance();
|
404
433
|
this._applicationReady = false;
|
405
434
|
this._templateSkeleton = TEMPLATES_SKELETON.GRID;
|
406
435
|
this._activeScrimWindow = false;
|
@@ -475,6 +504,14 @@ const SnkApplication = class {
|
|
475
504
|
async getKeyboardManager() {
|
476
505
|
return Promise.resolve(this._keyboardManager);
|
477
506
|
}
|
507
|
+
/**
|
508
|
+
* Obtém o notificador de Layout de formulario.
|
509
|
+
*
|
510
|
+
* @return {LayoutFormConfig} the Configurador de Layout do Formulario
|
511
|
+
*/
|
512
|
+
async getLayoutFormConfig() {
|
513
|
+
return Promise.resolve(this._LayoutFormConfigSingleton);
|
514
|
+
}
|
478
515
|
/**
|
479
516
|
* Obtém `true` caso o usuário logado seja o SUP.
|
480
517
|
*/
|
@@ -1388,6 +1425,12 @@ const SnkApplication = class {
|
|
1388
1425
|
ConfigStorage.preload(this.applicationResourceID, this.configName, legacyConfig);
|
1389
1426
|
document.addEventListener("click", () => Workspace.applicationClick());
|
1390
1427
|
this._waitingAppReady.forEach(resolve => resolve());
|
1428
|
+
this.setLayoutFormConfig();
|
1429
|
+
}
|
1430
|
+
async setLayoutFormConfig() {
|
1431
|
+
const response = await this._formConfigFetcher.fetchLayoutFormConfig('formColCfg.' + this.applicationResourceID);
|
1432
|
+
const config = isNaN(Number(response === null || response === void 0 ? void 0 : response.config)) ? null : Number(response === null || response === void 0 ? void 0 : response.config);
|
1433
|
+
this._LayoutFormConfigSingleton.setConfig(config);
|
1391
1434
|
}
|
1392
1435
|
connectedCallback() {
|
1393
1436
|
this._isBrowserTypeElectron = UserAgentUtils.isElectron();
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-a7d3d3f1.js';
|
2
2
|
import { ApplicationContext, DataType, Action, UserInterface, StringUtils, DataUnitLoaderUtils, DataUnit } from '@sankhyalabs/core';
|
3
3
|
import { D as DataFetcher } from './DataFetcher-ecf5f903.js';
|
4
|
-
import './
|
4
|
+
import { S as SaveErrorsEnum } from './ISave-7d546dce.js';
|
5
5
|
import './index-b40568ff.js';
|
6
|
-
import { S as SaveErrorsEnum } from './ISave-d8c8bc59.js';
|
7
6
|
import { P as PreloadManager, D as DataUnitFetcher, I as InMemoryLoader } from './dataunit-fetcher-ed6e65ef.js';
|
8
7
|
import './filter-item-type.enum-d45e026f.js';
|
9
|
-
import './form-config-fetcher-
|
8
|
+
import './form-config-fetcher-ac17cff4.js';
|
10
9
|
import { V as VIEW_MODE } from './constants-75abb876.js';
|
11
|
-
import { A as AutorizationType } from './auth-fetcher-
|
10
|
+
import { A as AutorizationType } from './auth-fetcher-07d33333.js';
|
12
11
|
import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
|
13
12
|
import './PrintUtils-3e4ff0f5.js';
|
14
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -3,12 +3,12 @@ import { UserInterface, ObjectUtils, StringUtils, ApplicationContext, ElementIDU
|
|
3
3
|
import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
4
4
|
import { CheckMode, ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
5
5
|
import { d as VARS_BY_TYPE, D as DEFAULT_TYPE, e as TAGS_BY_TYPE, C as CONFIG_EVENTS, a as CONFIG_SORTABLE_EVENTS, c as TAB_NAMES, A as ACTION_CONFIG } from './constants-75abb876.js';
|
6
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
6
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-fbc6a9a8.js';
|
7
7
|
import { R as ResourceIDUtils } from './ResourceIDUtils-a114189a.js';
|
8
8
|
import { S as Sortable } from './Sortable-83960219.js';
|
9
|
-
import { U as UserConfigType } from './form-config-fetcher-
|
9
|
+
import { U as UserConfigType } from './form-config-fetcher-ac17cff4.js';
|
10
10
|
import { buildFormConfigFromDataUnit } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
11
|
-
import './ConfigStorage-
|
11
|
+
import './ConfigStorage-9bd805d6.js';
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|
13
13
|
import './DataFetcher-ecf5f903.js';
|
14
14
|
import './PrintUtils-3e4ff0f5.js';
|
@@ -19,6 +19,7 @@ const SnkConfigurator = class {
|
|
19
19
|
this.resourceID = undefined;
|
20
20
|
this.viewMode = VIEW_MODE.GRID;
|
21
21
|
this.customContainerId = undefined;
|
22
|
+
this.layoutFormConfig = false;
|
22
23
|
this.messagesBuilder = undefined;
|
23
24
|
}
|
24
25
|
/**
|
@@ -79,6 +80,12 @@ const SnkConfigurator = class {
|
|
79
80
|
var _a;
|
80
81
|
return (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {});
|
81
82
|
}
|
83
|
+
handleSave() {
|
84
|
+
if (this.layoutFormConfig) {
|
85
|
+
this._snkLayoutFormConfig.save();
|
86
|
+
}
|
87
|
+
this.save.emit();
|
88
|
+
}
|
82
89
|
componentWillLoad() {
|
83
90
|
this._application = ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
84
91
|
if (this._application) {
|
@@ -102,7 +109,7 @@ const SnkConfigurator = class {
|
|
102
109
|
insideCustomElementsContainer === null || insideCustomElementsContainer === void 0 ? void 0 : insideCustomElementsContainer.appendChild(configuratorCustomElement);
|
103
110
|
}
|
104
111
|
render() {
|
105
|
-
return (h("ez-modal", { ref: (element) => (this.modal = element), opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small", scrim: "light" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage('snkConfigurator.titleConfigurations')), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-collapsible-box", { boxBordered: true, label: "Modo de visualiza\u00E7\u00E3o ", headerSize: "medium", class: "snk-configurator__collapsable-box" }, h("ez-radio-button", { value: this.getViewModeValue().toString(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelGrid'), value: VIEW_MODE.GRID }), h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelForm'), value: VIEW_MODE.FORM })), h("div", { class: "snk-configurator__collsable-box-action" }, h("ez-button", { label: this.viewMode === VIEW_MODE.GRID ? this.getMessage('snkConfigurator.labelConfigGrid') : this.getMessage('snkConfigurator.labelConfigForm'), class: "snk-configurator__button-config ez-button--secondary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }))), h("div", { id: "slotContainer", class: "snk-configurator__outline" })), this.showActionButtons && (h("div", { class: "snk-configurator__action-buttons" }, h("ez-button", { label: "Cancelar", onClick: () => this.cancel.emit() }), h("ez-button", { label: "Salvar", onClick: () => this.
|
112
|
+
return (h("ez-modal", { ref: (element) => (this.modal = element), opened: this._opened, "close-esc": false, "close-outside-click": false, "modal-size": "small", scrim: "light" }, h("div", { class: "snk-configurator" }, h("div", { class: "snk-configurator__header" }, h("label", { class: "snk-configurator__title" }, this.getMessage('snkConfigurator.titleConfigurations')), h("div", { class: "snk-configurator__button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", onClick: () => this.closeConfig() }))), h("div", { class: "snk-configurator__main" }, h("ez-collapsible-box", { boxBordered: true, label: "Modo de visualiza\u00E7\u00E3o ", headerSize: "medium", class: "snk-configurator__collapsable-box" }, h("ez-radio-button", { value: this.getViewModeValue().toString(), onEzChange: (evt) => this.onViewModeChanged(evt), enabled: this.enableModeConfig() }, h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelGrid'), value: VIEW_MODE.GRID }), h("ez-radio-button-option", { label: this.getMessage('snkConfigurator.labelForm'), value: VIEW_MODE.FORM })), h("div", { class: "snk-configurator__collsable-box-action" }, h("ez-button", { label: this.viewMode === VIEW_MODE.GRID ? this.getMessage('snkConfigurator.labelConfigGrid') : this.getMessage('snkConfigurator.labelConfigForm'), class: "snk-configurator__button-config ez-button--secondary", onClick: () => this.onClickOpenConfig(), id: "openConfigurator" }))), this.layoutFormConfig && h("ez-collapsible-box", { boxBordered: true, value: true, label: "Layout do formul\u00E1rio", headerSize: "medium", class: "snk-configurator__collapsable-box ez-margin-top--medium" }, h("div", { class: 'ez-flex ez-flex--column ez-size-width--full' }, h("snk-layout-form-config", { ref: (ref) => this._snkLayoutFormConfig = ref }))), h("div", { id: "slotContainer", class: "snk-configurator__outline" })), this.showActionButtons && (h("div", { class: "snk-configurator__action-buttons" }, h("ez-button", { label: "Cancelar", onClick: () => this.cancel.emit() }), h("ez-button", { label: "Salvar", onClick: () => this.handleSave(), class: "ez-button--primary" }))))));
|
106
113
|
}
|
107
114
|
get _element() { return getElement(this); }
|
108
115
|
};
|
@@ -2,16 +2,15 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
2
2
|
import { StringUtils, ElementIDUtils, ApplicationContext, JSUtils, FloatingManager } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
|
4
4
|
import './DataFetcher-ecf5f903.js';
|
5
|
-
import './
|
5
|
+
import './ISave-7d546dce.js';
|
6
6
|
import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
|
7
|
-
import './ISave-d8c8bc59.js';
|
8
7
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
8
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
9
|
import './dataunit-fetcher-ed6e65ef.js';
|
11
10
|
import './filter-item-type.enum-d45e026f.js';
|
12
|
-
import './form-config-fetcher-
|
11
|
+
import './form-config-fetcher-ac17cff4.js';
|
13
12
|
import { V as VIEW_MODE } from './constants-75abb876.js';
|
14
|
-
import { A as AutorizationType } from './auth-fetcher-
|
13
|
+
import { A as AutorizationType } from './auth-fetcher-07d33333.js';
|
15
14
|
import './index-bdf75557.js';
|
16
15
|
import './PrintUtils-3e4ff0f5.js';
|
17
16
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -63,6 +62,7 @@ const SnkCrud = class {
|
|
63
62
|
this.ignoreReadOnlyFormFields = undefined;
|
64
63
|
this.setCustomFormTitle = undefined;
|
65
64
|
this.strategyExporter = ExporterStrategy.SERVER_SIDE;
|
65
|
+
this.layoutFormConfig = false;
|
66
66
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
67
67
|
}
|
68
68
|
/**
|
@@ -397,7 +397,7 @@ const SnkCrud = class {
|
|
397
397
|
return;
|
398
398
|
}
|
399
399
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
400
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
400
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--medium' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
401
401
|
}
|
402
402
|
get _element() { return getElement(this); }
|
403
403
|
static get watchers() { return {
|
@@ -6,13 +6,12 @@ import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat
|
|
6
6
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-75abb876.js';
|
7
7
|
import { D as DataFetcher } from './DataFetcher-ecf5f903.js';
|
8
8
|
import { S as SnkDataUnit } from './snk-data-unit-6258b8ae.js';
|
9
|
-
import './
|
10
|
-
import './ISave-d8c8bc59.js';
|
9
|
+
import './ISave-7d546dce.js';
|
11
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
12
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
13
12
|
import './dataunit-fetcher-ed6e65ef.js';
|
14
13
|
import './filter-item-type.enum-d45e026f.js';
|
15
|
-
import './form-config-fetcher-
|
14
|
+
import './form-config-fetcher-ac17cff4.js';
|
16
15
|
import './PrintUtils-3e4ff0f5.js';
|
17
16
|
import './SnkMessageBuilder-6fff4a4c.js';
|
18
17
|
import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
@@ -1,21 +1,20 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host } from './index-a7d3d3f1.js';
|
2
2
|
import { Action } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-fbc6a9a8.js';
|
4
4
|
import { FormMetadata, buildFormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import './DataFetcher-ecf5f903.js';
|
6
|
-
import './
|
6
|
+
import './ISave-7d546dce.js';
|
7
7
|
import { P as PresentationMode } from './index-b40568ff.js';
|
8
|
-
import './ISave-d8c8bc59.js';
|
9
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
10
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
11
10
|
import './dataunit-fetcher-ed6e65ef.js';
|
12
11
|
import './filter-item-type.enum-d45e026f.js';
|
13
|
-
import './form-config-fetcher-
|
12
|
+
import './form-config-fetcher-ac17cff4.js';
|
14
13
|
import { V as VIEW_MODE } from './constants-75abb876.js';
|
15
14
|
import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
15
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-80a8709c.js';
|
17
16
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
18
|
-
import './ConfigStorage-
|
17
|
+
import './ConfigStorage-9bd805d6.js';
|
19
18
|
import './PrintUtils-3e4ff0f5.js';
|
20
19
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
21
20
|
import '@sankhyalabs/core/dist/utils/SortingUtils';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, LockManager, LockManagerOperation, FloatingManager, DateUtils, MaskFormatter, ArrayUtils } 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-9bd805d6.js';
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
6
6
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
7
7
|
import { F as FilterOperand } from './index-ae591a44.js';
|
@@ -10,7 +10,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
10
10
|
import { P as PersonalizedFilterUtils } from './PersonalizedFilterUtils-e2b38ef7.js';
|
11
11
|
import { ModalAction } from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container';
|
12
12
|
import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
|
13
|
-
import './form-config-fetcher-
|
13
|
+
import './form-config-fetcher-ac17cff4.js';
|
14
14
|
import './DataFetcher-ecf5f903.js';
|
15
15
|
import './PrintUtils-3e4ff0f5.js';
|
16
16
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -2,9 +2,9 @@ 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-d45e026f.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-9bd805d6.js';
|
6
6
|
import { F as FilterType } from './filter-type.enum-a80c1b6b.js';
|
7
|
-
import './form-config-fetcher-
|
7
|
+
import './form-config-fetcher-ac17cff4.js';
|
8
8
|
import './DataFetcher-ecf5f903.js';
|
9
9
|
import './PrintUtils-3e4ff0f5.js';
|
10
10
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,20 +1,19 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ElementIDUtils, ApplicationContext, StringUtils } from '@sankhyalabs/core';
|
3
3
|
import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
|
4
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { C as ConfigStorage } from './ConfigStorage-9bd805d6.js';
|
5
5
|
import { P as PresentationMode, E as ExporterStrategy } from './index-b40568ff.js';
|
6
6
|
import { T as TaskbarProcessor, o as openFieldSearch, b as buildFieldSearch } from './field-search-f8b1d91e.js';
|
7
7
|
import { s as store } from './index-bdf75557.js';
|
8
|
-
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-
|
8
|
+
import { C as CommonsExporter, S as SnkMultiSelectionListDataSource, a as CrudUtils, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-8191676b.js';
|
9
9
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
10
10
|
import './DataFetcher-ecf5f903.js';
|
11
|
-
import './
|
12
|
-
import './ISave-d8c8bc59.js';
|
11
|
+
import './ISave-7d546dce.js';
|
13
12
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
14
13
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
15
14
|
import './dataunit-fetcher-ed6e65ef.js';
|
16
15
|
import './filter-item-type.enum-d45e026f.js';
|
17
|
-
import './form-config-fetcher-
|
16
|
+
import './form-config-fetcher-ac17cff4.js';
|
18
17
|
import './constants-75abb876.js';
|
19
18
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
|
20
19
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
@@ -1,19 +1,18 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment } from './index-a7d3d3f1.js';
|
2
2
|
import { Action, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
3
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-fbc6a9a8.js';
|
4
4
|
import { buildFormMetadata, FormMetadata } from '@sankhyalabs/ezui/dist/collection/utils/form';
|
5
5
|
import { o as openFieldSearch, T as TaskbarProcessor, b as buildFieldSearch } from './field-search-f8b1d91e.js';
|
6
6
|
import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
|
7
7
|
import { V as VIEW_MODE } from './constants-75abb876.js';
|
8
8
|
import './DataFetcher-ecf5f903.js';
|
9
|
-
import './
|
9
|
+
import './ISave-7d546dce.js';
|
10
10
|
import { P as PresentationMode } from './index-b40568ff.js';
|
11
|
-
import './ISave-d8c8bc59.js';
|
12
11
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
13
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
14
13
|
import './dataunit-fetcher-ed6e65ef.js';
|
15
14
|
import './filter-item-type.enum-d45e026f.js';
|
16
|
-
import './form-config-fetcher-
|
15
|
+
import './form-config-fetcher-ac17cff4.js';
|
17
16
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
18
17
|
|
19
18
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--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-small);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-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.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-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.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,9 +1,9 @@
|
|
1
|
-
export { S as snk_guides_viewer } from './snk-guides-viewer-
|
1
|
+
export { S as snk_guides_viewer } from './snk-guides-viewer-80a8709c.js';
|
2
2
|
import './index-a7d3d3f1.js';
|
3
3
|
import '@sankhyalabs/core';
|
4
|
-
import './SnkFormConfigManager-
|
5
|
-
import './ConfigStorage-
|
6
|
-
import './form-config-fetcher-
|
4
|
+
import './SnkFormConfigManager-fbc6a9a8.js';
|
5
|
+
import './ConfigStorage-9bd805d6.js';
|
6
|
+
import './form-config-fetcher-ac17cff4.js';
|
7
7
|
import './DataFetcher-ecf5f903.js';
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -14,8 +14,7 @@ import './field-search-f8b1d91e.js';
|
|
14
14
|
import './taskbar-elements-d2353c64.js';
|
15
15
|
import './index-b40568ff.js';
|
16
16
|
import './index-bdf75557.js';
|
17
|
-
import './
|
18
|
-
import './ISave-d8c8bc59.js';
|
17
|
+
import './ISave-7d546dce.js';
|
19
18
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
20
19
|
import './dataunit-fetcher-ed6e65ef.js';
|
21
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -1,12 +1,12 @@
|
|
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-e2b38ef7.js';
|
4
|
-
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-
|
4
|
+
import { P as PersonalizedFilterFetcher, C as ConfigStorage } from './ConfigStorage-9bd805d6.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-d45e026f.js';
|
9
|
-
import './form-config-fetcher-
|
9
|
+
import './form-config-fetcher-ac17cff4.js';
|
10
10
|
import './DataFetcher-ecf5f903.js';
|
11
11
|
import './PrintUtils-3e4ff0f5.js';
|
12
12
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
@@ -1,14 +1,13 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
2
2
|
import { ObjectUtils, StringUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
-
import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './
|
3
|
+
import { P as PesquisaFetcher, b as buildGridMetadata, a as PESQUISA_VIEW_MODE } from './ISave-7d546dce.js';
|
4
4
|
import './DataFetcher-ecf5f903.js';
|
5
5
|
import './index-b40568ff.js';
|
6
|
-
import './ISave-d8c8bc59.js';
|
7
6
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
8
7
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
9
8
|
import './dataunit-fetcher-ed6e65ef.js';
|
10
9
|
import './filter-item-type.enum-d45e026f.js';
|
11
|
-
import './form-config-fetcher-
|
10
|
+
import './form-config-fetcher-ac17cff4.js';
|
12
11
|
import './constants-75abb876.js';
|
13
12
|
import './PrintUtils-3e4ff0f5.js';
|
14
13
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -4,18 +4,17 @@ import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { V as VIEW_MODE, S as SIMPLE_CRUD_MODE } from './constants-75abb876.js';
|
5
5
|
import { T as TaskbarElement } from './taskbar-elements-d2353c64.js';
|
6
6
|
import './DataFetcher-ecf5f903.js';
|
7
|
-
import './
|
8
|
-
import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-
|
7
|
+
import './ISave-7d546dce.js';
|
8
|
+
import { S as SnkMultiSelectionListDataSource, R as RmPrecisionCustomValueFormatter, b as ContinuousInsertUtils, a as CrudUtils, c as ClientSideExporterProvider } from './ClientSideExporterProvider-8191676b.js';
|
9
9
|
import { P as PresentationMode } from './index-b40568ff.js';
|
10
|
-
import './ISave-d8c8bc59.js';
|
11
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
12
11
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
13
12
|
import { I as InMemoryLoader } from './dataunit-fetcher-ed6e65ef.js';
|
14
13
|
import './filter-item-type.enum-d45e026f.js';
|
15
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
14
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-ac17cff4.js';
|
16
15
|
import { T as TaskbarProcessor, b as buildFieldSearch, o as openFieldSearch } from './field-search-f8b1d91e.js';
|
17
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
18
|
-
import { S as SnkFormConfigManager } from './SnkFormConfigManager-
|
16
|
+
import { C as ConfigStorage } from './ConfigStorage-9bd805d6.js';
|
17
|
+
import { S as SnkFormConfigManager } from './SnkFormConfigManager-fbc6a9a8.js';
|
19
18
|
import { s as store } from './index-bdf75557.js';
|
20
19
|
import './PrintUtils-3e4ff0f5.js';
|
21
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
@@ -83,6 +82,7 @@ const SnkSimpleCrud = class {
|
|
83
82
|
this.ignoreReadOnlyFormFields = false;
|
84
83
|
this.autoFocus = true;
|
85
84
|
this.domainMessagesBuilder = undefined;
|
85
|
+
this.layoutFormConfig = false;
|
86
86
|
this.autoLoad = undefined;
|
87
87
|
this.outlineMode = false;
|
88
88
|
}
|
@@ -775,7 +775,7 @@ const SnkSimpleCrud = class {
|
|
775
775
|
}
|
776
776
|
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
777
777
|
? undefined
|
778
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
778
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId, layoutFormConfig: this.layoutFormConfig })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
779
779
|
}
|
780
780
|
get _element() { return getElement(this); }
|
781
781
|
static get watchers() { return {
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import{d as e,D as t}from"./p-5a7e18f4.js";import{ObjectUtils as n}from"@sankhyalabs/core";class o{constructor(){this.templateByQuery=new Map,this.buldTemplates()}buldTemplates(){this.templateByQuery.set("fetchResource",e.gql`query($name: String!) {
|
2
|
+
$queryAlias$: fetchResource(name: $name){
|
3
|
+
resource
|
4
|
+
}
|
5
|
+
}`),this.templateByQuery.set("saveResource",e.gql`mutation($resource: InputResource!) {
|
6
|
+
$queryAlias$: saveResource(resource: $resource){
|
7
|
+
name
|
8
|
+
resource
|
9
|
+
}
|
10
|
+
}`)}loadResource(e){if(o._loadingResource.has(e))return o._loadingResource.get(e);const n=new Promise(((n,r)=>{t.get().callGraphQL({values:{name:e},query:this.templateByQuery.get("fetchResource")}).then((t=>{n(null==t?void 0:t.resource),o._loadingResource.delete(e)})).catch((t=>{r(t),o._loadingResource.delete(e)}))}));return o._loadingResource.set(e,n),n}saveResource(e,n){return new Promise(((o,r)=>{t.get().callGraphQL({values:{resource:{name:n,resource:JSON.stringify(e)}},query:this.templateByQuery.get("saveResource")}).then((e=>{o(e)})).catch((e=>{r(e)}))}))}}o._loadingResource=new Map;class r extends o{constructor(){super(),this.queryConfig=new Map,this.buildTemplatesConfig()}buildTemplatesConfig(){this.queryConfig.set("fetchUserAvailableConfigs",e.gql`query($name: String!) {
|
11
|
+
$queryAlias$: fetchUserAvailableConfigs(name: $name){
|
12
|
+
name
|
13
|
+
origin
|
14
|
+
key
|
15
|
+
}
|
16
|
+
}`),this.queryConfig.set("fetchLegacyConfig",e.gql`query($name: String!) {
|
17
|
+
$queryAlias$: fetchLegacyConfig(name: $name){
|
18
|
+
name
|
19
|
+
resource
|
20
|
+
}
|
21
|
+
}`),this.queryConfig.set("fetchDefaultConfig",e.gql`query($name: String!) {
|
22
|
+
$queryAlias$: fetchDefaultConfig(name: $name){
|
23
|
+
name
|
24
|
+
resource
|
25
|
+
}
|
26
|
+
}`)}loadFormConfig(e,t){return new Promise(((n,o)=>{Promise.all([this.loadResource(this.getPath(t,e)),this.loadResource(this.getPath(`FormCardState:${t}`,e,"form-card")),this.loadResource(this.getPath(t,e,"summary")),this.loadResource(this.getPath(t,e,"defaultValues"))]).then((([e,t,o,r])=>{let i;if(null!=e){i=Object.assign(Object.assign({},JSON.parse(e)),{emptyConfig:!1});const{tabs:t,fields:n}=i;if(t){const e=new Map(t.map((e=>[e.label,e])));null==n||n.forEach((t=>{var n;return t.tab=(null===(n=e.get(this.getTabName(t.tab)))||void 0===n?void 0:n.label)||e.get(this.getTabName(t.tab))}))}i.fields=null==n?void 0:n.map((e=>{if("readonly"in e){const t=!0===e.readonly;delete e.readonly,e.readOnly=t}return e}))}null!=t&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.cardsState=new Map(JSON.parse(t))),null!=o&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.summary=new Map(Object.entries(JSON.parse(o)))),null!=r&&(null==i&&(i={emptyConfig:!0,fields:[]}),i.defaultVars=new Map(Object.entries(JSON.parse(r)))),n(i)})).catch((e=>{o(e)}))}))}getTabName(e){return"object"==typeof e?e.label:e}saveCardState(e,t,n){const o=this.getPath(`FormCardState:${n}`,t,"form-card");return new Promise(((t,n)=>{this.saveResource(Array.from(e.entries()),o).then((e=>{t(new Map(JSON.parse(e.resource)))})).catch((e=>{n(e)}))}))}saveConfig(e,t,n){delete e.cardsState,delete e.defaultVars,delete e.summary;const o=this.getPath(n,t);return new Promise(((t,n)=>{this.saveResource(e,o).then((e=>{t(JSON.parse(e.resource))})).catch((e=>{n(e)}))}))}fetchUserAvailableConfigs(e,n){const o=this.getPath(n,e);return new Promise(((e,n)=>{t.get().callGraphQL({values:{name:o},query:this.queryConfig.get("fetchUserAvailableConfigs")}).then((t=>{e(t)})).catch((e=>{n(e)}))}))}fetchLegacyConfig(e,o){const r=this.getPath(o,e);return new Promise(((e,o)=>{t.get().callGraphQL({values:{name:r},query:this.queryConfig.get("fetchLegacyConfig")}).then((t=>{e(n.stringToObject((null==t?void 0:t.resource)||""))})).catch((e=>{o(e)}))}))}fetchDefaultConfig(e,o){const r=this.getPath(o,e);return new Promise(((e,o)=>{t.get().callGraphQL({values:{name:r},query:this.queryConfig.get("fetchDefaultConfig")}).then((t=>{(null==t?void 0:t.resource)||e(null),e(n.stringToObject(null==t?void 0:t.resource))})).catch((e=>{o(e)}))}))}getPath(e,t,n="form"){return t?`cfg://${n}/${e}/${t}`:`cfg://${n}/${e}`}async fetchLegacyConfigurableForm(e){const o={requestBody:{config:{chave:e,tipo:"T"}}},r=await t.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(o));if(!n.isEmpty(r))return this.buildLegacyConfigurableForm(r)}async fetchSimpleFormConfig(e){const n={requestBody:{formConfig:{configName:e}}},o=await t.get().callServiceBroker("FormConfig.getFormConfig",JSON.stringify(n));return this.processConfig(o)}async saveSimpleFormConfig(e,n){const o=this.buildSaveSimpleFormConfigPayload(e,n),r=await t.get().callServiceBroker("FormConfig.saveFormConfig",JSON.stringify(o));this.processConfig(r)}processConfig(e){return n.isEmpty(e)?[]:this.getResponseAsArray(e).map((e=>e.name))}getResponseAsArray(e){var t,n,o;const r=null!==(o=null===(n=null===(t=null==e?void 0:e.formConfig)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.field)&&void 0!==o?o:[];return Array.isArray(r)?r:[r]}buildSaveSimpleFormConfigPayload(e,t){return{formConfig:{configName:e,layout:{field:t.map((e=>({name:e})))},metadata:{field:[]}}}}async restoreFormConfig(e){const n={requestBody:{formConfig:{configName:e}}};await t.get().callServiceBroker("FormConfig.restoreFormConfig",JSON.stringify(n))}buildLegacyConfigurableForm(e){var t,n,o;const r=null!==(o=null===(n=null===(t=null==e?void 0:e.formConfig)||void 0===t?void 0:t.layout)||void 0===n?void 0:n.field)&&void 0!==o?o:[];return{emptyConfig:!1,fields:Array.isArray(r)?r:[r]}}async fetchLayoutFormConfig(e){const o={requestBody:{config:{chave:e,tipo:"T"}}},r=await t.get().callServiceBroker("SystemUtilsSP.getConf",JSON.stringify(o));if(!n.isEmpty(r))return r.config}async saveLayoutFormConfig(e,o){const r={requestBody:{config:Object.assign(Object.assign({},o),{chave:e,tipo:"T"})}},i=await t.get().callServiceBroker("SystemUtilsSP.saveConf",JSON.stringify(r));if(!n.isEmpty(i))return i}}var i;!function(e){e.USER="USER",e.DEFAULT="DEFAULT",e.SHARED="SHARED"}(i||(i={}));export{r as F,o as R,i as U}
|