@orangesix/react 1.0.3 → 1.0.6
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/api/index.cjs.js +2 -0
- package/api/index.cjs.js.map +1 -0
- package/api/index.d.ts +26 -0
- package/api/index.esm.js +2 -0
- package/api/index.esm.js.map +1 -0
- package/api/package.json +5 -0
- package/api/theme.css +1 -0
- package/box/_box.scss +83 -0
- package/box/index.cjs.js +2 -0
- package/box/index.cjs.js.map +1 -0
- package/box/index.d.ts +147 -0
- package/box/index.esm.js +2 -0
- package/box/index.esm.js.map +1 -0
- package/box/package.json +5 -0
- package/editor/_editor.scss +53 -0
- package/editor/index.cjs.js +2 -0
- package/editor/index.cjs.js.map +1 -0
- package/editor/index.d.ts +92 -0
- package/editor/index.esm.js +2 -0
- package/editor/index.esm.js.map +1 -0
- package/editor/package.json +5 -0
- package/package.json +19 -15
- package/table/_table.scss +136 -0
- package/table/index.cjs.js +2 -0
- package/table/index.cjs.js.map +1 -0
- package/table/index.d.ts +256 -0
- package/table/index.esm.js +2 -0
- package/table/index.esm.js.map +1 -0
- package/table/package.json +5 -0
- package/utils/index.cjs.js +2 -365
- package/utils/index.cjs.js.map +1 -0
- package/utils/index.d.ts +68 -45
- package/utils/index.esm.js +2 -350
- package/utils/index.esm.js.map +1 -0
package/utils/index.esm.js
CHANGED
|
@@ -1,350 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import SweetAlert from 'sweetalert2';
|
|
4
|
-
import Snackbar from 'node-snackbar';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Envia a mensagem para o evento da janela
|
|
8
|
-
*/
|
|
9
|
-
function sendMessage(params) {
|
|
10
|
-
let Window = window.self === window.top ? window : window.parent;
|
|
11
|
-
const { message, library, type, options } = params;
|
|
12
|
-
Window.postMessage({
|
|
13
|
-
type: "message",
|
|
14
|
-
params: {
|
|
15
|
-
message,
|
|
16
|
-
options,
|
|
17
|
-
type: type ?? "message",
|
|
18
|
-
library: library ?? "snackbar"
|
|
19
|
-
}
|
|
20
|
-
}, "*");
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Retorna o objeto mensagem de acordo com os parâmetros
|
|
24
|
-
*/
|
|
25
|
-
function message(params) {
|
|
26
|
-
let { message, library, type, options } = params;
|
|
27
|
-
library = library ?? "snackbar";
|
|
28
|
-
switch (library) {
|
|
29
|
-
case "sweetAlert":
|
|
30
|
-
let swal = {
|
|
31
|
-
icon: message.type,
|
|
32
|
-
title: message.title,
|
|
33
|
-
text: message.text
|
|
34
|
-
};
|
|
35
|
-
if (type === "toast") {
|
|
36
|
-
const Toast = SweetAlert.mixin(options !== undefined ? options
|
|
37
|
-
: {
|
|
38
|
-
toast: true,
|
|
39
|
-
position: "top-end",
|
|
40
|
-
showConfirmButton: false,
|
|
41
|
-
timer: 3000,
|
|
42
|
-
timerProgressBar: true,
|
|
43
|
-
didOpen: (toast) => {
|
|
44
|
-
toast.onmouseenter = SweetAlert.stopTimer;
|
|
45
|
-
toast.onmouseleave = SweetAlert.resumeTimer;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Toast.fire(swal);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
SweetAlert.fire({ ...swal, ...options });
|
|
52
|
-
}
|
|
53
|
-
break;
|
|
54
|
-
case "snackbar":
|
|
55
|
-
let config = options;
|
|
56
|
-
let text = message.message ?? message.text ?? message.title ?? "Não foi possível carregar a mensagem.";
|
|
57
|
-
Snackbar.show(config === undefined ? {
|
|
58
|
-
pos: "top-right",
|
|
59
|
-
showAction: false,
|
|
60
|
-
customClass: message.type,
|
|
61
|
-
text: "<p class='d-flex m-0 align-items-center'><i class='me-2 " + message.icon + "'></i>" + text + "</p>",
|
|
62
|
-
} : config);
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Realiza a pesquisa do elemento html na DOM<br>
|
|
69
|
-
* <meta id="???" name="???" content="your-url">
|
|
70
|
-
*/
|
|
71
|
-
function getMetaContent(id) {
|
|
72
|
-
let element = document.getElementById(id);
|
|
73
|
-
let url = element === null ? null : (element.content).replace(".br/", ".br");
|
|
74
|
-
return url === null ? null : url.substr(-1) === "/" ? url.slice(0, url.length - 1) : url;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Realiza a pesquisa do CEP na API pública "https://viacep.com.br/ws/"
|
|
78
|
-
*/
|
|
79
|
-
async function getCep(value) {
|
|
80
|
-
let cep = value.length === 0 ? "00000000" : value.replace("-", "");
|
|
81
|
-
return await axios.get("https://viacep.com.br/ws/" + cep + "/json/")
|
|
82
|
-
.then(data => data.data);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Realiza a pesquisa do elemento na árvore DOM
|
|
86
|
-
*/
|
|
87
|
-
function getElementDOM(element, preloadTimeOut) {
|
|
88
|
-
return new Promise((resolve) => {
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
let body = window.self === window.top ? $("body") : $(window.frameElement).parents("body");
|
|
91
|
-
if (!element || element.length === 0) {
|
|
92
|
-
resolve(body);
|
|
93
|
-
}
|
|
94
|
-
if (element === "#" || element === ".") {
|
|
95
|
-
resolve(null);
|
|
96
|
-
}
|
|
97
|
-
let elementFound = body.find(element);
|
|
98
|
-
if (elementFound.length > 0) {
|
|
99
|
-
resolve(elementFound);
|
|
100
|
-
}
|
|
101
|
-
else {
|
|
102
|
-
setTimeout(() => {
|
|
103
|
-
let iframe = body.find("iframe").contents();
|
|
104
|
-
if (iframe.length === 0) {
|
|
105
|
-
resolve(null);
|
|
106
|
-
}
|
|
107
|
-
elementFound = iframe.find(element);
|
|
108
|
-
if (elementFound.length > 0) {
|
|
109
|
-
resolve(elementFound);
|
|
110
|
-
}
|
|
111
|
-
resolve(null);
|
|
112
|
-
}, preloadTimeOut ?? 300);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Permite à comunicação de origem cruzada entre objetos do Windows.<br>
|
|
118
|
-
* Exemplo: Comunicação entre iframe e corpo principal
|
|
119
|
-
*/
|
|
120
|
-
function windowMessageEvent() {
|
|
121
|
-
window.addEventListener("message", function (event) {
|
|
122
|
-
if (event.data?.type === "message") {
|
|
123
|
-
let data = event.data;
|
|
124
|
-
message({ ...data.params });
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const USER = getMetaContent("auth");
|
|
130
|
-
const BASE = getMetaContent("react-base");
|
|
131
|
-
const TOKEN = getMetaContent("csrf-token");
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Realizei o gerenciamento do objeto de resposta
|
|
135
|
-
*/
|
|
136
|
-
function response(response, form = "") {
|
|
137
|
-
let data = response;
|
|
138
|
-
if (!data) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
if (data.redirect) {
|
|
142
|
-
window.location.href = data.redirect;
|
|
143
|
-
}
|
|
144
|
-
if (data.errors) {
|
|
145
|
-
messageField(data.errors, form.length === 0 ? "" : form);
|
|
146
|
-
}
|
|
147
|
-
if (data.accept) {
|
|
148
|
-
messageField(data.accept, form.length === 0 ? "" : form, "is-valid");
|
|
149
|
-
}
|
|
150
|
-
if (data.message && data?.errors === undefined) {
|
|
151
|
-
sendMessage({
|
|
152
|
-
message: { ...data.message },
|
|
153
|
-
type: "message",
|
|
154
|
-
library: "snackbar"
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Exibe a mensagem no campo do formulário
|
|
160
|
-
*/
|
|
161
|
-
function messageField(data, form = "", type = "is-invalid") {
|
|
162
|
-
tabViewActiveError(form, data);
|
|
163
|
-
getElementDOM("#" + form)
|
|
164
|
-
.then(formulario => {
|
|
165
|
-
if (formulario === null) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
let validationFeedbackClass = type === "is-invalid" ? "invalid-feedback" : "valid-feedback";
|
|
169
|
-
let removeValidationFeedbackClass = type === "is-invalid" ? "is-valid" : "is-invalid";
|
|
170
|
-
$.each(data, (key, value) => {
|
|
171
|
-
let text = "";
|
|
172
|
-
value.forEach(value => text += value + "<br>");
|
|
173
|
-
formulario.find("input[name='" + key + "']")
|
|
174
|
-
.addClass(type)
|
|
175
|
-
.parent()
|
|
176
|
-
.find("#j_feedback[data-name='" + key + "']")
|
|
177
|
-
.addClass(validationFeedbackClass)
|
|
178
|
-
.removeClass(removeValidationFeedbackClass)
|
|
179
|
-
.html(text);
|
|
180
|
-
formulario.find("input[name='" + key + "']")
|
|
181
|
-
.addClass(type)
|
|
182
|
-
.parent()
|
|
183
|
-
.parent()
|
|
184
|
-
.find("#j_feedback[data-name='" + key + "']")
|
|
185
|
-
.addClass(validationFeedbackClass)
|
|
186
|
-
.removeClass(removeValidationFeedbackClass)
|
|
187
|
-
.html(text);
|
|
188
|
-
formulario.find("input[name='" + key + "']")
|
|
189
|
-
.addClass(type)
|
|
190
|
-
.parent()
|
|
191
|
-
.parent()
|
|
192
|
-
.parent()
|
|
193
|
-
.find("#j_feedback[data-name='" + key + "']")
|
|
194
|
-
.addClass(validationFeedbackClass)
|
|
195
|
-
.removeClass(removeValidationFeedbackClass)
|
|
196
|
-
.html(text);
|
|
197
|
-
formulario.find("select[name='" + key + "']")
|
|
198
|
-
.addClass(type)
|
|
199
|
-
.parent()
|
|
200
|
-
.find("#j_feedback[data-name='" + key + "']")
|
|
201
|
-
.addClass(validationFeedbackClass)
|
|
202
|
-
.removeClass(removeValidationFeedbackClass)
|
|
203
|
-
.html(text);
|
|
204
|
-
formulario.find("textarea[name='" + key + "']")
|
|
205
|
-
.addClass(type)
|
|
206
|
-
.parent()
|
|
207
|
-
.find("#j_feedback[data-name='" + key + "']")
|
|
208
|
-
.addClass(validationFeedbackClass)
|
|
209
|
-
.removeClass(removeValidationFeedbackClass)
|
|
210
|
-
.html(text);
|
|
211
|
-
formulario.find("#j_feedback[data-name='" + key + "']")
|
|
212
|
-
.addClass(type)
|
|
213
|
-
.html(text);
|
|
214
|
-
});
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* Limpar as mensagens de feedback do formulário
|
|
219
|
-
*/
|
|
220
|
-
function messageFieldClear(form = "") {
|
|
221
|
-
getElementDOM("#" + form)
|
|
222
|
-
.then(formulario => {
|
|
223
|
-
if (formulario === null) {
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
let validationClass = ["is-invalid", "is-valid", "p-invalid"];
|
|
227
|
-
let validationFeedbackClass = ["invalid-feedback", "valid-feedback"];
|
|
228
|
-
$.each(formulario.find("input"), function () {
|
|
229
|
-
$(this)
|
|
230
|
-
.removeClass(validationClass)
|
|
231
|
-
.parent()
|
|
232
|
-
.find("#j_feedback")
|
|
233
|
-
.removeClass(validationFeedbackClass)
|
|
234
|
-
.html("");
|
|
235
|
-
$(this)
|
|
236
|
-
.removeClass(validationClass)
|
|
237
|
-
.parent()
|
|
238
|
-
.parent()
|
|
239
|
-
.find("#j_feedback")
|
|
240
|
-
.removeClass(validationFeedbackClass)
|
|
241
|
-
.html("");
|
|
242
|
-
$(this)
|
|
243
|
-
.removeClass(validationClass)
|
|
244
|
-
.parent()
|
|
245
|
-
.parent()
|
|
246
|
-
.parent()
|
|
247
|
-
.find("#j_feedback")
|
|
248
|
-
.removeClass(validationFeedbackClass)
|
|
249
|
-
.html("");
|
|
250
|
-
});
|
|
251
|
-
$.each(formulario.find("select"), function () {
|
|
252
|
-
$(this)
|
|
253
|
-
.removeClass(validationClass)
|
|
254
|
-
.parent()
|
|
255
|
-
.find("#j_feedback")
|
|
256
|
-
.removeClass(validationFeedbackClass)
|
|
257
|
-
.html("");
|
|
258
|
-
});
|
|
259
|
-
$.each(formulario.find("textarea"), function () {
|
|
260
|
-
$(this)
|
|
261
|
-
.removeClass(validationClass)
|
|
262
|
-
.parent()
|
|
263
|
-
.find("#j_feedback")
|
|
264
|
-
.removeClass(validationFeedbackClass)
|
|
265
|
-
.html("");
|
|
266
|
-
});
|
|
267
|
-
$.each(formulario.find("#j_feedback"), function () {
|
|
268
|
-
$(this).removeClass(validationClass).html("");
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
}
|
|
272
|
-
/**
|
|
273
|
-
* Ativa o TabView quando o campo apresenta erro
|
|
274
|
-
*/
|
|
275
|
-
function tabViewActiveError(form = "", errors) {
|
|
276
|
-
getElementDOM("#" + form)
|
|
277
|
-
.then(TabView => {
|
|
278
|
-
if (TabView === null) {
|
|
279
|
-
return;
|
|
280
|
-
}
|
|
281
|
-
let fieldError = Object.keys(errors)[0];
|
|
282
|
-
let TabViewSelected = TabView.find("*[id='" + fieldError + "']").closest(".tab-pane");
|
|
283
|
-
let TabViewSelectedId = TabViewSelected.attr("id");
|
|
284
|
-
let TabViewNav = TabViewSelected.parent().parent().find(".nav");
|
|
285
|
-
TabViewSelected.parent(".tab-content").children(".tab-pane").each(function (_, value) {
|
|
286
|
-
if (typeof value !== "undefined") {
|
|
287
|
-
if ($(value).attr("id") === TabViewSelectedId) {
|
|
288
|
-
$(value).addClass("show active");
|
|
289
|
-
TabViewNav.find("button[data-bs-target='#" + TabViewSelectedId + "']").addClass("active show");
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
$(value).removeClass("show active");
|
|
293
|
-
TabViewNav.find("button[data-bs-target='#" + $(value).attr("id") + "']").removeClass("active");
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Simplifica a solicitação POST HTTP usando a biblioteca axios
|
|
302
|
-
*/
|
|
303
|
-
function post(route, body, form, options) {
|
|
304
|
-
return new Promise((resolve, reject) => {
|
|
305
|
-
let url = BASE + (route.startsWith("/") ? "" : "/") + route;
|
|
306
|
-
messageFieldClear(form);
|
|
307
|
-
handleToManyRequest(options?.url ?? url, options?.blockedToManyRequest ?? false);
|
|
308
|
-
axios({
|
|
309
|
-
method: "post",
|
|
310
|
-
url: options?.url ?? url,
|
|
311
|
-
headers: { "X-CSRF-TOKEN": TOKEN },
|
|
312
|
-
data: !body ? {} : body,
|
|
313
|
-
}).then(data => {
|
|
314
|
-
if (data?.data !== undefined) {
|
|
315
|
-
resolve(data.data);
|
|
316
|
-
}
|
|
317
|
-
if (typeof options?.blockedResponse !== "boolean" || options?.blockedResponse === false) {
|
|
318
|
-
response(data?.data, form);
|
|
319
|
-
}
|
|
320
|
-
}).catch(error => {
|
|
321
|
-
response(error.response?.data, form);
|
|
322
|
-
reject(error);
|
|
323
|
-
});
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Bloqueia várias solicitações simultâneas
|
|
328
|
-
*/
|
|
329
|
-
function handleToManyRequest(url, blocked) {
|
|
330
|
-
let requestCount = 0;
|
|
331
|
-
axios.interceptors.request.use(config => {
|
|
332
|
-
requestCount = requestCount + 1;
|
|
333
|
-
if (requestCount > 1 && axios.getUri(config) === url && blocked) {
|
|
334
|
-
return Promise.reject(new Error("Requisições bloqueadas!"));
|
|
335
|
-
}
|
|
336
|
-
return config;
|
|
337
|
-
});
|
|
338
|
-
if (!blocked) {
|
|
339
|
-
axios.interceptors.request.clear();
|
|
340
|
-
}
|
|
341
|
-
axios.interceptors.response.use(response => {
|
|
342
|
-
requestCount = requestCount - 1;
|
|
343
|
-
return response;
|
|
344
|
-
}, function (error) {
|
|
345
|
-
requestCount = requestCount - 1;
|
|
346
|
-
return Promise.reject(error);
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export { BASE, TOKEN, USER, getCep, getElementDOM, getMetaContent, message, messageField, messageFieldClear, post, response, sendMessage, tabViewActiveError, windowMessageEvent };
|
|
1
|
+
import e from"jquery";import t from"axios";import a from"node-snackbar";import n from"sweetalert2";function s(e){let t=window.self===window.top?window:window.parent;const{message:a,library:n,type:s,options:i}=e;t.postMessage({type:"message",params:{message:a,options:i,type:s??"message",library:n??"snackbar"}},"*")}function i(e){let{message:t,library:s,type:i,options:r}=e;switch(s=s??"snackbar",s){case"sweetAlert":let e={icon:t.type,title:t.title,text:t.text};if("toast"===i){let t=r??{toast:!0,position:"top-end",showConfirmButton:!1,timer:3e3,timerProgressBar:!0,didOpen:e=>{e.onmouseenter=n.stopTimer,e.onmouseleave=n.resumeTimer}};n.mixin(t).fire(e)}else n.fire({...e,...r});break;case"snackbar":let s=r,o=t.message??t.text??t.title??"Não foi possível carregar a mensagem.";a.show(void 0===s?{pos:"top-right",showAction:!1,customClass:t.type,text:"<p class='d-flex m-0 align-items-center'><i class='me-2 "+t.icon+"'></i>"+o+"</p>"}:s)}}function r(e){let t=document.getElementById(e),a=null===t?null:t.content.replace(".br/",".br");return null===a?null:"/"===a.substr(-1)?a.slice(0,a.length-1):a}async function o(e){let a=0===e.length?"00000000":e.replace("-","");return await t.get("https://viacep.com.br/ws/"+a+"/json/").then((e=>e.data))}function l(t,a){return new Promise((n=>{let s=window.self===window.top?e("body"):e(window.frameElement).parents("body");t&&0!==t.length||n(s),"#"!==t&&"."!==t||n(null);let i=s.find(t);i.length>0?n(i):setTimeout((()=>{let e=s.find("iframe").contents();0===e.length&&n(null),i=e.find(t),i.length>0&&n(i),n(null)}),a??300)}))}function d(){window.addEventListener("message",(function(e){if("message"===e.data?.type){i({...e.data.params})}}))}const c=r("auth"),m=r("react-base"),f=r("csrf-token");function p(e,t=""){let a=e;a&&(a.redirect&&(window.location.href=a.redirect),a.errors&&u(a.errors,0===t.length?"":t),a.accept&&u(a.accept,0===t.length?"":t,"is-valid"),a.message&&void 0===a?.errors&&s({message:{...a.message},type:"message",library:"snackbar"}))}function u(t,a="",n="is-invalid"){b(a,t),l("#"+a).then((a=>{if(null===a)return;let s="is-invalid"===n?"invalid-feedback":"valid-feedback",i="is-invalid"===n?"is-valid":"is-invalid";e.each(t,((e,t)=>{let r="";t.forEach((e=>r+=e+"<br>")),a.find("input[name='"+e+"']").addClass(n).parent().find("#j_feedback[data-name='"+e+"']").addClass(s).removeClass(i).html(r),a.find("input[name='"+e+"']").addClass(n).parent().parent().find("#j_feedback[data-name='"+e+"']").addClass(s).removeClass(i).html(r),a.find("input[name='"+e+"']").addClass(n).parent().parent().parent().find("#j_feedback[data-name='"+e+"']").addClass(s).removeClass(i).html(r),a.find("select[name='"+e+"']").addClass(n).parent().find("#j_feedback[data-name='"+e+"']").addClass(s).removeClass(i).html(r),a.find("textarea[name='"+e+"']").addClass(n).parent().find("#j_feedback[data-name='"+e+"']").addClass(s).removeClass(i).html(r),a.find("#j_feedback[data-name='"+e+"']").addClass(n).html(r)}))}))}function h(t=""){l("#"+t).then((t=>{if(null===t)return;let a=["is-invalid","is-valid","p-invalid"],n=["invalid-feedback","valid-feedback"];e.each(t.find("input"),(function(){e(this).removeClass(a).parent().find("#j_feedback").removeClass(n).html(""),e(this).removeClass(a).parent().parent().find("#j_feedback").removeClass(n).html(""),e(this).removeClass(a).parent().parent().parent().find("#j_feedback").removeClass(n).html("")})),e.each(t.find("select"),(function(){e(this).removeClass(a).parent().find("#j_feedback").removeClass(n).html("")})),e.each(t.find("textarea"),(function(){e(this).removeClass(a).parent().find("#j_feedback").removeClass(n).html("")})),e.each(t.find("#j_feedback"),(function(){e(this).removeClass(a).html("")}))}))}function b(t="",a){l("#"+t).then((t=>{if(null===t)return;let n=Object.keys(a)[0],s=t.find("*[id='"+n+"']").closest(".tab-pane"),i=s.attr("id"),r=s.parent().parent().find(".nav");s.parent(".tab-content").children(".tab-pane").each((function(t,a){void 0!==a&&(e(a).attr("id")===i?(e(a).addClass("show active"),r.find("button[data-bs-target='#"+i+"']").addClass("active show")):(e(a).removeClass("show active"),r.find("button[data-bs-target='#"+e(a).attr("id")+"']").removeClass("active")))}))}))}function v(e,a,n,s){return new Promise(((i,r)=>{let o=m+(e.startsWith("/")?"":"/")+e;h(n),function(e,a){let n=0;t.interceptors.request.use((s=>(n+=1,n>1&&t.getUri(s)===e&&a?Promise.reject(new Error("Requisições bloqueadas!")):s))),a||t.interceptors.request.clear();t.interceptors.response.use((e=>(n-=1,e)),(function(e){return n-=1,Promise.reject(e)}))}(s?.url??o,s?.blockedToManyRequest??!1),t({method:"post",url:s?.url??o,headers:{"X-CSRF-TOKEN":f},data:a||{}}).then((e=>{void 0!==e?.data&&i(e.data),"boolean"==typeof s?.blockedResponse&&!1!==s?.blockedResponse||p(e?.data,n)})).catch((e=>{p(e.response?.data,n),r(e)}))}))}export{m as BASE,f as TOKEN,c as USER,o as getCep,l as getElementDOM,r as getMetaContent,i as message,u as messageField,h as messageFieldClear,v as post,p as response,s as sendMessage,b as tabViewActiveError,d as windowMessageEvent};
|
|
2
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/utils/message.ts","../../src/utils/helper.ts","../../src/utils/const.ts","../../src/utils/response.ts","../../src/utils/request.ts"],"sourcesContent":["import Snackbar from \"node-snackbar\";\r\nimport SweetAlert, { SweetAlertOptions } from \"sweetalert2\";\r\nimport { IUtilsMessage, IUtilsMessageOptions } from \"./types\";\r\n\r\n/**\r\n * Envia a mensagem para o evento da janela\r\n */\r\nexport function sendMessage<T extends keyof IUtilsMessageOptions>(params: IUtilsMessage<T>) {\r\n let Window: Window = window.self === window.top ? window : window.parent;\r\n const { message, library, type, options } = params;\r\n Window.postMessage({\r\n type: \"message\",\r\n params: {\r\n message,\r\n options,\r\n type: type ?? \"message\",\r\n library: library ?? \"snackbar\"\r\n }\r\n }, \"*\");\r\n}\r\n\r\n/**\r\n * Retorna o objeto mensagem de acordo com os parâmetros\r\n */\r\nexport function message<T extends keyof IUtilsMessageOptions>(params: IUtilsMessage<T>) {\r\n let { message, library, type, options } = params;\r\n\r\n library = library ?? \"snackbar\";\r\n switch (library) {\r\n case \"sweetAlert\":\r\n let swal: any = {\r\n icon: message.type,\r\n title: message.title,\r\n text: message.text\r\n };\r\n if (type === \"toast\") {\r\n let config: SweetAlertOptions = options as SweetAlertOptions ?? {\r\n toast: true,\r\n position: \"top-end\",\r\n showConfirmButton: false,\r\n timer: 3000,\r\n timerProgressBar: true,\r\n didOpen: (toast) => {\r\n toast.onmouseenter = SweetAlert.stopTimer;\r\n toast.onmouseleave = SweetAlert.resumeTimer;\r\n }\r\n };\r\n const Toast = SweetAlert.mixin(config);\r\n Toast.fire(swal);\r\n } else {\r\n SweetAlert.fire({ ...swal, ...options });\r\n }\r\n break;\r\n case \"snackbar\":\r\n let config: any = options;\r\n let text: string = message.message ?? message.text ?? message.title ?? \"Não foi possível carregar a mensagem.\";\r\n Snackbar.show(config === undefined ? {\r\n pos: \"top-right\",\r\n showAction: false,\r\n customClass: message.type,\r\n text: \"<p class='d-flex m-0 align-items-center'><i class='me-2 \" + message.icon + \"'></i>\" + text + \"</p>\",\r\n } : config);\r\n break;\r\n }\r\n}","import $ from \"jquery\";\r\nimport axios from \"axios\";\r\nimport { message } from \"./message\";\r\nimport { IUtilsHelperResponse } from \"./types\";\r\n\r\n/**\r\n * Realiza a pesquisa do elemento html na DOM<br>\r\n * <meta id=\"???\" name=\"???\" content=\"your-url\">\r\n */\r\nexport function getMetaContent(id: string): string | null {\r\n let element: any = document.getElementById(id);\r\n let url: null | string = element === null ? null : (element.content).replace(\".br/\", \".br\");\r\n return url === null ? null : url.substr(-1) === \"/\" ? url.slice(0, url.length - 1) : url;\r\n}\r\n\r\n/**\r\n * Realiza a pesquisa do CEP na API pública \"https://viacep.com.br/ws/\"\r\n */\r\nexport async function getCep(value: string): Promise<IUtilsHelperResponse[\"gep_cep\"]> {\r\n let cep = value.length === 0 ? \"00000000\" : value.replace(\"-\", \"\");\r\n return await axios.get<IUtilsHelperResponse[\"gep_cep\"]>(\"https://viacep.com.br/ws/\" + cep + \"/json/\")\r\n .then(data => data.data);\r\n}\r\n\r\n/**\r\n * Realiza a pesquisa do elemento na árvore DOM\r\n */\r\nexport function getElementDOM(element?: string, preloadTimeOut?: number): Promise<null | JQuery<HTMLElement>> {\r\n return new Promise((resolve) => {\r\n // @ts-ignore\r\n let body = window.self === window.top ? $(\"body\") : $(window.frameElement).parents(\"body\");\r\n if (!element || element.length === 0) {\r\n resolve(body);\r\n }\r\n\r\n if (element === \"#\" || element === \".\") {\r\n resolve(null);\r\n }\r\n\r\n let elementFound = body.find(element);\r\n if (elementFound.length > 0) {\r\n resolve(elementFound);\r\n } else {\r\n setTimeout(() => {\r\n let iframe = body.find(\"iframe\").contents();\r\n if (iframe.length === 0) {\r\n resolve(null);\r\n }\r\n elementFound = iframe.find(element);\r\n if (elementFound.length > 0) {\r\n resolve(elementFound);\r\n }\r\n resolve(null);\r\n }, preloadTimeOut ?? 300);\r\n }\r\n });\r\n}\r\n\r\n/**\r\n * Permite à comunicação de origem cruzada entre objetos do Windows.<br>\r\n * Exemplo: Comunicação entre iframe e corpo principal\r\n */\r\nexport function windowMessageEvent(): void {\r\n window.addEventListener(\"message\", function (event: MessageEvent) {\r\n if (event.data?.type === \"message\") {\r\n let data = event.data;\r\n message<any>({ ...data.params });\r\n }\r\n });\r\n}","import { getMetaContent } from \"./helper\";\r\n\r\nexport const USER: string | null = getMetaContent(\"auth\");\r\nexport const BASE: string | null = getMetaContent(\"react-base\");\r\nexport const TOKEN: string | null = getMetaContent(\"csrf-token\");\r\n","import $ from \"jquery\";\r\nimport { sendMessage } from \"./message\";\r\nimport { getElementDOM } from \"./helper\";\r\nimport { IUtilsResponseType, IUtilsResponseError } from \"./types\";\r\n\r\n/**\r\n * Realizei o gerenciamento do objeto de resposta\r\n */\r\nexport function response<Type>(\r\n response: IUtilsResponseType<Type>,\r\n form: string = \"\"\r\n): void {\r\n let data: IUtilsResponseType<Type> = response;\r\n if (!data) {\r\n return;\r\n }\r\n\r\n if (data.redirect) {\r\n window.location.href = data.redirect;\r\n }\r\n\r\n if (data.errors) {\r\n messageField(data.errors, form.length === 0 ? \"\" : form);\r\n }\r\n\r\n if (data.accept) {\r\n messageField(data.accept, form.length === 0 ? \"\" : form, \"is-valid\");\r\n }\r\n\r\n if (data.message && data?.errors === undefined) {\r\n sendMessage<\"snackbar\">({\r\n message: { ...data.message },\r\n type: \"message\",\r\n library: \"snackbar\"\r\n });\r\n }\r\n}\r\n\r\n/**\r\n * Exibe a mensagem no campo do formulário\r\n */\r\nexport function messageField(\r\n data: IUtilsResponseError,\r\n form: string = \"\",\r\n type: string = \"is-invalid\"\r\n): void {\r\n tabViewActiveError(form, data);\r\n getElementDOM(\"#\" + form)\r\n .then(formulario => {\r\n if (formulario === null) {\r\n return;\r\n }\r\n\r\n let validationFeedbackClass: string = type === \"is-invalid\" ? \"invalid-feedback\" : \"valid-feedback\";\r\n let removeValidationFeedbackClass: string = type === \"is-invalid\" ? \"is-valid\" : \"is-invalid\";\r\n\r\n $.each(data, (key: string, value) => {\r\n let text = \"\";\r\n value.forEach(value => text += value + \"<br>\");\r\n\r\n formulario.find(\"input[name='\" + key + \"']\")\r\n .addClass(type)\r\n .parent()\r\n .find(\"#j_feedback[data-name='\" + key + \"']\")\r\n .addClass(validationFeedbackClass)\r\n .removeClass(removeValidationFeedbackClass)\r\n .html(text);\r\n\r\n formulario.find(\"input[name='\" + key + \"']\")\r\n .addClass(type)\r\n .parent()\r\n .parent()\r\n .find(\"#j_feedback[data-name='\" + key + \"']\")\r\n .addClass(validationFeedbackClass)\r\n .removeClass(removeValidationFeedbackClass)\r\n .html(text);\r\n\r\n formulario.find(\"input[name='\" + key + \"']\")\r\n .addClass(type)\r\n .parent()\r\n .parent()\r\n .parent()\r\n .find(\"#j_feedback[data-name='\" + key + \"']\")\r\n .addClass(validationFeedbackClass)\r\n .removeClass(removeValidationFeedbackClass)\r\n .html(text);\r\n\r\n formulario.find(\"select[name='\" + key + \"']\")\r\n .addClass(type)\r\n .parent()\r\n .find(\"#j_feedback[data-name='\" + key + \"']\")\r\n .addClass(validationFeedbackClass)\r\n .removeClass(removeValidationFeedbackClass)\r\n .html(text);\r\n\r\n formulario.find(\"textarea[name='\" + key + \"']\")\r\n .addClass(type)\r\n .parent()\r\n .find(\"#j_feedback[data-name='\" + key + \"']\")\r\n .addClass(validationFeedbackClass)\r\n .removeClass(removeValidationFeedbackClass)\r\n .html(text);\r\n\r\n formulario.find(\"#j_feedback[data-name='\" + key + \"']\")\r\n .addClass(type)\r\n .html(text);\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Limpar as mensagens de feedback do formulário\r\n */\r\nexport function messageFieldClear(\r\n form: string = \"\"\r\n): void {\r\n getElementDOM(\"#\" + form)\r\n .then(formulario => {\r\n if (formulario === null) {\r\n return;\r\n }\r\n\r\n let validationClass: string[] = [\"is-invalid\", \"is-valid\", \"p-invalid\"];\r\n let validationFeedbackClass: string[] = [\"invalid-feedback\", \"valid-feedback\"];\r\n\r\n $.each(formulario.find(\"input\"), function () {\r\n $(this)\r\n .removeClass(validationClass)\r\n .parent()\r\n .find(\"#j_feedback\")\r\n .removeClass(validationFeedbackClass)\r\n .html(\"\");\r\n\r\n $(this)\r\n .removeClass(validationClass)\r\n .parent()\r\n .parent()\r\n .find(\"#j_feedback\")\r\n .removeClass(validationFeedbackClass)\r\n .html(\"\");\r\n\r\n $(this)\r\n .removeClass(validationClass)\r\n .parent()\r\n .parent()\r\n .parent()\r\n .find(\"#j_feedback\")\r\n .removeClass(validationFeedbackClass)\r\n .html(\"\");\r\n });\r\n\r\n $.each(formulario.find(\"select\"), function () {\r\n $(this)\r\n .removeClass(validationClass)\r\n .parent()\r\n .find(\"#j_feedback\")\r\n .removeClass(validationFeedbackClass)\r\n .html(\"\");\r\n });\r\n\r\n $.each(formulario.find(\"textarea\"), function () {\r\n $(this)\r\n .removeClass(validationClass)\r\n .parent()\r\n .find(\"#j_feedback\")\r\n .removeClass(validationFeedbackClass)\r\n .html(\"\");\r\n });\r\n\r\n $.each(formulario.find(\"#j_feedback\"), function () {\r\n $(this).removeClass(validationClass).html(\"\");\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Ativa o TabView quando o campo apresenta erro\r\n */\r\nexport function tabViewActiveError(\r\n form: string = \"\",\r\n errors: IUtilsResponseError\r\n): void {\r\n getElementDOM(\"#\" + form)\r\n .then(TabView => {\r\n if (TabView === null) {\r\n return;\r\n }\r\n\r\n let fieldError = Object.keys(errors)[0];\r\n\r\n let TabViewSelected = TabView.find(\"*[id='\" + fieldError + \"']\").closest(\".tab-pane\");\r\n let TabViewSelectedId = TabViewSelected.attr(\"id\");\r\n let TabViewNav = TabViewSelected.parent().parent().find(\".nav\");\r\n\r\n TabViewSelected.parent(\".tab-content\").children(\".tab-pane\").each(function (_, value) {\r\n if (typeof value !== \"undefined\") {\r\n if ($(value).attr(\"id\") === TabViewSelectedId) {\r\n $(value).addClass(\"show active\");\r\n TabViewNav.find(\"button[data-bs-target='#\" + TabViewSelectedId + \"']\").addClass(\"active show\");\r\n } else {\r\n $(value).removeClass(\"show active\");\r\n TabViewNav.find(\"button[data-bs-target='#\" + $(value).attr(\"id\") + \"']\").removeClass(\"active\");\r\n }\r\n }\r\n });\r\n });\r\n}","import axios from \"axios\";\r\nimport { BASE, TOKEN } from \"./const\";\r\nimport { messageFieldClear, response } from \"./response\";\r\nimport { IUtilsRequestPostOptions, IUtilsResponseType } from \"./types\";\r\n\r\n/**\r\n * Simplifica a solicitação POST HTTP usando a biblioteca axios\r\n */\r\nexport function post<TypeDataResponse = IUtilsResponseType<any>>(\r\n route: string,\r\n body: any,\r\n form?: string,\r\n options?: IUtilsRequestPostOptions\r\n): Promise<TypeDataResponse> {\r\n return new Promise((resolve, reject) => {\r\n let url = BASE + (route.startsWith(\"/\") ? \"\" : \"/\") + route;\r\n messageFieldClear(form);\r\n handleToManyRequest(options?.url ?? url, options?.blockedToManyRequest ?? false);\r\n axios<TypeDataResponse>({\r\n method: \"post\",\r\n url: options?.url ?? url,\r\n headers: { \"X-CSRF-TOKEN\": TOKEN },\r\n data: !body ? {} : body,\r\n }).then(data => {\r\n if (data?.data !== undefined) {\r\n resolve(data.data);\r\n }\r\n if (typeof options?.blockedResponse !== \"boolean\" || options?.blockedResponse === false) {\r\n response<TypeDataResponse>((data?.data as IUtilsResponseType<TypeDataResponse>), form);\r\n }\r\n }).catch(error => {\r\n response<TypeDataResponse>(error.response?.data, form);\r\n reject(error);\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Bloqueia várias solicitações simultâneas\r\n */\r\nfunction handleToManyRequest(url: string, blocked: boolean): void {\r\n let requestCount = 0;\r\n axios.interceptors.request.use(config => {\r\n requestCount = requestCount + 1;\r\n if (requestCount > 1 && axios.getUri(config) === url && blocked) {\r\n return Promise.reject(new Error(\"Requisições bloqueadas!\"));\r\n }\r\n return config;\r\n });\r\n if (!blocked) {\r\n axios.interceptors.request.clear();\r\n }\r\n\r\n axios.interceptors.response.use(response => {\r\n requestCount = requestCount - 1;\r\n return response;\r\n }, function (error) {\r\n requestCount = requestCount - 1;\r\n return Promise.reject(error);\r\n });\r\n}"],"names":["sendMessage","params","Window","window","self","top","parent","message","library","type","options","postMessage","swal","icon","title","text","config","toast","position","showConfirmButton","timer","timerProgressBar","didOpen","onmouseenter","SweetAlert","stopTimer","onmouseleave","resumeTimer","mixin","fire","Snackbar","show","undefined","pos","showAction","customClass","getMetaContent","id","element","document","getElementById","url","replace","substr","slice","length","async","getCep","value","cep","axios","get","then","data","getElementDOM","preloadTimeOut","Promise","resolve","body","$","frameElement","parents","elementFound","find","setTimeout","iframe","contents","windowMessageEvent","addEventListener","event","USER","BASE","TOKEN","response","form","redirect","location","href","errors","messageField","accept","tabViewActiveError","formulario","validationFeedbackClass","removeValidationFeedbackClass","each","key","forEach","addClass","removeClass","html","messageFieldClear","validationClass","this","TabView","fieldError","Object","keys","TabViewSelected","closest","TabViewSelectedId","attr","TabViewNav","children","_","post","route","reject","startsWith","blocked","requestCount","interceptors","request","use","getUri","Error","clear","error","handleToManyRequest","blockedToManyRequest","method","headers","blockedResponse","catch"],"mappings":"mGA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