@sankhyalabs/sankhyablocks 8.16.0-rc.2 → 8.16.0-rc.21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/{ConfigStorage-a343e418.js → ConfigStorage-ecc0ed20.js} +2 -2
- package/dist/cjs/{IExporterProvider-597949f9.js → ContinuousInsertUtils-29b65619.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-166cbd1f.js → SnkFormConfigManager-f1c92f79.js} +72 -16
- package/dist/cjs/{SnkMessageBuilder-897ffd08.js → SnkMessageBuilder-bae64d0d.js} +6 -2
- 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 +17 -7
- package/dist/cjs/snk-attach.cjs.entry.js +38 -29
- package/dist/cjs/snk-crud.cjs.entry.js +21 -8
- package/dist/cjs/snk-data-exporter.cjs.entry.js +9 -9
- package/dist/cjs/{snk-data-unit-8fa7917a.js → snk-data-unit-d8279f5f.js} +43 -22
- package/dist/cjs/snk-data-unit.cjs.entry.js +5 -5
- package/dist/cjs/snk-detail-view.cjs.entry.js +11 -11
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-bar.cjs.entry.js +40 -25
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
- 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 -5
- package/dist/cjs/snk-form.cjs.entry.js +7 -6
- package/dist/cjs/snk-grid.cjs.entry.js +66 -21
- package/dist/cjs/{snk-guides-viewer-bdc41281.js → snk-guides-viewer-b9920385.js} +29 -13
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -9
- package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +56 -21
- package/dist/cjs/snk-taskbar.cjs.entry.js +61 -36
- package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
- package/dist/collection/components/snk-application/snk-application.js +41 -1
- package/dist/collection/components/snk-attach/snk-attach.js +25 -16
- 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 +103 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +6 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +72 -6
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/options-step.js +1 -1
- 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/structure/ItemBuilder.js +2 -2
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +41 -20
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-checkbox-list.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-personalized-filter-editor/snk-personalized-filter-editor.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 +77 -21
- package/dist/collection/components/snk-form/snk-form.js +2 -2
- package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +70 -14
- package/dist/collection/components/snk-form-config/snk-form-config.js +32 -3
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +100 -8
- package/dist/collection/components/snk-print-selector/snk-print-selector.js +1 -1
- 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 +82 -10
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +103 -36
- package/dist/collection/lib/DefaultCustomFormatters/RmPrecisionCustomValueFormatter.js +3 -3
- 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-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/{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 +70 -14
- package/dist/components/SnkMessageBuilder.js +6 -2
- 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-application2.js +12 -1
- package/dist/components/snk-attach2.js +34 -25
- package/dist/components/snk-crud.js +20 -3
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-data-unit2.js +44 -60
- package/dist/components/snk-detail-view2.js +29 -10
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +39 -22
- package/dist/components/snk-filter-binary-select.js +1 -1
- package/dist/components/snk-filter-checkbox-list.js +1 -1
- package/dist/components/snk-form-config2.js +16 -3
- package/dist/components/snk-form.js +2 -2
- package/dist/components/snk-grid2.js +60 -12
- package/dist/components/snk-personalized-filter-editor.js +1 -1
- package/dist/components/snk-print-selector.js +1 -1
- package/dist/components/snk-simple-bar2.js +1 -1
- package/dist/components/snk-simple-crud2.js +49 -10
- package/dist/components/snk-taskbar2.js +63 -38
- package/dist/esm/{ConfigStorage-3806514e.js → ConfigStorage-7b36d041.js} +2 -2
- package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-30caa626.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-31b24066.js → SnkFormConfigManager-139f09fa.js} +72 -16
- package/dist/esm/{SnkMessageBuilder-571462fb.js → SnkMessageBuilder-6fff4a4c.js} +6 -2
- 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 +17 -7
- package/dist/esm/snk-attach.entry.js +38 -29
- package/dist/esm/snk-crud.entry.js +21 -8
- package/dist/esm/snk-data-exporter.entry.js +9 -9
- package/dist/esm/{snk-data-unit-f5cbe64b.js → snk-data-unit-d10910d9.js} +43 -22
- package/dist/esm/snk-data-unit.entry.js +5 -5
- package/dist/esm/snk-detail-view.entry.js +11 -11
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-filter-bar.entry.js +40 -25
- package/dist/esm/snk-filter-binary-select.entry.js +1 -1
- 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 -5
- package/dist/esm/snk-form.entry.js +7 -6
- package/dist/esm/snk-grid.entry.js +61 -16
- package/dist/esm/{snk-guides-viewer-dda0fede.js → snk-guides-viewer-beb6baef.js} +29 -13
- package/dist/esm/snk-guides-viewer.entry.js +9 -9
- package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-bar.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +52 -17
- package/dist/esm/snk-taskbar.entry.js +62 -37
- 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-af8efd95.js → p-1bf06cd3.js} +2 -2
- package/dist/sankhyablocks/{p-47db7e88.entry.js → p-212213d9.entry.js} +1 -1
- package/dist/sankhyablocks/p-23736d75.js +1 -0
- package/dist/sankhyablocks/p-2923c1b5.js +1 -0
- package/dist/sankhyablocks/{p-871aa14e.entry.js → p-31e74634.entry.js} +1 -1
- package/dist/sankhyablocks/p-38b85e5a.entry.js +1 -0
- package/dist/sankhyablocks/{p-72fc257b.entry.js → p-434817f0.entry.js} +1 -1
- package/dist/sankhyablocks/p-43acd479.entry.js +11 -0
- package/dist/sankhyablocks/{p-52920496.js → p-4d9549cf.js} +1 -1
- package/dist/sankhyablocks/p-50a3623b.entry.js +1 -0
- package/dist/sankhyablocks/p-520c7c38.entry.js +1 -0
- package/dist/sankhyablocks/p-52816250.entry.js +1 -0
- package/dist/sankhyablocks/p-5b51491f.entry.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-62f5f14b.entry.js +1 -0
- package/dist/sankhyablocks/p-7ac7932c.js +60 -0
- package/dist/sankhyablocks/p-7dd49d15.js +1 -0
- package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-8c235d4c.entry.js} +1 -1
- package/dist/sankhyablocks/p-93592aae.js +1 -0
- package/dist/sankhyablocks/p-afbb070d.js +1 -0
- package/dist/sankhyablocks/p-bd1a1ca6.entry.js +1 -0
- package/dist/sankhyablocks/p-c2e468c9.entry.js +1 -0
- package/dist/sankhyablocks/p-c5546f92.js +1 -0
- package/dist/sankhyablocks/p-c6db5eeb.entry.js +1 -0
- package/dist/sankhyablocks/{p-913a9979.js → p-ca5ec380.js} +1 -1
- package/dist/sankhyablocks/p-d0a6fc0f.entry.js +1 -0
- package/dist/sankhyablocks/p-dcead955.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-2c68b3ae.entry.js → p-fb34e0cf.entry.js} +1 -1
- package/dist/sankhyablocks/p-fbb1b675.entry.js +1 -0
- 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-application/snk-application.d.ts +6 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +1 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +17 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +15 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +9 -0
- package/dist/types/components/snk-form-config/SnkFormConfigManager.d.ts +7 -2
- package/dist/types/components/snk-form-config/snk-form-config.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +15 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +10 -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 +119 -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/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-17def7cd.js +0 -1
- package/dist/sankhyablocks/p-219f888d.entry.js +0 -1
- package/dist/sankhyablocks/p-2a408684.js +0 -1
- package/dist/sankhyablocks/p-3a212712.js +0 -1
- package/dist/sankhyablocks/p-450c60e4.entry.js +0 -1
- package/dist/sankhyablocks/p-4e5e1313.entry.js +0 -1
- package/dist/sankhyablocks/p-62ba211a.entry.js +0 -1
- package/dist/sankhyablocks/p-6bb2f3e9.entry.js +0 -1
- package/dist/sankhyablocks/p-7505da04.entry.js +0 -1
- package/dist/sankhyablocks/p-75e674ed.entry.js +0 -1
- package/dist/sankhyablocks/p-7619bdb1.entry.js +0 -11
- package/dist/sankhyablocks/p-7a85fd49.entry.js +0 -1
- package/dist/sankhyablocks/p-7ef9c55c.js +0 -1
- package/dist/sankhyablocks/p-80042dc6.entry.js +0 -1
- package/dist/sankhyablocks/p-88aa931b.entry.js +0 -1
- package/dist/sankhyablocks/p-8c59edd7.entry.js +0 -1
- package/dist/sankhyablocks/p-9863d682.js +0 -1
- package/dist/sankhyablocks/p-b05d8893.entry.js +0 -1
- package/dist/sankhyablocks/p-b11aa1e0.entry.js +0 -1
- package/dist/sankhyablocks/p-c2495304.js +0 -1
- package/dist/sankhyablocks/p-d6e26ea8.entry.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-f2809746.entry.js +0 -1
- package/dist/sankhyablocks/p-fa4d8cb4.js +0 -1
- package/dist/sankhyablocks/p-fe79f83a.js +0 -60
- package/dist/types/components/snk-data-exporter/utils/RecordIDUtils.d.ts +0 -3
@@ -7,20 +7,20 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const constants = require('./constants-35ddd366.js');
|
9
9
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
12
|
-
const
|
10
|
+
require('./DataFetcher-cadeef8e.js');
|
11
|
+
require('./pesquisa-fetcher-ca89181c.js');
|
12
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-29b65619.js');
|
13
13
|
const index = require('./index-1dfc7a6e.js');
|
14
14
|
require('./ISave-e91b70a7.js');
|
15
15
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
17
|
+
const dataunitFetcher = require('./dataunit-fetcher-f89461c1.js');
|
18
18
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
19
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
20
|
-
const fieldSearch = require('./field-search-
|
21
|
-
const ConfigStorage = require('./ConfigStorage-
|
22
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
23
|
-
const
|
19
|
+
const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
|
20
|
+
const fieldSearch = require('./field-search-68e34bf4.js');
|
21
|
+
const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
|
22
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
|
23
|
+
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
24
24
|
const index$2 = require('./index-102ba62d.js');
|
25
25
|
require('./PrintUtils-bcaeb82f.js');
|
26
26
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
@@ -31,7 +31,7 @@ require('./ResourceIDUtils-5ff86aa7.js');
|
|
31
31
|
const REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "MORE_OPTIONS"];
|
32
32
|
const REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER", "MORE_OPTIONS"];
|
33
33
|
|
34
|
-
class ClientSideExporterProvider extends
|
34
|
+
class ClientSideExporterProvider extends ContinuousInsertUtils.CommonsExporter {
|
35
35
|
getSelectedNumber() {
|
36
36
|
return this.dataUnit.getSelectionInfo().length;
|
37
37
|
}
|
@@ -41,7 +41,7 @@ class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
41
41
|
return total !== null && total !== void 0 ? total : (_c = (_b = this.dataUnit) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.length;
|
42
42
|
}
|
43
43
|
getSelectedIDs() {
|
44
|
-
return
|
44
|
+
return GetSelectedRecordsIDsInfo.getSelectedRecordsIDsInfo(this.dataUnit);
|
45
45
|
}
|
46
46
|
getRecordID() {
|
47
47
|
var _a, _b, _c;
|
@@ -86,7 +86,7 @@ class ClientSideExporterProvider extends IExporterProvider.CommonsExporter {
|
|
86
86
|
}
|
87
87
|
}
|
88
88
|
|
89
|
-
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;
|
89
|
+
const snkSimpleCrudCss = ".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";
|
90
90
|
|
91
91
|
const SnkSimpleCrud = class {
|
92
92
|
constructor(hostRef) {
|
@@ -97,7 +97,7 @@ const SnkSimpleCrud = class {
|
|
97
97
|
this.formItemsReady = index$1.createEvent(this, "formItemsReady", 7);
|
98
98
|
this.configuratorSave = index$1.createEvent(this, "configuratorSave", 7);
|
99
99
|
this.configuratorCancel = index$1.createEvent(this, "configuratorCancel", 7);
|
100
|
-
this._multiSelectionListDataSource = new
|
100
|
+
this._multiSelectionListDataSource = new ContinuousInsertUtils.SnkMultiSelectionListDataSource();
|
101
101
|
this._keyDownHandler = (event) => this.keyDownListener(event);
|
102
102
|
this._formConfigFetcher = new formConfigFetcher.FormConfigFetcher();
|
103
103
|
this._customEditors = new Map();
|
@@ -107,7 +107,7 @@ const SnkSimpleCrud = class {
|
|
107
107
|
"snkSimpleCrudTaskbar.grid_regular": this.getButtons(false, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
|
108
108
|
"snkSimpleCrudTaskbar.form_selected": this.getButtons(true, [taskbarElements.TaskbarElement.GRID_MODE]),
|
109
109
|
"snkSimpleCrudTaskbar.grid_selected": this.getButtons(true, [taskbarElements.TaskbarElement.DATA_EXPORTER, taskbarElements.TaskbarElement.FORM_MODE]),
|
110
|
-
"snkSimpleCrudTaskbar.finish_edition":
|
110
|
+
"snkSimpleCrudTaskbar.finish_edition": this.getFinishEditionButtonsCallback.bind(this)
|
111
111
|
});
|
112
112
|
this._showPopUpGridConfig = false;
|
113
113
|
this._showFormConfig = false;
|
@@ -121,12 +121,15 @@ const SnkSimpleCrud = class {
|
|
121
121
|
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
122
122
|
this.gridConfig = undefined;
|
123
123
|
this.formConfig = undefined;
|
124
|
+
this.enableLockManger = false;
|
124
125
|
this._formFields = [];
|
125
126
|
this._fieldsProps = new Map();
|
127
|
+
this._enableContinuousInsert = true;
|
126
128
|
this.multipleSelection = undefined;
|
127
129
|
this.useCancelConfirm = true;
|
128
130
|
this.pageSize = 150;
|
129
131
|
this.resourceID = undefined;
|
132
|
+
this.enableGridInsert = false;
|
130
133
|
this.taskbarManager = undefined;
|
131
134
|
this.messagesBuilder = undefined;
|
132
135
|
this.useEnterLikeTab = false;
|
@@ -196,6 +199,13 @@ const SnkSimpleCrud = class {
|
|
196
199
|
newCustomFieldProps.set(fieldName, Object.assign(Object.assign({}, currentProps), { [propName]: value }));
|
197
200
|
this._fieldsProps = newCustomFieldProps;
|
198
201
|
}
|
202
|
+
getFinishEditionButtonsCallback() {
|
203
|
+
const btns = ["CANCEL", "SAVE"];
|
204
|
+
if (this.enableGridInsert && this._currentViewMode !== constants.VIEW_MODE.ATTACHMENT) {
|
205
|
+
btns.push(this._currentViewMode === constants.VIEW_MODE.GRID ? taskbarElements.TaskbarElement.FORM_MODE : taskbarElements.TaskbarElement.GRID_MODE);
|
206
|
+
}
|
207
|
+
return btns;
|
208
|
+
}
|
199
209
|
getButtons(selected, extraButtons) {
|
200
210
|
return this.addConfigButton(this.resolveInMemoryBtns(selected ? REGULAR_SELECTED_BTNS : REGULAR_DEFAULT_BTNS)
|
201
211
|
.concat(extraButtons));
|
@@ -359,7 +369,7 @@ const SnkSimpleCrud = class {
|
|
359
369
|
return;
|
360
370
|
}
|
361
371
|
if (this._formConfigManager == undefined) {
|
362
|
-
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID());
|
372
|
+
this._formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resolveResourceID(), undefined, this.dataUnit);
|
363
373
|
this._formConfigManager.setConfig(this.formConfig);
|
364
374
|
}
|
365
375
|
if (this.formConfigIsLoaded() && !forceLoad) {
|
@@ -399,7 +409,11 @@ const SnkSimpleCrud = class {
|
|
399
409
|
this.processMetadata();
|
400
410
|
this.onModeChange();
|
401
411
|
this.configDatasource();
|
402
|
-
this._rmPrecisionCustomValueFormatter = new
|
412
|
+
this._rmPrecisionCustomValueFormatter = new ContinuousInsertUtils.RmPrecisionCustomValueFormatter();
|
413
|
+
this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this.application, this.resolveResourceID(), this.configName);
|
414
|
+
if (this.enableGridInsert) {
|
415
|
+
this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
|
416
|
+
}
|
403
417
|
}
|
404
418
|
componentDidLoad() {
|
405
419
|
utils.CSSVarsUtils.applyVarsGrid(this._element, this._grid);
|
@@ -634,6 +648,9 @@ const SnkSimpleCrud = class {
|
|
634
648
|
const options = filteredFields.map(field => ({ value: field.name, label: field.label }));
|
635
649
|
return Promise.resolve(options);
|
636
650
|
}
|
651
|
+
isGridInsertActive() {
|
652
|
+
return this.enableGridInsert && this.dataUnit.hasNewRecord();
|
653
|
+
}
|
637
654
|
getActionsList() {
|
638
655
|
var _a, _b;
|
639
656
|
const hardList = [{
|
@@ -645,11 +662,21 @@ const SnkSimpleCrud = class {
|
|
645
662
|
? this.getColumnSearch(actionButton, item)
|
646
663
|
: this.getFieldSearch(actionButton, item)
|
647
664
|
}];
|
665
|
+
if (this.enableGridInsert) {
|
666
|
+
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
|
667
|
+
this._enableContinuousInsert = !this._enableContinuousInsert;
|
668
|
+
this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
|
669
|
+
}));
|
670
|
+
}
|
671
|
+
if (this.isGridInsertActive())
|
672
|
+
return hardList;
|
648
673
|
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
649
674
|
const taskbarID = this.getTopTaskBarId();
|
650
675
|
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this.dataState, this.actionsList));
|
651
676
|
}
|
652
|
-
|
677
|
+
if (this.actionsList)
|
678
|
+
return hardList.concat(this.actionsList);
|
679
|
+
return hardList;
|
653
680
|
}
|
654
681
|
getTopTaskBarId() {
|
655
682
|
var _a;
|
@@ -694,9 +721,11 @@ const SnkSimpleCrud = class {
|
|
694
721
|
window.removeEventListener("keydown", this._keyDownHandler);
|
695
722
|
}
|
696
723
|
gridConfigChangeHandler(evt) {
|
724
|
+
evt.stopPropagation();
|
725
|
+
if (!this.configName)
|
726
|
+
return;
|
697
727
|
const config = evt.detail;
|
698
728
|
ConfigStorage.ConfigStorage.saveGridConfig(config, this.configName, this.resolveResourceID());
|
699
|
-
evt.stopPropagation();
|
700
729
|
}
|
701
730
|
modalConfigChangeHandler(evt) {
|
702
731
|
const config = evt.detail;
|
@@ -723,7 +752,7 @@ const SnkSimpleCrud = class {
|
|
723
752
|
}
|
724
753
|
setGridConfig(config) {
|
725
754
|
this.gridConfig = config;
|
726
|
-
|
755
|
+
ContinuousInsertUtils.CrudUtils.assertDefaultSorting(this.gridConfig, this.dataUnit);
|
727
756
|
}
|
728
757
|
setFormConfig(config, forceUpdate) {
|
729
758
|
if (this.formConfig && !forceUpdate)
|
@@ -768,15 +797,21 @@ const SnkSimpleCrud = class {
|
|
768
797
|
}
|
769
798
|
this._formConfigManager.setConfig(this.formConfig);
|
770
799
|
}
|
800
|
+
handleDataUnitOnInsertionMode() {
|
801
|
+
if (this.enableGridInsert)
|
802
|
+
return;
|
803
|
+
this.goToView(constants.VIEW_MODE.FORM);
|
804
|
+
}
|
771
805
|
/* istanbul ignore next */
|
772
806
|
render() {
|
773
807
|
var _a;
|
774
808
|
if (this.dataUnit == undefined) {
|
775
809
|
return;
|
776
810
|
}
|
777
|
-
|
811
|
+
const taskbarContent = (index$1.h("snk-taskbar", { class: this._currentViewMode === constants.VIEW_MODE.FORM && "ez-box ez-box--shadow ez-padding--small", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, actionsList: this.getActionsList(), disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, "data-exporter-store-key": this.getDataExporterStoreKey(), slot: "leftButtons", presentationMode: index.PresentationMode.SECONDARY }, index$1.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })));
|
812
|
+
return (index$1.h("snk-data-unit", { ref: ref => this._snkDataUnit = ref, class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), pageSize: this.getPageSize(), onInsertionMode: this.handleDataUnitOnInsertionMode.bind(this), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail, onDataUnitFieldsHidded: this.updateFormConfig.bind(this), domainMessagesBuilder: this.domainMessagesBuilder }, index$1.h("header", null, index$1.h("slot", { name: "snkSimpleCrudHeader" })), index$1.h("section", { class: "ez-box ez-box--shadow simple-crud__container-section" }, this._currentViewMode === constants.VIEW_MODE.FORM && taskbarContent, index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index$1.h("stack-item", null, index$1.h("ez-grid", { class: "ez-margin-bottom--large", ref: ref => this._grid = ref, dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), onConfigChange: evt => this.gridConfigChangeHandler(evt), columnfilterDataSource: this.dataUnit.name && this.dataUnit.name.includes(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
778
813
|
? undefined
|
779
|
-
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus }, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
814
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableContinuousInsert: this._enableContinuousInsert, enableLockManger: this.enableLockManger }, this._currentViewMode === constants.VIEW_MODE.GRID && taskbarContent, index$1.h("div", { slot: "footer" }, index$1.h("slot", { name: "snkSimpleCrudFooter" })))), index$1.h("stack-item", null, index$1.h("ez-form", { ref: (ref) => this._form = ref, class: `ez-margin-top--large ${this.handleShowFormConfig() ? "simple-crud__form--hidden" : ""}`, dataUnit: this.dataUnit, config: this.getFormConfig(), fieldToFocus: this._fieldToGetFocus, onEzFormSetFields: (evt) => this.handleFormSetFields(evt.detail), onEzFormRequestClearFieldToFocus: this.clearFieldToFocusHandler.bind(this) }), this.handleShowFormConfig() && index$1.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this.dataUnit, configManager: this._formConfigManager, onConfigClose: () => this.closeFormConfig() })), this.messagesBuilder && index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.goToView(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showConfiguratorButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this.resolveResourceID(), customContainerId: this._customContainerId })), index$1.h("div", { id: `${this._customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }))), index$1.h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._showPopUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, index$1.h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this.gridConfig, "data-element-id": this._element.getAttribute(core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resolveResourceID() }))));
|
780
815
|
}
|
781
816
|
get _element() { return index$1.getElement(this); }
|
782
817
|
static get watchers() { return {
|
@@ -15,6 +15,8 @@ const SnkTaskbar = class {
|
|
15
15
|
constructor(hostRef) {
|
16
16
|
index.registerInstance(this, hostRef);
|
17
17
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
18
|
+
this.taskbarSaveLocker = index.createEvent(this, "taskbarSaveLocker", 7);
|
19
|
+
this.taskbarSaveUnlocker = index.createEvent(this, "taskbarSaveUnlocker", 7);
|
18
20
|
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
19
21
|
this.TASKBAR_CUSTOM_ELEMENTS_CONTAINER_CLASS_NAME = 'taskbar-custom-elements-container';
|
20
22
|
this.ACTIONS_BUTTON_TAG = 'TASKBAR-ACTIONS-BUTTON';
|
@@ -38,8 +40,10 @@ const SnkTaskbar = class {
|
|
38
40
|
this.onSaveEvent = (action) => {
|
39
41
|
switch (action.type) {
|
40
42
|
case core.Action.FIELD_INVALIDATED:
|
43
|
+
case core.Action.INVALIDATE_CLEAN:
|
41
44
|
case core.Action.DATA_SAVED:
|
42
45
|
case core.Action.SAVING_ERROR:
|
46
|
+
case core.Action.SAVING_CANCELED:
|
43
47
|
this._isWaitingForSave = false;
|
44
48
|
break;
|
45
49
|
case core.Action.SAVING_DATA:
|
@@ -76,6 +80,16 @@ const SnkTaskbar = class {
|
|
76
80
|
this.getCustomElements(true);
|
77
81
|
}
|
78
82
|
}
|
83
|
+
handleTaskbarSaveLocker() {
|
84
|
+
if (this._isWaitingForSave !== true) {
|
85
|
+
this._isWaitingForSave = true;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
handleTaskbarSaveUnlocker() {
|
89
|
+
if (this._isWaitingForSave === true) {
|
90
|
+
this._isWaitingForSave = false;
|
91
|
+
}
|
92
|
+
}
|
79
93
|
hasToSearchCustomElements(event) {
|
80
94
|
return this.customSlotId === event.detail && !this._slotContainer;
|
81
95
|
}
|
@@ -94,6 +108,14 @@ const SnkTaskbar = class {
|
|
94
108
|
this._hasToUpdateOverFlow = true;
|
95
109
|
}
|
96
110
|
}
|
111
|
+
observeIsWaitingForSave(newValue, oldValue) {
|
112
|
+
if (newValue == true && oldValue == false) {
|
113
|
+
this.taskbarSaveLocker.emit();
|
114
|
+
}
|
115
|
+
if (newValue == false && oldValue == true) {
|
116
|
+
this.taskbarSaveUnlocker.emit();
|
117
|
+
}
|
118
|
+
}
|
97
119
|
// Internal methods
|
98
120
|
elementsFromString(strButtons) {
|
99
121
|
const elements = [];
|
@@ -138,42 +160,44 @@ const SnkTaskbar = class {
|
|
138
160
|
return key ? (_a = this.messagesBuilder) === null || _a === void 0 ? void 0 : _a.getMessage(key, {}) : "";
|
139
161
|
}
|
140
162
|
elementClick(elem) {
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
this._isWaitingForSave
|
167
|
-
|
168
|
-
.
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
163
|
+
core.LockManager.whenResolve(this._element, core.LockManagerOperation.TASKBAR_CLICK).then(() => {
|
164
|
+
if (this.dataUnit) {
|
165
|
+
switch (elem) {
|
166
|
+
case taskbarElements.TaskbarElement.PREVIOUS:
|
167
|
+
this.dataUnit.previousRecord();
|
168
|
+
break;
|
169
|
+
case taskbarElements.TaskbarElement.NEXT:
|
170
|
+
this.dataUnit.nextRecord();
|
171
|
+
break;
|
172
|
+
case taskbarElements.TaskbarElement.REFRESH:
|
173
|
+
this.dataUnit.loadData();
|
174
|
+
break;
|
175
|
+
case taskbarElements.TaskbarElement.CLONE:
|
176
|
+
this.dataUnit.copySelected();
|
177
|
+
break;
|
178
|
+
case taskbarElements.TaskbarElement.REMOVE:
|
179
|
+
this.dataUnit.removeSelectedRecords();
|
180
|
+
break;
|
181
|
+
case taskbarElements.TaskbarElement.INSERT:
|
182
|
+
this.dataUnit.addRecord();
|
183
|
+
break;
|
184
|
+
case taskbarElements.TaskbarElement.CANCEL:
|
185
|
+
this.dataUnit.cancelEdition();
|
186
|
+
break;
|
187
|
+
case taskbarElements.TaskbarElement.SAVE:
|
188
|
+
if (!this._isWaitingForSave) {
|
189
|
+
this._isWaitingForSave = true;
|
190
|
+
this.dataUnit.saveData()
|
191
|
+
.finally(() => {
|
192
|
+
this._isWaitingForSave = false;
|
193
|
+
});
|
194
|
+
}
|
195
|
+
break;
|
196
|
+
}
|
173
197
|
}
|
174
|
-
|
175
|
-
|
176
|
-
|
198
|
+
if (this.isEnabled(elem))
|
199
|
+
this.actionClick.emit(elem);
|
200
|
+
});
|
177
201
|
}
|
178
202
|
isEnabled(elem) {
|
179
203
|
if (!this.isAllowed(elem)) {
|
@@ -422,7 +446,8 @@ const SnkTaskbar = class {
|
|
422
446
|
static get watchers() { return {
|
423
447
|
"buttons": ["observeButtons"],
|
424
448
|
"disabledButtons": ["observeDisabledButtons"],
|
425
|
-
"_lastWidth": ["observeLastWidth"]
|
449
|
+
"_lastWidth": ["observeLastWidth"],
|
450
|
+
"_isWaitingForSave": ["observeIsWaitingForSave"]
|
426
451
|
}; }
|
427
452
|
};
|
428
453
|
SnkTaskbar.style = snkTaskbarCss;
|
@@ -3,9 +3,9 @@ import { RefreshType } from "./enum/RefreshType";
|
|
3
3
|
import { ParamType } from "./enum/ParamType";
|
4
4
|
import { DataFetcher } from "../../../lib";
|
5
5
|
import { ActionsType } from "./enum/ActionsType";
|
6
|
+
import { getSelectedRecordsIDsInfo } from "../../../lib/utils/GetSelectedRecordsIDsInfo";
|
6
7
|
const MASTER_ROW_PROPERTY = "__MASTER_ROW__";
|
7
8
|
const ENTITY_NAME_PROPERTY = '__ENTITY_NAME__';
|
8
|
-
const NUFIN_COLUMN = 'NUFIN';
|
9
9
|
const SERVICE_GET_CONFIGURATIONS = 'SystemUtilsSP.getConf';
|
10
10
|
export default class Actions {
|
11
11
|
constructor(actionsExecuteInterface, dataUnit, appResourceId) {
|
@@ -17,6 +17,10 @@ export default class Actions {
|
|
17
17
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
18
18
|
this._appResourceId = appResourceId;
|
19
19
|
}
|
20
|
+
getPrimaryKeys() {
|
21
|
+
const ids = getSelectedRecordsIDsInfo(this._dataUnit);
|
22
|
+
return ids.map(({ name }) => name);
|
23
|
+
}
|
20
24
|
apply(action, hasParamsToSave) {
|
21
25
|
this._application.closePopUp();
|
22
26
|
this._actionsExecuteInterface.execute(action, this._dataUnit)
|
@@ -285,6 +289,7 @@ export default class Actions {
|
|
285
289
|
executeAction(execSource);
|
286
290
|
}
|
287
291
|
addRows(execSource) {
|
292
|
+
const primaryKeys = this.getPrimaryKeys();
|
288
293
|
const rows = {
|
289
294
|
row: []
|
290
295
|
};
|
@@ -298,15 +303,13 @@ export default class Actions {
|
|
298
303
|
delete sourceRow[MASTER_ROW_PROPERTY];
|
299
304
|
delete sourceRow[ENTITY_NAME_PROPERTY];
|
300
305
|
}
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
row.field = [];
|
306
|
-
}
|
306
|
+
if (!row.field) {
|
307
|
+
row.field = [];
|
308
|
+
}
|
309
|
+
for (const primaryKey of primaryKeys) {
|
307
310
|
row.field.push({
|
308
|
-
fieldName:
|
309
|
-
$: sourceRow[
|
311
|
+
fieldName: primaryKey,
|
312
|
+
$: sourceRow[primaryKey]
|
310
313
|
});
|
311
314
|
}
|
312
315
|
rows.row.push(row);
|
@@ -15,6 +15,7 @@ import { SnkMessageBuilder } from "../../lib/message/SnkMessageBuilder";
|
|
15
15
|
import UrlUtils from "../../lib/utils/urlutils";
|
16
16
|
import Workspace from "../../lib/workspace/workspace";
|
17
17
|
import { SnkErrorHandler } from "./errorhandler/snk-error-handler";
|
18
|
+
import PreloadManager from "../../lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager";
|
18
19
|
/**
|
19
20
|
* É possível customizar as mensagens dos blocos de construção através de um pequeno modulo na estrutura da aplicação:
|
20
21
|
* - Criar um arquivo no seguinte caminho: /messages/appmessages.msg.js.
|
@@ -516,6 +517,16 @@ export class SnkApplication {
|
|
516
517
|
async isLoadedByPk() {
|
517
518
|
return Promise.resolve(this._isLoadedByPk);
|
518
519
|
}
|
520
|
+
/**
|
521
|
+
* Remove registro do cache do PreLoader do dataunit.
|
522
|
+
* Deve ser usado quando existe um dataunit usando loader do application, mas o removeLoader está sendo sobrescrito.
|
523
|
+
*/
|
524
|
+
async preloadMangerRemoveRecord(dataUnit, recordsIDs) {
|
525
|
+
const records = recordsIDs.map(id => {
|
526
|
+
return { "__record__id__": id };
|
527
|
+
});
|
528
|
+
PreloadManager.removeRecords(dataUnit, records);
|
529
|
+
}
|
519
530
|
async getAuthList(auth) {
|
520
531
|
return await (new MGEAuthorization()).parseFromJSON(auth);
|
521
532
|
}
|
@@ -1096,7 +1107,7 @@ export class SnkApplication {
|
|
1096
1107
|
"mutable": false,
|
1097
1108
|
"complexType": {
|
1098
1109
|
"original": "LoadByPkHandler",
|
1099
|
-
"resolved": "(objPK: { pk:
|
1110
|
+
"resolved": "(objPK: { pk: any; }, redirectFrom?: string) => void",
|
1100
1111
|
"references": {
|
1101
1112
|
"LoadByPkHandler": {
|
1102
1113
|
"location": "global"
|
@@ -2200,6 +2211,35 @@ export class SnkApplication {
|
|
2200
2211
|
}]
|
2201
2212
|
}
|
2202
2213
|
},
|
2214
|
+
"preloadMangerRemoveRecord": {
|
2215
|
+
"complexType": {
|
2216
|
+
"signature": "(dataUnit: DataUnit, recordsIDs: Array<string>) => Promise<void>",
|
2217
|
+
"parameters": [{
|
2218
|
+
"tags": [],
|
2219
|
+
"text": ""
|
2220
|
+
}, {
|
2221
|
+
"tags": [],
|
2222
|
+
"text": ""
|
2223
|
+
}],
|
2224
|
+
"references": {
|
2225
|
+
"Promise": {
|
2226
|
+
"location": "global"
|
2227
|
+
},
|
2228
|
+
"DataUnit": {
|
2229
|
+
"location": "import",
|
2230
|
+
"path": "@sankhyalabs/core"
|
2231
|
+
},
|
2232
|
+
"Array": {
|
2233
|
+
"location": "global"
|
2234
|
+
}
|
2235
|
+
},
|
2236
|
+
"return": "Promise<void>"
|
2237
|
+
},
|
2238
|
+
"docs": {
|
2239
|
+
"text": "Remove registro do cache do PreLoader do dataunit.\nDeve ser usado quando existe um dataunit usando loader do application, mas o removeLoader est\u00E1 sendo sobrescrito.",
|
2240
|
+
"tags": []
|
2241
|
+
}
|
2242
|
+
},
|
2203
2243
|
"executeSearch": {
|
2204
2244
|
"complexType": {
|
2205
2245
|
"signature": "(searchArgument: ISearchArgument, fieldName: string, dataUnit: DataUnit) => Promise<Array<IOption> | IOption>",
|
@@ -46,11 +46,20 @@ export class SnkAttach {
|
|
46
46
|
this.loadAttachmentDataUnit();
|
47
47
|
}
|
48
48
|
if (oldRegisterKey !== newRegisterKey) {
|
49
|
+
if (this._currentFetcher instanceof AnexoSistemaFetcher) {
|
50
|
+
this._currentFetcher.registerKey = newRegisterKey;
|
51
|
+
}
|
49
52
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
|
50
53
|
}
|
51
54
|
}
|
55
|
+
getAnexoSistemaFetcherInstance() {
|
56
|
+
var _a;
|
57
|
+
const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
58
|
+
anexoSistemaFetcher.registerKey = this.registerKey;
|
59
|
+
return anexoSistemaFetcher;
|
60
|
+
}
|
52
61
|
async initAttach() {
|
53
|
-
var _a, _b, _c, _d, _e
|
62
|
+
var _a, _b, _c, _d, _e;
|
54
63
|
if (!this.fetcherType && !this.registerKey)
|
55
64
|
return;
|
56
65
|
if (!this.fetcherType) {
|
@@ -58,18 +67,18 @@ export class SnkAttach {
|
|
58
67
|
}
|
59
68
|
this.returnToGridMode();
|
60
69
|
if (this.fetcherType === "AnexoSistema") {
|
61
|
-
this._currentFetcher =
|
62
|
-
(
|
63
|
-
await ((
|
70
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
71
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
72
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
64
73
|
return;
|
65
74
|
}
|
66
75
|
if (this.fetcherType === "Attach") {
|
67
|
-
const hasMoreOneItem = ((
|
76
|
+
const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
|
68
77
|
if (hasMoreOneItem)
|
69
78
|
return;
|
70
79
|
}
|
71
|
-
await ((
|
72
|
-
await ((
|
80
|
+
await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
|
81
|
+
await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
|
73
82
|
}
|
74
83
|
/**
|
75
84
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -128,11 +137,11 @@ export class SnkAttach {
|
|
128
137
|
}
|
129
138
|
}
|
130
139
|
async loadAnexoSistema() {
|
131
|
-
var _a, _b
|
140
|
+
var _a, _b;
|
132
141
|
this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
133
|
-
this._currentFetcher =
|
142
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
134
143
|
if (!this._currentDataUnit.metadata) {
|
135
|
-
await ((
|
144
|
+
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
136
145
|
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
137
146
|
}
|
138
147
|
this.initDataUnitLoaders();
|
@@ -142,7 +151,7 @@ export class SnkAttach {
|
|
142
151
|
this._currentDataUnit.addInterceptor({
|
143
152
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
144
153
|
});
|
145
|
-
await ((
|
154
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
146
155
|
this.disableEditFieldsNotInForm();
|
147
156
|
}
|
148
157
|
async loadAttach() {
|
@@ -168,16 +177,16 @@ export class SnkAttach {
|
|
168
177
|
}
|
169
178
|
}
|
170
179
|
initDataUnitLoaders() {
|
171
|
-
var _a, _b
|
180
|
+
var _a, _b;
|
172
181
|
if (this.fetcherType === "AnexoSistema") {
|
173
|
-
this._currentFetcher =
|
182
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
174
183
|
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
175
|
-
(
|
184
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
176
185
|
}
|
177
186
|
if (this.fetcherType === "Attach") {
|
178
187
|
this._currentFetcher = new AttachFetcher();
|
179
188
|
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
180
|
-
(
|
189
|
+
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
181
190
|
this.returnToGridMode();
|
182
191
|
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
183
192
|
});
|
@@ -221,7 +230,7 @@ export class SnkAttach {
|
|
221
230
|
var _a, _b;
|
222
231
|
if (!this._currentDataUnit)
|
223
232
|
return null;
|
224
|
-
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" }, this.getMessage("snkAttach.description")))))))));
|
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")))))))));
|
225
234
|
}
|
226
235
|
static get is() { return "snk-attach"; }
|
227
236
|
static get encapsulation() { return "scoped"; }
|
@@ -3,7 +3,7 @@ import { SaveErrorsEnum } from '../../../../../lib/http/data-fetcher/fetchers/At
|
|
3
3
|
import { AutorizationType } from '../../../../../lib/http/data-fetcher/fetchers/auth-fetcher';
|
4
4
|
import { attachFetcherMetadataBuilder } from '../../builder/attach-crud-config.builder';
|
5
5
|
import { VIEW_MODE } from '../../../../../lib/utils/constants';
|
6
|
-
import {
|
6
|
+
import { buildLoadDataResponse } from '../../../../../lib/dataUnit/dataUnitInMemoryUtils';
|
7
7
|
const SERVICE_LOAD = "Attach.load";
|
8
8
|
export class AttachFetcherDataUnitFactory {
|
9
9
|
constructor(getMessage) {
|
@@ -49,9 +49,7 @@ export class AttachFetcherDataUnitFactory {
|
|
49
49
|
});
|
50
50
|
this._records = records;
|
51
51
|
}
|
52
|
-
|
53
|
-
records = applySorting(records, dataUnit, request.sort);
|
54
|
-
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
52
|
+
return buildLoadDataResponse(this._records, dataUnit, request);
|
55
53
|
}
|
56
54
|
saveLoader(changes, fetcher) {
|
57
55
|
return new Promise((resolve) => {
|