@sankhyalabs/sankhyablocks 8.0.2 → 8.1.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/{ConfigStorage-e044fff2.js → ConfigStorage-e32e1391.js} +4 -4
- package/dist/cjs/{DataFetcher-62b9b2c8.js → DataFetcher-d2c6ae38.js} +42 -0
- package/dist/cjs/{SnkFormConfigManager-5d4b4765.js → SnkFormConfigManager-5e61b0a9.js} +2 -2
- package/dist/cjs/auth-fetcher-da975ac5.js +34 -0
- package/dist/cjs/{dataunit-fetcher-2a3c86b1.js → dataunit-fetcher-58ad78a7.js} +1 -1
- package/dist/cjs/{filter-bar-config-fetcher-71119171.js → filter-bar-config-fetcher-80b033ce.js} +1 -1
- package/dist/cjs/{form-config-fetcher-2b32c782.js → form-config-fetcher-761994b9.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-ee74ae40.js → pesquisa-fetcher-bb0bb679.js} +1 -1
- package/dist/cjs/{resource-fetcher-18c2d5ad.js → resource-fetcher-95d24dff.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +3 -2
- package/dist/cjs/snk-application.cjs.entry.js +21 -38
- package/dist/cjs/snk-attach.cjs.entry.js +3 -3
- package/dist/cjs/snk-crud.cjs.entry.js +12 -4
- package/dist/cjs/snk-data-exporter.cjs.entry.js +3 -2
- package/dist/cjs/{snk-data-unit-807a8684.js → snk-data-unit-e89e07bd.js} +4 -0
- package/dist/cjs/snk-data-unit.cjs.entry.js +1 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +15 -10
- package/dist/cjs/snk-filter-bar.cjs.entry.js +7 -6
- package/dist/cjs/snk-filter-detail.cjs.entry.js +4 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +6 -5
- package/dist/cjs/snk-form-config.cjs.entry.js +4 -3
- package/dist/cjs/snk-form-view.cjs.entry.js +6 -1
- package/dist/cjs/snk-form.cjs.entry.js +8 -6
- package/dist/cjs/snk-grid-config.cjs.entry.js +6 -5
- package/dist/cjs/snk-grid.cjs.entry.js +13 -9
- package/dist/cjs/{snk-guides-viewer-263de371.js → snk-guides-viewer-eb0a79a4.js} +6 -4
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +9 -8
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +6 -5
- package/dist/cjs/snk-print-selector.cjs.entry.js +2 -1
- package/dist/cjs/snk-simple-crud.cjs.entry.js +18 -72
- package/dist/collection/components/snk-application/snk-application.js +60 -0
- package/dist/collection/components/snk-crud/snk-crud.js +49 -3
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +46 -2
- package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +27 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +42 -1
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +21 -0
- package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +1 -1
- package/dist/collection/components/snk-form/snk-form.js +22 -0
- package/dist/collection/components/snk-grid/snk-grid.js +84 -4
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +43 -2
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.css +1 -1
- package/dist/collection/lib/dataUnit/InMemoryLoader.js +2 -59
- package/dist/collection/lib/http/data-fetcher/recaller/GraphQLRecaller.js +14 -0
- package/dist/collection/lib/utils/urlutils.js +29 -0
- package/dist/components/DataFetcher.js +43 -1
- package/dist/components/auth-fetcher.js +32 -0
- package/dist/components/snk-application2.js +12 -29
- package/dist/components/snk-crud.js +10 -2
- package/dist/components/snk-data-unit2.js +5 -0
- package/dist/components/snk-detail-view2.js +12 -3
- package/dist/components/snk-filter-bar2.js +1 -1
- package/dist/components/snk-form-view2.js +6 -1
- package/dist/components/snk-form.js +1 -0
- package/dist/components/snk-grid2.js +13 -5
- package/dist/components/snk-simple-crud2.js +7 -61
- package/dist/esm/{ConfigStorage-6ec80135.js → ConfigStorage-b6aefe42.js} +4 -4
- package/dist/esm/{DataFetcher-f7cf7302.js → DataFetcher-aaaff866.js} +43 -1
- package/dist/esm/{SnkFormConfigManager-b8091dec.js → SnkFormConfigManager-80901f2d.js} +2 -2
- package/dist/esm/auth-fetcher-7860d777.js +32 -0
- package/dist/esm/{dataunit-fetcher-06e70d4c.js → dataunit-fetcher-9dfcdb1d.js} +1 -1
- package/dist/esm/{filter-bar-config-fetcher-efd7ab4e.js → filter-bar-config-fetcher-317cb6bf.js} +1 -1
- package/dist/esm/{form-config-fetcher-a5b23cd9.js → form-config-fetcher-4a34b86a.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-f06f4883.js → pesquisa-fetcher-01d058e6.js} +1 -1
- package/dist/esm/{resource-fetcher-92640c2f.js → resource-fetcher-b36ac145.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +3 -2
- package/dist/esm/snk-application.entry.js +19 -36
- package/dist/esm/snk-attach.entry.js +3 -3
- package/dist/esm/snk-crud.entry.js +12 -4
- package/dist/esm/snk-data-exporter.entry.js +3 -2
- package/dist/esm/{snk-data-unit-351ef08f.js → snk-data-unit-8c4d944d.js} +4 -0
- package/dist/esm/snk-data-unit.entry.js +1 -1
- package/dist/esm/snk-detail-view.entry.js +15 -10
- package/dist/esm/snk-filter-bar.entry.js +7 -6
- package/dist/esm/snk-filter-detail.entry.js +4 -3
- package/dist/esm/snk-filter-modal-item.entry.js +6 -5
- package/dist/esm/snk-form-config.entry.js +4 -3
- package/dist/esm/snk-form-view.entry.js +6 -1
- package/dist/esm/snk-form.entry.js +8 -6
- package/dist/esm/snk-grid-config.entry.js +6 -5
- package/dist/esm/snk-grid.entry.js +13 -9
- package/dist/esm/{snk-guides-viewer-a6743bd9.js → snk-guides-viewer-ee42eb53.js} +6 -4
- package/dist/esm/snk-guides-viewer.entry.js +9 -8
- package/dist/esm/snk-personalized-filter.entry.js +6 -5
- package/dist/esm/snk-print-selector.entry.js +2 -1
- package/dist/esm/snk-simple-crud.entry.js +9 -63
- package/dist/sankhyablocks/p-05bcad8a.entry.js +1 -0
- package/dist/sankhyablocks/p-0b64f036.entry.js +1 -0
- package/dist/sankhyablocks/p-0e97ec46.entry.js +1 -0
- package/dist/sankhyablocks/{p-6785e5c9.entry.js → p-1b81c379.entry.js} +1 -1
- package/dist/sankhyablocks/{p-10a1b3a6.js → p-2dd0f891.js} +2 -2
- package/dist/sankhyablocks/p-330f584a.entry.js +1 -0
- package/dist/sankhyablocks/p-35ecafcb.entry.js +1 -0
- package/dist/sankhyablocks/{p-0d8f5882.js → p-42843f0e.js} +1 -1
- package/dist/sankhyablocks/p-459d4267.entry.js +1 -0
- package/dist/sankhyablocks/p-557affc8.entry.js +1 -0
- package/dist/sankhyablocks/p-564efc43.js +1 -0
- package/dist/sankhyablocks/p-60791bb6.js +1 -0
- package/dist/sankhyablocks/p-6295424d.entry.js +1 -0
- package/dist/sankhyablocks/p-64c2cec3.js +1 -0
- package/dist/sankhyablocks/p-77ecc583.entry.js +1 -0
- package/dist/sankhyablocks/p-803b79d6.js +1 -0
- package/dist/sankhyablocks/p-80729c9b.entry.js +11 -0
- package/dist/sankhyablocks/{p-a54bdcc8.js → p-85affa29.js} +2 -2
- package/dist/sankhyablocks/p-95fa8af6.entry.js +1 -0
- package/dist/sankhyablocks/p-96c1ae78.entry.js +1 -0
- package/dist/sankhyablocks/p-b556fadc.entry.js +1 -0
- package/dist/sankhyablocks/{p-70b8e4a4.js → p-bee6b5d7.js} +1 -1
- package/dist/sankhyablocks/p-bf3bd954.entry.js +1 -0
- package/dist/sankhyablocks/p-c32b9d7c.entry.js +1 -0
- package/dist/sankhyablocks/p-c555075c.entry.js +1 -0
- package/dist/sankhyablocks/{p-bdcfbe10.js → p-dd1fa35d.js} +1 -1
- package/dist/sankhyablocks/{p-e7aefd06.js → p-e42f1f2a.js} +1 -1
- package/dist/sankhyablocks/p-f24c4bc7.entry.js +1 -0
- package/dist/sankhyablocks/{p-49b24449.js → p-f737f7e1.js} +1 -1
- package/dist/sankhyablocks/p-fd69eab9.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-crud/snk-crud.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +9 -0
- package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +5 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +8 -0
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +4 -0
- package/dist/types/components/snk-form/snk-form.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +14 -1
- package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +8 -0
- package/dist/types/components.d.ts +98 -1
- package/dist/types/lib/dataUnit/InMemoryLoader.d.ts +0 -7
- package/dist/types/lib/http/data-fetcher/recaller/GraphQLRecaller.d.ts +1 -0
- package/dist/types/lib/utils/urlutils.d.ts +14 -0
- package/package.json +3 -3
- package/dist/sankhyablocks/p-0e8136f6.entry.js +0 -1
- package/dist/sankhyablocks/p-216f081a.entry.js +0 -1
- package/dist/sankhyablocks/p-29683966.entry.js +0 -1
- package/dist/sankhyablocks/p-2a57f7e1.entry.js +0 -1
- package/dist/sankhyablocks/p-3940f1e9.entry.js +0 -1
- package/dist/sankhyablocks/p-3e8e3025.entry.js +0 -1
- package/dist/sankhyablocks/p-3ef191cf.entry.js +0 -1
- package/dist/sankhyablocks/p-424a673f.entry.js +0 -1
- package/dist/sankhyablocks/p-5438f093.entry.js +0 -1
- package/dist/sankhyablocks/p-5807b3aa.entry.js +0 -1
- package/dist/sankhyablocks/p-5932777e.entry.js +0 -1
- package/dist/sankhyablocks/p-610e2459.js +0 -1
- package/dist/sankhyablocks/p-75cfc68e.entry.js +0 -1
- package/dist/sankhyablocks/p-7a43351d.entry.js +0 -11
- package/dist/sankhyablocks/p-829ebd26.entry.js +0 -1
- package/dist/sankhyablocks/p-8cf9c9ce.entry.js +0 -1
- package/dist/sankhyablocks/p-a304b0f3.entry.js +0 -1
- package/dist/sankhyablocks/p-a63aedf3.entry.js +0 -1
- package/dist/sankhyablocks/p-b8350ecf.entry.js +0 -1
- package/dist/sankhyablocks/p-cbc28ca6.js +0 -1
- package/dist/sankhyablocks/p-d23356a6.js +0 -1
@@ -174,6 +174,28 @@ export class SnkForm {
|
|
174
174
|
"resolved": "string",
|
175
175
|
"references": {}
|
176
176
|
}
|
177
|
+
}, {
|
178
|
+
"method": "formItemsReady",
|
179
|
+
"name": "formItemsReady",
|
180
|
+
"bubbles": true,
|
181
|
+
"cancelable": true,
|
182
|
+
"composed": true,
|
183
|
+
"docs": {
|
184
|
+
"tags": [],
|
185
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
186
|
+
},
|
187
|
+
"complexType": {
|
188
|
+
"original": "Array<HTMLElement>",
|
189
|
+
"resolved": "HTMLElement[]",
|
190
|
+
"references": {
|
191
|
+
"Array": {
|
192
|
+
"location": "global"
|
193
|
+
},
|
194
|
+
"HTMLElement": {
|
195
|
+
"location": "global"
|
196
|
+
}
|
197
|
+
}
|
198
|
+
}
|
177
199
|
}];
|
178
200
|
}
|
179
201
|
static get methods() {
|
@@ -10,7 +10,6 @@ import SnkMultiSelectionListDataSource from './filtercolumn/SnkMultiSelectionLis
|
|
10
10
|
import { SelectionMode } from '@sankhyalabs/core/dist/dataunit/DataUnit';
|
11
11
|
export class SnkGrid {
|
12
12
|
constructor() {
|
13
|
-
this._multiSelectionListDataSource = new SnkMultiSelectionListDataSource();
|
14
13
|
this._topTaskbarProcessor = new TaskbarProcessor({
|
15
14
|
"snkGridTopTaskbar.regular": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
16
15
|
"snkGridTopTaskbar.regular.secondary": ["FORM_MODE", "CONFIGURATOR", "INSERT"],
|
@@ -27,6 +26,7 @@ export class SnkGrid {
|
|
27
26
|
this._dataState = undefined;
|
28
27
|
this._gridConfig = undefined;
|
29
28
|
this._popUpGridConfig = false;
|
29
|
+
this.columnFilterDataSource = new SnkMultiSelectionListDataSource();
|
30
30
|
this.configName = undefined;
|
31
31
|
this.selectionToastConfig = undefined;
|
32
32
|
this.actionsList = undefined;
|
@@ -36,6 +36,9 @@ export class SnkGrid {
|
|
36
36
|
this.multipleSelection = undefined;
|
37
37
|
this.presentationMode = PresentationMode.PRIMARY;
|
38
38
|
this.messagesBuilder = undefined;
|
39
|
+
this.useEnterLikeTab = false;
|
40
|
+
this.recordsValidator = undefined;
|
41
|
+
this.canEdit = true;
|
39
42
|
}
|
40
43
|
/**
|
41
44
|
* Exibe a janela de configurações da grade.
|
@@ -209,10 +212,11 @@ export class SnkGrid {
|
|
209
212
|
ElementIDUtils.addIDInfo(this._element, null, dataInfo);
|
210
213
|
}
|
211
214
|
finshLoading() {
|
215
|
+
var _a, _b;
|
212
216
|
this._dataUnitLoadLockerResolver = this._dataUnit.addLoadingLocker();
|
213
217
|
this.addElementID();
|
214
|
-
this.
|
215
|
-
this.
|
218
|
+
(_a = this.columnFilterDataSource) === null || _a === void 0 ? void 0 : _a.setApplication(this._application);
|
219
|
+
(_b = this.columnFilterDataSource) === null || _b === void 0 ? void 0 : _b.setDataUnit(this._dataUnit);
|
216
220
|
}
|
217
221
|
componentWillLoad() {
|
218
222
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
@@ -304,7 +308,7 @@ export class SnkGrid {
|
|
304
308
|
return undefined;
|
305
309
|
}
|
306
310
|
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" }, h("snk-filter-bar", { ref: (ref) => this._snkFilterBar = ref, dataUnit: this._dataUnit, "data-element-id": "gridFilter", class: "snk-grid__filter-bar ez-align--top", configName: this.configName, messagesBuilder: this.messagesBuilder }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
307
|
-
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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.
|
311
|
+
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() })), 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: () => this.gridDoubleClick.emit(), statusResolver: this.statusResolver, multipleSelection: this.multipleSelection, onComponentReady: () => this.onEzGridReady(), columnfilterDataSource: this.columnFilterDataSource, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, recordsValidator: this.recordsValidator, canEdit: this.canEdit }, h("snk-taskbar", { dataUnit: this._dataUnit, configName: this.configName, messagesBuilder: this.messagesBuilder, "data-element-id": "grid_left", buttons: this._headerTaskbarProcessor.buttons, disabledButtons: this._headerTaskbarProcessor.disabledButtons, customButtons: this._headerTaskbarProcessor.customButtons, slot: "leftButtons", actionsList: this.actionsList })), 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), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig() }))));
|
308
312
|
}
|
309
313
|
static get is() { return "snk-grid"; }
|
310
314
|
static get encapsulation() { return "scoped"; }
|
@@ -320,6 +324,26 @@ export class SnkGrid {
|
|
320
324
|
}
|
321
325
|
static get properties() {
|
322
326
|
return {
|
327
|
+
"columnFilterDataSource": {
|
328
|
+
"type": "unknown",
|
329
|
+
"mutable": true,
|
330
|
+
"complexType": {
|
331
|
+
"original": "SnkMultiSelectionListDataSource",
|
332
|
+
"resolved": "SnkMultiSelectionListDataSource",
|
333
|
+
"references": {
|
334
|
+
"SnkMultiSelectionListDataSource": {
|
335
|
+
"location": "global"
|
336
|
+
}
|
337
|
+
}
|
338
|
+
},
|
339
|
+
"required": false,
|
340
|
+
"optional": false,
|
341
|
+
"docs": {
|
342
|
+
"tags": [],
|
343
|
+
"text": ""
|
344
|
+
},
|
345
|
+
"defaultValue": "new SnkMultiSelectionListDataSource()"
|
346
|
+
},
|
323
347
|
"configName": {
|
324
348
|
"type": "string",
|
325
349
|
"mutable": false,
|
@@ -500,6 +524,62 @@ export class SnkGrid {
|
|
500
524
|
"tags": [],
|
501
525
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
502
526
|
}
|
527
|
+
},
|
528
|
+
"useEnterLikeTab": {
|
529
|
+
"type": "boolean",
|
530
|
+
"mutable": false,
|
531
|
+
"complexType": {
|
532
|
+
"original": "boolean",
|
533
|
+
"resolved": "boolean",
|
534
|
+
"references": {}
|
535
|
+
},
|
536
|
+
"required": false,
|
537
|
+
"optional": false,
|
538
|
+
"docs": {
|
539
|
+
"tags": [],
|
540
|
+
"text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
|
541
|
+
},
|
542
|
+
"attribute": "use-enter-like-tab",
|
543
|
+
"reflect": false,
|
544
|
+
"defaultValue": "false"
|
545
|
+
},
|
546
|
+
"recordsValidator": {
|
547
|
+
"type": "unknown",
|
548
|
+
"mutable": false,
|
549
|
+
"complexType": {
|
550
|
+
"original": "IRecordValidator",
|
551
|
+
"resolved": "IRecordValidator",
|
552
|
+
"references": {
|
553
|
+
"IRecordValidator": {
|
554
|
+
"location": "import",
|
555
|
+
"path": "@sankhyalabs/ezui/dist/types/utils/form/interfaces"
|
556
|
+
}
|
557
|
+
}
|
558
|
+
},
|
559
|
+
"required": false,
|
560
|
+
"optional": false,
|
561
|
+
"docs": {
|
562
|
+
"tags": [],
|
563
|
+
"text": "Validador respons\u00E1vel por checar a integridade das informa\u00E7\u00F5es do registro."
|
564
|
+
}
|
565
|
+
},
|
566
|
+
"canEdit": {
|
567
|
+
"type": "boolean",
|
568
|
+
"mutable": false,
|
569
|
+
"complexType": {
|
570
|
+
"original": "boolean",
|
571
|
+
"resolved": "boolean",
|
572
|
+
"references": {}
|
573
|
+
},
|
574
|
+
"required": false,
|
575
|
+
"optional": false,
|
576
|
+
"docs": {
|
577
|
+
"tags": [],
|
578
|
+
"text": "Define se a edi\u00E7\u00E3o est\u00E1 habilitada na grid."
|
579
|
+
},
|
580
|
+
"attribute": "can-edit",
|
581
|
+
"reflect": false,
|
582
|
+
"defaultValue": "true"
|
503
583
|
}
|
504
584
|
};
|
505
585
|
}
|
@@ -29,6 +29,7 @@ export class SnkSimpleCrud {
|
|
29
29
|
this.useCancelConfirm = true;
|
30
30
|
this.taskbarManager = undefined;
|
31
31
|
this.messagesBuilder = undefined;
|
32
|
+
this.useEnterLikeTab = false;
|
32
33
|
}
|
33
34
|
resolveInMemoryBtns(taskbarButtons) {
|
34
35
|
const newTaskBarConfig = [...taskbarButtons];
|
@@ -173,9 +174,9 @@ export class SnkSimpleCrud {
|
|
173
174
|
}
|
174
175
|
render() {
|
175
176
|
var _a;
|
176
|
-
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
177
|
+
return (h("snk-data-unit", { class: "simple-crud__container", dataUnit: this.dataUnit, useCancelConfirm: this.useCancelConfirm, onDataStateChange: evt => this.onDataStateChange(evt), onCancelEdition: this.handleCancelEdit.bind(this), onInsertionMode: () => this.goToView(VIEW_MODE.FORM), onDataUnitReady: (evt) => this.dataUnitReady.emit(evt.detail), ignoreSaveMessage: this._currentViewMode === VIEW_MODE.GRID, onMessagesBuilderUpdated: evt => this.messagesBuilder = evt.detail }, h("header", null, h("slot", { name: "snkSimpleCrudHeader" })), h("section", { class: "ez-flex ez-box ez-box--shadow" }, h("snk-taskbar", { class: "ez-box ez-box--shadow ez-padding--medium ez-margin-bottom--large", dataUnit: this.dataUnit, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-element-id": "grid_left", messagesBuilder: this.messagesBuilder, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, slot: "leftButtons", presentationMode: PresentationMode.SECONDARY }), h("ez-view-stack", { class: "ez-flex ez-flex--column", ref: (ref) => this._viewStack = ref, "data-element-id": "simple-crud" }, h("stack-item", null, h("ez-grid", { dataUnit: this.dataUnit, config: this.gridConfig, "no-header": true, multipleSelection: this.multipleSelection, onEzDoubleClick: () => this.goToView(VIEW_MODE.FORM), columnfilterDataSource: this.dataUnit.name.includes(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME)
|
177
178
|
? undefined
|
178
|
-
: this._multiSelectionListDataSource }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
179
|
+
: this._multiSelectionListDataSource, useEnterLikeTab: this.useEnterLikeTab }, h("div", { slot: "footer" }, h("slot", { name: "snkSimpleCrudFooter" })))), h("stack-item", null, h("ez-form", { dataUnit: this.dataUnit, config: this.formConfig }))))));
|
179
180
|
}
|
180
181
|
static get is() { return "snk-simple-crud"; }
|
181
182
|
static get encapsulation() { return "scoped"; }
|
@@ -368,6 +369,24 @@ export class SnkSimpleCrud {
|
|
368
369
|
"tags": [],
|
369
370
|
"text": "Respons\u00E1vel por flexibilizar e padronizar o uso de mensagens nos blocos de constru\u00E7\u00E3o."
|
370
371
|
}
|
372
|
+
},
|
373
|
+
"useEnterLikeTab": {
|
374
|
+
"type": "boolean",
|
375
|
+
"mutable": false,
|
376
|
+
"complexType": {
|
377
|
+
"original": "boolean",
|
378
|
+
"resolved": "boolean",
|
379
|
+
"references": {}
|
380
|
+
},
|
381
|
+
"required": false,
|
382
|
+
"optional": false,
|
383
|
+
"docs": {
|
384
|
+
"tags": [],
|
385
|
+
"text": "Quando verdadeiro, o ENTER far\u00E1 a navega\u00E7\u00E3o como se fosse a tecla TAB na grade."
|
386
|
+
},
|
387
|
+
"attribute": "use-enter-like-tab",
|
388
|
+
"reflect": false,
|
389
|
+
"defaultValue": "false"
|
371
390
|
}
|
372
391
|
};
|
373
392
|
}
|
@@ -433,6 +452,28 @@ export class SnkSimpleCrud {
|
|
433
452
|
"resolved": "string",
|
434
453
|
"references": {}
|
435
454
|
}
|
455
|
+
}, {
|
456
|
+
"method": "formItemsReady",
|
457
|
+
"name": "formItemsReady",
|
458
|
+
"bubbles": true,
|
459
|
+
"cancelable": true,
|
460
|
+
"composed": true,
|
461
|
+
"docs": {
|
462
|
+
"tags": [],
|
463
|
+
"text": "Respons\u00E1vel por notificar quando ocorrer a renderiza\u00E7\u00E3o de itens do formul\u00E1rio."
|
464
|
+
},
|
465
|
+
"complexType": {
|
466
|
+
"original": "Array<HTMLElement>",
|
467
|
+
"resolved": "HTMLElement[]",
|
468
|
+
"references": {
|
469
|
+
"Array": {
|
470
|
+
"location": "global"
|
471
|
+
},
|
472
|
+
"HTMLElement": {
|
473
|
+
"location": "global"
|
474
|
+
}
|
475
|
+
}
|
476
|
+
}
|
436
477
|
}];
|
437
478
|
}
|
438
479
|
static get methods() {
|
@@ -1,12 +1,11 @@
|
|
1
|
-
import { ChangeOperation,
|
2
|
-
import { DISTINCT_FILTER_NAME_PREFIX } from "@sankhyalabs/ezui/dist/collection/utils/constants";
|
1
|
+
import { ChangeOperation, DataUnit, defaultDataLoader, StringUtils, } from '@sankhyalabs/core';
|
3
2
|
export default class InMemoryLoader {
|
4
3
|
constructor(metadata, records) {
|
5
4
|
this.records = records || [];
|
6
5
|
this.metadata = metadata;
|
7
6
|
this._dataUnit = new DataUnit(InMemoryLoader.IN_MEMORY_DATA_UNIT_NAME);
|
8
7
|
this._dataUnit.metadataLoader = () => this.metadaLoader();
|
9
|
-
this._dataUnit.dataLoader = (dataUnit, request) =>
|
8
|
+
this._dataUnit.dataLoader = (dataUnit, request) => defaultDataLoader(dataUnit, request, this._records);
|
10
9
|
this._dataUnit.saveLoader = (_dataUnit, changes) => this.saveLoader(_dataUnit, changes);
|
11
10
|
this._dataUnit.removeLoader = (_dataUnit, recordIds) => this.removeLoader(_dataUnit, recordIds);
|
12
11
|
this.dataUnit.loadMetadata().then(() => this.dataUnit.loadData());
|
@@ -43,62 +42,6 @@ export default class InMemoryLoader {
|
|
43
42
|
metadaLoader() {
|
44
43
|
return Promise.resolve(this._metadata);
|
45
44
|
}
|
46
|
-
dataLoader(dataUnit, request) {
|
47
|
-
const filters = this.getColumnFilters(dataUnit);
|
48
|
-
let records = this.applyFilters(filters);
|
49
|
-
if (request.sort) {
|
50
|
-
request.sort.forEach(sort => {
|
51
|
-
records = records.sort((recordA, recordB) => {
|
52
|
-
const fieldA = recordA[sort.field];
|
53
|
-
const fieldB = recordB[sort.field];
|
54
|
-
const sortFn = this.getSortFn(sort.dataType);
|
55
|
-
return sortFn(fieldA, fieldB) * (sort.mode == SortMode.ASC ? 1 : -1);
|
56
|
-
});
|
57
|
-
});
|
58
|
-
}
|
59
|
-
return Promise.resolve({ records: records });
|
60
|
-
}
|
61
|
-
applyFilters(filters) {
|
62
|
-
let records = [...this._records];
|
63
|
-
filters.forEach(filter => {
|
64
|
-
records = records.filter(record => { var _a; return filter.values.includes((_a = record[filter.column]) === null || _a === void 0 ? void 0 : _a.toString()); });
|
65
|
-
});
|
66
|
-
return records;
|
67
|
-
}
|
68
|
-
getColumnFilters(dataUnit) {
|
69
|
-
var _a, _b;
|
70
|
-
const allFilters = (_a = dataUnit.getFilters()) !== null && _a !== void 0 ? _a : [];
|
71
|
-
const columnFilters = (_b = allFilters.filter(filter => { var _a; return (_a = filter.name) === null || _a === void 0 ? void 0 : _a.includes(DISTINCT_FILTER_NAME_PREFIX); })) !== null && _b !== void 0 ? _b : [];
|
72
|
-
return columnFilters.map(filter => {
|
73
|
-
var _a, _b;
|
74
|
-
return {
|
75
|
-
column: (_b = (_a = filter.name) === null || _a === void 0 ? void 0 : _a.replace(DISTINCT_FILTER_NAME_PREFIX, "")) !== null && _b !== void 0 ? _b : "",
|
76
|
-
values: filter.params.map(param => param.value),
|
77
|
-
};
|
78
|
-
});
|
79
|
-
}
|
80
|
-
getSortFn(type) {
|
81
|
-
switch (type) {
|
82
|
-
case DataType.NUMBER:
|
83
|
-
return this.sortNumber;
|
84
|
-
case DataType.DATE:
|
85
|
-
return this.sortDate;
|
86
|
-
case DataType.OBJECT:
|
87
|
-
return this.sortObject;
|
88
|
-
default:
|
89
|
-
return StringUtils.compare;
|
90
|
-
}
|
91
|
-
}
|
92
|
-
sortObject(a, b) {
|
93
|
-
return StringUtils.compare(a === null || a === void 0 ? void 0 : a["label"], b === null || b === void 0 ? void 0 : b["label"]);
|
94
|
-
}
|
95
|
-
sortNumber(a, b) {
|
96
|
-
return a - b;
|
97
|
-
}
|
98
|
-
sortDate(a, b) {
|
99
|
-
let timeA = a.getTime(), timeB = b.getTime();
|
100
|
-
return timeA === timeB ? 0 : (timeA < timeB ? -1 : 1);
|
101
|
-
}
|
102
45
|
saveLoader(_dataUnit, changes) {
|
103
46
|
return new Promise((resolve) => {
|
104
47
|
let dataUnitRecords = [];
|
@@ -1,4 +1,6 @@
|
|
1
|
+
import { DataType } from "@sankhyalabs/core";
|
1
2
|
import { DataFetcher } from "../DataFetcher";
|
3
|
+
import { DataUnitTransient } from "@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";
|
2
4
|
export class GraphQLRecaller {
|
3
5
|
constructor(req, resolve, reject) {
|
4
6
|
this.req = req;
|
@@ -11,4 +13,16 @@ export class GraphQLRecaller {
|
|
11
13
|
reCall() {
|
12
14
|
return DataFetcher.get().callGraphQL(this.req).then(this.resolve, this.reject);
|
13
15
|
}
|
16
|
+
putTXPro(name, value) {
|
17
|
+
if (!this.req || !this.req.values)
|
18
|
+
return;
|
19
|
+
const changes = this.req.values.changes || [];
|
20
|
+
if (changes.length) {
|
21
|
+
this.req.values.changes[0].fields.push({
|
22
|
+
dataType: DataType.TEXT,
|
23
|
+
fieldName: `${DataUnitTransient.DATA_UNIT_TRANSIENT_PREFIX_NAME}${name}`,
|
24
|
+
value
|
25
|
+
});
|
26
|
+
}
|
27
|
+
}
|
14
28
|
}
|
@@ -22,4 +22,33 @@ export default class UrlUtils {
|
|
22
22
|
return window['mock_url'];
|
23
23
|
return `${location.protocol}//${location.hostname}${location.port ? ":" + location.port : ""}`;
|
24
24
|
}
|
25
|
+
/**
|
26
|
+
* Extrai da URL o parâmetro que contém o resourceId da tela desejada.
|
27
|
+
*
|
28
|
+
*/
|
29
|
+
static getResourceIdFromUrlToken(url) {
|
30
|
+
try {
|
31
|
+
const parts = url.split('/');
|
32
|
+
const encodedValue = parts[1];
|
33
|
+
return atob(encodedValue);
|
34
|
+
}
|
35
|
+
catch (error) {
|
36
|
+
throw new Error('Erro ao obter resourceId:' + error);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
/**
|
40
|
+
* Extrai da URL o parâmetro que contém o o objeto com a PK do registro específico.
|
41
|
+
*
|
42
|
+
*/
|
43
|
+
static getPkObjectFromUrlToken(url) {
|
44
|
+
try {
|
45
|
+
const parts = url.split('/');
|
46
|
+
const encodedObjectPart = parts[parts.length - 2];
|
47
|
+
const decodedObjectPart = atob(encodedObjectPart);
|
48
|
+
return JSON.parse(decodedObjectPart);
|
49
|
+
}
|
50
|
+
catch (error) {
|
51
|
+
throw new Error('Erro ao obter a PK do objeto:' + error);
|
52
|
+
}
|
53
|
+
}
|
25
54
|
}
|
@@ -1,5 +1,6 @@
|
|
1
|
-
import { StringUtils, ApplicationContext, ErrorException, WarningException, ObjectUtils } from '@sankhyalabs/core';
|
1
|
+
import { DataType, StringUtils, ApplicationContext, ErrorException, WarningException, ObjectUtils } from '@sankhyalabs/core';
|
2
2
|
import { c as createCommonjsModule, a as commonjsGlobal } from './_commonjsHelpers.js';
|
3
|
+
import { DataUnitTransient } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
3
4
|
|
4
5
|
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
5
6
|
var global = typeof self !== 'undefined' ? self : commonjsGlobal;
|
@@ -6433,6 +6434,35 @@ class UrlUtils {
|
|
6433
6434
|
return window['mock_url'];
|
6434
6435
|
return `${location.protocol}//${location.hostname}${location.port ? ":" + location.port : ""}`;
|
6435
6436
|
}
|
6437
|
+
/**
|
6438
|
+
* Extrai da URL o parâmetro que contém o resourceId da tela desejada.
|
6439
|
+
*
|
6440
|
+
*/
|
6441
|
+
static getResourceIdFromUrlToken(url) {
|
6442
|
+
try {
|
6443
|
+
const parts = url.split('/');
|
6444
|
+
const encodedValue = parts[1];
|
6445
|
+
return atob(encodedValue);
|
6446
|
+
}
|
6447
|
+
catch (error) {
|
6448
|
+
throw new Error('Erro ao obter resourceId:' + error);
|
6449
|
+
}
|
6450
|
+
}
|
6451
|
+
/**
|
6452
|
+
* Extrai da URL o parâmetro que contém o o objeto com a PK do registro específico.
|
6453
|
+
*
|
6454
|
+
*/
|
6455
|
+
static getPkObjectFromUrlToken(url) {
|
6456
|
+
try {
|
6457
|
+
const parts = url.split('/');
|
6458
|
+
const encodedObjectPart = parts[parts.length - 2];
|
6459
|
+
const decodedObjectPart = atob(encodedObjectPart);
|
6460
|
+
return JSON.parse(decodedObjectPart);
|
6461
|
+
}
|
6462
|
+
catch (error) {
|
6463
|
+
throw new Error('Erro ao obter a PK do objeto:' + error);
|
6464
|
+
}
|
6465
|
+
}
|
6436
6466
|
}
|
6437
6467
|
|
6438
6468
|
class ServiceBrokerRecaller {
|
@@ -6462,6 +6492,18 @@ class GraphQLRecaller {
|
|
6462
6492
|
reCall() {
|
6463
6493
|
return DataFetcher.get().callGraphQL(this.req).then(this.resolve, this.reject);
|
6464
6494
|
}
|
6495
|
+
putTXPro(name, value) {
|
6496
|
+
if (!this.req || !this.req.values)
|
6497
|
+
return;
|
6498
|
+
const changes = this.req.values.changes || [];
|
6499
|
+
if (changes.length) {
|
6500
|
+
this.req.values.changes[0].fields.push({
|
6501
|
+
dataType: DataType.TEXT,
|
6502
|
+
fieldName: `${DataUnitTransient.DATA_UNIT_TRANSIENT_PREFIX_NAME}${name}`,
|
6503
|
+
value
|
6504
|
+
});
|
6505
|
+
}
|
6506
|
+
}
|
6465
6507
|
}
|
6466
6508
|
|
6467
6509
|
class PrintUtils {
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import { ObjectUtils } from '@sankhyalabs/core';
|
2
|
+
import { R as ResourceFetcher } from './resource-fetcher.js';
|
3
|
+
|
4
|
+
class AuthFetcher extends ResourceFetcher {
|
5
|
+
getData(resourceID) {
|
6
|
+
const completePath = `cfg://auth/${resourceID}`;
|
7
|
+
return new Promise((resolve, reject) => {
|
8
|
+
this.loadResource(completePath)
|
9
|
+
.then((loadedResource) => {
|
10
|
+
let auth = ObjectUtils.stringToObject(loadedResource);
|
11
|
+
if (auth && typeof (auth) === 'object') {
|
12
|
+
resolve(auth);
|
13
|
+
}
|
14
|
+
}).catch((error) => {
|
15
|
+
reject(error);
|
16
|
+
});
|
17
|
+
});
|
18
|
+
}
|
19
|
+
}
|
20
|
+
var AutorizationType;
|
21
|
+
(function (AutorizationType) {
|
22
|
+
AutorizationType["INSERT"] = "I";
|
23
|
+
AutorizationType["UPDATE"] = "A";
|
24
|
+
AutorizationType["REMOVE"] = "E";
|
25
|
+
AutorizationType["SHOW"] = "C";
|
26
|
+
AutorizationType["CONFIG"] = "F";
|
27
|
+
AutorizationType["CONFIG_NUMBER"] = "N";
|
28
|
+
AutorizationType["CLONE"] = "D";
|
29
|
+
AutorizationType["CONFIG_GRID"] = "G";
|
30
|
+
})(AutorizationType || (AutorizationType = {}));
|
31
|
+
|
32
|
+
export { AutorizationType as A, AuthFetcher as a };
|
@@ -5,7 +5,7 @@ import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
5
|
import { P as PesquisaFetcher } from './pesquisa-fetcher.js';
|
6
6
|
import { G as GridConfigFetcher, C as ConfigStorage } from './ConfigStorage.js';
|
7
7
|
import { D as DataUnitFetcher } from './dataunit-fetcher.js';
|
8
|
-
import {
|
8
|
+
import { A as AutorizationType, a as AuthFetcher } from './auth-fetcher.js';
|
9
9
|
import { S as SnkMessageBuilder } from './SnkMessageBuilder.js';
|
10
10
|
import { d as defineCustomElement$1 } from './snk-pesquisa2.js';
|
11
11
|
|
@@ -226,34 +226,6 @@ class ParametersFetcher {
|
|
226
226
|
|
227
227
|
const _0x5b7870=_0x2202;(function(_0x42e134,_0x5d9727){const _0x185c97=_0x2202,_0x5854c7=_0x42e134();while(!![]){try{const _0x129d35=parseInt(_0x185c97(0x18f))/0x1*(-parseInt(_0x185c97(0x183))/0x2)+-parseInt(_0x185c97(0x191))/0x3+parseInt(_0x185c97(0x17d))/0x4*(-parseInt(_0x185c97(0x185))/0x5)+parseInt(_0x185c97(0x184))/0x6*(-parseInt(_0x185c97(0x182))/0x7)+parseInt(_0x185c97(0x17b))/0x8+parseInt(_0x185c97(0x18c))/0x9+parseInt(_0x185c97(0x17f))/0xa;if(_0x129d35===_0x5d9727)break;else _0x5854c7['push'](_0x5854c7['shift']());}catch(_0x4becb4){_0x5854c7['push'](_0x5854c7['shift']());}}}(_0xdfb1,0x44ac7));function _0x2202(_0x2eac1f,_0x170d27){const _0xdfb1b4=_0xdfb1();return _0x2202=function(_0x2202d7,_0x224df5){_0x2202d7=_0x2202d7-0x17a;let _0x4d54a9=_0xdfb1b4[_0x2202d7];return _0x4d54a9;},_0x2202(_0x2eac1f,_0x170d27);}function _0xdfb1(){const _0x2b9dc4=['true','863GKWjmo','parse','56355fjjjAm','isSup','putAccess','4324480sjuCdS','hasOwnProperty','239748okvJLB','name','6055770tXeRaU','actions','forEach','7RPRvzn','1042CHxkUw','2988126NIwRMm','20MTNzmH','authorizationSf','item','string','hasAccess','isArray','Objeto\x20não\x20pode\x20ser\x20indefinido.','3071943fWslZp','parseFromJSON'];_0xdfb1=function(){return _0x2b9dc4;};return _0xdfb1();}class MGEAuthorization{[_0x5b7870(0x18d)](_0x37e96b){const _0x580407=_0x5b7870;_0x37e96b=utxt(_0x37e96b[_0x580407(0x186)]);typeof _0x37e96b==_0x580407(0x188)&&(_0x37e96b=JSON[_0x580407(0x190)](_0x37e96b));if(_0x37e96b==undefined)throw Error(_0x580407(0x18b));const _0x291d34=new MGEAuthorizationData(_0x37e96b[_0x580407(0x192)]==='S'||_0x37e96b[_0x580407(0x192)]===!![]);return Array[_0x580407(0x18a)](_0x37e96b[_0x580407(0x187)])&&_0x37e96b[_0x580407(0x187)][_0x580407(0x181)](_0x58a748=>_0x291d34['putAccess'](_0x58a748[_0x580407(0x17e)],String(_0x58a748['status'])==_0x580407(0x18e))),_0x291d34;}}class MGEAuthorizationData{constructor(_0x51ec5d){const _0x2c8472=_0x5b7870;this['isSup']=_0x51ec5d,this[_0x2c8472(0x180)]={};}[_0x5b7870(0x17a)](_0x5bd0f2,_0x2ef465){const _0x40d701=_0x5b7870;this[_0x40d701(0x180)][_0x5bd0f2]=_0x2ef465;}[_0x5b7870(0x189)](_0x4fd772){const _0x3707c1=_0x5b7870;if(this[_0x3707c1(0x192)])return !![];let _0x25e60a=!![];return this[_0x3707c1(0x180)][_0x3707c1(0x17c)](_0x4fd772)&&(_0x25e60a=this['actions'][_0x4fd772]),_0x25e60a;}['isUserSup'](){return this['isSup'];}}
|
228
228
|
|
229
|
-
class AuthFetcher extends ResourceFetcher {
|
230
|
-
getData(resourceID) {
|
231
|
-
const completePath = `cfg://auth/${resourceID}`;
|
232
|
-
return new Promise((resolve, reject) => {
|
233
|
-
this.loadResource(completePath)
|
234
|
-
.then((loadedResource) => {
|
235
|
-
let auth = ObjectUtils.stringToObject(loadedResource);
|
236
|
-
if (auth && typeof (auth) === 'object') {
|
237
|
-
resolve(auth);
|
238
|
-
}
|
239
|
-
}).catch((error) => {
|
240
|
-
reject(error);
|
241
|
-
});
|
242
|
-
});
|
243
|
-
}
|
244
|
-
}
|
245
|
-
var AutorizationType;
|
246
|
-
(function (AutorizationType) {
|
247
|
-
AutorizationType["INSERT"] = "I";
|
248
|
-
AutorizationType["UPDATE"] = "A";
|
249
|
-
AutorizationType["REMOVE"] = "E";
|
250
|
-
AutorizationType["SHOW"] = "C";
|
251
|
-
AutorizationType["CONFIG"] = "F";
|
252
|
-
AutorizationType["CONFIG_NUMBER"] = "N";
|
253
|
-
AutorizationType["CLONE"] = "D";
|
254
|
-
AutorizationType["CONFIG_GRID"] = "G";
|
255
|
-
})(AutorizationType || (AutorizationType = {}));
|
256
|
-
|
257
229
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
258
230
|
|
259
231
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
@@ -607,6 +579,16 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
607
579
|
resolve(DataFetcher.hasClientEvent(eventID));
|
608
580
|
});
|
609
581
|
}
|
582
|
+
/**
|
583
|
+
* Realiza a chamada ao Service Broker conforme o nome do serviço.
|
584
|
+
*
|
585
|
+
* @param serviceName - Nome do serviço
|
586
|
+
* @param payload - Dados que serão processados na ação
|
587
|
+
* @param options - Parâmetros de URL
|
588
|
+
*/
|
589
|
+
async callServiceBroker(serviceName, payload, options) {
|
590
|
+
return DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
591
|
+
}
|
610
592
|
/**
|
611
593
|
* Obtém o resourceID da tela em questão.
|
612
594
|
*/
|
@@ -914,6 +896,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
914
896
|
"addClientEvent": [64],
|
915
897
|
"removeClientEvent": [64],
|
916
898
|
"hasClientEvent": [64],
|
899
|
+
"callServiceBroker": [64],
|
917
900
|
"getResourceID": [64],
|
918
901
|
"getUserID": [64],
|
919
902
|
"alert": [64],
|
@@ -5,6 +5,7 @@ import './DataFetcher.js';
|
|
5
5
|
import './pesquisa-fetcher.js';
|
6
6
|
import { P as PresentationMode } from './index2.js';
|
7
7
|
import { V as VIEW_MODE } from './constants.js';
|
8
|
+
import { A as AutorizationType } from './auth-fetcher.js';
|
8
9
|
import { d as defineCustomElement$v } from './snk-actions-button2.js';
|
9
10
|
import { d as defineCustomElement$u } from './snk-attach2.js';
|
10
11
|
import { d as defineCustomElement$t } from './snk-config-options2.js';
|
@@ -43,11 +44,13 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
43
44
|
this.actionClick = createEvent(this, "actionClick", 7);
|
44
45
|
this.configuratorSave = createEvent(this, "configuratorSave", 7);
|
45
46
|
this.configuratorCancel = createEvent(this, "configuratorCancel", 7);
|
47
|
+
this.formItemsReady = createEvent(this, "formItemsReady", 7);
|
46
48
|
this._viewHistory = [];
|
47
49
|
this._dataUnit = undefined;
|
48
50
|
this._dataState = undefined;
|
49
51
|
this.attachmentRegisterKey = undefined;
|
50
52
|
this._currentViewMode = VIEW_MODE.GRID;
|
53
|
+
this._canEdit = undefined;
|
51
54
|
this.configName = undefined;
|
52
55
|
this.selectionToastConfig = undefined;
|
53
56
|
this.showActionButtons = false;
|
@@ -58,6 +61,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
58
61
|
this.multipleSelection = true;
|
59
62
|
this.presentationMode = PresentationMode.PRIMARY;
|
60
63
|
this.messagesBuilder = undefined;
|
64
|
+
this.useEnterLikeTab = false;
|
61
65
|
}
|
62
66
|
/**
|
63
67
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
@@ -140,6 +144,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
140
144
|
return joinedPrimaryKeys;
|
141
145
|
}
|
142
146
|
componentWillLoad() {
|
147
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
148
|
+
application.hasAccess(AutorizationType.UPDATE).then(canEdit => this._canEdit = canEdit);
|
143
149
|
let parent = this._element.parentElement;
|
144
150
|
while (parent) {
|
145
151
|
if (parent.tagName.toUpperCase() === "SNK-DATA-UNIT") {
|
@@ -168,7 +174,6 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
168
174
|
parent = parent.parentElement;
|
169
175
|
}
|
170
176
|
if (!this.configName) {
|
171
|
-
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
172
177
|
this.configName = application.configName;
|
173
178
|
}
|
174
179
|
}
|
@@ -187,7 +192,8 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
187
192
|
this.configuratorCancel.emit();
|
188
193
|
}
|
189
194
|
render() {
|
190
|
-
|
195
|
+
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
196
|
+
return (h("ez-view-stack", { ref: (ref) => this._viewStack = ref, "data-element-id": "crud" }, h("stack-item", null, h("snk-grid", { ref: (ref) => this._snkGrid = ref, "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, selectionToastConfig: this.selectionToastConfig, useEnterLikeTab: this.useEnterLikeTab, canEdit: this._canEdit }, h("slot", { name: "SnkGridHeader" }), h("slot", { name: "SnkGridFooter" }), h("slot", { name: "SnkGridTaskBar" }))), h("stack-item", null, h("snk-guides-viewer", { ref: ref => this._guidesViewer = ref, entityPath: this._snkDataUnit.entityName, messagesBuilder: this.messagesBuilder, onExit: () => this.setViewMode(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 }, h("slot", { name: "SnkFormTaskBar" }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this._snkDataUnit.entityName, onBack: this.backView.bind(this) })), h("snk-configurator", { ref: (ref) => this._snkConfigurator = ref, 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') }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
191
197
|
}
|
192
198
|
get _element() { return this; }
|
193
199
|
static get watchers() { return {
|
@@ -205,10 +211,12 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
205
211
|
"multipleSelection": [4, "multiple-selection"],
|
206
212
|
"presentationMode": [1, "presentation-mode"],
|
207
213
|
"messagesBuilder": [1040],
|
214
|
+
"useEnterLikeTab": [4, "use-enter-like-tab"],
|
208
215
|
"_dataUnit": [32],
|
209
216
|
"_dataState": [32],
|
210
217
|
"attachmentRegisterKey": [32],
|
211
218
|
"_currentViewMode": [32],
|
219
|
+
"_canEdit": [32],
|
212
220
|
"goToView": [64],
|
213
221
|
"openConfigurator": [64],
|
214
222
|
"closeConfigurator": [64],
|