@sankhyalabs/sankhyablocks 1.3.31-beta.13 → 1.3.31-beta.16
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/{SnkMessageBuilder-bb55d4c4.js → SnkMessageBuilder-79cf15c5.js} +1 -0
- package/dist/cjs/{index-c6671817.js → index-5575fe3d.js} +434 -231
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/sankhyablocks.cjs.js +3 -3
- package/dist/cjs/snk-application.cjs.entry.js +60 -2
- package/dist/cjs/snk-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-unit.cjs.entry.js +3 -3
- package/dist/cjs/snk-form_2.cjs.entry.js +2 -2
- package/dist/cjs/snk-pesquisa.cjs.entry.js +1 -1
- package/dist/cjs/snk-taskbar.cjs.entry.js +2 -2
- package/dist/cjs/{taskbar-elements-2888ceb6.js → taskbar-elements-2ae0d005.js} +1 -1
- package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/snk-application/snk-application.js +703 -647
- package/dist/collection/components/snk-crud/snk-crud.js +75 -73
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +262 -250
- package/dist/collection/components/snk-form/snk-form.js +111 -111
- package/dist/collection/components/snk-grid/snk-grid.js +93 -92
- package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +80 -79
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +1 -2
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +128 -116
- package/dist/collection/components/teste-pesquisa/teste-pesquisa.js +12 -9
- package/dist/collection/lib/http/data-fetcher/fetchers/totals-fetcher.js +47 -0
- package/dist/collection/lib/message/resources/snk-data-unit.msg.js +1 -0
- package/dist/components/SnkMessageBuilder.js +1 -0
- package/dist/components/index.d.ts +8 -5
- package/dist/components/index.js +8 -0
- package/dist/components/snk-application2.js +59 -0
- package/dist/components/snk-data-unit.js +1 -1
- package/dist/esm/{SnkMessageBuilder-17d91b88.js → SnkMessageBuilder-3cdde541.js} +1 -0
- package/dist/esm/{index-6a83ac96.js → index-cf91f542.js} +434 -231
- package/dist/esm/loader.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/sankhyablocks.js +3 -3
- package/dist/esm/snk-application.entry.js +60 -2
- package/dist/esm/snk-crud.entry.js +1 -1
- package/dist/esm/snk-data-unit.entry.js +3 -3
- package/dist/esm/snk-form_2.entry.js +2 -2
- package/dist/esm/snk-pesquisa.entry.js +1 -1
- package/dist/esm/snk-taskbar.entry.js +2 -2
- package/dist/esm/{taskbar-elements-5ea74223.js → taskbar-elements-bcccc0ff.js} +1 -1
- package/dist/esm/teste-pesquisa.entry.js +1 -1
- package/dist/sankhyablocks/{p-b7e029cd.entry.js → p-1ba29824.entry.js} +8 -3
- package/dist/sankhyablocks/{p-4c7b32d6.entry.js → p-2266555e.entry.js} +1 -1
- package/dist/sankhyablocks/p-23c4c94f.js +2 -0
- package/dist/sankhyablocks/{p-b559117b.js → p-2454be94.js} +1 -1
- package/dist/sankhyablocks/p-49743bc5.js +1 -0
- package/dist/sankhyablocks/{p-ce2d1214.entry.js → p-4fa389bd.entry.js} +1 -1
- package/dist/sankhyablocks/{p-56a32417.entry.js → p-5327ba05.entry.js} +1 -1
- package/dist/sankhyablocks/{p-d25803a1.entry.js → p-7a922fb4.entry.js} +1 -1
- package/dist/sankhyablocks/p-92d6f826.entry.js +1 -0
- package/dist/sankhyablocks/{p-d25637c9.entry.js → p-bdeef7f2.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +8 -0
- package/dist/types/components.d.ts +5 -1
- package/dist/types/lib/http/data-fetcher/fetchers/totals-fetcher.d.ts +8 -0
- package/dist/types/stencil-public-runtime.d.ts +15 -4
- package/loader/package.json +1 -0
- package/package.json +5 -5
- package/dist/sankhyablocks/p-ab694dbc.js +0 -1
- package/dist/sankhyablocks/p-cd1dc099.js +0 -2
- package/dist/sankhyablocks/p-edf81d2c.entry.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApplicationContext } from '@sankhyalabs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { h, Host } from '@stencil/core';
|
|
3
3
|
import { TaskbarElement, buildElem, AuthorizationElements, VisibleWhenForbidden } from './elements/taskbar-elements';
|
|
4
4
|
export class SnkTaskbar {
|
|
5
5
|
constructor() {
|
|
@@ -141,130 +141,142 @@ export class SnkTaskbar {
|
|
|
141
141
|
}
|
|
142
142
|
static get is() { return "snk-taskbar"; }
|
|
143
143
|
static get encapsulation() { return "scoped"; }
|
|
144
|
-
static get originalStyleUrls() {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
144
|
+
static get originalStyleUrls() {
|
|
145
|
+
return {
|
|
146
|
+
"$": ["snk-taskbar.css"]
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
static get styleUrls() {
|
|
150
|
+
return {
|
|
151
|
+
"$": ["snk-taskbar.css"]
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
static get properties() {
|
|
155
|
+
return {
|
|
156
|
+
"buttons": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"mutable": false,
|
|
159
|
+
"complexType": {
|
|
160
|
+
"original": "string",
|
|
161
|
+
"resolved": "string",
|
|
162
|
+
"references": {}
|
|
163
|
+
},
|
|
164
|
+
"required": false,
|
|
165
|
+
"optional": false,
|
|
166
|
+
"docs": {
|
|
167
|
+
"tags": [],
|
|
168
|
+
"text": "Lista separada por virgula, contendo todos os elementos a serem criados"
|
|
169
|
+
},
|
|
170
|
+
"attribute": "buttons",
|
|
171
|
+
"reflect": false
|
|
164
172
|
},
|
|
165
|
-
"
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
"Action": {
|
|
179
|
-
"location": "local"
|
|
173
|
+
"actionsList": {
|
|
174
|
+
"type": "unknown",
|
|
175
|
+
"mutable": false,
|
|
176
|
+
"complexType": {
|
|
177
|
+
"original": "Array<Action>",
|
|
178
|
+
"resolved": "Action[]",
|
|
179
|
+
"references": {
|
|
180
|
+
"Array": {
|
|
181
|
+
"location": "global"
|
|
182
|
+
},
|
|
183
|
+
"Action": {
|
|
184
|
+
"location": "local"
|
|
185
|
+
}
|
|
180
186
|
}
|
|
187
|
+
},
|
|
188
|
+
"required": false,
|
|
189
|
+
"optional": false,
|
|
190
|
+
"docs": {
|
|
191
|
+
"tags": [],
|
|
192
|
+
"text": "Lista de a\u00E7\u00F5es que devem ser usadas no bot\u00E3o \"Mais op\u00E7\u00F5es\""
|
|
181
193
|
}
|
|
182
194
|
},
|
|
183
|
-
"
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
"
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
"optional": false,
|
|
200
|
-
"docs": {
|
|
201
|
-
"tags": [],
|
|
202
|
-
"text": "Qual bot\u00E3o deve ter apar\u00EAncia prim\u00E1ria"
|
|
195
|
+
"primaryButton": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"mutable": false,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "string",
|
|
200
|
+
"resolved": "string",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": false,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Qual bot\u00E3o deve ter apar\u00EAncia prim\u00E1ria"
|
|
208
|
+
},
|
|
209
|
+
"attribute": "primary-button",
|
|
210
|
+
"reflect": false
|
|
203
211
|
},
|
|
204
|
-
"
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"Array": {
|
|
215
|
-
"location": "global"
|
|
212
|
+
"disabledButtons": {
|
|
213
|
+
"type": "unknown",
|
|
214
|
+
"mutable": false,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "Array<string>",
|
|
217
|
+
"resolved": "string[]",
|
|
218
|
+
"references": {
|
|
219
|
+
"Array": {
|
|
220
|
+
"location": "global"
|
|
221
|
+
}
|
|
216
222
|
}
|
|
223
|
+
},
|
|
224
|
+
"required": false,
|
|
225
|
+
"optional": false,
|
|
226
|
+
"docs": {
|
|
227
|
+
"tags": [],
|
|
228
|
+
"text": "Array contendo todos os bot\u00F5es a serem desabilitados"
|
|
217
229
|
}
|
|
218
230
|
},
|
|
219
|
-
"
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
"
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
"original": "DataUnit",
|
|
231
|
-
"resolved": "DataUnit",
|
|
232
|
-
"references": {
|
|
233
|
-
"DataUnit": {
|
|
234
|
-
"location": "import",
|
|
235
|
-
"path": "@sankhyalabs/core"
|
|
231
|
+
"dataUnit": {
|
|
232
|
+
"type": "unknown",
|
|
233
|
+
"mutable": false,
|
|
234
|
+
"complexType": {
|
|
235
|
+
"original": "DataUnit",
|
|
236
|
+
"resolved": "DataUnit",
|
|
237
|
+
"references": {
|
|
238
|
+
"DataUnit": {
|
|
239
|
+
"location": "import",
|
|
240
|
+
"path": "@sankhyalabs/core"
|
|
241
|
+
}
|
|
236
242
|
}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "Inst\u00E2ncia do DataUnit"
|
|
237
249
|
}
|
|
238
|
-
},
|
|
239
|
-
"required": false,
|
|
240
|
-
"optional": false,
|
|
241
|
-
"docs": {
|
|
242
|
-
"tags": [],
|
|
243
|
-
"text": "Inst\u00E2ncia do DataUnit"
|
|
244
250
|
}
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
static get states() {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
"
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
static get states() {
|
|
254
|
+
return {
|
|
255
|
+
"_permissions": {}
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
static get events() {
|
|
259
|
+
return [{
|
|
260
|
+
"method": "actionClick",
|
|
261
|
+
"name": "actionClick",
|
|
262
|
+
"bubbles": true,
|
|
263
|
+
"cancelable": true,
|
|
264
|
+
"composed": true,
|
|
265
|
+
"docs": {
|
|
266
|
+
"tags": [],
|
|
267
|
+
"text": "Emitido sempre que houver click de bot\u00E3o ou a\u00E7\u00E3o"
|
|
268
|
+
},
|
|
269
|
+
"complexType": {
|
|
270
|
+
"original": "string",
|
|
271
|
+
"resolved": "string",
|
|
272
|
+
"references": {}
|
|
273
|
+
}
|
|
274
|
+
}];
|
|
275
|
+
}
|
|
276
|
+
static get watchers() {
|
|
277
|
+
return [{
|
|
278
|
+
"propName": "buttons",
|
|
279
|
+
"methodName": "observeButtons"
|
|
280
|
+
}];
|
|
281
|
+
}
|
|
270
282
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DataType, DataUnit, UserInterface } from '@sankhyalabs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { h } from '@stencil/core';
|
|
3
3
|
export class TestePesquisa {
|
|
4
4
|
componentWillLoad() {
|
|
5
5
|
this.dataUnit = new DataUnit("testes_com_formulario");
|
|
@@ -19,15 +19,18 @@ export class TestePesquisa {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
return (h("snk-application", null,
|
|
23
|
-
h("ez-form", { dataUnit: this.dataUnit })));
|
|
22
|
+
return (h("snk-application", null, h("ez-form", { dataUnit: this.dataUnit })));
|
|
24
23
|
}
|
|
25
24
|
static get is() { return "teste-pesquisa"; }
|
|
26
25
|
static get encapsulation() { return "shadow"; }
|
|
27
|
-
static get originalStyleUrls() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
static get originalStyleUrls() {
|
|
27
|
+
return {
|
|
28
|
+
"$": ["teste-pesquisa.css"]
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static get styleUrls() {
|
|
32
|
+
return {
|
|
33
|
+
"$": ["teste-pesquisa.css"]
|
|
34
|
+
};
|
|
35
|
+
}
|
|
33
36
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { gql } from "graphql-request";
|
|
2
|
+
import { DataFetcher } from "../DataFetcher";
|
|
3
|
+
export class TotalsFetcher {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.templateByQuery = new Map();
|
|
6
|
+
this.buldTemplates();
|
|
7
|
+
}
|
|
8
|
+
buldTemplates() {
|
|
9
|
+
this.templateByQuery.set("fetchTotals", gql `query($filters: [InputFilter!] $name: String!) {
|
|
10
|
+
$queryAlias$: fetchTotals(name: $name, filters: $filters ){
|
|
11
|
+
name
|
|
12
|
+
value
|
|
13
|
+
}
|
|
14
|
+
}`);
|
|
15
|
+
}
|
|
16
|
+
async getTotals(name, resourceID, filters) {
|
|
17
|
+
const path = `totals://${name}/${resourceID}`;
|
|
18
|
+
let variables = {
|
|
19
|
+
name: path,
|
|
20
|
+
filters: filters
|
|
21
|
+
};
|
|
22
|
+
return DataFetcher.get().callGraphQL({
|
|
23
|
+
values: variables,
|
|
24
|
+
query: this.templateByQuery.get("fetchTotals"),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
fetchTotals(name, resourceID, filters = []) {
|
|
28
|
+
return new Promise((accept, reject) => {
|
|
29
|
+
this.getTotals(name, resourceID, filters)
|
|
30
|
+
.then((result) => {
|
|
31
|
+
if (result.length > 0) {
|
|
32
|
+
const totalsData = new Map();
|
|
33
|
+
result.forEach(total => {
|
|
34
|
+
totalsData.set(total.name, parseFloat(total.value));
|
|
35
|
+
});
|
|
36
|
+
accept(totalsData);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
reject(`Não foi possível recuperar os totalizadores`);
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
.catch((error) => {
|
|
43
|
+
reject(error);
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -14,6 +14,7 @@ const snkDataUnitMessages = {
|
|
|
14
14
|
cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
|
|
15
15
|
removeConfirmationTitle: "Excluir",
|
|
16
16
|
removeConfirmation: "Deseja realmente excluir o registro atual?",
|
|
17
|
+
forbidden: "Sem permissão",
|
|
17
18
|
forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
|
|
18
19
|
forbiddenInsert: "Não é possível incluir. Verifique as permissões de acesso.",
|
|
19
20
|
forbiddenClone: "Não é possível duplicar. Verifique as permissões de acesso.",
|
|
@@ -14,6 +14,7 @@ const snkDataUnitMessages = {
|
|
|
14
14
|
cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
|
|
15
15
|
removeConfirmationTitle: "Excluir",
|
|
16
16
|
removeConfirmation: "Deseja realmente excluir o registro atual?",
|
|
17
|
+
forbidden: "Sem permissão",
|
|
17
18
|
forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
|
|
18
19
|
forbiddenInsert: "Não é possível incluir. Verifique as permissões de acesso.",
|
|
19
20
|
forbiddenClone: "Não é possível duplicar. Verifique as permissões de acesso.",
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/* sankhyablocks custom elements */
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export { SnkApplication as SnkApplication } from '../types/components/snk-application/snk-application';
|
|
3
|
+
export { SnkCrud as SnkCrud } from '../types/components/snk-crud/snk-crud';
|
|
4
|
+
export { SnkDataUnit as SnkDataUnit } from '../types/components/snk-data-unit/snk-data-unit';
|
|
5
|
+
export { SnkForm as SnkForm } from '../types/components/snk-form/snk-form';
|
|
6
|
+
export { SnkGrid as SnkGrid } from '../types/components/snk-grid/snk-grid';
|
|
7
|
+
export { SnkPesquisa as SnkPesquisa } from '../types/components/snk-pesquisa/snk-pesquisa';
|
|
8
|
+
export { SnkTaskbar as SnkTaskbar } from '../types/components/snk-taskbar/snk-taskbar';
|
|
9
|
+
export { TestePesquisa as TestePesquisa } from '../types/components/teste-pesquisa/teste-pesquisa';
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Used to manually set the base path where assets can be found.
|
|
@@ -20,7 +26,4 @@ export interface SetPlatformOptions {
|
|
|
20
26
|
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
21
27
|
}
|
|
22
28
|
export declare const setPlatformOptions: (opts: SetPlatformOptions) => void;
|
|
23
|
-
|
|
24
|
-
export type { Components, JSX };
|
|
25
|
-
|
|
26
29
|
export * from '../types';
|
package/dist/components/index.js
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
1
|
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
|
+
export { SnkApplication, defineCustomElement as defineCustomElementSnkApplication } from './snk-application.js';
|
|
3
|
+
export { SnkCrud, defineCustomElement as defineCustomElementSnkCrud } from './snk-crud.js';
|
|
4
|
+
export { SnkDataUnit, defineCustomElement as defineCustomElementSnkDataUnit } from './snk-data-unit.js';
|
|
5
|
+
export { SnkForm, defineCustomElement as defineCustomElementSnkForm } from './snk-form.js';
|
|
6
|
+
export { SnkGrid, defineCustomElement as defineCustomElementSnkGrid } from './snk-grid.js';
|
|
7
|
+
export { SnkPesquisa, defineCustomElement as defineCustomElementSnkPesquisa } from './snk-pesquisa.js';
|
|
8
|
+
export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
|
|
9
|
+
export { TestePesquisa, defineCustomElement as defineCustomElementTestePesquisa } from './teste-pesquisa.js';
|
|
@@ -7279,6 +7279,52 @@ class SnkErrorHandler {
|
|
|
7279
7279
|
|
|
7280
7280
|
function _0x53e1(){const _0x340df8=['2909523kXwted','CompanyName=Sankhya\x20Jiva\x20Tecnologia\x20e\x20Inovao\x20Ltda,LicensedApplication=Sankhya\x20Gestao,LicenseType=SingleApplication,LicensedConcurrentDeveloperCount=2,LicensedProductionInstancesCount=0,AssetReference=AG-019460,ExpiryDate=9_November_2022_[v2]_MTY2Nzk1MjAwMDAwMA==10487151e296ee4360f80961ca960869','1131048CARoeW','502909mLEPmu','447255iQEXuN','428UHbJwW','270AFTxAV','194369jhGqTI','1540nWuTrj','2044062GicUQI','30CkXPWg'];_0x53e1=function(){return _0x340df8;};return _0x53e1();}const _0xc7632f=_0x15c2;function _0x15c2(_0x353a9c,_0x3e4a5a){const _0x53e110=_0x53e1();return _0x15c2=function(_0x15c2aa,_0x219858){_0x15c2aa=_0x15c2aa-0x188;let _0x307231=_0x53e110[_0x15c2aa];return _0x307231;},_0x15c2(_0x353a9c,_0x3e4a5a);}(function(_0x42617e,_0x57debe){const _0x31061a=_0x15c2,_0x128d7d=_0x42617e();while(!![]){try{const _0x1c9bb1=-parseInt(_0x31061a(0x18e))/0x1+-parseInt(_0x31061a(0x189))/0x2+parseInt(_0x31061a(0x18b))/0x3+-parseInt(_0x31061a(0x190))/0x4*(parseInt(_0x31061a(0x188))/0x5)+-parseInt(_0x31061a(0x191))/0x6*(-parseInt(_0x31061a(0x192))/0x7)+parseInt(_0x31061a(0x18d))/0x8+-parseInt(_0x31061a(0x18f))/0x9*(-parseInt(_0x31061a(0x18a))/0xa);if(_0x1c9bb1===_0x57debe)break;else _0x128d7d['push'](_0x128d7d['shift']());}catch(_0x1bd816){_0x128d7d['push'](_0x128d7d['shift']());}}}(_0x53e1,0xe8676));const agGridLicense=_0xc7632f(0x18c);
|
|
7281
7281
|
|
|
7282
|
+
class TotalsFetcher {
|
|
7283
|
+
constructor() {
|
|
7284
|
+
this.templateByQuery = new Map();
|
|
7285
|
+
this.buldTemplates();
|
|
7286
|
+
}
|
|
7287
|
+
buldTemplates() {
|
|
7288
|
+
this.templateByQuery.set("fetchTotals", dist.gql `query($filters: [InputFilter!] $name: String!) {
|
|
7289
|
+
$queryAlias$: fetchTotals(name: $name, filters: $filters ){
|
|
7290
|
+
name
|
|
7291
|
+
value
|
|
7292
|
+
}
|
|
7293
|
+
}`);
|
|
7294
|
+
}
|
|
7295
|
+
async getTotals(name, resourceID, filters) {
|
|
7296
|
+
const path = `totals://${name}/${resourceID}`;
|
|
7297
|
+
let variables = {
|
|
7298
|
+
name: path,
|
|
7299
|
+
filters: filters
|
|
7300
|
+
};
|
|
7301
|
+
return DataFetcher.get().callGraphQL({
|
|
7302
|
+
values: variables,
|
|
7303
|
+
query: this.templateByQuery.get("fetchTotals"),
|
|
7304
|
+
});
|
|
7305
|
+
}
|
|
7306
|
+
fetchTotals(name, resourceID, filters = []) {
|
|
7307
|
+
return new Promise((accept, reject) => {
|
|
7308
|
+
this.getTotals(name, resourceID, filters)
|
|
7309
|
+
.then((result) => {
|
|
7310
|
+
if (result.length > 0) {
|
|
7311
|
+
const totalsData = new Map();
|
|
7312
|
+
result.forEach(total => {
|
|
7313
|
+
totalsData.set(total.name, parseFloat(total.value));
|
|
7314
|
+
});
|
|
7315
|
+
accept(totalsData);
|
|
7316
|
+
}
|
|
7317
|
+
else {
|
|
7318
|
+
reject(`Não foi possível recuperar os totalizadores`);
|
|
7319
|
+
}
|
|
7320
|
+
})
|
|
7321
|
+
.catch((error) => {
|
|
7322
|
+
reject(error);
|
|
7323
|
+
});
|
|
7324
|
+
});
|
|
7325
|
+
}
|
|
7326
|
+
}
|
|
7327
|
+
|
|
7282
7328
|
const snkApplicationCss = ".sc-snk-application-h{display:flex;flex-direction:column;height:100%}";
|
|
7283
7329
|
|
|
7284
7330
|
const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -7597,6 +7643,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7597
7643
|
async loadGridConfig(name) {
|
|
7598
7644
|
return this.gridConfigFetcher.getConfig(name, this.resourceID);
|
|
7599
7645
|
}
|
|
7646
|
+
/**
|
|
7647
|
+
* Busca os totalizadores da grade.
|
|
7648
|
+
*/
|
|
7649
|
+
async loadTotals(name, resourceID, filters) {
|
|
7650
|
+
return this.totalsFetcher.fetchTotals(name, resourceID, filters);
|
|
7651
|
+
}
|
|
7600
7652
|
/**
|
|
7601
7653
|
* Salva a configuração de grade.
|
|
7602
7654
|
*/
|
|
@@ -7630,6 +7682,12 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7630
7682
|
}
|
|
7631
7683
|
return this._gridConfigFetcher;
|
|
7632
7684
|
}
|
|
7685
|
+
get totalsFetcher() {
|
|
7686
|
+
if (!this._totalsFetcher) {
|
|
7687
|
+
this._totalsFetcher = new TotalsFetcher();
|
|
7688
|
+
}
|
|
7689
|
+
return this._totalsFetcher;
|
|
7690
|
+
}
|
|
7633
7691
|
get pesquisaFetcher() {
|
|
7634
7692
|
if (!this._pesquisaFetcher) {
|
|
7635
7693
|
this._pesquisaFetcher = new PesquisaFetcher();
|
|
@@ -7767,6 +7825,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
7767
7825
|
"info": [64],
|
|
7768
7826
|
"loadFormConfig": [64],
|
|
7769
7827
|
"loadGridConfig": [64],
|
|
7828
|
+
"loadTotals": [64],
|
|
7770
7829
|
"saveGridConfig": [64],
|
|
7771
7830
|
"executeSearch": [64],
|
|
7772
7831
|
"isDebugMode": [64]
|
|
@@ -132,7 +132,7 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
132
132
|
}
|
|
133
133
|
else {
|
|
134
134
|
this.dataUnit.cancelEdition();
|
|
135
|
-
ApplicationUtils.
|
|
135
|
+
ApplicationUtils.alert(this.getMessage("snkDataUnit.forbidden"), this.getMessage("snkDataUnit.forbiddenUpdate"));
|
|
136
136
|
}
|
|
137
137
|
break;
|
|
138
138
|
case Action.SAVING_DATA:
|
|
@@ -14,6 +14,7 @@ const snkDataUnitMessages = {
|
|
|
14
14
|
cancelConfirmation: "As alterações realizadas serão descartadas<br/><br/><b>Você realmente gostaria de cancelar?",
|
|
15
15
|
removeConfirmationTitle: "Excluir",
|
|
16
16
|
removeConfirmation: "Deseja realmente excluir o registro atual?",
|
|
17
|
+
forbidden: "Sem permissão",
|
|
17
18
|
forbiddenUpdate: "Não é possível fazer alterações. Verifique as permissões de acesso.",
|
|
18
19
|
forbiddenInsert: "Não é possível incluir. Verifique as permissões de acesso.",
|
|
19
20
|
forbiddenClone: "Não é possível duplicar. Verifique as permissões de acesso.",
|