@ssplib/react-components 0.0.174 → 0.0.176
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.
|
@@ -54,7 +54,6 @@ const lab_1 = require("@mui/lab");
|
|
|
54
54
|
const material_1 = require("@mui/material");
|
|
55
55
|
const react_1 = __importStar(require("react"));
|
|
56
56
|
const form_1 = require("../../../context/form");
|
|
57
|
-
const Table_1 = __importDefault(require("../table/Table"));
|
|
58
57
|
const getKeys = (values, id) => {
|
|
59
58
|
if (!values || Object.keys(values).length <= 0)
|
|
60
59
|
return [];
|
|
@@ -69,260 +68,7 @@ function sleep(ms) {
|
|
|
69
68
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
70
69
|
}
|
|
71
70
|
function Teste() {
|
|
72
|
-
return (react_1.default.createElement(react_1.default.Fragment, null
|
|
73
|
-
react_1.default.createElement(Table_1.default, { columnSize: 11, action: () => react_1.default.createElement(react_1.default.Fragment, null), tableName: 'Evento', multipleDataPath: 'dtTableArr', csv: { fileName: 'Eventos' }, isPublic: true, columns: [
|
|
74
|
-
{
|
|
75
|
-
keyName: 'coSeqEventoExterno',
|
|
76
|
-
title: 'Protocolo',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
keyName: 'noEvento',
|
|
80
|
-
title: 'Nome',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
keyName: 'dtTableDates',
|
|
84
|
-
title: 'Datas',
|
|
85
|
-
size: 2,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
keyName: 'dsEnderecoLocal',
|
|
89
|
-
title: 'Local',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
keyName: 'noTableRa',
|
|
93
|
-
title: 'RA',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
keyName: 'nuPublicoMaximo',
|
|
97
|
-
title: 'Público Máximo',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
keyName: 'dtCadastro',
|
|
101
|
-
title: 'Data de Solicitação',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
keyName: 'nuProcessoFormatadoSei',
|
|
105
|
-
title: 'Processo SEI',
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
keyName: 'stEventoExterno',
|
|
109
|
-
title: 'Status do Evento',
|
|
110
|
-
},
|
|
111
|
-
], statusKeyName: 'stEventoExterno', csvButtonTitle: 'Baixar Eventos CSV', csvCustomKeyNames: {
|
|
112
|
-
noTableRa: 'RA',
|
|
113
|
-
protocoloProcessosei: 'Protocolo / Processo SEI',
|
|
114
|
-
coSeqEventoExterno: 'Protocolo',
|
|
115
|
-
noEvento: 'Nome do Evento',
|
|
116
|
-
dtCadastro: 'Data de Solicitação',
|
|
117
|
-
dtTableInicio: 'Data de Início',
|
|
118
|
-
hrTableInicio: 'Hora de Início',
|
|
119
|
-
dsEnderecoLocal: 'Endereço',
|
|
120
|
-
nuPublicoMaximo: 'Público Máximo',
|
|
121
|
-
nuProcessoFormatadoSei: 'Processo SEI',
|
|
122
|
-
stTableStatus: 'Status do Evento',
|
|
123
|
-
dtTableDates: 'Datas Cadastradas (Inicio | Termino)',
|
|
124
|
-
dsTableNaturezas: 'Naturezas',
|
|
125
|
-
stAcaoTransito: 'Ações de Trânsito',
|
|
126
|
-
}, csvExcludeKeysCSV: ['dtTableDates'], csvExcludeKeys: ['rlEventoData', 'stEventoExterno', 'dtTableArr'], fetchFunc: () => fetch('http://localhost:7171/table'),
|
|
127
|
-
// filtros
|
|
128
|
-
filters: {
|
|
129
|
-
Protocolo: [
|
|
130
|
-
{
|
|
131
|
-
keyName: 'coSeqEventoExterno',
|
|
132
|
-
type: 'a-z',
|
|
133
|
-
name: 'Ordernar em ordem crescente',
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
keyName: 'coSeqEventoExterno',
|
|
137
|
-
type: 'z-a',
|
|
138
|
-
name: 'Ordernar em ordem decrescente',
|
|
139
|
-
},
|
|
140
|
-
],
|
|
141
|
-
Nome: [
|
|
142
|
-
{
|
|
143
|
-
keyName: 'noEvento',
|
|
144
|
-
type: 'a-z',
|
|
145
|
-
name: 'Ordernar em ordem crescente',
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
keyName: 'noEvento',
|
|
149
|
-
type: 'z-a',
|
|
150
|
-
name: 'Ordernar em ordem decrescente',
|
|
151
|
-
},
|
|
152
|
-
],
|
|
153
|
-
Datas: [
|
|
154
|
-
{
|
|
155
|
-
type: 'date-interval',
|
|
156
|
-
keyName: 'dtTableDates',
|
|
157
|
-
name: 'Intervalo de Data',
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
type: 'data-a-z',
|
|
161
|
-
keyName: 'dtTableDates',
|
|
162
|
-
name: 'Data crescente',
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
type: 'data-z-a',
|
|
166
|
-
keyName: 'dtTableDates',
|
|
167
|
-
name: 'Data decrescente',
|
|
168
|
-
},
|
|
169
|
-
],
|
|
170
|
-
Local: [
|
|
171
|
-
{
|
|
172
|
-
keyName: 'dsEnderecoLocal',
|
|
173
|
-
type: 'a-z',
|
|
174
|
-
name: 'Ordernar em ordem crescente',
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
keyName: 'dsEnderecoLocal',
|
|
178
|
-
type: 'z-a',
|
|
179
|
-
name: 'Ordernar em ordem decrescente',
|
|
180
|
-
},
|
|
181
|
-
],
|
|
182
|
-
'Ato Público': [
|
|
183
|
-
{
|
|
184
|
-
type: 'items',
|
|
185
|
-
keyName: 'dsTableNaturezas',
|
|
186
|
-
name: '',
|
|
187
|
-
referenceKey: 'coSeqEventoExterno',
|
|
188
|
-
options: [
|
|
189
|
-
{
|
|
190
|
-
key: 'atopublico',
|
|
191
|
-
color: 'purple',
|
|
192
|
-
name: 'Somente Ato Público',
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
key: 'carnavalesco',
|
|
196
|
-
color: 'red',
|
|
197
|
-
name: 'Somente Carnavalesco',
|
|
198
|
-
},
|
|
199
|
-
],
|
|
200
|
-
},
|
|
201
|
-
],
|
|
202
|
-
RA: [
|
|
203
|
-
{
|
|
204
|
-
keyName: 'noTableRa',
|
|
205
|
-
type: 'a-z',
|
|
206
|
-
name: 'Ordernar em ordem crescente',
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
keyName: 'noTableRa',
|
|
210
|
-
type: 'z-a',
|
|
211
|
-
name: 'Ordernar em ordem decrescente',
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
type: 'items',
|
|
215
|
-
keyName: 'noTableRa',
|
|
216
|
-
name: '',
|
|
217
|
-
referenceKey: 'coSeqEventoExterno',
|
|
218
|
-
options: [
|
|
219
|
-
'água quente',
|
|
220
|
-
'águas claras',
|
|
221
|
-
'arapoanga',
|
|
222
|
-
'arniqueira',
|
|
223
|
-
'brazlândia',
|
|
224
|
-
'candangolândia',
|
|
225
|
-
'ceilândia',
|
|
226
|
-
'cruzeiro',
|
|
227
|
-
'fercal',
|
|
228
|
-
'gama',
|
|
229
|
-
'guará',
|
|
230
|
-
'itapoã',
|
|
231
|
-
'jardim botânico',
|
|
232
|
-
'lago norte',
|
|
233
|
-
'lago sul',
|
|
234
|
-
'núcleo bandeirante',
|
|
235
|
-
'paranoá',
|
|
236
|
-
'park way',
|
|
237
|
-
'planaltina',
|
|
238
|
-
'plano piloto',
|
|
239
|
-
'recanto das emas',
|
|
240
|
-
'riacho fundo',
|
|
241
|
-
'riacho fundo ii',
|
|
242
|
-
'samambaia',
|
|
243
|
-
'santa maria',
|
|
244
|
-
'são sebastião',
|
|
245
|
-
'scia/estrutural',
|
|
246
|
-
'sia',
|
|
247
|
-
'sobradinho',
|
|
248
|
-
'sobradinho ii',
|
|
249
|
-
'sol nascente e pôr do sol',
|
|
250
|
-
'sudoeste/octogonal',
|
|
251
|
-
'taguatinga',
|
|
252
|
-
'varjão',
|
|
253
|
-
'vicente pires',
|
|
254
|
-
].map((x) => ({
|
|
255
|
-
key: x,
|
|
256
|
-
color: 'black',
|
|
257
|
-
name: x.toUpperCase(),
|
|
258
|
-
})),
|
|
259
|
-
},
|
|
260
|
-
],
|
|
261
|
-
'Público Máximo': [
|
|
262
|
-
{
|
|
263
|
-
keyName: 'nuPublicoMaximo',
|
|
264
|
-
type: 'a-z',
|
|
265
|
-
name: 'Ordernar em ordem crescente',
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
keyName: 'nuPublicoMaximo',
|
|
269
|
-
type: 'z-a',
|
|
270
|
-
name: 'Ordernar em ordem decrescente',
|
|
271
|
-
},
|
|
272
|
-
],
|
|
273
|
-
'Data de Solicitação': [
|
|
274
|
-
{
|
|
275
|
-
type: 'data-a-z',
|
|
276
|
-
keyName: 'dtCadastro',
|
|
277
|
-
name: 'Ordem crescente',
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
type: 'data-z-a',
|
|
281
|
-
keyName: 'dtCadastro',
|
|
282
|
-
name: 'Ordem decrescente',
|
|
283
|
-
},
|
|
284
|
-
],
|
|
285
|
-
Status: [
|
|
286
|
-
{
|
|
287
|
-
type: 'items',
|
|
288
|
-
keyName: 'stEventoExterno',
|
|
289
|
-
name: '',
|
|
290
|
-
referenceKey: 'coSeqEventoExterno',
|
|
291
|
-
options: [
|
|
292
|
-
{
|
|
293
|
-
key: 'p',
|
|
294
|
-
color: '#F59E0B',
|
|
295
|
-
name: 'EM ANÁLISE',
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
key: 'a',
|
|
299
|
-
color: '#0EA5E9',
|
|
300
|
-
name: 'CADASTRADO',
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
key: 'c',
|
|
304
|
-
color: '#a1a1a1',
|
|
305
|
-
name: 'CANCELADO',
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
key: 'r',
|
|
309
|
-
color: '#EF4444',
|
|
310
|
-
name: 'REPROVADO',
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
key: 'l',
|
|
314
|
-
color: '#22C55E',
|
|
315
|
-
name: 'LICENCIADO',
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
key: 'fp',
|
|
319
|
-
color: '#991b1b',
|
|
320
|
-
name: 'FORA DO PRAZO',
|
|
321
|
-
},
|
|
322
|
-
],
|
|
323
|
-
},
|
|
324
|
-
],
|
|
325
|
-
} })));
|
|
71
|
+
return (react_1.default.createElement(react_1.default.Fragment, null));
|
|
326
72
|
}
|
|
327
73
|
exports.Teste = Teste;
|
|
328
74
|
function Stepper(_a) {
|
|
@@ -382,9 +128,9 @@ function Stepper(_a) {
|
|
|
382
128
|
react_1.default.createElement(material_1.Button, { variant: 'contained', color: 'error', onClick: preencher }, "EXCLUIR BANCO PRODU\u00C7\u00C3O"))),
|
|
383
129
|
react_1.default.createElement(material_1.Stack, { sx: { padding: 2, marginBottom: 10 } },
|
|
384
130
|
react_1.default.createElement(material_1.Box, null, stepperBlocks.map((b, index) => (react_1.default.createElement(material_1.Box, { key: 'formsB' + index, hidden: !(activeStep === index) }, stepperBlocks[index])))),
|
|
385
|
-
react_1.default.createElement(material_1.MobileStepper, { variant: 'text', steps: maxSteps,
|
|
386
|
-
// position=
|
|
387
|
-
activeStep: activeStep, sx: { paddingX: 2, paddingTop: 2, paddingBottom: 4 }, backButton: react_1.default.createElement(material_1.Button, { variant: 'contained', startIcon: react_1.default.createElement(KeyboardArrowLeft_1.default, null), onClick: handleBack, disabled: activeStep === 0, sx: { textTransform: 'none' } }, "Voltar"), nextButton: activeStep < maxSteps - 1 ? (react_1.default.createElement(material_1.Button, { variant: 'contained', endIcon: react_1.default.createElement(KeyboardArrowRight_1.default, null), onClick: handleNext, sx: { textTransform: 'none' }, ref: nRef }, "Pr\u00F3ximo")) : (react_1.default.createElement(material_1.Box, null,
|
|
131
|
+
react_1.default.createElement(material_1.MobileStepper, { variant: 'text', steps: maxSteps,
|
|
132
|
+
// position='bottom'
|
|
133
|
+
position: (0, material_1.useMediaQuery)(theme.breakpoints.only('xs')) ? 'bottom' : 'static', activeStep: activeStep, sx: { paddingX: 2, paddingTop: 2, paddingBottom: 4 }, backButton: react_1.default.createElement(material_1.Button, { variant: 'contained', startIcon: react_1.default.createElement(KeyboardArrowLeft_1.default, null), onClick: handleBack, disabled: activeStep === 0, sx: { textTransform: 'none' } }, "Voltar"), nextButton: activeStep < maxSteps - 1 ? (react_1.default.createElement(material_1.Button, { variant: 'contained', endIcon: react_1.default.createElement(KeyboardArrowRight_1.default, null), onClick: handleNext, sx: { textTransform: 'none' }, ref: nRef }, "Pr\u00F3ximo")) : (react_1.default.createElement(material_1.Box, null,
|
|
388
134
|
react_1.default.createElement(lab_1.LoadingButton, { variant: 'contained', type: 'submit', loading: context.submiting, loadingPosition: 'start', startIcon: react_1.default.createElement(Save_1.default, null), onClick: (e) => nextCheck(e), sx: { textTransform: 'none', backgroundColor: '#22C55E', '&:hover': { backgroundColor: '#48cf7a' } } },
|
|
389
135
|
react_1.default.createElement("span", null, "Salvar")))) })),
|
|
390
136
|
react_1.default.createElement(material_1.Snackbar, { open: canPass, autoHideDuration: 3000, onClose: () => setCanPass(false), anchorOrigin: {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const cookieName = "nextauth.token";
|
|
3
|
-
export declare function KeycloakAuthProvider({ url, realm, clientId, children, type }: {
|
|
3
|
+
export declare function KeycloakAuthProvider({ url, realm, clientId, children, type, resource_name, }: {
|
|
4
4
|
url: string;
|
|
5
5
|
realm: string;
|
|
6
6
|
clientId: string;
|
|
7
7
|
children: JSX.Element | JSX.Element[];
|
|
8
8
|
type?: 'govbr' | 'ad';
|
|
9
|
+
resource_name?: string;
|
|
9
10
|
}): JSX.Element;
|
|
@@ -33,7 +33,7 @@ const auth_1 = require("../../context/auth");
|
|
|
33
33
|
const keycloak_js_1 = __importDefault(require("keycloak-js"));
|
|
34
34
|
exports.cookieName = 'nextauth.token';
|
|
35
35
|
const userImgName = 'user-data.img';
|
|
36
|
-
function KeycloakAuthProvider({ url, realm, clientId, children, type = 'ad' }) {
|
|
36
|
+
function KeycloakAuthProvider({ url, realm, clientId, children, type = 'ad', resource_name = 'eventos-front', }) {
|
|
37
37
|
const [user, setUser] = (0, react_1.useState)();
|
|
38
38
|
const [userLoaded, setUserLoaded] = (0, react_1.useState)(false);
|
|
39
39
|
const [kc, setKc] = (0, react_1.useState)(null);
|
|
@@ -61,7 +61,7 @@ function KeycloakAuthProvider({ url, realm, clientId, children, type = 'ad' }) {
|
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
63
|
const tokenParsed = keycloak.tokenParsed;
|
|
64
|
-
const userData = Object.assign(Object.assign({}, tokenParsed), { token: keycloak.token, roles: ((_b = ((_a = tokenParsed === null || tokenParsed === void 0 ? void 0 : tokenParsed.resource_access) !== null && _a !== void 0 ? _a : {})[
|
|
64
|
+
const userData = Object.assign(Object.assign({}, tokenParsed), { token: keycloak.token, roles: ((_b = ((_a = tokenParsed === null || tokenParsed === void 0 ? void 0 : tokenParsed.resource_access) !== null && _a !== void 0 ? _a : {})[resource_name]) !== null && _b !== void 0 ? _b : []).roles });
|
|
65
65
|
setUser(userData);
|
|
66
66
|
console.info('Authenticated!!!');
|
|
67
67
|
keycloak.onTokenExpired = () => {
|
|
@@ -83,8 +83,6 @@ function KeycloakAuthProvider({ url, realm, clientId, children, type = 'ad' }) {
|
|
|
83
83
|
}
|
|
84
84
|
function logout() {
|
|
85
85
|
setUserLoaded(false);
|
|
86
|
-
console.log('TENTANDO DESLOGAR');
|
|
87
|
-
console.log(kc);
|
|
88
86
|
kc === null || kc === void 0 ? void 0 : kc.logout();
|
|
89
87
|
setUser(null);
|
|
90
88
|
localStorage.removeItem(userImgName);
|