@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-76362.1 → 0.0.0-bugfix-dev-KB-78242.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 +3 -3
- 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 +11 -2
- package/dist/cjs/{snk-guides-viewer-eee43c8b.js → snk-guides-viewer-2139481c.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +1 -1
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +26 -5
- 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-detail-view/snk-detail-view.js +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/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.css +13 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.js +2 -2
- 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 +47 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +1 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +62 -5
- 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 +13 -2
- package/dist/components/snk-personalized-filter-editor.js +3 -3
- package/dist/components/snk-simple-crud2.js +29 -6
- 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 +3 -3
- 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 +11 -2
- package/dist/esm/{snk-guides-viewer-e8ca764a.js → snk-guides-viewer-b7ed39eb.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +1 -1
- package/dist/esm/snk-personalized-filter-editor.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +27 -6
- package/dist/esm/snk-taskbar.entry.js +41 -38
- package/dist/sankhyablocks/p-0387d9d7.entry.js +1 -0
- 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-37629dc1.entry.js +1 -0
- package/dist/sankhyablocks/{p-42130213.entry.js → p-4138da61.entry.js} +1 -1
- package/dist/sankhyablocks/p-47178038.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-af7f7b3e.entry.js +1 -0
- package/dist/sankhyablocks/{p-b389ed49.entry.js → p-b2172152.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e3a285a2.js → p-e97be1c8.js} +1 -1
- package/dist/sankhyablocks/p-ec43fcc8.entry.js +1 -0
- package/dist/sankhyablocks/p-f8be20c7.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 +10 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +9 -0
- package/dist/types/components.d.ts +47 -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 -471
- 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 -110
- package/dist/collection/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search.js +0 -544
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.css +0 -28
- package/dist/collection/components/snk-distinct-search/subcomponents/search-modal/search-modal.js +0 -593
- package/dist/collection/components/snk-distinct-search/utils/filter-distinct-search.js +0 -15
- 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 -17
- 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 -264
- 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 -466
- 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-3858a2e4.entry.js +0 -1
- package/dist/sankhyablocks/p-563b7c28.entry.js +0 -1
- package/dist/sankhyablocks/p-5b51491f.entry.js +0 -1
- package/dist/sankhyablocks/p-96a89d58.entry.js +0 -1
- package/dist/sankhyablocks/p-987c7328.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 -127
- package/dist/types/components/snk-distinct-search/types/index.d.ts +0 -12
- package/dist/types/components/snk-distinct-search/utils/filter-distinct-search.d.ts +0 -4
- 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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext, DataType, ElementIDUtils, FloatingManager, JSUtils, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
1
|
+
import { ApplicationContext, DataType, ElementIDUtils, FloatingManager, JSUtils, KeyboardManager, ObjectUtils, StringUtils, UserInterface, } from '@sankhyalabs/core';
|
|
2
2
|
import { CSSVarsUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
3
3
|
import { h } from '@stencil/core';
|
|
4
4
|
import { SIMPLE_CRUD_MODE, VIEW_MODE } from '../../lib/utils/constants';
|
|
@@ -41,6 +41,7 @@ export class SnkSimpleCrud {
|
|
|
41
41
|
this.mode = SIMPLE_CRUD_MODE.SERVER;
|
|
42
42
|
this.gridConfig = undefined;
|
|
43
43
|
this.formConfig = undefined;
|
|
44
|
+
this.enableLockManger = false;
|
|
44
45
|
this._formFields = [];
|
|
45
46
|
this._fieldsProps = new Map();
|
|
46
47
|
this._enableContinuousInsert = true;
|
|
@@ -61,6 +62,7 @@ export class SnkSimpleCrud {
|
|
|
61
62
|
this.autoFocus = true;
|
|
62
63
|
this.domainMessagesBuilder = undefined;
|
|
63
64
|
this.autoLoad = undefined;
|
|
65
|
+
this.boxShadow = true;
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* Registra um editor customizado para campos da grade e formulário.
|
|
@@ -340,6 +342,7 @@ export class SnkSimpleCrud {
|
|
|
340
342
|
}
|
|
341
343
|
componentDidLoad() {
|
|
342
344
|
CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
|
345
|
+
this.initKeyboardManager();
|
|
343
346
|
}
|
|
344
347
|
setCustomRenders() {
|
|
345
348
|
if (!this._grid) {
|
|
@@ -725,16 +728,34 @@ export class SnkSimpleCrud {
|
|
|
725
728
|
return;
|
|
726
729
|
this.goToView(VIEW_MODE.FORM);
|
|
727
730
|
}
|
|
731
|
+
async initKeyboardManager() {
|
|
732
|
+
const keyboardManager = new KeyboardManager();
|
|
733
|
+
const dataUnit = this.dataUnit || await this._snkDataUnit.getDataUnit();
|
|
734
|
+
keyboardManager
|
|
735
|
+
.bind("F7", () => dataUnit.saveData(), { description: "Salva os dados.", element: this._element })
|
|
736
|
+
.bind("F8", dataUnit.addRecord.bind(dataUnit), { description: "Adiciona um novo registro.", element: this._element })
|
|
737
|
+
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
738
|
+
.bind("Escape", () => {
|
|
739
|
+
if (dataUnit.isDirty()) {
|
|
740
|
+
dataUnit.cancelEdition();
|
|
741
|
+
}
|
|
742
|
+
}, {
|
|
743
|
+
debounceTime: 1000,
|
|
744
|
+
description: "Cancela uma ação.", element: this._element
|
|
745
|
+
});
|
|
746
|
+
}
|
|
747
|
+
renderTaskbarContent() {
|
|
748
|
+
var _a;
|
|
749
|
+
return (h("snk-taskbar", { class: this._currentViewMode === VIEW_MODE.FORM && `ez-box ${this.boxShadow ? 'ez-box--shadow-xsmall' : 'ez-box--outline'} 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" })));
|
|
750
|
+
}
|
|
728
751
|
/* istanbul ignore next */
|
|
729
752
|
render() {
|
|
730
|
-
var _a;
|
|
731
753
|
if (this.dataUnit == undefined) {
|
|
732
754
|
return;
|
|
733
755
|
}
|
|
734
|
-
|
|
735
|
-
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)
|
|
756
|
+
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 ${this.boxShadow ? 'ez-box--shadow' : 'ez-box--outline'} 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)
|
|
736
757
|
? undefined
|
|
737
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert
|
|
758
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger, boxShadow: this.boxShadow }, 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() }))));
|
|
738
759
|
}
|
|
739
760
|
static get is() { return "snk-simple-crud"; }
|
|
740
761
|
static get encapsulation() { return "scoped"; }
|
|
@@ -870,6 +891,24 @@ export class SnkSimpleCrud {
|
|
|
870
891
|
"text": ""
|
|
871
892
|
}
|
|
872
893
|
},
|
|
894
|
+
"enableLockManger": {
|
|
895
|
+
"type": "boolean",
|
|
896
|
+
"mutable": false,
|
|
897
|
+
"complexType": {
|
|
898
|
+
"original": "boolean",
|
|
899
|
+
"resolved": "boolean",
|
|
900
|
+
"references": {}
|
|
901
|
+
},
|
|
902
|
+
"required": false,
|
|
903
|
+
"optional": true,
|
|
904
|
+
"docs": {
|
|
905
|
+
"tags": [],
|
|
906
|
+
"text": ""
|
|
907
|
+
},
|
|
908
|
+
"attribute": "enable-lock-manger",
|
|
909
|
+
"reflect": false,
|
|
910
|
+
"defaultValue": "false"
|
|
911
|
+
},
|
|
873
912
|
"multipleSelection": {
|
|
874
913
|
"type": "boolean",
|
|
875
914
|
"mutable": false,
|
|
@@ -1176,6 +1215,24 @@ export class SnkSimpleCrud {
|
|
|
1176
1215
|
},
|
|
1177
1216
|
"attribute": "auto-load",
|
|
1178
1217
|
"reflect": false
|
|
1218
|
+
},
|
|
1219
|
+
"boxShadow": {
|
|
1220
|
+
"type": "boolean",
|
|
1221
|
+
"mutable": false,
|
|
1222
|
+
"complexType": {
|
|
1223
|
+
"original": "boolean",
|
|
1224
|
+
"resolved": "boolean",
|
|
1225
|
+
"references": {}
|
|
1226
|
+
},
|
|
1227
|
+
"required": false,
|
|
1228
|
+
"optional": true,
|
|
1229
|
+
"docs": {
|
|
1230
|
+
"tags": [],
|
|
1231
|
+
"text": "Altera visualmente as sombras e bordas do componente\nQuando true, aplica o padr\u00E3o de sombras ao componente (Utilizar quando for o elemento principal do layout)\nQuando false, aplica o padr\u00E3o de outline ao componente (Utilizar quando estiver contido em outro elemento como um painel ou pop-up)"
|
|
1232
|
+
},
|
|
1233
|
+
"attribute": "box-shadow",
|
|
1234
|
+
"reflect": false,
|
|
1235
|
+
"defaultValue": "true"
|
|
1179
1236
|
}
|
|
1180
1237
|
};
|
|
1181
1238
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME } from '@sankhyalabs/core';
|
|
1
|
+
import { ApplicationContext, ElementIDUtils, OverflowDirection, OverflowWatcher, StringUtils, OVERFLOWED_CLASS_NAME, LockManager, LockManagerOperation } from '@sankhyalabs/core';
|
|
2
2
|
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { AuthorizationConfig } from '../snk-configurator/AuthorizationConfig';
|
|
4
4
|
import { AuthorizationElements, buildCustomButton, buildElem, TaskbarElement, VisibleWhenForbidden, } from './elements/taskbar-elements';
|
|
@@ -149,42 +149,44 @@ export class SnkTaskbar {
|
|
|
149
149
|
return key ? (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {}) : "";
|
|
150
150
|
}
|
|
151
151
|
elementClick(elem) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
this._isWaitingForSave
|
|
178
|
-
|
|
179
|
-
.
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
152
|
+
LockManager.whenResolve(this._element, LockManagerOperation.TASKBAR_CLICK).then(() => {
|
|
153
|
+
if (this.dataUnit) {
|
|
154
|
+
switch (elem) {
|
|
155
|
+
case TaskbarElement.PREVIOUS:
|
|
156
|
+
this.dataUnit.previousRecord();
|
|
157
|
+
break;
|
|
158
|
+
case TaskbarElement.NEXT:
|
|
159
|
+
this.dataUnit.nextRecord();
|
|
160
|
+
break;
|
|
161
|
+
case TaskbarElement.REFRESH:
|
|
162
|
+
this.dataUnit.loadData();
|
|
163
|
+
break;
|
|
164
|
+
case TaskbarElement.CLONE:
|
|
165
|
+
this.dataUnit.copySelected();
|
|
166
|
+
break;
|
|
167
|
+
case TaskbarElement.REMOVE:
|
|
168
|
+
this.dataUnit.removeSelectedRecords();
|
|
169
|
+
break;
|
|
170
|
+
case TaskbarElement.INSERT:
|
|
171
|
+
this.dataUnit.addRecord();
|
|
172
|
+
break;
|
|
173
|
+
case TaskbarElement.CANCEL:
|
|
174
|
+
this.dataUnit.cancelEdition();
|
|
175
|
+
break;
|
|
176
|
+
case TaskbarElement.SAVE:
|
|
177
|
+
if (!this._isWaitingForSave) {
|
|
178
|
+
this._isWaitingForSave = true;
|
|
179
|
+
this.dataUnit.saveData()
|
|
180
|
+
.finally(() => {
|
|
181
|
+
this._isWaitingForSave = false;
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
184
186
|
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
if (this.isEnabled(elem))
|
|
188
|
+
this.actionClick.emit(elem);
|
|
189
|
+
});
|
|
188
190
|
}
|
|
189
191
|
isEnabled(elem) {
|
|
190
192
|
if (!this.isAllowed(elem)) {
|
|
@@ -388,9 +390,10 @@ export class SnkTaskbar {
|
|
|
388
390
|
this._lastWidth = this._element.getBoundingClientRect().width;
|
|
389
391
|
}
|
|
390
392
|
disconnectedCallback() {
|
|
391
|
-
var _a;
|
|
393
|
+
var _a, _b;
|
|
394
|
+
(_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.unsubscribe(this.onSaveEvent);
|
|
392
395
|
this.unlinkAllCustomElements();
|
|
393
|
-
(
|
|
396
|
+
(_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
394
397
|
}
|
|
395
398
|
unlinkAllCustomElements() {
|
|
396
399
|
var _a;
|
|
@@ -4,6 +4,7 @@ import { DataFetcher } from "../DataFetcher";
|
|
|
4
4
|
export default class ParametersFetcher {
|
|
5
5
|
constructor() {
|
|
6
6
|
this._embeddedParams = new Map();
|
|
7
|
+
this._cachedParams = new Map();
|
|
7
8
|
this.templateByQuery = new Map();
|
|
8
9
|
try {
|
|
9
10
|
if (window["MGE_PARAMS"] != undefined) {
|
|
@@ -33,11 +34,16 @@ export default class ParametersFetcher {
|
|
|
33
34
|
if (this._embeddedParams.has(name)) {
|
|
34
35
|
return Promise.resolve(this._embeddedParams.get(name));
|
|
35
36
|
}
|
|
37
|
+
if (this._cachedParams.has(name)) {
|
|
38
|
+
return this._cachedParams.get(name);
|
|
39
|
+
}
|
|
36
40
|
const completPath = `param://application?params=${name}`;
|
|
37
|
-
|
|
41
|
+
const param = await DataFetcher.get().callGraphQL({
|
|
38
42
|
values: { name: completPath },
|
|
39
43
|
query: this.templateByQuery.get("fetchParam"),
|
|
40
44
|
});
|
|
45
|
+
this._cachedParams.set(name, param);
|
|
46
|
+
return param;
|
|
41
47
|
}
|
|
42
48
|
async asString(name) {
|
|
43
49
|
const paramArr = await this.getParam(name);
|
|
@@ -7,7 +7,6 @@ import snkCrudMessages from "./resources/snk-crud.msg";
|
|
|
7
7
|
import snkSimpleCrudMessages from "./resources/snk-simple-crud.msg";
|
|
8
8
|
import fileViewerMessages from "./resources/file-viewer.msg";
|
|
9
9
|
import snkApplicationMessages from "./resources/snk-application.msg";
|
|
10
|
-
import snkDistinctSearchMessages from "./resources/snk-distinct-search.msg";
|
|
11
10
|
import { snkFormConfigMessages, snkConfigOptionsMessages, snkFieldConfigMessages, snkTabConfigMessages } from "./resources/snk-form.msg";
|
|
12
11
|
import { snkConfiguratorMessages } from "./resources/snk-configurator.msg";
|
|
13
12
|
import { snkGridMessages, snkGridConfigMessages } from "./resources/snk-grid.msg";
|
|
@@ -49,7 +48,6 @@ export class SnkMessageBuilder {
|
|
|
49
48
|
snkEntityList: snkEntityListMessages,
|
|
50
49
|
snkActionsButton: snkActionsButtonMessages,
|
|
51
50
|
snkPrintSelector: snkPrintSelectorMessages,
|
|
52
|
-
snkDistinctSearch: snkDistinctSearchMessages,
|
|
53
51
|
};
|
|
54
52
|
this._currentOperation = OperationMap.CLEAN;
|
|
55
53
|
this._domainName = domainName;
|
|
@@ -172,15 +172,6 @@ const snkAttachMessages$1 = {
|
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
|
|
175
|
-
const snkDistinctSearchMessages = {
|
|
176
|
-
titleBadgeNew: "novo",
|
|
177
|
-
titleAdd: "Adicionar",
|
|
178
|
-
availableResults: "resultados disponíveis",
|
|
179
|
-
availableResult: "resultado disponível",
|
|
180
|
-
limitResult: "Esta pesquisa foi limitada, existem mais resultados",
|
|
181
|
-
emptyResult: "Nenhum resultado disponível. <br/>Você pode adicionar um novo termo",
|
|
182
|
-
};
|
|
183
|
-
|
|
184
175
|
const snkConfigOptionsMessages = {
|
|
185
176
|
label: {
|
|
186
177
|
nameField: "Nome do Campo *",
|
|
@@ -561,7 +552,6 @@ class SnkMessageBuilder {
|
|
|
561
552
|
snkEntityList: snkEntityListMessages,
|
|
562
553
|
snkActionsButton: snkActionsButtonMessages,
|
|
563
554
|
snkPrintSelector: snkPrintSelectorMessages,
|
|
564
|
-
snkDistinctSearch: snkDistinctSearchMessages,
|
|
565
555
|
};
|
|
566
556
|
this._currentOperation = OperationMap.CLEAN;
|
|
567
557
|
this._domainName = domainName;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
/* sankhyablocks custom elements */
|
|
2
|
-
export { InputDistinctSearch as InputDistinctSearch } from '../types/components/snk-distinct-search/subcomponents/input-distinct-search/input-distinct-search';
|
|
3
|
-
export { SearchModal as SearchModal } from '../types/components/snk-distinct-search/subcomponents/search-modal/search-modal';
|
|
4
2
|
export { SnkActionsButton as SnkActionsButton } from '../types/components/snk-actions-button/snk-actions-button';
|
|
5
3
|
export { SnkActionsForm as SnkActionsForm } from '../types/components/snk-actions-button/subcomponents/snk-actions-form';
|
|
6
4
|
export { SnkApplication as SnkApplication } from '../types/components/snk-application/snk-application';
|
|
@@ -13,7 +11,6 @@ export { SnkCustomSlotElements as SnkCustomSlotElements } from '../types/compone
|
|
|
13
11
|
export { SnkDataExporter as SnkDataExporter } from '../types/components/snk-data-exporter/snk-data-exporter';
|
|
14
12
|
export { SnkDataUnit as SnkDataUnit } from '../types/components/snk-data-unit/snk-data-unit';
|
|
15
13
|
export { SnkDetailView as SnkDetailView } from '../types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view';
|
|
16
|
-
export { SnkDistinctSearch as SnkDistinctSearch } from '../types/components/snk-distinct-search/snk-distinct-search';
|
|
17
14
|
export { SnkEntityList as SnkEntityList } from '../types/components/snk-entity-list/snk-entity-list';
|
|
18
15
|
export { SnkExporterEmailSender as SnkExporterEmailSender } from '../types/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender';
|
|
19
16
|
export { SnkExpressionGroup as SnkExpressionGroup } from '../types/components/snk-personalized-filter/subcomponents/snk-expression-group/snk-expression-group';
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
-
export { InputDistinctSearch, defineCustomElement as defineCustomElementInputDistinctSearch } from './input-distinct-search.js';
|
|
3
|
-
export { SearchModal, defineCustomElement as defineCustomElementSearchModal } from './search-modal.js';
|
|
4
2
|
export { SnkActionsButton, defineCustomElement as defineCustomElementSnkActionsButton } from './snk-actions-button.js';
|
|
5
3
|
export { SnkActionsForm, defineCustomElement as defineCustomElementSnkActionsForm } from './snk-actions-form.js';
|
|
6
4
|
export { SnkApplication, defineCustomElement as defineCustomElementSnkApplication } from './snk-application.js';
|
|
@@ -13,7 +11,6 @@ export { SnkCustomSlotElements, defineCustomElement as defineCustomElementSnkCus
|
|
|
13
11
|
export { SnkDataExporter, defineCustomElement as defineCustomElementSnkDataExporter } from './snk-data-exporter.js';
|
|
14
12
|
export { SnkDataUnit, defineCustomElement as defineCustomElementSnkDataUnit } from './snk-data-unit.js';
|
|
15
13
|
export { SnkDetailView, defineCustomElement as defineCustomElementSnkDetailView } from './snk-detail-view.js';
|
|
16
|
-
export { SnkDistinctSearch, defineCustomElement as defineCustomElementSnkDistinctSearch } from './snk-distinct-search.js';
|
|
17
14
|
export { SnkEntityList, defineCustomElement as defineCustomElementSnkEntityList } from './snk-entity-list.js';
|
|
18
15
|
export { SnkExporterEmailSender, defineCustomElement as defineCustomElementSnkExporterEmailSender } from './snk-exporter-email-sender.js';
|
|
19
16
|
export { SnkExpressionGroup, defineCustomElement as defineCustomElementSnkExpressionGroup } from './snk-expression-group.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { ApplicationContext, StringUtils, ErrorException, WarningException, ObjectUtils, DateUtils, ServiceUtils, StorageType, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { D as DataFetcher } from './DataFetcher.js';
|
|
4
4
|
import { P as ParamType } from './ParamType.js';
|
|
5
5
|
import './pesquisa-fetcher.js';
|
|
@@ -598,6 +598,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
598
598
|
super();
|
|
599
599
|
this.__registerHost();
|
|
600
600
|
this.CLIENT_EVENT_CONFIRM_NAME = "br.com.sankhya.actionbutton.clientconfirm";
|
|
601
|
+
this._actions = [];
|
|
601
602
|
this.handleClick = (evt) => {
|
|
602
603
|
const selectedAction = this._actions.find((action) => action.actionID == evt.detail.id);
|
|
603
604
|
const executor = new ExecutorFactory(selectedAction.type).executor;
|
|
@@ -607,27 +608,22 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
607
608
|
};
|
|
608
609
|
this._items = [];
|
|
609
610
|
this._showDropdown = false;
|
|
610
|
-
this._actions = [];
|
|
611
|
-
this._isOrderActions = false;
|
|
612
611
|
}
|
|
613
612
|
async getActions() {
|
|
614
|
-
|
|
615
|
-
param: {
|
|
616
|
-
entityName: this._entityName,
|
|
617
|
-
resourceID: this._resourceID
|
|
618
|
-
}
|
|
619
|
-
};
|
|
620
|
-
return DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param).then((result) => {
|
|
613
|
+
const actions = await ServiceUtils.useCacheWithService(`SnkActionsButton_${this._entityName}-${this._resourceID}`, async () => {
|
|
621
614
|
var _a;
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
});
|
|
615
|
+
const param = {
|
|
616
|
+
param: {
|
|
617
|
+
entityName: this._entityName,
|
|
618
|
+
resourceID: this._resourceID,
|
|
619
|
+
},
|
|
620
|
+
};
|
|
621
|
+
const result = await DataFetcher.get().callServiceBroker('ActionButtonsSP.getActions', param);
|
|
622
|
+
return ((_a = result.actions) === null || _a === void 0 ? void 0 : _a.action) || [];
|
|
623
|
+
}, StorageType.IN_MEMORY_CACHE);
|
|
624
|
+
this._actions = SnkActionsButton.parameters.isOrderActions
|
|
625
|
+
? ArrayUtils.sortAlphabetically(actions, 'description')
|
|
626
|
+
: actions;
|
|
631
627
|
}
|
|
632
628
|
controlDropdown() {
|
|
633
629
|
this._showDropdown = !this._showDropdown;
|
|
@@ -660,7 +656,7 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
660
656
|
}
|
|
661
657
|
async componentWillLoad() {
|
|
662
658
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
663
|
-
|
|
659
|
+
await this.loadParameters();
|
|
664
660
|
const snkDataUnit = this._element.parentElement;
|
|
665
661
|
this._dataUnit = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.dataUnit;
|
|
666
662
|
this._resourceID = snkDataUnit === null || snkDataUnit === void 0 ? void 0 : snkDataUnit.resourceID;
|
|
@@ -669,9 +665,8 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
669
665
|
this._resourceID = await ResourceIDUtils.getResourceID();
|
|
670
666
|
}
|
|
671
667
|
this.setEvents();
|
|
672
|
-
this.getActions()
|
|
673
|
-
|
|
674
|
-
});
|
|
668
|
+
await this.getActions();
|
|
669
|
+
this.loadItems();
|
|
675
670
|
}
|
|
676
671
|
async componentDidLoad() {
|
|
677
672
|
if (!this._element)
|
|
@@ -698,6 +693,11 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
698
693
|
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
|
699
694
|
};
|
|
700
695
|
}
|
|
696
|
+
async loadParameters() {
|
|
697
|
+
if (SnkActionsButton.parameters.isOrderActions != null)
|
|
698
|
+
return;
|
|
699
|
+
SnkActionsButton.parameters.isOrderActions = await this._application.getBooleanParam('global.ordenar.acoes.personalizadas');
|
|
700
|
+
}
|
|
701
701
|
render() {
|
|
702
702
|
return (h(Host, null, (this._actions && this._actions.length > 0) &&
|
|
703
703
|
(h("div", { class: `ez-padding-left--medium snk-actions-button
|
|
@@ -713,10 +713,11 @@ const SnkActionsButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
713
713
|
static get style() { return snkActionsButtonCss; }
|
|
714
714
|
}, [2, "snk-actions-button", {
|
|
715
715
|
"_items": [32],
|
|
716
|
-
"_showDropdown": [32]
|
|
717
|
-
"_actions": [32],
|
|
718
|
-
"_isOrderActions": [32]
|
|
716
|
+
"_showDropdown": [32]
|
|
719
717
|
}]);
|
|
718
|
+
SnkActionsButton.parameters = {
|
|
719
|
+
isOrderActions: null
|
|
720
|
+
};
|
|
720
721
|
function defineCustomElement() {
|
|
721
722
|
if (typeof customElements === "undefined") {
|
|
722
723
|
return;
|
|
@@ -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 { D as DataUnitFetcher } from './dataunit-fetcher.js';
|
|
7
|
+
import { P as PreloadManager, 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,6 +74,7 @@ class TotalsFetcher {
|
|
|
74
74
|
class ParametersFetcher {
|
|
75
75
|
constructor() {
|
|
76
76
|
this._embeddedParams = new Map();
|
|
77
|
+
this._cachedParams = new Map();
|
|
77
78
|
this.templateByQuery = new Map();
|
|
78
79
|
try {
|
|
79
80
|
if (window["MGE_PARAMS"] != undefined) {
|
|
@@ -103,11 +104,16 @@ class ParametersFetcher {
|
|
|
103
104
|
if (this._embeddedParams.has(name)) {
|
|
104
105
|
return Promise.resolve(this._embeddedParams.get(name));
|
|
105
106
|
}
|
|
107
|
+
if (this._cachedParams.has(name)) {
|
|
108
|
+
return this._cachedParams.get(name);
|
|
109
|
+
}
|
|
106
110
|
const completPath = `param://application?params=${name}`;
|
|
107
|
-
|
|
111
|
+
const param = await DataFetcher.get().callGraphQL({
|
|
108
112
|
values: { name: completPath },
|
|
109
113
|
query: this.templateByQuery.get("fetchParam"),
|
|
110
114
|
});
|
|
115
|
+
this._cachedParams.set(name, param);
|
|
116
|
+
return param;
|
|
111
117
|
}
|
|
112
118
|
async asString(name) {
|
|
113
119
|
const paramArr = await this.getParam(name);
|
|
@@ -869,6 +875,16 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
869
875
|
async isLoadedByPk() {
|
|
870
876
|
return Promise.resolve(this._isLoadedByPk);
|
|
871
877
|
}
|
|
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
|
+
}
|
|
872
888
|
async getAuthList(auth) {
|
|
873
889
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
|
874
890
|
}
|
|
@@ -1407,6 +1423,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
1407
1423
|
"info": [64],
|
|
1408
1424
|
"loadTotals": [64],
|
|
1409
1425
|
"isLoadedByPk": [64],
|
|
1426
|
+
"preloadMangerRemoveRecord": [64],
|
|
1410
1427
|
"executeSearch": [64],
|
|
1411
1428
|
"executePreparedSearch": [64],
|
|
1412
1429
|
"isDebugMode": [64],
|
|
@@ -83,6 +83,7 @@ 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;
|
|
86
87
|
this.setCustomFormTitle = undefined;
|
|
87
88
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
88
89
|
}
|
|
@@ -323,11 +324,16 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
323
324
|
if (!isDocumentBody)
|
|
324
325
|
element.focus();
|
|
325
326
|
}
|
|
327
|
+
async function handleAddRecord() {
|
|
328
|
+
if (!dataUnit.hasNewRecord()) {
|
|
329
|
+
dataUnit.addRecord();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
326
332
|
keyboardManager
|
|
327
333
|
.bind("F6", this.toggleView.bind(this), { description: "Alterna entre modo formulário e grade.", element: this._element })
|
|
328
334
|
.bind("F7", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
329
335
|
.bind("ctrl + \\", saveDataUnitHandlingFocus.bind(this), { description: "Salva os dados.", element: this._element })
|
|
330
|
-
.bind("F8",
|
|
336
|
+
.bind("F8", handleAddRecord.bind(this), { description: "Adiciona um novo registro.", element: this._element })
|
|
331
337
|
.bind("F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
332
338
|
.bind("ctrl + F9", dataUnit.removeSelectedRecords.bind(dataUnit), { description: "Remove o registro selecionado.", element: this._element })
|
|
333
339
|
.bind("ctrl + .", () => {
|
|
@@ -424,7 +430,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
424
430
|
return;
|
|
425
431
|
}
|
|
426
432
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
|
427
|
-
return (h(Host, null, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item",
|
|
433
|
+
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--medium' }, 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" }))));
|
|
428
434
|
}
|
|
429
435
|
get _element() { return this; }
|
|
430
436
|
static get watchers() { return {
|
|
@@ -453,6 +459,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
453
459
|
"enableGridInsert": [4, "enable-grid-insert"],
|
|
454
460
|
"domainMessagesBuilder": [1, "domain-messages-builder"],
|
|
455
461
|
"ignoreReadOnlyFormFields": [4, "ignore-read-only-form-fields"],
|
|
462
|
+
"enableLockManger": [4, "enable-lock-manger"],
|
|
456
463
|
"setCustomFormTitle": [16],
|
|
457
464
|
"_dataUnit": [32],
|
|
458
465
|
"_dataState": [32],
|