@sankhyalabs/sankhyablocks 0.0.0-bugfix-dev-KB-68936.0 → 0.0.0-bugfix-dev-KB-38445.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/{ConfigStorage-a343e418.js → ConfigStorage-942ce74b.js} +0 -1
- package/dist/cjs/{IExporterProvider-d2a04ee7.js → IExporterProvider-597949f9.js} +2 -2
- package/dist/cjs/{SnkFormConfigManager-166cbd1f.js → SnkFormConfigManager-1b13bacd.js} +8 -6
- package/dist/cjs/{SnkMessageBuilder-28ceaaed.js → SnkMessageBuilder-722b104e.js} +1 -5
- package/dist/cjs/{dataunit-fetcher-75f89355.js → dataunit-fetcher-688d3f05.js} +2 -9
- package/dist/cjs/{field-search-68e34bf4.js → field-search-f56aa7d6.js} +1 -5
- 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 +2 -2
- package/dist/cjs/snk-application.cjs.entry.js +3 -3
- package/dist/cjs/snk-attach.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +2 -5
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -3
- package/dist/cjs/{snk-data-unit-bf418767.js → snk-data-unit-685272e7.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -7
- package/dist/cjs/snk-filter-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-form.cjs.entry.js +2 -2
- package/dist/cjs/snk-grid.cjs.entry.js +10 -35
- package/dist/cjs/{snk-guides-viewer-14c27834.js → snk-guides-viewer-67605336.js} +6 -10
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +5 -5
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +10 -28
- package/dist/collection/components/snk-crud/snk-crud.js +1 -22
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +3 -25
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +7 -5
- package/dist/collection/components/snk-form-config/snk-form-config.js +1 -1
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +6 -58
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +8 -43
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +1 -5
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +1 -1
- package/dist/collection/lib/configs/ConfigStorage.js +0 -1
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +2 -9
- package/dist/collection/lib/message/resources/snk-grid.msg.js +1 -5
- package/dist/components/ConfigStorage.js +0 -1
- package/dist/components/IExporterProvider.js +2 -6
- package/dist/components/SnkFormConfigManager.js +7 -5
- package/dist/components/SnkMessageBuilder.js +1 -5
- package/dist/components/dataunit-fetcher.js +2 -9
- package/dist/components/snk-crud.js +1 -5
- package/dist/components/snk-detail-view2.js +5 -9
- package/dist/components/snk-form-config2.js +1 -1
- package/dist/components/snk-grid2.js +8 -34
- package/dist/components/snk-simple-crud2.js +5 -24
- package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-86187da3.js} +0 -1
- package/dist/esm/{IExporterProvider-b2e244b3.js → IExporterProvider-63a188b6.js} +2 -2
- package/dist/esm/{SnkFormConfigManager-31b24066.js → SnkFormConfigManager-d4554df9.js} +8 -6
- package/dist/esm/{SnkMessageBuilder-0485b99a.js → SnkMessageBuilder-89925609.js} +1 -5
- package/dist/esm/{dataunit-fetcher-6463ac8d.js → dataunit-fetcher-264191b2.js} +2 -9
- package/dist/esm/{field-search-f8b1d91e.js → field-search-efbe307f.js} +1 -5
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +2 -2
- package/dist/esm/snk-application.entry.js +3 -3
- package/dist/esm/snk-attach.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +2 -5
- package/dist/esm/snk-data-exporter.entry.js +3 -3
- package/dist/esm/{snk-data-unit-20860cfc.js → snk-data-unit-63f83504.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +8 -7
- package/dist/esm/snk-filter-bar.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-form.entry.js +2 -2
- package/dist/esm/snk-grid.entry.js +10 -35
- package/dist/esm/{snk-guides-viewer-b82ec79a.js → snk-guides-viewer-151f6091.js} +6 -10
- package/dist/esm/snk-guides-viewer.entry.js +5 -5
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +10 -28
- package/dist/sankhyablocks/p-14a08904.entry.js +1 -0
- package/dist/sankhyablocks/{p-ebc4011a.entry.js → p-14b9f964.entry.js} +1 -1
- package/dist/sankhyablocks/p-19c18d06.entry.js +1 -0
- package/dist/sankhyablocks/{p-0e85d9ba.js → p-3a212712.js} +1 -1
- package/dist/sankhyablocks/{p-d6e26ea8.entry.js → p-47b60deb.entry.js} +1 -1
- package/dist/sankhyablocks/{p-249adf8b.entry.js → p-7505da04.entry.js} +1 -1
- package/dist/sankhyablocks/p-75f83d1d.entry.js +1 -0
- package/dist/sankhyablocks/p-7a337364.js +1 -0
- package/dist/sankhyablocks/p-829d4045.js +1 -0
- package/dist/sankhyablocks/{p-74fafa0d.entry.js → p-82a0bfb0.entry.js} +2 -2
- package/dist/sankhyablocks/{p-62ba211a.entry.js → p-8fc470e5.entry.js} +1 -1
- package/dist/sankhyablocks/{p-95e44a9c.entry.js → p-941bf3ef.entry.js} +1 -1
- package/dist/sankhyablocks/{p-47db7e88.entry.js → p-a1d72395.entry.js} +1 -1
- package/dist/sankhyablocks/{p-52920496.js → p-aff76a53.js} +1 -1
- package/dist/sankhyablocks/p-b4b21558.entry.js +1 -0
- package/dist/sankhyablocks/{p-d0bec13f.entry.js → p-bad55caa.entry.js} +1 -1
- package/dist/sankhyablocks/p-c053256c.entry.js +1 -0
- package/dist/sankhyablocks/p-c2495304.js +1 -0
- package/dist/sankhyablocks/{p-2f978e29.entry.js → p-c5268346.entry.js} +1 -1
- package/dist/sankhyablocks/p-cefba299.js +1 -0
- package/dist/sankhyablocks/{p-2c68b3ae.entry.js → p-eae7a817.entry.js} +1 -1
- package/dist/sankhyablocks/{p-950037cb.js → p-fcac4dfc.js} +1 -1
- package/dist/sankhyablocks/{p-b4d016a3.js → p-fe79f83a.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -4
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +0 -5
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +2 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +0 -9
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -7
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +0 -1
- package/dist/types/components.d.ts +0 -32
- package/package.json +2 -2
- package/dist/sankhyablocks/p-14c2056a.js +0 -1
- package/dist/sankhyablocks/p-23736d75.js +0 -1
- package/dist/sankhyablocks/p-2a408684.js +0 -1
- package/dist/sankhyablocks/p-4111c6ce.entry.js +0 -1
- package/dist/sankhyablocks/p-4238fcd4.entry.js +0 -1
- package/dist/sankhyablocks/p-450c60e4.entry.js +0 -1
- package/dist/sankhyablocks/p-6614c578.js +0 -1
- package/dist/sankhyablocks/p-6fede3d4.entry.js +0 -1
- package/dist/sankhyablocks/p-701442ef.entry.js +0 -1
|
@@ -80,7 +80,7 @@ const SnkFormConfig = class {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
getConfig() {
|
|
83
|
-
let config = this.configManager.getConfig(this.dataUnit);
|
|
83
|
+
let config = this.configManager.getConfig(false, this.dataUnit);
|
|
84
84
|
if (config.fields && config.fields.length === 0) {
|
|
85
85
|
config = undefined;
|
|
86
86
|
}
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
|
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
|
9
|
-
require('./ConfigStorage-
|
|
9
|
+
require('./ConfigStorage-942ce74b.js');
|
|
10
10
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
11
11
|
require('./DataFetcher-313debd8.js');
|
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -5,18 +5,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
|
9
9
|
const index$1 = require('./index-1dfc7a6e.js');
|
|
10
|
-
const fieldSearch = require('./field-search-
|
|
10
|
+
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
|
12
|
+
const IExporterProvider = require('./IExporterProvider-597949f9.js');
|
|
13
13
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
14
14
|
require('./DataFetcher-313debd8.js');
|
|
15
15
|
require('./pesquisa-fetcher-680e198f.js');
|
|
16
16
|
require('./ISave-e91b70a7.js');
|
|
17
17
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
19
|
-
require('./dataunit-fetcher-
|
|
19
|
+
require('./dataunit-fetcher-688d3f05.js');
|
|
20
20
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
21
21
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
22
22
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
|
@@ -80,7 +80,7 @@ class ServerSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100
|
|
83
|
+
const snkGridCss = ".sc-snk-grid-h{--snk-grid-min-height:300px;--snk-grid-padding:var(--space--lg)}.snk-grid__container.sc-snk-grid{display:flex;height:100%;width:100%;padding:var(--snk-grid-padding)}.snk-grid__header.sc-snk-grid{width:100%;display:flex;flex-wrap:nowrap;justify-content:flex-end}.snk-grid__filter-bar.sc-snk-grid{width:100%}.snk-grid__header-divider.sc-snk-grid{margin-bottom:var(--space--medium)}.snk-grid__table.sc-snk-grid{min-height:var(--snk-grid-min-height)}.snk-grid-container__without-shadow.sc-snk-grid{--ezgrid__container--shadow:unset}";
|
|
84
84
|
|
|
85
85
|
const SnkGrid = class {
|
|
86
86
|
constructor(hostRef) {
|
|
@@ -93,7 +93,7 @@ const SnkGrid = class {
|
|
|
93
93
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
|
94
94
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
|
95
95
|
"snkGridTopTaskbar.regular.singleTaskbar": [],
|
|
96
|
-
"snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE"
|
|
96
|
+
"snkGridTopTaskbar.finish_edition": ["CANCEL", "SAVE"],
|
|
97
97
|
"snkGridTopTaskbar.finish_edition.secondary": [],
|
|
98
98
|
"snkGridTopTaskbar.finish_edition.singleTaskbar": [],
|
|
99
99
|
});
|
|
@@ -106,7 +106,7 @@ const SnkGrid = class {
|
|
|
106
106
|
"snkGridHeaderTaskbar.singleTaskbar.selected": ["UPDATE", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "ATTACH", "FORM_MODE", "CONFIGURATOR", "REFRESH", "DATA_EXPORTER", "ACTIONS_BUTTON"],
|
|
107
107
|
"snkGridHeaderTaskbar.singleTaskbar.detail.unselected": ["INSERT", "FORM_MODE", "CONFIGURATOR", "REFRESH", "MORE_OPTIONS"],
|
|
108
108
|
"snkGridHeaderTaskbar.singleTaskbar.detail.selected": ["UPDATE", "ATTACH", "CLONE", "REMOVE", "MORE_OPTIONS", "DIVIDER", "FORM_MODE", "CONFIGURATOR", "REFRESH"],
|
|
109
|
-
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"
|
|
109
|
+
"snkGridHeaderTaskbar.singleTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
110
110
|
});
|
|
111
111
|
this.dataUnitInterceptor = {
|
|
112
112
|
interceptAction: async (action) => {
|
|
@@ -144,7 +144,6 @@ const SnkGrid = class {
|
|
|
144
144
|
this.filterBarLegacyConfigName = undefined;
|
|
145
145
|
this.autoLoad = undefined;
|
|
146
146
|
this.autoFocus = true;
|
|
147
|
-
this.enableGridInsert = false;
|
|
148
147
|
}
|
|
149
148
|
/**
|
|
150
149
|
* Exibe a janela de configurações da grade.
|
|
@@ -231,16 +230,6 @@ const SnkGrid = class {
|
|
|
231
230
|
async setFocus() {
|
|
232
231
|
this._grid.setFocus();
|
|
233
232
|
}
|
|
234
|
-
async handleClick(event) {
|
|
235
|
-
if (this.hasToBlockEvent(event)) {
|
|
236
|
-
event.preventDefault();
|
|
237
|
-
event.stopPropagation();
|
|
238
|
-
await this._dataUnit.cancelEdition();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
hasToBlockEvent(event) {
|
|
242
|
-
return this._snkFilterBar.contains(event.target) && this.enableGridInsert && this._dataUnit.hasNewRecord();
|
|
243
|
-
}
|
|
244
233
|
async handleGridLegacyConfigName(newLegacyConfig, oldLegacyConfig) {
|
|
245
234
|
if (!newLegacyConfig) {
|
|
246
235
|
return;
|
|
@@ -251,9 +240,6 @@ const SnkGrid = class {
|
|
|
251
240
|
this.addGridLegacyConfigName();
|
|
252
241
|
this.loadConfig();
|
|
253
242
|
}
|
|
254
|
-
handleAddFormMode() {
|
|
255
|
-
return this.enableGridInsert ? taskbarElements.TaskbarElement.FORM_MODE : "";
|
|
256
|
-
}
|
|
257
243
|
openGridConfig() {
|
|
258
244
|
this._grid.getColumnsState()
|
|
259
245
|
.then((gridColumns) => {
|
|
@@ -383,9 +369,8 @@ const SnkGrid = class {
|
|
|
383
369
|
this.loadConfig();
|
|
384
370
|
}
|
|
385
371
|
componentDidRender() {
|
|
386
|
-
var _a, _b;
|
|
387
372
|
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
|
388
|
-
this.loadGridCustomFormatters(
|
|
373
|
+
this.loadGridCustomFormatters(this._dataUnit.metadata.fields);
|
|
389
374
|
this.setCustomRenders();
|
|
390
375
|
this.setCustomEditors();
|
|
391
376
|
}
|
|
@@ -483,8 +468,6 @@ const SnkGrid = class {
|
|
|
483
468
|
eagerInitialize: true,
|
|
484
469
|
itemBuilder: (actionButton, item) => this.getColumnSearch(actionButton, item)
|
|
485
470
|
}];
|
|
486
|
-
if (this.isGridInsertActive())
|
|
487
|
-
return hardList;
|
|
488
471
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
489
472
|
const taskbarID = this.getTopTaskBarId();
|
|
490
473
|
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this._dataState, this.actionsList));
|
|
@@ -502,20 +485,12 @@ const SnkGrid = class {
|
|
|
502
485
|
}
|
|
503
486
|
this._showSnkFilterBar = true;
|
|
504
487
|
}
|
|
505
|
-
getGridHeaderButtons() {
|
|
506
|
-
if (this.isGridInsertActive())
|
|
507
|
-
return taskbarElements.TaskbarElement.MORE_OPTIONS;
|
|
508
|
-
return this._headerTaskbarProcessor.buttons;
|
|
509
|
-
}
|
|
510
|
-
isGridInsertActive() {
|
|
511
|
-
return this.enableGridInsert && this._dataUnit.hasNewRecord();
|
|
512
|
-
}
|
|
513
488
|
render() {
|
|
514
489
|
if (!this._dataUnit) {
|
|
515
490
|
return undefined;
|
|
516
491
|
}
|
|
517
|
-
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto
|
|
518
|
-
index.h(index.Fragment, null, index.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 }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.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' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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
|
|
492
|
+
return (index.h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto" }, index.h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
|
493
|
+
index.h(index.Fragment, null, index.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 }), index.h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), index.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' }, index.h("slot", { name: this.topTaskbarCustomSlotId }))), index.h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === index$1.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 }, index.h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, 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 }, index.h("slot", { name: this.gridHeaderCustomSlotId }))), index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("slot", { name: "SnkGridFooter" })), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
519
494
|
}
|
|
520
495
|
get _element() { return index.getElement(this); }
|
|
521
496
|
static get watchers() { return {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
|
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
7
|
-
const fieldSearch = require('./field-search-
|
|
7
|
+
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
8
8
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
|
10
10
|
require('./DataFetcher-313debd8.js');
|
|
@@ -13,7 +13,7 @@ const index$1 = require('./index-1dfc7a6e.js');
|
|
|
13
13
|
require('./ISave-e91b70a7.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
16
|
-
require('./dataunit-fetcher-
|
|
16
|
+
require('./dataunit-fetcher-688d3f05.js');
|
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
18
18
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
19
19
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
|
@@ -43,7 +43,6 @@ const SnkGuidesViewer = class {
|
|
|
43
43
|
this.resourceID = undefined;
|
|
44
44
|
this.detailTaskbarCustomContainerId = undefined;
|
|
45
45
|
this.formLegacyConfigName = undefined;
|
|
46
|
-
this.enableGridInsert = false;
|
|
47
46
|
this._hasToCreateFieldSearch = true;
|
|
48
47
|
this._breadcrumbItems = [];
|
|
49
48
|
this._guides = undefined;
|
|
@@ -112,7 +111,7 @@ const SnkGuidesViewer = class {
|
|
|
112
111
|
this._container.focus();
|
|
113
112
|
}
|
|
114
113
|
exitViewer() {
|
|
115
|
-
if (
|
|
114
|
+
if (this.dataUnit.isDirty()) {
|
|
116
115
|
this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
|
117
116
|
}
|
|
118
117
|
else {
|
|
@@ -130,7 +129,7 @@ const SnkGuidesViewer = class {
|
|
|
130
129
|
}
|
|
131
130
|
onContentCardChanged(evt) {
|
|
132
131
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
|
133
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
|
132
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataState.insertionMode, this.dataUnit));
|
|
134
133
|
}
|
|
135
134
|
/**
|
|
136
135
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -221,13 +220,10 @@ const SnkGuidesViewer = class {
|
|
|
221
220
|
const invisibleButtons = this.getInvisibleButtons();
|
|
222
221
|
this._taskbarProcessor = new fieldSearch.TaskbarProcessor({
|
|
223
222
|
"snkGuideViewer.regular": btnsRegularMode,
|
|
224
|
-
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"
|
|
223
|
+
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"],
|
|
225
224
|
});
|
|
226
225
|
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this.dataState, disabledButtons, invisibleButtons);
|
|
227
226
|
}
|
|
228
|
-
handleAddGridMode() {
|
|
229
|
-
return this.enableGridInsert ? taskbarElements.TaskbarElement.GRID_MODE : "";
|
|
230
|
-
}
|
|
231
227
|
getInvisibleButtons() {
|
|
232
228
|
const invisibleButtons = [];
|
|
233
229
|
if (this.dataState && this.dataState.selectionInfo.mode === DataUnit.SelectionMode.ALL_RECORDS)
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-67605336.js');
|
|
6
6
|
require('./index-f9e81701.js');
|
|
7
7
|
require('@sankhyalabs/core');
|
|
8
|
-
require('./SnkFormConfigManager-
|
|
9
|
-
require('./ConfigStorage-
|
|
8
|
+
require('./SnkFormConfigManager-1b13bacd.js');
|
|
9
|
+
require('./ConfigStorage-942ce74b.js');
|
|
10
10
|
require('./form-config-fetcher-2dd00e5b.js');
|
|
11
11
|
require('./DataFetcher-313debd8.js');
|
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
|
16
|
-
require('./field-search-
|
|
16
|
+
require('./field-search-f56aa7d6.js');
|
|
17
17
|
require('./taskbar-elements-9ad1f9c0.js');
|
|
18
18
|
require('./index-1dfc7a6e.js');
|
|
19
19
|
require('./index-102ba62d.js');
|
|
@@ -21,7 +21,7 @@ require('./constants-35ddd366.js');
|
|
|
21
21
|
require('./pesquisa-fetcher-680e198f.js');
|
|
22
22
|
require('./ISave-e91b70a7.js');
|
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
24
|
-
require('./dataunit-fetcher-
|
|
24
|
+
require('./dataunit-fetcher-688d3f05.js');
|
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
26
26
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
27
27
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-0184ffbb.js');
|
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
8
|
+
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
|
@@ -9,17 +9,17 @@ const constants = require('./constants-35ddd366.js');
|
|
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
|
10
10
|
require('./DataFetcher-313debd8.js');
|
|
11
11
|
require('./pesquisa-fetcher-680e198f.js');
|
|
12
|
-
const IExporterProvider = require('./IExporterProvider-
|
|
12
|
+
const IExporterProvider = require('./IExporterProvider-597949f9.js');
|
|
13
13
|
const index = require('./index-1dfc7a6e.js');
|
|
14
14
|
require('./ISave-e91b70a7.js');
|
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-688d3f05.js');
|
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
19
19
|
const formConfigFetcher = require('./form-config-fetcher-2dd00e5b.js');
|
|
20
|
-
const fieldSearch = require('./field-search-
|
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
|
20
|
+
const fieldSearch = require('./field-search-f56aa7d6.js');
|
|
21
|
+
const ConfigStorage = require('./ConfigStorage-942ce74b.js');
|
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-1b13bacd.js');
|
|
23
23
|
const RecordIDUtils = require('./RecordIDUtils-3735135c.js');
|
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
|
@@ -107,7 +107,7 @@ const SnkSimpleCrud = class {
|
|
|
107
107
|
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
|
|
108
108
|
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE]),
|
|
109
109
|
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
|
|
110
|
-
"snkSimpleCrudTaskbar.finish_edition":
|
|
110
|
+
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
|
111
111
|
});
|
|
112
112
|
this._showPopUpGridConfig = false;
|
|
113
113
|
this._showFormConfig = false;
|
|
@@ -127,7 +127,6 @@ const SnkSimpleCrud = class {
|
|
|
127
127
|
this.useCancelConfirm = true;
|
|
128
128
|
this.pageSize = 150;
|
|
129
129
|
this.resourceID = undefined;
|
|
130
|
-
this.enableGridInsert = false;
|
|
131
130
|
this.taskbarManager = undefined;
|
|
132
131
|
this.messagesBuilder = undefined;
|
|
133
132
|
this.useEnterLikeTab = false;
|
|
@@ -196,13 +195,6 @@ const SnkSimpleCrud = class {
|
|
|
196
195
|
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
|
197
196
|
this._fieldsProps = newCustomFieldProps;
|
|
198
197
|
}
|
|
199
|
-
getFinishEditionButtonsCallback() {
|
|
200
|
-
const btns = ["CANCEL", "SAVE"];
|
|
201
|
-
if (this.enableGridInsert && this._currentViewMode !== constants.VIEW_MODE.ATTACHMENT) {
|
|
202
|
-
btns.push(this._currentViewMode === constants.VIEW_MODE.GRID ? taskbarElements.TaskbarElement.FORM_MODE : taskbarElements.TaskbarElement.GRID_MODE);
|
|
203
|
-
}
|
|
204
|
-
return btns;
|
|
205
|
-
}
|
|
206
198
|
getButtons(selected, extraButtons) {
|
|
207
199
|
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
|
208
200
|
.concat(extraButtons));
|
|
@@ -641,9 +633,6 @@ const SnkSimpleCrud = class {
|
|
|
641
633
|
const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
|
|
642
634
|
return Promise.resolve(options);
|
|
643
635
|
}
|
|
644
|
-
isGridInsertActive() {
|
|
645
|
-
return this.enableGridInsert && this.dataUnit.hasNewRecord();
|
|
646
|
-
}
|
|
647
636
|
getActionsList() {
|
|
648
637
|
var _a, _b;
|
|
649
638
|
const hardList = [{
|
|
@@ -655,8 +644,6 @@ const SnkSimpleCrud = class {
|
|
|
655
644
|
? this.getColumnSearch(actionButton, item)
|
|
656
645
|
: this.getFieldSearch(actionButton, item)
|
|
657
646
|
}];
|
|
658
|
-
if (this.isGridInsertActive())
|
|
659
|
-
return hardList;
|
|
660
647
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
661
648
|
const taskbarID = this.getTopTaskBarId();
|
|
662
649
|
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
|
@@ -765,8 +752,8 @@ const SnkSimpleCrud = class {
|
|
|
765
752
|
return core.StringUtils.isEmpty(this.resourceID) ? this._resourceID : this.resourceID;
|
|
766
753
|
}
|
|
767
754
|
getFormConfig() {
|
|
768
|
-
var _a;
|
|
769
|
-
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
755
|
+
var _a, _b;
|
|
756
|
+
const configFromManager = (_a = this._formConfigManager) === null || _a === void 0 ? void 0 : _a.getConfig((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.insertionMode, this.dataUnit, this.ignoreReadOnlyFormFields);
|
|
770
757
|
if (!this.configName && !configFromManager) {
|
|
771
758
|
return this.formConfig;
|
|
772
759
|
}
|
|
@@ -780,20 +767,15 @@ const SnkSimpleCrud = class {
|
|
|
780
767
|
}
|
|
781
768
|
this._formConfigManager.setConfig(this.formConfig);
|
|
782
769
|
}
|
|
783
|
-
handleDataUnitOnInsertionMode() {
|
|
784
|
-
if (this.enableGridInsert)
|
|
785
|
-
return;
|
|
786
|
-
this.goToView(constants.VIEW_MODE.FORM);
|
|
787
|
-
}
|
|
788
770
|
/* istanbul ignore next */
|
|
789
771
|
render() {
|
|
790
772
|
var _a;
|
|
791
773
|
if (this.dataUnit == undefined) {
|
|
792
774
|
return;
|
|
793
775
|
}
|
|
794
|
-
return (index$1.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.
|
|
776
|
+
return (index$1.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.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this) }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, index$1.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium", 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: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.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(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
|
795
777
|
? undefined
|
|
796
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus
|
|
778
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.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() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.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 })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
|
797
779
|
}
|
|
798
780
|
get _element() { return index$1.getElement(this); }
|
|
799
781
|
static get watchers() { return {
|
|
@@ -39,7 +39,6 @@ export class SnkCrud {
|
|
|
39
39
|
this.disablePersonalizedFilter = undefined;
|
|
40
40
|
this.autoLoad = undefined;
|
|
41
41
|
this.autoFocus = true;
|
|
42
|
-
this.enableGridInsert = false;
|
|
43
42
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
44
43
|
}
|
|
45
44
|
/**
|
|
@@ -163,8 +162,6 @@ export class SnkCrud {
|
|
|
163
162
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
|
164
163
|
}
|
|
165
164
|
insertionModeHandler() {
|
|
166
|
-
if (this.enableGridInsert)
|
|
167
|
-
return;
|
|
168
165
|
this.gridToForm();
|
|
169
166
|
}
|
|
170
167
|
cancelHandler() {
|
|
@@ -379,7 +376,7 @@ export class SnkCrud {
|
|
|
379
376
|
return;
|
|
380
377
|
}
|
|
381
378
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
|
382
|
-
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
|
|
379
|
+
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 }, 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 }, 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" }))));
|
|
383
380
|
}
|
|
384
381
|
static get is() { return "snk-crud"; }
|
|
385
382
|
static get encapsulation() { return "scoped"; }
|
|
@@ -735,24 +732,6 @@ export class SnkCrud {
|
|
|
735
732
|
"attribute": "auto-focus",
|
|
736
733
|
"reflect": false,
|
|
737
734
|
"defaultValue": "true"
|
|
738
|
-
},
|
|
739
|
-
"enableGridInsert": {
|
|
740
|
-
"type": "boolean",
|
|
741
|
-
"mutable": false,
|
|
742
|
-
"complexType": {
|
|
743
|
-
"original": "boolean",
|
|
744
|
-
"resolved": "boolean",
|
|
745
|
-
"references": {}
|
|
746
|
-
},
|
|
747
|
-
"required": false,
|
|
748
|
-
"optional": true,
|
|
749
|
-
"docs": {
|
|
750
|
-
"tags": [],
|
|
751
|
-
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
|
752
|
-
},
|
|
753
|
-
"attribute": "enable-grid-insert",
|
|
754
|
-
"reflect": false,
|
|
755
|
-
"defaultValue": "false"
|
|
756
735
|
}
|
|
757
736
|
};
|
|
758
737
|
}
|
package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js
CHANGED
|
@@ -158,13 +158,14 @@ export class SnkDetailView {
|
|
|
158
158
|
return guideId.replace(SnkDetailView.REGEX_FORM_ID, "");
|
|
159
159
|
}
|
|
160
160
|
loadMetadata() {
|
|
161
|
+
var _a;
|
|
161
162
|
if (!this.dataUnit) {
|
|
162
163
|
return;
|
|
163
164
|
}
|
|
164
165
|
if (!this.formConfigManager.isLoaded) {
|
|
165
166
|
return;
|
|
166
167
|
}
|
|
167
|
-
const formConfig = this.formConfigManager.getConfig(this.dataUnit);
|
|
168
|
+
const formConfig = this.formConfigManager.getConfig((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.insertionMode, this.dataUnit);
|
|
168
169
|
//this._cardsState = formConfig?.cardsState;
|
|
169
170
|
this._formMetadata = buildFormMetadata(formConfig == undefined || formConfig.fields.length === 0 ? undefined : formConfig, this.dataUnit, true);
|
|
170
171
|
}
|
|
@@ -27,7 +27,6 @@ export class SnkGuidesViewer {
|
|
|
27
27
|
this.resourceID = undefined;
|
|
28
28
|
this.detailTaskbarCustomContainerId = undefined;
|
|
29
29
|
this.formLegacyConfigName = undefined;
|
|
30
|
-
this.enableGridInsert = false;
|
|
31
30
|
this._hasToCreateFieldSearch = true;
|
|
32
31
|
this._breadcrumbItems = [];
|
|
33
32
|
this._guides = undefined;
|
|
@@ -96,7 +95,7 @@ export class SnkGuidesViewer {
|
|
|
96
95
|
this._container.focus();
|
|
97
96
|
}
|
|
98
97
|
exitViewer() {
|
|
99
|
-
if (
|
|
98
|
+
if (this.dataUnit.isDirty()) {
|
|
100
99
|
this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
|
101
100
|
}
|
|
102
101
|
else {
|
|
@@ -114,7 +113,7 @@ export class SnkGuidesViewer {
|
|
|
114
113
|
}
|
|
115
114
|
onContentCardChanged(evt) {
|
|
116
115
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
|
117
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
|
116
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataState.insertionMode, this.dataUnit));
|
|
118
117
|
}
|
|
119
118
|
/**
|
|
120
119
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
|
@@ -205,13 +204,10 @@ export class SnkGuidesViewer {
|
|
|
205
204
|
const invisibleButtons = this.getInvisibleButtons();
|
|
206
205
|
this._taskbarProcessor = new TaskbarProcessor({
|
|
207
206
|
"snkGuideViewer.regular": btnsRegularMode,
|
|
208
|
-
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"
|
|
207
|
+
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"],
|
|
209
208
|
});
|
|
210
209
|
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this.dataState, disabledButtons, invisibleButtons);
|
|
211
210
|
}
|
|
212
|
-
handleAddGridMode() {
|
|
213
|
-
return this.enableGridInsert ? TaskbarElement.GRID_MODE : "";
|
|
214
|
-
}
|
|
215
211
|
getInvisibleButtons() {
|
|
216
212
|
const invisibleButtons = [];
|
|
217
213
|
if (this.dataState && this.dataState.selectionInfo.mode === SelectionMode.ALL_RECORDS)
|
|
@@ -798,24 +794,6 @@ export class SnkGuidesViewer {
|
|
|
798
794
|
},
|
|
799
795
|
"attribute": "form-legacy-config-name",
|
|
800
796
|
"reflect": false
|
|
801
|
-
},
|
|
802
|
-
"enableGridInsert": {
|
|
803
|
-
"type": "boolean",
|
|
804
|
-
"mutable": false,
|
|
805
|
-
"complexType": {
|
|
806
|
-
"original": "boolean",
|
|
807
|
-
"resolved": "boolean",
|
|
808
|
-
"references": {}
|
|
809
|
-
},
|
|
810
|
-
"required": false,
|
|
811
|
-
"optional": true,
|
|
812
|
-
"docs": {
|
|
813
|
-
"tags": [],
|
|
814
|
-
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
|
815
|
-
},
|
|
816
|
-
"attribute": "enable-grid-insert",
|
|
817
|
-
"reflect": false,
|
|
818
|
-
"defaultValue": "false"
|
|
819
797
|
}
|
|
820
798
|
};
|
|
821
799
|
}
|
|
@@ -73,8 +73,10 @@ export class SnkFormConfigManager {
|
|
|
73
73
|
if (fields != undefined && fields.length > 0) {
|
|
74
74
|
return fields.map(({ label, name, readOnly, visible, required }) => {
|
|
75
75
|
if (label == undefined) {
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
return Object.assign(Object.assign({}, dataUnit.getField(name)), { name,
|
|
77
|
+
readOnly,
|
|
78
|
+
visible,
|
|
79
|
+
required });
|
|
78
80
|
}
|
|
79
81
|
return { name, label, readOnly, visible, required };
|
|
80
82
|
})
|
|
@@ -98,7 +100,7 @@ export class SnkFormConfigManager {
|
|
|
98
100
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
|
99
101
|
return normalizedText.includes(normalizedFilter);
|
|
100
102
|
}
|
|
101
|
-
|
|
103
|
+
getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
102
104
|
let fields = this.getFieldsList(dataUnit);
|
|
103
105
|
if (ignoreReadOnlyFormFields) {
|
|
104
106
|
fields = fields.filter(field => {
|
|
@@ -130,8 +132,8 @@ export class SnkFormConfigManager {
|
|
|
130
132
|
this._onConfigChange(Object.assign({}, this._config));
|
|
131
133
|
}
|
|
132
134
|
}
|
|
133
|
-
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
|
134
|
-
return this.
|
|
135
|
+
getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
|
|
136
|
+
return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
|
|
135
137
|
}
|
|
136
138
|
getFormConfigFetcher() {
|
|
137
139
|
if (this._formConfigFetcher == undefined) {
|
|
@@ -67,7 +67,7 @@ export class SnkFormConfig {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
getConfig() {
|
|
70
|
-
let config = this.configManager.getConfig(this.dataUnit);
|
|
70
|
+
let config = this.configManager.getConfig(false, this.dataUnit);
|
|
71
71
|
if (config.fields && config.fields.length === 0) {
|
|
72
72
|
config = undefined;
|
|
73
73
|
}
|