@sankhyalabs/sankhyablocks 8.15.11 → 8.15.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-0a690675.js → ConfigStorage-317b99ee.js} +2 -2
- package/dist/cjs/{DataFetcher-77729a93.js → DataFetcher-b7b5d5cf.js} +188 -56
- package/dist/cjs/{SnkFormConfigManager-d6d5db6d.js → SnkFormConfigManager-073e1d5a.js} +2 -2
- package/dist/cjs/{SnkMultiSelectionListDataSource-f79d220c.js → SnkMultiSelectionListDataSource-9893d9ab.js} +3 -3
- package/dist/cjs/{auth-fetcher-29bb791c.js → auth-fetcher-4984b91c.js} +1 -1
- package/dist/cjs/{form-config-fetcher-feb08214.js → form-config-fetcher-a5750a79.js} +1 -1
- package/dist/cjs/{pesquisa-fetcher-cba1b3d0.js → pesquisa-fetcher-f238747e.js} +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +4 -4
- package/dist/cjs/snk-application.cjs.entry.js +5 -5
- package/dist/cjs/snk-attach.cjs.entry.js +4 -4
- package/dist/cjs/snk-crud.cjs.entry.js +4 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-735a1ee5.js → snk-data-unit-e07390ed.js} +7 -6
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +6 -6
- package/dist/cjs/snk-filter-bar.cjs.entry.js +3 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +2 -2
- package/dist/cjs/snk-form.cjs.entry.js +4 -4
- package/dist/cjs/snk-grid.cjs.entry.js +55 -20
- package/dist/cjs/{snk-guides-viewer-bfcad2d6.js → snk-guides-viewer-182f4ebf.js} +4 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -6
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -6
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -6
- package/dist/collection/components/snk-grid/snk-grid.js +50 -15
- package/dist/components/DataFetcher.js +188 -56
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-data-unit2.js +7 -6
- package/dist/components/snk-grid2.js +50 -15
- package/dist/esm/{ConfigStorage-8c2ddac8.js → ConfigStorage-3f44568f.js} +2 -2
- package/dist/esm/{DataFetcher-773a3e4b.js → DataFetcher-69e38b94.js} +188 -56
- package/dist/esm/{SnkFormConfigManager-c01b9d9d.js → SnkFormConfigManager-b8e8be9c.js} +2 -2
- package/dist/esm/{SnkMultiSelectionListDataSource-a4805051.js → SnkMultiSelectionListDataSource-7f925c1b.js} +3 -3
- package/dist/esm/{auth-fetcher-a411f73c.js → auth-fetcher-1372e2d1.js} +1 -1
- package/dist/esm/{form-config-fetcher-e0382e5a.js → form-config-fetcher-f221fbdd.js} +1 -1
- package/dist/esm/{pesquisa-fetcher-34a8b8be.js → pesquisa-fetcher-6d045e06.js} +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +4 -4
- package/dist/esm/snk-application.entry.js +5 -5
- package/dist/esm/snk-attach.entry.js +4 -4
- package/dist/esm/snk-crud.entry.js +4 -4
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-e85c0088.js → snk-data-unit-a91c34aa.js} +7 -6
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +6 -6
- package/dist/esm/snk-filter-bar.entry.js +3 -3
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +2 -2
- package/dist/esm/snk-form.entry.js +4 -4
- package/dist/esm/snk-grid.entry.js +55 -20
- package/dist/esm/{snk-guides-viewer-edeac29f.js → snk-guides-viewer-5723ccec.js} +4 -4
- package/dist/esm/snk-guides-viewer.entry.js +6 -6
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +6 -6
- package/dist/sankhyablocks/{p-2f3b59b4.entry.js → p-13173088.entry.js} +1 -1
- package/dist/sankhyablocks/{p-41c2c191.entry.js → p-19e779bb.entry.js} +1 -1
- package/dist/sankhyablocks/{p-181975f1.js → p-1c73621e.js} +1 -1
- package/dist/sankhyablocks/{p-9fc8dc5c.entry.js → p-20dde3d5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5630574e.js → p-21f4ad7d.js} +1 -1
- package/dist/sankhyablocks/{p-b85027c6.entry.js → p-2579c3e4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f93c9444.entry.js → p-38d69666.entry.js} +1 -1
- package/dist/sankhyablocks/p-43cf9fa1.js +1 -0
- package/dist/sankhyablocks/{p-c5a9a5d9.entry.js → p-45c04048.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c2ae0fab.entry.js → p-4ad2b2f6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-863351fd.entry.js → p-5577c6c8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-37e5d563.js → p-57b4c3b7.js} +1 -1
- package/dist/sankhyablocks/{p-4a832d16.entry.js → p-601db900.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c5aa7d70.entry.js → p-619e1af7.entry.js} +2 -2
- package/dist/sankhyablocks/{p-96621231.js → p-62ceca72.js} +1 -1
- package/dist/sankhyablocks/{p-a97226f6.entry.js → p-76b77086.entry.js} +1 -1
- package/dist/sankhyablocks/p-884385be.js +1 -0
- package/dist/sankhyablocks/{p-46e55a95.entry.js → p-9100a669.entry.js} +1 -1
- package/dist/sankhyablocks/{p-80c64add.entry.js → p-97af2a3a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f0145e3b.js → p-a6a01b15.js} +1 -1
- package/dist/sankhyablocks/{p-f03e4199.entry.js → p-aff42158.entry.js} +1 -1
- package/dist/sankhyablocks/p-b1997082.entry.js +1 -0
- package/dist/sankhyablocks/{p-86af4cc2.js → p-b7dc87c3.js} +1 -1
- package/dist/sankhyablocks/p-f2dc8ba0.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-grid/snk-grid.d.ts +7 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-0cd3c0a9.js +0 -1
- package/dist/sankhyablocks/p-594bc21d.js +0 -1
- package/dist/sankhyablocks/p-7c4c841c.entry.js +0 -1
- package/dist/sankhyablocks/p-edb806ca.js +0 -1
@@ -4,21 +4,21 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-073e1d5a.js');
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
9
|
-
require('./DataFetcher-
|
10
|
-
require('./pesquisa-fetcher-
|
9
|
+
require('./DataFetcher-b7b5d5cf.js');
|
10
|
+
require('./pesquisa-fetcher-f238747e.js');
|
11
11
|
const index$1 = require('./index-0922807b.js');
|
12
12
|
require('./ISave-e91b70a7.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
15
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
16
|
-
require('./form-config-fetcher-
|
16
|
+
require('./form-config-fetcher-a5750a79.js');
|
17
17
|
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
18
18
|
const constants = require('./constants-35ddd366.js');
|
19
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
19
|
+
const snkGuidesViewer = require('./snk-guides-viewer-182f4ebf.js');
|
20
20
|
const SnkMessageBuilder = require('./SnkMessageBuilder-96b0f549.js');
|
21
|
-
require('./ConfigStorage-
|
21
|
+
require('./ConfigStorage-317b99ee.js');
|
22
22
|
require('./PrintUtils-bcaeb82f.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
24
24
|
require('./ResourceIDUtils-5ff86aa7.js');
|
@@ -5,15 +5,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index$1 = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-317b99ee.js');
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
11
11
|
const index = require('./index-c5771aba.js');
|
12
12
|
const filterNumberVariation = require('./filterNumberVariation-d65332da.js');
|
13
13
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
14
14
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
15
|
-
require('./form-config-fetcher-
|
16
|
-
require('./DataFetcher-
|
15
|
+
require('./form-config-fetcher-a5750a79.js');
|
16
|
+
require('./DataFetcher-b7b5d5cf.js');
|
17
17
|
require('./PrintUtils-bcaeb82f.js');
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
19
19
|
|
@@ -6,10 +6,10 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
8
8
|
const presentationMode = require('./presentationMode-52ec3bdd.js');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-317b99ee.js');
|
10
10
|
const filterType_enum = require('./filter-type.enum-b14ce507.js');
|
11
|
-
require('./form-config-fetcher-
|
12
|
-
require('./DataFetcher-
|
11
|
+
require('./form-config-fetcher-a5750a79.js');
|
12
|
+
require('./DataFetcher-b7b5d5cf.js');
|
13
13
|
require('./PrintUtils-bcaeb82f.js');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
15
|
|
@@ -7,9 +7,9 @@ const Sortable = require('./Sortable-fb1c4cbb.js');
|
|
7
7
|
const core = require('@sankhyalabs/core');
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
10
|
+
const formConfigFetcher = require('./form-config-fetcher-a5750a79.js');
|
11
11
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
12
|
-
require('./DataFetcher-
|
12
|
+
require('./DataFetcher-b7b5d5cf.js');
|
13
13
|
require('./PrintUtils-bcaeb82f.js');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
15
|
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-073e1d5a.js');
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
9
|
-
require('./ConfigStorage-
|
10
|
-
require('./form-config-fetcher-
|
11
|
-
require('./DataFetcher-
|
9
|
+
require('./ConfigStorage-317b99ee.js');
|
10
|
+
require('./form-config-fetcher-a5750a79.js');
|
11
|
+
require('./DataFetcher-b7b5d5cf.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
@@ -6,18 +6,18 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
8
8
|
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-317b99ee.js');
|
10
10
|
const index$1 = require('./index-0922807b.js');
|
11
11
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
12
12
|
const index$2 = require('./index-102ba62d.js');
|
13
|
-
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-
|
13
|
+
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-9893d9ab.js');
|
14
14
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
15
|
-
require('./DataFetcher-
|
16
|
-
require('./pesquisa-fetcher-
|
15
|
+
require('./DataFetcher-b7b5d5cf.js');
|
16
|
+
require('./pesquisa-fetcher-f238747e.js');
|
17
17
|
require('./ISave-e91b70a7.js');
|
18
18
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
19
19
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
20
|
-
require('./form-config-fetcher-
|
20
|
+
require('./form-config-fetcher-a5750a79.js');
|
21
21
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
22
22
|
require('./PrintUtils-bcaeb82f.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -30,6 +30,9 @@ const SnkGrid = class {
|
|
30
30
|
index.registerInstance(this, hostRef);
|
31
31
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
32
32
|
this.gridDoubleClick = index.createEvent(this, "gridDoubleClick", 7);
|
33
|
+
this.MAX_WIDTH_COD = 60;
|
34
|
+
this.MIN_WIDTH_COD = 10;
|
35
|
+
this.DEFAULT_FONT_SIZE = 13;
|
33
36
|
this._topTaskbarProcessor = new fieldSearch.TaskbarProcessor({
|
34
37
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
35
38
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -182,7 +185,7 @@ const SnkGrid = class {
|
|
182
185
|
buildColumnsMetadata(gridColumns) {
|
183
186
|
const columnsMetadata = [];
|
184
187
|
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
185
|
-
var _a, _b;
|
188
|
+
var _a, _b, _c;
|
186
189
|
/**
|
187
190
|
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
188
191
|
*/
|
@@ -190,29 +193,61 @@ const SnkGrid = class {
|
|
190
193
|
return;
|
191
194
|
}
|
192
195
|
const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
193
|
-
const
|
194
|
-
|
196
|
+
const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UnitMetadata.UserInterface.SEARCH;
|
197
|
+
const widthColumnDefault = 60;
|
198
|
+
const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
|
199
|
+
let descriptionColumn = undefined;
|
200
|
+
let columnData = {
|
195
201
|
id: column.name,
|
196
|
-
|
202
|
+
label: labelColumn,
|
203
|
+
width: isUserInterfaceSEARCH ? ((labelColumn === null || labelColumn === void 0 ? void 0 : labelColumn.length) * this.DEFAULT_FONT_SIZE) : column.width,
|
197
204
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
198
205
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
199
206
|
};
|
207
|
+
if (isUserInterfaceSEARCH) {
|
208
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
209
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
210
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
211
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
212
|
+
descriptionColumn = {
|
213
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
214
|
+
label: labelDescription,
|
215
|
+
width: isUserInterfaceSEARCH && labelDescription ? ((labelDescription === null || labelDescription === void 0 ? void 0 : labelDescription.length) * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
216
|
+
type: core.DataType.TEXT,
|
217
|
+
userInterface: UnitMetadata.UserInterface.LONGTEXT
|
218
|
+
};
|
219
|
+
}
|
220
|
+
if (descriptionColumn) {
|
221
|
+
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);
|
222
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
223
|
+
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) });
|
224
|
+
}
|
225
|
+
}
|
200
226
|
columnsMetadata.push(columnData);
|
201
|
-
if (
|
202
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
203
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
204
|
-
const descriptionColumn = {
|
205
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
206
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
207
|
-
width: column.width,
|
208
|
-
type: core.DataType.TEXT,
|
209
|
-
userInterface: UnitMetadata.UserInterface.LONGTEXT
|
210
|
-
};
|
227
|
+
if (descriptionColumn)
|
211
228
|
columnsMetadata.push(descriptionColumn);
|
212
|
-
}
|
213
229
|
});
|
214
230
|
return columnsMetadata || [];
|
215
231
|
}
|
232
|
+
getWidthByMetaData(maxWidth, widthCod, widthDescription) {
|
233
|
+
const totalCurrentWidth = widthCod + widthDescription;
|
234
|
+
const codPercentage = widthCod / totalCurrentWidth;
|
235
|
+
const descPercentage = widthDescription / totalCurrentWidth;
|
236
|
+
let newWidthCod = Math.round(maxWidth * codPercentage);
|
237
|
+
let newWidthDescription = Math.round(maxWidth * descPercentage);
|
238
|
+
if (newWidthCod > this.MAX_WIDTH_COD) {
|
239
|
+
newWidthCod = this.MAX_WIDTH_COD;
|
240
|
+
newWidthDescription = maxWidth - this.MAX_WIDTH_COD;
|
241
|
+
}
|
242
|
+
else if (newWidthCod < this.MIN_WIDTH_COD) {
|
243
|
+
newWidthCod = this.MIN_WIDTH_COD;
|
244
|
+
newWidthDescription = maxWidth - this.MIN_WIDTH_COD;
|
245
|
+
}
|
246
|
+
return {
|
247
|
+
codWidth: newWidthCod,
|
248
|
+
descWidth: newWidthDescription
|
249
|
+
};
|
250
|
+
}
|
216
251
|
getPaginationInfo() {
|
217
252
|
var _a;
|
218
253
|
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|
@@ -2,19 +2,19 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-073e1d5a.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
8
8
|
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
10
|
+
require('./DataFetcher-b7b5d5cf.js');
|
11
|
+
require('./pesquisa-fetcher-f238747e.js');
|
12
12
|
const index$1 = require('./index-0922807b.js');
|
13
13
|
require('./ISave-e91b70a7.js');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
|
-
require('./form-config-fetcher-
|
17
|
+
require('./form-config-fetcher-a5750a79.js');
|
18
18
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
19
19
|
|
20
20
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-182f4ebf.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
9
|
-
require('./ConfigStorage-
|
10
|
-
require('./form-config-fetcher-
|
11
|
-
require('./DataFetcher-
|
8
|
+
require('./SnkFormConfigManager-073e1d5a.js');
|
9
|
+
require('./ConfigStorage-317b99ee.js');
|
10
|
+
require('./form-config-fetcher-a5750a79.js');
|
11
|
+
require('./DataFetcher-b7b5d5cf.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
@@ -18,7 +18,7 @@ require('./taskbar-elements-3ecd1278.js');
|
|
18
18
|
require('./index-0922807b.js');
|
19
19
|
require('./index-102ba62d.js');
|
20
20
|
require('./constants-35ddd366.js');
|
21
|
-
require('./pesquisa-fetcher-
|
21
|
+
require('./pesquisa-fetcher-f238747e.js');
|
22
22
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
24
24
|
require('./ResourceIDUtils-5ff86aa7.js');
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-317b99ee.js');
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
12
12
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
13
|
-
require('./form-config-fetcher-
|
14
|
-
require('./DataFetcher-
|
13
|
+
require('./form-config-fetcher-a5750a79.js');
|
14
|
+
require('./DataFetcher-b7b5d5cf.js');
|
15
15
|
require('./PrintUtils-bcaeb82f.js');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
17
|
|
@@ -7,18 +7,18 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
9
9
|
const taskbarElements = require('./taskbar-elements-3ecd1278.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
12
|
-
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-
|
10
|
+
require('./DataFetcher-b7b5d5cf.js');
|
11
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-f238747e.js');
|
12
|
+
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-9893d9ab.js');
|
13
13
|
const index$1 = require('./index-0922807b.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
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
18
|
+
const formConfigFetcher = require('./form-config-fetcher-a5750a79.js');
|
19
19
|
const fieldSearch = require('./field-search-f56aa7d6.js');
|
20
|
-
const ConfigStorage = require('./ConfigStorage-
|
21
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
20
|
+
const ConfigStorage = require('./ConfigStorage-317b99ee.js');
|
21
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-073e1d5a.js');
|
22
22
|
require('./index-102ba62d.js');
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
24
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -126,7 +126,7 @@ export class SnkDataUnit {
|
|
126
126
|
}
|
127
127
|
async interceptAction(action) {
|
128
128
|
return new Promise(resolve => {
|
129
|
-
var _a, _b, _c, _d, _e;
|
129
|
+
var _a, _b, _c, _d, _e, _f;
|
130
130
|
switch (action.type) {
|
131
131
|
case Action.RECORDS_ADDED:
|
132
132
|
if (this.isAllowed("INSERT")) {
|
@@ -155,7 +155,8 @@ export class SnkDataUnit {
|
|
155
155
|
break;
|
156
156
|
case Action.DATA_CHANGED:
|
157
157
|
case Action.CHANGING_DATA:
|
158
|
-
|
158
|
+
const recordId = (_a = this.dataUnit.getSelectedRecord()) === null || _a === void 0 ? void 0 : _a.__record__id__;
|
159
|
+
if (this.isAllowed("UPDATE") || this.dataUnit.isNewRecord(recordId))
|
159
160
|
return resolve(action);
|
160
161
|
if (this._openedAlert)
|
161
162
|
return this.dataUnit.cancelEdition();
|
@@ -192,7 +193,7 @@ export class SnkDataUnit {
|
|
192
193
|
return resolve(action);
|
193
194
|
if (this.dataState.hasDirtyRecords) {
|
194
195
|
const cancelConfirmation = this.getMessage("snkDataUnit.cancelConfirmation");
|
195
|
-
if (((
|
196
|
+
if (((_b = action.payload) === null || _b === void 0 ? void 0 : _b.fromParent) || ((_c = action.payload) === null || _c === void 0 ? void 0 : _c.silent)) {
|
196
197
|
resolve(action);
|
197
198
|
return;
|
198
199
|
}
|
@@ -216,9 +217,9 @@ export class SnkDataUnit {
|
|
216
217
|
case Action.REMOVING_RECORDS:
|
217
218
|
if (this.isAllowed("REMOVE")) {
|
218
219
|
let multipleSelection = false;
|
219
|
-
let removeConfirmation = !((
|
220
|
-
const selection = (
|
221
|
-
if (!((
|
220
|
+
let removeConfirmation = !((_d = action.payload) === null || _d === void 0 ? void 0 : _d.silent) && this.getMessage("snkDataUnit.removeConfirmation");
|
221
|
+
const selection = (_e = this.dataUnit) === null || _e === void 0 ? void 0 : _e.getSelectionInfo();
|
222
|
+
if (!((_f = action.payload) === null || _f === void 0 ? void 0 : _f.silent) && (selection === null || selection === void 0 ? void 0 : selection.length) > 1) {
|
222
223
|
removeConfirmation = this.getMessage("snkDataUnit.removeAllConfirmation", { size: selection.length });
|
223
224
|
multipleSelection = true;
|
224
225
|
}
|
@@ -12,6 +12,9 @@ import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/
|
|
12
12
|
import { CrudUtils } from '../../lib';
|
13
13
|
export class SnkGrid {
|
14
14
|
constructor() {
|
15
|
+
this.MAX_WIDTH_COD = 60;
|
16
|
+
this.MIN_WIDTH_COD = 10;
|
17
|
+
this.DEFAULT_FONT_SIZE = 13;
|
15
18
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
16
19
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
17
20
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -164,7 +167,7 @@ export class SnkGrid {
|
|
164
167
|
buildColumnsMetadata(gridColumns) {
|
165
168
|
const columnsMetadata = [];
|
166
169
|
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach((column) => {
|
167
|
-
var _a, _b;
|
170
|
+
var _a, _b, _c;
|
168
171
|
/**
|
169
172
|
* TODO: Analisar e criar uma melhor forma de tratar essa validação do "RECDESP".
|
170
173
|
*/
|
@@ -172,29 +175,61 @@ export class SnkGrid {
|
|
172
175
|
return;
|
173
176
|
}
|
174
177
|
const fieldData = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
175
|
-
const
|
176
|
-
|
178
|
+
const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface.SEARCH;
|
179
|
+
const widthColumnDefault = 60;
|
180
|
+
const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
|
181
|
+
let descriptionColumn = undefined;
|
182
|
+
let columnData = {
|
177
183
|
id: column.name,
|
178
|
-
|
184
|
+
label: labelColumn,
|
185
|
+
width: isUserInterfaceSEARCH ? ((labelColumn === null || labelColumn === void 0 ? void 0 : labelColumn.length) * this.DEFAULT_FONT_SIZE) : column.width,
|
179
186
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
180
187
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface
|
181
188
|
};
|
189
|
+
if (isUserInterfaceSEARCH) {
|
190
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
191
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
192
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
193
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
194
|
+
descriptionColumn = {
|
195
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
196
|
+
label: labelDescription,
|
197
|
+
width: isUserInterfaceSEARCH && labelDescription ? ((labelDescription === null || labelDescription === void 0 ? void 0 : labelDescription.length) * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
198
|
+
type: DataType.TEXT,
|
199
|
+
userInterface: UserInterface.LONGTEXT
|
200
|
+
};
|
201
|
+
}
|
202
|
+
if (descriptionColumn) {
|
203
|
+
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);
|
204
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
205
|
+
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) });
|
206
|
+
}
|
207
|
+
}
|
182
208
|
columnsMetadata.push(columnData);
|
183
|
-
if (
|
184
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
185
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
186
|
-
const descriptionColumn = {
|
187
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
188
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
189
|
-
width: column.width,
|
190
|
-
type: DataType.TEXT,
|
191
|
-
userInterface: UserInterface.LONGTEXT
|
192
|
-
};
|
209
|
+
if (descriptionColumn)
|
193
210
|
columnsMetadata.push(descriptionColumn);
|
194
|
-
}
|
195
211
|
});
|
196
212
|
return columnsMetadata || [];
|
197
213
|
}
|
214
|
+
getWidthByMetaData(maxWidth, widthCod, widthDescription) {
|
215
|
+
const totalCurrentWidth = widthCod + widthDescription;
|
216
|
+
const codPercentage = widthCod / totalCurrentWidth;
|
217
|
+
const descPercentage = widthDescription / totalCurrentWidth;
|
218
|
+
let newWidthCod = Math.round(maxWidth * codPercentage);
|
219
|
+
let newWidthDescription = Math.round(maxWidth * descPercentage);
|
220
|
+
if (newWidthCod > this.MAX_WIDTH_COD) {
|
221
|
+
newWidthCod = this.MAX_WIDTH_COD;
|
222
|
+
newWidthDescription = maxWidth - this.MAX_WIDTH_COD;
|
223
|
+
}
|
224
|
+
else if (newWidthCod < this.MIN_WIDTH_COD) {
|
225
|
+
newWidthCod = this.MIN_WIDTH_COD;
|
226
|
+
newWidthDescription = maxWidth - this.MIN_WIDTH_COD;
|
227
|
+
}
|
228
|
+
return {
|
229
|
+
codWidth: newWidthCod,
|
230
|
+
descWidth: newWidthDescription
|
231
|
+
};
|
232
|
+
}
|
198
233
|
getPaginationInfo() {
|
199
234
|
var _a;
|
200
235
|
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getPaginationInfo();
|