@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-71072.0 → 0.0.0-bugfix-dev-KB-76362.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{SnkMessageBuilder-bae64d0d.js → SnkMessageBuilder-7691a2c1.js} +10 -0
- package/dist/cjs/index-f9e81701.js +8 -0
- package/dist/cjs/input-distinct-search_2.cjs.entry.js +471 -0
- 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 +22 -25
- package/dist/cjs/snk-application.cjs.entry.js +2 -18
- package/dist/cjs/snk-config-options_3.cjs.entry.js +5 -17
- package/dist/cjs/snk-crud.cjs.entry.js +2 -8
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-3d9b6ed4.js → snk-data-unit-7dbdad0e.js} +14 -26
- 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-distinct-search.cjs.entry.js +123 -0
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +0 -9
- package/dist/cjs/snk-filter-text.cjs.entry.js +1 -2
- package/dist/cjs/snk-grid.cjs.entry.js +2 -10
- package/dist/cjs/{snk-guides-viewer-2139481c.js → snk-guides-viewer-eee43c8b.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +4 -7
- package/dist/cjs/snk-taskbar.cjs.entry.js +37 -40
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +26 -27
- package/dist/collection/components/snk-application/snk-application.js +1 -41
- package/dist/collection/components/snk-crud/snk-crud.js +2 -26
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +3 -3
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +13 -25
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.css +4 -0
- package/dist/collection/components/snk-distinct-search/snk-distinct-search.js +372 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.css +110 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +544 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +28 -0
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +593 -0
- package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +15 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +1 -5
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +0 -20
- package/dist/collection/components/snk-form-config/snk-form-config.js +5 -17
- package/dist/collection/components/snk-grid/snk-grid.js +2 -28
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +4 -25
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +38 -41
- package/dist/collection/lib/http/data-fetcher/fetchers/distinct-search-fetcher.js +25 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +1 -7
- package/dist/collection/lib/message/SnkMessageBuilder.js +2 -0
- package/dist/collection/lib/message/resources/snk-distinct-search.msg.js +9 -0
- package/dist/components/SnkMessageBuilder.js +10 -0
- package/dist/components/filter-distinct-search.js +17 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/input-distinct-search.d.ts +11 -0
- package/dist/components/input-distinct-search.js +6 -0
- package/dist/components/input-distinct-search2.js +264 -0
- package/dist/components/search-modal.d.ts +11 -0
- package/dist/components/search-modal.js +6 -0
- package/dist/components/search-modal2.js +264 -0
- package/dist/components/snk-actions-button2.js +26 -27
- package/dist/components/snk-application2.js +2 -19
- package/dist/components/snk-crud.js +2 -9
- package/dist/components/snk-data-exporter2.js +3 -3
- package/dist/components/snk-data-unit2.js +13 -25
- package/dist/components/snk-detail-view2.js +1 -1
- package/dist/components/snk-distinct-search.d.ts +11 -0
- package/dist/components/snk-distinct-search.js +163 -0
- package/dist/components/snk-filter-bar2.js +0 -6
- package/dist/components/snk-filter-item2.js +1 -5
- package/dist/components/snk-filter-text.js +1 -2
- package/dist/components/snk-form-config2.js +5 -17
- package/dist/components/snk-grid2.js +2 -11
- package/dist/components/snk-simple-crud2.js +4 -8
- package/dist/components/snk-taskbar2.js +38 -41
- package/dist/esm/{SnkMessageBuilder-6fff4a4c.js → SnkMessageBuilder-7ace6803.js} +10 -0
- package/dist/esm/index-a7d3d3f1.js +8 -0
- package/dist/esm/input-distinct-search_2.entry.js +466 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +23 -26
- package/dist/esm/snk-application.entry.js +3 -19
- package/dist/esm/snk-config-options_3.entry.js +5 -17
- package/dist/esm/snk-crud.entry.js +2 -8
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-9fa7d2b9.js → snk-data-unit-7a579dbd.js} +14 -26
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +2 -2
- package/dist/esm/snk-distinct-search.entry.js +119 -0
- package/dist/esm/snk-filter-bar_4.entry.js +1 -10
- package/dist/esm/snk-filter-text.entry.js +1 -2
- package/dist/esm/snk-grid.entry.js +2 -10
- package/dist/esm/{snk-guides-viewer-b7ed39eb.js → snk-guides-viewer-e8ca764a.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +4 -7
- package/dist/esm/snk-taskbar.entry.js +38 -41
- package/dist/sankhyablocks/{p-483ef1fa.entry.js → p-00f9fe5c.entry.js} +1 -1
- package/dist/sankhyablocks/p-0e250436.entry.js +1 -0
- package/dist/sankhyablocks/p-154aa2a6.entry.js +11 -0
- package/dist/sankhyablocks/p-18cb1acb.entry.js +1 -0
- package/dist/sankhyablocks/p-1dbd5c18.entry.js +1 -0
- package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
- package/dist/sankhyablocks/p-30ebcbe0.entry.js +1 -0
- package/dist/sankhyablocks/p-3858a2e4.entry.js +1 -0
- package/dist/sankhyablocks/{p-4138da61.entry.js → p-42130213.entry.js} +1 -1
- package/dist/sankhyablocks/p-563b7c28.entry.js +1 -0
- package/dist/sankhyablocks/p-96a89d58.entry.js +1 -0
- package/dist/sankhyablocks/p-987c7328.entry.js +1 -0
- package/dist/sankhyablocks/{p-e390641b.entry.js → p-b389ed49.entry.js} +1 -1
- package/dist/sankhyablocks/p-c75fae8e.js +1 -0
- package/dist/sankhyablocks/p-d8665750.js +1 -0
- package/dist/sankhyablocks/{p-e97be1c8.js → p-e3a285a2.js} +1 -1
- package/dist/sankhyablocks/p-f0aaad2b.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d2a2e9e.entry.js → p-f4e221b2.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +2 -3
- package/dist/types/components/snk-application/snk-application.d.ts +1 -6
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -4
- package/dist/types/components/snk-distinct-search/snk-distinct-search.d.ts +83 -0
- package/dist/types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.d.ts +105 -0
- package/dist/types/components/snk-distinct-search/subcomponents/search-modal/search-modal.d.ts +127 -0
- package/dist/types/components/snk-distinct-search/types/index.d.ts +12 -0
- package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +0 -2
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -4
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -2
- package/dist/types/components.d.ts +393 -31
- package/dist/types/lib/http/data-fetcher/fetchers/distinct-search-fetcher.d.ts +6 -0
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +0 -1
- package/dist/types/lib/message/resources/snk-distinct-search.msg.d.ts +2 -0
- package/package.json +1 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.js +0 -8
- package/dist/sankhyablocks/p-0387d9d7.entry.js +0 -1
- package/dist/sankhyablocks/p-17425c72.js +0 -1
- package/dist/sankhyablocks/p-1d3ce0d9.entry.js +0 -1
- package/dist/sankhyablocks/p-342eeb3b.js +0 -1
- package/dist/sankhyablocks/p-3728d2aa.entry.js +0 -11
- package/dist/sankhyablocks/p-4e1f992e.entry.js +0 -1
- package/dist/sankhyablocks/p-619aeac8.entry.js +0 -1
- package/dist/sankhyablocks/p-89c92727.entry.js +0 -1
- package/dist/sankhyablocks/p-a3fadd0b.entry.js +0 -1
- package/dist/sankhyablocks/p-af7f7b3e.entry.js +0 -1
- package/dist/sankhyablocks/p-ec43fcc8.entry.js +0 -1
- package/dist/types/components/snk-actions-button/interfaces/index.d.ts +0 -3
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type-mask.enum.d.ts +0 -7
- /package/dist/collection/components/{snk-actions-button/interfaces → snk-distinct-search/types}/index.js +0 -0
|
@@ -4,7 +4,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
|
4
4
|
import { C as ConfigStorage } from './ConfigStorage.js';
|
|
5
5
|
import { d as dist, D as DataFetcher, U as UrlUtils } from './DataFetcher.js';
|
|
6
6
|
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
|
|
7
|
-
import {
|
|
7
|
+
import { D as DataUnitFetcher } from './dataunit-fetcher.js';
|
|
8
8
|
import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
|
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
|
10
10
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
|
@@ -74,7 +74,6 @@ class TotalsFetcher {
|
|
|
74
74
|
class ParametersFetcher {
|
|
75
75
|
constructor() {
|
|
76
76
|
this._embeddedParams = new Map();
|
|
77
|
-
this._cachedParams = new Map();
|
|
78
77
|
this.templateByQuery = new Map();
|
|
79
78
|
try {
|
|
80
79
|
if (window["MGE_PARAMS"] != undefined) {
|
|
@@ -104,16 +103,11 @@ class ParametersFetcher {
|
|
|
104
103
|
if (this._embeddedParams.has(name)) {
|
|
105
104
|
return Promise.resolve(this._embeddedParams.get(name));
|
|
106
105
|
}
|
|
107
|
-
if (this._cachedParams.has(name)) {
|
|
108
|
-
return this._cachedParams.get(name);
|
|
109
|
-
}
|
|
110
106
|
const completPath = `param://application?params=${name}`;
|
|
111
|
-
|
|
107
|
+
return DataFetcher.get().callGraphQL({
|
|
112
108
|
values: { name: completPath },
|
|
113
109
|
query: this.templateByQuery.get("fetchParam"),
|
|
114
110
|
});
|
|
115
|
-
this._cachedParams.set(name, param);
|
|
116
|
-
return param;
|
|
117
111
|
}
|
|
118
112
|
async asString(name) {
|
|
119
113
|
const paramArr = await this.getParam(name);
|
|
@@ -875,16 +869,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
875
869
|
async isLoadedByPk() {
|
|
876
870
|
return Promise.resolve(this._isLoadedByPk);
|
|
877
871
|
}
|
|
878
|
-
/**
|
|
879
|
-
* Remove registro do cache do PreLoader do dataunit.
|
|
880
|
-
* Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
|
|
881
|
-
*/
|
|
882
|
-
async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
|
|
883
|
-
const records = recordsIDs.map(id => {
|
|
884
|
-
return { "__record__id__": id };
|
|
885
|
-
});
|
|
886
|
-
PreloadManager.removeRecords(dataUnit, records);
|
|
887
|
-
}
|
|
888
872
|
async getAuthList(auth) {
|
|
889
873
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
|
890
874
|
}
|
|
@@ -1423,7 +1407,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1423
1407
|
"info": [64],
|
|
1424
1408
|
"loadTotals": [64],
|
|
1425
1409
|
"isLoadedByPk": [64],
|
|
1426
|
-
"preloadMangerRemoveRecord": [64],
|
|
1427
1410
|
"executeSearch": [64],
|
|
1428
1411
|
"executePreparedSearch": [64],
|
|
1429
1412
|
"isDebugMode": [64],
|
|
@@ -83,7 +83,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
83
83
|
this.enableGridInsert = false;
|
|
84
84
|
this.domainMessagesBuilder = undefined;
|
|
85
85
|
this.ignoreReadOnlyFormFields = undefined;
|
|
86
|
-
this.enableLockManger = false;
|
|
87
86
|
this.setCustomFormTitle = undefined;
|
|
88
87
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
89
88
|
}
|
|
@@ -324,16 +323,11 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
324
323
|
if (!isDocumentBody)
|
|
325
324
|
element.focus();
|
|
326
325
|
}
|
|
327
|
-
async function handleAddRecord() {
|
|
328
|
-
if (!dataUnit.hasNewRecord()) {
|
|
329
|
-
dataUnit.addRecord();
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
326
|
keyboardManager
|
|
333
327
|
.bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
|
|
334
328
|
.bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
335
329
|
.bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
336
|
-
.bind("F8",
|
|
330
|
+
.bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
|
|
337
331
|
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
338
332
|
.bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
339
333
|
.bind("ctrl + .", () => {
|
|
@@ -430,7 +424,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
430
424
|
return;
|
|
431
425
|
}
|
|
432
426
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
433
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item",
|
|
427
|
+
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, 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 }, 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" }))));
|
|
434
428
|
}
|
|
435
429
|
get _element() { return this; }
|
|
436
430
|
static get watchers() { return {
|
|
@@ -459,7 +453,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
459
453
|
"enableGridInsert": [4, "enable-grid-insert"],
|
|
460
454
|
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
|
461
455
|
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
|
462
|
-
"enableLockManger": [4, "enable-lock-manger"],
|
|
463
456
|
"setCustomFormTitle": [16],
|
|
464
457
|
"_dataUnit": [32],
|
|
465
458
|
"_dataState": [32],
|
|
@@ -383,10 +383,10 @@ class ClientSideExporterStrategy {
|
|
|
383
383
|
"GridXLSBuilderSP.buildXLSFromJson",
|
|
384
384
|
responseBody => ({
|
|
385
385
|
fileSessionKey: responseBody.chaveXLS.valor,
|
|
386
|
-
canPrint:
|
|
387
|
-
canExport:
|
|
388
|
-
canSendEmail: true,
|
|
386
|
+
canPrint: false,
|
|
387
|
+
canExport: false,
|
|
389
388
|
useAppPrint: false,
|
|
389
|
+
canSendEmail: false
|
|
390
390
|
})
|
|
391
391
|
];
|
|
392
392
|
}
|
|
@@ -24,7 +24,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
24
24
|
this._rowMetadataCache = new Map();
|
|
25
25
|
this.REGEX_DATAUNIT_NAME = /dd:\/\/(.+?)\//;
|
|
26
26
|
this._dataUnitObserver = async (action) => {
|
|
27
|
-
const duState =
|
|
27
|
+
const duState = this.buildDataState(action.type);
|
|
28
28
|
this.dataState = duState;
|
|
29
29
|
this.messagesBuilder.currentOperation = this.getMessageOperation();
|
|
30
30
|
switch (action.type) {
|
|
@@ -136,22 +136,14 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
136
136
|
async getRowMetadata(record) {
|
|
137
137
|
return this.doGetRowMetadata(record);
|
|
138
138
|
}
|
|
139
|
-
|
|
139
|
+
doGetRowMetadata(record) {
|
|
140
140
|
const selectedRecord = this.dataUnit.getSelectedRecord();
|
|
141
141
|
if (!record && !selectedRecord) {
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
const currentRecord = record || selectedRecord;
|
|
145
145
|
const recordId = typeof currentRecord === 'string' ? currentRecord : currentRecord.__record__id__;
|
|
146
|
-
|
|
147
|
-
/*
|
|
148
|
-
Nao fazemos cache de metadataByRow pra registros novos, pois a chave do mesmo
|
|
149
|
-
muda ao ser salvo, por isso essa tratativa é necessária para que o dataState fique com metadados
|
|
150
|
-
corretos nao confiando apenas no _metadataByRow
|
|
151
|
-
*/
|
|
152
|
-
if (this.dataUnit.isNewRecord(recordId) && !rowMetadata) {
|
|
153
|
-
rowMetadata = await this.handleLoadRowMetadata(selectedRecord);
|
|
154
|
-
}
|
|
146
|
+
const rowMetadata = this._metadataByRow.get(recordId);
|
|
155
147
|
if (!rowMetadata) {
|
|
156
148
|
return;
|
|
157
149
|
}
|
|
@@ -345,7 +337,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
345
337
|
case Action.RECORDS_COPIED:
|
|
346
338
|
return this.interceptRecordsCopied(action);
|
|
347
339
|
case Action.DATA_CHANGED:
|
|
348
|
-
await this.handleLoadRowMetadata(action
|
|
340
|
+
await this.handleLoadRowMetadata(action);
|
|
349
341
|
return await this.interceptDataChange(action);
|
|
350
342
|
case Action.CHANGING_DATA:
|
|
351
343
|
return await this.interceptDataChange(action);
|
|
@@ -365,9 +357,8 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
365
357
|
return action;
|
|
366
358
|
}
|
|
367
359
|
}
|
|
368
|
-
async handleLoadRowMetadata(
|
|
369
|
-
|
|
370
|
-
return;
|
|
360
|
+
async handleLoadRowMetadata(action) {
|
|
361
|
+
const record = action.type === Action.DATA_CHANGED ? action.payload : action.payload.changes[0].record;
|
|
371
362
|
const keysPayload = Object.keys(record);
|
|
372
363
|
const rmpField = keysPayload.find((field) => this._fieldsWithRmp.includes(field));
|
|
373
364
|
if (rmpField) {
|
|
@@ -446,7 +437,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
446
437
|
isAllowed(flag) {
|
|
447
438
|
return this._permissions ? this._permissions.isSup || this._permissions[flag] : false;
|
|
448
439
|
}
|
|
449
|
-
|
|
440
|
+
buildDataState(actionType) {
|
|
450
441
|
var _a;
|
|
451
442
|
const selectionInfo = this.dataUnit.getSelectionInfo();
|
|
452
443
|
const isStartingInsertionMode = (this.dataUnit.hasDirtyRecords() || this.dataUnit.hasWaitingChanges()) && (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isEmpty());
|
|
@@ -454,7 +445,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
454
445
|
let rowMetadata = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.rowMetadata;
|
|
455
446
|
const allowedOverwrite = [Action.SELECTION_CHANGED, Action.EDITION_CANCELED, Action.NEXT_SELECTED, Action.PREVIOUS_SELECTED];
|
|
456
447
|
if (selectedRecord && (!rowMetadata || allowedOverwrite.includes(actionType))) {
|
|
457
|
-
rowMetadata =
|
|
448
|
+
rowMetadata = this.doGetRowMetadata(selectedRecord);
|
|
458
449
|
}
|
|
459
450
|
else if (rowMetadata) {
|
|
460
451
|
rowMetadata.getProp = this.buildGetPropRowMetadata(rowMetadata);
|
|
@@ -476,20 +467,17 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
476
467
|
});
|
|
477
468
|
}
|
|
478
469
|
async handleDataSaved(action) {
|
|
479
|
-
|
|
480
|
-
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
|
+
const newRowMetadata = await this.handleLoadRowMetadata(action);
|
|
481
471
|
if (newRowMetadata) {
|
|
482
472
|
newRowMetadata.getProp = this.buildGetPropRowMetadata(newRowMetadata);
|
|
483
473
|
}
|
|
484
474
|
const recordId = action.payload.records[0].__record__id__;
|
|
485
475
|
this._metadataByRow.set(recordId, newRowMetadata);
|
|
486
|
-
this.dataState =
|
|
487
|
-
|
|
488
|
-
if (saveOperation == 'copy')
|
|
489
|
-
saveOperation = OperationMap.CLONE;
|
|
490
|
-
if (this.ignoreSaveMessage && ![OperationMap.CLONE, OperationMap.INSERT].includes(saveOperation)) {
|
|
476
|
+
this.dataState = this.buildDataState();
|
|
477
|
+
if (this.ignoreSaveMessage) {
|
|
491
478
|
return;
|
|
492
479
|
}
|
|
480
|
+
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
|
493
481
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
|
494
482
|
if (msg != undefined) {
|
|
495
483
|
this.showSuccessMessage(msg);
|
|
@@ -582,7 +570,7 @@ const SnkDataUnit = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
582
570
|
const { records } = this.getMetadataByRow(this.dataUnit);
|
|
583
571
|
this.dataUnit.records = records;
|
|
584
572
|
}
|
|
585
|
-
this.dataState =
|
|
573
|
+
this.dataState = this.buildDataState();
|
|
586
574
|
let resolver;
|
|
587
575
|
while (resolver = this._onDataUnitResolve.pop()) {
|
|
588
576
|
resolver(this.dataUnit);
|
|
@@ -483,7 +483,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
483
483
|
await this.openGuideNavigator(guideName);
|
|
484
484
|
}
|
|
485
485
|
if (action.type === Action.METADATA_LOADED) {
|
|
486
|
-
this.loadGuides(
|
|
486
|
+
this.loadGuides(false);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
async addErrorBadgeToGuide(guideName) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkDistinctSearch extends Components.SnkDistinctSearch, HTMLElement {}
|
|
4
|
+
export const SnkDistinctSearch: {
|
|
5
|
+
prototype: SnkDistinctSearch;
|
|
6
|
+
new (): SnkDistinctSearch;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { D as DataFetcher } from './DataFetcher.js';
|
|
3
|
+
import { ApplicationContext } from '@sankhyalabs/core';
|
|
4
|
+
import { d as defineCustomElement$3 } from './input-distinct-search2.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './search-modal2.js';
|
|
6
|
+
|
|
7
|
+
class DistinctSearchFetcher {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.SERVICE = 'mge@Pesquisa.getSelectDistinct';
|
|
10
|
+
}
|
|
11
|
+
buildRequestBody(coluna, instancia) {
|
|
12
|
+
return {
|
|
13
|
+
selectDistinct: {
|
|
14
|
+
instancia,
|
|
15
|
+
coluna,
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
parseResponseBody(response) {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
const ocorrencias = (_c = (_b = (_a = response === null || response === void 0 ? void 0 : response.ocorrencias) === null || _a === void 0 ? void 0 : _a.ocorrencia) === null || _b === void 0 ? void 0 : _b.map(({ $ }) => $)) !== null && _c !== void 0 ? _c : [];
|
|
22
|
+
return ocorrencias;
|
|
23
|
+
}
|
|
24
|
+
async fetchItens(coluna, instancia) {
|
|
25
|
+
const requestBody = this.buildRequestBody(coluna, instancia);
|
|
26
|
+
const response = await DataFetcher.get().callServiceBroker(this.SERVICE, requestBody);
|
|
27
|
+
const parsedResponse = this.parseResponseBody(response);
|
|
28
|
+
return parsedResponse;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const snkDistinctSearchCss = ".sc-snk-distinct-search-h{display:block;width:100%}";
|
|
33
|
+
|
|
34
|
+
const SnkDistinctSearch$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
this.__registerHost();
|
|
38
|
+
this.changeValue = createEvent(this, "changeValue", 7);
|
|
39
|
+
this.onIconClick = () => {
|
|
40
|
+
this._searchModalElement.value = this.value || "";
|
|
41
|
+
this._searchModalElement.openModal();
|
|
42
|
+
};
|
|
43
|
+
this.distinctItems = undefined;
|
|
44
|
+
this.value = "";
|
|
45
|
+
this.label = "";
|
|
46
|
+
this.configSearch = undefined;
|
|
47
|
+
this.maxItems = 100;
|
|
48
|
+
this.debounceTime = 300;
|
|
49
|
+
this.canShowError = false;
|
|
50
|
+
this.mode = 'regular';
|
|
51
|
+
this.restrict = undefined;
|
|
52
|
+
this.errorMessage = undefined;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Método para limpa o campo de entrada de pesquisa
|
|
56
|
+
*/
|
|
57
|
+
clearInput() {
|
|
58
|
+
this._inputDistinctSearch.clearInput();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Retorna se o conteúdo é inválido.
|
|
62
|
+
*/
|
|
63
|
+
isInvalid() {
|
|
64
|
+
return this._inputDistinctSearch.isInvalid();
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Remove o foco do campo
|
|
68
|
+
*/
|
|
69
|
+
setBlur() {
|
|
70
|
+
this._inputDistinctSearch.setBlur();
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Aplica o foco do campo
|
|
74
|
+
*/
|
|
75
|
+
setFocus() {
|
|
76
|
+
this._inputDistinctSearch.setFocus();
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Método para fechar o modal
|
|
80
|
+
*/
|
|
81
|
+
closeModal() {
|
|
82
|
+
this._searchModalElement.closeModal();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Método para abrir o modal
|
|
86
|
+
*/
|
|
87
|
+
openModal() {
|
|
88
|
+
this._searchModalElement.openModal();
|
|
89
|
+
}
|
|
90
|
+
async componentWillLoad() {
|
|
91
|
+
await this.fetchDistinctItems();
|
|
92
|
+
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
93
|
+
}
|
|
94
|
+
async fetchDistinctItems() {
|
|
95
|
+
const distinctFetcher = new DistinctSearchFetcher();
|
|
96
|
+
const response = await distinctFetcher.fetchItens(this.configSearch.column, this.configSearch.instance);
|
|
97
|
+
this.distinctItems = [...response];
|
|
98
|
+
}
|
|
99
|
+
onChange(event) {
|
|
100
|
+
event.stopPropagation();
|
|
101
|
+
this.value = event.detail.value;
|
|
102
|
+
this._inputDistinctSearch.selectValue(event.detail.value, event.detail.isNewItem);
|
|
103
|
+
this.changeValue.emit(event.detail);
|
|
104
|
+
}
|
|
105
|
+
onPopupClose() {
|
|
106
|
+
this._inputDistinctSearch.setFocus();
|
|
107
|
+
}
|
|
108
|
+
getMessage(key) {
|
|
109
|
+
return this._application.messagesBuilder.getMessage(key, null);
|
|
110
|
+
}
|
|
111
|
+
renderEmptyMessage() {
|
|
112
|
+
return (h("span", { innerHTML: this.getMessage("snkDistinctSearch.emptyResult") }));
|
|
113
|
+
}
|
|
114
|
+
render() {
|
|
115
|
+
return (h(Host, null, h("input-distinct-search", { ref: (ref) => this._inputDistinctSearch = ref, application: this._application, label: this.label, distinctItems: this.distinctItems, onChangeValue: this.onChange.bind(this), debounceTime: this.debounceTime, value: this.value, onIconClick: this.onIconClick, maxItems: this.maxItems, canShowError: this.canShowError, mode: this.mode, restrict: this.restrict, errorMessage: this.errorMessage }), h("search-modal", { ref: (ref) => this._searchModalElement = ref, application: this._application, listItens: this.distinctItems, onChangeValue: this.onChange.bind(this), restrict: this.restrict, value: this.value, label: this.label, emptyMessage: this.renderEmptyMessage(), maxItens: this.maxItems, debounceTime: this.debounceTime, canShowError: this.canShowError, mode: this.mode, errorMessage: this.errorMessage, onPopupClose: this.onPopupClose.bind(this) })));
|
|
116
|
+
}
|
|
117
|
+
static get style() { return snkDistinctSearchCss; }
|
|
118
|
+
}, [2, "snk-distinct-search", {
|
|
119
|
+
"value": [1025],
|
|
120
|
+
"label": [1],
|
|
121
|
+
"configSearch": [16],
|
|
122
|
+
"maxItems": [2, "max-items"],
|
|
123
|
+
"debounceTime": [2, "debounce-time"],
|
|
124
|
+
"canShowError": [4, "can-show-error"],
|
|
125
|
+
"mode": [1],
|
|
126
|
+
"restrict": [1],
|
|
127
|
+
"errorMessage": [1, "error-message"],
|
|
128
|
+
"distinctItems": [32],
|
|
129
|
+
"clearInput": [64],
|
|
130
|
+
"isInvalid": [64],
|
|
131
|
+
"setBlur": [64],
|
|
132
|
+
"setFocus": [64],
|
|
133
|
+
"closeModal": [64],
|
|
134
|
+
"openModal": [64]
|
|
135
|
+
}]);
|
|
136
|
+
function defineCustomElement$1() {
|
|
137
|
+
if (typeof customElements === "undefined") {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const components = ["snk-distinct-search", "input-distinct-search", "search-modal"];
|
|
141
|
+
components.forEach(tagName => { switch (tagName) {
|
|
142
|
+
case "snk-distinct-search":
|
|
143
|
+
if (!customElements.get(tagName)) {
|
|
144
|
+
customElements.define(tagName, SnkDistinctSearch$1);
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
case "input-distinct-search":
|
|
148
|
+
if (!customElements.get(tagName)) {
|
|
149
|
+
defineCustomElement$3();
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
case "search-modal":
|
|
153
|
+
if (!customElements.get(tagName)) {
|
|
154
|
+
defineCustomElement$2();
|
|
155
|
+
}
|
|
156
|
+
break;
|
|
157
|
+
} });
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const SnkDistinctSearch = SnkDistinctSearch$1;
|
|
161
|
+
const defineCustomElement = defineCustomElement$1;
|
|
162
|
+
|
|
163
|
+
export { SnkDistinctSearch, defineCustomElement };
|
|
@@ -290,7 +290,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
290
290
|
this.disablePersonalizedFilter = undefined;
|
|
291
291
|
this.filterBarLegacyConfigName = undefined;
|
|
292
292
|
this.autoLoad = undefined;
|
|
293
|
-
this.afterApplyConfig = undefined;
|
|
294
293
|
this.allowDefault = undefined;
|
|
295
294
|
this.scrollerLocked = false;
|
|
296
295
|
this.showPersonalizedFilter = false;
|
|
@@ -426,7 +425,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
426
425
|
return this.filterConfig.find(item => item.type === FilterItemType.PERSONALIZED);
|
|
427
426
|
}
|
|
428
427
|
async processAfterUpdateConfig() {
|
|
429
|
-
var _a;
|
|
430
428
|
if (this._loadingPending) {
|
|
431
429
|
if (await this._application.isLoadedByPk() && !this._configUpdated)
|
|
432
430
|
return;
|
|
@@ -441,7 +439,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
441
439
|
if (this._configUpdated) {
|
|
442
440
|
this._configUpdated = false;
|
|
443
441
|
ConfigStorage.saveFilterBarConfig(this.filterConfig, this.configName, this.resourceID);
|
|
444
|
-
(_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
445
442
|
}
|
|
446
443
|
}
|
|
447
444
|
async doLoadData(forceReload = false) {
|
|
@@ -646,9 +643,7 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
646
643
|
*/
|
|
647
644
|
async showFilterModal() {
|
|
648
645
|
const callbackOnApplyFilter = (filters) => {
|
|
649
|
-
var _a;
|
|
650
646
|
this.filterConfig = filters.map(this.normalizeItem).sort((a, b) => this._filtersComparator(a, b));
|
|
651
|
-
(_a = this.afterApplyConfig) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
652
647
|
};
|
|
653
648
|
let filtersConfigCopy = ObjectUtils.copy(this.filterConfig);
|
|
654
649
|
filtersConfigCopy = filtersConfigCopy.sort((itemA, itemB) => {
|
|
@@ -740,7 +735,6 @@ const SnkFilterBar = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
740
735
|
"disablePersonalizedFilter": [4, "disable-personalized-filter"],
|
|
741
736
|
"filterBarLegacyConfigName": [1, "filter-bar-legacy-config-name"],
|
|
742
737
|
"autoLoad": [4, "auto-load"],
|
|
743
|
-
"afterApplyConfig": [16],
|
|
744
738
|
"allowDefault": [32],
|
|
745
739
|
"scrollerLocked": [32],
|
|
746
740
|
"showPersonalizedFilter": [32],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { FloatingManager, DateUtils,
|
|
2
|
+
import { FloatingManager, DateUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { F as FilterItemType } from './filter-item-type.enum.js';
|
|
4
4
|
import { F as FilterNumberVariation } from './filterNumberVariation.js';
|
|
5
5
|
import { d as defineCustomElement$1 } from './snk-filter-detail2.js';
|
|
@@ -217,10 +217,6 @@ const SnkFilterItem = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
217
217
|
return `${label}: ${this.getMessage('snkFilterBar.onlyEndToltip')} ${Number(end)}`;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
if (this.config.mask) {
|
|
221
|
-
const _maskFormatter = new MaskFormatter(this.config.mask);
|
|
222
|
-
return `${label}: ${_maskFormatter.format(value)}`;
|
|
223
|
-
}
|
|
224
220
|
return `${label}: ${value}`;
|
|
225
221
|
}
|
|
226
222
|
return label;
|
|
@@ -22,11 +22,10 @@ const SnkFilterText$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
render() {
|
|
25
|
-
var _a;
|
|
26
25
|
if (!this.config) {
|
|
27
26
|
return undefined;
|
|
28
27
|
}
|
|
29
|
-
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 }));
|
|
30
29
|
}
|
|
31
30
|
get _element() { return this; }
|
|
32
31
|
}, [0, "snk-filter-text", {
|
|
@@ -685,7 +685,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
getLayoutFormConfig() {
|
|
688
|
-
var _a, _b
|
|
688
|
+
var _a, _b;
|
|
689
689
|
if (((_a = this._formConfig) === null || _a === void 0 ? void 0 : _a.fields) == undefined) {
|
|
690
690
|
return;
|
|
691
691
|
}
|
|
@@ -698,11 +698,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
698
698
|
if (hasField == undefined) {
|
|
699
699
|
fields.push(field);
|
|
700
700
|
const fieldMD = this.dataUnit.getField(field.name);
|
|
701
|
-
|
|
702
|
-
* Quando um campo é ocultado pelo dev, mas queremos manter ele na config precisamos fazer essa tratativa.
|
|
703
|
-
*/
|
|
704
|
-
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;
|
|
705
|
-
if ((fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.visible) || visibleOnConfig) {
|
|
701
|
+
if (fieldMD === null || fieldMD === void 0 ? void 0 : fieldMD.visible) {
|
|
706
702
|
if (field.label == undefined || field.label === "") {
|
|
707
703
|
field.label = fieldMD.label;
|
|
708
704
|
}
|
|
@@ -718,7 +714,7 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
718
714
|
visible = configTabs[0].visible;
|
|
719
715
|
}
|
|
720
716
|
}
|
|
721
|
-
const tabLabel = ((
|
|
717
|
+
const tabLabel = ((_b = field.tab) === null || _b === void 0 ? void 0 : _b.label) || field.tab;
|
|
722
718
|
if (visible !== null) {
|
|
723
719
|
tab = { tab: tabLabel, groups: [], visible };
|
|
724
720
|
}
|
|
@@ -803,16 +799,8 @@ const SnkFormConfig = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
803
799
|
for (const field of this._formConfig.fields) {
|
|
804
800
|
fieldsFormConfig.push(field);
|
|
805
801
|
}
|
|
806
|
-
const listFieldsAvailable = fieldsMetadata.filter(({ name: _nameFieldMetadado, visible: _visibleMetadado
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Quando a visibilidade de um campo é alterada pelo dataunit, mas o desenvolvedor deseja que o mesmo continue
|
|
810
|
-
* sendo apresentado no configurador, precisamos fazer essa tratativa, verificando se o campo não tem configuração
|
|
811
|
-
*/
|
|
812
|
-
if (!hasCfg && properties.visibleOnConfig === true && !_visibleMetadado)
|
|
813
|
-
return properties.visibleOnConfig;
|
|
814
|
-
return _visibleMetadado === true && hasCfg === false;
|
|
815
|
-
});
|
|
802
|
+
const listFieldsAvailable = fieldsMetadata.filter(({ name: _nameFieldMetadado, visible: _visibleMetadado }) => _visibleMetadado === true
|
|
803
|
+
&& fieldsFormConfig.some(({ name: _nameFieldForm }) => _nameFieldForm === _nameFieldMetadado) === false);
|
|
816
804
|
this._fieldsAvailable = listFieldsAvailable;
|
|
817
805
|
this._listEnabledFields = listFieldsAvailable;
|
|
818
806
|
if (((_b = this._filterFieldsAvailable) === null || _b === void 0 ? void 0 : _b.value) != undefined) {
|
|
@@ -153,7 +153,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
153
153
|
this.autoLoad = undefined;
|
|
154
154
|
this.autoFocus = true;
|
|
155
155
|
this.enableGridInsert = false;
|
|
156
|
-
this.enableLockManger = false;
|
|
157
156
|
}
|
|
158
157
|
/**
|
|
159
158
|
* Exibe a janela de configurações da grade.
|
|
@@ -241,17 +240,10 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
241
240
|
this._grid.setFocus();
|
|
242
241
|
}
|
|
243
242
|
async handleClick(event) {
|
|
244
|
-
var _a;
|
|
245
243
|
if (this.hasToBlockEvent(event)) {
|
|
246
244
|
event.preventDefault();
|
|
247
245
|
event.stopPropagation();
|
|
248
|
-
|
|
249
|
-
return;
|
|
250
|
-
const newEvent = new event.constructor(event.type, event);
|
|
251
|
-
(_a = event.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(newEvent);
|
|
252
|
-
}
|
|
253
|
-
if (this._grid && !this._grid.contains(event.target)) {
|
|
254
|
-
this._grid.stopEdit();
|
|
246
|
+
await this._dataUnit.cancelEdition();
|
|
255
247
|
}
|
|
256
248
|
}
|
|
257
249
|
hasToBlockEvent(event) {
|
|
@@ -542,7 +534,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
542
534
|
return undefined;
|
|
543
535
|
}
|
|
544
536
|
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 &&
|
|
545
|
-
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
|
|
537
|
+
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 }))));
|
|
546
538
|
}
|
|
547
539
|
get _element() { return this; }
|
|
548
540
|
static get watchers() { return {
|
|
@@ -574,7 +566,6 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
574
566
|
"autoLoad": [4, "auto-load"],
|
|
575
567
|
"autoFocus": [4, "auto-focus"],
|
|
576
568
|
"enableGridInsert": [4, "enable-grid-insert"],
|
|
577
|
-
"enableLockManger": [4, "enable-lock-manger"],
|
|
578
569
|
"_dataUnit": [32],
|
|
579
570
|
"_dataState": [32],
|
|
580
571
|
"_gridConfig": [32],
|