@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-kb-85616.0 → 0.0.0-bugfix-dev-KB-81596.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/{ClientSideExporterProvider-9bd6fa5a.js → ClientSideExporterProvider-5fff8770.js} +20 -25
- package/dist/cjs/{ConfigStorage-6b633b10.js → ConfigStorage-df09fb78.js} +2 -2
- package/dist/cjs/{DataFetcher-875371e9.js → DataFetcher-1afdb18e.js} +14 -2
- package/dist/cjs/{pesquisa-fetcher-30cab386.js → ISave-c76e2c51.js} +35 -3
- package/dist/cjs/{SnkFormConfigManager-d680be08.js → SnkFormConfigManager-45a8d7b7.js} +3 -3
- package/dist/cjs/{auth-fetcher-24ba4135.js → auth-fetcher-1687ac0a.js} +1 -1
- package/dist/cjs/{constants-241934b3.js → constants-77c1b8bd.js} +1 -0
- package/dist/cjs/{dataunit-fetcher-b95768e8.js → dataunit-fetcher-4a5d491a.js} +7 -6
- package/dist/cjs/{form-config-fetcher-e0a512c3.js → form-config-fetcher-40d3f752.js} +15 -1
- 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 +6 -7
- 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} +68 -7
- package/dist/cjs/snk-application.cjs.entry.js +176 -13
- package/dist/cjs/snk-attach.cjs.entry.js +6 -7
- package/dist/cjs/snk-config-options_3.cjs.entry.js +10 -8
- package/dist/cjs/snk-configurator.cjs.entry.js +9 -2
- package/dist/cjs/snk-crud.cjs.entry.js +8 -8
- package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -7
- package/dist/cjs/{snk-data-unit-33937ffe.js → snk-data-unit-4b510d6e.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +11 -11
- package/dist/cjs/snk-field-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-search.cjs.entry.js +18 -5
- package/dist/cjs/snk-grid.cjs.entry.js +7 -8
- package/dist/cjs/{snk-guides-viewer-65964889.js → snk-guides-viewer-e8e5f7b4.js} +7 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +12 -13
- package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -10
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +5 -2
- package/dist/collection/components/snk-application/search-strategy/exec-prepared-search-plus.js +107 -0
- package/dist/collection/components/snk-application/snk-application.js +126 -4
- 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-crud/subcomponents/snk-detail-view/snk-detail-view.css +10 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +25 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +15 -19
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +18 -5
- package/dist/collection/components/snk-form-config/subcomponents/snk-config-options/snk-config-options.js +5 -3
- package/dist/collection/components/snk-grid-config/snk-grid-config.js +2 -0
- 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/DataFetcher.js +14 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +6 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +14 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/pesquisa-fetcher.js +26 -2
- package/dist/collection/lib/utils/constants.js +1 -0
- package/dist/components/ContinuousInsertUtils.js +15 -19
- package/dist/components/DataFetcher.js +14 -2
- package/dist/components/ISave.js +26 -2
- package/dist/components/constants.js +1 -0
- package/dist/components/dataunit-fetcher.js +6 -5
- 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 +174 -6
- package/dist/components/snk-attach2.js +34 -22
- package/dist/components/snk-config-options2.js +5 -3
- package/dist/components/snk-configurator2.js +22 -2
- package/dist/components/snk-crud.js +76 -62
- package/dist/components/snk-detail-view2.js +110 -86
- package/dist/components/snk-filter-search.js +18 -5
- package/dist/components/snk-grid-config2.js +2 -0
- 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-da9935ed.js} +20 -25
- package/dist/esm/{ConfigStorage-e5c1f4c0.js → ConfigStorage-71e6766f.js} +2 -2
- package/dist/esm/{DataFetcher-ecf5f903.js → DataFetcher-88e56266.js} +14 -2
- package/dist/esm/{pesquisa-fetcher-e26c3295.js → ISave-5efafc97.js} +36 -4
- package/dist/esm/{SnkFormConfigManager-1efd102b.js → SnkFormConfigManager-be490a33.js} +3 -3
- package/dist/esm/{auth-fetcher-9987c66e.js → auth-fetcher-3510520e.js} +1 -1
- package/dist/esm/{constants-75abb876.js → constants-7db1128a.js} +1 -0
- package/dist/esm/{dataunit-fetcher-ed6e65ef.js → dataunit-fetcher-1d02ecfc.js} +7 -6
- package/dist/esm/{form-config-fetcher-34becd23.js → form-config-fetcher-fa208a6c.js} +15 -1
- package/dist/esm/index-a7d3d3f1.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +5 -6
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_5.entry.js → snk-actions-button_7.entry.js} +68 -9
- package/dist/esm/snk-application.entry.js +176 -13
- package/dist/esm/snk-attach.entry.js +6 -7
- package/dist/esm/snk-config-options_3.entry.js +10 -8
- package/dist/esm/snk-configurator.entry.js +9 -2
- package/dist/esm/snk-crud.entry.js +8 -8
- package/dist/esm/snk-data-exporter.entry.js +6 -7
- package/dist/esm/{snk-data-unit-6258b8ae.js → snk-data-unit-7d0ce406.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +11 -11
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-filter-search.entry.js +18 -5
- package/dist/esm/snk-grid.entry.js +7 -8
- package/dist/esm/{snk-guides-viewer-9e43d0ca.js → snk-guides-viewer-c44b3839.js} +7 -8
- package/dist/esm/snk-guides-viewer.entry.js +8 -9
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-pesquisa.entry.js +5 -6
- package/dist/esm/snk-simple-crud.entry.js +10 -10
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/sankhyablocks/p-00796b12.entry.js +1 -0
- package/dist/sankhyablocks/{p-3fcb90d6.js → p-03b68a74.js} +1 -1
- package/dist/sankhyablocks/p-092078e3.entry.js +1 -0
- package/dist/sankhyablocks/{p-d3b9b377.entry.js → p-165cde3b.entry.js} +1 -1
- package/dist/sankhyablocks/p-35f85998.entry.js +1 -0
- package/dist/sankhyablocks/{p-2953c481.entry.js → p-3749dffb.entry.js} +1 -1
- package/dist/sankhyablocks/p-38e3ffda.entry.js +1 -0
- package/dist/sankhyablocks/p-3b190fb1.entry.js +1 -0
- package/dist/sankhyablocks/{p-6c43fcde.entry.js → p-490b75b5.entry.js} +1 -1
- package/dist/sankhyablocks/p-4ad638be.js +1 -0
- package/dist/sankhyablocks/p-5503e89f.entry.js +1 -0
- package/dist/sankhyablocks/p-5cc206bb.entry.js +1 -0
- package/dist/sankhyablocks/{p-e66bcb5c.entry.js → p-5ffa0493.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6c9d1be4.entry.js → p-60137b7a.entry.js} +1 -1
- package/dist/sankhyablocks/p-601b252b.js +26 -0
- package/dist/sankhyablocks/p-6293ded9.entry.js +11 -0
- package/dist/sankhyablocks/p-6dd38d7b.js +6 -0
- package/dist/sankhyablocks/{p-abd9681c.js → p-6e0a5314.js} +1 -1
- package/dist/sankhyablocks/{p-a77bdadc.js → p-73285a8a.js} +1 -1
- package/dist/sankhyablocks/p-893b9483.entry.js +1 -0
- package/dist/sankhyablocks/p-90684a75.entry.js +1 -0
- package/dist/sankhyablocks/{p-1d19a5b0.js → p-9261d8a0.js} +1 -1
- package/dist/sankhyablocks/p-92778d5a.js +1 -0
- package/dist/sankhyablocks/{p-7e0a0aae.js → p-a8be1d67.js} +1 -1
- package/dist/sankhyablocks/{p-2746d606.entry.js → p-b2a2a83e.entry.js} +1 -1
- package/dist/sankhyablocks/p-b6200d32.entry.js +1 -0
- package/dist/sankhyablocks/{p-23cd6abf.entry.js → p-c0eb761b.entry.js} +1 -1
- package/dist/sankhyablocks/p-d9fdb018.entry.js +1 -0
- package/dist/sankhyablocks/{p-3ce68be5.js → p-ebdb9d89.js} +1 -1
- package/dist/sankhyablocks/p-ef6f0a1b.entry.js +1 -0
- package/dist/sankhyablocks/{p-5a7e18f4.js → p-fbba7e3d.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/search-strategy/exec-prepared-search-plus.d.ts +5 -0
- package/dist/types/components/snk-application/snk-application.d.ts +17 -2
- 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-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +5 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +5 -3
- package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +1 -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 +83 -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/dist/types/lib/http/data-fetcher/fetchers/pesquisa-fetcher.d.ts +4 -1
- package/dist/types/lib/utils/constants.d.ts +1 -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-05fda408.entry.js +0 -1
- package/dist/sankhyablocks/p-1a8295af.entry.js +0 -1
- package/dist/sankhyablocks/p-1e48864c.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-3d424ae9.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-a18de25e.js +0 -1
- package/dist/sankhyablocks/p-be2e5f36.entry.js +0 -1
- package/dist/sankhyablocks/p-c8622597.entry.js +0 -1
- package/dist/sankhyablocks/p-d571e243.entry.js +0 -1
- package/dist/sankhyablocks/p-ef076eea.js +0 -6
|
@@ -3,14 +3,20 @@ import { h } from '@stencil/core';
|
|
|
3
3
|
import FilterItemType from '../filter-item-type.enum';
|
|
4
4
|
export class SnkFilterSearch {
|
|
5
5
|
constructor() {
|
|
6
|
+
this._isSearchPlus = false;
|
|
6
7
|
this.config = undefined;
|
|
7
8
|
this.value = undefined;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* Emitido quando acontece a alteração de valor do componente snk-filter-search
|
|
11
12
|
*/
|
|
12
|
-
ezChangeListener(_evt) {
|
|
13
|
-
this.
|
|
13
|
+
async ezChangeListener(_evt) {
|
|
14
|
+
if (this._isSearchPlus) {
|
|
15
|
+
this.value = await this._searchInput.getValueAsync();
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
this.value = this._searchInput.value;
|
|
19
|
+
}
|
|
14
20
|
this.valueChanged.emit(this.value);
|
|
15
21
|
}
|
|
16
22
|
componentDidLoad() {
|
|
@@ -18,10 +24,11 @@ export class SnkFilterSearch {
|
|
|
18
24
|
ElementIDUtils.addIDInfo(this._element, 'filterContentEditor');
|
|
19
25
|
}
|
|
20
26
|
}
|
|
21
|
-
doSearch(mode, argument) {
|
|
27
|
+
doSearch(mode, argument, isSearchPlus = false) {
|
|
22
28
|
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
29
|
+
const loader = isSearchPlus ? application.executePreparedSearchPlus : application.executePreparedSearch;
|
|
23
30
|
return new Promise((resolve, reject) => {
|
|
24
|
-
|
|
31
|
+
loader.bind(application)(mode, argument, this.config.props.searchContext)
|
|
25
32
|
.then(result => {
|
|
26
33
|
resolve(result);
|
|
27
34
|
}).catch(reason => {
|
|
@@ -35,11 +42,17 @@ export class SnkFilterSearch {
|
|
|
35
42
|
async show() {
|
|
36
43
|
this._searchInput.setFocus();
|
|
37
44
|
}
|
|
45
|
+
getInputItem() {
|
|
46
|
+
var _a;
|
|
47
|
+
this._isSearchPlus = ((_a = this.config.props) === null || _a === void 0 ? void 0 : _a["useSearchPlus"]) == true;
|
|
48
|
+
const TagName = this._isSearchPlus ? "ez-search-plus" : "ez-search";
|
|
49
|
+
return (h(TagName, { id: this.config.id, suppressEmptyOption: true, value: this.config.value, label: this.config.label, ref: ref => this._searchInput = ref, optionLoader: ({ mode, argument }) => this.doSearch(mode, argument, this._isSearchPlus) }));
|
|
50
|
+
}
|
|
38
51
|
render() {
|
|
39
52
|
if (!this.config || this.config.type !== FilterItemType.SEARCH) {
|
|
40
53
|
return undefined;
|
|
41
54
|
}
|
|
42
|
-
return
|
|
55
|
+
return this.getInputItem();
|
|
43
56
|
}
|
|
44
57
|
static get is() { return "snk-filter-search"; }
|
|
45
58
|
static get properties() {
|
|
@@ -136,11 +136,13 @@ export class SnkConfigOptions {
|
|
|
136
136
|
return h(TagName, Object.assign({ value: value, enabled: enabled, label: label, "data-field-name": name, key: name, onEzChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail) }, (this.getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode))));
|
|
137
137
|
}
|
|
138
138
|
getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode) {
|
|
139
|
+
const useSearchPlus = userInterface == UserInterface.SEARCHPLUS;
|
|
139
140
|
switch (userInterface) {
|
|
140
141
|
case UserInterface.SEARCH:
|
|
142
|
+
case UserInterface.SEARCHPLUS:
|
|
141
143
|
return {
|
|
142
144
|
suppressEmptyOption: required,
|
|
143
|
-
optionLoader: (searchArgument) => this.onSearch(searchArgument)
|
|
145
|
+
optionLoader: (searchArgument) => this.onSearch(searchArgument, { useSearchPlus })
|
|
144
146
|
};
|
|
145
147
|
case UserInterface.OPTIONSELECTOR:
|
|
146
148
|
return {
|
|
@@ -173,9 +175,9 @@ export class SnkConfigOptions {
|
|
|
173
175
|
this.fieldConfig.defaultValue.value = this.getValidatedValue(fieldValue);
|
|
174
176
|
this.configOptionsChanged.emit(this.fieldConfig);
|
|
175
177
|
}
|
|
176
|
-
onSearch(searchArgument) {
|
|
178
|
+
onSearch(searchArgument, ctxOptions) {
|
|
177
179
|
if (this._application != undefined && this.fieldConfig != undefined) {
|
|
178
|
-
return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
|
|
180
|
+
return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit, ctxOptions);
|
|
179
181
|
}
|
|
180
182
|
}
|
|
181
183
|
buildField(descriptor, config) {
|
|
@@ -258,6 +258,7 @@ export class SnkGridConfig {
|
|
|
258
258
|
delete _newColumnConfig.ascending;
|
|
259
259
|
_newColumnConfig.orderIndex = 0;
|
|
260
260
|
}
|
|
261
|
+
_newColumnConfig.configVersion = SnkGridConfig.CURRENT_CONFIG_VERSION;
|
|
261
262
|
_newColumnConfigList.push(_newColumnConfig);
|
|
262
263
|
}
|
|
263
264
|
});
|
|
@@ -639,3 +640,4 @@ export class SnkGridConfig {
|
|
|
639
640
|
}
|
|
640
641
|
static get elementRef() { return "_element"; }
|
|
641
642
|
}
|
|
643
|
+
SnkGridConfig.CURRENT_CONFIG_VERSION = 1;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { FormConfigFetcher } from '../../lib';
|
|
3
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
4
|
+
import { FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
+
const FORM_COL_CONFIG_PREFIX = 'formColCfg.';
|
|
6
|
+
export class SnkLayoutFormConfig {
|
|
7
|
+
constructor() {
|
|
8
|
+
this._formConfigFetcher = new FormConfigFetcher();
|
|
9
|
+
this.layoutType = FormLayout.CASCADE;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Salva o tipo de layout escolhido. Sem retorno.
|
|
13
|
+
*/
|
|
14
|
+
async save() {
|
|
15
|
+
this._LayoutFormConfigSingleton.setConfig(this.layoutType);
|
|
16
|
+
this._formConfigFetcher.saveLayoutFormConfig(FORM_COL_CONFIG_PREFIX + this._resourceID, { config: this.layoutType, newConfig: true });
|
|
17
|
+
}
|
|
18
|
+
async componentWillLoad() {
|
|
19
|
+
const _application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
20
|
+
this._LayoutFormConfigSingleton = await (_application === null || _application === void 0 ? void 0 : _application.getLayoutFormConfig());
|
|
21
|
+
this._resourceID = await (_application === null || _application === void 0 ? void 0 : _application.getResourceID());
|
|
22
|
+
this.setLayoutInit();
|
|
23
|
+
}
|
|
24
|
+
setLayoutInit() {
|
|
25
|
+
if (!this._LayoutFormConfigSingleton)
|
|
26
|
+
return;
|
|
27
|
+
const { config } = this._LayoutFormConfigSingleton;
|
|
28
|
+
this.layoutType = Number(config) in FormLayout ? Number(config) : FormLayout.CASCADE;
|
|
29
|
+
}
|
|
30
|
+
toggleLayout(key) {
|
|
31
|
+
this.layoutType = key;
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
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."))));
|
|
35
|
+
}
|
|
36
|
+
static get is() { return "snk-layout-form-config"; }
|
|
37
|
+
static get encapsulation() { return "scoped"; }
|
|
38
|
+
static get originalStyleUrls() {
|
|
39
|
+
return {
|
|
40
|
+
"$": ["snk-layout-form-config.css"]
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
static get styleUrls() {
|
|
44
|
+
return {
|
|
45
|
+
"$": ["snk-layout-form-config.css"]
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
static get states() {
|
|
49
|
+
return {
|
|
50
|
+
"layoutType": {}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
static get methods() {
|
|
54
|
+
return {
|
|
55
|
+
"save": {
|
|
56
|
+
"complexType": {
|
|
57
|
+
"signature": "() => Promise<void>",
|
|
58
|
+
"parameters": [],
|
|
59
|
+
"references": {
|
|
60
|
+
"Promise": {
|
|
61
|
+
"location": "global"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"return": "Promise<void>"
|
|
65
|
+
},
|
|
66
|
+
"docs": {
|
|
67
|
+
"text": "Salva o tipo de layout escolhido. Sem retorno.",
|
|
68
|
+
"tags": []
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.svg-container {
|
|
6
|
+
display: flex;
|
|
7
|
+
width: 185px;
|
|
8
|
+
height: 125px;
|
|
9
|
+
border-radius: 8px;
|
|
10
|
+
background-color: #f7f7f7;
|
|
11
|
+
padding: 10px 12px;
|
|
12
|
+
box-sizing: border-box;
|
|
13
|
+
position: relative;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.svg-container__background{
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.svg-container__header {
|
|
23
|
+
display: flex;
|
|
24
|
+
gap: 2px;
|
|
25
|
+
margin-bottom: 12px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.svg-container__circle {
|
|
29
|
+
width: 9px;
|
|
30
|
+
height: 9px;
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.svg-container__circle--red {
|
|
35
|
+
background-color: #ed7678;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.svg-container__circle--yellow {
|
|
39
|
+
background-color: #eddb76;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.svg-container__circle--green {
|
|
43
|
+
background-color: #7ad08e;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.svg-container__section{
|
|
47
|
+
width: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.svg-container__collumn {
|
|
51
|
+
width: 100%;
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.svg-container__inline {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
gap: 6px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.svg-container__line {
|
|
63
|
+
height: 13px;
|
|
64
|
+
border-radius: 4px;
|
|
65
|
+
background-color: #d9d9d9;
|
|
66
|
+
margin-bottom: 4px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.svg-container__line--short {
|
|
70
|
+
width: 39.68px;
|
|
71
|
+
height: 7px;
|
|
72
|
+
border-radius: 3.5px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.svg-container__line--long {
|
|
76
|
+
width: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { FormLayout } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
|
+
export class SnkViewRepresentation {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.mode = FormLayout.SIDE_BY_SIDE;
|
|
6
|
+
}
|
|
7
|
+
renderCascadeLayout() {
|
|
8
|
+
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" }))))));
|
|
9
|
+
}
|
|
10
|
+
renderSideBySideLayout() {
|
|
11
|
+
return (h("div", { class: "svg-container__inline" }, [...Array(2)].map(() => this.renderCascadeLayout())));
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
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
|
|
15
|
+
? this.renderCascadeLayout()
|
|
16
|
+
: this.renderSideBySideLayout())));
|
|
17
|
+
}
|
|
18
|
+
static get is() { return "snk-view-representation"; }
|
|
19
|
+
static get encapsulation() { return "scoped"; }
|
|
20
|
+
static get originalStyleUrls() {
|
|
21
|
+
return {
|
|
22
|
+
"$": ["snk-view-representation.css"]
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
static get styleUrls() {
|
|
26
|
+
return {
|
|
27
|
+
"$": ["snk-view-representation.css"]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static get properties() {
|
|
31
|
+
return {
|
|
32
|
+
"mode": {
|
|
33
|
+
"type": "any",
|
|
34
|
+
"mutable": false,
|
|
35
|
+
"complexType": {
|
|
36
|
+
"original": "FormLayout",
|
|
37
|
+
"resolved": "FormLayout",
|
|
38
|
+
"references": {
|
|
39
|
+
"FormLayout": {
|
|
40
|
+
"location": "import",
|
|
41
|
+
"path": "@sankhyalabs/ezui/dist/collection/utils"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": false,
|
|
46
|
+
"optional": false,
|
|
47
|
+
"docs": {
|
|
48
|
+
"tags": [],
|
|
49
|
+
"text": "Define o layout do componente: 'CASCADE' ou 'SIDE_BY_SIDE'"
|
|
50
|
+
},
|
|
51
|
+
"attribute": "mode",
|
|
52
|
+
"reflect": false,
|
|
53
|
+
"defaultValue": "FormLayout.SIDE_BY_SIDE"
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -61,6 +61,7 @@ export class SnkSimpleCrud {
|
|
|
61
61
|
this.ignoreReadOnlyFormFields = false;
|
|
62
62
|
this.autoFocus = true;
|
|
63
63
|
this.domainMessagesBuilder = undefined;
|
|
64
|
+
this.layoutFormConfig = false;
|
|
64
65
|
this.autoLoad = undefined;
|
|
65
66
|
this.outlineMode = false;
|
|
66
67
|
}
|
|
@@ -753,7 +754,7 @@ export class SnkSimpleCrud {
|
|
|
753
754
|
}
|
|
754
755
|
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)
|
|
755
756
|
? undefined
|
|
756
|
-
: 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() }))));
|
|
757
|
+
: 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() }))));
|
|
757
758
|
}
|
|
758
759
|
static get is() { return "snk-simple-crud"; }
|
|
759
760
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1233,6 +1234,24 @@ export class SnkSimpleCrud {
|
|
|
1233
1234
|
"attribute": "domain-messages-builder",
|
|
1234
1235
|
"reflect": false
|
|
1235
1236
|
},
|
|
1237
|
+
"layoutFormConfig": {
|
|
1238
|
+
"type": "boolean",
|
|
1239
|
+
"mutable": false,
|
|
1240
|
+
"complexType": {
|
|
1241
|
+
"original": "boolean",
|
|
1242
|
+
"resolved": "boolean",
|
|
1243
|
+
"references": {}
|
|
1244
|
+
},
|
|
1245
|
+
"required": false,
|
|
1246
|
+
"optional": false,
|
|
1247
|
+
"docs": {
|
|
1248
|
+
"tags": [],
|
|
1249
|
+
"text": "Define se o LayoutFormConfig ser\u00E1 exibido no configurador."
|
|
1250
|
+
},
|
|
1251
|
+
"attribute": "layout-form-config",
|
|
1252
|
+
"reflect": false,
|
|
1253
|
+
"defaultValue": "false"
|
|
1254
|
+
},
|
|
1236
1255
|
"autoLoad": {
|
|
1237
1256
|
"type": "boolean",
|
|
1238
1257
|
"mutable": false,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export class LayoutFormConfig {
|
|
2
|
+
constructor() {
|
|
3
|
+
this._config = null;
|
|
4
|
+
this.listeners = [];
|
|
5
|
+
}
|
|
6
|
+
static getInstance() {
|
|
7
|
+
if (!LayoutFormConfig.instance) {
|
|
8
|
+
LayoutFormConfig.instance = new LayoutFormConfig();
|
|
9
|
+
}
|
|
10
|
+
return LayoutFormConfig.instance;
|
|
11
|
+
}
|
|
12
|
+
get config() {
|
|
13
|
+
return this._config;
|
|
14
|
+
}
|
|
15
|
+
setConfig(newConfig) {
|
|
16
|
+
this._config = newConfig;
|
|
17
|
+
this.notifyListeners();
|
|
18
|
+
}
|
|
19
|
+
onConfigChange(listener) {
|
|
20
|
+
this.listeners.push(listener);
|
|
21
|
+
}
|
|
22
|
+
notifyListeners() {
|
|
23
|
+
this.listeners.forEach(listener => listener(this._config));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -61,7 +61,13 @@ export class DataFetcher {
|
|
|
61
61
|
if (error.length > 0) { //As informações do erro vem no primeiro indice de um array
|
|
62
62
|
const errorInfo = error[POSITION_ERROR_INFO];
|
|
63
63
|
const errorMessage = (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.message) ? errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.message : "Não há mensagem de erro";
|
|
64
|
-
|
|
64
|
+
/*
|
|
65
|
+
No HTML5, todos os erros de Troubleshooting são considerados alerta,
|
|
66
|
+
pois a comparação errorLevel == ServiceProxyConstants.LEVEL.ERROR sempre é falsa
|
|
67
|
+
Motivo: - errorLevel é uma string "ERROR" por exemplo
|
|
68
|
+
- ServiceProxyConstants.LEVEL.ERROR é um numero 1, por exemplo
|
|
69
|
+
*/
|
|
70
|
+
const errorLevel = ((_a = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _a === void 0 ? void 0 : _a.level) ? "WARNING" : "ERROR";
|
|
65
71
|
const errorCode = ((_b = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _b === void 0 ? void 0 : _b.code) ? errorInfo.extensions.code : "";
|
|
66
72
|
switch (errorLevel) {
|
|
67
73
|
case "WARNING":
|
|
@@ -83,7 +89,13 @@ export class DataFetcher {
|
|
|
83
89
|
let tsErrorCode, tsErrorLevel;
|
|
84
90
|
if (tsError) {
|
|
85
91
|
tsErrorCode = tsError.tsErrorCode;
|
|
86
|
-
|
|
92
|
+
/*
|
|
93
|
+
No HTML5, todos os erros de Troubleshooting são considerados alerta,
|
|
94
|
+
pois a comparação errorLevel == ServiceProxyConstants.LEVEL.ERROR sempre é falsa
|
|
95
|
+
Motivo: - errorLevel é uma string "ERROR" por exemplo
|
|
96
|
+
- ServiceProxyConstants.LEVEL.ERROR é um numero 1, por exemplo
|
|
97
|
+
*/
|
|
98
|
+
tsErrorLevel = "WARNING";
|
|
87
99
|
}
|
|
88
100
|
if (tsErrorLevel === "WARNING") {
|
|
89
101
|
return new WarningException(title, statusMessage, tsErrorCode);
|
package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js
CHANGED
|
@@ -227,11 +227,12 @@ export class DatasetStrategy {
|
|
|
227
227
|
return InMemoryLoader.getConvertedValue(descriptor, strValue);
|
|
228
228
|
}
|
|
229
229
|
getSearchDescriptionField(descriptor) {
|
|
230
|
-
if (
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
230
|
+
if (![UserInterface.SEARCH, UserInterface.SEARCHPLUS].includes(descriptor.userInterface)) {
|
|
231
|
+
return undefined;
|
|
232
|
+
}
|
|
233
|
+
const { ENTITYNAME, mergedFrom, DESCRIPTIONFIELD } = descriptor.properties;
|
|
234
|
+
if (!StringUtils.isEmpty(DESCRIPTIONFIELD)) {
|
|
235
|
+
return mergedFrom != undefined ? `${mergedFrom}.${ENTITYNAME}.${DESCRIPTIONFIELD}` : `${ENTITYNAME}.${DESCRIPTIONFIELD}`;
|
|
235
236
|
}
|
|
236
237
|
return undefined;
|
|
237
238
|
}
|
|
@@ -220,6 +220,20 @@ export class FormConfigFetcher extends ResourceFetcher {
|
|
|
220
220
|
const rawFields = (_c = (_b = (_a = config === null || config === void 0 ? void 0 : config.formConfig) === null || _a === void 0 ? void 0 : _a.layout) === null || _b === void 0 ? void 0 : _b.field) !== null && _c !== void 0 ? _c : [];
|
|
221
221
|
return { emptyConfig: false, fields: Array.isArray(rawFields) ? rawFields : [rawFields] };
|
|
222
222
|
}
|
|
223
|
+
async fetchLayoutFormConfig(configName) {
|
|
224
|
+
const payload = { 'requestBody': { 'config': { 'chave': configName, 'tipo': 'T' } } };
|
|
225
|
+
const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.getConf', JSON.stringify(payload));
|
|
226
|
+
if (ObjectUtils.isEmpty(response))
|
|
227
|
+
return undefined;
|
|
228
|
+
return response.config;
|
|
229
|
+
}
|
|
230
|
+
async saveLayoutFormConfig(configName, config) {
|
|
231
|
+
const payload = { 'requestBody': { 'config': Object.assign(Object.assign({}, config), { 'chave': configName, 'tipo': 'T' }) } };
|
|
232
|
+
const response = await DataFetcher.get().callServiceBroker('SystemUtilsSP.saveConf', JSON.stringify(payload));
|
|
233
|
+
if (ObjectUtils.isEmpty(response))
|
|
234
|
+
return undefined;
|
|
235
|
+
return response;
|
|
236
|
+
}
|
|
223
237
|
}
|
|
224
238
|
export var UserConfigType;
|
|
225
239
|
(function (UserConfigType) {
|
|
@@ -50,7 +50,20 @@ export class PesquisaFetcher {
|
|
|
50
50
|
});
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
buildDescriptionCacheKey(entityName, codeValue) {
|
|
54
|
+
return `${entityName}__${codeValue}`;
|
|
55
|
+
}
|
|
56
|
+
async loadByCode(entityName, codeValue, criteria, searchOptions) {
|
|
57
|
+
const cacheKey = this.buildDescriptionCacheKey(entityName, codeValue);
|
|
58
|
+
const cachedValue = PesquisaFetcher.DESCRIPTIONS_BY_CODE[cacheKey];
|
|
59
|
+
if (cachedValue) {
|
|
60
|
+
return Promise.resolve(cachedValue);
|
|
61
|
+
}
|
|
62
|
+
const result = await this.loadAdvancedSearch(entityName, undefined, criteria, searchOptions, codeValue);
|
|
63
|
+
PesquisaFetcher.DESCRIPTIONS_BY_CODE[cacheKey] = result;
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
loadAdvancedSearch(entityName, argument, criteria, searchOptions, codeValue) {
|
|
54
67
|
var _a, _b, _c, _d, _e;
|
|
55
68
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
56
69
|
const values = {
|
|
@@ -94,12 +107,22 @@ export class PesquisaFetcher {
|
|
|
94
107
|
const reqBody = {
|
|
95
108
|
"serviceName": serviceName,
|
|
96
109
|
"requestBody": {
|
|
97
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": (_d = options === null || options === void 0 ? void 0 : options.ignoreEntityCriteria) !== null && _d !== void 0 ? _d : false, "limit": this._defaultPageSize, "
|
|
110
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": (_d = options === null || options === void 0 ? void 0 : options.ignoreEntityCriteria) !== null && _d !== void 0 ? _d : false, "limit": this._defaultPageSize, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_e = values.searchOptions) === null || _e === void 0 ? void 0 : _e.rootEntity }, { options }),
|
|
98
111
|
"clientEventList": {
|
|
99
112
|
"clientEvent": []
|
|
100
113
|
}
|
|
101
114
|
}
|
|
102
115
|
};
|
|
116
|
+
if (codeValue == undefined) {
|
|
117
|
+
reqBody.requestBody.criteria.query = {
|
|
118
|
+
"$": argument
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
reqBody.requestBody.criteria.pk = {
|
|
123
|
+
"$": codeValue
|
|
124
|
+
};
|
|
125
|
+
}
|
|
103
126
|
const urlOptions = {
|
|
104
127
|
urlParams: {
|
|
105
128
|
"quietMode": true
|
|
@@ -209,6 +232,7 @@ export class PesquisaFetcher {
|
|
|
209
232
|
return params;
|
|
210
233
|
}
|
|
211
234
|
}
|
|
235
|
+
PesquisaFetcher.DESCRIPTIONS_BY_CODE = {};
|
|
212
236
|
function buildLoadGridConfigPayload(entityName) {
|
|
213
237
|
return {
|
|
214
238
|
'gridConfig': {
|
|
@@ -298,25 +298,21 @@ class CommonsExporter {
|
|
|
298
298
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
|
299
299
|
customFormatter
|
|
300
300
|
};
|
|
301
|
-
if (isUserInterfaceSEARCH) {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
const newWidth = this.getWidthByMetaData(column === null || column === void 0 ? void 0 : column.width, columnData === null || columnData === void 0 ? void 0 : columnData.width, descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.width);
|
|
317
|
-
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
|
318
|
-
descriptionColumn = Object.assign(Object.assign({}, descriptionColumn), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.descWidth, label: (descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.label) || (column === null || column === void 0 ? void 0 : column.label) });
|
|
319
|
-
}
|
|
301
|
+
if (isUserInterfaceSEARCH && ((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
|
302
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
|
303
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
|
304
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
|
305
|
+
descriptionColumn = {
|
|
306
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
|
307
|
+
label: labelDescription,
|
|
308
|
+
width: isUserInterfaceSEARCH && labelDescription ? (labelDescription.length * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
|
309
|
+
type: DataType.TEXT,
|
|
310
|
+
userInterface: UserInterface$1.LONGTEXT,
|
|
311
|
+
descriptionFrom: fieldData.name
|
|
312
|
+
};
|
|
313
|
+
const newWidth = this.getWidthByMetaData(column === null || column === void 0 ? void 0 : column.width, columnData === null || columnData === void 0 ? void 0 : columnData.width, descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.width);
|
|
314
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
|
315
|
+
descriptionColumn = Object.assign(Object.assign({}, descriptionColumn), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.descWidth, label: (descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.label) || (column === null || column === void 0 ? void 0 : column.label) });
|
|
320
316
|
}
|
|
321
317
|
columnsMetadata.push(columnData);
|
|
322
318
|
if (descriptionColumn)
|
|
@@ -6716,7 +6716,13 @@ class DataFetcher {
|
|
|
6716
6716
|
if (error.length > 0) { //As informações do erro vem no primeiro indice de um array
|
|
6717
6717
|
const errorInfo = error[POSITION_ERROR_INFO];
|
|
6718
6718
|
const errorMessage = (errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.message) ? errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.message : "Não há mensagem de erro";
|
|
6719
|
-
|
|
6719
|
+
/*
|
|
6720
|
+
No HTML5, todos os erros de Troubleshooting são considerados alerta,
|
|
6721
|
+
pois a comparação errorLevel == ServiceProxyConstants.LEVEL.ERROR sempre é falsa
|
|
6722
|
+
Motivo: - errorLevel é uma string "ERROR" por exemplo
|
|
6723
|
+
- ServiceProxyConstants.LEVEL.ERROR é um numero 1, por exemplo
|
|
6724
|
+
*/
|
|
6725
|
+
const errorLevel = ((_a = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _a === void 0 ? void 0 : _a.level) ? "WARNING" : "ERROR";
|
|
6720
6726
|
const errorCode = ((_b = errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.extensions) === null || _b === void 0 ? void 0 : _b.code) ? errorInfo.extensions.code : "";
|
|
6721
6727
|
switch (errorLevel) {
|
|
6722
6728
|
case "WARNING":
|
|
@@ -6738,7 +6744,13 @@ class DataFetcher {
|
|
|
6738
6744
|
let tsErrorCode, tsErrorLevel;
|
|
6739
6745
|
if (tsError) {
|
|
6740
6746
|
tsErrorCode = tsError.tsErrorCode;
|
|
6741
|
-
|
|
6747
|
+
/*
|
|
6748
|
+
No HTML5, todos os erros de Troubleshooting são considerados alerta,
|
|
6749
|
+
pois a comparação errorLevel == ServiceProxyConstants.LEVEL.ERROR sempre é falsa
|
|
6750
|
+
Motivo: - errorLevel é uma string "ERROR" por exemplo
|
|
6751
|
+
- ServiceProxyConstants.LEVEL.ERROR é um numero 1, por exemplo
|
|
6752
|
+
*/
|
|
6753
|
+
tsErrorLevel = "WARNING";
|
|
6742
6754
|
}
|
|
6743
6755
|
if (tsErrorLevel === "WARNING") {
|
|
6744
6756
|
return new WarningException(title, statusMessage, tsErrorCode);
|
package/dist/components/ISave.js
CHANGED
|
@@ -148,7 +148,20 @@ class PesquisaFetcher {
|
|
|
148
148
|
});
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
|
|
151
|
+
buildDescriptionCacheKey(entityName, codeValue) {
|
|
152
|
+
return `${entityName}__${codeValue}`;
|
|
153
|
+
}
|
|
154
|
+
async loadByCode(entityName, codeValue, criteria, searchOptions) {
|
|
155
|
+
const cacheKey = this.buildDescriptionCacheKey(entityName, codeValue);
|
|
156
|
+
const cachedValue = PesquisaFetcher.DESCRIPTIONS_BY_CODE[cacheKey];
|
|
157
|
+
if (cachedValue) {
|
|
158
|
+
return Promise.resolve(cachedValue);
|
|
159
|
+
}
|
|
160
|
+
const result = await this.loadAdvancedSearch(entityName, undefined, criteria, searchOptions, codeValue);
|
|
161
|
+
PesquisaFetcher.DESCRIPTIONS_BY_CODE[cacheKey] = result;
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
loadAdvancedSearch(entityName, argument, criteria, searchOptions, codeValue) {
|
|
152
165
|
var _a, _b, _c, _d, _e;
|
|
153
166
|
const listenerResult = this.applySearchListener(SearchListenerType.beforeSearch, entityName, argument, criteria, searchOptions);
|
|
154
167
|
const values = {
|
|
@@ -192,12 +205,22 @@ class PesquisaFetcher {
|
|
|
192
205
|
const reqBody = {
|
|
193
206
|
"serviceName": serviceName,
|
|
194
207
|
"requestBody": {
|
|
195
|
-
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": (_d = options === null || options === void 0 ? void 0 : options.ignoreEntityCriteria) !== null && _d !== void 0 ? _d : false, "limit": this._defaultPageSize, "
|
|
208
|
+
"criteria": Object.assign({ "entityName": entityName, "compacted": false, "ignoreEntityCriteria": (_d = options === null || options === void 0 ? void 0 : options.ignoreEntityCriteria) !== null && _d !== void 0 ? _d : false, "limit": this._defaultPageSize, "orderByDesc": false, "externalCriteria": externalCriteria, "localEntityName": (_e = values.searchOptions) === null || _e === void 0 ? void 0 : _e.rootEntity }, { options }),
|
|
196
209
|
"clientEventList": {
|
|
197
210
|
"clientEvent": []
|
|
198
211
|
}
|
|
199
212
|
}
|
|
200
213
|
};
|
|
214
|
+
if (codeValue == undefined) {
|
|
215
|
+
reqBody.requestBody.criteria.query = {
|
|
216
|
+
"$": argument
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
reqBody.requestBody.criteria.pk = {
|
|
221
|
+
"$": codeValue
|
|
222
|
+
};
|
|
223
|
+
}
|
|
201
224
|
const urlOptions = {
|
|
202
225
|
urlParams: {
|
|
203
226
|
"quietMode": true
|
|
@@ -307,6 +330,7 @@ class PesquisaFetcher {
|
|
|
307
330
|
return params;
|
|
308
331
|
}
|
|
309
332
|
}
|
|
333
|
+
PesquisaFetcher.DESCRIPTIONS_BY_CODE = {};
|
|
310
334
|
function buildLoadGridConfigPayload(entityName) {
|
|
311
335
|
return {
|
|
312
336
|
'gridConfig': {
|