@sankhyalabs/sankhyablocks 8.16.0-dev.4 → 8.16.0-dev.41
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-37c7cbcf.js} +64 -22
- 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-a36ae041.js} +48 -20
- 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/index-f9e81701.js +8 -28
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-680e198f.js → pesquisa-fetcher-490a86c3.js} +7 -2
- 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 +38 -29
- package/dist/cjs/{snk-form-config.cjs.entry.js → snk-config-options_3.cjs.entry.js} +381 -7
- package/dist/cjs/snk-crud.cjs.entry.js +16 -7
- package/dist/cjs/snk-data-exporter.cjs.entry.js +19 -18
- package/dist/cjs/{snk-data-unit-685272e7.js → snk-data-unit-b460f1da.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_4.cjs.entry.js +1411 -0
- 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-grid.cjs.entry.js +58 -21
- package/dist/cjs/{snk-guides-viewer-67605336.js → snk-guides-viewer-de0a5c57.js} +27 -14
- 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 +66 -27
- package/dist/cjs/snk-taskbar.cjs.entry.js +24 -1
- package/dist/collection/collection-manifest.json +11 -31
- package/dist/collection/components/snk-actions-button/actions/index.js +12 -9
- 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 +97 -2
- 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.css +6 -6
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +70 -7
- 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-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 +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 +32 -3
- package/dist/collection/components/snk-grid/snk-grid.css +2 -0
- package/dist/collection/components/snk-grid/snk-grid.js +74 -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 +91 -16
- package/dist/collection/components/snk-taskbar/processor/taskbar-processor.js +5 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +65 -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/DataUnitDataLoader.js +2 -2
- 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/http/data-fetcher/fetchers/pesquisa-fetcher.js +6 -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/lib/utils/CrudUtils.js +25 -16
- package/dist/collection/{components/snk-data-exporter/utils/RecordIDUtils.js → lib/utils/GetSelectedRecordsIDsInfo.js} +9 -9
- package/dist/collection/sw.js +46 -0
- package/dist/components/ConfigStorage.js +1 -0
- package/dist/components/{IExporterProvider.js → ContinuousInsertUtils.js} +65 -21
- 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 +47 -17
- package/dist/components/form-config-fetcher.js +4 -1
- package/dist/components/pesquisa-fetcher.js +6 -1
- package/dist/components/snk-actions-button2.js +12 -9
- package/dist/components/snk-attach2.js +34 -25
- package/dist/components/snk-crud.js +15 -2
- 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 +28 -13
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +35 -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 +17 -4
- package/dist/components/snk-form.js +2 -2
- package/dist/components/snk-grid2.js +51 -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 +59 -16
- package/dist/components/snk-taskbar2.js +25 -2
- package/dist/esm/{ConfigStorage-86187da3.js → ConfigStorage-7b36d041.js} +3 -2
- package/dist/esm/{IExporterProvider-63a188b6.js → ContinuousInsertUtils-881c41a9.js} +65 -24
- 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-f1a0fc92.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/{constants-8457af36.js → constants-7302ee87.js} +1 -1
- package/dist/esm/{dataunit-fetcher-264191b2.js → dataunit-fetcher-fd58c640.js} +48 -18
- 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/index-a7d3d3f1.js +8 -28
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-03c8f919.js → pesquisa-fetcher-50fc7e6b.js} +7 -2
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_4.entry.js +18 -15
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +39 -30
- package/dist/esm/{snk-form-config.entry.js → snk-config-options_3.entry.js} +382 -10
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +17 -8
- package/dist/esm/snk-data-exporter.entry.js +20 -19
- package/dist/esm/{snk-data-unit-63f83504.js → snk-data-unit-590225b5.js} +42 -22
- package/dist/esm/snk-data-unit.entry.js +5 -5
- package/dist/esm/snk-detail-view.entry.js +13 -14
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/snk-field-config.entry.js +1 -1
- package/dist/esm/snk-filter-bar_4.entry.js +1404 -0
- 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-grid.entry.js +53 -16
- package/dist/esm/{snk-guides-viewer-151f6091.js → snk-guides-viewer-2f4dcdc5.js} +28 -15
- 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 +63 -24
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +24 -1
- package/dist/sankhyablocks/p-052213ba.entry.js +1 -0
- package/dist/sankhyablocks/{p-df5451c7.js → p-06421fdb.js} +2 -2
- package/dist/sankhyablocks/p-0b6cd238.entry.js +1 -0
- package/dist/sankhyablocks/p-16a1dd18.entry.js +1 -0
- package/dist/sankhyablocks/p-17425c72.js +1 -0
- 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-242d010e.entry.js +1 -0
- package/dist/sankhyablocks/p-275de842.entry.js +1 -0
- package/dist/sankhyablocks/p-2aae03a1.entry.js +1 -0
- package/dist/sankhyablocks/{p-8eb67fa4.entry.js → p-2d3f9482.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7663f597.entry.js → p-41793e17.entry.js} +1 -1
- package/dist/sankhyablocks/{p-72fc257b.entry.js → p-434817f0.entry.js} +1 -1
- package/dist/sankhyablocks/p-47bce500.js +60 -0
- package/dist/sankhyablocks/{p-aff76a53.js → p-4d9549cf.js} +2 -2
- package/dist/sankhyablocks/p-583517ba.entry.js +1 -0
- package/dist/sankhyablocks/p-5b51491f.entry.js +1 -0
- package/dist/sankhyablocks/p-5e51e833.entry.js +1 -0
- package/dist/sankhyablocks/{p-aaa3ee68.entry.js → p-5f157b09.entry.js} +1 -1
- package/dist/sankhyablocks/p-6114ee36.entry.js +1 -0
- package/dist/sankhyablocks/p-72c10005.entry.js +1 -0
- package/dist/sankhyablocks/p-7bd9683d.js +1 -0
- package/dist/sankhyablocks/p-7dd49d15.js +1 -0
- package/dist/sankhyablocks/{p-af8efd95.js → p-8a9638ae.js} +2 -2
- package/dist/sankhyablocks/{p-95df461f.entry.js → p-8b4fc28f.entry.js} +1 -1
- package/dist/sankhyablocks/{p-41f8bfa3.entry.js → p-8c235d4c.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b0ef4383.js → p-95ce311a.js} +1 -1
- package/dist/sankhyablocks/p-ab1645fb.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-cefb0ee1.entry.js +1 -0
- package/dist/sankhyablocks/p-cfa1b199.js +1 -0
- package/dist/sankhyablocks/{p-82a0bfb0.entry.js → p-dbe6174a.entry.js} +2 -2
- package/dist/sankhyablocks/p-f3434fc4.js +1 -0
- package/dist/sankhyablocks/p-fa6c5826.entry.js +1 -0
- package/dist/sankhyablocks/p-fadc8339.js +1 -0
- package/dist/sankhyablocks/{p-eae7a817.entry.js → p-fb34e0cf.entry.js} +1 -1
- package/dist/sankhyablocks/p-fd13b4d2.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-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-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-form-config/snk-form-config.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +11 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +13 -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 +113 -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/CrudUtils.d.ts +1 -0
- package/dist/types/lib/utils/GetSelectedRecordsIDsInfo.d.ts +3 -0
- package/package.json +4 -3
- package/dist/cjs/snk-config-options.cjs.entry.js +0 -239
- package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -714
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -312
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -152
- package/dist/cjs/snk-filter-modal.cjs.entry.js +0 -249
- package/dist/cjs/snk-form.cjs.entry.js +0 -143
- package/dist/esm/snk-config-options.entry.js +0 -235
- package/dist/esm/snk-filter-bar.entry.js +0 -710
- package/dist/esm/snk-filter-item.entry.js +0 -308
- package/dist/esm/snk-filter-list.entry.js +0 -148
- package/dist/esm/snk-filter-modal.entry.js +0 -245
- package/dist/esm/snk-form.entry.js +0 -139
- 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-3b60db06.entry.js +0 -1
- package/dist/sankhyablocks/p-47b60deb.entry.js +0 -1
- package/dist/sankhyablocks/p-70a4af56.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-b11aa1e0.entry.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-d3f53df2.entry.js +0 -1
- package/dist/sankhyablocks/p-dc7c9047.js +0 -1
- package/dist/sankhyablocks/p-e8763234.entry.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
@@ -1,9 +1,9 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
3
|
+
const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
|
4
4
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
5
5
|
const core = require('@sankhyalabs/core');
|
6
|
-
const DataFetcher = require('./DataFetcher-
|
6
|
+
const DataFetcher = require('./DataFetcher-cadeef8e.js');
|
7
7
|
|
8
8
|
class GridConfigFetcher extends formConfigFetcher.ResourceFetcher {
|
9
9
|
constructor() {
|
@@ -425,6 +425,7 @@ class ConfigStorage {
|
|
425
425
|
if (config == undefined) {
|
426
426
|
return;
|
427
427
|
}
|
428
|
+
name = this.handleLegacyConfigAsString(name, CONFIG_SOURCE.grid);
|
428
429
|
await this.deleteGridConfigCache(name, resourceID);
|
429
430
|
return this.gridConfigFetcher.saveConfig(config, name, resourceID);
|
430
431
|
}
|
@@ -1,16 +1,17 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const DataFetcher = require('./DataFetcher-
|
4
|
-
require('./pesquisa-fetcher-
|
3
|
+
const DataFetcher = require('./DataFetcher-cadeef8e.js');
|
4
|
+
require('./pesquisa-fetcher-490a86c3.js');
|
5
5
|
const core = require('@sankhyalabs/core');
|
6
6
|
require('./index-1dfc7a6e.js');
|
7
7
|
require('./ISave-e91b70a7.js');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
9
9
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
10
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
10
|
+
const dataunitFetcher = require('./dataunit-fetcher-a36ae041.js');
|
11
11
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
12
|
-
require('./form-config-fetcher-
|
12
|
+
require('./form-config-fetcher-ed497282.js');
|
13
13
|
const InMemoryFilterColumnDataSource = require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
14
|
+
const index = require('./index-f9e81701.js');
|
14
15
|
|
15
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
16
17
|
|
@@ -29,6 +30,28 @@ class CrudUtils {
|
|
29
30
|
});
|
30
31
|
}
|
31
32
|
}
|
33
|
+
static parseCrudResults(entities, onlyFirst) {
|
34
|
+
if (!Array.isArray(entities)) {
|
35
|
+
entities = [entities];
|
36
|
+
}
|
37
|
+
const crudFindResults = [];
|
38
|
+
for (const entity of entities) {
|
39
|
+
let crudFindResult = {
|
40
|
+
fields: new Map()
|
41
|
+
};
|
42
|
+
for (let key in entity) {
|
43
|
+
let fieldValue = entity[key];
|
44
|
+
if (fieldValue.hasOwnProperty('$')) {
|
45
|
+
crudFindResult.fields.set(key, fieldValue.$);
|
46
|
+
}
|
47
|
+
if (onlyFirst) {
|
48
|
+
break;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
crudFindResults.push(crudFindResult);
|
52
|
+
}
|
53
|
+
return crudFindResults.length > 1 ? crudFindResults : crudFindResults[0];
|
54
|
+
}
|
32
55
|
static find(entityName, fields, criteria, onlyFirst = true, criteriaExpression, orderBy) {
|
33
56
|
const SERVICE_CRUD_FIND = "mge@crud.find";
|
34
57
|
let parsedFields = [];
|
@@ -76,24 +99,11 @@ class CrudUtils {
|
|
76
99
|
DataFetcher.DataFetcher.get().callServiceBroker(SERVICE_CRUD_FIND, JSON.stringify(request)).then((result) => {
|
77
100
|
var _a;
|
78
101
|
let entities = (_a = result.entidades) === null || _a === void 0 ? void 0 : _a.entidade;
|
79
|
-
if (entities
|
80
|
-
let crudFindResult = {
|
81
|
-
fields: new Map()
|
82
|
-
};
|
83
|
-
for (let key in entities) {
|
84
|
-
let fieldValue = entities[key];
|
85
|
-
if (fieldValue.hasOwnProperty('$')) {
|
86
|
-
crudFindResult.fields.set(key, fieldValue.$);
|
87
|
-
}
|
88
|
-
if (onlyFirst) {
|
89
|
-
break;
|
90
|
-
}
|
91
|
-
}
|
92
|
-
resolve(crudFindResult);
|
93
|
-
}
|
94
|
-
else {
|
102
|
+
if (!entities) {
|
95
103
|
resolve(null);
|
96
104
|
}
|
105
|
+
const crudFindResults = this.parseCrudResults(entities, onlyFirst);
|
106
|
+
resolve(crudFindResults);
|
97
107
|
});
|
98
108
|
});
|
99
109
|
}
|
@@ -146,7 +156,7 @@ class RmPrecisionCustomValueFormatter {
|
|
146
156
|
this.refreshSelectedRows();
|
147
157
|
}
|
148
158
|
setDataState(dataState) {
|
149
|
-
if (core.ObjectUtils.
|
159
|
+
if (this._dataState && core.ObjectUtils.equals(dataState === null || dataState === void 0 ? void 0 : dataState.metadataByRow, this._dataState.metadataByRow)) {
|
150
160
|
return;
|
151
161
|
}
|
152
162
|
this._dataState = dataState;
|
@@ -154,7 +164,7 @@ class RmPrecisionCustomValueFormatter {
|
|
154
164
|
}
|
155
165
|
format(currentValue, column, recordId) {
|
156
166
|
var _a;
|
157
|
-
if (
|
167
|
+
if (core.StringUtils.isEmpty(currentValue)) {
|
158
168
|
return currentValue;
|
159
169
|
}
|
160
170
|
const rowMetadata = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.metadataByRow.get(recordId);
|
@@ -224,7 +234,39 @@ class CommonsExporter {
|
|
224
234
|
}
|
225
235
|
}
|
226
236
|
|
237
|
+
class ContinuousInsertUtils {
|
238
|
+
constructor(snkApplication, resourceID, configName) {
|
239
|
+
this.snkApplication = snkApplication;
|
240
|
+
this.keyConfigEnableContinuousInsert = `${resourceID}enableContinuousInsert${configName ? configName : ''}`;
|
241
|
+
}
|
242
|
+
handleSaveConfig(enableContinuousInsert) {
|
243
|
+
return this.snkApplication.saveConfig(this.keyConfigEnableContinuousInsert, enableContinuousInsert);
|
244
|
+
}
|
245
|
+
getConfig() {
|
246
|
+
return this.snkApplication.getConfig(this.keyConfigEnableContinuousInsert).then(value => {
|
247
|
+
if (value) {
|
248
|
+
return value == "true" ? true : false;
|
249
|
+
}
|
250
|
+
return false;
|
251
|
+
}).catch(() => {
|
252
|
+
return false;
|
253
|
+
});
|
254
|
+
}
|
255
|
+
actionContinuousInsert(enableContinuousInsert, handleEnableContinuousInsert) {
|
256
|
+
return {
|
257
|
+
value: core.StringUtils.generateUUID(),
|
258
|
+
label: enableContinuousInsert ? 'Desativar inclusão contínua' : 'Ativar inclusão contínua',
|
259
|
+
enabled: true,
|
260
|
+
itemBuilder: () => {
|
261
|
+
return (index.h("div", { class: "ez-dropdown__item-wrapper", onClick: handleEnableContinuousInsert },
|
262
|
+
index.h("span", { class: "ez-dropdown__item-label" }, enableContinuousInsert ? 'Desativar inclusão contínua' : 'Ativar inclusão contínua')));
|
263
|
+
},
|
264
|
+
};
|
265
|
+
}
|
266
|
+
}
|
267
|
+
|
227
268
|
exports.CommonsExporter = CommonsExporter;
|
269
|
+
exports.ContinuousInsertUtils = ContinuousInsertUtils;
|
228
270
|
exports.CrudUtils = CrudUtils;
|
229
271
|
exports.RmPrecisionCustomValueFormatter = RmPrecisionCustomValueFormatter;
|
230
272
|
exports.SnkMultiSelectionListDataSource = SnkMultiSelectionListDataSource;
|
@@ -6865,6 +6865,7 @@ class DataFetcher {
|
|
6865
6865
|
}
|
6866
6866
|
}
|
6867
6867
|
async executePendingRequest(watingRequestsById) {
|
6868
|
+
var _a, _b;
|
6868
6869
|
const requestsBatch = [];
|
6869
6870
|
let quietMode = true;
|
6870
6871
|
watingRequestsById.forEach((waitingReq) => {
|
@@ -6875,31 +6876,36 @@ class DataFetcher {
|
|
6875
6876
|
const response = await this.fecthGraphQL(requestsBatch, quietMode);
|
6876
6877
|
const { data: dataResponse, errors: errorsResponse, extensions } = response;
|
6877
6878
|
//Reject promises with errors from query
|
6878
|
-
|
6879
|
-
Object.
|
6880
|
-
|
6879
|
+
for (const errorResponse of errorsResponse) {
|
6880
|
+
const values = Object.values(errorResponse);
|
6881
|
+
for (const value of values) {
|
6882
|
+
const waitingRequest = watingRequestsById.get(value.request.variables[value.index].queryID);
|
6881
6883
|
const hasClientEvent = await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
|
6882
|
-
Promise.race([
|
6884
|
+
const data = await Promise.race([
|
6883
6885
|
waitingRequest.promise,
|
6884
6886
|
new Promise((resolve) => {
|
6885
6887
|
resolve(false);
|
6886
6888
|
})
|
6887
|
-
])
|
6888
|
-
|
6889
|
-
if (
|
6890
|
-
(((_a = watingRequestsById.get(
|
6889
|
+
]);
|
6890
|
+
if (!hasClientEvent || data === false) {
|
6891
|
+
if (Object.keys(errorResponse[0].extensions).includes("SERVICE_CANCELED") || Object.keys(extensions).includes("isServiceCancelled")) {
|
6892
|
+
(((_a = watingRequestsById.get(value.request.variables[value.index].queryID)) === null || _a === void 0 ? void 0 : _a.reject) || Promise.reject)(new core.ServiceCanceledException("Service canceled", value.message));
|
6891
6893
|
}
|
6892
|
-
|
6893
|
-
|
6894
|
-
|
6894
|
+
else {
|
6895
|
+
(((_b = watingRequestsById.get(value.request.variables[value.index].queryID)) === null || _b === void 0 ? void 0 : _b.reject) || Promise.reject)(new core.ErrorException("Falha detectada", value.message));
|
6896
|
+
}
|
6897
|
+
}
|
6898
|
+
}
|
6899
|
+
}
|
6895
6900
|
//Resolve promises with data from query
|
6896
|
-
|
6897
|
-
Object.entries(data)
|
6901
|
+
for (const data of dataResponse) {
|
6902
|
+
const entries = Object.entries(data);
|
6903
|
+
for (const [key, val] of entries) {
|
6898
6904
|
const waitingRequest = watingRequestsById.get(key);
|
6899
6905
|
await this.proccesGraphQLClientEvents(extensions, waitingRequest.request, waitingRequest.resolve, waitingRequest.reject);
|
6900
6906
|
((waitingRequest === null || waitingRequest === void 0 ? void 0 : waitingRequest.resolve) || Promise.resolve)(val);
|
6901
|
-
}
|
6902
|
-
}
|
6907
|
+
}
|
6908
|
+
}
|
6903
6909
|
}
|
6904
6910
|
buildGraphQlURL(quietMode) {
|
6905
6911
|
const urlParams = UrlUtils.getQueryParams(location.search);
|
@@ -2,31 +2,31 @@
|
|
2
2
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
4
4
|
|
5
|
-
|
6
|
-
const selectionInfo = dataUnit.getSelectionInfo();
|
5
|
+
function getSelectedRecordsIDsInfo(dataUnit) {
|
6
|
+
const selectionInfo = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getSelectionInfo();
|
7
7
|
if (selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.isAllRecords()) {
|
8
8
|
return [];
|
9
9
|
}
|
10
10
|
const selectedRecordsIDsInfo = [];
|
11
|
-
const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.
|
11
|
+
const selectedRecords = selectionInfo === null || selectionInfo === void 0 ? void 0 : selectionInfo.records;
|
12
12
|
if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
|
13
|
-
selectedRecords.forEach(
|
14
|
-
if (!dataUnit.isNewRecord(
|
13
|
+
selectedRecords.forEach(({ __record__id__ }) => {
|
14
|
+
if (!dataUnit.isNewRecord(__record__id__)) {
|
15
15
|
/*
|
16
16
|
Esse if foi necessário para tratar corretamente o ID
|
17
17
|
do record quando está sendo utilizado no modo standAlone
|
18
18
|
isso não faz a exportação da grid funcionar no modo standAlone
|
19
19
|
mas deixa de causar erro nas oprações de CRUD.
|
20
20
|
*/
|
21
|
-
if (!core.JSUtils.isBase64(
|
21
|
+
if (!core.JSUtils.isBase64(__record__id__)) {
|
22
22
|
selectedRecordsIDsInfo.push({
|
23
23
|
name: "__record__id__",
|
24
24
|
type: core.DataType.TEXT,
|
25
|
-
value:
|
25
|
+
value: __record__id__
|
26
26
|
});
|
27
27
|
return;
|
28
28
|
}
|
29
|
-
const revertBase64ToObject = JSON.parse(window.atob(
|
29
|
+
const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
|
30
30
|
Object.entries(revertBase64ToObject).forEach(([name, value]) => {
|
31
31
|
const metadataField = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(name);
|
32
32
|
if (metadataField == undefined) {
|
@@ -38,6 +38,6 @@ const getSelectedIDs = (dataUnit) => {
|
|
38
38
|
});
|
39
39
|
}
|
40
40
|
return selectedRecordsIDsInfo;
|
41
|
-
}
|
41
|
+
}
|
42
42
|
|
43
|
-
exports.
|
43
|
+
exports.getSelectedRecordsIDsInfo = getSelectedRecordsIDsInfo;
|
@@ -1,14 +1,16 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const ConfigStorage = require('./ConfigStorage-
|
3
|
+
const ConfigStorage = require('./ConfigStorage-ecc0ed20.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
5
|
+
const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
|
6
|
+
const constants = require('./constants-35ddd366.js');
|
6
7
|
|
7
8
|
class SnkFormConfigManager {
|
8
|
-
constructor(configName, resourceID, onConfigChange) {
|
9
|
+
constructor(configName, resourceID, onConfigChange, dataUnit) {
|
9
10
|
this._resourceID = resourceID;
|
10
11
|
this._configName = configName;
|
11
12
|
this._onConfigChange = onConfigChange;
|
13
|
+
this._dataUnit = dataUnit;
|
12
14
|
}
|
13
15
|
addFormLegacyConfig(legacyConfigName) {
|
14
16
|
if (this._configName) {
|
@@ -19,6 +21,7 @@ class SnkFormConfigManager {
|
|
19
21
|
return new Promise(resolve => {
|
20
22
|
ConfigStorage.ConfigStorage.loadFormConfig(this._configName, this._resourceID)
|
21
23
|
.then((config) => {
|
24
|
+
config = this.buildFormMetadataUITabs(config);
|
22
25
|
this.setConfig(config);
|
23
26
|
resolve(config);
|
24
27
|
})
|
@@ -27,6 +30,10 @@ class SnkFormConfigManager {
|
|
27
30
|
});
|
28
31
|
});
|
29
32
|
}
|
33
|
+
getEmptyConfig() {
|
34
|
+
const config = this.buildFormMetadataUITabs({ fields: [], emptyConfig: true }, true);
|
35
|
+
return config;
|
36
|
+
}
|
30
37
|
saveConfig(config) {
|
31
38
|
const configToSave = core.ObjectUtils.copy(config);
|
32
39
|
return new Promise(accept => {
|
@@ -70,27 +77,36 @@ class SnkFormConfigManager {
|
|
70
77
|
}
|
71
78
|
return updatingCardConfig;
|
72
79
|
}
|
73
|
-
|
80
|
+
hasConfig(config) {
|
81
|
+
var _a;
|
82
|
+
const currentConfig = config !== null && config !== void 0 ? config : this._config;
|
83
|
+
if (currentConfig && ((_a = currentConfig.fields) === null || _a === void 0 ? void 0 : _a.length)) {
|
84
|
+
return true;
|
85
|
+
}
|
86
|
+
return false;
|
87
|
+
}
|
88
|
+
getFieldsList(descriptionFilter, forceEmptyConfig = false) {
|
74
89
|
var _a;
|
75
90
|
const fields = (_a = this._config) === null || _a === void 0 ? void 0 : _a.fields;
|
76
|
-
|
77
|
-
|
91
|
+
const hasConfig = this.hasConfig();
|
92
|
+
if (hasConfig && !forceEmptyConfig) {
|
93
|
+
return fields.map(({ label, name, readOnly, visible, required, tab }) => {
|
94
|
+
var _a;
|
78
95
|
if (label == undefined) {
|
79
|
-
|
80
|
-
|
81
|
-
visible,
|
82
|
-
required });
|
96
|
+
const currentField = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
|
97
|
+
return Object.assign(Object.assign({}, currentField), { name: name !== null && name !== void 0 ? name : currentField.name, readOnly: readOnly !== null && readOnly !== void 0 ? readOnly : currentField.readOnly, visible: visible !== null && visible !== void 0 ? visible : currentField.visible, required: required !== null && required !== void 0 ? required : currentField.required, tab: tab });
|
83
98
|
}
|
84
|
-
return { name, label, readOnly, visible, required };
|
99
|
+
return { name, label, readOnly, visible, required, tab };
|
85
100
|
})
|
86
101
|
.filter(field => this.isFieldVisible(field, descriptionFilter));
|
87
102
|
}
|
88
|
-
if (
|
89
|
-
return
|
90
|
-
.filter(field => this.isFieldVisible(field, descriptionFilter))
|
91
|
-
.map(({ label, name, readOnly }) => { return { label, name, readOnly }; });
|
103
|
+
if (!this._dataUnit) {
|
104
|
+
return [];
|
92
105
|
}
|
93
|
-
|
106
|
+
const filteredFields = this._dataUnit.metadata.fields
|
107
|
+
.filter(field => this.isFieldVisible(field, descriptionFilter))
|
108
|
+
.map(({ label, name, readOnly, visible, required, properties }) => ({ label, name, readOnly, visible, required, tab: properties === null || properties === void 0 ? void 0 : properties.UITabName }));
|
109
|
+
return filteredFields;
|
94
110
|
}
|
95
111
|
isFieldVisible(field, descriptionFilter) {
|
96
112
|
if (field.visible === false) {
|
@@ -103,8 +119,8 @@ class SnkFormConfigManager {
|
|
103
119
|
const normalizedFilter = core.StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
104
120
|
return normalizedText.includes(normalizedFilter);
|
105
121
|
}
|
106
|
-
|
107
|
-
let fields = this.getFieldsList(
|
122
|
+
getFormConfig(dataUnit, ignoreReadOnlyFormFields, forceEmptyConfig = false) {
|
123
|
+
let fields = this.getFieldsList(undefined, forceEmptyConfig);
|
108
124
|
if (ignoreReadOnlyFormFields) {
|
109
125
|
fields = fields.filter(field => {
|
110
126
|
if (dataUnit) {
|
@@ -135,8 +151,8 @@ class SnkFormConfigManager {
|
|
135
151
|
this._onConfigChange(Object.assign({}, this._config));
|
136
152
|
}
|
137
153
|
}
|
138
|
-
getConfig(
|
139
|
-
return
|
154
|
+
getConfig(dataUnit, ignoreReadOnlyFormFields) {
|
155
|
+
return this.getFormConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true);
|
140
156
|
}
|
141
157
|
getFormConfigFetcher() {
|
142
158
|
if (this._formConfigFetcher == undefined) {
|
@@ -157,6 +173,44 @@ class SnkFormConfigManager {
|
|
157
173
|
async fetchDefaultConfig() {
|
158
174
|
return this.getFormConfigFetcher().fetchDefaultConfig(this._configName, this._resourceID);
|
159
175
|
}
|
176
|
+
parseObjectList(object) {
|
177
|
+
if (!object) {
|
178
|
+
return [];
|
179
|
+
}
|
180
|
+
return Array.isArray(object) ? object : [object];
|
181
|
+
}
|
182
|
+
buildFormMetadataUITabs(config, forceEmptyConfig = false) {
|
183
|
+
var _a;
|
184
|
+
const hasConfig = this.hasConfig(config);
|
185
|
+
if (!forceEmptyConfig && (!this._dataUnit || hasConfig)) {
|
186
|
+
return config;
|
187
|
+
}
|
188
|
+
config = this.getFormConfig(this._dataUnit, false, true);
|
189
|
+
config.tabs = this.parseObjectList(config.tabs);
|
190
|
+
config.emptyConfig = false;
|
191
|
+
config.defaultConfiguration = true;
|
192
|
+
const fields = this._dataUnit.metadata.fields;
|
193
|
+
for (const currentField of fields) {
|
194
|
+
const field = config.fields.find(field => field.name === currentField.name);
|
195
|
+
const uiTabName = (_a = currentField.properties) === null || _a === void 0 ? void 0 : _a.UITabName;
|
196
|
+
if (!uiTabName || uiTabName === constants.TAB_NAMES.main) {
|
197
|
+
continue;
|
198
|
+
}
|
199
|
+
const haveTab = config.tabs.some((tab) => tab.label === uiTabName);
|
200
|
+
if (!haveTab) {
|
201
|
+
config.tabs.push({
|
202
|
+
label: uiTabName,
|
203
|
+
name: uiTabName,
|
204
|
+
order: 0,
|
205
|
+
visible: true,
|
206
|
+
});
|
207
|
+
}
|
208
|
+
if (field) {
|
209
|
+
field.tab = uiTabName;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
return config;
|
213
|
+
}
|
160
214
|
}
|
161
215
|
|
162
216
|
exports.SnkFormConfigManager = SnkFormConfigManager;
|
@@ -30,7 +30,7 @@ const snkDataUnitMessages = {
|
|
30
30
|
},
|
31
31
|
cancelInfo: {
|
32
32
|
clone: "Duplicação descartada!",
|
33
|
-
insert: "A inclusão descartada!",
|
33
|
+
insert: "A inclusão foi descartada!",
|
34
34
|
update: "A edição foi descartada!"
|
35
35
|
},
|
36
36
|
confirm: {
|
@@ -144,7 +144,7 @@ const snkExporterMessages = {
|
|
144
144
|
emailSenderOptStep_subtitle: "Primeiro, escolha o formato do arquivo",
|
145
145
|
emailSenderOptStep_lblFormat: "Formato:",
|
146
146
|
emailSenderOptStep_formatPDF: "PDF (.pdf)",
|
147
|
-
|
147
|
+
emailSenderOptStep_formatXLS: "Planilha (.xls)",
|
148
148
|
emailSenderOptStep_export: "Exportar:",
|
149
149
|
emailSenderOptStep_allData: "Toda a grade",
|
150
150
|
emailSenderOptStep_currentPage: "Somente a página atual",
|
@@ -267,7 +267,11 @@ const snkConfiguratorMessages = {
|
|
267
267
|
};
|
268
268
|
|
269
269
|
const snkGridMessages = {
|
270
|
-
findColumn: "Busca de colunas"
|
270
|
+
findColumn: "Busca de colunas",
|
271
|
+
cancelConfirmation: {
|
272
|
+
title: "Aviso",
|
273
|
+
message: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?</b>",
|
274
|
+
}
|
271
275
|
};
|
272
276
|
const snkGridConfigMessages = {
|
273
277
|
gridConfiguration: "Configuração da Grade",
|
@@ -1,7 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
4
|
-
const formConfigFetcher = require('./form-config-fetcher-
|
4
|
+
const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
|
5
5
|
|
6
6
|
class AuthFetcher extends formConfigFetcher.ResourceFetcher {
|
7
7
|
getData(resourceID) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
const core = require('@sankhyalabs/core');
|
4
|
-
const DataFetcher = require('./DataFetcher-
|
4
|
+
const DataFetcher = require('./DataFetcher-cadeef8e.js');
|
5
5
|
const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
6
6
|
const UnitMetadata = require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -241,6 +241,21 @@ function applyFilter(records, dataUnit, filters) {
|
|
241
241
|
}
|
242
242
|
return records.filter(filterFunction);
|
243
243
|
}
|
244
|
+
function buildLoadDataResponse(recordsIn, dataUnit, request) {
|
245
|
+
let records = recordsIn ? [...recordsIn] : [];
|
246
|
+
records = applyFilter(records, dataUnit, request.filters);
|
247
|
+
records = applySorting(records, dataUnit, request.sort);
|
248
|
+
const { offset, limit } = request;
|
249
|
+
const paginationInfoBuilderParams = {
|
250
|
+
recordsLength: records.length,
|
251
|
+
offset,
|
252
|
+
recordsPerPage: limit,
|
253
|
+
};
|
254
|
+
return Promise.resolve({
|
255
|
+
records: getPagesByRecords(records, offset, limit),
|
256
|
+
paginationInfo: buildPaginationInfo(paginationInfoBuilderParams),
|
257
|
+
});
|
258
|
+
}
|
244
259
|
function applySorting(records, dataUnit, sorting) {
|
245
260
|
if (sorting == undefined || sorting.length == 0) {
|
246
261
|
return records;
|
@@ -251,18 +266,28 @@ function applySorting(records, dataUnit, sorting) {
|
|
251
266
|
}
|
252
267
|
return records.sort(sortingFunction);
|
253
268
|
}
|
254
|
-
function
|
255
|
-
|
256
|
-
|
269
|
+
function hasValidLimitAndOffset(offset, limit) {
|
270
|
+
return offset >= 0 && limit >= 0;
|
271
|
+
}
|
272
|
+
function getPagesByRecords(records, offset = 0, limit = 0) {
|
273
|
+
if (!records || !records.length || !hasValidLimitAndOffset(offset, limit))
|
274
|
+
return [];
|
275
|
+
if (limit === 0 && offset === 0)
|
276
|
+
return records;
|
277
|
+
return records.slice(offset, offset + limit);
|
278
|
+
}
|
279
|
+
function buildPaginationInfo({ recordsLength = 0, offset = 0, recordsPerPage = 0 }) {
|
280
|
+
if (!recordsLength) {
|
281
|
+
return { currentPage: 0, firstRecord: 0, lastRecord: 0, total: 0, hasMore: false };
|
257
282
|
}
|
258
|
-
const
|
259
|
-
const lastRecord = Math.min(
|
283
|
+
const lastRecordIndex = offset + recordsPerPage;
|
284
|
+
const lastRecord = lastRecordIndex ? Math.min(lastRecordIndex, recordsLength) : recordsLength;
|
260
285
|
return {
|
261
|
-
currentPage:
|
262
|
-
firstRecord: offset,
|
286
|
+
currentPage: recordsPerPage === 0 ? 0 : Math.ceil(offset / recordsPerPage),
|
287
|
+
firstRecord: offset + 1,
|
263
288
|
lastRecord: lastRecord,
|
264
|
-
total:
|
265
|
-
hasMore:
|
289
|
+
total: recordsLength,
|
290
|
+
hasMore: lastRecord < recordsLength,
|
266
291
|
};
|
267
292
|
}
|
268
293
|
|
@@ -348,9 +373,7 @@ class InMemoryLoader {
|
|
348
373
|
return core.StringUtils.generateUUID();
|
349
374
|
}
|
350
375
|
inMemoryLoader(dataUnit, request, recordsIn) {
|
351
|
-
|
352
|
-
records = applySorting(records, dataUnit, request.sort);
|
353
|
-
return Promise.resolve({ records, paginationInfo: buildPaginationInfo(records, request.offset, request.limit) });
|
376
|
+
return buildLoadDataResponse(recordsIn, dataUnit, request);
|
354
377
|
}
|
355
378
|
metadaLoader() {
|
356
379
|
return Promise.resolve(this._metadata);
|
@@ -430,12 +453,19 @@ class DatasetStrategy {
|
|
430
453
|
const records = this.processRecords(dataUnit, fields, responseRecords);
|
431
454
|
const loadingInProgress = pagerId != undefined;
|
432
455
|
const count = loadingInfo.count + records.length;
|
456
|
+
const isInsertingNewRecord = dataUnit.hasNewRecord();
|
433
457
|
const needReload = !loadingInProgress && localSorting.length > 0;
|
458
|
+
/**
|
459
|
+
* Caso precise recarregar dados, porém está no meio de uma inserção, os dados não devem recarregados instantaneamente,
|
460
|
+
* Mas sim, sinalizar que o dataUnit está aguardando para der recarregado.
|
461
|
+
*/
|
462
|
+
if (needReload && isInsertingNewRecord) {
|
463
|
+
dataUnit.setWaitingToReload(true);
|
464
|
+
}
|
434
465
|
return Promise.resolve({
|
435
466
|
records,
|
436
467
|
loadingInfo: Object.assign(Object.assign({}, loadingInfo), { pagerId,
|
437
|
-
loadingInProgress, total: loadingInProgress ? undefined : count, count,
|
438
|
-
needReload })
|
468
|
+
loadingInProgress, total: loadingInProgress ? undefined : count, count, needReload: needReload && !isInsertingNewRecord })
|
439
469
|
});
|
440
470
|
}
|
441
471
|
catch (error) {
|
@@ -688,7 +718,7 @@ class DataUnitDataLoader {
|
|
688
718
|
}
|
689
719
|
const count = loadingInfo.count;
|
690
720
|
if (loadingInfo.loadingInProgress) {
|
691
|
-
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count }));
|
721
|
+
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { count, loadingInProgress: true }));
|
692
722
|
return;
|
693
723
|
}
|
694
724
|
if (loadingInfo.needReload) {
|
@@ -696,7 +726,7 @@ class DataUnitDataLoader {
|
|
696
726
|
dataUnit.gotoPage(0);
|
697
727
|
return;
|
698
728
|
}
|
699
|
-
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count }));
|
729
|
+
dataUnit.updatePagination(Object.assign(Object.assign({}, dataUnitPagination), { total: count, count, loadingInProgress: false }));
|
700
730
|
}
|
701
731
|
static registryLoading(dataUnit, loadingInfo) {
|
702
732
|
if (loadingInfo == undefined) {
|
@@ -1062,7 +1092,5 @@ exports.DataUnitFetcher = DataUnitFetcher;
|
|
1062
1092
|
exports.DatasetStrategy = DatasetStrategy;
|
1063
1093
|
exports.InMemoryLoader = InMemoryLoader;
|
1064
1094
|
exports.PreloadManager = PreloadManager;
|
1065
|
-
exports.
|
1066
|
-
exports.applySorting = applySorting;
|
1067
|
-
exports.buildPaginationInfo = buildPaginationInfo;
|
1095
|
+
exports.buildLoadDataResponse = buildLoadDataResponse;
|
1068
1096
|
exports.getRecordValue = getRecordValue;
|
@@ -33,12 +33,16 @@ class TaskbarProcessor {
|
|
33
33
|
});
|
34
34
|
}
|
35
35
|
getButtonsArray(taskbarId, taskbarManager, dataState) {
|
36
|
-
const defaults = this.
|
36
|
+
const defaults = this.getButtonsFromKey(taskbarId);
|
37
37
|
if (taskbarManager) {
|
38
38
|
return taskbarManager.getButtons(taskbarId, dataState, [...defaults]);
|
39
39
|
}
|
40
40
|
return defaults;
|
41
41
|
}
|
42
|
+
getButtonsFromKey(taskbarId) {
|
43
|
+
const btnsValue = this._defaultButtons[taskbarId];
|
44
|
+
return typeof btnsValue === 'function' ? btnsValue() : btnsValue;
|
45
|
+
}
|
42
46
|
isEnabled(taskbarId, taskbarManager, buttonName, dataState, disabled) {
|
43
47
|
const originalValue = disabled.includes(buttonName) ? false : true;
|
44
48
|
if (taskbarManager && taskbarManager.isEnabled) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const DataFetcher = require('./DataFetcher-
|
3
|
+
const DataFetcher = require('./DataFetcher-cadeef8e.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
5
|
|
6
6
|
class ResourceFetcher {
|
@@ -219,7 +219,10 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
219
219
|
query: this.queryConfig.get("fetchDefaultConfig"),
|
220
220
|
})
|
221
221
|
.then((result) => {
|
222
|
-
|
222
|
+
if (!(result === null || result === void 0 ? void 0 : result.resource)) {
|
223
|
+
resolve(null);
|
224
|
+
}
|
225
|
+
resolve(core.ObjectUtils.stringToObject(result === null || result === void 0 ? void 0 : result.resource));
|
223
226
|
})
|
224
227
|
.catch((error) => {
|
225
228
|
reject(error);
|