@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-76362.0 → 0.0.0-bugfix-dev-KB-74224.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-f079f5fd.js → ConfigStorage-ecc0ed20.js} +2 -2
- package/dist/cjs/{ContinuousInsertUtils-64e47516.js → ContinuousInsertUtils-29b65619.js} +20 -29
- package/dist/cjs/{DataFetcher-e059eb72.js → DataFetcher-cadeef8e.js} +5 -7
- package/dist/cjs/{SnkFormConfigManager-63369164.js → SnkFormConfigManager-f1c92f79.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-7691a2c1.js → SnkMessageBuilder-bae64d0d.js} +0 -10
- package/dist/cjs/{auth-fetcher-4f853233.js → auth-fetcher-d68841bc.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-228016f4.js → dataunit-fetcher-f89461c1.js} +3 -3
- package/dist/cjs/{form-config-fetcher-39397ac5.js → form-config-fetcher-ed497282.js} +1 -1
- package/dist/cjs/index-f9e81701.js +28 -16
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-a9bfeb22.js → pesquisa-fetcher-ca89181c.js} +2 -7
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +30 -27
- package/dist/cjs/snk-application.cjs.entry.js +60 -102
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-config-options.cjs.entry.js +239 -0
- package/dist/cjs/snk-crud.cjs.entry.js +5 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
- package/dist/cjs/{snk-data-unit-7dbdad0e.js → snk-data-unit-668dc5e8.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -8
- package/dist/cjs/{snk-filter-bar_4.cjs.entry.js → snk-filter-bar.cjs.entry.js} +3 -688
- package/dist/cjs/snk-filter-item.cjs.entry.js +312 -0
- package/dist/cjs/snk-filter-list.cjs.entry.js +152 -0
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal.cjs.entry.js +249 -0
- package/dist/cjs/{snk-config-options_3.cjs.entry.js → snk-form-config.cjs.entry.js} +3 -365
- package/dist/cjs/snk-form.cjs.entry.js +144 -0
- package/dist/cjs/snk-grid.cjs.entry.js +6 -6
- package/dist/cjs/{snk-guides-viewer-eee43c8b.js → snk-guides-viewer-4236cb9d.js} +5 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +14 -14
- package/dist/collection/collection-manifest.json +31 -14
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
- package/dist/collection/components/snk-application/snk-application.js +53 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +0 -3
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +7 -7
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +6 -8
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +2 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +1 -6
- package/dist/collection/lib/message/SnkMessageBuilder.js +0 -2
- package/dist/collection/lib/utils/CrudUtils.js +16 -25
- package/dist/components/ContinuousInsertUtils.js +16 -25
- package/dist/components/DataFetcher.js +5 -7
- package/dist/components/SnkMessageBuilder.js +0 -10
- package/dist/components/dataunit-fetcher.js +2 -2
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.js +0 -3
- package/dist/components/pesquisa-fetcher.js +1 -6
- package/dist/components/snk-actions-button2.js +27 -26
- package/dist/components/snk-application2.js +53 -95
- package/dist/components/snk-detail-view2.js +0 -3
- package/dist/components/snk-simple-crud2.js +7 -7
- package/dist/esm/{ConfigStorage-6514d66e.js → ConfigStorage-7b36d041.js} +2 -2
- package/dist/esm/{ContinuousInsertUtils-b62906f9.js → ContinuousInsertUtils-30caa626.js} +20 -29
- package/dist/esm/{DataFetcher-5034df59.js → DataFetcher-a9c598f2.js} +5 -7
- package/dist/esm/{SnkFormConfigManager-b409c745.js → SnkFormConfigManager-139f09fa.js} +3 -3
- package/dist/esm/{SnkMessageBuilder-7ace6803.js → SnkMessageBuilder-6fff4a4c.js} +0 -10
- package/dist/esm/{auth-fetcher-ca5d3a49.js → auth-fetcher-749d880f.js} +1 -1
- package/dist/esm/{constants-7302ee87.js → constants-8457af36.js} +1 -1
- package/dist/esm/{dataunit-fetcher-56cb648b.js → dataunit-fetcher-c24c76c6.js} +3 -3
- package/dist/esm/{form-config-fetcher-a7d3e277.js → form-config-fetcher-adbe5d34.js} +1 -1
- package/dist/esm/index-a7d3d3f1.js +28 -16
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-6bc2e41a.js → pesquisa-fetcher-8edaa8cd.js} +2 -7
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +32 -29
- package/dist/esm/snk-application.entry.js +60 -102
- package/dist/esm/snk-attach.entry.js +6 -6
- package/dist/esm/snk-config-options.entry.js +235 -0
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +6 -6
- package/dist/esm/snk-data-exporter.entry.js +7 -7
- package/dist/esm/{snk-data-unit-7a579dbd.js → snk-data-unit-0fdfb6c2.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-detail-view.entry.js +9 -9
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/{snk-filter-bar_4.entry.js → snk-filter-bar.entry.js} +5 -687
- package/dist/esm/snk-filter-item.entry.js +308 -0
- package/dist/esm/snk-filter-list.entry.js +148 -0
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-filter-modal.entry.js +245 -0
- package/dist/esm/{snk-config-options_3.entry.js → snk-form-config.entry.js} +6 -366
- package/dist/esm/snk-form.entry.js +140 -0
- package/dist/esm/snk-grid.entry.js +6 -6
- package/dist/esm/{snk-guides-viewer-e8ca764a.js → snk-guides-viewer-8934c537.js} +6 -9
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +15 -15
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/sankhyablocks/p-01086ff7.entry.js +1 -0
- package/dist/sankhyablocks/{p-126c58ea.js → p-06421fdb.js} +1 -1
- package/dist/sankhyablocks/{p-e3a285a2.js → p-16869f77.js} +1 -1
- package/dist/sankhyablocks/p-17425c72.js +1 -0
- package/dist/sankhyablocks/{p-341465ce.js → p-1bf06cd3.js} +2 -2
- package/dist/sankhyablocks/{p-aa003d4e.entry.js → p-212213d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-2923c1b5.js +1 -0
- package/dist/sankhyablocks/p-3b60db06.entry.js +1 -0
- package/dist/sankhyablocks/{p-00f9fe5c.entry.js → p-430e4d3c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-9ffd9fc7.js → p-4d9549cf.js} +1 -1
- package/dist/sankhyablocks/{p-c75fae8e.js → p-5dd8cf4f.js} +1 -1
- package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
- package/dist/sankhyablocks/p-70a4af56.entry.js +1 -0
- package/dist/sankhyablocks/{p-41793e17.entry.js → p-7663f597.entry.js} +1 -1
- package/dist/sankhyablocks/{p-47d24ac8.js → p-7ac7932c.js} +2 -2
- package/dist/sankhyablocks/{p-2d3f9482.entry.js → p-8eb67fa4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f0aaad2b.entry.js → p-92eadb1c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-8b4fc28f.entry.js → p-95df461f.entry.js} +1 -1
- package/dist/sankhyablocks/p-a42e7a1e.entry.js +11 -0
- package/dist/sankhyablocks/p-a724e798.entry.js +1 -0
- package/dist/sankhyablocks/{p-1dbd5c18.entry.js → p-a75d242d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0e206e62.js → p-afbb070d.js} +1 -1
- package/dist/sankhyablocks/{p-95ce311a.js → p-b0ef4383.js} +1 -1
- package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
- package/dist/sankhyablocks/{p-f4e221b2.entry.js → p-b9c67e45.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b389ed49.entry.js → p-be5d8fcb.entry.js} +1 -1
- package/dist/sankhyablocks/p-ca5ec380.js +1 -0
- package/dist/sankhyablocks/p-d3f53df2.entry.js +1 -0
- package/dist/sankhyablocks/{p-a2c790ac.entry.js → p-dcead955.entry.js} +1 -1
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/{p-00278e07.js → p-f3434fc4.js} +1 -1
- package/dist/sankhyablocks/{p-fca0e5cc.entry.js → p-fb34e0cf.entry.js} +1 -1
- package/dist/sankhyablocks/p-fd8e631c.entry.js +1 -0
- package/dist/sankhyablocks/p-feba9d4b.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
- package/dist/types/components/snk-application/snk-application.d.ts +12 -3
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -0
- package/dist/types/components.d.ts +1 -393
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +0 -1
- package/dist/types/lib/utils/CrudUtils.d.ts +0 -1
- package/package.json +2 -3
- package/react/components.d.ts +0 -3
- package/react/components.js +0 -3
- package/react/components.js.map +1 -1
- package/dist/cjs/input-distinct-search_2.cjs.entry.js +0 -471
- package/dist/cjs/snk-distinct-search.cjs.entry.js +0 -123
- package/dist/collection/components/snk-application/request-listener/DebouncedRequestListener.js +0 -28
- package/dist/collection/components/snk-application/request-listener/RequestListenerFactory.js +0 -16
- package/dist/collection/components/snk-application/request-listener/RequestListenerLoadingBar.js +0 -52
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.css +0 -4
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.js +0 -372
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.css +0 -110
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +0 -544
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +0 -28
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +0 -593
- package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +0 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/distinct-search-fetcher.js +0 -25
- package/dist/collection/lib/message/resources/snk-distinct-search.msg.js +0 -9
- package/dist/collection/sw.js +0 -46
- package/dist/components/filter-distinct-search.js +0 -17
- package/dist/components/input-distinct-search.d.ts +0 -11
- package/dist/components/input-distinct-search.js +0 -6
- package/dist/components/input-distinct-search2.js +0 -264
- package/dist/components/search-modal.d.ts +0 -11
- package/dist/components/search-modal.js +0 -6
- package/dist/components/search-modal2.js +0 -264
- package/dist/components/snk-distinct-search.d.ts +0 -11
- package/dist/components/snk-distinct-search.js +0 -163
- package/dist/esm/input-distinct-search_2.entry.js +0 -466
- package/dist/esm/snk-distinct-search.entry.js +0 -119
- package/dist/sankhyablocks/p-0e250436.entry.js +0 -1
- package/dist/sankhyablocks/p-154aa2a6.entry.js +0 -11
- package/dist/sankhyablocks/p-18cb1acb.entry.js +0 -1
- package/dist/sankhyablocks/p-30ebcbe0.entry.js +0 -1
- package/dist/sankhyablocks/p-3755b46f.entry.js +0 -1
- package/dist/sankhyablocks/p-3858a2e4.entry.js +0 -1
- package/dist/sankhyablocks/p-42130213.entry.js +0 -1
- package/dist/sankhyablocks/p-563b7c28.entry.js +0 -1
- package/dist/sankhyablocks/p-aaf94476.js +0 -1
- package/dist/sankhyablocks/p-d8665750.js +0 -1
- package/dist/sankhyablocks/p-e4391e16.js +0 -1
- package/dist/types/components/snk-application/request-listener/DebouncedRequestListener.d.ts +0 -11
- package/dist/types/components/snk-application/request-listener/RequestListenerFactory.d.ts +0 -12
- package/dist/types/components/snk-application/request-listener/RequestListenerLoadingBar.d.ts +0 -13
- package/dist/types/components/snk-distinct-search/snk-distinct-search.d.ts +0 -83
- package/dist/types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.d.ts +0 -105
- package/dist/types/components/snk-distinct-search/subcomponents/search-modal/search-modal.d.ts +0 -127
- package/dist/types/components/snk-distinct-search/types/index.d.ts +0 -12
- package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +0 -4
- package/dist/types/lib/http/data-fetcher/fetchers/distinct-search-fetcher.d.ts +0 -6
- package/dist/types/lib/message/resources/snk-distinct-search.msg.d.ts +0 -2
- /package/dist/collection/components/{snk-distinct-search/types → snk-actions-button/interfaces}/index.js +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-f9e81701.js');
|
|
6
|
+
const core = require('@sankhyalabs/core');
|
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
|
|
8
|
+
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
9
|
+
require('./ConfigStorage-ecc0ed20.js');
|
|
10
|
+
require('./form-config-fetcher-ed497282.js');
|
|
11
|
+
require('./DataFetcher-cadeef8e.js');
|
|
12
|
+
require('./PrintUtils-bcaeb82f.js');
|
|
13
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
|
+
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
15
|
+
require('./constants-35ddd366.js');
|
|
16
|
+
|
|
17
|
+
const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
|
|
18
|
+
|
|
19
|
+
const SnkForm = class {
|
|
20
|
+
constructor(hostRef) {
|
|
21
|
+
index.registerInstance(this, hostRef);
|
|
22
|
+
this.exit = index.createEvent(this, "exit", 7);
|
|
23
|
+
this.actionClick = index.createEvent(this, "actionClick", 7);
|
|
24
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
|
25
|
+
this._customEditors = new Map();
|
|
26
|
+
this._dataUnit = undefined;
|
|
27
|
+
this._dataState = undefined;
|
|
28
|
+
this._showFormConfig = false;
|
|
29
|
+
this._configManager = undefined;
|
|
30
|
+
this.configName = undefined;
|
|
31
|
+
this.recordsValidator = undefined;
|
|
32
|
+
this.messagesBuilder = undefined;
|
|
33
|
+
this.formLegacyConfigName = undefined;
|
|
34
|
+
this.resourceID = undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Exibe a janela de configurações do formulário.
|
|
38
|
+
*/
|
|
39
|
+
async showConfig() {
|
|
40
|
+
this._showFormConfig = true;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Fecha a janela de configurações do formulário.
|
|
44
|
+
*/
|
|
45
|
+
async hideConfig() {
|
|
46
|
+
this._showFormConfig = false;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Registra um editor customizado para campos da grade e formulário.
|
|
50
|
+
*/
|
|
51
|
+
async addCustomEditor(fieldName, customEditor) {
|
|
52
|
+
if (this._form) {
|
|
53
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const newCustomEditors = new Map(this._customEditors);
|
|
57
|
+
newCustomEditors.set(fieldName, customEditor);
|
|
58
|
+
this._customEditors = newCustomEditors;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
|
62
|
+
*/
|
|
63
|
+
async setFieldProp(fieldName, propName, value) {
|
|
64
|
+
await this._form.setFieldProp(fieldName, propName, value);
|
|
65
|
+
}
|
|
66
|
+
closeConfig() {
|
|
67
|
+
this.hideConfig();
|
|
68
|
+
}
|
|
69
|
+
dataunitReady() {
|
|
70
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
|
71
|
+
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
72
|
+
}
|
|
73
|
+
setCustomEditors() {
|
|
74
|
+
if (!this._form) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
for (const [fieldName, customEditor] of this._customEditors) {
|
|
78
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
|
79
|
+
this._customEditors.delete(fieldName);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
async componentDidRender() {
|
|
83
|
+
this.setCustomEditors();
|
|
84
|
+
}
|
|
85
|
+
async componentWillLoad() {
|
|
86
|
+
let parent = this._element.parentElement;
|
|
87
|
+
while (parent) {
|
|
88
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
|
89
|
+
this._snkDataUnit = parent;
|
|
90
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
|
91
|
+
this._dataState = this._snkDataUnit.dataState;
|
|
92
|
+
if (this._dataUnit) {
|
|
93
|
+
this.dataunitReady();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
|
97
|
+
this._dataUnit = evt.detail;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
parent = parent.parentElement;
|
|
104
|
+
}
|
|
105
|
+
if (this.resourceID == undefined) {
|
|
106
|
+
this.resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
|
|
107
|
+
}
|
|
108
|
+
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
|
|
109
|
+
this.addFormLegacyConfig();
|
|
110
|
+
await this._configManager.loadConfig();
|
|
111
|
+
}
|
|
112
|
+
async handleDataStateChange(evt) {
|
|
113
|
+
var _a;
|
|
114
|
+
this._dataState = evt.detail;
|
|
115
|
+
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
|
116
|
+
for (const field of fieldsWithRmPrecision || []) {
|
|
117
|
+
if (!field) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
|
|
121
|
+
if (!rmPrecision && rmPrecision !== 0) {
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
await this.setFieldProp(field, 'precision', rmPrecision);
|
|
125
|
+
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
addFormLegacyConfig() {
|
|
129
|
+
if (this.formLegacyConfigName) {
|
|
130
|
+
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
render() {
|
|
134
|
+
if (!this._dataUnit || !this._dataState) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
|
138
|
+
index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
|
|
139
|
+
}
|
|
140
|
+
get _element() { return index.getElement(this); }
|
|
141
|
+
};
|
|
142
|
+
SnkForm.style = snkFormCss;
|
|
143
|
+
|
|
144
|
+
exports.snk_form = SnkForm;
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
|
|
9
9
|
const index$1 = require('./index-1dfc7a6e.js');
|
|
10
10
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
12
|
-
const ContinuousInsertUtils = require('./ContinuousInsertUtils-
|
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-29b65619.js');
|
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
14
|
-
require('./DataFetcher-
|
|
15
|
-
require('./pesquisa-fetcher-
|
|
14
|
+
require('./DataFetcher-cadeef8e.js');
|
|
15
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
|
16
16
|
require('./ISave-e91b70a7.js');
|
|
17
17
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
19
|
-
require('./dataunit-fetcher-
|
|
19
|
+
require('./dataunit-fetcher-f89461c1.js');
|
|
20
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
21
|
-
require('./form-config-fetcher-
|
|
21
|
+
require('./form-config-fetcher-ed497282.js');
|
|
22
22
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
|
24
24
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -2,20 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
|
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
7
7
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
8
8
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
|
-
require('./DataFetcher-
|
|
11
|
-
require('./pesquisa-fetcher-
|
|
10
|
+
require('./DataFetcher-cadeef8e.js');
|
|
11
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
|
12
12
|
const index$1 = require('./index-1dfc7a6e.js');
|
|
13
13
|
require('./ISave-e91b70a7.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
16
|
-
require('./dataunit-fetcher-
|
|
16
|
+
require('./dataunit-fetcher-f89461c1.js');
|
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
18
|
-
require('./form-config-fetcher-
|
|
18
|
+
require('./form-config-fetcher-ed497282.js');
|
|
19
19
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
20
20
|
|
|
21
21
|
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}";
|
|
@@ -455,9 +455,6 @@ const SnkGuidesViewer = class {
|
|
|
455
455
|
await this.addErrorBadgeToGuide(guideName);
|
|
456
456
|
await this.openGuideNavigator(guideName);
|
|
457
457
|
}
|
|
458
|
-
if (action.type === core.Action.METADATA_LOADED) {
|
|
459
|
-
this.loadGuides(false);
|
|
460
|
-
}
|
|
461
458
|
}
|
|
462
459
|
async addErrorBadgeToGuide(guideName) {
|
|
463
460
|
var _a;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-4236cb9d.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
|
-
require('./SnkFormConfigManager-
|
|
9
|
-
require('./ConfigStorage-
|
|
10
|
-
require('./form-config-fetcher-
|
|
11
|
-
require('./DataFetcher-
|
|
8
|
+
require('./SnkFormConfigManager-f1c92f79.js');
|
|
9
|
+
require('./ConfigStorage-ecc0ed20.js');
|
|
10
|
+
require('./form-config-fetcher-ed497282.js');
|
|
11
|
+
require('./DataFetcher-cadeef8e.js');
|
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
@@ -18,10 +18,10 @@ require('./field-search-68e34bf4.js');
|
|
|
18
18
|
require('./taskbar-elements-9ad1f9c0.js');
|
|
19
19
|
require('./index-1dfc7a6e.js');
|
|
20
20
|
require('./index-102ba62d.js');
|
|
21
|
-
require('./pesquisa-fetcher-
|
|
21
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
|
22
22
|
require('./ISave-e91b70a7.js');
|
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
24
|
-
require('./dataunit-fetcher-
|
|
24
|
+
require('./dataunit-fetcher-f89461c1.js');
|
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
26
26
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
27
27
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
|
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
12
12
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
13
|
-
require('./form-config-fetcher-
|
|
14
|
-
require('./DataFetcher-
|
|
13
|
+
require('./form-config-fetcher-ed497282.js');
|
|
14
|
+
require('./DataFetcher-cadeef8e.js');
|
|
15
15
|
require('./PrintUtils-bcaeb82f.js');
|
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
17
17
|
|
|
@@ -7,19 +7,19 @@ const core = require('@sankhyalabs/core');
|
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
10
|
-
require('./DataFetcher-
|
|
11
|
-
require('./pesquisa-fetcher-
|
|
12
|
-
const ContinuousInsertUtils = require('./ContinuousInsertUtils-
|
|
10
|
+
require('./DataFetcher-cadeef8e.js');
|
|
11
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-29b65619.js');
|
|
13
13
|
const index = require('./index-1dfc7a6e.js');
|
|
14
14
|
require('./ISave-e91b70a7.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-f89461c1.js');
|
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
|
19
|
+
const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
|
|
20
20
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
21
|
+
const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
|
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
|
|
23
23
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -724,11 +724,9 @@ const SnkSimpleCrud = class {
|
|
|
724
724
|
window.removeEventListener("keydown", this._keyDownHandler);
|
|
725
725
|
}
|
|
726
726
|
gridConfigChangeHandler(evt) {
|
|
727
|
-
evt.stopPropagation();
|
|
728
|
-
if (!this.configName)
|
|
729
|
-
return;
|
|
730
727
|
const config = evt.detail;
|
|
731
728
|
ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
|
|
729
|
+
evt.stopPropagation();
|
|
732
730
|
}
|
|
733
731
|
modalConfigChangeHandler(evt) {
|
|
734
732
|
const config = evt.detail;
|
|
@@ -805,16 +803,18 @@ const SnkSimpleCrud = class {
|
|
|
805
803
|
return;
|
|
806
804
|
this.goToView(constants.VIEW_MODE.FORM);
|
|
807
805
|
}
|
|
806
|
+
renderTaskbarContent() {
|
|
807
|
+
var _a;
|
|
808
|
+
return (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
|
809
|
+
}
|
|
808
810
|
/* istanbul ignore next */
|
|
809
811
|
render() {
|
|
810
|
-
var _a;
|
|
811
812
|
if (this.dataUnit == undefined) {
|
|
812
813
|
return;
|
|
813
814
|
}
|
|
814
|
-
|
|
815
|
-
return (index$1.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 === constants.VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === constants.VIEW_MODE.FORM && taskbarContent, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.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(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
815
|
+
return (index$1.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 === constants.VIEW_MODE.GRID && !this.enableGridInsert, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.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(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
816
816
|
? undefined
|
|
817
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this.
|
|
817
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, this.renderTaskbarContent(), index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, this.renderTaskbarContent(), index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.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 })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
818
818
|
}
|
|
819
819
|
get _element() { return index$1.getElement(this); }
|
|
820
820
|
static get watchers() { return {
|
|
@@ -19,9 +19,6 @@
|
|
|
19
19
|
"./components/snk-custom-slot-elements/snk-custom-slot-elements.js",
|
|
20
20
|
"./components/snk-data-exporter/snk-data-exporter.js",
|
|
21
21
|
"./components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js",
|
|
22
|
-
"./components/snk-distinct-search/snk-distinct-search.js",
|
|
23
|
-
"./components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js",
|
|
24
|
-
"./components/snk-distinct-search/subcomponents/search-modal/search-modal.js",
|
|
25
22
|
"./components/snk-entity-list/snk-entity-list.js",
|
|
26
23
|
"./components/snk-filter-bar/snk-filter-bar.js",
|
|
27
24
|
"./components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js",
|
|
@@ -68,6 +65,21 @@
|
|
|
68
65
|
"snk-application"
|
|
69
66
|
]
|
|
70
67
|
},
|
|
68
|
+
{
|
|
69
|
+
"components": [
|
|
70
|
+
"snk-form"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"components": [
|
|
75
|
+
"snk-form-config"
|
|
76
|
+
]
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"components": [
|
|
80
|
+
"snk-config-options"
|
|
81
|
+
]
|
|
82
|
+
},
|
|
71
83
|
{
|
|
72
84
|
"components": [
|
|
73
85
|
"snk-tab-config"
|
|
@@ -120,37 +132,42 @@
|
|
|
120
132
|
},
|
|
121
133
|
{
|
|
122
134
|
"components": [
|
|
123
|
-
"snk-
|
|
135
|
+
"snk-filter-bar"
|
|
124
136
|
]
|
|
125
137
|
},
|
|
126
138
|
{
|
|
127
139
|
"components": [
|
|
128
|
-
"snk-
|
|
140
|
+
"snk-filter-item"
|
|
129
141
|
]
|
|
130
142
|
},
|
|
131
143
|
{
|
|
132
144
|
"components": [
|
|
133
|
-
"snk-
|
|
145
|
+
"snk-filter-list"
|
|
134
146
|
]
|
|
135
147
|
},
|
|
136
148
|
{
|
|
137
149
|
"components": [
|
|
138
|
-
"snk-
|
|
150
|
+
"snk-filter-modal"
|
|
139
151
|
]
|
|
140
152
|
},
|
|
141
153
|
{
|
|
142
154
|
"components": [
|
|
143
|
-
"snk-config
|
|
144
|
-
"snk-form",
|
|
145
|
-
"snk-form-config"
|
|
155
|
+
"snk-field-config"
|
|
146
156
|
]
|
|
147
157
|
},
|
|
148
158
|
{
|
|
149
159
|
"components": [
|
|
150
|
-
"snk-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
160
|
+
"snk-grid"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"components": [
|
|
165
|
+
"snk-pesquisa"
|
|
166
|
+
]
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"components": [
|
|
170
|
+
"snk-taskbar"
|
|
154
171
|
]
|
|
155
172
|
}
|
|
156
173
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, Host } from '@stencil/core';
|
|
2
|
-
import { ApplicationContext, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ApplicationContext, ArrayUtils, ElementIDUtils, ServiceUtils, StorageType } from '@sankhyalabs/core';
|
|
3
3
|
import { DataFetcher } from '../../lib/http/data-fetcher/DataFetcher';
|
|
4
4
|
import ExecutorFactory from './actions/factory/executor.factory';
|
|
5
5
|
import Actions from './actions';
|
|
@@ -8,6 +8,7 @@ import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
|
|
|
8
8
|
export class SnkActionsButton {
|
|
9
9
|
constructor() {
|
|
10
10
|
this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
|
|
11
|
+
this._actions = [];
|
|
11
12
|
this.handleClick = (evt) => {
|
|
12
13
|
const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
|
|
13
14
|
const executor = new ExecutorFactory(selectedAction.type).executor;
|
|
@@ -17,27 +18,22 @@ export class SnkActionsButton {
|
|
|
17
18
|
};
|
|
18
19
|
this._items = [];
|
|
19
20
|
this._showDropdown = false;
|
|
20
|
-
this._actions = [];
|
|
21
|
-
this._isOrderActions = false;
|
|
22
21
|
}
|
|
23
22
|
async getActions() {
|
|
24
|
-
|
|
25
|
-
param: {
|
|
26
|
-
entityName: this._entityName,
|
|
27
|
-
resourceID: this._resourceID
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
return DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param).then((result) => {
|
|
23
|
+
const actions = await ServiceUtils.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`, async () => {
|
|
31
24
|
var _a;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
});
|
|
25
|
+
const param = {
|
|
26
|
+
param: {
|
|
27
|
+
entityName: this._entityName,
|
|
28
|
+
resourceID: this._resourceID,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const result = await DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param);
|
|
32
|
+
return ((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action) || [];
|
|
33
|
+
}, StorageType.IN_MEMORY_CACHE);
|
|
34
|
+
this._actions = SnkActionsButton.parameters.isOrderActions
|
|
35
|
+
? ArrayUtils.sortAlphabetically(actions, 'description')
|
|
36
|
+
: actions;
|
|
41
37
|
}
|
|
42
38
|
controlDropdown() {
|
|
43
39
|
this._showDropdown = !this._showDropdown;
|
|
@@ -70,7 +66,7 @@ export class SnkActionsButton {
|
|
|
70
66
|
}
|
|
71
67
|
async componentWillLoad() {
|
|
72
68
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
73
|
-
|
|
69
|
+
await this.loadParameters();
|
|
74
70
|
const snkDataUnit = this._element.parentElement;
|
|
75
71
|
this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
|
|
76
72
|
this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
|
|
@@ -79,9 +75,8 @@ export class SnkActionsButton {
|
|
|
79
75
|
this._resourceID = await ResourceIDUtils.getResourceID();
|
|
80
76
|
}
|
|
81
77
|
this.setEvents();
|
|
82
|
-
this.getActions()
|
|
83
|
-
|
|
84
|
-
});
|
|
78
|
+
await this.getActions();
|
|
79
|
+
this.loadItems();
|
|
85
80
|
}
|
|
86
81
|
async componentDidLoad() {
|
|
87
82
|
if (!this._element)
|
|
@@ -108,6 +103,11 @@ export class SnkActionsButton {
|
|
|
108
103
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
|
109
104
|
};
|
|
110
105
|
}
|
|
106
|
+
async loadParameters() {
|
|
107
|
+
if (SnkActionsButton.parameters.isOrderActions != null)
|
|
108
|
+
return;
|
|
109
|
+
SnkActionsButton.parameters.isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
|
|
110
|
+
}
|
|
111
111
|
render() {
|
|
112
112
|
return (h(Host, null, (this._actions && this._actions.length > 0) &&
|
|
113
113
|
(h("div", { class: `ez-padding-left--medium snk-actions-button
|
|
@@ -134,10 +134,11 @@ export class SnkActionsButton {
|
|
|
134
134
|
static get states() {
|
|
135
135
|
return {
|
|
136
136
|
"_items": {},
|
|
137
|
-
"_showDropdown": {}
|
|
138
|
-
"_actions": {},
|
|
139
|
-
"_isOrderActions": {}
|
|
137
|
+
"_showDropdown": {}
|
|
140
138
|
};
|
|
141
139
|
}
|
|
142
140
|
static get elementRef() { return "_element"; }
|
|
143
141
|
}
|
|
142
|
+
SnkActionsButton.parameters = {
|
|
143
|
+
isOrderActions: null
|
|
144
|
+
};
|
|
@@ -15,7 +15,6 @@ import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
|
|
|
15
15
|
import UrlUtils from "../../lib/utils/urlutils";
|
|
16
16
|
import Workspace from "../../lib/workspace/workspace";
|
|
17
17
|
import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
|
|
18
|
-
import RequestListenerFactory from "./request-listener/RequestListenerFactory";
|
|
19
18
|
/**
|
|
20
19
|
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
|
21
20
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
|
@@ -29,7 +28,7 @@ export class SnkApplication {
|
|
|
29
28
|
this._waitingAppReady = new Array();
|
|
30
29
|
this._duCache = new Map();
|
|
31
30
|
this._duPromises = new Map();
|
|
32
|
-
this._requestListener =
|
|
31
|
+
this._requestListener = new RequestListenerLoadingBar();
|
|
33
32
|
this._pendingActions = new Map;
|
|
34
33
|
this._loadPkParameter = null;
|
|
35
34
|
this._isLoadedByPk = false;
|
|
@@ -1005,7 +1004,7 @@ export class SnkApplication {
|
|
|
1005
1004
|
.unbind("F1");
|
|
1006
1005
|
}
|
|
1007
1006
|
render() {
|
|
1008
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.
|
|
1007
|
+
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
|
1009
1008
|
}
|
|
1010
1009
|
static get is() { return "snk-application"; }
|
|
1011
1010
|
static get encapsulation() { return "scoped"; }
|
|
@@ -2514,6 +2513,57 @@ export class SnkApplication {
|
|
|
2514
2513
|
}];
|
|
2515
2514
|
}
|
|
2516
2515
|
}
|
|
2516
|
+
class RequestListenerLoadingBar {
|
|
2517
|
+
constructor() {
|
|
2518
|
+
this._debounceTime = 1000;
|
|
2519
|
+
this._ignoredNameTypes = ["totals"];
|
|
2520
|
+
this._countRequest = 0;
|
|
2521
|
+
}
|
|
2522
|
+
onRequestStart(param) {
|
|
2523
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
2524
|
+
return;
|
|
2525
|
+
}
|
|
2526
|
+
this._countRequest++;
|
|
2527
|
+
this.loadingBar.show();
|
|
2528
|
+
if (this._timerLoading) {
|
|
2529
|
+
clearTimeout(this._timerLoading);
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
;
|
|
2533
|
+
onRequestEnd(param) {
|
|
2534
|
+
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
2535
|
+
return;
|
|
2536
|
+
}
|
|
2537
|
+
this._countRequest--;
|
|
2538
|
+
this._timerLoading = setTimeout(() => {
|
|
2539
|
+
if (this._countRequest <= 0) {
|
|
2540
|
+
this.loadingBar.hide();
|
|
2541
|
+
}
|
|
2542
|
+
}, this._debounceTime);
|
|
2543
|
+
}
|
|
2544
|
+
;
|
|
2545
|
+
isIgnoreLoadingOnRequest(param) {
|
|
2546
|
+
if (param == undefined) {
|
|
2547
|
+
return false;
|
|
2548
|
+
}
|
|
2549
|
+
if (param.url.includes("quietMode=true")) {
|
|
2550
|
+
return true;
|
|
2551
|
+
}
|
|
2552
|
+
if (param.requestBody == undefined) {
|
|
2553
|
+
return false;
|
|
2554
|
+
}
|
|
2555
|
+
if (param.requestBody.length == 1) {
|
|
2556
|
+
const { name } = param.requestBody[0].variables;
|
|
2557
|
+
if (name) {
|
|
2558
|
+
const nameParts = name.split(":");
|
|
2559
|
+
const nameType = nameParts[0];
|
|
2560
|
+
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
return false;
|
|
2564
|
+
}
|
|
2565
|
+
;
|
|
2566
|
+
}
|
|
2517
2567
|
class PendingPromise {
|
|
2518
2568
|
constructor(resolve, reject) {
|
|
2519
2569
|
this.resolve = resolve;
|
|
@@ -439,9 +439,6 @@ export class SnkGuidesViewer {
|
|
|
439
439
|
await this.addErrorBadgeToGuide(guideName);
|
|
440
440
|
await this.openGuideNavigator(guideName);
|
|
441
441
|
}
|
|
442
|
-
if (action.type === DUAction.METADATA_LOADED) {
|
|
443
|
-
this.loadGuides(false);
|
|
444
|
-
}
|
|
445
442
|
}
|
|
446
443
|
async addErrorBadgeToGuide(guideName) {
|
|
447
444
|
var _a;
|