@sankhyalabs/sankhyablocks 8.16.0-ms.1 → 8.16.0-ms.10
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/{ClientSideExporterProvider-2f5f350c.js → ClientSideExporterProvider-fe52f7cf.js} +63 -22
- package/dist/cjs/{ConfigStorage-d024aec8.js → ConfigStorage-6b633b10.js} +2 -2
- package/dist/cjs/{DataFetcher-65879b2c.js → DataFetcher-875371e9.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-c11d8468.js → SnkFormConfigManager-d680be08.js} +2 -2
- package/dist/cjs/{auth-fetcher-8480751c.js → auth-fetcher-24ba4135.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-449d51a3.js → dataunit-fetcher-b95768e8.js} +1 -1
- package/dist/cjs/{form-config-fetcher-90126e4c.js → form-config-fetcher-e0a512c3.js} +1 -1
- package/dist/cjs/{index-102ba62d.js → index-ab1cfb44.js} +3 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-5c583c93.js → pesquisa-fetcher-30cab386.js} +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -5
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_5.cjs.entry.js +5 -5
- package/dist/cjs/snk-application.cjs.entry.js +6 -6
- package/dist/cjs/snk-attach.cjs.entry.js +50 -21
- package/dist/cjs/snk-config-options_3.cjs.entry.js +4 -4
- package/dist/cjs/snk-crud.cjs.entry.js +9 -8
- package/dist/cjs/snk-data-exporter.cjs.entry.js +6 -6
- package/dist/cjs/{snk-data-unit-bbd384bf.js → snk-data-unit-33937ffe.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-detail-view.cjs.entry.js +9 -9
- package/dist/cjs/snk-expression-group_2.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +6 -5
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +11 -10
- package/dist/cjs/{snk-guides-viewer-5396062f.js → snk-guides-viewer-b6002ea7.js} +6 -6
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +4 -4
- package/dist/cjs/snk-pesquisa.cjs.entry.js +11 -5
- package/dist/cjs/snk-simple-crud.cjs.entry.js +12 -11
- package/dist/cjs/snk-taskbar.cjs.entry.js +6 -3
- package/dist/cjs/{taskbar-elements-7e19882d.js → taskbar-elements-ebddaef4.js} +1 -1
- package/dist/collection/components/snk-attach/snk-attach.js +27 -1
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +17 -13
- package/dist/collection/components/snk-crud/snk-crud.js +20 -1
- package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +51 -16
- package/dist/collection/components/snk-data-exporter/utils/ParserExport.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +2 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -0
- package/dist/collection/components/snk-grid/snk-grid.css +1 -0
- package/dist/collection/components/snk-grid/snk-grid.js +20 -1
- package/dist/collection/components/snk-pesquisa/pesquisa-grid/pesquisa-grid.js +1 -1
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +9 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +21 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +4 -1
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +8 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +1 -1
- package/dist/components/ContinuousInsertUtils.js +59 -18
- package/dist/components/DataFetcher.js +1 -1
- package/dist/components/index2.js +3 -4
- package/dist/components/pesquisa-grid2.js +1 -1
- package/dist/components/snk-attach2.js +43 -14
- package/dist/components/snk-crud.js +3 -1
- package/dist/components/snk-data-exporter2.js +1 -1
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/snk-filter-item2.js +2 -1
- package/dist/components/snk-grid2.js +4 -2
- package/dist/components/snk-pesquisa2.js +9 -2
- package/dist/components/snk-simple-crud2.js +4 -2
- package/dist/components/snk-taskbar2.js +4 -1
- package/dist/esm/{ClientSideExporterProvider-3537805a.js → ClientSideExporterProvider-bd24a4b3.js} +63 -22
- package/dist/esm/{ConfigStorage-373bb440.js → ConfigStorage-e5c1f4c0.js} +2 -2
- package/dist/esm/{DataFetcher-5221b992.js → DataFetcher-ecf5f903.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-5022f87f.js → SnkFormConfigManager-1efd102b.js} +2 -2
- package/dist/esm/{auth-fetcher-e32fe8a4.js → auth-fetcher-9987c66e.js} +1 -1
- package/dist/esm/{dataunit-fetcher-91b094f2.js → dataunit-fetcher-ed6e65ef.js} +1 -1
- package/dist/esm/{form-config-fetcher-126e2471.js → form-config-fetcher-34becd23.js} +1 -1
- package/dist/esm/{index-bdf75557.js → index-c57e49af.js} +3 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-4284f2a3.js → pesquisa-fetcher-e26c3295.js} +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +5 -5
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_5.entry.js +5 -5
- package/dist/esm/snk-application.entry.js +6 -6
- package/dist/esm/snk-attach.entry.js +50 -21
- package/dist/esm/snk-config-options_3.entry.js +4 -4
- package/dist/esm/snk-crud.entry.js +9 -8
- package/dist/esm/snk-data-exporter.entry.js +6 -6
- package/dist/esm/{snk-data-unit-b03bb5cf.js → snk-data-unit-6258b8ae.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-detail-view.entry.js +9 -9
- package/dist/esm/snk-expression-group_2.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +6 -5
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +11 -10
- package/dist/esm/{snk-guides-viewer-749d027c.js → snk-guides-viewer-39fae8d5.js} +6 -6
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +4 -4
- package/dist/esm/snk-pesquisa.entry.js +11 -5
- package/dist/esm/snk-simple-crud.entry.js +12 -11
- package/dist/esm/snk-taskbar.entry.js +6 -3
- package/dist/esm/{taskbar-elements-d2353c64.js → taskbar-elements-ed51e143.js} +1 -1
- package/dist/sankhyablocks/p-11afea24.entry.js +1 -0
- package/dist/sankhyablocks/p-18389343.entry.js +1 -0
- package/dist/sankhyablocks/{p-1435701f.js → p-22ddc147.js} +1 -1
- package/dist/sankhyablocks/{p-4be6e0e7.entry.js → p-240ac47f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-44efbeed.entry.js → p-2746d606.entry.js} +1 -1
- package/dist/sankhyablocks/p-3ce68be5.js +1 -0
- package/dist/sankhyablocks/{p-19dc71e9.js → p-3fcb90d6.js} +1 -1
- package/dist/sankhyablocks/{p-7b87d1a8.js → p-43769aa9.js} +1 -1
- package/dist/sankhyablocks/{p-647f9830.entry.js → p-4b01cbad.entry.js} +1 -1
- package/dist/sankhyablocks/{p-3fc82614.js → p-517efc93.js} +1 -1
- package/dist/sankhyablocks/{p-d62228fb.js → p-5a7e18f4.js} +1 -1
- package/dist/sankhyablocks/p-5e9fbd76.js +1 -0
- package/dist/sankhyablocks/{p-4fa79d68.entry.js → p-6b898a51.entry.js} +1 -1
- package/dist/sankhyablocks/p-77168ab4.entry.js +1 -0
- package/dist/sankhyablocks/{p-3653374d.js → p-7e0a0aae.js} +1 -1
- package/dist/sankhyablocks/p-91708c3d.entry.js +1 -0
- package/dist/sankhyablocks/{p-ad5e4f9d.entry.js → p-9523fc40.entry.js} +1 -1
- package/dist/sankhyablocks/p-9887a437.entry.js +1 -0
- package/dist/sankhyablocks/p-9ebc3f3b.entry.js +1 -0
- package/dist/sankhyablocks/p-a5bdcb3f.entry.js +1 -0
- package/dist/sankhyablocks/{p-82ee6dc3.entry.js → p-a61bbe18.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f0b9303b.js → p-a77bdadc.js} +1 -1
- package/dist/sankhyablocks/{p-23b47a92.js → p-abd9681c.js} +1 -1
- package/dist/sankhyablocks/{p-9d3a025a.entry.js → p-bfdf92e9.entry.js} +1 -1
- package/dist/sankhyablocks/p-cb1e77e0.entry.js +1 -0
- package/dist/sankhyablocks/{p-1cf39cfd.entry.js → p-d3b9b377.entry.js} +1 -1
- package/dist/sankhyablocks/p-e289826a.js +1 -0
- package/dist/sankhyablocks/p-e51c52cf.entry.js +1 -0
- package/dist/sankhyablocks/{p-c021a3a9.entry.js → p-e66bcb5c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-41c3bee5.js → p-ef076eea.js} +2 -2
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +4 -0
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +7 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +4 -0
- package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +1 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +1 -0
- package/dist/types/components.d.ts +24 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-0ce56d43.entry.js +0 -1
- package/dist/sankhyablocks/p-13391b3d.entry.js +0 -1
- package/dist/sankhyablocks/p-389ba782.entry.js +0 -1
- package/dist/sankhyablocks/p-3ba431c9.js +0 -1
- package/dist/sankhyablocks/p-4d87cd45.entry.js +0 -1
- package/dist/sankhyablocks/p-5dd7f4c7.js +0 -1
- package/dist/sankhyablocks/p-6234bda8.entry.js +0 -1
- package/dist/sankhyablocks/p-6dc031de.js +0 -1
- package/dist/sankhyablocks/p-a962a3e4.entry.js +0 -1
- package/dist/sankhyablocks/p-b2de1bcc.entry.js +0 -1
- package/dist/sankhyablocks/p-ca316523.entry.js +0 -1
- package/dist/sankhyablocks/p-ee53b000.entry.js +0 -1
@@ -4,15 +4,15 @@ 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 pesquisaFetcher = require('./pesquisa-fetcher-
|
8
|
-
require('./DataFetcher-
|
7
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-30cab386.js');
|
8
|
+
require('./DataFetcher-875371e9.js');
|
9
9
|
require('./index-e3e39724.js');
|
10
10
|
require('./ISave-e91b70a7.js');
|
11
11
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
12
12
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
13
|
-
require('./dataunit-fetcher-
|
13
|
+
require('./dataunit-fetcher-b95768e8.js');
|
14
14
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
15
|
-
require('./form-config-fetcher-
|
15
|
+
require('./form-config-fetcher-e0a512c3.js');
|
16
16
|
require('./constants-241934b3.js');
|
17
17
|
require('./PrintUtils-bcaeb82f.js');
|
18
18
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -39,6 +39,7 @@ const SnkPesquisa = class {
|
|
39
39
|
this._startLoading = false;
|
40
40
|
this._presentationMode = "list";
|
41
41
|
this._currentView = undefined;
|
42
|
+
this._valideDataSource = false;
|
42
43
|
this.searchLoader = undefined;
|
43
44
|
this.treeLoader = undefined;
|
44
45
|
this.selectItem = undefined;
|
@@ -309,10 +310,13 @@ const SnkPesquisa = class {
|
|
309
310
|
if (this.argument && (!isNaN(argumentNumber) || this.argument.length >= this._limitCharsToSearch)) {
|
310
311
|
this._changeDeboucingTimeout = setTimeout(() => {
|
311
312
|
this.doSearch(isNaN(argumentNumber) ? this.argument : argumentNumber.toString());
|
313
|
+
this._valideDataSource = true;
|
312
314
|
}, this._deboucingTime);
|
313
315
|
}
|
314
316
|
else {
|
315
317
|
this._itemList = undefined;
|
318
|
+
this._gridDataSource = [];
|
319
|
+
this._valideDataSource = false;
|
316
320
|
}
|
317
321
|
}
|
318
322
|
clearDeboucingTimeout() {
|
@@ -323,6 +327,7 @@ const SnkPesquisa = class {
|
|
323
327
|
}
|
324
328
|
onClickSearch() {
|
325
329
|
this.doSearch((this.argument || "").trim());
|
330
|
+
this._valideDataSource = true;
|
326
331
|
}
|
327
332
|
getMessageView() {
|
328
333
|
return this._startLoading
|
@@ -390,7 +395,8 @@ const SnkPesquisa = class {
|
|
390
395
|
var _a, _b;
|
391
396
|
return (index.h(index.Host, null, index.h("div", { class: "snk-pesquisa" }, index.h("div", { class: "snk-pesquisa__input" }, index.h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument, "data-element-id": "searchInput" }, index.h("ez-icon", { slot: "leftIcon", iconName: "search" }), this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
|
392
397
|
? index.h("button", { slot: "rightIcon", class: "snk-pesquisa__btn", onClick: () => this.clearSearch() }, index.h("ez-icon", { iconName: "close" }))
|
393
|
-
: undefined), index.h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() }), index.h("ez-button", { class: "ez-margin-left--medium", mode: "icon", iconName: this.getButtonModeInfo().iconName, title: this.getButtonModeInfo().title, onClick: async () => await this.handleChangeViewMode() })), index.h("div", { class: `snk-pesquisa__records-label ${this._currentView === pesquisaFetcher.PESQUISA_VIEW_MODE.TREE ? 'hidden' : ''}` }, index.h("label", { class: `snk-pesquisa__records ${this.hideRecordsMessage() ? "hidden" : ""}` }, this.getMessageView()), index.h("label", { class: `snk-pesquisa__records-limit ${this.hideLimitMessage() ? "hidden" : ""}` }, "Essa pesquisa foi limitada, existem mais resultados.")), index.h("div", { class: "snk-pesquisa__content" }, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null,
|
398
|
+
: undefined), index.h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() }), index.h("ez-button", { class: "ez-margin-left--medium", mode: "icon", iconName: this.getButtonModeInfo().iconName, title: this.getButtonModeInfo().title, onClick: async () => await this.handleChangeViewMode() })), index.h("div", { class: `snk-pesquisa__records-label ${this._currentView === pesquisaFetcher.PESQUISA_VIEW_MODE.TREE ? 'hidden' : ''}` }, index.h("label", { class: `snk-pesquisa__records ${this.hideRecordsMessage() ? "hidden" : ""}` }, this.getMessageView()), index.h("label", { class: `snk-pesquisa__records-limit ${this.hideLimitMessage() ? "hidden" : ""}` }, "Essa pesquisa foi limitada, existem mais resultados.")), index.h("div", { class: "snk-pesquisa__content" }, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, this._valideDataSource &&
|
399
|
+
index.h("pesquisa-grid", { metadata: this._gridMetadata, dataSource: this._gridDataSource, pkField: this._pkField, descriptionField: this._descriptionField, entityName: this.entityName, shouldLoadConfig: this._currentView === pesquisaFetcher.PESQUISA_VIEW_MODE.GRID, onPesquisaGridSelectItem: ({ detail }) => this.selectItem(detail) })), index.h("stack-item", null, index.h("div", { class: 'snk-pesquisa__cards-container' }, (_b = this._itemList) === null || _b === void 0 ? void 0 : _b.map((item) => {
|
394
400
|
return (index.h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
|
395
401
|
}))), index.h("stack-item", null, index.h("pesquisa-tree", { ref: (element) => this._pesquisaTree = element, argument: this.argument, treeLoader: this.treeLoader, allowsNonAnalytic: this.allowsNonAnalytic, shouldLoadTree: this._currentView === pesquisaFetcher.PESQUISA_VIEW_MODE.TREE, onPesquisaTreeSelectItem: ({ detail }) => this.selectItem(detail) })))))));
|
396
402
|
}
|
@@ -6,21 +6,21 @@ const index = require('./index-f9e81701.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const constants = require('./constants-241934b3.js');
|
9
|
-
const taskbarElements = require('./taskbar-elements-
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
12
|
-
const ClientSideExporterProvider = require('./ClientSideExporterProvider-
|
9
|
+
const taskbarElements = require('./taskbar-elements-ebddaef4.js');
|
10
|
+
require('./DataFetcher-875371e9.js');
|
11
|
+
require('./pesquisa-fetcher-30cab386.js');
|
12
|
+
const ClientSideExporterProvider = require('./ClientSideExporterProvider-fe52f7cf.js');
|
13
13
|
const index$1 = require('./index-e3e39724.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-b95768e8.js');
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
19
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
19
|
+
const formConfigFetcher = require('./form-config-fetcher-e0a512c3.js');
|
20
20
|
const fieldSearch = require('./field-search-68e34bf4.js');
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
23
|
-
const index$2 = require('./index-
|
21
|
+
const ConfigStorage = require('./ConfigStorage-6b633b10.js');
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-d680be08.js');
|
23
|
+
const index$2 = require('./index-ab1cfb44.js');
|
24
24
|
require('./PrintUtils-bcaeb82f.js');
|
25
25
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
26
26
|
require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
@@ -76,6 +76,7 @@ const SnkSimpleCrud = class {
|
|
76
76
|
this.pageSize = 150;
|
77
77
|
this.resourceID = undefined;
|
78
78
|
this.enableGridInsert = false;
|
79
|
+
this.paginationCounterMode = 'auto';
|
79
80
|
this.taskbarManager = undefined;
|
80
81
|
this.messagesBuilder = undefined;
|
81
82
|
this.useEnterLikeTab = false;
|
@@ -777,9 +778,9 @@ const SnkSimpleCrud = class {
|
|
777
778
|
if (this.dataUnit == undefined) {
|
778
779
|
return;
|
779
780
|
}
|
780
|
-
return (index.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),
|
781
|
+
return (index.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), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: `ez-box ${this.outlineMode ? 'ez-box--outline' : 'ez-box--shadow'} simple-crud__container-section` }, index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.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)
|
781
782
|
? undefined
|
782
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, this.renderTaskbarContent(), index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, this.renderTaskbarContent(), index.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), index.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && index.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.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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.resolveResourceID() }))));
|
783
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this.enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, paginationCounterMode: this.paginationCounterMode }, this.renderTaskbarContent(), index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, this.renderTaskbarContent(), index.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), index.h("snk-simple-form-config", { ref: (ref) => this._snkSimpleFormConfig = ref, dataUnit: this.dataUnit, onSnkConfigSaved: this.handleFormConfigSaved.bind(this), configName: (_a = this.formLegacyConfigName) !== null && _a !== void 0 ? _a : this.configName })), this.messagesBuilder && index.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.h("div", { id: `${this._customContainerId}` }, index.h("slot", { name: "SnkConfigContainerSlot" }))), index.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, 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.resolveResourceID() }))));
|
783
784
|
}
|
784
785
|
get _element() { return index.getElement(this); }
|
785
786
|
static get watchers() { return {
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-ebddaef4.js');
|
9
9
|
const index$1 = require('./index-e3e39724.js');
|
10
|
-
require('./index-
|
10
|
+
require('./index-ab1cfb44.js');
|
11
11
|
|
12
12
|
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex;flex-wrap:wrap}.no-wrap.sc-snk-taskbar-h{flex-wrap:nowrap}.full-width.sc-snk-taskbar-h{width:100%}.align-right.sc-snk-taskbar-h{justify-content:flex-end}.overflowed.sc-snk-taskbar{display:none}";
|
13
13
|
|
@@ -21,6 +21,7 @@ const SnkTaskbar = class {
|
|
21
21
|
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
22
22
|
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
23
23
|
this.NOT_OVERFLOW_ELEMENTS = ["moreOptions", "dataExporter_snkDataExporter", "actionsButton_snkActionsButton"];
|
24
|
+
this.TASKBAR_CUSTOM_ELEMENTS = 'taskbar-custom-elements-container';
|
24
25
|
this._titleKeyByElement = {
|
25
26
|
[taskbarElements.TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
26
27
|
[taskbarElements.TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
@@ -424,6 +425,7 @@ const SnkTaskbar = class {
|
|
424
425
|
this._slotContainer.appendChild(customElement);
|
425
426
|
}
|
426
427
|
render() {
|
428
|
+
var _a;
|
427
429
|
if (this._definitions === undefined) {
|
428
430
|
return undefined;
|
429
431
|
}
|
@@ -442,7 +444,8 @@ const SnkTaskbar = class {
|
|
442
444
|
}
|
443
445
|
(_b = this._overFlowWatcher) === null || _b === void 0 ? void 0 : _b.addNotOverFlowElement(elem);
|
444
446
|
return index.h("slot", { name: elem });
|
445
|
-
})), index.h("div", { class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, index.h("slot", { name: this.customSlotId }))
|
447
|
+
})), index.h("div", { id: this.TASKBAR_CUSTOM_ELEMENTS, class: this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME }, index.h("slot", { name: this.customSlotId }), (_a = this._overFlowWatcher) === null || _a === void 0 ? void 0 :
|
448
|
+
_a.addNotOverFlowElement(this.TASKBAR_CUSTOM_ELEMENTS))));
|
446
449
|
}
|
447
450
|
getHostClasses() {
|
448
451
|
if (this.overflowStrategy !== 'hiddenItems')
|
@@ -4,6 +4,7 @@ import { AnexoSistemaFetcher, AttachFetcher, DataUnitFetcher } from '../../lib';
|
|
4
4
|
import { VIEW_MODE } from '../../lib/utils/constants';
|
5
5
|
import { anexoSistemaCrudConfig, AnexoSistemaDataUnitFactory, attachCrudConfig, AttachFetcherDataUnitFactory, buildTaskBarManager, } from './structure';
|
6
6
|
import InMemoryLoader from '../../lib/dataUnit/InMemoryLoader';
|
7
|
+
import { SaveErrorsEnum } from '../../lib/http/data-fetcher/fetchers/AttachFetcher/interfaces';
|
7
8
|
const RESOURCE_ID = 'AnexoSistema';
|
8
9
|
const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
|
9
10
|
export class SnkAttach {
|
@@ -24,6 +25,9 @@ export class SnkAttach {
|
|
24
25
|
this.handleFinish = () => {
|
25
26
|
if (!this._currentDataUnit.isDirty())
|
26
27
|
return this.back.emit();
|
28
|
+
if (!this.validateAnexoSistema()) {
|
29
|
+
return;
|
30
|
+
}
|
27
31
|
this._currentDataUnit.saveData().then(() => {
|
28
32
|
this.showFinishedToast();
|
29
33
|
this.back.emit();
|
@@ -158,6 +162,7 @@ export class SnkAttach {
|
|
158
162
|
var _a, _b;
|
159
163
|
this._currentFetcher = new AttachFetcher();
|
160
164
|
this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
165
|
+
this._currentDataUnit.pageSize = 150;
|
161
166
|
this.initDataUnitLoaders();
|
162
167
|
this._currentDataUnit.addInterceptor({
|
163
168
|
interceptAction: (action) => {
|
@@ -202,6 +207,27 @@ export class SnkAttach {
|
|
202
207
|
}
|
203
208
|
});
|
204
209
|
}
|
210
|
+
validateAnexoSistema() {
|
211
|
+
var _a;
|
212
|
+
if (this._currentFetcher instanceof AnexoSistemaFetcher) {
|
213
|
+
try {
|
214
|
+
let fields = this._currentDataUnit.getSelectedRecord();
|
215
|
+
fields = Object.assign(Object.assign({}, fields), { NOMEARQUIVO: (_a = fields.NOMEARQUIVO) === null || _a === void 0 ? void 0 : _a[0] });
|
216
|
+
this._currentFetcher.validateFields(fields);
|
217
|
+
}
|
218
|
+
catch (error) {
|
219
|
+
if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
|
220
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
|
221
|
+
return false;
|
222
|
+
}
|
223
|
+
if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
|
224
|
+
this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
|
225
|
+
return false;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
return true;
|
230
|
+
}
|
205
231
|
async componentWillLoad() {
|
206
232
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
207
233
|
await this.initAttach();
|
@@ -230,7 +256,7 @@ export class SnkAttach {
|
|
230
256
|
var _a, _b;
|
231
257
|
if (!this._currentDataUnit)
|
232
258
|
return null;
|
233
|
-
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this) }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
259
|
+
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this), multipleSelection: true }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
234
260
|
}
|
235
261
|
static get is() { return "snk-attach"; }
|
236
262
|
static get encapsulation() { return "scoped"; }
|
@@ -94,20 +94,24 @@ export class AttachFetcherDataUnitFactory {
|
|
94
94
|
}
|
95
95
|
getInterceptions(dataUnit, action, crudRef) {
|
96
96
|
return new Promise((resolve) => {
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
if (cancellationConfirmed) {
|
102
|
-
crudRef.goToView(VIEW_MODE.GRID);
|
97
|
+
var _a, _b, _c, _d, _e, _f;
|
98
|
+
switch (action.type) {
|
99
|
+
case Action.EDITION_CANCELED:
|
100
|
+
if (!dataUnit.isDirty())
|
103
101
|
return resolve(action);
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
102
|
+
return this._application.confirm(this.getMessage('snkAttach.cancelConfirmation.title'), this.getMessage('snkAttach.cancelConfirmation.message')).then((cancellationConfirmed) => {
|
103
|
+
if (cancellationConfirmed) {
|
104
|
+
crudRef.goToView(VIEW_MODE.GRID);
|
105
|
+
return resolve(action);
|
106
|
+
}
|
107
|
+
return resolve(undefined);
|
108
|
+
});
|
109
|
+
case Action.DATA_SAVED:
|
110
|
+
dataUnit.loadData(undefined, undefined, false, (_c = (_b = (_a = action === null || action === void 0 ? void 0 : action.payload) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.REGISTER_KEY);
|
111
|
+
return resolve(action);
|
112
|
+
case Action.RECORDS_REMOVED:
|
113
|
+
dataUnit.loadData(undefined, undefined, false, (_f = (_e = (_d = action === null || action === void 0 ? void 0 : action.payload) === null || _d === void 0 ? void 0 : _d.cachedRecords) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.CODATA);
|
114
|
+
return resolve(action);
|
111
115
|
}
|
112
116
|
resolve(action);
|
113
117
|
});
|
@@ -47,6 +47,7 @@ export class SnkCrud {
|
|
47
47
|
this.ignoreReadOnlyFormFields = undefined;
|
48
48
|
this.setCustomFormTitle = undefined;
|
49
49
|
this.strategyExporter = ExporterStrategy.SERVER_SIDE;
|
50
|
+
this.paginationCounterMode = 'auto';
|
50
51
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
51
52
|
}
|
52
53
|
/**
|
@@ -382,7 +383,7 @@ export class SnkCrud {
|
|
382
383
|
return;
|
383
384
|
}
|
384
385
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === VIEW_MODE.GRID && !this.enableGridInsert);
|
385
|
-
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, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter }, 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" }))));
|
386
|
+
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, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, paginationCounterMode: this.paginationCounterMode }, 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" }))));
|
386
387
|
}
|
387
388
|
static get is() { return "snk-crud"; }
|
388
389
|
static get encapsulation() { return "scoped"; }
|
@@ -864,6 +865,24 @@ export class SnkCrud {
|
|
864
865
|
"attribute": "strategy-exporter",
|
865
866
|
"reflect": false,
|
866
867
|
"defaultValue": "ExporterStrategy.SERVER_SIDE"
|
868
|
+
},
|
869
|
+
"paginationCounterMode": {
|
870
|
+
"type": "string",
|
871
|
+
"mutable": false,
|
872
|
+
"complexType": {
|
873
|
+
"original": "'show' | 'hidden' | 'auto'",
|
874
|
+
"resolved": "\"auto\" | \"hidden\" | \"show\"",
|
875
|
+
"references": {}
|
876
|
+
},
|
877
|
+
"required": false,
|
878
|
+
"optional": true,
|
879
|
+
"docs": {
|
880
|
+
"tags": [],
|
881
|
+
"text": "Define se a grid ser\u00E1 focada ao ser carregada."
|
882
|
+
},
|
883
|
+
"attribute": "pagination-counter-mode",
|
884
|
+
"reflect": false,
|
885
|
+
"defaultValue": "'auto'"
|
867
886
|
}
|
868
887
|
};
|
869
888
|
}
|
@@ -2,6 +2,9 @@ import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMeta
|
|
2
2
|
import { DataType } from '@sankhyalabs/core';
|
3
3
|
export class CommonsExporter {
|
4
4
|
constructor(dataUnit, grid) {
|
5
|
+
this.MAX_WIDTH_COD = 60;
|
6
|
+
this.MIN_WIDTH_COD = 10;
|
7
|
+
this.DEFAULT_FONT_SIZE = 13;
|
5
8
|
this.dataUnit = dataUnit;
|
6
9
|
this.grid = grid;
|
7
10
|
}
|
@@ -14,7 +17,7 @@ export class CommonsExporter {
|
|
14
17
|
return this.columnsState;
|
15
18
|
}
|
16
19
|
async buildColumnsMetadata(gridColumns) {
|
17
|
-
var _a, _b;
|
20
|
+
var _a, _b, _c;
|
18
21
|
const columnsMetadata = [];
|
19
22
|
for (const column of gridColumns) {
|
20
23
|
/**
|
@@ -25,30 +28,62 @@ export class CommonsExporter {
|
|
25
28
|
}
|
26
29
|
const fieldData = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(column.name);
|
27
30
|
const customFormatter = await this.grid.getCustomValueFormatter(column.name);
|
28
|
-
const
|
29
|
-
|
31
|
+
const isUserInterfaceSEARCH = (fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface) === UserInterface.SEARCH;
|
32
|
+
const widthColumnDefault = 60;
|
33
|
+
const labelColumn = isUserInterfaceSEARCH ? "Cód. " : column.label;
|
34
|
+
let descriptionColumn = undefined;
|
35
|
+
let columnData = {
|
30
36
|
id: column.name,
|
31
|
-
|
37
|
+
label: labelColumn,
|
38
|
+
width: isUserInterfaceSEARCH ? (labelColumn.length * this.DEFAULT_FONT_SIZE) : column.width,
|
32
39
|
type: fieldData === null || fieldData === void 0 ? void 0 : fieldData.dataType,
|
33
40
|
userInterface: fieldData === null || fieldData === void 0 ? void 0 : fieldData.userInterface,
|
34
41
|
customFormatter
|
35
42
|
};
|
43
|
+
if (isUserInterfaceSEARCH) {
|
44
|
+
if (((_b = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _b === void 0 ? void 0 : _b.DESCRIPTIONFIELD) != undefined) {
|
45
|
+
const labelDescription = (_c = fieldData === null || fieldData === void 0 ? void 0 : fieldData.properties) === null || _c === void 0 ? void 0 : _c.DESCRIPTIONENTITY;
|
46
|
+
const mergedFrom = fieldData.properties.mergedFrom;
|
47
|
+
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
48
|
+
descriptionColumn = {
|
49
|
+
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
50
|
+
label: labelDescription,
|
51
|
+
width: isUserInterfaceSEARCH && labelDescription ? (labelDescription.length * this.DEFAULT_FONT_SIZE - widthColumnDefault) : column.width,
|
52
|
+
type: DataType.TEXT,
|
53
|
+
userInterface: UserInterface.LONGTEXT,
|
54
|
+
descriptionFrom: fieldData.name
|
55
|
+
};
|
56
|
+
}
|
57
|
+
if (descriptionColumn) {
|
58
|
+
const newWidth = this.getWidthByMetaData(column === null || column === void 0 ? void 0 : column.width, columnData === null || columnData === void 0 ? void 0 : columnData.width, descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.width);
|
59
|
+
columnData = Object.assign(Object.assign({}, columnData), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.codWidth });
|
60
|
+
descriptionColumn = Object.assign(Object.assign({}, descriptionColumn), { width: newWidth === null || newWidth === void 0 ? void 0 : newWidth.descWidth, label: (descriptionColumn === null || descriptionColumn === void 0 ? void 0 : descriptionColumn.label) || (column === null || column === void 0 ? void 0 : column.label) });
|
61
|
+
}
|
62
|
+
}
|
36
63
|
columnsMetadata.push(columnData);
|
37
|
-
if (
|
38
|
-
const mergedFrom = fieldData.properties.mergedFrom;
|
39
|
-
const descriptionField = `${fieldData.properties.ENTITYNAME}.${fieldData.properties.DESCRIPTIONFIELD}`;
|
40
|
-
const descriptionColumn = {
|
41
|
-
label: fieldData.properties.DESCRIPTIONENTITY,
|
42
|
-
id: `${mergedFrom ? (mergedFrom + ".") : ""}${descriptionField}`,
|
43
|
-
width: column.width,
|
44
|
-
type: DataType.TEXT,
|
45
|
-
userInterface: UserInterface.LONGTEXT,
|
46
|
-
descriptionFrom: fieldData.name
|
47
|
-
};
|
64
|
+
if (descriptionColumn)
|
48
65
|
columnsMetadata.push(descriptionColumn);
|
49
|
-
}
|
50
66
|
}
|
51
67
|
;
|
52
68
|
return columnsMetadata || [];
|
53
69
|
}
|
70
|
+
getWidthByMetaData(maxWidth, widthCod, widthDescription) {
|
71
|
+
const totalCurrentWidth = widthCod + widthDescription;
|
72
|
+
const codPercentage = widthCod / totalCurrentWidth;
|
73
|
+
const descPercentage = widthDescription / totalCurrentWidth;
|
74
|
+
let newWidthCod = Math.round(maxWidth * codPercentage);
|
75
|
+
let newWidthDescription = Math.round(maxWidth * descPercentage);
|
76
|
+
if (newWidthCod > this.MAX_WIDTH_COD) {
|
77
|
+
newWidthCod = this.MAX_WIDTH_COD;
|
78
|
+
newWidthDescription = maxWidth - this.MAX_WIDTH_COD;
|
79
|
+
}
|
80
|
+
else if (newWidthCod < this.MIN_WIDTH_COD) {
|
81
|
+
newWidthCod = this.MIN_WIDTH_COD;
|
82
|
+
newWidthDescription = maxWidth - this.MIN_WIDTH_COD;
|
83
|
+
}
|
84
|
+
return {
|
85
|
+
codWidth: newWidthCod,
|
86
|
+
descWidth: newWidthDescription
|
87
|
+
};
|
88
|
+
}
|
54
89
|
}
|
@@ -24,10 +24,11 @@ export class SnkFilterItem {
|
|
24
24
|
*/
|
25
25
|
async showUp(open = false) {
|
26
26
|
return new Promise(resolve => {
|
27
|
+
var _a;
|
27
28
|
this._filterItemElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
|
28
29
|
if (open) {
|
29
30
|
this._closeCallback = resolve;
|
30
|
-
this._chipElement.blur();
|
31
|
+
(_a = this._chipElement) === null || _a === void 0 ? void 0 : _a.blur();
|
31
32
|
window.requestAnimationFrame(() => {
|
32
33
|
this._floatingID = FloatingManager.float(this._popover, this._popoverContainer, this.getFloatOptions());
|
33
34
|
this._popover.show();
|
@@ -78,6 +78,7 @@ export class SnkGrid {
|
|
78
78
|
this.enableGridInsert = false;
|
79
79
|
this.outlineMode = false;
|
80
80
|
this.strategyExporter = ExporterStrategy.SERVER_SIDE;
|
81
|
+
this.paginationCounterMode = 'auto';
|
81
82
|
}
|
82
83
|
reloadConfig() {
|
83
84
|
this.loadConfig();
|
@@ -485,7 +486,7 @@ export class SnkGrid {
|
|
485
486
|
return undefined;
|
486
487
|
}
|
487
488
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--extra-small" }, this._showSnkFilterBar &&
|
488
|
-
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
489
|
+
h(Fragment, null, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this.resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, outlineMode: this.outlineMode, paginationCounterMode: this.paginationCounterMode }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this.getGridHeaderButtons(), presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12 snk-grid-container__footer" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
489
490
|
}
|
490
491
|
static get is() { return "snk-grid"; }
|
491
492
|
static get encapsulation() { return "scoped"; }
|
@@ -1026,6 +1027,24 @@ export class SnkGrid {
|
|
1026
1027
|
"attribute": "strategy-exporter",
|
1027
1028
|
"reflect": false,
|
1028
1029
|
"defaultValue": "ExporterStrategy.SERVER_SIDE"
|
1030
|
+
},
|
1031
|
+
"paginationCounterMode": {
|
1032
|
+
"type": "string",
|
1033
|
+
"mutable": false,
|
1034
|
+
"complexType": {
|
1035
|
+
"original": "'show' | 'hidden' | 'auto'",
|
1036
|
+
"resolved": "\"auto\" | \"hidden\" | \"show\"",
|
1037
|
+
"references": {}
|
1038
|
+
},
|
1039
|
+
"required": false,
|
1040
|
+
"optional": true,
|
1041
|
+
"docs": {
|
1042
|
+
"tags": [],
|
1043
|
+
"text": "Define se a grid ser\u00E1 focada ao ser carregada."
|
1044
|
+
},
|
1045
|
+
"attribute": "pagination-counter-mode",
|
1046
|
+
"reflect": false,
|
1047
|
+
"defaultValue": "'auto'"
|
1029
1048
|
}
|
1030
1049
|
};
|
1031
1050
|
}
|
@@ -32,7 +32,7 @@ export class PesquisaGrid {
|
|
32
32
|
}
|
33
33
|
initializeDataUnit() {
|
34
34
|
var _a;
|
35
|
-
if (!this.metadata)
|
35
|
+
if (!this.metadata || this._dataunit)
|
36
36
|
return;
|
37
37
|
this._inMemoryLoader = new InMemoryLoader(this.metadata, (_a = this.dataSource) !== null && _a !== void 0 ? _a : []);
|
38
38
|
this._dataunit = this._inMemoryLoader.dataUnit;
|
@@ -19,6 +19,7 @@ export class SnkPesquisa {
|
|
19
19
|
this._startLoading = false;
|
20
20
|
this._presentationMode = "list";
|
21
21
|
this._currentView = undefined;
|
22
|
+
this._valideDataSource = false;
|
22
23
|
this.searchLoader = undefined;
|
23
24
|
this.treeLoader = undefined;
|
24
25
|
this.selectItem = undefined;
|
@@ -289,10 +290,13 @@ export class SnkPesquisa {
|
|
289
290
|
if (this.argument && (!isNaN(argumentNumber) || this.argument.length >= this._limitCharsToSearch)) {
|
290
291
|
this._changeDeboucingTimeout = setTimeout(() => {
|
291
292
|
this.doSearch(isNaN(argumentNumber) ? this.argument : argumentNumber.toString());
|
293
|
+
this._valideDataSource = true;
|
292
294
|
}, this._deboucingTime);
|
293
295
|
}
|
294
296
|
else {
|
295
297
|
this._itemList = undefined;
|
298
|
+
this._gridDataSource = [];
|
299
|
+
this._valideDataSource = false;
|
296
300
|
}
|
297
301
|
}
|
298
302
|
clearDeboucingTimeout() {
|
@@ -303,6 +307,7 @@ export class SnkPesquisa {
|
|
303
307
|
}
|
304
308
|
onClickSearch() {
|
305
309
|
this.doSearch((this.argument || "").trim());
|
310
|
+
this._valideDataSource = true;
|
306
311
|
}
|
307
312
|
getMessageView() {
|
308
313
|
return this._startLoading
|
@@ -370,7 +375,8 @@ export class SnkPesquisa {
|
|
370
375
|
var _a, _b;
|
371
376
|
return (h(Host, null, h("div", { class: "snk-pesquisa" }, h("div", { class: "snk-pesquisa__input" }, h("ez-text-input", { label: "Buscar", class: "ez-margin-right--medium", canShowError: false, ref: (ref) => this._textInput = ref, onEzChange: (event) => this.onChangeValue(event), value: this.argument, "data-element-id": "searchInput" }, h("ez-icon", { slot: "leftIcon", iconName: "search" }), this.argument && ((_a = this._textInput) === null || _a === void 0 ? void 0 : _a.value)
|
372
377
|
? h("button", { slot: "rightIcon", class: "snk-pesquisa__btn", onClick: () => this.clearSearch() }, h("ez-icon", { iconName: "close" }))
|
373
|
-
: undefined), h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() }), h("ez-button", { class: "ez-margin-left--medium", mode: "icon", iconName: this.getButtonModeInfo().iconName, title: this.getButtonModeInfo().title, onClick: async () => await this.handleChangeViewMode() })), h("div", { class: `snk-pesquisa__records-label ${this._currentView === PESQUISA_VIEW_MODE.TREE ? 'hidden' : ''}` }, h("label", { class: `snk-pesquisa__records ${this.hideRecordsMessage() ? "hidden" : ""}` }, this.getMessageView()), h("label", { class: `snk-pesquisa__records-limit ${this.hideLimitMessage() ? "hidden" : ""}` }, "Essa pesquisa foi limitada, existem mais resultados.")), h("div", { class: "snk-pesquisa__content" }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null,
|
378
|
+
: undefined), h("ez-button", { class: "ez-button--primary", label: "Pesquisar", onClick: () => this.onClickSearch() }), h("ez-button", { class: "ez-margin-left--medium", mode: "icon", iconName: this.getButtonModeInfo().iconName, title: this.getButtonModeInfo().title, onClick: async () => await this.handleChangeViewMode() })), h("div", { class: `snk-pesquisa__records-label ${this._currentView === PESQUISA_VIEW_MODE.TREE ? 'hidden' : ''}` }, h("label", { class: `snk-pesquisa__records ${this.hideRecordsMessage() ? "hidden" : ""}` }, this.getMessageView()), h("label", { class: `snk-pesquisa__records-limit ${this.hideLimitMessage() ? "hidden" : ""}` }, "Essa pesquisa foi limitada, existem mais resultados.")), h("div", { class: "snk-pesquisa__content" }, h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, this._valideDataSource &&
|
379
|
+
h("pesquisa-grid", { metadata: this._gridMetadata, dataSource: this._gridDataSource, pkField: this._pkField, descriptionField: this._descriptionField, entityName: this.entityName, shouldLoadConfig: this._currentView === PESQUISA_VIEW_MODE.GRID, onPesquisaGridSelectItem: ({ detail }) => this.selectItem(detail) })), h("stack-item", null, h("div", { class: 'snk-pesquisa__cards-container' }, (_b = this._itemList) === null || _b === void 0 ? void 0 : _b.map((item) => {
|
374
380
|
return (h("ez-card-item", { onEzClick: (event) => this.createOption(event.detail), item: item }));
|
375
381
|
}))), h("stack-item", null, h("pesquisa-tree", { ref: (element) => this._pesquisaTree = element, argument: this.argument, treeLoader: this.treeLoader, allowsNonAnalytic: this.allowsNonAnalytic, shouldLoadTree: this._currentView === PESQUISA_VIEW_MODE.TREE, onPesquisaTreeSelectItem: ({ detail }) => this.selectItem(detail) })))))));
|
376
382
|
}
|
@@ -523,7 +529,8 @@ export class SnkPesquisa {
|
|
523
529
|
"_itemList": {},
|
524
530
|
"_startLoading": {},
|
525
531
|
"_presentationMode": {},
|
526
|
-
"_currentView": {}
|
532
|
+
"_currentView": {},
|
533
|
+
"_valideDataSource": {}
|
527
534
|
};
|
528
535
|
}
|
529
536
|
static get elementRef() { return "_element"; }
|