@sankhyalabs/sankhyablocks 9.1.0-ms.5 → 9.1.0-ms.6
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-34aa43d8.js → ConfigStorage-bb8c0edf.js} +11 -1
- package/dist/cjs/{SnkFormConfigManager-61bf3266.js → SnkFormConfigManager-a23df43c.js} +1 -1
- package/dist/cjs/SnkMessageBuilder-acd9ec62.js +1937 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button_8.cjs.entry.js +76 -37
- package/dist/cjs/snk-application.cjs.entry.js +2 -2
- package/dist/cjs/snk-attach.cjs.entry.js +28 -11
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -2
- package/dist/cjs/{snk-data-unit-a4f9287b.js → snk-data-unit-47c6d16b.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +4 -4
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +1 -1
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +1 -1
- package/dist/cjs/snk-form_2.cjs.entry.js +3 -3
- package/dist/cjs/snk-grid.cjs.entry.js +1 -1
- package/dist/cjs/{snk-guides-viewer-29298823.js → snk-guides-viewer-1689e877.js} +1 -1
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +3 -3
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +1 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +9 -9
- package/dist/collection/components/snk-attach/snk-attach.js +45 -11
- package/dist/collection/components/snk-grid-config/snk-grid-config.js +74 -36
- package/dist/collection/components/snk-grid-config/snk-select-box/snk-select-box.js +20 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +8 -8
- package/dist/collection/lib/configs/ConfigStorage.js +3 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +9 -1
- package/dist/collection/lib/message/SnkMessageBuilder.js +25 -52
- package/dist/collection/lib/message/messageResourceEnUSUtils.js +91 -0
- package/dist/collection/lib/message/messageResourceEsESUtils.js +91 -0
- package/dist/collection/lib/message/messageResourcePtBRUtils.js +91 -0
- package/dist/collection/lib/message/resources/en-us/crud-utils.msg.js +3 -0
- package/dist/collection/lib/message/resources/en-us/file-viewer.msg.js +9 -0
- package/dist/collection/lib/message/resources/en-us/snk-actions-button.msg.js +27 -0
- package/dist/collection/lib/message/resources/en-us/snk-application.msg.js +8 -0
- package/dist/collection/lib/message/resources/en-us/snk-attach.msg.js +39 -0
- package/dist/collection/lib/message/resources/en-us/snk-configurator.msg.js +8 -0
- package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +10 -0
- package/dist/collection/lib/message/resources/en-us/snk-data-exporter.msg.js +35 -0
- package/dist/collection/lib/message/resources/en-us/snk-data-unit.msg.js +36 -0
- package/dist/collection/lib/message/resources/en-us/snk-entity-list.msg.js +3 -0
- package/dist/collection/lib/message/resources/en-us/snk-exporter.msg.js +20 -0
- package/dist/collection/lib/message/resources/en-us/snk-filter-bar.msg.js +64 -0
- package/dist/collection/lib/message/resources/en-us/snk-filter-field-search.msg.js +7 -0
- package/dist/collection/lib/message/resources/en-us/snk-filter-param-config.msg.js +18 -0
- package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +76 -0
- package/dist/collection/lib/message/resources/en-us/snk-grid.msg.js +41 -0
- package/dist/collection/lib/message/resources/en-us/snk-personalized-filter.msg.js +88 -0
- package/dist/collection/lib/message/resources/en-us/snk-print-selector.msg.js +23 -0
- package/dist/collection/lib/message/resources/en-us/snk-simple-bar.msg.js +3 -0
- package/dist/collection/lib/message/resources/en-us/snk-simple-crud.msg.js +8 -0
- package/dist/collection/lib/message/resources/en-us/snk-taskbar.msg.js +18 -0
- package/dist/collection/lib/message/resources/es-es/crud-utils.msg.js +3 -0
- package/dist/collection/lib/message/resources/es-es/file-viewer.msg.js +9 -0
- package/dist/collection/lib/message/resources/es-es/snk-actions-button.msg.js +27 -0
- package/dist/collection/lib/message/resources/es-es/snk-application.msg.js +8 -0
- package/dist/collection/lib/message/resources/es-es/snk-attach.msg.js +39 -0
- package/dist/collection/lib/message/resources/es-es/snk-configurator.msg.js +8 -0
- package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +10 -0
- package/dist/collection/lib/message/resources/es-es/snk-data-exporter.msg.js +35 -0
- package/dist/collection/lib/message/resources/es-es/snk-data-unit.msg.js +36 -0
- package/dist/collection/lib/message/resources/es-es/snk-entity-list.msg.js +3 -0
- package/dist/collection/lib/message/resources/es-es/snk-exporter.msg.js +20 -0
- package/dist/collection/lib/message/resources/es-es/snk-filter-bar.msg.js +64 -0
- package/dist/collection/lib/message/resources/es-es/snk-filter-field-search.msg.js +7 -0
- package/dist/collection/lib/message/resources/es-es/snk-filter-param-config.msg.js +18 -0
- package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +76 -0
- package/dist/collection/lib/message/resources/es-es/snk-grid.msg.js +41 -0
- package/dist/collection/lib/message/resources/es-es/snk-personalized-filter.msg.js +88 -0
- package/dist/collection/lib/message/resources/es-es/snk-print-selector.msg.js +23 -0
- package/dist/collection/lib/message/resources/es-es/snk-simple-bar.msg.js +3 -0
- package/dist/collection/lib/message/resources/es-es/snk-simple-crud.msg.js +8 -0
- package/dist/collection/lib/message/resources/es-es/snk-taskbar.msg.js +18 -0
- package/dist/collection/lib/message/resources/{crud-utils.msg.js → pt-br/crud-utils.msg.js} +1 -2
- package/dist/collection/lib/message/resources/{file-viewer.msg.js → pt-br/file-viewer.msg.js} +1 -2
- package/dist/collection/lib/message/resources/{snk-application.msg.js → pt-br/snk-application.msg.js} +1 -2
- package/dist/collection/lib/message/resources/{snk-attach.msg.js → pt-br/snk-attach.msg.js} +0 -1
- package/dist/collection/lib/message/resources/{snk-crud.msg.js → pt-br/snk-crud.msg.js} +0 -1
- package/dist/collection/lib/message/resources/{snk-data-unit.msg.js → pt-br/snk-data-unit.msg.js} +1 -2
- package/dist/collection/lib/message/resources/{snk-exporter.msg.js → pt-br/snk-exporter.msg.js} +1 -2
- package/dist/collection/lib/message/resources/pt-br/snk-filter-bar.msg.js +64 -0
- package/dist/collection/lib/message/resources/pt-br/snk-grid.msg.js +41 -0
- package/dist/collection/lib/message/resources/{snk-simple-crud.msg.js → pt-br/snk-simple-crud.msg.js} +0 -1
- package/dist/collection/lib/message/resources/{snk-taskbar.msg.js → pt-br/snk-taskbar.msg.js} +1 -2
- package/dist/components/ConfigStorage.js +11 -1
- package/dist/components/SnkMessageBuilder.js +1345 -139
- package/dist/components/snk-attach2.js +29 -11
- package/dist/components/snk-grid-config2.js +73 -35
- package/dist/components/snk-select-box2.js +4 -2
- package/dist/components/snk-simple-crud2.js +7 -7
- package/dist/esm/{ConfigStorage-89154c4e.js → ConfigStorage-cf578768.js} +11 -1
- package/dist/esm/{SnkFormConfigManager-d64d62d6.js → SnkFormConfigManager-c1cd9dcd.js} +1 -1
- package/dist/esm/SnkMessageBuilder-c8b452b6.js +1915 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button_8.entry.js +76 -37
- package/dist/esm/snk-application.entry.js +2 -2
- package/dist/esm/snk-attach.entry.js +28 -11
- package/dist/esm/snk-data-exporter.entry.js +2 -2
- package/dist/esm/{snk-data-unit-330db397.js → snk-data-unit-c12986b7.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +4 -4
- package/dist/esm/snk-filter-bar_4.entry.js +1 -1
- package/dist/esm/snk-filter-modal-item.entry.js +1 -1
- package/dist/esm/snk-form_2.entry.js +3 -3
- package/dist/esm/snk-grid.entry.js +1 -1
- package/dist/esm/{snk-guides-viewer-9335318d.js → snk-guides-viewer-defa2629.js} +1 -1
- package/dist/esm/snk-guides-viewer.entry.js +3 -3
- package/dist/esm/snk-personalized-filter.entry.js +1 -1
- package/dist/esm/snk-simple-crud.entry.js +9 -9
- package/dist/sankhyablocks/{p-5b31b239.entry.js → p-09ba8326.entry.js} +1 -1
- package/dist/sankhyablocks/p-224fa6f9.js +1 -0
- package/dist/sankhyablocks/{p-a2c6944d.entry.js → p-2628f34e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-1079e61b.entry.js → p-34cfb5ad.entry.js} +2 -2
- package/dist/sankhyablocks/p-360f0b74.js +1 -0
- package/dist/sankhyablocks/p-405edf96.js +56 -0
- package/dist/sankhyablocks/{p-fc87708a.js → p-4b8691b6.js} +1 -1
- package/dist/sankhyablocks/{p-3b1d73f9.js → p-4eb731b3.js} +1 -1
- package/dist/sankhyablocks/{p-2ebd3bfd.entry.js → p-60d3abf6.entry.js} +1 -1
- package/dist/sankhyablocks/{p-31193a60.entry.js → p-6bc7c7ee.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e56eb36b.entry.js → p-81820bf8.entry.js} +1 -1
- package/dist/sankhyablocks/{p-2d58f98e.entry.js → p-86c8f7f2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-b2946adb.entry.js → p-90ee1990.entry.js} +1 -1
- package/dist/sankhyablocks/{p-0750661e.entry.js → p-aef68e58.entry.js} +1 -1
- package/dist/sankhyablocks/p-b033bf30.entry.js +1 -0
- package/dist/sankhyablocks/{p-9a6fbf3d.entry.js → p-b1ea8c6d.entry.js} +1 -1
- package/dist/sankhyablocks/{p-5126b34e.entry.js → p-cfa8cac2.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7c9815ea.entry.js → p-f65421cd.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-attach/interfaces/ICrudConfig.d.ts +1 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +5 -0
- package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +7 -0
- package/dist/types/components/snk-grid-config/snk-select-box/snk-select-box.d.ts +4 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +1 -1
- package/dist/types/components.d.ts +16 -0
- package/dist/types/lib/configs/ConfigStorage.d.ts +1 -0
- package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +3 -2
- package/dist/types/lib/message/SnkMessageBuilder.d.ts +4 -0
- package/dist/types/lib/message/resources/en-us/crud-utils.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/en-us/file-viewer.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/en-us/snk-application.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/{snk-attach.msg.d.ts → en-us/snk-attach.msg.d.ts} +0 -1
- package/dist/types/lib/message/resources/{snk-crud.msg.d.ts → en-us/snk-crud.msg.d.ts} +0 -1
- package/dist/types/lib/message/resources/en-us/snk-data-unit.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/en-us/snk-exporter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/en-us/snk-filter-bar.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/{snk-simple-crud.msg.d.ts → en-us/snk-simple-crud.msg.d.ts} +0 -1
- package/dist/types/lib/message/resources/en-us/snk-taskbar.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/crud-utils.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/file-viewer.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-actions-button.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-application.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/{snk-application.msg.d.ts → es-es/snk-attach.msg.d.ts} +0 -1
- package/dist/types/lib/message/resources/es-es/snk-configurator.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-crud.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-data-exporter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-data-unit.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-entity-list.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-exporter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-filter-bar.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-filter-field-search.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-filter-param-config.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-form.msg.d.ts +4 -0
- package/dist/types/lib/message/resources/es-es/snk-grid.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/es-es/snk-personalized-filter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-print-selector.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-simple-bar.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-simple-crud.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/es-es/snk-taskbar.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/crud-utils.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/file-viewer.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-actions-button.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-application.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-attach.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-configurator.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-crud.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-data-exporter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-data-unit.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-entity-list.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-exporter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-filter-bar.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-filter-field-search.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-filter-param-config.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-form.msg.d.ts +4 -0
- package/dist/types/lib/message/resources/pt-br/snk-grid.msg.d.ts +2 -0
- package/dist/types/lib/message/resources/pt-br/snk-personalized-filter.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-print-selector.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-simple-bar.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-simple-crud.msg.d.ts +1 -0
- package/dist/types/lib/message/resources/pt-br/snk-taskbar.msg.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/SnkMessageBuilder-221cc88d.js +0 -731
- package/dist/collection/lib/message/resources/snk-filter-bar.msg.js +0 -65
- package/dist/collection/lib/message/resources/snk-grid.msg.js +0 -40
- package/dist/esm/SnkMessageBuilder-da87a821.js +0 -709
- package/dist/sankhyablocks/p-412e06e9.js +0 -1
- package/dist/sankhyablocks/p-8758404f.js +0 -56
- package/dist/sankhyablocks/p-c99293d5.entry.js +0 -1
- package/dist/sankhyablocks/p-fc4eac32.js +0 -1
- package/dist/types/lib/message/resources/crud-utils.msg.d.ts +0 -2
- package/dist/types/lib/message/resources/file-viewer.msg.d.ts +0 -2
- package/dist/types/lib/message/resources/snk-data-unit.msg.d.ts +0 -2
- package/dist/types/lib/message/resources/snk-exporter.msg.d.ts +0 -2
- package/dist/types/lib/message/resources/snk-filter-bar.msg.d.ts +0 -2
- package/dist/types/lib/message/resources/snk-taskbar.msg.d.ts +0 -2
- /package/dist/collection/components/snk-simple-crud/{regular-buttons.js → snk-simple-crud.constants.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-actions-button.msg.js → pt-br/snk-actions-button.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-configurator.msg.js → pt-br/snk-configurator.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-data-exporter.msg.js → pt-br/snk-data-exporter.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-entity-list.msg.js → pt-br/snk-entity-list.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-filter-field-search.msg.js → pt-br/snk-filter-field-search.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-filter-param-config.msg.js → pt-br/snk-filter-param-config.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-form.msg.js → pt-br/snk-form.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-personalized-filter.msg.js → pt-br/snk-personalized-filter.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-print-selector.msg.js → pt-br/snk-print-selector.msg.js} +0 -0
- /package/dist/collection/lib/message/resources/{snk-simple-bar.msg.js → pt-br/snk-simple-bar.msg.js} +0 -0
- /package/dist/types/components/snk-simple-crud/{regular-buttons.d.ts → snk-simple-crud.constants.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-actions-button.msg.d.ts → en-us/snk-actions-button.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-configurator.msg.d.ts → en-us/snk-configurator.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-data-exporter.msg.d.ts → en-us/snk-data-exporter.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-entity-list.msg.d.ts → en-us/snk-entity-list.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-filter-field-search.msg.d.ts → en-us/snk-filter-field-search.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-filter-param-config.msg.d.ts → en-us/snk-filter-param-config.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-form.msg.d.ts → en-us/snk-form.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-grid.msg.d.ts → en-us/snk-grid.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-personalized-filter.msg.d.ts → en-us/snk-personalized-filter.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-print-selector.msg.d.ts → en-us/snk-print-selector.msg.d.ts} +0 -0
- /package/dist/types/lib/message/resources/{snk-simple-bar.msg.d.ts → en-us/snk-simple-bar.msg.d.ts} +0 -0
@@ -625,6 +625,8 @@ const snkAttachCss = ".snk-attach__header.sc-snk-attach,.snk-attach__crud-sectio
|
|
625
625
|
|
626
626
|
const RESOURCE_ID = 'AnexoSistema';
|
627
627
|
const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
|
628
|
+
const GRID_LEGACY_CONFIG_NAME = 'GrdCfgHtml5:grdcfg.dynaform.anexo';
|
629
|
+
const LINKORFILE_COLUMN_NAME = "ARQUIVOOULINK";
|
628
630
|
const SnkAttach = class {
|
629
631
|
constructor(hostRef) {
|
630
632
|
index.registerInstance(this, hostRef);
|
@@ -653,6 +655,7 @@ const SnkAttach = class {
|
|
653
655
|
this.back.emit();
|
654
656
|
});
|
655
657
|
};
|
658
|
+
this.gridLegacyConfigName = undefined;
|
656
659
|
this.fetcherType = undefined;
|
657
660
|
this.fetcher = undefined;
|
658
661
|
this.dataUnit = undefined;
|
@@ -764,9 +767,11 @@ const SnkAttach = class {
|
|
764
767
|
var _a, _b;
|
765
768
|
this._currentDataUnit = new dataunitFetcher.DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
766
769
|
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
770
|
+
let gridValidateForm;
|
767
771
|
if (!this._currentDataUnit.metadata) {
|
768
772
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
769
|
-
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
773
|
+
this.crudConfig = this.entityName ? { form: anexoSistemaCrudConfig === null || anexoSistemaCrudConfig === void 0 ? void 0 : anexoSistemaCrudConfig.form } : Object.assign({}, anexoSistemaCrudConfig);
|
774
|
+
gridValidateForm = { grid: anexoSistemaCrudConfig === null || anexoSistemaCrudConfig === void 0 ? void 0 : anexoSistemaCrudConfig.grid };
|
770
775
|
}
|
771
776
|
this.initDataUnitLoaders();
|
772
777
|
this._currentDataUnit.addFilterProvider({
|
@@ -776,19 +781,21 @@ const SnkAttach = class {
|
|
776
781
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
777
782
|
});
|
778
783
|
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
779
|
-
this.disableEditFieldsNotInForm();
|
784
|
+
this.disableEditFieldsNotInForm(gridValidateForm);
|
780
785
|
}
|
781
786
|
async loadAttach() {
|
782
787
|
var _a, _b;
|
783
788
|
this._currentFetcher = new AttachFetcher();
|
784
789
|
this._currentDataUnit = new core.DataUnit(dataunitFetcher.InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
785
790
|
this._currentDataUnit.pageSize = 150;
|
791
|
+
let gridValidateForm;
|
786
792
|
this.initDataUnitLoaders();
|
787
793
|
this._currentDataUnit.addInterceptor({
|
788
794
|
interceptAction: (action) => {
|
789
795
|
var _a;
|
790
796
|
if (action.type === core.Action.METADATA_LOADED) {
|
791
|
-
this.crudConfig = Object.assign({}, attachCrudConfig);
|
797
|
+
this.crudConfig = this.entityName ? { form: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.form } : Object.assign({}, attachCrudConfig);
|
798
|
+
gridValidateForm = { grid: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.grid };
|
792
799
|
(_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
|
793
800
|
}
|
794
801
|
return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
|
@@ -796,9 +803,10 @@ const SnkAttach = class {
|
|
796
803
|
});
|
797
804
|
if (!this._currentDataUnit.metadata) {
|
798
805
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
799
|
-
this.crudConfig = Object.assign({}, attachCrudConfig);
|
806
|
+
this.crudConfig = this.entityName ? { form: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.form } : Object.assign({}, attachCrudConfig);
|
807
|
+
gridValidateForm = { grid: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.grid };
|
800
808
|
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData(undefined, undefined, true, this.registerKey));
|
801
|
-
this.disableEditFieldsNotInForm();
|
809
|
+
this.disableEditFieldsNotInForm(gridValidateForm);
|
802
810
|
}
|
803
811
|
}
|
804
812
|
initDataUnitLoaders() {
|
@@ -817,12 +825,16 @@ const SnkAttach = class {
|
|
817
825
|
});
|
818
826
|
}
|
819
827
|
}
|
820
|
-
disableEditFieldsNotInForm() {
|
821
|
-
var _a;
|
822
|
-
(_a = this.
|
823
|
-
|
828
|
+
disableEditFieldsNotInForm(gridValidateForm) {
|
829
|
+
var _a, _b, _c, _d, _e;
|
830
|
+
const gridColumns = ((_b = (_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.gridConfig) === null || _b === void 0 ? void 0 : _b.columns) || ((_c = gridValidateForm === null || gridValidateForm === void 0 ? void 0 : gridValidateForm.grid) === null || _c === void 0 ? void 0 : _c.columns) || ((_e = (_d = this.crudConfig) === null || _d === void 0 ? void 0 : _d.grid) === null || _e === void 0 ? void 0 : _e.columns);
|
831
|
+
if (!!this.getGridLegacyConfigName()) {
|
832
|
+
this._currentDataUnit.disableField(LINKORFILE_COLUMN_NAME);
|
833
|
+
}
|
834
|
+
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach(column => {
|
835
|
+
var _a, _b;
|
824
836
|
const fieldName = column.name;
|
825
|
-
if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
|
837
|
+
if (!((_b = (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.fields.some(field => (field === null || field === void 0 ? void 0 : field.name) === fieldName))) {
|
826
838
|
this._currentDataUnit.disableField(fieldName);
|
827
839
|
}
|
828
840
|
});
|
@@ -872,11 +884,16 @@ const SnkAttach = class {
|
|
872
884
|
await this._currentDataUnit.loadMetadata();
|
873
885
|
}
|
874
886
|
;
|
887
|
+
getGridLegacyConfigName() {
|
888
|
+
if (this.gridLegacyConfigName)
|
889
|
+
return this.gridLegacyConfigName;
|
890
|
+
return this.entityName ? GRID_LEGACY_CONFIG_NAME + "." + this.entityName : this.entityName;
|
891
|
+
}
|
875
892
|
render() {
|
876
893
|
var _a, _b;
|
877
894
|
if (!this._currentDataUnit)
|
878
895
|
return null;
|
879
|
-
return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this), multipleSelection: true }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
896
|
+
return (index.h("main", { class: "snk-attach__main" }, index.h("header", { class: "snk-attach__header" }, index.h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, index.h("div", { slot: "rightSlot" }, index.h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), index.h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, index.h("div", { class: "ez-box__container" }, index.h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this), multipleSelection: true, configName: this.entityName, ignoreReadOnlyFormFields: this.entityName ? true : false, gridLegacyConfigName: this.getGridLegacyConfigName() }, index.h("div", { slot: "snkSimpleCrudHeader" }, index.h("div", { class: "ez-flex ez-flex--column" }, index.h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), index.h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
880
897
|
}
|
881
898
|
static get watchers() { return {
|
882
899
|
"registerKey": ["registerKeyWatcher"]
|
@@ -9,7 +9,7 @@ const IFetchDataExporterParams = require('./IFetchDataExporterParams-e78ec415.js
|
|
9
9
|
const index = require('./index-e3e39724.js');
|
10
10
|
const constants = require('./constants-6d82e405.js');
|
11
11
|
const DataFetcher = require('./DataFetcher-e23a263b.js');
|
12
|
-
const snkDataUnit = require('./snk-data-unit-
|
12
|
+
const snkDataUnit = require('./snk-data-unit-47c6d16b.js');
|
13
13
|
require('./ISave-e0be2362.js');
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
@@ -17,7 +17,7 @@ require('./dataunit-fetcher-c34a8217.js');
|
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
18
|
require('./form-config-fetcher-d8b78403.js');
|
19
19
|
require('./PrintUtils-bcaeb82f.js');
|
20
|
-
require('./SnkMessageBuilder-
|
20
|
+
require('./SnkMessageBuilder-acd9ec62.js');
|
21
21
|
require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
22
22
|
require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
23
23
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
@@ -3,7 +3,7 @@
|
|
3
3
|
const index = require('./index-1cf293c1.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
5
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
6
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
6
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-acd9ec62.js');
|
7
7
|
const dataunitFetcher = require('./dataunit-fetcher-c34a8217.js');
|
8
8
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
9
9
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const snkDataUnit = require('./snk-data-unit-
|
5
|
+
const snkDataUnit = require('./snk-data-unit-47c6d16b.js');
|
6
6
|
require('./index-1cf293c1.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
8
|
require('@sankhyalabs/ezui/dist/collection/utils');
|
9
|
-
require('./SnkMessageBuilder-
|
9
|
+
require('./SnkMessageBuilder-acd9ec62.js');
|
10
10
|
require('./dataunit-fetcher-c34a8217.js');
|
11
11
|
require('./DataFetcher-e23a263b.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-1cf293c1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-a23df43c.js');
|
8
8
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
9
9
|
require('./DataFetcher-e23a263b.js');
|
10
10
|
require('./ISave-e0be2362.js');
|
@@ -16,10 +16,10 @@ require('./filter-item-type.enum-a7ffdaa6.js');
|
|
16
16
|
require('./form-config-fetcher-d8b78403.js');
|
17
17
|
const constants = require('./constants-6d82e405.js');
|
18
18
|
const taskbarElements = require('./taskbar-elements-3b74cd21.js');
|
19
|
-
const snkGuidesViewer = require('./snk-guides-viewer-
|
20
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
19
|
+
const snkGuidesViewer = require('./snk-guides-viewer-1689e877.js');
|
20
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-acd9ec62.js');
|
21
21
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
22
|
-
require('./ConfigStorage-
|
22
|
+
require('./ConfigStorage-bb8c0edf.js');
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
24
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
25
25
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index$1 = require('./index-1cf293c1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const EzScrollDirection = require('@sankhyalabs/ezui/dist/collection/components/ez-scroller/EzScrollDirection');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-bb8c0edf.js');
|
9
9
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
10
10
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
11
11
|
const index = require('./index-62760a9c.js');
|
@@ -6,7 +6,7 @@ const index = require('./index-1cf293c1.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const filterItemType_enum = require('./filter-item-type.enum-a7ffdaa6.js');
|
8
8
|
const presentationMode = require('./presentationMode-52ec3bdd.js');
|
9
|
-
const ConfigStorage = require('./ConfigStorage-
|
9
|
+
const ConfigStorage = require('./ConfigStorage-bb8c0edf.js');
|
10
10
|
const filterType_enum = require('./filter-type.enum-2bb46d2a.js');
|
11
11
|
require('./form-config-fetcher-d8b78403.js');
|
12
12
|
require('./DataFetcher-e23a263b.js');
|
@@ -4,18 +4,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
5
5
|
const index = require('./index-1cf293c1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
7
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-a23df43c.js');
|
8
8
|
const ResourceIDUtils = require('./ResourceIDUtils-5ff86aa7.js');
|
9
9
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
10
10
|
const FormConfigHelper = require('./FormConfigHelper-c664dbae.js');
|
11
11
|
const constants = require('./constants-6d82e405.js');
|
12
12
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
13
13
|
const formConfigFetcher = require('./form-config-fetcher-d8b78403.js');
|
14
|
-
require('./ConfigStorage-
|
15
|
-
require('./filter-item-type.enum-a7ffdaa6.js');
|
14
|
+
require('./ConfigStorage-bb8c0edf.js');
|
16
15
|
require('./DataFetcher-e23a263b.js');
|
17
16
|
require('./PrintUtils-bcaeb82f.js');
|
18
17
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
18
|
+
require('./filter-item-type.enum-a7ffdaa6.js');
|
19
19
|
|
20
20
|
const snkFormCss = ".sc-snk-form-h{--snk-form__header--min-height:94px;display:block}.snk-form__form--hidden.sc-snk-form{display:none}";
|
21
21
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-1cf293c1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const taskbarElements = require('./taskbar-elements-3b74cd21.js');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-bb8c0edf.js');
|
9
9
|
const index$1 = require('./index-e3e39724.js');
|
10
10
|
const taskbarProcessor = require('./taskbar-processor-2fba34a8.js');
|
11
11
|
const index$2 = require('./index-0ad2baeb.js');
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
const index = require('./index-1cf293c1.js');
|
4
4
|
const core = require('@sankhyalabs/core');
|
5
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
5
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-a23df43c.js');
|
6
6
|
const form = require('@sankhyalabs/ezui/dist/collection/utils/form');
|
7
7
|
const taskbarProcessor = require('./taskbar-processor-2fba34a8.js');
|
8
8
|
const taskbarElements = require('./taskbar-elements-3b74cd21.js');
|
@@ -2,11 +2,11 @@
|
|
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-1689e877.js');
|
6
6
|
require('./index-1cf293c1.js');
|
7
7
|
require('@sankhyalabs/core');
|
8
|
-
require('./SnkFormConfigManager-
|
9
|
-
require('./ConfigStorage-
|
8
|
+
require('./SnkFormConfigManager-a23df43c.js');
|
9
|
+
require('./ConfigStorage-bb8c0edf.js');
|
10
10
|
require('./form-config-fetcher-d8b78403.js');
|
11
11
|
require('./DataFetcher-e23a263b.js');
|
12
12
|
require('./PrintUtils-bcaeb82f.js');
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
5
|
const index = require('./index-1cf293c1.js');
|
6
6
|
const core = require('@sankhyalabs/core');
|
7
7
|
const PersonalizedFilterUtils = require('./PersonalizedFilterUtils-7259cf65.js');
|
8
|
-
const ConfigStorage = require('./ConfigStorage-
|
8
|
+
const ConfigStorage = require('./ConfigStorage-bb8c0edf.js');
|
9
9
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
10
10
|
const index$1 = require('./index-62760a9c.js');
|
11
11
|
const index$2 = require('./index-0ad2baeb.js');
|
@@ -17,8 +17,8 @@ const dataunitFetcher = require('./dataunit-fetcher-c34a8217.js');
|
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
18
18
|
const formConfigFetcher = require('./form-config-fetcher-d8b78403.js');
|
19
19
|
const taskbarProcessor = require('./taskbar-processor-2fba34a8.js');
|
20
|
-
const ConfigStorage = require('./ConfigStorage-
|
21
|
-
const SnkFormConfigManager = require('./SnkFormConfigManager-
|
20
|
+
const ConfigStorage = require('./ConfigStorage-bb8c0edf.js');
|
21
|
+
const SnkFormConfigManager = require('./SnkFormConfigManager-a23df43c.js');
|
22
22
|
const index$2 = require('./index-0ad2baeb.js');
|
23
23
|
require('./PrintUtils-bcaeb82f.js');
|
24
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource');
|
@@ -110,15 +110,15 @@ const SnkSimpleCrud = class {
|
|
110
110
|
newCustomRenders.set(fieldName, customRender);
|
111
111
|
this._customRenders = newCustomRenders;
|
112
112
|
}
|
113
|
-
handleResourceIDChanged(newValue, oldValue) {
|
113
|
+
async handleResourceIDChanged(newValue, oldValue) {
|
114
114
|
if (core.StringUtils.isEmpty(newValue)) {
|
115
115
|
return;
|
116
116
|
}
|
117
117
|
if (newValue === oldValue) {
|
118
118
|
return;
|
119
119
|
}
|
120
|
-
this.loadFormConfig(true);
|
121
|
-
this.loadGridConfig(true);
|
120
|
+
await this.loadFormConfig(true);
|
121
|
+
await this.loadGridConfig(true);
|
122
122
|
}
|
123
123
|
/**
|
124
124
|
* Registra um formatador de valores para uma coluna da grid.
|
@@ -174,7 +174,7 @@ const SnkSimpleCrud = class {
|
|
174
174
|
.concat(extraButtons));
|
175
175
|
}
|
176
176
|
addConfigButton(buttons) {
|
177
|
-
if (this.configName === undefined) {
|
177
|
+
if (this.configName === undefined || (this.configName && this.gridLegacyConfigName)) {
|
178
178
|
return buttons;
|
179
179
|
}
|
180
180
|
return buttons.concat(taskbarElements.TaskbarElement.CONFIGURATOR);
|
@@ -285,7 +285,7 @@ const SnkSimpleCrud = class {
|
|
285
285
|
if (!this._formConfigAlreadyLoaded) {
|
286
286
|
return;
|
287
287
|
}
|
288
|
-
this.loadFormConfig(true);
|
288
|
+
await this.loadFormConfig(true);
|
289
289
|
}
|
290
290
|
openConfig(viewMode) {
|
291
291
|
this._snkConfigurator.close();
|
@@ -370,8 +370,8 @@ const SnkSimpleCrud = class {
|
|
370
370
|
return;
|
371
371
|
}
|
372
372
|
await this.addGridLegacyConfigName();
|
373
|
-
this.loadGridConfig();
|
374
|
-
this.loadFormConfig();
|
373
|
+
await this.loadGridConfig();
|
374
|
+
await this.loadFormConfig();
|
375
375
|
}
|
376
376
|
componentDidRender() {
|
377
377
|
this._rmPrecisionCustomValueFormatter.setGrid(this._grid);
|
@@ -7,6 +7,8 @@ import InMemoryLoader from '../../lib/dataUnit/InMemoryLoader';
|
|
7
7
|
import { SaveErrorsEnum } from '../../lib/http/data-fetcher/fetchers/AttachFetcher/interfaces';
|
8
8
|
const RESOURCE_ID = 'AnexoSistema';
|
9
9
|
const DATA_UNIT_NAME = 'br.com.sankhya.core.v3.anexoSistema';
|
10
|
+
const GRID_LEGACY_CONFIG_NAME = 'GrdCfgHtml5:grdcfg.dynaform.anexo';
|
11
|
+
const LINKORFILE_COLUMN_NAME = "ARQUIVOOULINK";
|
10
12
|
export class SnkAttach {
|
11
13
|
constructor() {
|
12
14
|
this.handleTaskbarClick = async ({ detail: taskbar }) => {
|
@@ -33,6 +35,7 @@ export class SnkAttach {
|
|
33
35
|
this.back.emit();
|
34
36
|
});
|
35
37
|
};
|
38
|
+
this.gridLegacyConfigName = undefined;
|
36
39
|
this.fetcherType = undefined;
|
37
40
|
this.fetcher = undefined;
|
38
41
|
this.dataUnit = undefined;
|
@@ -144,9 +147,11 @@ export class SnkAttach {
|
|
144
147
|
var _a, _b;
|
145
148
|
this._currentDataUnit = new DataUnitFetcher().getDataUnit(RESOURCE_ID, DATA_UNIT_NAME);
|
146
149
|
this._currentFetcher = this.getAnexoSistemaFetcherInstance();
|
150
|
+
let gridValidateForm;
|
147
151
|
if (!this._currentDataUnit.metadata) {
|
148
152
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
149
|
-
this.crudConfig = Object.assign({}, anexoSistemaCrudConfig);
|
153
|
+
this.crudConfig = this.entityName ? { form: anexoSistemaCrudConfig === null || anexoSistemaCrudConfig === void 0 ? void 0 : anexoSistemaCrudConfig.form } : Object.assign({}, anexoSistemaCrudConfig);
|
154
|
+
gridValidateForm = { grid: anexoSistemaCrudConfig === null || anexoSistemaCrudConfig === void 0 ? void 0 : anexoSistemaCrudConfig.grid };
|
150
155
|
}
|
151
156
|
this.initDataUnitLoaders();
|
152
157
|
this._currentDataUnit.addFilterProvider({
|
@@ -156,19 +161,21 @@ export class SnkAttach {
|
|
156
161
|
interceptAction: (action) => this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement)
|
157
162
|
});
|
158
163
|
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData());
|
159
|
-
this.disableEditFieldsNotInForm();
|
164
|
+
this.disableEditFieldsNotInForm(gridValidateForm);
|
160
165
|
}
|
161
166
|
async loadAttach() {
|
162
167
|
var _a, _b;
|
163
168
|
this._currentFetcher = new AttachFetcher();
|
164
169
|
this._currentDataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
165
170
|
this._currentDataUnit.pageSize = 150;
|
171
|
+
let gridValidateForm;
|
166
172
|
this.initDataUnitLoaders();
|
167
173
|
this._currentDataUnit.addInterceptor({
|
168
174
|
interceptAction: (action) => {
|
169
175
|
var _a;
|
170
176
|
if (action.type === Action.METADATA_LOADED) {
|
171
|
-
this.crudConfig = Object.assign({}, attachCrudConfig);
|
177
|
+
this.crudConfig = this.entityName ? { form: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.form } : Object.assign({}, attachCrudConfig);
|
178
|
+
gridValidateForm = { grid: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.grid };
|
172
179
|
(_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.updateConfig();
|
173
180
|
}
|
174
181
|
return this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit, action, this._crudElement);
|
@@ -176,9 +183,10 @@ export class SnkAttach {
|
|
176
183
|
});
|
177
184
|
if (!this._currentDataUnit.metadata) {
|
178
185
|
await ((_a = this._currentDataUnit) === null || _a === void 0 ? void 0 : _a.loadMetadata());
|
179
|
-
this.crudConfig = Object.assign({}, attachCrudConfig);
|
186
|
+
this.crudConfig = this.entityName ? { form: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.form } : Object.assign({}, attachCrudConfig);
|
187
|
+
gridValidateForm = { grid: attachCrudConfig === null || attachCrudConfig === void 0 ? void 0 : attachCrudConfig.grid };
|
180
188
|
await ((_b = this._currentDataUnit) === null || _b === void 0 ? void 0 : _b.loadData(undefined, undefined, true, this.registerKey));
|
181
|
-
this.disableEditFieldsNotInForm();
|
189
|
+
this.disableEditFieldsNotInForm(gridValidateForm);
|
182
190
|
}
|
183
191
|
}
|
184
192
|
initDataUnitLoaders() {
|
@@ -197,12 +205,16 @@ export class SnkAttach {
|
|
197
205
|
});
|
198
206
|
}
|
199
207
|
}
|
200
|
-
disableEditFieldsNotInForm() {
|
201
|
-
var _a;
|
202
|
-
(_a = this.
|
203
|
-
|
208
|
+
disableEditFieldsNotInForm(gridValidateForm) {
|
209
|
+
var _a, _b, _c, _d, _e;
|
210
|
+
const gridColumns = ((_b = (_a = this._crudElement) === null || _a === void 0 ? void 0 : _a.gridConfig) === null || _b === void 0 ? void 0 : _b.columns) || ((_c = gridValidateForm === null || gridValidateForm === void 0 ? void 0 : gridValidateForm.grid) === null || _c === void 0 ? void 0 : _c.columns) || ((_e = (_d = this.crudConfig) === null || _d === void 0 ? void 0 : _d.grid) === null || _e === void 0 ? void 0 : _e.columns);
|
211
|
+
if (!!this.getGridLegacyConfigName()) {
|
212
|
+
this._currentDataUnit.disableField(LINKORFILE_COLUMN_NAME);
|
213
|
+
}
|
214
|
+
gridColumns === null || gridColumns === void 0 ? void 0 : gridColumns.forEach(column => {
|
215
|
+
var _a, _b;
|
204
216
|
const fieldName = column.name;
|
205
|
-
if (!((_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form.fields.some(field => field.name === fieldName))) {
|
217
|
+
if (!((_b = (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.form) === null || _b === void 0 ? void 0 : _b.fields.some(field => (field === null || field === void 0 ? void 0 : field.name) === fieldName))) {
|
206
218
|
this._currentDataUnit.disableField(fieldName);
|
207
219
|
}
|
208
220
|
});
|
@@ -252,11 +264,16 @@ export class SnkAttach {
|
|
252
264
|
await this._currentDataUnit.loadMetadata();
|
253
265
|
}
|
254
266
|
;
|
267
|
+
getGridLegacyConfigName() {
|
268
|
+
if (this.gridLegacyConfigName)
|
269
|
+
return this.gridLegacyConfigName;
|
270
|
+
return this.entityName ? GRID_LEGACY_CONFIG_NAME + "." + this.entityName : this.entityName;
|
271
|
+
}
|
255
272
|
render() {
|
256
273
|
var _a, _b;
|
257
274
|
if (!this._currentDataUnit)
|
258
275
|
return null;
|
259
|
-
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this), multipleSelection: true }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
276
|
+
return (h("main", { class: "snk-attach__main" }, h("header", { class: "snk-attach__header" }, h("snk-simple-bar", { onExit: this.handleBack, messagesBuilder: this.messagesBuilder }, h("div", { slot: "rightSlot" }, h("ez-button", { class: "ez-button--primary", label: this.getMessage("snkAttach.finish"), onClick: this.handleFinish })))), h("div", { class: "snk-attach__crud-section ez-size-height--full ez-size-width--full ez-flex ez-flex--column" }, h("div", { class: "ez-box__container" }, h("snk-simple-crud", { ref: (el) => this._crudElement = el, dataUnit: this._currentDataUnit, taskbarManager: buildTaskBarManager(), gridConfig: (_a = this.crudConfig) === null || _a === void 0 ? void 0 : _a.grid, formConfig: (_b = this.crudConfig) === null || _b === void 0 ? void 0 : _b.form, useCancelConfirm: false, onActionClick: this.handleTaskbarClick, messagesBuilder: this.messagesBuilder, onDataStateChange: this.handleOnDataStateChange.bind(this), multipleSelection: true, configName: this.entityName, ignoreReadOnlyFormFields: this.entityName ? true : false, gridLegacyConfigName: this.getGridLegacyConfigName() }, h("div", { slot: "snkSimpleCrudHeader" }, h("div", { class: "ez-flex ez-flex--column" }, h("span", { class: "ez-title--primary ez-text ez-text--large ez-text--bold ez-padding-bottom--medium" }, this.getMessage("snkAttach.title")), h("span", { class: "ez-text ez-text--medium ez-text--secondary ez-padding-bottom--medium" }, this.getMessage("snkAttach.description")))))))));
|
260
277
|
}
|
261
278
|
static get is() { return "snk-attach"; }
|
262
279
|
static get encapsulation() { return "scoped"; }
|
@@ -272,6 +289,23 @@ export class SnkAttach {
|
|
272
289
|
}
|
273
290
|
static get properties() {
|
274
291
|
return {
|
292
|
+
"gridLegacyConfigName": {
|
293
|
+
"type": "string",
|
294
|
+
"mutable": false,
|
295
|
+
"complexType": {
|
296
|
+
"original": "string",
|
297
|
+
"resolved": "string",
|
298
|
+
"references": {}
|
299
|
+
},
|
300
|
+
"required": false,
|
301
|
+
"optional": false,
|
302
|
+
"docs": {
|
303
|
+
"tags": [],
|
304
|
+
"text": "Chave da configura\u00E7\u00E3o legado da grid."
|
305
|
+
},
|
306
|
+
"attribute": "grid-legacy-config-name",
|
307
|
+
"reflect": false
|
308
|
+
},
|
275
309
|
"fetcherType": {
|
276
310
|
"type": "string",
|
277
311
|
"mutable": false,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { ApplicationContext, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
2
2
|
import { ApplicationUtils, DialogType } from '@sankhyalabs/ezui/dist/collection/utils';
|
3
3
|
import { h, Host } from '@stencil/core';
|
4
4
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
@@ -75,23 +75,10 @@ export class SnkGridConfig {
|
|
75
75
|
this._orderListItems = newSortableList;
|
76
76
|
}
|
77
77
|
createColumnList() {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
let hiddenGroup = {
|
83
|
-
group: this.getMessage('snkGridConfig.group.hidden'),
|
84
|
-
items: [],
|
85
|
-
sort: ORDER_VALUES.asc.value,
|
86
|
-
};
|
87
|
-
this.columns.forEach((column) => {
|
88
|
-
var _a;
|
89
|
-
let item = {
|
90
|
-
label: column.label,
|
91
|
-
selected: false,
|
92
|
-
sort: (_a = column === null || column === void 0 ? void 0 : column.sort) !== null && _a !== void 0 ? _a : ORDER_VALUES.asc.value,
|
93
|
-
id: column.name,
|
94
|
-
};
|
78
|
+
const visibleGroup = this.buildVisibleGroup();
|
79
|
+
const hiddenGroup = this.buildHiddenGroup();
|
80
|
+
this.columns.forEach(column => {
|
81
|
+
const item = this.buildListItemFromColumn(column);
|
95
82
|
if (column.hidden) {
|
96
83
|
hiddenGroup.items.push(item);
|
97
84
|
}
|
@@ -104,6 +91,19 @@ export class SnkGridConfig {
|
|
104
91
|
this._hiddenList = hiddenGroup.items;
|
105
92
|
this.createOrderList();
|
106
93
|
}
|
94
|
+
buildVisibleGroup() {
|
95
|
+
return {
|
96
|
+
group: this.getMessage('snkGridConfig.group.visible'),
|
97
|
+
items: [],
|
98
|
+
};
|
99
|
+
}
|
100
|
+
buildHiddenGroup() {
|
101
|
+
return {
|
102
|
+
group: this.getMessage('snkGridConfig.group.hidden'),
|
103
|
+
items: [],
|
104
|
+
sort: ORDER_VALUES.asc.value,
|
105
|
+
};
|
106
|
+
}
|
107
107
|
createOrderListSlotDataElementId(item) {
|
108
108
|
return `${this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME)}_configItem_${StringUtils.toCamelCase(item.label)}`;
|
109
109
|
}
|
@@ -116,7 +116,7 @@ export class SnkGridConfig {
|
|
116
116
|
return (h("snk-select-box", { selectedOption: selectedOption, key: 'snk-select-box-' + this._componenteInternalKey + '-' + item, "data-element-id": dataElementId, onEzChange: (evt) => {
|
117
117
|
evt.stopPropagation();
|
118
118
|
this.updateOrder(evt.detail, item.label);
|
119
|
-
} }));
|
119
|
+
}, preventAutoFocus: true }));
|
120
120
|
}
|
121
121
|
updateOrder(sortOrder, updatedItemLabel) {
|
122
122
|
var _a;
|
@@ -151,25 +151,21 @@ export class SnkGridConfig {
|
|
151
151
|
this.closeConfig();
|
152
152
|
return;
|
153
153
|
}
|
154
|
-
|
155
|
-
this._columListItems.forEach((group) => {
|
156
|
-
group.items.forEach((item) => {
|
157
|
-
const baseColumn = this.columns.find((column) => column.label === item.label);
|
158
|
-
let newColumnItem = Object.assign({}, baseColumn);
|
159
|
-
if (group.group === this.getMessage('snkGridConfig.group.hidden')) {
|
160
|
-
newColumnItem.hidden = true;
|
161
|
-
}
|
162
|
-
else {
|
163
|
-
newColumnItem.hidden = false;
|
164
|
-
}
|
165
|
-
newColumnList.push(newColumnItem);
|
166
|
-
});
|
167
|
-
});
|
168
|
-
this.columns = newColumnList;
|
154
|
+
this.updateColumns();
|
169
155
|
this._dataChanged = false;
|
170
156
|
this.closeConfig();
|
171
157
|
this.save();
|
172
158
|
}
|
159
|
+
updateColumns() {
|
160
|
+
this.columns = this._columListItems.flatMap((group) => group.items.map((item) => this.buildColumnFromListItem(item, group)));
|
161
|
+
}
|
162
|
+
buildColumnFromListItem(item, group) {
|
163
|
+
const baseColumn = this.columns.find((column) => column.label === item.label);
|
164
|
+
if (!baseColumn) {
|
165
|
+
throw new Error(`Column with label "${item.label}" not found.`);
|
166
|
+
}
|
167
|
+
return Object.assign(Object.assign({}, baseColumn), { hidden: group.group === this.getMessage('snkGridConfig.group.hidden') });
|
168
|
+
}
|
173
169
|
saveGridConfigOnStorage(_newConfig) {
|
174
170
|
ConfigStorage.saveGridConfig(_newConfig, this.configName, this.resourceID)
|
175
171
|
.then((savedConfig) => {
|
@@ -339,13 +335,55 @@ export class SnkGridConfig {
|
|
339
335
|
},
|
340
336
|
};
|
341
337
|
}
|
338
|
+
renderResetConfigBtn() {
|
339
|
+
if (!this.resourceID)
|
340
|
+
return;
|
341
|
+
return h("ez-button", { class: "padding-right--medium", label: this.getMessage('snkGridConfig.reset'), onClick: () => this.setDefaultConfig() });
|
342
|
+
}
|
343
|
+
async setDefaultConfig() {
|
344
|
+
var _a;
|
345
|
+
if (!this.resourceID)
|
346
|
+
return;
|
347
|
+
this._dataChanged = true;
|
348
|
+
const config = await ConfigStorage.getDefaultGridConfig(this.resourceID);
|
349
|
+
const defaultVisibleCols = (_a = config === null || config === void 0 ? void 0 : config.columns.map(col => col.name)) !== null && _a !== void 0 ? _a : [];
|
350
|
+
const visibleGroup = this.buildVisibleGroup();
|
351
|
+
const hiddenGroup = this.buildHiddenGroup();
|
352
|
+
const visibleItemsMap = new Map();
|
353
|
+
this.columns.forEach(column => {
|
354
|
+
const item = this.buildListItemFromColumn(column);
|
355
|
+
if (defaultVisibleCols.includes(column.name)) {
|
356
|
+
visibleItemsMap.set(column.name, item);
|
357
|
+
}
|
358
|
+
else {
|
359
|
+
hiddenGroup.items.push(item);
|
360
|
+
}
|
361
|
+
});
|
362
|
+
visibleGroup.items = defaultVisibleCols
|
363
|
+
.map(name => visibleItemsMap.get(name))
|
364
|
+
.filter(item => item);
|
365
|
+
this._columListItems = [visibleGroup, hiddenGroup];
|
366
|
+
this._visibleList = visibleGroup.items;
|
367
|
+
this._hiddenList = hiddenGroup.items;
|
368
|
+
this.updateColumns();
|
369
|
+
this.createOrderList();
|
370
|
+
}
|
371
|
+
buildListItemFromColumn(column) {
|
372
|
+
var _a;
|
373
|
+
return {
|
374
|
+
label: column.label,
|
375
|
+
selected: false,
|
376
|
+
sort: (_a = column === null || column === void 0 ? void 0 : column.sort) !== null && _a !== void 0 ? _a : ORDER_VALUES.asc.value,
|
377
|
+
id: column.name,
|
378
|
+
};
|
379
|
+
}
|
342
380
|
render() {
|
343
|
-
return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "ez-margin-bottom--medium" }, h("label", { class: "title" }, this.getMessage('snkGridConfig.gridConfiguration')), h("label", { class: "subtitle" }, this.getMessage('snkGridConfig.columnVisibilityOrder'))), h("div", { class: "button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", class: "ez-button--tertiary", onClick: () => this.closeConfig() })))), h("div", { class:
|
381
|
+
return (h(Host, null, h("div", { class: "grid-config__header" }, h("div", { class: "title-container" }, h("div", { class: "ez-margin-bottom--medium" }, h("label", { class: "title" }, this.getMessage('snkGridConfig.gridConfiguration')), h("label", { class: "subtitle" }, this.getMessage('snkGridConfig.columnVisibilityOrder'))), h("div", { class: "button-close" }, h("ez-button", { mode: "icon", iconName: "close", size: "medium", class: "ez-button--tertiary", onClick: () => this.closeConfig() })))), h("div", { class: 'grid-config__body' }, h("ez-collapsible-box", { id: 'group-select-columns', label: this.getMessage('snkGridConfig.columnsSelection'), "header-size": "medium", key: 'key_group-select-columns', value: this._collapsibleBoxListSelect, onEzChange: ({ detail }) => this._collapsibleBoxListOrder = !detail }, h("div", { class: "grid-config__main" }, h("ez-double-list", { leftList: this._hiddenList, leftTitle: this.getMessage('snkGridConfig.availableColumns'), rightList: this._visibleList, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), onEzRightListChanged: ({ detail }) => this.handleRightListChange(detail), emptyMessage: {
|
344
382
|
LEFT_LIST: this.getMessage('snkGridConfig.emptyMensage.left'),
|
345
383
|
RIGHT_LIST: this.getMessage('snkGridConfig.emptyMensage.right'),
|
346
384
|
}, entityLabel: 'coluna', entityLabelPlural: 'colunas' }))), h("ez-collapsible-box", { id: 'ID_group-order-columns', label: this.getMessage('snkGridConfig.dataOrdering'), "header-size": "medium", key: 'KEY_group-order-columns', value: this._collapsibleBoxListOrder, onEzChange: ({ detail }) => this._collapsibleBoxListSelect = !detail }, h("div", { class: "grid-config__main" }, h("ez-double-list", { rightList: this._orderListItems, rightTitle: this.getMessage('snkGridConfig.selectedColumns'), useOnlyRightList: true, slotsListBuilder: this.getListSlots(), emptyMessage: {
|
347
385
|
RIGHT_LIST: this.getMessage('snkGridConfig.emptyMensage.right'),
|
348
|
-
}, entityLabel: 'coluna', entityLabelPlural: 'colunas' })))), h("div", { class: "grid-config__footer" }, h("ez-button", { class: "padding-right--medium", label: this.getMessage('snkGridConfig.cancel'), onClick: () => this.closeConfig() }), h("ez-button", { label: this.getMessage('snkGridConfig.complete'), class: "ez-button--primary", onClick: () => this.finish() }))));
|
386
|
+
}, entityLabel: 'coluna', entityLabelPlural: 'colunas' })))), h("div", { class: "grid-config__footer" }, this.renderResetConfigBtn(), h("ez-button", { class: "padding-right--medium", label: this.getMessage('snkGridConfig.cancel'), onClick: () => this.closeConfig() }), h("ez-button", { label: this.getMessage('snkGridConfig.complete'), class: "ez-button--primary", onClick: () => this.finish() }))));
|
349
387
|
}
|
350
388
|
static get is() { return "snk-grid-config"; }
|
351
389
|
static get encapsulation() { return "scoped"; }
|