@sankhyalabs/sankhyablocks 10.1.0-dev.37 → 10.1.0-dev.38
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-e384fb7b.js → ConfigStorage-a1fab5ca.js} +2 -2
- package/dist/cjs/ContinuousInsertUtils-1ae0c6ac.js +41 -0
- package/dist/cjs/{DataFetcher-3a8ea521.js → DataFetcher-384d2ce8.js} +1 -1
- package/dist/cjs/{ISave-a66bb65e.js → ISave-ecbe9336.js} +1 -1
- package/dist/cjs/{ImageUtils-5e3f406b.js → ImageUtils-c46f2d11.js} +1 -1
- package/dist/cjs/{SnkFormConfigManager-73df0f8b.js → SnkFormConfigManager-44386305.js} +2 -2
- package/dist/cjs/{SnkMessageBuilder-d9558dba.js → SnkMessageBuilder-a9300ebe.js} +24 -0
- package/dist/cjs/{SnkMultiSelectionListDataSource-016393f3.js → SnkMultiSelectionListDataSource-b951ed91.js} +61 -47
- package/dist/cjs/{auth-fetcher-80e608b0.js → auth-fetcher-6b134ec4.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-6febd6c4.js → dataunit-fetcher-93f53260.js} +2 -2
- package/dist/cjs/{form-config-fetcher-81cbd405.js → form-config-fetcher-45d1964c.js} +1 -1
- package/dist/cjs/index-1894343a.js +8 -8
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/pesquisa-grid_2.cjs.entry.js +5 -5
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_8.cjs.entry.js → snk-actions-button_9.cjs.entry.js} +52 -12
- package/dist/cjs/snk-application.cjs.entry.js +7 -7
- package/dist/cjs/snk-attach.cjs.entry.js +50 -24
- package/dist/cjs/snk-crud.cjs.entry.js +349 -109
- package/dist/cjs/snk-data-exporter.cjs.entry.js +8 -7
- package/dist/cjs/{snk-data-unit-94757628.js → snk-data-unit-6abc5efc.js} +2 -2
- package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
- package/dist/cjs/snk-detail-view.cjs.entry.js +11 -16
- package/dist/cjs/snk-entity-search.cjs.entry.js +211 -0
- package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +1 -1
- package/dist/cjs/{snk-filter-advanced-mode_2.cjs.entry.js → snk-filter-advanced-mode_3.cjs.entry.js} +39 -1
- package/dist/cjs/snk-filter-bar_4.cjs.entry.js +106 -95
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -4
- package/dist/cjs/snk-form-view.cjs.entry.js +1 -1
- package/dist/cjs/snk-form_2.cjs.entry.js +5 -5
- package/dist/cjs/snk-grid.cjs.entry.js +40 -17
- package/dist/cjs/{snk-guides-viewer-688c4398.js → snk-guides-viewer-b4ca3437.js} +37 -153
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -17
- package/dist/cjs/snk-image-input.cjs.entry.js +2 -2
- package/dist/cjs/snk-layout-form-config.cjs.entry.js +5 -5
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +5 -5
- package/dist/cjs/snk-pesquisa.cjs.entry.js +5 -5
- package/dist/cjs/snk-simple-crud.cjs.entry.js +12 -12
- package/dist/cjs/snk-taskbar.cjs.entry.js +181 -124
- package/dist/cjs/taskbar-elements-80eddec8.js +152 -0
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/snk-actions-button/snk-actions-button.js +27 -3
- package/dist/collection/components/snk-attach/snk-attach.css +29 -7
- package/dist/collection/components/snk-attach/snk-attach.js +81 -18
- package/dist/collection/components/snk-crud/snk-crud.css +46 -0
- package/dist/collection/components/snk-crud/snk-crud.js +148 -94
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -5
- package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.css +17 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.js +330 -0
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +22 -8
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +35 -144
- package/dist/collection/components/snk-crud/utils/taskbarUtils.js +144 -0
- package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +1 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +20 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +2 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +23 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +6 -1
- package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +8 -5
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +139 -84
- package/dist/collection/components/snk-grid/snk-grid.css +12 -3
- package/dist/collection/components/snk-grid/snk-grid.js +148 -4
- package/dist/collection/components/snk-image-input/utils/ImageUtils.js +1 -1
- package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +8 -0
- package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +38 -2
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +51 -35
- package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +27 -1
- package/dist/collection/components/snk-taskbar/processor/simple-taskbar-processor.js +55 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +44 -1
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +248 -132
- package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.css +12 -0
- package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.js +19 -0
- package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +8 -0
- package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +8 -0
- package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +8 -0
- package/dist/components/ContinuousInsertUtils.js +1 -1
- package/dist/components/SnkMessageBuilder.js +24 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/snk-actions-button2.js +6 -3
- package/dist/components/snk-attach2.js +56 -27
- package/dist/components/snk-crud.js +427 -175
- package/dist/components/snk-data-exporter2.js +3 -1
- package/dist/components/snk-detail-view2.js +158 -258
- package/dist/components/snk-entity-search.d.ts +11 -0
- package/dist/components/snk-entity-search.js +6 -0
- package/dist/components/snk-entity-search2.js +231 -0
- package/dist/components/snk-exporter-email-sender2.js +1 -1
- package/dist/components/snk-filter-bar2.js +94 -85
- package/dist/components/snk-filter-item2.js +4 -2
- package/dist/components/snk-filter-modal2.js +8 -5
- package/dist/components/snk-grid2.js +82 -47
- package/dist/components/snk-image-input2.js +1 -1
- package/dist/components/snk-personalized-filter2.js +1 -1
- package/dist/components/snk-simple-crud2.js +29 -23
- package/dist/components/snk-taskbar-skeleton.d.ts +11 -0
- package/dist/components/snk-taskbar-skeleton.js +6 -0
- package/dist/components/snk-taskbar-skeleton2.js +29 -0
- package/dist/components/snk-taskbar2.js +253 -174
- package/dist/components/taskbar-actions-button2.js +21 -2
- package/dist/components/taskbar-split-button2.js +10 -1
- package/dist/esm/{ConfigStorage-82ff76fb.js → ConfigStorage-76872695.js} +2 -2
- package/dist/esm/ContinuousInsertUtils-bce77dc1.js +39 -0
- package/dist/esm/{DataFetcher-1dd7e8c0.js → DataFetcher-e60f8d53.js} +1 -1
- package/dist/esm/{ISave-498c4831.js → ISave-4929c071.js} +1 -1
- package/dist/esm/{ImageUtils-8fc8d905.js → ImageUtils-7f3a4149.js} +1 -1
- package/dist/esm/{SnkFormConfigManager-e8ae1561.js → SnkFormConfigManager-83f6b22f.js} +2 -2
- package/dist/esm/{SnkMessageBuilder-c0bc4424.js → SnkMessageBuilder-1eb7a1af.js} +24 -0
- package/dist/esm/{SnkMultiSelectionListDataSource-ec783ded.js → SnkMultiSelectionListDataSource-7fe25a58.js} +55 -41
- package/dist/esm/{auth-fetcher-38a83f5e.js → auth-fetcher-1a31c1e4.js} +1 -1
- package/dist/esm/{dataunit-fetcher-21c43ec7.js → dataunit-fetcher-050b6d31.js} +2 -2
- package/dist/esm/{form-config-fetcher-24eb587c.js → form-config-fetcher-b44b2727.js} +1 -1
- package/dist/esm/index-04f73a26.js +8 -8
- package/dist/esm/loader.js +1 -1
- package/dist/esm/pesquisa-grid_2.entry.js +5 -5
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_8.entry.js → snk-actions-button_9.entry.js} +52 -13
- package/dist/esm/snk-application.entry.js +7 -7
- package/dist/esm/snk-attach.entry.js +50 -24
- package/dist/esm/snk-crud.entry.js +338 -98
- package/dist/esm/snk-data-exporter.entry.js +8 -7
- package/dist/esm/{snk-data-unit-3b06a0f3.js → snk-data-unit-ca2c9858.js} +2 -2
- package/dist/esm/snk-data-unit.entry.js +4 -4
- package/dist/esm/snk-detail-view.entry.js +11 -16
- package/dist/esm/snk-entity-search.entry.js +207 -0
- package/dist/esm/snk-exporter-email-sender.entry.js +1 -1
- package/dist/esm/{snk-filter-advanced-mode_2.entry.js → snk-filter-advanced-mode_3.entry.js} +40 -3
- package/dist/esm/snk-filter-bar_4.entry.js +107 -96
- package/dist/esm/snk-filter-modal-item.entry.js +4 -4
- package/dist/esm/snk-form-view.entry.js +1 -1
- package/dist/esm/snk-form_2.entry.js +5 -5
- package/dist/esm/snk-grid.entry.js +37 -14
- package/dist/esm/{snk-guides-viewer-6ddc7e6a.js → snk-guides-viewer-cc37535b.js} +38 -154
- package/dist/esm/snk-guides-viewer.entry.js +9 -17
- package/dist/esm/snk-image-input.entry.js +2 -2
- package/dist/esm/snk-layout-form-config.entry.js +5 -5
- package/dist/esm/snk-personalized-filter.entry.js +5 -5
- package/dist/esm/snk-pesquisa.entry.js +5 -5
- package/dist/esm/snk-simple-crud.entry.js +10 -10
- package/dist/esm/snk-taskbar.entry.js +182 -125
- package/dist/esm/taskbar-elements-63651ca7.js +149 -0
- package/dist/sankhyablocks/p-09ba6bd4.js +1 -0
- package/dist/sankhyablocks/p-10f27dc6.entry.js +1 -0
- package/dist/sankhyablocks/{p-54f5c36d.entry.js → p-20af4b6a.entry.js} +1 -1
- package/dist/sankhyablocks/p-225f92cf.entry.js +1 -0
- package/dist/sankhyablocks/{p-605a2a99.entry.js → p-251aee41.entry.js} +1 -1
- package/dist/sankhyablocks/{p-bdf0077f.js → p-2af8aca3.js} +1 -1
- package/dist/sankhyablocks/p-3072136e.js +1 -0
- package/dist/sankhyablocks/p-33492640.entry.js +1 -0
- package/dist/sankhyablocks/{p-f208ec52.entry.js → p-35317d9a.entry.js} +1 -1
- package/dist/sankhyablocks/{p-6753f16e.js → p-3704bf1b.js} +1 -1
- package/dist/sankhyablocks/{p-2d606189.js → p-3870748a.js} +1 -1
- package/dist/sankhyablocks/{p-e057ecb6.js → p-3c990841.js} +1 -1
- package/dist/sankhyablocks/{p-4ff3b494.js → p-420b39b5.js} +1 -1
- package/dist/sankhyablocks/{p-8bb4e86b.entry.js → p-46f75667.entry.js} +1 -1
- package/dist/sankhyablocks/{p-32ad76cc.js → p-4f7adf97.js} +2 -2
- package/dist/sankhyablocks/p-554c0e54.js +1 -0
- package/dist/sankhyablocks/p-6ae7543b.entry.js +1 -0
- package/dist/sankhyablocks/p-771b137e.js +1 -0
- package/dist/sankhyablocks/p-77f608bc.entry.js +1 -0
- package/dist/sankhyablocks/p-7c8bf699.entry.js +1 -0
- package/dist/sankhyablocks/{p-d34a41ec.entry.js → p-8a8900a9.entry.js} +1 -1
- package/dist/sankhyablocks/{p-e484913b.entry.js → p-95af0bb1.entry.js} +1 -1
- package/dist/sankhyablocks/{p-10cad767.entry.js → p-98241c21.entry.js} +1 -1
- package/dist/sankhyablocks/{p-f5b929c2.entry.js → p-ab12f544.entry.js} +1 -1
- package/dist/sankhyablocks/{p-ef8cf0e2.js → p-ab5e12fa.js} +1 -1
- package/dist/sankhyablocks/p-ac384a1e.entry.js +1 -0
- package/dist/sankhyablocks/p-ac85f011.entry.js +1 -0
- package/dist/sankhyablocks/{p-3a98c337.entry.js → p-aff2d081.entry.js} +1 -1
- package/dist/sankhyablocks/p-b3b51693.entry.js +1 -0
- package/dist/sankhyablocks/{p-08415ef7.entry.js → p-bab4cde4.entry.js} +1 -1
- package/dist/sankhyablocks/p-ce3b284c.entry.js +1 -0
- package/dist/sankhyablocks/p-ce8ccd72.entry.js +1 -0
- package/dist/sankhyablocks/{p-b9970342.js → p-d972a9c1.js} +1 -1
- package/dist/sankhyablocks/p-e5a3711f.js +1 -0
- package/dist/sankhyablocks/{p-2b882835.entry.js → p-e737fd5a.entry.js} +1 -1
- package/dist/sankhyablocks/p-efd18bc2.entry.js +1 -0
- package/dist/sankhyablocks/{p-362e6e8c.js → p-f185d5ad.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +4 -0
- package/dist/types/components/snk-attach/snk-attach.d.ts +20 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +28 -10
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +1 -1
- package/dist/types/components/snk-crud/subcomponents/snk-entity-search.d.ts +62 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +4 -18
- package/dist/types/components/snk-crud/utils/taskbarUtils.d.ts +13 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +32 -20
- package/dist/types/components/snk-grid/snk-grid.d.ts +28 -1
- package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +6 -0
- package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -2
- package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +5 -0
- package/dist/types/components/snk-taskbar/processor/simple-taskbar-processor.d.ts +31 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +32 -21
- package/dist/types/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.d.ts +3 -0
- package/dist/types/components.d.ts +197 -4
- package/package.json +2 -2
- package/react/components.d.ts +2 -0
- package/react/components.js +2 -0
- package/react/components.js.map +1 -1
- package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -45
- package/dist/cjs/taskbar-elements-a94d4318.js +0 -133
- package/dist/cjs/taskbar-processor-2fba34a8.js +0 -53
- package/dist/esm/snk-simple-bar.entry.js +0 -41
- package/dist/esm/taskbar-elements-97541bdd.js +0 -130
- package/dist/esm/taskbar-processor-3436124c.js +0 -51
- package/dist/sankhyablocks/p-07aa8192.entry.js +0 -1
- package/dist/sankhyablocks/p-1a0caadb.js +0 -1
- package/dist/sankhyablocks/p-27aea149.entry.js +0 -1
- package/dist/sankhyablocks/p-27d6590e.js +0 -1
- package/dist/sankhyablocks/p-449e36d2.entry.js +0 -1
- package/dist/sankhyablocks/p-615655bd.entry.js +0 -1
- package/dist/sankhyablocks/p-62e17eea.entry.js +0 -1
- package/dist/sankhyablocks/p-6e1a7929.entry.js +0 -1
- package/dist/sankhyablocks/p-72d62f22.js +0 -1
- package/dist/sankhyablocks/p-9c1ff75e.entry.js +0 -1
- package/dist/sankhyablocks/p-a8c5ebf1.entry.js +0 -1
- package/dist/sankhyablocks/p-b25777fa.entry.js +0 -1
- package/dist/sankhyablocks/p-b6d47f08.entry.js +0 -1
- package/dist/sankhyablocks/p-b8453e18.js +0 -1
- package/dist/sankhyablocks/p-c8043a53.entry.js +0 -1
- package/dist/sankhyablocks/p-f0c9969e.entry.js +0 -1
- package/dist/sankhyablocks/p-fc5938fb.js +0 -1
|
@@ -2,80 +2,255 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-1894343a.js');
|
|
5
|
+
const index$1 = require('./index-1894343a.js');
|
|
6
6
|
const core = require('@sankhyalabs/core');
|
|
7
|
-
require('./DataFetcher-
|
|
8
|
-
require('./ISave-
|
|
9
|
-
const index
|
|
7
|
+
require('./DataFetcher-384d2ce8.js');
|
|
8
|
+
require('./ISave-ecbe9336.js');
|
|
9
|
+
const index = require('./index-e3e39724.js');
|
|
10
10
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
11
11
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
12
|
-
require('./dataunit-fetcher-
|
|
12
|
+
require('./dataunit-fetcher-93f53260.js');
|
|
13
13
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
14
|
-
require('./form-config-fetcher-
|
|
14
|
+
require('./form-config-fetcher-45d1964c.js');
|
|
15
15
|
const constants = require('./constants-6d82e405.js');
|
|
16
|
-
const authFetcher = require('./auth-fetcher-
|
|
16
|
+
const authFetcher = require('./auth-fetcher-6b134ec4.js');
|
|
17
17
|
const ServicesNumberingConfig = require('./ServicesNumberingConfig-69038a0f.js');
|
|
18
|
-
const taskbarElements = require('./taskbar-elements-
|
|
18
|
+
const taskbarElements = require('./taskbar-elements-80eddec8.js');
|
|
19
|
+
const filterValidate = require('./filter-validate-cb4ed41a.js');
|
|
20
|
+
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
21
|
+
const ContinuousInsertUtils = require('./ContinuousInsertUtils-1ae0c6ac.js');
|
|
19
22
|
require('./PrintUtils-bcaeb82f.js');
|
|
20
|
-
require('./SnkMessageBuilder-
|
|
23
|
+
require('./SnkMessageBuilder-a9300ebe.js');
|
|
21
24
|
require('@sankhyalabs/ezui/dist/collection/components/ez-grid/utils');
|
|
22
25
|
require('@sankhyalabs/core/dist/utils/SortingUtils');
|
|
23
26
|
require('./ResourceIDUtils-5ff86aa7.js');
|
|
24
27
|
require('./index-f0fe7e6e.js');
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
class SimpleTaskbarProcessor {
|
|
30
|
+
/**
|
|
31
|
+
* Cria uma nova instância do processador de taskbar.
|
|
32
|
+
* @param defaultButtons - Array com os botões padrão a serem exibidos
|
|
33
|
+
*/
|
|
34
|
+
constructor(defaultButtons) {
|
|
35
|
+
this._defaultButtons = [];
|
|
36
|
+
this._defaultButtons = [...defaultButtons];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Processa a taskbar aplicando regras de visibilidade e habilitação.
|
|
40
|
+
* @param taskbarID - Identificador único da taskbar
|
|
41
|
+
* @param taskbarManager - Gerenciador de taskbar com regras customizadas
|
|
42
|
+
* @param dataState - Estado atual dos dados
|
|
43
|
+
* @param disabledButtons - Array de botões desabilitados
|
|
44
|
+
* @param invisibleButtons - Array de botões invisíveis
|
|
45
|
+
*/
|
|
46
|
+
process(taskbarID, taskbarManager, dataState, disabledButtons = [], invisibleButtons = []) {
|
|
47
|
+
var _a;
|
|
48
|
+
this.taskbarID = taskbarID;
|
|
49
|
+
this.customButtons = new Map();
|
|
50
|
+
this.buttonsArray = [];
|
|
51
|
+
this.disabledButtons = [...disabledButtons];
|
|
52
|
+
(_a = this.getButtonsArray(taskbarManager, dataState)) === null || _a === void 0 ? void 0 : _a.forEach((btnDef) => {
|
|
53
|
+
let buttonName;
|
|
54
|
+
if (typeof btnDef === "string") {
|
|
55
|
+
buttonName = btnDef;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
this.customButtons.set(btnDef.name, btnDef);
|
|
59
|
+
buttonName = btnDef.name;
|
|
60
|
+
}
|
|
61
|
+
if (!invisibleButtons.includes(buttonName)) {
|
|
62
|
+
if (!this.isEnabled(taskbarManager, buttonName, dataState, disabledButtons)) {
|
|
63
|
+
this.disabledButtons.push(buttonName);
|
|
64
|
+
}
|
|
65
|
+
this.buttonsArray.push(buttonName);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
this.buttons = this.buttonsArray.join(",");
|
|
69
|
+
}
|
|
70
|
+
getButtonsArray(taskbarManager, dataState) {
|
|
71
|
+
if (taskbarManager) {
|
|
72
|
+
return taskbarManager.getButtons(this.taskbarID, dataState, [...this._defaultButtons]);
|
|
73
|
+
}
|
|
74
|
+
return this._defaultButtons;
|
|
75
|
+
}
|
|
76
|
+
isEnabled(taskbarManager, buttonName, dataState, disabled) {
|
|
77
|
+
const originalValue = !disabled.includes(buttonName);
|
|
78
|
+
if (taskbarManager && taskbarManager.isEnabled) {
|
|
79
|
+
return taskbarManager.isEnabled(this.taskbarID, dataState, buttonName, originalValue);
|
|
80
|
+
}
|
|
81
|
+
return originalValue;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
27
84
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
85
|
+
const DEFAULT_TASKBAR_BUTTONS = [
|
|
86
|
+
taskbarElements.TaskbarElement.FORM_MODE,
|
|
87
|
+
taskbarElements.TaskbarElement.PREVIOUS,
|
|
88
|
+
taskbarElements.TaskbarElement.NEXT,
|
|
89
|
+
taskbarElements.TaskbarElement.REFRESH,
|
|
90
|
+
taskbarElements.TaskbarElement.SPACER,
|
|
91
|
+
taskbarElements.TaskbarElement.ACTIONS_BUTTON,
|
|
92
|
+
taskbarElements.TaskbarElement.DATA_EXPORTER,
|
|
93
|
+
taskbarElements.TaskbarElement.ATTACH,
|
|
94
|
+
taskbarElements.TaskbarElement.CLONE,
|
|
95
|
+
taskbarElements.TaskbarElement.UPDATE,
|
|
96
|
+
taskbarElements.TaskbarElement.REMOVE,
|
|
97
|
+
taskbarElements.TaskbarElement.INSERT,
|
|
98
|
+
taskbarElements.TaskbarElement.CONFIGURATOR,
|
|
99
|
+
taskbarElements.TaskbarElement.MORE_OPTIONS,
|
|
100
|
+
];
|
|
101
|
+
var CustomTaskbarButton;
|
|
102
|
+
(function (CustomTaskbarButton) {
|
|
103
|
+
CustomTaskbarButton["FILTER"] = "FILTER";
|
|
104
|
+
CustomTaskbarButton["ENTITY_SEARCH"] = "ENTITY_SEARCH";
|
|
105
|
+
})(CustomTaskbarButton || (CustomTaskbarButton = {}));
|
|
106
|
+
/**
|
|
107
|
+
* Insere os botões customizados à esquerda do elemento SPACER na lista de botões.
|
|
108
|
+
* Caso o SPACER não seja encontrado, os botões são inseridos no início da lista.
|
|
109
|
+
*/
|
|
110
|
+
function insertCustomButtonsBeforeSpacer(buttons, customButtons) {
|
|
111
|
+
const spacerIndex = buttons.findIndex(btn => btn === taskbarElements.TaskbarElement.SPACER || (typeof btn === 'string' && btn === 'SPACER'));
|
|
112
|
+
if (spacerIndex > -1) {
|
|
113
|
+
return [
|
|
114
|
+
...buttons.slice(0, spacerIndex),
|
|
115
|
+
...customButtons,
|
|
116
|
+
...buttons.slice(spacerIndex),
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
return [...customButtons, ...buttons];
|
|
120
|
+
}
|
|
121
|
+
function buildNativeTaskbarManager(currentViewMode, mergeTaskbarManager, messagesBuilder) {
|
|
122
|
+
var _a, _b;
|
|
123
|
+
const CUSTOM_BUTTONS = [
|
|
124
|
+
{
|
|
125
|
+
name: CustomTaskbarButton.FILTER,
|
|
126
|
+
hint: (_a = messagesBuilder === null || messagesBuilder === void 0 ? void 0 : messagesBuilder.getMessage("snkCrud.customButtons.filter")) !== null && _a !== void 0 ? _a : "Abre o painel de filtros",
|
|
127
|
+
iconName: "filter",
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: CustomTaskbarButton.ENTITY_SEARCH,
|
|
131
|
+
hint: (_b = messagesBuilder === null || messagesBuilder === void 0 ? void 0 : messagesBuilder.getMessage("snkCrud.customButtons.entitySearch")) !== null && _b !== void 0 ? _b : "Busca na entidade",
|
|
132
|
+
iconName: "search",
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
const EDITION_MODE_BUTTONS = [
|
|
136
|
+
taskbarElements.TaskbarElement.CANCEL,
|
|
137
|
+
taskbarElements.TaskbarElement.SAVE,
|
|
138
|
+
];
|
|
139
|
+
return {
|
|
140
|
+
getButtons: (taskbarID, dataState, defaultButtons) => {
|
|
141
|
+
var _a, _b;
|
|
142
|
+
if (!taskbarID) {
|
|
143
|
+
console.warn('taskbarID não fornecido');
|
|
46
144
|
return [];
|
|
47
145
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
146
|
+
const isInEditionMode = (dataState === null || dataState === void 0 ? void 0 : dataState.insertionMode) || (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty);
|
|
147
|
+
if (isInEditionMode) {
|
|
148
|
+
return EDITION_MODE_BUTTONS;
|
|
149
|
+
}
|
|
150
|
+
if (currentViewMode === constants.VIEW_MODE.FORM) {
|
|
151
|
+
const indexFormMode = defaultButtons.indexOf(taskbarElements.TaskbarElement.FORM_MODE);
|
|
152
|
+
if (indexFormMode > -1) {
|
|
153
|
+
defaultButtons = [
|
|
154
|
+
...defaultButtons.slice(0, indexFormMode),
|
|
155
|
+
taskbarElements.TaskbarElement.GRID_MODE,
|
|
156
|
+
...defaultButtons.slice(indexFormMode + 1)
|
|
157
|
+
];
|
|
53
158
|
}
|
|
54
|
-
return await this._application.executePreparedSearch(mode, value, this.buildSearchOptions(entityName));
|
|
55
159
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
160
|
+
if (((_b = (_a = dataState === null || dataState === void 0 ? void 0 : dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b.length) > 1) {
|
|
161
|
+
const indexUpdate = defaultButtons.indexOf(taskbarElements.TaskbarElement.UPDATE);
|
|
162
|
+
if (indexUpdate > -1) {
|
|
163
|
+
defaultButtons = [
|
|
164
|
+
...defaultButtons.slice(0, indexUpdate),
|
|
165
|
+
taskbarElements.TaskbarElement.UPDATE_MULTIPLE,
|
|
166
|
+
...defaultButtons.slice(indexUpdate + 1)
|
|
167
|
+
];
|
|
168
|
+
}
|
|
59
169
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return;
|
|
170
|
+
const defaultsWithCustomButtons = insertCustomButtonsBeforeSpacer(defaultButtons, CUSTOM_BUTTONS);
|
|
171
|
+
if (mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.getButtons) {
|
|
172
|
+
return mergeTaskbarManager.getButtons(taskbarID, dataState, defaultsWithCustomButtons);
|
|
64
173
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
174
|
+
return defaultsWithCustomButtons;
|
|
175
|
+
},
|
|
176
|
+
isEnabled: (_, dataState, buttonName, originalValue) => {
|
|
177
|
+
var _a;
|
|
178
|
+
if (!dataState) {
|
|
179
|
+
return originalValue;
|
|
68
180
|
}
|
|
69
|
-
|
|
70
|
-
|
|
181
|
+
const hasSelectedRecord = dataState.selectedRecord !== undefined;
|
|
182
|
+
const buttonsRequiringSelection = [
|
|
183
|
+
taskbarElements.TaskbarElement.UPDATE,
|
|
184
|
+
taskbarElements.TaskbarElement.REMOVE,
|
|
185
|
+
taskbarElements.TaskbarElement.ATTACH,
|
|
186
|
+
taskbarElements.TaskbarElement.CLONE,
|
|
187
|
+
];
|
|
188
|
+
if (!hasSelectedRecord && buttonsRequiringSelection.includes(buttonName)) {
|
|
189
|
+
return false;
|
|
71
190
|
}
|
|
72
|
-
|
|
191
|
+
return (_a = mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.isEnabled(_, dataState, buttonName, originalValue)) !== null && _a !== void 0 ? _a : originalValue;
|
|
192
|
+
},
|
|
193
|
+
getMoreOptions(taskbarId, configName, dataState, currentActions) {
|
|
194
|
+
var _a;
|
|
195
|
+
return (_a = mergeTaskbarManager === null || mergeTaskbarManager === void 0 ? void 0 : mergeTaskbarManager.getMoreOptions) === null || _a === void 0 ? void 0 : _a.call(mergeTaskbarManager, taskbarId, configName, dataState, currentActions);
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function getHeaderTaskbarId(dataState, presentationMode) {
|
|
200
|
+
var _a;
|
|
201
|
+
const hasSelectedRecord = dataState && !!((_a = dataState.selectionInfo) === null || _a === void 0 ? void 0 : _a.length);
|
|
202
|
+
const taskbarIdPrefixLookup = {
|
|
203
|
+
primary: "snkGridHeaderTaskbar",
|
|
204
|
+
secondary: "snkGridHeaderTaskbar",
|
|
205
|
+
singleTaskbar: "snkGridHeaderTaskbar.singleTaskbar",
|
|
206
|
+
};
|
|
207
|
+
const taskbarIdPrefix = taskbarIdPrefixLookup[presentationMode];
|
|
208
|
+
let headerTaskbarId = hasSelectedRecord ? `${taskbarIdPrefix}.selected` : `${taskbarIdPrefix}.unselected`;
|
|
209
|
+
if ((dataState === null || dataState === void 0 ? void 0 : dataState.isDirty) && presentationMode === index.PresentationMode.SINGLE_TASKBAR) {
|
|
210
|
+
headerTaskbarId = "snkGridHeaderTaskbar.singleTaskbar.finish_edition";
|
|
211
|
+
}
|
|
212
|
+
return headerTaskbarId;
|
|
213
|
+
}
|
|
214
|
+
function getTopTaskBarId(dataState, presentationMode) {
|
|
215
|
+
const suffixLookup = {
|
|
216
|
+
primary: '',
|
|
217
|
+
secondary: '.secondary',
|
|
218
|
+
singleTaskbar: '.singleTaskbar',
|
|
219
|
+
};
|
|
220
|
+
const sufix = suffixLookup[presentationMode];
|
|
221
|
+
if (dataState === null || dataState === void 0 ? void 0 : dataState.isDirty) {
|
|
222
|
+
return `snkGridTopTaskbar.finish_edition${sufix}`;
|
|
223
|
+
}
|
|
224
|
+
return `snkGridTopTaskbar.regular${sufix}`;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const snkCrudCss = ".sc-snk-crud-h{display:flex;flex-direction:column;height:100%;width:100%;overflow-y:auto;scrollbar-gutter:stable both-edges}snk-grid.sc-snk-crud{--snk-grid-padding:0 var(--space--6, 6px) var(--space--6, 6px) var(--space--6, 6px)}stack-item.sc-snk-crud.sc-snk-crud{display:grid;min-height:100%}.snk-crud__grid-stack-item.sc-snk-crud{display:flex;flex-direction:column;height:100%;width:100%;padding:0 var(--space--2, 2px)}.snk-crud__header-top.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:var(--space--8, 8px);padding-top:var(--space--12, 12px)}.snk-crud__header-bottom.sc-snk-crud{display:flex;justify-content:space-between;align-items:center;padding:0 var(--space--8, 8px) 0 var(--space--6, 6px)}.snk-crud__header-bottom.sc-snk-crud>snk-taskbar.sc-snk-crud{padding-bottom:var(--space--8, 8px);margin-left:var(--space--12, 12px)}.snk-crud--hidden.sc-snk-crud{display:none !important}ez-record-navigation.sc-snk-crud,ez-grid-pagination.sc-snk-crud{margin-bottom:var(--space--8, 8px)}";
|
|
228
|
+
|
|
229
|
+
const SnkCrud = class {
|
|
230
|
+
constructor(hostRef) {
|
|
231
|
+
index$1.registerInstance(this, hostRef);
|
|
232
|
+
this.snkShowGuide = index$1.createEvent(this, "snkShowGuide", 7);
|
|
233
|
+
this.actionClick = index$1.createEvent(this, "actionClick", 7);
|
|
234
|
+
this.configuratorSave = index$1.createEvent(this, "configuratorSave", 7);
|
|
235
|
+
this.configuratorCancel = index$1.createEvent(this, "configuratorCancel", 7);
|
|
236
|
+
this.formItemsReady = index$1.createEvent(this, "formItemsReady", 7);
|
|
237
|
+
this.viewModeChanged = index$1.createEvent(this, "viewModeChanged", 7);
|
|
238
|
+
this.numberingConfigChanged = index$1.createEvent(this, "numberingConfigChanged", 7);
|
|
239
|
+
this._viewHistory = [];
|
|
240
|
+
this._customEditors = new Map();
|
|
241
|
+
this._customRenders = new Map();
|
|
242
|
+
this._taskbarProcessor = new SimpleTaskbarProcessor(DEFAULT_TASKBAR_BUTTONS);
|
|
243
|
+
this._taskbarCustomProcessor = new SimpleTaskbarProcessor([]);
|
|
73
244
|
this.dataUnitInterceptor = {
|
|
74
|
-
interceptAction: (action) => {
|
|
75
|
-
|
|
76
|
-
|
|
245
|
+
interceptAction: async (action) => {
|
|
246
|
+
switch (action.type) {
|
|
247
|
+
case core.Action.DATA_SAVED:
|
|
248
|
+
return this.interceptDataSaved(action);
|
|
249
|
+
case core.Action.LOADING_DATA:
|
|
250
|
+
return await this.interceptLoadData(action);
|
|
251
|
+
default:
|
|
252
|
+
return action;
|
|
77
253
|
}
|
|
78
|
-
return action;
|
|
79
254
|
},
|
|
80
255
|
};
|
|
81
256
|
this._dataUnit = undefined;
|
|
@@ -86,8 +261,9 @@ const SnkCrud = class {
|
|
|
86
261
|
this._resourceID = undefined;
|
|
87
262
|
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${core.StringUtils.generateUUID()}`;
|
|
88
263
|
this.numberingConfig = undefined;
|
|
89
|
-
this.
|
|
90
|
-
this.
|
|
264
|
+
this._filterMode = 'regular';
|
|
265
|
+
this._enableContinuousInsert = false;
|
|
266
|
+
this._headerVisible = true;
|
|
91
267
|
this.enableLockManagerLoadingComp = false;
|
|
92
268
|
this.enableLockManagerTaskbarClick = false;
|
|
93
269
|
this.configName = undefined;
|
|
@@ -99,7 +275,7 @@ const SnkCrud = class {
|
|
|
99
275
|
this.recordsValidator = undefined;
|
|
100
276
|
this.statusResolver = undefined;
|
|
101
277
|
this.multipleSelection = true;
|
|
102
|
-
this.presentationMode = index
|
|
278
|
+
this.presentationMode = index.PresentationMode.PRIMARY;
|
|
103
279
|
this.messagesBuilder = undefined;
|
|
104
280
|
this.useEnterLikeTab = false;
|
|
105
281
|
this.gridLegacyConfigName = undefined;
|
|
@@ -112,7 +288,7 @@ const SnkCrud = class {
|
|
|
112
288
|
this.domainMessagesBuilder = undefined;
|
|
113
289
|
this.ignoreReadOnlyFormFields = undefined;
|
|
114
290
|
this.setCustomFormTitle = undefined;
|
|
115
|
-
this.strategyExporter = index
|
|
291
|
+
this.strategyExporter = index.ExporterStrategy.SERVER_SIDE;
|
|
116
292
|
this.layoutFormConfig = true;
|
|
117
293
|
this.multipleEditionEnabled = true;
|
|
118
294
|
this.paginationCounterMode = 'auto';
|
|
@@ -120,6 +296,9 @@ const SnkCrud = class {
|
|
|
120
296
|
this.showEntitySearch = true;
|
|
121
297
|
this.disableNumberingConfig = false;
|
|
122
298
|
}
|
|
299
|
+
handleActionClick(evt) {
|
|
300
|
+
this.executeAction(evt.detail);
|
|
301
|
+
}
|
|
123
302
|
/**
|
|
124
303
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
|
125
304
|
*/
|
|
@@ -217,6 +396,7 @@ const SnkCrud = class {
|
|
|
217
396
|
this.setViewMode(constants.VIEW_MODE.FORM);
|
|
218
397
|
}
|
|
219
398
|
async executeAction(act) {
|
|
399
|
+
var _a;
|
|
220
400
|
switch (act) {
|
|
221
401
|
case taskbarElements.TaskbarElement.GRID_MODE:
|
|
222
402
|
return this.setViewMode(constants.VIEW_MODE.GRID);
|
|
@@ -229,13 +409,13 @@ const SnkCrud = class {
|
|
|
229
409
|
case taskbarElements.TaskbarElement.CONFIGURATOR:
|
|
230
410
|
return this._snkConfigurator.open();
|
|
231
411
|
case taskbarElements.TaskbarElement.ATTACH:
|
|
232
|
-
return this.
|
|
412
|
+
return this._snkAttach.open();
|
|
413
|
+
case CustomTaskbarButton.FILTER:
|
|
414
|
+
return (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.showFilterModal();
|
|
415
|
+
case CustomTaskbarButton.ENTITY_SEARCH:
|
|
416
|
+
return this.openSearchPopover();
|
|
233
417
|
}
|
|
234
418
|
}
|
|
235
|
-
backView() {
|
|
236
|
-
const lastView = this._viewHistory.at(-2) || constants.VIEW_MODE.GRID;
|
|
237
|
-
this.setViewMode(lastView);
|
|
238
|
-
}
|
|
239
419
|
setViewMode(viewMode) {
|
|
240
420
|
this._viewStack.show(viewMode);
|
|
241
421
|
this._currentViewMode = viewMode;
|
|
@@ -297,6 +477,16 @@ const SnkCrud = class {
|
|
|
297
477
|
this._customEditors.delete(fieldName);
|
|
298
478
|
}
|
|
299
479
|
}
|
|
480
|
+
initializeTaskbarProcessor() {
|
|
481
|
+
const nativeTaskbarManager = buildNativeTaskbarManager(this._currentViewMode, this.taskbarManager, this.messagesBuilder);
|
|
482
|
+
const topTaskbarId = getTopTaskBarId(this._dataState, this.presentationMode);
|
|
483
|
+
this._taskbarProcessor.process(topTaskbarId, nativeTaskbarManager, this._dataState, undefined, []);
|
|
484
|
+
const headerTaskbarId = getHeaderTaskbarId(this._dataState, this.presentationMode);
|
|
485
|
+
this._taskbarCustomProcessor.process(headerTaskbarId, this.taskbarManager, this._dataState, undefined, []);
|
|
486
|
+
}
|
|
487
|
+
componentWillRender() {
|
|
488
|
+
this.initializeTaskbarProcessor();
|
|
489
|
+
}
|
|
300
490
|
componentDidRender() {
|
|
301
491
|
this.setCustomRenders();
|
|
302
492
|
this.setCustomEditors();
|
|
@@ -332,6 +522,7 @@ const SnkCrud = class {
|
|
|
332
522
|
if (!this.configName) {
|
|
333
523
|
this.configName = this._application.configName;
|
|
334
524
|
}
|
|
525
|
+
this.initContinuousInsertUtils();
|
|
335
526
|
}
|
|
336
527
|
componentDidLoad() {
|
|
337
528
|
this.initKeyboardManager();
|
|
@@ -413,49 +604,6 @@ const SnkCrud = class {
|
|
|
413
604
|
var _a;
|
|
414
605
|
(_a = this._keyboardManager) === null || _a === void 0 ? void 0 : _a.unbindAllShortcutKeys();
|
|
415
606
|
}
|
|
416
|
-
async handlePredictiveSearch(argument, entityName) {
|
|
417
|
-
var _a, _b;
|
|
418
|
-
const response = await this._application.executePreparedSearchWithFullResponse(argument, this.buildSearchOptions(entityName, 5));
|
|
419
|
-
this._showMoreOnSearch = (_a = response === null || response === void 0 ? void 0 : response.hasMore) !== null && _a !== void 0 ? _a : false;
|
|
420
|
-
this._entityPKField = response === null || response === void 0 ? void 0 : response.pkField;
|
|
421
|
-
return (_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : [];
|
|
422
|
-
}
|
|
423
|
-
async refreshDataUnitByPk(pks) {
|
|
424
|
-
try {
|
|
425
|
-
const pkField = pks[0].name;
|
|
426
|
-
const pkValue = pks[0].value;
|
|
427
|
-
// Criar filtro para a busca específica
|
|
428
|
-
const quickFilter = {
|
|
429
|
-
term: '',
|
|
430
|
-
filter: {
|
|
431
|
-
name: '',
|
|
432
|
-
params: [],
|
|
433
|
-
expression: `(${pkField} = ${pkValue})`
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
// Carregar dados com o filtro aplicado diretamente
|
|
437
|
-
await this._dataUnit.loadData(quickFilter);
|
|
438
|
-
// Navegar para o formulário se houver apenas um registro
|
|
439
|
-
if (this._dataUnit.records.length === 1) {
|
|
440
|
-
this._dataUnit.selectFirst();
|
|
441
|
-
this.gridToForm(true);
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
catch (error) {
|
|
445
|
-
console.error('Erro ao atualizar dataset:', error);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
buildSearchOptions(entityName, limit) {
|
|
449
|
-
return {
|
|
450
|
-
entity: entityName,
|
|
451
|
-
entityDescription: entityName,
|
|
452
|
-
executeOnOpen: true,
|
|
453
|
-
searchOptions: {
|
|
454
|
-
localEntityName: entityName,
|
|
455
|
-
limit,
|
|
456
|
-
}
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
607
|
async toggleView() {
|
|
460
608
|
const currentView = await this._viewStack.getSelectedIndex();
|
|
461
609
|
this.setViewMode(constants.VIEW_MODE.GRID === currentView ? constants.VIEW_MODE.FORM : constants.VIEW_MODE.GRID);
|
|
@@ -499,6 +647,17 @@ const SnkCrud = class {
|
|
|
499
647
|
this.updateNumberingConfigAfterInsert(action);
|
|
500
648
|
return action;
|
|
501
649
|
}
|
|
650
|
+
async interceptLoadData(action) {
|
|
651
|
+
var _a;
|
|
652
|
+
const hasInvalidFilters = !filterValidate.validateFilters((_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig);
|
|
653
|
+
if (hasInvalidFilters) {
|
|
654
|
+
const errorTitle = this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.title", {});
|
|
655
|
+
const errorMessage = this.messagesBuilder.getMessage("snkGrid.requiredFiltersNotFilled.message", {});
|
|
656
|
+
await this._application.error(errorTitle, errorMessage);
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
return action;
|
|
660
|
+
}
|
|
502
661
|
onDataUnitReady() {
|
|
503
662
|
var _a;
|
|
504
663
|
(_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.addInterceptor(this.dataUnitInterceptor);
|
|
@@ -518,6 +677,12 @@ const SnkCrud = class {
|
|
|
518
677
|
}
|
|
519
678
|
this.onDataUnitReady();
|
|
520
679
|
}
|
|
680
|
+
initContinuousInsertUtils() {
|
|
681
|
+
this._continuousInsertUtils = new ContinuousInsertUtils.ContinuousInsertUtils(this._application, this._resourceID, this.configName);
|
|
682
|
+
if (this.enableGridInsert) {
|
|
683
|
+
this._continuousInsertUtils.getConfig().then(value => this._enableContinuousInsert = value);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
521
686
|
async loadNumberingConfig() {
|
|
522
687
|
if (this.numberingConfig || !this._snkDataUnit || !this._snkDataUnit.entityName || this.disableNumberingConfig) {
|
|
523
688
|
return;
|
|
@@ -565,22 +730,97 @@ const SnkCrud = class {
|
|
|
565
730
|
renderCustomGuideSlots() {
|
|
566
731
|
if (!this.customGuidesConfig)
|
|
567
732
|
return;
|
|
568
|
-
return this.customGuidesConfig.map(g => index.h("slot", { name: g.id }));
|
|
733
|
+
return this.customGuidesConfig.map(g => index$1.h("slot", { name: g.id }));
|
|
569
734
|
}
|
|
570
|
-
|
|
735
|
+
getColumnSearch(item) {
|
|
736
|
+
if (this._columnSearch != undefined) {
|
|
737
|
+
return this._columnSearch;
|
|
738
|
+
}
|
|
739
|
+
this._columnSearch = utils.buildFieldSearch(item, ({ argument }) => new Promise(accept => {
|
|
740
|
+
this._snkGrid.filterColumns(argument).then((columns) => {
|
|
741
|
+
accept(columns
|
|
742
|
+
.filter(column => !column.hidden)
|
|
743
|
+
.map(column => ({ label: column.label, value: column.name })));
|
|
744
|
+
});
|
|
745
|
+
}), (option) => {
|
|
746
|
+
if (option != undefined) {
|
|
747
|
+
this._snkGrid.locateColumn(option.value);
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
return this._columnSearch;
|
|
751
|
+
}
|
|
752
|
+
buildTaskbarCustomActionsList() {
|
|
753
|
+
return [this.buildSearchColumnTaskbarAction()];
|
|
754
|
+
}
|
|
755
|
+
buildSearchColumnTaskbarAction() {
|
|
756
|
+
return {
|
|
757
|
+
value: core.StringUtils.generateUUID(),
|
|
758
|
+
label: this.messagesBuilder.getMessage('snkGrid.findColumn', {}),
|
|
759
|
+
disableCloseOnSelect: true,
|
|
760
|
+
eagerInitialize: true,
|
|
761
|
+
itemBuilder: (_, item) => this.getColumnSearch(item),
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
isGridInsertActive() {
|
|
765
|
+
return this.enableGridInsert && this._dataUnit.hasNewRecord();
|
|
766
|
+
}
|
|
767
|
+
getActionsList() {
|
|
768
|
+
const hardList = [];
|
|
769
|
+
if (this.enableGridInsert) {
|
|
770
|
+
hardList.push(this._continuousInsertUtils.actionContinuousInsert(this._enableContinuousInsert, () => {
|
|
771
|
+
this._enableContinuousInsert = !this._enableContinuousInsert;
|
|
772
|
+
this._continuousInsertUtils.handleSaveConfig(this._enableContinuousInsert);
|
|
773
|
+
}));
|
|
774
|
+
}
|
|
775
|
+
if (this.isGridInsertActive())
|
|
776
|
+
return hardList;
|
|
777
|
+
if (this.taskbarManager != undefined && this.taskbarManager.getMoreOptions != undefined) {
|
|
778
|
+
const taskbarID = getTopTaskBarId(this._dataState, this.presentationMode);
|
|
779
|
+
return hardList.concat(this.taskbarManager.getMoreOptions(taskbarID, this.configName, this._dataState, this.actionsList));
|
|
780
|
+
}
|
|
781
|
+
return hardList.concat(this.actionsList);
|
|
782
|
+
}
|
|
783
|
+
async openSearchPopover() {
|
|
784
|
+
if (!this._popoverSearchEntity) {
|
|
785
|
+
return;
|
|
786
|
+
}
|
|
787
|
+
const buttonElement = this._element.querySelector(`[data-taskbar-element="${CustomTaskbarButton.ENTITY_SEARCH}"]`);
|
|
788
|
+
await this._popoverSearchEntity.showUnder(buttonElement);
|
|
789
|
+
}
|
|
790
|
+
handleLoadedSearch(evt) {
|
|
791
|
+
if (evt.detail.length === 1) {
|
|
792
|
+
this._dataUnit.selectFirst();
|
|
793
|
+
this.gridToForm(true);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
renderDynamicSearch() {
|
|
571
797
|
var _a;
|
|
572
|
-
if (!this.showEntitySearch
|
|
798
|
+
if (!this.showEntitySearch)
|
|
799
|
+
return;
|
|
800
|
+
return (index$1.h("snk-entity-search", { ref: (ref) => this._popoverSearchEntity = ref, dataUnit: this._dataUnit, entityName: (_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.entityName, messagesBuilder: this.messagesBuilder, onLoaded: (evt) => this.handleLoadedSearch(evt) }));
|
|
801
|
+
}
|
|
802
|
+
handleFilterConfigUpdated(filterConfig) {
|
|
803
|
+
if (!filterConfig.length) {
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
806
|
+
if (filterConfig.length === 1 && filterConfig[0].id === 'PERSONALIZED_FILTER_GROUP') {
|
|
807
|
+
this._filterMode = filterConfig[0].groupedItems.length > 0 ? 'regular' : 'button';
|
|
573
808
|
return;
|
|
574
|
-
|
|
809
|
+
}
|
|
575
810
|
}
|
|
576
811
|
render() {
|
|
812
|
+
var _a;
|
|
577
813
|
if (this._resourceID == undefined) {
|
|
578
814
|
return;
|
|
579
815
|
}
|
|
580
816
|
this._snkDataUnit.ignoreSaveMessage = (this._currentViewMode === constants.VIEW_MODE.GRID && !this.enableGridInsert);
|
|
581
|
-
return (index.h(index.Host, null, index.h("
|
|
817
|
+
return (index$1.h(index$1.Host, null, index$1.h("header", { class: { 'snk-crud--hidden': !this._headerVisible } }, index$1.h("div", { class: "snk-crud__header-top" }, index$1.h("snk-taskbar", { "data-element-id": "grid_top", key: "snkGridTopTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, resourceID: this._resourceID, primaryButton: "INSERT", overflowStrategy: "hiddenItems", alignRigth: true, actionsList: this.getActionsList(), customActionsList: this.buildTaskbarCustomActionsList(), sizeButtons: 'medium' })), index$1.h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, title: this.filterBarTitle, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder, resourceID: this._resourceID, onConfigUpdated: evt => this.handleFilterConfigUpdated(evt.detail), disablePersonalizedFilter: this.disablePersonalizedFilter, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, mode: this._filterMode, hideFilterButton: true, sizeChips: 'default' }), index$1.h("div", { class: "snk-crud__header-bottom" }, index$1.h("ez-record-navigation", { dataUnit: this._dataUnit, primaryKeys: this._dataUnit.metadata.fields.filter(field => field.properties['isPrimaryKey']).map(field => field.name), textPosition: 'left', disabled: (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.isDirty, class: {
|
|
818
|
+
"snk-crud--hidden": this._currentViewMode === constants.VIEW_MODE.GRID
|
|
819
|
+
} }))), index$1.h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, index$1.h("ez-grid-pagination", { dataUnit: this._dataUnit, paginationCounterMode: this.paginationCounterMode, onPageChange: () => this._snkGrid.handlePageChange(), paginationTextPosition: "left", buttonsSize: "medium", class: {
|
|
820
|
+
"snk-crud--hidden": this._currentViewMode !== constants.VIEW_MODE.GRID
|
|
821
|
+
} }), index$1.h("stack-item", { class: 'snk-crud__grid-stack-item' }, index$1.h("snk-grid", { ref: (ref) => this._snkGrid = ref, class: 'ez-flex ez-flex--column ez-size-height--full ez-size-width--full', filterBarTitle: this.filterBarTitle, "data-element-id": "crud_grid", configName: this.configName, onGridDoubleClick: () => this.gridToForm(true), taskbarManager: this.taskbarManager, onActionClick: evt => this.executeAction(evt.detail), messagesBuilder: this.messagesBuilder, actionsList: this.actionsList, statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, presentationMode: this.presentationMode, recordsValidator: this.recordsValidator, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit, resourceID: this._resourceID, disablePersonalizedFilter: this.disablePersonalizedFilter, gridLegacyConfigName: this.gridLegacyConfigName, filterBarLegacyConfigName: this.filterBarLegacyConfigName, autoLoad: this.autoLoad, autoFocus: this.autoFocus, enableGridInsert: this.enableGridInsert, enableLockManagerTaskbarClick: this.enableLockManagerTaskbarClick, enableLockManagerLoadingComp: this.enableLockManagerLoadingComp, strategyExporter: this.strategyExporter, multipleEditionEnabled: this.multipleEditionEnabled, paginationCounterMode: this.paginationCounterMode, hideHeader: true, hideGridTaskbar: true }, index$1.h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "SnkGridHeader" }), index$1.h("slot", { name: "SnkGridFooter" }), index$1.h("slot", { name: "SnkGridTaskBar" }))), index$1.h("stack-item", null, index$1.h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, customGuidesConfig: this.customGuidesConfig, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(constants.VIEW_MODE.GRID), dataState: this._dataState, dataUnit: this._dataUnit, actionsList: this.actionsList, taskbarManager: this.taskbarManager, configName: this.configName, onActionClick: evt => this.executeAction(evt.detail), presentationMode: this.presentationMode, "data-element-id": "crud_form", canEdit: this._canEdit, recordsValidator: this.recordsValidator, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId, formLegacyConfigName: this.formLegacyConfigName, enableGridInsert: this.enableGridInsert, getCustomTitle: this.setCustomFormTitle, ignoreReadOnlyFormFields: this.ignoreReadOnlyFormFields, onFormConfigVisibilityChanged: evt => this._headerVisible = !evt.detail }, index$1.h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), this.renderCustomGuideSlots(), index$1.h("slot", { name: "SnkFormTaskBar" })))), index$1.h("snk-attach", { ref: (ref) => this._snkAttach = ref, registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName }), index$1.h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, entityName: this._snkDataUnit.entityName, viewMode: this._currentViewMode, messagesBuilder: this.messagesBuilder, onConfigSelected: (evt) => this.setViewMode(evt.detail), onOpenConfig: (evt) => this.openConfig(evt.detail), showActionButtons: this.showActionButtons, onSave: evt => this.handleConfiguratorEvent(evt, 'SAVE'), onCancel: evt => this.handleConfiguratorEvent(evt, 'CANCEL'), resourceID: this._resourceID, customContainerId: this.customContainerId, layoutFormConfig: this.layoutFormConfig }), this.renderDynamicSearch(), index$1.h("div", { id: `${this.customContainerId}` }, index$1.h("slot", { name: "SnkConfigContainerSlot" }), index$1.h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), index$1.h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
582
822
|
}
|
|
583
|
-
get _element() { return index.getElement(this); }
|
|
823
|
+
get _element() { return index$1.getElement(this); }
|
|
584
824
|
static get watchers() { return {
|
|
585
825
|
"_currentViewMode": ["currentViewModeWatcher"]
|
|
586
826
|
}; }
|
|
@@ -8,16 +8,16 @@ const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
|
8
8
|
const IFetchDataExporterParams = require('./IFetchDataExporterParams-e78ec415.js');
|
|
9
9
|
const index = require('./index-e3e39724.js');
|
|
10
10
|
const constants = require('./constants-6d82e405.js');
|
|
11
|
-
const DataFetcher = require('./DataFetcher-
|
|
12
|
-
const snkDataUnit = require('./snk-data-unit-
|
|
13
|
-
require('./ISave-
|
|
11
|
+
const DataFetcher = require('./DataFetcher-384d2ce8.js');
|
|
12
|
+
const snkDataUnit = require('./snk-data-unit-6abc5efc.js');
|
|
13
|
+
require('./ISave-ecbe9336.js');
|
|
14
14
|
require('@sankhyalabs/ezui/dist/collection/utils/constants');
|
|
15
15
|
require('@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata');
|
|
16
|
-
require('./dataunit-fetcher-
|
|
16
|
+
require('./dataunit-fetcher-93f53260.js');
|
|
17
17
|
require('./filter-item-type.enum-a7ffdaa6.js');
|
|
18
|
-
require('./form-config-fetcher-
|
|
18
|
+
require('./form-config-fetcher-45d1964c.js');
|
|
19
19
|
require('./PrintUtils-bcaeb82f.js');
|
|
20
|
-
require('./SnkMessageBuilder-
|
|
20
|
+
require('./SnkMessageBuilder-a9300ebe.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');
|
|
@@ -466,6 +466,7 @@ const SnkDataExporter = class {
|
|
|
466
466
|
this._showDropdown = false;
|
|
467
467
|
this.provider = null;
|
|
468
468
|
this.messagesBuilder = undefined;
|
|
469
|
+
this.size = 'medium';
|
|
469
470
|
}
|
|
470
471
|
async exportByEmail() {
|
|
471
472
|
const selectedRows = this._selectedNumber;
|
|
@@ -751,7 +752,7 @@ const SnkDataExporter = class {
|
|
|
751
752
|
render() {
|
|
752
753
|
return (index$1.h(index$1.Host, null, index$1.h("div", { class: `snk-data-exporter
|
|
753
754
|
${this.canShowDropdown() ? " ez-elevation--16" : ""}
|
|
754
|
-
` }, index$1.h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download",
|
|
755
|
+
` }, index$1.h("ez-tooltip", { message: this.getMessage("snkDataExporter.group.export.title") }, index$1.h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", mode: "icon", onClick: () => this.controlDropdown(), size: this.size }, this.getElementID("button")))), index$1.h("div", Object.assign({ ref: (ref) => this._dropdownParent = ref, class: `snk-data-exporter__dropdown
|
|
755
756
|
${this.canShowDropdown() ? "snk-data-exporter__dropdown--show" : ""}
|
|
756
757
|
` }, this.getElementID("dropdown")), this.canShowDropdown() &&
|
|
757
758
|
index$1.h("ez-dropdown", Object.assign({ items: this._items, onEzClick: (evt) => this.processExporter(evt) }, this.getElementID("dropdown"))))), this.canShowDropdown() &&
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const index = require('./index-1894343a.js');
|
|
4
4
|
const core = require('@sankhyalabs/core');
|
|
5
5
|
const utils = require('@sankhyalabs/ezui/dist/collection/utils');
|
|
6
|
-
const SnkMessageBuilder = require('./SnkMessageBuilder-
|
|
7
|
-
const dataunitFetcher = require('./dataunit-fetcher-
|
|
6
|
+
const SnkMessageBuilder = require('./SnkMessageBuilder-a9300ebe.js');
|
|
7
|
+
const dataunitFetcher = require('./dataunit-fetcher-93f53260.js');
|
|
8
8
|
const DataType = require('@sankhyalabs/core/dist/dataunit/metadata/DataType');
|
|
9
9
|
const GetSelectedRecordsIDsInfo = require('./GetSelectedRecordsIDsInfo-bd50caf1.js');
|
|
10
10
|
|