@sankhyalabs/sankhyablocks 8.15.0-dev.8 → 8.15.0-dev.9
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/{dataunit-fetcher-14108bec.js → dataunit-fetcher-353e4af2.js} +24 -4
- package/dist/cjs/snk-actions-button_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-application.cjs.entry.js +1 -1
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-item.cjs.entry.js +47 -1
- package/dist/cjs/{snk-guides-viewer-c8b9374f.js → snk-guides-viewer-e60ccc5e.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +2 -2
- package/dist/cjs/snk-simple-crud.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/snk-crud/snk-crud.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +47 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +14 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +10 -3
- package/dist/components/dataunit-fetcher.js +24 -4
- package/dist/components/snk-crud.js +1 -1
- package/dist/components/snk-filter-item2.js +47 -1
- package/dist/esm/{dataunit-fetcher-cbec1594.js → dataunit-fetcher-0fc935a0.js} +24 -4
- package/dist/esm/snk-actions-button_2.entry.js +1 -1
- package/dist/esm/snk-application.entry.js +1 -1
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +2 -2
- package/dist/esm/snk-filter-item.entry.js +47 -1
- package/dist/esm/{snk-guides-viewer-8da24475.js → snk-guides-viewer-98a8e45e.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +2 -2
- package/dist/esm/snk-simple-crud.entry.js +1 -1
- package/dist/sankhyablocks/{p-d81f20c4.entry.js → p-41560fd8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-a9e4bb55.entry.js → p-6678d5d4.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6977a26c.entry.js → p-71439fd9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ba3d3fa9.entry.js → p-90f9b4db.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c6e477ff.js → p-a91bb13d.js} +1 -1
- package/dist/sankhyablocks/{p-8d70b5d5.entry.js → p-abfa8101.entry.js} +1 -1
- package/dist/sankhyablocks/{p-c4d19840.entry.js → p-b3020263.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3891ae6f.js → p-bf93a748.js} +2 -2
- package/dist/sankhyablocks/{p-25927311.entry.js → p-c6f89389.entry.js} +1 -1
- package/dist/sankhyablocks/{p-aa0ae6bc.entry.js → p-cebae710.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +1 -0
- package/package.json +6 -4
@@ -241,7 +241,7 @@ class DatasetStrategy {
|
|
241
241
|
tryJoinedFields: true,
|
242
242
|
parallelLoader: useParallelLoader,
|
243
243
|
crudListener: `br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,
|
244
|
-
txProperties: this.getTxProperties(
|
244
|
+
txProperties: this.getTxProperties(dataUnit, request, sorting),
|
245
245
|
useDefaultRowsLimit: false
|
246
246
|
}
|
247
247
|
};
|
@@ -252,10 +252,10 @@ class DatasetStrategy {
|
|
252
252
|
const moduleName = app.getModuleName();
|
253
253
|
return moduleName.replace("-bff", "");
|
254
254
|
}
|
255
|
-
getTxProperties(
|
255
|
+
getTxProperties(dataUnit, request, sorting) {
|
256
256
|
var _a, _b;
|
257
257
|
const txProperties = {
|
258
|
-
"__DATA_UNIT_ADAPTER__[dataUnitName]":
|
258
|
+
"__DATA_UNIT_ADAPTER__[dataUnitName]": dataUnit.name
|
259
259
|
};
|
260
260
|
const serverSideFilters = (_b = (_a = request.filters) === null || _a === void 0 ? void 0 : _a.filter(filter => !filter.name.startsWith("FILTRO_COLUNA_"))) !== null && _b !== void 0 ? _b : [];
|
261
261
|
if (serverSideFilters.length !== 0) {
|
@@ -267,6 +267,13 @@ class DatasetStrategy {
|
|
267
267
|
if (request.parentRecordId != undefined) {
|
268
268
|
txProperties["__DATA_UNIT_ADAPTER__[parentRecordId]"] = request.parentRecordId;
|
269
269
|
}
|
270
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
271
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
272
|
+
return txProperties;
|
273
|
+
}
|
274
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
275
|
+
txProperties[name] = value;
|
276
|
+
});
|
270
277
|
return txProperties;
|
271
278
|
}
|
272
279
|
processRecords(dataUnit, fields, responseRecords) {
|
@@ -596,6 +603,19 @@ class DataUnitFetcher {
|
|
596
603
|
});
|
597
604
|
});
|
598
605
|
}
|
606
|
+
addTransientProperties(dataUnit, updatingFields) {
|
607
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
608
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
609
|
+
return updatingFields;
|
610
|
+
}
|
611
|
+
if (updatingFields == undefined) {
|
612
|
+
updatingFields = {};
|
613
|
+
}
|
614
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
615
|
+
updatingFields[`transient.${name}`] = value;
|
616
|
+
});
|
617
|
+
return updatingFields;
|
618
|
+
}
|
599
619
|
saveData(dataUnit, duChanges) {
|
600
620
|
const updatedRecordsIds = [];
|
601
621
|
const addedRecordsIds = [];
|
@@ -604,7 +624,7 @@ class DataUnitFetcher {
|
|
604
624
|
const dataUnitInstance = core.DataUnitStorage.get(changeDU);
|
605
625
|
let parsedUpdatingFields;
|
606
626
|
if (updatingFields) {
|
607
|
-
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
627
|
+
parsedUpdatingFields = Object.entries(this.addTransientProperties(dataUnit, updatingFields)).map(([fieldName, value]) => {
|
608
628
|
const descriptor = dataUnitInstance.getField(fieldName);
|
609
629
|
const dataType = descriptor ? descriptor.dataType : core.DataType.TEXT;
|
610
630
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
@@ -11,7 +11,7 @@ require('./index-0922807b.js');
|
|
11
11
|
require('./ISave-d68ce3cd.js');
|
12
12
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
-
require('./dataunit-fetcher-
|
14
|
+
require('./dataunit-fetcher-353e4af2.js');
|
15
15
|
require('./PreloadManager-84466da6.js');
|
16
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
17
|
require('./form-config-fetcher-df043d3d.js');
|
@@ -8,7 +8,7 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
8
8
|
const ConfigStorage = require('./ConfigStorage-302bbbd4.js');
|
9
9
|
const DataFetcher = require('./DataFetcher-ba94ed5b.js');
|
10
10
|
const authFetcher = require('./auth-fetcher-c8467c07.js');
|
11
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-353e4af2.js');
|
12
12
|
const pesquisaFetcher = require('./pesquisa-fetcher-ef050a47.js');
|
13
13
|
const SnkMessageBuilder = require('./SnkMessageBuilder-7293d0ad.js');
|
14
14
|
require('./form-config-fetcher-df043d3d.js');
|
@@ -7,7 +7,7 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const DataFetcher = require('./DataFetcher-ba94ed5b.js');
|
8
8
|
const ISave = require('./ISave-d68ce3cd.js');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
10
|
+
const dataunitFetcher = require('./dataunit-fetcher-353e4af2.js');
|
11
11
|
const PreloadManager = require('./PreloadManager-84466da6.js');
|
12
12
|
const taskbarElements = require('./taskbar-elements-01b85b99.js');
|
13
13
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -11,7 +11,7 @@ const index$1 = require('./index-0922807b.js');
|
|
11
11
|
require('./ISave-d68ce3cd.js');
|
12
12
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
-
require('./dataunit-fetcher-
|
14
|
+
require('./dataunit-fetcher-353e4af2.js');
|
15
15
|
require('./PreloadManager-84466da6.js');
|
16
16
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
17
|
require('./form-config-fetcher-df043d3d.js');
|
@@ -298,7 +298,7 @@ const SnkCrud = class {
|
|
298
298
|
return;
|
299
299
|
}
|
300
300
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === constants.VIEW_MODE.GRID;
|
301
|
-
return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
301
|
+
return (index.h(index.Host, null, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), index.h("div", { id: `${this.customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }), index.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
302
302
|
}
|
303
303
|
get _element() { return index.getElement(this); }
|
304
304
|
static get watchers() { return {
|
@@ -12,13 +12,13 @@ const index$1 = require('./index-0922807b.js');
|
|
12
12
|
require('./ISave-d68ce3cd.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
require('./dataunit-fetcher-
|
15
|
+
require('./dataunit-fetcher-353e4af2.js');
|
16
16
|
require('./PreloadManager-84466da6.js');
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
18
|
require('./form-config-fetcher-df043d3d.js');
|
19
19
|
const taskbarElements = require('./taskbar-elements-01b85b99.js');
|
20
20
|
const constants = require('./constants-35ddd366.js');
|
21
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
21
|
+
const snkGuidesViewer = require('./snk-guides-viewer-e60ccc5e.js');
|
22
22
|
const SnkMessageBuilder = require('./SnkMessageBuilder-7293d0ad.js');
|
23
23
|
require('./ConfigStorage-302bbbd4.js');
|
24
24
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -292,14 +292,60 @@ const SnkFilterItem = class {
|
|
292
292
|
}
|
293
293
|
return this.hasActiveValue(this.config);
|
294
294
|
}
|
295
|
+
onEzClick() {
|
296
|
+
console.log("onEzClick");
|
297
|
+
}
|
295
298
|
render() {
|
296
299
|
const leftIcon = this.getLeftIconName();
|
297
|
-
return (index.h(index.Host, null, index.h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? index.h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, index.h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), index.h("
|
300
|
+
return (index.h(index.Host, null, index.h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? index.h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, index.h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), index.h("ez-split-button", { label: "Split Button", class: "ez-button--primary", mode: "label-icon", iconName: "acao", size: "small", onEzClick: this.onEzClick,
|
301
|
+
//onclick={this.onEzClick}
|
302
|
+
items: items }), index.h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, index.h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
|
298
303
|
}
|
299
304
|
get _filterItemElement() { return index.getElement(this); }
|
300
305
|
static get watchers() { return {
|
301
306
|
"detailIsVisible": ["observeDetailIsVisible"]
|
302
307
|
}; }
|
303
308
|
};
|
309
|
+
const items = [
|
310
|
+
{
|
311
|
+
id: "1",
|
312
|
+
label: "Emitir NFe",
|
313
|
+
type: "item"
|
314
|
+
},
|
315
|
+
{
|
316
|
+
id: "2",
|
317
|
+
label: "Cancelar NFe",
|
318
|
+
type: "item"
|
319
|
+
},
|
320
|
+
{
|
321
|
+
id: "3",
|
322
|
+
label: "Exportar NFe",
|
323
|
+
type: "item",
|
324
|
+
children: [
|
325
|
+
{
|
326
|
+
id: "4",
|
327
|
+
label: "Danfe PDF",
|
328
|
+
type: "item",
|
329
|
+
children: [
|
330
|
+
{
|
331
|
+
id: "6",
|
332
|
+
label: "Modo retrato",
|
333
|
+
type: "item"
|
334
|
+
},
|
335
|
+
{
|
336
|
+
id: "7",
|
337
|
+
label: "Modo paisagem",
|
338
|
+
type: "item"
|
339
|
+
}
|
340
|
+
]
|
341
|
+
},
|
342
|
+
{
|
343
|
+
id: "5",
|
344
|
+
label: "XML",
|
345
|
+
type: "item"
|
346
|
+
}
|
347
|
+
]
|
348
|
+
}
|
349
|
+
];
|
304
350
|
|
305
351
|
exports.snk_filter_item = SnkFilterItem;
|
@@ -13,7 +13,7 @@ const index$1 = require('./index-0922807b.js');
|
|
13
13
|
require('./ISave-d68ce3cd.js');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
|
-
require('./dataunit-fetcher-
|
16
|
+
require('./dataunit-fetcher-353e4af2.js');
|
17
17
|
require('./PreloadManager-84466da6.js');
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
19
19
|
require('./form-config-fetcher-df043d3d.js');
|
@@ -2,7 +2,7 @@
|
|
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-e60ccc5e.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('./SnkFormConfigManager-71c4768e.js');
|
@@ -21,7 +21,7 @@ require('./constants-35ddd366.js');
|
|
21
21
|
require('./pesquisa-fetcher-ef050a47.js');
|
22
22
|
require('./ISave-d68ce3cd.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
24
|
-
require('./dataunit-fetcher-
|
24
|
+
require('./dataunit-fetcher-353e4af2.js');
|
25
25
|
require('./PreloadManager-84466da6.js');
|
26
26
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
27
27
|
require('./ResourceIDUtils-5ff86aa7.js');
|
@@ -12,7 +12,7 @@ const index$1 = require('./index-0922807b.js');
|
|
12
12
|
require('./ISave-d68ce3cd.js');
|
13
13
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
14
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
15
|
+
const dataunitFetcher = require('./dataunit-fetcher-353e4af2.js');
|
16
16
|
require('./PreloadManager-84466da6.js');
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
18
|
require('./form-config-fetcher-df043d3d.js');
|
@@ -5,6 +5,7 @@
|
|
5
5
|
"./components/snk-data-unit/snk-data-unit.js",
|
6
6
|
"./components/snk-taskbar/snk-taskbar.js",
|
7
7
|
"./components/snk-filter-bar/filter-list/snk-filter-list.js",
|
8
|
+
"./components/snk-print-selector/snk-print-selector.js",
|
8
9
|
"./components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js",
|
9
10
|
"./components/snk-actions-button/snk-actions-button.js",
|
10
11
|
"./components/snk-actions-button/subcomponents/snk-actions-form.js",
|
@@ -47,7 +48,6 @@
|
|
47
48
|
"./components/snk-personalized-filter/subcomponents/snk-filter-assistent-mode/snk-filter-assistent-mode.js",
|
48
49
|
"./components/snk-personalized-filter/subcomponents/snk-filter-param-config/snk-filter-param-config.js",
|
49
50
|
"./components/snk-pesquisa/snk-pesquisa.js",
|
50
|
-
"./components/snk-print-selector/snk-print-selector.js",
|
51
51
|
"./components/snk-simple-bar/snk-simple-bar.js",
|
52
52
|
"./components/snk-simple-crud/snk-simple-crud.js",
|
53
53
|
"./components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js",
|
@@ -278,7 +278,7 @@ export class SnkCrud {
|
|
278
278
|
return;
|
279
279
|
}
|
280
280
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
281
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
281
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
282
282
|
}
|
283
283
|
static get is() { return "snk-crud"; }
|
284
284
|
static get encapsulation() { return "scoped"; }
|
@@ -284,9 +284,14 @@ export class SnkFilterItem {
|
|
284
284
|
}
|
285
285
|
return this.hasActiveValue(this.config);
|
286
286
|
}
|
287
|
+
onEzClick() {
|
288
|
+
console.log("onEzClick");
|
289
|
+
}
|
287
290
|
render() {
|
288
291
|
const leftIcon = this.getLeftIconName();
|
289
|
-
return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("
|
292
|
+
return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("ez-split-button", { label: "Split Button", class: "ez-button--primary", mode: "label-icon", iconName: "acao", size: "small", onEzClick: this.onEzClick,
|
293
|
+
//onclick={this.onEzClick}
|
294
|
+
items: items }), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
|
290
295
|
}
|
291
296
|
static get is() { return "snk-filter-item"; }
|
292
297
|
static get properties() {
|
@@ -437,3 +442,44 @@ export class SnkFilterItem {
|
|
437
442
|
}];
|
438
443
|
}
|
439
444
|
}
|
445
|
+
const items = [
|
446
|
+
{
|
447
|
+
id: "1",
|
448
|
+
label: "Emitir NFe",
|
449
|
+
type: "item"
|
450
|
+
},
|
451
|
+
{
|
452
|
+
id: "2",
|
453
|
+
label: "Cancelar NFe",
|
454
|
+
type: "item"
|
455
|
+
},
|
456
|
+
{
|
457
|
+
id: "3",
|
458
|
+
label: "Exportar NFe",
|
459
|
+
type: "item",
|
460
|
+
children: [
|
461
|
+
{
|
462
|
+
id: "4",
|
463
|
+
label: "Danfe PDF",
|
464
|
+
type: "item",
|
465
|
+
children: [
|
466
|
+
{
|
467
|
+
id: "6",
|
468
|
+
label: "Modo retrato",
|
469
|
+
type: "item"
|
470
|
+
},
|
471
|
+
{
|
472
|
+
id: "7",
|
473
|
+
label: "Modo paisagem",
|
474
|
+
type: "item"
|
475
|
+
}
|
476
|
+
]
|
477
|
+
},
|
478
|
+
{
|
479
|
+
id: "5",
|
480
|
+
label: "XML",
|
481
|
+
type: "item"
|
482
|
+
}
|
483
|
+
]
|
484
|
+
}
|
485
|
+
];
|
@@ -171,6 +171,19 @@ export default class DataUnitFetcher {
|
|
171
171
|
});
|
172
172
|
});
|
173
173
|
}
|
174
|
+
addTransientProperties(dataUnit, updatingFields) {
|
175
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
176
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
177
|
+
return updatingFields;
|
178
|
+
}
|
179
|
+
if (updatingFields == undefined) {
|
180
|
+
updatingFields = {};
|
181
|
+
}
|
182
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
183
|
+
updatingFields[`transient.${name}`] = value;
|
184
|
+
});
|
185
|
+
return updatingFields;
|
186
|
+
}
|
174
187
|
saveData(dataUnit, duChanges) {
|
175
188
|
const updatedRecordsIds = [];
|
176
189
|
const addedRecordsIds = [];
|
@@ -179,7 +192,7 @@ export default class DataUnitFetcher {
|
|
179
192
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
180
193
|
let parsedUpdatingFields;
|
181
194
|
if (updatingFields) {
|
182
|
-
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
195
|
+
parsedUpdatingFields = Object.entries(this.addTransientProperties(dataUnit, updatingFields)).map(([fieldName, value]) => {
|
183
196
|
const descriptor = dataUnitInstance.getField(fieldName);
|
184
197
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
185
198
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js
CHANGED
@@ -92,7 +92,7 @@ export class DatasetStrategy {
|
|
92
92
|
tryJoinedFields: true,
|
93
93
|
parallelLoader: useParallelLoader,
|
94
94
|
crudListener: `br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,
|
95
|
-
txProperties: this.getTxProperties(
|
95
|
+
txProperties: this.getTxProperties(dataUnit, request, sorting),
|
96
96
|
useDefaultRowsLimit: false
|
97
97
|
}
|
98
98
|
};
|
@@ -103,10 +103,10 @@ export class DatasetStrategy {
|
|
103
103
|
const moduleName = app.getModuleName();
|
104
104
|
return moduleName.replace("-bff", "");
|
105
105
|
}
|
106
|
-
getTxProperties(
|
106
|
+
getTxProperties(dataUnit, request, sorting) {
|
107
107
|
var _a, _b;
|
108
108
|
const txProperties = {
|
109
|
-
"__DATA_UNIT_ADAPTER__[dataUnitName]":
|
109
|
+
"__DATA_UNIT_ADAPTER__[dataUnitName]": dataUnit.name
|
110
110
|
};
|
111
111
|
const serverSideFilters = (_b = (_a = request.filters) === null || _a === void 0 ? void 0 : _a.filter(filter => !filter.name.startsWith("FILTRO_COLUNA_"))) !== null && _b !== void 0 ? _b : [];
|
112
112
|
if (serverSideFilters.length !== 0) {
|
@@ -118,6 +118,13 @@ export class DatasetStrategy {
|
|
118
118
|
if (request.parentRecordId != undefined) {
|
119
119
|
txProperties["__DATA_UNIT_ADAPTER__[parentRecordId]"] = request.parentRecordId;
|
120
120
|
}
|
121
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
122
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
123
|
+
return txProperties;
|
124
|
+
}
|
125
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
126
|
+
txProperties[name] = value;
|
127
|
+
});
|
121
128
|
return txProperties;
|
122
129
|
}
|
123
130
|
processRecords(dataUnit, fields, responseRecords) {
|
@@ -617,7 +617,7 @@ class DatasetStrategy {
|
|
617
617
|
tryJoinedFields: true,
|
618
618
|
parallelLoader: useParallelLoader,
|
619
619
|
crudListener: `br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,
|
620
|
-
txProperties: this.getTxProperties(
|
620
|
+
txProperties: this.getTxProperties(dataUnit, request, sorting),
|
621
621
|
useDefaultRowsLimit: false
|
622
622
|
}
|
623
623
|
};
|
@@ -628,10 +628,10 @@ class DatasetStrategy {
|
|
628
628
|
const moduleName = app.getModuleName();
|
629
629
|
return moduleName.replace("-bff", "");
|
630
630
|
}
|
631
|
-
getTxProperties(
|
631
|
+
getTxProperties(dataUnit, request, sorting) {
|
632
632
|
var _a, _b;
|
633
633
|
const txProperties = {
|
634
|
-
"__DATA_UNIT_ADAPTER__[dataUnitName]":
|
634
|
+
"__DATA_UNIT_ADAPTER__[dataUnitName]": dataUnit.name
|
635
635
|
};
|
636
636
|
const serverSideFilters = (_b = (_a = request.filters) === null || _a === void 0 ? void 0 : _a.filter(filter => !filter.name.startsWith("FILTRO_COLUNA_"))) !== null && _b !== void 0 ? _b : [];
|
637
637
|
if (serverSideFilters.length !== 0) {
|
@@ -643,6 +643,13 @@ class DatasetStrategy {
|
|
643
643
|
if (request.parentRecordId != undefined) {
|
644
644
|
txProperties["__DATA_UNIT_ADAPTER__[parentRecordId]"] = request.parentRecordId;
|
645
645
|
}
|
646
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
647
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
648
|
+
return txProperties;
|
649
|
+
}
|
650
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
651
|
+
txProperties[name] = value;
|
652
|
+
});
|
646
653
|
return txProperties;
|
647
654
|
}
|
648
655
|
processRecords(dataUnit, fields, responseRecords) {
|
@@ -972,6 +979,19 @@ class DataUnitFetcher {
|
|
972
979
|
});
|
973
980
|
});
|
974
981
|
}
|
982
|
+
addTransientProperties(dataUnit, updatingFields) {
|
983
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
984
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
985
|
+
return updatingFields;
|
986
|
+
}
|
987
|
+
if (updatingFields == undefined) {
|
988
|
+
updatingFields = {};
|
989
|
+
}
|
990
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
991
|
+
updatingFields[`transient.${name}`] = value;
|
992
|
+
});
|
993
|
+
return updatingFields;
|
994
|
+
}
|
975
995
|
saveData(dataUnit, duChanges) {
|
976
996
|
const updatedRecordsIds = [];
|
977
997
|
const addedRecordsIds = [];
|
@@ -980,7 +1000,7 @@ class DataUnitFetcher {
|
|
980
1000
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
981
1001
|
let parsedUpdatingFields;
|
982
1002
|
if (updatingFields) {
|
983
|
-
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
1003
|
+
parsedUpdatingFields = Object.entries(this.addTransientProperties(dataUnit, updatingFields)).map(([fieldName, value]) => {
|
984
1004
|
const descriptor = dataUnitInstance.getField(fieldName);
|
985
1005
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
986
1006
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
@@ -317,7 +317,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
317
317
|
return;
|
318
318
|
}
|
319
319
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
320
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
320
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId })), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "SnkConfigContainerSlot" }), h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
321
321
|
}
|
322
322
|
get _element() { return this; }
|
323
323
|
static get watchers() { return {
|
@@ -290,9 +290,14 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
290
290
|
}
|
291
291
|
return this.hasActiveValue(this.config);
|
292
292
|
}
|
293
|
+
onEzClick() {
|
294
|
+
console.log("onEzClick");
|
295
|
+
}
|
293
296
|
render() {
|
294
297
|
const leftIcon = this.getLeftIconName();
|
295
|
-
return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("
|
298
|
+
return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon ? h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" }) : undefined, h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" })), h("ez-split-button", { label: "Split Button", class: "ez-button--primary", mode: "label-icon", iconName: "acao", size: "small", onEzClick: this.onEzClick,
|
299
|
+
//onclick={this.onEzClick}
|
300
|
+
items: items }), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail }))));
|
296
301
|
}
|
297
302
|
get _filterItemElement() { return this; }
|
298
303
|
static get watchers() { return {
|
@@ -305,6 +310,47 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
305
310
|
"showUp": [64],
|
306
311
|
"hideDetail": [64]
|
307
312
|
}, [[2, "click", "clickListener"], [2, "mousedown", "mouseDownListener"], [0, "filterChange", "filterChangeListener"]]]);
|
313
|
+
const items = [
|
314
|
+
{
|
315
|
+
id: "1",
|
316
|
+
label: "Emitir NFe",
|
317
|
+
type: "item"
|
318
|
+
},
|
319
|
+
{
|
320
|
+
id: "2",
|
321
|
+
label: "Cancelar NFe",
|
322
|
+
type: "item"
|
323
|
+
},
|
324
|
+
{
|
325
|
+
id: "3",
|
326
|
+
label: "Exportar NFe",
|
327
|
+
type: "item",
|
328
|
+
children: [
|
329
|
+
{
|
330
|
+
id: "4",
|
331
|
+
label: "Danfe PDF",
|
332
|
+
type: "item",
|
333
|
+
children: [
|
334
|
+
{
|
335
|
+
id: "6",
|
336
|
+
label: "Modo retrato",
|
337
|
+
type: "item"
|
338
|
+
},
|
339
|
+
{
|
340
|
+
id: "7",
|
341
|
+
label: "Modo paisagem",
|
342
|
+
type: "item"
|
343
|
+
}
|
344
|
+
]
|
345
|
+
},
|
346
|
+
{
|
347
|
+
id: "5",
|
348
|
+
label: "XML",
|
349
|
+
type: "item"
|
350
|
+
}
|
351
|
+
]
|
352
|
+
}
|
353
|
+
];
|
308
354
|
function defineCustomElement() {
|
309
355
|
if (typeof customElements === "undefined") {
|
310
356
|
return;
|
@@ -239,7 +239,7 @@ class DatasetStrategy {
|
|
239
239
|
tryJoinedFields: true,
|
240
240
|
parallelLoader: useParallelLoader,
|
241
241
|
crudListener: `br.com.sankhya.bff.${this.getModuleName()}.BFFDataUnitDatasetAdapter`,
|
242
|
-
txProperties: this.getTxProperties(
|
242
|
+
txProperties: this.getTxProperties(dataUnit, request, sorting),
|
243
243
|
useDefaultRowsLimit: false
|
244
244
|
}
|
245
245
|
};
|
@@ -250,10 +250,10 @@ class DatasetStrategy {
|
|
250
250
|
const moduleName = app.getModuleName();
|
251
251
|
return moduleName.replace("-bff", "");
|
252
252
|
}
|
253
|
-
getTxProperties(
|
253
|
+
getTxProperties(dataUnit, request, sorting) {
|
254
254
|
var _a, _b;
|
255
255
|
const txProperties = {
|
256
|
-
"__DATA_UNIT_ADAPTER__[dataUnitName]":
|
256
|
+
"__DATA_UNIT_ADAPTER__[dataUnitName]": dataUnit.name
|
257
257
|
};
|
258
258
|
const serverSideFilters = (_b = (_a = request.filters) === null || _a === void 0 ? void 0 : _a.filter(filter => !filter.name.startsWith("FILTRO_COLUNA_"))) !== null && _b !== void 0 ? _b : [];
|
259
259
|
if (serverSideFilters.length !== 0) {
|
@@ -265,6 +265,13 @@ class DatasetStrategy {
|
|
265
265
|
if (request.parentRecordId != undefined) {
|
266
266
|
txProperties["__DATA_UNIT_ADAPTER__[parentRecordId]"] = request.parentRecordId;
|
267
267
|
}
|
268
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
269
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
270
|
+
return txProperties;
|
271
|
+
}
|
272
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
273
|
+
txProperties[name] = value;
|
274
|
+
});
|
268
275
|
return txProperties;
|
269
276
|
}
|
270
277
|
processRecords(dataUnit, fields, responseRecords) {
|
@@ -594,6 +601,19 @@ class DataUnitFetcher {
|
|
594
601
|
});
|
595
602
|
});
|
596
603
|
}
|
604
|
+
addTransientProperties(dataUnit, updatingFields) {
|
605
|
+
const loaderProps = dataUnit.getGlobalLoaderProps();
|
606
|
+
if (loaderProps == undefined || loaderProps.size === 0) {
|
607
|
+
return updatingFields;
|
608
|
+
}
|
609
|
+
if (updatingFields == undefined) {
|
610
|
+
updatingFields = {};
|
611
|
+
}
|
612
|
+
Array.from(loaderProps.entries()).forEach(([name, value]) => {
|
613
|
+
updatingFields[`transient.${name}`] = value;
|
614
|
+
});
|
615
|
+
return updatingFields;
|
616
|
+
}
|
597
617
|
saveData(dataUnit, duChanges) {
|
598
618
|
const updatedRecordsIds = [];
|
599
619
|
const addedRecordsIds = [];
|
@@ -602,7 +622,7 @@ class DataUnitFetcher {
|
|
602
622
|
const dataUnitInstance = DataUnitStorage.get(changeDU);
|
603
623
|
let parsedUpdatingFields;
|
604
624
|
if (updatingFields) {
|
605
|
-
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
625
|
+
parsedUpdatingFields = Object.entries(this.addTransientProperties(dataUnit, updatingFields)).map(([fieldName, value]) => {
|
606
626
|
const descriptor = dataUnitInstance.getField(fieldName);
|
607
627
|
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
608
628
|
return { fieldName, dataType, value: dataUnitInstance.valueToString(fieldName, value) };
|
@@ -7,7 +7,7 @@ import './index-0ece87a6.js';
|
|
7
7
|
import './ISave-4412b20c.js';
|
8
8
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
9
9
|
import '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
10
|
-
import './dataunit-fetcher-
|
10
|
+
import './dataunit-fetcher-0fc935a0.js';
|
11
11
|
import './PreloadManager-c1c2f2b4.js';
|
12
12
|
import './filter-item-type.enum-d45e026f.js';
|
13
13
|
import './form-config-fetcher-36219cd3.js';
|