@sankhyalabs/sankhyablocks 2.12.4 → 2.13.0
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/{constants-0069b951.js → constants-8f3504ec.js} +2 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-config-options.cjs.entry.js +1 -1
- package/dist/cjs/snk-configurator_3.cjs.entry.js +10 -6
- package/dist/cjs/snk-crud.cjs.entry.js +1 -1
- package/dist/cjs/snk-data-exporter_8.cjs.entry.js +94 -18
- package/dist/cjs/snk-data-unit.cjs.entry.js +23 -0
- package/dist/cjs/snk-form-config.cjs.entry.js +1 -1
- package/dist/cjs/snk-tab-config.cjs.entry.js +1 -1
- package/dist/collection/components/snk-data-exporter/interfaces/ISelectedID.js +1 -0
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.css +13 -1
- package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +76 -14
- package/dist/collection/components/snk-data-unit/snk-data-unit.js +53 -0
- package/dist/collection/components/snk-grid/snk-grid.js +9 -5
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.js +1 -0
- package/dist/collection/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.js +18 -0
- package/dist/collection/lib/utils/constants.js +1 -0
- package/dist/components/constants.js +2 -1
- package/dist/components/snk-data-exporter2.js +95 -18
- package/dist/components/snk-data-unit.js +25 -1
- package/dist/components/snk-grid2.js +9 -5
- package/dist/esm/{constants-8ad13317.js → constants-965d7a7f.js} +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-config-options.entry.js +1 -1
- package/dist/esm/snk-configurator_3.entry.js +10 -6
- package/dist/esm/snk-crud.entry.js +1 -1
- package/dist/esm/snk-data-exporter_8.entry.js +94 -18
- package/dist/esm/snk-data-unit.entry.js +23 -0
- package/dist/esm/snk-form-config.entry.js +1 -1
- package/dist/esm/snk-tab-config.entry.js +1 -1
- package/dist/sankhyablocks/{p-e24e488b.entry.js → p-3c7ec56e.entry.js} +1 -1
- package/dist/sankhyablocks/{p-392d3c18.entry.js → p-3f6c05c7.entry.js} +1 -1
- package/dist/sankhyablocks/p-b4093344.js +1 -0
- package/dist/sankhyablocks/{p-223d1bd9.entry.js → p-bcb2fb03.entry.js} +1 -1
- package/dist/sankhyablocks/{p-7ba9d7c7.entry.js → p-e728ca22.entry.js} +1 -1
- package/dist/sankhyablocks/p-f1ae398e.entry.js +1 -0
- package/dist/sankhyablocks/{p-ecdf80bf.entry.js → p-f9829109.entry.js} +1 -1
- package/dist/sankhyablocks/p-fa885483.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +3 -1
- package/dist/types/components/snk-data-exporter/interfaces/IRecordID.d.ts +6 -0
- package/dist/types/components/snk-data-exporter/interfaces/ISelectedID.d.ts +13 -0
- package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +8 -3
- package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +6 -0
- package/dist/types/components.d.ts +7 -1
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IPersonalizedReport.d.ts +4 -0
- package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/personalized-reports-fetcher.d.ts +4 -0
- package/dist/types/lib/utils/constants.d.ts +1 -0
- package/package.json +1 -1
- package/dist/sankhyablocks/p-12fb5088.entry.js +0 -1
- package/dist/sankhyablocks/p-790e1ed5.entry.js +0 -1
- package/dist/sankhyablocks/p-ad2026bb.js +0 -1
- package/dist/types/lib/applet-caller/interfaces/IAppletCallerParams.d.ts +0 -6
- /package/dist/collection/{lib/applet-caller/interfaces/IAppletCallerParams.js → components/snk-data-exporter/interfaces/IRecordID.js} +0 -0
|
@@ -89,6 +89,29 @@ export class SnkDataUnit {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Método que retorna a lista de IDs dos registros selecionados.
|
|
94
|
+
* @returns Retorna a lista de IDs dos registros selecionados.
|
|
95
|
+
*/
|
|
96
|
+
async getSelectedRecordsIDsInfo() {
|
|
97
|
+
var _a;
|
|
98
|
+
const selectedRecordsIDsInfo = [];
|
|
99
|
+
const selectedRecords = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecords();
|
|
100
|
+
if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
|
|
101
|
+
selectedRecords.forEach(({ __record__id__ }) => {
|
|
102
|
+
const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
|
|
103
|
+
Object.entries(revertBase64ToObject).forEach(([name, value]) => {
|
|
104
|
+
var _a;
|
|
105
|
+
const metadataField = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
|
|
106
|
+
if (metadataField == undefined) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return selectedRecordsIDsInfo;
|
|
114
|
+
}
|
|
92
115
|
async interceptAction(action) {
|
|
93
116
|
return new Promise(resolve => {
|
|
94
117
|
switch (action.type) {
|
|
@@ -532,6 +555,36 @@ export class SnkDataUnit {
|
|
|
532
555
|
"text": "Obt\u00E9m o dataUnit.",
|
|
533
556
|
"tags": []
|
|
534
557
|
}
|
|
558
|
+
},
|
|
559
|
+
"getSelectedRecordsIDsInfo": {
|
|
560
|
+
"complexType": {
|
|
561
|
+
"signature": "() => Promise<Array<IRecordID>>",
|
|
562
|
+
"parameters": [],
|
|
563
|
+
"references": {
|
|
564
|
+
"Promise": {
|
|
565
|
+
"location": "global"
|
|
566
|
+
},
|
|
567
|
+
"IRecordID": {
|
|
568
|
+
"location": "import",
|
|
569
|
+
"path": "../snk-data-exporter/interfaces/IRecordID"
|
|
570
|
+
},
|
|
571
|
+
"Array": {
|
|
572
|
+
"location": "global"
|
|
573
|
+
},
|
|
574
|
+
"Record": {
|
|
575
|
+
"location": "import",
|
|
576
|
+
"path": "@sankhyalabs/core"
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
"return": "Promise<IRecordID[]>"
|
|
580
|
+
},
|
|
581
|
+
"docs": {
|
|
582
|
+
"text": "M\u00E9todo que retorna a lista de IDs dos registros selecionados.",
|
|
583
|
+
"tags": [{
|
|
584
|
+
"name": "returns",
|
|
585
|
+
"text": "Retorna a lista de IDs dos registros selecionados."
|
|
586
|
+
}]
|
|
587
|
+
}
|
|
535
588
|
}
|
|
536
589
|
};
|
|
537
590
|
}
|
|
@@ -140,10 +140,11 @@ export class SnkGrid {
|
|
|
140
140
|
return limit;
|
|
141
141
|
}
|
|
142
142
|
async dataExporterProviderStore() {
|
|
143
|
-
var _a;
|
|
143
|
+
var _a, _b;
|
|
144
144
|
const paginationInfo = this.getPaginationInfo();
|
|
145
145
|
const columnsMetadata = [];
|
|
146
|
-
await ((_a = this.
|
|
146
|
+
const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
|
|
147
|
+
await ((_b = this._grid) === null || _b === void 0 ? void 0 : _b.getColumnsState().then(this.buildColumnsMetadata.bind(this, columnsMetadata)));
|
|
147
148
|
const dataExporterProvider = {
|
|
148
149
|
getFilters: () => {
|
|
149
150
|
var _a;
|
|
@@ -160,15 +161,18 @@ export class SnkGrid {
|
|
|
160
161
|
var _a;
|
|
161
162
|
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
|
162
163
|
},
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) === null || _b === void 0 ? void 0 : _b.length;
|
|
164
|
+
getSelectedIDs: () => {
|
|
165
|
+
return selectedIDs || [];
|
|
166
166
|
},
|
|
167
167
|
getOffset: () => {
|
|
168
168
|
return this.getExporterOffset(paginationInfo);
|
|
169
169
|
},
|
|
170
170
|
getLimit: () => {
|
|
171
171
|
return this.getExporterLimit(paginationInfo);
|
|
172
|
+
},
|
|
173
|
+
getRecordID: () => {
|
|
174
|
+
var _a, _b, _c;
|
|
175
|
+
return (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
172
176
|
}
|
|
173
177
|
};
|
|
174
178
|
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ObjectUtils } from '@sankhyalabs/core';
|
|
2
|
+
import { DataFetcher } from '../../DataFetcher';
|
|
3
|
+
export default function getPersonalizedReports(requestBody) {
|
|
4
|
+
const serviceName = "DataExporterSPBean.getPersonalizedReports";
|
|
5
|
+
const payload = { serviceName, requestBody };
|
|
6
|
+
return new Promise((resolve, reject) => (DataFetcher.get()
|
|
7
|
+
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
|
8
|
+
.then(result => resolve(getFormatResponse(result)))
|
|
9
|
+
.catch(error => reject(error))));
|
|
10
|
+
}
|
|
11
|
+
function getFormatResponse(result) {
|
|
12
|
+
var _a;
|
|
13
|
+
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
|
14
|
+
if (response == undefined) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
return ObjectUtils.stringToObject(response);
|
|
18
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const REPORT_LAUNCHER_RESOURCE_ID = "br.com.sankhya.controls.ReportLauncher";
|
|
1
2
|
const KEY_PORT_EXPORT = "global.porta.app.impressao";
|
|
2
3
|
const VIEW_MODE = {
|
|
3
4
|
grid: {
|
|
@@ -97,4 +98,4 @@ const WEB_CONNECTION = {
|
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
|
|
100
|
-
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_PORT_EXPORT as K, ORDER_VALUES as O, TAGS_BY_TYPE as T, VIEW_MODE as V, WEB_CONNECTION as W, VARS_BY_TYPE as a, TAB_NAMES as b, KEY_EVENTS as c, TYPE_ACTIONS as d };
|
|
101
|
+
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_PORT_EXPORT as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, TAGS_BY_TYPE as T, VIEW_MODE as V, WEB_CONNECTION as W, VARS_BY_TYPE as a, TAB_NAMES as b, KEY_EVENTS as c, TYPE_ACTIONS as d };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
2
|
import { ObjectUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
|
+
import { K as KEY_PORT_EXPORT, W as WEB_CONNECTION, R as REPORT_LAUNCHER_RESOURCE_ID } from './constants.js';
|
|
4
5
|
import { D as DataFetcher } from './DataFetcher.js';
|
|
5
|
-
import { K as KEY_PORT_EXPORT, W as WEB_CONNECTION } from './constants.js';
|
|
6
6
|
import { d as defineCustomElement$1 } from './snk-exporter-email-sender2.js';
|
|
7
7
|
|
|
8
8
|
var PresentationMode;
|
|
@@ -195,11 +195,11 @@ function fetchDataExporter(_a) {
|
|
|
195
195
|
return new Promise((resolve, reject) => {
|
|
196
196
|
DataFetcher.get()
|
|
197
197
|
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
|
198
|
-
.then(result => resolve(getFormatResponse(result)))
|
|
198
|
+
.then(result => resolve(getFormatResponse$1(result)))
|
|
199
199
|
.catch(error => reject(error));
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
|
-
function getFormatResponse(result) {
|
|
202
|
+
function getFormatResponse$1(result) {
|
|
203
203
|
var _a;
|
|
204
204
|
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
|
205
205
|
if (response == undefined) {
|
|
@@ -232,14 +232,32 @@ function webConnection(fileSessionKey, canPrint, canExport) {
|
|
|
232
232
|
application.webConnection(keyPort, methodName, params);
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
function getPersonalizedReports(requestBody) {
|
|
236
|
+
const serviceName = "DataExporterSPBean.getPersonalizedReports";
|
|
237
|
+
const payload = { serviceName, requestBody };
|
|
238
|
+
return new Promise((resolve, reject) => (DataFetcher.get()
|
|
239
|
+
.callServiceBroker(serviceName, ObjectUtils.objectToString(payload))
|
|
240
|
+
.then(result => resolve(getFormatResponse(result)))
|
|
241
|
+
.catch(error => reject(error))));
|
|
242
|
+
}
|
|
243
|
+
function getFormatResponse(result) {
|
|
244
|
+
var _a;
|
|
245
|
+
const response = (_a = result === null || result === void 0 ? void 0 : result.json) === null || _a === void 0 ? void 0 : _a.$;
|
|
246
|
+
if (response == undefined) {
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
return ObjectUtils.stringToObject(response);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const snkDataExporterCss = ".sc-snk-data-exporter-h{--snk-data-exporter--z-index:var(--most-visible, 3);display:flex;width:fit-content;height:fit-content}.snk-data-exporter.sc-snk-data-exporter{display:flex;width:fit-content;height:fit-content}.snk-data-exporter--overlap.sc-snk-data-exporter{z-index:var(--snk-data-exporter--z-index)}.snk-data-exporter__dropdown.sc-snk-data-exporter{display:none}.snk-data-exporter__dropdown--show.sc-snk-data-exporter{display:flex;flex-direction:column;position:fixed}.snk-data-exporter__dropdown.sc-snk-data-exporter>ez-dropdown.sc-snk-data-exporter{position:relative}";
|
|
236
253
|
|
|
237
254
|
const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
238
255
|
constructor() {
|
|
239
256
|
super();
|
|
240
257
|
this.__registerHost();
|
|
241
|
-
this._items = [];
|
|
242
258
|
this._selectedNumber = 0;
|
|
259
|
+
this._customPrefix = "$custom$";
|
|
260
|
+
this._items = [];
|
|
243
261
|
this._showDropdown = false;
|
|
244
262
|
this._releasedToExport = [
|
|
245
263
|
DataExporterOption.EXPORT_TO_PDF,
|
|
@@ -288,11 +306,11 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
288
306
|
positionDropdown() {
|
|
289
307
|
var _a;
|
|
290
308
|
const bounding = (_a = this._ezButton) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
291
|
-
if (bounding == undefined || this.
|
|
309
|
+
if (bounding == undefined || this._dropdownParent == undefined) {
|
|
292
310
|
return;
|
|
293
311
|
}
|
|
294
|
-
this.
|
|
295
|
-
this.
|
|
312
|
+
this._dropdownParent.style.top = (bounding.y + bounding.height + 5) + "px";
|
|
313
|
+
this._dropdownParent.style.left = bounding.x + "px";
|
|
296
314
|
}
|
|
297
315
|
closeDropdown(evt) {
|
|
298
316
|
const target = evt === null || evt === void 0 ? void 0 : evt.target;
|
|
@@ -364,7 +382,13 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
364
382
|
});
|
|
365
383
|
}
|
|
366
384
|
async processExporter(evt) {
|
|
385
|
+
var _a;
|
|
367
386
|
const item = evt === null || evt === void 0 ? void 0 : evt.detail;
|
|
387
|
+
if ((_a = item === null || item === void 0 ? void 0 : item.id) === null || _a === void 0 ? void 0 : _a.includes(this._customPrefix)) {
|
|
388
|
+
this.openPersonalizedReports(item.id);
|
|
389
|
+
this._showDropdown = false;
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
368
392
|
if (!this._releasedToExport.includes(item === null || item === void 0 ? void 0 : item.id)) {
|
|
369
393
|
return;
|
|
370
394
|
}
|
|
@@ -376,26 +400,70 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
376
400
|
}
|
|
377
401
|
this._showDropdown = false;
|
|
378
402
|
}
|
|
379
|
-
|
|
403
|
+
loadItems() {
|
|
380
404
|
const items = [];
|
|
381
405
|
this._releasedToExport
|
|
382
406
|
.forEach((option) => {
|
|
383
407
|
var _a;
|
|
384
408
|
(_a = this._itemBuilder) === null || _a === void 0 ? void 0 : _a.setExportOption(option, items);
|
|
385
409
|
});
|
|
386
|
-
|
|
410
|
+
this.loadPersonalizedItems(items);
|
|
387
411
|
}
|
|
388
|
-
|
|
412
|
+
async loadPersonalizedItems(items) {
|
|
389
413
|
var _a;
|
|
390
|
-
|
|
414
|
+
const recordID = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getRecordID();
|
|
415
|
+
if (recordID == undefined) {
|
|
416
|
+
this._items = items;
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
const personalizedReports = await getPersonalizedReports({ recordID });
|
|
420
|
+
personalizedReports === null || personalizedReports === void 0 ? void 0 : personalizedReports.forEach((item) => {
|
|
421
|
+
items.push({
|
|
422
|
+
id: `${this._customPrefix}_${item.ID}`,
|
|
423
|
+
label: item.label,
|
|
424
|
+
group: this.getMessage("snkDataExporter.group.custom")
|
|
425
|
+
});
|
|
426
|
+
});
|
|
427
|
+
this._items = items;
|
|
428
|
+
}
|
|
429
|
+
openPersonalizedReports(option) {
|
|
430
|
+
var _a;
|
|
431
|
+
const pkObject = [];
|
|
432
|
+
const appId = (option === null || option === void 0 ? void 0 : option.replace(this._customPrefix, "")) || "";
|
|
433
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs().forEach(({ name, type, value }, index) => {
|
|
434
|
+
const dataFields = [];
|
|
435
|
+
const fields = [];
|
|
436
|
+
fields['fields'] = [];
|
|
437
|
+
// Se for o primeiro elemento, adiciona essa primeira PK
|
|
438
|
+
if (index === 0) {
|
|
439
|
+
pkObject[`PK_${name}`] = { type, value };
|
|
440
|
+
pkObject['pks'] = [];
|
|
441
|
+
}
|
|
442
|
+
dataFields.push({ nome: name, tipo: type, valor: value });
|
|
443
|
+
fields['fields'].push(dataFields);
|
|
444
|
+
pkObject['pks'].push(fields);
|
|
445
|
+
});
|
|
446
|
+
this._application.openApp(`${REPORT_LAUNCHER_RESOURCE_ID}${appId}`, pkObject);
|
|
447
|
+
}
|
|
448
|
+
loadDropdown() {
|
|
449
|
+
var _a, _b;
|
|
450
|
+
this._selectedNumber = ((_b = (_a = this.provider) === null || _a === void 0 ? void 0 : _a.getSelectedIDs()) === null || _b === void 0 ? void 0 : _b.length) || 0;
|
|
391
451
|
this._itemBuilder = new ItemBuilder(this.getMessage.bind(this), this._selectedNumber);
|
|
392
|
-
this.
|
|
452
|
+
this.loadItems();
|
|
453
|
+
}
|
|
454
|
+
getElementID(sufix) {
|
|
455
|
+
return {
|
|
456
|
+
[ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME]: ElementIDUtils.getInternalIDInfo(sufix)
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
canShowDropdown() {
|
|
460
|
+
var _a;
|
|
461
|
+
return this._showDropdown && ((_a = this._items) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
393
462
|
}
|
|
394
463
|
componentWillLoad() {
|
|
395
464
|
var _a;
|
|
396
465
|
this._application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
397
466
|
(_a = this._application) === null || _a === void 0 ? void 0 : _a.getAppLabel().then(result => this._appLabel = result);
|
|
398
|
-
this.loadDropdown();
|
|
399
467
|
this.setEvents();
|
|
400
468
|
}
|
|
401
469
|
componentDidLoad() {
|
|
@@ -406,25 +474,34 @@ const SnkDataExporter = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
406
474
|
this.positionDropdown();
|
|
407
475
|
}
|
|
408
476
|
componentWillUpdate() {
|
|
409
|
-
|
|
477
|
+
var _a;
|
|
478
|
+
if (this._showDropdown && !((_a = this._items) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
410
479
|
this.loadDropdown();
|
|
411
480
|
}
|
|
412
481
|
}
|
|
413
482
|
componentDidUpdate() {
|
|
483
|
+
var _a;
|
|
414
484
|
if (this._showDropdown) {
|
|
415
485
|
this.positionDropdown();
|
|
416
486
|
}
|
|
487
|
+
else if (((_a = this._items) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
488
|
+
this._items = [];
|
|
489
|
+
}
|
|
417
490
|
}
|
|
418
491
|
render() {
|
|
419
492
|
return (h(Host, null, h("div", { class: `snk-data-exporter
|
|
420
|
-
${this.
|
|
421
|
-
` }, h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", size: "small", mode: "icon", title: this.getMessage("snkDataExporter.group.export.title"), onClick: () => this.controlDropdown() },
|
|
422
|
-
|
|
493
|
+
${this.canShowDropdown() ? " snk-data-exporter--overlap" : ""}
|
|
494
|
+
` }, h("ez-button", Object.assign({ ref: (ref) => this._ezButton = ref, iconName: "file-download", size: "small", mode: "icon", title: this.getMessage("snkDataExporter.group.export.title"), onClick: () => this.controlDropdown() }, this.getElementID("button"))), h("div", Object.assign({ ref: (ref) => this._dropdownParent = ref, class: `snk-data-exporter__dropdown
|
|
495
|
+
${this.canShowDropdown() ? "snk-data-exporter__dropdown--show" : ""}
|
|
496
|
+
` }, this.getElementID("dropdown")), this.canShowDropdown() &&
|
|
497
|
+
h("ez-dropdown", Object.assign({ items: this._items, onEzClick: (evt) => this.processExporter(evt) }, this.getElementID("dropdown"))))), this.canShowDropdown() &&
|
|
498
|
+
h("div", Object.assign({ class: "ez-scrim ez-scrim--light" }, this.getElementID("ezScrim"))), h("snk-exporter-email-sender", Object.assign({ ref: ref => this._snkEmailSender = ref, getMessage: (key, params) => this.getMessage(key, params) }, this.getElementID("snkExporterEmailSender")))));
|
|
423
499
|
}
|
|
424
500
|
get _element() { return this; }
|
|
425
501
|
static get style() { return snkDataExporterCss; }
|
|
426
502
|
}, [2, "snk-data-exporter", {
|
|
427
503
|
"provider": [16],
|
|
504
|
+
"_items": [32],
|
|
428
505
|
"_showDropdown": [32],
|
|
429
506
|
"_releasedToExport": [32]
|
|
430
507
|
}]);
|
|
@@ -98,6 +98,29 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Método que retorna a lista de IDs dos registros selecionados.
|
|
103
|
+
* @returns Retorna a lista de IDs dos registros selecionados.
|
|
104
|
+
*/
|
|
105
|
+
async getSelectedRecordsIDsInfo() {
|
|
106
|
+
var _a;
|
|
107
|
+
const selectedRecordsIDsInfo = [];
|
|
108
|
+
const selectedRecords = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecords();
|
|
109
|
+
if ((selectedRecords === null || selectedRecords === void 0 ? void 0 : selectedRecords.length) > 0) {
|
|
110
|
+
selectedRecords.forEach(({ __record__id__ }) => {
|
|
111
|
+
const revertBase64ToObject = JSON.parse(window.atob(__record__id__));
|
|
112
|
+
Object.entries(revertBase64ToObject).forEach(([name, value]) => {
|
|
113
|
+
var _a;
|
|
114
|
+
const metadataField = (_a = this.dataUnit) === null || _a === void 0 ? void 0 : _a.getField(name);
|
|
115
|
+
if (metadataField == undefined) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
selectedRecordsIDsInfo.push(Object.assign({ name, type: metadataField.dataType }, value));
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return selectedRecordsIDsInfo;
|
|
123
|
+
}
|
|
101
124
|
async interceptAction(action) {
|
|
102
125
|
return new Promise(resolve => {
|
|
103
126
|
switch (action.type) {
|
|
@@ -315,7 +338,8 @@ const SnkDataUnit$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
315
338
|
"dataUnit": [1040],
|
|
316
339
|
"beforeSave": [16],
|
|
317
340
|
"afterSave": [16],
|
|
318
|
-
"getDataUnit": [64]
|
|
341
|
+
"getDataUnit": [64],
|
|
342
|
+
"getSelectedRecordsIDsInfo": [64]
|
|
319
343
|
}]);
|
|
320
344
|
function defineCustomElement$1() {
|
|
321
345
|
if (typeof customElements === "undefined") {
|
|
@@ -155,10 +155,11 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
155
155
|
return limit;
|
|
156
156
|
}
|
|
157
157
|
async dataExporterProviderStore() {
|
|
158
|
-
var _a;
|
|
158
|
+
var _a, _b;
|
|
159
159
|
const paginationInfo = this.getPaginationInfo();
|
|
160
160
|
const columnsMetadata = [];
|
|
161
|
-
await ((_a = this.
|
|
161
|
+
const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
|
|
162
|
+
await ((_b = this._grid) === null || _b === void 0 ? void 0 : _b.getColumnsState().then(this.buildColumnsMetadata.bind(this, columnsMetadata)));
|
|
162
163
|
const dataExporterProvider = {
|
|
163
164
|
getFilters: () => {
|
|
164
165
|
var _a;
|
|
@@ -175,15 +176,18 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
175
176
|
var _a;
|
|
176
177
|
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
|
177
178
|
},
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) === null || _b === void 0 ? void 0 : _b.length;
|
|
179
|
+
getSelectedIDs: () => {
|
|
180
|
+
return selectedIDs || [];
|
|
181
181
|
},
|
|
182
182
|
getOffset: () => {
|
|
183
183
|
return this.getExporterOffset(paginationInfo);
|
|
184
184
|
},
|
|
185
185
|
getLimit: () => {
|
|
186
186
|
return this.getExporterLimit(paginationInfo);
|
|
187
|
+
},
|
|
188
|
+
getRecordID: () => {
|
|
189
|
+
var _a, _b, _c;
|
|
190
|
+
return (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
187
191
|
}
|
|
188
192
|
};
|
|
189
193
|
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const REPORT_LAUNCHER_RESOURCE_ID = "br.com.sankhya.controls.ReportLauncher";
|
|
1
2
|
const KEY_PORT_EXPORT = "global.porta.app.impressao";
|
|
2
3
|
const VIEW_MODE = {
|
|
3
4
|
grid: {
|
|
@@ -97,4 +98,4 @@ const WEB_CONNECTION = {
|
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
|
|
100
|
-
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, TAB_NAMES as T, VARS_BY_TYPE as V, WEB_CONNECTION as W, TAGS_BY_TYPE as a, TYPE_ACTIONS as b, VIEW_MODE as c, KEY_PORT_EXPORT as d };
|
|
101
|
+
export { ACTION_CONFIG as A, CONFIG_EVENTS as C, DEFAULT_TYPE as D, KEY_EVENTS as K, ORDER_VALUES as O, REPORT_LAUNCHER_RESOURCE_ID as R, TAB_NAMES as T, VARS_BY_TYPE as V, WEB_CONNECTION as W, TAGS_BY_TYPE as a, TYPE_ACTIONS as b, VIEW_MODE as c, KEY_PORT_EXPORT as d };
|
package/dist/esm/loader.js
CHANGED
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
13
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
16
|
+
return bootstrapLazy([["teste-pesquisa",[[1,"teste-pesquisa"]]],["snk-data-unit",[[2,"snk-data-unit",{"dataState":[1040],"dataUnitName":[1,"data-unit-name"],"entityName":[1,"entity-name"],"pageSize":[2,"page-size"],"dataUnit":[1040],"beforeSave":[16],"afterSave":[16],"getDataUnit":[64],"getSelectedRecordsIDsInfo":[64]}]]],["snk-filter-binary-select",[[0,"snk-filter-binary-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-multi-select",[[0,"snk-filter-multi-select",{"value":[1544],"config":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-number",[[0,"snk-filter-number",{"config":[16],"value":[2],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-period",[[0,"snk-filter-period",{"config":[16],"value":[8],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-personalized",[[0,"snk-filter-personalized",{"config":[16],"value":[1040],"fix":[16],"unfix":[16],"show":[64]}]]],["snk-filter-search",[[0,"snk-filter-search",{"config":[16],"value":[16],"show":[64]},[[0,"ezChange","ezChangeListener"]]]]],["snk-filter-text",[[0,"snk-filter-text",{"config":[16],"value":[1]},[[0,"ezChange","ezChangeListener"]]]]],["snk-pesquisa",[[2,"snk-pesquisa",{"searchLoader":[16],"selectItem":[16],"argument":[1025],"_itemList":[32],"_startLoading":[32]}]]],["snk-config-options",[[2,"snk-config-options",{"fieldConfig":[16],"idConfig":[513,"id-config"],"dataUnit":[16],"_defaultType":[32]}]]],["snk-tab-config",[[6,"snk-tab-config",{"selectedIndex":[1538,"selected-index"],"selectedTab":[1537,"selected-tab"],"tabs":[1],"_processedTabs":[32],"_activeEditText":[32],"_activeEditTextIndex":[32],"_actionsHide":[32],"_actionsShow":[32]}]]],["snk-filter-detail",[[0,"snk-filter-detail",{"config":[1040],"getMessage":[16],"show":[64]}]]],["snk-configurator_3",[[6,"snk-grid",{"configName":[1,"config-name"],"actionsList":[16],"taskbarManager":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_gridConfig":[32],"_popUpGridConfig":[32],"showConfig":[64],"hideConfig":[64],"setConfig":[64]}],[2,"snk-configurator",{"configName":[1,"config-name"],"viewMode":[1,"view-mode"],"_opened":[32],"_permissions":[32],"open":[64],"close":[64]}],[2,"snk-field-config",{"isConfigActive":[16],"fieldConfig":[16],"modeInsertion":[516,"mode-insertion"],"dataUnit":[16]}]]],["snk-form-config",[[2,"snk-form-config",{"dataUnit":[16],"formConfig":[16],"configName":[513,"config-name"],"_formConfigOptions":[32],"_fieldConfigSelected":[32],"_layoutFormConfig":[32],"_fieldsAvailable":[32],"_formConfig":[32],"_formConfigChanged":[32],"_optionFormConfigSelected":[32],"_optionFormConfigChanged":[32],"_tempGroups":[32]}]]],["snk-exporter-email-sender",[[0,"snk-exporter-email-sender",{"getMessage":[16],"_config":[32],"_opened":[32],"_currentStep":[32],"open":[64],"close":[64]}]]],["snk-data-exporter_8",[[2,"snk-filter-bar",{"dataUnit":[1040],"configName":[1,"config-name"],"filterConfig":[1040],"allowDefault":[32],"scrollerLocked":[32]},[[0,"filterChange","filterChangeListener"]]],[2,"snk-grid-config",{"selectedIndex":[1026,"selected-index"],"application":[16],"columns":[1040],"config":[1040],"saveConfig":[64]}],[6,"snk-taskbar",{"configName":[1,"config-name"],"buttons":[1],"customButtons":[16],"actionsList":[16],"primaryButton":[1,"primary-button"],"disabledButtons":[16],"dataUnit":[16],"presentationMode":[1537,"presentation-mode"],"_permissions":[32]}],[0,"snk-filter-item",{"config":[1040],"getMessage":[16],"detailIsVisible":[32],"showUp":[64],"hideDetail":[64]},[[2,"click","clickListener"],[2,"mousedown","mouseDownListener"],[0,"filterChange","filterChangeListener"]]],[4,"snk-filter-list",{"label":[1],"iconName":[1,"icon-name"],"items":[16],"getMessage":[16],"emptyText":[1,"empty-text"],"findFilterText":[1,"find-filter-text"],"buttonClass":[1,"button-class"],"_filterArgument":[32],"_showAll":[32],"hideDetail":[64]},[[2,"keydown","keyDownHandler"]]],[0,"snk-filter-modal",{"getMessage":[16],"items":[1040],"modalTitle":[1,"modal-title"],"modalSubTitle":[1,"modal-sub-title"],"cancelButtonLabel":[1,"cancel-button-label"],"okButtonLabel":[1,"ok-button-label"],"infoText":[1,"info-text"],"useSearch":[4,"use-search"],"processModalAction":[16],"_filterArgument":[32]}],[1,"snk-select-box",{"selectedOption":[1,"selected-option"]}],[2,"snk-data-exporter",{"provider":[16],"_items":[32],"_showDropdown":[32],"_releasedToExport":[32]}]]],["snk-form",[[2,"snk-form",{"configName":[1,"config-name"],"recordsValidator":[16],"actionsList":[16],"taskbarManager":[16],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_editionFormConfig":[32],"_insertionFormConfig":[32],"_showFormConfig":[32],"showConfig":[64],"hideConfig":[64]}]]],["snk-crud",[[6,"snk-crud",{"configName":[1025,"config-name"],"actionsList":[16],"taskbarManager":[16],"recordsValidator":[16],"statusResolver":[16],"multipleSelection":[4,"multiple-selection"],"presentationMode":[1,"presentation-mode"],"_dataUnit":[32],"_dataState":[32],"_viewMode":[32],"goToView":[64]}]]],["snk-application",[[2,"snk-application",{"messagesBuilder":[1040],"configName":[1,"config-name"],"isUserSup":[64],"hasAccess":[64],"getAllAccess":[64],"getStringParam":[64],"getIntParam":[64],"getFloatParam":[64],"getBooleanParam":[64],"getDateParam":[64],"showPopUp":[64],"showModal":[64],"closeModal":[64],"closePopUp":[64],"temOpcional":[64],"getConfig":[64],"saveConfig":[64],"getAttributeFromHTMLWrapper":[64],"openApp":[64],"webConnection":[64],"createDataunit":[64],"getDataUnit":[64],"getResourceID":[64],"getUserID":[64],"alert":[64],"error":[64],"success":[64],"message":[64],"confirm":[64],"info":[64],"loadFormConfig":[64],"loadGridConfig":[64],"fetchUserAvailableConfigs":[64],"fetchLegacyConfig":[64],"fetchDefaultConfig":[64],"loadTotals":[64],"saveGridConfig":[64],"getFilterBarConfig":[64],"saveFilterBarConfig":[64],"saveFormConfig":[64],"getDefaultValues":[64],"getDefaultValue":[64],"executeSearch":[64],"executePreparedSearch":[64],"isDebugMode":[64],"getAppLabel":[64]}]]]], options);
|
|
17
17
|
});
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement
|
|
|
2
2
|
import { UserInterface, ObjectUtils, StringUtils, ApplicationContext, ElementIDUtils } from '@sankhyalabs/core';
|
|
3
3
|
import { DataType, getConvertedValue } from '@sankhyalabs/core/dist/dataunit/metadata/DataType';
|
|
4
4
|
import { CheckMode } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
5
|
-
import { V as VARS_BY_TYPE, D as DEFAULT_TYPE, a as TAGS_BY_TYPE } from './constants-
|
|
5
|
+
import { V as VARS_BY_TYPE, D as DEFAULT_TYPE, a as TAGS_BY_TYPE } from './constants-965d7a7f.js';
|
|
6
6
|
|
|
7
7
|
const snkConfigOptionsCss = ".sc-snk-config-options-h{--snk-config-options--border:2px solid var(--color--secondary-200, #D2D3DA);width:100%;border-radius:15px;border:var(--snk-config-options--border)}.config-options__switch-row.sc-snk-config-options{margin-top:-30px}";
|
|
8
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-a77b6f35.js';
|
|
2
2
|
import { ApplicationContext, ElementIDUtils, DataType } from '@sankhyalabs/core';
|
|
3
|
-
import { c as VIEW_MODE, A as ACTION_CONFIG } from './constants-
|
|
3
|
+
import { c as VIEW_MODE, A as ACTION_CONFIG } from './constants-965d7a7f.js';
|
|
4
4
|
import { A as AuthorizationConfig } from './AuthorizationConfig-dcbd207a.js';
|
|
5
5
|
import { UserInterface } from '@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata';
|
|
6
6
|
import { C as ConfigStorage } from './ConfigStorage-4654f57b.js';
|
|
@@ -294,10 +294,11 @@ const SnkGrid = class {
|
|
|
294
294
|
return limit;
|
|
295
295
|
}
|
|
296
296
|
async dataExporterProviderStore() {
|
|
297
|
-
var _a;
|
|
297
|
+
var _a, _b;
|
|
298
298
|
const paginationInfo = this.getPaginationInfo();
|
|
299
299
|
const columnsMetadata = [];
|
|
300
|
-
await ((_a = this.
|
|
300
|
+
const selectedIDs = await ((_a = this._snkDataUnit) === null || _a === void 0 ? void 0 : _a.getSelectedRecordsIDsInfo());
|
|
301
|
+
await ((_b = this._grid) === null || _b === void 0 ? void 0 : _b.getColumnsState().then(this.buildColumnsMetadata.bind(this, columnsMetadata)));
|
|
301
302
|
const dataExporterProvider = {
|
|
302
303
|
getFilters: () => {
|
|
303
304
|
var _a;
|
|
@@ -314,15 +315,18 @@ const SnkGrid = class {
|
|
|
314
315
|
var _a;
|
|
315
316
|
return (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.name;
|
|
316
317
|
},
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
return (_b = (_a = this._dataState) === null || _a === void 0 ? void 0 : _a.selectedRecords) === null || _b === void 0 ? void 0 : _b.length;
|
|
318
|
+
getSelectedIDs: () => {
|
|
319
|
+
return selectedIDs || [];
|
|
320
320
|
},
|
|
321
321
|
getOffset: () => {
|
|
322
322
|
return this.getExporterOffset(paginationInfo);
|
|
323
323
|
},
|
|
324
324
|
getLimit: () => {
|
|
325
325
|
return this.getExporterLimit(paginationInfo);
|
|
326
|
+
},
|
|
327
|
+
getRecordID: () => {
|
|
328
|
+
var _a, _b, _c;
|
|
329
|
+
return (_c = (_b = (_a = this._dataUnit) === null || _a === void 0 ? void 0 : _a.records) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.__record__id__;
|
|
326
330
|
}
|
|
327
331
|
};
|
|
328
332
|
store.set("exporterProviders", Object.assign(Object.assign({}, store.get("exporterProviders")), { [this.configName]: dataExporterProvider }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, g as getElement } from './index-a77b6f35.js';
|
|
2
2
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
|
-
import { c as VIEW_MODE } from './constants-
|
|
3
|
+
import { c as VIEW_MODE } from './constants-965d7a7f.js';
|
|
4
4
|
import { T as TaskbarElement } from './taskbar-elements-9b0a87f1.js';
|
|
5
5
|
import { P as PresentationMode } from './index-1564817d.js';
|
|
6
6
|
import './index-d89e384f.js';
|