@sankhyalabs/sankhyablocks 8.2.0-dev.1 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-12397f18.js → ConfigStorage-e9d7fa82.js} +51 -163
- package/dist/cjs/{DataFetcher-f2da1f79.js → DataFetcher-39b63a1e.js} +29 -67
- package/dist/cjs/{SnkFormConfigManager-13f79e37.js → SnkFormConfigManager-2f8eccd9.js} +21 -19
- package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-15a7cc88.js} +1 -1
- package/dist/cjs/filter-bar-config-fetcher-24548cec.js +155 -0
- package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-ab3ce222.js} +3 -66
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-96c042aa.js} +1 -1
- package/dist/cjs/resource-fetcher-64102551.js +68 -0
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +11 -18
- package/dist/cjs/snk-application.cjs.entry.js +73 -51
- package/dist/cjs/snk-attach.cjs.entry.js +13 -7
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -2
- package/dist/cjs/snk-crud.cjs.entry.js +9 -28
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-80a00ae4.js → snk-data-unit-d5109a08.js} +6 -8
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +25 -18
- package/dist/cjs/snk-entity-list.cjs.entry.js +4 -0
- package/dist/cjs/snk-filter-bar.cjs.entry.js +17 -14
- package/dist/cjs/snk-filter-detail.cjs.entry.js +15 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +19 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +17 -6
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -6
- package/dist/cjs/snk-form.cjs.entry.js +8 -12
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
- package/dist/cjs/snk-grid.cjs.entry.js +20 -20
- package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-8c9693aa.js} +9 -18
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +16 -13
- package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +80 -22
- package/dist/cjs/snk-taskbar.cjs.entry.js +1 -2
- package/dist/collection/components/snk-actions-button/actions/index.js +4 -3
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +4 -8
- package/dist/collection/components/snk-application/snk-application.js +65 -60
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -19
- package/dist/collection/components/snk-crud/snk-crud.js +8 -63
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +15 -65
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +1 -27
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +30 -66
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +7 -42
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +12 -2
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +16 -21
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +12 -28
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +19 -17
- package/dist/collection/components/snk-form/snk-form.js +2 -46
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +15 -5
- package/dist/collection/components/snk-grid/snk-grid.js +16 -110
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +1 -19
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +12 -28
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +9 -43
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +1 -19
- package/dist/collection/lib/configs/ConfigStorage.js +44 -33
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +59 -2
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +29 -38
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +24 -0
- package/dist/collection/lib/index.js +0 -10
- package/dist/collection/lib/utils/urlutils.js +0 -29
- package/dist/components/ConfigStorage.js +48 -161
- package/dist/components/DataFetcher.js +29 -67
- package/dist/components/SnkFormConfigManager.js +19 -17
- package/dist/components/filter-bar-config-fetcher.js +153 -0
- package/dist/components/form-config-fetcher.js +2 -64
- package/dist/components/resource-fetcher.js +66 -0
- package/dist/components/snk-actions-button2.js +9 -23
- package/dist/components/snk-application2.js +154 -132
- package/dist/components/snk-attach2.js +8 -1
- package/dist/components/snk-configurator2.js +1 -3
- package/dist/components/snk-crud.js +7 -29
- package/dist/components/snk-data-unit2.js +6 -10
- package/dist/components/snk-detail-view2.js +23 -28
- package/dist/components/snk-entity-list.js +4 -0
- package/dist/components/snk-filter-bar2.js +12 -12
- package/dist/components/snk-filter-detail2.js +12 -2
- package/dist/components/snk-filter-modal-item2.js +16 -5
- package/dist/components/snk-form-config2.js +15 -5
- package/dist/components/snk-form-view2.js +1 -6
- package/dist/components/snk-form.js +2 -9
- package/dist/components/snk-grid-config2.js +2 -4
- package/dist/components/snk-grid2.js +16 -23
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-simple-crud2.js +69 -12
- package/dist/components/snk-taskbar2.js +1 -3
- package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-1090289a.js} +49 -162
- package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-a4ed43e7.js} +29 -67
- package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-de537eca.js} +21 -19
- package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-8d0bfa4a.js} +1 -1
- package/dist/esm/filter-bar-config-fetcher-2417b8cf.js +153 -0
- package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-4065db9a.js} +3 -65
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-7460b876.js} +1 -1
- package/dist/esm/resource-fetcher-45a70066.js +66 -0
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +11 -18
- package/dist/esm/snk-application.entry.js +71 -49
- package/dist/esm/snk-attach.entry.js +9 -3
- package/dist/esm/snk-configurator.entry.js +1 -2
- package/dist/esm/snk-crud.entry.js +9 -28
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-3ab57d1a.js → snk-data-unit-3a0bbfcb.js} +6 -8
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +25 -18
- package/dist/esm/snk-entity-list.entry.js +4 -0
- package/dist/esm/snk-filter-bar.entry.js +17 -14
- package/dist/esm/snk-filter-detail.entry.js +16 -2
- package/dist/esm/snk-filter-modal-item.entry.js +20 -6
- package/dist/esm/snk-form-config.entry.js +18 -7
- package/dist/esm/snk-form-view.entry.js +1 -6
- package/dist/esm/snk-form.entry.js +8 -12
- package/dist/esm/snk-grid-config.entry.js +6 -5
- package/dist/esm/snk-grid.entry.js +20 -20
- package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-a6d39c18.js} +9 -18
- package/dist/esm/snk-guides-viewer.entry.js +8 -8
- package/dist/esm/snk-personalized-filter.entry.js +16 -13
- package/dist/esm/snk-print-selector.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +71 -13
- package/dist/esm/snk-taskbar.entry.js +1 -2
- package/dist/sankhyablocks/p-0fb83448.js +1 -0
- package/dist/sankhyablocks/p-15aba6fb.entry.js +11 -0
- package/dist/sankhyablocks/p-216f081a.entry.js +1 -0
- package/dist/sankhyablocks/p-21e7c08e.entry.js +1 -0
- package/dist/sankhyablocks/p-2861d44f.entry.js +1 -0
- package/dist/sankhyablocks/p-2d883fe9.entry.js +1 -0
- package/dist/sankhyablocks/{p-d13c00b6.entry.js → p-3d6f91c2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f8e6b97e.js → p-44e66c8d.js} +1 -1
- package/dist/sankhyablocks/p-4514fc6a.entry.js +1 -0
- package/dist/sankhyablocks/p-4f4cd005.entry.js +1 -0
- package/dist/sankhyablocks/p-50c13cc8.entry.js +1 -0
- package/dist/sankhyablocks/p-52c6b2e7.js +1 -0
- package/dist/sankhyablocks/p-5994af77.js +56 -0
- package/dist/sankhyablocks/p-5df17074.js +1 -0
- package/dist/sankhyablocks/p-6bb904bb.entry.js +1 -0
- package/dist/sankhyablocks/p-6f0795c8.entry.js +1 -0
- package/dist/sankhyablocks/p-7588f006.entry.js +1 -0
- package/dist/sankhyablocks/p-847e6c20.js +17 -0
- package/dist/sankhyablocks/p-9471cbc9.entry.js +1 -0
- package/dist/sankhyablocks/{p-14eac6fe.js → p-9d18017a.js} +1 -1
- package/dist/sankhyablocks/p-9edad923.js +1 -0
- package/dist/sankhyablocks/p-a42dd503.entry.js +1 -0
- package/dist/sankhyablocks/{p-2d333d22.js → p-b978da60.js} +1 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +1 -0
- package/dist/sankhyablocks/p-c6380ea2.entry.js +1 -0
- package/dist/sankhyablocks/{p-03bb1aea.entry.js → p-c6feb995.entry.js} +1 -1
- package/dist/sankhyablocks/p-c945318c.entry.js +1 -0
- package/dist/sankhyablocks/p-ccbfb1cf.entry.js +1 -0
- package/dist/sankhyablocks/p-d7c7a289.entry.js +1 -0
- package/dist/sankhyablocks/p-de69b4b0.entry.js +1 -0
- package/dist/sankhyablocks/p-f3b7b69e.js +10 -0
- package/dist/sankhyablocks/p-f7eded3a.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +1 -2
- package/dist/types/components/snk-application/snk-application.d.ts +13 -8
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +0 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +0 -10
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +0 -13
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +0 -5
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +2 -13
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +0 -8
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +3 -0
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +4 -5
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +0 -4
- package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +4 -5
- package/dist/types/components/snk-form/snk-form.d.ts +1 -9
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +2 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +1 -18
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +0 -4
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +1 -5
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +0 -8
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +0 -4
- package/dist/types/components.d.ts +21 -189
- package/dist/types/lib/configs/ConfigStorage.d.ts +13 -11
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +7 -0
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +1 -0
- package/dist/types/lib/index.d.ts +0 -11
- package/dist/types/lib/utils/urlutils.d.ts +0 -14
- package/package.json +2 -2
- package/dist/cjs/ISave-d68ce3cd.js +0 -8
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +0 -12
- package/dist/cjs/auth-fetcher-319a4cb2.js +0 -34
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +0 -7
- package/dist/components/ResourceIDUtils.js +0 -10
- package/dist/components/auth-fetcher.js +0 -32
- package/dist/esm/ISave-4412b20c.js +0 -8
- package/dist/esm/ResourceIDUtils-a114189a.js +0 -10
- package/dist/esm/auth-fetcher-6d9664b7.js +0 -32
- package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
- package/dist/sankhyablocks/p-05dbc70e.entry.js +0 -1
- package/dist/sankhyablocks/p-41e897f1.js +0 -56
- package/dist/sankhyablocks/p-48a40939.js +0 -1
- package/dist/sankhyablocks/p-611aa624.entry.js +0 -1
- package/dist/sankhyablocks/p-66bb8c20.entry.js +0 -1
- package/dist/sankhyablocks/p-688dcb4c.js +0 -1
- package/dist/sankhyablocks/p-6f154396.entry.js +0 -1
- package/dist/sankhyablocks/p-787071a8.js +0 -1
- package/dist/sankhyablocks/p-8481bb59.entry.js +0 -1
- package/dist/sankhyablocks/p-8818d8f6.entry.js +0 -1
- package/dist/sankhyablocks/p-93f6ca04.entry.js +0 -1
- package/dist/sankhyablocks/p-9a270401.entry.js +0 -1
- package/dist/sankhyablocks/p-9e7d65a4.js +0 -1
- package/dist/sankhyablocks/p-a52a6c9d.js +0 -26
- package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
- package/dist/sankhyablocks/p-c555075c.entry.js +0 -1
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +0 -1
- package/dist/sankhyablocks/p-d53a9169.entry.js +0 -1
- package/dist/sankhyablocks/p-d7638f45.entry.js +0 -11
- package/dist/sankhyablocks/p-e086cc2a.entry.js +0 -1
- package/dist/sankhyablocks/p-e64f3e17.entry.js +0 -1
- package/dist/sankhyablocks/p-ed41b38c.js +0 -1
- package/dist/sankhyablocks/p-ed705cbb.entry.js +0 -1
- package/dist/sankhyablocks/p-efc10705.entry.js +0 -1
- package/dist/sankhyablocks/p-f74fe358.js +0 -1
- package/dist/sankhyablocks/p-f91e0c5d.entry.js +0 -1
- package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +0 -3
@@ -4,16 +4,17 @@ 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-
|
7
|
+
const DataFetcher = require('./DataFetcher-39b63a1e.js');
|
8
8
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
9
|
-
const pesquisaFetcher = require('./pesquisa-fetcher-
|
10
|
-
const ConfigStorage = require('./ConfigStorage-
|
11
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
12
|
-
const
|
9
|
+
const pesquisaFetcher = require('./pesquisa-fetcher-96c042aa.js');
|
10
|
+
const ConfigStorage = require('./ConfigStorage-e9d7fa82.js');
|
11
|
+
const dataunitFetcher = require('./dataunit-fetcher-15a7cc88.js');
|
12
|
+
const resourceFetcher = require('./resource-fetcher-64102551.js');
|
13
13
|
const SnkMessageBuilder = require('./SnkMessageBuilder-d0abb63d.js');
|
14
14
|
require('./_commonjsHelpers-537d719a.js');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
|
-
require('./form-config-fetcher-
|
16
|
+
require('./form-config-fetcher-ab3ce222.js');
|
17
|
+
require('./filter-bar-config-fetcher-24548cec.js');
|
17
18
|
require('./filter-item-type.enum-aa823a00.js');
|
18
19
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
19
20
|
|
@@ -234,6 +235,34 @@ class ParametersFetcher {
|
|
234
235
|
|
235
236
|
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
236
237
|
|
238
|
+
class AuthFetcher extends resourceFetcher.ResourceFetcher {
|
239
|
+
getData(resourceID) {
|
240
|
+
const completePath = `cfg://auth/${resourceID}`;
|
241
|
+
return new Promise((resolve, reject) => {
|
242
|
+
this.loadResource(completePath)
|
243
|
+
.then((loadedResource) => {
|
244
|
+
let auth = core.ObjectUtils.stringToObject(loadedResource);
|
245
|
+
if (auth && typeof (auth) === 'object') {
|
246
|
+
resolve(auth);
|
247
|
+
}
|
248
|
+
}).catch((error) => {
|
249
|
+
reject(error);
|
250
|
+
});
|
251
|
+
});
|
252
|
+
}
|
253
|
+
}
|
254
|
+
var AutorizationType;
|
255
|
+
(function (AutorizationType) {
|
256
|
+
AutorizationType["INSERT"] = "I";
|
257
|
+
AutorizationType["UPDATE"] = "A";
|
258
|
+
AutorizationType["REMOVE"] = "E";
|
259
|
+
AutorizationType["SHOW"] = "C";
|
260
|
+
AutorizationType["CONFIG"] = "F";
|
261
|
+
AutorizationType["CONFIG_NUMBER"] = "N";
|
262
|
+
AutorizationType["CLONE"] = "D";
|
263
|
+
AutorizationType["CONFIG_GRID"] = "G";
|
264
|
+
})(AutorizationType || (AutorizationType = {}));
|
265
|
+
|
237
266
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
238
267
|
|
239
268
|
const SnkApplication = class {
|
@@ -254,21 +283,16 @@ const SnkApplication = class {
|
|
254
283
|
}
|
255
284
|
return this._parameters;
|
256
285
|
}
|
257
|
-
|
258
|
-
if (
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
this.authFetcher.getData(resourceID).then((authList) => {
|
264
|
-
resolve(authList);
|
265
|
-
}).catch(error => {
|
266
|
-
reject(error);
|
267
|
-
});
|
268
|
-
});
|
286
|
+
get resourceID() {
|
287
|
+
if (!this._resourceID) {
|
288
|
+
this._resourceID = this.urlParams.get("workspaceResourceID") ||
|
289
|
+
this.urlParams.get("resourceID") ||
|
290
|
+
Workspace.resourceID ||
|
291
|
+
"unknown.resource.id";
|
269
292
|
}
|
293
|
+
return this._resourceID;
|
270
294
|
}
|
271
|
-
|
295
|
+
get auth() {
|
272
296
|
if (this._auth) {
|
273
297
|
return Promise.resolve(this._auth);
|
274
298
|
}
|
@@ -277,7 +301,7 @@ const SnkApplication = class {
|
|
277
301
|
const waitingAuth = this._authPromises.length > 0;
|
278
302
|
this._authPromises.push(new PendingPromise(resolve, reject));
|
279
303
|
if (!waitingAuth) {
|
280
|
-
this.authFetcher.getData(this.
|
304
|
+
this.authFetcher.getData(this.resourceID).then((authList) => {
|
281
305
|
this._auth = authList;
|
282
306
|
while (this._authPromises.length > 0) {
|
283
307
|
this._authPromises.pop().resolve(this._auth);
|
@@ -296,7 +320,7 @@ const SnkApplication = class {
|
|
296
320
|
*/
|
297
321
|
async isUserSup() {
|
298
322
|
return new Promise((resolve, reject) => {
|
299
|
-
this.
|
323
|
+
this.auth.then((authorization) => {
|
300
324
|
this.getAuthList(authorization).then((auths) => {
|
301
325
|
resolve(auths.isSup);
|
302
326
|
}).catch(error => reject(error));
|
@@ -310,9 +334,9 @@ const SnkApplication = class {
|
|
310
334
|
/**
|
311
335
|
* Obtém `true` caso o usuário logado tem permissão pra determinada ação.
|
312
336
|
*/
|
313
|
-
async hasAccess(access
|
337
|
+
async hasAccess(access) {
|
314
338
|
return new Promise((resolve, reject) => {
|
315
|
-
this.
|
339
|
+
this.auth.then((authorization) => {
|
316
340
|
this.getAuthList(authorization).then((auths) => {
|
317
341
|
resolve(auths.isSup || auths.actions[access]);
|
318
342
|
}).catch(error => reject(error));
|
@@ -322,13 +346,13 @@ const SnkApplication = class {
|
|
322
346
|
/**
|
323
347
|
* Obtém todos os acessos do usuário logado.
|
324
348
|
*/
|
325
|
-
async getAllAccess(
|
349
|
+
async getAllAccess() {
|
326
350
|
return new Promise((resolve, reject) => {
|
327
|
-
this.
|
351
|
+
this.auth.then((authorization) => {
|
328
352
|
this.getAuthList(authorization).then((auths) => {
|
329
353
|
const allAccess = {};
|
330
354
|
allAccess['isSup'] = auths.isSup;
|
331
|
-
Object.entries(
|
355
|
+
Object.entries(AutorizationType).forEach((data) => {
|
332
356
|
allAccess[data[0]] = auths.actions[data[1]] || false;
|
333
357
|
});
|
334
358
|
resolve(allAccess);
|
@@ -508,16 +532,13 @@ const SnkApplication = class {
|
|
508
532
|
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
509
533
|
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado.
|
510
534
|
*/
|
511
|
-
async createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
512
|
-
if (resourceID == undefined) {
|
513
|
-
resourceID = this.applicationResourceID;
|
514
|
-
}
|
535
|
+
async createDataunit(entityName, dataUnitName, parentDataUnit, configName) {
|
515
536
|
return new Promise((resolve, reject) => {
|
516
537
|
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
517
538
|
const waitingDu = duPromisses.length > 0;
|
518
539
|
duPromisses.push(new PendingPromise(resolve, reject));
|
519
540
|
if (!waitingDu) {
|
520
|
-
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, resourceID, parentDataUnit, configName);
|
541
|
+
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID, parentDataUnit, configName);
|
521
542
|
dataUnit.loadMetadata().then(() => {
|
522
543
|
if (dataUnitName) {
|
523
544
|
this.updateDataunitCache(undefined, dataUnitName, dataUnit);
|
@@ -548,14 +569,14 @@ const SnkApplication = class {
|
|
548
569
|
/**
|
549
570
|
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
550
571
|
*/
|
551
|
-
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName
|
572
|
+
async getDataUnit(entityName, dataUnitName, parentDataUnit, configName) {
|
552
573
|
return new Promise((resolve, reject) => {
|
553
574
|
const dataUnit = this._duCache.get(dataUnitName);
|
554
575
|
if (dataUnit) {
|
555
576
|
resolve(dataUnit);
|
556
577
|
}
|
557
578
|
else {
|
558
|
-
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName
|
579
|
+
this.createDataunit(entityName, dataUnitName, parentDataUnit, configName).then(dataUnit => {
|
559
580
|
resolve(dataUnit);
|
560
581
|
}).catch(reason => reject(reason));
|
561
582
|
}
|
@@ -604,20 +625,11 @@ const SnkApplication = class {
|
|
604
625
|
async callServiceBroker(serviceName, payload, options) {
|
605
626
|
return DataFetcher.DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
606
627
|
}
|
607
|
-
get applicationResourceID() {
|
608
|
-
if (!this._applicationResourceID) {
|
609
|
-
this._applicationResourceID = this.urlParams.get("workspaceResourceID") ||
|
610
|
-
this.urlParams.get("resourceID") ||
|
611
|
-
Workspace.resourceID ||
|
612
|
-
"unknown.resource.id";
|
613
|
-
}
|
614
|
-
return this._applicationResourceID;
|
615
|
-
}
|
616
628
|
/**
|
617
629
|
* Obtém o resourceID da tela em questão.
|
618
630
|
*/
|
619
631
|
async getResourceID() {
|
620
|
-
return Promise.resolve(this.
|
632
|
+
return Promise.resolve(this.resourceID);
|
621
633
|
}
|
622
634
|
/**
|
623
635
|
* Obtém o UserId da tela em questão.
|
@@ -661,14 +673,20 @@ const SnkApplication = class {
|
|
661
673
|
async info(message, options) {
|
662
674
|
return utils.ApplicationUtils.info(message, options);
|
663
675
|
}
|
676
|
+
/**
|
677
|
+
* Obtém a configuração de grade.
|
678
|
+
*/
|
679
|
+
async loadGridConfig(name) {
|
680
|
+
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
681
|
+
}
|
664
682
|
/**
|
665
683
|
* Obtém os totalizadores da grade.
|
666
684
|
*/
|
667
685
|
async loadTotals(name, resourceID, filters) {
|
668
686
|
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
669
687
|
}
|
670
|
-
async getAuthList(
|
671
|
-
return await (new MGEAuthorization()).parseFromJSON(
|
688
|
+
async getAuthList(_auth) {
|
689
|
+
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
672
690
|
}
|
673
691
|
get urlParams() {
|
674
692
|
if (!this._urlParams) {
|
@@ -682,6 +700,12 @@ const SnkApplication = class {
|
|
682
700
|
}
|
683
701
|
return this._dataUnitFetcher;
|
684
702
|
}
|
703
|
+
get gridConfigFetcher() {
|
704
|
+
if (!this._gridConfigFetcher) {
|
705
|
+
this._gridConfigFetcher = new ConfigStorage.GridConfigFetcher();
|
706
|
+
}
|
707
|
+
return this._gridConfigFetcher;
|
708
|
+
}
|
685
709
|
get totalsFetcher() {
|
686
710
|
if (!this._totalsFetcher) {
|
687
711
|
this._totalsFetcher = new TotalsFetcher();
|
@@ -696,7 +720,7 @@ const SnkApplication = class {
|
|
696
720
|
}
|
697
721
|
get authFetcher() {
|
698
722
|
if (!this._authFetcher) {
|
699
|
-
this._authFetcher = new
|
723
|
+
this._authFetcher = new AuthFetcher();
|
700
724
|
}
|
701
725
|
return this._authFetcher;
|
702
726
|
}
|
@@ -779,7 +803,7 @@ const SnkApplication = class {
|
|
779
803
|
* Obtém o nome das telas da aplicação
|
780
804
|
*/
|
781
805
|
async getAppLabel() {
|
782
|
-
return Workspace.getAppLabel(this.
|
806
|
+
return Workspace.getAppLabel(this._resourceID);
|
783
807
|
}
|
784
808
|
/**
|
785
809
|
* Adiciona um listener no fetcher de Pesquisa
|
@@ -851,7 +875,6 @@ const SnkApplication = class {
|
|
851
875
|
this._popUp.ezTitle = title;
|
852
876
|
}
|
853
877
|
componentWillLoad() {
|
854
|
-
core.ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", true);
|
855
878
|
this._errorHandler = new SnkErrorHandler(this);
|
856
879
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder();
|
857
880
|
core.ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${DataFetcher.UrlUtils.getUrlBase()}/mge/upload/file`);
|
@@ -860,7 +883,7 @@ const SnkApplication = class {
|
|
860
883
|
});
|
861
884
|
core.ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
862
885
|
core.ErrorTracking.init();
|
863
|
-
ConfigStorage.ConfigStorage.
|
886
|
+
ConfigStorage.ConfigStorage.get();
|
864
887
|
}
|
865
888
|
connectedCallback() {
|
866
889
|
core.ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
@@ -872,10 +895,9 @@ const SnkApplication = class {
|
|
872
895
|
componentDidLoad() {
|
873
896
|
this.applicationLoading.emit(true);
|
874
897
|
window.requestAnimationFrame(() => {
|
875
|
-
core.ApplicationContext.setContextValue("__SNK__APPLICATION__LOADING__", false);
|
876
898
|
this.applicationLoaded.emit(true);
|
877
899
|
});
|
878
|
-
core.ElementIDUtils.addIDInfo(this._element, `resource_${this.
|
900
|
+
core.ElementIDUtils.addIDInfo(this._element, `resource_${this._resourceID}`);
|
879
901
|
}
|
880
902
|
render() {
|
881
903
|
return (index.h("div", null, index.h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), index.h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() }), index.h("ez-modal", { opened: false, ref: (ref) => this._rightModal = ref, "modal-size": "small", closeOutsideClick: true, closeEsc: true })));
|
@@ -4,10 +4,9 @@ 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
|
-
const ISave = require('./ISave-d68ce3cd.js');
|
7
|
+
const DataFetcher = require('./DataFetcher-39b63a1e.js');
|
9
8
|
const constants = require('./constants-d187e03e.js');
|
10
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
9
|
+
const dataunitFetcher = require('./dataunit-fetcher-15a7cc88.js');
|
11
10
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
12
11
|
require('./_commonjsHelpers-537d719a.js');
|
13
12
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
@@ -15,6 +14,13 @@ require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
14
|
require('./index-0e663819.js');
|
16
15
|
require('./index-102ba62d.js');
|
17
16
|
|
17
|
+
var SaveErrorsEnum;
|
18
|
+
(function (SaveErrorsEnum) {
|
19
|
+
SaveErrorsEnum["LINK_AND_FILE_AT_THE_SAME_TIME"] = "LINK_AND_FILE_AT_THE_SAME_TIME";
|
20
|
+
SaveErrorsEnum["ANY_LINK_OR_FILE_FILLED"] = "ANY_LINK_OR_FILE_FILLED";
|
21
|
+
SaveErrorsEnum["UNKNOWN"] = "UNKNOWN";
|
22
|
+
})(SaveErrorsEnum || (SaveErrorsEnum = {}));
|
23
|
+
|
18
24
|
class AttachFetcher {
|
19
25
|
constructor(entityName, registerKey, dataUnitName) {
|
20
26
|
var _a;
|
@@ -23,9 +29,9 @@ class AttachFetcher {
|
|
23
29
|
this.dataUnitName = dataUnitName;
|
24
30
|
this.validateFields = (fields) => {
|
25
31
|
if (!!fields.LINK && !!fields.NOMEARQUIVO)
|
26
|
-
throw new Error(
|
32
|
+
throw new Error(SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME);
|
27
33
|
if (!fields.LINK && !fields.NOMEARQUIVO)
|
28
|
-
throw new Error(
|
34
|
+
throw new Error(SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED);
|
29
35
|
if (!this.registerKey)
|
30
36
|
throw new Error('Register key can not be null');
|
31
37
|
};
|
@@ -194,11 +200,11 @@ class AttachmentDataUnitBuilder {
|
|
194
200
|
savePromise(change).then((records) => {
|
195
201
|
resolve(records);
|
196
202
|
}).catch((error) => {
|
197
|
-
if (error.message ===
|
203
|
+
if (error.message === SaveErrorsEnum.LINK_AND_FILE_AT_THE_SAME_TIME) {
|
198
204
|
this._application.alert(this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.title'), this.getMessage('snkAttach.alertValidation.fileAndLinkAtTheSameTime.message'));
|
199
205
|
return resolve([]);
|
200
206
|
}
|
201
|
-
if (error.message ===
|
207
|
+
if (error.message === SaveErrorsEnum.ANY_LINK_OR_FILE_FILLED) {
|
202
208
|
this._application.alert(this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.title'), this.getMessage('snkAttach.alertValidation.anyLinkOrFileFilled.message'));
|
203
209
|
return resolve([]);
|
204
210
|
}
|
@@ -20,7 +20,6 @@ const SnkConfigurator = class {
|
|
20
20
|
this._permissions = undefined;
|
21
21
|
this.showActionButtons = false;
|
22
22
|
this.configName = undefined;
|
23
|
-
this.resourceID = undefined;
|
24
23
|
this.viewMode = constants.VIEW_MODE.GRID;
|
25
24
|
this.messagesBuilder = undefined;
|
26
25
|
}
|
@@ -85,7 +84,7 @@ const SnkConfigurator = class {
|
|
85
84
|
componentWillLoad() {
|
86
85
|
this._application = core.ApplicationContext.getContextValue('__SNK__APPLICATION__');
|
87
86
|
if (this._application) {
|
88
|
-
this._application.getAllAccess(
|
87
|
+
this._application.getAllAccess().then(access => (this._permissions = access));
|
89
88
|
}
|
90
89
|
else {
|
91
90
|
this._permissions = {};
|
@@ -5,18 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
8
|
-
require('./DataFetcher-
|
9
|
-
require('./pesquisa-fetcher-
|
8
|
+
require('./DataFetcher-39b63a1e.js');
|
9
|
+
require('./pesquisa-fetcher-96c042aa.js');
|
10
10
|
const index$1 = require('./index-0e663819.js');
|
11
|
-
require('./ISave-d68ce3cd.js');
|
12
|
-
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
13
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
-
require('./filter-item-type.enum-aa823a00.js');
|
15
|
-
require('./form-config-fetcher-5d62ab62.js');
|
16
11
|
const constants = require('./constants-d187e03e.js');
|
17
|
-
const authFetcher = require('./auth-fetcher-319a4cb2.js');
|
18
12
|
require('./index-102ba62d.js');
|
19
13
|
require('./_commonjsHelpers-537d719a.js');
|
14
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
20
15
|
|
21
16
|
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%}";
|
22
17
|
|
@@ -26,14 +21,11 @@ const SnkCrud = class {
|
|
26
21
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
27
22
|
this.configuratorSave = index.createEvent(this, "configuratorSave", 7);
|
28
23
|
this.configuratorCancel = index.createEvent(this, "configuratorCancel", 7);
|
29
|
-
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
30
24
|
this._viewHistory = [];
|
31
25
|
this._dataUnit = undefined;
|
32
26
|
this._dataState = undefined;
|
33
27
|
this.attachmentRegisterKey = undefined;
|
34
28
|
this._currentViewMode = constants.VIEW_MODE.GRID;
|
35
|
-
this._canEdit = undefined;
|
36
|
-
this._resourceID = undefined;
|
37
29
|
this.configName = undefined;
|
38
30
|
this.selectionToastConfig = undefined;
|
39
31
|
this.showActionButtons = false;
|
@@ -44,7 +36,6 @@ const SnkCrud = class {
|
|
44
36
|
this.multipleSelection = true;
|
45
37
|
this.presentationMode = index$1.PresentationMode.PRIMARY;
|
46
38
|
this.messagesBuilder = undefined;
|
47
|
-
this.useEnterLikeTab = false;
|
48
39
|
}
|
49
40
|
/**
|
50
41
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
@@ -128,7 +119,7 @@ const SnkCrud = class {
|
|
128
119
|
}
|
129
120
|
componentWillLoad() {
|
130
121
|
const application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
131
|
-
application.hasAccess(
|
122
|
+
// application.hasAccess(AutorizationType.UPDATE).then(canEdit=>this._canEdit = canEdit)
|
132
123
|
let parent = this._element.parentElement;
|
133
124
|
while (parent) {
|
134
125
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -140,11 +131,11 @@ const SnkCrud = class {
|
|
140
131
|
if (!this._dataUnit) {
|
141
132
|
this._snkDataUnit.addEventListener("dataUnitReady", (evt) => {
|
142
133
|
this._dataUnit = evt.detail;
|
143
|
-
this.initDataUnit(
|
134
|
+
this.initDataUnit();
|
144
135
|
});
|
145
136
|
}
|
146
137
|
else {
|
147
|
-
this.initDataUnit(
|
138
|
+
this.initDataUnit();
|
148
139
|
}
|
149
140
|
this._snkDataUnit.addEventListener("dataStateChange", async ({ detail: dataState }) => {
|
150
141
|
this._dataState = dataState;
|
@@ -160,18 +151,11 @@ const SnkCrud = class {
|
|
160
151
|
this.configName = application.configName;
|
161
152
|
}
|
162
153
|
}
|
163
|
-
|
154
|
+
initDataUnit() {
|
164
155
|
this.addDataElementID();
|
165
156
|
if (!this.messagesBuilder) {
|
166
157
|
this.messagesBuilder = this._snkDataUnit.messagesBuilder;
|
167
158
|
}
|
168
|
-
if (this._resourceID == undefined) {
|
169
|
-
//Tenta pegar o resourceID do snkDataUnit;
|
170
|
-
this._resourceID = this._snkDataUnit.resourceID;
|
171
|
-
if (this._resourceID == undefined) {
|
172
|
-
this._resourceID = await application.getResourceID();
|
173
|
-
}
|
174
|
-
}
|
175
159
|
}
|
176
160
|
handleConfiguratorEvent(evt, type) {
|
177
161
|
evt.stopImmediatePropagation();
|
@@ -182,11 +166,8 @@ const SnkCrud = class {
|
|
182
166
|
this.configuratorCancel.emit();
|
183
167
|
}
|
184
168
|
render() {
|
185
|
-
|
186
|
-
|
187
|
-
}
|
188
|
-
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === constants.VIEW_MODE.GRID;
|
189
|
-
return (index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, resourceID: this._resourceID }, index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID }, index.h("div", { slot: "SnkConfigContainerSlot" }, index.h("slot", { name: "SnkConfigContainerSlot" })))));
|
169
|
+
// this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
170
|
+
return (index.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index.h("stack-item", null, index.h("snk-grid", { ref: (ref) => this._snkGrid = ref, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, selectionToastConfig: this.selectionToastConfig }, index.h("slot", { name: "SnkGridHeader" }), index.h("slot", { name: "SnkGridFooter" }), index.h("slot", { name: "SnkGridTaskBar" }))), index.h("stack-item", null, index.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form" }, index.h("slot", { name: "SnkFormTaskBar" }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL') }, index.h("div", { slot: "SnkConfigContainerSlot" }, index.h("slot", { name: "SnkConfigContainerSlot" })))));
|
190
171
|
}
|
191
172
|
get _element() { return index.getElement(this); }
|
192
173
|
static get watchers() { return {
|
@@ -7,8 +7,8 @@ const core = require('@sankhyalabs/core');
|
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const index = require('./index-0e663819.js');
|
9
9
|
const constants = require('./constants-d187e03e.js');
|
10
|
-
const DataFetcher = require('./DataFetcher-
|
11
|
-
const snkDataUnit = require('./snk-data-unit-
|
10
|
+
const DataFetcher = require('./DataFetcher-39b63a1e.js');
|
11
|
+
const snkDataUnit = require('./snk-data-unit-d5109a08.js');
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
14
|
require('./SnkMessageBuilder-d0abb63d.js');
|
@@ -22,9 +22,9 @@ const SnkDataUnit = class {
|
|
22
22
|
const duState = this.buildDataState();
|
23
23
|
this.dataState = duState;
|
24
24
|
if (action.type === core.Action.DATA_SAVED) {
|
25
|
-
if
|
26
|
-
|
27
|
-
}
|
25
|
+
// if(this.ignoreSaveMessage){
|
26
|
+
// return
|
27
|
+
// }
|
28
28
|
const msg = this.getMessage("snkDataUnit.saveInfo", action.payload.records[0]);
|
29
29
|
if (msg != undefined) {
|
30
30
|
this.showSuccessMessage(msg);
|
@@ -70,9 +70,7 @@ const SnkDataUnit = class {
|
|
70
70
|
this.beforeSave = undefined;
|
71
71
|
this.afterSave = undefined;
|
72
72
|
this.useCancelConfirm = true;
|
73
|
-
this.ignoreSaveMessage = undefined;
|
74
73
|
this.configName = undefined;
|
75
|
-
this.resourceID = undefined;
|
76
74
|
}
|
77
75
|
observePageSize() {
|
78
76
|
if (this.dataUnit) {
|
@@ -336,10 +334,10 @@ const SnkDataUnit = class {
|
|
336
334
|
const cacheName = this.dataUnitName ? this.dataUnitName : this.entityName;
|
337
335
|
if (this._parentSnkDataUnit) {
|
338
336
|
this._parentDataUnit = await ((_a = this._parentSnkDataUnit) === null || _a === void 0 ? void 0 : _a.getDataUnit());
|
339
|
-
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName
|
337
|
+
return await this._application.getDataUnit(this.entityName, cacheName, this._parentDataUnit, this.configName);
|
340
338
|
}
|
341
339
|
else {
|
342
|
-
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName
|
340
|
+
return await this._application.getDataUnit(this.entityName, cacheName, null, this.configName);
|
343
341
|
}
|
344
342
|
}
|
345
343
|
async loadDataUnit() {
|
@@ -398,7 +396,7 @@ const SnkDataUnit = class {
|
|
398
396
|
//---------------------------------------------
|
399
397
|
componentWillLoad() {
|
400
398
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
401
|
-
this._application.getAllAccess(
|
399
|
+
this._application.getAllAccess().then(access => this._permissions = access);
|
402
400
|
this._parentSnkDataUnit = this.getParentSnkDataUnit();
|
403
401
|
if (this.messagesBuilder == undefined) {
|
404
402
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
5
|
+
const snkDataUnit = require('./snk-data-unit-d5109a08.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
@@ -3,23 +3,23 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
6
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-2f8eccd9.js');
|
7
7
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
8
|
-
require('./DataFetcher-
|
9
|
-
require('./pesquisa-fetcher-
|
8
|
+
require('./DataFetcher-39b63a1e.js');
|
9
|
+
require('./pesquisa-fetcher-96c042aa.js');
|
10
10
|
require('@sankhyalabs/core');
|
11
11
|
const index$1 = require('./index-0e663819.js');
|
12
|
-
require('./ISave-d68ce3cd.js');
|
13
|
-
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
-
require('./filter-item-type.enum-aa823a00.js');
|
16
|
-
require('./form-config-fetcher-5d62ab62.js');
|
17
12
|
const taskbarElements = require('./taskbar-elements-b98dd6e9.js');
|
18
13
|
const constants = require('./constants-d187e03e.js');
|
19
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
14
|
+
const snkGuidesViewer = require('./snk-guides-viewer-8c9693aa.js');
|
20
15
|
const SnkMessageBuilder = require('./SnkMessageBuilder-d0abb63d.js');
|
21
|
-
require('./ConfigStorage-
|
16
|
+
require('./ConfigStorage-e9d7fa82.js');
|
17
|
+
require('./form-config-fetcher-ab3ce222.js');
|
18
|
+
require('./resource-fetcher-64102551.js');
|
19
|
+
require('./filter-bar-config-fetcher-24548cec.js');
|
20
|
+
require('./filter-item-type.enum-aa823a00.js');
|
22
21
|
require('./_commonjsHelpers-537d719a.js');
|
22
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
23
23
|
require('./index-102ba62d.js');
|
24
24
|
require('./taskbar-processor-bce3f499.js');
|
25
25
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
@@ -74,13 +74,10 @@ const SnkDetailView = class {
|
|
74
74
|
index.registerInstance(this, hostRef);
|
75
75
|
this.snkDetailGuidesChange = index.createEvent(this, "snkDetailGuidesChange", 7);
|
76
76
|
this.snkSwitchGuide = index.createEvent(this, "snkSwitchGuide", 7);
|
77
|
-
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
78
77
|
this._disabledButtons = undefined;
|
79
|
-
this._currentView = undefined;
|
80
78
|
this.attachmentRegisterKey = undefined;
|
81
79
|
this.formConfigManager = undefined;
|
82
80
|
this.dataUnitName = undefined;
|
83
|
-
this.resourceID = undefined;
|
84
81
|
this.guideItemPath = undefined;
|
85
82
|
this.entityName = undefined;
|
86
83
|
this.label = undefined;
|
@@ -89,8 +86,12 @@ const SnkDetailView = class {
|
|
89
86
|
this.dataState = undefined;
|
90
87
|
this.messagesBuilder = undefined;
|
91
88
|
this.branchGuide = undefined;
|
92
|
-
this.canEdit = true;
|
93
89
|
}
|
90
|
+
// /**
|
91
|
+
// * Define se a edição está habilitada na grid.
|
92
|
+
// */
|
93
|
+
// @Prop()
|
94
|
+
// canEdit: boolean = true;
|
94
95
|
observerDataState(newValue, oldValue) {
|
95
96
|
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
96
97
|
const closeInsertion = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && !(newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
@@ -203,8 +204,10 @@ const SnkDetailView = class {
|
|
203
204
|
updateViewStack(viewStack) {
|
204
205
|
var _a, _b;
|
205
206
|
this._viewStack = viewStack;
|
206
|
-
|
207
|
-
(_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.
|
207
|
+
// TODO: remove to gridEditor
|
208
|
+
(_b = (_a = this._viewStack) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a, this.selectedForm ? 1 : 0);
|
209
|
+
// this._currentView = this.selectedForm ? 1 : 0;
|
210
|
+
// this._viewStack?.show?.(this._currentView);
|
208
211
|
}
|
209
212
|
getFormFields() {
|
210
213
|
if (this.selectedForm && this._formMetadata) {
|
@@ -250,7 +253,7 @@ const SnkDetailView = class {
|
|
250
253
|
}
|
251
254
|
componentWillLoad() {
|
252
255
|
this._configName = `dynaform.${this.entityName}`;
|
253
|
-
this.formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this._configName,
|
256
|
+
this.formConfigManager = new SnkFormConfigManager.SnkFormConfigManager(this._configName, () => this.loadMetadata());
|
254
257
|
this.formConfigManager.loadConfig();
|
255
258
|
if (this.messagesBuilder == undefined) {
|
256
259
|
this.messagesBuilder = new SnkMessageBuilder.SnkMessageBuilder(this.entityName);
|
@@ -259,7 +262,11 @@ const SnkDetailView = class {
|
|
259
262
|
render() {
|
260
263
|
this.updateLabel();
|
261
264
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
262
|
-
return (index.h(index.Host, null, index.h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this),
|
265
|
+
return (index.h(index.Host, null, index.h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this),
|
266
|
+
// ignoreSaveMessage={this._currentView === VIEW_MODE.GRID}
|
267
|
+
messagesBuilder: this.messagesBuilder, configName: this._configName }, index.h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, index.h("stack-item", null, index.h("div", { class: "ez-box ez-box--shadow grid-container" }, index.h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, index.h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? index.h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), index.h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(constants.VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: index$1.PresentationMode.SECONDARY,
|
268
|
+
// canEdit={this.canEdit}
|
269
|
+
isDetail: true }))), index.h("stack-item", null, index.h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath }, index.h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: index$1.PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit }))), index.h("stack-item", null, index.h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
263
270
|
}
|
264
271
|
static get watchers() { return {
|
265
272
|
"dataState": ["observerDataState"]
|
@@ -11,6 +11,7 @@ const SnkEntityList = class {
|
|
11
11
|
constructor(hostRef) {
|
12
12
|
index.registerInstance(this, hostRef);
|
13
13
|
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
14
|
+
this.saveConfig = index.createEvent(this, "saveConfig", 7);
|
14
15
|
this._searchValue = undefined;
|
15
16
|
this._ezListSource = [];
|
16
17
|
this.config = undefined;
|
@@ -19,6 +20,7 @@ const SnkEntityList = class {
|
|
19
20
|
}
|
20
21
|
async reloadList() {
|
21
22
|
this.loadListSource();
|
23
|
+
this.saveConfig.emit(this.config);
|
22
24
|
}
|
23
25
|
observeConfig() {
|
24
26
|
var _a, _b;
|
@@ -34,6 +36,7 @@ const SnkEntityList = class {
|
|
34
36
|
}
|
35
37
|
});
|
36
38
|
this.config = core.ObjectUtils.copy(configCopy);
|
39
|
+
this.saveConfig.emit(this.config);
|
37
40
|
this.valueChanged.emit((_b = this.config) === null || _b === void 0 ? void 0 : _b.value);
|
38
41
|
}
|
39
42
|
loadListSource() {
|
@@ -90,6 +93,7 @@ const SnkEntityList = class {
|
|
90
93
|
}
|
91
94
|
] });
|
92
95
|
this.loadListSource();
|
96
|
+
this.saveConfig.emit(this.config);
|
93
97
|
this.valueChanged.emit((_d = this.config) === null || _d === void 0 ? void 0 : _d.value);
|
94
98
|
}
|
95
99
|
}
|