@sankhyalabs/sankhyablocks 8.16.0-ms.1 → 8.16.0-ms.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{ClientSideExporterProvider-2f5f350c.js → ClientSideExporterProvider-fe52f7cf.js} +63 -22
- package/dist/cjs/{ConfigStorage-d024aec8.js → ConfigStorage-6b633b10.js} +2 -2
- package/dist/cjs/{DataFetcher-65879b2c.js → DataFetcher-875371e9.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-c11d8468.js → SnkFormConfigManager-d680be08.js} +2 -2
- package/dist/cjs/{auth-fetcher-8480751c.js → auth-fetcher-24ba4135.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-449d51a3.js → dataunit-fetcher-b95768e8.js} +1 -1
- package/dist/cjs/{form-config-fetcher-90126e4c.js → form-config-fetcher-e0a512c3.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-5c583c93.js → pesquisa-fetcher-30cab386.js} +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +4 -4
- package/dist/cjs/snk-actions-button_5.cjs.entry.js +5 -5
- package/dist/cjs/snk-application.cjs.entry.js +6 -6
- package/dist/cjs/snk-attach.cjs.entry.js +5 -5
- package/dist/cjs/snk-config-options_3.cjs.entry.js +4 -4
- 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-bbd384bf.js → snk-data-unit-33937ffe.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +7 -7
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +5 -4
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +6 -6
- package/dist/cjs/{snk-guides-viewer-5396062f.js → snk-guides-viewer-65964889.js} +5 -5
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +7 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-pesquisa.cjs.entry.js +4 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +8 -8
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +51 -16
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +2 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +8 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -1
- package/dist/components/ContinuousInsertUtils.js +59 -18
- package/dist/components/DataFetcher.js +1 -1
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-filter-item2.js +2 -1
- package/dist/components/snk-simple-crud2.js +1 -1
- package/dist/esm/{ClientSideExporterProvider-3537805a.js → ClientSideExporterProvider-bd24a4b3.js} +63 -22
- package/dist/esm/{ConfigStorage-373bb440.js → ConfigStorage-e5c1f4c0.js} +2 -2
- package/dist/esm/{DataFetcher-5221b992.js → DataFetcher-ecf5f903.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-5022f87f.js → SnkFormConfigManager-1efd102b.js} +2 -2
- package/dist/esm/{auth-fetcher-e32fe8a4.js → auth-fetcher-9987c66e.js} +1 -1
- package/dist/esm/{dataunit-fetcher-91b094f2.js → dataunit-fetcher-ed6e65ef.js} +1 -1
- package/dist/esm/{form-config-fetcher-126e2471.js → form-config-fetcher-34becd23.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-4284f2a3.js → pesquisa-fetcher-e26c3295.js} +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +4 -4
- package/dist/esm/snk-actions-button_5.entry.js +5 -5
- package/dist/esm/snk-application.entry.js +6 -6
- package/dist/esm/snk-attach.entry.js +5 -5
- package/dist/esm/snk-config-options_3.entry.js +4 -4
- package/dist/esm/snk-crud.entry.js +5 -5
- package/dist/esm/snk-data-exporter.entry.js +6 -6
- package/dist/esm/{snk-data-unit-b03bb5cf.js → snk-data-unit-6258b8ae.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +7 -7
- package/dist/esm/snk-filter-bar_4.entry.js +5 -4
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +6 -6
- package/dist/esm/{snk-guides-viewer-749d027c.js → snk-guides-viewer-9e43d0ca.js} +5 -5
- package/dist/esm/snk-guides-viewer.entry.js +7 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-pesquisa.entry.js +4 -4
- package/dist/esm/snk-simple-crud.entry.js +8 -8
- package/dist/sankhyablocks/{p-ca316523.entry.js → p-05fda408.entry.js} +1 -1
- package/dist/sankhyablocks/p-1a8295af.entry.js +1 -0
- package/dist/sankhyablocks/{p-7b87d1a8.js → p-1e48864c.js} +1 -1
- package/dist/sankhyablocks/{p-1435701f.js → p-22ddc147.js} +1 -1
- package/dist/sankhyablocks/{p-44efbeed.entry.js → p-2746d606.entry.js} +1 -1
- package/dist/sankhyablocks/{p-4d87cd45.entry.js → p-3bab7e9c.entry.js} +1 -1
- package/dist/sankhyablocks/p-3ce68be5.js +1 -0
- package/dist/sankhyablocks/{p-4be6e0e7.entry.js → p-3d424ae9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-19dc71e9.js → p-3fcb90d6.js} +1 -1
- package/dist/sankhyablocks/{p-647f9830.entry.js → p-4b01cbad.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d62228fb.js → p-5a7e18f4.js} +1 -1
- package/dist/sankhyablocks/{p-4fa79d68.entry.js → p-6b898a51.entry.js} +1 -1
- package/dist/sankhyablocks/{p-82ee6dc3.entry.js → p-6c43fcde.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0ce56d43.entry.js → p-6c9d1be4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3653374d.js → p-7e0a0aae.js} +1 -1
- package/dist/sankhyablocks/{p-ee53b000.entry.js → p-815b0a74.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ad5e4f9d.entry.js → p-9523fc40.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f0b9303b.js → p-a77bdadc.js} +1 -1
- package/dist/sankhyablocks/{p-23b47a92.js → p-abd9681c.js} +1 -1
- package/dist/sankhyablocks/{p-389ba782.entry.js → p-be2e5f36.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1cf39cfd.entry.js → p-d3b9b377.entry.js} +1 -1
- package/dist/sankhyablocks/{p-13391b3d.entry.js → p-d571e243.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6234bda8.entry.js → p-db8b3536.entry.js} +1 -1
- package/dist/sankhyablocks/p-e289826a.js +1 -0
- package/dist/sankhyablocks/{p-c021a3a9.entry.js → p-e66bcb5c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-41c3bee5.js → p-ef076eea.js} +2 -2
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +7 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-3ba431c9.js +0 -1
- package/dist/sankhyablocks/p-5dd7f4c7.js +0 -1
- package/dist/sankhyablocks/p-b2de1bcc.entry.js +0 -1
@@ -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-241934b3.js');
|
9
9
|
const taskbarElements = require('./taskbar-elements-7e19882d.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
12
|
-
const ClientSideExporterProvider = require('./ClientSideExporterProvider-
|
10
|
+
require('./DataFetcher-875371e9.js');
|
11
|
+
require('./pesquisa-fetcher-30cab386.js');
|
12
|
+
const ClientSideExporterProvider = require('./ClientSideExporterProvider-fe52f7cf.js');
|
13
13
|
const index$1 = require('./index-e3e39724.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-b95768e8.js');
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
19
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
19
|
+
const formConfigFetcher = require('./form-config-fetcher-e0a512c3.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-6b633b10.js');
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-d680be08.js');
|
23
23
|
const index$2 = require('./index-102ba62d.js');
|
24
24
|
require('./PrintUtils-bcaeb82f.js');
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
@@ -777,7 +777,7 @@ const SnkSimpleCrud = class {
|
|
777
777
|
if (this.dataUnit == undefined) {
|
778
778
|
return;
|
779
779
|
}
|
780
|
-
return (index.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),
|
780
|
+
return (index.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), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.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)
|
781
781
|
? undefined
|
782
782
|
: 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(), index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, this.renderTaskbarContent(), index.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) }), index.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 && index.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.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.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() }))));
|
783
783
|
}
|
@@ -2,6 +2,9 @@ import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMeta
|
|
2
2
|
import { DataType } from '@sankhyalabs/core';
|
3
3
|
export class CommonsExporter {
|
4
4
|
constructor(dataUnit, grid) {
|
5
|
+
this.MAX_WIDTH_COD = 60;
|
6
|
+
this.MIN_WIDTH_COD = 10;
|
7
|
+
this.DEFAULT_FONT_SIZE = 13;
|
5
8
|
this.dataUnit = dataUnit;
|
6
9
|
this.grid = grid;
|
7
10
|
}
|
@@ -14,7 +17,7 @@ export class CommonsExporter {
|
|
14
17
|
return this.columnsState;
|
15
18
|
}
|
16
19
|
async buildColumnsMetadata(gridColumns) {
|
17
|
-
var _a, _b;
|
20
|
+
var _a, _b, _c;
|
18
21
|
const columnsMetadata = [];
|
19
22
|
for (const column of gridColumns) {
|
20
23
|
/**
|
@@ -25,30 +28,62 @@ export class CommonsExporter {
|
|
25
28
|
}
|
26
29
|
const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
27
30
|
const customFormatter = await this.grid.getCustomValueFormatter(column.name);
|
28
|
-
const
|
29
|
-
|
31
|
+
const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface.SEARCH;
|
32
|
+
const widthColumnDefault = 60;
|
33
|
+
const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
|
34
|
+
let descriptionColumn = undefined;
|
35
|
+
let columnData = {
|
30
36
|
id: column.name,
|
31
|
-
|
37
|
+
label: labelColumn,
|
38
|
+
width: isUserInterfaceSEARCH ? (labelColumn.length * this.DEFAULT_FONT_SIZE) : column.width,
|
32
39
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
33
40
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
34
41
|
customFormatter
|
35
42
|
};
|
43
|
+
if (isUserInterfaceSEARCH) {
|
44
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
45
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
46
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
47
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
48
|
+
descriptionColumn = {
|
49
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
50
|
+
label: labelDescription,
|
51
|
+
width: isUserInterfaceSEARCH && labelDescription ? (labelDescription.length * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
52
|
+
type: DataType.TEXT,
|
53
|
+
userInterface: UserInterface.LONGTEXT,
|
54
|
+
descriptionFrom: fieldData.name
|
55
|
+
};
|
56
|
+
}
|
57
|
+
if (descriptionColumn) {
|
58
|
+
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);
|
59
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
60
|
+
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) });
|
61
|
+
}
|
62
|
+
}
|
36
63
|
columnsMetadata.push(columnData);
|
37
|
-
if (
|
38
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
39
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
40
|
-
const descriptionColumn = {
|
41
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
42
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
43
|
-
width: column.width,
|
44
|
-
type: DataType.TEXT,
|
45
|
-
userInterface: UserInterface.LONGTEXT,
|
46
|
-
descriptionFrom: fieldData.name
|
47
|
-
};
|
64
|
+
if (descriptionColumn)
|
48
65
|
columnsMetadata.push(descriptionColumn);
|
49
|
-
}
|
50
66
|
}
|
51
67
|
;
|
52
68
|
return columnsMetadata || [];
|
53
69
|
}
|
70
|
+
getWidthByMetaData(maxWidth, widthCod, widthDescription) {
|
71
|
+
const totalCurrentWidth = widthCod + widthDescription;
|
72
|
+
const codPercentage = widthCod / totalCurrentWidth;
|
73
|
+
const descPercentage = widthDescription / totalCurrentWidth;
|
74
|
+
let newWidthCod = Math.round(maxWidth * codPercentage);
|
75
|
+
let newWidthDescription = Math.round(maxWidth * descPercentage);
|
76
|
+
if (newWidthCod > this.MAX_WIDTH_COD) {
|
77
|
+
newWidthCod = this.MAX_WIDTH_COD;
|
78
|
+
newWidthDescription = maxWidth - this.MAX_WIDTH_COD;
|
79
|
+
}
|
80
|
+
else if (newWidthCod < this.MIN_WIDTH_COD) {
|
81
|
+
newWidthCod = this.MIN_WIDTH_COD;
|
82
|
+
newWidthDescription = maxWidth - this.MIN_WIDTH_COD;
|
83
|
+
}
|
84
|
+
return {
|
85
|
+
codWidth: newWidthCod,
|
86
|
+
descWidth: newWidthDescription
|
87
|
+
};
|
88
|
+
}
|
54
89
|
}
|
@@ -24,10 +24,11 @@ export class SnkFilterItem {
|
|
24
24
|
*/
|
25
25
|
async showUp(open = false) {
|
26
26
|
return new Promise(resolve => {
|
27
|
+
var _a;
|
27
28
|
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
28
29
|
if (open) {
|
29
30
|
this._closeCallback = resolve;
|
30
|
-
this._chipElement.blur();
|
31
|
+
(_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
|
31
32
|
window.requestAnimationFrame(() => {
|
32
33
|
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
33
34
|
this._popover.show();
|
@@ -751,7 +751,7 @@ export class SnkSimpleCrud {
|
|
751
751
|
if (this.dataUnit == undefined) {
|
752
752
|
return;
|
753
753
|
}
|
754
|
-
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),
|
754
|
+
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), 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
755
|
? undefined
|
756
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
757
|
}
|
@@ -24,9 +24,15 @@ export default class RmPrecisionCustomValueFormatter {
|
|
24
24
|
if (rmPrecision || rmPrecision === 0) {
|
25
25
|
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
26
26
|
}
|
27
|
-
|
28
|
-
|
27
|
+
const columnProps = column === null || column === void 0 ? void 0 : column.props;
|
28
|
+
if (columnProps) {
|
29
|
+
const precision = column === null || column === void 0 ? void 0 : column.props.get('precision');
|
30
|
+
const prettyPrecision = column === null || column === void 0 ? void 0 : column.props.get('prettyPrecision');
|
31
|
+
if (precision !== undefined && prettyPrecision !== undefined) {
|
32
|
+
return NumberUtils.format(currentValue, precision, prettyPrecision);
|
33
|
+
}
|
29
34
|
}
|
35
|
+
return currentValue;
|
30
36
|
}
|
31
37
|
refreshSelectedRows() {
|
32
38
|
var _a;
|
@@ -415,7 +415,7 @@ export class DataFetcher {
|
|
415
415
|
const requestId = StringUtils.generateUUID();
|
416
416
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
417
417
|
try {
|
418
|
-
const response = await batchRequests(url, request, { 'Content-Type': `application/json; charset
|
418
|
+
const response = await batchRequests(url, request, { 'Content-Type': `application/json; charset=UTF-8` });
|
419
419
|
response.forEach((resItem, index) => {
|
420
420
|
var _a;
|
421
421
|
if (((_a = resItem === null || resItem === void 0 ? void 0 : resItem.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
@@ -248,9 +248,15 @@ class RmPrecisionCustomValueFormatter {
|
|
248
248
|
if (rmPrecision || rmPrecision === 0) {
|
249
249
|
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
250
250
|
}
|
251
|
-
|
252
|
-
|
251
|
+
const columnProps = column === null || column === void 0 ? void 0 : column.props;
|
252
|
+
if (columnProps) {
|
253
|
+
const precision = column === null || column === void 0 ? void 0 : column.props.get('precision');
|
254
|
+
const prettyPrecision = column === null || column === void 0 ? void 0 : column.props.get('prettyPrecision');
|
255
|
+
if (precision !== undefined && prettyPrecision !== undefined) {
|
256
|
+
return NumberUtils.format(currentValue, precision, prettyPrecision);
|
257
|
+
}
|
253
258
|
}
|
259
|
+
return currentValue;
|
254
260
|
}
|
255
261
|
refreshSelectedRows() {
|
256
262
|
var _a;
|
@@ -260,6 +266,9 @@ class RmPrecisionCustomValueFormatter {
|
|
260
266
|
|
261
267
|
class CommonsExporter {
|
262
268
|
constructor(dataUnit, grid) {
|
269
|
+
this.MAX_WIDTH_COD = 60;
|
270
|
+
this.MIN_WIDTH_COD = 10;
|
271
|
+
this.DEFAULT_FONT_SIZE = 13;
|
263
272
|
this.dataUnit = dataUnit;
|
264
273
|
this.grid = grid;
|
265
274
|
}
|
@@ -272,7 +281,7 @@ class CommonsExporter {
|
|
272
281
|
return this.columnsState;
|
273
282
|
}
|
274
283
|
async buildColumnsMetadata(gridColumns) {
|
275
|
-
var _a, _b;
|
284
|
+
var _a, _b, _c;
|
276
285
|
const columnsMetadata = [];
|
277
286
|
for (const column of gridColumns) {
|
278
287
|
/**
|
@@ -283,31 +292,63 @@ class CommonsExporter {
|
|
283
292
|
}
|
284
293
|
const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
285
294
|
const customFormatter = await this.grid.getCustomValueFormatter(column.name);
|
286
|
-
const
|
287
|
-
|
295
|
+
const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface$1.SEARCH;
|
296
|
+
const widthColumnDefault = 60;
|
297
|
+
const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
|
298
|
+
let descriptionColumn = undefined;
|
299
|
+
let columnData = {
|
288
300
|
id: column.name,
|
289
|
-
|
301
|
+
label: labelColumn,
|
302
|
+
width: isUserInterfaceSEARCH ? (labelColumn.length * this.DEFAULT_FONT_SIZE) : column.width,
|
290
303
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
291
304
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
292
305
|
customFormatter
|
293
306
|
};
|
307
|
+
if (isUserInterfaceSEARCH) {
|
308
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
309
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
310
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
311
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
312
|
+
descriptionColumn = {
|
313
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
314
|
+
label: labelDescription,
|
315
|
+
width: isUserInterfaceSEARCH && labelDescription ? (labelDescription.length * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
316
|
+
type: DataType.TEXT,
|
317
|
+
userInterface: UserInterface$1.LONGTEXT,
|
318
|
+
descriptionFrom: fieldData.name
|
319
|
+
};
|
320
|
+
}
|
321
|
+
if (descriptionColumn) {
|
322
|
+
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);
|
323
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
324
|
+
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) });
|
325
|
+
}
|
326
|
+
}
|
294
327
|
columnsMetadata.push(columnData);
|
295
|
-
if (
|
296
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
297
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
298
|
-
const descriptionColumn = {
|
299
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
300
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
301
|
-
width: column.width,
|
302
|
-
type: DataType.TEXT,
|
303
|
-
userInterface: UserInterface$1.LONGTEXT,
|
304
|
-
descriptionFrom: fieldData.name
|
305
|
-
};
|
328
|
+
if (descriptionColumn)
|
306
329
|
columnsMetadata.push(descriptionColumn);
|
307
|
-
}
|
308
330
|
}
|
309
331
|
return columnsMetadata || [];
|
310
332
|
}
|
333
|
+
getWidthByMetaData(maxWidth, widthCod, widthDescription) {
|
334
|
+
const totalCurrentWidth = widthCod + widthDescription;
|
335
|
+
const codPercentage = widthCod / totalCurrentWidth;
|
336
|
+
const descPercentage = widthDescription / totalCurrentWidth;
|
337
|
+
let newWidthCod = Math.round(maxWidth * codPercentage);
|
338
|
+
let newWidthDescription = Math.round(maxWidth * descPercentage);
|
339
|
+
if (newWidthCod > this.MAX_WIDTH_COD) {
|
340
|
+
newWidthCod = this.MAX_WIDTH_COD;
|
341
|
+
newWidthDescription = maxWidth - this.MAX_WIDTH_COD;
|
342
|
+
}
|
343
|
+
else if (newWidthCod < this.MIN_WIDTH_COD) {
|
344
|
+
newWidthCod = this.MIN_WIDTH_COD;
|
345
|
+
newWidthDescription = maxWidth - this.MIN_WIDTH_COD;
|
346
|
+
}
|
347
|
+
return {
|
348
|
+
codWidth: newWidthCod,
|
349
|
+
descWidth: newWidthDescription
|
350
|
+
};
|
351
|
+
}
|
311
352
|
}
|
312
353
|
|
313
354
|
class ClientSideExporterProvider extends CommonsExporter {
|
@@ -7058,7 +7058,7 @@ class DataFetcher {
|
|
7058
7058
|
const requestId = StringUtils.generateUUID();
|
7059
7059
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
7060
7060
|
try {
|
7061
|
-
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset
|
7061
|
+
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=UTF-8` });
|
7062
7062
|
response.forEach((resItem, index) => {
|
7063
7063
|
var _a;
|
7064
7064
|
if (((_a = resItem === null || resItem === void 0 ? void 0 : resItem.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
@@ -249,7 +249,7 @@ function getFormatResponse(result) {
|
|
249
249
|
return ObjectUtils.stringToObject(response);
|
250
250
|
}
|
251
251
|
|
252
|
-
const DOC_MAX_WIDTH =
|
252
|
+
const DOC_MAX_WIDTH = 860;
|
253
253
|
function getVisibleColumns(columns) {
|
254
254
|
const visibleColumns = [];
|
255
255
|
let totalWidth = 0;
|
@@ -30,10 +30,11 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
30
30
|
*/
|
31
31
|
async showUp(open = false) {
|
32
32
|
return new Promise(resolve => {
|
33
|
+
var _a;
|
33
34
|
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
34
35
|
if (open) {
|
35
36
|
this._closeCallback = resolve;
|
36
|
-
this._chipElement.blur();
|
37
|
+
(_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
|
37
38
|
window.requestAnimationFrame(() => {
|
38
39
|
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
39
40
|
this._popover.show();
|
@@ -773,7 +773,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
773
773
|
if (this.dataUnit == undefined) {
|
774
774
|
return;
|
775
775
|
}
|
776
|
-
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail),
|
776
|
+
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
777
777
|
? undefined
|
778
778
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, this.renderTaskbarContent(), h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), h("div", { id: `${this._customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }))), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
779
779
|
}
|
package/dist/esm/{ClientSideExporterProvider-3537805a.js → ClientSideExporterProvider-bd24a4b3.js}
RENAMED
@@ -1,13 +1,13 @@
|
|
1
|
-
import { D as DataFetcher } from './DataFetcher-
|
2
|
-
import './pesquisa-fetcher-
|
1
|
+
import { D as DataFetcher } from './DataFetcher-ecf5f903.js';
|
2
|
+
import './pesquisa-fetcher-e26c3295.js';
|
3
3
|
import { SortMode, ApplicationContext, UserInterface, DateUtils, ObjectUtils, StringUtils, NumberUtils, DataType } from '@sankhyalabs/core';
|
4
4
|
import { D as DataExporterOption } from './index-b40568ff.js';
|
5
5
|
import './ISave-d8c8bc59.js';
|
6
6
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
7
7
|
import { UserInterface as UserInterface$1 } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
8
|
-
import { P as PreloadManager } from './dataunit-fetcher-
|
8
|
+
import { P as PreloadManager } from './dataunit-fetcher-ed6e65ef.js';
|
9
9
|
import './filter-item-type.enum-d45e026f.js';
|
10
|
-
import './form-config-fetcher-
|
10
|
+
import './form-config-fetcher-34becd23.js';
|
11
11
|
import './constants-75abb876.js';
|
12
12
|
import InMemoryFilterColumnDataSource from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource';
|
13
13
|
import { h } from './index-a7d3d3f1.js';
|
@@ -169,9 +169,15 @@ class RmPrecisionCustomValueFormatter {
|
|
169
169
|
if (rmPrecision || rmPrecision === 0) {
|
170
170
|
return NumberUtils.format(currentValue, rmPrecision, rmPrecision);
|
171
171
|
}
|
172
|
-
|
173
|
-
|
172
|
+
const columnProps = column === null || column === void 0 ? void 0 : column.props;
|
173
|
+
if (columnProps) {
|
174
|
+
const precision = column === null || column === void 0 ? void 0 : column.props.get('precision');
|
175
|
+
const prettyPrecision = column === null || column === void 0 ? void 0 : column.props.get('prettyPrecision');
|
176
|
+
if (precision !== undefined && prettyPrecision !== undefined) {
|
177
|
+
return NumberUtils.format(currentValue, precision, prettyPrecision);
|
178
|
+
}
|
174
179
|
}
|
180
|
+
return currentValue;
|
175
181
|
}
|
176
182
|
refreshSelectedRows() {
|
177
183
|
var _a;
|
@@ -181,6 +187,9 @@ class RmPrecisionCustomValueFormatter {
|
|
181
187
|
|
182
188
|
class CommonsExporter {
|
183
189
|
constructor(dataUnit, grid) {
|
190
|
+
this.MAX_WIDTH_COD = 60;
|
191
|
+
this.MIN_WIDTH_COD = 10;
|
192
|
+
this.DEFAULT_FONT_SIZE = 13;
|
184
193
|
this.dataUnit = dataUnit;
|
185
194
|
this.grid = grid;
|
186
195
|
}
|
@@ -193,7 +202,7 @@ class CommonsExporter {
|
|
193
202
|
return this.columnsState;
|
194
203
|
}
|
195
204
|
async buildColumnsMetadata(gridColumns) {
|
196
|
-
var _a, _b;
|
205
|
+
var _a, _b, _c;
|
197
206
|
const columnsMetadata = [];
|
198
207
|
for (const column of gridColumns) {
|
199
208
|
/**
|
@@ -204,31 +213,63 @@ class CommonsExporter {
|
|
204
213
|
}
|
205
214
|
const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
206
215
|
const customFormatter = await this.grid.getCustomValueFormatter(column.name);
|
207
|
-
const
|
208
|
-
|
216
|
+
const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface$1.SEARCH;
|
217
|
+
const widthColumnDefault = 60;
|
218
|
+
const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
|
219
|
+
let descriptionColumn = undefined;
|
220
|
+
let columnData = {
|
209
221
|
id: column.name,
|
210
|
-
|
222
|
+
label: labelColumn,
|
223
|
+
width: isUserInterfaceSEARCH ? (labelColumn.length * this.DEFAULT_FONT_SIZE) : column.width,
|
211
224
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
212
225
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
213
226
|
customFormatter
|
214
227
|
};
|
228
|
+
if (isUserInterfaceSEARCH) {
|
229
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
230
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
231
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
232
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
233
|
+
descriptionColumn = {
|
234
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
235
|
+
label: labelDescription,
|
236
|
+
width: isUserInterfaceSEARCH && labelDescription ? (labelDescription.length * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
237
|
+
type: DataType.TEXT,
|
238
|
+
userInterface: UserInterface$1.LONGTEXT,
|
239
|
+
descriptionFrom: fieldData.name
|
240
|
+
};
|
241
|
+
}
|
242
|
+
if (descriptionColumn) {
|
243
|
+
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);
|
244
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
245
|
+
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) });
|
246
|
+
}
|
247
|
+
}
|
215
248
|
columnsMetadata.push(columnData);
|
216
|
-
if (
|
217
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
218
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
219
|
-
const descriptionColumn = {
|
220
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
221
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
222
|
-
width: column.width,
|
223
|
-
type: DataType.TEXT,
|
224
|
-
userInterface: UserInterface$1.LONGTEXT,
|
225
|
-
descriptionFrom: fieldData.name
|
226
|
-
};
|
249
|
+
if (descriptionColumn)
|
227
250
|
columnsMetadata.push(descriptionColumn);
|
228
|
-
}
|
229
251
|
}
|
230
252
|
return columnsMetadata || [];
|
231
253
|
}
|
254
|
+
getWidthByMetaData(maxWidth, widthCod, widthDescription) {
|
255
|
+
const totalCurrentWidth = widthCod + widthDescription;
|
256
|
+
const codPercentage = widthCod / totalCurrentWidth;
|
257
|
+
const descPercentage = widthDescription / totalCurrentWidth;
|
258
|
+
let newWidthCod = Math.round(maxWidth * codPercentage);
|
259
|
+
let newWidthDescription = Math.round(maxWidth * descPercentage);
|
260
|
+
if (newWidthCod > this.MAX_WIDTH_COD) {
|
261
|
+
newWidthCod = this.MAX_WIDTH_COD;
|
262
|
+
newWidthDescription = maxWidth - this.MAX_WIDTH_COD;
|
263
|
+
}
|
264
|
+
else if (newWidthCod < this.MIN_WIDTH_COD) {
|
265
|
+
newWidthCod = this.MIN_WIDTH_COD;
|
266
|
+
newWidthDescription = maxWidth - this.MIN_WIDTH_COD;
|
267
|
+
}
|
268
|
+
return {
|
269
|
+
codWidth: newWidthCod,
|
270
|
+
descWidth: newWidthDescription
|
271
|
+
};
|
272
|
+
}
|
232
273
|
}
|
233
274
|
|
234
275
|
class ContinuousInsertUtils {
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-
|
1
|
+
import { R as ResourceFetcher, F as FormConfigFetcher } from './form-config-fetcher-34becd23.js';
|
2
2
|
import { F as FilterItemType } from './filter-item-type.enum-d45e026f.js';
|
3
3
|
import { ObjectUtils } from '@sankhyalabs/core';
|
4
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
4
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-ecf5f903.js';
|
5
5
|
|
6
6
|
class GridConfigFetcher extends ResourceFetcher {
|
7
7
|
constructor() {
|
@@ -7058,7 +7058,7 @@ class DataFetcher {
|
|
7058
7058
|
const requestId = StringUtils.generateUUID();
|
7059
7059
|
DataFetcher.requestListener.forEach(listener => listener.onRequestStart({ url, requestBody: request, requestId }));
|
7060
7060
|
try {
|
7061
|
-
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset
|
7061
|
+
const response = await dist.batchRequests(url, request, { 'Content-Type': `application/json; charset=UTF-8` });
|
7062
7062
|
response.forEach((resItem, index) => {
|
7063
7063
|
var _a;
|
7064
7064
|
if (((_a = resItem === null || resItem === void 0 ? void 0 : resItem.errors) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { C as ConfigStorage } from './ConfigStorage-
|
1
|
+
import { C as ConfigStorage } from './ConfigStorage-e5c1f4c0.js';
|
2
2
|
import { ObjectUtils, StringUtils } from '@sankhyalabs/core';
|
3
|
-
import { F as FormConfigFetcher } from './form-config-fetcher-
|
3
|
+
import { F as FormConfigFetcher } from './form-config-fetcher-34becd23.js';
|
4
4
|
import { c as TAB_NAMES } from './constants-75abb876.js';
|
5
5
|
|
6
6
|
class SnkFormConfigManager {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ObjectUtils } from '@sankhyalabs/core';
|
2
|
-
import { R as ResourceFetcher } from './form-config-fetcher-
|
2
|
+
import { R as ResourceFetcher } from './form-config-fetcher-34becd23.js';
|
3
3
|
|
4
4
|
class AuthFetcher extends ResourceFetcher {
|
5
5
|
getData(resourceID) {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ObjectUtils, DataUnit, DataUnitInMemoryLoader, ApplicationContext, StringUtils, UserInterface, DataUnitStorage, DataType, ChangeOperation } from '@sankhyalabs/core';
|
2
|
-
import { D as DataFetcher, d as dist } from './DataFetcher-
|
2
|
+
import { D as DataFetcher, d as dist } from './DataFetcher-ecf5f903.js';
|
3
3
|
import { DISTINCT_FILTER_NAME_PREFIX } from '@sankhyalabs/ezui/dist/collection/utils/constants';
|
4
4
|
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
5
5
|
import { ColumnFilterManager } from '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { UserInterface, DataType, ApplicationContext, ErrorException } from '@sankhyalabs/core';
|
2
|
-
import { d as dist, D as DataFetcher } from './DataFetcher-
|
2
|
+
import { d as dist, D as DataFetcher } from './DataFetcher-ecf5f903.js';
|
3
3
|
|
4
4
|
function buildGridMetadata(rawValue) {
|
5
5
|
const fieldsMetadata = buildFieldsMetadata(rawValue.fieldsMetadata);
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment } from './index-a7d3d3f1.js';
|
2
|
-
import { I as InMemoryLoader } from './dataunit-fetcher-
|
3
|
-
import './DataFetcher-
|
4
|
-
import { P as PesquisaFetcher } from './pesquisa-fetcher-
|
2
|
+
import { I as InMemoryLoader } from './dataunit-fetcher-ed6e65ef.js';
|
3
|
+
import './DataFetcher-ecf5f903.js';
|
4
|
+
import { P as PesquisaFetcher } from './pesquisa-fetcher-e26c3295.js';
|
5
5
|
import '@sankhyalabs/core';
|
6
6
|
import './index-b40568ff.js';
|
7
7
|
import './ISave-d8c8bc59.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
10
|
import './filter-item-type.enum-d45e026f.js';
|
11
|
-
import './form-config-fetcher-
|
11
|
+
import './form-config-fetcher-34becd23.js';
|
12
12
|
import './constants-75abb876.js';
|
13
13
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
14
14
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|