@sankhyalabs/sankhyablocks 8.2.0-dev.5 → 8.2.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{ConfigStorage-12397f18.js → ConfigStorage-349cf0fd.js} +2 -2
- package/dist/cjs/{DataFetcher-f2da1f79.js → DataFetcher-7ba52c1d.js} +12 -206
- package/dist/cjs/PrintUtils-bcaeb82f.js +215 -0
- package/dist/cjs/{SnkFormConfigManager-13f79e37.js → SnkFormConfigManager-9083c12f.js} +2 -2
- package/dist/cjs/{auth-fetcher-319a4cb2.js → auth-fetcher-718ca8b4.js} +1 -1
- package/dist/cjs/{dataunit-fetcher-e72068c1.js → dataunit-fetcher-076fcbf7.js} +1 -1
- package/dist/cjs/{form-config-fetcher-5d62ab62.js → form-config-fetcher-c7ec4ff9.js} +1 -1
- package/dist/cjs/index-f9e81701.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pesquisa-fetcher-8c363096.js → pesquisa-fetcher-a9c5a2f5.js} +1 -1
- package/dist/cjs/sankhyablocks.cjs.js +1 -1
- package/dist/cjs/snk-actions-button.cjs.entry.js +4 -3
- package/dist/cjs/snk-application.cjs.entry.js +17 -6
- package/dist/cjs/snk-attach.cjs.entry.js +4 -3
- package/dist/cjs/snk-crud.cjs.entry.js +8 -6
- package/dist/cjs/snk-data-exporter.cjs.entry.js +2 -1
- package/dist/cjs/snk-detail-view.cjs.entry.js +10 -8
- package/dist/cjs/snk-filter-bar.cjs.entry.js +4 -3
- package/dist/cjs/snk-filter-modal-item.cjs.entry.js +4 -3
- package/dist/cjs/snk-form-config.cjs.entry.js +3 -2
- package/dist/cjs/snk-form.cjs.entry.js +5 -4
- package/dist/cjs/snk-grid-config.cjs.entry.js +4 -3
- package/dist/cjs/snk-grid.cjs.entry.js +9 -5
- package/dist/cjs/{snk-guides-viewer-a7cd6fda.js → snk-guides-viewer-18e9666c.js} +8 -7
- package/dist/cjs/snk-guides-viewer.cjs.entry.js +8 -7
- package/dist/cjs/snk-personalized-filter.cjs.entry.js +4 -3
- package/dist/cjs/snk-print-selector.cjs.entry.js +2 -4
- package/dist/cjs/snk-simple-crud.cjs.entry.js +6 -5
- package/dist/cjs/snk-taskbar-custom-elements.cjs.entry.js +20 -0
- package/dist/cjs/snk-taskbar.cjs.entry.js +69 -4
- package/dist/cjs/{taskbar-elements-b98dd6e9.js → taskbar-elements-39949c7a.js} +4 -4
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/snk-application/snk-application.js +60 -0
- package/dist/collection/components/snk-crud/snk-crud.js +6 -4
- package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +19 -1
- package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +20 -2
- package/dist/collection/components/snk-grid/snk-grid.js +57 -1
- package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +1 -1
- package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +4 -4
- package/dist/collection/components/snk-taskbar/snk-taskbar-custom-elements.js +43 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.css +4 -0
- package/dist/collection/components/snk-taskbar/snk-taskbar.js +107 -4
- package/dist/collection/lib/http/data-fetcher/DataFetcher.js +10 -4
- package/dist/collection/lib/utils/PrintUtils.js +18 -9
- package/dist/components/DataFetcher.js +13 -206
- package/dist/components/PrintUtils.js +213 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/snk-application2.js +11 -1
- package/dist/components/snk-crud.js +5 -3
- package/dist/components/snk-detail-view2.js +9 -5
- package/dist/components/snk-grid2.js +7 -1
- package/dist/components/snk-print-selector.js +1 -1
- package/dist/components/snk-simple-crud2.js +1 -1
- package/dist/components/snk-taskbar-custom-elements.d.ts +11 -0
- package/dist/components/snk-taskbar-custom-elements.js +35 -0
- package/dist/components/snk-taskbar2.js +78 -8
- package/dist/esm/{ConfigStorage-932ab366.js → ConfigStorage-8d420626.js} +2 -2
- package/dist/esm/{DataFetcher-7e18aa30.js → DataFetcher-e97b3942.js} +13 -206
- package/dist/esm/PrintUtils-3e4ff0f5.js +213 -0
- package/dist/esm/{SnkFormConfigManager-bb9afc3f.js → SnkFormConfigManager-4c6a5b41.js} +2 -2
- package/dist/esm/{auth-fetcher-6d9664b7.js → auth-fetcher-55e5cbce.js} +1 -1
- package/dist/esm/{dataunit-fetcher-91a4eb82.js → dataunit-fetcher-716a99ca.js} +1 -1
- package/dist/esm/{form-config-fetcher-aaaa79a6.js → form-config-fetcher-b69da2f1.js} +1 -1
- package/dist/esm/index-a7d3d3f1.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pesquisa-fetcher-56b30fb4.js → pesquisa-fetcher-c9a53822.js} +1 -1
- package/dist/esm/sankhyablocks.js +1 -1
- package/dist/esm/snk-actions-button.entry.js +4 -3
- package/dist/esm/snk-application.entry.js +17 -6
- package/dist/esm/snk-attach.entry.js +4 -3
- package/dist/esm/snk-crud.entry.js +10 -8
- package/dist/esm/snk-data-exporter.entry.js +2 -1
- package/dist/esm/snk-detail-view.entry.js +10 -8
- package/dist/esm/snk-filter-bar.entry.js +4 -3
- package/dist/esm/snk-filter-modal-item.entry.js +4 -3
- package/dist/esm/snk-form-config.entry.js +3 -2
- package/dist/esm/snk-form.entry.js +5 -4
- package/dist/esm/snk-grid-config.entry.js +4 -3
- package/dist/esm/snk-grid.entry.js +9 -5
- package/dist/esm/{snk-guides-viewer-cc709b5f.js → snk-guides-viewer-2e97c0c3.js} +8 -7
- package/dist/esm/snk-guides-viewer.entry.js +8 -7
- package/dist/esm/snk-personalized-filter.entry.js +4 -3
- package/dist/esm/snk-print-selector.entry.js +1 -3
- package/dist/esm/snk-simple-crud.entry.js +6 -5
- package/dist/esm/snk-taskbar-custom-elements.entry.js +16 -0
- package/dist/esm/snk-taskbar.entry.js +69 -4
- package/dist/esm/{taskbar-elements-2c761819.js → taskbar-elements-0a6b8b95.js} +4 -4
- package/dist/sankhyablocks/p-0b19beb9.entry.js +1 -0
- package/dist/sankhyablocks/p-110136be.entry.js +1 -0
- package/dist/sankhyablocks/p-12e48665.entry.js +1 -0
- package/dist/sankhyablocks/p-236cd346.js +1 -0
- package/dist/sankhyablocks/p-34604220.entry.js +1 -0
- package/dist/sankhyablocks/{p-ed41b38c.js → p-41f81c72.js} +1 -1
- package/dist/sankhyablocks/p-4e701fa7.js +1 -0
- package/dist/sankhyablocks/{p-41e897f1.js → p-615874db.js} +1 -1
- package/dist/sankhyablocks/p-648a7c72.entry.js +1 -0
- package/dist/sankhyablocks/p-72fc257b.entry.js +1 -0
- package/dist/sankhyablocks/p-7453735e.entry.js +1 -0
- package/dist/sankhyablocks/p-776514a8.entry.js +11 -0
- package/dist/sankhyablocks/{p-a52a6c9d.js → p-81392ced.js} +1 -1
- package/dist/sankhyablocks/p-8d884fab.js +1 -0
- package/dist/sankhyablocks/p-a2854b5a.entry.js +1 -0
- package/dist/sankhyablocks/p-c149dca8.entry.js +1 -0
- package/dist/sankhyablocks/p-c303d74f.entry.js +1 -0
- package/dist/sankhyablocks/p-c51a4f28.entry.js +1 -0
- package/dist/sankhyablocks/{p-a2493d11.js → p-c9841939.js} +1 -1
- package/dist/sankhyablocks/p-ce6d7e3f.js +1 -0
- package/dist/sankhyablocks/p-cee68227.entry.js +1 -0
- package/dist/sankhyablocks/{p-2d333d22.js → p-e696a8f6.js} +1 -1
- package/dist/sankhyablocks/p-e6c00493.entry.js +1 -0
- package/dist/sankhyablocks/p-ecbb878e.entry.js +1 -0
- package/dist/sankhyablocks/{p-14eac6fe.js → p-f390386d.js} +1 -1
- package/dist/sankhyablocks/p-fbb4597a.entry.js +1 -0
- package/dist/sankhyablocks/p-ff2f2152.entry.js +1 -0
- package/dist/sankhyablocks/p-ff8778e6.entry.js +1 -0
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/components/snk-application/snk-application.d.ts +1 -9
- package/dist/types/components/snk-crud/snk-crud.d.ts +1 -0
- package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +4 -0
- package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +4 -0
- package/dist/types/components/snk-grid/snk-grid.d.ts +12 -0
- package/dist/types/components/snk-taskbar/processor/taskbar-processor.d.ts +2 -2
- package/dist/types/components/snk-taskbar/snk-taskbar-custom-elements.d.ts +7 -0
- package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +23 -0
- package/dist/types/components.d.ts +78 -1
- package/dist/types/lib/utils/PrintUtils.d.ts +1 -0
- package/package.json +1 -1
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/sankhyablocks/p-01739b21.entry.js +0 -1
- package/dist/sankhyablocks/p-02b89228.entry.js +0 -1
- package/dist/sankhyablocks/p-03bb1aea.entry.js +0 -1
- package/dist/sankhyablocks/p-05dbc70e.entry.js +0 -1
- package/dist/sankhyablocks/p-611aa624.entry.js +0 -1
- package/dist/sankhyablocks/p-66bb8c20.entry.js +0 -1
- package/dist/sankhyablocks/p-6f154396.entry.js +0 -1
- package/dist/sankhyablocks/p-787071a8.js +0 -1
- package/dist/sankhyablocks/p-8818d8f6.entry.js +0 -1
- package/dist/sankhyablocks/p-93f6ca04.entry.js +0 -1
- package/dist/sankhyablocks/p-951e98c9.entry.js +0 -1
- package/dist/sankhyablocks/p-b6003974.entry.js +0 -1
- package/dist/sankhyablocks/p-cfb33a4a.entry.js +0 -1
- package/dist/sankhyablocks/p-d53a9169.entry.js +0 -1
- package/dist/sankhyablocks/p-d7638f45.entry.js +0 -11
- package/dist/sankhyablocks/p-e64f3e17.entry.js +0 -1
- package/dist/sankhyablocks/p-efc10705.entry.js +0 -1
- package/dist/sankhyablocks/p-f74fe358.js +0 -1
- package/dist/sankhyablocks/p-f8e6b97e.js +0 -1
- package/dist/sankhyablocks/p-fa523d6b.entry.js +0 -1
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { ApplicationContext, StringUtils } from '@sankhyalabs/core';
|
|
2
|
+
|
|
3
|
+
class PrintUtils {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.appletImpressao = new AppletImpressao();
|
|
6
|
+
const application = ApplicationContext.getContextValue("__SNK__APPLICATION__");
|
|
7
|
+
application.getDataFetcher().then(result => this.DataFetcher = result);
|
|
8
|
+
}
|
|
9
|
+
static getInstance() {
|
|
10
|
+
if (!PrintUtils.instance) {
|
|
11
|
+
PrintUtils.instance = new PrintUtils();
|
|
12
|
+
}
|
|
13
|
+
return PrintUtils.instance;
|
|
14
|
+
}
|
|
15
|
+
async processPendingPrinting(transactionId) {
|
|
16
|
+
await this.findPendingPrints(transactionId);
|
|
17
|
+
}
|
|
18
|
+
async findPendingPrints(transactionId) {
|
|
19
|
+
const requestBody = {
|
|
20
|
+
transactionIds: [
|
|
21
|
+
{
|
|
22
|
+
transactionId: {
|
|
23
|
+
$: transactionId
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
Promise.resolve(this.DataFetcher).then(async (res) => {
|
|
29
|
+
res = await Promise.resolve(this.DataFetcher);
|
|
30
|
+
while (!res || !res.application) {
|
|
31
|
+
res = await Promise.resolve(this.DataFetcher);
|
|
32
|
+
}
|
|
33
|
+
const response = await res.application.callServiceBroker(PrintUtils.SERVICE_FIND_PENDING_PRINTS, JSON.stringify(requestBody));
|
|
34
|
+
const printJobData = this.parsePrintData(response);
|
|
35
|
+
const pendingPrints = await this.processDirectPrint(printJobData);
|
|
36
|
+
if (!pendingPrints.length)
|
|
37
|
+
return;
|
|
38
|
+
this.openSnkPrintSelector(Object.assign(Object.assign({}, printJobData), { pendingPrinters: pendingPrints }));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
getLocalPrinters() {
|
|
42
|
+
const localPrinters = this.appletImpressao.findLocalPrinters();
|
|
43
|
+
const printers = [];
|
|
44
|
+
for (const printerName of localPrinters) {
|
|
45
|
+
printers.push({
|
|
46
|
+
nome: printerName,
|
|
47
|
+
printerUri: PrintUtils.LOCAL_SERVER_URI + printerName,
|
|
48
|
+
isLocal: true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return printers;
|
|
52
|
+
}
|
|
53
|
+
parsePrintData(payload) {
|
|
54
|
+
const pendingPrintJobData = payload.pendindPrintJobData;
|
|
55
|
+
if (!pendingPrintJobData)
|
|
56
|
+
return undefined;
|
|
57
|
+
let { printServers: { printServer }, pendingPrinters: { pendingPrinter } } = pendingPrintJobData;
|
|
58
|
+
printServer = printServer ? (Array.isArray(printServer) ? printServer : [printServer]) : [];
|
|
59
|
+
pendingPrinter = pendingPrinter ? (Array.isArray(pendingPrinter) ? pendingPrinter : [pendingPrinter]) : [];
|
|
60
|
+
const normalizedPrintServer = printServer.map(item => {
|
|
61
|
+
const printerList = Array.isArray(item.printerLocation) ? item.printerLocation : [item.printerLocation];
|
|
62
|
+
return {
|
|
63
|
+
printServerUri: item.printServerUri,
|
|
64
|
+
printerList: printerList.map(this.normalize)
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
const normalizedPendingPrinter = pendingPrinter.map(this.normalize);
|
|
68
|
+
return {
|
|
69
|
+
transactionId: pendingPrintJobData.transactionId.$,
|
|
70
|
+
printServers: normalizedPrintServer,
|
|
71
|
+
pendingPrinters: normalizedPendingPrinter,
|
|
72
|
+
printServerActive: pendingPrintJobData.printServers.printServerActive === 'true'
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
normalize(object) {
|
|
76
|
+
const normalizedObject = {};
|
|
77
|
+
Object.keys(object).forEach((key) => {
|
|
78
|
+
normalizedObject[key] = PrintUtils.ENCODED_PROPERTIES.includes(key) ? window.atob(object[key].$) : object[key].$;
|
|
79
|
+
});
|
|
80
|
+
return normalizedObject;
|
|
81
|
+
}
|
|
82
|
+
processLocalPrinting(localPrintings) {
|
|
83
|
+
const transactionIds = localPrintings.map((item) => item.transactionId);
|
|
84
|
+
this.appletImpressao.doLocalPrinting(transactionIds.join());
|
|
85
|
+
}
|
|
86
|
+
async openSnkPrintSelector(printJobData) {
|
|
87
|
+
let printSelector = document.querySelector('snk-print-selector');
|
|
88
|
+
if (!printSelector) {
|
|
89
|
+
printSelector = document.createElement('snk-print-selector');
|
|
90
|
+
printSelector.setAttribute('id', StringUtils.generateUUID());
|
|
91
|
+
window.document.body.appendChild(printSelector);
|
|
92
|
+
}
|
|
93
|
+
const { selectedPrinter, saveSubstitute } = await printSelector.openPrintSelector(printJobData);
|
|
94
|
+
if (!selectedPrinter)
|
|
95
|
+
return;
|
|
96
|
+
const params = {
|
|
97
|
+
transactionId: printJobData.transactionId,
|
|
98
|
+
pendingPrinters: printJobData.pendingPrinters,
|
|
99
|
+
printerUri: selectedPrinter.printerUri,
|
|
100
|
+
saveSubstitutePrinters: saveSubstitute
|
|
101
|
+
};
|
|
102
|
+
await this.saveSubstitutePrinter(params);
|
|
103
|
+
}
|
|
104
|
+
async saveSubstitutePrinter(params) {
|
|
105
|
+
const { transactionId, pendingPrinters, printerUri, saveSubstitutePrinters = false } = params;
|
|
106
|
+
const parsedPendingPrinters = pendingPrinters.map((item) => ({
|
|
107
|
+
printerUri: {
|
|
108
|
+
$: item.printerUri || printerUri
|
|
109
|
+
},
|
|
110
|
+
originalPrinterName: {
|
|
111
|
+
$: item.originalPrinterName
|
|
112
|
+
},
|
|
113
|
+
printJobCount: {
|
|
114
|
+
$: item.printJobCount
|
|
115
|
+
},
|
|
116
|
+
docType: {
|
|
117
|
+
$: item.docType
|
|
118
|
+
},
|
|
119
|
+
docTypeDescription: {
|
|
120
|
+
$: item.docTypeDescription
|
|
121
|
+
}
|
|
122
|
+
}));
|
|
123
|
+
const requestBody = {
|
|
124
|
+
substitutePrintersRequest: {
|
|
125
|
+
substitutePrinters: {
|
|
126
|
+
pendingPrinter: parsedPendingPrinters
|
|
127
|
+
},
|
|
128
|
+
saveSubstitutePrinters: {
|
|
129
|
+
$: saveSubstitutePrinters.toString()
|
|
130
|
+
},
|
|
131
|
+
transactionId: {
|
|
132
|
+
$: transactionId
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
Promise.resolve(this.DataFetcher).then(async (res) => {
|
|
137
|
+
await res.application.callServiceBroker(PrintUtils.SERVICE_SAVE_SUBSTITUTE_PRINTER, JSON.stringify(requestBody));
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
async processDirectPrint(printJobData) {
|
|
141
|
+
const isWCRunning = this.appletImpressao.checkWebConnection();
|
|
142
|
+
if (!isWCRunning) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
const localPrinters = this.getLocalPrinters();
|
|
146
|
+
if (!localPrinters.length)
|
|
147
|
+
return [];
|
|
148
|
+
const directPendingPrints = [];
|
|
149
|
+
const pendingPrints = printJobData.pendingPrinters.filter(item => {
|
|
150
|
+
const defaultPrinterName = this.getDefaultPrinterName(item.originalPrinterName);
|
|
151
|
+
const isDirectPrint = !!localPrinters.find(localPrinter => localPrinter.nome === defaultPrinterName) || this.isPrinterNameAFile(defaultPrinterName);
|
|
152
|
+
if (isDirectPrint) {
|
|
153
|
+
directPendingPrints.push(Object.assign(Object.assign({}, item), { printerUri: PrintUtils.LOCAL_SERVER_URI + defaultPrinterName }));
|
|
154
|
+
return false;
|
|
155
|
+
}
|
|
156
|
+
return true;
|
|
157
|
+
});
|
|
158
|
+
if (!directPendingPrints.length)
|
|
159
|
+
return pendingPrints;
|
|
160
|
+
const params = {
|
|
161
|
+
transactionId: printJobData.transactionId,
|
|
162
|
+
pendingPrinters: directPendingPrints
|
|
163
|
+
};
|
|
164
|
+
await this.saveSubstitutePrinter(params);
|
|
165
|
+
return pendingPrints;
|
|
166
|
+
}
|
|
167
|
+
getDefaultPrinterName(printerName) {
|
|
168
|
+
const defaultPrinterName = this.appletImpressao.getDefaultPrinter();
|
|
169
|
+
const isDefaultPrinterName = /padr[aã]o/ig.test(printerName);
|
|
170
|
+
return (defaultPrinterName && isDefaultPrinterName) ? defaultPrinterName : printerName;
|
|
171
|
+
}
|
|
172
|
+
isPrinterNameAFile(printerName) {
|
|
173
|
+
const regExp = new RegExp("^(\w:)?[/\\\w\s]+?\.\w{3}$", "mis");
|
|
174
|
+
return regExp.test(printerName);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
PrintUtils.SERVICE_FIND_PENDING_PRINTS = 'mge@PrintServiceSP.findPendingPrinters';
|
|
178
|
+
PrintUtils.SERVICE_SAVE_SUBSTITUTE_PRINTER = 'mge@PrintServiceSP.saveSubstitutePrinter';
|
|
179
|
+
PrintUtils.LOCAL_SERVER_URI = 'LOCAL:0/';
|
|
180
|
+
PrintUtils.ENCODED_PROPERTIES = ['printerName', 'printerUri'];
|
|
181
|
+
class AppletImpressao {
|
|
182
|
+
constructor() {
|
|
183
|
+
this.appletImpressao = document.getElementById('centralNotaAppletImpressao');
|
|
184
|
+
}
|
|
185
|
+
checkWebConnection() {
|
|
186
|
+
if (!this.appletImpressao)
|
|
187
|
+
return false;
|
|
188
|
+
if (!this.appletImpressao.testRunningWC)
|
|
189
|
+
return false;
|
|
190
|
+
const isRunning = this.appletImpressao.testRunningWC();
|
|
191
|
+
return !!isRunning;
|
|
192
|
+
}
|
|
193
|
+
findLocalPrinters() {
|
|
194
|
+
if (!this.appletImpressao)
|
|
195
|
+
return [];
|
|
196
|
+
const localPrinters = this.appletImpressao.getLocalPrinters();
|
|
197
|
+
if (!localPrinters)
|
|
198
|
+
return [];
|
|
199
|
+
return localPrinters.split(",");
|
|
200
|
+
}
|
|
201
|
+
doLocalPrinting(transactionIds) {
|
|
202
|
+
if (!this.appletImpressao)
|
|
203
|
+
return;
|
|
204
|
+
this.appletImpressao.doLocalPrinting(transactionIds);
|
|
205
|
+
}
|
|
206
|
+
getDefaultPrinter() {
|
|
207
|
+
if (!this.appletImpressao)
|
|
208
|
+
return '';
|
|
209
|
+
return this.appletImpressao.getPrintDefault();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export { PrintUtils as P };
|
|
@@ -47,6 +47,7 @@ export { SnkSimpleBar as SnkSimpleBar } from '../types/components/snk-simple-bar
|
|
|
47
47
|
export { SnkSimpleCrud as SnkSimpleCrud } from '../types/components/snk-simple-crud/snk-simple-crud';
|
|
48
48
|
export { SnkTabConfig as SnkTabConfig } from '../types/components/snk-form/subcomponents/snk-tab-config/snk-tab-config';
|
|
49
49
|
export { SnkTaskbar as SnkTaskbar } from '../types/components/snk-taskbar/snk-taskbar';
|
|
50
|
+
export { SnkTaskbarCustomElements as SnkTaskbarCustomElements } from '../types/components/snk-taskbar/snk-taskbar-custom-elements';
|
|
50
51
|
export { TestePesquisa as TestePesquisa } from '../types/components/teste-pesquisa/teste-pesquisa';
|
|
51
52
|
|
|
52
53
|
/**
|
package/dist/components/index.js
CHANGED
|
@@ -47,4 +47,5 @@ export { SnkSimpleBar, defineCustomElement as defineCustomElementSnkSimpleBar }
|
|
|
47
47
|
export { SnkSimpleCrud, defineCustomElement as defineCustomElementSnkSimpleCrud } from './snk-simple-crud.js';
|
|
48
48
|
export { SnkTabConfig, defineCustomElement as defineCustomElementSnkTabConfig } from './snk-tab-config.js';
|
|
49
49
|
export { SnkTaskbar, defineCustomElement as defineCustomElementSnkTaskbar } from './snk-taskbar.js';
|
|
50
|
+
export { SnkTaskbarCustomElements, defineCustomElement as defineCustomElementSnkTaskbarCustomElements } from './snk-taskbar-custom-elements.js';
|
|
50
51
|
export { TestePesquisa, defineCustomElement as defineCustomElementTestePesquisa } from './teste-pesquisa.js';
|
|
@@ -296,6 +296,16 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
296
296
|
});
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Realiza a chamada ao Service Broker conforme o nome do serviço.
|
|
301
|
+
*
|
|
302
|
+
* @param serviceName - Nome do serviço
|
|
303
|
+
* @param payload - Dados que serão processados na ação
|
|
304
|
+
* @param options - Parâmetros de URL
|
|
305
|
+
*/
|
|
306
|
+
async callServiceBroker(serviceName, payload, options) {
|
|
307
|
+
return DataFetcher.get().callServiceBroker(serviceName, payload, options);
|
|
308
|
+
}
|
|
299
309
|
initOnboarding(onboardingKey) {
|
|
300
310
|
OnboardingUtils.getInstance().init(onboardingKey, window.envContext);
|
|
301
311
|
return Promise.resolve();
|
|
@@ -879,6 +889,7 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
879
889
|
"messagesBuilder": [1040],
|
|
880
890
|
"configName": [1, "config-name"],
|
|
881
891
|
"isUserSup": [64],
|
|
892
|
+
"callServiceBroker": [64],
|
|
882
893
|
"initOnboarding": [64],
|
|
883
894
|
"hasAccess": [64],
|
|
884
895
|
"getAllAccess": [64],
|
|
@@ -903,7 +914,6 @@ const SnkApplication = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
|
|
|
903
914
|
"addClientEvent": [64],
|
|
904
915
|
"removeClientEvent": [64],
|
|
905
916
|
"hasClientEvent": [64],
|
|
906
|
-
"callServiceBroker": [64],
|
|
907
917
|
"getResourceID": [64],
|
|
908
918
|
"getUserID": [64],
|
|
909
919
|
"alert": [64],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { StringUtils, ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
3
3
|
import { T as TaskbarElement, d as defineCustomElement$2 } from './snk-taskbar2.js';
|
|
4
4
|
import './DataFetcher.js';
|
|
5
5
|
import './pesquisa-fetcher.js';
|
|
@@ -67,6 +67,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
67
67
|
this.presentationMode = PresentationMode.PRIMARY;
|
|
68
68
|
this.messagesBuilder = undefined;
|
|
69
69
|
this.useEnterLikeTab = false;
|
|
70
|
+
this.customContainerId = `SNK-CRUD-CUSTOM-CONTAINER-${StringUtils.generateUUID()}`;
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* Usado para alternar a visão entre GRID e FORM externamente.
|
|
@@ -208,7 +209,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
210
211
|
this._snkDataUnit.ignoreSaveMessage = this._currentViewMode === VIEW_MODE.GRID;
|
|
211
|
-
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, resourceID: this._resourceID }, 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, resourceID: this._resourceID }, 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'), resourceID: this._resourceID }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))));
|
|
212
|
+
return (h(Host, null, 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, resourceID: this._resourceID }, h("slot", { name: "GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "GRID_HEADER_CUSTOM_ELEMENTS" }), 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, resourceID: this._resourceID, detailTaskbarCustomContainerId: this.customContainerId }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }), 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'), resourceID: this._resourceID }, h("div", { slot: "SnkConfigContainerSlot" }, h("slot", { name: "SnkConfigContainerSlot" })))), h("div", { id: `${this.customContainerId}` }, h("slot", { name: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }), h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }))));
|
|
212
213
|
}
|
|
213
214
|
get _element() { return this; }
|
|
214
215
|
static get watchers() { return {
|
|
@@ -233,6 +234,7 @@ const SnkCrud$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
233
234
|
"_currentViewMode": [32],
|
|
234
235
|
"_canEdit": [32],
|
|
235
236
|
"_resourceID": [32],
|
|
237
|
+
"customContainerId": [32],
|
|
236
238
|
"goToView": [64],
|
|
237
239
|
"openConfigurator": [64],
|
|
238
240
|
"closeConfigurator": [64],
|
|
@@ -66,6 +66,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
66
66
|
this.canEdit = true;
|
|
67
67
|
this.presentationMode = undefined;
|
|
68
68
|
this.resourceID = undefined;
|
|
69
|
+
this.detailTaskbarCustomContainerId = undefined;
|
|
69
70
|
this._breadcrumbItems = [];
|
|
70
71
|
this._guides = undefined;
|
|
71
72
|
this._formEditorConfigManager = undefined;
|
|
@@ -267,7 +268,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
267
268
|
else {
|
|
268
269
|
detailBranch = this.selectedGuide;
|
|
269
270
|
}
|
|
270
|
-
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID }));
|
|
271
|
+
content = this.wrapDetail(levels, h("snk-detail-view", { ref: (ref) => this._currentDetail = ref, dataUnitName: this.getDataUnitName(levels, childEntityName), onSnkDetailGuidesChange: (evt) => this.updateGuide(evt.detail), entityName: childEntityName, selectedForm: formName, branchGuide: detailBranch, guideItemPath: this._breadcrumbItems, key: `detail${detailId}`, canEdit: this.canEdit, onSnkSwitchGuide: evt => this._guideNavigator.selectGuide(evt.detail), resourceID: this.resourceID, taskbarCustomContainerId: this.detailTaskbarCustomContainerId }));
|
|
271
272
|
}
|
|
272
273
|
else {
|
|
273
274
|
const cardId = this.selectedGuide.id;
|
|
@@ -338,7 +339,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
338
339
|
}
|
|
339
340
|
buildTaskBar() {
|
|
340
341
|
var _a;
|
|
341
|
-
return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID }));
|
|
342
|
+
return h("div", { class: `ez-col ez-flex-item--align-center ez-col--sd-6 ez-col--tb-6 ${this.presentationMode != PresentationMode.SECONDARY ? 'ez-align--right' : 'ez-padding-bottom--medium'}` }, h("snk-taskbar", { key: "guideViewerTaskbar", "data-element-id": "guideViewer", configName: this.configName, buttons: this._taskbarProcessor.buttons, disabledButtons: this._taskbarProcessor.disabledButtons, customButtons: this._taskbarProcessor.customButtons, actionsList: this.actionsList, messagesBuilder: this.messagesBuilder, presentationMode: this.presentationMode, primaryButton: ((_a = this.dataState) === null || _a === void 0 ? void 0 : _a.isDirty) ? "SAVE" : "INSERT", "data-taskbar-owner": "master", dataUnit: this.dataUnit, resourceID: this.resourceID, customSlotId: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "GUIDES_VIEWER_TASKBAR_CUSTOM_ELEMENTS" })));
|
|
342
343
|
}
|
|
343
344
|
render() {
|
|
344
345
|
var _a, _b;
|
|
@@ -365,7 +366,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
365
366
|
"masterFormConfig": ["observeMasterFormConfig"]
|
|
366
367
|
}; }
|
|
367
368
|
static get style() { return snkGuidesViewerCss; }
|
|
368
|
-
}, [
|
|
369
|
+
}, [6, "snk-guides-viewer", {
|
|
369
370
|
"dataUnit": [16],
|
|
370
371
|
"dataState": [16],
|
|
371
372
|
"configName": [1, "config-name"],
|
|
@@ -379,6 +380,7 @@ const SnkGuidesViewer = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
379
380
|
"canEdit": [4, "can-edit"],
|
|
380
381
|
"presentationMode": [1, "presentation-mode"],
|
|
381
382
|
"resourceID": [1, "resource-i-d"],
|
|
383
|
+
"detailTaskbarCustomContainerId": [1, "detail-taskbar-custom-container-id"],
|
|
382
384
|
"_breadcrumbItems": [32],
|
|
383
385
|
"_guides": [32],
|
|
384
386
|
"_formEditorConfigManager": [32],
|
|
@@ -611,6 +613,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
611
613
|
this.messagesBuilder = undefined;
|
|
612
614
|
this.branchGuide = undefined;
|
|
613
615
|
this.canEdit = true;
|
|
616
|
+
this.taskbarCustomContainerId = undefined;
|
|
614
617
|
}
|
|
615
618
|
observerDataState(newValue, oldValue) {
|
|
616
619
|
const openInsertion = !(oldValue === null || oldValue === void 0 ? void 0 : oldValue.insertionMode) && (newValue === null || newValue === void 0 ? void 0 : newValue.insertionMode);
|
|
@@ -780,13 +783,13 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
780
783
|
render() {
|
|
781
784
|
this.updateLabel();
|
|
782
785
|
//const cardConfig: IFormCardConfig = this._cardsState?.get(this.selectedForm);
|
|
783
|
-
return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID }))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
|
786
|
+
return (h(Host, null, h("snk-data-unit", { ref: (el) => this._snkDataUnit = el, dataUnitName: `${this.dataUnitName}`, onDataUnitReady: evt => this.dataUnitReadyHandler(evt), entityName: this.entityName, onDataStateChange: this.handleDataStateChange.bind(this), ignoreSaveMessage: this._currentView === VIEW_MODE.GRID, messagesBuilder: this.messagesBuilder, configName: this._configName }, h("ez-view-stack", { ref: (ref) => this.updateViewStack(ref) }, h("stack-item", null, h("div", { class: "ez-box ez-box--shadow grid-container" }, h("div", { class: "ez-flex ez-title--primary ez-size-width--full ez-padding--large detail-header" }, h("div", { class: "ez-flex ez-text ez-text--bold ez-flex--justify-start ez-flex--align-items-center" }, this._levelPath ? h("span", { class: "level-path" }, this._levelPath + " /") : undefined, this.label)), h("snk-grid", { class: "ez-size-width--full ez-size-height--full", ref: (ref) => this._snkGrid = ref, configName: this._configName, messagesBuilder: this.messagesBuilder, onGridDoubleClick: () => this.emitSwitchEvent(VIEW_MODE.FORM), onActionClick: (evt) => this.executeActionHandler(evt), presentationMode: PresentationMode.SECONDARY, canEdit: this.canEdit, isDetail: true, taskbarCustomContainerId: this.taskbarCustomContainerId, gridHeaderCustomSlotId: "DETAIL_GRID_HEADER_CUSTOM_ELEMENTS", topTaskbarCustomSlotId: "DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS" }))), h("stack-item", null, h("snk-form-view", { ref: (ref) => this._snkFormView = ref, canExpand: false, canFix: false, name: this.selectedForm, formMetadata: this._formMetadata, dataUnit: this.dataUnit, fields: this.getFormFields(), label: this.label, levelPath: this._levelPath, onFormItemsReady: ({ detail: formItems }) => this.formItemsReady.emit(formItems) }, h("snk-taskbar", { key: "guideViewerTaskbar", class: "form-taskbar", "data-element-id": "guideViewer", configName: this._configName, messagesBuilder: this.messagesBuilder, disabledButtons: this._disabledButtons, buttons: "INSERT,PREVIOUS,NEXT,DIVIDER,CLONE,REMOVE,MORE_OPTIONS,DIVIDER,GRID_MODE,CONFIGURATOR", primaryButton: "INSERT", presentationMode: PresentationMode.SECONDARY, onActionClick: evt => this.executeActionHandler(evt), dataUnit: this.dataUnit, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" }, h("slot", { name: "DETAIL_TASKBAR_CUSTOM_ELEMENTS" })))), h("stack-item", null, h("snk-attach", { registerKey: this.attachmentRegisterKey, messagesBuilder: this.messagesBuilder, entityName: this.entityName, onBack: this.handleAttachBack.bind(this) }))))));
|
|
784
787
|
}
|
|
785
788
|
static get watchers() { return {
|
|
786
789
|
"dataState": ["observerDataState"]
|
|
787
790
|
}; }
|
|
788
791
|
static get style() { return snkDetailViewCss; }
|
|
789
|
-
}, [
|
|
792
|
+
}, [6, "snk-detail-view", {
|
|
790
793
|
"formConfigManager": [1040],
|
|
791
794
|
"dataUnitName": [1, "data-unit-name"],
|
|
792
795
|
"resourceID": [1, "resource-i-d"],
|
|
@@ -799,6 +802,7 @@ const SnkDetailView = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
799
802
|
"messagesBuilder": [1040],
|
|
800
803
|
"branchGuide": [16],
|
|
801
804
|
"canEdit": [4, "can-edit"],
|
|
805
|
+
"taskbarCustomContainerId": [1, "taskbar-custom-container-id"],
|
|
802
806
|
"_disabledButtons": [32],
|
|
803
807
|
"_currentView": [32],
|
|
804
808
|
"attachmentRegisterKey": [32],
|
|
@@ -62,6 +62,9 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
62
62
|
this.useEnterLikeTab = false;
|
|
63
63
|
this.recordsValidator = undefined;
|
|
64
64
|
this.canEdit = true;
|
|
65
|
+
this.taskbarCustomContainerId = undefined;
|
|
66
|
+
this.gridHeaderCustomSlotId = 'GRID_HEADER_CUSTOM_ELEMENTS';
|
|
67
|
+
this.topTaskbarCustomSlotId = 'GRID_TASKBAR_CUSTOM_ELEMENTS';
|
|
65
68
|
}
|
|
66
69
|
/**
|
|
67
70
|
* Exibe a janela de configurações da grade.
|
|
@@ -328,7 +331,7 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
328
331
|
return undefined;
|
|
329
332
|
}
|
|
330
333
|
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, resourceID: this.resourceID }), ((_b = (_a = this._snkFilterBar) === null || _a === void 0 ? void 0 : _a.filterConfig) === null || _b === void 0 ? void 0 : _b.length) > 0 &&
|
|
331
|
-
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID })), 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, resourceID: this.resourceID })), 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(), resourceID: this.resourceID }))));
|
|
334
|
+
h("hr", { class: "ez-divider-vertical ez-divider--dark ez-margin-left--medium snk-grid__header-divider" }), h("snk-taskbar", { class: "ez-padding-left--medium", "data-element-id": "grid_top", key: "topTaskbar", configName: this.configName, dataUnit: this._dataUnit, messagesBuilder: this.messagesBuilder, buttons: this._topTaskbarProcessor.buttons, disabledButtons: this._topTaskbarProcessor.disabledButtons, customButtons: this._topTaskbarProcessor.customButtons, primaryButton: this.getPrimaryButton(), resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.topTaskbarCustomSlotId }, h("slot", { name: this.topTaskbarCustomSlotId }))), h("ez-grid", { ref: ref => this._grid = ref, class: (this.presentationMode === PresentationMode.SECONDARY ? "snk-grid-container__without-shadow " : "") + "snk-grid__table", "data-element-id": "embedded", dataUnit: this._dataUnit, key: "grid-" + this._snkDataUnit.entityName, config: this._gridConfig, onConfigChange: (evt) => { this.gridConfigChangeHandler(evt); }, onEzDoubleClick: () => 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, resourceID: this.resourceID, customContainerId: this.taskbarCustomContainerId, customSlotId: this.gridHeaderCustomSlotId }, h("slot", { name: this.gridHeaderCustomSlotId }))), h("div", { class: "ez-col ez-col--sd-12" }, h("slot", { name: "SnkGridFooter" })), h("ez-modal", { modalSize: "small", closeEsc: false, closeOutsideClick: false, opened: this._popUpGridConfig, onEzCloseModal: () => this.closeGridConfig() }, h("snk-grid-config", { ref: ref => this._snkGridConfig = ref, config: this._gridConfig, "data-element-id": this._element.getAttribute(ElementIDUtils.DATA_ELEMENT_ID_ATTRIBUTE_NAME), application: this._application, selectedIndex: 0, configName: this.configName, onConfigChange: (evt) => this.modalConfigChangeHandler(evt), onConfigCancel: () => this.closeGridConfig(), resourceID: this.resourceID }))));
|
|
332
335
|
}
|
|
333
336
|
get _element() { return this; }
|
|
334
337
|
static get style() { return snkGridCss; }
|
|
@@ -347,6 +350,9 @@ const SnkGrid = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
347
350
|
"useEnterLikeTab": [4, "use-enter-like-tab"],
|
|
348
351
|
"recordsValidator": [16],
|
|
349
352
|
"canEdit": [4, "can-edit"],
|
|
353
|
+
"taskbarCustomContainerId": [1, "taskbar-custom-container-id"],
|
|
354
|
+
"gridHeaderCustomSlotId": [1, "grid-header-custom-slot-id"],
|
|
355
|
+
"topTaskbarCustomSlotId": [1, "top-taskbar-custom-slot-id"],
|
|
350
356
|
"_dataUnit": [32],
|
|
351
357
|
"_dataState": [32],
|
|
352
358
|
"_gridConfig": [32],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { P as PrintUtils } from './
|
|
2
|
+
import { P as PrintUtils } from './PrintUtils.js';
|
|
3
3
|
import { ApplicationUtils } from '@sankhyalabs/ezui/dist/collection/utils';
|
|
4
4
|
import { ElementIDUtils, ApplicationContext } from '@sankhyalabs/core';
|
|
5
5
|
import ModalButtonStatus from '@sankhyalabs/ezui/dist/collection/components/ez-modal-container/modal-button-status';
|
|
@@ -277,7 +277,7 @@ const SnkSimpleCrud = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
277
277
|
}
|
|
278
278
|
render() {
|
|
279
279
|
var _a;
|
|
280
|
-
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)
|
|
280
|
+
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("slot", { name: "TASKBAR_CUSTOM_ELEMENTS" })), 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)
|
|
281
281
|
? undefined
|
|
282
282
|
: 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 }))))));
|
|
283
283
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SnkTaskbarCustomElements extends Components.SnkTaskbarCustomElements, HTMLElement {}
|
|
4
|
+
export const SnkTaskbarCustomElements: {
|
|
5
|
+
prototype: SnkTaskbarCustomElements;
|
|
6
|
+
new (): SnkTaskbarCustomElements;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const snkTaskbarCss = ".sc-snk-taskbar-custom-elements-h{display:flex}.taskbar-custom-elements-container.sc-snk-taskbar-custom-elements{display:none}";
|
|
4
|
+
|
|
5
|
+
const SnkTaskbarCustomElements$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.slot = 'TASKBAR_CUSTOM_ELEMENTS';
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (h(Host, { slot: this.slot }, h("div", { id: this.slot, class: "taskbar-custom-elements-container" }, h("slot", null))));
|
|
13
|
+
}
|
|
14
|
+
static get style() { return snkTaskbarCss; }
|
|
15
|
+
}, [6, "snk-taskbar-custom-elements", {
|
|
16
|
+
"slot": [1]
|
|
17
|
+
}]);
|
|
18
|
+
function defineCustomElement$1() {
|
|
19
|
+
if (typeof customElements === "undefined") {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const components = ["snk-taskbar-custom-elements"];
|
|
23
|
+
components.forEach(tagName => { switch (tagName) {
|
|
24
|
+
case "snk-taskbar-custom-elements":
|
|
25
|
+
if (!customElements.get(tagName)) {
|
|
26
|
+
customElements.define(tagName, SnkTaskbarCustomElements$1);
|
|
27
|
+
}
|
|
28
|
+
break;
|
|
29
|
+
} });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const SnkTaskbarCustomElements = SnkTaskbarCustomElements$1;
|
|
33
|
+
const defineCustomElement = defineCustomElement$1;
|
|
34
|
+
|
|
35
|
+
export { SnkTaskbarCustomElements, defineCustomElement };
|