@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-77074.0 → 0.0.0-bugfix-dev-KB-78131.0
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/{SnkMessageBuilder-7691a2c1.js → SnkMessageBuilder-bae64d0d.js} +0 -10
- package/dist/cjs/index-f9e81701.js +0 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +25 -22
- package/dist/cjs/snk-application.cjs.entry.js +18 -2
- package/dist/cjs/snk-config-options_3.cjs.entry.js +17 -5
- package/dist/cjs/snk-crud.cjs.entry.js +8 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-7dbdad0e.js → snk-data-unit-3d9b6ed4.js} +26 -14
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +2 -2
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +9 -0
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -1
- package/dist/cjs/snk-grid.cjs.entry.js +10 -2
- package/dist/cjs/{snk-guides-viewer-eee43c8b.js → snk-guides-viewer-c2e64f68.js} +2 -2
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +7 -4
- package/dist/cjs/snk-taskbar.cjs.entry.js +40 -37
- package/dist/collection/collection-manifest.json +0 -3
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -26
- package/dist/collection/components/snk-application/snk-application.js +41 -1
- package/dist/collection/components/snk-crud/snk-crud.js +26 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +1 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +25 -13
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +2 -1
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +8 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +5 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +20 -0
- package/dist/collection/components/snk-form-config/snk-form-config.js +17 -5
- package/dist/collection/components/snk-grid/snk-grid.js +28 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +25 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +41 -38
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +7 -1
- package/dist/collection/lib/message/SnkMessageBuilder.js +0 -2
- package/dist/components/SnkMessageBuilder.js +0 -10
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.js +0 -3
- package/dist/components/snk-actions-button2.js +27 -26
- package/dist/components/snk-application2.js +19 -2
- package/dist/components/snk-crud.js +9 -2
- package/dist/components/snk-data-unit2.js +25 -13
- package/dist/components/snk-detail-view2.js +2 -2
- package/dist/components/snk-filter-bar2.js +6 -0
- package/dist/components/snk-filter-item2.js +5 -1
- package/dist/components/snk-filter-text.js +2 -1
- package/dist/components/snk-form-config2.js +17 -5
- package/dist/components/snk-grid2.js +11 -2
- package/dist/components/snk-simple-crud2.js +8 -4
- package/dist/components/snk-taskbar2.js +41 -38
- package/dist/esm/{SnkMessageBuilder-7ace6803.js → SnkMessageBuilder-6fff4a4c.js} +0 -10
- package/dist/esm/index-a7d3d3f1.js +0 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +26 -23
- package/dist/esm/snk-application.entry.js +19 -3
- package/dist/esm/snk-config-options_3.entry.js +17 -5
- package/dist/esm/snk-crud.entry.js +8 -2
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-7a579dbd.js → snk-data-unit-9fa7d2b9.js} +26 -14
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +2 -2
- package/dist/esm/snk-filter-bar_4.entry.js +10 -1
- package/dist/esm/snk-filter-text.entry.js +2 -1
- package/dist/esm/snk-grid.entry.js +10 -2
- package/dist/esm/{snk-guides-viewer-e8ca764a.js → snk-guides-viewer-3e56f2c0.js} +2 -2
- package/dist/esm/snk-guides-viewer.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +7 -4
- package/dist/esm/snk-taskbar.entry.js +41 -38
- package/dist/sankhyablocks/{p-f4e221b2.entry.js → p-0d2a2e9e.entry.js} +1 -1
- package/dist/sankhyablocks/p-17425c72.js +1 -0
- package/dist/sankhyablocks/p-1d3ce0d9.entry.js +1 -0
- package/dist/sankhyablocks/p-342eeb3b.js +1 -0
- package/dist/sankhyablocks/p-3728d2aa.entry.js +11 -0
- package/dist/sankhyablocks/p-40ec3105.entry.js +1 -0
- package/dist/sankhyablocks/p-4e1f992e.entry.js +1 -0
- package/dist/sankhyablocks/p-619aeac8.entry.js +1 -0
- package/dist/sankhyablocks/{p-00f9fe5c.entry.js → p-7075b789.entry.js} +1 -1
- package/dist/sankhyablocks/p-89c92727.entry.js +1 -0
- package/dist/sankhyablocks/{p-42130213.entry.js → p-9abaa4ab.entry.js} +1 -1
- package/dist/sankhyablocks/p-a3fadd0b.entry.js +1 -0
- package/dist/sankhyablocks/p-af7f7b3e.entry.js +1 -0
- package/dist/sankhyablocks/{p-b389ed49.entry.js → p-d5db32d1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e3a285a2.js → p-e89dea18.js} +1 -1
- package/dist/sankhyablocks/p-ec43fcc8.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/interfaces/index.d.ts +3 -0
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +3 -2
- package/dist/types/components/snk-application/snk-application.d.ts +6 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +2 -0
- package/dist/types/components.d.ts +31 -393
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +0 -3
- package/react/components.js +0 -3
- package/react/components.js.map +1 -1
- package/dist/cjs/input-distinct-search_2.cjs.entry.js +0 -469
- package/dist/cjs/snk-distinct-search.cjs.entry.js +0 -123
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.css +0 -4
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.js +0 -372
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.css +0 -109
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +0 -542
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +0 -27
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +0 -600
- package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +0 -13
- package/dist/collection/lib/http/data-fetcher/fetchers/distinct-search-fetcher.js +0 -25
- package/dist/collection/lib/message/resources/snk-distinct-search.msg.js +0 -9
- package/dist/components/filter-distinct-search.js +0 -15
- package/dist/components/input-distinct-search.d.ts +0 -11
- package/dist/components/input-distinct-search.js +0 -6
- package/dist/components/input-distinct-search2.js +0 -262
- package/dist/components/search-modal.d.ts +0 -11
- package/dist/components/search-modal.js +0 -6
- package/dist/components/search-modal2.js +0 -264
- package/dist/components/snk-distinct-search.d.ts +0 -11
- package/dist/components/snk-distinct-search.js +0 -163
- package/dist/esm/input-distinct-search_2.entry.js +0 -464
- package/dist/esm/snk-distinct-search.entry.js +0 -119
- package/dist/sankhyablocks/p-0e250436.entry.js +0 -1
- package/dist/sankhyablocks/p-154aa2a6.entry.js +0 -11
- package/dist/sankhyablocks/p-18cb1acb.entry.js +0 -1
- package/dist/sankhyablocks/p-1dbd5c18.entry.js +0 -1
- package/dist/sankhyablocks/p-2aae03a1.entry.js +0 -1
- package/dist/sankhyablocks/p-30ebcbe0.entry.js +0 -1
- package/dist/sankhyablocks/p-37074cc3.entry.js +0 -1
- package/dist/sankhyablocks/p-3858a2e4.entry.js +0 -1
- package/dist/sankhyablocks/p-563b7c28.entry.js +0 -1
- package/dist/sankhyablocks/p-96a89d58.entry.js +0 -1
- package/dist/sankhyablocks/p-c75fae8e.js +0 -1
- package/dist/sankhyablocks/p-d8665750.js +0 -1
- package/dist/sankhyablocks/p-f0aaad2b.entry.js +0 -1
- package/dist/types/components/snk-distinct-search/snk-distinct-search.d.ts +0 -83
- package/dist/types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.d.ts +0 -105
- package/dist/types/components/snk-distinct-search/subcomponents/search-modal/search-modal.d.ts +0 -126
- package/dist/types/components/snk-distinct-search/types/index.d.ts +0 -8
- package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +0 -3
- package/dist/types/lib/http/data-fetcher/fetchers/distinct-search-fetcher.d.ts +0 -6
- package/dist/types/lib/message/resources/snk-distinct-search.msg.d.ts +0 -2
- /package/dist/collection/components/{snk-distinct-search/types → snk-actions-button/interfaces}/index.js +0 -0
|
@@ -4,9 +4,9 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
|
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher-5034df59.js';
|
|
6
6
|
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher-ca5d3a49.js';
|
|
7
|
-
import { D as DataUnitFetcher } from './dataunit-fetcher-56cb648b.js';
|
|
7
|
+
import { P as PreloadManager, D as DataUnitFetcher } from './dataunit-fetcher-56cb648b.js';
|
|
8
8
|
import { P as PesquisaFetcher } from './pesquisa-fetcher-6bc2e41a.js';
|
|
9
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
9
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
|
10
10
|
import './form-config-fetcher-a7d3e277.js';
|
|
11
11
|
import './filter-item-type.enum-d45e026f.js';
|
|
12
12
|
import './PrintUtils-3e4ff0f5.js';
|
|
@@ -28,6 +28,7 @@ const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_
|
|
|
28
28
|
class ParametersFetcher {
|
|
29
29
|
constructor() {
|
|
30
30
|
this._embeddedParams = new Map();
|
|
31
|
+
this._cachedParams = new Map();
|
|
31
32
|
this.templateByQuery = new Map();
|
|
32
33
|
try {
|
|
33
34
|
if (window["MGE_PARAMS"] != undefined) {
|
|
@@ -57,11 +58,16 @@ class ParametersFetcher {
|
|
|
57
58
|
if (this._embeddedParams.has(name)) {
|
|
58
59
|
return Promise.resolve(this._embeddedParams.get(name));
|
|
59
60
|
}
|
|
61
|
+
if (this._cachedParams.has(name)) {
|
|
62
|
+
return this._cachedParams.get(name);
|
|
63
|
+
}
|
|
60
64
|
const completPath = `param://application?params=${name}`;
|
|
61
|
-
|
|
65
|
+
const param = await DataFetcher.get().callGraphQL({
|
|
62
66
|
values: { name: completPath },
|
|
63
67
|
query: this.templateByQuery.get("fetchParam"),
|
|
64
68
|
});
|
|
69
|
+
this._cachedParams.set(name, param);
|
|
70
|
+
return param;
|
|
65
71
|
}
|
|
66
72
|
async asString(name) {
|
|
67
73
|
const paramArr = await this.getParam(name);
|
|
@@ -875,6 +881,16 @@ const SnkApplication = class {
|
|
|
875
881
|
async isLoadedByPk() {
|
|
876
882
|
return Promise.resolve(this._isLoadedByPk);
|
|
877
883
|
}
|
|
884
|
+
/**
|
|
885
|
+
* Remove registro do cache do PreLoader do dataunit.
|
|
886
|
+
* Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
|
|
887
|
+
*/
|
|
888
|
+
async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
|
|
889
|
+
const records = recordsIDs.map(id => {
|
|
890
|
+
return { "__record__id__": id };
|
|
891
|
+
});
|
|
892
|
+
PreloadManager.removeRecords(dataUnit, records);
|
|
893
|
+
}
|
|
878
894
|
async getAuthList(auth) {
|
|
879
895
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
|
880
896
|
}
|
|
@@ -1045,7 +1045,7 @@ const SnkFormConfig = class {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
getLayoutFormConfig() {
|
|
1048
|
-
var _a, _b;
|
|
1048
|
+
var _a, _b, _c;
|
|
1049
1049
|
if (((_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.fields) == undefined) {
|
|
1050
1050
|
return;
|
|
1051
1051
|
}
|
|
@@ -1058,7 +1058,11 @@ const SnkFormConfig = class {
|
|
|
1058
1058
|
if (hasField == undefined) {
|
|
1059
1059
|
fields.push(field);
|
|
1060
1060
|
const fieldMD = this.dataUnit.getField(field.name);
|
|
1061
|
-
|
|
1061
|
+
/**
|
|
1062
|
+
* Quando um campo é ocultado pelo dev, mas queremos manter ele na config precisamos fazer essa tratativa.
|
|
1063
|
+
*/
|
|
1064
|
+
const visibleOnConfig = ((_b = fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.properties) === null || _b === void 0 ? void 0 : _b.visibleOnConfig) === true && (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.visible) === false;
|
|
1065
|
+
if ((fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.visible) || visibleOnConfig) {
|
|
1062
1066
|
if (field.label == undefined || field.label === "") {
|
|
1063
1067
|
field.label = fieldMD.label;
|
|
1064
1068
|
}
|
|
@@ -1074,7 +1078,7 @@ const SnkFormConfig = class {
|
|
|
1074
1078
|
visible = configTabs[0].visible;
|
|
1075
1079
|
}
|
|
1076
1080
|
}
|
|
1077
|
-
const tabLabel = ((
|
|
1081
|
+
const tabLabel = ((_c = field.tab) === null || _c === void 0 ? void 0 : _c.label) || field.tab;
|
|
1078
1082
|
if (visible !== null) {
|
|
1079
1083
|
tab = { tab: tabLabel, groups: [], visible };
|
|
1080
1084
|
}
|
|
@@ -1159,8 +1163,16 @@ const SnkFormConfig = class {
|
|
|
1159
1163
|
for (const field of this._formConfig.fields) {
|
|
1160
1164
|
fieldsFormConfig.push(field);
|
|
1161
1165
|
}
|
|
1162
|
-
const listFieldsAvailable = fieldsMetadata.filter(({ name: _nameFieldMetadado, visible: _visibleMetadado }) =>
|
|
1163
|
-
|
|
1166
|
+
const listFieldsAvailable = fieldsMetadata.filter(({ name: _nameFieldMetadado, visible: _visibleMetadado, properties }) => {
|
|
1167
|
+
const hasCfg = fieldsFormConfig.some(({ name: _nameFieldForm }) => _nameFieldForm === _nameFieldMetadado);
|
|
1168
|
+
/**
|
|
1169
|
+
* Quando a visibilidade de um campo é alterada pelo dataunit, mas o desenvolvedor deseja que o mesmo continue
|
|
1170
|
+
* sendo apresentado no configurador, precisamos fazer essa tratativa, verificando se o campo não tem configuração
|
|
1171
|
+
*/
|
|
1172
|
+
if (!hasCfg && properties.visibleOnConfig === true && !_visibleMetadado)
|
|
1173
|
+
return properties.visibleOnConfig;
|
|
1174
|
+
return _visibleMetadado === true && hasCfg === false;
|
|
1175
|
+
});
|
|
1164
1176
|
this._fieldsAvailable = listFieldsAvailable;
|
|
1165
1177
|
this._listEnabledFields = listFieldsAvailable;
|
|
1166
1178
|
if (((_b = this._filterFieldsAvailable) === null || _b === void 0 ? void 0 : _b.value) != undefined) {
|
|
@@ -59,6 +59,7 @@ const SnkCrud = class {
|
|
|
59
59
|
this.enableGridInsert = false;
|
|
60
60
|
this.domainMessagesBuilder = undefined;
|
|
61
61
|
this.ignoreReadOnlyFormFields = undefined;
|
|
62
|
+
this.enableLockManger = false;
|
|
62
63
|
this.setCustomFormTitle = undefined;
|
|
63
64
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
64
65
|
}
|
|
@@ -299,11 +300,16 @@ const SnkCrud = class {
|
|
|
299
300
|
if (!isDocumentBody)
|
|
300
301
|
element.focus();
|
|
301
302
|
}
|
|
303
|
+
async function handleAddRecord() {
|
|
304
|
+
if (!dataUnit.hasNewRecord()) {
|
|
305
|
+
dataUnit.addRecord();
|
|
306
|
+
}
|
|
307
|
+
}
|
|
302
308
|
keyboardManager
|
|
303
309
|
.bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
|
|
304
310
|
.bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
305
311
|
.bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
306
|
-
.bind("F8",
|
|
312
|
+
.bind("F8", handleAddRecord.bind(this), { description: "Adiciona um novo registro.", element: this._element })
|
|
307
313
|
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
308
314
|
.bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
309
315
|
.bind("ctrl + .", () => {
|
|
@@ -400,7 +406,7 @@ const SnkCrud = class {
|
|
|
400
406
|
return;
|
|
401
407
|
}
|
|
402
408
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
403
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item",
|
|
409
|
+
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", { class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full ez-padding--small' }, h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "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, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManger: this.enableLockManger }, 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, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields }, 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" }))));
|
|
404
410
|
}
|
|
405
411
|
get _element() { return getElement(this); }
|
|
406
412
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
|
|
|
4
4
|
import { D as DataExporterOption, a as DataExporterType, b as DataExporterFormat } from './index-3aa4977a.js';
|
|
5
5
|
import { R as REPORT_LAUNCHER_RESOURCE_ID } from './constants-7302ee87.js';
|
|
6
6
|
import { D as DataFetcher } from './DataFetcher-5034df59.js';
|
|
7
|
-
import { S as SnkDataUnit } from './snk-data-unit-
|
|
7
|
+
import { S as SnkDataUnit } from './snk-data-unit-9fa7d2b9.js';
|
|
8
8
|
import './pesquisa-fetcher-6bc2e41a.js';
|
|
9
9
|
import './ISave-d8c8bc59.js';
|
|
10
10
|
import '@sankhyalabs/ezui/dist/collection/utils/constants';
|
|
@@ -13,7 +13,7 @@ import './dataunit-fetcher-56cb648b.js';
|
|
|
13
13
|
import './filter-item-type.enum-d45e026f.js';
|
|
14
14
|
import './form-config-fetcher-a7d3e277.js';
|
|
15
15
|
import './PrintUtils-3e4ff0f5.js';
|
|
16
|
-
import './SnkMessageBuilder-
|
|
16
|
+
import './SnkMessageBuilder-6fff4a4c.js';
|
|
17
17
|
import '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
18
18
|
import './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
19
19
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement, H as Host } from './index-a7d3d3f1.js';
|
|
2
2
|
import { Action, ObjectUtils, DataUnitAction, StringUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
-
import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
4
|
+
import { O as OperationMap, S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
|
5
5
|
import { g as getRecordValue, a as DatasetStrategy } from './dataunit-fetcher-56cb648b.js';
|
|
6
6
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
7
7
|
import { g as getSelectedRecordsIDsInfo } from './GetSelectedRecordsIDsInfo-9fa41508.js';
|
|
@@ -23,7 +23,7 @@ const SnkDataUnit = class {
|
|
|
23
23
|
this._rowMetadataCache = new Map();
|
|
24
24
|
this.REGEX_DATAUNIT_NAME = /dd:\/\/(.+?)\//;
|
|
25
25
|
this._dataUnitObserver = async (action) => {
|
|
26
|
-
const duState = this.buildDataState(action.type);
|
|
26
|
+
const duState = await this.buildDataState(action.type);
|
|
27
27
|
this.dataState = duState;
|
|
28
28
|
this.messagesBuilder.currentOperation = this.getMessageOperation();
|
|
29
29
|
switch (action.type) {
|
|
@@ -135,14 +135,22 @@ const SnkDataUnit = class {
|
|
|
135
135
|
async getRowMetadata(record) {
|
|
136
136
|
return this.doGetRowMetadata(record);
|
|
137
137
|
}
|
|
138
|
-
doGetRowMetadata(record) {
|
|
138
|
+
async doGetRowMetadata(record) {
|
|
139
139
|
const selectedRecord = this.dataUnit.getSelectedRecord();
|
|
140
140
|
if (!record && !selectedRecord) {
|
|
141
141
|
return;
|
|
142
142
|
}
|
|
143
143
|
const currentRecord = record || selectedRecord;
|
|
144
144
|
const recordId = typeof currentRecord === 'string' ? currentRecord : currentRecord.__record__id__;
|
|
145
|
-
|
|
145
|
+
let rowMetadata = this._metadataByRow.get(recordId);
|
|
146
|
+
/*
|
|
147
|
+
Nao fazemos cache de metadataByRow pra registros novos, pois a chave do mesmo
|
|
148
|
+
muda ao ser salvo, por isso essa tratativa é necessária para que o dataState fique com metadados
|
|
149
|
+
corretos nao confiando apenas no _metadataByRow
|
|
150
|
+
*/
|
|
151
|
+
if (this.dataUnit.isNewRecord(recordId) && !rowMetadata) {
|
|
152
|
+
rowMetadata = await this.handleLoadRowMetadata(selectedRecord);
|
|
153
|
+
}
|
|
146
154
|
if (!rowMetadata) {
|
|
147
155
|
return;
|
|
148
156
|
}
|
|
@@ -336,7 +344,7 @@ const SnkDataUnit = class {
|
|
|
336
344
|
case Action.RECORDS_COPIED:
|
|
337
345
|
return this.interceptRecordsCopied(action);
|
|
338
346
|
case Action.DATA_CHANGED:
|
|
339
|
-
await this.handleLoadRowMetadata(action);
|
|
347
|
+
await this.handleLoadRowMetadata(action.payload);
|
|
340
348
|
return await this.interceptDataChange(action);
|
|
341
349
|
case Action.CHANGING_DATA:
|
|
342
350
|
return await this.interceptDataChange(action);
|
|
@@ -356,8 +364,9 @@ const SnkDataUnit = class {
|
|
|
356
364
|
return action;
|
|
357
365
|
}
|
|
358
366
|
}
|
|
359
|
-
async handleLoadRowMetadata(
|
|
360
|
-
|
|
367
|
+
async handleLoadRowMetadata(record) {
|
|
368
|
+
if (!record)
|
|
369
|
+
return;
|
|
361
370
|
const keysPayload = Object.keys(record);
|
|
362
371
|
const rmpField = keysPayload.find((field) => this._fieldsWithRmp.includes(field));
|
|
363
372
|
if (rmpField) {
|
|
@@ -436,7 +445,7 @@ const SnkDataUnit = class {
|
|
|
436
445
|
isAllowed(flag) {
|
|
437
446
|
return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
|
|
438
447
|
}
|
|
439
|
-
buildDataState(actionType) {
|
|
448
|
+
async buildDataState(actionType) {
|
|
440
449
|
var _a;
|
|
441
450
|
const selectionInfo = this.dataUnit.getSelectionInfo();
|
|
442
451
|
const isStartingInsertionMode = (this.dataUnit.hasDirtyRecords() || this.dataUnit.hasWaitingChanges()) && (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isEmpty());
|
|
@@ -444,7 +453,7 @@ const SnkDataUnit = class {
|
|
|
444
453
|
let rowMetadata = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata;
|
|
445
454
|
const allowedOverwrite = [Action.SELECTION_CHANGED, Action.EDITION_CANCELED, Action.NEXT_SELECTED, Action.PREVIOUS_SELECTED];
|
|
446
455
|
if (selectedRecord && (!rowMetadata || allowedOverwrite.includes(actionType))) {
|
|
447
|
-
rowMetadata = this.doGetRowMetadata(selectedRecord);
|
|
456
|
+
rowMetadata = await this.doGetRowMetadata(selectedRecord);
|
|
448
457
|
}
|
|
449
458
|
else if (rowMetadata) {
|
|
450
459
|
rowMetadata.getProp = this.buildGetPropRowMetadata(rowMetadata);
|
|
@@ -466,17 +475,20 @@ const SnkDataUnit = class {
|
|
|
466
475
|
});
|
|
467
476
|
}
|
|
468
477
|
async handleDataSaved(action) {
|
|
469
|
-
|
|
478
|
+
var _a, _b, _c;
|
|
479
|
+
const newRowMetadata = await this.handleLoadRowMetadata((_c = (_b = (_a = action === null || action === void 0 ? void 0 : action.payload) === null || _a === void 0 ? void 0 : _a.changes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.record);
|
|
470
480
|
if (newRowMetadata) {
|
|
471
481
|
newRowMetadata.getProp = this.buildGetPropRowMetadata(newRowMetadata);
|
|
472
482
|
}
|
|
473
483
|
const recordId = action.payload.records[0].__record__id__;
|
|
474
484
|
this._metadataByRow.set(recordId, newRowMetadata);
|
|
475
|
-
this.dataState = this.buildDataState();
|
|
476
|
-
|
|
485
|
+
this.dataState = await this.buildDataState();
|
|
486
|
+
let saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
|
487
|
+
if (saveOperation == 'copy')
|
|
488
|
+
saveOperation = OperationMap.CLONE;
|
|
489
|
+
if (this.ignoreSaveMessage && ![OperationMap.CLONE, OperationMap.INSERT].includes(saveOperation)) {
|
|
477
490
|
return;
|
|
478
491
|
}
|
|
479
|
-
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
|
480
492
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
|
481
493
|
if (msg != undefined) {
|
|
482
494
|
this.showSuccessMessage(msg);
|
|
@@ -569,7 +581,7 @@ const SnkDataUnit = class {
|
|
|
569
581
|
const { records } = this.getMetadataByRow(this.dataUnit);
|
|
570
582
|
this.dataUnit.records = records;
|
|
571
583
|
}
|
|
572
|
-
this.dataState = this.buildDataState();
|
|
584
|
+
this.dataState = await this.buildDataState();
|
|
573
585
|
let resolver;
|
|
574
586
|
while (resolver = this._onDataUnitResolve.pop()) {
|
|
575
587
|
resolver(this.dataUnit);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { S as snk_data_unit } from './snk-data-unit-
|
|
1
|
+
export { S as snk_data_unit } from './snk-data-unit-9fa7d2b9.js';
|
|
2
2
|
import './index-a7d3d3f1.js';
|
|
3
3
|
import '@sankhyalabs/core';
|
|
4
4
|
import '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import './SnkMessageBuilder-
|
|
5
|
+
import './SnkMessageBuilder-6fff4a4c.js';
|
|
6
6
|
import './dataunit-fetcher-56cb648b.js';
|
|
7
7
|
import './DataFetcher-5034df59.js';
|
|
8
8
|
import './PrintUtils-3e4ff0f5.js';
|
|
@@ -13,8 +13,8 @@ import './filter-item-type.enum-d45e026f.js';
|
|
|
13
13
|
import './form-config-fetcher-a7d3e277.js';
|
|
14
14
|
import { T as TaskbarElement } from './taskbar-elements-d59867f1.js';
|
|
15
15
|
import { V as VIEW_MODE } from './constants-7302ee87.js';
|
|
16
|
-
import { S as SnkGuidesViewer } from './snk-guides-viewer-
|
|
17
|
-
import { S as SnkMessageBuilder } from './SnkMessageBuilder-
|
|
16
|
+
import { S as SnkGuidesViewer } from './snk-guides-viewer-3e56f2c0.js';
|
|
17
|
+
import { S as SnkMessageBuilder } from './SnkMessageBuilder-6fff4a4c.js';
|
|
18
18
|
import './ConfigStorage-6514d66e.js';
|
|
19
19
|
import './PrintUtils-3e4ff0f5.js';
|
|
20
20
|
import '@sankhyalabs/ezui/dist/collection/components/ez-grid/utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
|
2
|
-
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, FloatingManager, DateUtils, ArrayUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { DataType, StringUtils, ObjectUtils, ElementIDUtils, ErrorException, ApplicationContext, FloatingManager, DateUtils, MaskFormatter, ArrayUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage-6514d66e.js';
|
|
5
5
|
import { toString } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
@@ -286,6 +286,7 @@ const SnkFilterBar = class {
|
|
|
286
286
|
this.disablePersonalizedFilter = undefined;
|
|
287
287
|
this.filterBarLegacyConfigName = undefined;
|
|
288
288
|
this.autoLoad = undefined;
|
|
289
|
+
this.afterApplyConfig = undefined;
|
|
289
290
|
this.allowDefault = undefined;
|
|
290
291
|
this.scrollerLocked = false;
|
|
291
292
|
this.showPersonalizedFilter = false;
|
|
@@ -421,6 +422,7 @@ const SnkFilterBar = class {
|
|
|
421
422
|
return this.filterConfig.find(item => item.type === FilterItemType.PERSONALIZED);
|
|
422
423
|
}
|
|
423
424
|
async processAfterUpdateConfig() {
|
|
425
|
+
var _a;
|
|
424
426
|
if (this._loadingPending) {
|
|
425
427
|
if (await this._application.isLoadedByPk() && !this._configUpdated)
|
|
426
428
|
return;
|
|
@@ -435,6 +437,7 @@ const SnkFilterBar = class {
|
|
|
435
437
|
if (this._configUpdated) {
|
|
436
438
|
this._configUpdated = false;
|
|
437
439
|
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
|
|
440
|
+
(_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
438
441
|
}
|
|
439
442
|
}
|
|
440
443
|
async doLoadData(forceReload = false) {
|
|
@@ -639,7 +642,9 @@ const SnkFilterBar = class {
|
|
|
639
642
|
*/
|
|
640
643
|
async showFilterModal() {
|
|
641
644
|
const callbackOnApplyFilter = (filters) => {
|
|
645
|
+
var _a;
|
|
642
646
|
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
|
647
|
+
(_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
643
648
|
};
|
|
644
649
|
let filtersConfigCopy = ObjectUtils.copy(this.filterConfig);
|
|
645
650
|
filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
|
|
@@ -933,6 +938,10 @@ const SnkFilterItem = class {
|
|
|
933
938
|
return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
|
|
934
939
|
}
|
|
935
940
|
}
|
|
941
|
+
if (this.config.mask) {
|
|
942
|
+
const _maskFormatter = new MaskFormatter(this.config.mask);
|
|
943
|
+
return `${label}: ${_maskFormatter.format(value)}`;
|
|
944
|
+
}
|
|
936
945
|
return `${label}: ${value}`;
|
|
937
946
|
}
|
|
938
947
|
return label;
|
|
@@ -21,10 +21,11 @@ const SnkFilterText = class {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
render() {
|
|
24
|
+
var _a;
|
|
24
25
|
if (!this.config) {
|
|
25
26
|
return undefined;
|
|
26
27
|
}
|
|
27
|
-
return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value }));
|
|
28
|
+
return (h("ez-text-input", { id: this.config.id, ref: ref => this._textInputElement = ref, label: this.config.label, value: this.config.value, mask: (_a = this.config) === null || _a === void 0 ? void 0 : _a.mask, cleanValueMask: true }));
|
|
28
29
|
}
|
|
29
30
|
get _element() { return getElement(this); }
|
|
30
31
|
};
|
|
@@ -142,6 +142,7 @@ const SnkGrid = class {
|
|
|
142
142
|
this.autoLoad = undefined;
|
|
143
143
|
this.autoFocus = true;
|
|
144
144
|
this.enableGridInsert = false;
|
|
145
|
+
this.enableLockManger = false;
|
|
145
146
|
}
|
|
146
147
|
/**
|
|
147
148
|
* Exibe a janela de configurações da grade.
|
|
@@ -229,10 +230,17 @@ const SnkGrid = class {
|
|
|
229
230
|
this._grid.setFocus();
|
|
230
231
|
}
|
|
231
232
|
async handleClick(event) {
|
|
233
|
+
var _a;
|
|
232
234
|
if (this.hasToBlockEvent(event)) {
|
|
233
235
|
event.preventDefault();
|
|
234
236
|
event.stopPropagation();
|
|
235
|
-
await this._dataUnit.cancelEdition()
|
|
237
|
+
if (!await this._dataUnit.cancelEdition())
|
|
238
|
+
return;
|
|
239
|
+
const newEvent = new event.constructor(event.type, event);
|
|
240
|
+
(_a = event.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(newEvent);
|
|
241
|
+
}
|
|
242
|
+
if (this._grid && !this._grid.contains(event.target)) {
|
|
243
|
+
this._grid.stopEdit();
|
|
236
244
|
}
|
|
237
245
|
}
|
|
238
246
|
hasToBlockEvent(event) {
|
|
@@ -523,7 +531,7 @@ const SnkGrid = class {
|
|
|
523
531
|
return undefined;
|
|
524
532
|
}
|
|
525
533
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
|
526
|
-
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, 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.resourceID }))));
|
|
534
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, 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.resourceID }))));
|
|
527
535
|
}
|
|
528
536
|
get _element() { return getElement(this); }
|
|
529
537
|
static get watchers() { return {
|
|
@@ -16,7 +16,7 @@ import './filter-item-type.enum-d45e026f.js';
|
|
|
16
16
|
import './form-config-fetcher-a7d3e277.js';
|
|
17
17
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
|
18
18
|
|
|
19
|
-
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--
|
|
19
|
+
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--medium, 12px);--snk-guides-viewer--space-small:var(--space--2xs, 8px);--snk-guides-viewer__header--min-height:68px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-small);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-small)}.snk-guides-viewer__header-breadcrumb.sc-snk-guides-viewer{width:25%;display:flex}.snk-guides-viewer__header-taskbar.sc-snk-guides-viewer{width:75%}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-small));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-small))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
|
20
20
|
|
|
21
21
|
const FORM_NAME_PREFIX = "__FORM:";
|
|
22
22
|
const SnkGuidesViewer = class {
|
|
@@ -454,7 +454,7 @@ const SnkGuidesViewer = class {
|
|
|
454
454
|
await this.openGuideNavigator(guideName);
|
|
455
455
|
}
|
|
456
456
|
if (action.type === Action.METADATA_LOADED) {
|
|
457
|
-
this.loadGuides(
|
|
457
|
+
this.loadGuides(this.noGuideSelected());
|
|
458
458
|
}
|
|
459
459
|
}
|
|
460
460
|
async addErrorBadgeToGuide(guideName) {
|
|
@@ -117,6 +117,7 @@ const SnkSimpleCrud = class {
|
|
|
117
117
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
|
118
118
|
this.gridConfig = undefined;
|
|
119
119
|
this.formConfig = undefined;
|
|
120
|
+
this.enableLockManger = false;
|
|
120
121
|
this._formFields = [];
|
|
121
122
|
this._fieldsProps = new Map();
|
|
122
123
|
this._enableContinuousInsert = true;
|
|
@@ -801,16 +802,18 @@ const SnkSimpleCrud = class {
|
|
|
801
802
|
return;
|
|
802
803
|
this.goToView(VIEW_MODE.FORM);
|
|
803
804
|
}
|
|
805
|
+
renderTaskbarContent() {
|
|
806
|
+
var _a;
|
|
807
|
+
return (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }, h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
|
808
|
+
}
|
|
804
809
|
/* istanbul ignore next */
|
|
805
810
|
render() {
|
|
806
|
-
var _a;
|
|
807
811
|
if (this.dataUnit == undefined) {
|
|
808
812
|
return;
|
|
809
813
|
}
|
|
810
|
-
|
|
811
|
-
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert, 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 ez-box--shadow simple-crud__container-section" }, this._currentViewMode === VIEW_MODE.FORM && taskbarContent, 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)
|
|
814
|
+
return (h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-box 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)
|
|
812
815
|
? undefined
|
|
813
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert
|
|
816
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger }, 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 ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), 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() }))));
|
|
814
817
|
}
|
|
815
818
|
get _element() { return getElement(this); }
|
|
816
819
|
static get watchers() { return {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a7d3d3f1.js';
|
|
2
|
-
import { Action, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { Action, LockManager, LockManagerOperation, StringUtils, ApplicationContext, OVERFLOWED_CLASS_NAME, OverflowWatcher, OverflowDirection, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
|
4
4
|
import { T as TaskbarElement, V as VisibleWhenForbidden, A as AuthorizationElements, b as buildElem, a as buildCustomButton } from './taskbar-elements-d59867f1.js';
|
|
5
5
|
import { P as PresentationMode } from './index-3aa4977a.js';
|
|
@@ -156,42 +156,44 @@ const SnkTaskbar = class {
|
|
|
156
156
|
return key ? (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {}) : "";
|
|
157
157
|
}
|
|
158
158
|
elementClick(elem) {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
this._isWaitingForSave
|
|
185
|
-
|
|
186
|
-
.
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
159
|
+
LockManager.whenResolve(this._element, LockManagerOperation.TASKBAR_CLICK).then(() => {
|
|
160
|
+
if (this.dataUnit) {
|
|
161
|
+
switch (elem) {
|
|
162
|
+
case TaskbarElement.PREVIOUS:
|
|
163
|
+
this.dataUnit.previousRecord();
|
|
164
|
+
break;
|
|
165
|
+
case TaskbarElement.NEXT:
|
|
166
|
+
this.dataUnit.nextRecord();
|
|
167
|
+
break;
|
|
168
|
+
case TaskbarElement.REFRESH:
|
|
169
|
+
this.dataUnit.loadData();
|
|
170
|
+
break;
|
|
171
|
+
case TaskbarElement.CLONE:
|
|
172
|
+
this.dataUnit.copySelected();
|
|
173
|
+
break;
|
|
174
|
+
case TaskbarElement.REMOVE:
|
|
175
|
+
this.dataUnit.removeSelectedRecords();
|
|
176
|
+
break;
|
|
177
|
+
case TaskbarElement.INSERT:
|
|
178
|
+
this.dataUnit.addRecord();
|
|
179
|
+
break;
|
|
180
|
+
case TaskbarElement.CANCEL:
|
|
181
|
+
this.dataUnit.cancelEdition();
|
|
182
|
+
break;
|
|
183
|
+
case TaskbarElement.SAVE:
|
|
184
|
+
if (!this._isWaitingForSave) {
|
|
185
|
+
this._isWaitingForSave = true;
|
|
186
|
+
this.dataUnit.saveData()
|
|
187
|
+
.finally(() => {
|
|
188
|
+
this._isWaitingForSave = false;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
191
193
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
194
|
+
if (this.isEnabled(elem))
|
|
195
|
+
this.actionClick.emit(elem);
|
|
196
|
+
});
|
|
195
197
|
}
|
|
196
198
|
isEnabled(elem) {
|
|
197
199
|
if (!this.isAllowed(elem)) {
|
|
@@ -395,9 +397,10 @@ const SnkTaskbar = class {
|
|
|
395
397
|
this._lastWidth = this._element.getBoundingClientRect().width;
|
|
396
398
|
}
|
|
397
399
|
disconnectedCallback() {
|
|
398
|
-
var _a;
|
|
400
|
+
var _a, _b;
|
|
401
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.onSaveEvent);
|
|
399
402
|
this.unlinkAllCustomElements();
|
|
400
|
-
(
|
|
403
|
+
(_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
401
404
|
}
|
|
402
405
|
unlinkAllCustomElements() {
|
|
403
406
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{S as snk_data_unit}from"./p-
|
|
1
|
+
export{S as snk_data_unit}from"./p-342eeb3b.js";import"./p-d2d301a6.js";import"@sankhyalabs/core";import"@sankhyalabs/ezui/dist/collection/utils";import"./p-17425c72.js";import"./p-47d24ac8.js";import"./p-00278e07.js";import"./p-8d884fab.js";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"@sankhyalabs/core/dist/dataunit/metadata/DataType";import"./p-7dd49d15.js";
|