@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
@@ -4,15 +4,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const DataFetcher = require('./DataFetcher-
|
8
|
-
require('./pesquisa-fetcher-
|
7
|
+
const DataFetcher = require('./DataFetcher-cadeef8e.js');
|
8
|
+
require('./pesquisa-fetcher-490a86c3.js');
|
9
9
|
require('./index-1dfc7a6e.js');
|
10
10
|
const ISave = require('./ISave-e91b70a7.js');
|
11
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-a36ae041.js');
|
12
12
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
13
|
-
require('./form-config-fetcher-
|
13
|
+
require('./form-config-fetcher-ed497282.js');
|
14
14
|
const constants = require('./constants-35ddd366.js');
|
15
|
-
const authFetcher = require('./auth-fetcher-
|
15
|
+
const authFetcher = require('./auth-fetcher-d68841bc.js');
|
16
16
|
const taskbarElements = require('./taskbar-elements-9ad1f9c0.js');
|
17
17
|
require('./PrintUtils-bcaeb82f.js');
|
18
18
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
@@ -117,21 +117,23 @@ const SERVICE = {
|
|
117
117
|
download: "AnexoSistemaSP.baixar",
|
118
118
|
};
|
119
119
|
class AnexoSistemaFetcher {
|
120
|
-
constructor(entityName,
|
120
|
+
constructor(entityName, dataUnitName) {
|
121
121
|
var _a;
|
122
122
|
this.entityName = entityName;
|
123
|
-
this.registerKey = registerKey;
|
124
123
|
this.dataUnitName = dataUnitName;
|
125
124
|
this.validateFields = (fields) => {
|
126
125
|
if (!!fields.LINK && !!fields.NOMEARQUIVO)
|
127
126
|
throw new Error(ISave.SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
|
128
127
|
if (!fields.LINK && !fields.NOMEARQUIVO)
|
129
128
|
throw new Error(ISave.SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
|
130
|
-
if (!this.
|
129
|
+
if (!this._registerKey)
|
131
130
|
throw new Error('Register key can not be null');
|
132
131
|
};
|
133
132
|
this.resourceID = (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID));
|
134
133
|
}
|
134
|
+
set registerKey(registerKey) {
|
135
|
+
this._registerKey = registerKey;
|
136
|
+
}
|
135
137
|
async save(change) {
|
136
138
|
var _a, _b;
|
137
139
|
let { updatingFields: fields } = change;
|
@@ -150,7 +152,7 @@ class AnexoSistemaFetcher {
|
|
150
152
|
nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
|
151
153
|
link: fields.LINK,
|
152
154
|
nameEntity: this.entityName,
|
153
|
-
pkEntity: this.
|
155
|
+
pkEntity: this._registerKey,
|
154
156
|
typeAcess: fields.TIPOACESSO,
|
155
157
|
typeApres: fields.TIPOAPRES,
|
156
158
|
}
|
@@ -190,7 +192,7 @@ class AnexoSistemaFetcher {
|
|
190
192
|
nameAttach: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.name,
|
191
193
|
link: fields.LINK,
|
192
194
|
nameEntity: this.entityName,
|
193
|
-
pkEntity: this.
|
195
|
+
pkEntity: this._registerKey,
|
194
196
|
typeAcess: fields.TIPOACESSO,
|
195
197
|
typeApres: fields.TIPOAPRES,
|
196
198
|
}
|
@@ -462,9 +464,7 @@ class AttachFetcherDataUnitFactory {
|
|
462
464
|
});
|
463
465
|
this._records = records;
|
464
466
|
}
|
465
|
-
|
466
|
-
records = dataunitFetcher.applySorting(records, dataUnit, request.sort);
|
467
|
-
return Promise.resolve({ records, paginationInfo: dataunitFetcher.buildPaginationInfo(records, request.offset, request.limit) });
|
467
|
+
return dataunitFetcher.buildLoadDataResponse(this._records, dataUnit, request);
|
468
468
|
}
|
469
469
|
saveLoader(changes, fetcher) {
|
470
470
|
return new Promise((resolve) => {
|
@@ -660,11 +660,20 @@ const SnkAttach = class {
|
|
660
660
|
this.loadAttachmentDataUnit();
|
661
661
|
}
|
662
662
|
if (oldRegisterKey !== newRegisterKey) {
|
663
|
+
if (this._currentFetcher instanceof AnexoSistemaFetcher) {
|
664
|
+
this._currentFetcher.registerKey = newRegisterKey;
|
665
|
+
}
|
663
666
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadData());
|
664
667
|
}
|
665
668
|
}
|
669
|
+
getAnexoSistemaFetcherInstance() {
|
670
|
+
var _a;
|
671
|
+
const anexoSistemaFetcher = new AnexoSistemaFetcher(this.entityName, (_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.name);
|
672
|
+
anexoSistemaFetcher.registerKey = this.registerKey;
|
673
|
+
return anexoSistemaFetcher;
|
674
|
+
}
|
666
675
|
async initAttach() {
|
667
|
-
var _a, _b, _c, _d, _e
|
676
|
+
var _a, _b, _c, _d, _e;
|
668
677
|
if (!this.fetcherType && !this.registerKey)
|
669
678
|
return;
|
670
679
|
if (!this.fetcherType) {
|
@@ -672,18 +681,18 @@ const SnkAttach = class {
|
|
672
681
|
}
|
673
682
|
this.returnToGridMode();
|
674
683
|
if (this.fetcherType === "AnexoSistema") {
|
675
|
-
this._currentFetcher =
|
676
|
-
(
|
677
|
-
await ((
|
684
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
685
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
686
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
678
687
|
return;
|
679
688
|
}
|
680
689
|
if (this.fetcherType === "Attach") {
|
681
|
-
const hasMoreOneItem = ((
|
690
|
+
const hasMoreOneItem = ((_c = this.registerKey) === null || _c === void 0 ? void 0 : _c.split("_").length) > 1;
|
682
691
|
if (hasMoreOneItem)
|
683
692
|
return;
|
684
693
|
}
|
685
|
-
await ((
|
686
|
-
await ((
|
694
|
+
await ((_d = this._currentDataUnit) === null || _d === void 0 ? void 0 : _d.loadMetadata());
|
695
|
+
await ((_e = this._currentDataUnit) === null || _e === void 0 ? void 0 : _e.loadData(undefined, undefined, true, this.registerKey));
|
687
696
|
}
|
688
697
|
/**
|
689
698
|
* Conforme mecanismo de mensagens, é possível customizar as mensagens dos blocos de construção
|
@@ -742,11 +751,11 @@ const SnkAttach = class {
|
|
742
751
|
}
|
743
752
|
}
|
744
753
|
async loadAnexoSistema() {
|
745
|
-
var _a, _b
|
754
|
+
var _a, _b;
|
746
755
|
this._currentDataUnit = new dataunitFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
747
|
-
this._currentFetcher =
|
756
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
748
757
|
if (!this._currentDataUnit.metadata) {
|
749
|
-
await ((
|
758
|
+
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
750
759
|
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
751
760
|
}
|
752
761
|
this.initDataUnitLoaders();
|
@@ -756,7 +765,7 @@ const SnkAttach = class {
|
|
756
765
|
this._currentDataUnit.addInterceptor({
|
757
766
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
758
767
|
});
|
759
|
-
await ((
|
768
|
+
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
760
769
|
this.disableEditFieldsNotInForm();
|
761
770
|
}
|
762
771
|
async loadAttach() {
|
@@ -782,16 +791,16 @@ const SnkAttach = class {
|
|
782
791
|
}
|
783
792
|
}
|
784
793
|
initDataUnitLoaders() {
|
785
|
-
var _a, _b
|
794
|
+
var _a, _b;
|
786
795
|
if (this.fetcherType === "AnexoSistema") {
|
787
|
-
this._currentFetcher =
|
796
|
+
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
788
797
|
this._currentDataUnitBuilder = new AnexoSistemaDataUnitFactory(this.entityName, this.getMessage.bind(this));
|
789
|
-
(
|
798
|
+
(_a = this._currentDataUnitBuilder) === null || _a === void 0 ? void 0 : _a.initLoaders(this._currentDataUnit, this._currentFetcher, this.returnToGridMode.bind(this));
|
790
799
|
}
|
791
800
|
if (this.fetcherType === "Attach") {
|
792
801
|
this._currentFetcher = new AttachFetcher();
|
793
802
|
this._currentDataUnitBuilder = new AttachFetcherDataUnitFactory(this.getMessage.bind(this));
|
794
|
-
(
|
803
|
+
(_b = this._currentDataUnitBuilder) === null || _b === void 0 ? void 0 : _b.initLoaders(this._currentDataUnit, this._currentFetcher, async () => {
|
795
804
|
this.returnToGridMode();
|
796
805
|
await this._currentDataUnit.loadData(undefined, undefined, true, this.registerKey);
|
797
806
|
});
|
@@ -835,7 +844,7 @@ const SnkAttach = class {
|
|
835
844
|
var _a, _b;
|
836
845
|
if (!this._currentDataUnit)
|
837
846
|
return null;
|
838
|
-
return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.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) }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary" }, this.getMessage("snkAttach.description")))))))));
|
847
|
+
return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.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) }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
839
848
|
}
|
840
849
|
static get watchers() { return {
|
841
850
|
"registerKey": ["registerKeyWatcher"]
|
@@ -3,17 +3,377 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
|
-
const Sortable = require('./Sortable-fb1c4cbb.js');
|
7
6
|
const core = require('@sankhyalabs/core');
|
7
|
+
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
9
9
|
const constants = require('./constants-35ddd366.js');
|
10
|
-
const
|
10
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-f1c92f79.js');
|
11
|
+
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
12
|
+
const Sortable = require('./Sortable-fb1c4cbb.js');
|
13
|
+
const formConfigFetcher = require('./form-config-fetcher-ed497282.js');
|
11
14
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
12
|
-
require('./
|
15
|
+
require('./ConfigStorage-ecc0ed20.js');
|
16
|
+
require('./filter-item-type.enum-a7ffdaa6.js');
|
17
|
+
require('./DataFetcher-cadeef8e.js');
|
13
18
|
require('./PrintUtils-bcaeb82f.js');
|
14
19
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
20
|
|
16
|
-
const
|
21
|
+
const snkConfigOptionsCss = ".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
|
22
|
+
|
23
|
+
const SnkConfigOptions = class {
|
24
|
+
constructor(hostRef) {
|
25
|
+
index.registerInstance(this, hostRef);
|
26
|
+
this.configOptionsChanged = index.createEvent(this, "configOptionsChanged", 7);
|
27
|
+
this._defaultType = undefined;
|
28
|
+
this.fieldConfig = {};
|
29
|
+
this.idConfig = undefined;
|
30
|
+
this.dataUnit = undefined;
|
31
|
+
this.messagesBuilder = undefined;
|
32
|
+
}
|
33
|
+
onConfigDefault(optionSelected) {
|
34
|
+
if (optionSelected != undefined) {
|
35
|
+
this._defaultType = optionSelected;
|
36
|
+
this.fieldConfig.defaultValue = {
|
37
|
+
type: this._defaultType
|
38
|
+
};
|
39
|
+
this.configOptionsChanged.emit(this.fieldConfig);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
buildOptions() {
|
43
|
+
var _a, _b, _c;
|
44
|
+
let interfaceField = (_c = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name)) === null || _c === void 0 ? void 0 : _c.userInterface;
|
45
|
+
if (interfaceField === core.UserInterface.SEARCH) {
|
46
|
+
interfaceField = core.UserInterface.INTEGERNUMBER;
|
47
|
+
}
|
48
|
+
return constants.VARS_BY_TYPE.UserInterface[interfaceField];
|
49
|
+
}
|
50
|
+
enabledValueDefault() {
|
51
|
+
var _a, _b, _c;
|
52
|
+
const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
|
53
|
+
const allowDefault = (_c = field === null || field === void 0 ? void 0 : field.properties) === null || _c === void 0 ? void 0 : _c.allowDefault;
|
54
|
+
const hasVariableVar = constants.VARS_BY_TYPE.UserInterface.hasOwnProperty(field === null || field === void 0 ? void 0 : field.userInterface)
|
55
|
+
|| (field === null || field === void 0 ? void 0 : field.userInterface) === core.UserInterface.SEARCH;
|
56
|
+
if ((allowDefault == undefined || allowDefault === "true") && hasVariableVar) {
|
57
|
+
return true;
|
58
|
+
}
|
59
|
+
return false;
|
60
|
+
}
|
61
|
+
isAllowDefault() {
|
62
|
+
var _a, _b;
|
63
|
+
const allowDefault = (_b = (_a = this._fieldProperties) === null || _a === void 0 ? void 0 : _a.properties) === null || _b === void 0 ? void 0 : _b.allowDefault;
|
64
|
+
if (allowDefault == undefined) {
|
65
|
+
return true;
|
66
|
+
}
|
67
|
+
return allowDefault === "true";
|
68
|
+
}
|
69
|
+
loadDefaultValue() {
|
70
|
+
var _a;
|
71
|
+
if (this.fieldConfig == undefined) {
|
72
|
+
this._defaultType = constants.DEFAULT_TYPE.fixed;
|
73
|
+
this.fieldConfig = {
|
74
|
+
defaultValue: {
|
75
|
+
type: this._defaultType
|
76
|
+
}
|
77
|
+
};
|
78
|
+
}
|
79
|
+
else if (((_a = this.fieldConfig.defaultValue) === null || _a === void 0 ? void 0 : _a.type) == undefined) {
|
80
|
+
this._defaultType = constants.DEFAULT_TYPE.fixed;
|
81
|
+
this.fieldConfig.defaultValue = {
|
82
|
+
type: this._defaultType
|
83
|
+
};
|
84
|
+
}
|
85
|
+
else {
|
86
|
+
this._defaultType = this.fieldConfig.defaultValue.type;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
getFieldProperties(field) {
|
90
|
+
var _a;
|
91
|
+
if (field != undefined) {
|
92
|
+
return (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(field);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
getMessage(key, params) {
|
96
|
+
return this.messagesBuilder.getMessage(key, params);
|
97
|
+
}
|
98
|
+
getDefaultType() {
|
99
|
+
var _a;
|
100
|
+
return (_a = this.fieldConfig.defaultValue.type) !== null && _a !== void 0 ? _a : constants.DEFAULT_TYPE.fixed;
|
101
|
+
}
|
102
|
+
getEnabledByProperty(attribName, propertyName) {
|
103
|
+
const fieldDescriptor = this._fieldProperties;
|
104
|
+
if (fieldDescriptor == undefined) {
|
105
|
+
return true;
|
106
|
+
}
|
107
|
+
const fieldProperties = fieldDescriptor.properties || {};
|
108
|
+
return fieldProperties.hasOwnProperty(propertyName) ? fieldProperties[propertyName] !== "S" : fieldDescriptor[attribName] !== true;
|
109
|
+
}
|
110
|
+
getValueByProperty(property) {
|
111
|
+
const properties = this._fieldProperties;
|
112
|
+
if (properties != undefined && properties[property] === true) {
|
113
|
+
return true;
|
114
|
+
}
|
115
|
+
return this.fieldConfig[property];
|
116
|
+
}
|
117
|
+
getValidatedValue(fieldValue) {
|
118
|
+
var _a, _b;
|
119
|
+
if (fieldValue == undefined) {
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
const field = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField((_b = this.fieldConfig) === null || _b === void 0 ? void 0 : _b.name);
|
123
|
+
const dataType = field === null || field === void 0 ? void 0 : field.dataType;
|
124
|
+
if (dataType == undefined) {
|
125
|
+
return;
|
126
|
+
}
|
127
|
+
const value = (fieldValue === null || fieldValue === void 0 ? void 0 : fieldValue.waitmessage) != undefined ? undefined :
|
128
|
+
dataType !== DataType.DataType.OBJECT && dataType !== DataType.DataType.DATE
|
129
|
+
&& typeof fieldValue === "object"
|
130
|
+
? fieldValue.value
|
131
|
+
: fieldValue;
|
132
|
+
return dataType === DataType.DataType.OBJECT ? JSON.stringify(value) : value;
|
133
|
+
}
|
134
|
+
buildInputDefault({ value, enabled, label, name, required, userInterface }, properties = undefined, mode = undefined) {
|
135
|
+
let options;
|
136
|
+
let precision = 0;
|
137
|
+
let prettyPrecision = 0;
|
138
|
+
const TagName = userInterface == undefined || constants.TAGS_BY_TYPE[userInterface] == undefined
|
139
|
+
? constants.TAGS_BY_TYPE.DEFAULT
|
140
|
+
: constants.TAGS_BY_TYPE[userInterface];
|
141
|
+
if (userInterface === core.UserInterface.OPTIONSELECTOR) {
|
142
|
+
const prop = properties === null || properties === void 0 ? void 0 : properties.options;
|
143
|
+
if (typeof prop === "string") {
|
144
|
+
const parsed = core.ObjectUtils.stringToObject(prop);
|
145
|
+
options = Object.keys(parsed).map(key => { return { value: key, label: parsed[key] }; });
|
146
|
+
}
|
147
|
+
else {
|
148
|
+
options = prop;
|
149
|
+
}
|
150
|
+
}
|
151
|
+
else if (userInterface === core.UserInterface.DECIMALNUMBER) {
|
152
|
+
precision = Number((properties === null || properties === void 0 ? void 0 : properties.precision) || 2);
|
153
|
+
prettyPrecision = Number((properties === null || properties === void 0 ? void 0 : properties.prettyPrecision) || precision);
|
154
|
+
}
|
155
|
+
return index.h(TagName, Object.assign({ value: value, enabled: enabled, label: label, "data-field-name": name, key: name, onEzChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail) }, (this.getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode))));
|
156
|
+
}
|
157
|
+
getConditionalAttributes(userInterface, required, options, precision, prettyPrecision, mode) {
|
158
|
+
switch (userInterface) {
|
159
|
+
case core.UserInterface.SEARCH:
|
160
|
+
return {
|
161
|
+
suppressEmptyOption: required,
|
162
|
+
optionLoader: (searchArgument) => this.onSearch(searchArgument)
|
163
|
+
};
|
164
|
+
case core.UserInterface.OPTIONSELECTOR:
|
165
|
+
return {
|
166
|
+
suppressEmptyOption: required,
|
167
|
+
options
|
168
|
+
};
|
169
|
+
case core.UserInterface.CHECKBOX:
|
170
|
+
case core.UserInterface.SWITCH:
|
171
|
+
return {
|
172
|
+
mode
|
173
|
+
};
|
174
|
+
case core.UserInterface.INTEGERNUMBER:
|
175
|
+
case core.UserInterface.DECIMALNUMBER:
|
176
|
+
return {
|
177
|
+
precision,
|
178
|
+
prettyPrecision,
|
179
|
+
onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
|
180
|
+
};
|
181
|
+
case core.UserInterface.DATE:
|
182
|
+
case core.UserInterface.DATETIME:
|
183
|
+
case core.UserInterface.TIME:
|
184
|
+
return {
|
185
|
+
onEzStartChange: (evt) => this.onChange(evt === null || evt === void 0 ? void 0 : evt.detail)
|
186
|
+
};
|
187
|
+
default:
|
188
|
+
return {};
|
189
|
+
}
|
190
|
+
}
|
191
|
+
onChange(fieldValue) {
|
192
|
+
this.fieldConfig.defaultValue.value = this.getValidatedValue(fieldValue);
|
193
|
+
this.configOptionsChanged.emit(this.fieldConfig);
|
194
|
+
}
|
195
|
+
onSearch(searchArgument) {
|
196
|
+
if (this._application != undefined && this.fieldConfig != undefined) {
|
197
|
+
return this._application.executeSearch(searchArgument, this.fieldConfig.name, this.dataUnit);
|
198
|
+
}
|
199
|
+
}
|
200
|
+
buildField(descriptor, config) {
|
201
|
+
const { name, label, readOnly, required, defaultValue } = config;
|
202
|
+
const { userInterface, properties } = descriptor;
|
203
|
+
const allowDefault = properties === null || properties === void 0 ? void 0 : properties.allowDefault;
|
204
|
+
let value;
|
205
|
+
let enabled = core.StringUtils.getBooleanValue(allowDefault, !readOnly);
|
206
|
+
if (userInterface === core.UserInterface.FILE) {
|
207
|
+
enabled = false;
|
208
|
+
}
|
209
|
+
if (enabled) {
|
210
|
+
value = defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.value;
|
211
|
+
if (value != undefined) {
|
212
|
+
value = DataType.getConvertedValue(descriptor === null || descriptor === void 0 ? void 0 : descriptor.dataType, value);
|
213
|
+
}
|
214
|
+
}
|
215
|
+
const configField = { value, enabled, label, name, required, userInterface };
|
216
|
+
switch (userInterface) {
|
217
|
+
case core.UserInterface.SWITCH:
|
218
|
+
return this.buildInputDefault(configField, undefined, utils.CheckMode.SWITCH);
|
219
|
+
case core.UserInterface.CHECKBOX:
|
220
|
+
return this.buildInputDefault(configField, undefined, utils.CheckMode.REGULAR);
|
221
|
+
case core.UserInterface.OPTIONSELECTOR:
|
222
|
+
case core.UserInterface.DECIMALNUMBER:
|
223
|
+
return this.buildInputDefault(configField, properties);
|
224
|
+
default:
|
225
|
+
return this.buildInputDefault(configField);
|
226
|
+
}
|
227
|
+
}
|
228
|
+
componentWillLoad() {
|
229
|
+
var _a;
|
230
|
+
this.loadDefaultValue();
|
231
|
+
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
232
|
+
this._fieldProperties = this.getFieldProperties((_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.name);
|
233
|
+
}
|
234
|
+
componentDidLoad() {
|
235
|
+
core.ElementIDUtils.addIDInfo(this._element, this.fieldConfig.name);
|
236
|
+
}
|
237
|
+
render() {
|
238
|
+
var _a, _b;
|
239
|
+
return (index.h(index.Host, null, index.h("div", { id: this.idConfig }, index.h("div", { class: "ez-row ez-padding--medium" }, index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-text-input", { label: this.getMessage("snkConfigOptions.label.nameField"), value: (_a = this.fieldConfig) === null || _a === void 0 ? void 0 : _a.label, onEzChange: (evt) => { this.fieldConfig.label = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.typeValueDefault"), suppressEmptyOption: true, enabled: this.enabledValueDefault(), onEzChange: (evt) => { var _a; return this.onConfigDefault((_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value); }, value: this.getDefaultType() }, index.h("option", { value: constants.DEFAULT_TYPE.fixed }, this.getMessage("snkConfigOptions.options.valueFixed")), index.h("option", { value: constants.DEFAULT_TYPE.variable }, this.getMessage("snkConfigOptions.options.variable")))), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, this._defaultType === constants.DEFAULT_TYPE.variable ?
|
240
|
+
index.h("ez-combo-box", { label: this.getMessage("snkConfigOptions.label.valueDefault"), enabled: this.isAllowDefault(), onEzChange: (evt) => { var _a; this.fieldConfig.defaultValue.value = (_a = evt.detail) === null || _a === void 0 ? void 0 : _a.value; this.configOptionsChanged.emit(this.fieldConfig); }, value: this.fieldConfig.defaultValue.value, options: this.buildOptions() })
|
241
|
+
:
|
242
|
+
((_b = this._fieldProperties) === null || _b === void 0 ? void 0 : _b.userInterface) &&
|
243
|
+
this.buildField(this._fieldProperties, this.fieldConfig))), index.h("div", { class: "ez-row ez-padding--medium config-options__switch-row" }, index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.clearDuplicate"), value: this.fieldConfig.cleanOnCopy, onEzChange: (evt) => { this.fieldConfig.cleanOnCopy = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.requiredField"), enabled: this.getEnabledByProperty("required", "systemRequired"), value: this.getValueByProperty("required"), onEzChange: (evt) => { this.fieldConfig.required = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } })), index.h("div", { class: "ez-col ez-col--sd-12 ez-col--tb-4 ez-padding--small" }, index.h("ez-check", { mode: utils.CheckMode.SWITCH, label: this.getMessage("snkConfigOptions.label.protectedField"), enabled: this.getEnabledByProperty("readOnly", "systemReadOnly"), value: this.getValueByProperty("readOnly"), onEzChange: (evt) => { this.fieldConfig.readOnly = evt.detail; this.configOptionsChanged.emit(this.fieldConfig); } }))))));
|
244
|
+
}
|
245
|
+
get _element() { return index.getElement(this); }
|
246
|
+
};
|
247
|
+
SnkConfigOptions.style = snkConfigOptionsCss;
|
248
|
+
|
249
|
+
const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
|
250
|
+
|
251
|
+
const SnkForm = class {
|
252
|
+
constructor(hostRef) {
|
253
|
+
index.registerInstance(this, hostRef);
|
254
|
+
this.exit = index.createEvent(this, "exit", 7);
|
255
|
+
this.actionClick = index.createEvent(this, "actionClick", 7);
|
256
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
257
|
+
this._customEditors = new Map();
|
258
|
+
this._dataUnit = undefined;
|
259
|
+
this._dataState = undefined;
|
260
|
+
this._showFormConfig = false;
|
261
|
+
this._configManager = undefined;
|
262
|
+
this.configName = undefined;
|
263
|
+
this.recordsValidator = undefined;
|
264
|
+
this.messagesBuilder = undefined;
|
265
|
+
this.formLegacyConfigName = undefined;
|
266
|
+
this.resourceID = undefined;
|
267
|
+
}
|
268
|
+
/**
|
269
|
+
* Exibe a janela de configurações do formulário.
|
270
|
+
*/
|
271
|
+
async showConfig() {
|
272
|
+
this._showFormConfig = true;
|
273
|
+
}
|
274
|
+
/**
|
275
|
+
* Fecha a janela de configurações do formulário.
|
276
|
+
*/
|
277
|
+
async hideConfig() {
|
278
|
+
this._showFormConfig = false;
|
279
|
+
}
|
280
|
+
/**
|
281
|
+
* Registra um editor customizado para campos da grade e formulário.
|
282
|
+
*/
|
283
|
+
async addCustomEditor(fieldName, customEditor) {
|
284
|
+
if (this._form) {
|
285
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
286
|
+
return;
|
287
|
+
}
|
288
|
+
const newCustomEditors = new Map(this._customEditors);
|
289
|
+
newCustomEditors.set(fieldName, customEditor);
|
290
|
+
this._customEditors = newCustomEditors;
|
291
|
+
}
|
292
|
+
/**
|
293
|
+
* Altera/adiciona uma propriedade nos metadados do campo.
|
294
|
+
*/
|
295
|
+
async setFieldProp(fieldName, propName, value) {
|
296
|
+
await this._form.setFieldProp(fieldName, propName, value);
|
297
|
+
}
|
298
|
+
closeConfig() {
|
299
|
+
this.hideConfig();
|
300
|
+
}
|
301
|
+
dataunitReady() {
|
302
|
+
const dataInfo = { dataUnit: this._dataUnit };
|
303
|
+
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
304
|
+
}
|
305
|
+
setCustomEditors() {
|
306
|
+
if (!this._form) {
|
307
|
+
return;
|
308
|
+
}
|
309
|
+
for (const [fieldName, customEditor] of this._customEditors) {
|
310
|
+
this._form.addCustomEditor(fieldName, customEditor);
|
311
|
+
this._customEditors.delete(fieldName);
|
312
|
+
}
|
313
|
+
}
|
314
|
+
async componentDidRender() {
|
315
|
+
this.setCustomEditors();
|
316
|
+
}
|
317
|
+
async componentWillLoad() {
|
318
|
+
let parent = this._element.parentElement;
|
319
|
+
while (parent) {
|
320
|
+
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
321
|
+
this._snkDataUnit = parent;
|
322
|
+
this._dataUnit = this._snkDataUnit.dataUnit;
|
323
|
+
this._dataState = this._snkDataUnit.dataState;
|
324
|
+
if (this._dataUnit) {
|
325
|
+
this.dataunitReady();
|
326
|
+
}
|
327
|
+
else {
|
328
|
+
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
329
|
+
this._dataUnit = evt.detail;
|
330
|
+
});
|
331
|
+
}
|
332
|
+
this._snkDataUnit.addEventListener("dataStateChange", this.handleDataStateChange.bind(this));
|
333
|
+
break;
|
334
|
+
}
|
335
|
+
parent = parent.parentElement;
|
336
|
+
}
|
337
|
+
if (this.resourceID == undefined) {
|
338
|
+
this.resourceID = await ResourceIDUtils.ResourceIDUtils.getResourceID();
|
339
|
+
}
|
340
|
+
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, undefined, this._dataUnit);
|
341
|
+
this.addFormLegacyConfig();
|
342
|
+
await this._configManager.loadConfig();
|
343
|
+
}
|
344
|
+
async handleDataStateChange(evt) {
|
345
|
+
var _a;
|
346
|
+
this._dataState = evt.detail;
|
347
|
+
const fieldsWithRmPrecision = await this._snkDataUnit.getFieldsWithRmPrecision();
|
348
|
+
for (const field of fieldsWithRmPrecision || []) {
|
349
|
+
if (!field) {
|
350
|
+
continue;
|
351
|
+
}
|
352
|
+
const rmPrecision = (_a = this._dataState.rowMetadata) === null || _a === void 0 ? void 0 : _a.getProp('rm_precision', field);
|
353
|
+
if (!rmPrecision && rmPrecision !== 0) {
|
354
|
+
continue;
|
355
|
+
}
|
356
|
+
await this.setFieldProp(field, 'precision', rmPrecision);
|
357
|
+
await this.setFieldProp(field, 'prettyPrecision', rmPrecision);
|
358
|
+
}
|
359
|
+
}
|
360
|
+
addFormLegacyConfig() {
|
361
|
+
if (this.formLegacyConfigName) {
|
362
|
+
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
363
|
+
}
|
364
|
+
}
|
365
|
+
render() {
|
366
|
+
if (!this._dataUnit || !this._dataState) {
|
367
|
+
return undefined;
|
368
|
+
}
|
369
|
+
return (index.h("section", null, index.h("div", { class: "ez-row" }, index.h("div", { class: "ez-col ez-col--sd-12" }, index.h("ez-form", { ref: (ref) => this._form = ref, key: "ezForm" + this._snkDataUnit.entityName, "data-element-id": "embedded", dataUnit: this._dataUnit, config: this._configManager.getConfig(this._dataUnit), recordsValidator: this.recordsValidator, class: this._showFormConfig ? 'snk-form__form--hidden' : '' }), this._showFormConfig &&
|
370
|
+
index.h("snk-form-config", { messagesBuilder: this.messagesBuilder, dataUnit: this._dataUnit, configManager: this._configManager, onConfigClose: () => this.closeConfig() })))));
|
371
|
+
}
|
372
|
+
get _element() { return index.getElement(this); }
|
373
|
+
};
|
374
|
+
SnkForm.style = snkFormCss;
|
375
|
+
|
376
|
+
const snkFormConfigCss = ".sc-snk-form-config-h{--snk-form-config--z-index:var(--more-visible, 2);--snk-form-config--background-color:var(--background--xlight, #fff);--snk-form-config__icon--color:var(--text--disable, #AFB6C0);--snk-form-config__label-counter--font-weight:var(--text-weight--extra-small, 200);--snk-form-config__add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__add-group-container--background-color:var(--background--medium, #d2dce9);--snk-form-config__add-group-container--padding:var(--space--small, 6px);--snk-form-config__add-group-content--border:2px dashed var(--color-strokes, #DCE0E8);--snk-form-config__add-group-content--border-radius:var(--border--radius-small, 6px);--snk-form-config__add-group-label--padding:var(--space--large, 24px);--snk-form-config__btn-add-group--padding:var(--space--large, 24px) var(--space--medium, 12px) 0;--snk-form-config__btn-add-group-container--padding:var(--space--medium, 12px);--snk-form-config__btn-add-group-container--border-radius:var(--border--radius-medium, 12px);--snk-form-config__btn-add-group-container--border:2px solid var(--color-strokes, #DCE0E8);--snk-form-config__btn-add-group-container--background-color:var(--background--body, #fafcff);display:flex;flex-direction:column;position:fixed;top:0;left:0;width:100%;height:100%;z-index:var(--snk-form-config--z-index);background-color:var(--snk-form-config--background-color)}div.sc-snk-form-config:focus-visible,div.sc-snk-form-config:focus{outline:none}.form-config__header-container.sc-snk-form-config{display:flex}.form-config__field-container.sc-snk-form-config{width:32%;padding:6px}.form-config__hide-content.sc-snk-form-config{display:none}ez-icon.sc-snk-form-config .left-icon.sc-snk-form-config{--ez-icon--color:var(--snk-form-config__icon--color)}.ez-box__label-counter.sc-snk-form-config{margin-top:-7px;font-weight:var(--snk-form-config__label-counter--font-weight)}.form-config__btn-options.sc-snk-form-config{--ez-button--min-width:300px;--ez-button--background-color:var(--snk-form-config--background-color)}[data-draggable-parent].sc-snk-form-config{position:relative}.form-config__field-config--selected.sc-snk-form-config{position:static}.form-config__field-config--dragged.sc-snk-form-config .draggable-mirror.sc-snk-form-config{z-index:var(--snk-form-config--z-index)}.form-config__config-options.sc-snk-form-config{position:relative;margin-top:-3px;min-width:100%;z-index:1}.form-config__tab-container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config{position:relative;height:100%;max-height:calc(100vh - 92px)}.form-config__tab-container.sc-snk-form-config .ez-box__container.sc-snk-form-config,.form-config__fields-available.sc-snk-form-config .ez-box__container.sc-snk-form-config{align-content:flex-start;height:100%}.form-config__fields-available.sc-snk-form-config [data-draggable-parent].sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:100%;max-height:calc(100% - 122px)}.form-config__tab-content.sc-snk-form-config{align-content:flex-start;overflow-y:auto;height:auto;max-height:calc(100% - 128px)}[data-draggable-element].sc-snk-form-config{cursor:grab}.form-config__actions-button.sc-snk-form-config{--ez-actions-button__btn-action--min-width:235px}.form-config__add-group.sc-snk-form-config{position:relative;min-height:120px;margin-bottom:10px}.form-config__add-group-container.sc-snk-form-config{position:absolute;display:flex;flex-wrap:wrap;width:100%;box-sizing:border-box;border-radius:var(--snk-form-config__add-group-container--border-radius);background-color:var(--snk-form-config__add-group-container--background-color);padding:var(--snk-form-config__add-group-container--padding)}.form-config__add-group-content.sc-snk-form-config{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;box-sizing:border-box;border:var(--snk-form-config__add-group-content--border);border-radius:var(--snk-form-config__add-group-content--border-radius)}.form-config__add-group-label.sc-snk-form-config{display:flex;justify-content:center;box-sizing:border-box;padding:var(--snk-form-config__add-group-label--padding)}.form-config__btn-add-group.sc-snk-form-config{position:relative;padding:var(--snk-form-config__btn-add-group--padding)}.form-config__btn-add-group-container.sc-snk-form-config{padding:var(--snk-form-config__btn-add-group-container--padding);border-radius:var(--snk-form-config__btn-add-group-container--border-radius);border:var(--snk-form-config__btn-add-group-container--border);background-color:var(--snk-form-config__btn-add-group-container--background-color)}ez-collapsible-box.draggable-mirror.sc-snk-form-config{display:table;background-color:var(--snk-form-config--background-color)}ez-collapsible-box.sc-snk-form-config{margin-bottom:10px}@media screen and (min-width: 480px){.form-config__field-config--selected.sc-snk-form-config .ez-flex.form-config__config-options.sc-snk-form-config{min-width:calc(300% + 12px)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+2) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -1)}.form-config__field-config--selected.sc-snk-form-config:nth-child(3n+3) .ez-flex.form-config__config-options.sc-snk-form-config{left:calc(100% / 1 * -2)}}";
|
17
377
|
|
18
378
|
const CONTAINER_ID = {
|
19
379
|
collapsibleBox: "EZ-COLLAPSIBLE-BOX",
|
@@ -51,6 +411,7 @@ const SnkFormConfig = class {
|
|
51
411
|
this.dataUnit = undefined;
|
52
412
|
this.configManager = undefined;
|
53
413
|
this.messagesBuilder = undefined;
|
414
|
+
this.ignoreReadOnlyFormFields = undefined;
|
54
415
|
}
|
55
416
|
observeConfigManager() {
|
56
417
|
this.loadConfig(this._sortableTimer);
|
@@ -80,7 +441,7 @@ const SnkFormConfig = class {
|
|
80
441
|
}
|
81
442
|
}
|
82
443
|
getConfig() {
|
83
|
-
let config = this.configManager.getConfig(
|
444
|
+
let config = this.configManager.getConfig(this.dataUnit, this.ignoreReadOnlyFormFields);
|
84
445
|
if (config.fields && config.fields.length === 0) {
|
85
446
|
config = undefined;
|
86
447
|
}
|
@@ -205,7 +566,12 @@ const SnkFormConfig = class {
|
|
205
566
|
this._optionFormConfigChanged = false;
|
206
567
|
this.configManager.saveConfig(this.buildConfigToSave())
|
207
568
|
.then(savedConfig => {
|
569
|
+
var _a;
|
208
570
|
utils.ApplicationUtils.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"), { iconName: "check" });
|
571
|
+
const userOption = (_a = this._formConfigOptions) === null || _a === void 0 ? void 0 : _a.find((config) => {
|
572
|
+
return config.origin === formConfigFetcher.UserConfigType.USER;
|
573
|
+
});
|
574
|
+
this.setFormConfig(userOption);
|
209
575
|
this.configChange.emit(savedConfig);
|
210
576
|
});
|
211
577
|
}
|
@@ -539,9 +905,12 @@ const SnkFormConfig = class {
|
|
539
905
|
switch (this._optionFormConfigSelected.origin) {
|
540
906
|
case formConfigFetcher.UserConfigType.DEFAULT:
|
541
907
|
config = await this.configManager.fetchDefaultConfig();
|
908
|
+
if (!config) {
|
909
|
+
config = this.configManager.getEmptyConfig();
|
910
|
+
}
|
542
911
|
break;
|
543
|
-
|
544
|
-
config =
|
912
|
+
default:
|
913
|
+
config = this.getConfig();
|
545
914
|
break;
|
546
915
|
}
|
547
916
|
if (config != undefined) {
|
@@ -744,6 +1113,9 @@ const SnkFormConfig = class {
|
|
744
1113
|
if (layoutFormConfig == undefined) {
|
745
1114
|
layoutFormConfig = [];
|
746
1115
|
}
|
1116
|
+
if (this._formConfig.defaultConfiguration) {
|
1117
|
+
return layoutFormConfig;
|
1118
|
+
}
|
747
1119
|
return this._formConfig.tabs.map((tab) => {
|
748
1120
|
return layoutFormConfig.find(config => { var _a, _b; return ((_a = tab.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = config.tab) === null || _b === void 0 ? void 0 : _b.toLowerCase()); })
|
749
1121
|
|| { tab: tab.label, groups: [], visible: tab.visible };
|
@@ -999,4 +1371,6 @@ const SnkFormConfig = class {
|
|
999
1371
|
};
|
1000
1372
|
SnkFormConfig.style = snkFormConfigCss;
|
1001
1373
|
|
1374
|
+
exports.snk_config_options = SnkConfigOptions;
|
1375
|
+
exports.snk_form = SnkForm;
|
1002
1376
|
exports.snk_form_config = SnkFormConfig;
|