@sankhyalabs/sankhyablocks 8.15.0-rc.9 → 8.15.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-d4c99a5e.js → ConfigStorage-942ce74b.js} +70 -7
- package/dist/cjs/{DataFetcher-99f0f6ed.js → DataFetcher-313debd8.js} +13 -5
- package/dist/cjs/{SnkFormConfigManager-3621bfc4.js → SnkFormConfigManager-f9dc0d28.js} +21 -13
- package/dist/cjs/{SnkMessageBuilder-141aa18d.js → SnkMessageBuilder-66aa2557.js} +4 -0
- package/dist/cjs/SnkMultiSelectionListDataSource-303e85d1.js +140 -0
- package/dist/cjs/{auth-fetcher-5161d082.js → auth-fetcher-54f5ff9d.js} +1 -1
- package/dist/cjs/{form-config-fetcher-9f1a13ca.js → form-config-fetcher-2dd00e5b.js} +13 -1
- package/dist/cjs/index-f9e81701.js +2 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8bbee432.js → pesquisa-fetcher-213797ec.js} +273 -50
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/{snk-actions-button_2.cjs.entry.js → snk-actions-button_4.cjs.entry.js} +519 -4
- package/dist/cjs/snk-application.cjs.entry.js +19 -11
- package/dist/cjs/snk-attach.cjs.entry.js +66 -46
- package/dist/cjs/snk-configurator.cjs.entry.js +1 -1
- package/dist/cjs/snk-crud.cjs.entry.js +25 -17
- package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +6 -2
- package/dist/cjs/snk-data-exporter.cjs.entry.js +5 -5
- package/dist/cjs/{snk-data-unit-6026a9f7.js → snk-data-unit-41c29713.js} +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +2 -2
- package/dist/cjs/snk-detail-view.cjs.entry.js +8 -9
- package/dist/cjs/snk-filter-bar.cjs.entry.js +31 -7
- package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -1
- package/dist/cjs/snk-filter-item.cjs.entry.js +10 -6
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +3 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +8 -2
- package/dist/cjs/snk-form.cjs.entry.js +11 -4
- package/dist/cjs/snk-grid.cjs.entry.js +40 -21
- package/dist/cjs/{snk-guides-viewer-e87f01b9.js → snk-guides-viewer-4b6ecda8.js} +20 -11
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +6 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +3 -3
- package/dist/cjs/snk-simple-crud.cjs.entry.js +255 -21
- package/dist/cjs/snk-taskbar.cjs.entry.js +69 -8
- package/dist/collection/collection-manifest.json +6 -6
- package/dist/collection/components/snk-application/snk-application.js +55 -6
- package/dist/collection/components/snk-attach/snk-attach.js +39 -24
- package/dist/collection/components/snk-attach/structure/builder/attach-crud-config.builder.js +1 -1
- package/dist/collection/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.js +29 -22
- package/dist/collection/components/snk-configurator/snk-configurator.js +1 -1
- package/dist/collection/components/snk-crud/snk-crud.js +71 -11
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +2 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +50 -7
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.css +1 -1
- package/dist/collection/components/snk-custom-slot-elements/snk-custom-slot-elements.js +22 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +2 -2
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +22 -1
- package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -6
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +2 -1
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +44 -3
- package/dist/collection/components/snk-form/snk-form.js +25 -1
- package/dist/collection/components/{snk-form → snk-form-config}/SnkFormConfigManager.js +20 -12
- package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.js +11 -5
- package/dist/collection/components/snk-grid/snk-grid.js +86 -16
- package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.js +130 -123
- package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.js +1 -1
- package/dist/collection/components/snk-simple-crud/regular-buttons.js +3 -0
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.css +10 -2
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +421 -17
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +86 -8
- package/dist/collection/lib/configs/ConfigStorage.js +63 -3
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +9 -40
- package/dist/collection/lib/dataUnit/dataUnitInMemoryUtils.js +33 -0
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +13 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +12 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.js +6 -3
- package/dist/collection/lib/message/SnkMessageBuilder.js +20 -20
- package/dist/collection/lib/message/resources/snk-simple-crud.msg.js +4 -0
- package/dist/collection/lib/utils/CrudUtils.js +13 -1
- package/dist/components/ConfigStorage.js +68 -5
- package/dist/components/DataFetcher.js +13 -5
- package/dist/components/SnkFormConfigManager.js +19 -11
- package/dist/components/SnkMessageBuilder.js +4 -0
- package/dist/components/dataunit-fetcher.js +41 -39
- package/dist/components/field-search.js +93 -3
- package/dist/components/form-config-fetcher.js +12 -0
- package/dist/components/index.d.ts +6 -6
- package/dist/components/snk-application2.js +15 -4
- package/dist/components/snk-attach2.js +115 -52
- package/dist/components/snk-configurator2.js +1 -1
- package/dist/components/snk-crud.js +23 -11
- package/dist/components/snk-custom-slot-elements.js +7 -3
- package/dist/components/snk-data-exporter2.js +2 -2
- package/dist/components/snk-detail-view2.js +48 -11
- package/dist/components/snk-filter-bar2.js +29 -4
- package/dist/components/snk-filter-detail2.js +5 -1
- package/dist/components/snk-filter-item2.js +11 -6
- package/dist/components/snk-form-config2.js +7 -1
- package/dist/components/snk-form.js +8 -0
- package/dist/components/snk-grid-config2.js +128 -102
- package/dist/components/snk-grid2.js +42 -18
- package/dist/components/snk-simple-crud2.js +317 -29
- package/dist/components/snk-taskbar2.js +75 -11
- package/dist/esm/{ConfigStorage-39ed8aeb.js → ConfigStorage-86187da3.js} +70 -7
- package/dist/esm/{DataFetcher-a650ae58.js → DataFetcher-c1baf61d.js} +13 -5
- package/dist/esm/{SnkFormConfigManager-692e20c7.js → SnkFormConfigManager-f53f9f87.js} +21 -13
- package/dist/esm/{SnkMessageBuilder-9747ddd2.js → SnkMessageBuilder-0a4becdd.js} +4 -0
- package/dist/esm/SnkMultiSelectionListDataSource-36918dbf.js +133 -0
- package/dist/esm/{auth-fetcher-17dc5b5e.js → auth-fetcher-039abba3.js} +1 -1
- package/dist/esm/{form-config-fetcher-f121f880.js → form-config-fetcher-30fb808f.js} +13 -1
- package/dist/esm/index-a7d3d3f1.js +2 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-5a8cae10.js → pesquisa-fetcher-fe6f3826.js} +262 -43
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/{snk-actions-button_2.entry.js → snk-actions-button_4.entry.js} +518 -5
- package/dist/esm/snk-application.entry.js +19 -11
- package/dist/esm/snk-attach.entry.js +65 -45
- package/dist/esm/snk-configurator.entry.js +1 -1
- package/dist/esm/snk-crud.entry.js +25 -17
- package/dist/esm/snk-custom-slot-elements.entry.js +7 -3
- package/dist/esm/snk-data-exporter.entry.js +5 -5
- package/dist/esm/{snk-data-unit-4c343635.js → snk-data-unit-de1d140d.js} +1 -1
- package/dist/esm/snk-data-unit.entry.js +2 -2
- package/dist/esm/snk-detail-view.entry.js +8 -9
- package/dist/esm/snk-filter-bar.entry.js +31 -7
- package/dist/esm/snk-filter-detail.entry.js +4 -1
- package/dist/esm/snk-filter-item.entry.js +10 -6
- package/dist/esm/snk-filter-modal-item.entry.js +3 -3
- package/dist/esm/snk-form-config.entry.js +9 -3
- package/dist/esm/snk-form.entry.js +11 -4
- package/dist/esm/snk-grid.entry.js +41 -22
- package/dist/esm/{snk-guides-viewer-ba8ce538.js → snk-guides-viewer-113be3fd.js} +20 -11
- package/dist/esm/snk-guides-viewer.entry.js +6 -7
- package/dist/esm/snk-personalized-filter.entry.js +3 -3
- package/dist/esm/snk-simple-crud.entry.js +256 -22
- package/dist/esm/snk-taskbar.entry.js +70 -9
- package/dist/sankhyablocks/p-032fe52e.js +1 -0
- package/dist/sankhyablocks/p-07a61550.entry.js +1 -0
- package/dist/sankhyablocks/p-0899e0b5.entry.js +1 -0
- package/dist/sankhyablocks/p-14a08904.entry.js +1 -0
- package/dist/sankhyablocks/p-154a7f33.entry.js +1 -0
- package/dist/sankhyablocks/p-15802c59.entry.js +1 -0
- package/dist/sankhyablocks/p-164666b1.js +65 -0
- package/dist/sankhyablocks/p-21a81901.entry.js +1 -0
- package/dist/sankhyablocks/p-32556aa6.js +1 -0
- package/dist/sankhyablocks/p-328585d0.entry.js +1 -0
- package/dist/sankhyablocks/{p-9a5d1b39.js → p-52c8e589.js} +1 -1
- package/dist/sankhyablocks/p-54a5d52a.entry.js +1 -0
- package/dist/sankhyablocks/p-5cb07080.js +1 -0
- package/dist/sankhyablocks/p-74d349c3.entry.js +1 -0
- package/dist/sankhyablocks/p-7663f597.entry.js +1 -0
- package/dist/sankhyablocks/p-7fe120b8.entry.js +11 -0
- package/dist/sankhyablocks/{p-50783a8b.js → p-913a9979.js} +1 -1
- package/dist/sankhyablocks/{p-827e4b01.entry.js → p-a1d72395.entry.js} +1 -1
- package/dist/sankhyablocks/p-add17f6a.entry.js +1 -0
- package/dist/sankhyablocks/p-af1ac81f.entry.js +1 -0
- package/dist/sankhyablocks/p-aff76a53.js +56 -0
- package/dist/sankhyablocks/p-b4525fc0.entry.js +1 -0
- package/dist/sankhyablocks/p-cce0865d.js +1 -0
- package/dist/sankhyablocks/{p-be75153c.js → p-dc7c9047.js} +1 -1
- package/dist/sankhyablocks/p-dec65f6c.entry.js +1 -0
- package/dist/sankhyablocks/p-df5451c7.js +26 -0
- package/dist/sankhyablocks/p-e8763234.entry.js +1 -0
- package/dist/sankhyablocks/{p-9d608b62.entry.js → p-eae7a817.entry.js} +1 -1
- package/dist/sankhyablocks/{p-20b46647.entry.js → p-ee9536bc.entry.js} +1 -1
- package/dist/sankhyablocks/p-f13f7616.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +9 -1
- package/dist/types/components/snk-attach/snk-attach.d.ts +2 -1
- package/dist/types/components/snk-attach/structure/builder/attach-crud-config.builder.d.ts +10 -1
- package/dist/types/components/snk-attach/structure/fetcher/factory/attach-fetcher-data-unit.factory.d.ts +5 -4
- package/dist/types/components/snk-crud/snk-crud.d.ts +12 -0
- 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-guides-viewer.d.ts +11 -1
- package/dist/types/components/snk-custom-slot-elements/snk-custom-slot-elements.d.ts +6 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +4 -0
- package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +6 -2
- package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +8 -0
- package/dist/types/components/snk-form/snk-form.d.ts +6 -1
- package/dist/types/components/{snk-form → snk-form-config}/SnkFormConfigManager.d.ts +2 -1
- package/dist/types/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.d.ts +4 -3
- package/dist/types/components/snk-grid/snk-grid.d.ts +14 -1
- package/dist/types/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.d.ts +11 -6
- package/dist/types/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.d.ts +1 -1
- package/dist/types/components/snk-simple-crud/regular-buttons.d.ts +3 -0
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +76 -3
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +11 -0
- package/dist/types/components.d.ts +172 -11
- package/dist/types/lib/configs/ConfigStorage.d.ts +21 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -2
- package/dist/types/lib/dataUnit/dataUnitInMemoryUtils.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +2 -0
- package/dist/types/lib/http/data-fetcher/fetchers/personalized-filter-fetcher.d.ts +2 -1
- package/dist/types/lib/utils/CrudUtils.d.ts +3 -0
- package/package.json +1 -1
- package/dist/cjs/PreloadManager-84466da6.js +0 -224
- package/dist/cjs/SnkMultiSelectionListDataSource-ba5838c2.js +0 -49
- package/dist/cjs/snk-grid-config.cjs.entry.js +0 -483
- package/dist/cjs/snk-select-box.cjs.entry.js +0 -25
- package/dist/esm/PreloadManager-c1c2f2b4.js +0 -222
- package/dist/esm/SnkMultiSelectionListDataSource-44494b0e.js +0 -43
- package/dist/esm/snk-grid-config.entry.js +0 -479
- package/dist/esm/snk-select-box.entry.js +0 -21
- package/dist/sankhyablocks/p-094c30cb.js +0 -1
- package/dist/sankhyablocks/p-1c55becf.entry.js +0 -1
- package/dist/sankhyablocks/p-230f5148.entry.js +0 -1
- package/dist/sankhyablocks/p-2936303b.js +0 -1
- package/dist/sankhyablocks/p-2e4eb644.entry.js +0 -1
- package/dist/sankhyablocks/p-3e2e2424.entry.js +0 -1
- package/dist/sankhyablocks/p-3e91d5ea.entry.js +0 -1
- package/dist/sankhyablocks/p-43de1258.entry.js +0 -1
- package/dist/sankhyablocks/p-4ce6cb02.entry.js +0 -11
- package/dist/sankhyablocks/p-5e681b7b.js +0 -65
- package/dist/sankhyablocks/p-5f74c859.entry.js +0 -1
- package/dist/sankhyablocks/p-67aedbe0.js +0 -56
- package/dist/sankhyablocks/p-69754d94.entry.js +0 -1
- package/dist/sankhyablocks/p-725d04ba.js +0 -1
- package/dist/sankhyablocks/p-86801b08.entry.js +0 -1
- package/dist/sankhyablocks/p-8a3a2631.entry.js +0 -1
- package/dist/sankhyablocks/p-965b79a9.js +0 -1
- package/dist/sankhyablocks/p-98674137.entry.js +0 -1
- package/dist/sankhyablocks/p-a13ccb86.js +0 -26
- package/dist/sankhyablocks/p-aba0e87f.entry.js +0 -1
- package/dist/sankhyablocks/p-c22c1d8e.js +0 -1
- package/dist/sankhyablocks/p-d26e0a02.entry.js +0 -1
- package/dist/sankhyablocks/p-d6317851.entry.js +0 -1
- package/dist/sankhyablocks/p-d7d85fa9.entry.js +0 -1
- package/dist/sankhyablocks/p-e3bd000e.entry.js +0 -1
- package/dist/sankhyablocks/p-e7dbe53a.entry.js +0 -1
- package/dist/sankhyablocks/p-fcdcb0e2.entry.js +0 -1
- /package/dist/collection/components/{snk-form/subcomponents/snk-form-config → snk-form-config}/snk-form-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.js +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.css +0 -0
- /package/dist/collection/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.js +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents/snk-grid-config → snk-grid-config}/snk-grid-config.css +0 -0
- /package/dist/collection/components/{snk-grid/subcomponents → snk-grid-config}/snk-select-box/snk-select-box.css +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-config-options/snk-config-options.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-field-config/snk-field-config.d.ts +0 -0
- /package/dist/types/components/{snk-form → snk-form-config}/subcomponents/snk-tab-config/snk-tab-config.d.ts +0 -0
@@ -3,8 +3,11 @@ export class SnkCustomSlotElements {
|
|
3
3
|
constructor() {
|
4
4
|
this.slotName = 'CUSTOM_SLOT_ELEMENTS';
|
5
5
|
}
|
6
|
+
componentDidLoad() {
|
7
|
+
this.snkCustomSlotElementsLoaded.emit(this.slotName);
|
8
|
+
}
|
6
9
|
render() {
|
7
|
-
return (h(Host, { slot: this.slotName
|
10
|
+
return (h(Host, { slot: this.slotName, id: this.slotName, class: "custom-slot-elements-container" }, h("slot", null)));
|
8
11
|
}
|
9
12
|
static get is() { return "snk-custom-slot-elements"; }
|
10
13
|
static get encapsulation() { return "scoped"; }
|
@@ -40,4 +43,22 @@ export class SnkCustomSlotElements {
|
|
40
43
|
}
|
41
44
|
};
|
42
45
|
}
|
46
|
+
static get events() {
|
47
|
+
return [{
|
48
|
+
"method": "snkCustomSlotElementsLoaded",
|
49
|
+
"name": "snkCustomSlotElementsLoaded",
|
50
|
+
"bubbles": true,
|
51
|
+
"cancelable": true,
|
52
|
+
"composed": true,
|
53
|
+
"docs": {
|
54
|
+
"tags": [],
|
55
|
+
"text": "Emitido quando elemento \u00E9 carregado na tela."
|
56
|
+
},
|
57
|
+
"complexType": {
|
58
|
+
"original": "string",
|
59
|
+
"resolved": "string",
|
60
|
+
"references": {}
|
61
|
+
}
|
62
|
+
}];
|
63
|
+
}
|
43
64
|
}
|
@@ -236,14 +236,14 @@ export class SnkDataExporter {
|
|
236
236
|
const pkObject = [];
|
237
237
|
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
238
238
|
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
239
|
-
const fields =
|
239
|
+
const fields = {};
|
240
240
|
fields['fields'] = [];
|
241
241
|
// Se for o primeiro elemento, adiciona essa primeira PK
|
242
242
|
if (index === 0) {
|
243
243
|
pkObject[`PK_${name}`] = { type: this.parseDataType(type), value };
|
244
244
|
pkObject['pks'] = [];
|
245
245
|
}
|
246
|
-
const dataFields = { nome: name
|
246
|
+
const dataFields = { nome: `PK_${name}`, tipo: this.parseDataType(type), valor: value };
|
247
247
|
fields['fields'].push(dataFields);
|
248
248
|
pkObject['pks'].push(fields);
|
249
249
|
});
|
@@ -8,6 +8,7 @@ export class SnkFilterDetail {
|
|
8
8
|
constructor() {
|
9
9
|
this.config = undefined;
|
10
10
|
this.getMessage = undefined;
|
11
|
+
this.showHardFixed = true;
|
11
12
|
}
|
12
13
|
/**
|
13
14
|
* Exibe o componente snk-filter-detail.
|
@@ -85,7 +86,9 @@ export class SnkFilterDetail {
|
|
85
86
|
return Object.assign(Object.assign({}, item), { visible: false, fixed: false, value: undefined });
|
86
87
|
}
|
87
88
|
getPopUpHeaderButtons() {
|
88
|
-
return (h(Fragment, null, !this.config.removalBlocked &&
|
89
|
+
return (h(Fragment, null, !this.config.removalBlocked &&
|
90
|
+
this.buildIcon(this.getMessage("snkFilterBar.removeFilter"), "delete", () => this.removeItem()), this.showHardFixed && !this.config.hardFixed &&
|
91
|
+
this.buildIcon(this.getMessage(this.config.fixed ? "snkFilterBar.unpinFilter" : "snkFilterBar.pinFilter"), this.config.fixed ? "un-pin" : "push-pin", () => this.changeConfig(Object.assign(Object.assign({}, this.config), { fixed: !this.config.fixed })))));
|
89
92
|
}
|
90
93
|
buildIcon(title, iconName, action) {
|
91
94
|
return (h("button", { onClick: () => action(), class: "sc-snk-filter-bar snk-filter-item__editor-header-button", ref: elem => elem && this.buildIdButton(elem, title) }, h("ez-icon", Object.assign({ title: title, iconName: iconName }, { [ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: `${ElementIDUtils.getInternalIDInfo(`_${title}`)}` }))));
|
@@ -196,6 +199,24 @@ export class SnkFilterDetail {
|
|
196
199
|
"tags": [],
|
197
200
|
"text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
|
198
201
|
}
|
202
|
+
},
|
203
|
+
"showHardFixed": {
|
204
|
+
"type": "boolean",
|
205
|
+
"mutable": false,
|
206
|
+
"complexType": {
|
207
|
+
"original": "boolean",
|
208
|
+
"resolved": "boolean",
|
209
|
+
"references": {}
|
210
|
+
},
|
211
|
+
"required": false,
|
212
|
+
"optional": false,
|
213
|
+
"docs": {
|
214
|
+
"tags": [],
|
215
|
+
"text": "Controla a visibilidade do bot\u00E3o de fixar elemento"
|
216
|
+
},
|
217
|
+
"attribute": "show-hard-fixed",
|
218
|
+
"reflect": false,
|
219
|
+
"defaultValue": "true"
|
199
220
|
}
|
200
221
|
};
|
201
222
|
}
|
@@ -14,6 +14,7 @@ export class SnkFilterItem {
|
|
14
14
|
this.detailIsVisible = undefined;
|
15
15
|
this.config = undefined;
|
16
16
|
this.getMessage = undefined;
|
17
|
+
this.showChips = true;
|
17
18
|
}
|
18
19
|
observeDetailIsVisible(value) {
|
19
20
|
this.visibleChanged.emit(value);
|
@@ -45,19 +46,22 @@ export class SnkFilterItem {
|
|
45
46
|
autoClose: true,
|
46
47
|
innerClickTest: this.innerClickCheck,
|
47
48
|
backClickListener: () => this.onDetailCloseCallback(),
|
48
|
-
left: this.
|
49
|
-
top: this.
|
49
|
+
left: this.getOffsetLeft(),
|
50
|
+
top: this.getOffsetTop(),
|
50
51
|
useOverlay: true,
|
51
52
|
overlayClassName: 'ez-scrim ez-scrim--light',
|
52
53
|
isFixed: true
|
53
54
|
};
|
54
55
|
}
|
55
|
-
|
56
|
+
getOffsetLeft() {
|
56
57
|
const padding = getComputedStyle(this._filterItemElement).getPropertyValue("padding-left");
|
57
58
|
const rect = this._filterItemElement.getBoundingClientRect();
|
58
|
-
|
59
|
+
// Width baseado no conteudo do snk-filter-detail. Nesse momento ele retorna 0px pois ainda não foi criado em tela.
|
60
|
+
const filterDetailWidth = 430;
|
61
|
+
const adjustRightPosition = filterDetailWidth - (document.body.clientWidth - rect.left);
|
62
|
+
return `calc(${rect.x}px + ${padding} - ${adjustRightPosition > 0 ? adjustRightPosition : 0}px)`;
|
59
63
|
}
|
60
|
-
|
64
|
+
getOffsetTop() {
|
61
65
|
const rect = this._filterItemElement.getBoundingClientRect();
|
62
66
|
return (rect.y + rect.height) + "px";
|
63
67
|
}
|
@@ -289,7 +293,7 @@ export class SnkFilterItem {
|
|
289
293
|
}
|
290
294
|
render() {
|
291
295
|
const leftIcon = this.getLeftIconName();
|
292
|
-
return (h(Host, null, h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon
|
296
|
+
return (h(Host, null, this.showChips && (h("ez-chip", { id: this.config.id, ref: ref => this._chipElement = ref, label: this.getLabel(), value: this.getEnabledChip() }, leftIcon && (h("ez-icon", { ref: ref => this._leftIconElement = ref, iconName: leftIcon, class: "ez-padding-right--small", slot: "leftIcon" })), h("ez-icon", { ref: ref => this._rightIconElement = ref, iconName: this.getRightIconName(), class: "ez-padding-left--small", slot: "rightIcon", id: "removeFilter" }))), h("section", { class: "ez-margin-top--small sc-snk-filter-bar snk-filter__popover-container", ref: elem => this._popoverContainer = elem }, h("snk-filter-detail", { config: this.config, getMessage: this.getMessage, class: "sc-snk-filter-bar snk-filter__popover ez-padding--small ez-elevation--16", ref: elem => this._popover = elem, key: this.config.id, "data-element-id": this._idSnkFilterDetail, showHardFixed: this.showChips }))));
|
293
297
|
}
|
294
298
|
static get is() { return "snk-filter-item"; }
|
295
299
|
static get properties() {
|
@@ -327,6 +331,24 @@ export class SnkFilterItem {
|
|
327
331
|
"tags": [],
|
328
332
|
"text": "Usado pra flexibilizar os verbetes e mensagens de acordo com o SnkMessageBuilder."
|
329
333
|
}
|
334
|
+
},
|
335
|
+
"showChips": {
|
336
|
+
"type": "boolean",
|
337
|
+
"mutable": false,
|
338
|
+
"complexType": {
|
339
|
+
"original": "boolean",
|
340
|
+
"resolved": "boolean",
|
341
|
+
"references": {}
|
342
|
+
},
|
343
|
+
"required": false,
|
344
|
+
"optional": false,
|
345
|
+
"docs": {
|
346
|
+
"tags": [],
|
347
|
+
"text": "Usado para controlar a visibilidade dos chips de filtros"
|
348
|
+
},
|
349
|
+
"attribute": "show-chips",
|
350
|
+
"reflect": false,
|
351
|
+
"defaultValue": "true"
|
330
352
|
}
|
331
353
|
};
|
332
354
|
}
|
@@ -35,12 +35,18 @@ export class SnkFilterBar {
|
|
35
35
|
this.filterConfig = undefined;
|
36
36
|
this.messagesBuilder = undefined;
|
37
37
|
this.disablePersonalizedFilter = undefined;
|
38
|
+
this.filterBarLegacyConfigName = undefined;
|
38
39
|
this.allowDefault = undefined;
|
39
40
|
this.scrollerLocked = false;
|
40
41
|
this.showPersonalizedFilter = false;
|
41
42
|
this.personalizedFilterId = undefined;
|
42
43
|
}
|
43
44
|
observeFilterConfig(newValue, oldValue) {
|
45
|
+
if (ObjectUtils.equals(newValue, oldValue))
|
46
|
+
return;
|
47
|
+
this.handleFilterConfigsChanged(oldValue, newValue);
|
48
|
+
}
|
49
|
+
handleFilterConfigsChanged(oldValue, newValue) {
|
44
50
|
if (oldValue != undefined && newValue == undefined) {
|
45
51
|
this._loadingPending = true;
|
46
52
|
this._configUpdated = true;
|
@@ -244,6 +250,17 @@ export class SnkFilterBar {
|
|
244
250
|
filterActiveFilter(item) {
|
245
251
|
return item.visible || item.removalBlocked;
|
246
252
|
}
|
253
|
+
filterPersonalizedItems(item) {
|
254
|
+
return item.type === FilterItemType.PERSONALIZED;
|
255
|
+
}
|
256
|
+
getPersonalizedFilterVariableItems() {
|
257
|
+
return this.filterConfig
|
258
|
+
.filter(this.filterPersonalizedItems)
|
259
|
+
.map(item => {
|
260
|
+
const itemId = `filter-${item.id}`;
|
261
|
+
return (h("snk-filter-item", { key: item.id, id: itemId, config: Object.assign({}, item), onFocusin: () => this.itemFocused(itemId), onVisibleChanged: (evt) => this.scrollerLocked = evt.detail, onFilterChange: (event) => this.updateFilter(event.detail), getMessage: (key, props) => this.getMessage(key, props), showChips: false }));
|
262
|
+
});
|
263
|
+
}
|
247
264
|
getFilterItems() {
|
248
265
|
const pinnedItems = [];
|
249
266
|
const unpinnedItems = [];
|
@@ -303,6 +320,11 @@ export class SnkFilterBar {
|
|
303
320
|
loadPermitions() {
|
304
321
|
this._application.isUserSup().then(value => this.allowDefault = value);
|
305
322
|
}
|
323
|
+
addFilterBarLegacyConfigName() {
|
324
|
+
if (this.filterBarLegacyConfigName && this.configName) {
|
325
|
+
ConfigStorage.addFilterBarLegacyConfig(this.configName, this.filterBarLegacyConfigName);
|
326
|
+
}
|
327
|
+
}
|
306
328
|
async loadConfigFromStorage(clearCache) {
|
307
329
|
if (clearCache) {
|
308
330
|
await ConfigStorage.deleteFilterBarConfigCache(this.configName, this.resourceID);
|
@@ -409,6 +431,7 @@ export class SnkFilterBar {
|
|
409
431
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
410
432
|
if (this._application) {
|
411
433
|
this.loadPermitions();
|
434
|
+
this.addFilterBarLegacyConfigName();
|
412
435
|
this.loadConfigFromStorage();
|
413
436
|
}
|
414
437
|
this.attachDataUnit();
|
@@ -423,9 +446,10 @@ export class SnkFilterBar {
|
|
423
446
|
if (this.showPersonalizedFilter) {
|
424
447
|
return h("snk-personalized-filter", { class: "filter-bar__personalized-filter", filterId: this.personalizedFilterId, ref: (el) => this._elPersonalizedFilter = el, onEzCancel: () => this.handleHidePersonalizedFilter(false), onEzAfterSave: () => this.handleHidePersonalizedFilter(true), entityUri: this.dataUnit.name, configName: this.configName, resourceID: this.resourceID });
|
425
448
|
}
|
426
|
-
if (this.mode
|
427
|
-
return (h(Host, { "data-mode": this.mode }, h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) })));
|
428
|
-
|
449
|
+
if (this.mode !== "regular") {
|
450
|
+
return (h(Host, { "data-mode": this.mode }, this.getPersonalizedFilterVariableItems(), this.mode === 'button' && (h("ez-button", { class: "ez-margin-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }))));
|
451
|
+
}
|
452
|
+
return (h(Host, null, h("div", null, h("span", { class: "snk-filter-bar__title", title: this.title, "data-tooltip": this.title, "data-flow": "bottom" }, this.title)), h("ez-scroller", { class: "snk-filter-bar__scroller", direction: EzScrollDirection.HORIZONTAL, activeShadow: true, locked: this.scrollerLocked }, h("section", { class: "snk-filter-bar__filter-item-container" }, this.getFilterItems())), h("ez-button", { class: "ez-padding-left--medium", size: "small", label: this.getMessage('snkFilterBar.filters', undefined, 'Filtros'), onClick: this.showFilterModal.bind(this) }, h("ez-icon", { slot: "leftIcon", iconName: "plus", class: "ez-padding-right--small" }))));
|
429
453
|
}
|
430
454
|
static get is() { return "snk-filter-bar"; }
|
431
455
|
static get encapsulation() { return "scoped"; }
|
@@ -589,6 +613,23 @@ export class SnkFilterBar {
|
|
589
613
|
},
|
590
614
|
"attribute": "disable-personalized-filter",
|
591
615
|
"reflect": false
|
616
|
+
},
|
617
|
+
"filterBarLegacyConfigName": {
|
618
|
+
"type": "string",
|
619
|
+
"mutable": false,
|
620
|
+
"complexType": {
|
621
|
+
"original": "string",
|
622
|
+
"resolved": "string",
|
623
|
+
"references": {}
|
624
|
+
},
|
625
|
+
"required": false,
|
626
|
+
"optional": false,
|
627
|
+
"docs": {
|
628
|
+
"tags": [],
|
629
|
+
"text": "Chave da configura\u00E7\u00E3o legado da barra de filtros."
|
630
|
+
},
|
631
|
+
"attribute": "filter-bar-legacy-config-name",
|
632
|
+
"reflect": false
|
592
633
|
}
|
593
634
|
};
|
594
635
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ElementIDUtils } from '@sankhyalabs/core';
|
2
2
|
import { h } from '@stencil/core';
|
3
|
-
import { SnkFormConfigManager } from '
|
3
|
+
import { SnkFormConfigManager } from '../snk-form-config/SnkFormConfigManager';
|
4
4
|
import ResourceIDUtils from '../../lib/resourceid/ResourceIDUtils';
|
5
5
|
export class SnkForm {
|
6
6
|
constructor() {
|
@@ -11,6 +11,7 @@ export class SnkForm {
|
|
11
11
|
this.configName = undefined;
|
12
12
|
this.recordsValidator = undefined;
|
13
13
|
this.messagesBuilder = undefined;
|
14
|
+
this.formLegacyConfigName = undefined;
|
14
15
|
this.resourceID = undefined;
|
15
16
|
}
|
16
17
|
/**
|
@@ -58,8 +59,14 @@ export class SnkForm {
|
|
58
59
|
this.resourceID = await ResourceIDUtils.getResourceID();
|
59
60
|
}
|
60
61
|
this._configManager = new SnkFormConfigManager(this.configName, this.resourceID);
|
62
|
+
this.addFormLegacyConfig();
|
61
63
|
this._configManager.loadConfig();
|
62
64
|
}
|
65
|
+
addFormLegacyConfig() {
|
66
|
+
if (this.formLegacyConfigName) {
|
67
|
+
this._configManager.addFormLegacyConfig(this.formLegacyConfigName);
|
68
|
+
}
|
69
|
+
}
|
63
70
|
render() {
|
64
71
|
if (!this._dataUnit || !this._dataState) {
|
65
72
|
return undefined;
|
@@ -138,6 +145,23 @@ export class SnkForm {
|
|
138
145
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
139
146
|
}
|
140
147
|
},
|
148
|
+
"formLegacyConfigName": {
|
149
|
+
"type": "string",
|
150
|
+
"mutable": false,
|
151
|
+
"complexType": {
|
152
|
+
"original": "string",
|
153
|
+
"resolved": "string",
|
154
|
+
"references": {}
|
155
|
+
},
|
156
|
+
"required": false,
|
157
|
+
"optional": false,
|
158
|
+
"docs": {
|
159
|
+
"tags": [],
|
160
|
+
"text": "Chave da configura\u00E7\u00E3o legado do formul\u00E1rio."
|
161
|
+
},
|
162
|
+
"attribute": "form-legacy-config-name",
|
163
|
+
"reflect": false
|
164
|
+
},
|
141
165
|
"resourceID": {
|
142
166
|
"type": "string",
|
143
167
|
"mutable": false,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ConfigStorage } from
|
1
|
+
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
2
2
|
import { ObjectUtils, StringUtils } from "@sankhyalabs/core";
|
3
3
|
import { FormConfigFetcher } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
|
4
4
|
export class SnkFormConfigManager {
|
@@ -7,6 +7,11 @@ export class SnkFormConfigManager {
|
|
7
7
|
this._configName = configName;
|
8
8
|
this._onConfigChange = onConfigChange;
|
9
9
|
}
|
10
|
+
addFormLegacyConfig(legacyConfigName) {
|
11
|
+
if (this._configName) {
|
12
|
+
ConfigStorage.addFormLegacyConfig(this._configName, legacyConfigName);
|
13
|
+
}
|
14
|
+
}
|
10
15
|
async loadConfig() {
|
11
16
|
return new Promise(resolve => {
|
12
17
|
ConfigStorage.loadFormConfig(this._configName, this._resourceID)
|
@@ -92,16 +97,19 @@ export class SnkFormConfigManager {
|
|
92
97
|
const normalizedFilter = StringUtils.replaceAccentuatedCharsLower(descriptionFilter.toLocaleLowerCase());
|
93
98
|
return normalizedText.includes(normalizedFilter);
|
94
99
|
}
|
95
|
-
getInsertionConfig(dataUnit) {
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
if (
|
100
|
-
|
100
|
+
getInsertionConfig(dataUnit, ignoreReadOnlyFormFields) {
|
101
|
+
let fields = this.getFieldsList(dataUnit);
|
102
|
+
if (ignoreReadOnlyFormFields) {
|
103
|
+
fields = fields.filter(field => {
|
104
|
+
if (dataUnit) {
|
105
|
+
const def = dataUnit.getField(field.name);
|
106
|
+
if (def && def.readOnly) {
|
107
|
+
return false;
|
108
|
+
}
|
101
109
|
}
|
102
|
-
|
103
|
-
|
104
|
-
}
|
110
|
+
return !field.readOnly;
|
111
|
+
});
|
112
|
+
}
|
105
113
|
return Object.assign(Object.assign({}, this._config), { fields });
|
106
114
|
}
|
107
115
|
setConfig(config) {
|
@@ -121,8 +129,8 @@ export class SnkFormConfigManager {
|
|
121
129
|
this._onConfigChange(Object.assign({}, this._config));
|
122
130
|
}
|
123
131
|
}
|
124
|
-
getConfig(insertionMode, dataUnit) {
|
125
|
-
return insertionMode ? this.getInsertionConfig(dataUnit) : Object.assign({}, this._config);
|
132
|
+
getConfig(insertionMode, dataUnit, ignoreReadOnlyFormFields) {
|
133
|
+
return insertionMode ? this.getInsertionConfig(dataUnit, ignoreReadOnlyFormFields !== null && ignoreReadOnlyFormFields !== void 0 ? ignoreReadOnlyFormFields : true) : Object.assign({}, this._config);
|
126
134
|
}
|
127
135
|
getFormConfigFetcher() {
|
128
136
|
if (this._formConfigFetcher == undefined) {
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
2
2
|
import { Sortable } from '@shopify/draggable';
|
3
|
-
import { ObjectUtils, ArrayUtils, ElementIDUtils } from '@sankhyalabs/core';
|
3
|
+
import { ObjectUtils, ArrayUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
4
4
|
import { ApplicationUtils, DialogType } from "@sankhyalabs/ezui/dist/collection/utils";
|
5
|
-
import { ACTION_CONFIG, CONFIG_EVENTS, CONFIG_SORTABLE_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "
|
6
|
-
import { UserConfigType } from "
|
5
|
+
import { ACTION_CONFIG, CONFIG_EVENTS, CONFIG_SORTABLE_EVENTS, DEFAULT_TYPE, TAB_NAMES } from "../../lib/utils/constants";
|
6
|
+
import { UserConfigType } from "../../lib/http/data-fetcher/fetchers/form-config-fetcher";
|
7
7
|
import { buildFormConfigFromDataUnit } from "@sankhyalabs/ezui/dist/collection/utils/form";
|
8
8
|
const CONTAINER_ID = {
|
9
9
|
collapsibleBox: "EZ-COLLAPSIBLE-BOX",
|
@@ -946,6 +946,12 @@ export class SnkFormConfig {
|
|
946
946
|
this.controlSortableField();
|
947
947
|
this.controlSortableGroup();
|
948
948
|
}
|
949
|
+
async componentWillRender() {
|
950
|
+
if (this.messagesBuilder == undefined) {
|
951
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
952
|
+
this.messagesBuilder = application.messagesBuilder;
|
953
|
+
}
|
954
|
+
}
|
949
955
|
componentWillLoad() {
|
950
956
|
this.loadConfig();
|
951
957
|
}
|
@@ -1019,7 +1025,7 @@ export class SnkFormConfig {
|
|
1019
1025
|
"references": {
|
1020
1026
|
"SnkFormConfigManager": {
|
1021
1027
|
"location": "import",
|
1022
|
-
"path": "
|
1028
|
+
"path": "./SnkFormConfigManager"
|
1023
1029
|
}
|
1024
1030
|
}
|
1025
1031
|
},
|
@@ -1039,7 +1045,7 @@ export class SnkFormConfig {
|
|
1039
1045
|
"references": {
|
1040
1046
|
"SnkMessageBuilder": {
|
1041
1047
|
"location": "import",
|
1042
|
-
"path": "
|
1048
|
+
"path": "../../lib/message/SnkMessageBuilder"
|
1043
1049
|
}
|
1044
1050
|
}
|
1045
1051
|
},
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { h, Fragment } from '@stencil/core';
|
2
2
|
import { ApplicationContext, DataType, ElementIDUtils, StringUtils } from '@sankhyalabs/core';
|
3
|
-
import {
|
3
|
+
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
4
4
|
import { TaskbarElement } from '../snk-taskbar/elements/taskbar-elements';
|
5
5
|
import { ConfigStorage } from '../../lib/configs/ConfigStorage';
|
6
6
|
import { PresentationMode } from '../../lib/@types';
|
@@ -9,6 +9,7 @@ import store from "../../lib/store";
|
|
9
9
|
import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionListDataSource';
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
11
|
import { buildFieldSearch, openFieldSearch } from '../snk-taskbar/subcomponents/field-search';
|
12
|
+
import { CrudUtils } from '../../lib';
|
12
13
|
export class SnkGrid {
|
13
14
|
constructor() {
|
14
15
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
@@ -54,6 +55,8 @@ export class SnkGrid {
|
|
54
55
|
this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
|
55
56
|
this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
|
56
57
|
this.disablePersonalizedFilter = undefined;
|
58
|
+
this.gridLegacyConfigName = undefined;
|
59
|
+
this.filterBarLegacyConfigName = undefined;
|
57
60
|
}
|
58
61
|
/**
|
59
62
|
* Exibe a janela de configurações da grade.
|
@@ -98,6 +101,22 @@ export class SnkGrid {
|
|
98
101
|
async findColumn() {
|
99
102
|
await openFieldSearch(this._moreOptions, this._columnSearch);
|
100
103
|
}
|
104
|
+
/**
|
105
|
+
* Atribui o foco para a grade.
|
106
|
+
*/
|
107
|
+
async setFocus() {
|
108
|
+
this._grid.setFocus();
|
109
|
+
}
|
110
|
+
async handleGridLegacyConfigName(newLegacyConfig, oldLegacyConfig) {
|
111
|
+
if (!newLegacyConfig) {
|
112
|
+
return;
|
113
|
+
}
|
114
|
+
if (newLegacyConfig === oldLegacyConfig) {
|
115
|
+
return;
|
116
|
+
}
|
117
|
+
this.addGridLegacyConfigName();
|
118
|
+
this.loadConfig();
|
119
|
+
}
|
101
120
|
openGridConfig() {
|
102
121
|
this._grid.getColumnsState()
|
103
122
|
.then((gridColumns) => {
|
@@ -111,19 +130,7 @@ export class SnkGrid {
|
|
111
130
|
}
|
112
131
|
setGridConfig(config) {
|
113
132
|
this._gridConfig = config;
|
114
|
-
|
115
|
-
}
|
116
|
-
assertDefaultSorting() {
|
117
|
-
if (this._gridConfig && this._dataUnit) {
|
118
|
-
this._dataUnit.defaultSorting = this._gridConfig
|
119
|
-
.columns
|
120
|
-
.filter(col => col.ascending != undefined)
|
121
|
-
.sort((colA, colB) => colA.orderIndex - colB.orderIndex)
|
122
|
-
.map(({ name: field, ascending }) => {
|
123
|
-
const { dataType } = this._dataUnit.getField(field);
|
124
|
-
return { field, dataType, mode: ascending ? SortMode.ASC : SortMode.DESC };
|
125
|
-
});
|
126
|
-
}
|
133
|
+
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
127
134
|
}
|
128
135
|
loadConfig() {
|
129
136
|
ConfigStorage.loadGridConfig(this.configName, this.resourceID)
|
@@ -134,6 +141,11 @@ export class SnkGrid {
|
|
134
141
|
console.warn(error);
|
135
142
|
});
|
136
143
|
}
|
144
|
+
addGridLegacyConfigName() {
|
145
|
+
if (this.gridLegacyConfigName && this.configName) {
|
146
|
+
ConfigStorage.addGridLegacyConfig(this.configName, this.gridLegacyConfigName);
|
147
|
+
}
|
148
|
+
}
|
137
149
|
gridConfigChangeHandler(evt) {
|
138
150
|
const config = evt.detail;
|
139
151
|
ConfigStorage.saveGridConfig(config, this.configName, this.resourceID);
|
@@ -249,7 +261,7 @@ export class SnkGrid {
|
|
249
261
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
250
262
|
}
|
251
263
|
finshLoading() {
|
252
|
-
|
264
|
+
CrudUtils.assertDefaultSorting(this._gridConfig, this._dataUnit);
|
253
265
|
this.addElementID();
|
254
266
|
if (this.columnFilterDataSource != undefined) {
|
255
267
|
this.columnFilterDataSource.setApplication(this._application);
|
@@ -258,6 +270,7 @@ export class SnkGrid {
|
|
258
270
|
}
|
259
271
|
componentWillLoad() {
|
260
272
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
273
|
+
//TODO: substituir pelo metodo nativo closest
|
261
274
|
let parent = this._element.parentElement;
|
262
275
|
while (parent) {
|
263
276
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -287,6 +300,7 @@ export class SnkGrid {
|
|
287
300
|
}
|
288
301
|
parent = parent.parentElement;
|
289
302
|
}
|
303
|
+
this.addGridLegacyConfigName();
|
290
304
|
this.loadConfig();
|
291
305
|
}
|
292
306
|
getHeaderDisabledButtons() {
|
@@ -401,7 +415,7 @@ export class SnkGrid {
|
|
401
415
|
return undefined;
|
402
416
|
}
|
403
417
|
return (h("div", { class: "snk-grid__container ez-flex ez-flex--column ez-flex-item--auto ez-padding--large" }, h("div", { class: "snk-grid__header ez-margin-bottom--medium" }, this._showSnkFilterBar &&
|
404
|
-
h(Fragment, null, 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 }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME),
|
418
|
+
h(Fragment, null, 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 }), h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" })), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId, overflowStrategy: 'none' }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: (evt) => this.gridDoubleClick.emit(evt.detail), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { id: 'teste', dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, presentationMode: this.presentationMode, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.getActionsList(), primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
405
419
|
}
|
406
420
|
static get is() { return "snk-grid"; }
|
407
421
|
static get encapsulation() { return "scoped"; }
|
@@ -778,6 +792,40 @@ export class SnkGrid {
|
|
778
792
|
},
|
779
793
|
"attribute": "disable-personalized-filter",
|
780
794
|
"reflect": false
|
795
|
+
},
|
796
|
+
"gridLegacyConfigName": {
|
797
|
+
"type": "string",
|
798
|
+
"mutable": false,
|
799
|
+
"complexType": {
|
800
|
+
"original": "string",
|
801
|
+
"resolved": "string",
|
802
|
+
"references": {}
|
803
|
+
},
|
804
|
+
"required": false,
|
805
|
+
"optional": false,
|
806
|
+
"docs": {
|
807
|
+
"tags": [],
|
808
|
+
"text": "Chave da configura\u00E7\u00E3o legado da grade."
|
809
|
+
},
|
810
|
+
"attribute": "grid-legacy-config-name",
|
811
|
+
"reflect": false
|
812
|
+
},
|
813
|
+
"filterBarLegacyConfigName": {
|
814
|
+
"type": "string",
|
815
|
+
"mutable": false,
|
816
|
+
"complexType": {
|
817
|
+
"original": "string",
|
818
|
+
"resolved": "string",
|
819
|
+
"references": {}
|
820
|
+
},
|
821
|
+
"required": false,
|
822
|
+
"optional": false,
|
823
|
+
"docs": {
|
824
|
+
"tags": [],
|
825
|
+
"text": "Chave da configura\u00E7\u00E3o legado da barra de filtros."
|
826
|
+
},
|
827
|
+
"attribute": "filter-bar-legacy-config-name",
|
828
|
+
"reflect": false
|
781
829
|
}
|
782
830
|
};
|
783
831
|
}
|
@@ -930,8 +978,30 @@ export class SnkGrid {
|
|
930
978
|
"text": "Abre o localizador de colunas",
|
931
979
|
"tags": []
|
932
980
|
}
|
981
|
+
},
|
982
|
+
"setFocus": {
|
983
|
+
"complexType": {
|
984
|
+
"signature": "() => Promise<void>",
|
985
|
+
"parameters": [],
|
986
|
+
"references": {
|
987
|
+
"Promise": {
|
988
|
+
"location": "global"
|
989
|
+
}
|
990
|
+
},
|
991
|
+
"return": "Promise<void>"
|
992
|
+
},
|
993
|
+
"docs": {
|
994
|
+
"text": "Atribui o foco para a grade.",
|
995
|
+
"tags": []
|
996
|
+
}
|
933
997
|
}
|
934
998
|
};
|
935
999
|
}
|
936
1000
|
static get elementRef() { return "_element"; }
|
1001
|
+
static get watchers() {
|
1002
|
+
return [{
|
1003
|
+
"propName": "gridLegacyConfigName",
|
1004
|
+
"methodName": "handleGridLegacyConfigName"
|
1005
|
+
}];
|
1006
|
+
}
|
937
1007
|
}
|