@sankhyalabs/sankhyablocks 8.16.0-dev.3 → 8.16.0-dev.31
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{ConfigStorage-942ce74b.js → ConfigStorage-ecc0ed20.js} +3 -2
- package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-807730a8.js} +39 -6
- package/dist/cjs/{DataFetcher-313debd8.js → DataFetcher-cadeef8e.js} +21 -15
- package/dist/cjs/{RecordIDUtils-3735135c.js → GetSelectedRecordsIDsInfo-bd50caf1.js} +10 -10
- package/dist/cjs/{SnkFormConfigManager-1b13bacd.js → SnkFormConfigManager-f1c92f79.js} +74 -20
- package/dist/cjs/{SnkMessageBuilder-722b104e.js → SnkMessageBuilder-bae64d0d.js} +7 -3
- package/dist/cjs/{auth-fetcher-54f5ff9d.js → auth-fetcher-d68841bc.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-688d3f05.js → dataunit-fetcher-f89461c1.js} +46 -18
- package/dist/cjs/{field-search-f56aa7d6.js → field-search-68e34bf4.js} +5 -1
- package/dist/cjs/{form-config-fetcher-2dd00e5b.js → form-config-fetcher-ed497282.js} +5 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-ca89181c.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_4.cjs.entry.js +17 -14
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +37 -28
- package/dist/cjs/snk-crud.cjs.entry.js +14 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +19 -18
- package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-668dc5e8.js} +42 -22
- package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
- package/dist/cjs/snk-detail-view.cjs.entry.js +12 -13
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +37 -25
- package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
- package/dist/cjs/snk-form.cjs.entry.js +7 -6
- package/dist/cjs/snk-grid.cjs.entry.js +61 -21
- package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-68777d37.js} +24 -12
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +64 -26
- package/dist/cjs/snk-taskbar.cjs.entry.js +23 -1
- package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
- package/dist/collection/components/snk-attach/snk-attach.js +24 -15
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +2 -4
- package/dist/collection/components/snk-crud/snk-crud.js +78 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +3 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +51 -6
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +4 -4
- package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js +5 -5
- package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js +1 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +2 -2
- package/dist/collection/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.js +4 -4
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +57 -20
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +59 -21
- package/dist/collection/components/snk-form/snk-form.js +2 -2
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +72 -18
- package/dist/collection/components/snk-form-config/snk-form-config.css +8 -3
- package/dist/collection/components/snk-form-config/snk-form-config.js +14 -3
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +68 -8
- package/dist/collection/components/snk-simple-bar/snk-simple-bar.js +1 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +0 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +89 -15
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +64 -0
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
- package/dist/collection/lib/configs/ConfigStorage.js +1 -0
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -4
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +34 -9
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +22 -16
- package/dist/collection/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.js +7 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy.js +9 -2
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +4 -1
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-exporter.msg.js +1 -1
- package/dist/collection/lib/message/resources/snk-grid.msg.js +5 -1
- package/dist/collection/lib/utils/ContinuousInsertUtils.js +31 -0
- package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +40 -5
- package/dist/components/DataFetcher.js +22 -16
- package/dist/{esm/RecordIDUtils-87d02110.js → components/GetSelectedRecordsIDsInfo.js} +10 -10
- package/dist/components/SnkFormConfigManager.js +72 -18
- package/dist/components/SnkMessageBuilder.js +7 -3
- package/dist/components/dataunit-fetcher.js +45 -15
- package/dist/components/form-config-fetcher.js +4 -1
- package/dist/components/snk-actions-button2.js +12 -9
- package/dist/components/snk-attach2.js +33 -24
- package/dist/components/snk-crud.js +12 -1
- package/dist/components/snk-data-exporter2.js +12 -11
- package/dist/components/snk-data-unit2.js +44 -60
- package/dist/components/snk-detail-view2.js +24 -11
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +35 -22
- package/dist/components/snk-filter-checkbox-list.js +1 -1
- package/dist/components/snk-form-config2.js +15 -4
- package/dist/components/snk-form.js +2 -2
- package/dist/components/snk-grid2.js +53 -11
- package/dist/components/snk-simple-bar2.js +1 -1
- package/dist/components/snk-simple-crud2.js +57 -15
- package/dist/components/snk-taskbar2.js +24 -2
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
- package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-1a82a768.js} +40 -8
- package/dist/esm/{DataFetcher-c1baf61d.js → DataFetcher-a9c598f2.js} +22 -16
- package/dist/esm/GetSelectedRecordsIDsInfo-9fa41508.js +41 -0
- package/dist/esm/{SnkFormConfigManager-d4554df9.js → SnkFormConfigManager-139f09fa.js} +74 -20
- package/dist/esm/{SnkMessageBuilder-89925609.js → SnkMessageBuilder-6fff4a4c.js} +7 -3
- package/dist/esm/{auth-fetcher-039abba3.js → auth-fetcher-749d880f.js} +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-c24c76c6.js} +46 -16
- package/dist/esm/{field-search-efbe307f.js → field-search-f8b1d91e.js} +5 -1
- package/dist/esm/{form-config-fetcher-30fb808f.js → form-config-fetcher-adbe5d34.js} +5 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-8edaa8cd.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +17 -14
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +37 -28
- package/dist/esm/snk-crud.entry.js +14 -6
- package/dist/esm/snk-data-exporter.entry.js +19 -18
- package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-0fdfb6c2.js} +42 -22
- package/dist/esm/snk-data-unit.entry.js +5 -5
- package/dist/esm/snk-detail-view.entry.js +12 -13
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +37 -25
- package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +17 -6
- package/dist/esm/snk-form.entry.js +7 -6
- package/dist/esm/snk-grid.entry.js +56 -16
- package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-b5dd30e6.js} +24 -12
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-bar.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +60 -22
- package/dist/esm/snk-taskbar.entry.js +23 -1
- package/dist/sankhyablocks/p-0035ad6e.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/p-17425c72.js +1 -0
- package/dist/sankhyablocks/p-18ed15f4.entry.js +1 -0
- package/dist/sankhyablocks/{p-af8efd95.js → p-1bf06cd3.js} +2 -2
- package/dist/sankhyablocks/{p-a1d72395.entry.js → p-212213d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-23736d75.js +1 -0
- package/dist/sankhyablocks/p-3ae9d08a.js +1 -0
- package/dist/sankhyablocks/p-3e3cc017.js +1 -0
- package/dist/sankhyablocks/p-430e4d3c.entry.js +1 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
- package/dist/sankhyablocks/p-50779ad3.entry.js +1 -0
- package/dist/sankhyablocks/p-5dd8cf4f.js +1 -0
- package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
- package/dist/sankhyablocks/p-60b29483.entry.js +1 -0
- package/dist/sankhyablocks/p-694e1c4a.entry.js +1 -0
- package/dist/sankhyablocks/p-7ac7932c.js +60 -0
- package/dist/sankhyablocks/p-7dd49d15.js +1 -0
- package/dist/sankhyablocks/p-7eef0898.entry.js +1 -0
- package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-a42e7a1e.entry.js} +2 -2
- package/dist/sankhyablocks/p-afbb070d.js +1 -0
- package/dist/sankhyablocks/p-b9679243.entry.js +1 -0
- package/dist/sankhyablocks/p-b9c67e45.entry.js +1 -0
- package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
- package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
- package/dist/sankhyablocks/p-d80a84fd.entry.js +1 -0
- package/dist/sankhyablocks/p-d836f72b.entry.js +1 -0
- package/dist/sankhyablocks/p-e16e87fc.entry.js +1 -0
- package/dist/sankhyablocks/p-eb9f0407.entry.js +1 -0
- package/dist/sankhyablocks/p-f3434fc4.js +1 -0
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +13 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +11 -0
- package/dist/types/components/snk-data-exporter/test/resources/ClientSideExporterStrategyResources.d.ts +3 -3
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +7 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +5 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +9 -4
- package/dist/types/components/snk-grid/snk-grid.d.ts +12 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +14 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +1 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +89 -0
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +12 -2
- package/dist/types/lib/http/data-fetcher/fetchers/AttachFetcher/anexo-sistema-fetcher.d.ts +3 -2
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +1 -1
- package/dist/types/lib/utils/ContinuousInsertUtils.d.ts +10 -0
- package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
- package/package.json +2 -2
- package/dist/sankhyablocks/p-14a08904.entry.js +0 -1
- package/dist/sankhyablocks/p-14b9f964.entry.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-3a212712.js +0 -1
- package/dist/sankhyablocks/p-3a216b81.entry.js +0 -1
- package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
- package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
- package/dist/sankhyablocks/p-75f83d1d.entry.js +0 -1
- package/dist/sankhyablocks/p-7a337364.js +0 -1
- package/dist/sankhyablocks/p-829d4045.js +0 -1
- package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
- package/dist/sankhyablocks/p-8fc470e5.entry.js +0 -1
- package/dist/sankhyablocks/p-941bf3ef.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-b4b21558.entry.js +0 -1
- package/dist/sankhyablocks/p-bad55caa.entry.js +0 -1
- package/dist/sankhyablocks/p-c053256c.entry.js +0 -1
- package/dist/sankhyablocks/p-c2495304.js +0 -1
- package/dist/sankhyablocks/p-c5268346.entry.js +0 -1
- package/dist/sankhyablocks/p-cefba299.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/sankhyablocks/p-fcac4dfc.js +0 -1
- package/dist/sankhyablocks/p-fe79f83a.js +0 -60
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -27,6 +27,8 @@ export class SnkGuidesViewer {
|
|
27
27
|
this.resourceID = undefined;
|
28
28
|
this.detailTaskbarCustomContainerId = undefined;
|
29
29
|
this.formLegacyConfigName = undefined;
|
30
|
+
this.enableGridInsert = false;
|
31
|
+
this.getCustomTitle = undefined;
|
30
32
|
this._hasToCreateFieldSearch = true;
|
31
33
|
this._breadcrumbItems = [];
|
32
34
|
this._guides = undefined;
|
@@ -95,7 +97,7 @@ export class SnkGuidesViewer {
|
|
95
97
|
this._container.focus();
|
96
98
|
}
|
97
99
|
exitViewer() {
|
98
|
-
if (this.dataUnit.isDirty()) {
|
100
|
+
if (!this.enableGridInsert && this.dataUnit.isDirty()) {
|
99
101
|
this.dataUnit.cancelEdition({ after: () => this.exit.emit() });
|
100
102
|
}
|
101
103
|
else {
|
@@ -113,7 +115,7 @@ export class SnkGuidesViewer {
|
|
113
115
|
}
|
114
116
|
onContentCardChanged(evt) {
|
115
117
|
SnkGuidesViewer.updateContentCard(evt.detail.formName, evt.detail.cardConfig, evt.detail.propertyChanged, this._configManager)
|
116
|
-
.then(() => this.masterFormConfig = this._configManager.getConfig(this.
|
118
|
+
.then(() => this.masterFormConfig = this._configManager.getConfig(this.dataUnit));
|
117
119
|
}
|
118
120
|
/**
|
119
121
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -204,10 +206,13 @@ export class SnkGuidesViewer {
|
|
204
206
|
const invisibleButtons = this.getInvisibleButtons();
|
205
207
|
this._taskbarProcessor = new TaskbarProcessor({
|
206
208
|
"snkGuideViewer.regular": btnsRegularMode,
|
207
|
-
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE"],
|
209
|
+
"snkGuideViewer.finish_edition": ["CANCEL", "SAVE", this.handleAddGridMode()],
|
208
210
|
});
|
209
211
|
this._taskbarProcessor.process(taskbarId, this.taskbarManager, this.dataState, disabledButtons, invisibleButtons);
|
210
212
|
}
|
213
|
+
handleAddGridMode() {
|
214
|
+
return this.enableGridInsert ? TaskbarElement.GRID_MODE : "";
|
215
|
+
}
|
211
216
|
getInvisibleButtons() {
|
212
217
|
const invisibleButtons = [];
|
213
218
|
if (this.dataState && this.dataState.selectionInfo.mode === SelectionMode.ALL_RECORDS)
|
@@ -360,11 +365,14 @@ export class SnkGuidesViewer {
|
|
360
365
|
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
361
366
|
}
|
362
367
|
}
|
368
|
+
setMasterFormConfig(config) {
|
369
|
+
this.masterFormConfig = config;
|
370
|
+
}
|
363
371
|
componentWillLoad() {
|
364
372
|
if (this.resourceID == undefined) {
|
365
373
|
throw new Error("Erro interno: resourceID não informado");
|
366
374
|
}
|
367
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID,
|
375
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, this.setMasterFormConfig.bind(this), this.dataUnit);
|
368
376
|
this.addFormLegacyConfigName();
|
369
377
|
this._configManager.loadConfig();
|
370
378
|
}
|
@@ -392,7 +400,7 @@ export class SnkGuidesViewer {
|
|
392
400
|
return this._fieldSearch;
|
393
401
|
}
|
394
402
|
fieldsOptionLoader(argument) {
|
395
|
-
return Promise.resolve(this._configManager.getFieldsList(
|
403
|
+
return Promise.resolve(this._configManager.getFieldsList(argument)
|
396
404
|
.map(field => ({ value: field.name, label: field.label })));
|
397
405
|
}
|
398
406
|
onSelectField(option, actionButton) {
|
@@ -464,6 +472,10 @@ export class SnkGuidesViewer {
|
|
464
472
|
}
|
465
473
|
return "";
|
466
474
|
}
|
475
|
+
getTitle() {
|
476
|
+
var _a, _b;
|
477
|
+
return (_b = (_a = this.getCustomTitle) === null || _a === void 0 ? void 0 : _a.call(this)) !== null && _b !== void 0 ? _b : this.getMessage("snkCrud.title");
|
478
|
+
}
|
467
479
|
componentDidLoad() {
|
468
480
|
this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this));
|
469
481
|
}
|
@@ -477,7 +489,7 @@ export class SnkGuidesViewer {
|
|
477
489
|
}
|
478
490
|
this.loadTaskbarProcessor();
|
479
491
|
const showGuides = this._guides && (this._guides.length > 1);
|
480
|
-
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.
|
492
|
+
return (h("section", { class: "snk-guides-viewer", ref: ref => this._container = ref, tabindex: -1 }, h("div", { class: "ez-row snk-guides-viewer__header" }, h("div", { class: "snk-guides-viewer__header-breadcrumb ez-flex--align-items-center ez-flex-item--align-center ez-padding-left--large", key: "header" }, h("ez-button", { onClick: () => this.exitViewer(), title: this.getMessage("snkCrud.goBackTitle"), mode: "icon", iconName: "arrow_back", class: "ez-padding-right--medium", size: "small" }), h("div", { class: "ez-flex ez-flex--column ez-flex-item--auto" }, h("h1", { class: "ez-title ez-title--primary ez-title--xlarge" }, this.getTitle()), ((_a = this._breadcrumbItems) === null || _a === void 0 ? void 0 : _a.length) > 1 &&
|
481
493
|
h("div", { class: "ez-margin-top--extra-small" }, h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != PresentationMode.SECONDARY && this.buildTaskBar()), h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
482
494
|
h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
483
495
|
:
|
@@ -794,6 +806,39 @@ export class SnkGuidesViewer {
|
|
794
806
|
},
|
795
807
|
"attribute": "form-legacy-config-name",
|
796
808
|
"reflect": false
|
809
|
+
},
|
810
|
+
"enableGridInsert": {
|
811
|
+
"type": "boolean",
|
812
|
+
"mutable": false,
|
813
|
+
"complexType": {
|
814
|
+
"original": "boolean",
|
815
|
+
"resolved": "boolean",
|
816
|
+
"references": {}
|
817
|
+
},
|
818
|
+
"required": false,
|
819
|
+
"optional": true,
|
820
|
+
"docs": {
|
821
|
+
"tags": [],
|
822
|
+
"text": "Ativa inser\u00E7\u00E3o de registros no modo grade."
|
823
|
+
},
|
824
|
+
"attribute": "enable-grid-insert",
|
825
|
+
"reflect": false,
|
826
|
+
"defaultValue": "false"
|
827
|
+
},
|
828
|
+
"getCustomTitle": {
|
829
|
+
"type": "unknown",
|
830
|
+
"mutable": false,
|
831
|
+
"complexType": {
|
832
|
+
"original": "() => string",
|
833
|
+
"resolved": "() => string",
|
834
|
+
"references": {}
|
835
|
+
},
|
836
|
+
"required": false,
|
837
|
+
"optional": false,
|
838
|
+
"docs": {
|
839
|
+
"tags": [],
|
840
|
+
"text": "Fornece uma fun\u00E7\u00E3o para obter um t\u00EDtulo customizado do formul\u00E1rio."
|
841
|
+
}
|
797
842
|
}
|
798
843
|
};
|
799
844
|
}
|
@@ -4,7 +4,7 @@ export const OptionsStep = ({ getMessage, changeInfo, data }) => {
|
|
4
4
|
const selectionCount = (data === null || data === void 0 ? void 0 : data.selectedRows) || 0;
|
5
5
|
const formatOptions = [
|
6
6
|
{ label: getMessage("snkExporter.emailSenderOptStep_formatPDF"), value: "pdf" },
|
7
|
-
{ label: getMessage("snkExporter.
|
7
|
+
{ label: getMessage("snkExporter.emailSenderOptStep_formatXLS"), value: "xls" }
|
8
8
|
];
|
9
9
|
const typeOptions = [
|
10
10
|
{ label: getMessage("snkExporter.emailSenderOptStep_allData"), value: "all" },
|
package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { UserInterface } from "@sankhyalabs/core";
|
2
2
|
import { DataFetcher } from "../../../lib";
|
3
3
|
import { getOptionKey, getVisibleColumns } from "../utils/ParserExport";
|
4
|
-
import { DataExporterType } from "../../../lib/@types";
|
5
4
|
export default class ClientSideExporterStrategy {
|
6
5
|
constructor(provider) {
|
7
6
|
this._provider = provider;
|
@@ -12,15 +11,16 @@ export default class ClientSideExporterStrategy {
|
|
12
11
|
return visibleColumns;
|
13
12
|
}
|
14
13
|
async executeExport(resolveProps) {
|
15
|
-
|
14
|
+
var _a;
|
15
|
+
const { methodName, gridTitle } = resolveProps;
|
16
16
|
const records = await this._provider.getRecords();
|
17
|
-
const columns =
|
17
|
+
const columns = ((_a = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _a === void 0 ? void 0 : _a.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
18
18
|
const [serviceName, processor] = this.getExecutor(methodName);
|
19
19
|
const payload = {
|
20
20
|
serviceName,
|
21
21
|
requestBody: {
|
22
22
|
grid: {
|
23
|
-
|
23
|
+
gridTitle,
|
24
24
|
columns: this.buildColumnsObject(columns),
|
25
25
|
rows: this.buildRowsObject(columns, records),
|
26
26
|
customOptions: { xlsxExtension: false }
|
package/dist/collection/components/snk-data-exporter/exporter-strategy/ServerSideExporterStrategy.js
CHANGED
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
12
12
|
};
|
13
13
|
import { ApplicationContext, ObjectUtils } from "@sankhyalabs/core";
|
14
14
|
import { DataFetcher } from '../../../lib/http/data-fetcher/DataFetcher';
|
15
|
-
import { DataExporterOption
|
15
|
+
import { DataExporterOption } from "../../../lib/@types";
|
16
16
|
import { getOptionKey, getVisibleColumns } from "../utils/ParserExport";
|
17
17
|
export default class ServerSideExporterStrategy {
|
18
18
|
constructor(provider) {
|
@@ -24,11 +24,11 @@ export default class ServerSideExporterStrategy {
|
|
24
24
|
return visibleColumns;
|
25
25
|
}
|
26
26
|
async getParams(resolveProps) {
|
27
|
-
var _a, _b, _c, _d, _e, _f;
|
27
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
28
28
|
const filters = (_b = (_a = this._provider).getFilters) === null || _b === void 0 ? void 0 : _b.call(_a);
|
29
|
-
const columns =
|
30
|
-
const sort = (
|
31
|
-
const resourceURI = (
|
29
|
+
const columns = ((_c = getOptionKey(resolveProps === null || resolveProps === void 0 ? void 0 : resolveProps.exportOption)) === null || _c === void 0 ? void 0 : _c.includes("PDF")) ? await this.getParsedColumns() : await this._provider.getColumnsMetadata();
|
30
|
+
const sort = (_e = (_d = this._provider).getOrders) === null || _e === void 0 ? void 0 : _e.call(_d);
|
31
|
+
const resourceURI = (_g = (_f = this._provider).getResourceURI) === null || _g === void 0 ? void 0 : _g.call(_f);
|
32
32
|
const selectedIDs = this._provider.getSelectedIDs();
|
33
33
|
const option = resolveProps.exportOption;
|
34
34
|
const currentPageOptions = [
|
package/dist/collection/components/snk-data-exporter/providers/ClientSideExporterProvider.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
2
2
|
import { UserInterface } from "@sankhyalabs/core";
|
3
|
-
import { getSelectedIDs } from
|
3
|
+
import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
|
4
4
|
import { DataExporterOption } from "../../../lib/@types";
|
5
5
|
export default class ClientSideExporterProvider extends CommonsExporter {
|
6
6
|
getSelectedNumber() {
|
package/dist/collection/components/snk-data-exporter/providers/ServerSideExporterProvider.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { CommonsExporter } from "../interfaces/IExporterProvider";
|
2
|
-
import { getSelectedIDs } from
|
2
|
+
import { getSelectedRecordsIDsInfo as getSelectedIDs } from '../../../lib/utils/GetSelectedRecordsIDsInfo';
|
3
3
|
export default class ServerSideExporterProvider extends CommonsExporter {
|
4
4
|
getFilters() {
|
5
5
|
var _a;
|
@@ -42,7 +42,7 @@ export class SnkDataExporter {
|
|
42
42
|
resolver: ({ type, format, email: { to, subject, message } }) => {
|
43
43
|
var _a;
|
44
44
|
const methodName = (_a = DataExporterFormat[format === null || format === void 0 ? void 0 : format.toUpperCase()]) !== null && _a !== void 0 ? _a : DataExporterFormat.PDF;
|
45
|
-
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel,
|
45
|
+
this.resolveExporter({ type, methodName, to, subject, message, fileName: this._appLabel, gridTitle: this._appLabel }, () => {
|
46
46
|
this._snkEmailSender.close();
|
47
47
|
ApplicationUtils.info(this.getMessage("snkDataExporter.message.emailSuccess"), { iconName: "check" });
|
48
48
|
});
|
@@ -130,7 +130,7 @@ export class SnkDataExporter {
|
|
130
130
|
const params = {
|
131
131
|
methodName: DataExporterOption[`EXPORT_TO_${fileType}`],
|
132
132
|
fileName: this._appLabel,
|
133
|
-
|
133
|
+
gridTitle: this._appLabel,
|
134
134
|
exportOption: option,
|
135
135
|
limit: (_c = (_b = this.provider) === null || _b === void 0 ? void 0 : _b.getExportLimit) === null || _c === void 0 ? void 0 : _c.call(_b),
|
136
136
|
type: this.getExportType(option),
|
@@ -110,7 +110,7 @@ export class ItemBuilder {
|
|
110
110
|
getExportToXLS(groupName) {
|
111
111
|
return {
|
112
112
|
id: DataExporterOption.EXPORT_TO_XLS,
|
113
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
113
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`,
|
114
114
|
group: groupName
|
115
115
|
};
|
116
116
|
}
|
@@ -153,7 +153,7 @@ export class ItemBuilder {
|
|
153
153
|
getExportPageToXLS() {
|
154
154
|
return {
|
155
155
|
id: DataExporterOption.EXPORT_PAGE_TO_XLS,
|
156
|
-
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.
|
156
|
+
label: `${this._getMessage("snkDataExporter.label.spreadsheet")} (.xls)`
|
157
157
|
};
|
158
158
|
}
|
159
159
|
/**
|
@@ -42,21 +42,21 @@ export const dataFetcherXLSResponse = {
|
|
42
42
|
export const exportPDFParams = {
|
43
43
|
methodName: 'exportToPDF',
|
44
44
|
fileName: '',
|
45
|
-
|
45
|
+
gridTitle: '',
|
46
46
|
};
|
47
47
|
export const exportXLSParams = {
|
48
48
|
methodName: 'exportToXLS',
|
49
49
|
fileName: '',
|
50
|
-
|
50
|
+
gridTitle: '',
|
51
51
|
};
|
52
52
|
export const serviceNamePDF = "GridPDFBuilderSP.buildPDFFromJson";
|
53
53
|
export const serviceNameXLS = "GridXLSBuilderSP.buildXLSFromJson";
|
54
|
-
export function buildExpectedResponse({ serviceName,
|
54
|
+
export function buildExpectedResponse({ serviceName, gridTitle, value, align = 'left', type = 'S' }) {
|
55
55
|
return {
|
56
56
|
serviceName: serviceName,
|
57
57
|
requestBody: {
|
58
58
|
grid: {
|
59
|
-
|
59
|
+
gridTitle: gridTitle,
|
60
60
|
columns: {
|
61
61
|
column: [
|
62
62
|
{
|
@@ -4,8 +4,8 @@ import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/
|
|
4
4
|
import { OperationMap, SnkMessageBuilder } from '../../lib/message/SnkMessageBuilder';
|
5
5
|
import { DatasetStrategy } from '../../lib/http/data-fetcher/fetchers/data-unit/loadstrategy/DatasetStrategy';
|
6
6
|
import { getRecordValue } from '../../lib/dataUnit/ValueFormatter';
|
7
|
-
import { getSelectedIDs } from '../snk-data-exporter/utils/RecordIDUtils';
|
8
7
|
import { convertType } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
8
|
+
import { getSelectedRecordsIDsInfo } from '../../lib/utils/GetSelectedRecordsIDsInfo';
|
9
9
|
export class SnkDataUnit {
|
10
10
|
constructor() {
|
11
11
|
this._onDataUnitResolve = [];
|
@@ -54,6 +54,7 @@ export class SnkDataUnit {
|
|
54
54
|
this.ignoreSaveMessage = undefined;
|
55
55
|
this.configName = undefined;
|
56
56
|
this.resourceID = undefined;
|
57
|
+
this.domainMessagesBuilder = undefined;
|
57
58
|
}
|
58
59
|
observePageSize() {
|
59
60
|
if (this.dataUnit) {
|
@@ -109,7 +110,7 @@ export class SnkDataUnit {
|
|
109
110
|
* @returns Retorna a lista de IDs dos registros selecionados.
|
110
111
|
*/
|
111
112
|
async getSelectedRecordsIDsInfo() {
|
112
|
-
return
|
113
|
+
return getSelectedRecordsIDsInfo(this.dataUnit);
|
113
114
|
}
|
114
115
|
/**
|
115
116
|
* Retorna os campos que possuem a propriedade "rmp" (Row Metadata Provider).
|
@@ -470,21 +471,15 @@ export class SnkDataUnit {
|
|
470
471
|
if (this.ignoreSaveMessage) {
|
471
472
|
return;
|
472
473
|
}
|
473
|
-
const
|
474
|
+
const saveOperation = action.payload.changes[0]._operation.toLowerCase();
|
475
|
+
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0], saveOperation);
|
474
476
|
if (msg != undefined) {
|
475
477
|
this.showSuccessMessage(msg);
|
476
478
|
}
|
477
479
|
}
|
478
480
|
handleRecordsRemoved(action) {
|
479
481
|
var _a, _b;
|
480
|
-
|
481
|
-
let removeFinishMsg;
|
482
|
-
if ((cachedRecords === null || cachedRecords === void 0 ? void 0 : cachedRecords.length) > 1) {
|
483
|
-
removeFinishMsg = this.getMessage("snkDataUnit.removeAllInfo", { size: cachedRecords.length });
|
484
|
-
}
|
485
|
-
else {
|
486
|
-
removeFinishMsg = this.getMessage("snkDataUnit.removeInfo", action.payload.cachedRecords[0]);
|
487
|
-
}
|
482
|
+
let removeFinishMsg = this.buildRemoveFinishMessage(action);
|
488
483
|
if (removeFinishMsg != undefined) {
|
489
484
|
this.showSuccessMessage(removeFinishMsg);
|
490
485
|
}
|
@@ -495,16 +490,27 @@ export class SnkDataUnit {
|
|
495
490
|
this.dataUnit.gotoPage(page);
|
496
491
|
}
|
497
492
|
}
|
493
|
+
buildRemoveFinishMessage(action) {
|
494
|
+
const records = action.payload.records;
|
495
|
+
if (!records || !records.length)
|
496
|
+
return undefined;
|
497
|
+
if ((records === null || records === void 0 ? void 0 : records.length) > 1)
|
498
|
+
return this.getMessage('snkDataUnit.removeAllInfo', { size: records.length });
|
499
|
+
return this.getMessage('snkDataUnit.removeInfo', records);
|
500
|
+
}
|
498
501
|
/**
|
499
502
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
500
503
|
* através de um pequeno modulo na estrutura da aplicação:
|
501
504
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
502
505
|
* Para conhecer os detalhes do módulo, vide o arquivo neste projeto "/src/lib/message/resources/snk-data-unit.msg.ts"
|
503
506
|
*/
|
504
|
-
getMessage(key, params = undefined) {
|
507
|
+
getMessage(key, params = undefined, customOperation) {
|
505
508
|
if (!params) {
|
506
509
|
params = this.getMessageParams();
|
507
510
|
}
|
511
|
+
if (customOperation) {
|
512
|
+
this.messagesBuilder.currentOperation = customOperation;
|
513
|
+
}
|
508
514
|
return this.messagesBuilder.getMessage(key, params);
|
509
515
|
}
|
510
516
|
getMessageParams() {
|
@@ -535,19 +541,28 @@ export class SnkDataUnit {
|
|
535
541
|
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName, this.resourceID);
|
536
542
|
}
|
537
543
|
}
|
544
|
+
updateMetadataWithRMP() {
|
545
|
+
this.fillFieldsWithRmp(this.dataUnit.metadata);
|
546
|
+
this.fillFieldsWithRmPrecision(this.dataUnit.metadata);
|
547
|
+
const dataUnitUpdatedMetadata = this.handleDULinksOnMetadataLoaded(this.dataUnit.metadata);
|
548
|
+
this.dataUnit.metadata = dataUnitUpdatedMetadata;
|
549
|
+
}
|
538
550
|
async loadDataUnit() {
|
539
|
-
var _a;
|
551
|
+
var _a, _b;
|
540
552
|
if (this.dataUnit == null && this._application && this.entityName) {
|
541
553
|
this.dataUnit = await this.getDataUnitParentOrChild();
|
542
554
|
}
|
543
555
|
if (this.dataUnit) {
|
544
556
|
this.dataUnit.pageSize = this.pageSize;
|
545
557
|
this.dataUnit.unsubscribe(this._dataUnitObserver);
|
546
|
-
this.dataUnit.addInterceptor(this);
|
547
558
|
this.dataUnit.subscribe(this._dataUnitObserver);
|
548
|
-
|
549
|
-
|
550
|
-
|
559
|
+
if ((_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.metadata) {
|
560
|
+
this.updateMetadataWithRMP();
|
561
|
+
}
|
562
|
+
this.dataUnit.addInterceptor(this);
|
563
|
+
if ((_b = this.dataUnit.records) === null || _b === void 0 ? void 0 : _b.length) {
|
564
|
+
const { records } = this.getMetadataByRow(this.dataUnit);
|
565
|
+
this.dataUnit.records = records;
|
551
566
|
}
|
552
567
|
this.dataState = this.buildDataState();
|
553
568
|
let resolver;
|
@@ -611,6 +626,13 @@ export class SnkDataUnit {
|
|
611
626
|
parent = parent.parentElement;
|
612
627
|
}
|
613
628
|
}
|
629
|
+
instanceMessagesBuilder() {
|
630
|
+
var _a;
|
631
|
+
if (this.messagesBuilder) {
|
632
|
+
return;
|
633
|
+
}
|
634
|
+
this.messagesBuilder = new SnkMessageBuilder((_a = this.domainMessagesBuilder) !== null && _a !== void 0 ? _a : this.entityName);
|
635
|
+
}
|
614
636
|
//---------------------------------------------
|
615
637
|
// Lifecycle web component
|
616
638
|
//---------------------------------------------
|
@@ -618,9 +640,7 @@ export class SnkDataUnit {
|
|
618
640
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
619
641
|
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
620
642
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
621
|
-
|
622
|
-
this.messagesBuilder = new SnkMessageBuilder(this.entityName);
|
623
|
-
}
|
643
|
+
this.instanceMessagesBuilder();
|
624
644
|
}
|
625
645
|
disconnectedCallback() {
|
626
646
|
if (this.dataUnit) {
|
@@ -860,6 +880,23 @@ export class SnkDataUnit {
|
|
860
880
|
},
|
861
881
|
"attribute": "resource-i-d",
|
862
882
|
"reflect": false
|
883
|
+
},
|
884
|
+
"domainMessagesBuilder": {
|
885
|
+
"type": "string",
|
886
|
+
"mutable": false,
|
887
|
+
"complexType": {
|
888
|
+
"original": "string",
|
889
|
+
"resolved": "string",
|
890
|
+
"references": {}
|
891
|
+
},
|
892
|
+
"required": false,
|
893
|
+
"optional": false,
|
894
|
+
"docs": {
|
895
|
+
"tags": [],
|
896
|
+
"text": "Define a chave customizada para sobrescrever as mensagens (N\u00E3o pegando pela entidade)"
|
897
|
+
},
|
898
|
+
"attribute": "domain-messages-builder",
|
899
|
+
"reflect": false
|
863
900
|
}
|
864
901
|
};
|
865
902
|
}
|
package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js
CHANGED
@@ -19,7 +19,7 @@ export class SnkFilterCheckboxList {
|
|
19
19
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
20
20
|
}
|
21
21
|
renderOptions() {
|
22
|
-
return this.optionsList.map(option => (h("ez-check", { label: option.label,
|
22
|
+
return this.optionsList.map(option => (h("ez-check", { label: option.label, onEzChange: (event) => this.handleToggleCheck(option, event.detail), value: !!this.isChecked(option.name) })));
|
23
23
|
}
|
24
24
|
isChecked(itemName) {
|
25
25
|
var _a;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ApplicationContext, ElementIDUtils,
|
1
|
+
import { ApplicationContext, ElementIDUtils, ObjectUtils, ErrorException } from '@sankhyalabs/core';
|
2
2
|
import { EzScrollDirection } from '@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection';
|
3
3
|
import { h, Host } from '@stencil/core';
|
4
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
@@ -15,18 +15,19 @@ export class SnkFilterBar {
|
|
15
15
|
this._pendingVariables = false;
|
16
16
|
this._customfiltersToBeUpdated = [];
|
17
17
|
this._calculateSortIndex = (item) => {
|
18
|
-
|
19
|
-
|
20
|
-
if (
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
if (!item.visible)
|
19
|
+
return 0;
|
20
|
+
if (item.hardFixed)
|
21
|
+
return 1000000; //campos Hard Fixed não variam a ordem
|
22
|
+
let index = item.fixed ? 100000 : 0;
|
23
|
+
index += this.hasValidValue(item) ? 10000 : 0;
|
24
|
+
index += this._updateSequence.lastIndexOf(item.id) + 1;
|
25
25
|
return index;
|
26
26
|
};
|
27
27
|
this._filtersComparator = (a, b) => {
|
28
28
|
return this._calculateSortIndex(b) - this._calculateSortIndex(a);
|
29
29
|
};
|
30
|
+
this.customFilterBarConfig = undefined;
|
30
31
|
this.dataUnit = undefined;
|
31
32
|
this.title = undefined;
|
32
33
|
this.configName = undefined;
|
@@ -42,6 +43,13 @@ export class SnkFilterBar {
|
|
42
43
|
this.showPersonalizedFilter = false;
|
43
44
|
this.personalizedFilterId = undefined;
|
44
45
|
}
|
46
|
+
hasValidValue(item) {
|
47
|
+
if (item.value === undefined || item.value === null)
|
48
|
+
return false;
|
49
|
+
if (!Array.isArray(item.value))
|
50
|
+
return true;
|
51
|
+
return item.value.some(filterItem => filterItem.check === true);
|
52
|
+
}
|
45
53
|
observeFilterConfig(newValue, oldValue) {
|
46
54
|
if (ObjectUtils.equals(newValue, oldValue))
|
47
55
|
return;
|
@@ -268,7 +276,7 @@ export class SnkFilterBar {
|
|
268
276
|
getFilterItems() {
|
269
277
|
const pinnedItems = [];
|
270
278
|
const unpinnedItems = [];
|
271
|
-
this.filterConfig
|
279
|
+
this.filterConfig.sort((a, b) => this._filtersComparator(a, b))
|
272
280
|
.filter(this.filterActiveFilter)
|
273
281
|
.forEach((item, index) => {
|
274
282
|
item = ObjectUtils.copy(item);
|
@@ -330,19 +338,23 @@ export class SnkFilterBar {
|
|
330
338
|
}
|
331
339
|
}
|
332
340
|
async loadConfigFromStorage(clearCache) {
|
333
|
-
|
334
|
-
|
341
|
+
try {
|
342
|
+
if (clearCache) {
|
343
|
+
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
344
|
+
}
|
345
|
+
let config;
|
346
|
+
if (this.customFilterBarConfig) {
|
347
|
+
config = await this.customFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
|
348
|
+
}
|
349
|
+
else {
|
350
|
+
config = await ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name });
|
351
|
+
}
|
352
|
+
this.filterConfig = config.map(item => this.normalizeItem(item));
|
353
|
+
this.filterConfig.sort((a, b) => this._filtersComparator(a, b));
|
354
|
+
}
|
355
|
+
catch (e) {
|
356
|
+
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), e);
|
335
357
|
}
|
336
|
-
return new Promise(accept => {
|
337
|
-
ConfigStorage.loadFilterBarConfig(this.configName, this.resourceID, { contextURI: this.dataUnit.name })
|
338
|
-
.then((filters) => {
|
339
|
-
accept();
|
340
|
-
this.filterConfig = filters.map(item => this.normalizeItem(item));
|
341
|
-
})
|
342
|
-
.catch(reason => {
|
343
|
-
throw new ErrorException(this.getMessage("snkFilterBar.failToLoadConfig"), reason);
|
344
|
-
});
|
345
|
-
});
|
346
358
|
}
|
347
359
|
attachDataUnit() {
|
348
360
|
if (this.dataUnit == undefined) {
|
@@ -469,6 +481,32 @@ export class SnkFilterBar {
|
|
469
481
|
}
|
470
482
|
static get properties() {
|
471
483
|
return {
|
484
|
+
"customFilterBarConfig": {
|
485
|
+
"type": "unknown",
|
486
|
+
"mutable": false,
|
487
|
+
"complexType": {
|
488
|
+
"original": "(configName: string, resourceId: string, options: any) => Promise<Array<SnkFilterItemConfig>>",
|
489
|
+
"resolved": "(configName: string, resourceId: string, options: any) => Promise<SnkFilterItemConfig[]>",
|
490
|
+
"references": {
|
491
|
+
"Promise": {
|
492
|
+
"location": "global"
|
493
|
+
},
|
494
|
+
"Array": {
|
495
|
+
"location": "global"
|
496
|
+
},
|
497
|
+
"SnkFilterItemConfig": {
|
498
|
+
"location": "import",
|
499
|
+
"path": "./filter-item/snk-filter-item"
|
500
|
+
}
|
501
|
+
}
|
502
|
+
},
|
503
|
+
"required": false,
|
504
|
+
"optional": true,
|
505
|
+
"docs": {
|
506
|
+
"tags": [],
|
507
|
+
"text": "Loader customizado para carregar as configura\u00E7\u00F5es"
|
508
|
+
}
|
509
|
+
},
|
472
510
|
"dataUnit": {
|
473
511
|
"type": "unknown",
|
474
512
|
"mutable": true,
|
@@ -87,7 +87,7 @@ export class SnkForm {
|
|
87
87
|
if (this.resourceID == undefined) {
|
88
88
|
this.resourceID = await ResourceIDUtils.getResourceID();
|
89
89
|
}
|
90
|
-
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
|
90
|
+
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
|
91
91
|
this.addFormLegacyConfig();
|
92
92
|
await this._configManager.loadConfig();
|
93
93
|
}
|
@@ -117,7 +117,7 @@ export class SnkForm {
|
|
117
117
|
if (!this._dataUnit || !this._dataState) {
|
118
118
|
return undefined;
|
119
119
|
}
|
120
|
-
return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this.
|
120
|
+
return (h("section", null, h("div", { class: "ez-row" }, h("div", { class: "ez-col ez-col--sd-12" }, h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
121
121
|
h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
|
122
122
|
}
|
123
123
|
static get is() { return "snk-form"; }
|