@oondemand/oon-core-front 0.3.35 → 0.3.37
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.js +329 -143
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -642,7 +642,7 @@ function OonProviders({ config, http, storage, children }) {
|
|
|
642
642
|
|
|
643
643
|
// src/components/CoreCollection.tsx
|
|
644
644
|
import { useState as useState10 } from "react";
|
|
645
|
-
import { Box as
|
|
645
|
+
import { Box as Box10, Heading as Heading4, Stack as Stack4, Text as Text11 } from "@chakra-ui/react";
|
|
646
646
|
import { useMutation as useMutation2, useQueryClient as useQueryClient3 } from "@tanstack/react-query";
|
|
647
647
|
|
|
648
648
|
// src/components/internal/fieldUtils.ts
|
|
@@ -1833,12 +1833,12 @@ function DynamicForm({ title, eyebrow = "Cadastro", fields, initialValues, submi
|
|
|
1833
1833
|
|
|
1834
1834
|
// src/components/internal/CoreDetailModal.tsx
|
|
1835
1835
|
import { useEffect as useEffect6, useMemo as useMemo7, useState as useState9 } from "react";
|
|
1836
|
-
import { Box as
|
|
1836
|
+
import { Box as Box9, Button as Button8, Flex as Flex7, Heading as Heading3, IconButton, Text as Text10 } from "@chakra-ui/react";
|
|
1837
1837
|
import { useQuery as useQuery6, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
|
|
1838
1838
|
|
|
1839
1839
|
// src/components/internal/CoreTabbedDetail.tsx
|
|
1840
1840
|
import { useEffect as useEffect5, useMemo as useMemo6, useState as useState8 } from "react";
|
|
1841
|
-
import { Box as
|
|
1841
|
+
import { Box as Box8, Button as Button7, Flex as Flex6, Input as Input5, NativeSelect as NativeSelect4, SimpleGrid as SimpleGrid3, Stack as Stack3, Text as Text9, Textarea as Textarea3 } from "@chakra-ui/react";
|
|
1842
1842
|
|
|
1843
1843
|
// src/components/internal/CoreSummaryCards.tsx
|
|
1844
1844
|
import { SimpleGrid as SimpleGrid2, Box as Box5, Text as Text6, Badge as Badge2 } from "@chakra-ui/react";
|
|
@@ -1894,7 +1894,7 @@ function CoreSummaryCards({ cards = [], parent, relations }) {
|
|
|
1894
1894
|
|
|
1895
1895
|
// src/components/internal/CoreRelatedGrid.tsx
|
|
1896
1896
|
import { useMemo as useMemo5, useState as useState7 } from "react";
|
|
1897
|
-
import { Badge as Badge3, Box as
|
|
1897
|
+
import { Badge as Badge3, Box as Box7, Button as Button6, Flex as Flex5, Table as Table2, Text as Text8 } from "@chakra-ui/react";
|
|
1898
1898
|
import { useMutation, useQuery as useQuery5, useQueryClient } from "@tanstack/react-query";
|
|
1899
1899
|
|
|
1900
1900
|
// src/components/internal/CoreInlineEditableCell.tsx
|
|
@@ -1944,7 +1944,60 @@ function CoreInlineEditableCell({ column, meta, value, onChange }) {
|
|
|
1944
1944
|
|
|
1945
1945
|
// src/components/internal/CoreRowAction.tsx
|
|
1946
1946
|
import { useState as useState6 } from "react";
|
|
1947
|
-
import { Button as Button5, Text as Text7 } from "@chakra-ui/react";
|
|
1947
|
+
import { Box as Box6, Button as Button5, Text as Text7 } from "@chakra-ui/react";
|
|
1948
|
+
|
|
1949
|
+
// src/components/internal/actionError.ts
|
|
1950
|
+
function asRecord(value) {
|
|
1951
|
+
return value && typeof value === "object" ? value : void 0;
|
|
1952
|
+
}
|
|
1953
|
+
function firstText(...values) {
|
|
1954
|
+
return values.find((value) => typeof value === "string" && value.trim().length > 0)?.trim();
|
|
1955
|
+
}
|
|
1956
|
+
function firstNumber(...values) {
|
|
1957
|
+
return values.find((value) => typeof value === "number" && Number.isFinite(value));
|
|
1958
|
+
}
|
|
1959
|
+
function collectDetailMessages(value, visited = /* @__PURE__ */ new WeakSet(), depth = 0) {
|
|
1960
|
+
if (depth > 4 || value == null) return [];
|
|
1961
|
+
if (typeof value === "string") return value.trim() ? [value.trim()] : [];
|
|
1962
|
+
if (Array.isArray(value)) {
|
|
1963
|
+
return value.flatMap((item) => collectDetailMessages(item, visited, depth + 1));
|
|
1964
|
+
}
|
|
1965
|
+
if (typeof value !== "object" || visited.has(value)) return [];
|
|
1966
|
+
visited.add(value);
|
|
1967
|
+
const record = value;
|
|
1968
|
+
const field = firstText(record.field, record.path, record.property, record.name);
|
|
1969
|
+
const message = firstText(record.message, record.msg, record.reason);
|
|
1970
|
+
const direct = message ? [field ? `${field}: ${message}` : message] : [];
|
|
1971
|
+
const nestedKeys = ["details", "errors", "validation", "fields"];
|
|
1972
|
+
const nested = nestedKeys.flatMap((key) => collectDetailMessages(record[key], visited, depth + 1));
|
|
1973
|
+
if (direct.length || nested.length) return [...direct, ...nested];
|
|
1974
|
+
return Object.entries(record).filter(([key]) => !["code", "status", "statusCode", "requestId"].includes(key)).flatMap(([, nestedValue]) => collectDetailMessages(nestedValue, visited, depth + 1));
|
|
1975
|
+
}
|
|
1976
|
+
function unique(values) {
|
|
1977
|
+
return [...new Set(values.map((value) => value.trim()).filter(Boolean))];
|
|
1978
|
+
}
|
|
1979
|
+
function describeActionError(error) {
|
|
1980
|
+
if (error instanceof Error) return { message: error.message };
|
|
1981
|
+
if (typeof error === "string") return { message: error };
|
|
1982
|
+
const record = asRecord(error);
|
|
1983
|
+
if (!record) return { message: "N\xE3o foi poss\xEDvel executar a a\xE7\xE3o." };
|
|
1984
|
+
const envelope = asRecord(record.error) ?? record;
|
|
1985
|
+
const message = firstText(envelope.message, record.message) ?? "N\xE3o foi poss\xEDvel executar a a\xE7\xE3o.";
|
|
1986
|
+
const details = unique(collectDetailMessages(envelope.details ?? record.details)).filter((detail) => detail !== message).slice(0, 3);
|
|
1987
|
+
const code = firstText(envelope.code, record.code);
|
|
1988
|
+
const status = firstNumber(envelope.status, envelope.statusCode, record.status, record.statusCode);
|
|
1989
|
+
const requestId = firstText(envelope.requestId, record.requestId);
|
|
1990
|
+
const technical = [
|
|
1991
|
+
code ? `C\xF3digo: ${code}` : void 0,
|
|
1992
|
+
status ? `HTTP: ${status}` : void 0,
|
|
1993
|
+
requestId ? `ID da requisi\xE7\xE3o: ${requestId}` : void 0
|
|
1994
|
+
].filter((value) => Boolean(value));
|
|
1995
|
+
const contextParts = [...details, ...technical];
|
|
1996
|
+
return {
|
|
1997
|
+
message,
|
|
1998
|
+
...contextParts.length ? { context: contextParts.join(" \u2022 ") } : {}
|
|
1999
|
+
};
|
|
2000
|
+
}
|
|
1948
2001
|
|
|
1949
2002
|
// src/components/internal/conditions.ts
|
|
1950
2003
|
function valueAt(source, path) {
|
|
@@ -1987,8 +2040,25 @@ var ACTION_TONES = {
|
|
|
1987
2040
|
neutral: { bg: "#F1F5F9", color: "#334155", border: "#E2E8F0", hover: "#E8EEF5" },
|
|
1988
2041
|
brand: { bg: "#E0F2FE", color: "#075985", border: "#BAE6FD", hover: "#D5EEFC" }
|
|
1989
2042
|
};
|
|
1990
|
-
function
|
|
1991
|
-
|
|
2043
|
+
function ActionErrorMessage({ error }) {
|
|
2044
|
+
const description = describeActionError(error);
|
|
2045
|
+
return /* @__PURE__ */ jsxs8(
|
|
2046
|
+
Box6,
|
|
2047
|
+
{
|
|
2048
|
+
role: "alert",
|
|
2049
|
+
mt: "5px",
|
|
2050
|
+
maxW: "420px",
|
|
2051
|
+
p: "7px 9px",
|
|
2052
|
+
bg: "#FEF3F2",
|
|
2053
|
+
borderWidth: "1px",
|
|
2054
|
+
borderColor: "#FECDCA",
|
|
2055
|
+
borderRadius: "6px",
|
|
2056
|
+
children: [
|
|
2057
|
+
/* @__PURE__ */ jsx12(Text7, { color: "#B42318", fontSize: "10px", fontWeight: "600", lineHeight: "1.35", children: description.message }),
|
|
2058
|
+
description.context ? /* @__PURE__ */ jsx12(Text7, { mt: "2px", color: "#7A271A", fontSize: "9px", lineHeight: "1.35", children: description.context }) : null
|
|
2059
|
+
]
|
|
2060
|
+
}
|
|
2061
|
+
);
|
|
1992
2062
|
}
|
|
1993
2063
|
function unwrap2(value) {
|
|
1994
2064
|
if (!value || typeof value !== "object") return {};
|
|
@@ -2112,7 +2182,7 @@ function CoreRowAction({ action, row, parent, onOpenDetail, onRefresh, onUpdate
|
|
|
2112
2182
|
]
|
|
2113
2183
|
}
|
|
2114
2184
|
),
|
|
2115
|
-
error ? /* @__PURE__ */ jsx12(
|
|
2185
|
+
error ? /* @__PURE__ */ jsx12(ActionErrorMessage, { error }) : null,
|
|
2116
2186
|
formOpen && pipelineAction.type === "formAction" ? /* @__PURE__ */ jsx12(
|
|
2117
2187
|
DynamicForm,
|
|
2118
2188
|
{
|
|
@@ -2214,12 +2284,12 @@ function CoreRelatedGrid({
|
|
|
2214
2284
|
[id]: { ...current[id] ?? {}, [field]: value }
|
|
2215
2285
|
}));
|
|
2216
2286
|
const createFields = tab.create?.fields?.length ? tab.create.fields : formFieldsFromMeta(schema?.fields ?? []).filter((field) => ![relation.foreignKey, "_id", "createdAt", "updatedAt"].includes(field.field));
|
|
2217
|
-
return /* @__PURE__ */ jsxs9(
|
|
2287
|
+
return /* @__PURE__ */ jsxs9(Box7, { children: [
|
|
2218
2288
|
canCreate ? /* @__PURE__ */ jsx13(Flex5, { justify: "flex-end", mb: "10px", children: /* @__PURE__ */ jsx13(Button6, { size: "sm", colorPalette: "brand", onClick: () => {
|
|
2219
2289
|
setCreateError(null);
|
|
2220
2290
|
setCreating(true);
|
|
2221
2291
|
}, children: tab.create?.label ?? "Novo registro" }) }) : null,
|
|
2222
|
-
/* @__PURE__ */ jsx13(
|
|
2292
|
+
/* @__PURE__ */ jsx13(Box7, { overflowX: "auto", borderWidth: "1px", borderColor: "#E5E9ED", borderRadius: "10px", children: /* @__PURE__ */ jsxs9(Table2.Root, { size: "sm", minW: "760px", children: [
|
|
2223
2293
|
/* @__PURE__ */ jsx13(Table2.Header, { children: /* @__PURE__ */ jsxs9(Table2.Row, { bg: "#F4F7F9", children: [
|
|
2224
2294
|
columns.map((column) => /* @__PURE__ */ jsx13(Table2.ColumnHeader, { fontSize: "10px", children: column.label ?? column.field }, column.field)),
|
|
2225
2295
|
hasActions ? /* @__PURE__ */ jsx13(Table2.ColumnHeader, { children: "A\xE7\xF5es" }) : null
|
|
@@ -2332,7 +2402,7 @@ function initialFieldValue2(field, value) {
|
|
|
2332
2402
|
function isMultiline2(field) {
|
|
2333
2403
|
return /observa|descricao|mensagem|detalhe|necessidade/i.test(field.field);
|
|
2334
2404
|
}
|
|
2335
|
-
function
|
|
2405
|
+
function messageOf2(error) {
|
|
2336
2406
|
if (!error) return null;
|
|
2337
2407
|
if (typeof error === "string") return error;
|
|
2338
2408
|
if (error instanceof Error) return error.message;
|
|
@@ -2420,9 +2490,9 @@ function FieldControl({
|
|
|
2420
2490
|
const checkedValue = String(field.checkedValue ?? true);
|
|
2421
2491
|
const uncheckedValue = String(field.uncheckedValue ?? false);
|
|
2422
2492
|
const checked = (value || uncheckedValue) === checkedValue;
|
|
2423
|
-
return /* @__PURE__ */ jsxs10(
|
|
2493
|
+
return /* @__PURE__ */ jsxs10(Box8, { children: [
|
|
2424
2494
|
/* @__PURE__ */ jsxs10(
|
|
2425
|
-
|
|
2495
|
+
Box8,
|
|
2426
2496
|
{
|
|
2427
2497
|
as: "label",
|
|
2428
2498
|
display: "flex",
|
|
@@ -2458,7 +2528,7 @@ function FieldControl({
|
|
|
2458
2528
|
}
|
|
2459
2529
|
if (field.kind === "ref" && field.ref) {
|
|
2460
2530
|
const reference = resolveReference2(field, values);
|
|
2461
|
-
return /* @__PURE__ */ jsxs10(
|
|
2531
|
+
return /* @__PURE__ */ jsxs10(Box8, { children: [
|
|
2462
2532
|
/* @__PURE__ */ jsx14(FieldLabel, { field, htmlFor: inputId }),
|
|
2463
2533
|
/* @__PURE__ */ jsx14(
|
|
2464
2534
|
ReferenceSelect,
|
|
@@ -2510,7 +2580,7 @@ function FieldControl({
|
|
|
2510
2580
|
onChange: (event) => onChange(parseMaskedInput(event.currentTarget.value, mask))
|
|
2511
2581
|
}
|
|
2512
2582
|
);
|
|
2513
|
-
return /* @__PURE__ */ jsxs10(
|
|
2583
|
+
return /* @__PURE__ */ jsxs10(Box8, { children: [
|
|
2514
2584
|
/* @__PURE__ */ jsx14(FieldLabel, { field, htmlFor: inputId }),
|
|
2515
2585
|
control,
|
|
2516
2586
|
/* @__PURE__ */ jsx14(ErrorText2, { id: errorId, message: error })
|
|
@@ -2526,9 +2596,9 @@ function GroupSection({
|
|
|
2526
2596
|
}) {
|
|
2527
2597
|
if (!fields.length) return null;
|
|
2528
2598
|
const columns = group.columns ?? 2;
|
|
2529
|
-
return /* @__PURE__ */ jsxs10(
|
|
2599
|
+
return /* @__PURE__ */ jsxs10(Box8, { p: { base: "12px", md: "14px" }, bg: "#FAFCFD", borderWidth: "1px", borderColor: "#E5E9ED", borderRadius: "9px", children: [
|
|
2530
2600
|
/* @__PURE__ */ jsx14(Text9, { color: "#344054", fontSize: "12px", fontWeight: "700", children: group.label }),
|
|
2531
|
-
group.description ? /* @__PURE__ */ jsx14(Text9, { mt: "2px", mb: "12px", color: "#667085", fontSize: "10px", children: group.description }) : /* @__PURE__ */ jsx14(
|
|
2601
|
+
group.description ? /* @__PURE__ */ jsx14(Text9, { mt: "2px", mb: "12px", color: "#667085", fontSize: "10px", children: group.description }) : /* @__PURE__ */ jsx14(Box8, { h: "10px" }),
|
|
2532
2602
|
/* @__PURE__ */ jsx14(SimpleGrid3, { columns: { base: 1, md: Math.min(columns, 2), xl: columns }, gapX: "16px", gapY: "14px", children: fields.map((field) => /* @__PURE__ */ jsx14(
|
|
2533
2603
|
FieldControl,
|
|
2534
2604
|
{
|
|
@@ -2641,7 +2711,7 @@ function InlineParentForm({
|
|
|
2641
2711
|
}
|
|
2642
2712
|
},
|
|
2643
2713
|
children: /* @__PURE__ */ jsxs10(Stack3, { gap: "16px", children: [
|
|
2644
|
-
error ? /* @__PURE__ */ jsx14(
|
|
2714
|
+
error ? /* @__PURE__ */ jsx14(Box8, { role: "alert", p: "10px 12px", color: "#B42318", bg: "#FEF3F2", borderWidth: "1px", borderColor: "#FECDCA", borderRadius: "7px", fontSize: "11px", children: messageOf2(error) }) : null,
|
|
2645
2715
|
renderFields(),
|
|
2646
2716
|
!externalSubmit ? /* @__PURE__ */ jsx14(Flex6, { justify: "flex-end", children: /* @__PURE__ */ jsx14(Button7, { type: "submit", colorPalette: "brand", loading: saving, children: "Salvar dados principais" }) }) : null
|
|
2647
2717
|
] })
|
|
@@ -2679,7 +2749,7 @@ function CoreTabbedDetail({
|
|
|
2679
2749
|
tab.id
|
|
2680
2750
|
);
|
|
2681
2751
|
}) }),
|
|
2682
|
-
/* @__PURE__ */ jsx14(
|
|
2752
|
+
/* @__PURE__ */ jsx14(Box8, { children: !active ? null : active.type === "summary" && parent ? /* @__PURE__ */ jsx14(CoreSummaryCards, { cards: active.cards, parent, relations }) : active.type === "form" ? /* @__PURE__ */ jsx14(
|
|
2683
2753
|
InlineParentForm,
|
|
2684
2754
|
{
|
|
2685
2755
|
fields: fieldsForTab(formFields, active.fields ?? active.groups?.flatMap((group) => group.fields)),
|
|
@@ -2765,9 +2835,9 @@ function CoreDetailModal({
|
|
|
2765
2835
|
const displayTitle = parent?.[config.titleField ?? ""] ? String(parent[config.titleField ?? ""]) : title;
|
|
2766
2836
|
const activeIsForm = (config.tabs.find((tab) => tab.id === activeTab) ?? config.tabs[0])?.type === "form";
|
|
2767
2837
|
const formId = `oon-detail-form-${model.replace(/[^a-zA-Z0-9_-]/g, "-")}`;
|
|
2768
|
-
return /* @__PURE__ */ jsx15(Flex7, { position: "fixed", inset: 0, zIndex: 1e3, align: "center", justify: "center", p: 4, bg: "rgba(15,23,42,.48)", children: /* @__PURE__ */ jsxs11(
|
|
2838
|
+
return /* @__PURE__ */ jsx15(Flex7, { position: "fixed", inset: 0, zIndex: 1e3, align: "center", justify: "center", p: 4, bg: "rgba(15,23,42,.48)", children: /* @__PURE__ */ jsxs11(Box9, { role: "dialog", "aria-modal": "true", display: "flex", flexDirection: "column", w: `min(${width}, 98vw)`, h: "94vh", maxH: "94vh", overflow: "hidden", bg: "white", borderRadius: "14px", boxShadow: "0 24px 70px rgba(15,23,42,.24)", children: [
|
|
2769
2839
|
/* @__PURE__ */ jsxs11(Flex7, { minH: "72px", px: "20px", py: "10px", align: "center", justify: "space-between", gap: 4, borderBottomWidth: "1px", borderColor: "#E5E9ED", children: [
|
|
2770
|
-
/* @__PURE__ */ jsxs11(
|
|
2840
|
+
/* @__PURE__ */ jsxs11(Box9, { minW: "160px", children: [
|
|
2771
2841
|
/* @__PURE__ */ jsx15(Text10, { color: "#0474AF", fontSize: "10px", fontWeight: "700", textTransform: "uppercase", children: "Detalhe" }),
|
|
2772
2842
|
/* @__PURE__ */ jsx15(Heading3, { size: "md", children: recordId ? displayTitle : `Novo ${title}` })
|
|
2773
2843
|
] }),
|
|
@@ -2794,7 +2864,7 @@ function CoreDetailModal({
|
|
|
2794
2864
|
)
|
|
2795
2865
|
] })
|
|
2796
2866
|
] }),
|
|
2797
|
-
/* @__PURE__ */ jsx15(
|
|
2867
|
+
/* @__PURE__ */ jsx15(Box9, { flex: "1", minH: 0, p: "20px", overflowY: "auto", children: schemaQuery.isLoading || parentQuery.isLoading ? /* @__PURE__ */ jsx15(Text10, { children: "Carregando..." }) : /* @__PURE__ */ jsx15(
|
|
2798
2868
|
CoreTabbedDetail,
|
|
2799
2869
|
{
|
|
2800
2870
|
tabs: config.tabs,
|
|
@@ -2830,7 +2900,7 @@ function CoreDetailModal({
|
|
|
2830
2900
|
borderColor: "#E5E9ED",
|
|
2831
2901
|
boxShadow: "0 -8px 24px rgba(15,23,42,.06)",
|
|
2832
2902
|
children: [
|
|
2833
|
-
/* @__PURE__ */ jsx15(
|
|
2903
|
+
/* @__PURE__ */ jsx15(Box9, { children: recordId ? bottomActions : null }),
|
|
2834
2904
|
/* @__PURE__ */ jsx15(Button8, { type: "submit", form: formId, colorPalette: "brand", disabled: !activeIsForm || schemaQuery.isLoading || parentQuery.isLoading, children: "Salvar" })
|
|
2835
2905
|
]
|
|
2836
2906
|
}
|
|
@@ -2885,7 +2955,7 @@ function CoreCollection({ model, label, section = "Cole\xE7\xE3o", mode = "dynam
|
|
|
2885
2955
|
if (needsSchema && schemaQuery.isError) return /* @__PURE__ */ jsx16(ErrorState, { error: schemaQuery.error });
|
|
2886
2956
|
const title = label ?? schema?.name ?? model;
|
|
2887
2957
|
return /* @__PURE__ */ jsxs12(Stack4, { gap: 5, children: [
|
|
2888
|
-
/* @__PURE__ */ jsxs12(
|
|
2958
|
+
/* @__PURE__ */ jsxs12(Box10, { children: [
|
|
2889
2959
|
/* @__PURE__ */ jsx16(Text11, { fontSize: "11px", fontWeight: "700", color: "brand.500", textTransform: "uppercase", letterSpacing: "0.08em", mb: 1, children: section }),
|
|
2890
2960
|
/* @__PURE__ */ jsx16(Heading4, { size: "lg", color: "#24323A", letterSpacing: "-0.02em", children: title }),
|
|
2891
2961
|
/* @__PURE__ */ jsx16(Text11, { mt: 1, fontSize: "13px", color: "gray.500", children: "Consulte, filtre e mantenha os registros desta opera\xE7\xE3o." })
|
|
@@ -2979,8 +3049,8 @@ function CoreDocument({ model, label, endpoint, columns, form }) {
|
|
|
2979
3049
|
}
|
|
2980
3050
|
|
|
2981
3051
|
// src/components/CorePipeline.tsx
|
|
2982
|
-
import { useState as useState11 } from "react";
|
|
2983
|
-
import { Badge as Badge4, Box as
|
|
3052
|
+
import { useEffect as useEffect7, useRef as useRef2, useState as useState11 } from "react";
|
|
3053
|
+
import { Badge as Badge4, Box as Box11, Button as Button9, Flex as Flex8, Heading as Heading5, Input as Input6, NativeSelect as NativeSelect5, Stack as Stack5, Text as Text12 } from "@chakra-ui/react";
|
|
2984
3054
|
import { useMutation as useMutation3, useQuery as useQuery7, useQueryClient as useQueryClient4 } from "@tanstack/react-query";
|
|
2985
3055
|
|
|
2986
3056
|
// src/pipelineTicket.ts
|
|
@@ -3108,6 +3178,19 @@ function groupPipelineActions(actions) {
|
|
|
3108
3178
|
};
|
|
3109
3179
|
}
|
|
3110
3180
|
|
|
3181
|
+
// src/components/internal/pipelineBoardScroll.ts
|
|
3182
|
+
var EDGE_TOLERANCE = 2;
|
|
3183
|
+
function resolveHorizontalScrollState(metrics) {
|
|
3184
|
+
const maxScrollLeft = Math.max(0, metrics.scrollWidth - metrics.clientWidth);
|
|
3185
|
+
return {
|
|
3186
|
+
canScrollLeft: metrics.scrollLeft > EDGE_TOLERANCE,
|
|
3187
|
+
canScrollRight: metrics.scrollLeft < maxScrollLeft - EDGE_TOLERANCE
|
|
3188
|
+
};
|
|
3189
|
+
}
|
|
3190
|
+
function pipelineBoardScrollStep(clientWidth) {
|
|
3191
|
+
return Math.max(280, Math.round(clientWidth * 0.75));
|
|
3192
|
+
}
|
|
3193
|
+
|
|
3111
3194
|
// src/components/CorePipeline.tsx
|
|
3112
3195
|
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3113
3196
|
function ticketId(row) {
|
|
@@ -3131,6 +3214,10 @@ function workStatusColor(value) {
|
|
|
3131
3214
|
if (/revisar|revisao|review/.test(normalized2)) return "#DC2626";
|
|
3132
3215
|
return "#94A3B8";
|
|
3133
3216
|
}
|
|
3217
|
+
function PipelineArrowIcon({ direction }) {
|
|
3218
|
+
const path = direction === "left" ? "M12.5 5 7.5 10l5 5" : "m7.5 5 5 5-5 5";
|
|
3219
|
+
return /* @__PURE__ */ jsx18("svg", { viewBox: "0 0 20 20", width: "18", height: "18", "aria-hidden": "true", children: /* @__PURE__ */ jsx18("path", { d: path, fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
3220
|
+
}
|
|
3134
3221
|
function PipelineFilterControl({
|
|
3135
3222
|
filter,
|
|
3136
3223
|
value,
|
|
@@ -3138,7 +3225,7 @@ function PipelineFilterControl({
|
|
|
3138
3225
|
onChange
|
|
3139
3226
|
}) {
|
|
3140
3227
|
if (filter.type === "ref" && meta?.ref) {
|
|
3141
|
-
return /* @__PURE__ */ jsx18(
|
|
3228
|
+
return /* @__PURE__ */ jsx18(Box11, { w: "220px", children: /* @__PURE__ */ jsx18(
|
|
3142
3229
|
ReferenceSelect,
|
|
3143
3230
|
{
|
|
3144
3231
|
field: filter.field,
|
|
@@ -3206,6 +3293,8 @@ function CorePipeline({
|
|
|
3206
3293
|
const [selectedTicket, setSelectedTicket] = useState11(null);
|
|
3207
3294
|
const [creating, setCreating] = useState11(false);
|
|
3208
3295
|
const [formError, setFormError] = useState11(null);
|
|
3296
|
+
const boardRef = useRef2(null);
|
|
3297
|
+
const [boardScrollState, setBoardScrollState] = useState11({ canScrollLeft: false, canScrollRight: false });
|
|
3209
3298
|
const effectiveFilters = Object.fromEntries(
|
|
3210
3299
|
Object.entries(filterValues).filter(([, value]) => value !== "" && value != null)
|
|
3211
3300
|
);
|
|
@@ -3214,6 +3303,23 @@ function CorePipeline({
|
|
|
3214
3303
|
queryFn: () => resource.list({ pageSize: 200, ...effectiveFilters }),
|
|
3215
3304
|
enabled: !!schema && viewMode === "board"
|
|
3216
3305
|
});
|
|
3306
|
+
useEffect7(() => {
|
|
3307
|
+
if (viewMode !== "board") return void 0;
|
|
3308
|
+
const board = boardRef.current;
|
|
3309
|
+
if (!board) return void 0;
|
|
3310
|
+
const sync = () => setBoardScrollState(resolveHorizontalScrollState(board));
|
|
3311
|
+
sync();
|
|
3312
|
+
board.addEventListener("scroll", sync, { passive: true });
|
|
3313
|
+
window.addEventListener("resize", sync);
|
|
3314
|
+
const resizeObserver = typeof ResizeObserver !== "undefined" ? new ResizeObserver(sync) : void 0;
|
|
3315
|
+
resizeObserver?.observe(board);
|
|
3316
|
+
Array.from(board.children).forEach((child) => resizeObserver?.observe(child));
|
|
3317
|
+
return () => {
|
|
3318
|
+
board.removeEventListener("scroll", sync);
|
|
3319
|
+
window.removeEventListener("resize", sync);
|
|
3320
|
+
resizeObserver?.disconnect();
|
|
3321
|
+
};
|
|
3322
|
+
}, [viewMode, listQuery.data?.results?.length, stages?.length, schema?.fields.length]);
|
|
3217
3323
|
const invalidate = async () => {
|
|
3218
3324
|
await Promise.all([
|
|
3219
3325
|
queryClient.invalidateQueries({ queryKey: ["oon", "pipeline", basePath] }),
|
|
@@ -3270,6 +3376,12 @@ function CorePipeline({
|
|
|
3270
3376
|
...defaultStage ? { [stageField]: defaultStage } : {}
|
|
3271
3377
|
});
|
|
3272
3378
|
};
|
|
3379
|
+
const scrollBoard = (direction) => {
|
|
3380
|
+
const board = boardRef.current;
|
|
3381
|
+
if (!board) return;
|
|
3382
|
+
const step = pipelineBoardScrollStep(board.clientWidth);
|
|
3383
|
+
board.scrollBy({ left: direction === "left" ? -step : step, behavior: "smooth" });
|
|
3384
|
+
};
|
|
3273
3385
|
const renderModalAction = (action, index) => selectedTicket ? /* @__PURE__ */ jsx18(
|
|
3274
3386
|
CoreRowAction,
|
|
3275
3387
|
{
|
|
@@ -3296,7 +3408,7 @@ function CorePipeline({
|
|
|
3296
3408
|
] }) : null;
|
|
3297
3409
|
return /* @__PURE__ */ jsxs13(Stack5, { gap: 5, children: [
|
|
3298
3410
|
/* @__PURE__ */ jsxs13(Flex8, { align: { base: "stretch", md: "flex-end" }, justify: "space-between", gap: 4, direction: { base: "column", md: "row" }, children: [
|
|
3299
|
-
/* @__PURE__ */ jsxs13(
|
|
3411
|
+
/* @__PURE__ */ jsxs13(Box11, { children: [
|
|
3300
3412
|
/* @__PURE__ */ jsx18(Text12, { fontSize: "11px", fontWeight: "700", color: "brand.500", textTransform: "uppercase", letterSpacing: "0.08em", mb: 1, children: "Esteira de processo" }),
|
|
3301
3413
|
/* @__PURE__ */ jsx18(Heading5, { size: "lg", color: "#24323A", letterSpacing: "-0.02em", children: label ?? schema?.name ?? model }),
|
|
3302
3414
|
/* @__PURE__ */ jsx18(Text12, { mt: 1, fontSize: "13px", color: "gray.500", children: "Acompanhe os tickets por etapa e visualize os principais dados de cada item." })
|
|
@@ -3309,7 +3421,7 @@ function CorePipeline({
|
|
|
3309
3421
|
filters.length ? /* @__PURE__ */ jsxs13(Flex8, { p: "12px", gap: "10px", align: "flex-end", wrap: "wrap", bg: "white", borderWidth: "1px", borderColor: "#E5E9ED", borderRadius: "10px", children: [
|
|
3310
3422
|
filters.map((filter) => {
|
|
3311
3423
|
const meta = schema?.fields.find((field) => field.name === filter.field);
|
|
3312
|
-
return /* @__PURE__ */ jsxs13(
|
|
3424
|
+
return /* @__PURE__ */ jsxs13(Box11, { children: [
|
|
3313
3425
|
/* @__PURE__ */ jsx18(Text12, { mb: "4px", fontSize: "10px", color: "#667085", fontWeight: "600", children: filter.label ?? fieldLabel({ name: filter.field }) }),
|
|
3314
3426
|
/* @__PURE__ */ jsx18(
|
|
3315
3427
|
PipelineFilterControl,
|
|
@@ -3345,69 +3457,143 @@ function CorePipeline({
|
|
|
3345
3457
|
setSelectedTicket(row);
|
|
3346
3458
|
}
|
|
3347
3459
|
}
|
|
3348
|
-
) : /* @__PURE__ */
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
textAlign: "
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
}
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3460
|
+
) : /* @__PURE__ */ jsxs13(Box11, { position: "relative", children: [
|
|
3461
|
+
/* @__PURE__ */ jsx18(
|
|
3462
|
+
Flex8,
|
|
3463
|
+
{
|
|
3464
|
+
ref: boardRef,
|
|
3465
|
+
"data-oon-pipeline-board": "true",
|
|
3466
|
+
gap: 4,
|
|
3467
|
+
align: "stretch",
|
|
3468
|
+
overflowX: "auto",
|
|
3469
|
+
overflowY: "auto",
|
|
3470
|
+
h: "clamp(420px, calc(100vh - 250px), 760px)",
|
|
3471
|
+
minH: "420px",
|
|
3472
|
+
pb: "18px",
|
|
3473
|
+
pr: "2px",
|
|
3474
|
+
scrollBehavior: "smooth",
|
|
3475
|
+
scrollbarGutter: "stable both-edges",
|
|
3476
|
+
overscrollBehaviorX: "contain",
|
|
3477
|
+
children: Array.from(byStage.entries()).map(([stageId, items]) => {
|
|
3478
|
+
const stageLabel = resolvedStages.find((stage) => stage.id === stageId)?.label ?? (stageId || "Sem etapa");
|
|
3479
|
+
return /* @__PURE__ */ jsxs13(Box11, { minW: "300px", maxW: "340px", flex: "1 0 300px", bg: "#E8ECEF", borderRadius: "12px", p: 3, borderWidth: "1px", borderColor: "#DDE3E7", children: [
|
|
3480
|
+
/* @__PURE__ */ jsxs13(Flex8, { align: "center", justify: "space-between", mb: 3, px: 1, children: [
|
|
3481
|
+
/* @__PURE__ */ jsx18(Text12, { fontWeight: "700", fontSize: "12px", color: "#33434C", textTransform: "uppercase", letterSpacing: "0.03em", children: stageLabel }),
|
|
3482
|
+
/* @__PURE__ */ jsx18(Badge4, { colorPalette: "brand", variant: "solid", borderRadius: "full", minW: "24px", justifyContent: "center", children: items.length })
|
|
3483
|
+
] }),
|
|
3484
|
+
/* @__PURE__ */ jsx18(Stack5, { gap: 2, children: items.length === 0 ? /* @__PURE__ */ jsx18(Box11, { borderWidth: "1px", borderStyle: "dashed", borderColor: "#C8D0D5", borderRadius: "10px", p: 5, textAlign: "center", children: /* @__PURE__ */ jsx18(Text12, { fontSize: "12px", color: "gray.500", children: "Nenhum ticket nesta etapa." }) }) : items.map((row, index) => {
|
|
3485
|
+
const ticketTitle = formatCell(row[resolvedTitleField], "string");
|
|
3486
|
+
return /* @__PURE__ */ jsxs13(
|
|
3487
|
+
Button9,
|
|
3488
|
+
{
|
|
3489
|
+
type: "button",
|
|
3490
|
+
variant: "plain",
|
|
3491
|
+
display: "block",
|
|
3492
|
+
w: "100%",
|
|
3493
|
+
h: "auto",
|
|
3494
|
+
minH: "auto",
|
|
3495
|
+
p: 3,
|
|
3496
|
+
bg: "white",
|
|
3497
|
+
borderRadius: "10px",
|
|
3498
|
+
borderWidth: "1px",
|
|
3499
|
+
borderColor: "#DDE3E7",
|
|
3500
|
+
boxShadow: "0 3px 10px rgba(7, 38, 46, 0.05)",
|
|
3501
|
+
textAlign: "left",
|
|
3502
|
+
whiteSpace: "normal",
|
|
3503
|
+
"aria-label": `Abrir ticket ${ticketTitle}`,
|
|
3504
|
+
onClick: () => {
|
|
3505
|
+
setFormError(null);
|
|
3506
|
+
setCreating(false);
|
|
3507
|
+
setSelectedTicket(row);
|
|
3508
|
+
},
|
|
3509
|
+
_hover: { borderColor: "brand.300", transform: "translateY(-1px)", boxShadow: "0 7px 18px rgba(7, 38, 46, 0.09)" },
|
|
3510
|
+
children: [
|
|
3511
|
+
/* @__PURE__ */ jsxs13(Flex8, { align: "flex-start", justify: "space-between", gap: "8px", mb: 2, children: [
|
|
3512
|
+
/* @__PURE__ */ jsx18(Text12, { fontSize: "13px", fontWeight: "700", color: "#24323A", lineClamp: 2, children: ticketTitle }),
|
|
3513
|
+
/* @__PURE__ */ jsx18(
|
|
3514
|
+
Box11,
|
|
3515
|
+
{
|
|
3516
|
+
as: "span",
|
|
3517
|
+
title: `Status da atividade: ${String(row[workStatusField] ?? "N\xE3o informado")}`,
|
|
3518
|
+
"aria-label": `Status da atividade: ${String(row[workStatusField] ?? "N\xE3o informado")}`,
|
|
3519
|
+
flex: "0 0 auto",
|
|
3520
|
+
w: "10px",
|
|
3521
|
+
h: "10px",
|
|
3522
|
+
mt: "4px",
|
|
3523
|
+
borderRadius: "full",
|
|
3524
|
+
bg: workStatusColor(row[workStatusField]),
|
|
3525
|
+
boxShadow: "0 0 0 3px white, 0 0 0 4px #E2E8F0"
|
|
3526
|
+
}
|
|
3527
|
+
)
|
|
3528
|
+
] }),
|
|
3529
|
+
/* @__PURE__ */ jsx18(Stack5, { gap: 1, children: detailFields.map((field) => /* @__PURE__ */ jsxs13(Flex8, { gap: 2, align: "baseline", justify: "space-between", children: [
|
|
3530
|
+
/* @__PURE__ */ jsx18(Text12, { fontSize: "10px", color: "gray.500", textTransform: "uppercase", letterSpacing: "0.03em", children: fieldLabel(field) }),
|
|
3531
|
+
/* @__PURE__ */ jsx18(Text12, { fontSize: "11px", color: "#46545C", fontWeight: "500", textAlign: "right", lineClamp: 1, children: formatCell(row[field.name], field.kind) })
|
|
3532
|
+
] }, field.name)) })
|
|
3533
|
+
]
|
|
3534
|
+
},
|
|
3535
|
+
ticketId(row) ?? index
|
|
3536
|
+
);
|
|
3537
|
+
}) })
|
|
3538
|
+
] }, stageId);
|
|
3539
|
+
})
|
|
3540
|
+
}
|
|
3541
|
+
),
|
|
3542
|
+
/* @__PURE__ */ jsx18(
|
|
3543
|
+
Button9,
|
|
3544
|
+
{
|
|
3545
|
+
type: "button",
|
|
3546
|
+
"aria-label": "Deslizar quadro para a esquerda",
|
|
3547
|
+
title: "Deslizar para a esquerda",
|
|
3548
|
+
position: "absolute",
|
|
3549
|
+
left: "8px",
|
|
3550
|
+
top: "50%",
|
|
3551
|
+
transform: "translateY(-50%)",
|
|
3552
|
+
zIndex: 3,
|
|
3553
|
+
minW: "34px",
|
|
3554
|
+
w: "34px",
|
|
3555
|
+
h: "34px",
|
|
3556
|
+
p: 0,
|
|
3557
|
+
borderRadius: "full",
|
|
3558
|
+
variant: "outline",
|
|
3559
|
+
bg: "rgba(255,255,255,.96)",
|
|
3560
|
+
borderColor: "#CBD5E1",
|
|
3561
|
+
boxShadow: "0 5px 16px rgba(15,23,42,.16)",
|
|
3562
|
+
disabled: !boardScrollState.canScrollLeft,
|
|
3563
|
+
onClick: () => scrollBoard("left"),
|
|
3564
|
+
_hover: { bg: "white", borderColor: "brand.400" },
|
|
3565
|
+
_disabled: { opacity: 0.25, cursor: "not-allowed" },
|
|
3566
|
+
children: /* @__PURE__ */ jsx18(PipelineArrowIcon, { direction: "left" })
|
|
3567
|
+
}
|
|
3568
|
+
),
|
|
3569
|
+
/* @__PURE__ */ jsx18(
|
|
3570
|
+
Button9,
|
|
3571
|
+
{
|
|
3572
|
+
type: "button",
|
|
3573
|
+
"aria-label": "Deslizar quadro para a direita",
|
|
3574
|
+
title: "Deslizar para a direita",
|
|
3575
|
+
position: "absolute",
|
|
3576
|
+
right: "8px",
|
|
3577
|
+
top: "50%",
|
|
3578
|
+
transform: "translateY(-50%)",
|
|
3579
|
+
zIndex: 3,
|
|
3580
|
+
minW: "34px",
|
|
3581
|
+
w: "34px",
|
|
3582
|
+
h: "34px",
|
|
3583
|
+
p: 0,
|
|
3584
|
+
borderRadius: "full",
|
|
3585
|
+
variant: "outline",
|
|
3586
|
+
bg: "rgba(255,255,255,.96)",
|
|
3587
|
+
borderColor: "#CBD5E1",
|
|
3588
|
+
boxShadow: "0 5px 16px rgba(15,23,42,.16)",
|
|
3589
|
+
disabled: !boardScrollState.canScrollRight,
|
|
3590
|
+
onClick: () => scrollBoard("right"),
|
|
3591
|
+
_hover: { bg: "white", borderColor: "brand.400" },
|
|
3592
|
+
_disabled: { opacity: 0.25, cursor: "not-allowed" },
|
|
3593
|
+
children: /* @__PURE__ */ jsx18(PipelineArrowIcon, { direction: "right" })
|
|
3594
|
+
}
|
|
3595
|
+
)
|
|
3596
|
+
] }),
|
|
3411
3597
|
selectedTicket && ticketModal && ticketModal.enabled !== false ? /* @__PURE__ */ jsx18(
|
|
3412
3598
|
CoreDetailModal,
|
|
3413
3599
|
{
|
|
@@ -3461,7 +3647,7 @@ function CorePipeline({
|
|
|
3461
3647
|
}
|
|
3462
3648
|
|
|
3463
3649
|
// src/components/CoreDashboard.tsx
|
|
3464
|
-
import { Box as
|
|
3650
|
+
import { Box as Box12, Heading as Heading6, SimpleGrid as SimpleGrid4, Stack as Stack6, Text as Text13 } from "@chakra-ui/react";
|
|
3465
3651
|
import { useQueries } from "@tanstack/react-query";
|
|
3466
3652
|
import { jsx as jsx19, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3467
3653
|
function CoreDashboard({ label = "Dashboard", widgets = [] }) {
|
|
@@ -3484,11 +3670,11 @@ function CoreDashboard({ label = "Dashboard", widgets = [] }) {
|
|
|
3484
3670
|
/* @__PURE__ */ jsx19(Heading6, { size: "lg", children: label }),
|
|
3485
3671
|
/* @__PURE__ */ jsx19(SimpleGrid4, { columns: { base: 1, md: 2, lg: 3 }, gap: 4, children: widgets.map((w) => {
|
|
3486
3672
|
if (w.kind === "custom" && w.render) {
|
|
3487
|
-
return /* @__PURE__ */ jsx19(
|
|
3673
|
+
return /* @__PURE__ */ jsx19(Box12, { borderWidth: "1px", borderColor: "gray.200", borderRadius: "md", bg: "white", p: 5, children: w.render() }, w.id);
|
|
3488
3674
|
}
|
|
3489
3675
|
const q = queries[queryIdx++];
|
|
3490
3676
|
const value = q?.isLoading ? "\u2026" : q?.isError ? "\u2014" : formatWidget(q?.data, w.kind, w.field);
|
|
3491
|
-
return /* @__PURE__ */ jsxs14(
|
|
3677
|
+
return /* @__PURE__ */ jsxs14(Box12, { borderWidth: "1px", borderColor: "gray.200", borderRadius: "md", bg: "white", p: 5, children: [
|
|
3492
3678
|
/* @__PURE__ */ jsx19(Text13, { fontSize: "sm", color: "gray.500", children: w.label }),
|
|
3493
3679
|
/* @__PURE__ */ jsx19(Heading6, { size: "xl", mt: 1, children: value })
|
|
3494
3680
|
] }, w.id);
|
|
@@ -3504,7 +3690,7 @@ function formatWidget(value, kind, field) {
|
|
|
3504
3690
|
}
|
|
3505
3691
|
|
|
3506
3692
|
// src/components/ui-v2/CorePage.tsx
|
|
3507
|
-
import { Box as
|
|
3693
|
+
import { Box as Box15, Heading as Heading8, Stack as Stack7, Text as Text16 } from "@chakra-ui/react";
|
|
3508
3694
|
|
|
3509
3695
|
// src/security/PermissionGate.tsx
|
|
3510
3696
|
import { Fragment as Fragment3, jsx as jsx20 } from "react/jsx-runtime";
|
|
@@ -3518,7 +3704,7 @@ function PermissionGate({
|
|
|
3518
3704
|
}
|
|
3519
3705
|
|
|
3520
3706
|
// src/app/componentRegistry.tsx
|
|
3521
|
-
import { Box as
|
|
3707
|
+
import { Box as Box13, Text as Text14 } from "@chakra-ui/react";
|
|
3522
3708
|
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3523
3709
|
var PREFIX_BUCKETS = {
|
|
3524
3710
|
"custom": "pageComponents",
|
|
@@ -3540,7 +3726,7 @@ function resolveComponent(registry, key, bucket) {
|
|
|
3540
3726
|
}
|
|
3541
3727
|
function MissingRenderer({ renderer, children }) {
|
|
3542
3728
|
if (import.meta.env?.MODE === "production") return /* @__PURE__ */ jsx21(Fragment4, { children: children ?? null });
|
|
3543
|
-
return /* @__PURE__ */ jsxs15(
|
|
3729
|
+
return /* @__PURE__ */ jsxs15(Box13, { borderWidth: "1px", borderStyle: "dashed", borderColor: "orange.300", bg: "orange.50", color: "orange.900", borderRadius: "md", p: 3, children: [
|
|
3544
3730
|
/* @__PURE__ */ jsx21(Text14, { fontSize: "sm", fontWeight: "600", children: "Renderer n\xE3o encontrado" }),
|
|
3545
3731
|
/* @__PURE__ */ jsxs15(Text14, { fontSize: "xs", children: [
|
|
3546
3732
|
"Registre a chave ",
|
|
@@ -3552,14 +3738,14 @@ function MissingRenderer({ renderer, children }) {
|
|
|
3552
3738
|
}
|
|
3553
3739
|
|
|
3554
3740
|
// src/components/ui-v2/CorePrimitives.tsx
|
|
3555
|
-
import { Box as
|
|
3741
|
+
import { Box as Box14, Button as Button10, Flex as Flex9, Heading as Heading7, Spinner as Spinner3, Text as Text15 } from "@chakra-ui/react";
|
|
3556
3742
|
import { jsx as jsx22, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3557
3743
|
function CorePage({ children }) {
|
|
3558
|
-
return /* @__PURE__ */ jsx22(
|
|
3744
|
+
return /* @__PURE__ */ jsx22(Box14, { children });
|
|
3559
3745
|
}
|
|
3560
3746
|
function CorePageHeader({ title, description, actions }) {
|
|
3561
3747
|
return /* @__PURE__ */ jsxs16(Flex9, { align: "start", justify: "space-between", gap: 4, mb: 6, children: [
|
|
3562
|
-
/* @__PURE__ */ jsxs16(
|
|
3748
|
+
/* @__PURE__ */ jsxs16(Box14, { children: [
|
|
3563
3749
|
title ? /* @__PURE__ */ jsx22(Heading7, { size: "lg", children: title }) : null,
|
|
3564
3750
|
description ? /* @__PURE__ */ jsx22(Text15, { color: "gray.600", mt: 1, children: description }) : null
|
|
3565
3751
|
] }),
|
|
@@ -3576,10 +3762,10 @@ function CoreCards(props) {
|
|
|
3576
3762
|
return /* @__PURE__ */ jsx22(CoreCollection, { model: props.model, mode: "minimal", label: props.model });
|
|
3577
3763
|
}
|
|
3578
3764
|
function CoreForm(props) {
|
|
3579
|
-
return /* @__PURE__ */ jsx22(
|
|
3765
|
+
return /* @__PURE__ */ jsx22(Box14, { children: props.children });
|
|
3580
3766
|
}
|
|
3581
3767
|
function CoreField({ label, children }) {
|
|
3582
|
-
return /* @__PURE__ */ jsxs16(
|
|
3768
|
+
return /* @__PURE__ */ jsxs16(Box14, { children: [
|
|
3583
3769
|
/* @__PURE__ */ jsx22(Text15, { fontSize: "sm", fontWeight: "600", children: label }),
|
|
3584
3770
|
children
|
|
3585
3771
|
] });
|
|
@@ -3591,7 +3777,7 @@ function CoreActions({ children }) {
|
|
|
3591
3777
|
return /* @__PURE__ */ jsx22(Flex9, { gap: 2, children });
|
|
3592
3778
|
}
|
|
3593
3779
|
function CoreEmptyState({ title = "Nenhum dado encontrado", actionLabel, onAction }) {
|
|
3594
|
-
return /* @__PURE__ */ jsxs16(
|
|
3780
|
+
return /* @__PURE__ */ jsxs16(Box14, { textAlign: "center", py: 10, children: [
|
|
3595
3781
|
/* @__PURE__ */ jsx22(Text15, { children: title }),
|
|
3596
3782
|
actionLabel ? /* @__PURE__ */ jsx22(Button10, { mt: 3, onClick: onAction, children: actionLabel }) : null
|
|
3597
3783
|
] });
|
|
@@ -3627,7 +3813,7 @@ function CoreBlock({ block, registry }) {
|
|
|
3627
3813
|
return Component ? /* @__PURE__ */ jsx23(Component, { block, model: block.model }) : /* @__PURE__ */ jsx23(CoreCards, { model: block.model, renderer: block.renderer });
|
|
3628
3814
|
}
|
|
3629
3815
|
case "section":
|
|
3630
|
-
return /* @__PURE__ */ jsxs17(
|
|
3816
|
+
return /* @__PURE__ */ jsxs17(Box15, { children: [
|
|
3631
3817
|
/* @__PURE__ */ jsx23(Heading8, { size: "md", mb: block.description ? 1 : 4, children: block.title }),
|
|
3632
3818
|
block.description ? /* @__PURE__ */ jsx23(Text16, { color: "gray.600", mb: 4, children: block.description }) : null,
|
|
3633
3819
|
/* @__PURE__ */ jsx23(Stack7, { gap: 4, children: block.blocks?.map((child, index) => /* @__PURE__ */ jsx23(CoreBlock, { block: child, registry }, child.id ?? index)) })
|
|
@@ -3798,11 +3984,11 @@ import {
|
|
|
3798
3984
|
} from "react-router-dom";
|
|
3799
3985
|
|
|
3800
3986
|
// src/shell/DefaultShell.tsx
|
|
3801
|
-
import { Box as
|
|
3987
|
+
import { Box as Box17, Button as Button11, Flex as Flex11, Spacer as Spacer2, Text as Text18 } from "@chakra-ui/react";
|
|
3802
3988
|
import { Outlet } from "react-router-dom";
|
|
3803
3989
|
|
|
3804
3990
|
// src/shell/Sidebar.tsx
|
|
3805
|
-
import { Box as
|
|
3991
|
+
import { Box as Box16, Flex as Flex10, Image, Stack as Stack8, Text as Text17 } from "@chakra-ui/react";
|
|
3806
3992
|
import { NavLink } from "react-router-dom";
|
|
3807
3993
|
import { jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3808
3994
|
function groupBySection(items) {
|
|
@@ -3818,7 +4004,7 @@ function Sidebar({ app, menu, registry }) {
|
|
|
3818
4004
|
const { hasPermission } = useOonAuth();
|
|
3819
4005
|
const visible = menu.filter((item) => !item.hidden && hasPermission(item.permissions));
|
|
3820
4006
|
return /* @__PURE__ */ jsxs18(
|
|
3821
|
-
|
|
4007
|
+
Box16,
|
|
3822
4008
|
{
|
|
3823
4009
|
as: "nav",
|
|
3824
4010
|
w: { base: "76px", lg: "248px" },
|
|
@@ -3850,7 +4036,7 @@ function Sidebar({ app, menu, registry }) {
|
|
|
3850
4036
|
children: "O"
|
|
3851
4037
|
}
|
|
3852
4038
|
),
|
|
3853
|
-
/* @__PURE__ */ jsxs18(
|
|
4039
|
+
/* @__PURE__ */ jsxs18(Box16, { display: { base: "none", lg: "block" }, minW: 0, children: [
|
|
3854
4040
|
/* @__PURE__ */ jsx25(Text17, { fontWeight: "700", fontSize: "sm", color: "#07262E", lineClamp: 1, children: app.name }),
|
|
3855
4041
|
/* @__PURE__ */ jsx25(Text17, { fontSize: "10px", color: "gray.500", textTransform: "uppercase", letterSpacing: "0.08em", children: "Opera\xE7\xE3o digital" })
|
|
3856
4042
|
] })
|
|
@@ -3891,7 +4077,7 @@ function Sidebar({ app, menu, registry }) {
|
|
|
3891
4077
|
transition: "all 0.15s ease",
|
|
3892
4078
|
_hover: { bg: isActive ? "brand.50" : "#F8F9FA", color: "brand.700" },
|
|
3893
4079
|
children: [
|
|
3894
|
-
item.icon ? /* @__PURE__ */ jsx25(
|
|
4080
|
+
item.icon ? /* @__PURE__ */ jsx25(Box16, { flex: "0 0 auto", children: item.icon }) : /* @__PURE__ */ jsx25(Box16, { w: "7px", h: "7px", borderRadius: "full", bg: isActive ? "brand.500" : "gray.300" }),
|
|
3895
4081
|
/* @__PURE__ */ jsx25(Text17, { display: { base: "none", lg: "block" }, lineClamp: 1, children: item.label })
|
|
3896
4082
|
]
|
|
3897
4083
|
}
|
|
@@ -3908,13 +4094,13 @@ import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
|
3908
4094
|
function CoreTopbar({ app }) {
|
|
3909
4095
|
const { user, logout } = useOonAuth();
|
|
3910
4096
|
return /* @__PURE__ */ jsxs19(Flex11, { as: "header", align: "center", minH: "64px", px: { base: 4, lg: 6 }, py: 3, borderBottomWidth: "1px", borderColor: "#E8ECEF", bg: "rgba(255, 255, 255, 0.96)", backdropFilter: "blur(10px)", position: "sticky", top: 0, zIndex: 10, children: [
|
|
3911
|
-
/* @__PURE__ */ jsxs19(
|
|
4097
|
+
/* @__PURE__ */ jsxs19(Box17, { children: [
|
|
3912
4098
|
/* @__PURE__ */ jsx26(Text18, { fontSize: "xs", fontWeight: "600", color: "brand.500", textTransform: "uppercase", letterSpacing: "0.08em", children: "Central Oon" }),
|
|
3913
4099
|
/* @__PURE__ */ jsx26(Text18, { fontSize: "sm", fontWeight: "600", color: "#24323A", children: app.title ?? app.name })
|
|
3914
4100
|
] }),
|
|
3915
4101
|
/* @__PURE__ */ jsx26(Spacer2, {}),
|
|
3916
4102
|
user ? /* @__PURE__ */ jsxs19(Flex11, { align: "center", gap: 3, children: [
|
|
3917
|
-
/* @__PURE__ */ jsxs19(
|
|
4103
|
+
/* @__PURE__ */ jsxs19(Box17, { textAlign: "right", display: { base: "none", md: "block" }, children: [
|
|
3918
4104
|
/* @__PURE__ */ jsx26(Text18, { fontSize: "sm", fontWeight: "600", color: "#24323A", children: user.nome }),
|
|
3919
4105
|
user.email ? /* @__PURE__ */ jsx26(Text18, { fontSize: "xs", color: "gray.500", children: user.email }) : null
|
|
3920
4106
|
] }),
|
|
@@ -3930,7 +4116,7 @@ function Slot({ name, slot, registry, app, menu }) {
|
|
|
3930
4116
|
}
|
|
3931
4117
|
if (name === "sidebar") return /* @__PURE__ */ jsx26(Sidebar, { app, menu, registry });
|
|
3932
4118
|
if (name === "topbar") return /* @__PURE__ */ jsx26(CoreTopbar, { app });
|
|
3933
|
-
if (name === "footer" && slot === "core") return /* @__PURE__ */ jsx26(
|
|
4119
|
+
if (name === "footer" && slot === "core") return /* @__PURE__ */ jsx26(Box17, { as: "footer", px: 6, py: 4, color: "gray.500", fontSize: "xs", borderTopWidth: "1px", children: "OonCore" });
|
|
3934
4120
|
return null;
|
|
3935
4121
|
}
|
|
3936
4122
|
function DefaultShell({ app, menu, layout, registry }) {
|
|
@@ -3941,7 +4127,7 @@ function DefaultShell({ app, menu, layout, registry }) {
|
|
|
3941
4127
|
/* @__PURE__ */ jsxs19(Flex11, { direction: "column", flex: "1", minW: 0, children: [
|
|
3942
4128
|
/* @__PURE__ */ jsx26(Slot, { name: "topbar", slot: layout?.topbar ?? "core", registry, app, menu }),
|
|
3943
4129
|
/* @__PURE__ */ jsx26(Slot, { name: "header", slot: layout?.header, registry, app, menu }),
|
|
3944
|
-
/* @__PURE__ */ jsx26(
|
|
4130
|
+
/* @__PURE__ */ jsx26(Box17, { as: "main", flex: "1", p: mainPadding, minW: 0, children: /* @__PURE__ */ jsx26(Box17, { maxW: portal ? "1180px" : "1680px", mx: "auto", children: /* @__PURE__ */ jsx26(Outlet, {}) }) }),
|
|
3945
4131
|
/* @__PURE__ */ jsx26(Slot, { name: "footer", slot: layout?.footer ?? "none", registry, app, menu })
|
|
3946
4132
|
] })
|
|
3947
4133
|
] });
|
|
@@ -3962,7 +4148,7 @@ function AuthenticatedLayout({ app, menu, layout, registry }) {
|
|
|
3962
4148
|
}
|
|
3963
4149
|
|
|
3964
4150
|
// src/security/AccessDeniedPage.tsx
|
|
3965
|
-
import { Box as
|
|
4151
|
+
import { Box as Box18, Button as Button12, Flex as Flex12, Heading as Heading9, Text as Text19, VStack } from "@chakra-ui/react";
|
|
3966
4152
|
import { useNavigate } from "react-router-dom";
|
|
3967
4153
|
import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3968
4154
|
function AccessDeniedPage({ app }) {
|
|
@@ -3973,7 +4159,7 @@ function AccessDeniedPage({ app }) {
|
|
|
3973
4159
|
navigate("/login", { replace: true });
|
|
3974
4160
|
}
|
|
3975
4161
|
return /* @__PURE__ */ jsx28(Flex12, { minH: "100vh", align: "center", justify: "center", bg: "#F5F8FA", px: 4, children: /* @__PURE__ */ jsx28(
|
|
3976
|
-
|
|
4162
|
+
Box18,
|
|
3977
4163
|
{
|
|
3978
4164
|
width: "100%",
|
|
3979
4165
|
maxW: "560px",
|
|
@@ -3985,7 +4171,7 @@ function AccessDeniedPage({ app }) {
|
|
|
3985
4171
|
p: { base: 6, md: 10 },
|
|
3986
4172
|
children: /* @__PURE__ */ jsxs20(VStack, { align: "stretch", gap: 6, children: [
|
|
3987
4173
|
/* @__PURE__ */ jsx28(
|
|
3988
|
-
|
|
4174
|
+
Box18,
|
|
3989
4175
|
{
|
|
3990
4176
|
width: "56px",
|
|
3991
4177
|
height: "56px",
|
|
@@ -4001,7 +4187,7 @@ function AccessDeniedPage({ app }) {
|
|
|
4001
4187
|
children: "!"
|
|
4002
4188
|
}
|
|
4003
4189
|
),
|
|
4004
|
-
/* @__PURE__ */ jsxs20(
|
|
4190
|
+
/* @__PURE__ */ jsxs20(Box18, { children: [
|
|
4005
4191
|
/* @__PURE__ */ jsx28(
|
|
4006
4192
|
Text19,
|
|
4007
4193
|
{
|
|
@@ -4077,7 +4263,7 @@ function AppAccessGuard({ children }) {
|
|
|
4077
4263
|
// src/security/LoginPage.tsx
|
|
4078
4264
|
import { useState as useState12 } from "react";
|
|
4079
4265
|
import {
|
|
4080
|
-
Box as
|
|
4266
|
+
Box as Box19,
|
|
4081
4267
|
Button as Button13,
|
|
4082
4268
|
Flex as Flex13,
|
|
4083
4269
|
Heading as Heading10,
|
|
@@ -4126,7 +4312,7 @@ function LoginPage({ app }) {
|
|
|
4126
4312
|
}
|
|
4127
4313
|
}
|
|
4128
4314
|
return /* @__PURE__ */ jsx30(Flex13, { minH: "100vh", align: "center", justify: "center", bg: "#F5F8FA", px: 4, children: /* @__PURE__ */ jsx30(
|
|
4129
|
-
|
|
4315
|
+
Box19,
|
|
4130
4316
|
{
|
|
4131
4317
|
width: "100%",
|
|
4132
4318
|
maxW: "440px",
|
|
@@ -4137,7 +4323,7 @@ function LoginPage({ app }) {
|
|
|
4137
4323
|
boxShadow: "0 24px 70px rgba(7, 38, 46, 0.10)",
|
|
4138
4324
|
p: { base: 6, md: 9 },
|
|
4139
4325
|
children: /* @__PURE__ */ jsx30("form", { onSubmit: handleSubmit, children: /* @__PURE__ */ jsxs21(VStack2, { align: "stretch", gap: 6, children: [
|
|
4140
|
-
/* @__PURE__ */ jsxs21(
|
|
4326
|
+
/* @__PURE__ */ jsxs21(Box19, { children: [
|
|
4141
4327
|
/* @__PURE__ */ jsx30(
|
|
4142
4328
|
Text20,
|
|
4143
4329
|
{
|
|
@@ -4153,7 +4339,7 @@ function LoginPage({ app }) {
|
|
|
4153
4339
|
/* @__PURE__ */ jsx30(Text20, { mt: 2, color: "gray.600", fontSize: "sm", children: "Entre com seu usu\xE1rio autorizado para acessar este aplicativo." })
|
|
4154
4340
|
] }),
|
|
4155
4341
|
/* @__PURE__ */ jsxs21(VStack2, { align: "stretch", gap: 4, children: [
|
|
4156
|
-
/* @__PURE__ */ jsxs21(
|
|
4342
|
+
/* @__PURE__ */ jsxs21(Box19, { children: [
|
|
4157
4343
|
/* @__PURE__ */ jsx30(Text20, { mb: 2, fontSize: "sm", fontWeight: "600", color: "#24323A", children: "E-mail" }),
|
|
4158
4344
|
/* @__PURE__ */ jsx30(
|
|
4159
4345
|
Input7,
|
|
@@ -4167,7 +4353,7 @@ function LoginPage({ app }) {
|
|
|
4167
4353
|
}
|
|
4168
4354
|
)
|
|
4169
4355
|
] }),
|
|
4170
|
-
/* @__PURE__ */ jsxs21(
|
|
4356
|
+
/* @__PURE__ */ jsxs21(Box19, { children: [
|
|
4171
4357
|
/* @__PURE__ */ jsx30(Text20, { mb: 2, fontSize: "sm", fontWeight: "600", color: "#24323A", children: "Senha" }),
|
|
4172
4358
|
/* @__PURE__ */ jsx30(
|
|
4173
4359
|
Input7,
|
|
@@ -4183,7 +4369,7 @@ function LoginPage({ app }) {
|
|
|
4183
4369
|
] })
|
|
4184
4370
|
] }),
|
|
4185
4371
|
message ? /* @__PURE__ */ jsx30(
|
|
4186
|
-
|
|
4372
|
+
Box19,
|
|
4187
4373
|
{
|
|
4188
4374
|
role: "alert",
|
|
4189
4375
|
borderRadius: "10px",
|
|
@@ -4212,8 +4398,8 @@ function LoginPage({ app }) {
|
|
|
4212
4398
|
}
|
|
4213
4399
|
|
|
4214
4400
|
// src/security/ActivationPage.tsx
|
|
4215
|
-
import { useEffect as
|
|
4216
|
-
import { Box as
|
|
4401
|
+
import { useEffect as useEffect8, useState as useState13 } from "react";
|
|
4402
|
+
import { Box as Box20, Button as Button14, Heading as Heading11, Input as Input8, Text as Text21, VStack as VStack3 } from "@chakra-ui/react";
|
|
4217
4403
|
import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4218
4404
|
function encodeBasicCredentials2(email, password) {
|
|
4219
4405
|
const bytes = new TextEncoder().encode(`${email}:${password}`);
|
|
@@ -4239,7 +4425,7 @@ function ActivationPage() {
|
|
|
4239
4425
|
const [devResult, setDevResult] = useState13(null);
|
|
4240
4426
|
const [error, setError] = useState13(null);
|
|
4241
4427
|
const [submitting, setSubmitting] = useState13(false);
|
|
4242
|
-
|
|
4428
|
+
useEffect8(() => {
|
|
4243
4429
|
http.get("/ativacao/configuracao").then((response) => {
|
|
4244
4430
|
setConfig(response.data);
|
|
4245
4431
|
setGlobal(response.data.defaults || {});
|
|
@@ -4247,7 +4433,7 @@ function ActivationPage() {
|
|
|
4247
4433
|
() => setError("N\xE3o foi poss\xEDvel carregar a configura\xE7\xE3o de ativa\xE7\xE3o.")
|
|
4248
4434
|
);
|
|
4249
4435
|
}, [http]);
|
|
4250
|
-
|
|
4436
|
+
useEffect8(() => {
|
|
4251
4437
|
if (activation.status === "active") {
|
|
4252
4438
|
window.location.replace("/login");
|
|
4253
4439
|
}
|
|
@@ -4348,7 +4534,7 @@ function ActivationPage() {
|
|
|
4348
4534
|
}
|
|
4349
4535
|
}
|
|
4350
4536
|
function renderField(field, values, setValues) {
|
|
4351
|
-
return /* @__PURE__ */ jsxs22(
|
|
4537
|
+
return /* @__PURE__ */ jsxs22(Box20, { w: "100%", children: [
|
|
4352
4538
|
/* @__PURE__ */ jsxs22(Text21, { fontWeight: "medium", children: [
|
|
4353
4539
|
field.label,
|
|
4354
4540
|
field.required ? " *" : ""
|
|
@@ -4371,7 +4557,7 @@ function ActivationPage() {
|
|
|
4371
4557
|
function renderDevLocalActivation() {
|
|
4372
4558
|
return /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
4373
4559
|
/* @__PURE__ */ jsx31(Text21, { color: "gray.700", children: "Entre com seu e-mail e senha para ativar esta Central em ambiente de desenvolvimento. Se o e-mail ainda n\xE3o existir na Central de Ativa\xE7\xF5es, o usu\xE1rio ser\xE1 criado automaticamente com perfil de desenvolvedor." }),
|
|
4374
|
-
/* @__PURE__ */ jsxs22(
|
|
4560
|
+
/* @__PURE__ */ jsxs22(Box20, { w: "100%", children: [
|
|
4375
4561
|
/* @__PURE__ */ jsx31(Text21, { fontWeight: "medium", children: "Nome do usu\xE1rio" }),
|
|
4376
4562
|
/* @__PURE__ */ jsx31(
|
|
4377
4563
|
Input8,
|
|
@@ -4383,7 +4569,7 @@ function ActivationPage() {
|
|
|
4383
4569
|
}
|
|
4384
4570
|
)
|
|
4385
4571
|
] }),
|
|
4386
|
-
/* @__PURE__ */ jsxs22(
|
|
4572
|
+
/* @__PURE__ */ jsxs22(Box20, { w: "100%", children: [
|
|
4387
4573
|
/* @__PURE__ */ jsx31(Text21, { fontWeight: "medium", children: "E-mail *" }),
|
|
4388
4574
|
/* @__PURE__ */ jsx31(
|
|
4389
4575
|
Input8,
|
|
@@ -4396,7 +4582,7 @@ function ActivationPage() {
|
|
|
4396
4582
|
}
|
|
4397
4583
|
)
|
|
4398
4584
|
] }),
|
|
4399
|
-
/* @__PURE__ */ jsxs22(
|
|
4585
|
+
/* @__PURE__ */ jsxs22(Box20, { w: "100%", children: [
|
|
4400
4586
|
/* @__PURE__ */ jsx31(Text21, { fontWeight: "medium", children: "Senha *" }),
|
|
4401
4587
|
/* @__PURE__ */ jsx31(
|
|
4402
4588
|
Input8,
|
|
@@ -4434,7 +4620,7 @@ function ActivationPage() {
|
|
|
4434
4620
|
const rootMode = config?.mode === "root-bootstrap" || activation.details?.role === "root";
|
|
4435
4621
|
const isDevelopmentMember = !rootMode && config?.technical?.ambiente === "desenvolvimento";
|
|
4436
4622
|
if (activation.status === "loading" || !config) {
|
|
4437
|
-
return /* @__PURE__ */ jsx31(
|
|
4623
|
+
return /* @__PURE__ */ jsx31(Box20, { minH: "100vh", bg: "gray.50", p: 8, children: /* @__PURE__ */ jsxs22(
|
|
4438
4624
|
VStack3,
|
|
4439
4625
|
{
|
|
4440
4626
|
maxW: "760px",
|
|
@@ -4452,7 +4638,7 @@ function ActivationPage() {
|
|
|
4452
4638
|
) });
|
|
4453
4639
|
}
|
|
4454
4640
|
if (rootMode) {
|
|
4455
|
-
return /* @__PURE__ */ jsx31(
|
|
4641
|
+
return /* @__PURE__ */ jsx31(Box20, { minH: "100vh", bg: "gray.50", p: 8, children: /* @__PURE__ */ jsxs22(
|
|
4456
4642
|
VStack3,
|
|
4457
4643
|
{
|
|
4458
4644
|
maxW: "560px",
|
|
@@ -4474,7 +4660,7 @@ function ActivationPage() {
|
|
|
4474
4660
|
] }),
|
|
4475
4661
|
error ? /* @__PURE__ */ jsx31(Text21, { color: "red.600", children: error }) : null,
|
|
4476
4662
|
step !== 6 ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
4477
|
-
/* @__PURE__ */ jsxs22(
|
|
4663
|
+
/* @__PURE__ */ jsxs22(Box20, { w: "100%", children: [
|
|
4478
4664
|
/* @__PURE__ */ jsx31(Text21, { fontWeight: "medium", children: "E-mail do administrador *" }),
|
|
4479
4665
|
/* @__PURE__ */ jsx31(
|
|
4480
4666
|
Input8,
|
|
@@ -4487,7 +4673,7 @@ function ActivationPage() {
|
|
|
4487
4673
|
}
|
|
4488
4674
|
)
|
|
4489
4675
|
] }),
|
|
4490
|
-
/* @__PURE__ */ jsxs22(
|
|
4676
|
+
/* @__PURE__ */ jsxs22(Box20, { w: "100%", children: [
|
|
4491
4677
|
/* @__PURE__ */ jsx31(Text21, { fontWeight: "medium", children: "Senha *" }),
|
|
4492
4678
|
/* @__PURE__ */ jsx31(
|
|
4493
4679
|
Input8,
|
|
@@ -4519,7 +4705,7 @@ function ActivationPage() {
|
|
|
4519
4705
|
}
|
|
4520
4706
|
) });
|
|
4521
4707
|
}
|
|
4522
|
-
return /* @__PURE__ */ jsx31(
|
|
4708
|
+
return /* @__PURE__ */ jsx31(Box20, { minH: "100vh", bg: "gray.50", p: 8, children: /* @__PURE__ */ jsxs22(
|
|
4523
4709
|
VStack3,
|
|
4524
4710
|
{
|
|
4525
4711
|
maxW: "760px",
|
|
@@ -4618,7 +4804,7 @@ function InstanceBlockedPage({
|
|
|
4618
4804
|
title,
|
|
4619
4805
|
message
|
|
4620
4806
|
}) {
|
|
4621
|
-
return /* @__PURE__ */ jsxs22(
|
|
4807
|
+
return /* @__PURE__ */ jsxs22(Box20, { p: 8, children: [
|
|
4622
4808
|
/* @__PURE__ */ jsx31(Heading11, { children: title }),
|
|
4623
4809
|
/* @__PURE__ */ jsx31(Text21, { children: message })
|
|
4624
4810
|
] });
|
|
@@ -4932,7 +5118,7 @@ function defineOonModule(mod) {
|
|
|
4932
5118
|
}
|
|
4933
5119
|
|
|
4934
5120
|
// src/components/CoreIntegration.tsx
|
|
4935
|
-
import { Badge as Badge5, Box as
|
|
5121
|
+
import { Badge as Badge5, Box as Box21, Button as Button15, Flex as Flex14, Heading as Heading12, Stack as Stack9, Text as Text22 } from "@chakra-ui/react";
|
|
4936
5122
|
import { useMutation as useMutation4 } from "@tanstack/react-query";
|
|
4937
5123
|
import { jsx as jsx37, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4938
5124
|
function CoreIntegration({ label = "Integra\xE7\xF5es" }) {
|
|
@@ -4950,7 +5136,7 @@ function CoreIntegration({ label = "Integra\xE7\xF5es" }) {
|
|
|
4950
5136
|
/* @__PURE__ */ jsx37(Button15, { size: "sm", variant: "outline", loading: reprocess.isPending, onClick: () => reprocess.mutate(), children: "Reprocessar ativos" })
|
|
4951
5137
|
] }),
|
|
4952
5138
|
/* @__PURE__ */ jsx37(Stack9, { gap: 3, children: integrations.length === 0 ? /* @__PURE__ */ jsx37(Text22, { color: "gray.400", children: "Nenhuma integra\xE7\xE3o declarada." }) : integrations.map((it, idx) => /* @__PURE__ */ jsx37(
|
|
4953
|
-
|
|
5139
|
+
Box21,
|
|
4954
5140
|
{
|
|
4955
5141
|
borderWidth: "1px",
|
|
4956
5142
|
borderColor: "gray.200",
|
|
@@ -4990,7 +5176,7 @@ function CoreCurrency({ model = "Moeda", label = "Multi-moedas", endpoint = "/mo
|
|
|
4990
5176
|
|
|
4991
5177
|
// src/components/CoreAssistant.tsx
|
|
4992
5178
|
import { useState as useState14 } from "react";
|
|
4993
|
-
import { Box as
|
|
5179
|
+
import { Box as Box22, Button as Button17, Flex as Flex16, Heading as Heading14, Input as Input9, Stack as Stack11, Text as Text24 } from "@chakra-ui/react";
|
|
4994
5180
|
import { useMutation as useMutation6 } from "@tanstack/react-query";
|
|
4995
5181
|
import { jsx as jsx39, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4996
5182
|
function CoreAssistant({ assistantCode, label = "Assistente", entity, endpoint = "/assistant-runs" }) {
|
|
@@ -5023,9 +5209,9 @@ function CoreAssistant({ assistantCode, label = "Assistente", entity, endpoint =
|
|
|
5023
5209
|
};
|
|
5024
5210
|
return /* @__PURE__ */ jsxs25(Stack11, { gap: 4, maxW: "560px", children: [
|
|
5025
5211
|
/* @__PURE__ */ jsx39(Heading14, { size: "md", children: label }),
|
|
5026
|
-
/* @__PURE__ */ jsx39(
|
|
5212
|
+
/* @__PURE__ */ jsx39(Box22, { borderWidth: "1px", borderColor: "gray.200", borderRadius: "md", bg: "white", p: 4, minH: "240px", children: /* @__PURE__ */ jsxs25(Stack11, { gap: 3, children: [
|
|
5027
5213
|
messages.length === 0 ? /* @__PURE__ */ jsx39(Text24, { color: "gray.400", fontSize: "sm", children: "Fa\xE7a uma pergunta ao assistente." }) : messages.map((m, idx) => /* @__PURE__ */ jsx39(Flex16, { justify: m.role === "user" ? "flex-end" : "flex-start", children: /* @__PURE__ */ jsx39(
|
|
5028
|
-
|
|
5214
|
+
Box22,
|
|
5029
5215
|
{
|
|
5030
5216
|
bg: m.role === "user" ? "brand.500" : "gray.100",
|
|
5031
5217
|
color: m.role === "user" ? "white" : "gray.800",
|