@oondemand/oon-core-front 0.7.34 → 0.7.36
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/{chunk-GIDNQRK6.js → chunk-4J7L5PIO.js} +68 -24
- package/dist/chunk-4J7L5PIO.js.map +1 -0
- package/dist/{chunk-B4QFRGOK.js → chunk-74ATSPSO.js} +24 -24
- package/dist/chunk-74ATSPSO.js.map +1 -0
- package/dist/{chunk-ALZCHGGI.js → chunk-H4RCPPT3.js} +2 -2
- package/dist/chunk-H4RCPPT3.js.map +1 -0
- package/dist/{chunk-32GGDIWB.js → chunk-HS3Q4SCM.js} +2 -2
- package/dist/{chunk-VC6NTMZS.js → chunk-O4M3YJRY.js} +23 -20
- package/dist/chunk-O4M3YJRY.js.map +1 -0
- package/dist/{chunk-WZD4ACMX.js → chunk-RUE7ZDZS.js} +2 -2
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -6
- package/dist/routing.js +2 -2
- package/dist/testing.js +5 -5
- package/dist/theme.js +1 -1
- package/dist/{ui-D1u6ze-h.d.ts → ui-BBEP4aNZ.d.ts} +5 -0
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-ALZCHGGI.js.map +0 -1
- package/dist/chunk-B4QFRGOK.js.map +0 -1
- package/dist/chunk-GIDNQRK6.js.map +0 -1
- package/dist/chunk-VC6NTMZS.js.map +0 -1
- /package/dist/{chunk-32GGDIWB.js.map → chunk-HS3Q4SCM.js.map} +0 -0
- /package/dist/{chunk-WZD4ACMX.js.map → chunk-RUE7ZDZS.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LoadingScreen
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H4RCPPT3.js";
|
|
4
4
|
import {
|
|
5
5
|
useModelSchema,
|
|
6
6
|
useOonApi,
|
|
@@ -4167,6 +4167,7 @@ function CoreUsersAccess() {
|
|
|
4167
4167
|
|
|
4168
4168
|
// src/components/ui-v2/CorePrimitives.tsx
|
|
4169
4169
|
import { Badge as Badge5, Box as Box16, Button as Button11, Flex as Flex10, Heading as Heading9, SimpleGrid as SimpleGrid6, Spinner as Spinner3, Stack as Stack8, Text as Text17 } from "@chakra-ui/react";
|
|
4170
|
+
import { useId, useRef as useRef5, useState as useState12 } from "react";
|
|
4170
4171
|
import { jsx as jsx20, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
4171
4172
|
function CorePage({ children }) {
|
|
4172
4173
|
return /* @__PURE__ */ jsx20(Box16, { color: "text.primary", children });
|
|
@@ -4224,11 +4225,54 @@ function CoreErrorState({ title = "N\xE3o foi poss\xEDvel carregar", description
|
|
|
4224
4225
|
] });
|
|
4225
4226
|
}
|
|
4226
4227
|
function CoreTabs({ items, value: value2, onChange }) {
|
|
4227
|
-
const
|
|
4228
|
+
const baseId = useId();
|
|
4229
|
+
const tabRefs = useRef5([]);
|
|
4230
|
+
const [internal, setInternal] = useState12(items[0]?.id);
|
|
4231
|
+
const active = value2 ?? (items.some((item) => item.id === internal) ? internal : items[0]?.id);
|
|
4228
4232
|
const selected = items.find((item) => item.id === active);
|
|
4233
|
+
const select = (id) => {
|
|
4234
|
+
if (value2 === void 0) setInternal(id);
|
|
4235
|
+
onChange?.(id);
|
|
4236
|
+
};
|
|
4237
|
+
const onKeyDown = (event, index) => {
|
|
4238
|
+
const last = items.length - 1;
|
|
4239
|
+
const target = event.key === "ArrowRight" ? index === last ? 0 : index + 1 : event.key === "ArrowLeft" ? index === 0 ? last : index - 1 : event.key === "Home" ? 0 : event.key === "End" ? last : -1;
|
|
4240
|
+
if (target < 0) return;
|
|
4241
|
+
event.preventDefault();
|
|
4242
|
+
select(items[target].id);
|
|
4243
|
+
tabRefs.current[target]?.focus();
|
|
4244
|
+
};
|
|
4229
4245
|
return /* @__PURE__ */ jsxs17(Box16, { children: [
|
|
4230
|
-
/* @__PURE__ */ jsx20(Flex10, { gap:
|
|
4231
|
-
|
|
4246
|
+
/* @__PURE__ */ jsx20(Flex10, { role: "tablist", gap: 1, borderBottomWidth: "1px", borderColor: "border.default", mb: 4, overflowX: "auto", children: items.map((item, index) => {
|
|
4247
|
+
const isActive = item.id === active;
|
|
4248
|
+
return /* @__PURE__ */ jsx20(
|
|
4249
|
+
Button11,
|
|
4250
|
+
{
|
|
4251
|
+
ref: (el) => {
|
|
4252
|
+
tabRefs.current[index] = el;
|
|
4253
|
+
},
|
|
4254
|
+
id: `${baseId}-tab-${item.id}`,
|
|
4255
|
+
role: "tab",
|
|
4256
|
+
"aria-selected": isActive,
|
|
4257
|
+
"aria-controls": `${baseId}-panel-${item.id}`,
|
|
4258
|
+
tabIndex: isActive ? 0 : -1,
|
|
4259
|
+
variant: "ghost",
|
|
4260
|
+
borderRadius: "0",
|
|
4261
|
+
mb: "-1px",
|
|
4262
|
+
borderBottomWidth: "2px",
|
|
4263
|
+
borderColor: "transparent",
|
|
4264
|
+
borderBottomColor: isActive ? "brand.solid" : "transparent",
|
|
4265
|
+
color: isActive ? "text.primary" : "text.muted",
|
|
4266
|
+
fontWeight: isActive ? "600" : "500",
|
|
4267
|
+
_hover: { bg: "surface.hover", color: "text.primary" },
|
|
4268
|
+
onClick: () => select(item.id),
|
|
4269
|
+
onKeyDown: (event) => onKeyDown(event, index),
|
|
4270
|
+
children: item.label
|
|
4271
|
+
},
|
|
4272
|
+
item.id
|
|
4273
|
+
);
|
|
4274
|
+
}) }),
|
|
4275
|
+
selected ? /* @__PURE__ */ jsx20(Box16, { role: "tabpanel", id: `${baseId}-panel-${selected.id}`, "aria-labelledby": `${baseId}-tab-${selected.id}`, color: "text.primary", children: selected.content }) : null
|
|
4232
4276
|
] });
|
|
4233
4277
|
}
|
|
4234
4278
|
function CoreSummaryCards2({ items }) {
|
|
@@ -4406,7 +4450,7 @@ function CorePage2({ page, registry }) {
|
|
|
4406
4450
|
}
|
|
4407
4451
|
|
|
4408
4452
|
// src/components/CoreTransactionalEmail.tsx
|
|
4409
|
-
import { useEffect as useEffect7, useMemo as useMemo9, useState as
|
|
4453
|
+
import { useEffect as useEffect7, useMemo as useMemo9, useState as useState13 } from "react";
|
|
4410
4454
|
import { Badge as Badge6, Box as Box19, Button as Button13, Flex as Flex12, Heading as Heading11, IconButton as IconButton3, Input as Input8, Stack as Stack10, Text as Text20, Textarea as Textarea3 } from "@chakra-ui/react";
|
|
4411
4455
|
import { useMutation as useMutation5, useQuery as useQuery11, useQueryClient as useQueryClient6 } from "@tanstack/react-query";
|
|
4412
4456
|
import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
@@ -4455,26 +4499,26 @@ function parseObject(source, message) {
|
|
|
4455
4499
|
function CoreTransactionalEmail() {
|
|
4456
4500
|
const { http } = useOonApi();
|
|
4457
4501
|
const cache = useQueryClient6();
|
|
4458
|
-
const [tab, setTab] =
|
|
4459
|
-
const [error, setError] =
|
|
4460
|
-
const [notice, setNotice] =
|
|
4461
|
-
const [configurationDraft, setConfigurationDraft] =
|
|
4502
|
+
const [tab, setTab] = useState13("config");
|
|
4503
|
+
const [error, setError] = useState13("");
|
|
4504
|
+
const [notice, setNotice] = useState13("");
|
|
4505
|
+
const [configurationDraft, setConfigurationDraft] = useState13({
|
|
4462
4506
|
apiKey: "",
|
|
4463
4507
|
senderEmail: "",
|
|
4464
4508
|
senderName: "",
|
|
4465
4509
|
replyTo: ""
|
|
4466
4510
|
});
|
|
4467
|
-
const [configurationTestRecipient, setConfigurationTestRecipient] =
|
|
4468
|
-
const [loadedConfigurationKey, setLoadedConfigurationKey] =
|
|
4469
|
-
const [templateDraft, setTemplateDraft] =
|
|
4470
|
-
const [editingBase, setEditingBase] =
|
|
4471
|
-
const [previewTarget, setPreviewTarget] =
|
|
4472
|
-
const [previewVariables, setPreviewVariables] =
|
|
4473
|
-
const [testTarget, setTestTarget] =
|
|
4474
|
-
const [templateTest, setTemplateTest] =
|
|
4475
|
-
const [templateModalOpen, setTemplateModalOpen] =
|
|
4476
|
-
const [templateModalTab, setTemplateModalTab] =
|
|
4477
|
-
const [managedTemplateCode, setManagedTemplateCode] =
|
|
4511
|
+
const [configurationTestRecipient, setConfigurationTestRecipient] = useState13("");
|
|
4512
|
+
const [loadedConfigurationKey, setLoadedConfigurationKey] = useState13("");
|
|
4513
|
+
const [templateDraft, setTemplateDraft] = useState13(EMPTY_DRAFT);
|
|
4514
|
+
const [editingBase, setEditingBase] = useState13(null);
|
|
4515
|
+
const [previewTarget, setPreviewTarget] = useState13(null);
|
|
4516
|
+
const [previewVariables, setPreviewVariables] = useState13("{}");
|
|
4517
|
+
const [testTarget, setTestTarget] = useState13(null);
|
|
4518
|
+
const [templateTest, setTemplateTest] = useState13({ to: "", variables: "{}" });
|
|
4519
|
+
const [templateModalOpen, setTemplateModalOpen] = useState13(false);
|
|
4520
|
+
const [templateModalTab, setTemplateModalTab] = useState13("versions");
|
|
4521
|
+
const [managedTemplateCode, setManagedTemplateCode] = useState13("");
|
|
4478
4522
|
const health = useQuery11({
|
|
4479
4523
|
queryKey: ["transactional-email", "health"],
|
|
4480
4524
|
queryFn: async () => (await http.get("/core/transactional-email/health")).data
|
|
@@ -5419,7 +5463,7 @@ import {
|
|
|
5419
5463
|
Stack as Stack11,
|
|
5420
5464
|
Text as Text21
|
|
5421
5465
|
} from "@chakra-ui/react";
|
|
5422
|
-
import { useState as
|
|
5466
|
+
import { useState as useState14 } from "react";
|
|
5423
5467
|
import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5424
5468
|
var STATUS = {
|
|
5425
5469
|
contract: {
|
|
@@ -5595,7 +5639,7 @@ function CoreDataTable({ columns, rows, rowKey, loading, error, empty, search, f
|
|
|
5595
5639
|
] });
|
|
5596
5640
|
}
|
|
5597
5641
|
function CoreDetailDrawer({ open, onClose, title, status, tabs, actions, children }) {
|
|
5598
|
-
const [tab, setTab] =
|
|
5642
|
+
const [tab, setTab] = useState14(tabs?.[0]?.id);
|
|
5599
5643
|
const active = tabs?.find((item) => item.id === tab) ?? tabs?.[0];
|
|
5600
5644
|
return /* @__PURE__ */ jsx24(Drawer.Root, { open, onOpenChange: (event) => {
|
|
5601
5645
|
if (!event.open) onClose();
|
|
@@ -5649,7 +5693,7 @@ function CoreConfirmDialog({ open, title, effect, confirmLabel = "Confirmar", ca
|
|
|
5649
5693
|
}
|
|
5650
5694
|
function CoreTechnicalDetails({ items, label = "Detalhes t\xE9cnicos" }) {
|
|
5651
5695
|
const visible = items.filter((item) => item.value !== void 0 && item.value !== null && item.value !== "");
|
|
5652
|
-
const [copied, setCopied] =
|
|
5696
|
+
const [copied, setCopied] = useState14(null);
|
|
5653
5697
|
if (!visible.length) return null;
|
|
5654
5698
|
const copy = async (text, key) => {
|
|
5655
5699
|
try {
|
|
@@ -5744,4 +5788,4 @@ export {
|
|
|
5744
5788
|
CoreOrganizationSwitcher,
|
|
5745
5789
|
coreInitials
|
|
5746
5790
|
};
|
|
5747
|
-
//# sourceMappingURL=chunk-
|
|
5791
|
+
//# sourceMappingURL=chunk-4J7L5PIO.js.map
|