@sankhyalabs/sankhyablocks 1.4.0-beta.1 → 1.4.0-beta.10
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/{SnkMessageBuilder-7717f1e4.js → SnkMessageBuilder-6c2f7bcd.js} +107 -131
- package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
- package/dist/cjs/configurableElementsStorage-93459c72.js +20 -0
- package/dist/cjs/constants-9056ca9e.js +84 -0
- package/dist/cjs/draggable.bundle-82a25c06.js +6886 -0
- package/dist/cjs/{filter-item-type.enum-e2e1bc5b.js → filter-item-type.enum-3daf58d3.js} +2 -0
- package/dist/cjs/form-config-fetcher-2de7c16a.js +6895 -0
- package/dist/cjs/{index-b0b676c5.js → index-20e8b68a.js} +165 -1473
- package/dist/cjs/loader.cjs.js +2 -18
- package/dist/cjs/sankhyablocks.cjs.js +4 -116
- package/dist/cjs/snk-application.cjs.entry.js +330 -7196
- package/dist/cjs/snk-config-modal.cjs.entry.js +62 -0
- package/dist/cjs/snk-config-options.cjs.entry.js +230 -0
- package/dist/cjs/snk-configurator_6.cjs.entry.js +1156 -0
- package/dist/cjs/snk-crud.cjs.entry.js +21 -13
- package/dist/cjs/snk-data-unit.cjs.entry.js +24 -32
- package/dist/cjs/snk-field-config_2.cjs.entry.js +135 -0
- package/dist/cjs/snk-filter-binary-select.cjs.entry.js +5 -2
- package/dist/cjs/snk-filter-detail.cjs.entry.js +62 -5
- package/dist/cjs/snk-filter-multi-select.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-number.cjs.entry.js +6 -3
- package/dist/cjs/snk-filter-period.cjs.entry.js +5 -2
- package/dist/cjs/snk-filter-personalized.cjs.entry.js +89 -0
- package/dist/cjs/snk-filter-search.cjs.entry.js +7 -13
- package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
- package/dist/cjs/snk-form-config.cjs.entry.js +957 -0
- package/dist/cjs/snk-form.cjs.entry.js +41 -28
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-tab-config.cjs.entry.js +321 -0
- package/dist/cjs/{taskbar-elements-283c737e.js → taskbar-elements-9a4b1e19.js} +10 -6
- package/dist/cjs/teste-pesquisa.cjs.entry.js +5 -5
- package/dist/collection/collection-manifest.json +29 -1
- package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -1
- package/dist/collection/components/snk-application/snk-application.js +236 -37
- package/dist/collection/components/snk-configurator/snk-configurator.js +261 -0
- package/dist/collection/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.js +16 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.css +122 -0
- package/dist/collection/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.js +137 -0
- package/dist/collection/components/snk-crud/snk-crud.js +46 -17
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +1 -28
- package/dist/collection/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.js +100 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +24 -1
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +23 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.js +180 -0
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +22 -38
- package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-item/filter-item-type.enum.js +2 -0
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +80 -20
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +65 -31
- package/dist/collection/components/snk-filter-bar/filter-list/snk-filter-list.js +85 -19
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +222 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +39 -4
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +250 -141
- package/dist/collection/components/snk-form/snk-form.css +4 -0
- package/dist/collection/components/snk-form/snk-form.js +108 -30
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.css +9 -0
- package/dist/collection/components/snk-form/subcomponents/snk-config-options/snk-config-options.js +315 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.css +164 -0
- package/dist/collection/components/snk-form/subcomponents/snk-field-config/snk-field-config.js +140 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.css +185 -0
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +1062 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.css +272 -0
- package/dist/collection/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.js +476 -0
- package/dist/collection/components/snk-grid/snk-grid.js +94 -26
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +9 -5
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +35 -3
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +3 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +35 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +18 -10
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +106 -3
- package/dist/collection/lib/http/data-fetcher/fetchers/parameters-fecher.js +15 -15
- package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +9 -1
- package/dist/collection/lib/index.js +1 -0
- package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
- package/dist/collection/lib/message/resources/crud-utils.msg.js +4 -0
- package/dist/collection/lib/message/resources/snk-configurator.msg.js +11 -0
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +14 -2
- package/dist/collection/lib/message/resources/snk-form.msg.js +59 -2
- package/dist/collection/lib/message/resources/snk-taskbar.msg.js +1 -1
- package/dist/collection/lib/utils/CrudUtils.js +73 -0
- package/dist/collection/lib/utils/constants.js +72 -0
- package/dist/components/SnkMessageBuilder.js +108 -131
- package/dist/components/_commonjsHelpers.js +17 -0
- package/dist/components/constants.js +74 -0
- package/dist/components/filter-item-type.enum.js +2 -0
- package/dist/{sankhyablocks/snk-application.entry.js → components/form-config-fetcher.js} +88 -1347
- package/dist/components/index.d.ts +8 -0
- package/dist/components/index.js +8 -4
- package/dist/components/snk-application2.js +313 -7173
- package/dist/components/snk-config-modal.d.ts +11 -0
- package/dist/components/snk-config-modal.js +6 -0
- package/dist/components/snk-config-modal2.js +91 -0
- package/dist/components/snk-config-options.d.ts +11 -0
- package/dist/components/snk-config-options.js +6 -0
- package/dist/components/snk-config-options2.js +245 -0
- package/dist/components/snk-configurator.d.ts +11 -0
- package/dist/components/snk-configurator.js +6 -0
- package/dist/components/snk-configurator2.js +212 -0
- package/dist/components/snk-crud.js +76 -26
- package/dist/components/snk-data-unit.js +4 -13
- package/dist/components/snk-field-config.d.ts +11 -0
- package/dist/components/snk-field-config.js +6 -0
- package/dist/components/snk-field-config2.js +70 -0
- package/dist/components/snk-filter-bar2.js +354 -148
- package/dist/components/snk-filter-binary-select.js +5 -1
- package/dist/components/snk-filter-detail2.js +62 -5
- package/dist/components/snk-filter-item2.js +52 -33
- package/dist/components/snk-filter-list2.js +60 -22
- package/dist/components/snk-filter-modal.d.ts +11 -0
- package/dist/components/snk-filter-modal.js +6 -0
- package/dist/components/snk-filter-modal2.js +84 -0
- package/dist/components/snk-filter-multi-select.js +6 -2
- package/dist/components/snk-filter-number.js +6 -2
- package/dist/components/snk-filter-period.js +5 -1
- package/dist/components/snk-filter-personalized.d.ts +11 -0
- package/dist/components/snk-filter-personalized.js +108 -0
- package/dist/components/snk-filter-search.js +5 -12
- package/dist/components/snk-filter-text.js +1 -1
- package/dist/components/snk-form-config.d.ts +11 -0
- package/dist/components/snk-form-config.js +6 -0
- package/dist/components/snk-form-config2.js +996 -0
- package/dist/components/snk-form2.js +79 -29
- package/dist/components/snk-grid2.js +57 -32
- package/dist/components/snk-pesquisa2.js +1 -1
- package/dist/components/snk-tab-config.d.ts +11 -0
- package/dist/components/snk-tab-config.js +6 -0
- package/dist/components/snk-tab-config2.js +7220 -0
- package/dist/components/snk-taskbar2.js +28 -10
- package/dist/components/teste-pesquisa.js +1 -1
- package/dist/{sankhyablocks/SnkMessageBuilder-a7da466b.js → esm/SnkMessageBuilder-5792c260.js} +108 -131
- package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
- package/dist/esm/configurableElementsStorage-cdc144b5.js +18 -0
- package/dist/esm/constants-c6039d3d.js +74 -0
- package/dist/esm/draggable.bundle-41d56f06.js +6884 -0
- package/dist/esm/{filter-item-type.enum-61fbf80a.js → filter-item-type.enum-a79b2fa8.js} +2 -0
- package/dist/esm/form-config-fetcher-96c6c2dc.js +6889 -0
- package/dist/{sankhyablocks/index-2b4d2d14.js → esm/index-e4121713.js} +165 -1466
- package/dist/esm/loader.js +2 -18
- package/dist/esm/sankhyablocks.js +4 -116
- package/dist/esm/snk-application.entry.js +308 -7174
- package/dist/esm/snk-config-modal.entry.js +58 -0
- package/dist/esm/snk-config-options.entry.js +226 -0
- package/dist/esm/snk-configurator_6.entry.js +1147 -0
- package/dist/esm/snk-crud.entry.js +20 -12
- package/dist/esm/snk-data-unit.entry.js +5 -13
- package/dist/esm/snk-field-config_2.entry.js +130 -0
- package/dist/esm/snk-filter-binary-select.entry.js +5 -2
- package/dist/esm/snk-filter-detail.entry.js +62 -5
- package/dist/esm/snk-filter-multi-select.entry.js +6 -3
- package/dist/esm/snk-filter-number.entry.js +6 -3
- package/dist/esm/snk-filter-period.entry.js +5 -2
- package/dist/esm/snk-filter-personalized.entry.js +85 -0
- package/dist/esm/snk-filter-search.entry.js +6 -12
- package/dist/esm/snk-filter-text.entry.js +2 -2
- package/dist/esm/snk-form-config.entry.js +953 -0
- package/dist/esm/snk-form.entry.js +40 -27
- package/dist/esm/snk-pesquisa.entry.js +2 -2
- package/dist/esm/snk-tab-config.entry.js +317 -0
- package/dist/{sankhyablocks/taskbar-elements-35d64ff9.js → esm/taskbar-elements-e2ed0536.js} +10 -6
- package/dist/esm/teste-pesquisa.entry.js +2 -2
- package/dist/sankhyablocks/index.esm.js +0 -1
- package/dist/sankhyablocks/p-029ae4e4.entry.js +1 -0
- package/dist/sankhyablocks/p-03f9c407.js +1 -0
- package/dist/sankhyablocks/p-112455b1.js +1 -0
- package/dist/sankhyablocks/p-12ad2a19.entry.js +1 -0
- package/dist/sankhyablocks/p-1feabfc7.entry.js +1 -0
- package/dist/sankhyablocks/p-21c8929b.js +1 -0
- package/dist/sankhyablocks/p-2284c850.entry.js +1 -0
- package/dist/sankhyablocks/p-2b891c4a.entry.js +1 -0
- package/dist/sankhyablocks/p-2dc76d79.entry.js +1 -0
- package/dist/sankhyablocks/p-361299e8.js +26 -0
- package/dist/sankhyablocks/p-3a276f3d.entry.js +1 -0
- package/dist/sankhyablocks/p-400cc777.entry.js +1 -0
- package/dist/sankhyablocks/p-44ce5b90.entry.js +1 -0
- package/dist/sankhyablocks/p-521c96f0.entry.js +1 -0
- package/dist/sankhyablocks/p-6988f4a6.entry.js +1 -0
- package/dist/sankhyablocks/p-776ff4d1.entry.js +1 -0
- package/dist/sankhyablocks/p-7b4a4a50.entry.js +1 -0
- package/dist/sankhyablocks/p-9ba3df4c.js +2 -0
- package/dist/sankhyablocks/p-9dc4426d.entry.js +1 -0
- package/dist/sankhyablocks/p-9dd2b8cb.js +1 -0
- package/dist/sankhyablocks/p-a17a4fca.entry.js +1 -0
- package/dist/sankhyablocks/p-a5b26df2.js +1 -0
- package/dist/sankhyablocks/p-b6d6b172.js +1 -0
- package/dist/sankhyablocks/p-cc4bef9f.entry.js +1 -0
- package/dist/sankhyablocks/p-d50651a3.js +1 -0
- package/dist/sankhyablocks/p-d690b6b5.entry.js +75 -0
- package/dist/sankhyablocks/p-d9fbb26f.js +1 -0
- package/dist/sankhyablocks/p-deb1f523.entry.js +1 -0
- package/dist/sankhyablocks/p-e871aa92.entry.js +1 -0
- package/dist/sankhyablocks/p-e9beab79.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -129
- package/dist/types/components/snk-application/snk-application.d.ts +38 -16
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +46 -0
- package/dist/types/components/snk-configurator/subcomponents/configModalProvider/configurableElementsStorage.d.ts +8 -0
- package/dist/types/components/snk-configurator/subcomponents/snk-config-modal/snk-config-modal.d.ts +38 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +50 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +92 -0
- package/dist/types/components/snk-filter-bar/filter-item/dataunitfilter/data-unit-filter-builder.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-binary-select.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-multi-select.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +2 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-personalized.d.ts +24 -0
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +4 -5
- package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-text.d.ts +1 -0
- package/dist/types/components/snk-filter-bar/filter-item/filter-item-type.enum.d.ts +3 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +7 -1
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +40 -0
- package/dist/types/components/snk-filter-bar/filter-list/snk-filter-list.d.ts +8 -3
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +26 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +31 -17
- package/dist/types/components/snk-form/snk-form.d.ts +71 -0
- package/dist/types/components/snk-form/subcomponents/snk-config-options/snk-config-options.d.ts +51 -0
- package/dist/types/components/snk-form/subcomponents/snk-field-config/snk-field-config.d.ts +32 -0
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +139 -0
- package/dist/types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config.d.ts +97 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +59 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +6 -5
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -3
- package/dist/types/components.d.ts +424 -24
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +21 -3
- package/dist/types/lib/http/data-fetcher/fetchers/parameters-fecher.d.ts +7 -7
- package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
- package/dist/types/lib/index.d.ts +1 -0
- package/dist/types/lib/message/resources/crud-utils.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-configurator.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/snk-form.msg.d.ts +5 -2
- package/dist/types/lib/utils/CrudUtils.d.ts +6 -0
- package/dist/types/lib/utils/constants.d.ts +76 -0
- package/dist/types/lib/utils/pesquisa.d.ts +2 -1
- package/package.json +4 -3
- package/react/components.d.ts +25 -0
- package/react/components.js +25 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -5
- package/dist/cjs/css-shim-b8158822.js +0 -6
- package/dist/cjs/dom-36862b77.js +0 -75
- package/dist/cjs/index-02201bc9.js +0 -2397
- package/dist/cjs/shadow-css-346c0795.js +0 -389
- package/dist/cjs/snk-filter-bar.cjs.entry.js +0 -278
- package/dist/cjs/snk-filter-item.cjs.entry.js +0 -154
- package/dist/cjs/snk-filter-list.cjs.entry.js +0 -91
- package/dist/cjs/snk-grid.cjs.entry.js +0 -79
- package/dist/cjs/snk-taskbar.cjs.entry.js +0 -160
- package/dist/components/index2.js +0 -2384
- package/dist/esm/SnkMessageBuilder-a7da466b.js +0 -303
- package/dist/esm/app-globals-0f993ce5.js +0 -3
- package/dist/esm/css-shim-b3f2ee8d.js +0 -4
- package/dist/esm/dom-665d6011.js +0 -73
- package/dist/esm/index-2b4d2d14.js +0 -3262
- package/dist/esm/index-f1d3e4da.js +0 -2384
- package/dist/esm/shadow-css-b18e99d7.js +0 -387
- package/dist/esm/snk-filter-bar.entry.js +0 -274
- package/dist/esm/snk-filter-item.entry.js +0 -150
- package/dist/esm/snk-filter-list.entry.js +0 -87
- package/dist/esm/snk-grid.entry.js +0 -75
- package/dist/esm/snk-taskbar.entry.js +0 -156
- package/dist/esm/taskbar-elements-35d64ff9.js +0 -90
- package/dist/sankhyablocks/app-globals-0f993ce5.js +0 -3
- package/dist/sankhyablocks/css-shim-b3f2ee8d.js +0 -4
- package/dist/sankhyablocks/dom-665d6011.js +0 -73
- package/dist/sankhyablocks/filter-item-type.enum-61fbf80a.js +0 -12
- package/dist/sankhyablocks/index-f1d3e4da.js +0 -2384
- package/dist/sankhyablocks/shadow-css-b18e99d7.js +0 -387
- package/dist/sankhyablocks/snk-crud.entry.js +0 -66
- package/dist/sankhyablocks/snk-data-unit.entry.js +0 -276
- package/dist/sankhyablocks/snk-filter-bar.entry.js +0 -274
- package/dist/sankhyablocks/snk-filter-binary-select.entry.js +0 -43
- package/dist/sankhyablocks/snk-filter-detail.entry.js +0 -45
- package/dist/sankhyablocks/snk-filter-item.entry.js +0 -150
- package/dist/sankhyablocks/snk-filter-list.entry.js +0 -87
- package/dist/sankhyablocks/snk-filter-multi-select.entry.js +0 -19
- package/dist/sankhyablocks/snk-filter-number.entry.js +0 -20
- package/dist/sankhyablocks/snk-filter-period.entry.js +0 -33
- package/dist/sankhyablocks/snk-filter-search.entry.js +0 -40
- package/dist/sankhyablocks/snk-filter-text.entry.js +0 -18
- package/dist/sankhyablocks/snk-form.entry.js +0 -129
- package/dist/sankhyablocks/snk-grid.entry.js +0 -75
- package/dist/sankhyablocks/snk-pesquisa.entry.js +0 -311
- package/dist/sankhyablocks/snk-taskbar.entry.js +0 -156
- package/dist/sankhyablocks/taskbar-processor-aa6772c9.js +0 -45
- package/dist/sankhyablocks/teste-pesquisa.entry.js +0 -33
|
@@ -1,49 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { A as ApplicationUtils, S as SnkMessageBuilder } from './SnkMessageBuilder-a7da466b.js';
|
|
4
|
-
|
|
5
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
6
|
-
|
|
7
|
-
function getDefaultExportFromCjs (x) {
|
|
8
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function createCommonjsModule(fn, basedir, module) {
|
|
12
|
-
return module = {
|
|
13
|
-
path: basedir,
|
|
14
|
-
exports: {},
|
|
15
|
-
require: function (path, base) {
|
|
16
|
-
return commonjsRequire(path, (base === undefined || base === null) ? module.path : base);
|
|
17
|
-
}
|
|
18
|
-
}, fn(module, module.exports), module.exports;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
22
|
-
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
26
|
-
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function getAugmentedNamespace(n) {
|
|
30
|
-
if (n.__esModule) return n;
|
|
31
|
-
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
32
|
-
Object.keys(n).forEach(function (k) {
|
|
33
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
34
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function () {
|
|
37
|
-
return n[k];
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
return a;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function commonjsRequire () {
|
|
45
|
-
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
46
|
-
}
|
|
1
|
+
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
|
|
2
|
+
import { ErrorException, WarningException, StringUtils, ObjectUtils } from '@sankhyalabs/core';
|
|
47
3
|
|
|
48
4
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
|
49
5
|
var global = typeof self !== 'undefined' ? self : commonjsGlobal;
|
|
@@ -57,7 +13,7 @@ return new F();
|
|
|
57
13
|
})();
|
|
58
14
|
(function(self) {
|
|
59
15
|
|
|
60
|
-
|
|
16
|
+
((function (exports) {
|
|
61
17
|
|
|
62
18
|
var support = {
|
|
63
19
|
searchParams: 'URLSearchParams' in self,
|
|
@@ -585,7 +541,7 @@ var irrelevant = (function (exports) {
|
|
|
585
541
|
|
|
586
542
|
return exports;
|
|
587
543
|
|
|
588
|
-
})({});
|
|
544
|
+
}))({});
|
|
589
545
|
})(__self__);
|
|
590
546
|
__self__.fetch.ponyfill = true;
|
|
591
547
|
// Remove "polyfill" property added by whatwg-fetch
|
|
@@ -602,10 +558,7 @@ exports.Response = ctx.Response;
|
|
|
602
558
|
module.exports = exports;
|
|
603
559
|
});
|
|
604
560
|
|
|
605
|
-
const browserPonyfill$1 = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill);
|
|
606
|
-
|
|
607
561
|
var isObjectLike_1 = createCommonjsModule(function (module, exports) {
|
|
608
|
-
'use strict';
|
|
609
562
|
|
|
610
563
|
Object.defineProperty(exports, '__esModule', {
|
|
611
564
|
value: true,
|
|
@@ -621,10 +574,7 @@ function isObjectLike(value) {
|
|
|
621
574
|
}
|
|
622
575
|
});
|
|
623
576
|
|
|
624
|
-
const isObjectLike = /*@__PURE__*/getDefaultExportFromCjs(isObjectLike_1);
|
|
625
|
-
|
|
626
577
|
var invariant_1 = createCommonjsModule(function (module, exports) {
|
|
627
|
-
'use strict';
|
|
628
578
|
|
|
629
579
|
Object.defineProperty(exports, '__esModule', {
|
|
630
580
|
value: true,
|
|
@@ -642,10 +592,7 @@ function invariant(condition, message) {
|
|
|
642
592
|
}
|
|
643
593
|
});
|
|
644
594
|
|
|
645
|
-
const invariant = /*@__PURE__*/getDefaultExportFromCjs(invariant_1);
|
|
646
|
-
|
|
647
595
|
var location_1 = createCommonjsModule(function (module, exports) {
|
|
648
|
-
'use strict';
|
|
649
596
|
|
|
650
597
|
Object.defineProperty(exports, '__esModule', {
|
|
651
598
|
value: true,
|
|
@@ -685,10 +632,7 @@ function getLocation(source, position) {
|
|
|
685
632
|
}
|
|
686
633
|
});
|
|
687
634
|
|
|
688
|
-
const location$1 = /*@__PURE__*/getDefaultExportFromCjs(location_1);
|
|
689
|
-
|
|
690
635
|
var printLocation_1 = createCommonjsModule(function (module, exports) {
|
|
691
|
-
'use strict';
|
|
692
636
|
|
|
693
637
|
Object.defineProperty(exports, '__esModule', {
|
|
694
638
|
value: true,
|
|
@@ -764,10 +708,7 @@ function printPrefixedLines(lines) {
|
|
|
764
708
|
}
|
|
765
709
|
});
|
|
766
710
|
|
|
767
|
-
const printLocation = /*@__PURE__*/getDefaultExportFromCjs(printLocation_1);
|
|
768
|
-
|
|
769
711
|
var GraphQLError_1 = createCommonjsModule(function (module, exports) {
|
|
770
|
-
'use strict';
|
|
771
712
|
|
|
772
713
|
Object.defineProperty(exports, '__esModule', {
|
|
773
714
|
value: true,
|
|
@@ -1036,10 +977,7 @@ function formatError(error) {
|
|
|
1036
977
|
}
|
|
1037
978
|
});
|
|
1038
979
|
|
|
1039
|
-
const GraphQLError = /*@__PURE__*/getDefaultExportFromCjs(GraphQLError_1);
|
|
1040
|
-
|
|
1041
980
|
var syntaxError_1 = createCommonjsModule(function (module, exports) {
|
|
1042
|
-
'use strict';
|
|
1043
981
|
|
|
1044
982
|
Object.defineProperty(exports, '__esModule', {
|
|
1045
983
|
value: true,
|
|
@@ -1060,10 +998,7 @@ function syntaxError(source, position, description) {
|
|
|
1060
998
|
}
|
|
1061
999
|
});
|
|
1062
1000
|
|
|
1063
|
-
const syntaxError = /*@__PURE__*/getDefaultExportFromCjs(syntaxError_1);
|
|
1064
|
-
|
|
1065
1001
|
var ast = createCommonjsModule(function (module, exports) {
|
|
1066
|
-
'use strict';
|
|
1067
1002
|
|
|
1068
1003
|
Object.defineProperty(exports, '__esModule', {
|
|
1069
1004
|
value: true,
|
|
@@ -1289,10 +1224,7 @@ exports.OperationTypeNode = OperationTypeNode;
|
|
|
1289
1224
|
})(OperationTypeNode || (exports.OperationTypeNode = OperationTypeNode = {}));
|
|
1290
1225
|
});
|
|
1291
1226
|
|
|
1292
|
-
const ast$1 = /*@__PURE__*/getDefaultExportFromCjs(ast);
|
|
1293
|
-
|
|
1294
1227
|
var directiveLocation = createCommonjsModule(function (module, exports) {
|
|
1295
|
-
'use strict';
|
|
1296
1228
|
|
|
1297
1229
|
Object.defineProperty(exports, '__esModule', {
|
|
1298
1230
|
value: true,
|
|
@@ -1333,10 +1265,7 @@ exports.DirectiveLocation = DirectiveLocation;
|
|
|
1333
1265
|
*/
|
|
1334
1266
|
});
|
|
1335
1267
|
|
|
1336
|
-
const directiveLocation$1 = /*@__PURE__*/getDefaultExportFromCjs(directiveLocation);
|
|
1337
|
-
|
|
1338
1268
|
var kinds = createCommonjsModule(function (module, exports) {
|
|
1339
|
-
'use strict';
|
|
1340
1269
|
|
|
1341
1270
|
Object.defineProperty(exports, '__esModule', {
|
|
1342
1271
|
value: true,
|
|
@@ -1401,10 +1330,7 @@ exports.Kind = Kind;
|
|
|
1401
1330
|
*/
|
|
1402
1331
|
});
|
|
1403
1332
|
|
|
1404
|
-
const kinds$1 = /*@__PURE__*/getDefaultExportFromCjs(kinds);
|
|
1405
|
-
|
|
1406
1333
|
var characterClasses = createCommonjsModule(function (module, exports) {
|
|
1407
|
-
'use strict';
|
|
1408
1334
|
|
|
1409
1335
|
Object.defineProperty(exports, '__esModule', {
|
|
1410
1336
|
value: true,
|
|
@@ -1481,10 +1407,7 @@ function isNameContinue(code) {
|
|
|
1481
1407
|
}
|
|
1482
1408
|
});
|
|
1483
1409
|
|
|
1484
|
-
const characterClasses$1 = /*@__PURE__*/getDefaultExportFromCjs(characterClasses);
|
|
1485
|
-
|
|
1486
1410
|
var blockString = createCommonjsModule(function (module, exports) {
|
|
1487
|
-
'use strict';
|
|
1488
1411
|
|
|
1489
1412
|
Object.defineProperty(exports, '__esModule', {
|
|
1490
1413
|
value: true,
|
|
@@ -1681,10 +1604,7 @@ function printBlockString(value, options) {
|
|
|
1681
1604
|
}
|
|
1682
1605
|
});
|
|
1683
1606
|
|
|
1684
|
-
const blockString$1 = /*@__PURE__*/getDefaultExportFromCjs(blockString);
|
|
1685
|
-
|
|
1686
1607
|
var tokenKind = createCommonjsModule(function (module, exports) {
|
|
1687
|
-
'use strict';
|
|
1688
1608
|
|
|
1689
1609
|
Object.defineProperty(exports, '__esModule', {
|
|
1690
1610
|
value: true,
|
|
@@ -1729,10 +1649,7 @@ exports.TokenKind = TokenKind;
|
|
|
1729
1649
|
*/
|
|
1730
1650
|
});
|
|
1731
1651
|
|
|
1732
|
-
const tokenKind$1 = /*@__PURE__*/getDefaultExportFromCjs(tokenKind);
|
|
1733
|
-
|
|
1734
1652
|
var lexer = createCommonjsModule(function (module, exports) {
|
|
1735
|
-
'use strict';
|
|
1736
1653
|
|
|
1737
1654
|
Object.defineProperty(exports, '__esModule', {
|
|
1738
1655
|
value: true,
|
|
@@ -2740,10 +2657,7 @@ function readName(lexer, start) {
|
|
|
2740
2657
|
}
|
|
2741
2658
|
});
|
|
2742
2659
|
|
|
2743
|
-
const lexer$1 = /*@__PURE__*/getDefaultExportFromCjs(lexer);
|
|
2744
|
-
|
|
2745
2660
|
var devAssert_1 = createCommonjsModule(function (module, exports) {
|
|
2746
|
-
'use strict';
|
|
2747
2661
|
|
|
2748
2662
|
Object.defineProperty(exports, '__esModule', {
|
|
2749
2663
|
value: true,
|
|
@@ -2759,10 +2673,7 @@ function devAssert(condition, message) {
|
|
|
2759
2673
|
}
|
|
2760
2674
|
});
|
|
2761
2675
|
|
|
2762
|
-
const devAssert = /*@__PURE__*/getDefaultExportFromCjs(devAssert_1);
|
|
2763
|
-
|
|
2764
2676
|
var inspect_1 = createCommonjsModule(function (module, exports) {
|
|
2765
|
-
'use strict';
|
|
2766
2677
|
|
|
2767
2678
|
Object.defineProperty(exports, '__esModule', {
|
|
2768
2679
|
value: true,
|
|
@@ -2885,10 +2796,7 @@ function getObjectTag(object) {
|
|
|
2885
2796
|
}
|
|
2886
2797
|
});
|
|
2887
2798
|
|
|
2888
|
-
const inspect = /*@__PURE__*/getDefaultExportFromCjs(inspect_1);
|
|
2889
|
-
|
|
2890
2799
|
var instanceOf_1 = createCommonjsModule(function (module, exports) {
|
|
2891
|
-
'use strict';
|
|
2892
2800
|
|
|
2893
2801
|
Object.defineProperty(exports, '__esModule', {
|
|
2894
2802
|
value: true,
|
|
@@ -2907,54 +2815,14 @@ const instanceOf =
|
|
|
2907
2815
|
/* c8 ignore next 6 */
|
|
2908
2816
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
2909
2817
|
// eslint-disable-next-line no-undef
|
|
2910
|
-
|
|
2911
|
-
? function instanceOf(value, constructor) {
|
|
2818
|
+
function instanceOf(value, constructor) {
|
|
2912
2819
|
return value instanceof constructor;
|
|
2913
2820
|
}
|
|
2914
|
-
|
|
2915
|
-
if (value instanceof constructor) {
|
|
2916
|
-
return true;
|
|
2917
|
-
}
|
|
2918
|
-
|
|
2919
|
-
if (typeof value === 'object' && value !== null) {
|
|
2920
|
-
var _value$constructor;
|
|
2921
|
-
|
|
2922
|
-
// Prefer Symbol.toStringTag since it is immune to minification.
|
|
2923
|
-
const className = constructor.prototype[Symbol.toStringTag];
|
|
2924
|
-
const valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
2925
|
-
Symbol.toStringTag in value // @ts-expect-error TS bug see, https://github.com/microsoft/TypeScript/issues/38009
|
|
2926
|
-
? value[Symbol.toStringTag]
|
|
2927
|
-
: (_value$constructor = value.constructor) === null ||
|
|
2928
|
-
_value$constructor === void 0
|
|
2929
|
-
? void 0
|
|
2930
|
-
: _value$constructor.name;
|
|
2931
|
-
|
|
2932
|
-
if (className === valueClassName) {
|
|
2933
|
-
const stringifiedValue = (0, inspect_1.inspect)(value);
|
|
2934
|
-
throw new Error(`Cannot use ${className} "${stringifiedValue}" from another module or realm.
|
|
2935
|
-
|
|
2936
|
-
Ensure that there is only one instance of "graphql" in the node_modules
|
|
2937
|
-
directory. If different versions of "graphql" are the dependencies of other
|
|
2938
|
-
relied on modules, use "resolutions" to ensure only one version is installed.
|
|
2939
|
-
|
|
2940
|
-
https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
2941
|
-
|
|
2942
|
-
Duplicate "graphql" modules cannot be used at the same time since different
|
|
2943
|
-
versions may have different capabilities and behavior. The data from one
|
|
2944
|
-
version used in the function from another could produce confusing and
|
|
2945
|
-
spurious results.`);
|
|
2946
|
-
}
|
|
2947
|
-
}
|
|
2948
|
-
|
|
2949
|
-
return false;
|
|
2950
|
-
};
|
|
2821
|
+
;
|
|
2951
2822
|
exports.instanceOf = instanceOf;
|
|
2952
2823
|
});
|
|
2953
2824
|
|
|
2954
|
-
const instanceOf = /*@__PURE__*/getDefaultExportFromCjs(instanceOf_1);
|
|
2955
|
-
|
|
2956
2825
|
var source = createCommonjsModule(function (module, exports) {
|
|
2957
|
-
'use strict';
|
|
2958
2826
|
|
|
2959
2827
|
Object.defineProperty(exports, '__esModule', {
|
|
2960
2828
|
value: true,
|
|
@@ -3021,10 +2889,7 @@ function isSource(source) {
|
|
|
3021
2889
|
}
|
|
3022
2890
|
});
|
|
3023
2891
|
|
|
3024
|
-
const source$1 = /*@__PURE__*/getDefaultExportFromCjs(source);
|
|
3025
|
-
|
|
3026
2892
|
var parser = createCommonjsModule(function (module, exports) {
|
|
3027
|
-
'use strict';
|
|
3028
2893
|
|
|
3029
2894
|
Object.defineProperty(exports, '__esModule', {
|
|
3030
2895
|
value: true,
|
|
@@ -4593,10 +4458,7 @@ function getTokenKindDesc(kind) {
|
|
|
4593
4458
|
}
|
|
4594
4459
|
});
|
|
4595
4460
|
|
|
4596
|
-
const parser$1 = /*@__PURE__*/getDefaultExportFromCjs(parser);
|
|
4597
|
-
|
|
4598
4461
|
var printString_1 = createCommonjsModule(function (module, exports) {
|
|
4599
|
-
'use strict';
|
|
4600
4462
|
|
|
4601
4463
|
Object.defineProperty(exports, '__esModule', {
|
|
4602
4464
|
value: true,
|
|
@@ -4781,10 +4643,7 @@ const escapeSequences = [
|
|
|
4781
4643
|
];
|
|
4782
4644
|
});
|
|
4783
4645
|
|
|
4784
|
-
const printString = /*@__PURE__*/getDefaultExportFromCjs(printString_1);
|
|
4785
|
-
|
|
4786
4646
|
var visitor = createCommonjsModule(function (module, exports) {
|
|
4787
|
-
'use strict';
|
|
4788
4647
|
|
|
4789
4648
|
Object.defineProperty(exports, '__esModule', {
|
|
4790
4649
|
value: true,
|
|
@@ -5163,10 +5022,7 @@ function getVisitFn(visitor, kind, isLeaving) {
|
|
|
5163
5022
|
}
|
|
5164
5023
|
});
|
|
5165
5024
|
|
|
5166
|
-
const visitor$1 = /*@__PURE__*/getDefaultExportFromCjs(visitor);
|
|
5167
|
-
|
|
5168
5025
|
var printer = createCommonjsModule(function (module, exports) {
|
|
5169
|
-
'use strict';
|
|
5170
5026
|
|
|
5171
5027
|
Object.defineProperty(exports, '__esModule', {
|
|
5172
5028
|
value: true,
|
|
@@ -5519,10 +5375,6 @@ function hasMultilineItems(maybeArray) {
|
|
|
5519
5375
|
}
|
|
5520
5376
|
});
|
|
5521
5377
|
|
|
5522
|
-
const printer$1 = /*@__PURE__*/getDefaultExportFromCjs(printer);
|
|
5523
|
-
|
|
5524
|
-
'use strict';
|
|
5525
|
-
|
|
5526
5378
|
var ReactNativeFile$1 = function ReactNativeFile(_ref) {
|
|
5527
5379
|
var uri = _ref.uri,
|
|
5528
5380
|
name = _ref.name,
|
|
@@ -5532,10 +5384,6 @@ var ReactNativeFile$1 = function ReactNativeFile(_ref) {
|
|
|
5532
5384
|
this.type = type;
|
|
5533
5385
|
};
|
|
5534
5386
|
|
|
5535
|
-
'use strict';
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
5387
|
var isExtractableFile$1 = function isExtractableFile(value) {
|
|
5540
5388
|
return (
|
|
5541
5389
|
(typeof File !== 'undefined' && value instanceof File) ||
|
|
@@ -5544,10 +5392,6 @@ var isExtractableFile$1 = function isExtractableFile(value) {
|
|
|
5544
5392
|
);
|
|
5545
5393
|
};
|
|
5546
5394
|
|
|
5547
|
-
'use strict';
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
5395
|
var extractFiles$1 = function extractFiles(value, path, isExtractableFile) {
|
|
5552
5396
|
if (path === void 0) {
|
|
5553
5397
|
path = '';
|
|
@@ -5599,8 +5443,6 @@ var extractFiles$1 = function extractFiles(value, path, isExtractableFile) {
|
|
|
5599
5443
|
};
|
|
5600
5444
|
};
|
|
5601
5445
|
|
|
5602
|
-
'use strict';
|
|
5603
|
-
|
|
5604
5446
|
var ReactNativeFile = ReactNativeFile$1;
|
|
5605
5447
|
var extractFiles = extractFiles$1;
|
|
5606
5448
|
var isExtractableFile = isExtractableFile$1;
|
|
@@ -5615,7 +5457,6 @@ var _public = {
|
|
|
5615
5457
|
var browser = typeof self == 'object' ? self.FormData : window.FormData;
|
|
5616
5458
|
|
|
5617
5459
|
var defaultJsonSerializer = createCommonjsModule(function (module, exports) {
|
|
5618
|
-
"use strict";
|
|
5619
5460
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5620
5461
|
exports.defaultJsonSerializer = void 0;
|
|
5621
5462
|
exports.defaultJsonSerializer = {
|
|
@@ -5625,10 +5466,7 @@ exports.defaultJsonSerializer = {
|
|
|
5625
5466
|
//# sourceMappingURL=defaultJsonSerializer.js.map
|
|
5626
5467
|
});
|
|
5627
5468
|
|
|
5628
|
-
const defaultJsonSerializer$1 = /*@__PURE__*/getDefaultExportFromCjs(defaultJsonSerializer);
|
|
5629
|
-
|
|
5630
5469
|
var createRequestBody_1 = createCommonjsModule(function (module, exports) {
|
|
5631
|
-
"use strict";
|
|
5632
5470
|
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
5633
5471
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5634
5472
|
};
|
|
@@ -5685,10 +5523,7 @@ exports.default = createRequestBody;
|
|
|
5685
5523
|
//# sourceMappingURL=createRequestBody.js.map
|
|
5686
5524
|
});
|
|
5687
5525
|
|
|
5688
|
-
const createRequestBody = /*@__PURE__*/getDefaultExportFromCjs(createRequestBody_1);
|
|
5689
|
-
|
|
5690
5526
|
var parseArgs = createCommonjsModule(function (module, exports) {
|
|
5691
|
-
"use strict";
|
|
5692
5527
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5693
5528
|
exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
|
|
5694
5529
|
function parseRequestArgs(documentOrOptions, variables, requestHeaders) {
|
|
@@ -5761,10 +5596,7 @@ exports.parseBatchRequestsExtendedArgs = parseBatchRequestsExtendedArgs;
|
|
|
5761
5596
|
//# sourceMappingURL=parseArgs.js.map
|
|
5762
5597
|
});
|
|
5763
5598
|
|
|
5764
|
-
const parseArgs$1 = /*@__PURE__*/getDefaultExportFromCjs(parseArgs);
|
|
5765
|
-
|
|
5766
5599
|
var types = createCommonjsModule(function (module, exports) {
|
|
5767
|
-
"use strict";
|
|
5768
5600
|
var __extends = (commonjsGlobal && commonjsGlobal.__extends) || (function () {
|
|
5769
5601
|
var extendStatics = function (d, b) {
|
|
5770
5602
|
extendStatics = Object.setPrototypeOf ||
|
|
@@ -5814,10 +5646,7 @@ exports.ClientError = ClientError;
|
|
|
5814
5646
|
//# sourceMappingURL=types.js.map
|
|
5815
5647
|
});
|
|
5816
5648
|
|
|
5817
|
-
const types$1 = /*@__PURE__*/getDefaultExportFromCjs(types);
|
|
5818
|
-
|
|
5819
5649
|
var graphqlWs = createCommonjsModule(function (module, exports) {
|
|
5820
|
-
"use strict";
|
|
5821
5650
|
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
5822
5651
|
__assign = Object.assign || function(t) {
|
|
5823
5652
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -5997,8 +5826,6 @@ var GraphQLWebSocketClient = /** @class */ (function () {
|
|
|
5997
5826
|
if (message.payload.errors) {
|
|
5998
5827
|
subscriber.error && subscriber.error(new types.ClientError(__assign(__assign({}, message.payload), { status: 200 }), { query: query, variables: variables }));
|
|
5999
5828
|
}
|
|
6000
|
-
else {
|
|
6001
|
-
}
|
|
6002
5829
|
return;
|
|
6003
5830
|
}
|
|
6004
5831
|
case ERROR: {
|
|
@@ -6093,10 +5920,7 @@ function Complete(id) {
|
|
|
6093
5920
|
//# sourceMappingURL=graphql-ws.js.map
|
|
6094
5921
|
});
|
|
6095
5922
|
|
|
6096
|
-
const graphqlWs$1 = /*@__PURE__*/getDefaultExportFromCjs(graphqlWs);
|
|
6097
|
-
|
|
6098
5923
|
var dist = createCommonjsModule(function (module, exports) {
|
|
6099
|
-
"use strict";
|
|
6100
5924
|
var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
|
|
6101
5925
|
__assign = Object.assign || function(t) {
|
|
6102
5926
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -6421,7 +6245,7 @@ exports.GraphQLClient = GraphQLClient;
|
|
|
6421
6245
|
function makeRequest(_a) {
|
|
6422
6246
|
var url = _a.url, query = _a.query, variables = _a.variables, headers = _a.headers, operationName = _a.operationName, fetch = _a.fetch, _b = _a.method, method = _b === void 0 ? 'POST' : _b, fetchOptions = _a.fetchOptions;
|
|
6423
6247
|
return __awaiter(this, void 0, void 0, function () {
|
|
6424
|
-
var fetcher, isBathchingQuery, response, result, successfullyReceivedData, successfullyPassedErrorPolicy, headers_1, status_1,
|
|
6248
|
+
var fetcher, isBathchingQuery, response, result, successfullyReceivedData, successfullyPassedErrorPolicy, headers_1, status_1, rest, data, errorResult;
|
|
6425
6249
|
return __generator(this, function (_c) {
|
|
6426
6250
|
switch (_c.label) {
|
|
6427
6251
|
case 0:
|
|
@@ -6448,7 +6272,7 @@ function makeRequest(_a) {
|
|
|
6448
6272
|
successfullyPassedErrorPolicy = !result.errors || fetchOptions.errorPolicy === 'all' || fetchOptions.errorPolicy === 'ignore';
|
|
6449
6273
|
if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {
|
|
6450
6274
|
headers_1 = response.headers, status_1 = response.status;
|
|
6451
|
-
|
|
6275
|
+
rest = __rest(result, ["errors"]);
|
|
6452
6276
|
data = fetchOptions.errorPolicy === 'ignore' ? rest : result;
|
|
6453
6277
|
return [2 /*return*/, __assign(__assign({}, (isBathchingQuery ? { data: data } : data)), { headers: headers_1, status: status_1 })];
|
|
6454
6278
|
}
|
|
@@ -6456,7 +6280,6 @@ function makeRequest(_a) {
|
|
|
6456
6280
|
errorResult = typeof result === 'string' ? { error: result } : result;
|
|
6457
6281
|
throw new types.ClientError(__assign(__assign({}, errorResult), { status: response.status, headers: response.headers }), { query: query, variables: variables });
|
|
6458
6282
|
}
|
|
6459
|
-
return [2 /*return*/];
|
|
6460
6283
|
}
|
|
6461
6284
|
});
|
|
6462
6285
|
});
|
|
@@ -6586,8 +6409,6 @@ Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get
|
|
|
6586
6409
|
//# sourceMappingURL=index.js.map
|
|
6587
6410
|
});
|
|
6588
6411
|
|
|
6589
|
-
const index = /*@__PURE__*/getDefaultExportFromCjs(dist);
|
|
6590
|
-
|
|
6591
6412
|
class UrlUtils {
|
|
6592
6413
|
static getQueryParams(queryString) {
|
|
6593
6414
|
const params = new Map();
|
|
@@ -6695,14 +6516,14 @@ class DataFetcher {
|
|
|
6695
6516
|
return UrlUtils.getUrlBase();
|
|
6696
6517
|
}
|
|
6697
6518
|
getContext(module) {
|
|
6519
|
+
var _a;
|
|
6698
6520
|
const urlParams = UrlUtils.getQueryParams(location.search);
|
|
6699
6521
|
return {
|
|
6700
6522
|
baseUrl: `${this.resolveURL()}/${module}/service.sbr`,
|
|
6701
6523
|
appName: "SankhyaBlocks",
|
|
6702
|
-
mgeSession: `${window['skw_session'] || urlParams.mgeSession}`,
|
|
6524
|
+
mgeSession: `${window['skw_session'] || urlParams.get("mgeSession")}`,
|
|
6703
6525
|
globalID: "85C0093DFA240EAB699B4E47A10215BD",
|
|
6704
|
-
|
|
6705
|
-
resourceID: "br.com.sankhya.mov.bancaria"
|
|
6526
|
+
resourceID: (window["resourceID"] || ((_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID))
|
|
6706
6527
|
};
|
|
6707
6528
|
}
|
|
6708
6529
|
async callServiceBroker(serviceName, payload) {
|
|
@@ -6871,308 +6692,6 @@ class WaitingRequest {
|
|
|
6871
6692
|
}
|
|
6872
6693
|
}
|
|
6873
6694
|
|
|
6874
|
-
class DataUnitFetcher {
|
|
6875
|
-
constructor() {
|
|
6876
|
-
this.templateByQuery = new Map();
|
|
6877
|
-
this._loadDataTimeout = {};
|
|
6878
|
-
this.buldTemplates();
|
|
6879
|
-
}
|
|
6880
|
-
buldTemplates() {
|
|
6881
|
-
this.templateByQuery.set("fetchDataUnit", dist.gql `query($name: String!) {
|
|
6882
|
-
$queryAlias$: fetchDataUnit(name: $name){
|
|
6883
|
-
name
|
|
6884
|
-
fields{
|
|
6885
|
-
name
|
|
6886
|
-
defaultValue
|
|
6887
|
-
label
|
|
6888
|
-
visible
|
|
6889
|
-
readOnly
|
|
6890
|
-
required
|
|
6891
|
-
dataType
|
|
6892
|
-
userInterface
|
|
6893
|
-
calculated
|
|
6894
|
-
properties{
|
|
6895
|
-
name
|
|
6896
|
-
value
|
|
6897
|
-
}
|
|
6898
|
-
dependencies{
|
|
6899
|
-
masterFields
|
|
6900
|
-
type
|
|
6901
|
-
expression
|
|
6902
|
-
}
|
|
6903
|
-
}
|
|
6904
|
-
}
|
|
6905
|
-
}`);
|
|
6906
|
-
this.templateByQuery.set("fetchData", dist.gql `query($dataunit: String! $limit: Int $offset:Int $filters: [InputFilter!] $sort: [InputSort!]) {
|
|
6907
|
-
$queryAlias$: fetchDataUnit(name: $dataunit){
|
|
6908
|
-
data(limit: $limit offset: $offset filters: $filters sort: $sort){
|
|
6909
|
-
limit
|
|
6910
|
-
offset
|
|
6911
|
-
total
|
|
6912
|
-
hasMore
|
|
6913
|
-
records{
|
|
6914
|
-
id
|
|
6915
|
-
fields {
|
|
6916
|
-
name
|
|
6917
|
-
value
|
|
6918
|
-
}
|
|
6919
|
-
}
|
|
6920
|
-
}
|
|
6921
|
-
}
|
|
6922
|
-
}`);
|
|
6923
|
-
this.templateByQuery.set("saveData", dist.gql `mutation($changes: [InputBatchChange!]!) {
|
|
6924
|
-
$queryAlias$: batchOperationDataUnit(changes: $changes){
|
|
6925
|
-
oldId
|
|
6926
|
-
id
|
|
6927
|
-
fields {
|
|
6928
|
-
name
|
|
6929
|
-
value
|
|
6930
|
-
}
|
|
6931
|
-
}
|
|
6932
|
-
}`);
|
|
6933
|
-
}
|
|
6934
|
-
getDataUnit(entityName, resourceID) {
|
|
6935
|
-
const dataUnit = new DataUnit(`dd://${entityName}/${resourceID}`);
|
|
6936
|
-
dataUnit.metadataLoader = (dataUnit) => this.loadMetadata(dataUnit);
|
|
6937
|
-
dataUnit.dataLoader = (dataUnit, request) => this.loadData(dataUnit, request);
|
|
6938
|
-
dataUnit.saveLoader = (dataUnit, changes) => this.saveData(dataUnit, changes);
|
|
6939
|
-
dataUnit.removeLoader = (dataUnit, recordIds) => this.removeRecords(dataUnit, recordIds);
|
|
6940
|
-
return dataUnit;
|
|
6941
|
-
}
|
|
6942
|
-
loadMetadata(dataUnit) {
|
|
6943
|
-
return new Promise((resolve, reject) => {
|
|
6944
|
-
DataFetcher.get()
|
|
6945
|
-
.callGraphQL({
|
|
6946
|
-
values: { name: dataUnit.name },
|
|
6947
|
-
query: this.templateByQuery.get("fetchDataUnit"),
|
|
6948
|
-
})
|
|
6949
|
-
.then((resp) => {
|
|
6950
|
-
var _a;
|
|
6951
|
-
const metadata = {
|
|
6952
|
-
name: resp.name,
|
|
6953
|
-
label: resp.name,
|
|
6954
|
-
fields: [],
|
|
6955
|
-
};
|
|
6956
|
-
(_a = resp.fields) === null || _a === void 0 ? void 0 : _a.forEach((source) => {
|
|
6957
|
-
let properties = undefined;
|
|
6958
|
-
if (Array.isArray(source.properties)) {
|
|
6959
|
-
properties = {};
|
|
6960
|
-
if (source.calculated) {
|
|
6961
|
-
properties.gridHeaderTooltip = "Campos calculados não podem ser ordenados";
|
|
6962
|
-
}
|
|
6963
|
-
source.properties.forEach((prop) => (properties[prop.name] = prop.value));
|
|
6964
|
-
}
|
|
6965
|
-
metadata.fields.push(Object.assign(Object.assign({}, source), { properties }));
|
|
6966
|
-
});
|
|
6967
|
-
resolve(metadata);
|
|
6968
|
-
})
|
|
6969
|
-
.catch((error) => {
|
|
6970
|
-
reject(error);
|
|
6971
|
-
});
|
|
6972
|
-
});
|
|
6973
|
-
}
|
|
6974
|
-
loadData(dataUnit, request) {
|
|
6975
|
-
const duName = dataUnit.name;
|
|
6976
|
-
if (this._loadDataTimeout[duName]) {
|
|
6977
|
-
clearTimeout(this._loadDataTimeout[duName]);
|
|
6978
|
-
delete this._loadDataTimeout[duName];
|
|
6979
|
-
}
|
|
6980
|
-
return new Promise((resolve, reject) => {
|
|
6981
|
-
this._loadDataTimeout[duName] = setTimeout(() => {
|
|
6982
|
-
delete this._loadDataTimeout[duName];
|
|
6983
|
-
this.doLoadData(dataUnit, request)
|
|
6984
|
-
.then(result => resolve(result))
|
|
6985
|
-
.catch(reason => reject(reason));
|
|
6986
|
-
}, 200);
|
|
6987
|
-
});
|
|
6988
|
-
}
|
|
6989
|
-
doLoadData(dataUnit, request) {
|
|
6990
|
-
return new Promise((resolve, reject) => {
|
|
6991
|
-
var _a;
|
|
6992
|
-
const { sort, filters, limit, offset, quickFilter } = request;
|
|
6993
|
-
const variables = { dataunit: dataUnit.name, sort, filters };
|
|
6994
|
-
variables.limit = limit;
|
|
6995
|
-
variables.offset = offset;
|
|
6996
|
-
if (!StringUtils.isEmpty(quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.term)) {
|
|
6997
|
-
if (variables.filter === undefined) {
|
|
6998
|
-
variables.filter = [];
|
|
6999
|
-
}
|
|
7000
|
-
const quickFilterCriteria = {
|
|
7001
|
-
name: "__QUICK_FILTER__",
|
|
7002
|
-
expression: "__QUICK_FILTER__",
|
|
7003
|
-
params: [{ name: "term", dataType: DataType.TEXT, value: quickFilter.term }]
|
|
7004
|
-
};
|
|
7005
|
-
if (((_a = quickFilter === null || quickFilter === void 0 ? void 0 : quickFilter.fields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
7006
|
-
quickFilterCriteria.params.push({ name: "fields", dataType: DataType.OBJECT, value: quickFilter.fields });
|
|
7007
|
-
}
|
|
7008
|
-
variables.filter.push(quickFilterCriteria);
|
|
7009
|
-
}
|
|
7010
|
-
DataFetcher.get()
|
|
7011
|
-
.callGraphQL({
|
|
7012
|
-
values: variables,
|
|
7013
|
-
query: this.templateByQuery.get("fetchData"),
|
|
7014
|
-
})
|
|
7015
|
-
.then((resp) => {
|
|
7016
|
-
const { limit, offset, total, hasMore, records } = resp.data;
|
|
7017
|
-
let paginationInfo;
|
|
7018
|
-
if (limit) {
|
|
7019
|
-
const firstRecord = total == 0 ? 0 : offset + 1;
|
|
7020
|
-
const lastRecord = offset + Math.min(records.length, limit);
|
|
7021
|
-
const currentPage = offset / limit;
|
|
7022
|
-
paginationInfo = {
|
|
7023
|
-
firstRecord,
|
|
7024
|
-
lastRecord,
|
|
7025
|
-
total,
|
|
7026
|
-
currentPage,
|
|
7027
|
-
hasMore
|
|
7028
|
-
};
|
|
7029
|
-
}
|
|
7030
|
-
const processedRecords = [];
|
|
7031
|
-
records.forEach((responseRecord) => {
|
|
7032
|
-
const duRecord = { __record__id__: responseRecord.id };
|
|
7033
|
-
responseRecord.fields.forEach(({ name, value }) => {
|
|
7034
|
-
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
7035
|
-
});
|
|
7036
|
-
processedRecords.push(duRecord);
|
|
7037
|
-
});
|
|
7038
|
-
resolve({
|
|
7039
|
-
paginationInfo,
|
|
7040
|
-
records: processedRecords
|
|
7041
|
-
});
|
|
7042
|
-
})
|
|
7043
|
-
.catch((error) => {
|
|
7044
|
-
reject(error);
|
|
7045
|
-
});
|
|
7046
|
-
});
|
|
7047
|
-
}
|
|
7048
|
-
saveData(dataUnit, duChanges) {
|
|
7049
|
-
const changes = duChanges.map((change) => {
|
|
7050
|
-
const { dataUnit: changeDU, record, updatingFields, operation } = change;
|
|
7051
|
-
let parsedUpdatingFields;
|
|
7052
|
-
if (updatingFields) {
|
|
7053
|
-
parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
7054
|
-
const descriptor = dataUnit.getField(fieldName);
|
|
7055
|
-
const dataType = descriptor ? descriptor.dataType : DataType.TEXT;
|
|
7056
|
-
return { fieldName, dataType, value: dataUnit.valueToString(fieldName, value) };
|
|
7057
|
-
});
|
|
7058
|
-
}
|
|
7059
|
-
const reqChange = { dataUnit: changeDU, fields: parsedUpdatingFields, operation, recordId: record.__record__id__ };
|
|
7060
|
-
if (change.sourceId) {
|
|
7061
|
-
reqChange.sourceId = change.sourceId;
|
|
7062
|
-
}
|
|
7063
|
-
return reqChange;
|
|
7064
|
-
});
|
|
7065
|
-
return new Promise((resolve, reject) => {
|
|
7066
|
-
DataFetcher.get()
|
|
7067
|
-
.callGraphQL({
|
|
7068
|
-
values: { changes: changes },
|
|
7069
|
-
query: this.templateByQuery.get("saveData"),
|
|
7070
|
-
})
|
|
7071
|
-
.then((resp) => {
|
|
7072
|
-
const dataUnitRecords = [];
|
|
7073
|
-
resp === null || resp === void 0 ? void 0 : resp.forEach((responseRecord) => {
|
|
7074
|
-
const duRecord = { __record__id__: responseRecord.id };
|
|
7075
|
-
if (responseRecord.oldId) {
|
|
7076
|
-
duRecord.__old__id__ = responseRecord.oldId;
|
|
7077
|
-
}
|
|
7078
|
-
responseRecord.fields.forEach(({ name, value }) => {
|
|
7079
|
-
duRecord[name] = dataUnit.valueFromString(name, value);
|
|
7080
|
-
});
|
|
7081
|
-
dataUnitRecords.push(duRecord);
|
|
7082
|
-
});
|
|
7083
|
-
resolve(dataUnitRecords);
|
|
7084
|
-
})
|
|
7085
|
-
.catch((error) => {
|
|
7086
|
-
reject(error);
|
|
7087
|
-
});
|
|
7088
|
-
});
|
|
7089
|
-
}
|
|
7090
|
-
removeRecords(dataUnit, recordIds) {
|
|
7091
|
-
const changes = recordIds.map((recordId) => {
|
|
7092
|
-
return { dataUnit: dataUnit.name, operation: ChangeOperation.DELETE, recordId };
|
|
7093
|
-
});
|
|
7094
|
-
return new Promise((resolve, reject) => {
|
|
7095
|
-
DataFetcher.get()
|
|
7096
|
-
.callGraphQL({
|
|
7097
|
-
values: { changes: changes },
|
|
7098
|
-
query: this.templateByQuery.get("saveData"),
|
|
7099
|
-
})
|
|
7100
|
-
.then((_resp) => {
|
|
7101
|
-
resolve(recordIds);
|
|
7102
|
-
})
|
|
7103
|
-
.catch((error) => {
|
|
7104
|
-
reject(error);
|
|
7105
|
-
});
|
|
7106
|
-
});
|
|
7107
|
-
}
|
|
7108
|
-
}
|
|
7109
|
-
|
|
7110
|
-
var _a;
|
|
7111
|
-
class Workspace {
|
|
7112
|
-
static openAppActivity(resourceId, pkObject) {
|
|
7113
|
-
var _a;
|
|
7114
|
-
(_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.openAppActivity(resourceId, pkObject);
|
|
7115
|
-
}
|
|
7116
|
-
}
|
|
7117
|
-
Workspace.resourceID = (_a = window["workspace"]) === null || _a === void 0 ? void 0 : _a.resourceID;
|
|
7118
|
-
|
|
7119
|
-
class ParametersFetcher {
|
|
7120
|
-
constructor() {
|
|
7121
|
-
this.templateByQuery = new Map();
|
|
7122
|
-
this.buldTemplates();
|
|
7123
|
-
}
|
|
7124
|
-
buldTemplates() {
|
|
7125
|
-
this.templateByQuery.set("fetchParam", dist.gql `query($name: String!) {
|
|
7126
|
-
$queryAlias$: fetchResource(name: $name){
|
|
7127
|
-
name
|
|
7128
|
-
resource
|
|
7129
|
-
}
|
|
7130
|
-
}`);
|
|
7131
|
-
}
|
|
7132
|
-
async getParam(name, resourceID) {
|
|
7133
|
-
const completPath = `param://${resourceID}?params=${window.btoa(name)}`;
|
|
7134
|
-
return DataFetcher.get().callGraphQL({
|
|
7135
|
-
values: { name: completPath },
|
|
7136
|
-
query: this.templateByQuery.get("fetchParam"),
|
|
7137
|
-
});
|
|
7138
|
-
}
|
|
7139
|
-
async asString(name, resourceID) {
|
|
7140
|
-
const paramArr = await this.getParam(name, resourceID);
|
|
7141
|
-
return this.getValue(paramArr);
|
|
7142
|
-
}
|
|
7143
|
-
async asInteger(name, resourceID) {
|
|
7144
|
-
const paramArr = await this.getParam(name, resourceID);
|
|
7145
|
-
return parseInt(this.getValue(paramArr));
|
|
7146
|
-
}
|
|
7147
|
-
async asFloat(name, resourceID) {
|
|
7148
|
-
const paramArr = await this.getParam(name, resourceID);
|
|
7149
|
-
return parseFloat(this.getValue(paramArr));
|
|
7150
|
-
}
|
|
7151
|
-
async asBoolean(name, resourceID) {
|
|
7152
|
-
const paramArr = await this.getParam(name, resourceID);
|
|
7153
|
-
return this.getValue(paramArr) == "S";
|
|
7154
|
-
}
|
|
7155
|
-
async asDate(name, resourceID) {
|
|
7156
|
-
const paramArr = await this.getParam(name, resourceID);
|
|
7157
|
-
return DateUtils.strToDate(this.getValue(paramArr));
|
|
7158
|
-
}
|
|
7159
|
-
async getBatchParams(names, resourceID) {
|
|
7160
|
-
const paramArr = await this.getParam(names.join(","), resourceID);
|
|
7161
|
-
//TODO: try to typed params val?
|
|
7162
|
-
const response = {};
|
|
7163
|
-
paramArr.forEach((param) => (response[param.name] = param.resource));
|
|
7164
|
-
return response;
|
|
7165
|
-
}
|
|
7166
|
-
getValue(obj = {}) {
|
|
7167
|
-
if (Array.isArray(obj) && obj.length > 0) {
|
|
7168
|
-
obj = obj[0];
|
|
7169
|
-
}
|
|
7170
|
-
if (StringUtils.isEmpty(obj.resource))
|
|
7171
|
-
return "";
|
|
7172
|
-
return obj.resource;
|
|
7173
|
-
}
|
|
7174
|
-
}
|
|
7175
|
-
|
|
7176
6695
|
class ResourceFetcher {
|
|
7177
6696
|
constructor() {
|
|
7178
6697
|
this.templateByQuery = new Map();
|
|
@@ -7192,7 +6711,10 @@ class ResourceFetcher {
|
|
|
7192
6711
|
}`);
|
|
7193
6712
|
}
|
|
7194
6713
|
loadResource(name) {
|
|
7195
|
-
|
|
6714
|
+
if (ResourceFetcher._loadingResource.has(name)) {
|
|
6715
|
+
return ResourceFetcher._loadingResource.get(name);
|
|
6716
|
+
}
|
|
6717
|
+
const promiseLoadResource = new Promise((resolve, reject) => {
|
|
7196
6718
|
DataFetcher.get()
|
|
7197
6719
|
.callGraphQL({
|
|
7198
6720
|
values: { name },
|
|
@@ -7200,11 +6722,15 @@ class ResourceFetcher {
|
|
|
7200
6722
|
})
|
|
7201
6723
|
.then((result) => {
|
|
7202
6724
|
resolve(result === null || result === void 0 ? void 0 : result.resource);
|
|
6725
|
+
ResourceFetcher._loadingResource.delete(name);
|
|
7203
6726
|
})
|
|
7204
6727
|
.catch((error) => {
|
|
7205
6728
|
reject(error);
|
|
6729
|
+
ResourceFetcher._loadingResource.delete(name);
|
|
7206
6730
|
});
|
|
7207
6731
|
});
|
|
6732
|
+
ResourceFetcher._loadingResource.set(name, promiseLoadResource);
|
|
6733
|
+
return promiseLoadResource;
|
|
7208
6734
|
}
|
|
7209
6735
|
saveResource(resource, name) {
|
|
7210
6736
|
return new Promise((resolve, reject) => {
|
|
@@ -7227,8 +6753,35 @@ class ResourceFetcher {
|
|
|
7227
6753
|
});
|
|
7228
6754
|
}
|
|
7229
6755
|
}
|
|
6756
|
+
ResourceFetcher._loadingResource = new Map();
|
|
7230
6757
|
|
|
7231
6758
|
class FormConfigFetcher extends ResourceFetcher {
|
|
6759
|
+
constructor() {
|
|
6760
|
+
super();
|
|
6761
|
+
this.queryConfig = new Map();
|
|
6762
|
+
this.buildTemplatesConfig();
|
|
6763
|
+
}
|
|
6764
|
+
buildTemplatesConfig() {
|
|
6765
|
+
this.queryConfig.set("fetchUserAvailableConfigs", dist.gql `query($name: String!) {
|
|
6766
|
+
$queryAlias$: fetchUserAvailableConfigs(name: $name){
|
|
6767
|
+
name
|
|
6768
|
+
origin
|
|
6769
|
+
key
|
|
6770
|
+
}
|
|
6771
|
+
}`);
|
|
6772
|
+
this.queryConfig.set("fetchLegacyConfig", dist.gql `query($name: String!) {
|
|
6773
|
+
$queryAlias$: fetchLegacyConfig(name: $name){
|
|
6774
|
+
name
|
|
6775
|
+
resource
|
|
6776
|
+
}
|
|
6777
|
+
}`);
|
|
6778
|
+
this.queryConfig.set("fetchDefaultConfig", dist.gql `query($name: String!) {
|
|
6779
|
+
$queryAlias$: fetchDefaultConfig(name: $name){
|
|
6780
|
+
name
|
|
6781
|
+
resource
|
|
6782
|
+
}
|
|
6783
|
+
}`);
|
|
6784
|
+
}
|
|
7232
6785
|
loadFormConfig(formName, resourceID) {
|
|
7233
6786
|
return new Promise((accept, reject) => {
|
|
7234
6787
|
this.loadResource(`cfg://form/${resourceID}/${formName}`)
|
|
@@ -7238,9 +6791,17 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
7238
6791
|
const { tabs, fields } = config;
|
|
7239
6792
|
if (tabs) {
|
|
7240
6793
|
const allTabs = new Map(tabs.map(t => [t.label, t]));
|
|
7241
|
-
fields.forEach(f => f.tab = allTabs.get(this.getTabName(f.tab)));
|
|
6794
|
+
fields === null || fields === void 0 ? void 0 : fields.forEach(f => { var _a; return f.tab = ((_a = allTabs.get(this.getTabName(f.tab))) === null || _a === void 0 ? void 0 : _a.label) || allTabs.get(this.getTabName(f.tab)); });
|
|
7242
6795
|
}
|
|
7243
|
-
|
|
6796
|
+
config.fields = fields === null || fields === void 0 ? void 0 : fields.map((field) => {
|
|
6797
|
+
if ("readonly" in field) {
|
|
6798
|
+
const readOnly = field['readonly'];
|
|
6799
|
+
delete field['readonly'];
|
|
6800
|
+
field.readOnly = readOnly;
|
|
6801
|
+
}
|
|
6802
|
+
return field;
|
|
6803
|
+
});
|
|
6804
|
+
accept(config);
|
|
7244
6805
|
}
|
|
7245
6806
|
else {
|
|
7246
6807
|
reject(`Sem configuração pro formulário "${formName}".`);
|
|
@@ -7252,35 +6813,13 @@ class FormConfigFetcher extends ResourceFetcher {
|
|
|
7252
6813
|
});
|
|
7253
6814
|
}
|
|
7254
6815
|
getTabName(tab) {
|
|
7255
|
-
if (typeof tab === 'object') { //
|
|
6816
|
+
if (typeof tab === 'object') { // ITabConfig type
|
|
7256
6817
|
return tab.label;
|
|
7257
6818
|
}
|
|
7258
6819
|
return tab; //string type
|
|
7259
6820
|
}
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
class GridConfigFetcher extends ResourceFetcher {
|
|
7263
|
-
constructor() {
|
|
7264
|
-
super(...arguments);
|
|
7265
|
-
this.GRID_CONFIG_VERSION = "V3:";
|
|
7266
|
-
}
|
|
7267
|
-
getConfig(_gridName, resourceID) {
|
|
7268
|
-
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
7269
|
-
return new Promise((resolve, reject) => {
|
|
7270
|
-
this.loadResource(completePath)
|
|
7271
|
-
.then(loadedResource => {
|
|
7272
|
-
let config = undefined;
|
|
7273
|
-
if (loadedResource) {
|
|
7274
|
-
config = JSON.parse(loadedResource);
|
|
7275
|
-
}
|
|
7276
|
-
resolve(config);
|
|
7277
|
-
}).catch((error) => {
|
|
7278
|
-
reject(error);
|
|
7279
|
-
});
|
|
7280
|
-
});
|
|
7281
|
-
}
|
|
7282
|
-
saveConfig(config, resourceID) {
|
|
7283
|
-
const completePath = `cfg://grid/${this.GRID_CONFIG_VERSION}${resourceID}`;
|
|
6821
|
+
saveConfig(config, formName, resourceID) {
|
|
6822
|
+
const completePath = `cfg://form/${resourceID}/${formName}`;
|
|
7284
6823
|
return new Promise((resolve, reject) => {
|
|
7285
6824
|
this.saveResource(config, completePath)
|
|
7286
6825
|
.then((resp) => {
|
|
@@ -7291,30 +6830,13 @@ class GridConfigFetcher extends ResourceFetcher {
|
|
|
7291
6830
|
});
|
|
7292
6831
|
});
|
|
7293
6832
|
}
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
class PesquisaFetcher {
|
|
7297
|
-
constructor() {
|
|
7298
|
-
this._defaultPageSize = 100;
|
|
7299
|
-
this._templateByQuery = new Map();
|
|
7300
|
-
this.buldTemplates();
|
|
7301
|
-
}
|
|
7302
|
-
buldTemplates() {
|
|
7303
|
-
this._templateByQuery.set("search", dist.gql `query($entityName: String! $argument: String $criteria: InputSearchCriteria $options: InputSearchOptions) {
|
|
7304
|
-
$queryAlias$: search(entityName: $entityName argument: $argument criteria: $criteria options: $options){
|
|
7305
|
-
value
|
|
7306
|
-
label
|
|
7307
|
-
}
|
|
7308
|
-
}`);
|
|
7309
|
-
}
|
|
7310
|
-
loadSearchOptions(entityName, argument, criteria, options) {
|
|
7311
|
-
const cleanText = (argument === null || argument === void 0 ? void 0 : argument.trim()) || undefined;
|
|
7312
|
-
argument = isNaN(Number(cleanText)) && cleanText ? `%${cleanText}` : cleanText;
|
|
6833
|
+
fetchUserAvailableConfigs(formName, resourceID) {
|
|
6834
|
+
const name = `cfg://form/${resourceID}/${formName}`;
|
|
7313
6835
|
return new Promise((resolve, reject) => {
|
|
7314
6836
|
DataFetcher.get()
|
|
7315
6837
|
.callGraphQL({
|
|
7316
|
-
values: {
|
|
7317
|
-
query: this.
|
|
6838
|
+
values: { name },
|
|
6839
|
+
query: this.queryConfig.get("fetchUserAvailableConfigs"),
|
|
7318
6840
|
})
|
|
7319
6841
|
.then((result) => {
|
|
7320
6842
|
resolve(result);
|
|
@@ -7324,825 +6846,44 @@ class PesquisaFetcher {
|
|
|
7324
6846
|
});
|
|
7325
6847
|
});
|
|
7326
6848
|
}
|
|
7327
|
-
|
|
7328
|
-
const
|
|
7329
|
-
const externalCriteria = {
|
|
7330
|
-
query: {
|
|
7331
|
-
$: criteria === null || criteria === void 0 ? void 0 : criteria.expression
|
|
7332
|
-
}
|
|
7333
|
-
};
|
|
7334
|
-
if ((criteria === null || criteria === void 0 ? void 0 : criteria.params.length) > 0) {
|
|
7335
|
-
externalCriteria.params = {
|
|
7336
|
-
param: criteria.params.map(p => { return { $: p.value, type: convertParamType(p.dataType) }; })
|
|
7337
|
-
};
|
|
7338
|
-
}
|
|
7339
|
-
const reqBody = {
|
|
7340
|
-
"serviceName": serviceName,
|
|
7341
|
-
"requestBody": {
|
|
7342
|
-
"criteria": {
|
|
7343
|
-
"entityName": entityName,
|
|
7344
|
-
"compacted": false,
|
|
7345
|
-
"ignoreEntityCriteria": false,
|
|
7346
|
-
"limit": this._defaultPageSize,
|
|
7347
|
-
"query": { "$": argument },
|
|
7348
|
-
"orderByDesc": false,
|
|
7349
|
-
"externalCriteria": externalCriteria,
|
|
7350
|
-
"localEntityName": searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.rootEntity
|
|
7351
|
-
},
|
|
7352
|
-
"clientEventList": {
|
|
7353
|
-
"clientEvent": []
|
|
7354
|
-
}
|
|
7355
|
-
}
|
|
7356
|
-
};
|
|
6849
|
+
fetchLegacyConfig(formName, resourceID) {
|
|
6850
|
+
const name = `cfg://form/${resourceID}/${formName}`;
|
|
7357
6851
|
return new Promise((resolve, reject) => {
|
|
7358
6852
|
DataFetcher.get()
|
|
7359
|
-
.
|
|
7360
|
-
|
|
7361
|
-
.
|
|
7362
|
-
});
|
|
7363
|
-
}
|
|
7364
|
-
}
|
|
7365
|
-
function convertParamType(dataType) {
|
|
7366
|
-
//Alerta: Cuidado pra não contaminar o DataType com a implementação
|
|
7367
|
-
//atual da pesquisa... em geral, somente inteiros,
|
|
7368
|
-
//data (com ou sem hora) e string são realmente relevantes
|
|
7369
|
-
switch (dataType) {
|
|
7370
|
-
case DataType.NUMBER:
|
|
7371
|
-
return "I";
|
|
7372
|
-
case DataType.DATE:
|
|
7373
|
-
return "D";
|
|
7374
|
-
default:
|
|
7375
|
-
return "S";
|
|
7376
|
-
}
|
|
7377
|
-
}
|
|
7378
|
-
|
|
7379
|
-
class AuthFetcher extends ResourceFetcher {
|
|
7380
|
-
getData(resourceID) {
|
|
7381
|
-
const completePath = `cfg://auth/${resourceID}`;
|
|
7382
|
-
return new Promise((resolve, reject) => {
|
|
7383
|
-
this.loadResource(completePath)
|
|
7384
|
-
.then((loadedResource) => {
|
|
7385
|
-
let auth = ObjectUtils.stringToObject(loadedResource);
|
|
7386
|
-
if (auth && typeof (auth) === 'object') {
|
|
7387
|
-
resolve(auth);
|
|
7388
|
-
}
|
|
7389
|
-
}).catch((error) => {
|
|
7390
|
-
reject(error);
|
|
7391
|
-
});
|
|
7392
|
-
});
|
|
7393
|
-
}
|
|
7394
|
-
}
|
|
7395
|
-
var AutorizationType;
|
|
7396
|
-
(function (AutorizationType) {
|
|
7397
|
-
AutorizationType["INSERT"] = "I";
|
|
7398
|
-
AutorizationType["UPDATE"] = "A";
|
|
7399
|
-
AutorizationType["REMOVE"] = "E";
|
|
7400
|
-
AutorizationType["SHOW"] = "C";
|
|
7401
|
-
AutorizationType["CONFIG"] = "F";
|
|
7402
|
-
AutorizationType["CONFIG_NUMBER"] = "N";
|
|
7403
|
-
AutorizationType["CLONE"] = "D";
|
|
7404
|
-
AutorizationType["CONFIG_GRID"] = "G";
|
|
7405
|
-
})(AutorizationType || (AutorizationType = {}));
|
|
7406
|
-
|
|
7407
|
-
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'];}}
|
|
7408
|
-
|
|
7409
|
-
class SnkErrorHandler {
|
|
7410
|
-
constructor(app) {
|
|
7411
|
-
this._app = app;
|
|
7412
|
-
window.addEventListener("error", evt => this.errorHandler(evt));
|
|
7413
|
-
window.addEventListener("unhandledrejection", evt => this.rejectionHandler(evt));
|
|
7414
|
-
}
|
|
7415
|
-
rejectionHandler(evt) {
|
|
7416
|
-
const reason = evt.reason;
|
|
7417
|
-
//Promisse rejeitada com WaitingChangeException, não precisam
|
|
7418
|
-
//ser notificadas pelo usuário.
|
|
7419
|
-
if (!(reason instanceof WaitingChangeException)) {
|
|
7420
|
-
if (reason) {
|
|
7421
|
-
this.processException(reason);
|
|
7422
|
-
}
|
|
7423
|
-
else {
|
|
7424
|
-
this._app.isDebugMode().then((isDebug) => {
|
|
7425
|
-
if (isDebug) {
|
|
7426
|
-
this._app.error("Promise rejeitada", "Erro interno: Uma promise foi rejeitada sem razão determinada.");
|
|
7427
|
-
}
|
|
7428
|
-
});
|
|
7429
|
-
}
|
|
7430
|
-
}
|
|
7431
|
-
}
|
|
7432
|
-
errorHandler(evt) {
|
|
7433
|
-
this.processException(evt.error);
|
|
7434
|
-
}
|
|
7435
|
-
buildErrorCodeHTML(exception) {
|
|
7436
|
-
const onclick = 'try{window.workspace.openHelp(\'_tbcode:' + exception.errorCode + '\')} catch(e){alert(\'Não é possível abrir a ajuda fora do workspace Sankhya\');}';
|
|
7437
|
-
return '<br><a href="#" onclick="' + onclick + '">Código: ' + exception.errorCode + '</a>';
|
|
7438
|
-
}
|
|
7439
|
-
processException(exception) {
|
|
7440
|
-
if (exception.errorCode != "") {
|
|
7441
|
-
exception.message += this.buildErrorCodeHTML(exception);
|
|
7442
|
-
}
|
|
7443
|
-
if (exception instanceof WaitingChangeException) {
|
|
7444
|
-
this._app.alert(exception.title, exception.message);
|
|
7445
|
-
}
|
|
7446
|
-
else if (exception instanceof WarningException) {
|
|
7447
|
-
this._app.alert(exception.title, exception.message);
|
|
7448
|
-
}
|
|
7449
|
-
else if (exception instanceof ErrorException) {
|
|
7450
|
-
this._app.error(exception.title, exception.message);
|
|
7451
|
-
}
|
|
7452
|
-
else {
|
|
7453
|
-
this._app.isDebugMode().then(isDebug => {
|
|
7454
|
-
if (isDebug) {
|
|
7455
|
-
if (exception instanceof Error) {
|
|
7456
|
-
this._app.error(exception.name, exception.message);
|
|
7457
|
-
}
|
|
7458
|
-
else {
|
|
7459
|
-
const title = (exception === null || exception === void 0 ? void 0 : exception.title) || "Erro detectado";
|
|
7460
|
-
const message = (typeof exception === "string") ? exception : exception.message || `Erro interno "${ObjectUtils.objectToString(exception)}"`;
|
|
7461
|
-
this._app.error(title, message);
|
|
7462
|
-
}
|
|
7463
|
-
}
|
|
7464
|
-
});
|
|
7465
|
-
}
|
|
7466
|
-
}
|
|
7467
|
-
}
|
|
7468
|
-
|
|
7469
|
-
function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
|
|
7470
|
-
|
|
7471
|
-
class TotalsFetcher {
|
|
7472
|
-
constructor() {
|
|
7473
|
-
this.templateByQuery = new Map();
|
|
7474
|
-
this.buldTemplates();
|
|
7475
|
-
}
|
|
7476
|
-
buldTemplates() {
|
|
7477
|
-
this.templateByQuery.set("fetchTotals", dist.gql `query($filters: [InputFilter!] $name: String!) {
|
|
7478
|
-
$queryAlias$: fetchTotals(name: $name, filters: $filters ){
|
|
7479
|
-
name
|
|
7480
|
-
value
|
|
7481
|
-
}
|
|
7482
|
-
}`);
|
|
7483
|
-
}
|
|
7484
|
-
async getTotals(name, resourceID, filters) {
|
|
7485
|
-
const path = `totals://${name}/${resourceID}`;
|
|
7486
|
-
let variables = {
|
|
7487
|
-
name: path,
|
|
7488
|
-
filters: filters
|
|
7489
|
-
};
|
|
7490
|
-
return DataFetcher.get().callGraphQL({
|
|
7491
|
-
values: variables,
|
|
7492
|
-
query: this.templateByQuery.get("fetchTotals"),
|
|
7493
|
-
});
|
|
7494
|
-
}
|
|
7495
|
-
fetchTotals(name, resourceID, filters = []) {
|
|
7496
|
-
return new Promise((accept, reject) => {
|
|
7497
|
-
this.getTotals(name, resourceID, filters)
|
|
7498
|
-
.then((result) => {
|
|
7499
|
-
if (result.length > 0) {
|
|
7500
|
-
const totalsData = new Map();
|
|
7501
|
-
result.forEach(total => {
|
|
7502
|
-
totalsData.set(total.name, parseFloat(total.value));
|
|
7503
|
-
});
|
|
7504
|
-
accept(totalsData);
|
|
7505
|
-
}
|
|
7506
|
-
else {
|
|
7507
|
-
reject(`Não foi possível recuperar os totalizadores`);
|
|
7508
|
-
}
|
|
6853
|
+
.callGraphQL({
|
|
6854
|
+
values: { name },
|
|
6855
|
+
query: this.queryConfig.get("fetchLegacyConfig"),
|
|
7509
6856
|
})
|
|
7510
|
-
.
|
|
7511
|
-
|
|
7512
|
-
});
|
|
7513
|
-
});
|
|
7514
|
-
}
|
|
7515
|
-
}
|
|
7516
|
-
|
|
7517
|
-
function normalizeValue(value) {
|
|
7518
|
-
if (value instanceof Date) {
|
|
7519
|
-
return value.toISOString();
|
|
7520
|
-
}
|
|
7521
|
-
if (typeof value === "object") {
|
|
7522
|
-
const normalized = Object.assign({}, value);
|
|
7523
|
-
Object.keys(value).forEach(prop => {
|
|
7524
|
-
if (value[prop]) {
|
|
7525
|
-
normalized[prop] = normalizeValue(value[prop]);
|
|
7526
|
-
}
|
|
7527
|
-
else {
|
|
7528
|
-
delete normalized[prop];
|
|
7529
|
-
}
|
|
7530
|
-
});
|
|
7531
|
-
return normalized;
|
|
7532
|
-
}
|
|
7533
|
-
return value;
|
|
7534
|
-
}
|
|
7535
|
-
class FilterBarConfigFetcher extends ResourceFetcher {
|
|
7536
|
-
saveConfig(items, resourceID, configName) {
|
|
7537
|
-
const state = items.map(item => {
|
|
7538
|
-
const { id, value, fixed, visible } = item;
|
|
7539
|
-
const stateItem = { id };
|
|
7540
|
-
if (value) {
|
|
7541
|
-
stateItem["value"] = normalizeValue(value);
|
|
7542
|
-
}
|
|
7543
|
-
if (fixed) {
|
|
7544
|
-
stateItem["fixed"] = fixed;
|
|
7545
|
-
}
|
|
7546
|
-
if (visible) {
|
|
7547
|
-
stateItem["visible"] = true;
|
|
7548
|
-
}
|
|
7549
|
-
return stateItem;
|
|
7550
|
-
});
|
|
7551
|
-
return this.saveResource(state, `cfg://filter/FilterBarState:${resourceID}/${configName}`);
|
|
7552
|
-
}
|
|
7553
|
-
getConfig(resourceID, configName) {
|
|
7554
|
-
return new Promise((accept, reject) => {
|
|
7555
|
-
this.loadResource(`cfg://filter/FilterBarState:${resourceID}/${configName}`)
|
|
7556
|
-
.then((configAsString) => {
|
|
7557
|
-
let fieldsList;
|
|
7558
|
-
if (configAsString) {
|
|
7559
|
-
const filterBarConfig = JSON.parse(configAsString);
|
|
7560
|
-
fieldsList = filterBarConfig.items;
|
|
7561
|
-
}
|
|
7562
|
-
accept(fieldsList || []);
|
|
6857
|
+
.then((result) => {
|
|
6858
|
+
resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
|
7563
6859
|
})
|
|
7564
6860
|
.catch((error) => {
|
|
7565
6861
|
reject(error);
|
|
7566
6862
|
});
|
|
7567
6863
|
});
|
|
7568
6864
|
}
|
|
7569
|
-
|
|
7570
|
-
|
|
7571
|
-
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
7572
|
-
|
|
7573
|
-
const SnkApplication = class {
|
|
7574
|
-
constructor(hostRef) {
|
|
7575
|
-
registerInstance(this, hostRef);
|
|
7576
|
-
this.applicationLoaded = createEvent(this, "applicationLoaded", 7);
|
|
7577
|
-
this.applicationLoading = createEvent(this, "applicationLoading", 7);
|
|
7578
|
-
this._authPromises = [];
|
|
7579
|
-
this._duCache = new Map();
|
|
7580
|
-
this._duPromises = new Map();
|
|
7581
|
-
this._requestListener = new RequestListenerLoadingBar();
|
|
7582
|
-
}
|
|
7583
|
-
get parameters() {
|
|
7584
|
-
if (!this._parameters) {
|
|
7585
|
-
this._parameters = new ParametersFetcher();
|
|
7586
|
-
}
|
|
7587
|
-
return this._parameters;
|
|
7588
|
-
}
|
|
7589
|
-
get resourceID() {
|
|
7590
|
-
if (!this._resourceID) {
|
|
7591
|
-
this._resourceID = this.urlParams.get("workspaceResourceID") ||
|
|
7592
|
-
this.urlParams.get("resourceID") ||
|
|
7593
|
-
Workspace.resourceID ||
|
|
7594
|
-
"unknown.resource.id";
|
|
7595
|
-
}
|
|
7596
|
-
return this._resourceID;
|
|
7597
|
-
}
|
|
7598
|
-
get auth() {
|
|
7599
|
-
if (this._auth) {
|
|
7600
|
-
return Promise.resolve(this._auth);
|
|
7601
|
-
}
|
|
7602
|
-
else {
|
|
7603
|
-
return new Promise((resolve, reject) => {
|
|
7604
|
-
const waitingAuth = this._authPromises.length > 0;
|
|
7605
|
-
this._authPromises.push(new PendingPromise(resolve, reject));
|
|
7606
|
-
if (!waitingAuth) {
|
|
7607
|
-
this.authFetcher.getData(this.resourceID).then((authList) => {
|
|
7608
|
-
this._auth = authList;
|
|
7609
|
-
while (this._authPromises.length > 0) {
|
|
7610
|
-
this._authPromises.pop().resolve(this._auth);
|
|
7611
|
-
}
|
|
7612
|
-
}).catch(error => {
|
|
7613
|
-
while (this._authPromises.length > 0) {
|
|
7614
|
-
this._authPromises.pop().reject(error);
|
|
7615
|
-
}
|
|
7616
|
-
});
|
|
7617
|
-
}
|
|
7618
|
-
});
|
|
7619
|
-
}
|
|
7620
|
-
}
|
|
7621
|
-
/**
|
|
7622
|
-
* Caso o usuário logado seja o SUP.
|
|
7623
|
-
*/
|
|
7624
|
-
async isUserSup() {
|
|
6865
|
+
fetchDefaultConfig(formName, resourceID) {
|
|
6866
|
+
const name = `cfg://form/${resourceID}/${formName}`;
|
|
7625
6867
|
return new Promise((resolve, reject) => {
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7630
|
-
});
|
|
7631
|
-
});
|
|
7632
|
-
}
|
|
7633
|
-
/**
|
|
7634
|
-
* Se o usuário logado tem permissão pra determinada ação.
|
|
7635
|
-
*/
|
|
7636
|
-
async hasAccess(access) {
|
|
7637
|
-
return new Promise((resolve, reject) => {
|
|
7638
|
-
this.auth.then((authorization) => {
|
|
7639
|
-
this.getAuthList(authorization).then((auths) => {
|
|
7640
|
-
resolve(auths.isSup || auths.actions[access]);
|
|
7641
|
-
}).catch(error => reject(error));
|
|
7642
|
-
});
|
|
7643
|
-
});
|
|
7644
|
-
}
|
|
7645
|
-
/**
|
|
7646
|
-
* Retorna todos os acessos do usuário logado.
|
|
7647
|
-
*/
|
|
7648
|
-
async getAllAccess() {
|
|
7649
|
-
return new Promise((resolve, reject) => {
|
|
7650
|
-
this.auth.then((authorization) => {
|
|
7651
|
-
this.getAuthList(authorization).then((auths) => {
|
|
7652
|
-
const allAccess = {};
|
|
7653
|
-
allAccess['isSup'] = auths.isSup;
|
|
7654
|
-
Object.entries(AutorizationType).forEach((data) => {
|
|
7655
|
-
allAccess[data[0]] = auths.actions[data[1]] || false;
|
|
7656
|
-
});
|
|
7657
|
-
resolve(allAccess);
|
|
7658
|
-
}).catch(error => reject(error));
|
|
7659
|
-
});
|
|
7660
|
-
});
|
|
7661
|
-
}
|
|
7662
|
-
/**
|
|
7663
|
-
* Retorna o valor de um parâmetro do tipo string.
|
|
7664
|
-
*/
|
|
7665
|
-
async getStringParam(name) {
|
|
7666
|
-
return this.parameters.asString(name, this.resourceID);
|
|
7667
|
-
}
|
|
7668
|
-
/**
|
|
7669
|
-
* Retorna o valor de um parâmetro do tipo Inteiro.
|
|
7670
|
-
*/
|
|
7671
|
-
async getIntParam(name) {
|
|
7672
|
-
return this.parameters.asInteger(name, this.resourceID);
|
|
7673
|
-
}
|
|
7674
|
-
/**
|
|
7675
|
-
* Retorna o valor de um parâmetro do tipo Decimal.
|
|
7676
|
-
*/
|
|
7677
|
-
async getFloatParam(name) {
|
|
7678
|
-
return this.parameters.asFloat(name, this.resourceID);
|
|
7679
|
-
}
|
|
7680
|
-
/**
|
|
7681
|
-
* Retorna o valor de um parâmetro do tipo booleano.
|
|
7682
|
-
*/
|
|
7683
|
-
async getBooleanParam(name) {
|
|
7684
|
-
return this.parameters.asBoolean(name, this.resourceID);
|
|
7685
|
-
}
|
|
7686
|
-
/**
|
|
7687
|
-
* Retorna o valor de um parâmetro do tipo data.
|
|
7688
|
-
*/
|
|
7689
|
-
async getDateParam(name) {
|
|
7690
|
-
return this.parameters.asDate(name, this.resourceID);
|
|
7691
|
-
}
|
|
7692
|
-
/**
|
|
7693
|
-
* Mostra o conteúdo passado em um Popup
|
|
7694
|
-
*/
|
|
7695
|
-
async showPopUp(content) {
|
|
7696
|
-
this.clearPopUpContent();
|
|
7697
|
-
this._popUp.appendChild(content);
|
|
7698
|
-
this._popUp.opened = true;
|
|
7699
|
-
}
|
|
7700
|
-
/**
|
|
7701
|
-
* Fecha o popup, liberando o conteúdo.
|
|
7702
|
-
*/
|
|
7703
|
-
async closePopUp() {
|
|
7704
|
-
this.clearPopUpContent();
|
|
7705
|
-
this._popUp.opened = false;
|
|
7706
|
-
}
|
|
7707
|
-
/**
|
|
7708
|
-
* Verifica se a licença do cliente tem determinado opcional (produto)
|
|
7709
|
-
*/
|
|
7710
|
-
async temOpcional(opcional) {
|
|
7711
|
-
const opts = opcional.split(",");
|
|
7712
|
-
return new Promise((resolve, reject) => {
|
|
7713
|
-
this.getAttributeFromHTMLWrapper("opc0009")
|
|
7714
|
-
.then(value => {
|
|
7715
|
-
if (value === "1") {
|
|
7716
|
-
resolve(true);
|
|
7717
|
-
}
|
|
7718
|
-
else {
|
|
7719
|
-
Promise.all(opts.map(opt => this.getAttributeFromHTMLWrapper("opc" + opt)))
|
|
7720
|
-
.then(result => {
|
|
7721
|
-
resolve(result.includes("1"));
|
|
7722
|
-
})
|
|
7723
|
-
.catch(error => {
|
|
7724
|
-
reject(error);
|
|
7725
|
-
});
|
|
7726
|
-
}
|
|
6868
|
+
DataFetcher.get()
|
|
6869
|
+
.callGraphQL({
|
|
6870
|
+
values: { name },
|
|
6871
|
+
query: this.queryConfig.get("fetchDefaultConfig"),
|
|
7727
6872
|
})
|
|
7728
|
-
.
|
|
6873
|
+
.then((result) => {
|
|
6874
|
+
resolve(ObjectUtils.stringToObject((result === null || result === void 0 ? void 0 : result.resource) || ''));
|
|
6875
|
+
})
|
|
6876
|
+
.catch((error) => {
|
|
7729
6877
|
reject(error);
|
|
7730
6878
|
});
|
|
7731
6879
|
});
|
|
7732
6880
|
}
|
|
7733
|
-
/**
|
|
7734
|
-
* Retorna a configuração de um recurso por service broker
|
|
7735
|
-
* Veja também o método "loadConfig"
|
|
7736
|
-
*/
|
|
7737
|
-
async getConfig(key) {
|
|
7738
|
-
let payload = {
|
|
7739
|
-
"serviceName": "SystemUtilsSP.getConf",
|
|
7740
|
-
"requestBody": {
|
|
7741
|
-
"config": {
|
|
7742
|
-
"chave": key,
|
|
7743
|
-
"tipo": "T"
|
|
7744
|
-
}
|
|
7745
|
-
}
|
|
7746
|
-
};
|
|
7747
|
-
return new Promise((resolve, reject) => {
|
|
7748
|
-
DataFetcher.get()
|
|
7749
|
-
.callServiceBroker("SystemUtilsSP.getConf", JSON.stringify(payload))
|
|
7750
|
-
.then(result => { var _a; return resolve((_a = result.config) === null || _a === void 0 ? void 0 : _a.data); })
|
|
7751
|
-
.catch(error => reject(error));
|
|
7752
|
-
});
|
|
7753
|
-
}
|
|
7754
|
-
/**
|
|
7755
|
-
* Salva a configuração de determinado recurso.
|
|
7756
|
-
*/
|
|
7757
|
-
async saveConfig(key, data) {
|
|
7758
|
-
let payload = {
|
|
7759
|
-
"serviceName": "SystemUtilsSP.saveConf",
|
|
7760
|
-
"requestBody": {
|
|
7761
|
-
"config": {
|
|
7762
|
-
"chave": key,
|
|
7763
|
-
"tipo": "T",
|
|
7764
|
-
data
|
|
7765
|
-
}
|
|
7766
|
-
}
|
|
7767
|
-
};
|
|
7768
|
-
return new Promise((resolve, reject) => {
|
|
7769
|
-
DataFetcher.get()
|
|
7770
|
-
.callServiceBroker("SystemUtilsSP.saveConf", JSON.stringify(payload))
|
|
7771
|
-
.then(result => resolve(result))
|
|
7772
|
-
.catch(error => reject(error));
|
|
7773
|
-
});
|
|
7774
|
-
}
|
|
7775
|
-
/**
|
|
7776
|
-
* Acessa informações de contexto "empurrados" na abertura da tela
|
|
7777
|
-
*/
|
|
7778
|
-
async getAttributeFromHTMLWrapper(attribName) {
|
|
7779
|
-
return Promise.resolve(window[attribName]);
|
|
7780
|
-
}
|
|
7781
|
-
/**
|
|
7782
|
-
* Abre determinada tela, repassando pkObject
|
|
7783
|
-
*/
|
|
7784
|
-
async openApp(resourceId, pkObject) {
|
|
7785
|
-
Workspace.openAppActivity(resourceId, pkObject);
|
|
7786
|
-
}
|
|
7787
|
-
getDuPromissesStack(dataUnitName) {
|
|
7788
|
-
let stack;
|
|
7789
|
-
if (dataUnitName) {
|
|
7790
|
-
stack = this._duPromises.get(dataUnitName);
|
|
7791
|
-
if (!stack) {
|
|
7792
|
-
stack = [];
|
|
7793
|
-
this._duPromises.set(dataUnitName, stack);
|
|
7794
|
-
}
|
|
7795
|
-
}
|
|
7796
|
-
return stack || [];
|
|
7797
|
-
}
|
|
7798
|
-
/**
|
|
7799
|
-
* Cria o DataUnit a partir do nome da entidade. É possível armazená-lo no cache
|
|
7800
|
-
* passando o dataUnitName, assim, se mais de uma chamada for feita, o mesmo DataUnit será usado
|
|
7801
|
-
*/
|
|
7802
|
-
async createDataunit(entityName, dataUnitName) {
|
|
7803
|
-
return new Promise((resolve, reject) => {
|
|
7804
|
-
const duPromisses = this.getDuPromissesStack(dataUnitName);
|
|
7805
|
-
const waitingDu = duPromisses.length > 0;
|
|
7806
|
-
duPromisses.push(new PendingPromise(resolve, reject));
|
|
7807
|
-
if (!waitingDu) {
|
|
7808
|
-
const dataUnit = this.dataUnitFetcher.getDataUnit(entityName, this.resourceID);
|
|
7809
|
-
dataUnit.loadMetadata().then(() => {
|
|
7810
|
-
if (dataUnitName) {
|
|
7811
|
-
this._duCache.set(dataUnitName, dataUnit);
|
|
7812
|
-
}
|
|
7813
|
-
while (duPromisses.length > 0) {
|
|
7814
|
-
duPromisses.pop().resolve(dataUnit);
|
|
7815
|
-
}
|
|
7816
|
-
}).catch(reason => {
|
|
7817
|
-
while (duPromisses.length > 0) {
|
|
7818
|
-
duPromisses.pop().reject(reason);
|
|
7819
|
-
}
|
|
7820
|
-
});
|
|
7821
|
-
}
|
|
7822
|
-
});
|
|
7823
|
-
}
|
|
7824
|
-
/**
|
|
7825
|
-
* Obtem um DataUnit do cache ou cria um caso ainda não tenha sido criado.
|
|
7826
|
-
*/
|
|
7827
|
-
async getDataUnit(entityName, dataUnitName) {
|
|
7828
|
-
return new Promise((resolve, reject) => {
|
|
7829
|
-
const dataUnit = this._duCache.get(dataUnitName);
|
|
7830
|
-
if (dataUnit) {
|
|
7831
|
-
resolve(dataUnit);
|
|
7832
|
-
}
|
|
7833
|
-
else {
|
|
7834
|
-
this.createDataunit(entityName, dataUnitName).then(dataUnit => {
|
|
7835
|
-
resolve(dataUnit);
|
|
7836
|
-
}).catch(reason => reject(reason));
|
|
7837
|
-
}
|
|
7838
|
-
});
|
|
7839
|
-
}
|
|
7840
|
-
/**
|
|
7841
|
-
* Retorna o resourceID da tela em questão.
|
|
7842
|
-
*/
|
|
7843
|
-
async getResourceID() {
|
|
7844
|
-
return Promise.resolve(this.resourceID);
|
|
7845
|
-
}
|
|
7846
|
-
/**
|
|
7847
|
-
* Mostra o diálogo de alerta de acordo com os parâmetros passados.
|
|
7848
|
-
*/
|
|
7849
|
-
async alert(title, message, icon, options) {
|
|
7850
|
-
return ApplicationUtils.alert(title, message, icon, options);
|
|
7851
|
-
}
|
|
7852
|
-
/**
|
|
7853
|
-
* Mostra o diálogo de erro de acordo com os parâmetros passados.
|
|
7854
|
-
*/
|
|
7855
|
-
async error(title, message, icon, options) {
|
|
7856
|
-
return ApplicationUtils.error(title, message, icon, options);
|
|
7857
|
-
}
|
|
7858
|
-
/**
|
|
7859
|
-
* Mostra o diálogo de sucesso de acordo com os parâmetros passados.
|
|
7860
|
-
*/
|
|
7861
|
-
async success(title, message, icon, options) {
|
|
7862
|
-
return ApplicationUtils.success(title, message, icon, options);
|
|
7863
|
-
}
|
|
7864
|
-
/**
|
|
7865
|
-
* Exibe um diálogo de mensagem comum
|
|
7866
|
-
*/
|
|
7867
|
-
async message(title, message, icon, options) {
|
|
7868
|
-
return ApplicationUtils.message(title, message, icon, options);
|
|
7869
|
-
}
|
|
7870
|
-
/**
|
|
7871
|
-
* Exibe um diálogo de confirmação
|
|
7872
|
-
*/
|
|
7873
|
-
async confirm(title, message, icon, dialogType, options) {
|
|
7874
|
-
return ApplicationUtils.confirm(title, message, icon, dialogType, options);
|
|
7875
|
-
}
|
|
7876
|
-
/**
|
|
7877
|
-
* Mostra uma informação efêmera (de segundo plano).
|
|
7878
|
-
*/
|
|
7879
|
-
async info(message, options) {
|
|
7880
|
-
return ApplicationUtils.info(message, options);
|
|
7881
|
-
}
|
|
7882
|
-
/**
|
|
7883
|
-
* Busca a configuração de formulário.
|
|
7884
|
-
*/
|
|
7885
|
-
async loadFormConfig(name) {
|
|
7886
|
-
return this.formConfigFetcher.loadFormConfig(name, this.resourceID);
|
|
7887
|
-
}
|
|
7888
|
-
/**
|
|
7889
|
-
* Busca a configuração de grade.
|
|
7890
|
-
*/
|
|
7891
|
-
async loadGridConfig(name) {
|
|
7892
|
-
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7893
|
-
}
|
|
7894
|
-
/**
|
|
7895
|
-
* Busca os totalizadores da grade.
|
|
7896
|
-
*/
|
|
7897
|
-
async loadTotals(name, resourceID, filters) {
|
|
7898
|
-
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
|
7899
|
-
}
|
|
7900
|
-
/**
|
|
7901
|
-
* Salva a configuração de grade.
|
|
7902
|
-
*/
|
|
7903
|
-
async saveGridConfig(config) {
|
|
7904
|
-
return this.gridConfigFetcher.saveConfig(config, this.resourceID);
|
|
7905
|
-
}
|
|
7906
|
-
/**
|
|
7907
|
-
* Obtém as configurações da barra de filtros
|
|
7908
|
-
*/
|
|
7909
|
-
async getFilterBarConfig(name) {
|
|
7910
|
-
return new Promise((accept, reject) => {
|
|
7911
|
-
if (this.configName === name && this._filterBarConfig) {
|
|
7912
|
-
accept(this._filterBarConfig);
|
|
7913
|
-
}
|
|
7914
|
-
else if (this.configName === name && this._filterConfigPromise != undefined) {
|
|
7915
|
-
Promise.all([this._filterConfigPromise])
|
|
7916
|
-
.then(result => accept(result[0]))
|
|
7917
|
-
.catch(reason => reject(reason[0]));
|
|
7918
|
-
}
|
|
7919
|
-
else {
|
|
7920
|
-
this.filterBarConfigFetcher.getConfig(this.resourceID, name)
|
|
7921
|
-
.then(config => accept(config))
|
|
7922
|
-
.catch(reason => reject(reason));
|
|
7923
|
-
}
|
|
7924
|
-
});
|
|
7925
|
-
}
|
|
7926
|
-
/**
|
|
7927
|
-
* Salva as configurações da barra de filtros
|
|
7928
|
-
*/
|
|
7929
|
-
async saveFilterBarConfig(config, name) {
|
|
7930
|
-
return this.filterBarConfigFetcher.saveConfig(config, this.resourceID, name);
|
|
7931
|
-
}
|
|
7932
|
-
async getAuthList(_auth) {
|
|
7933
|
-
return await (new MGEAuthorization()).parseFromJSON(_auth);
|
|
7934
|
-
}
|
|
7935
|
-
get urlParams() {
|
|
7936
|
-
if (!this._urlParams) {
|
|
7937
|
-
this._urlParams = UrlUtils.getQueryParams(location.search);
|
|
7938
|
-
}
|
|
7939
|
-
return this._urlParams;
|
|
7940
|
-
}
|
|
7941
|
-
get dataUnitFetcher() {
|
|
7942
|
-
if (!this._dataUnitFetcher) {
|
|
7943
|
-
this._dataUnitFetcher = new DataUnitFetcher();
|
|
7944
|
-
}
|
|
7945
|
-
return this._dataUnitFetcher;
|
|
7946
|
-
}
|
|
7947
|
-
get formConfigFetcher() {
|
|
7948
|
-
if (!this._formConfigFetcher) {
|
|
7949
|
-
this._formConfigFetcher = new FormConfigFetcher();
|
|
7950
|
-
}
|
|
7951
|
-
return this._formConfigFetcher;
|
|
7952
|
-
}
|
|
7953
|
-
get gridConfigFetcher() {
|
|
7954
|
-
if (!this._gridConfigFetcher) {
|
|
7955
|
-
this._gridConfigFetcher = new GridConfigFetcher();
|
|
7956
|
-
}
|
|
7957
|
-
return this._gridConfigFetcher;
|
|
7958
|
-
}
|
|
7959
|
-
get totalsFetcher() {
|
|
7960
|
-
if (!this._totalsFetcher) {
|
|
7961
|
-
this._totalsFetcher = new TotalsFetcher();
|
|
7962
|
-
}
|
|
7963
|
-
return this._totalsFetcher;
|
|
7964
|
-
}
|
|
7965
|
-
get pesquisaFetcher() {
|
|
7966
|
-
if (!this._pesquisaFetcher) {
|
|
7967
|
-
this._pesquisaFetcher = new PesquisaFetcher();
|
|
7968
|
-
}
|
|
7969
|
-
return this._pesquisaFetcher;
|
|
7970
|
-
}
|
|
7971
|
-
get authFetcher() {
|
|
7972
|
-
if (!this._authFetcher) {
|
|
7973
|
-
this._authFetcher = new AuthFetcher();
|
|
7974
|
-
}
|
|
7975
|
-
return this._authFetcher;
|
|
7976
|
-
}
|
|
7977
|
-
get filterBarConfigFetcher() {
|
|
7978
|
-
if (!this._filterBarConfigFetcher) {
|
|
7979
|
-
this._filterBarConfigFetcher = new FilterBarConfigFetcher();
|
|
7980
|
-
}
|
|
7981
|
-
return this._filterBarConfigFetcher;
|
|
7982
|
-
}
|
|
7983
|
-
async executeSearch(searchArgument, fieldName, dataUnit) {
|
|
7984
|
-
const descriptor = dataUnit === null || dataUnit === void 0 ? void 0 : dataUnit.getField(fieldName);
|
|
7985
|
-
if (!descriptor) {
|
|
7986
|
-
//TODO: Implementar mensagem de erro
|
|
7987
|
-
}
|
|
7988
|
-
else {
|
|
7989
|
-
const { mode, argument } = searchArgument;
|
|
7990
|
-
const { ENTITYNAME, CODEFIELD, DESCRIPTIONFIELD, ROOTENTITY, DESCRIPTIONENTITY } = descriptor.properties;
|
|
7991
|
-
const dependencies = descriptor.dependencies;
|
|
7992
|
-
let criteria;
|
|
7993
|
-
const searchOptions = {
|
|
7994
|
-
rootEntity: ROOTENTITY,
|
|
7995
|
-
descriptionFieldName: DESCRIPTIONFIELD,
|
|
7996
|
-
codeFieldName: CODEFIELD,
|
|
7997
|
-
showInactives: false
|
|
7998
|
-
};
|
|
7999
|
-
dependencies === null || dependencies === void 0 ? void 0 : dependencies.filter(dep => { var _a; return (_a = dep.masterFields) === null || _a === void 0 ? void 0 : _a.every(f => { var _a; return (_a = dataUnit.getField(f)) === null || _a === void 0 ? void 0 : _a.visible; }); }).forEach(dependency => {
|
|
8000
|
-
var _a;
|
|
8001
|
-
if (dependency.type === DependencyType.SEARCHING) {
|
|
8002
|
-
if (((_a = dependency.masterFields) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
8003
|
-
criteria = {
|
|
8004
|
-
expression: dependency.expression,
|
|
8005
|
-
params: dependency.masterFields.map(fieldName => {
|
|
8006
|
-
const masterDescriptor = dataUnit.getField(fieldName);
|
|
8007
|
-
const dataType = (masterDescriptor === null || masterDescriptor === void 0 ? void 0 : masterDescriptor.dataType) || DataType.TEXT;
|
|
8008
|
-
const value = dataUnit.getFieldValue(fieldName);
|
|
8009
|
-
if (value == undefined) {
|
|
8010
|
-
this.alert("Erro ao pesquisar", `É necessario informar o campo ${masterDescriptor.label} para executar a pesquisa.`);
|
|
8011
|
-
throw new Error(`É necessario informar o campo ${masterDescriptor.label} para executar a pesquisa.`);
|
|
8012
|
-
}
|
|
8013
|
-
return { name: fieldName, value, dataType };
|
|
8014
|
-
})
|
|
8015
|
-
};
|
|
8016
|
-
}
|
|
8017
|
-
}
|
|
8018
|
-
});
|
|
8019
|
-
return this.executePreparedSearch(mode, argument, { entity: ENTITYNAME, entityDescription: DESCRIPTIONENTITY, criteria, searchOptions });
|
|
8020
|
-
}
|
|
8021
|
-
}
|
|
8022
|
-
async executePreparedSearch(mode, argument, options) {
|
|
8023
|
-
const { entity, entityDescription, criteria, searchOptions } = options;
|
|
8024
|
-
if (mode === "ADVANCED") {
|
|
8025
|
-
return new Promise(accept => {
|
|
8026
|
-
const pesquisaContent = document.createElement("snk-pesquisa");
|
|
8027
|
-
pesquisaContent.argument = argument;
|
|
8028
|
-
pesquisaContent.searchLoader = (text) => this.pesquisaFetcher.loadAdvancedSearch(entity, text, criteria, searchOptions);
|
|
8029
|
-
pesquisaContent.selectItem = (option) => {
|
|
8030
|
-
accept(option);
|
|
8031
|
-
this.clearPopUpTitle();
|
|
8032
|
-
this.closePopUp();
|
|
8033
|
-
};
|
|
8034
|
-
this.setPopUpTitle(entityDescription);
|
|
8035
|
-
this.showPopUp(pesquisaContent);
|
|
8036
|
-
});
|
|
8037
|
-
}
|
|
8038
|
-
else {
|
|
8039
|
-
return this.pesquisaFetcher.loadSearchOptions(entity, argument, criteria, searchOptions);
|
|
8040
|
-
}
|
|
8041
|
-
}
|
|
8042
|
-
async isDebugMode() {
|
|
8043
|
-
return new Promise(accept => {
|
|
8044
|
-
accept(window['isDebugMode']);
|
|
8045
|
-
});
|
|
8046
|
-
}
|
|
8047
|
-
clearPopUpContent() {
|
|
8048
|
-
if (this._popUp) {
|
|
8049
|
-
Array.from(this._popUp.children).forEach(c => {
|
|
8050
|
-
this._popUp.removeChild(c);
|
|
8051
|
-
});
|
|
8052
|
-
}
|
|
8053
|
-
}
|
|
8054
|
-
clearPopUpTitle() {
|
|
8055
|
-
this._popUp.ezTitle = "";
|
|
8056
|
-
}
|
|
8057
|
-
setPopUpTitle(title) {
|
|
8058
|
-
this._popUp.ezTitle = title;
|
|
8059
|
-
}
|
|
8060
|
-
componentWillLoad() {
|
|
8061
|
-
this._errorHandler = new SnkErrorHandler(this);
|
|
8062
|
-
this.messagesBuilder = new SnkMessageBuilder();
|
|
8063
|
-
ApplicationContext.setContextValue("__EZUI__UPLOAD__ADD__URL__", `${UrlUtils.getUrlBase()}/mge/upload/file`);
|
|
8064
|
-
ApplicationContext.setContextValue("__EZUI__SEARCH__OPTION__LOADER__", (searchArgument, fieldName, dataUnit) => {
|
|
8065
|
-
return this.executeSearch(searchArgument, fieldName, dataUnit);
|
|
8066
|
-
});
|
|
8067
|
-
ApplicationContext.setContextValue("__EZUI__GRID_LICENSE__", agGridLicense);
|
|
8068
|
-
if (this.configName) {
|
|
8069
|
-
this._filterConfigPromise = new Promise((accept, reject) => {
|
|
8070
|
-
this.filterBarConfigFetcher.getConfig(this.resourceID, this.configName)
|
|
8071
|
-
.then(config => {
|
|
8072
|
-
this._filterBarConfig = config;
|
|
8073
|
-
accept(config);
|
|
8074
|
-
})
|
|
8075
|
-
.catch(reason => reject(reason));
|
|
8076
|
-
});
|
|
8077
|
-
}
|
|
8078
|
-
ErrorTracking.init();
|
|
8079
|
-
}
|
|
8080
|
-
connectedCallback() {
|
|
8081
|
-
ApplicationContext.setContextValue("__SNK__APPLICATION__", this);
|
|
8082
|
-
DataFetcher.addRequestListener(this._requestListener);
|
|
8083
|
-
}
|
|
8084
|
-
disconnectedCallback() {
|
|
8085
|
-
DataFetcher.removeRequestListener(this._requestListener);
|
|
8086
|
-
}
|
|
8087
|
-
componentDidLoad() {
|
|
8088
|
-
this.applicationLoading.emit(true);
|
|
8089
|
-
window.requestAnimationFrame(() => {
|
|
8090
|
-
this.applicationLoaded.emit(true);
|
|
8091
|
-
});
|
|
8092
|
-
}
|
|
8093
|
-
render() {
|
|
8094
|
-
return (h("div", null, h("ez-loading-bar", { ref: (ref) => this._requestListener.loadingBar = ref }), h("ez-popup", { opened: false, ref: (ref) => this._popUp = ref, onEzClosePopup: () => this.closePopUp() })));
|
|
8095
|
-
}
|
|
8096
|
-
};
|
|
8097
|
-
class RequestListenerLoadingBar {
|
|
8098
|
-
constructor() {
|
|
8099
|
-
this._debounceTime = 1000;
|
|
8100
|
-
this._ignoredNameTypes = ["totals"];
|
|
8101
|
-
this._countRequest = 0;
|
|
8102
|
-
}
|
|
8103
|
-
onRequestStart(param) {
|
|
8104
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8105
|
-
return;
|
|
8106
|
-
}
|
|
8107
|
-
this._countRequest++;
|
|
8108
|
-
this.loadingBar.show();
|
|
8109
|
-
if (this._timerLoading) {
|
|
8110
|
-
clearTimeout(this._timerLoading);
|
|
8111
|
-
}
|
|
8112
|
-
}
|
|
8113
|
-
;
|
|
8114
|
-
onRequestEnd(param) {
|
|
8115
|
-
if (this.isIgnoreLoadingOnRequest(param)) {
|
|
8116
|
-
return;
|
|
8117
|
-
}
|
|
8118
|
-
this._countRequest--;
|
|
8119
|
-
this._timerLoading = setTimeout(() => {
|
|
8120
|
-
if (this._countRequest <= 0) {
|
|
8121
|
-
this.loadingBar.hide();
|
|
8122
|
-
}
|
|
8123
|
-
}, this._debounceTime);
|
|
8124
|
-
}
|
|
8125
|
-
;
|
|
8126
|
-
isIgnoreLoadingOnRequest(param) {
|
|
8127
|
-
var _a;
|
|
8128
|
-
if (((_a = param === null || param === void 0 ? void 0 : param.requestBody) === null || _a === void 0 ? void 0 : _a.length) == 1) {
|
|
8129
|
-
const { name } = param.requestBody[0].variables;
|
|
8130
|
-
if (name) {
|
|
8131
|
-
const nameParts = name.split(":");
|
|
8132
|
-
const nameType = nameParts[0];
|
|
8133
|
-
return this._ignoredNameTypes.indexOf(nameType) >= 0;
|
|
8134
|
-
}
|
|
8135
|
-
}
|
|
8136
|
-
return false;
|
|
8137
|
-
}
|
|
8138
|
-
;
|
|
8139
6881
|
}
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8145
|
-
}
|
|
8146
|
-
|
|
8147
|
-
|
|
8148
|
-
export { SnkApplication as snk_application };
|
|
6882
|
+
var UserConfigType;
|
|
6883
|
+
(function (UserConfigType) {
|
|
6884
|
+
UserConfigType["USER"] = "USER";
|
|
6885
|
+
UserConfigType["DEFAULT"] = "DEFAULT";
|
|
6886
|
+
UserConfigType["SHARED"] = "SHARED";
|
|
6887
|
+
})(UserConfigType || (UserConfigType = {}));
|
|
6888
|
+
|
|
6889
|
+
export { DataFetcher as D, FormConfigFetcher as F, ResourceFetcher as R, UrlUtils as U, UserConfigType as a, dist as d };
|