@sankhyalabs/sankhyablocks 8.3.1 → 8.4.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-c9ca6658.js → ConfigStorage-f0f89379.js} +163 -51
- package/dist/cjs/{DataFetcher-7694daf2.js → DataFetcher-4798bac3.js} +78 -234
- package/dist/cjs/ISave-d68ce3cd.js +8 -0
- package/dist/cjs/PrintUtils-bcaeb82f.js +215 -0
- package/dist/cjs/ResourceIDUtils-5ff86aa7.js +12 -0
- package/dist/cjs/{SnkFormConfigManager-fb684c0e.js → SnkFormConfigManager-d5fd8800.js} +19 -21
- package/dist/cjs/{auth-fetcher-80818a0f.js → auth-fetcher-f2967437.js} +2 -2
- package/dist/cjs/{dataunit-fetcher-1acab20d.js → dataunit-fetcher-959c9a00.js} +1 -1
- package/dist/cjs/{form-config-fetcher-f10017bf.js → form-config-fetcher-5e3d3b87.js} +66 -3
- package/dist/cjs/index-f9e81701.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-c9d99342.js → pesquisa-fetcher-7973c081.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +19 -11
- package/dist/cjs/snk-application.cjs.entry.js +60 -44
- package/dist/cjs/snk-attach.cjs.entry.js +9 -14
- package/dist/cjs/snk-configurator.cjs.entry.js +2 -1
- package/dist/cjs/snk-crud.cjs.entry.js +28 -11
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
- package/dist/cjs/{snk-data-unit-e89e07bd.js → snk-data-unit-7cc1846d.js} +5 -5
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +17 -13
- package/dist/cjs/snk-entity-list.cjs.entry.js +0 -4
- package/dist/cjs/snk-filter-bar.cjs.entry.js +15 -17
- package/dist/cjs/snk-filter-detail.cjs.entry.js +7 -16
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -19
- package/dist/cjs/snk-form-config.cjs.entry.js +7 -17
- package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
- package/dist/cjs/snk-form.cjs.entry.js +13 -8
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -6
- package/dist/cjs/snk-grid.cjs.entry.js +23 -22
- package/dist/cjs/{snk-guides-viewer-5da253af.js → snk-guides-viewer-b7b680d2.js} +19 -8
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -9
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +14 -16
- package/dist/cjs/snk-print-selector.cjs.entry.js +2 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +43 -85
- package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +20 -0
- package/dist/cjs/snk-taskbar.cjs.entry.js +71 -5
- package/dist/cjs/{taskbar-elements-b98dd6e9.js → taskbar-elements-39949c7a.js} +4 -4
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-actions-button/actions/index.js +3 -4
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +8 -4
- package/dist/collection/components/snk-application/snk-application.js +120 -65
- package/dist/collection/components/snk-configurator/snk-configurator.js +19 -1
- package/dist/collection/components/snk-crud/snk-crud.js +44 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +60 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +65 -28
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +22 -6
- package/dist/collection/components/snk-entity-list/snk-entity-list.js +0 -23
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +8 -13
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +1 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +21 -16
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +28 -12
- package/dist/collection/components/snk-form/SnkFormConfigManager.js +17 -19
- package/dist/collection/components/snk-form/snk-form.js +46 -2
- package/dist/collection/components/snk-form/subcomponents/snk-form-config/snk-form-config.js +5 -15
- package/dist/collection/components/snk-grid/snk-grid.js +108 -16
- package/dist/collection/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.js +19 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +28 -12
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +23 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +4 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar-custom-elements.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +4 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +126 -5
- package/dist/collection/lib/configs/ConfigStorage.js +33 -44
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +23 -71
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +47 -32
- package/dist/collection/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.js +0 -24
- package/dist/collection/lib/index.js +10 -0
- package/dist/collection/lib/resourceid/ResourceIDUtils.js +7 -0
- package/dist/collection/lib/utils/PrintUtils.js +18 -9
- package/dist/collection/lib/utils/urlutils.js +29 -0
- package/dist/components/ConfigStorage.js +161 -48
- package/dist/components/DataFetcher.js +79 -234
- package/dist/components/PrintUtils.js +213 -0
- package/dist/components/ResourceIDUtils.js +10 -0
- package/dist/components/SnkFormConfigManager.js +17 -19
- package/dist/components/auth-fetcher.js +1 -1
- package/dist/components/form-config-fetcher.js +64 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-actions-button2.js +23 -9
- package/dist/components/snk-application2.js +145 -129
- package/dist/components/snk-attach2.js +1 -8
- package/dist/components/snk-configurator2.js +3 -1
- package/dist/components/snk-crud.js +27 -8
- package/dist/components/snk-data-unit2.js +6 -5
- package/dist/components/snk-detail-view2.js +26 -10
- package/dist/components/snk-entity-list.js +0 -4
- package/dist/components/snk-filter-bar2.js +12 -12
- package/dist/components/snk-filter-detail2.js +8 -13
- package/dist/components/snk-filter-modal-item2.js +5 -16
- package/dist/components/snk-form-config2.js +5 -15
- package/dist/components/snk-form-view2.js +6 -1
- package/dist/components/snk-form.js +9 -2
- package/dist/components/snk-grid-config2.js +4 -2
- package/dist/components/snk-grid2.js +24 -17
- package/dist/components/snk-personalized-filter2.js +11 -11
- package/dist/components/snk-print-selector.js +1 -1
- package/dist/components/snk-simple-crud2.js +30 -73
- package/dist/components/snk-taskbar-custom-elements.d.ts +11 -0
- package/dist/components/snk-taskbar-custom-elements.js +35 -0
- package/dist/components/snk-taskbar2.js +81 -9
- package/dist/esm/{ConfigStorage-6887ede4.js → ConfigStorage-4441aa3d.js} +162 -49
- package/dist/esm/{DataFetcher-731430d9.js → DataFetcher-1618bffe.js} +79 -234
- package/dist/esm/ISave-4412b20c.js +8 -0
- package/dist/esm/PrintUtils-3e4ff0f5.js +213 -0
- package/dist/esm/ResourceIDUtils-a114189a.js +10 -0
- package/dist/esm/{SnkFormConfigManager-6acecf9f.js → SnkFormConfigManager-5a5f85a3.js} +19 -21
- package/dist/esm/{auth-fetcher-82d89fe6.js → auth-fetcher-7861187e.js} +1 -1
- package/dist/esm/{dataunit-fetcher-ad7a1a3e.js → dataunit-fetcher-53c007be.js} +1 -1
- package/dist/esm/{form-config-fetcher-9560730a.js → form-config-fetcher-2fe67341.js} +65 -3
- package/dist/esm/index-a7d3d3f1.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-27dc20ed.js → pesquisa-fetcher-19e81fc8.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +19 -11
- package/dist/esm/snk-application.entry.js +60 -44
- package/dist/esm/snk-attach.entry.js +5 -10
- package/dist/esm/snk-configurator.entry.js +2 -1
- package/dist/esm/snk-crud.entry.js +30 -13
- package/dist/esm/snk-data-exporter.entry.js +3 -2
- package/dist/esm/{snk-data-unit-8c4d944d.js → snk-data-unit-1715d2f1.js} +5 -5
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +17 -13
- package/dist/esm/snk-entity-list.entry.js +0 -4
- package/dist/esm/snk-filter-bar.entry.js +15 -17
- package/dist/esm/snk-filter-detail.entry.js +8 -17
- package/dist/esm/snk-filter-modal-item.entry.js +7 -20
- package/dist/esm/snk-form-config.entry.js +8 -18
- package/dist/esm/snk-form-view.entry.js +6 -1
- package/dist/esm/snk-form.entry.js +13 -8
- package/dist/esm/snk-grid-config.entry.js +6 -6
- package/dist/esm/snk-grid.entry.js +23 -22
- package/dist/esm/{snk-guides-viewer-d3623a1f.js → snk-guides-viewer-e4fe884d.js} +19 -8
- package/dist/esm/snk-guides-viewer.entry.js +10 -9
- package/dist/esm/snk-personalized-filter.entry.js +14 -16
- package/dist/esm/snk-print-selector.entry.js +1 -3
- package/dist/esm/snk-simple-crud.entry.js +34 -76
- package/dist/esm/snk-taskbar-custom-elements.entry.js +16 -0
- package/dist/esm/snk-taskbar.entry.js +71 -5
- package/dist/esm/{taskbar-elements-2c761819.js → taskbar-elements-0a6b8b95.js} +4 -4
- package/dist/sankhyablocks/p-0b99a775.entry.js +1 -0
- package/dist/sankhyablocks/p-1e30c376.entry.js +1 -0
- package/dist/sankhyablocks/p-1fa3acbe.entry.js +1 -0
- package/dist/sankhyablocks/p-27dbbb3a.entry.js +1 -0
- package/dist/sankhyablocks/p-29b1d77b.entry.js +11 -0
- package/dist/sankhyablocks/p-324ce41e.entry.js +1 -0
- package/dist/sankhyablocks/p-34604220.entry.js +1 -0
- package/dist/sankhyablocks/p-41820e28.entry.js +1 -0
- package/dist/sankhyablocks/p-4352324d.entry.js +1 -0
- package/dist/sankhyablocks/{p-f6b98398.js → p-449d25e0.js} +2 -2
- package/dist/sankhyablocks/p-5051a23a.entry.js +1 -0
- package/dist/sankhyablocks/p-5526ab67.js +1 -0
- package/dist/sankhyablocks/p-5b2ee1d3.js +1 -0
- package/dist/sankhyablocks/p-5da848bb.js +26 -0
- package/dist/sankhyablocks/p-6098d844.entry.js +1 -0
- package/dist/sankhyablocks/p-648a7c72.entry.js +1 -0
- package/dist/sankhyablocks/p-688dcb4c.js +1 -0
- package/dist/sankhyablocks/p-72fc257b.entry.js +1 -0
- package/dist/sankhyablocks/p-7d6eca73.entry.js +1 -0
- package/dist/sankhyablocks/p-81a7f74c.js +1 -0
- package/dist/sankhyablocks/p-8d884fab.js +1 -0
- package/dist/sankhyablocks/p-90b5d1af.entry.js +1 -0
- package/dist/sankhyablocks/p-989937ee.entry.js +1 -0
- package/dist/sankhyablocks/p-9a270401.entry.js +1 -0
- package/dist/sankhyablocks/p-9e7d65a4.js +1 -0
- package/dist/sankhyablocks/{p-1bed2c42.js → p-a75e892a.js} +1 -1
- package/dist/sankhyablocks/p-a81996df.js +1 -0
- package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
- package/dist/sankhyablocks/{p-a2493d11.js → p-c9841939.js} +1 -1
- package/dist/sankhyablocks/p-ca1522bc.entry.js +1 -0
- package/dist/sankhyablocks/p-cbed6235.entry.js +1 -0
- package/dist/sankhyablocks/p-d4f9ee17.entry.js +1 -0
- package/dist/sankhyablocks/p-daa687aa.js +56 -0
- package/dist/sankhyablocks/p-e1cb1f0b.js +1 -0
- package/dist/sankhyablocks/p-eb1a650a.entry.js +1 -0
- package/dist/sankhyablocks/p-f784010c.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/actions/index.d.ts +2 -1
- package/dist/types/components/snk-application/snk-application.d.ts +9 -22
- package/dist/types/components/snk-configurator/snk-configurator.d.ts +4 -0
- package/dist/types/components/snk-crud/snk-crud.d.ts +6 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +12 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -2
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
- package/dist/types/components/snk-entity-list/snk-entity-list.d.ts +0 -4
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +0 -3
- package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +1 -1
- package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +5 -4
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +4 -0
- package/dist/types/components/snk-form/SnkFormConfigManager.d.ts +5 -4
- package/dist/types/components/snk-form/snk-form.d.ts +9 -1
- package/dist/types/components/snk-form/subcomponents/snk-form-config/snk-form-config.d.ts +0 -2
- package/dist/types/components/snk-grid/snk-grid.d.ts +17 -1
- package/dist/types/components/snk-grid/subcomponents/snk-grid-config/snk-grid-config.d.ts +4 -0
- package/dist/types/components/snk-personalized-filter/snk-personalized-filter.d.ts +5 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +2 -2
- package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +7 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +27 -0
- package/dist/types/components.d.ts +203 -22
- package/dist/types/lib/configs/ConfigStorage.d.ts +11 -13
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +2 -8
- package/dist/types/lib/http/data-fetcher/DataFetcher.d.ts +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/filter-bar-config-fetcher.d.ts +0 -1
- package/dist/types/lib/index.d.ts +11 -0
- package/dist/types/lib/resourceid/ResourceIDUtils.d.ts +3 -0
- package/dist/types/lib/utils/PrintUtils.d.ts +1 -0
- package/dist/types/lib/utils/urlutils.d.ts +14 -0
- package/package.json +2 -2
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/filter-bar-config-fetcher-f13a1aff.js +0 -155
- package/dist/cjs/resource-fetcher-a6e6c5fd.js +0 -68
- package/dist/components/filter-bar-config-fetcher.js +0 -153
- package/dist/components/resource-fetcher.js +0 -66
- package/dist/esm/filter-bar-config-fetcher-553c5463.js +0 -153
- package/dist/esm/resource-fetcher-0586b1fc.js +0 -66
- package/dist/sankhyablocks/p-000d073b.entry.js +0 -1
- package/dist/sankhyablocks/p-162f5d21.entry.js +0 -1
- package/dist/sankhyablocks/p-1dc76c50.js +0 -1
- package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
- package/dist/sankhyablocks/p-24b18442.entry.js +0 -1
- package/dist/sankhyablocks/p-301d4e34.js +0 -1
- package/dist/sankhyablocks/p-4374bc89.entry.js +0 -1
- package/dist/sankhyablocks/p-564efc43.js +0 -1
- package/dist/sankhyablocks/p-5fe223c9.entry.js +0 -1
- package/dist/sankhyablocks/p-61651a40.entry.js +0 -1
- package/dist/sankhyablocks/p-70d4a90a.entry.js +0 -1
- package/dist/sankhyablocks/p-7bd353de.entry.js +0 -1
- package/dist/sankhyablocks/p-837831c2.js +0 -56
- package/dist/sankhyablocks/p-85ec10c9.entry.js +0 -1
- package/dist/sankhyablocks/p-89d46727.entry.js +0 -1
- package/dist/sankhyablocks/p-8e8b5fc7.js +0 -1
- package/dist/sankhyablocks/p-8e96581f.js +0 -17
- package/dist/sankhyablocks/p-9b2af526.entry.js +0 -1
- package/dist/sankhyablocks/p-9db7e50a.js +0 -10
- package/dist/sankhyablocks/p-a2f32d4e.entry.js +0 -1
- package/dist/sankhyablocks/p-a7eaea51.entry.js +0 -1
- package/dist/sankhyablocks/p-a84b1ca2.entry.js +0 -1
- package/dist/sankhyablocks/p-befbc9ee.entry.js +0 -1
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +0 -1
- package/dist/sankhyablocks/p-c3943e7e.entry.js +0 -11
- package/dist/sankhyablocks/p-c6380ea2.entry.js +0 -1
- package/dist/sankhyablocks/p-c7d1e26a.js +0 -1
- package/dist/sankhyablocks/p-cd40ab53.entry.js +0 -1
- package/dist/sankhyablocks/p-d41198ff.js +0 -1
- package/dist/sankhyablocks/p-de69b4b0.entry.js +0 -1
- package/dist/sankhyablocks/p-f9f385eb.entry.js +0 -1
@@ -2,14 +2,19 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-f9e81701.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-d5fd8800.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
9
9
|
const constants = require('./constants-d187e03e.js');
|
10
|
-
require('./DataFetcher-
|
11
|
-
require('./pesquisa-fetcher-
|
10
|
+
require('./DataFetcher-4798bac3.js');
|
11
|
+
require('./pesquisa-fetcher-7973c081.js');
|
12
12
|
const index$1 = require('./index-0e663819.js');
|
13
|
+
require('./ISave-d68ce3cd.js');
|
14
|
+
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
15
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
16
|
+
require('./filter-item-type.enum-aa823a00.js');
|
17
|
+
require('./form-config-fetcher-5e3d3b87.js');
|
13
18
|
const DataUnit = require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
14
19
|
|
15
20
|
const snkGuidesViewerCss = ".sc-snk-guides-viewer-h{--snk-guides-viewer--space-large:var(--space--large, 24px);--snk-guides-viewer--space-medium:var(--space--medium, 12px);--snk-guides-viewer__header--min-height:94px;--snk-guides-viewer__header--z-index:var(--more-visible, 2);--snk-guides-viewer__header--background-color:var(--background--body, #fafcff);--snk-guides-viewer__guide-navigator--width:340px;display:block}snk-form-view.sc-snk-guides-viewer{width:100%}.snk-guides-viewer.sc-snk-guides-viewer{position:relative;padding-left:0px;padding-top:0px;padding-right:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__detail-container.sc-snk-guides-viewer{display:flex;row-gap:24px;flex-direction:column}.snk-guides-viewer__header.sc-snk-guides-viewer{position:sticky;align-items:center;top:0;z-index:var(--snk-guides-viewer__header--z-index);background-color:var(--snk-guides-viewer__header--background-color);min-height:var(--snk-guides-viewer__header--min-height);width:calc(100% + (var(--snk-guides-viewer--space-large) * 2));padding-left:var(--snk-guides-viewer--space-large);padding-right:var(--snk-guides-viewer--space-large);padding-top:var(--snk-guides-viewer--space-large);padding-bottom:var(--snk-guides-viewer--space-medium);margin-left:calc(var(--snk-guides-viewer--space-large) * -1);margin-right:calc(var(--snk-guides-viewer--space-large) * -1);margin-bottom:var(--snk-guides-viewer--space-medium)}.snk-guides-viewer__container.sc-snk-guides-viewer{display:grid;grid-template-columns:minmax(0, auto) minmax(0, 100%);height:100%;column-gap:var(--snk-guides-viewer--space-large)}.snk-guides-viewer__guide-navigator.sc-snk-guides-viewer{position:sticky;top:calc(var(--snk-guides-viewer__header--min-height) + var(--snk-guides-viewer--space-medium));height:calc(100vh - var(--snk-guides-viewer__header--min-height) - var(--snk-guides-viewer--space-large) - var(--snk-guides-viewer--space-medium))}.snk-guides-viewer__guide-navigator[open].sc-snk-guides-viewer{width:var(--snk-guides-viewer__guide-navigator--width);max-width:var(--snk-guides-viewer__guide-navigator--width);min-width:var(--snk-guides-viewer__guide-navigator--width)}.snk-guides-viewer__detail-content.sc-snk-guides-viewer{min-height:100%;align-items:flex-start;align-content:flex-start}";
|
@@ -20,6 +25,7 @@ const SnkGuidesViewer = class {
|
|
20
25
|
index.registerInstance(this, hostRef);
|
21
26
|
this.exit = index.createEvent(this, "exit", 7);
|
22
27
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
28
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
23
29
|
this._guideBuilders = new Map();
|
24
30
|
this.dataUnit = undefined;
|
25
31
|
this.dataState = undefined;
|
@@ -33,6 +39,8 @@ const SnkGuidesViewer = class {
|
|
33
39
|
this.messagesBuilder = undefined;
|
34
40
|
this.canEdit = true;
|
35
41
|
this.presentationMode = undefined;
|
42
|
+
this.resourceID = undefined;
|
43
|
+
this.detailTaskbarCustomContainerId = undefined;
|
36
44
|
this._breadcrumbItems = [];
|
37
45
|
this._guides = undefined;
|
38
46
|
this._formEditorConfigManager = undefined;
|
@@ -234,7 +242,7 @@ const SnkGuidesViewer = class {
|
|
234
242
|
else {
|
235
243
|
detailBranch = this.selectedGuide;
|
236
244
|
}
|
237
|
-
content = this.wrapDetail(levels, index.h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail) }));
|
245
|
+
content = this.wrapDetail(levels, index.h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId }));
|
238
246
|
}
|
239
247
|
else {
|
240
248
|
const cardId = this.selectedGuide.id;
|
@@ -283,7 +291,10 @@ const SnkGuidesViewer = class {
|
|
283
291
|
return this.selectedGuide === undefined || '__main' === ((_a = this.selectedGuide) === null || _a === void 0 ? void 0 : _a.id);
|
284
292
|
}
|
285
293
|
componentWillLoad() {
|
286
|
-
|
294
|
+
if (this.resourceID == undefined) {
|
295
|
+
throw new Error("Erro interno: resourceID não informado");
|
296
|
+
}
|
297
|
+
this._configManager = new SnkFormConfigManager.SnkFormConfigManager(this.configName, this.resourceID, config => this.masterFormConfig = config);
|
287
298
|
this._configManager.loadConfig();
|
288
299
|
}
|
289
300
|
componentDidRender() {
|
@@ -302,7 +313,7 @@ const SnkGuidesViewer = class {
|
|
302
313
|
}
|
303
314
|
buildTaskBar() {
|
304
315
|
var _a;
|
305
|
-
return index.h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != index$1.PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, index.h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit }));
|
316
|
+
return index.h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != index$1.PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, index.h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }, index.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
306
317
|
}
|
307
318
|
render() {
|
308
319
|
var _a, _b;
|
@@ -321,7 +332,7 @@ const SnkGuidesViewer = class {
|
|
321
332
|
index.h("div", { class: "ez-margin-top--extra-small" }, index.h("ez-breadcrumb", Object.assign({ items: this._breadcrumbItems, onSelectedItem: (evt) => this.onBreadcrumbClickHandler(evt === null || evt === void 0 ? void 0 : evt.detail) }, { [core.ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${core.ElementIDUtils.getInternalIDInfo("breadcrumb")}` }))))), this.presentationMode != index$1.PresentationMode.SECONDARY && this.buildTaskBar()), index.h("div", { class: "snk-guides-viewer__container" }, showGuides ?
|
322
333
|
index.h("ez-guide-navigator", { ref: (ref) => this._guideNavigator = ref, class: "snk-guides-viewer__guide-navigator", items: this._guides, selectedId: this.selectedGuide ? this.selectedGuide.id : undefined, onEzSelectionChange: evt => this.updateSelectedGuideHandler(evt.detail) })
|
323
334
|
:
|
324
|
-
index.h("div", null), index.h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail) })));
|
335
|
+
index.h("div", null), index.h("div", { class: "snk-guides-viewer__detail-container" }, SnkGuidesViewer.buildFixedForms(this.masterFormConfig, this._masterFormMetadata, (_b = this.selectedGuide) === null || _b === void 0 ? void 0 : _b.id, this.dataUnit, this.recordsValidator), this.getContent())), index.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, viewMode: this.getConfigViewMode(), onConfigSelected: (evt) => this.changeConfigViewMode(evt.detail), messagesBuilder: this.messagesBuilder, onOpenConfig: (evt) => this.openConfig(evt.detail), resourceID: this.resourceID })));
|
325
336
|
}
|
326
337
|
static get watchers() { return {
|
327
338
|
"dataUnit": ["observeDataUnit"],
|
@@ -2,25 +2,26 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
5
|
+
const snkGuidesViewer = require('./snk-guides-viewer-b7b680d2.js');
|
6
6
|
require('./index-f9e81701.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
9
|
-
require('./ConfigStorage-
|
10
|
-
require('./form-config-fetcher-
|
11
|
-
require('./DataFetcher-
|
8
|
+
require('./SnkFormConfigManager-d5fd8800.js');
|
9
|
+
require('./ConfigStorage-f0f89379.js');
|
10
|
+
require('./form-config-fetcher-5e3d3b87.js');
|
11
|
+
require('./DataFetcher-4798bac3.js');
|
12
12
|
require('./_commonjsHelpers-537d719a.js');
|
13
13
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
14
|
-
require('./
|
15
|
-
require('./filter-bar-config-fetcher-f13a1aff.js');
|
14
|
+
require('./PrintUtils-bcaeb82f.js');
|
16
15
|
require('./filter-item-type.enum-aa823a00.js');
|
17
16
|
require('@sankhyalabs/ezui/dist/collection/utils/form');
|
18
17
|
require('./taskbar-processor-bce3f499.js');
|
19
|
-
require('./taskbar-elements-
|
18
|
+
require('./taskbar-elements-39949c7a.js');
|
20
19
|
require('./index-0e663819.js');
|
21
20
|
require('./index-102ba62d.js');
|
22
21
|
require('./constants-d187e03e.js');
|
23
|
-
require('./pesquisa-fetcher-
|
22
|
+
require('./pesquisa-fetcher-7973c081.js');
|
23
|
+
require('./ISave-d68ce3cd.js');
|
24
|
+
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
24
25
|
require('@sankhyalabs/core/dist/dataunit/DataUnit');
|
25
26
|
|
26
27
|
|
@@ -5,17 +5,16 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-1aeb625d.js');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-f0f89379.js');
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
10
10
|
const index$1 = require('./index-c5771aba.js');
|
11
11
|
const index$2 = require('./index-102ba62d.js');
|
12
12
|
require('./filter-item-type.enum-aa823a00.js');
|
13
|
-
require('./form-config-fetcher-
|
14
|
-
require('./DataFetcher-
|
13
|
+
require('./form-config-fetcher-5e3d3b87.js');
|
14
|
+
require('./DataFetcher-4798bac3.js');
|
15
15
|
require('./_commonjsHelpers-537d719a.js');
|
16
16
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
17
|
-
require('./
|
18
|
-
require('./filter-bar-config-fetcher-f13a1aff.js');
|
17
|
+
require('./PrintUtils-bcaeb82f.js');
|
19
18
|
|
20
19
|
const snkPersonalizedFilterCss = ".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";
|
21
20
|
|
@@ -45,6 +44,7 @@ const SnkPersonalizedFilter = class {
|
|
45
44
|
this.entityUri = undefined;
|
46
45
|
this.filterId = undefined;
|
47
46
|
this.configName = undefined;
|
47
|
+
this.resourceID = undefined;
|
48
48
|
}
|
49
49
|
/*
|
50
50
|
* Cria um novo filtro se não houver nenhum filtro existente
|
@@ -81,17 +81,15 @@ const SnkPersonalizedFilter = class {
|
|
81
81
|
this._filterAssistent = core.ObjectUtils.copy(newPersonalizedFilter);
|
82
82
|
}
|
83
83
|
loadFilter(newValue, oldValue) {
|
84
|
-
if (newValue == null || oldValue == newValue) {
|
84
|
+
if (newValue == null || oldValue == newValue || this.resourceID == undefined) {
|
85
85
|
return;
|
86
86
|
}
|
87
|
-
ConfigStorage.ConfigStorage.
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
94
|
-
});
|
87
|
+
ConfigStorage.ConfigStorage.loadPersonalizedFilter(newValue, this.resourceID, this.configName)
|
88
|
+
.then((resp) => {
|
89
|
+
const personalizedFilter = this.addLabelToItems(resp);
|
90
|
+
this._filterAssistent = personalizedFilter;
|
91
|
+
this._originalFilterAssistent = core.ObjectUtils.copy(personalizedFilter);
|
92
|
+
this._filterAssistentMode = this._filterAssistent.hasOwnProperty("assistent") && this._filterAssistent.assistent != undefined;
|
95
93
|
});
|
96
94
|
}
|
97
95
|
componentWillLoad() {
|
@@ -116,7 +114,7 @@ const SnkPersonalizedFilter = class {
|
|
116
114
|
return this._application.messagesBuilder.getMessage(key, params);
|
117
115
|
}
|
118
116
|
saveFilter() {
|
119
|
-
ConfigStorage.ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.configName).then((personalizedFilter) => {
|
117
|
+
ConfigStorage.ConfigStorage.savePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName).then((personalizedFilter) => {
|
120
118
|
this._elButtonSave.enabled = false;
|
121
119
|
const messageToken = !!this._filterAssistent.id ? 'confirmEdit' : 'confirmSave';
|
122
120
|
utils.ApplicationUtils.info(this.getMessage(`snkPersonalizedFilter.${messageToken}.title`), { iconName: "check" });
|
@@ -127,7 +125,7 @@ const SnkPersonalizedFilter = class {
|
|
127
125
|
});
|
128
126
|
}
|
129
127
|
removeFilter() {
|
130
|
-
ConfigStorage.ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.configName);
|
128
|
+
ConfigStorage.ConfigStorage.removePersonalizedFilter(this._filterAssistent, this.resourceID, this.configName);
|
131
129
|
}
|
132
130
|
hasChangesToSave() {
|
133
131
|
return JSON.stringify(this._filterAssistent) === JSON.stringify(this._originalFilterAssistent);
|
@@ -3,12 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
|
-
const
|
6
|
+
const PrintUtils = require('./PrintUtils-bcaeb82f.js');
|
7
7
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
8
8
|
const core = require('@sankhyalabs/core');
|
9
9
|
const ModalButtonStatus = require('@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status');
|
10
|
-
require('./_commonjsHelpers-537d719a.js');
|
11
|
-
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
12
10
|
|
13
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
14
12
|
|
@@ -117,7 +115,7 @@ const SnkPrintSelector = class {
|
|
117
115
|
buildLocalPrinters() {
|
118
116
|
if (this._localPrintersDataSource.length > 0)
|
119
117
|
return;
|
120
|
-
this._localPrinters =
|
118
|
+
this._localPrinters = PrintUtils.PrintUtils.getInstance().getLocalPrinters();
|
121
119
|
this._localPrintersDataSource = this._localPrinters.map((printer) => ({
|
122
120
|
label: printer.nome
|
123
121
|
}));
|
@@ -4,44 +4,62 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const constants
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
9
|
-
require('./DataFetcher-
|
10
|
-
require('./pesquisa-fetcher-
|
7
|
+
const constants = require('./constants-d187e03e.js');
|
8
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
9
|
+
require('./DataFetcher-4798bac3.js');
|
10
|
+
require('./pesquisa-fetcher-7973c081.js');
|
11
11
|
const index$1 = require('./index-0e663819.js');
|
12
|
+
require('./ISave-d68ce3cd.js');
|
13
|
+
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
|
+
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
15
|
+
require('./filter-item-type.enum-aa823a00.js');
|
16
|
+
require('./form-config-fetcher-5e3d3b87.js');
|
12
17
|
const taskbarProcessor = require('./taskbar-processor-bce3f499.js');
|
13
|
-
const constants = require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
14
18
|
const SnkMultiSelectionListDataSource = require('./SnkMultiSelectionListDataSource-804ff4c7.js');
|
15
19
|
require('./index-102ba62d.js');
|
16
20
|
require('./_commonjsHelpers-537d719a.js');
|
17
|
-
require('
|
21
|
+
require('./PrintUtils-bcaeb82f.js');
|
18
22
|
|
19
23
|
class InMemoryLoader {
|
20
24
|
constructor(metadata, records) {
|
21
|
-
this.records = records
|
25
|
+
this.records = records;
|
22
26
|
this.metadata = metadata;
|
23
27
|
this._dataUnit = new core.DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
24
28
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
25
|
-
this._dataUnit.dataLoader = (dataUnit, request) =>
|
29
|
+
this._dataUnit.dataLoader = (dataUnit, request) => core.defaultDataLoader(dataUnit, request, this.getRecordsToLoad());
|
26
30
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
27
31
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
28
32
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
29
33
|
}
|
34
|
+
getRecordsToLoad() {
|
35
|
+
if (this._initialRecords) {
|
36
|
+
try {
|
37
|
+
return this._initialRecords;
|
38
|
+
}
|
39
|
+
finally {
|
40
|
+
this._initialRecords = undefined;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
return this.dataUnit.records;
|
44
|
+
}
|
30
45
|
get dataUnit() {
|
31
46
|
return this._dataUnit;
|
32
47
|
}
|
33
48
|
get records() {
|
34
|
-
return this.
|
49
|
+
return this.dataUnit.records;
|
35
50
|
}
|
36
51
|
set records(records) {
|
37
|
-
|
52
|
+
const newRecords = records === null || records === void 0 ? void 0 : records.map(record => {
|
38
53
|
if (!record["__record__id__"]) {
|
39
54
|
record["__record__id__"] = this.generateUniqueId();
|
40
55
|
}
|
41
56
|
return record;
|
42
57
|
});
|
43
58
|
if (this._dataUnit) {
|
44
|
-
this._dataUnit.records =
|
59
|
+
this._dataUnit.records = newRecords;
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
this._initialRecords = newRecords;
|
45
63
|
}
|
46
64
|
}
|
47
65
|
get metadata() {
|
@@ -59,76 +77,16 @@ class InMemoryLoader {
|
|
59
77
|
metadaLoader() {
|
60
78
|
return Promise.resolve(this._metadata);
|
61
79
|
}
|
62
|
-
dataLoader(dataUnit, request) {
|
63
|
-
const filters = this.getColumnFilters(dataUnit);
|
64
|
-
let records = this.applyFilters(filters);
|
65
|
-
if (request.sort) {
|
66
|
-
request.sort.forEach(sort => {
|
67
|
-
records = records.sort((recordA, recordB) => {
|
68
|
-
const fieldA = recordA[sort.field];
|
69
|
-
const fieldB = recordB[sort.field];
|
70
|
-
const sortFn = this.getSortFn(sort.dataType);
|
71
|
-
return sortFn(fieldA, fieldB) * (sort.mode == core.SortMode.ASC ? 1 : -1);
|
72
|
-
});
|
73
|
-
});
|
74
|
-
}
|
75
|
-
return Promise.resolve({ records: records });
|
76
|
-
}
|
77
|
-
applyFilters(filters) {
|
78
|
-
let records = [...this._records];
|
79
|
-
filters.forEach(filter => {
|
80
|
-
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
81
|
-
});
|
82
|
-
return records;
|
83
|
-
}
|
84
|
-
getColumnFilters(dataUnit) {
|
85
|
-
var _a, _b;
|
86
|
-
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
87
|
-
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(constants.DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
88
|
-
return columnFilters.map(filter => {
|
89
|
-
var _a, _b;
|
90
|
-
return {
|
91
|
-
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(constants.DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
92
|
-
values: filter.params.map(param => param.value),
|
93
|
-
};
|
94
|
-
});
|
95
|
-
}
|
96
|
-
getSortFn(type) {
|
97
|
-
switch (type) {
|
98
|
-
case core.DataType.NUMBER:
|
99
|
-
return this.sortNumber;
|
100
|
-
case core.DataType.DATE:
|
101
|
-
return this.sortDate;
|
102
|
-
case core.DataType.OBJECT:
|
103
|
-
return this.sortObject;
|
104
|
-
default:
|
105
|
-
return core.StringUtils.compare;
|
106
|
-
}
|
107
|
-
}
|
108
|
-
sortObject(a, b) {
|
109
|
-
return core.StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
|
110
|
-
}
|
111
|
-
sortNumber(a, b) {
|
112
|
-
return a - b;
|
113
|
-
}
|
114
|
-
sortDate(a, b) {
|
115
|
-
let timeA = a.getTime(), timeB = b.getTime();
|
116
|
-
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
117
|
-
}
|
118
80
|
saveLoader(_dataUnit, changes) {
|
119
81
|
return new Promise((resolve) => {
|
120
82
|
let dataUnitRecords = [];
|
121
83
|
changes.forEach(change => {
|
122
84
|
let { record, updatingFields, operation } = change;
|
123
|
-
|
85
|
+
const changedRecord = Object.assign(Object.assign({}, record), updatingFields);
|
124
86
|
if (operation === core.ChangeOperation.INSERT ||
|
125
87
|
operation === core.ChangeOperation.COPY) {
|
126
|
-
|
127
|
-
|
128
|
-
isAdd = true;
|
129
|
-
}
|
130
|
-
const changedRecord = Object.assign(Object.assign({}, record), updatingFields);
|
131
|
-
if (isAdd) {
|
88
|
+
changedRecord["__old__id__"] = record["__record__id__"];
|
89
|
+
changedRecord["__record__id__"] = this.generateUniqueId();
|
132
90
|
this.records.push(changedRecord);
|
133
91
|
}
|
134
92
|
else {
|
@@ -142,7 +100,6 @@ class InMemoryLoader {
|
|
142
100
|
}
|
143
101
|
removeLoader(_dataUnit, recordIds) {
|
144
102
|
return new Promise((resolve) => {
|
145
|
-
this._records = this._records.filter(record => !recordIds.includes(record["__record__id__"]));
|
146
103
|
resolve(recordIds);
|
147
104
|
});
|
148
105
|
}
|
@@ -157,6 +114,7 @@ const SnkSimpleCrud = class {
|
|
157
114
|
this.dataStateChange = index.createEvent(this, "dataStateChange", 3);
|
158
115
|
this.dataUnitReady = index.createEvent(this, "dataUnitReady", 3);
|
159
116
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
117
|
+
this.formItemsReady = index.createEvent(this, "formItemsReady", 7);
|
160
118
|
this.REGULAR_DEFAULT_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER"];
|
161
119
|
this.REGULAR_SELECTED_BTNS = ["INSERT", "REFRESH", "PREVIOUS", "NEXT", "DIVIDER", "CLONE", "REMOVE", "DIVIDER"];
|
162
120
|
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource.SnkMultiSelectionListDataSource();
|
@@ -167,11 +125,11 @@ const SnkSimpleCrud = class {
|
|
167
125
|
"snkSimpleCrudTaskbar.grid_selected": this.resolveInMemoryBtns(this.REGULAR_SELECTED_BTNS).concat(taskbarElements.TaskbarElement.FORM_MODE),
|
168
126
|
"snkSimpleCrudTaskbar.finish_edition": ["CANCEL", "SAVE"]
|
169
127
|
});
|
170
|
-
this._currentViewMode = constants
|
128
|
+
this._currentViewMode = constants.VIEW_MODE.GRID;
|
171
129
|
this._config = undefined;
|
172
130
|
this.dataState = undefined;
|
173
131
|
this.dataUnit = undefined;
|
174
|
-
this.mode = constants
|
132
|
+
this.mode = constants.SIMPLE_CRUD_MODE.SERVER;
|
175
133
|
this.gridConfig = undefined;
|
176
134
|
this.formConfig = undefined;
|
177
135
|
this.multipleSelection = undefined;
|
@@ -182,7 +140,7 @@ const SnkSimpleCrud = class {
|
|
182
140
|
}
|
183
141
|
resolveInMemoryBtns(taskbarButtons) {
|
184
142
|
const newTaskBarConfig = [...taskbarButtons];
|
185
|
-
if (this.mode === constants
|
143
|
+
if (this.mode === constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
186
144
|
newTaskBarConfig.splice(1, 1);
|
187
145
|
}
|
188
146
|
return newTaskBarConfig;
|
@@ -199,15 +157,15 @@ const SnkSimpleCrud = class {
|
|
199
157
|
actionClickListener(evt) {
|
200
158
|
const act = evt.detail;
|
201
159
|
if (act === taskbarElements.TaskbarElement.GRID_MODE) {
|
202
|
-
this.goToView(constants
|
160
|
+
this.goToView(constants.VIEW_MODE.GRID);
|
203
161
|
}
|
204
162
|
else if (act === taskbarElements.TaskbarElement.FORM_MODE) {
|
205
|
-
this.goToView(constants
|
163
|
+
this.goToView(constants.VIEW_MODE.FORM);
|
206
164
|
}
|
207
165
|
evt.stopPropagation();
|
208
166
|
}
|
209
167
|
onModeChange() {
|
210
|
-
if (this.mode == constants
|
168
|
+
if (this.mode == constants.SIMPLE_CRUD_MODE.IN_MEMORY) {
|
211
169
|
this.initInMemoryDataUnit();
|
212
170
|
}
|
213
171
|
}
|
@@ -237,9 +195,9 @@ const SnkSimpleCrud = class {
|
|
237
195
|
if (((_b = this.dataState) === null || _b === void 0 ? void 0 : _b.selectionInfo) &&
|
238
196
|
!this.dataState.selectionInfo.isAllRecords() &&
|
239
197
|
((_c = this.dataState.selectionInfo.records) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
240
|
-
return this._currentViewMode === constants
|
198
|
+
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_selected" : "snkSimpleCrudTaskbar.form_selected";
|
241
199
|
}
|
242
|
-
return this._currentViewMode === constants
|
200
|
+
return this._currentViewMode === constants.VIEW_MODE.GRID ? "snkSimpleCrudTaskbar.grid_regular" : "snkSimpleCrudTaskbar.form_regular";
|
243
201
|
}
|
244
202
|
initInMemoryDataUnit() {
|
245
203
|
this._inMemoryLoader = new InMemoryLoader(this._metadata);
|
@@ -317,13 +275,13 @@ const SnkSimpleCrud = class {
|
|
317
275
|
handleCancelEdit() {
|
318
276
|
var _a;
|
319
277
|
if ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.recordsIsEmpty) {
|
320
|
-
this.goToView(constants
|
278
|
+
this.goToView(constants.VIEW_MODE.GRID);
|
321
279
|
this.dataUnit.clearSelection();
|
322
280
|
}
|
323
281
|
}
|
324
282
|
render() {
|
325
283
|
var _a;
|
326
|
-
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants
|
284
|
+
return (index.h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(constants.VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === constants.VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, index.h("header", null, index.h("slot", { name: "snkSimpleCrudHeader" })), index.h("section", { class: "ez-flex ez-box ez-box--shadow" }, index.h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: index$1.PresentationMode.SECONDARY }, index.h("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), index.h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, index.h("stack-item", null, index.h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(constants.VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
327
285
|
? undefined
|
328
286
|
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, index.h("div", { slot: "footer" }, index.h("slot", { name: "snkSimpleCrudFooter" })))), index.h("stack-item", null, index.h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
329
287
|
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
const index = require('./index-f9e81701.js');
|
6
|
+
|
7
|
+
const snkTaskbarCss = ".sc-snk-taskbar-custom-elements-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar-custom-elements{display:none}";
|
8
|
+
|
9
|
+
const SnkTaskbarCustomElements = class {
|
10
|
+
constructor(hostRef) {
|
11
|
+
index.registerInstance(this, hostRef);
|
12
|
+
this.slot = 'TASKBAR_CUSTOM_ELEMENTS';
|
13
|
+
}
|
14
|
+
render() {
|
15
|
+
return (index.h(index.Host, { slot: this.slot }, index.h("div", { id: this.slot, class: "taskbar-custom-elements-container" }, index.h("slot", null))));
|
16
|
+
}
|
17
|
+
};
|
18
|
+
SnkTaskbarCustomElements.style = snkTaskbarCss;
|
19
|
+
|
20
|
+
exports.snk_taskbar_custom_elements = SnkTaskbarCustomElements;
|
@@ -5,16 +5,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-f9e81701.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const AuthorizationConfig = require('./AuthorizationConfig-79ffae4b.js');
|
8
|
-
const taskbarElements = require('./taskbar-elements-
|
8
|
+
const taskbarElements = require('./taskbar-elements-39949c7a.js');
|
9
9
|
const index$1 = require('./index-0e663819.js');
|
10
10
|
require('./index-102ba62d.js');
|
11
11
|
|
12
|
-
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}";
|
12
|
+
const snkTaskbarCss = ".sc-snk-taskbar-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar{display:none}";
|
13
13
|
|
14
14
|
const SnkTaskbar = class {
|
15
15
|
constructor(hostRef) {
|
16
16
|
index.registerInstance(this, hostRef);
|
17
17
|
this.actionClick = index.createEvent(this, "actionClick", 7);
|
18
|
+
this.TASKBAR_ITEM_ID_PREFIX = 'TASKBAR_ITEM_';
|
18
19
|
this._titleKeyByElement = {
|
19
20
|
[taskbarElements.TaskbarElement.UPDATE]: "snkTaskbar.titleUpdate",
|
20
21
|
[taskbarElements.TaskbarElement.PREVIOUS]: "snkTaskbar.titlePrevious",
|
@@ -32,7 +33,13 @@ const SnkTaskbar = class {
|
|
32
33
|
[taskbarElements.TaskbarElement.ATTACH]: "snkTaskbar.titleAttach",
|
33
34
|
};
|
34
35
|
this._permissions = undefined;
|
36
|
+
this._customElements = undefined;
|
37
|
+
this._customElementsId = undefined;
|
38
|
+
this._slotContainer = undefined;
|
39
|
+
this.customSlotId = "TASKBAR_CUSTOM_ELEMENTS";
|
40
|
+
this.customContainerId = undefined;
|
35
41
|
this.configName = undefined;
|
42
|
+
this.resourceID = undefined;
|
36
43
|
this.buttons = undefined;
|
37
44
|
this.customButtons = undefined;
|
38
45
|
this.actionsList = undefined;
|
@@ -171,14 +178,52 @@ const SnkTaskbar = class {
|
|
171
178
|
return true;
|
172
179
|
});
|
173
180
|
}
|
181
|
+
appendCustomElementsInTaskbar() {
|
182
|
+
this._customElementsId.forEach(id => {
|
183
|
+
const elementId = id.replace(this.TASKBAR_ITEM_ID_PREFIX, '');
|
184
|
+
const customElement = this._customElements.get(elementId);
|
185
|
+
const container = this._element.querySelector(`#${id}`);
|
186
|
+
if (container) {
|
187
|
+
container === null || container === void 0 ? void 0 : container.appendChild(customElement);
|
188
|
+
}
|
189
|
+
else {
|
190
|
+
this.unlinkCustomElementFromTaskbar(customElement);
|
191
|
+
}
|
192
|
+
});
|
193
|
+
}
|
194
|
+
addCustomElementContainer(elem) {
|
195
|
+
const elementId = `${this.TASKBAR_ITEM_ID_PREFIX}${elem}`;
|
196
|
+
if (!this._customElementsId.includes(elementId)) {
|
197
|
+
this._customElementsId.push(elementId);
|
198
|
+
}
|
199
|
+
return index.h("span", { key: elementId, id: elementId });
|
200
|
+
}
|
201
|
+
getCustomElements() {
|
202
|
+
var _a, _b;
|
203
|
+
this._customElementsId = [];
|
204
|
+
this._customElements = new Map();
|
205
|
+
this._slotContainer = this.buildSlotContainer();
|
206
|
+
const customElementsArray = Array.from((_b = (_a = this._slotContainer) === null || _a === void 0 ? void 0 : _a.children) !== null && _b !== void 0 ? _b : []);
|
207
|
+
customElementsArray.forEach(item => this._customElements.set(item.id, item));
|
208
|
+
}
|
209
|
+
buildSlotContainer() {
|
210
|
+
if (this.customContainerId) {
|
211
|
+
const container = document.querySelector(`#${this.customContainerId}`);
|
212
|
+
return container === null || container === void 0 ? void 0 : container.querySelector(`#${this.customSlotId}`);
|
213
|
+
}
|
214
|
+
else {
|
215
|
+
return this._element.querySelector(`#${this.customSlotId}`);
|
216
|
+
}
|
217
|
+
}
|
174
218
|
componentWillLoad() {
|
175
219
|
this._application = core.ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
176
220
|
if (this._application) {
|
177
|
-
this._application.getAllAccess().then(access => this._permissions = access);
|
221
|
+
this._application.getAllAccess(this.resourceID).then(access => this._permissions = access);
|
178
222
|
}
|
179
223
|
else {
|
180
224
|
this._permissions = {};
|
181
225
|
}
|
226
|
+
this.getCustomElements();
|
182
227
|
}
|
183
228
|
componentWillRender() {
|
184
229
|
if (this._definitions == undefined && this._permissions) {
|
@@ -190,12 +235,30 @@ const SnkTaskbar = class {
|
|
190
235
|
const dataInfo = { dataUnit: this.dataUnit };
|
191
236
|
core.ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
192
237
|
}
|
238
|
+
componentDidRender() {
|
239
|
+
this.appendCustomElementsInTaskbar();
|
240
|
+
}
|
241
|
+
disconnectedCallback() {
|
242
|
+
this.unlinkAllCustomElements();
|
243
|
+
}
|
244
|
+
unlinkAllCustomElements() {
|
245
|
+
var _a;
|
246
|
+
(_a = this._customElementsId) === null || _a === void 0 ? void 0 : _a.forEach(id => {
|
247
|
+
const elementId = id.replace(this.TASKBAR_ITEM_ID_PREFIX, '');
|
248
|
+
const customElement = this._customElements.get(elementId);
|
249
|
+
this.unlinkCustomElementFromTaskbar(customElement);
|
250
|
+
});
|
251
|
+
}
|
252
|
+
unlinkCustomElementFromTaskbar(customElement) {
|
253
|
+
this._slotContainer.appendChild(customElement);
|
254
|
+
}
|
193
255
|
render() {
|
194
256
|
if (this._definitions === undefined) {
|
195
257
|
return undefined;
|
196
258
|
}
|
197
259
|
let index$1 = 0;
|
198
260
|
return (index.h(index.Host, null, this.removeEmpty(this._definitions.map((elem) => {
|
261
|
+
var _a;
|
199
262
|
if (elem === taskbarElements.TaskbarElement.DIVIDER) {
|
200
263
|
index$1 = 0;
|
201
264
|
}
|
@@ -205,11 +268,14 @@ const SnkTaskbar = class {
|
|
205
268
|
if (taskbarElements.TaskbarElement[elem]) {
|
206
269
|
return this.getElement(index$1, taskbarElements.TaskbarElement[elem]);
|
207
270
|
}
|
208
|
-
if (this.customButtons.has(elem)) {
|
271
|
+
if ((_a = this.customButtons) === null || _a === void 0 ? void 0 : _a.has(elem)) {
|
209
272
|
return this.getElement(index$1, this.customButtons.get(elem));
|
210
273
|
}
|
274
|
+
if (this._customElements.has(elem)) {
|
275
|
+
return this.addCustomElementContainer(elem);
|
276
|
+
}
|
211
277
|
return index.h("slot", { name: elem });
|
212
|
-
}))));
|
278
|
+
})), index.h("div", { class: "taskbar-custom-elements-container" }, index.h("slot", { name: this.customSlotId }))));
|
213
279
|
}
|
214
280
|
get _element() { return index.getElement(this); }
|
215
281
|
static get watchers() { return {
|
@@ -102,18 +102,18 @@ const buildElem = (element, className, dataElementId, getTitle, action, isEnable
|
|
102
102
|
}
|
103
103
|
};
|
104
104
|
function textButton(name, className, dataElementId, text, title, action, isEnabled) {
|
105
|
-
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
105
|
+
return index.h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) });
|
106
106
|
}
|
107
107
|
function iconButton(iconName, name, className, dataElementId, title, action, isEnabled) {
|
108
|
-
return index.h("ez-button", { title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
108
|
+
return index.h("ez-button", { key: dataElementId, title: title, mode: "icon", size: "small", class: className, "data-element-id": dataElementId, iconName: iconName, enabled: isEnabled(name), onClick: () => action(name) });
|
109
109
|
}
|
110
110
|
function iconTextButton(iconName, name, className, dataElementId, text, title, action, isEnabled) {
|
111
|
-
return index.h("ez-button", { title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
111
|
+
return index.h("ez-button", { key: dataElementId, title: title, label: text, size: "small", class: className, "data-element-id": dataElementId, enabled: isEnabled(name), onClick: () => action(name) },
|
112
112
|
index.h("ez-icon", { class: "ez-padding-right--small", slot: "leftIcon", iconName: iconName }));
|
113
113
|
}
|
114
114
|
function actionButton(element, className, dataElementId, title, action, isEnabled, actions) {
|
115
115
|
return actions && actions.length > 0
|
116
|
-
? index.h("ez-actions-button", { title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
116
|
+
? index.h("ez-actions-button", { key: dataElementId, title: title, size: "small", "data-element-id": dataElementId, arrowActive: true, class: className, enabled: isEnabled(element), onEzAction: (evt) => action(evt.detail.value), actions: actions })
|
117
117
|
: undefined;
|
118
118
|
}
|
119
119
|
|