teraprox-ui-kit 0.1.10 → 0.2.1
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/index.css +198 -25
- package/dist/index.d.mts +96 -30
- package/dist/index.d.ts +96 -30
- package/dist/index.js +1512 -1116
- package/dist/index.mjs +1519 -1109
- package/package.json +11 -2
package/dist/index.js
CHANGED
|
@@ -33,11 +33,16 @@ __export(index_exports, {
|
|
|
33
33
|
ActionButtons: () => ActionButtons,
|
|
34
34
|
AddButton: () => AddButton_default,
|
|
35
35
|
AdvancedFilterBar: () => AdvancedFilterBar,
|
|
36
|
+
AnexoManager: () => import_ui_kit_core.AnexoManager,
|
|
36
37
|
ApproveAndReproveButtons: () => ApproveAndReproveButtons,
|
|
37
38
|
AsyncButton: () => AsyncButton,
|
|
38
39
|
AutoComplete: () => AutoComplete,
|
|
39
40
|
BonusButton: () => BonusButton,
|
|
41
|
+
BranchDropDisplay: () => import_ui_kit_sgm.BranchDropDisplay,
|
|
40
42
|
ButtonWithDropdown: () => ButtonWithDropdown,
|
|
43
|
+
CalculadoraCorrecaoModal: () => import_ui_kit_sgp.CalculadoraCorrecaoModal,
|
|
44
|
+
CalculoCorrecao: () => import_ui_kit_sgp.CalculoCorrecao,
|
|
45
|
+
CampoDeVerificacaoV2: () => import_ui_kit_sgp.CampoDeVerificacaoV2,
|
|
41
46
|
CheckBox: () => CheckBox,
|
|
42
47
|
ClickToWriteField: () => ClickToWriteField,
|
|
43
48
|
ColorPicker: () => ColorPicker,
|
|
@@ -45,8 +50,9 @@ __export(index_exports, {
|
|
|
45
50
|
DeleteButton: () => DeleteButton_default,
|
|
46
51
|
DeleteConfirm: () => DeleteConfirm,
|
|
47
52
|
ExpandableCard: () => ExpandableCard,
|
|
48
|
-
FindRecursoByTagField: () => FindRecursoByTagField,
|
|
53
|
+
FindRecursoByTagField: () => import_ui_kit_sgm3.FindRecursoByTagField,
|
|
49
54
|
FormField: () => FormField,
|
|
55
|
+
FrequenciaFormV2: () => import_ui_kit_sgp.FrequenciaFormV2,
|
|
50
56
|
Generic3DotMenu: () => Generic3DotMenu,
|
|
51
57
|
GenericChart: () => GenericChart,
|
|
52
58
|
GenericDisplay: () => GenericDisplay_default,
|
|
@@ -69,7 +75,8 @@ __export(index_exports, {
|
|
|
69
75
|
PeriodSelector: () => PeriodSelector,
|
|
70
76
|
QrCodeScanButton: () => QrCodeScanButton,
|
|
71
77
|
QrReader: () => QrReader,
|
|
72
|
-
|
|
78
|
+
RateLimitBar: () => RateLimitBar,
|
|
79
|
+
RecursoDisplayer: () => import_ui_kit_sgm2.RecursoDisplayer,
|
|
73
80
|
ResponsiveContainer: () => ResponsiveContainer_default,
|
|
74
81
|
ReusableTableWithModal: () => ReusableTableWithModal,
|
|
75
82
|
SectorSelector: () => SectorSelector,
|
|
@@ -80,9 +87,12 @@ __export(index_exports, {
|
|
|
80
87
|
StatusPills: () => StatusPills,
|
|
81
88
|
Switch: () => Switch,
|
|
82
89
|
SwitchOnClick: () => SwitchOnClick,
|
|
90
|
+
TarefaUnidadeForm: () => import_ui_kit_sgp.TarefaUnidadeForm,
|
|
83
91
|
TextWithMore: () => TextWithMore,
|
|
84
92
|
TimerDisplay: () => TimerDisplay,
|
|
93
|
+
UnidadeMaterialCard: () => import_ui_kit_sgp.UnidadeMaterialCard,
|
|
85
94
|
UnidadeMaterialForm: () => UnidadeMaterialForm,
|
|
95
|
+
UnifiedPeriodSelector: () => UnifiedPeriodSelector,
|
|
86
96
|
UploadArea: () => UploadArea,
|
|
87
97
|
UuidPill: () => UuidPill_default,
|
|
88
98
|
VerticalItemsDisplay: () => VerticalItemsDisplay
|
|
@@ -105,21 +115,20 @@ var AddButton = ({ callback, hiddenBool, size }) => /* @__PURE__ */ (0, import_j
|
|
|
105
115
|
var AddButton_default = AddButton;
|
|
106
116
|
|
|
107
117
|
// src/buttons/DeleteButton.tsx
|
|
108
|
-
var import_react_bootstrap2 = require("react-bootstrap");
|
|
109
118
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
110
119
|
var DeleteButton = ({ title, onDeleteClick }) => {
|
|
111
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("button", { className: "btn btn-danger", onClick: () => onDeleteClick(), children: title });
|
|
112
121
|
};
|
|
113
122
|
var DeleteButton_default = DeleteButton;
|
|
114
123
|
|
|
115
124
|
// src/buttons/ActionButtons.tsx
|
|
116
125
|
var import_react2 = require("react");
|
|
117
|
-
var
|
|
126
|
+
var import_react_bootstrap3 = require("react-bootstrap");
|
|
118
127
|
var import_fi = require("react-icons/fi");
|
|
119
128
|
|
|
120
129
|
// src/forms/DeleteConfirm.tsx
|
|
121
130
|
var import_react = require("react");
|
|
122
|
-
var
|
|
131
|
+
var import_react_bootstrap2 = require("react-bootstrap");
|
|
123
132
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
124
133
|
var DeleteConfirm = ({
|
|
125
134
|
show,
|
|
@@ -141,14 +150,14 @@ var DeleteConfirm = ({
|
|
|
141
150
|
if (!needExclusionDetails) return true;
|
|
142
151
|
return exclusionDetails.length >= 8;
|
|
143
152
|
};
|
|
144
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
145
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
146
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
153
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_bootstrap2.Modal, { show, onHide: () => onHide(false), centered: true, children: [
|
|
154
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_bootstrap2.Modal.Header, { closeButton: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_bootstrap2.Modal.Title, { children: title }) }),
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_bootstrap2.Modal.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "d-flex flex-column gap-3", children: [
|
|
147
156
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("strong", { children: getDialogContent() }) }),
|
|
148
|
-
needExclusionDetails && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
149
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
157
|
+
needExclusionDetails && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_bootstrap2.Form.Group, { children: [
|
|
158
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_bootstrap2.Form.Label, { children: "Motivo da Exclus\xE3o (m\xEDn. 8 caracteres)" }),
|
|
150
159
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
151
|
-
|
|
160
|
+
import_react_bootstrap2.Form.Control,
|
|
152
161
|
{
|
|
153
162
|
as: "textarea",
|
|
154
163
|
rows: 3,
|
|
@@ -160,10 +169,10 @@ var DeleteConfirm = ({
|
|
|
160
169
|
)
|
|
161
170
|
] })
|
|
162
171
|
] }) }),
|
|
163
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
164
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
172
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_bootstrap2.Modal.Footer, { children: [
|
|
173
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_bootstrap2.Button, { variant: "secondary", onClick: () => onHide(false), children: "Cancelar" }),
|
|
165
174
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
166
|
-
|
|
175
|
+
import_react_bootstrap2.Button,
|
|
167
176
|
{
|
|
168
177
|
variant: "danger",
|
|
169
178
|
disabled: !isConfirmEnabled(),
|
|
@@ -230,7 +239,7 @@ var ActionButtons = ({
|
|
|
230
239
|
if (useDelayedDelete) {
|
|
231
240
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { style: { position: "relative", display: "inline-block", margin: 2 }, children: [
|
|
232
241
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
233
|
-
|
|
242
|
+
import_react_bootstrap3.Button,
|
|
234
243
|
{
|
|
235
244
|
variant: "outline-danger",
|
|
236
245
|
onMouseDown: startHold,
|
|
@@ -247,7 +256,7 @@ var ActionButtons = ({
|
|
|
247
256
|
}
|
|
248
257
|
),
|
|
249
258
|
isHolding && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
250
|
-
|
|
259
|
+
import_react_bootstrap3.ProgressBar,
|
|
251
260
|
{
|
|
252
261
|
now: progress,
|
|
253
262
|
style: {
|
|
@@ -264,7 +273,7 @@ var ActionButtons = ({
|
|
|
264
273
|
] });
|
|
265
274
|
}
|
|
266
275
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
267
|
-
|
|
276
|
+
import_react_bootstrap3.Button,
|
|
268
277
|
{
|
|
269
278
|
variant: "danger",
|
|
270
279
|
onClick: () => setShowConfirm(true),
|
|
@@ -288,21 +297,21 @@ var ActionButtons = ({
|
|
|
288
297
|
needExclusionDetails
|
|
289
298
|
}
|
|
290
299
|
),
|
|
291
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
292
|
-
onBack && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_bootstrap3.Form.Group, { className: "d-flex flex-wrap align-items-center mt-3 gap-1", children: [
|
|
301
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_bootstrap3.Button, { variant: "outline-secondary", onClick: onBack, disabled, style: { margin: 2 }, children: [
|
|
293
302
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fi.FiChevronLeft, { className: "me-2" }),
|
|
294
303
|
backLabel
|
|
295
304
|
] }),
|
|
296
|
-
isEditing && onCancelEdit && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
305
|
+
isEditing && onCancelEdit && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_bootstrap3.Button, { variant: "warning", onClick: onCancelEdit, disabled, style: { margin: 2 }, children: [
|
|
297
306
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fi.FiRotateCcw, { className: "me-2" }),
|
|
298
307
|
cancelEditLabel
|
|
299
308
|
] }),
|
|
300
309
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PermissionWrapper, { children: renderDeleteButton() }),
|
|
301
|
-
onSave && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
310
|
+
onSave && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_bootstrap3.Button, { variant: saveVariant, onClick: onSave, disabled, style: { margin: 2 }, children: [
|
|
302
311
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fi.FiSave, { className: "me-2" }),
|
|
303
312
|
saveLabel
|
|
304
313
|
] }),
|
|
305
|
-
isEditing && onCopy && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
314
|
+
isEditing && onCopy && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react_bootstrap3.Button, { variant: "outline-primary", onClick: onCopy, disabled, style: { margin: 2 }, children: [
|
|
306
315
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_fi.FiCopy, { className: "me-2" }),
|
|
307
316
|
copyLabel
|
|
308
317
|
] })
|
|
@@ -312,7 +321,7 @@ var ActionButtons = ({
|
|
|
312
321
|
|
|
313
322
|
// src/buttons/ApproveAndReproveButtons.tsx
|
|
314
323
|
var import_react3 = require("react");
|
|
315
|
-
var
|
|
324
|
+
var import_react_bootstrap4 = require("react-bootstrap");
|
|
316
325
|
var import_gr2 = require("react-icons/gr");
|
|
317
326
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
318
327
|
var ApproveAndReproveButtons = ({
|
|
@@ -336,20 +345,20 @@ var ApproveAndReproveButtons = ({
|
|
|
336
345
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
|
|
337
346
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("strong", { children: headerText }),
|
|
338
347
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("br", {}),
|
|
339
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
340
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
348
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_bootstrap4.Button, { onClick: approveCallback, variant: "success", className: "me-1", children: approveText ? approveText : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_gr2.GrCheckmark, { size: buttonSize }) }),
|
|
349
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_bootstrap4.Button, { onClick: reproveCallback, variant: "danger", children: repproveText ? repproveText : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_gr2.GrClose, { size: buttonSize }) })
|
|
341
350
|
] });
|
|
342
351
|
};
|
|
343
352
|
|
|
344
353
|
// src/buttons/AsyncButton.tsx
|
|
345
354
|
var import_react4 = require("react");
|
|
346
|
-
var
|
|
355
|
+
var import_react_bootstrap6 = require("react-bootstrap");
|
|
347
356
|
|
|
348
357
|
// src/progress/LoadingProgress.tsx
|
|
349
|
-
var
|
|
358
|
+
var import_react_bootstrap5 = require("react-bootstrap");
|
|
350
359
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
351
360
|
var LoadingProgress = ({ hidden }) => {
|
|
352
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_bootstrap5.Spinner, { hidden, animation: "border", role: "status", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "visually-hidden", children: "Carregando..." }) });
|
|
353
362
|
};
|
|
354
363
|
|
|
355
364
|
// src/buttons/AsyncButton.tsx
|
|
@@ -386,7 +395,7 @@ var AsyncButton = ({
|
|
|
386
395
|
}) => {
|
|
387
396
|
const { loading, execute } = useAsyncAction();
|
|
388
397
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
389
|
-
|
|
398
|
+
import_react_bootstrap6.Button,
|
|
390
399
|
{
|
|
391
400
|
...buttonProps,
|
|
392
401
|
onClick: () => execute(onClick),
|
|
@@ -418,7 +427,7 @@ var BonusButton = ({
|
|
|
418
427
|
};
|
|
419
428
|
|
|
420
429
|
// src/buttons/ButtonWithDropdown.tsx
|
|
421
|
-
var
|
|
430
|
+
var import_react_bootstrap7 = require("react-bootstrap");
|
|
422
431
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
423
432
|
var ButtonWithDropdown = ({
|
|
424
433
|
title,
|
|
@@ -429,15 +438,14 @@ var ButtonWithDropdown = ({
|
|
|
429
438
|
toggleVariant
|
|
430
439
|
}) => {
|
|
431
440
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
432
|
-
|
|
441
|
+
import_react_bootstrap7.Dropdown,
|
|
433
442
|
{
|
|
434
|
-
as:
|
|
443
|
+
as: import_react_bootstrap7.ButtonGroup,
|
|
435
444
|
className: "d-flex w-100",
|
|
436
445
|
style: { flex: 1, minWidth: 0 },
|
|
437
|
-
menuVariant,
|
|
438
446
|
children: [
|
|
439
447
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
440
|
-
|
|
448
|
+
import_react_bootstrap7.Button,
|
|
441
449
|
{
|
|
442
450
|
variant,
|
|
443
451
|
onClick: onClickButton,
|
|
@@ -447,7 +455,7 @@ var ButtonWithDropdown = ({
|
|
|
447
455
|
}
|
|
448
456
|
),
|
|
449
457
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
450
|
-
|
|
458
|
+
import_react_bootstrap7.Dropdown.Toggle,
|
|
451
459
|
{
|
|
452
460
|
split: true,
|
|
453
461
|
variant: toggleVariant || variant,
|
|
@@ -462,14 +470,14 @@ var ButtonWithDropdown = ({
|
|
|
462
470
|
}
|
|
463
471
|
}
|
|
464
472
|
),
|
|
465
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
473
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_bootstrap7.Dropdown.Menu, { variant: menuVariant, children: options.map((opt, idx) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react_bootstrap7.Dropdown.Item, { onClick: opt.callback, children: opt.label }, `${opt.label}-${idx}`)) })
|
|
466
474
|
]
|
|
467
475
|
}
|
|
468
476
|
);
|
|
469
477
|
};
|
|
470
478
|
|
|
471
479
|
// src/buttons/CheckBox.tsx
|
|
472
|
-
var
|
|
480
|
+
var import_react_bootstrap8 = require("react-bootstrap");
|
|
473
481
|
var import_ti = require("react-icons/ti");
|
|
474
482
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
475
483
|
var CheckBox = ({
|
|
@@ -483,10 +491,10 @@ var CheckBox = ({
|
|
|
483
491
|
className = ""
|
|
484
492
|
}) => {
|
|
485
493
|
if (isHover) {
|
|
486
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: opcoes.map((opcao, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
487
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, children: opcoes.map((opcao, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react_bootstrap8.InputGroup, { style: { padding: 12, justifyItems: "center", opacity: disabled ? 0.5 : 1, pointerEvents: disabled ? "none" : "auto" }, children: [
|
|
495
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react_bootstrap8.InputGroup.Checkbox, {}),
|
|
488
496
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
489
|
-
|
|
497
|
+
import_react_bootstrap8.Form.Control,
|
|
490
498
|
{
|
|
491
499
|
autoFocus: true,
|
|
492
500
|
onKeyDown: (event) => enterEvent && enterEvent(event, index, opcao),
|
|
@@ -499,7 +507,7 @@ var CheckBox = ({
|
|
|
499
507
|
] }, index)) });
|
|
500
508
|
}
|
|
501
509
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className, style: { textAlign: "start" }, children: opcoes.map((opcao, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
502
|
-
|
|
510
|
+
import_react_bootstrap8.Form.Check,
|
|
503
511
|
{
|
|
504
512
|
disabled,
|
|
505
513
|
type: "checkbox",
|
|
@@ -511,7 +519,7 @@ var CheckBox = ({
|
|
|
511
519
|
|
|
512
520
|
// src/buttons/Generic3DotMenu.tsx
|
|
513
521
|
var import_react5 = require("react");
|
|
514
|
-
var
|
|
522
|
+
var import_react_bootstrap9 = require("react-bootstrap");
|
|
515
523
|
var import_ci = require("react-icons/ci");
|
|
516
524
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
517
525
|
var MenuEvent = class {
|
|
@@ -552,14 +560,14 @@ var Generic3DotMenu = ({
|
|
|
552
560
|
}, {});
|
|
553
561
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
554
562
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_ci.CiMenuKebab, { onClick: handleShow, style: { cursor: "pointer" }, size: 25, title: tittle }),
|
|
555
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
556
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
557
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
563
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_bootstrap9.Modal, { show, onHide: handleClose, centered: true, children: [
|
|
564
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap9.Modal.Header, { closeButton: true, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap9.Modal.Title, { children: tittle }) }),
|
|
565
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_react_bootstrap9.Modal.Body, { children: [
|
|
558
566
|
Object.keys(groupedEvents).length === 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "text-center text-muted", children: "Nenhuma op\xE7\xE3o dispon\xEDvel." }),
|
|
559
567
|
Object.keys(groupedEvents).map((section, sectionIndex) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "mb-4", children: [
|
|
560
568
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h6", { className: "border-bottom pb-2 mb-3", children: section !== "default" ? section : "Op\xE7\xF5es Principais" }),
|
|
561
569
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "d-grid gap-2", children: groupedEvents[section].map((event, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
562
|
-
|
|
570
|
+
import_react_bootstrap9.Button,
|
|
563
571
|
{
|
|
564
572
|
variant: event.variant || "primary",
|
|
565
573
|
onClick: () => {
|
|
@@ -572,13 +580,13 @@ var Generic3DotMenu = ({
|
|
|
572
580
|
)) })
|
|
573
581
|
] }, sectionIndex))
|
|
574
582
|
] }),
|
|
575
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap9.Modal.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_bootstrap9.Button, { variant: "secondary", onClick: handleClose, children: "Fechar" }) })
|
|
576
584
|
] })
|
|
577
585
|
] });
|
|
578
586
|
};
|
|
579
587
|
|
|
580
588
|
// src/buttons/LoadingButton.tsx
|
|
581
|
-
var
|
|
589
|
+
var import_react_bootstrap10 = require("react-bootstrap");
|
|
582
590
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
583
591
|
var LoadingButton = ({
|
|
584
592
|
onClick,
|
|
@@ -593,7 +601,7 @@ var LoadingButton = ({
|
|
|
593
601
|
...props
|
|
594
602
|
}) => {
|
|
595
603
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
596
|
-
|
|
604
|
+
import_react_bootstrap10.Button,
|
|
597
605
|
{
|
|
598
606
|
variant,
|
|
599
607
|
size,
|
|
@@ -604,7 +612,7 @@ var LoadingButton = ({
|
|
|
604
612
|
...props,
|
|
605
613
|
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "align-items-center", children: [
|
|
606
614
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
607
|
-
|
|
615
|
+
import_react_bootstrap10.Spinner,
|
|
608
616
|
{
|
|
609
617
|
as: "span",
|
|
610
618
|
animation: "border",
|
|
@@ -624,7 +632,7 @@ var LoadingButton = ({
|
|
|
624
632
|
};
|
|
625
633
|
|
|
626
634
|
// src/buttons/NavigateButton.tsx
|
|
627
|
-
var
|
|
635
|
+
var import_react_bootstrap11 = require("react-bootstrap");
|
|
628
636
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
629
637
|
var NavigateButton = ({
|
|
630
638
|
displayName,
|
|
@@ -644,7 +652,7 @@ var NavigateButton = ({
|
|
|
644
652
|
navigator2(path, config, pageName);
|
|
645
653
|
};
|
|
646
654
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
647
|
-
|
|
655
|
+
import_react_bootstrap11.Button,
|
|
648
656
|
{
|
|
649
657
|
style,
|
|
650
658
|
variant,
|
|
@@ -656,7 +664,7 @@ var NavigateButton = ({
|
|
|
656
664
|
};
|
|
657
665
|
|
|
658
666
|
// src/buttons/StatusBadge.tsx
|
|
659
|
-
var
|
|
667
|
+
var import_react_bootstrap12 = require("react-bootstrap");
|
|
660
668
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
661
669
|
var StatusBadge = ({
|
|
662
670
|
status,
|
|
@@ -674,9 +682,9 @@ var StatusBadge = ({
|
|
|
674
682
|
CANCELED: "bg-danger text-white"
|
|
675
683
|
};
|
|
676
684
|
const badgeClass = statusClasses[status] || "bg-secondary text-white";
|
|
677
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "d-flex align-items-center gap-2", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "d-flex align-items-center gap-2", children: loading ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_bootstrap12.Spinner, { animation: "border", size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
678
686
|
showCheckbox && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
679
|
-
|
|
687
|
+
import_react_bootstrap12.Form.Check,
|
|
680
688
|
{
|
|
681
689
|
type: "checkbox",
|
|
682
690
|
checked,
|
|
@@ -825,7 +833,7 @@ var GenericREchart = ({
|
|
|
825
833
|
};
|
|
826
834
|
|
|
827
835
|
// src/containers/ResponsiveContainer.tsx
|
|
828
|
-
var
|
|
836
|
+
var import_react_bootstrap13 = require("react-bootstrap");
|
|
829
837
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
830
838
|
var ResponsiveContainer2 = ({
|
|
831
839
|
title,
|
|
@@ -839,16 +847,16 @@ var ResponsiveContainer2 = ({
|
|
|
839
847
|
setShow(false);
|
|
840
848
|
if (onClose) onClose();
|
|
841
849
|
};
|
|
842
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
843
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
844
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react_bootstrap13.Modal, { size: "lg", show, onHide: handleClose, scrollable, children: [
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_bootstrap13.Modal.Header, { closeButton: true, onClick: handleClose, children: title && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_bootstrap13.Modal.Title, { children: title }) }),
|
|
852
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react_bootstrap13.ModalBody, { children })
|
|
845
853
|
] });
|
|
846
854
|
};
|
|
847
855
|
var ResponsiveContainer_default = ResponsiveContainer2;
|
|
848
856
|
|
|
849
857
|
// src/containers/ExpandableCard.tsx
|
|
850
858
|
var import_react7 = require("react");
|
|
851
|
-
var
|
|
859
|
+
var import_react_bootstrap14 = require("react-bootstrap");
|
|
852
860
|
var import_fa2 = require("react-icons/fa");
|
|
853
861
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
854
862
|
var ExpandableCard = ({
|
|
@@ -871,15 +879,15 @@ var ExpandableCard = ({
|
|
|
871
879
|
const renderContentWithToggle = (content) => {
|
|
872
880
|
return content;
|
|
873
881
|
};
|
|
874
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
882
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_bootstrap14.Card, { className: `expandable-card ${cardClassName}`, children: [
|
|
875
883
|
leftSideContent && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "expandable-card-left-side", children: leftSideContent }),
|
|
876
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react_bootstrap14.Card.Body, { className: `expandable-card-body ${cardBodyClassName}`, style: cardBodyStyle, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_bootstrap14.ListGroup, { variant: "flush", children: [
|
|
877
885
|
visibleItems.map((item, index) => {
|
|
878
886
|
const isObject = typeof item === "object" && item !== null && "content" in item;
|
|
879
887
|
const itemObj = isObject ? item : { content: item };
|
|
880
888
|
const clickableClass = itemObj.clickable ? "expandable-card-list-item-clickable" : "";
|
|
881
889
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
882
|
-
|
|
890
|
+
import_react_bootstrap14.ListGroup.Item,
|
|
883
891
|
{
|
|
884
892
|
className: `expandable-card-list-item ${clickableClass}`,
|
|
885
893
|
children: isMobile ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "expandable-card-item", children: [
|
|
@@ -897,7 +905,7 @@ var ExpandableCard = ({
|
|
|
897
905
|
);
|
|
898
906
|
}),
|
|
899
907
|
shouldShowExpandButton && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
900
|
-
|
|
908
|
+
import_react_bootstrap14.ListGroup.Item,
|
|
901
909
|
{
|
|
902
910
|
className: `expandable-card-toggle ${expandedCard ? "expanded" : ""}`,
|
|
903
911
|
onClick: handleToggleExpandCard,
|
|
@@ -911,7 +919,7 @@ var ExpandableCard = ({
|
|
|
911
919
|
|
|
912
920
|
// src/displays/UuidPill.tsx
|
|
913
921
|
var import_react8 = require("react");
|
|
914
|
-
var
|
|
922
|
+
var import_react_bootstrap15 = require("react-bootstrap");
|
|
915
923
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
916
924
|
var UuidPill = ({ uuid, bg = "light", textColor = "dark", short = 8 }) => {
|
|
917
925
|
const [copied, setCopied] = (0, import_react8.useState)(false);
|
|
@@ -936,7 +944,7 @@ var UuidPill = ({ uuid, bg = "light", textColor = "dark", short = 8 }) => {
|
|
|
936
944
|
};
|
|
937
945
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
938
946
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
939
|
-
|
|
947
|
+
import_react_bootstrap15.Badge,
|
|
940
948
|
{
|
|
941
949
|
ref,
|
|
942
950
|
bg,
|
|
@@ -956,7 +964,7 @@ var UuidPill = ({ uuid, bg = "light", textColor = "dark", short = 8 }) => {
|
|
|
956
964
|
]
|
|
957
965
|
}
|
|
958
966
|
),
|
|
959
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
967
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_bootstrap15.Overlay, { target: ref.current, show: showTooltip, placement: "top", children: (props) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_bootstrap15.Tooltip, { ...props, children: copied ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { style: { color: "#6f6" }, children: "Copiado!" }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { style: { fontFamily: "monospace", fontSize: "0.75rem" }, children: [
|
|
960
968
|
uuid,
|
|
961
969
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("br", {}),
|
|
962
970
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("small", { className: "text-muted", children: "Clique para copiar" })
|
|
@@ -967,7 +975,7 @@ var UuidPill_default = UuidPill;
|
|
|
967
975
|
|
|
968
976
|
// src/displays/GenericDisplay.tsx
|
|
969
977
|
var import_react9 = __toESM(require("react"));
|
|
970
|
-
var
|
|
978
|
+
var import_react_bootstrap16 = require("react-bootstrap");
|
|
971
979
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
972
980
|
var ConfigObject = class {
|
|
973
981
|
constructor(dotNotation, style, onClick, onBlur, onHideClick, hidden, mapData, additionalComponents) {
|
|
@@ -1018,17 +1026,17 @@ var buildData = (obj, propertiesMap, configObjects, opn, innerArray, dispatch, i
|
|
|
1018
1026
|
const onClick = getOnClick(innerConfigs);
|
|
1019
1027
|
const extraComponents = getAdditionalComponentes(innerConfigs);
|
|
1020
1028
|
if (Array.isArray(obj)) {
|
|
1021
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_bootstrap16.Container, { onClick, style: { ...styles }, children: [
|
|
1022
1030
|
opn && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("strong", { children: opn }) }),
|
|
1023
1031
|
obj.map((o, index) => {
|
|
1024
1032
|
const mapCopy = [...newPropertiesMap, `[${index}]`];
|
|
1025
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_bootstrap16.Row, { style: { padding: 4, ...styles }, children: buildData(o, mapCopy, configObjects, null, true, null, false, editButtonRenderer) }, index);
|
|
1026
1034
|
})
|
|
1027
1035
|
] });
|
|
1028
1036
|
}
|
|
1029
1037
|
if (typeof obj === "object" && obj != null) {
|
|
1030
1038
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1031
|
-
|
|
1039
|
+
import_react_bootstrap16.Container,
|
|
1032
1040
|
{
|
|
1033
1041
|
onClick,
|
|
1034
1042
|
style: {
|
|
@@ -1049,7 +1057,7 @@ var buildData = (obj, propertiesMap, configObjects, opn, innerArray, dispatch, i
|
|
|
1049
1057
|
}
|
|
1050
1058
|
);
|
|
1051
1059
|
}
|
|
1052
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_react_bootstrap16.Col, { children: [
|
|
1053
1061
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("strong", { children: [
|
|
1054
1062
|
opn,
|
|
1055
1063
|
": "
|
|
@@ -1087,12 +1095,72 @@ var GenericDisplay = ({
|
|
|
1087
1095
|
refreshFunc();
|
|
1088
1096
|
}
|
|
1089
1097
|
}, [context]);
|
|
1090
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: innerOptions && innerOptions.map((cObj, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1098
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: innerOptions && innerOptions.map((cObj, index) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_bootstrap16.Container, { style: { padding: 4, border: "solid" }, children: buildData(cObj, [], configObjects, rootName || null, false, null, true, editButtonRenderer) }, index)) });
|
|
1091
1099
|
};
|
|
1092
1100
|
var GenericDisplay_default = GenericDisplay;
|
|
1093
1101
|
|
|
1094
|
-
// src/displays/
|
|
1102
|
+
// src/displays/BranchDropDisplay.tsx
|
|
1103
|
+
var import_ui_kit_sgm = require("@teraprox/ui-kit-sgm");
|
|
1104
|
+
|
|
1105
|
+
// src/displays/RateLimitBar.tsx
|
|
1106
|
+
var import_react10 = require("react");
|
|
1095
1107
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1108
|
+
function formatResetIn(windowReset) {
|
|
1109
|
+
const resetAt = new Date(windowReset).getTime();
|
|
1110
|
+
const remaining = Math.max(0, Math.round((resetAt - Date.now()) / 1e3));
|
|
1111
|
+
if (remaining <= 0) return "agora";
|
|
1112
|
+
if (remaining < 60) return `${remaining}s`;
|
|
1113
|
+
return `${Math.round(remaining / 60)}min`;
|
|
1114
|
+
}
|
|
1115
|
+
var RateLimitBar = ({ entry, label, className }) => {
|
|
1116
|
+
const pct = (0, import_react10.useMemo)(() => {
|
|
1117
|
+
if (!entry || entry.limit <= 0) return 0;
|
|
1118
|
+
return Math.min(100, Math.round(entry.used / entry.limit * 100));
|
|
1119
|
+
}, [entry]);
|
|
1120
|
+
if (!entry) return null;
|
|
1121
|
+
const color = entry.exceeded || pct >= 90 ? "#dc3545" : pct >= 70 ? "#ffc107" : "#28a745";
|
|
1122
|
+
const containerStyle = {
|
|
1123
|
+
width: "100%",
|
|
1124
|
+
marginBottom: "4px"
|
|
1125
|
+
};
|
|
1126
|
+
const barTrackStyle = {
|
|
1127
|
+
height: "6px",
|
|
1128
|
+
width: "100%",
|
|
1129
|
+
backgroundColor: "#e9ecef",
|
|
1130
|
+
borderRadius: "3px",
|
|
1131
|
+
overflow: "hidden"
|
|
1132
|
+
};
|
|
1133
|
+
const barFillStyle = {
|
|
1134
|
+
height: "100%",
|
|
1135
|
+
width: `${pct}%`,
|
|
1136
|
+
backgroundColor: color,
|
|
1137
|
+
borderRadius: "3px",
|
|
1138
|
+
transition: "width 0.3s ease, background-color 0.3s ease"
|
|
1139
|
+
};
|
|
1140
|
+
const textStyle = {
|
|
1141
|
+
fontSize: "11px",
|
|
1142
|
+
color: "#6c757d",
|
|
1143
|
+
display: "flex",
|
|
1144
|
+
justifyContent: "space-between",
|
|
1145
|
+
marginBottom: "2px"
|
|
1146
|
+
};
|
|
1147
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: containerStyle, className, children: [
|
|
1148
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { style: textStyle, children: [
|
|
1149
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: label }),
|
|
1150
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("span", { children: [
|
|
1151
|
+
entry.used,
|
|
1152
|
+
"/",
|
|
1153
|
+
entry.limit,
|
|
1154
|
+
" req",
|
|
1155
|
+
entry.exceeded ? " \u2014 limite atingido" : ` (reset em ${formatResetIn(entry.windowReset)})`
|
|
1156
|
+
] })
|
|
1157
|
+
] }),
|
|
1158
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: barTrackStyle, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { style: barFillStyle }) })
|
|
1159
|
+
] });
|
|
1160
|
+
};
|
|
1161
|
+
|
|
1162
|
+
// src/displays/StatusIndicator.tsx
|
|
1163
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1096
1164
|
var StatusIndicator = ({
|
|
1097
1165
|
status,
|
|
1098
1166
|
count,
|
|
@@ -1107,14 +1175,14 @@ var StatusIndicator = ({
|
|
|
1107
1175
|
naoAtribuida: "N\xC3O ATRIBUIDA"
|
|
1108
1176
|
};
|
|
1109
1177
|
const label = statusLabels[status] || status.toUpperCase();
|
|
1110
|
-
return /* @__PURE__ */ (0,
|
|
1111
|
-
/* @__PURE__ */ (0,
|
|
1112
|
-
/* @__PURE__ */ (0,
|
|
1178
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: `status-flag ${status} ${containerClassName}`, children: [
|
|
1179
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "status-label", children: label }),
|
|
1180
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "status-count", children: count })
|
|
1113
1181
|
] });
|
|
1114
1182
|
};
|
|
1115
1183
|
|
|
1116
1184
|
// src/displays/VerticalItemsDisplay.tsx
|
|
1117
|
-
var
|
|
1185
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1118
1186
|
var VerticalItemsDisplay = ({
|
|
1119
1187
|
item1 = "",
|
|
1120
1188
|
item2 = "",
|
|
@@ -1122,15 +1190,15 @@ var VerticalItemsDisplay = ({
|
|
|
1122
1190
|
className = "",
|
|
1123
1191
|
style
|
|
1124
1192
|
}) => {
|
|
1125
|
-
return /* @__PURE__ */ (0,
|
|
1126
|
-
/* @__PURE__ */ (0,
|
|
1127
|
-
/* @__PURE__ */ (0,
|
|
1128
|
-
/* @__PURE__ */ (0,
|
|
1193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className, style, children: [
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: item1 }),
|
|
1195
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: item2 }),
|
|
1196
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: item3 })
|
|
1129
1197
|
] });
|
|
1130
1198
|
};
|
|
1131
1199
|
|
|
1132
1200
|
// src/displays/StatusLight.tsx
|
|
1133
|
-
var
|
|
1201
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1134
1202
|
var StatusLight = ({
|
|
1135
1203
|
active = false,
|
|
1136
1204
|
activeLightColor = "green",
|
|
@@ -1140,7 +1208,7 @@ var StatusLight = ({
|
|
|
1140
1208
|
style
|
|
1141
1209
|
}) => {
|
|
1142
1210
|
const color = active ? activeLightColor : inactiveLightColor;
|
|
1143
|
-
return /* @__PURE__ */ (0,
|
|
1211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1144
1212
|
"div",
|
|
1145
1213
|
{
|
|
1146
1214
|
className,
|
|
@@ -1162,7 +1230,7 @@ var import_dayjs2 = __toESM(require("dayjs"));
|
|
|
1162
1230
|
var import_duration = __toESM(require("dayjs/plugin/duration"));
|
|
1163
1231
|
var import_bi = require("react-icons/bi");
|
|
1164
1232
|
var import_bs = require("react-icons/bs");
|
|
1165
|
-
var
|
|
1233
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1166
1234
|
import_dayjs2.default.extend(import_duration.default);
|
|
1167
1235
|
var TimerDisplay = ({
|
|
1168
1236
|
id,
|
|
@@ -1192,8 +1260,8 @@ var TimerDisplay = ({
|
|
|
1192
1260
|
const secondsRemaining = time.seconds().toString().padStart(2, "0");
|
|
1193
1261
|
return days > 0 ? `${days}d ${hours}:${minutes}:${secondsRemaining}` : `${hours}:${minutes}:${secondsRemaining}`;
|
|
1194
1262
|
};
|
|
1195
|
-
return /* @__PURE__ */ (0,
|
|
1196
|
-
/* @__PURE__ */ (0,
|
|
1263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "timer-display-container", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "timer-display-content", children: id ? /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
1264
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1197
1265
|
import_bi.BiTimer,
|
|
1198
1266
|
{
|
|
1199
1267
|
size: 24,
|
|
@@ -1201,7 +1269,7 @@ var TimerDisplay = ({
|
|
|
1201
1269
|
title: "Timer"
|
|
1202
1270
|
}
|
|
1203
1271
|
),
|
|
1204
|
-
pausable && !isStopped && /* @__PURE__ */ (0,
|
|
1272
|
+
pausable && !isStopped && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1205
1273
|
import_bs.BsPause,
|
|
1206
1274
|
{
|
|
1207
1275
|
size: 20,
|
|
@@ -1210,7 +1278,7 @@ var TimerDisplay = ({
|
|
|
1210
1278
|
title: "Pausar"
|
|
1211
1279
|
}
|
|
1212
1280
|
),
|
|
1213
|
-
playable && !isStopped && /* @__PURE__ */ (0,
|
|
1281
|
+
playable && !isStopped && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1214
1282
|
import_bs.BsPlay,
|
|
1215
1283
|
{
|
|
1216
1284
|
size: 20,
|
|
@@ -1219,588 +1287,61 @@ var TimerDisplay = ({
|
|
|
1219
1287
|
title: "Iniciar"
|
|
1220
1288
|
}
|
|
1221
1289
|
),
|
|
1222
|
-
/* @__PURE__ */ (0,
|
|
1223
|
-
] }) : /* @__PURE__ */ (0,
|
|
1290
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "timer-display-time", children: formatDuration(tempo) })
|
|
1291
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "timer-display-message", children: emptyMessage }) }) });
|
|
1224
1292
|
};
|
|
1225
1293
|
|
|
1226
1294
|
// src/displays/RecursoDisplayer.tsx
|
|
1227
|
-
var
|
|
1228
|
-
var import_react_bootstrap19 = require("react-bootstrap");
|
|
1229
|
-
|
|
1230
|
-
// src/forms/FindRecursoByTagField.tsx
|
|
1231
|
-
var import_react13 = require("react");
|
|
1232
|
-
var import_gr4 = require("react-icons/gr");
|
|
1295
|
+
var import_ui_kit_sgm2 = require("@teraprox/ui-kit-sgm");
|
|
1233
1296
|
|
|
1234
|
-
// src/
|
|
1235
|
-
var
|
|
1236
|
-
var
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
displayKey,
|
|
1243
|
-
displayKeys,
|
|
1244
|
-
onValueChanged,
|
|
1245
|
-
onSelectedClick,
|
|
1246
|
-
value,
|
|
1247
|
-
actionButton,
|
|
1248
|
-
actionButton2,
|
|
1249
|
-
placeH,
|
|
1250
|
-
title,
|
|
1251
|
-
filter,
|
|
1252
|
-
filterField,
|
|
1253
|
-
loadFunc,
|
|
1254
|
-
loadCondition,
|
|
1255
|
-
onBlurEvent,
|
|
1256
|
-
formatationFunc,
|
|
1257
|
-
onEscKeyDown,
|
|
1258
|
-
onEnterKeyDown,
|
|
1259
|
-
margT,
|
|
1260
|
-
margB,
|
|
1261
|
-
hideComponent,
|
|
1262
|
-
disableComponent = false,
|
|
1263
|
-
disableSelect = false,
|
|
1264
|
-
autoFocusConfig,
|
|
1265
|
-
onLoad,
|
|
1266
|
-
cacheKey,
|
|
1267
|
-
minChars = 0,
|
|
1268
|
-
maxItems,
|
|
1269
|
-
showListOnFocus = true,
|
|
1270
|
-
lazyLoad = false
|
|
1297
|
+
// src/filters/StatusPills.tsx
|
|
1298
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1299
|
+
var StatusPills = ({
|
|
1300
|
+
statuses,
|
|
1301
|
+
activeKeys,
|
|
1302
|
+
onSelectionChange,
|
|
1303
|
+
multiSelect = true,
|
|
1304
|
+
className = ""
|
|
1271
1305
|
}) => {
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
const win = window;
|
|
1280
|
-
if (!win.__AUTO_COMPLETE_CACHE__) {
|
|
1281
|
-
win.__AUTO_COMPLETE_CACHE__ = /* @__PURE__ */ new Map();
|
|
1282
|
-
}
|
|
1283
|
-
return win.__AUTO_COMPLETE_CACHE__;
|
|
1284
|
-
}, []);
|
|
1285
|
-
const sortOptions = (data, key) => {
|
|
1286
|
-
if (!key || !Array.isArray(data)) return data;
|
|
1287
|
-
return [...data].sort((a, b) => String(a[key]).localeCompare(String(b[key])));
|
|
1288
|
-
};
|
|
1289
|
-
(0, import_react10.useEffect)(() => {
|
|
1290
|
-
setInput(value || "");
|
|
1291
|
-
}, [value]);
|
|
1292
|
-
(0, import_react10.useEffect)(() => {
|
|
1293
|
-
const sortedOptions = sortOptions(ops, sortKey);
|
|
1294
|
-
setListItem(sortedOptions);
|
|
1295
|
-
setOptions(sortedOptions);
|
|
1296
|
-
}, [ops, sortKey]);
|
|
1297
|
-
(0, import_react10.useEffect)(() => {
|
|
1298
|
-
const loadData = async () => {
|
|
1299
|
-
if (!(loadCondition && loadFunc)) return;
|
|
1300
|
-
if (lazyLoad && minChars > 0 && !showListOnFocus && (!value || String(value).length < minChars)) {
|
|
1301
|
-
return;
|
|
1302
|
-
}
|
|
1303
|
-
const key = cacheKey ? `${cacheKey}${filter ? `:${filterField}:${filter}` : ""}` : null;
|
|
1304
|
-
if (key && cacheStore.has(key)) {
|
|
1305
|
-
const cacheEntry = cacheStore.get(key);
|
|
1306
|
-
const data = cacheEntry.promise ? await cacheEntry.promise : cacheEntry.data || cacheEntry;
|
|
1307
|
-
setListItem(data);
|
|
1308
|
-
setOptions(data);
|
|
1309
|
-
triggerOnLoad(data);
|
|
1310
|
-
return;
|
|
1311
|
-
}
|
|
1312
|
-
setLoading(true);
|
|
1313
|
-
try {
|
|
1314
|
-
const requestPromise = loadFunc().then((res) => {
|
|
1315
|
-
let newOps = (res == null ? void 0 : res.content) || res;
|
|
1316
|
-
newOps = Array.isArray(newOps) ? newOps.filter((op) => op != null) : [];
|
|
1317
|
-
if (filter && filterField) {
|
|
1318
|
-
newOps = newOps.filter((op) => op[filterField] === filter);
|
|
1319
|
-
}
|
|
1320
|
-
return sortOptions(newOps, sortKey);
|
|
1321
|
-
});
|
|
1322
|
-
if (key) cacheStore.set(key, { promise: requestPromise });
|
|
1323
|
-
const sortedOptions = await requestPromise;
|
|
1324
|
-
setListItem(sortedOptions);
|
|
1325
|
-
setOptions(sortedOptions);
|
|
1326
|
-
if (key) cacheStore.set(key, { data: sortedOptions });
|
|
1327
|
-
triggerOnLoad(sortedOptions);
|
|
1328
|
-
} catch (error) {
|
|
1329
|
-
if (key) cacheStore.delete(key);
|
|
1330
|
-
setListItem([]);
|
|
1331
|
-
} finally {
|
|
1332
|
-
setLoading(false);
|
|
1306
|
+
const toggleKey = (key) => {
|
|
1307
|
+
const isActive = activeKeys.includes(key);
|
|
1308
|
+
if (multiSelect) {
|
|
1309
|
+
if (isActive) {
|
|
1310
|
+
onSelectionChange(activeKeys.filter((k) => k !== key));
|
|
1311
|
+
} else {
|
|
1312
|
+
onSelectionChange([...activeKeys, key]);
|
|
1333
1313
|
}
|
|
1334
|
-
};
|
|
1335
|
-
loadData();
|
|
1336
|
-
}, [loadCondition, filter, filterField, sortKey, cacheKey, lazyLoad, minChars, showListOnFocus]);
|
|
1337
|
-
const triggerOnLoad = (data) => {
|
|
1338
|
-
if (onLoad && !onLoaded) {
|
|
1339
|
-
setOnLoaded(true);
|
|
1340
|
-
onLoad(data);
|
|
1341
|
-
}
|
|
1342
|
-
};
|
|
1343
|
-
const keysJoinner = (li) => {
|
|
1344
|
-
if (!displayKeys || !Array.isArray(displayKeys)) return "";
|
|
1345
|
-
return displayKeys.map((key) => `${li[key]} `).join("").trim();
|
|
1346
|
-
};
|
|
1347
|
-
const getDisplayText = (item) => {
|
|
1348
|
-
if (formatationFunc) return formatationFunc(item);
|
|
1349
|
-
if (displayKey) return item[displayKey];
|
|
1350
|
-
if (displayKeys) return keysJoinner(item);
|
|
1351
|
-
return String(item);
|
|
1352
|
-
};
|
|
1353
|
-
const onFieldUpdate = (val) => {
|
|
1354
|
-
const search = val.toLowerCase();
|
|
1355
|
-
const canSearch = search.length >= minChars;
|
|
1356
|
-
if (canSearch && Array.isArray(options)) {
|
|
1357
|
-
const filtered = options.filter((item) => {
|
|
1358
|
-
const text = getDisplayText(item);
|
|
1359
|
-
return String(text).toLowerCase().includes(search);
|
|
1360
|
-
});
|
|
1361
|
-
setListItem(filtered);
|
|
1362
1314
|
} else {
|
|
1363
|
-
|
|
1315
|
+
onSelectionChange(isActive ? [] : [key]);
|
|
1364
1316
|
}
|
|
1365
|
-
onValueChanged == null ? void 0 : onValueChanged(val);
|
|
1366
|
-
setInput(val);
|
|
1367
|
-
setHide(!canSearch && options.length === 0);
|
|
1368
1317
|
};
|
|
1369
|
-
return /* @__PURE__ */ (0,
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
}
|
|
1385
|
-
if (e.key === "Enter" && onEnterKeyDown) {
|
|
1386
|
-
onEnterKeyDown(input);
|
|
1387
|
-
}
|
|
1318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: `status-pills-container ${className}`, children: Object.entries(statuses).map(([key, meta]) => {
|
|
1319
|
+
const isActive = activeKeys.includes(key);
|
|
1320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1321
|
+
"button",
|
|
1322
|
+
{
|
|
1323
|
+
type: "button",
|
|
1324
|
+
className: `status-pill ${isActive ? "active" : ""}`,
|
|
1325
|
+
style: { "--status-color": meta.color },
|
|
1326
|
+
onClick: () => toggleKey(key),
|
|
1327
|
+
"aria-pressed": isActive,
|
|
1328
|
+
children: [
|
|
1329
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "status-pill__swatch" }),
|
|
1330
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "status-pill__label", children: meta.label }),
|
|
1331
|
+
meta.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "status-pill__count", children: meta.count })
|
|
1332
|
+
]
|
|
1388
1333
|
},
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_bootstrap18.FloatingLabel, { controlId: "floatingInput", label: title, style: { zIndex: 0, flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1393
|
-
import_react_bootstrap18.Form.Control,
|
|
1394
|
-
{
|
|
1395
|
-
autoFocus: autoFocusConfig,
|
|
1396
|
-
disabled: disableComponent || disableSelect,
|
|
1397
|
-
placeholder: placeH,
|
|
1398
|
-
autoComplete: "off",
|
|
1399
|
-
value: input,
|
|
1400
|
-
onClickCapture: () => {
|
|
1401
|
-
const canOpen = showListOnFocus && input.length >= minChars;
|
|
1402
|
-
setHide(!canOpen);
|
|
1403
|
-
},
|
|
1404
|
-
onChange: (e) => onFieldUpdate(e.currentTarget.value),
|
|
1405
|
-
type: "text"
|
|
1406
|
-
}
|
|
1407
|
-
) }),
|
|
1408
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_bootstrap18.InputGroup.Text, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_bootstrap18.Spinner, { animation: "border", size: "sm" }) }),
|
|
1409
|
-
!disableComponent && (actionButton == null ? void 0 : actionButton(() => setInput(""))),
|
|
1410
|
-
!disableComponent && (actionButton2 == null ? void 0 : actionButton2(input))
|
|
1411
|
-
] }),
|
|
1412
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1413
|
-
import_react_bootstrap18.ListGroup,
|
|
1414
|
-
{
|
|
1415
|
-
className: "listgroup-autocomplete shadow-sm",
|
|
1416
|
-
hidden: hide || liItem.length === 0,
|
|
1417
|
-
style: {
|
|
1418
|
-
position: "absolute",
|
|
1419
|
-
top: "100%",
|
|
1420
|
-
left: 0,
|
|
1421
|
-
width: "100%",
|
|
1422
|
-
maxHeight: "250px",
|
|
1423
|
-
overflowY: "auto",
|
|
1424
|
-
zIndex: 1050,
|
|
1425
|
-
backgroundColor: "#fff"
|
|
1426
|
-
},
|
|
1427
|
-
children: (maxItems ? liItem.slice(0, maxItems) : liItem).map((li, index) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1428
|
-
import_react_bootstrap18.ListGroup.Item,
|
|
1429
|
-
{
|
|
1430
|
-
action: true,
|
|
1431
|
-
onClick: () => {
|
|
1432
|
-
const text = getDisplayText(li);
|
|
1433
|
-
setInput(text);
|
|
1434
|
-
onSelectedClick(li, index, liItem);
|
|
1435
|
-
setHide(true);
|
|
1436
|
-
},
|
|
1437
|
-
children: getDisplayText(li)
|
|
1438
|
-
},
|
|
1439
|
-
index
|
|
1440
|
-
))
|
|
1441
|
-
}
|
|
1442
|
-
)
|
|
1443
|
-
]
|
|
1444
|
-
}
|
|
1445
|
-
);
|
|
1446
|
-
};
|
|
1447
|
-
|
|
1448
|
-
// src/qr/QrCodeScanButton.tsx
|
|
1449
|
-
var import_react12 = require("react");
|
|
1450
|
-
var import_bs2 = require("react-icons/bs");
|
|
1451
|
-
|
|
1452
|
-
// src/qr/QrReader.tsx
|
|
1453
|
-
var import_qr_scanner = __toESM(require("qr-scanner"));
|
|
1454
|
-
var import_react11 = require("react");
|
|
1455
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1456
|
-
var QrReader = ({ callback }) => {
|
|
1457
|
-
const scanner = (0, import_react11.useRef)(null);
|
|
1458
|
-
const videoEl = (0, import_react11.useRef)(null);
|
|
1459
|
-
const qrBoxEl = (0, import_react11.useRef)(null);
|
|
1460
|
-
const [qrOn, setQrOn] = (0, import_react11.useState)(true);
|
|
1461
|
-
const [scannedResult, setScannedResult] = (0, import_react11.useState)("");
|
|
1462
|
-
const onScanSuccess = (result) => {
|
|
1463
|
-
setScannedResult(result.data);
|
|
1464
|
-
callback(result.data);
|
|
1465
|
-
};
|
|
1466
|
-
const onScanFail = (err) => {
|
|
1467
|
-
if (typeof err === "string" && !err.includes("No QR code found")) {
|
|
1468
|
-
console.error("QR Scanner Error:", err);
|
|
1469
|
-
}
|
|
1470
|
-
};
|
|
1471
|
-
(0, import_react11.useEffect)(() => {
|
|
1472
|
-
if (videoEl.current && !scanner.current) {
|
|
1473
|
-
scanner.current = new import_qr_scanner.default(videoEl.current, onScanSuccess, {
|
|
1474
|
-
onDecodeError: onScanFail,
|
|
1475
|
-
preferredCamera: "environment",
|
|
1476
|
-
highlightScanRegion: true,
|
|
1477
|
-
highlightCodeOutline: true,
|
|
1478
|
-
overlay: qrBoxEl.current || void 0
|
|
1479
|
-
});
|
|
1480
|
-
scanner.current.start().then(() => setQrOn(true)).catch((err) => {
|
|
1481
|
-
console.error("Failed to start QR Scanner:", err);
|
|
1482
|
-
setQrOn(false);
|
|
1483
|
-
});
|
|
1484
|
-
}
|
|
1485
|
-
return () => {
|
|
1486
|
-
if (scanner.current) {
|
|
1487
|
-
scanner.current.stop();
|
|
1488
|
-
scanner.current.destroy();
|
|
1489
|
-
scanner.current = null;
|
|
1490
|
-
}
|
|
1491
|
-
};
|
|
1492
|
-
}, []);
|
|
1493
|
-
(0, import_react11.useEffect)(() => {
|
|
1494
|
-
if (!qrOn) {
|
|
1495
|
-
alert(
|
|
1496
|
-
"C\xE2mera est\xE1 bloqueada ou inacess\xEDvel. Por favor, habilite a c\xE2mera nas permiss\xF5es do seu navegador e recarregue a p\xE1gina."
|
|
1497
|
-
);
|
|
1498
|
-
}
|
|
1499
|
-
}, [qrOn]);
|
|
1500
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "qr-reader", style: { position: "relative", width: "100%", maxWidth: "500px", margin: "0 auto" }, children: [
|
|
1501
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("video", { ref: videoEl, style: { width: "100%", borderRadius: "8px" } }),
|
|
1502
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { ref: qrBoxEl, className: "qr-box" }),
|
|
1503
|
-
scannedResult && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
1504
|
-
"div",
|
|
1505
|
-
{
|
|
1506
|
-
style: {
|
|
1507
|
-
position: "absolute",
|
|
1508
|
-
top: 10,
|
|
1509
|
-
left: 10,
|
|
1510
|
-
zIndex: 10,
|
|
1511
|
-
background: "rgba(0,0,0,0.6)",
|
|
1512
|
-
color: "white",
|
|
1513
|
-
padding: "4px 8px",
|
|
1514
|
-
borderRadius: "4px",
|
|
1515
|
-
fontSize: "0.8rem"
|
|
1516
|
-
},
|
|
1517
|
-
children: [
|
|
1518
|
-
"Lido: ",
|
|
1519
|
-
scannedResult
|
|
1520
|
-
]
|
|
1521
|
-
}
|
|
1522
|
-
)
|
|
1523
|
-
] });
|
|
1524
|
-
};
|
|
1525
|
-
|
|
1526
|
-
// src/qr/QrCodeScanButton.tsx
|
|
1527
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1528
|
-
var QrCodeScanButton = ({ callback, size = 25 }) => {
|
|
1529
|
-
const [showQr, setShowQr] = (0, import_react12.useState)(false);
|
|
1530
|
-
const toggleQr = () => {
|
|
1531
|
-
setShowQr((prev) => !prev);
|
|
1532
|
-
};
|
|
1533
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
1534
|
-
"div",
|
|
1535
|
-
{
|
|
1536
|
-
className: "hoverable-div",
|
|
1537
|
-
style: {
|
|
1538
|
-
border: "solid",
|
|
1539
|
-
borderTopRightRadius: "3px",
|
|
1540
|
-
borderBottomRightRadius: "3px",
|
|
1541
|
-
padding: "8px",
|
|
1542
|
-
borderLeft: "none",
|
|
1543
|
-
borderColor: "#ccc",
|
|
1544
|
-
borderWidth: "1px",
|
|
1545
|
-
cursor: "pointer",
|
|
1546
|
-
display: "flex",
|
|
1547
|
-
alignItems: "center"
|
|
1548
|
-
},
|
|
1549
|
-
onClick: toggleQr,
|
|
1550
|
-
children: [
|
|
1551
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_bs2.BsQrCode, { size }),
|
|
1552
|
-
showQr && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1553
|
-
"div",
|
|
1554
|
-
{
|
|
1555
|
-
style: {
|
|
1556
|
-
position: "fixed",
|
|
1557
|
-
top: 0,
|
|
1558
|
-
left: 0,
|
|
1559
|
-
right: 0,
|
|
1560
|
-
bottom: 0,
|
|
1561
|
-
backgroundColor: "rgba(0,0,0,0.8)",
|
|
1562
|
-
zIndex: 9999,
|
|
1563
|
-
display: "flex",
|
|
1564
|
-
flexDirection: "column",
|
|
1565
|
-
alignItems: "center",
|
|
1566
|
-
justifyContent: "center",
|
|
1567
|
-
padding: "20px"
|
|
1568
|
-
},
|
|
1569
|
-
onClick: (e) => e.stopPropagation(),
|
|
1570
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { style: { width: "100%", maxWidth: "500px", backgroundColor: "#fff", borderRadius: "12px", padding: "20px", position: "relative" }, children: [
|
|
1571
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1572
|
-
"div",
|
|
1573
|
-
{
|
|
1574
|
-
onClick: toggleQr,
|
|
1575
|
-
style: { position: "absolute", top: "10px", right: "15px", fontSize: "1.5rem", cursor: "pointer", zIndex: 10001 },
|
|
1576
|
-
children: "\xD7"
|
|
1577
|
-
}
|
|
1578
|
-
),
|
|
1579
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h5", { className: "mb-3 text-center", children: "Escaneie o QR Code" }),
|
|
1580
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1581
|
-
QrReader,
|
|
1582
|
-
{
|
|
1583
|
-
callback: (v) => {
|
|
1584
|
-
toggleQr();
|
|
1585
|
-
callback(v);
|
|
1586
|
-
}
|
|
1587
|
-
}
|
|
1588
|
-
),
|
|
1589
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "mt-3 text-muted text-center small", children: "Aponte a c\xE2mera para o c\xF3digo" })
|
|
1590
|
-
] })
|
|
1591
|
-
}
|
|
1592
|
-
)
|
|
1593
|
-
]
|
|
1594
|
-
}
|
|
1595
|
-
);
|
|
1596
|
-
};
|
|
1597
|
-
|
|
1598
|
-
// src/forms/FindRecursoByTagField.tsx
|
|
1599
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1600
|
-
var FindRecursoByTagField = ({ callback, recursoController }) => {
|
|
1601
|
-
const [selectedTag, setSelectedTag] = (0, import_react13.useState)("");
|
|
1602
|
-
const [reachedRecurso, setReachedRecurso] = (0, import_react13.useState)(null);
|
|
1603
|
-
const findRecursoByTagIdHandler = async (tagId) => {
|
|
1604
|
-
if (!recursoController) return;
|
|
1605
|
-
try {
|
|
1606
|
-
const r = await recursoController.read("findRecursoByTagId", tagId);
|
|
1607
|
-
setReachedRecurso(r);
|
|
1608
|
-
} catch (error) {
|
|
1609
|
-
console.error("Erro ao buscar recurso por tag ID:", error);
|
|
1610
|
-
}
|
|
1611
|
-
};
|
|
1612
|
-
const findRecursoByTagDescriptionHandler = async (description) => {
|
|
1613
|
-
if (!recursoController) return;
|
|
1614
|
-
try {
|
|
1615
|
-
const formattedDescription = description.replace(/\s/g, "");
|
|
1616
|
-
const recurso = await recursoController.read(
|
|
1617
|
-
`recurso/findByTagDescription`,
|
|
1618
|
-
formattedDescription
|
|
1619
|
-
);
|
|
1620
|
-
if (!callback) {
|
|
1621
|
-
console.log("Recurso encontrado (sem callback):", recurso);
|
|
1622
|
-
} else {
|
|
1623
|
-
callback(recurso, true);
|
|
1624
|
-
}
|
|
1625
|
-
} catch (error) {
|
|
1626
|
-
console.error("Erro ao buscar recurso por descri\xE7\xE3o de tag:", error);
|
|
1627
|
-
}
|
|
1628
|
-
};
|
|
1629
|
-
const confirmRecursoSelectionButton = () => {
|
|
1630
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1631
|
-
"div",
|
|
1632
|
-
{
|
|
1633
|
-
className: "hoverable-div",
|
|
1634
|
-
style: {
|
|
1635
|
-
border: "solid",
|
|
1636
|
-
borderTopRightRadius: "3px",
|
|
1637
|
-
borderBottomRightRadius: "3px",
|
|
1638
|
-
padding: "8px",
|
|
1639
|
-
borderLeft: "none",
|
|
1640
|
-
borderColor: "#ccc",
|
|
1641
|
-
borderWidth: "1px",
|
|
1642
|
-
cursor: "pointer",
|
|
1643
|
-
display: "flex",
|
|
1644
|
-
alignItems: "center"
|
|
1645
|
-
},
|
|
1646
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1647
|
-
import_gr4.GrCheckmark,
|
|
1648
|
-
{
|
|
1649
|
-
size: 25,
|
|
1650
|
-
onClick: () => reachedRecurso && callback(reachedRecurso, true)
|
|
1651
|
-
}
|
|
1652
|
-
)
|
|
1653
|
-
}
|
|
1654
|
-
);
|
|
1655
|
-
};
|
|
1656
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1657
|
-
AutoComplete,
|
|
1658
|
-
{
|
|
1659
|
-
sortKey: "id",
|
|
1660
|
-
loadCondition: true,
|
|
1661
|
-
loadFunc: () => {
|
|
1662
|
-
var _a;
|
|
1663
|
-
return (_a = recursoController == null ? void 0 : recursoController.get("findActiveRecursosTags")) != null ? _a : Promise.resolve([]);
|
|
1664
|
-
},
|
|
1665
|
-
displayKey: "descricao",
|
|
1666
|
-
title: "Selecione ou Digite a TAG",
|
|
1667
|
-
actionButton: confirmRecursoSelectionButton,
|
|
1668
|
-
actionButton2: () => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1669
|
-
QrCodeScanButton,
|
|
1670
|
-
{
|
|
1671
|
-
callback: (description) => findRecursoByTagDescriptionHandler(description)
|
|
1672
|
-
}
|
|
1673
|
-
),
|
|
1674
|
-
onSelectedClick: (v) => {
|
|
1675
|
-
setSelectedTag(v);
|
|
1676
|
-
findRecursoByTagIdHandler(v.id);
|
|
1677
|
-
},
|
|
1678
|
-
value: (selectedTag == null ? void 0 : selectedTag.descricao) || ""
|
|
1679
|
-
}
|
|
1680
|
-
) });
|
|
1681
|
-
};
|
|
1682
|
-
|
|
1683
|
-
// src/displays/RecursoDisplayer.tsx
|
|
1684
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1685
|
-
var RecursoDisplayer = ({
|
|
1686
|
-
mode = "manutencao",
|
|
1687
|
-
controller,
|
|
1688
|
-
selectedList = [],
|
|
1689
|
-
onSaveRecurso,
|
|
1690
|
-
singleReturn = false
|
|
1691
|
-
}) => {
|
|
1692
|
-
const [selectorDisplay, setSelectorDisplay] = (0, import_react14.useState)("branch");
|
|
1693
|
-
const [loading, setLoading] = (0, import_react14.useState)(false);
|
|
1694
|
-
const [recursosProcesso, setRecursosProcesso] = (0, import_react14.useState)([]);
|
|
1695
|
-
const [branchesManutencao, setBranchesManutencao] = (0, import_react14.useState)([]);
|
|
1696
|
-
(0, import_react14.useEffect)(() => {
|
|
1697
|
-
let mounted = true;
|
|
1698
|
-
const loadInicial = async () => {
|
|
1699
|
-
setLoading(true);
|
|
1700
|
-
try {
|
|
1701
|
-
if (mode === "manutencao") {
|
|
1702
|
-
const b = await controller("arvoreEstrutural").get(`branchByBranchLevel/1`);
|
|
1703
|
-
if (mounted) setBranchesManutencao(b);
|
|
1704
|
-
} else if (mode === "processo") {
|
|
1705
|
-
const recs = await controller("recurso").readAll();
|
|
1706
|
-
if (mounted) setRecursosProcesso(Array.isArray(recs) ? recs : []);
|
|
1707
|
-
}
|
|
1708
|
-
} catch (err) {
|
|
1709
|
-
console.error("Erro ao carregar estrutura do RecursoDisplayer", err);
|
|
1710
|
-
} finally {
|
|
1711
|
-
if (mounted) setLoading(false);
|
|
1712
|
-
}
|
|
1713
|
-
};
|
|
1714
|
-
loadInicial();
|
|
1715
|
-
return () => {
|
|
1716
|
-
mounted = false;
|
|
1717
|
-
};
|
|
1718
|
-
}, [mode, controller]);
|
|
1719
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { style: { width: "100%", padding: 0 }, className: "recurso-displayer-generic", children: [
|
|
1720
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "d-flex justify-content-between align-items-center mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
1721
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("label", { className: "me-2", children: "Selecionar Recurso Por:" }),
|
|
1722
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1723
|
-
import_react_bootstrap19.Button,
|
|
1724
|
-
{
|
|
1725
|
-
size: "sm",
|
|
1726
|
-
onClick: () => setSelectorDisplay("branch"),
|
|
1727
|
-
variant: selectorDisplay === "branch" ? "primary" : "outline-primary",
|
|
1728
|
-
className: "me-1",
|
|
1729
|
-
children: mode === "processo" ? "Agrupamentos" : "\xC1rvore"
|
|
1730
|
-
}
|
|
1731
|
-
),
|
|
1732
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1733
|
-
import_react_bootstrap19.Button,
|
|
1734
|
-
{
|
|
1735
|
-
size: "sm",
|
|
1736
|
-
onClick: () => setSelectorDisplay("TAG"),
|
|
1737
|
-
variant: selectorDisplay === "TAG" ? "primary" : "outline-primary",
|
|
1738
|
-
children: "TAG"
|
|
1739
|
-
}
|
|
1740
|
-
)
|
|
1741
|
-
] }) }),
|
|
1742
|
-
loading && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_bootstrap19.Spinner, { animation: "border", size: "sm" }),
|
|
1743
|
-
!loading && selectorDisplay === "branch" && mode === "manutencao" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "manutencao-tree-view", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-muted small italic", children: "\xC1rvore de Manuten\xE7\xE3o (Branches/Nodes em Cascata) - Implementa\xE7\xE3o Gen\xE9rica" }) }),
|
|
1744
|
-
!loading && selectorDisplay === "branch" && mode === "processo" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "processo-group-view", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "text-muted small italic", children: "Lista de Agrupamentos de Processo (Raiz \xDAnica)" }) }),
|
|
1745
|
-
selectorDisplay === "TAG" && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1746
|
-
FindRecursoByTagField,
|
|
1747
|
-
{
|
|
1748
|
-
callback: (rec, checked) => {
|
|
1749
|
-
onSaveRecurso([rec]);
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
)
|
|
1753
|
-
] });
|
|
1754
|
-
};
|
|
1755
|
-
|
|
1756
|
-
// src/filters/StatusPills.tsx
|
|
1757
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1758
|
-
var StatusPills = ({
|
|
1759
|
-
statuses,
|
|
1760
|
-
activeKeys,
|
|
1761
|
-
onSelectionChange,
|
|
1762
|
-
multiSelect = true,
|
|
1763
|
-
className = ""
|
|
1764
|
-
}) => {
|
|
1765
|
-
const toggleKey = (key) => {
|
|
1766
|
-
const isActive = activeKeys.includes(key);
|
|
1767
|
-
if (multiSelect) {
|
|
1768
|
-
if (isActive) {
|
|
1769
|
-
onSelectionChange(activeKeys.filter((k) => k !== key));
|
|
1770
|
-
} else {
|
|
1771
|
-
onSelectionChange([...activeKeys, key]);
|
|
1772
|
-
}
|
|
1773
|
-
} else {
|
|
1774
|
-
onSelectionChange(isActive ? [] : [key]);
|
|
1775
|
-
}
|
|
1776
|
-
};
|
|
1777
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: `status-pills-container ${className}`, children: Object.entries(statuses).map(([key, meta]) => {
|
|
1778
|
-
const isActive = activeKeys.includes(key);
|
|
1779
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1780
|
-
"button",
|
|
1781
|
-
{
|
|
1782
|
-
type: "button",
|
|
1783
|
-
className: `status-pill ${isActive ? "active" : ""}`,
|
|
1784
|
-
style: { "--status-color": meta.color },
|
|
1785
|
-
onClick: () => toggleKey(key),
|
|
1786
|
-
"aria-pressed": isActive,
|
|
1787
|
-
children: [
|
|
1788
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "status-pill__swatch" }),
|
|
1789
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "status-pill__label", children: meta.label }),
|
|
1790
|
-
meta.count !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "status-pill__count", children: meta.count })
|
|
1791
|
-
]
|
|
1792
|
-
},
|
|
1793
|
-
key
|
|
1794
|
-
);
|
|
1795
|
-
}) });
|
|
1334
|
+
key
|
|
1335
|
+
);
|
|
1336
|
+
}) });
|
|
1796
1337
|
};
|
|
1797
1338
|
|
|
1798
1339
|
// src/filters/PeriodSelector.tsx
|
|
1799
|
-
var
|
|
1800
|
-
var
|
|
1340
|
+
var import_react11 = require("react");
|
|
1341
|
+
var import_react_bootstrap17 = require("react-bootstrap");
|
|
1801
1342
|
var import_fa3 = require("react-icons/fa");
|
|
1802
1343
|
var import_dayjs3 = __toESM(require("dayjs"));
|
|
1803
|
-
var
|
|
1344
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1804
1345
|
var PeriodSelector = ({
|
|
1805
1346
|
startDate,
|
|
1806
1347
|
endDate,
|
|
@@ -1811,7 +1352,7 @@ var PeriodSelector = ({
|
|
|
1811
1352
|
allowFuture = false,
|
|
1812
1353
|
className = ""
|
|
1813
1354
|
}) => {
|
|
1814
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
1355
|
+
const [isExpanded, setIsExpanded] = (0, import_react11.useState)(false);
|
|
1815
1356
|
const formatDisplayRange = (start, end) => {
|
|
1816
1357
|
const s = (0, import_dayjs3.default)(start).format("DD/MM/YY HH:mm");
|
|
1817
1358
|
const e = (0, import_dayjs3.default)(end).format("DD/MM/YY HH:mm");
|
|
@@ -1825,146 +1366,588 @@ var PeriodSelector = ({
|
|
|
1825
1366
|
{ key: "month", label: "\xDAltimo M\xEAs" },
|
|
1826
1367
|
{ key: "year", label: "\xDAltimo Ano" }
|
|
1827
1368
|
];
|
|
1828
|
-
return /* @__PURE__ */ (0,
|
|
1829
|
-
/* @__PURE__ */ (0,
|
|
1830
|
-
/* @__PURE__ */ (0,
|
|
1831
|
-
/* @__PURE__ */ (0,
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_bootstrap17.Card, { className: `period-selector-card ${isExpanded ? "expanded" : ""} ${className}`, children: [
|
|
1370
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "compact-row", onClick: () => setIsExpanded(!isExpanded), children: [
|
|
1371
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "d-flex align-items-center", children: [
|
|
1372
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_fa3.FaCalendarAlt, { className: "me-2 text-primary" }),
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "date-range-text", children: isExpanded ? label : formatDisplayRange(startDate, endDate) })
|
|
1833
1374
|
] }),
|
|
1834
|
-
/* @__PURE__ */ (0,
|
|
1375
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "period-icon-btn", children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_fa3.FaChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "small text-muted", children: "Editar" }) })
|
|
1835
1376
|
] }),
|
|
1836
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
1837
|
-
onPresetSelect && /* @__PURE__ */ (0,
|
|
1838
|
-
/* @__PURE__ */ (0,
|
|
1839
|
-
/* @__PURE__ */ (0,
|
|
1840
|
-
/* @__PURE__ */ (0,
|
|
1377
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "expanded-content", children: [
|
|
1378
|
+
onPresetSelect && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "d-flex align-items-center mb-2", children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_fa3.FaHistory, { size: 12, className: "me-1 text-muted" }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("small", { className: "text-muted fw-bold text-uppercase", style: { fontSize: "0.65rem" }, children: "Atalhos" })
|
|
1841
1382
|
] }),
|
|
1842
|
-
presets.map((p) => /* @__PURE__ */ (0,
|
|
1843
|
-
|
|
1383
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "presets-container", children: presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1384
|
+
import_react_bootstrap17.Button,
|
|
1844
1385
|
{
|
|
1845
1386
|
variant: "outline-primary",
|
|
1846
1387
|
className: "preset-btn",
|
|
1847
1388
|
onClick: (e) => {
|
|
1848
1389
|
e.stopPropagation();
|
|
1849
1390
|
onPresetSelect(p.key);
|
|
1391
|
+
setIsExpanded(false);
|
|
1392
|
+
},
|
|
1393
|
+
children: p.label
|
|
1394
|
+
},
|
|
1395
|
+
p.key
|
|
1396
|
+
)) })
|
|
1397
|
+
] }),
|
|
1398
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "date-inputs-grid", children: [
|
|
1399
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_bootstrap17.Form.Group, { children: [
|
|
1400
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_bootstrap17.Form.Label, { className: "small text-muted", children: "In\xEDcio" }),
|
|
1401
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1402
|
+
import_react_bootstrap17.Form.Control,
|
|
1403
|
+
{
|
|
1404
|
+
type: "datetime-local",
|
|
1405
|
+
size: "sm",
|
|
1406
|
+
value: startDate,
|
|
1407
|
+
max: maxDate,
|
|
1408
|
+
onChange: (e) => onStartDateChange(e.target.value)
|
|
1409
|
+
}
|
|
1410
|
+
)
|
|
1411
|
+
] }),
|
|
1412
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_react_bootstrap17.Form.Group, { children: [
|
|
1413
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_bootstrap17.Form.Label, { className: "small text-muted", children: "Fim" }),
|
|
1414
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1415
|
+
import_react_bootstrap17.Form.Control,
|
|
1416
|
+
{
|
|
1417
|
+
type: "datetime-local",
|
|
1418
|
+
size: "sm",
|
|
1419
|
+
value: endDate,
|
|
1420
|
+
min: startDate,
|
|
1421
|
+
max: maxDate,
|
|
1422
|
+
onChange: (e) => onEndDateChange(e.target.value)
|
|
1423
|
+
}
|
|
1424
|
+
)
|
|
1425
|
+
] })
|
|
1426
|
+
] }),
|
|
1427
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "mt-3 d-flex justify-content-end", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1428
|
+
import_react_bootstrap17.Button,
|
|
1429
|
+
{
|
|
1430
|
+
variant: "primary",
|
|
1431
|
+
size: "sm",
|
|
1432
|
+
onClick: () => setIsExpanded(false),
|
|
1433
|
+
children: "Aplicar"
|
|
1434
|
+
}
|
|
1435
|
+
) })
|
|
1436
|
+
] })
|
|
1437
|
+
] });
|
|
1438
|
+
};
|
|
1439
|
+
|
|
1440
|
+
// src/filters/AdvancedFilterBar.tsx
|
|
1441
|
+
var import_react12 = require("react");
|
|
1442
|
+
var import_react_bootstrap18 = require("react-bootstrap");
|
|
1443
|
+
var import_fi2 = require("react-icons/fi");
|
|
1444
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1445
|
+
var AdvancedFilterBar = ({
|
|
1446
|
+
children,
|
|
1447
|
+
title = "Filtros e Busca",
|
|
1448
|
+
activeFiltersCount = 0,
|
|
1449
|
+
onClearAll,
|
|
1450
|
+
defaultExpanded = false,
|
|
1451
|
+
className = ""
|
|
1452
|
+
}) => {
|
|
1453
|
+
const [expanded, setExpanded] = (0, import_react12.useState)(defaultExpanded);
|
|
1454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: `advanced-filter-bar ${className}`, children: [
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1456
|
+
"div",
|
|
1457
|
+
{
|
|
1458
|
+
className: "filter-bar-header",
|
|
1459
|
+
onClick: () => setExpanded(!expanded),
|
|
1460
|
+
children: [
|
|
1461
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "filter-title-group", children: [
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_fi2.FiFilter, { className: "text-primary" }),
|
|
1463
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h5", { className: "filter-title", children: title }),
|
|
1464
|
+
activeFiltersCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("span", { className: "filter-count-badge", children: [
|
|
1465
|
+
activeFiltersCount,
|
|
1466
|
+
" ativos"
|
|
1467
|
+
] })
|
|
1468
|
+
] }),
|
|
1469
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "filter-chevron", children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_fi2.FiChevronUp, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_fi2.FiChevronDown, { size: 20 }) })
|
|
1470
|
+
]
|
|
1471
|
+
}
|
|
1472
|
+
),
|
|
1473
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react_bootstrap18.Collapse, { in: expanded, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "filter-bar-content", children: [
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "filter-grid", children }),
|
|
1475
|
+
(onClearAll || activeFiltersCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "filter-actions", children: [
|
|
1476
|
+
onClearAll && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1477
|
+
import_react_bootstrap18.Button,
|
|
1478
|
+
{
|
|
1479
|
+
variant: "link",
|
|
1480
|
+
className: "text-danger text-decoration-none btn-sm d-flex align-items-center",
|
|
1481
|
+
onClick: (e) => {
|
|
1482
|
+
e.stopPropagation();
|
|
1483
|
+
onClearAll();
|
|
1850
1484
|
},
|
|
1485
|
+
children: [
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_fi2.FiTrash2, { className: "me-1" }),
|
|
1487
|
+
"Limpar Filtros"
|
|
1488
|
+
]
|
|
1489
|
+
}
|
|
1490
|
+
),
|
|
1491
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1492
|
+
import_react_bootstrap18.Button,
|
|
1493
|
+
{
|
|
1494
|
+
variant: "primary",
|
|
1495
|
+
size: "sm",
|
|
1496
|
+
onClick: () => setExpanded(false),
|
|
1497
|
+
children: "Aplicar Filtros"
|
|
1498
|
+
}
|
|
1499
|
+
)
|
|
1500
|
+
] })
|
|
1501
|
+
] }) }) })
|
|
1502
|
+
] });
|
|
1503
|
+
};
|
|
1504
|
+
|
|
1505
|
+
// src/filters/UnifiedPeriodSelector.tsx
|
|
1506
|
+
var import_react13 = require("react");
|
|
1507
|
+
var import_react_bootstrap19 = require("react-bootstrap");
|
|
1508
|
+
var import_fa4 = require("react-icons/fa");
|
|
1509
|
+
var import_dayjs4 = __toESM(require("dayjs"));
|
|
1510
|
+
var import_isoWeek = __toESM(require("dayjs/plugin/isoWeek"));
|
|
1511
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1512
|
+
import_dayjs4.default.extend(import_isoWeek.default);
|
|
1513
|
+
var MONTHS = [
|
|
1514
|
+
"Jan",
|
|
1515
|
+
"Fev",
|
|
1516
|
+
"Mar",
|
|
1517
|
+
"Abr",
|
|
1518
|
+
"Mai",
|
|
1519
|
+
"Jun",
|
|
1520
|
+
"Jul",
|
|
1521
|
+
"Ago",
|
|
1522
|
+
"Set",
|
|
1523
|
+
"Out",
|
|
1524
|
+
"Nov",
|
|
1525
|
+
"Dez"
|
|
1526
|
+
];
|
|
1527
|
+
var MONTHS_FULL = [
|
|
1528
|
+
"Janeiro",
|
|
1529
|
+
"Fevereiro",
|
|
1530
|
+
"Mar\xE7o",
|
|
1531
|
+
"Abril",
|
|
1532
|
+
"Maio",
|
|
1533
|
+
"Junho",
|
|
1534
|
+
"Julho",
|
|
1535
|
+
"Agosto",
|
|
1536
|
+
"Setembro",
|
|
1537
|
+
"Outubro",
|
|
1538
|
+
"Novembro",
|
|
1539
|
+
"Dezembro"
|
|
1540
|
+
];
|
|
1541
|
+
var pad2 = (n) => String(n).padStart(2, "0");
|
|
1542
|
+
var startOfMonthISO = (year, m) => `${year}-${pad2(m + 1)}-01T00:00:00`;
|
|
1543
|
+
var endOfMonthISO = (year, m) => {
|
|
1544
|
+
const lastDay = new Date(year, m + 1, 0).getDate();
|
|
1545
|
+
return `${year}-${pad2(m + 1)}-${pad2(lastDay)}T23:59:59`;
|
|
1546
|
+
};
|
|
1547
|
+
var parseDate = (v) => {
|
|
1548
|
+
if (!v) return null;
|
|
1549
|
+
const d = new Date(v);
|
|
1550
|
+
return isNaN(d.getTime()) ? null : d;
|
|
1551
|
+
};
|
|
1552
|
+
var DEFAULT_PRESETS = [
|
|
1553
|
+
{
|
|
1554
|
+
key: "today",
|
|
1555
|
+
label: "Hoje",
|
|
1556
|
+
start: () => (0, import_dayjs4.default)().startOf("day"),
|
|
1557
|
+
end: () => (0, import_dayjs4.default)().endOf("day")
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
key: "week",
|
|
1561
|
+
label: "Esta semana",
|
|
1562
|
+
start: () => (0, import_dayjs4.default)().startOf("isoWeek"),
|
|
1563
|
+
end: () => (0, import_dayjs4.default)().endOf("isoWeek")
|
|
1564
|
+
},
|
|
1565
|
+
{
|
|
1566
|
+
key: "month",
|
|
1567
|
+
label: "Este m\xEAs",
|
|
1568
|
+
start: () => (0, import_dayjs4.default)().startOf("month"),
|
|
1569
|
+
end: () => (0, import_dayjs4.default)().endOf("month")
|
|
1570
|
+
},
|
|
1571
|
+
{
|
|
1572
|
+
key: "year",
|
|
1573
|
+
label: "Este ano",
|
|
1574
|
+
start: () => (0, import_dayjs4.default)().startOf("year"),
|
|
1575
|
+
end: () => (0, import_dayjs4.default)().endOf("year")
|
|
1576
|
+
}
|
|
1577
|
+
];
|
|
1578
|
+
var TABS = [
|
|
1579
|
+
{ key: "quick", icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaClock, { size: 12 }), label: "R\xE1pido" },
|
|
1580
|
+
{ key: "month", icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaCalendarAlt, { size: 12 }), label: "Meses" },
|
|
1581
|
+
{ key: "custom", icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaCalendarAlt, { size: 12 }), label: "Per\xEDodo" }
|
|
1582
|
+
];
|
|
1583
|
+
var UnifiedPeriodSelector = ({
|
|
1584
|
+
dataInicio,
|
|
1585
|
+
dataFim,
|
|
1586
|
+
onSelect,
|
|
1587
|
+
defaultTab = "quick",
|
|
1588
|
+
allowFuture = true,
|
|
1589
|
+
quickPresets,
|
|
1590
|
+
className = "",
|
|
1591
|
+
disabled = false,
|
|
1592
|
+
compact = false
|
|
1593
|
+
}) => {
|
|
1594
|
+
const [activeTab, setActiveTab] = (0, import_react13.useState)(defaultTab);
|
|
1595
|
+
const [isExpanded, setIsExpanded] = (0, import_react13.useState)(!compact);
|
|
1596
|
+
const [activePresetKey, setActivePresetKey] = (0, import_react13.useState)(null);
|
|
1597
|
+
const [selectedYear, setSelectedYear] = (0, import_react13.useState)(() => {
|
|
1598
|
+
const d = parseDate(dataInicio);
|
|
1599
|
+
return d ? d.getFullYear() : (/* @__PURE__ */ new Date()).getFullYear();
|
|
1600
|
+
});
|
|
1601
|
+
const [selectedMonths, setSelectedMonths] = (0, import_react13.useState)(/* @__PURE__ */ new Set());
|
|
1602
|
+
const [lastClickedMonth, setLastClickedMonth] = (0, import_react13.useState)(null);
|
|
1603
|
+
const [customStart, setCustomStart] = (0, import_react13.useState)("");
|
|
1604
|
+
const [customEnd, setCustomEnd] = (0, import_react13.useState)("");
|
|
1605
|
+
const presets = quickPresets || DEFAULT_PRESETS;
|
|
1606
|
+
(0, import_react13.useEffect)(() => {
|
|
1607
|
+
const start = parseDate(dataInicio);
|
|
1608
|
+
const end = parseDate(dataFim);
|
|
1609
|
+
if (!start || !end) return;
|
|
1610
|
+
if (start.getFullYear() === selectedYear || end.getFullYear() === selectedYear) {
|
|
1611
|
+
const next = /* @__PURE__ */ new Set();
|
|
1612
|
+
if (start.getFullYear() === end.getFullYear() && start.getFullYear() === selectedYear) {
|
|
1613
|
+
for (let m = start.getMonth(); m <= end.getMonth(); m++) next.add(m);
|
|
1614
|
+
} else {
|
|
1615
|
+
const s = start.getFullYear() === selectedYear ? start.getMonth() : 0;
|
|
1616
|
+
const e = end.getFullYear() === selectedYear ? end.getMonth() : 11;
|
|
1617
|
+
for (let m = s; m <= e; m++) next.add(m);
|
|
1618
|
+
}
|
|
1619
|
+
setSelectedMonths(next);
|
|
1620
|
+
}
|
|
1621
|
+
}, [dataInicio, dataFim, selectedYear]);
|
|
1622
|
+
(0, import_react13.useEffect)(() => {
|
|
1623
|
+
if (dataInicio) setCustomStart((0, import_dayjs4.default)(dataInicio).format("YYYY-MM-DDTHH:mm"));
|
|
1624
|
+
if (dataFim) setCustomEnd((0, import_dayjs4.default)(dataFim).format("YYYY-MM-DDTHH:mm"));
|
|
1625
|
+
}, [dataInicio, dataFim]);
|
|
1626
|
+
const displayLabel = (0, import_react13.useMemo)(() => {
|
|
1627
|
+
const s = parseDate(dataInicio);
|
|
1628
|
+
const e = parseDate(dataFim);
|
|
1629
|
+
if (!s || !e) return "Selecione um per\xEDodo";
|
|
1630
|
+
if (activePresetKey) {
|
|
1631
|
+
const p = presets.find((pr) => pr.key === activePresetKey);
|
|
1632
|
+
if (p) return p.label;
|
|
1633
|
+
}
|
|
1634
|
+
if (s.getFullYear() === e.getFullYear() && s.getMonth() === e.getMonth() && s.getDate() === 1) {
|
|
1635
|
+
return `${MONTHS_FULL[s.getMonth()]} ${s.getFullYear()}`;
|
|
1636
|
+
}
|
|
1637
|
+
return `${(0, import_dayjs4.default)(s).format("DD/MM/YYYY")} \u2013 ${(0, import_dayjs4.default)(e).format("DD/MM/YYYY")}`;
|
|
1638
|
+
}, [dataInicio, dataFim, activePresetKey, presets]);
|
|
1639
|
+
const handlePreset = (0, import_react13.useCallback)(
|
|
1640
|
+
(preset) => {
|
|
1641
|
+
if (disabled) return;
|
|
1642
|
+
setActivePresetKey(preset.key);
|
|
1643
|
+
onSelect({
|
|
1644
|
+
dataInicio: preset.start().toISOString(),
|
|
1645
|
+
dataFim: preset.end().toISOString()
|
|
1646
|
+
});
|
|
1647
|
+
},
|
|
1648
|
+
[disabled, onSelect]
|
|
1649
|
+
);
|
|
1650
|
+
const handleMonthClick = (0, import_react13.useCallback)(
|
|
1651
|
+
(index, event) => {
|
|
1652
|
+
if (disabled) return;
|
|
1653
|
+
const ctrl = event.ctrlKey || event.metaKey;
|
|
1654
|
+
const shift = event.shiftKey;
|
|
1655
|
+
setSelectedMonths((prev) => {
|
|
1656
|
+
let next;
|
|
1657
|
+
if (shift && lastClickedMonth !== null) {
|
|
1658
|
+
next = /* @__PURE__ */ new Set();
|
|
1659
|
+
const start = Math.min(index, lastClickedMonth);
|
|
1660
|
+
const end = Math.max(index, lastClickedMonth);
|
|
1661
|
+
for (let m = start; m <= end; m++) next.add(m);
|
|
1662
|
+
} else if (ctrl) {
|
|
1663
|
+
next = new Set(prev);
|
|
1664
|
+
if (next.has(index)) next.delete(index);
|
|
1665
|
+
else next.add(index);
|
|
1666
|
+
} else {
|
|
1667
|
+
next = /* @__PURE__ */ new Set([index]);
|
|
1668
|
+
}
|
|
1669
|
+
if (next.size === 0) {
|
|
1670
|
+
onSelect({ dataInicio: "", dataFim: "" });
|
|
1671
|
+
} else {
|
|
1672
|
+
const arr = Array.from(next).sort((a, b) => a - b);
|
|
1673
|
+
const first = arr[0];
|
|
1674
|
+
const last = arr[arr.length - 1];
|
|
1675
|
+
onSelect({
|
|
1676
|
+
dataInicio: startOfMonthISO(selectedYear, first),
|
|
1677
|
+
dataFim: endOfMonthISO(selectedYear, last)
|
|
1678
|
+
});
|
|
1679
|
+
}
|
|
1680
|
+
setActivePresetKey(null);
|
|
1681
|
+
return next;
|
|
1682
|
+
});
|
|
1683
|
+
setLastClickedMonth(index);
|
|
1684
|
+
},
|
|
1685
|
+
[disabled, lastClickedMonth, onSelect, selectedYear]
|
|
1686
|
+
);
|
|
1687
|
+
const handleYearChange = (0, import_react13.useCallback)(
|
|
1688
|
+
(delta) => {
|
|
1689
|
+
const newYear = selectedYear + delta;
|
|
1690
|
+
setSelectedYear(newYear);
|
|
1691
|
+
if (selectedMonths.size > 0) {
|
|
1692
|
+
const arr = Array.from(selectedMonths).sort((a, b) => a - b);
|
|
1693
|
+
onSelect({
|
|
1694
|
+
dataInicio: startOfMonthISO(newYear, arr[0]),
|
|
1695
|
+
dataFim: endOfMonthISO(newYear, arr[arr.length - 1])
|
|
1696
|
+
});
|
|
1697
|
+
setActivePresetKey(null);
|
|
1698
|
+
}
|
|
1699
|
+
},
|
|
1700
|
+
[selectedYear, selectedMonths, onSelect]
|
|
1701
|
+
);
|
|
1702
|
+
const quickMonthOptions = (0, import_react13.useMemo)(() => {
|
|
1703
|
+
const now = /* @__PURE__ */ new Date();
|
|
1704
|
+
const opts = [];
|
|
1705
|
+
for (let yearOffset = 0; yearOffset <= 1; yearOffset++) {
|
|
1706
|
+
const year = now.getFullYear() - yearOffset;
|
|
1707
|
+
const lastMonth = yearOffset === 0 ? now.getMonth() : 11;
|
|
1708
|
+
for (let m = lastMonth; m >= 0; m--) {
|
|
1709
|
+
opts.push({
|
|
1710
|
+
value: `${year}-${pad2(m + 1)}`,
|
|
1711
|
+
label: `${MONTHS_FULL[m]} ${year}`,
|
|
1712
|
+
year,
|
|
1713
|
+
month: m
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
return opts;
|
|
1718
|
+
}, []);
|
|
1719
|
+
const quickMonthValue = (0, import_react13.useMemo)(() => {
|
|
1720
|
+
const s = parseDate(dataInicio);
|
|
1721
|
+
const e = parseDate(dataFim);
|
|
1722
|
+
if (!s || !e) return "";
|
|
1723
|
+
if (s.getFullYear() === e.getFullYear() && s.getMonth() === e.getMonth() && s.getDate() === 1) {
|
|
1724
|
+
return `${s.getFullYear()}-${pad2(s.getMonth() + 1)}`;
|
|
1725
|
+
}
|
|
1726
|
+
return "";
|
|
1727
|
+
}, [dataInicio, dataFim]);
|
|
1728
|
+
const handleQuickMonthChange = (0, import_react13.useCallback)(
|
|
1729
|
+
(value) => {
|
|
1730
|
+
if (disabled || !value) return;
|
|
1731
|
+
const opt = quickMonthOptions.find((o) => o.value === value);
|
|
1732
|
+
if (!opt) return;
|
|
1733
|
+
setActivePresetKey(null);
|
|
1734
|
+
setSelectedYear(opt.year);
|
|
1735
|
+
setSelectedMonths(/* @__PURE__ */ new Set([opt.month]));
|
|
1736
|
+
onSelect({
|
|
1737
|
+
dataInicio: startOfMonthISO(opt.year, opt.month),
|
|
1738
|
+
dataFim: endOfMonthISO(opt.year, opt.month)
|
|
1739
|
+
});
|
|
1740
|
+
},
|
|
1741
|
+
[disabled, onSelect, quickMonthOptions]
|
|
1742
|
+
);
|
|
1743
|
+
const handleCustomApply = (0, import_react13.useCallback)(() => {
|
|
1744
|
+
if (!customStart || !customEnd) return;
|
|
1745
|
+
setActivePresetKey(null);
|
|
1746
|
+
onSelect({
|
|
1747
|
+
dataInicio: (0, import_dayjs4.default)(customStart).toISOString(),
|
|
1748
|
+
dataFim: (0, import_dayjs4.default)(customEnd).toISOString()
|
|
1749
|
+
});
|
|
1750
|
+
}, [customStart, customEnd, onSelect]);
|
|
1751
|
+
const handleClear = (0, import_react13.useCallback)(() => {
|
|
1752
|
+
setSelectedMonths(/* @__PURE__ */ new Set());
|
|
1753
|
+
setActivePresetKey(null);
|
|
1754
|
+
setCustomStart("");
|
|
1755
|
+
setCustomEnd("");
|
|
1756
|
+
onSelect({ dataInicio: "", dataFim: "" });
|
|
1757
|
+
}, [onSelect]);
|
|
1758
|
+
const today = /* @__PURE__ */ new Date();
|
|
1759
|
+
const maxDateStr = allowFuture ? void 0 : (0, import_dayjs4.default)().format("YYYY-MM-DDTHH:mm");
|
|
1760
|
+
if (compact && !isExpanded) {
|
|
1761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1762
|
+
import_react_bootstrap19.Card,
|
|
1763
|
+
{
|
|
1764
|
+
className: `ups-card ups-card--compact ${className}`,
|
|
1765
|
+
onClick: () => !disabled && setIsExpanded(true),
|
|
1766
|
+
role: "button",
|
|
1767
|
+
tabIndex: 0,
|
|
1768
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ups-compact-row", children: [
|
|
1769
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaCalendarAlt, { className: "text-primary me-2" }),
|
|
1770
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ups-display-label", children: displayLabel }),
|
|
1771
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ups-edit-hint text-muted small", children: "Editar" })
|
|
1772
|
+
] })
|
|
1773
|
+
}
|
|
1774
|
+
);
|
|
1775
|
+
}
|
|
1776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_bootstrap19.Card, { className: `ups-card ${className}`, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_bootstrap19.Card.Body, { className: "ups-body", children: [
|
|
1777
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ups-header", children: [
|
|
1778
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "d-flex align-items-center gap-2 flex-grow-1 min-w-0", children: [
|
|
1779
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaCalendarAlt, { className: "text-primary flex-shrink-0" }),
|
|
1780
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ups-display-label text-truncate", children: displayLabel })
|
|
1781
|
+
] }),
|
|
1782
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "d-flex align-items-center gap-1", children: [
|
|
1783
|
+
(dataInicio || dataFim) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1784
|
+
import_react_bootstrap19.Button,
|
|
1785
|
+
{
|
|
1786
|
+
variant: "link",
|
|
1787
|
+
size: "sm",
|
|
1788
|
+
className: "p-0 text-muted",
|
|
1789
|
+
onClick: handleClear,
|
|
1790
|
+
title: "Limpar per\xEDodo",
|
|
1791
|
+
disabled,
|
|
1792
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaTimesCircle, { size: 14 })
|
|
1793
|
+
}
|
|
1794
|
+
),
|
|
1795
|
+
compact && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1796
|
+
import_react_bootstrap19.Button,
|
|
1797
|
+
{
|
|
1798
|
+
variant: "link",
|
|
1799
|
+
size: "sm",
|
|
1800
|
+
className: "p-0 text-muted",
|
|
1801
|
+
onClick: () => setIsExpanded(false),
|
|
1802
|
+
children: "Fechar"
|
|
1803
|
+
}
|
|
1804
|
+
)
|
|
1805
|
+
] })
|
|
1806
|
+
] }),
|
|
1807
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ups-tabs", children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1808
|
+
"button",
|
|
1809
|
+
{
|
|
1810
|
+
className: `ups-tab ${activeTab === tab.key ? "ups-tab--active" : ""}`,
|
|
1811
|
+
onClick: () => setActiveTab(tab.key),
|
|
1812
|
+
disabled,
|
|
1813
|
+
children: [
|
|
1814
|
+
tab.icon,
|
|
1815
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { children: tab.label })
|
|
1816
|
+
]
|
|
1817
|
+
},
|
|
1818
|
+
tab.key
|
|
1819
|
+
)) }),
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ups-content", children: [
|
|
1821
|
+
activeTab === "quick" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
1822
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ups-quick-grid", children: presets.map((p) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1823
|
+
import_react_bootstrap19.Button,
|
|
1824
|
+
{
|
|
1825
|
+
size: "sm",
|
|
1826
|
+
variant: activePresetKey === p.key ? "primary" : "outline-secondary",
|
|
1827
|
+
className: "ups-quick-btn",
|
|
1828
|
+
onClick: () => handlePreset(p),
|
|
1829
|
+
disabled,
|
|
1851
1830
|
children: p.label
|
|
1852
1831
|
},
|
|
1853
1832
|
p.key
|
|
1854
|
-
))
|
|
1833
|
+
)) }),
|
|
1834
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ups-quick-month", children: [
|
|
1835
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_bootstrap19.Form.Label, { className: "small text-muted mb-1", children: "M\xEAs exato" }),
|
|
1836
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
1837
|
+
import_react_bootstrap19.Form.Select,
|
|
1838
|
+
{
|
|
1839
|
+
size: "sm",
|
|
1840
|
+
value: quickMonthValue,
|
|
1841
|
+
onChange: (e) => handleQuickMonthChange(e.target.value),
|
|
1842
|
+
disabled,
|
|
1843
|
+
"aria-label": "Selecionar m\xEAs exato",
|
|
1844
|
+
children: [
|
|
1845
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: "", children: "Escolha um m\xEAs\u2026" }),
|
|
1846
|
+
quickMonthOptions.map((o) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("option", { value: o.value, children: o.label }, o.value))
|
|
1847
|
+
]
|
|
1848
|
+
}
|
|
1849
|
+
)
|
|
1850
|
+
] })
|
|
1855
1851
|
] }),
|
|
1856
|
-
/* @__PURE__ */ (0,
|
|
1857
|
-
/* @__PURE__ */ (0,
|
|
1858
|
-
/* @__PURE__ */ (0,
|
|
1859
|
-
|
|
1860
|
-
import_react_bootstrap20.Form.Control,
|
|
1852
|
+
activeTab === "month" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ups-month-section", children: [
|
|
1853
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ups-year-nav", children: [
|
|
1854
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1855
|
+
import_react_bootstrap19.Button,
|
|
1861
1856
|
{
|
|
1862
|
-
|
|
1857
|
+
variant: "outline-secondary",
|
|
1863
1858
|
size: "sm",
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1859
|
+
className: "ups-year-btn",
|
|
1860
|
+
onClick: () => handleYearChange(-1),
|
|
1861
|
+
disabled,
|
|
1862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaChevronLeft, { size: 10 })
|
|
1867
1863
|
}
|
|
1868
|
-
)
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1873
|
-
import_react_bootstrap20.Form.Control,
|
|
1864
|
+
),
|
|
1865
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "ups-year-label", children: selectedYear }),
|
|
1866
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1867
|
+
import_react_bootstrap19.Button,
|
|
1874
1868
|
{
|
|
1875
|
-
|
|
1869
|
+
variant: "outline-secondary",
|
|
1876
1870
|
size: "sm",
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1871
|
+
className: "ups-year-btn",
|
|
1872
|
+
onClick: () => handleYearChange(1),
|
|
1873
|
+
disabled,
|
|
1874
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_fa4.FaChevronRight, { size: 10 })
|
|
1881
1875
|
}
|
|
1882
1876
|
)
|
|
1883
|
-
] })
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
var import_react16 = require("react");
|
|
1900
|
-
var import_react_bootstrap21 = require("react-bootstrap");
|
|
1901
|
-
var import_fi2 = require("react-icons/fi");
|
|
1902
|
-
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1903
|
-
var AdvancedFilterBar = ({
|
|
1904
|
-
children,
|
|
1905
|
-
title = "Filtros e Busca",
|
|
1906
|
-
activeFiltersCount = 0,
|
|
1907
|
-
onClearAll,
|
|
1908
|
-
defaultExpanded = false,
|
|
1909
|
-
className = ""
|
|
1910
|
-
}) => {
|
|
1911
|
-
const [expanded, setExpanded] = (0, import_react16.useState)(defaultExpanded);
|
|
1912
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: `advanced-filter-bar ${className}`, children: [
|
|
1913
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1914
|
-
"div",
|
|
1915
|
-
{
|
|
1916
|
-
className: "filter-bar-header",
|
|
1917
|
-
onClick: () => setExpanded(!expanded),
|
|
1918
|
-
children: [
|
|
1919
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "filter-title-group", children: [
|
|
1920
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fi2.FiFilter, { className: "text-primary" }),
|
|
1921
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("h5", { className: "filter-title", children: title }),
|
|
1922
|
-
activeFiltersCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("span", { className: "filter-count-badge", children: [
|
|
1923
|
-
activeFiltersCount,
|
|
1924
|
-
" ativos"
|
|
1925
|
-
] })
|
|
1926
|
-
] }),
|
|
1927
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "filter-chevron", children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fi2.FiChevronUp, { size: 20 }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_fi2.FiChevronDown, { size: 20 }) })
|
|
1928
|
-
]
|
|
1929
|
-
}
|
|
1930
|
-
),
|
|
1931
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap21.Collapse, { in: expanded, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "filter-bar-content", children: [
|
|
1932
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "filter-grid", children }),
|
|
1933
|
-
(onClearAll || activeFiltersCount > 0) && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "filter-actions", children: [
|
|
1934
|
-
onClearAll && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1935
|
-
import_react_bootstrap21.Button,
|
|
1936
|
-
{
|
|
1937
|
-
variant: "link",
|
|
1938
|
-
className: "text-danger text-decoration-none btn-sm d-flex align-items-center",
|
|
1939
|
-
onClick: (e) => {
|
|
1940
|
-
e.stopPropagation();
|
|
1941
|
-
onClearAll();
|
|
1877
|
+
] }),
|
|
1878
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "ups-month-grid", children: MONTHS.map((label, idx) => {
|
|
1879
|
+
const isSelected = selectedMonths.has(idx);
|
|
1880
|
+
const isCurrent = today.getFullYear() === selectedYear && today.getMonth() === idx;
|
|
1881
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1882
|
+
"button",
|
|
1883
|
+
{
|
|
1884
|
+
className: [
|
|
1885
|
+
"ups-month-cell",
|
|
1886
|
+
isSelected && "ups-month-cell--selected",
|
|
1887
|
+
isCurrent && !isSelected && "ups-month-cell--current"
|
|
1888
|
+
].filter(Boolean).join(" "),
|
|
1889
|
+
onClick: (e) => handleMonthClick(idx, e),
|
|
1890
|
+
disabled,
|
|
1891
|
+
title: "Clique: selecionar \xB7 Shift: range \xB7 Ctrl/Cmd: multi",
|
|
1892
|
+
children: label
|
|
1942
1893
|
},
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
1950
|
-
|
|
1894
|
+
idx
|
|
1895
|
+
);
|
|
1896
|
+
}) }),
|
|
1897
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "ups-month-hint text-muted", children: "Shift+clique para range \xB7 Ctrl/Cmd+clique para multi-sele\xE7\xE3o" })
|
|
1898
|
+
] }),
|
|
1899
|
+
activeTab === "custom" && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "ups-custom-section", children: [
|
|
1900
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_bootstrap19.Row, { className: "g-2", children: [
|
|
1901
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_bootstrap19.Col, { xs: 12, sm: 6, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_bootstrap19.Form.Group, { children: [
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_bootstrap19.Form.Label, { className: "small text-muted mb-1", children: "In\xEDcio" }),
|
|
1903
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1904
|
+
import_react_bootstrap19.Form.Control,
|
|
1905
|
+
{
|
|
1906
|
+
type: "datetime-local",
|
|
1907
|
+
size: "sm",
|
|
1908
|
+
value: customStart,
|
|
1909
|
+
max: maxDateStr,
|
|
1910
|
+
onChange: (e) => setCustomStart(e.target.value),
|
|
1911
|
+
disabled
|
|
1912
|
+
}
|
|
1913
|
+
)
|
|
1914
|
+
] }) }),
|
|
1915
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_bootstrap19.Col, { xs: 12, sm: 6, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_react_bootstrap19.Form.Group, { children: [
|
|
1916
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_react_bootstrap19.Form.Label, { className: "small text-muted mb-1", children: "Fim" }),
|
|
1917
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1918
|
+
import_react_bootstrap19.Form.Control,
|
|
1919
|
+
{
|
|
1920
|
+
type: "datetime-local",
|
|
1921
|
+
size: "sm",
|
|
1922
|
+
value: customEnd,
|
|
1923
|
+
min: customStart,
|
|
1924
|
+
max: maxDateStr,
|
|
1925
|
+
onChange: (e) => setCustomEnd(e.target.value),
|
|
1926
|
+
disabled
|
|
1927
|
+
}
|
|
1928
|
+
)
|
|
1929
|
+
] }) })
|
|
1930
|
+
] }),
|
|
1931
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "d-flex justify-content-end mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1932
|
+
import_react_bootstrap19.Button,
|
|
1951
1933
|
{
|
|
1952
1934
|
variant: "primary",
|
|
1953
1935
|
size: "sm",
|
|
1954
|
-
onClick:
|
|
1955
|
-
|
|
1936
|
+
onClick: handleCustomApply,
|
|
1937
|
+
disabled: disabled || !customStart || !customEnd,
|
|
1938
|
+
children: "Aplicar"
|
|
1956
1939
|
}
|
|
1957
|
-
)
|
|
1940
|
+
) })
|
|
1958
1941
|
] })
|
|
1959
|
-
] })
|
|
1960
|
-
] });
|
|
1942
|
+
] })
|
|
1943
|
+
] }) });
|
|
1961
1944
|
};
|
|
1962
1945
|
|
|
1963
1946
|
// src/forms/MailSender.tsx
|
|
1964
|
-
var
|
|
1965
|
-
var
|
|
1947
|
+
var import_react14 = require("react");
|
|
1948
|
+
var import_react_bootstrap20 = require("react-bootstrap");
|
|
1966
1949
|
var import_fi3 = require("react-icons/fi");
|
|
1967
|
-
var
|
|
1950
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1968
1951
|
var MailSender = ({
|
|
1969
1952
|
htmlContent,
|
|
1970
1953
|
companyName,
|
|
@@ -1973,15 +1956,15 @@ var MailSender = ({
|
|
|
1973
1956
|
hide = false,
|
|
1974
1957
|
renderTrigger
|
|
1975
1958
|
}) => {
|
|
1976
|
-
const [opened, setOpened] = (0,
|
|
1977
|
-
const [addingEmail, setAddingEmail] = (0,
|
|
1978
|
-
const [selectedEmails, setSelectedEmails] = (0,
|
|
1979
|
-
const [emails, setEmails] = (0,
|
|
1980
|
-
const [loading, setLoading] = (0,
|
|
1981
|
-
const [postLoading, setPostLoading] = (0,
|
|
1982
|
-
const [customEmail, setCustomEmail] = (0,
|
|
1983
|
-
const [emailError, setEmailError] = (0,
|
|
1984
|
-
const [searchFilter, setSearchFilter] = (0,
|
|
1959
|
+
const [opened, setOpened] = (0, import_react14.useState)(false);
|
|
1960
|
+
const [addingEmail, setAddingEmail] = (0, import_react14.useState)(false);
|
|
1961
|
+
const [selectedEmails, setSelectedEmails] = (0, import_react14.useState)([]);
|
|
1962
|
+
const [emails, setEmails] = (0, import_react14.useState)([]);
|
|
1963
|
+
const [loading, setLoading] = (0, import_react14.useState)(false);
|
|
1964
|
+
const [postLoading, setPostLoading] = (0, import_react14.useState)(false);
|
|
1965
|
+
const [customEmail, setCustomEmail] = (0, import_react14.useState)("");
|
|
1966
|
+
const [emailError, setEmailError] = (0, import_react14.useState)("");
|
|
1967
|
+
const [searchFilter, setSearchFilter] = (0, import_react14.useState)("");
|
|
1985
1968
|
const handleOpen = async () => {
|
|
1986
1969
|
setLoading(true);
|
|
1987
1970
|
try {
|
|
@@ -2064,9 +2047,9 @@ var MailSender = ({
|
|
|
2064
2047
|
if (renderTrigger) {
|
|
2065
2048
|
return renderTrigger({ onClick: handleOpen, loading });
|
|
2066
2049
|
}
|
|
2067
|
-
return /* @__PURE__ */ (0,
|
|
2050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Button, { disabled: loading, className: "w-100", onClick: handleOpen, children: loading ? "Carregando..." : "Enviar por E-mail" });
|
|
2068
2051
|
}
|
|
2069
|
-
return /* @__PURE__ */ (0,
|
|
2052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2070
2053
|
"div",
|
|
2071
2054
|
{
|
|
2072
2055
|
style: {
|
|
@@ -2077,7 +2060,7 @@ var MailSender = ({
|
|
|
2077
2060
|
boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1)"
|
|
2078
2061
|
},
|
|
2079
2062
|
children: [
|
|
2080
|
-
/* @__PURE__ */ (0,
|
|
2063
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2081
2064
|
"div",
|
|
2082
2065
|
{
|
|
2083
2066
|
style: {
|
|
@@ -2085,20 +2068,20 @@ var MailSender = ({
|
|
|
2085
2068
|
color: "white",
|
|
2086
2069
|
padding: "25px"
|
|
2087
2070
|
},
|
|
2088
|
-
children: /* @__PURE__ */ (0,
|
|
2089
|
-
/* @__PURE__ */ (0,
|
|
2090
|
-
/* @__PURE__ */ (0,
|
|
2091
|
-
/* @__PURE__ */ (0,
|
|
2071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "d-flex justify-content-between align-items-center", children: [
|
|
2072
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
2073
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("h4", { className: "mb-1", style: { fontWeight: "600", fontSize: "22px" }, children: [
|
|
2074
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiMail, { className: "me-2", size: 20 }),
|
|
2092
2075
|
"Enviar Relat\xF3rio por E-mail"
|
|
2093
2076
|
] }),
|
|
2094
|
-
/* @__PURE__ */ (0,
|
|
2077
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("small", { style: { opacity: "0.9", fontSize: "14px" }, children: [
|
|
2095
2078
|
"Selecione os destinat\xE1rios para envio do relat\xF3rio de ",
|
|
2096
2079
|
companyName
|
|
2097
2080
|
] })
|
|
2098
2081
|
] }),
|
|
2099
|
-
/* @__PURE__ */ (0,
|
|
2100
|
-
/* @__PURE__ */ (0,
|
|
2101
|
-
|
|
2082
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "d-flex gap-2", children: [
|
|
2083
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2084
|
+
import_react_bootstrap20.Button,
|
|
2102
2085
|
{
|
|
2103
2086
|
variant: "light",
|
|
2104
2087
|
onClick: sendEmail,
|
|
@@ -2109,38 +2092,38 @@ var MailSender = ({
|
|
|
2109
2092
|
minWidth: "130px",
|
|
2110
2093
|
height: "40px"
|
|
2111
2094
|
},
|
|
2112
|
-
children: postLoading ? /* @__PURE__ */ (0,
|
|
2113
|
-
/* @__PURE__ */ (0,
|
|
2095
|
+
children: postLoading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
2096
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Spinner, { size: "sm", className: "me-2" }),
|
|
2114
2097
|
"Enviando..."
|
|
2115
|
-
] }) : /* @__PURE__ */ (0,
|
|
2116
|
-
/* @__PURE__ */ (0,
|
|
2098
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
2099
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiSend, { className: "me-2", size: 14 }),
|
|
2117
2100
|
"Enviar E-mail"
|
|
2118
2101
|
] })
|
|
2119
2102
|
}
|
|
2120
2103
|
),
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2122
|
-
|
|
2104
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2105
|
+
import_react_bootstrap20.Button,
|
|
2123
2106
|
{
|
|
2124
2107
|
variant: "outline-light",
|
|
2125
2108
|
onClick: () => setOpened(false),
|
|
2126
2109
|
disabled: postLoading,
|
|
2127
2110
|
style: { borderRadius: "8px", width: "40px", height: "40px" },
|
|
2128
|
-
children: /* @__PURE__ */ (0,
|
|
2111
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiX, { size: 16 })
|
|
2129
2112
|
}
|
|
2130
2113
|
)
|
|
2131
2114
|
] })
|
|
2132
2115
|
] })
|
|
2133
2116
|
}
|
|
2134
2117
|
),
|
|
2135
|
-
/* @__PURE__ */ (0,
|
|
2136
|
-
/* @__PURE__ */ (0,
|
|
2137
|
-
/* @__PURE__ */ (0,
|
|
2138
|
-
/* @__PURE__ */ (0,
|
|
2139
|
-
/* @__PURE__ */ (0,
|
|
2140
|
-
/* @__PURE__ */ (0,
|
|
2141
|
-
/* @__PURE__ */ (0,
|
|
2142
|
-
/* @__PURE__ */ (0,
|
|
2143
|
-
|
|
2118
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { style: { padding: "25px" }, children: [
|
|
2119
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Card, { className: "mb-4", style: { border: "none", boxShadow: "0 2px 8px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Card.Body, { style: { padding: "20px" }, children: [
|
|
2120
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Row, { className: "align-items-center", children: [
|
|
2121
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Col, { md: 6, children: [
|
|
2122
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h6", { className: "mb-2", style: { color: "#495057", fontWeight: "600" }, children: "\u{1F527} Filtros e A\xE7\xF5es" }),
|
|
2123
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.InputGroup, { style: { maxWidth: "300px" }, children: [
|
|
2124
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.InputGroup.Text, { style: { backgroundColor: "#f8f9fa", border: "1px solid #dee2e6" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiSearch, { size: 14, color: "#6c757d" }) }),
|
|
2125
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2126
|
+
import_react_bootstrap20.Form.Control,
|
|
2144
2127
|
{
|
|
2145
2128
|
type: "text",
|
|
2146
2129
|
placeholder: "Buscar e-mails...",
|
|
@@ -2151,25 +2134,25 @@ var MailSender = ({
|
|
|
2151
2134
|
)
|
|
2152
2135
|
] })
|
|
2153
2136
|
] }),
|
|
2154
|
-
/* @__PURE__ */ (0,
|
|
2155
|
-
|
|
2137
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Col, { md: 6, className: "text-end", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2138
|
+
import_react_bootstrap20.Button,
|
|
2156
2139
|
{
|
|
2157
2140
|
variant: addingEmail ? "outline-secondary" : "outline-primary",
|
|
2158
2141
|
size: "sm",
|
|
2159
2142
|
onClick: () => setAddingEmail(!addingEmail),
|
|
2160
2143
|
disabled: postLoading,
|
|
2161
2144
|
style: { borderRadius: "8px" },
|
|
2162
|
-
children: addingEmail ? /* @__PURE__ */ (0,
|
|
2163
|
-
/* @__PURE__ */ (0,
|
|
2145
|
+
children: addingEmail ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
2146
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiX, { className: "me-1", size: 14 }),
|
|
2164
2147
|
"Cancelar"
|
|
2165
|
-
] }) : /* @__PURE__ */ (0,
|
|
2166
|
-
/* @__PURE__ */ (0,
|
|
2148
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
2149
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiPlus, { className: "me-1", size: 14 }),
|
|
2167
2150
|
"E-mail Personalizado"
|
|
2168
2151
|
] })
|
|
2169
2152
|
}
|
|
2170
2153
|
) })
|
|
2171
2154
|
] }),
|
|
2172
|
-
addingEmail && /* @__PURE__ */ (0,
|
|
2155
|
+
addingEmail && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2173
2156
|
"div",
|
|
2174
2157
|
{
|
|
2175
2158
|
style: {
|
|
@@ -2180,12 +2163,12 @@ var MailSender = ({
|
|
|
2180
2163
|
border: "1px solid #e3f2fd"
|
|
2181
2164
|
},
|
|
2182
2165
|
children: [
|
|
2183
|
-
/* @__PURE__ */ (0,
|
|
2184
|
-
/* @__PURE__ */ (0,
|
|
2185
|
-
/* @__PURE__ */ (0,
|
|
2186
|
-
/* @__PURE__ */ (0,
|
|
2187
|
-
/* @__PURE__ */ (0,
|
|
2188
|
-
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h6", { className: "mb-3", style: { color: "#1976d2", fontWeight: "600" }, children: "\u2709\uFE0F Adicionar E-mail Personalizado" }),
|
|
2167
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Row, { className: "align-items-end", children: [
|
|
2168
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Col, { md: 8, children: [
|
|
2169
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Form.Label, { style: { fontSize: "13px", color: "#6c757d", fontWeight: "500" }, children: "Endere\xE7o de E-mail" }),
|
|
2170
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2171
|
+
import_react_bootstrap20.Form.Control,
|
|
2189
2172
|
{
|
|
2190
2173
|
type: "email",
|
|
2191
2174
|
placeholder: "exemplo@empresa.com",
|
|
@@ -2200,17 +2183,17 @@ var MailSender = ({
|
|
|
2200
2183
|
onKeyPress: (e) => e.key === "Enter" && handleEmailAdd()
|
|
2201
2184
|
}
|
|
2202
2185
|
),
|
|
2203
|
-
/* @__PURE__ */ (0,
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Form.Control.Feedback, { type: "invalid", children: emailError })
|
|
2204
2187
|
] }),
|
|
2205
|
-
/* @__PURE__ */ (0,
|
|
2206
|
-
|
|
2188
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Col, { md: 4, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2189
|
+
import_react_bootstrap20.Button,
|
|
2207
2190
|
{
|
|
2208
2191
|
variant: "success",
|
|
2209
2192
|
onClick: handleEmailAdd,
|
|
2210
2193
|
disabled: postLoading,
|
|
2211
2194
|
style: { borderRadius: "8px", width: "100%" },
|
|
2212
2195
|
children: [
|
|
2213
|
-
/* @__PURE__ */ (0,
|
|
2196
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiPlus, { className: "me-1", size: 14 }),
|
|
2214
2197
|
"Adicionar"
|
|
2215
2198
|
]
|
|
2216
2199
|
}
|
|
@@ -2220,16 +2203,16 @@ var MailSender = ({
|
|
|
2220
2203
|
}
|
|
2221
2204
|
)
|
|
2222
2205
|
] }) }),
|
|
2223
|
-
selectedEmails.length > 0 && /* @__PURE__ */ (0,
|
|
2224
|
-
/* @__PURE__ */ (0,
|
|
2225
|
-
/* @__PURE__ */ (0,
|
|
2226
|
-
/* @__PURE__ */ (0,
|
|
2206
|
+
selectedEmails.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Card, { className: "mb-4", style: { border: "none", boxShadow: "0 2px 8px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Card.Body, { style: { padding: "20px" }, children: [
|
|
2207
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "d-flex justify-content-between align-items-center mb-3", children: [
|
|
2208
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h6", { className: "mb-0", style: { color: "#495057", fontWeight: "600" }, children: "\u{1F4CB} Destinat\xE1rios Selecionados" }),
|
|
2209
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Badge, { bg: "primary", style: { fontSize: "12px", padding: "6px 12px" }, children: [
|
|
2227
2210
|
selectedEmails.length,
|
|
2228
2211
|
" selecionado",
|
|
2229
2212
|
selectedEmails.length > 1 ? "s" : ""
|
|
2230
2213
|
] })
|
|
2231
2214
|
] }),
|
|
2232
|
-
/* @__PURE__ */ (0,
|
|
2215
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "d-flex flex-wrap gap-2", children: selectedEmails.map((email, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2233
2216
|
"div",
|
|
2234
2217
|
{
|
|
2235
2218
|
style: {
|
|
@@ -2243,10 +2226,10 @@ var MailSender = ({
|
|
|
2243
2226
|
fontWeight: "500"
|
|
2244
2227
|
},
|
|
2245
2228
|
children: [
|
|
2246
|
-
/* @__PURE__ */ (0,
|
|
2247
|
-
/* @__PURE__ */ (0,
|
|
2248
|
-
/* @__PURE__ */ (0,
|
|
2249
|
-
|
|
2229
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiUser, { size: 12, className: "me-2", color: "#1976d2" }),
|
|
2230
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: email.email || email }),
|
|
2231
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2232
|
+
import_react_bootstrap20.Button,
|
|
2250
2233
|
{
|
|
2251
2234
|
variant: "link",
|
|
2252
2235
|
size: "sm",
|
|
@@ -2258,7 +2241,7 @@ var MailSender = ({
|
|
|
2258
2241
|
textDecoration: "none",
|
|
2259
2242
|
fontSize: "16px"
|
|
2260
2243
|
},
|
|
2261
|
-
children: /* @__PURE__ */ (0,
|
|
2244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiX, { size: 14 })
|
|
2262
2245
|
}
|
|
2263
2246
|
)
|
|
2264
2247
|
]
|
|
@@ -2266,17 +2249,17 @@ var MailSender = ({
|
|
|
2266
2249
|
index
|
|
2267
2250
|
)) })
|
|
2268
2251
|
] }) }),
|
|
2269
|
-
/* @__PURE__ */ (0,
|
|
2270
|
-
/* @__PURE__ */ (0,
|
|
2271
|
-
/* @__PURE__ */ (0,
|
|
2252
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Card, { style: { border: "none", boxShadow: "0 2px 8px rgba(0,0,0,0.05)" }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Card.Body, { style: { padding: "20px" }, children: [
|
|
2253
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("h6", { className: "mb-3", style: { color: "#495057", fontWeight: "600" }, children: [
|
|
2254
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiUser, { className: "me-2", size: 16 }),
|
|
2272
2255
|
"E-mails de ",
|
|
2273
2256
|
companyName
|
|
2274
2257
|
] }),
|
|
2275
|
-
loading ? /* @__PURE__ */ (0,
|
|
2276
|
-
/* @__PURE__ */ (0,
|
|
2277
|
-
/* @__PURE__ */ (0,
|
|
2278
|
-
] }) : filteredEmails.length === 0 ? /* @__PURE__ */ (0,
|
|
2279
|
-
|
|
2258
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "text-center py-4", children: [
|
|
2259
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Spinner, {}),
|
|
2260
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "mt-2 text-muted", children: "Carregando e-mails..." })
|
|
2261
|
+
] }) : filteredEmails.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "text-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-muted mb-0", children: searchFilter ? "Nenhum e-mail encontrado com esse filtro" : "Nenhum e-mail dispon\xEDvel" }) }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Row, { children: filteredEmails.map((email) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react_bootstrap20.Col, { xs: 12, sm: 6, lg: 4, className: "mb-3", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2262
|
+
import_react_bootstrap20.Card,
|
|
2280
2263
|
{
|
|
2281
2264
|
onClick: () => setSelectedEmails([...selectedEmails, email]),
|
|
2282
2265
|
style: {
|
|
@@ -2296,9 +2279,9 @@ var MailSender = ({
|
|
|
2296
2279
|
e.currentTarget.style.boxShadow = "none";
|
|
2297
2280
|
e.currentTarget.style.borderColor = "#e9ecef";
|
|
2298
2281
|
},
|
|
2299
|
-
children: /* @__PURE__ */ (0,
|
|
2300
|
-
/* @__PURE__ */ (0,
|
|
2301
|
-
/* @__PURE__ */ (0,
|
|
2282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react_bootstrap20.Card.Body, { style: { padding: "15px", textAlign: "center" }, children: [
|
|
2283
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_fi3.FiMail, { size: 20, color: "#007bff", className: "mb-2" }),
|
|
2284
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2302
2285
|
"div",
|
|
2303
2286
|
{
|
|
2304
2287
|
style: {
|
|
@@ -2320,13 +2303,247 @@ var MailSender = ({
|
|
|
2320
2303
|
);
|
|
2321
2304
|
};
|
|
2322
2305
|
|
|
2306
|
+
// src/forms/AutoComplete.tsx
|
|
2307
|
+
var import_react15 = require("react");
|
|
2308
|
+
var import_react_bootstrap21 = require("react-bootstrap");
|
|
2309
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2310
|
+
var AutoComplete = ({
|
|
2311
|
+
className,
|
|
2312
|
+
ops = [],
|
|
2313
|
+
sortKey,
|
|
2314
|
+
displayKey,
|
|
2315
|
+
displayKeys,
|
|
2316
|
+
onValueChanged,
|
|
2317
|
+
onSelectedClick,
|
|
2318
|
+
value,
|
|
2319
|
+
actionButton,
|
|
2320
|
+
actionButton2,
|
|
2321
|
+
placeH,
|
|
2322
|
+
title,
|
|
2323
|
+
filter,
|
|
2324
|
+
filterField,
|
|
2325
|
+
loadFunc,
|
|
2326
|
+
loadCondition,
|
|
2327
|
+
onBlurEvent,
|
|
2328
|
+
formatationFunc,
|
|
2329
|
+
onEscKeyDown,
|
|
2330
|
+
onEnterKeyDown,
|
|
2331
|
+
margT,
|
|
2332
|
+
margB,
|
|
2333
|
+
hideComponent,
|
|
2334
|
+
disableComponent = false,
|
|
2335
|
+
disableSelect = false,
|
|
2336
|
+
autoFocusConfig,
|
|
2337
|
+
onLoad,
|
|
2338
|
+
cacheKey,
|
|
2339
|
+
minChars = 0,
|
|
2340
|
+
maxItems,
|
|
2341
|
+
showListOnFocus = true,
|
|
2342
|
+
lazyLoad = false,
|
|
2343
|
+
labelPosition = "top"
|
|
2344
|
+
}) => {
|
|
2345
|
+
const [liItem, setListItem] = (0, import_react15.useState)([]);
|
|
2346
|
+
const [options, setOptions] = (0, import_react15.useState)([]);
|
|
2347
|
+
const [input, setInput] = (0, import_react15.useState)("");
|
|
2348
|
+
const [hide, setHide] = (0, import_react15.useState)(true);
|
|
2349
|
+
const [onLoaded, setOnLoaded] = (0, import_react15.useState)(false);
|
|
2350
|
+
const [loading, setLoading] = (0, import_react15.useState)(false);
|
|
2351
|
+
const cacheStore = (0, import_react15.useMemo)(() => {
|
|
2352
|
+
const win = window;
|
|
2353
|
+
if (!win.__AUTO_COMPLETE_CACHE__) {
|
|
2354
|
+
win.__AUTO_COMPLETE_CACHE__ = /* @__PURE__ */ new Map();
|
|
2355
|
+
}
|
|
2356
|
+
return win.__AUTO_COMPLETE_CACHE__;
|
|
2357
|
+
}, []);
|
|
2358
|
+
const sortOptions = (data, key) => {
|
|
2359
|
+
if (!key || !Array.isArray(data)) return data;
|
|
2360
|
+
return [...data].sort((a, b) => String(a[key]).localeCompare(String(b[key])));
|
|
2361
|
+
};
|
|
2362
|
+
(0, import_react15.useEffect)(() => {
|
|
2363
|
+
setInput(value || "");
|
|
2364
|
+
}, [value]);
|
|
2365
|
+
(0, import_react15.useEffect)(() => {
|
|
2366
|
+
if (!Array.isArray(ops) || ops.length === 0) return;
|
|
2367
|
+
const sortedOptions = sortOptions(ops, sortKey);
|
|
2368
|
+
setListItem(sortedOptions);
|
|
2369
|
+
setOptions(sortedOptions);
|
|
2370
|
+
}, [ops, sortKey]);
|
|
2371
|
+
(0, import_react15.useEffect)(() => {
|
|
2372
|
+
const loadData = async () => {
|
|
2373
|
+
if (!(loadCondition && loadFunc)) return;
|
|
2374
|
+
if (lazyLoad && minChars > 0 && !showListOnFocus && (!value || String(value).length < minChars)) {
|
|
2375
|
+
return;
|
|
2376
|
+
}
|
|
2377
|
+
const key = cacheKey ? `${cacheKey}${filter ? `:${filterField}:${filter}` : ""}` : null;
|
|
2378
|
+
if (key && cacheStore.has(key)) {
|
|
2379
|
+
const cacheEntry = cacheStore.get(key);
|
|
2380
|
+
const data = cacheEntry.promise ? await cacheEntry.promise : cacheEntry.data || cacheEntry;
|
|
2381
|
+
setListItem(data);
|
|
2382
|
+
setOptions(data);
|
|
2383
|
+
triggerOnLoad(data);
|
|
2384
|
+
return;
|
|
2385
|
+
}
|
|
2386
|
+
setLoading(true);
|
|
2387
|
+
try {
|
|
2388
|
+
const requestPromise = loadFunc().then((res) => {
|
|
2389
|
+
let newOps = (res == null ? void 0 : res.content) || res;
|
|
2390
|
+
newOps = Array.isArray(newOps) ? newOps.filter((op) => op != null) : [];
|
|
2391
|
+
if (filter && filterField) {
|
|
2392
|
+
newOps = newOps.filter((op) => op[filterField] === filter);
|
|
2393
|
+
}
|
|
2394
|
+
return sortOptions(newOps, sortKey);
|
|
2395
|
+
});
|
|
2396
|
+
if (key) cacheStore.set(key, { promise: requestPromise });
|
|
2397
|
+
const sortedOptions = await requestPromise;
|
|
2398
|
+
setListItem(sortedOptions);
|
|
2399
|
+
setOptions(sortedOptions);
|
|
2400
|
+
if (key) cacheStore.set(key, { data: sortedOptions });
|
|
2401
|
+
triggerOnLoad(sortedOptions);
|
|
2402
|
+
} catch (error) {
|
|
2403
|
+
if (key) cacheStore.delete(key);
|
|
2404
|
+
setListItem([]);
|
|
2405
|
+
} finally {
|
|
2406
|
+
setLoading(false);
|
|
2407
|
+
}
|
|
2408
|
+
};
|
|
2409
|
+
loadData();
|
|
2410
|
+
}, [loadCondition, filter, filterField, sortKey, cacheKey, lazyLoad, minChars, showListOnFocus]);
|
|
2411
|
+
const triggerOnLoad = (data) => {
|
|
2412
|
+
if (onLoad && !onLoaded) {
|
|
2413
|
+
setOnLoaded(true);
|
|
2414
|
+
onLoad(data);
|
|
2415
|
+
}
|
|
2416
|
+
};
|
|
2417
|
+
const keysJoinner = (li) => {
|
|
2418
|
+
if (!displayKeys || !Array.isArray(displayKeys)) return "";
|
|
2419
|
+
return displayKeys.map((key) => `${li[key]} `).join("").trim();
|
|
2420
|
+
};
|
|
2421
|
+
const getDisplayText = (item) => {
|
|
2422
|
+
if (formatationFunc) return formatationFunc(item);
|
|
2423
|
+
if (displayKey) return item[displayKey];
|
|
2424
|
+
if (displayKeys) return keysJoinner(item);
|
|
2425
|
+
return String(item);
|
|
2426
|
+
};
|
|
2427
|
+
const onFieldUpdate = (val) => {
|
|
2428
|
+
const search = val.toLowerCase();
|
|
2429
|
+
const canSearch = search.length >= minChars;
|
|
2430
|
+
if (canSearch && Array.isArray(options)) {
|
|
2431
|
+
const filtered = options.filter((item) => {
|
|
2432
|
+
const text = getDisplayText(item);
|
|
2433
|
+
return String(text).toLowerCase().includes(search);
|
|
2434
|
+
});
|
|
2435
|
+
setListItem(filtered);
|
|
2436
|
+
} else {
|
|
2437
|
+
setListItem(options || []);
|
|
2438
|
+
}
|
|
2439
|
+
onValueChanged == null ? void 0 : onValueChanged(val);
|
|
2440
|
+
setInput(val);
|
|
2441
|
+
setHide(!canSearch && options.length === 0);
|
|
2442
|
+
};
|
|
2443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
|
|
2444
|
+
"div",
|
|
2445
|
+
{
|
|
2446
|
+
className,
|
|
2447
|
+
style: { marginTop: margT != null ? margT : 4, marginBottom: margB != null ? margB : 4, position: "relative" },
|
|
2448
|
+
onBlur: (e) => {
|
|
2449
|
+
setTimeout(() => {
|
|
2450
|
+
onBlurEvent == null ? void 0 : onBlurEvent(e, input);
|
|
2451
|
+
setHide(true);
|
|
2452
|
+
}, 200);
|
|
2453
|
+
},
|
|
2454
|
+
onKeyDown: (e) => {
|
|
2455
|
+
if (e.key === "Escape") {
|
|
2456
|
+
setHide(true);
|
|
2457
|
+
onEscKeyDown == null ? void 0 : onEscKeyDown();
|
|
2458
|
+
}
|
|
2459
|
+
if (e.key === "Enter" && onEnterKeyDown) {
|
|
2460
|
+
onEnterKeyDown(input);
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
onMouseLeave: () => setHide(true),
|
|
2464
|
+
children: [
|
|
2465
|
+
!hideComponent && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
|
|
2466
|
+
labelPosition === "top" && title && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_bootstrap21.Form.Label, { className: "fw-semibold small mb-1", children: title }),
|
|
2467
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_bootstrap21.InputGroup, { children: [
|
|
2468
|
+
labelPosition === "floating" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_bootstrap21.FloatingLabel, { controlId: "floatingInput", label: title, style: { zIndex: 0, flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2469
|
+
import_react_bootstrap21.Form.Control,
|
|
2470
|
+
{
|
|
2471
|
+
autoFocus: autoFocusConfig,
|
|
2472
|
+
disabled: disableComponent || disableSelect,
|
|
2473
|
+
placeholder: placeH,
|
|
2474
|
+
autoComplete: "off",
|
|
2475
|
+
value: input,
|
|
2476
|
+
onClickCapture: () => {
|
|
2477
|
+
const canOpen = showListOnFocus && input.length >= minChars;
|
|
2478
|
+
setHide(!canOpen);
|
|
2479
|
+
},
|
|
2480
|
+
onChange: (e) => onFieldUpdate(e.currentTarget.value),
|
|
2481
|
+
type: "text"
|
|
2482
|
+
}
|
|
2483
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2484
|
+
import_react_bootstrap21.Form.Control,
|
|
2485
|
+
{
|
|
2486
|
+
autoFocus: autoFocusConfig,
|
|
2487
|
+
disabled: disableComponent || disableSelect,
|
|
2488
|
+
placeholder: placeH || title,
|
|
2489
|
+
autoComplete: "off",
|
|
2490
|
+
value: input,
|
|
2491
|
+
onClickCapture: () => {
|
|
2492
|
+
const canOpen = showListOnFocus && input.length >= minChars;
|
|
2493
|
+
setHide(!canOpen);
|
|
2494
|
+
},
|
|
2495
|
+
onChange: (e) => onFieldUpdate(e.currentTarget.value),
|
|
2496
|
+
type: "text"
|
|
2497
|
+
}
|
|
2498
|
+
),
|
|
2499
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_bootstrap21.InputGroup.Text, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_bootstrap21.Spinner, { animation: "border", size: "sm" }) }),
|
|
2500
|
+
!disableComponent && (actionButton == null ? void 0 : actionButton(() => setInput(""))),
|
|
2501
|
+
!disableComponent && (actionButton2 == null ? void 0 : actionButton2(input))
|
|
2502
|
+
] })
|
|
2503
|
+
] }),
|
|
2504
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2505
|
+
import_react_bootstrap21.ListGroup,
|
|
2506
|
+
{
|
|
2507
|
+
className: "listgroup-autocomplete shadow-sm",
|
|
2508
|
+
hidden: hide || liItem.length === 0,
|
|
2509
|
+
style: {
|
|
2510
|
+
position: "absolute",
|
|
2511
|
+
top: "100%",
|
|
2512
|
+
left: 0,
|
|
2513
|
+
width: "100%",
|
|
2514
|
+
maxHeight: "250px",
|
|
2515
|
+
overflowY: "auto",
|
|
2516
|
+
zIndex: 1050,
|
|
2517
|
+
backgroundColor: "#fff"
|
|
2518
|
+
},
|
|
2519
|
+
children: (maxItems ? liItem.slice(0, maxItems) : liItem).map((li, index) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2520
|
+
import_react_bootstrap21.ListGroup.Item,
|
|
2521
|
+
{
|
|
2522
|
+
action: true,
|
|
2523
|
+
onClick: () => {
|
|
2524
|
+
const text = getDisplayText(li);
|
|
2525
|
+
setInput(text);
|
|
2526
|
+
onSelectedClick(li, index, liItem);
|
|
2527
|
+
setHide(true);
|
|
2528
|
+
},
|
|
2529
|
+
children: getDisplayText(li)
|
|
2530
|
+
},
|
|
2531
|
+
index
|
|
2532
|
+
))
|
|
2533
|
+
}
|
|
2534
|
+
)
|
|
2535
|
+
]
|
|
2536
|
+
}
|
|
2537
|
+
);
|
|
2538
|
+
};
|
|
2539
|
+
|
|
2323
2540
|
// src/forms/GenericForm.tsx
|
|
2324
|
-
var
|
|
2325
|
-
var
|
|
2326
|
-
var
|
|
2541
|
+
var import_react16 = require("react");
|
|
2542
|
+
var import_react_bootstrap22 = require("react-bootstrap");
|
|
2543
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2327
2544
|
var GenericForm = ({ fields, onSubmit, renderCustomSelect }) => {
|
|
2328
|
-
const [formValues, setFormValues] = (0,
|
|
2329
|
-
const [errors, setErrors] = (0,
|
|
2545
|
+
const [formValues, setFormValues] = (0, import_react16.useState)({});
|
|
2546
|
+
const [errors, setErrors] = (0, import_react16.useState)({});
|
|
2330
2547
|
const handleChange = (key, value) => {
|
|
2331
2548
|
setFormValues({
|
|
2332
2549
|
...formValues,
|
|
@@ -2355,10 +2572,10 @@ var GenericForm = ({ fields, onSubmit, renderCustomSelect }) => {
|
|
|
2355
2572
|
switch (type) {
|
|
2356
2573
|
case "text":
|
|
2357
2574
|
case "number":
|
|
2358
|
-
return /* @__PURE__ */ (0,
|
|
2359
|
-
/* @__PURE__ */ (0,
|
|
2360
|
-
/* @__PURE__ */ (0,
|
|
2361
|
-
|
|
2575
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_bootstrap22.Form.Group, { className: "mb-3", children: [
|
|
2576
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap22.Form.Label, { children: label }),
|
|
2577
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2578
|
+
import_react_bootstrap22.Form.Control,
|
|
2362
2579
|
{
|
|
2363
2580
|
type,
|
|
2364
2581
|
placeholder,
|
|
@@ -2367,30 +2584,30 @@ var GenericForm = ({ fields, onSubmit, renderCustomSelect }) => {
|
|
|
2367
2584
|
isInvalid: !!errors[key]
|
|
2368
2585
|
}
|
|
2369
2586
|
),
|
|
2370
|
-
/* @__PURE__ */ (0,
|
|
2587
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap22.Form.Control.Feedback, { type: "invalid", children: errors[key] })
|
|
2371
2588
|
] }, key);
|
|
2372
2589
|
case "select": {
|
|
2373
2590
|
const orderedOptions = (options || []).filter((opt) => opt && opt.value !== void 0 && opt.label !== void 0).sort((a, b) => a.label.localeCompare(b.label));
|
|
2374
|
-
return /* @__PURE__ */ (0,
|
|
2375
|
-
/* @__PURE__ */ (0,
|
|
2376
|
-
/* @__PURE__ */ (0,
|
|
2377
|
-
|
|
2591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_bootstrap22.Form.Group, { className: "mb-3", children: [
|
|
2592
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap22.Form.Label, { children: label }),
|
|
2593
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2594
|
+
import_react_bootstrap22.Form.Select,
|
|
2378
2595
|
{
|
|
2379
2596
|
value,
|
|
2380
2597
|
onChange: (e) => handleChange(key, e.target.value),
|
|
2381
2598
|
isInvalid: !!errors[key],
|
|
2382
2599
|
children: [
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2384
|
-
orderedOptions.map((option) => /* @__PURE__ */ (0,
|
|
2600
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: "", children: "Selecione..." }),
|
|
2601
|
+
orderedOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: option.value, children: option.label }, String(option.value)))
|
|
2385
2602
|
]
|
|
2386
2603
|
}
|
|
2387
2604
|
),
|
|
2388
|
-
/* @__PURE__ */ (0,
|
|
2605
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap22.Form.Control.Feedback, { type: "invalid", children: errors[key] })
|
|
2389
2606
|
] }, key);
|
|
2390
2607
|
}
|
|
2391
2608
|
case "custom-select":
|
|
2392
2609
|
if (renderCustomSelect) {
|
|
2393
|
-
return /* @__PURE__ */ (0,
|
|
2610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
2394
2611
|
renderCustomSelect({
|
|
2395
2612
|
label,
|
|
2396
2613
|
value,
|
|
@@ -2398,15 +2615,15 @@ var GenericForm = ({ fields, onSubmit, renderCustomSelect }) => {
|
|
|
2398
2615
|
onChange: (v) => handleChange(key, v),
|
|
2399
2616
|
placeholder
|
|
2400
2617
|
}),
|
|
2401
|
-
errors[key] && /* @__PURE__ */ (0,
|
|
2618
|
+
errors[key] && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "invalid-feedback d-block", children: errors[key] })
|
|
2402
2619
|
] }, key);
|
|
2403
2620
|
}
|
|
2404
2621
|
return null;
|
|
2405
2622
|
case "date":
|
|
2406
|
-
return /* @__PURE__ */ (0,
|
|
2407
|
-
/* @__PURE__ */ (0,
|
|
2408
|
-
/* @__PURE__ */ (0,
|
|
2409
|
-
|
|
2623
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_bootstrap22.Form.Group, { className: "mb-3", children: [
|
|
2624
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap22.Form.Label, { children: label }),
|
|
2625
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2626
|
+
import_react_bootstrap22.Form.Control,
|
|
2410
2627
|
{
|
|
2411
2628
|
type: "date",
|
|
2412
2629
|
value,
|
|
@@ -2414,23 +2631,23 @@ var GenericForm = ({ fields, onSubmit, renderCustomSelect }) => {
|
|
|
2414
2631
|
isInvalid: !!errors[key]
|
|
2415
2632
|
}
|
|
2416
2633
|
),
|
|
2417
|
-
/* @__PURE__ */ (0,
|
|
2634
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap22.Form.Control.Feedback, { type: "invalid", children: errors[key] })
|
|
2418
2635
|
] }, key);
|
|
2419
2636
|
default:
|
|
2420
2637
|
return null;
|
|
2421
2638
|
}
|
|
2422
2639
|
};
|
|
2423
|
-
return /* @__PURE__ */ (0,
|
|
2640
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react_bootstrap22.Form, { onSubmit: handleSubmit, children: [
|
|
2424
2641
|
fields.map((field) => renderField(field)),
|
|
2425
|
-
/* @__PURE__ */ (0,
|
|
2642
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "d-grid", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_bootstrap22.Button, { variant: "primary", type: "submit", children: "Salvar" }) })
|
|
2426
2643
|
] });
|
|
2427
2644
|
};
|
|
2428
2645
|
var GenericForm_default = GenericForm;
|
|
2429
2646
|
|
|
2430
2647
|
// src/forms/GenericSelect.tsx
|
|
2431
|
-
var
|
|
2432
|
-
var
|
|
2433
|
-
var
|
|
2648
|
+
var import_react17 = require("react");
|
|
2649
|
+
var import_react_bootstrap23 = require("react-bootstrap");
|
|
2650
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2434
2651
|
var GenericSelectOps = class {
|
|
2435
2652
|
constructor(noLabel, title, onChange, ops, selection, returnType, displayType, filter, filterField, valueType, loadFunc, loadCondition, actionClick, locked) {
|
|
2436
2653
|
this.noLabel = noLabel;
|
|
@@ -2467,8 +2684,8 @@ var GenericSelect = ({
|
|
|
2467
2684
|
isBold,
|
|
2468
2685
|
...restProps
|
|
2469
2686
|
}) => {
|
|
2470
|
-
const [options, setOptions] = (0,
|
|
2471
|
-
(0,
|
|
2687
|
+
const [options, setOptions] = (0, import_react17.useState)(ops || []);
|
|
2688
|
+
(0, import_react17.useEffect)(() => {
|
|
2472
2689
|
const loadFunction = async () => {
|
|
2473
2690
|
if (loadCondition && loadFunc) {
|
|
2474
2691
|
loadFunc().then((res) => {
|
|
@@ -2493,15 +2710,15 @@ var GenericSelect = ({
|
|
|
2493
2710
|
}
|
|
2494
2711
|
};
|
|
2495
2712
|
const defaultPlaceholder = (restProps == null ? void 0 : restProps.default) || "Seleciona uma Op\xE7\xE3o";
|
|
2496
|
-
const selectContent = /* @__PURE__ */ (0,
|
|
2497
|
-
|
|
2713
|
+
const selectContent = /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2714
|
+
import_react_bootstrap23.Form.Control,
|
|
2498
2715
|
{
|
|
2499
2716
|
disabled: locked,
|
|
2500
2717
|
as: "select",
|
|
2501
2718
|
value: selection,
|
|
2502
2719
|
onChange: (event) => getTrueValue(event.target.selectedIndex),
|
|
2503
2720
|
children: [
|
|
2504
|
-
/* @__PURE__ */ (0,
|
|
2721
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("option", { value: void 0, children: [
|
|
2505
2722
|
"-- ",
|
|
2506
2723
|
defaultPlaceholder,
|
|
2507
2724
|
" --"
|
|
@@ -2510,35 +2727,36 @@ var GenericSelect = ({
|
|
|
2510
2727
|
const val = valueType && op[valueType] || op.id || op;
|
|
2511
2728
|
let fill = displayType && op[displayType] || op;
|
|
2512
2729
|
if (typeof fill == "object") fill = "";
|
|
2513
|
-
return /* @__PURE__ */ (0,
|
|
2730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("option", { value: val, children: fill }, op.id || index);
|
|
2514
2731
|
})
|
|
2515
2732
|
]
|
|
2516
2733
|
}
|
|
2517
2734
|
);
|
|
2518
2735
|
if (actionClick) {
|
|
2519
|
-
return /* @__PURE__ */ (0,
|
|
2520
|
-
/* @__PURE__ */ (0,
|
|
2521
|
-
/* @__PURE__ */ (0,
|
|
2736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
2737
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_bootstrap23.Form.Label, { style: { fontWeight: isBold ? "bold" : void 0 }, hidden: noLabel, children: title }),
|
|
2738
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_bootstrap23.InputGroup, { children: [
|
|
2522
2739
|
selectContent,
|
|
2523
2740
|
actionClick()
|
|
2524
2741
|
] })
|
|
2525
2742
|
] });
|
|
2526
2743
|
}
|
|
2527
|
-
return /* @__PURE__ */ (0,
|
|
2528
|
-
/* @__PURE__ */ (0,
|
|
2744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
|
|
2745
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_bootstrap23.Form.Label, { style: { fontWeight: isBold ? "bold" : void 0 }, hidden: noLabel, children: title }),
|
|
2529
2746
|
selectContent
|
|
2530
2747
|
] });
|
|
2531
2748
|
};
|
|
2532
2749
|
var GenericSelect_default = GenericSelect;
|
|
2533
2750
|
|
|
2534
2751
|
// src/forms/FormField.tsx
|
|
2535
|
-
var
|
|
2536
|
-
var
|
|
2752
|
+
var import_react_bootstrap24 = require("react-bootstrap");
|
|
2753
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2537
2754
|
var FormField = ({
|
|
2538
2755
|
val,
|
|
2539
2756
|
onValueUpdate,
|
|
2540
2757
|
onBlur,
|
|
2541
2758
|
label,
|
|
2759
|
+
labelPosition = "top",
|
|
2542
2760
|
ty,
|
|
2543
2761
|
actionClick,
|
|
2544
2762
|
actionClick2,
|
|
@@ -2584,32 +2802,35 @@ var FormField = ({
|
|
|
2584
2802
|
fieldProps.as = "textarea";
|
|
2585
2803
|
fieldProps.rows = rows || 3;
|
|
2586
2804
|
}
|
|
2587
|
-
return /* @__PURE__ */ (0,
|
|
2805
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_bootstrap24.Form.Control, { ...fieldProps });
|
|
2588
2806
|
};
|
|
2589
2807
|
if (hide) return null;
|
|
2590
|
-
|
|
2591
|
-
|
|
2808
|
+
const useFloating = labelPosition === "floating" && !asTextArea;
|
|
2809
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2810
|
+
import_react_bootstrap24.Form.Group,
|
|
2592
2811
|
{
|
|
2593
2812
|
onFocusCapture: (e) => onFocusHandler(e.target.value),
|
|
2594
2813
|
onMouseLeave: onMouseLv,
|
|
2595
2814
|
onKeyDown: onKeyDownHandler,
|
|
2596
2815
|
style: { marginTop: 4, marginBottom: 4, width: "100%" },
|
|
2816
|
+
controlId: !useFloating ? controlId : void 0,
|
|
2597
2817
|
children: [
|
|
2598
|
-
/* @__PURE__ */ (0,
|
|
2599
|
-
|
|
2818
|
+
!useFloating && label && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_bootstrap24.Form.Label, { className: "fw-semibold small mb-1", children: label }),
|
|
2819
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_bootstrap24.InputGroup, { children: [
|
|
2820
|
+
useFloating ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_bootstrap24.FloatingLabel, { style: { zIndex: 0, flex: 1 }, label, controlId: controlId || "floatingInput", children: renderField() }) : renderField(),
|
|
2600
2821
|
actionClick && actionClick(),
|
|
2601
2822
|
actionClick2 && actionClick2()
|
|
2602
2823
|
] }),
|
|
2603
|
-
feedback && isInvalid && /* @__PURE__ */ (0,
|
|
2824
|
+
feedback && isInvalid && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_bootstrap24.Form.Control.Feedback, { type: "invalid", style: { display: "block" }, children: feedback })
|
|
2604
2825
|
]
|
|
2605
2826
|
}
|
|
2606
2827
|
);
|
|
2607
2828
|
};
|
|
2608
2829
|
|
|
2609
2830
|
// src/forms/ClickToWriteField.tsx
|
|
2610
|
-
var
|
|
2611
|
-
var
|
|
2612
|
-
var
|
|
2831
|
+
var import_react18 = require("react");
|
|
2832
|
+
var import_react_bootstrap25 = require("react-bootstrap");
|
|
2833
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2613
2834
|
var ClickToWriteField = ({
|
|
2614
2835
|
buttonDisplay,
|
|
2615
2836
|
fieldType = "text",
|
|
@@ -2625,9 +2846,9 @@ var ClickToWriteField = ({
|
|
|
2625
2846
|
onEnterPress,
|
|
2626
2847
|
cleanRef
|
|
2627
2848
|
}) => {
|
|
2628
|
-
const [showClick, setShowClick] = (0,
|
|
2629
|
-
const inputRef = (0,
|
|
2630
|
-
(0,
|
|
2849
|
+
const [showClick, setShowClick] = (0, import_react18.useState)(false);
|
|
2850
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
2851
|
+
(0, import_react18.useEffect)(() => {
|
|
2631
2852
|
if (showClick) {
|
|
2632
2853
|
setTimeout(() => {
|
|
2633
2854
|
if (inputRef.current) {
|
|
@@ -2656,9 +2877,9 @@ var ClickToWriteField = ({
|
|
|
2656
2877
|
onEnterPress(inputRef);
|
|
2657
2878
|
}
|
|
2658
2879
|
};
|
|
2659
|
-
return /* @__PURE__ */ (0,
|
|
2660
|
-
!showClick && /* @__PURE__ */ (0,
|
|
2661
|
-
|
|
2880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { style: { display: "flex", width: "100%", margin: 0, padding: 0 }, children: [
|
|
2881
|
+
!showClick && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2882
|
+
import_react_bootstrap25.Button,
|
|
2662
2883
|
{
|
|
2663
2884
|
style: { flexGrow: 1 },
|
|
2664
2885
|
onClick: handleShowClick,
|
|
@@ -2666,7 +2887,7 @@ var ClickToWriteField = ({
|
|
|
2666
2887
|
children: resolveButtonDisplay()
|
|
2667
2888
|
}
|
|
2668
2889
|
),
|
|
2669
|
-
showClick && /* @__PURE__ */ (0,
|
|
2890
|
+
showClick && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2670
2891
|
FormField,
|
|
2671
2892
|
{
|
|
2672
2893
|
reference: inputRef,
|
|
@@ -2676,8 +2897,8 @@ var ClickToWriteField = ({
|
|
|
2676
2897
|
label: fieldLabel,
|
|
2677
2898
|
onValueUpdate: onFieldValueUpdate,
|
|
2678
2899
|
onBlur: () => setShowClick(false),
|
|
2679
|
-
actionClick: () => enableFieldActionButton ? /* @__PURE__ */ (0,
|
|
2680
|
-
|
|
2900
|
+
actionClick: () => enableFieldActionButton ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2901
|
+
import_react_bootstrap25.Button,
|
|
2681
2902
|
{
|
|
2682
2903
|
...fieldActionButtonProps,
|
|
2683
2904
|
onClick: () => fieldActionButtonCallback(inputRef),
|
|
@@ -2690,35 +2911,43 @@ var ClickToWriteField = ({
|
|
|
2690
2911
|
};
|
|
2691
2912
|
|
|
2692
2913
|
// src/forms/ColorPicker.tsx
|
|
2693
|
-
var
|
|
2694
|
-
var
|
|
2695
|
-
var
|
|
2914
|
+
var import_react_bootstrap26 = require("react-bootstrap");
|
|
2915
|
+
var import_fa5 = require("react-icons/fa");
|
|
2916
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2696
2917
|
var ColorPicker = ({
|
|
2697
2918
|
selectedColor,
|
|
2698
2919
|
onColorChange,
|
|
2920
|
+
defaultColor,
|
|
2921
|
+
setCor,
|
|
2699
2922
|
presetColors = ["#ff0000", "#ffd700", "#008000", "#0000ff", "#800080"],
|
|
2700
2923
|
title = "Cor de Identifica\xE7\xE3o"
|
|
2701
2924
|
}) => {
|
|
2702
|
-
|
|
2703
|
-
|
|
2925
|
+
var _a, _b;
|
|
2926
|
+
const safeSelectedColor = (_b = (_a = selectedColor != null ? selectedColor : defaultColor) != null ? _a : presetColors[0]) != null ? _b : "#000000";
|
|
2927
|
+
const handleColorChange = (color) => {
|
|
2928
|
+
onColorChange == null ? void 0 : onColorChange(color);
|
|
2929
|
+
setCor == null ? void 0 : setCor(color);
|
|
2930
|
+
};
|
|
2931
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
2932
|
+
import_react_bootstrap26.Card,
|
|
2704
2933
|
{
|
|
2705
2934
|
className: "shadow-sm border-primary-hover mb-3",
|
|
2706
2935
|
style: { maxWidth: "320px", transition: "0.3s" },
|
|
2707
2936
|
children: [
|
|
2708
|
-
/* @__PURE__ */ (0,
|
|
2709
|
-
/* @__PURE__ */ (0,
|
|
2710
|
-
/* @__PURE__ */ (0,
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_bootstrap26.Card.Header, { className: "bg-light d-flex align-items-center", children: [
|
|
2938
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_fa5.FaPalette, { className: "me-2 text-primary" }),
|
|
2939
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "fw-medium", children: title })
|
|
2711
2940
|
] }),
|
|
2712
|
-
/* @__PURE__ */ (0,
|
|
2713
|
-
/* @__PURE__ */ (0,
|
|
2714
|
-
/* @__PURE__ */ (0,
|
|
2941
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_bootstrap26.Card.Body, { children: [
|
|
2942
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_react_bootstrap26.Row, { className: "g-3 align-items-center mb-3", children: [
|
|
2943
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_bootstrap26.Col, { xs: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2715
2944
|
"div",
|
|
2716
2945
|
{
|
|
2717
2946
|
className: "rounded-circle shadow-sm border",
|
|
2718
2947
|
style: {
|
|
2719
2948
|
width: "40px",
|
|
2720
2949
|
height: "40px",
|
|
2721
|
-
backgroundColor:
|
|
2950
|
+
backgroundColor: safeSelectedColor,
|
|
2722
2951
|
cursor: "pointer",
|
|
2723
2952
|
border: "2px solid #dee2e6"
|
|
2724
2953
|
},
|
|
@@ -2729,19 +2958,19 @@ var ColorPicker = ({
|
|
|
2729
2958
|
title: "Clique para abrir o seletor"
|
|
2730
2959
|
}
|
|
2731
2960
|
) }),
|
|
2732
|
-
/* @__PURE__ */ (0,
|
|
2733
|
-
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_bootstrap26.Col, { children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2962
|
+
import_react_bootstrap26.Form.Control,
|
|
2734
2963
|
{
|
|
2735
2964
|
type: "color",
|
|
2736
2965
|
id: "color-input-hidden",
|
|
2737
|
-
value:
|
|
2738
|
-
onChange: (e) =>
|
|
2966
|
+
value: safeSelectedColor,
|
|
2967
|
+
onChange: (e) => handleColorChange(e.target.value),
|
|
2739
2968
|
className: "form-control-color-lg",
|
|
2740
2969
|
style: { width: "100%", height: "40px", cursor: "pointer" }
|
|
2741
2970
|
}
|
|
2742
2971
|
) })
|
|
2743
2972
|
] }),
|
|
2744
|
-
/* @__PURE__ */ (0,
|
|
2973
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_bootstrap26.Row, { className: "g-2 justify-content-start", children: presetColors.map((cor) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react_bootstrap26.Col, { xs: "auto", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
2745
2974
|
"div",
|
|
2746
2975
|
{
|
|
2747
2976
|
className: "rounded-1 shadow-sm",
|
|
@@ -2750,9 +2979,9 @@ var ColorPicker = ({
|
|
|
2750
2979
|
height: "28px",
|
|
2751
2980
|
backgroundColor: cor,
|
|
2752
2981
|
cursor: "pointer",
|
|
2753
|
-
border: cor.toLowerCase() ===
|
|
2982
|
+
border: cor.toLowerCase() === safeSelectedColor.toLowerCase() ? "2px solid #0d6efd" : "1px solid #dee2e6"
|
|
2754
2983
|
},
|
|
2755
|
-
onClick: () =>
|
|
2984
|
+
onClick: () => handleColorChange(cor)
|
|
2756
2985
|
}
|
|
2757
2986
|
) }, cor)) })
|
|
2758
2987
|
] })
|
|
@@ -2762,8 +2991,8 @@ var ColorPicker = ({
|
|
|
2762
2991
|
};
|
|
2763
2992
|
|
|
2764
2993
|
// src/forms/Switch.tsx
|
|
2765
|
-
var
|
|
2766
|
-
var
|
|
2994
|
+
var import_react_bootstrap27 = require("react-bootstrap");
|
|
2995
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2767
2996
|
var Switch = ({
|
|
2768
2997
|
label,
|
|
2769
2998
|
onSwitchChange,
|
|
@@ -2772,8 +3001,8 @@ var Switch = ({
|
|
|
2772
3001
|
defaultChecked,
|
|
2773
3002
|
...props
|
|
2774
3003
|
}) => {
|
|
2775
|
-
return /* @__PURE__ */ (0,
|
|
2776
|
-
|
|
3004
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3005
|
+
import_react_bootstrap27.Form.Check,
|
|
2777
3006
|
{
|
|
2778
3007
|
...props,
|
|
2779
3008
|
disabled,
|
|
@@ -2787,17 +3016,17 @@ var Switch = ({
|
|
|
2787
3016
|
};
|
|
2788
3017
|
|
|
2789
3018
|
// src/forms/UploadArea.tsx
|
|
2790
|
-
var
|
|
3019
|
+
var import_react19 = require("react");
|
|
2791
3020
|
var import_react_dropzone = require("react-dropzone");
|
|
2792
3021
|
var import_fi4 = require("react-icons/fi");
|
|
2793
|
-
var
|
|
3022
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2794
3023
|
var UploadArea = ({
|
|
2795
3024
|
onFilePut,
|
|
2796
3025
|
anexo,
|
|
2797
3026
|
accept = { "image/jpeg": [], "image/png": [] },
|
|
2798
3027
|
maxSize = 50 * 1024 * 1024
|
|
2799
3028
|
}) => {
|
|
2800
|
-
const onDrop = (0,
|
|
3029
|
+
const onDrop = (0, import_react19.useCallback)(
|
|
2801
3030
|
(acceptedFiles) => {
|
|
2802
3031
|
const file = acceptedFiles[0];
|
|
2803
3032
|
if (file && typeof onFilePut === "function") {
|
|
@@ -2812,7 +3041,7 @@ var UploadArea = ({
|
|
|
2812
3041
|
accept
|
|
2813
3042
|
});
|
|
2814
3043
|
const hasAnexo = Boolean(anexo);
|
|
2815
|
-
return /* @__PURE__ */ (0,
|
|
3044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
2816
3045
|
"div",
|
|
2817
3046
|
{
|
|
2818
3047
|
...getRootProps(),
|
|
@@ -2821,23 +3050,23 @@ var UploadArea = ({
|
|
|
2821
3050
|
${hasAnexo ? "upload-has-file" : ""}
|
|
2822
3051
|
`,
|
|
2823
3052
|
children: [
|
|
2824
|
-
/* @__PURE__ */ (0,
|
|
2825
|
-
/* @__PURE__ */ (0,
|
|
2826
|
-
/* @__PURE__ */ (0,
|
|
2827
|
-
hasAnexo ? /* @__PURE__ */ (0,
|
|
2828
|
-
/* @__PURE__ */ (0,
|
|
2829
|
-
/* @__PURE__ */ (0,
|
|
2830
|
-
] }) : /* @__PURE__ */ (0,
|
|
2831
|
-
/* @__PURE__ */ (0,
|
|
2832
|
-
/* @__PURE__ */ (0,
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("input", { ...getInputProps() }),
|
|
3054
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "upload-content", children: [
|
|
3055
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "upload-icon", children: hasAnexo ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_fi4.FiCheckCircle, { size: 24 }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_fi4.FiUploadCloud, { size: 24 }) }),
|
|
3056
|
+
hasAnexo ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
3057
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "upload-link", children: "Arquivo anexado" }),
|
|
3058
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "upload-info", children: anexo == null ? void 0 : anexo.name })
|
|
3059
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { children: [
|
|
3061
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("span", { className: "upload-link", children: "Adicione" }),
|
|
2833
3062
|
" ou arraste arquivos aqui"
|
|
2834
3063
|
] }),
|
|
2835
|
-
/* @__PURE__ */ (0,
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "upload-info", children: [
|
|
2836
3065
|
"Formatos aceitos: ",
|
|
2837
|
-
/* @__PURE__ */ (0,
|
|
3066
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("b", { children: Object.keys(accept).map((t) => t.split("/")[1].toUpperCase()).join(", ") }),
|
|
2838
3067
|
" | Tamanho m\xE1ximo:",
|
|
2839
3068
|
" ",
|
|
2840
|
-
/* @__PURE__ */ (0,
|
|
3069
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("b", { children: [
|
|
2841
3070
|
(maxSize / (1024 * 1024)).toFixed(0),
|
|
2842
3071
|
"MB"
|
|
2843
3072
|
] })
|
|
@@ -2849,11 +3078,17 @@ var UploadArea = ({
|
|
|
2849
3078
|
);
|
|
2850
3079
|
};
|
|
2851
3080
|
|
|
3081
|
+
// src/index.ts
|
|
3082
|
+
var import_ui_kit_core = require("@teraprox/ui-kit-core");
|
|
3083
|
+
|
|
3084
|
+
// src/forms/FindRecursoByTagField.tsx
|
|
3085
|
+
var import_ui_kit_sgm3 = require("@teraprox/ui-kit-sgm");
|
|
3086
|
+
|
|
2852
3087
|
// src/forms/SectorSelector.tsx
|
|
2853
|
-
var
|
|
2854
|
-
var
|
|
2855
|
-
var
|
|
2856
|
-
var
|
|
3088
|
+
var import_react20 = require("react");
|
|
3089
|
+
var import_react_bootstrap28 = require("react-bootstrap");
|
|
3090
|
+
var import_bs2 = require("react-icons/bs");
|
|
3091
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2857
3092
|
var SectorSelector = ({
|
|
2858
3093
|
setores,
|
|
2859
3094
|
onSectorSelect,
|
|
@@ -2863,9 +3098,9 @@ var SectorSelector = ({
|
|
|
2863
3098
|
defaultSectorName = false,
|
|
2864
3099
|
allowAll = false
|
|
2865
3100
|
}) => {
|
|
2866
|
-
const [expanded, setExpanded] = (0,
|
|
2867
|
-
const [selectedSector, setSelectedSector] = (0,
|
|
2868
|
-
(0,
|
|
3101
|
+
const [expanded, setExpanded] = (0, import_react20.useState)(false);
|
|
3102
|
+
const [selectedSector, setSelectedSector] = (0, import_react20.useState)(null);
|
|
3103
|
+
(0, import_react20.useEffect)(() => {
|
|
2869
3104
|
if (defaultSectorName && setores.length > 0) {
|
|
2870
3105
|
const setor = setores.find((s) => s.nome === defaultSectorName);
|
|
2871
3106
|
if (setor && setor.id !== (selectedSector == null ? void 0 : selectedSector.id)) {
|
|
@@ -2885,19 +3120,19 @@ var SectorSelector = ({
|
|
|
2885
3120
|
};
|
|
2886
3121
|
if (hideComponent) return null;
|
|
2887
3122
|
const setorOptions = allowAll ? [{ id: "all", nome: "Todos" }, ...setores] : [...setores];
|
|
2888
|
-
return /* @__PURE__ */ (0,
|
|
2889
|
-
/* @__PURE__ */ (0,
|
|
2890
|
-
/* @__PURE__ */ (0,
|
|
2891
|
-
/* @__PURE__ */ (0,
|
|
3123
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_react_bootstrap28.Form.Floating, { className: "sector-selector-floating", children: [
|
|
3124
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "custom-select-container", onClick: toggleExpand, children: [
|
|
3125
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("span", { className: "selected-sector-label mt-1", children: (selectedSector == null ? void 0 : selectedSector.nome) || selectionPlaceholder }),
|
|
3126
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "zoom-container", children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_bs2.BsChevronUp, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_bs2.BsChevronDown, {}) })
|
|
2892
3127
|
] }),
|
|
2893
|
-
(selectedSector == null ? void 0 : selectedSector.nome) && /* @__PURE__ */ (0,
|
|
2894
|
-
expanded && /* @__PURE__ */ (0,
|
|
3128
|
+
(selectedSector == null ? void 0 : selectedSector.nome) && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("label", { htmlFor: "floatingInputCustom", children: selectionLabel }),
|
|
3129
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2895
3130
|
"div",
|
|
2896
3131
|
{
|
|
2897
3132
|
className: "custom-dropdown-menu",
|
|
2898
3133
|
onMouseLeave: () => setExpanded(false),
|
|
2899
3134
|
children: [
|
|
2900
|
-
setorOptions.sort((a, b) => a.nome.localeCompare(b.nome)).map((setor, idx) => /* @__PURE__ */ (0,
|
|
3135
|
+
setorOptions.sort((a, b) => a.nome.localeCompare(b.nome)).map((setor, idx) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2901
3136
|
"div",
|
|
2902
3137
|
{
|
|
2903
3138
|
className: `dropdown-option ${setor.nome === (selectedSector == null ? void 0 : selectedSector.nome) ? "selected-option" : ""}`,
|
|
@@ -2906,7 +3141,7 @@ var SectorSelector = ({
|
|
|
2906
3141
|
},
|
|
2907
3142
|
idx
|
|
2908
3143
|
)),
|
|
2909
|
-
setores.length === 0 && /* @__PURE__ */ (0,
|
|
3144
|
+
setores.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "dropdown-option text-muted italic", children: "Carregando setores..." })
|
|
2910
3145
|
]
|
|
2911
3146
|
}
|
|
2912
3147
|
)
|
|
@@ -2914,8 +3149,8 @@ var SectorSelector = ({
|
|
|
2914
3149
|
};
|
|
2915
3150
|
|
|
2916
3151
|
// src/forms/UnidadeMaterialForm.tsx
|
|
2917
|
-
var
|
|
2918
|
-
var
|
|
3152
|
+
var import_react_bootstrap29 = require("react-bootstrap");
|
|
3153
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
2919
3154
|
var UnidadeMaterialForm = ({
|
|
2920
3155
|
value,
|
|
2921
3156
|
onMaterialSelected,
|
|
@@ -2931,11 +3166,11 @@ var UnidadeMaterialForm = ({
|
|
|
2931
3166
|
hideUnidade = false,
|
|
2932
3167
|
className = ""
|
|
2933
3168
|
}) => {
|
|
2934
|
-
var _a, _b;
|
|
2935
|
-
const renderNewMaterialButton = () => /* @__PURE__ */ (0,
|
|
2936
|
-
const renderNewUnidadeButton = () => /* @__PURE__ */ (0,
|
|
2937
|
-
return /* @__PURE__ */ (0,
|
|
2938
|
-
!hideMaterial && /* @__PURE__ */ (0,
|
|
3169
|
+
var _a, _b, _c;
|
|
3170
|
+
const renderNewMaterialButton = () => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_bootstrap29.Button, { onClick: onNavigateToCreateMaterial, size: "sm", variant: "outline-primary", children: "Novo Material" });
|
|
3171
|
+
const renderNewUnidadeButton = () => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_react_bootstrap29.Button, { onClick: onNavigateToCreateUnidade, size: "sm", variant: "outline-primary", children: "Nova Unidade" });
|
|
3172
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: `unidade-material-form ${className}`, children: [
|
|
3173
|
+
!hideMaterial && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2939
3174
|
AutoComplete,
|
|
2940
3175
|
{
|
|
2941
3176
|
displayKey: "nome",
|
|
@@ -2947,20 +3182,20 @@ var UnidadeMaterialForm = ({
|
|
|
2947
3182
|
actionButton: onNavigateToCreateMaterial ? renderNewMaterialButton : void 0
|
|
2948
3183
|
}
|
|
2949
3184
|
),
|
|
2950
|
-
!hideQuantidade && /* @__PURE__ */ (0,
|
|
3185
|
+
!hideQuantidade && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2951
3186
|
FormField,
|
|
2952
3187
|
{
|
|
2953
3188
|
label: "Quantidade",
|
|
2954
|
-
val: value.quantidade
|
|
3189
|
+
val: (_b = value == null ? void 0 : value.quantidade) != null ? _b : "",
|
|
2955
3190
|
onValueUpdate: onQuantidadeUpdate,
|
|
2956
3191
|
ty: "number"
|
|
2957
3192
|
}
|
|
2958
3193
|
),
|
|
2959
|
-
!hideUnidade && /* @__PURE__ */ (0,
|
|
3194
|
+
!hideUnidade && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
2960
3195
|
AutoComplete,
|
|
2961
3196
|
{
|
|
2962
3197
|
displayKey: "nome",
|
|
2963
|
-
value: ((
|
|
3198
|
+
value: ((_c = value == null ? void 0 : value.unidade) == null ? void 0 : _c.nome) || "",
|
|
2964
3199
|
loadCondition: true,
|
|
2965
3200
|
title: "Unidade",
|
|
2966
3201
|
loadFunc: loadUnidadesFunc,
|
|
@@ -2972,7 +3207,7 @@ var UnidadeMaterialForm = ({
|
|
|
2972
3207
|
};
|
|
2973
3208
|
|
|
2974
3209
|
// src/icons/IconLabelItem.tsx
|
|
2975
|
-
var
|
|
3210
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
2976
3211
|
var IconLabelItem = ({
|
|
2977
3212
|
icon,
|
|
2978
3213
|
label,
|
|
@@ -2981,16 +3216,16 @@ var IconLabelItem = ({
|
|
|
2981
3216
|
onClick,
|
|
2982
3217
|
style
|
|
2983
3218
|
}) => {
|
|
2984
|
-
return /* @__PURE__ */ (0,
|
|
3219
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: containerClassName, onClick, style: { ...style, cursor: onClick ? "pointer" : "default" }, children: [
|
|
2985
3220
|
icon,
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
3221
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: labelClassName, children: label })
|
|
2987
3222
|
] });
|
|
2988
3223
|
};
|
|
2989
3224
|
|
|
2990
3225
|
// src/icons/IconLabelList.tsx
|
|
2991
|
-
var
|
|
3226
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
2992
3227
|
var IconLabelList = ({ items, className = "" }) => {
|
|
2993
|
-
return /* @__PURE__ */ (0,
|
|
3228
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: `icon-label-list ${className}`, children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
2994
3229
|
IconLabelItem,
|
|
2995
3230
|
{
|
|
2996
3231
|
labelClassName: "icon-label",
|
|
@@ -3004,18 +3239,18 @@ var IconLabelList = ({ items, className = "" }) => {
|
|
|
3004
3239
|
};
|
|
3005
3240
|
|
|
3006
3241
|
// src/icons/NotificationItem.tsx
|
|
3007
|
-
var
|
|
3008
|
-
var
|
|
3242
|
+
var import_react21 = require("react");
|
|
3243
|
+
var import_react_bootstrap30 = require("react-bootstrap");
|
|
3009
3244
|
var import_fi5 = require("react-icons/fi");
|
|
3010
|
-
var
|
|
3011
|
-
var
|
|
3245
|
+
var import_dayjs5 = __toESM(require("dayjs"));
|
|
3246
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3012
3247
|
var NotificationItem = ({
|
|
3013
3248
|
notification,
|
|
3014
3249
|
onRead,
|
|
3015
3250
|
onDismiss,
|
|
3016
3251
|
emptyContentLabel = "Sem conte\xFAdo adicional dispon\xEDvel."
|
|
3017
3252
|
}) => {
|
|
3018
|
-
const [showModal, setShowModal] = (0,
|
|
3253
|
+
const [showModal, setShowModal] = (0, import_react21.useState)(false);
|
|
3019
3254
|
const { context, contextId, content, status, createdAt, readAt } = notification;
|
|
3020
3255
|
const handleOpenModal = (e) => {
|
|
3021
3256
|
e.stopPropagation();
|
|
@@ -3031,49 +3266,49 @@ var NotificationItem = ({
|
|
|
3031
3266
|
onDismiss(notification);
|
|
3032
3267
|
};
|
|
3033
3268
|
const displayTitle = contextId ? `${context} - ${contextId}` : context || "Notifica\xE7\xE3o";
|
|
3034
|
-
return /* @__PURE__ */ (0,
|
|
3035
|
-
/* @__PURE__ */ (0,
|
|
3269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3270
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3036
3271
|
"div",
|
|
3037
3272
|
{
|
|
3038
3273
|
className: `notification-item-modern ${status === "unread" ? "unread" : ""}`,
|
|
3039
3274
|
onClick: handleOpenModal,
|
|
3040
3275
|
children: [
|
|
3041
|
-
/* @__PURE__ */ (0,
|
|
3042
|
-
/* @__PURE__ */ (0,
|
|
3043
|
-
/* @__PURE__ */ (0,
|
|
3044
|
-
/* @__PURE__ */ (0,
|
|
3045
|
-
contextId && /* @__PURE__ */ (0,
|
|
3046
|
-
/* @__PURE__ */ (0,
|
|
3047
|
-
/* @__PURE__ */ (0,
|
|
3276
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: `notification-status-indicator ${status}`, children: status === "unread" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiClock, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiCheck, { size: 14 }) }),
|
|
3277
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-main-content", children: [
|
|
3278
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "notification-header-row", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-title-modern", children: [
|
|
3279
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "notification-context", children: context }),
|
|
3280
|
+
contextId && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
3281
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "notification-separator", children: "/" }),
|
|
3282
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "notification-context-id", children: contextId })
|
|
3048
3283
|
] })
|
|
3049
3284
|
] }) }),
|
|
3050
|
-
/* @__PURE__ */ (0,
|
|
3051
|
-
/* @__PURE__ */ (0,
|
|
3052
|
-
/* @__PURE__ */ (0,
|
|
3053
|
-
/* @__PURE__ */ (0,
|
|
3054
|
-
/* @__PURE__ */ (0,
|
|
3285
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "notification-preview", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "notification-content-preview", children: content || "Nova mensagem recebida" }) }),
|
|
3286
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-meta", children: [
|
|
3287
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-timestamp", children: [
|
|
3288
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiClock, { size: 12, className: "me-1" }),
|
|
3289
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("small", { children: (0, import_dayjs5.default)(createdAt).format("DD/MM/YYYY HH:mm") })
|
|
3055
3290
|
] }),
|
|
3056
|
-
readAt && /* @__PURE__ */ (0,
|
|
3057
|
-
/* @__PURE__ */ (0,
|
|
3058
|
-
/* @__PURE__ */ (0,
|
|
3291
|
+
readAt && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-read-time", children: [
|
|
3292
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiCheck, { size: 12, className: "me-1" }),
|
|
3293
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("small", { children: [
|
|
3059
3294
|
"Lida em ",
|
|
3060
|
-
(0,
|
|
3295
|
+
(0, import_dayjs5.default)(readAt).format("DD/MM HH:mm")
|
|
3061
3296
|
] })
|
|
3062
3297
|
] })
|
|
3063
3298
|
] })
|
|
3064
3299
|
] }),
|
|
3065
|
-
/* @__PURE__ */ (0,
|
|
3066
|
-
|
|
3300
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "notification-quick-actions", children: status === "unread" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3301
|
+
import_react_bootstrap30.OverlayTrigger,
|
|
3067
3302
|
{
|
|
3068
3303
|
placement: "top",
|
|
3069
|
-
overlay: /* @__PURE__ */ (0,
|
|
3070
|
-
children: /* @__PURE__ */ (0,
|
|
3304
|
+
overlay: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_bootstrap30.Tooltip, { children: "Descartar" }),
|
|
3305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
3071
3306
|
"button",
|
|
3072
3307
|
{
|
|
3073
3308
|
className: "notification-action-btn notification-dismiss-btn",
|
|
3074
3309
|
onClick: handleDismiss,
|
|
3075
3310
|
"aria-label": "Descartar notifica\xE7\xE3o",
|
|
3076
|
-
children: /* @__PURE__ */ (0,
|
|
3311
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiTrash2, { size: 14 })
|
|
3077
3312
|
}
|
|
3078
3313
|
)
|
|
3079
3314
|
}
|
|
@@ -3081,39 +3316,39 @@ var NotificationItem = ({
|
|
|
3081
3316
|
]
|
|
3082
3317
|
}
|
|
3083
3318
|
),
|
|
3084
|
-
/* @__PURE__ */ (0,
|
|
3085
|
-
|
|
3319
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
3320
|
+
import_react_bootstrap30.Modal,
|
|
3086
3321
|
{
|
|
3087
3322
|
show: showModal,
|
|
3088
3323
|
onHide: handleCloseModal,
|
|
3089
3324
|
centered: true,
|
|
3090
3325
|
className: "notification-modal",
|
|
3091
3326
|
children: [
|
|
3092
|
-
/* @__PURE__ */ (0,
|
|
3093
|
-
status === "unread" ? /* @__PURE__ */ (0,
|
|
3327
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_bootstrap30.Modal.Header, { closeButton: true, className: "notification-modal-header", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_bootstrap30.Modal.Title, { className: "notification-modal-title", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "d-flex align-items-center", children: [
|
|
3328
|
+
status === "unread" ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiClock, { className: "me-2 text-warning" }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiCheck, { className: "me-2 text-success" }),
|
|
3094
3329
|
"Detalhes da Notifica\xE7\xE3o"
|
|
3095
3330
|
] }) }) }),
|
|
3096
|
-
/* @__PURE__ */ (0,
|
|
3097
|
-
/* @__PURE__ */ (0,
|
|
3098
|
-
/* @__PURE__ */ (0,
|
|
3099
|
-
/* @__PURE__ */ (0,
|
|
3100
|
-
/* @__PURE__ */ (0,
|
|
3101
|
-
/* @__PURE__ */ (0,
|
|
3331
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_bootstrap30.Modal.Body, { className: "notification-modal-body", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-modal-content", children: [
|
|
3332
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-modal-meta", children: [
|
|
3333
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("h6", { className: "notification-modal-source", children: displayTitle }),
|
|
3334
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "notification-modal-timestamps", children: [
|
|
3335
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("small", { className: "text-muted", children: [
|
|
3336
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiClock, { size: 12, className: "me-1" }),
|
|
3102
3337
|
"Criada em ",
|
|
3103
|
-
(0,
|
|
3338
|
+
(0, import_dayjs5.default)(createdAt).format("DD/MM/YYYY [\xE0s] HH:mm")
|
|
3104
3339
|
] }),
|
|
3105
|
-
readAt && /* @__PURE__ */ (0,
|
|
3106
|
-
/* @__PURE__ */ (0,
|
|
3340
|
+
readAt && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("small", { className: "text-muted ms-3", children: [
|
|
3341
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_fi5.FiCheck, { size: 12, className: "me-1" }),
|
|
3107
3342
|
"Lida em ",
|
|
3108
|
-
(0,
|
|
3343
|
+
(0, import_dayjs5.default)(readAt).format("DD/MM/YYYY [\xE0s] HH:mm")
|
|
3109
3344
|
] })
|
|
3110
3345
|
] })
|
|
3111
3346
|
] }),
|
|
3112
|
-
/* @__PURE__ */ (0,
|
|
3347
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("div", { className: "notification-modal-message", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "mb-0", children: content || emptyContentLabel }) })
|
|
3113
3348
|
] }) }),
|
|
3114
|
-
/* @__PURE__ */ (0,
|
|
3115
|
-
/* @__PURE__ */ (0,
|
|
3116
|
-
status === "unread" && /* @__PURE__ */ (0,
|
|
3349
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_react_bootstrap30.Modal.Footer, { className: "notification-modal-footer", children: [
|
|
3350
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_bootstrap30.Button, { variant: "outline-secondary", onClick: handleCloseModal, children: "Fechar" }),
|
|
3351
|
+
status === "unread" && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react_bootstrap30.Button, { variant: "primary", onClick: handleReadAndClose, children: "Marcar como lida" })
|
|
3117
3352
|
] })
|
|
3118
3353
|
]
|
|
3119
3354
|
}
|
|
@@ -3122,9 +3357,9 @@ var NotificationItem = ({
|
|
|
3122
3357
|
};
|
|
3123
3358
|
|
|
3124
3359
|
// src/icons/NotificationBell.tsx
|
|
3125
|
-
var
|
|
3360
|
+
var import_react_bootstrap31 = require("react-bootstrap");
|
|
3126
3361
|
var import_fi6 = require("react-icons/fi");
|
|
3127
|
-
var
|
|
3362
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3128
3363
|
var NotificationBell = ({
|
|
3129
3364
|
notifications,
|
|
3130
3365
|
onItemRead,
|
|
@@ -3134,11 +3369,11 @@ var NotificationBell = ({
|
|
|
3134
3369
|
className = ""
|
|
3135
3370
|
}) => {
|
|
3136
3371
|
const unreadCount = notifications.filter((n) => n.status === "unread").length;
|
|
3137
|
-
return /* @__PURE__ */ (0,
|
|
3138
|
-
/* @__PURE__ */ (0,
|
|
3139
|
-
/* @__PURE__ */ (0,
|
|
3140
|
-
unreadCount > 0 && /* @__PURE__ */ (0,
|
|
3141
|
-
|
|
3372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_react_bootstrap31.Dropdown, { align: "end", className: `notification-bell-dropdown ${className}`, children: [
|
|
3373
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_react_bootstrap31.Dropdown.Toggle, { as: "div", className: "position-relative cursor-pointer p-2", children: [
|
|
3374
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_fi6.FiBell, { size }),
|
|
3375
|
+
unreadCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3376
|
+
import_react_bootstrap31.Badge,
|
|
3142
3377
|
{
|
|
3143
3378
|
pill: true,
|
|
3144
3379
|
bg: "danger",
|
|
@@ -3148,15 +3383,15 @@ var NotificationBell = ({
|
|
|
3148
3383
|
}
|
|
3149
3384
|
)
|
|
3150
3385
|
] }),
|
|
3151
|
-
/* @__PURE__ */ (0,
|
|
3152
|
-
|
|
3386
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
3387
|
+
import_react_bootstrap31.Dropdown.Menu,
|
|
3153
3388
|
{
|
|
3154
3389
|
className: "shadow-lg border-0",
|
|
3155
3390
|
style: { width: "320px", padding: 0, maxHeight: "500px", overflowY: "auto" },
|
|
3156
3391
|
children: [
|
|
3157
|
-
/* @__PURE__ */ (0,
|
|
3158
|
-
/* @__PURE__ */ (0,
|
|
3159
|
-
unreadCount > 0 && onMarkAllRead && /* @__PURE__ */ (0,
|
|
3392
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "p-3 border-bottom d-flex justify-content-between align-items-center bg-light", children: [
|
|
3393
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("h6", { className: "mb-0 fw-bold", children: "Notifica\xE7\xF5es" }),
|
|
3394
|
+
unreadCount > 0 && onMarkAllRead && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3160
3395
|
"button",
|
|
3161
3396
|
{
|
|
3162
3397
|
className: "btn btn-link btn-sm p-0 text-decoration-none",
|
|
@@ -3168,7 +3403,7 @@ var NotificationBell = ({
|
|
|
3168
3403
|
}
|
|
3169
3404
|
)
|
|
3170
3405
|
] }),
|
|
3171
|
-
/* @__PURE__ */ (0,
|
|
3406
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "notification-list", children: notifications.length > 0 ? notifications.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()).map((n) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
3172
3407
|
NotificationItem,
|
|
3173
3408
|
{
|
|
3174
3409
|
notification: n,
|
|
@@ -3176,11 +3411,11 @@ var NotificationBell = ({
|
|
|
3176
3411
|
onDismiss: onItemDismiss
|
|
3177
3412
|
},
|
|
3178
3413
|
n.id
|
|
3179
|
-
)) : /* @__PURE__ */ (0,
|
|
3180
|
-
/* @__PURE__ */ (0,
|
|
3181
|
-
/* @__PURE__ */ (0,
|
|
3414
|
+
)) : /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "p-4 text-center text-muted", children: [
|
|
3415
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_fi6.FiBell, { size: 24, className: "mb-2 opacity-25" }),
|
|
3416
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "mb-0 small", children: "Nenhuma notifica\xE7\xE3o por aqui." })
|
|
3182
3417
|
] }) }),
|
|
3183
|
-
notifications.length > 0 && /* @__PURE__ */ (0,
|
|
3418
|
+
notifications.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "p-2 border-top text-center bg-light", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("small", { className: "text-muted", children: [
|
|
3184
3419
|
"Total: ",
|
|
3185
3420
|
notifications.length,
|
|
3186
3421
|
" notifica\xE7\xF5es"
|
|
@@ -3192,8 +3427,8 @@ var NotificationBell = ({
|
|
|
3192
3427
|
};
|
|
3193
3428
|
|
|
3194
3429
|
// src/modals/ModalBasicTemplate.tsx
|
|
3195
|
-
var
|
|
3196
|
-
var
|
|
3430
|
+
var import_react_bootstrap32 = require("react-bootstrap");
|
|
3431
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3197
3432
|
var ModalBasicTemplate = ({
|
|
3198
3433
|
show,
|
|
3199
3434
|
closeFunc,
|
|
@@ -3207,8 +3442,8 @@ var ModalBasicTemplate = ({
|
|
|
3207
3442
|
if (typeof part === "function") return part();
|
|
3208
3443
|
return part;
|
|
3209
3444
|
};
|
|
3210
|
-
return /* @__PURE__ */ (0,
|
|
3211
|
-
|
|
3445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
3446
|
+
import_react_bootstrap32.Modal,
|
|
3212
3447
|
{
|
|
3213
3448
|
show,
|
|
3214
3449
|
onHide: closeFunc,
|
|
@@ -3216,11 +3451,11 @@ var ModalBasicTemplate = ({
|
|
|
3216
3451
|
style: dialogStyle,
|
|
3217
3452
|
...modalProps,
|
|
3218
3453
|
children: [
|
|
3219
|
-
header && /* @__PURE__ */ (0,
|
|
3220
|
-
/* @__PURE__ */ (0,
|
|
3221
|
-
footer && /* @__PURE__ */ (0,
|
|
3454
|
+
header && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_bootstrap32.Modal.Header, { closeButton: true, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_bootstrap32.Modal.Title, { children: renderPart(header) }) }),
|
|
3455
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_bootstrap32.Modal.Body, { style: bodyStyle, children: renderPart(body) }),
|
|
3456
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_react_bootstrap32.Modal.Footer, { children: [
|
|
3222
3457
|
renderPart(footer),
|
|
3223
|
-
!footer && /* @__PURE__ */ (0,
|
|
3458
|
+
!footer && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_react_bootstrap32.Button, { variant: "secondary", onClick: closeFunc, children: "Fechar" })
|
|
3224
3459
|
] })
|
|
3225
3460
|
]
|
|
3226
3461
|
}
|
|
@@ -3229,10 +3464,10 @@ var ModalBasicTemplate = ({
|
|
|
3229
3464
|
var ModalBasicTemplate_default = ModalBasicTemplate;
|
|
3230
3465
|
|
|
3231
3466
|
// src/modals/SelectDateModal.tsx
|
|
3232
|
-
var
|
|
3233
|
-
var
|
|
3234
|
-
var
|
|
3235
|
-
var
|
|
3467
|
+
var import_react22 = require("react");
|
|
3468
|
+
var import_react_bootstrap33 = require("react-bootstrap");
|
|
3469
|
+
var import_dayjs6 = __toESM(require("dayjs"));
|
|
3470
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
3236
3471
|
var SelectDateModal = ({
|
|
3237
3472
|
show,
|
|
3238
3473
|
onClose,
|
|
@@ -3242,40 +3477,40 @@ var SelectDateModal = ({
|
|
|
3242
3477
|
initialDate,
|
|
3243
3478
|
allowFuture = true
|
|
3244
3479
|
}) => {
|
|
3245
|
-
const [selectedDate, setSelectedDate] = (0,
|
|
3246
|
-
initialDate || (0,
|
|
3480
|
+
const [selectedDate, setSelectedDate] = (0, import_react22.useState)(
|
|
3481
|
+
initialDate || (0, import_dayjs6.default)().format("YYYY-MM-DDTHH:mm")
|
|
3247
3482
|
);
|
|
3248
3483
|
const handleConfirm = () => {
|
|
3249
3484
|
onSelect(selectedDate);
|
|
3250
3485
|
onClose();
|
|
3251
3486
|
};
|
|
3252
|
-
return /* @__PURE__ */ (0,
|
|
3253
|
-
/* @__PURE__ */ (0,
|
|
3254
|
-
/* @__PURE__ */ (0,
|
|
3255
|
-
/* @__PURE__ */ (0,
|
|
3256
|
-
/* @__PURE__ */ (0,
|
|
3257
|
-
|
|
3487
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_bootstrap33.Modal, { show, onHide: onClose, centered: true, size: "sm", children: [
|
|
3488
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_bootstrap33.Modal.Header, { closeButton: true, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_bootstrap33.Modal.Title, { children: title }) }),
|
|
3489
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_bootstrap33.Modal.Body, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_bootstrap33.Form.Group, { children: [
|
|
3490
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_bootstrap33.Form.Label, { children: label }),
|
|
3491
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
3492
|
+
import_react_bootstrap33.Form.Control,
|
|
3258
3493
|
{
|
|
3259
3494
|
type: "datetime-local",
|
|
3260
3495
|
value: selectedDate,
|
|
3261
|
-
max: allowFuture ? void 0 : (0,
|
|
3496
|
+
max: allowFuture ? void 0 : (0, import_dayjs6.default)().format("YYYY-MM-DDTHH:mm"),
|
|
3262
3497
|
onChange: (e) => setSelectedDate(e.target.value)
|
|
3263
3498
|
}
|
|
3264
3499
|
)
|
|
3265
3500
|
] }) }),
|
|
3266
|
-
/* @__PURE__ */ (0,
|
|
3267
|
-
/* @__PURE__ */ (0,
|
|
3268
|
-
/* @__PURE__ */ (0,
|
|
3501
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_react_bootstrap33.Modal.Footer, { children: [
|
|
3502
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_bootstrap33.Button, { variant: "outline-secondary", onClick: onClose, children: "Cancelar" }),
|
|
3503
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_react_bootstrap33.Button, { variant: "primary", onClick: handleConfirm, children: "Confirmar" })
|
|
3269
3504
|
] })
|
|
3270
3505
|
] });
|
|
3271
3506
|
};
|
|
3272
3507
|
|
|
3273
3508
|
// src/modals/JustificativaModal.tsx
|
|
3274
|
-
var
|
|
3275
|
-
var
|
|
3276
|
-
var
|
|
3277
|
-
var
|
|
3278
|
-
var
|
|
3509
|
+
var import_react23 = require("react");
|
|
3510
|
+
var import_react_bootstrap34 = require("react-bootstrap");
|
|
3511
|
+
var import_fa6 = require("react-icons/fa");
|
|
3512
|
+
var import_dayjs7 = __toESM(require("dayjs"));
|
|
3513
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
3279
3514
|
var JustificativaModal = ({
|
|
3280
3515
|
show,
|
|
3281
3516
|
onClose,
|
|
@@ -3284,10 +3519,10 @@ var JustificativaModal = ({
|
|
|
3284
3519
|
currentUserName,
|
|
3285
3520
|
onUpdateJustificativas
|
|
3286
3521
|
}) => {
|
|
3287
|
-
const [localJustificativas, setLocalJustificativas] = (0,
|
|
3288
|
-
const [novaDescricao, setNovaDescricao] = (0,
|
|
3289
|
-
const [editandoId, setEditandoId] = (0,
|
|
3290
|
-
(0,
|
|
3522
|
+
const [localJustificativas, setLocalJustificativas] = (0, import_react23.useState)(initialJustificativas);
|
|
3523
|
+
const [novaDescricao, setNovaDescricao] = (0, import_react23.useState)("");
|
|
3524
|
+
const [editandoId, setEditandoId] = (0, import_react23.useState)(null);
|
|
3525
|
+
(0, import_react23.useEffect)(() => {
|
|
3291
3526
|
setLocalJustificativas(initialJustificativas);
|
|
3292
3527
|
}, [initialJustificativas]);
|
|
3293
3528
|
const handleAddOrEdit = async () => {
|
|
@@ -3323,14 +3558,14 @@ var JustificativaModal = ({
|
|
|
3323
3558
|
await onUpdateJustificativas(updated);
|
|
3324
3559
|
setLocalJustificativas(updated);
|
|
3325
3560
|
};
|
|
3326
|
-
return /* @__PURE__ */ (0,
|
|
3327
|
-
/* @__PURE__ */ (0,
|
|
3328
|
-
/* @__PURE__ */ (0,
|
|
3329
|
-
/* @__PURE__ */ (0,
|
|
3330
|
-
/* @__PURE__ */ (0,
|
|
3331
|
-
/* @__PURE__ */ (0,
|
|
3332
|
-
/* @__PURE__ */ (0,
|
|
3333
|
-
|
|
3561
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_bootstrap34.Modal, { show, onHide: onClose, centered: true, size: "lg", children: [
|
|
3562
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Modal.Header, { closeButton: true, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Modal.Title, { children: "Justificativas / Coment\xE1rios" }) }),
|
|
3563
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_bootstrap34.Modal.Body, { children: [
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_bootstrap34.Form, { className: "mb-4", children: [
|
|
3565
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_react_bootstrap34.Form.Group, { controlId: "justificativaInput", className: "mb-2", children: [
|
|
3566
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Form.Label, { className: "small text-muted fw-bold", children: "NOVO REGISTRO" }),
|
|
3567
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3568
|
+
import_react_bootstrap34.Form.Control,
|
|
3334
3569
|
{
|
|
3335
3570
|
as: "textarea",
|
|
3336
3571
|
rows: 2,
|
|
@@ -3340,13 +3575,13 @@ var JustificativaModal = ({
|
|
|
3340
3575
|
}
|
|
3341
3576
|
)
|
|
3342
3577
|
] }),
|
|
3343
|
-
/* @__PURE__ */ (0,
|
|
3578
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "d-flex justify-content-end", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Button, { variant: "primary", size: "sm", onClick: handleAddOrEdit, children: editandoId ? "Salvar Edi\xE7\xE3o" : "Adicionar Justificativa" }) })
|
|
3344
3579
|
] }),
|
|
3345
|
-
/* @__PURE__ */ (0,
|
|
3580
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.ListGroup, { className: "border-0", children: localJustificativas.map((j) => {
|
|
3346
3581
|
var _a, _b, _c;
|
|
3347
3582
|
const isMe = ((_a = j.user) == null ? void 0 : _a.userId) === currentUserId;
|
|
3348
|
-
return /* @__PURE__ */ (0,
|
|
3349
|
-
|
|
3583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
3584
|
+
import_react_bootstrap34.ListGroup.Item,
|
|
3350
3585
|
{
|
|
3351
3586
|
className: "border-0 px-0",
|
|
3352
3587
|
style: {
|
|
@@ -3357,11 +3592,11 @@ var JustificativaModal = ({
|
|
|
3357
3592
|
backgroundColor: "transparent"
|
|
3358
3593
|
},
|
|
3359
3594
|
children: [
|
|
3360
|
-
/* @__PURE__ */ (0,
|
|
3361
|
-
/* @__PURE__ */ (0,
|
|
3362
|
-
/* @__PURE__ */ (0,
|
|
3595
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "d-flex align-items-center mb-1", style: { width: "100%", justifyContent: isMe ? "flex-start" : "flex-end" }, children: [
|
|
3596
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "small fw-bold text-dark me-2", children: isMe ? "Voc\xEA" : ((_b = j.user) == null ? void 0 : _b.userName) || ((_c = j.user) == null ? void 0 : _c.firstName) || "Usu\xE1rio" }),
|
|
3597
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Badge, { bg: "secondary", style: { fontSize: "0.65rem" }, children: (0, import_dayjs7.default)(j.createdAt).format("DD/MM [\xE0s] HH:mm") })
|
|
3363
3598
|
] }),
|
|
3364
|
-
/* @__PURE__ */ (0,
|
|
3599
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3365
3600
|
"div",
|
|
3366
3601
|
{
|
|
3367
3602
|
onClick: () => !j.removed && isMe && (setNovaDescricao(j.descricao), setEditandoId(j.id)),
|
|
@@ -3380,15 +3615,15 @@ var JustificativaModal = ({
|
|
|
3380
3615
|
children: j.descricao
|
|
3381
3616
|
}
|
|
3382
3617
|
),
|
|
3383
|
-
isMe && /* @__PURE__ */ (0,
|
|
3384
|
-
|
|
3618
|
+
isMe && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "mt-1 d-flex gap-2", children: j.removed ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.OverlayTrigger, { placement: "top", overlay: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Tooltip, { children: "Desfazer" }), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3619
|
+
import_fa6.FaUndo,
|
|
3385
3620
|
{
|
|
3386
3621
|
onClick: () => handleUndoRemove(j.id),
|
|
3387
3622
|
className: "text-success cursor-pointer",
|
|
3388
3623
|
size: 14
|
|
3389
3624
|
}
|
|
3390
|
-
) }) : /* @__PURE__ */ (0,
|
|
3391
|
-
|
|
3625
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.OverlayTrigger, { placement: "top", overlay: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Tooltip, { children: "Remover" }), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
3626
|
+
import_fa6.FaTrashAlt,
|
|
3392
3627
|
{
|
|
3393
3628
|
onClick: () => handleRemove(j.id),
|
|
3394
3629
|
className: "text-danger cursor-pointer",
|
|
@@ -3401,14 +3636,14 @@ var JustificativaModal = ({
|
|
|
3401
3636
|
);
|
|
3402
3637
|
}) })
|
|
3403
3638
|
] }),
|
|
3404
|
-
/* @__PURE__ */ (0,
|
|
3639
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Modal.Footer, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_react_bootstrap34.Button, { variant: "outline-secondary", onClick: onClose, children: "Fechar" }) })
|
|
3405
3640
|
] });
|
|
3406
3641
|
};
|
|
3407
3642
|
|
|
3408
3643
|
// src/modals/ImageViewModal.tsx
|
|
3409
|
-
var
|
|
3410
|
-
var
|
|
3411
|
-
var
|
|
3644
|
+
var import_react24 = require("react");
|
|
3645
|
+
var import_react_bootstrap35 = require("react-bootstrap");
|
|
3646
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
3412
3647
|
var ImageViewModal = ({
|
|
3413
3648
|
show,
|
|
3414
3649
|
onHide,
|
|
@@ -3417,10 +3652,10 @@ var ImageViewModal = ({
|
|
|
3417
3652
|
imageAltText = "Visualiza\xE7\xE3o de imagem",
|
|
3418
3653
|
resolveImageUrl
|
|
3419
3654
|
}) => {
|
|
3420
|
-
const [selectedImageKey, setSelectedImageKey] = (0,
|
|
3421
|
-
const [imageSrc, setImageSrc] = (0,
|
|
3422
|
-
const [currentAuthor, setCurrentAuthor] = (0,
|
|
3423
|
-
(0,
|
|
3655
|
+
const [selectedImageKey, setSelectedImageKey] = (0, import_react24.useState)(null);
|
|
3656
|
+
const [imageSrc, setImageSrc] = (0, import_react24.useState)(null);
|
|
3657
|
+
const [currentAuthor, setCurrentAuthor] = (0, import_react24.useState)("Desconhecido");
|
|
3658
|
+
(0, import_react24.useEffect)(() => {
|
|
3424
3659
|
if (show && initialImageData) {
|
|
3425
3660
|
setSelectedImageKey(initialImageData.key);
|
|
3426
3661
|
setCurrentAuthor(initialImageData.author || "Desconhecido");
|
|
@@ -3429,7 +3664,7 @@ var ImageViewModal = ({
|
|
|
3429
3664
|
setCurrentAuthor(imagesData[0].author || "Desconhecido");
|
|
3430
3665
|
}
|
|
3431
3666
|
}, [show, initialImageData]);
|
|
3432
|
-
(0,
|
|
3667
|
+
(0, import_react24.useEffect)(() => {
|
|
3433
3668
|
if (show && selectedImageKey) {
|
|
3434
3669
|
setImageSrc(null);
|
|
3435
3670
|
const file = imagesData.find((f) => f.key === selectedImageKey);
|
|
@@ -3442,8 +3677,8 @@ var ImageViewModal = ({
|
|
|
3442
3677
|
}, [show, selectedImageKey]);
|
|
3443
3678
|
const renderImageSelector = () => {
|
|
3444
3679
|
if (imagesData.length <= 1) return null;
|
|
3445
|
-
return /* @__PURE__ */ (0,
|
|
3446
|
-
|
|
3680
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "mb-3 d-flex flex-wrap justify-content-center gap-2", children: imagesData.map((img, idx) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3681
|
+
import_react_bootstrap35.Button,
|
|
3447
3682
|
{
|
|
3448
3683
|
variant: selectedImageKey === img.key ? "primary" : "outline-secondary",
|
|
3449
3684
|
size: "sm",
|
|
@@ -3456,9 +3691,9 @@ var ImageViewModal = ({
|
|
|
3456
3691
|
idx
|
|
3457
3692
|
)) });
|
|
3458
3693
|
};
|
|
3459
|
-
const body = /* @__PURE__ */ (0,
|
|
3694
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "text-center", children: [
|
|
3460
3695
|
renderImageSelector(),
|
|
3461
|
-
imageSrc ? /* @__PURE__ */ (0,
|
|
3696
|
+
imageSrc ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3462
3697
|
"img",
|
|
3463
3698
|
{
|
|
3464
3699
|
src: imageSrc,
|
|
@@ -3466,9 +3701,9 @@ var ImageViewModal = ({
|
|
|
3466
3701
|
className: "img-fluid rounded shadow-sm",
|
|
3467
3702
|
style: { maxHeight: "75vh", objectFit: "contain" }
|
|
3468
3703
|
}
|
|
3469
|
-
) : /* @__PURE__ */ (0,
|
|
3704
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "p-5 text-muted", children: "Aguardando imagem..." })
|
|
3470
3705
|
] });
|
|
3471
|
-
return /* @__PURE__ */ (0,
|
|
3706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
3472
3707
|
ModalBasicTemplate_default,
|
|
3473
3708
|
{
|
|
3474
3709
|
header: "Visualiza\xE7\xE3o de Imagem",
|
|
@@ -3476,20 +3711,168 @@ var ImageViewModal = ({
|
|
|
3476
3711
|
show,
|
|
3477
3712
|
body,
|
|
3478
3713
|
props: { size: "lg" },
|
|
3479
|
-
footer: () => /* @__PURE__ */ (0,
|
|
3480
|
-
/* @__PURE__ */ (0,
|
|
3714
|
+
footer: () => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "w-100 d-flex justify-content-between align-items-center", children: [
|
|
3715
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("small", { className: "text-muted", children: [
|
|
3481
3716
|
"Enviado por: ",
|
|
3482
|
-
/* @__PURE__ */ (0,
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("strong", { children: currentAuthor })
|
|
3483
3718
|
] }),
|
|
3484
|
-
/* @__PURE__ */ (0,
|
|
3719
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_react_bootstrap35.Button, { variant: "outline-secondary", size: "sm", onClick: onHide, children: "Fechar" })
|
|
3485
3720
|
] })
|
|
3486
3721
|
}
|
|
3487
3722
|
);
|
|
3488
3723
|
};
|
|
3489
3724
|
|
|
3725
|
+
// src/qr/QrReader.tsx
|
|
3726
|
+
var import_qr_scanner = __toESM(require("qr-scanner"));
|
|
3727
|
+
var import_react25 = require("react");
|
|
3728
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
3729
|
+
var QrReader = ({ callback }) => {
|
|
3730
|
+
const scanner = (0, import_react25.useRef)(null);
|
|
3731
|
+
const videoEl = (0, import_react25.useRef)(null);
|
|
3732
|
+
const qrBoxEl = (0, import_react25.useRef)(null);
|
|
3733
|
+
const [qrOn, setQrOn] = (0, import_react25.useState)(true);
|
|
3734
|
+
const [scannedResult, setScannedResult] = (0, import_react25.useState)("");
|
|
3735
|
+
const onScanSuccess = (result) => {
|
|
3736
|
+
setScannedResult(result.data);
|
|
3737
|
+
callback(result.data);
|
|
3738
|
+
};
|
|
3739
|
+
const onScanFail = (err) => {
|
|
3740
|
+
if (typeof err === "string" && !err.includes("No QR code found")) {
|
|
3741
|
+
console.error("QR Scanner Error:", err);
|
|
3742
|
+
}
|
|
3743
|
+
};
|
|
3744
|
+
(0, import_react25.useEffect)(() => {
|
|
3745
|
+
if (videoEl.current && !scanner.current) {
|
|
3746
|
+
scanner.current = new import_qr_scanner.default(videoEl.current, onScanSuccess, {
|
|
3747
|
+
onDecodeError: onScanFail,
|
|
3748
|
+
preferredCamera: "environment",
|
|
3749
|
+
highlightScanRegion: true,
|
|
3750
|
+
highlightCodeOutline: true,
|
|
3751
|
+
overlay: qrBoxEl.current || void 0
|
|
3752
|
+
});
|
|
3753
|
+
scanner.current.start().then(() => setQrOn(true)).catch((err) => {
|
|
3754
|
+
console.error("Failed to start QR Scanner:", err);
|
|
3755
|
+
setQrOn(false);
|
|
3756
|
+
});
|
|
3757
|
+
}
|
|
3758
|
+
return () => {
|
|
3759
|
+
if (scanner.current) {
|
|
3760
|
+
scanner.current.stop();
|
|
3761
|
+
scanner.current.destroy();
|
|
3762
|
+
scanner.current = null;
|
|
3763
|
+
}
|
|
3764
|
+
};
|
|
3765
|
+
}, []);
|
|
3766
|
+
(0, import_react25.useEffect)(() => {
|
|
3767
|
+
if (!qrOn) {
|
|
3768
|
+
alert(
|
|
3769
|
+
"C\xE2mera est\xE1 bloqueada ou inacess\xEDvel. Por favor, habilite a c\xE2mera nas permiss\xF5es do seu navegador e recarregue a p\xE1gina."
|
|
3770
|
+
);
|
|
3771
|
+
}
|
|
3772
|
+
}, [qrOn]);
|
|
3773
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "qr-reader", style: { position: "relative", width: "100%", maxWidth: "500px", margin: "0 auto" }, children: [
|
|
3774
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("video", { ref: videoEl, style: { width: "100%", borderRadius: "8px" } }),
|
|
3775
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ref: qrBoxEl, className: "qr-box" }),
|
|
3776
|
+
scannedResult && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
3777
|
+
"div",
|
|
3778
|
+
{
|
|
3779
|
+
style: {
|
|
3780
|
+
position: "absolute",
|
|
3781
|
+
top: 10,
|
|
3782
|
+
left: 10,
|
|
3783
|
+
zIndex: 10,
|
|
3784
|
+
background: "rgba(0,0,0,0.6)",
|
|
3785
|
+
color: "white",
|
|
3786
|
+
padding: "4px 8px",
|
|
3787
|
+
borderRadius: "4px",
|
|
3788
|
+
fontSize: "0.8rem"
|
|
3789
|
+
},
|
|
3790
|
+
children: [
|
|
3791
|
+
"Lido: ",
|
|
3792
|
+
scannedResult
|
|
3793
|
+
]
|
|
3794
|
+
}
|
|
3795
|
+
)
|
|
3796
|
+
] });
|
|
3797
|
+
};
|
|
3798
|
+
|
|
3799
|
+
// src/qr/QrCodeScanButton.tsx
|
|
3800
|
+
var import_react26 = require("react");
|
|
3801
|
+
var import_bs3 = require("react-icons/bs");
|
|
3802
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3803
|
+
var QrCodeScanButton = ({ callback, size = 25 }) => {
|
|
3804
|
+
const [showQr, setShowQr] = (0, import_react26.useState)(false);
|
|
3805
|
+
const toggleQr = () => {
|
|
3806
|
+
setShowQr((prev) => !prev);
|
|
3807
|
+
};
|
|
3808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
3809
|
+
"div",
|
|
3810
|
+
{
|
|
3811
|
+
className: "hoverable-div",
|
|
3812
|
+
style: {
|
|
3813
|
+
border: "solid",
|
|
3814
|
+
borderTopRightRadius: "3px",
|
|
3815
|
+
borderBottomRightRadius: "3px",
|
|
3816
|
+
padding: "8px",
|
|
3817
|
+
borderLeft: "none",
|
|
3818
|
+
borderColor: "#ccc",
|
|
3819
|
+
borderWidth: "1px",
|
|
3820
|
+
cursor: "pointer",
|
|
3821
|
+
display: "flex",
|
|
3822
|
+
alignItems: "center"
|
|
3823
|
+
},
|
|
3824
|
+
onClick: toggleQr,
|
|
3825
|
+
children: [
|
|
3826
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_bs3.BsQrCode, { size }),
|
|
3827
|
+
showQr && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3828
|
+
"div",
|
|
3829
|
+
{
|
|
3830
|
+
style: {
|
|
3831
|
+
position: "fixed",
|
|
3832
|
+
top: 0,
|
|
3833
|
+
left: 0,
|
|
3834
|
+
right: 0,
|
|
3835
|
+
bottom: 0,
|
|
3836
|
+
backgroundColor: "rgba(0,0,0,0.8)",
|
|
3837
|
+
zIndex: 9999,
|
|
3838
|
+
display: "flex",
|
|
3839
|
+
flexDirection: "column",
|
|
3840
|
+
alignItems: "center",
|
|
3841
|
+
justifyContent: "center",
|
|
3842
|
+
padding: "20px"
|
|
3843
|
+
},
|
|
3844
|
+
onClick: (e) => e.stopPropagation(),
|
|
3845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("div", { style: { width: "100%", maxWidth: "500px", backgroundColor: "#fff", borderRadius: "12px", padding: "20px", position: "relative" }, children: [
|
|
3846
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3847
|
+
"div",
|
|
3848
|
+
{
|
|
3849
|
+
onClick: toggleQr,
|
|
3850
|
+
style: { position: "absolute", top: "10px", right: "15px", fontSize: "1.5rem", cursor: "pointer", zIndex: 10001 },
|
|
3851
|
+
children: "\xD7"
|
|
3852
|
+
}
|
|
3853
|
+
),
|
|
3854
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("h5", { className: "mb-3 text-center", children: "Escaneie o QR Code" }),
|
|
3855
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
3856
|
+
QrReader,
|
|
3857
|
+
{
|
|
3858
|
+
callback: (v) => {
|
|
3859
|
+
toggleQr();
|
|
3860
|
+
callback(v);
|
|
3861
|
+
}
|
|
3862
|
+
}
|
|
3863
|
+
),
|
|
3864
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("p", { className: "mt-3 text-muted text-center small", children: "Aponte a c\xE2mera para o c\xF3digo" })
|
|
3865
|
+
] })
|
|
3866
|
+
}
|
|
3867
|
+
)
|
|
3868
|
+
]
|
|
3869
|
+
}
|
|
3870
|
+
);
|
|
3871
|
+
};
|
|
3872
|
+
|
|
3490
3873
|
// src/tables/ReusableTableWithModal.tsx
|
|
3491
3874
|
var import_react27 = require("react");
|
|
3492
|
-
var
|
|
3875
|
+
var import_react_bootstrap36 = require("react-bootstrap");
|
|
3493
3876
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
3494
3877
|
var ReusableTableWithModal = ({
|
|
3495
3878
|
fetchDataCallback,
|
|
@@ -3532,7 +3915,7 @@ var ReusableTableWithModal = ({
|
|
|
3532
3915
|
setSelectedItem(null);
|
|
3533
3916
|
};
|
|
3534
3917
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
3535
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3918
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react_bootstrap36.Table, { striped: true, bordered: true, hover: true, responsive: true, children: [
|
|
3536
3919
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tr", { children: headers.map((col, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("th", { children: col }, index)) }) }),
|
|
3537
3920
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tbody", { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("td", { colSpan: headers.length, className: "text-center py-4", children: "Carregando..." }) }) : tableDataRows.length > 0 ? tableDataRows.map((td, index) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3538
3921
|
"tr",
|
|
@@ -3544,13 +3927,13 @@ var ReusableTableWithModal = ({
|
|
|
3544
3927
|
index
|
|
3545
3928
|
)) : /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("td", { colSpan: headers.length, className: "text-center py-4", children: "Nenhum dado encontrado." }) }) })
|
|
3546
3929
|
] }),
|
|
3547
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3548
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3549
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3550
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
3551
|
-
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3930
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react_bootstrap36.Modal, { show: showModal, onHide: handleCloseModal, centered: true, children: [
|
|
3931
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_bootstrap36.Modal.Header, { closeButton: true, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_bootstrap36.Modal.Title, { children: "Detalhes" }) }),
|
|
3932
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_bootstrap36.Modal.Body, { children: selectedItem && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { children: modalContent ? modalContent(selectedItem) : "Visualizando detalhes do item." }) }),
|
|
3933
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react_bootstrap36.Modal.Footer, { children: [
|
|
3934
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react_bootstrap36.Button, { variant: "outline-secondary", onClick: handleCloseModal, children: "Fechar" }),
|
|
3552
3935
|
modalButtonCallback && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
3553
|
-
|
|
3936
|
+
import_react_bootstrap36.Button,
|
|
3554
3937
|
{
|
|
3555
3938
|
variant: "primary",
|
|
3556
3939
|
onClick: () => {
|
|
@@ -3567,7 +3950,7 @@ var ReusableTableWithModal = ({
|
|
|
3567
3950
|
|
|
3568
3951
|
// src/text/TextWithMore.tsx
|
|
3569
3952
|
var import_react28 = require("react");
|
|
3570
|
-
var
|
|
3953
|
+
var import_react_bootstrap37 = require("react-bootstrap");
|
|
3571
3954
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
3572
3955
|
var TextWithMore = ({
|
|
3573
3956
|
text = "Carregando...",
|
|
@@ -3584,7 +3967,7 @@ var TextWithMore = ({
|
|
|
3584
3967
|
return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
3585
3968
|
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "text-with-more-content", children: displayText }),
|
|
3586
3969
|
isTruncated && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
3587
|
-
|
|
3970
|
+
import_react_bootstrap37.Button,
|
|
3588
3971
|
{
|
|
3589
3972
|
variant: "link",
|
|
3590
3973
|
className: "p-0 ms-2",
|
|
@@ -3595,16 +3978,24 @@ var TextWithMore = ({
|
|
|
3595
3978
|
)
|
|
3596
3979
|
] });
|
|
3597
3980
|
};
|
|
3981
|
+
|
|
3982
|
+
// src/index.ts
|
|
3983
|
+
var import_ui_kit_sgp = require("@teraprox/ui-kit-sgp");
|
|
3598
3984
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3599
3985
|
0 && (module.exports = {
|
|
3600
3986
|
ActionButtons,
|
|
3601
3987
|
AddButton,
|
|
3602
3988
|
AdvancedFilterBar,
|
|
3989
|
+
AnexoManager,
|
|
3603
3990
|
ApproveAndReproveButtons,
|
|
3604
3991
|
AsyncButton,
|
|
3605
3992
|
AutoComplete,
|
|
3606
3993
|
BonusButton,
|
|
3994
|
+
BranchDropDisplay,
|
|
3607
3995
|
ButtonWithDropdown,
|
|
3996
|
+
CalculadoraCorrecaoModal,
|
|
3997
|
+
CalculoCorrecao,
|
|
3998
|
+
CampoDeVerificacaoV2,
|
|
3608
3999
|
CheckBox,
|
|
3609
4000
|
ClickToWriteField,
|
|
3610
4001
|
ColorPicker,
|
|
@@ -3614,6 +4005,7 @@ var TextWithMore = ({
|
|
|
3614
4005
|
ExpandableCard,
|
|
3615
4006
|
FindRecursoByTagField,
|
|
3616
4007
|
FormField,
|
|
4008
|
+
FrequenciaFormV2,
|
|
3617
4009
|
Generic3DotMenu,
|
|
3618
4010
|
GenericChart,
|
|
3619
4011
|
GenericDisplay,
|
|
@@ -3636,6 +4028,7 @@ var TextWithMore = ({
|
|
|
3636
4028
|
PeriodSelector,
|
|
3637
4029
|
QrCodeScanButton,
|
|
3638
4030
|
QrReader,
|
|
4031
|
+
RateLimitBar,
|
|
3639
4032
|
RecursoDisplayer,
|
|
3640
4033
|
ResponsiveContainer,
|
|
3641
4034
|
ReusableTableWithModal,
|
|
@@ -3647,9 +4040,12 @@ var TextWithMore = ({
|
|
|
3647
4040
|
StatusPills,
|
|
3648
4041
|
Switch,
|
|
3649
4042
|
SwitchOnClick,
|
|
4043
|
+
TarefaUnidadeForm,
|
|
3650
4044
|
TextWithMore,
|
|
3651
4045
|
TimerDisplay,
|
|
4046
|
+
UnidadeMaterialCard,
|
|
3652
4047
|
UnidadeMaterialForm,
|
|
4048
|
+
UnifiedPeriodSelector,
|
|
3653
4049
|
UploadArea,
|
|
3654
4050
|
UuidPill,
|
|
3655
4051
|
VerticalItemsDisplay
|