@axzydev/axzy_ui_system 1.7.3 → 1.7.4
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.cjs +1621 -594
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +366 -12
- package/dist/index.d.ts +366 -12
- package/dist/index.js +1331 -313
- package/dist/index.js.map +1 -1
- package/dist/layered.css +1 -1
- package/package.json +4 -2
- package/src/App.tsx +6 -8
- package/src/components/atoms/flex/flex.props.ts +3 -1
- package/src/components/atoms/flex/flex.tsx +11 -3
- package/src/components/atoms/textarea/textarea.props.ts +4 -0
- package/src/components/atoms/textarea/textarea.tsx +13 -3
- package/src/components/molecules/card/card.props.ts +2 -0
- package/src/components/molecules/card/card.tsx +15 -2
- package/src/components/molecules/line-bar-chart/line-bar-chart.props.ts +4 -0
- package/src/components/molecules/line-bar-chart/line-bar-chart.tsx +57 -41
- package/src/components/organisms/dropfile/dropfile.props.ts +8 -2
- package/src/components/organisms/dropfile/dropfile.tsx +17 -0
- package/src/i18n/locales/en.ts +7 -0
- package/src/i18n/locales/es.ts +7 -0
- package/src/index.ts +31 -3
- package/src/json-renderer/actions/effects.test.tsx +115 -0
- package/src/json-renderer/actions/effects.ts +291 -0
- package/src/json-renderer/actions/effectsChain.test.ts +117 -0
- package/src/json-renderer/binding/binding.test.tsx +168 -0
- package/src/json-renderer/binding/resolveValue.ts +193 -0
- package/src/json-renderer/estado-acciones.test.tsx +166 -0
- package/src/json-renderer/form/FormNode.tsx +92 -0
- package/src/json-renderer/form/form.test.tsx +148 -0
- package/src/json-renderer/form/formLength.test.tsx +99 -0
- package/src/json-renderer/form/rules.ts +162 -0
- package/src/json-renderer/index.ts +21 -0
- package/src/json-renderer/kernel/SchemaRenderer.tsx +83 -7
- package/src/json-renderer/kernel/capabilities.ts +30 -0
- package/src/json-renderer/kernel/renderNode.tsx +256 -3
- package/src/json-renderer/kernel/schemaRenderer.props.ts +29 -3
- package/src/json-renderer/kernel/slots.test.tsx +104 -0
- package/src/json-renderer/kernel/slots.ts +34 -0
- package/src/json-renderer/kernel/types.ts +4 -0
- package/src/json-renderer/routing/match.ts +82 -0
- package/src/json-renderer/routing/navigation.ts +71 -0
- package/src/json-renderer/routing/routes.ts +179 -0
- package/src/json-renderer/routing/routing.test.ts +147 -0
- package/src/json-renderer/seguridad.test.tsx +299 -0
- package/src/json-renderer/shared/errors.ts +1 -0
- package/src/json-renderer/stream/tolerantParse.ts +5 -0
- package/src/json-renderer/stream/useSchemaStream.test.tsx +143 -0
- package/src/json-renderer/stream/useSchemaStream.ts +227 -0
- package/src/json-renderer/validation/jsonSchema.test.ts +105 -0
- package/src/json-renderer/validation/jsonSchema.ts +317 -0
- package/src/json-renderer/validation/validate.ts +17 -0
- package/src/sandbox/i18n.ts +38 -0
- package/src/sandbox/useHashRoute.ts +2 -1
- package/src/showcases/DemoJsonDashboard.tsx +218 -103
- package/src/showcases/DemoJsonDocs.tsx +11 -11
- package/src/showcases/JsonScreenShowcase.tsx +43 -53
- package/src/showcases/demoApp/demoJson.test.tsx +241 -0
- package/src/showcases/demoApp/routes.test.ts +63 -0
- package/src/showcases/demoApp/schemas.test.ts +6 -17
package/dist/index.cjs
CHANGED
|
@@ -59,7 +59,7 @@ __export(index_exports, {
|
|
|
59
59
|
ITDropfile: () => dropfile_default,
|
|
60
60
|
ITEmptyState: () => ITEmptyState,
|
|
61
61
|
ITField: () => ITField,
|
|
62
|
-
ITFlex: () =>
|
|
62
|
+
ITFlex: () => flex_default,
|
|
63
63
|
ITFormBuilder: () => ITFormBuilder,
|
|
64
64
|
ITFormHeader: () => ITFormHeader,
|
|
65
65
|
ITGrid: () => ITGrid,
|
|
@@ -96,7 +96,7 @@ __export(index_exports, {
|
|
|
96
96
|
ITTable: () => ITTable,
|
|
97
97
|
ITTabs: () => tabs_default,
|
|
98
98
|
ITText: () => ITText,
|
|
99
|
-
ITTextarea: () =>
|
|
99
|
+
ITTextarea: () => textarea_default,
|
|
100
100
|
ITThemeProvider: () => ITThemeProvider,
|
|
101
101
|
ITTimePicker: () => ITTimePicker,
|
|
102
102
|
ITToast: () => ITToast,
|
|
@@ -108,13 +108,16 @@ __export(index_exports, {
|
|
|
108
108
|
auditTree: () => auditTree,
|
|
109
109
|
axzyCatalog: () => axzyCatalog,
|
|
110
110
|
axzyCatalogTypes: () => axzyCatalogTypes,
|
|
111
|
+
buildNavigationTree: () => buildNavigationTree,
|
|
111
112
|
buildVocabularyContract: () => buildVocabularyContract,
|
|
112
113
|
countPendingNodes: () => countPendingNodes,
|
|
114
|
+
createBindingResolver: () => createBindingResolver,
|
|
113
115
|
createCatalog: () => createCatalog,
|
|
114
116
|
createLimitTracker: () => createLimitTracker,
|
|
115
117
|
createValidationSchema: () => createValidationSchema,
|
|
116
118
|
enMessages: () => en_default,
|
|
117
119
|
esMessages: () => es_default,
|
|
120
|
+
flattenRoutes: () => flattenRoutes,
|
|
118
121
|
formatPath: () => formatPath,
|
|
119
122
|
formatVocabularyForPrompt: () => formatVocabularyForPrompt,
|
|
120
123
|
getCatalogEntry: () => getCatalogEntry,
|
|
@@ -125,7 +128,10 @@ __export(index_exports, {
|
|
|
125
128
|
isLightColor: () => isLightColor,
|
|
126
129
|
isNodePending: () => isNodePending,
|
|
127
130
|
issue: () => issue,
|
|
131
|
+
joinRoutePath: () => joinRoutePath,
|
|
132
|
+
matchRoute: () => matchRoute,
|
|
128
133
|
migrateSchema: () => migrateSchema,
|
|
134
|
+
navContainsRoute: () => navContainsRoute,
|
|
129
135
|
parsePartialSchema: () => parsePartialSchema,
|
|
130
136
|
parsePath: () => parsePath,
|
|
131
137
|
propPath: () => propPath,
|
|
@@ -135,6 +141,7 @@ __export(index_exports, {
|
|
|
135
141
|
resolveCssColor: () => resolveCssColor,
|
|
136
142
|
resolveLimits: () => resolveLimits,
|
|
137
143
|
resolveNode: () => resolveNode,
|
|
144
|
+
routeHref: () => routeHref,
|
|
138
145
|
useClickOutside: () => useClickOutside_default,
|
|
139
146
|
useDebouncedSearch: () => useDebouncedSearch,
|
|
140
147
|
useEditableRow: () => useEditableRow,
|
|
@@ -144,7 +151,9 @@ __export(index_exports, {
|
|
|
144
151
|
useITThemeSafe: () => useITThemeSafe,
|
|
145
152
|
useITTranslation: () => useITTranslation,
|
|
146
153
|
useJsonRender: () => useJsonRender_default,
|
|
154
|
+
useSchemaStream: () => useSchemaStream,
|
|
147
155
|
useTableState: () => useTableState,
|
|
156
|
+
validateRoutes: () => validateRoutes,
|
|
148
157
|
validateSchema: () => validateSchema
|
|
149
158
|
});
|
|
150
159
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -476,10 +485,10 @@ function useTableState({
|
|
|
476
485
|
}
|
|
477
486
|
|
|
478
487
|
// src/hooks/useJsonRender.tsx
|
|
479
|
-
var
|
|
488
|
+
var import_react15 = require("react");
|
|
480
489
|
|
|
481
490
|
// src/components/molecules/json-renderer/json-renderer.tsx
|
|
482
|
-
var
|
|
491
|
+
var import_react14 = __toESM(require("react"), 1);
|
|
483
492
|
|
|
484
493
|
// src/types/button.types.ts
|
|
485
494
|
var buttonVariants = {
|
|
@@ -1352,7 +1361,13 @@ var es = {
|
|
|
1352
1361
|
"jsonEditor.kindString": "texto",
|
|
1353
1362
|
"jsonEditor.kindNumber": "n\xFAmero",
|
|
1354
1363
|
"jsonEditor.kindBoolean": "booleano",
|
|
1355
|
-
"jsonEditor.kindNull": "nulo"
|
|
1364
|
+
"jsonEditor.kindNull": "nulo",
|
|
1365
|
+
// ---------------------------------------------------------------- jsonRenderer
|
|
1366
|
+
"jsonRenderer.form.required": "Campo obligatorio.",
|
|
1367
|
+
"jsonRenderer.form.email": "Escribe un correo v\xE1lido.",
|
|
1368
|
+
"jsonRenderer.form.minLength": "Escribe al menos {min} caracteres.",
|
|
1369
|
+
"jsonRenderer.form.maxLength": "Escribe como m\xE1ximo {max} caracteres.",
|
|
1370
|
+
"jsonRenderer.form.submit": "Enviar"
|
|
1356
1371
|
};
|
|
1357
1372
|
var es_default = es;
|
|
1358
1373
|
|
|
@@ -1558,7 +1573,13 @@ var en = {
|
|
|
1558
1573
|
"jsonEditor.kindString": "string",
|
|
1559
1574
|
"jsonEditor.kindNumber": "number",
|
|
1560
1575
|
"jsonEditor.kindBoolean": "boolean",
|
|
1561
|
-
"jsonEditor.kindNull": "null"
|
|
1576
|
+
"jsonEditor.kindNull": "null",
|
|
1577
|
+
// ---------------------------------------------------------------- jsonRenderer
|
|
1578
|
+
"jsonRenderer.form.required": "Required field.",
|
|
1579
|
+
"jsonRenderer.form.email": "Enter a valid email address.",
|
|
1580
|
+
"jsonRenderer.form.minLength": "Enter at least {min} characters.",
|
|
1581
|
+
"jsonRenderer.form.maxLength": "Enter at most {max} characters.",
|
|
1582
|
+
"jsonRenderer.form.submit": "Submit"
|
|
1562
1583
|
};
|
|
1563
1584
|
var en_default = en;
|
|
1564
1585
|
|
|
@@ -1635,6 +1656,7 @@ function useITTranslation() {
|
|
|
1635
1656
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1636
1657
|
function ITCard({
|
|
1637
1658
|
title,
|
|
1659
|
+
headerActions,
|
|
1638
1660
|
image,
|
|
1639
1661
|
alt,
|
|
1640
1662
|
children,
|
|
@@ -1694,14 +1716,24 @@ function ITCard({
|
|
|
1694
1716
|
}
|
|
1695
1717
|
),
|
|
1696
1718
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx2.default)(contentClassName), style: bodyStyle, children: [
|
|
1697
|
-
|
|
1719
|
+
headerActions ? /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-3", children: [
|
|
1720
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1721
|
+
ITText,
|
|
1722
|
+
{
|
|
1723
|
+
as: "h3",
|
|
1724
|
+
className: (0, import_clsx2.default)(flat ? "text-base font-semibold" : "text-xl font-semibold", titleClassName),
|
|
1725
|
+
children: title
|
|
1726
|
+
}
|
|
1727
|
+
),
|
|
1728
|
+
headerActions
|
|
1729
|
+
] }) : title ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1698
1730
|
ITText,
|
|
1699
1731
|
{
|
|
1700
1732
|
as: "h3",
|
|
1701
1733
|
className: (0, import_clsx2.default)(flat ? "text-base font-semibold mb-3" : "text-xl font-semibold mb-2", titleClassName),
|
|
1702
1734
|
children: title
|
|
1703
1735
|
}
|
|
1704
|
-
),
|
|
1736
|
+
) : null,
|
|
1705
1737
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ITText, { as: "div", className: "text-secondary-600", children })
|
|
1706
1738
|
] }),
|
|
1707
1739
|
actions && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
@@ -1721,6 +1753,7 @@ function ITCard({
|
|
|
1721
1753
|
|
|
1722
1754
|
// src/components/atoms/flex/flex.tsx
|
|
1723
1755
|
var import_clsx3 = __toESM(require("clsx"), 1);
|
|
1756
|
+
var import_react12 = require("react");
|
|
1724
1757
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1725
1758
|
var directionMap = {
|
|
1726
1759
|
row: "flex-row",
|
|
@@ -1748,7 +1781,7 @@ var wrapMap = {
|
|
|
1748
1781
|
wrap: "flex-wrap",
|
|
1749
1782
|
"wrap-reverse": "flex-wrap-reverse"
|
|
1750
1783
|
};
|
|
1751
|
-
|
|
1784
|
+
var ITFlex = (0, import_react12.forwardRef)(function ITFlex2({
|
|
1752
1785
|
children,
|
|
1753
1786
|
direction = "row",
|
|
1754
1787
|
align,
|
|
@@ -1761,8 +1794,9 @@ function ITFlex({
|
|
|
1761
1794
|
className,
|
|
1762
1795
|
style,
|
|
1763
1796
|
as: Component = "div",
|
|
1764
|
-
onClick
|
|
1765
|
-
|
|
1797
|
+
onClick,
|
|
1798
|
+
onScroll
|
|
1799
|
+
}, ref) {
|
|
1766
1800
|
const resolvedStyle = {
|
|
1767
1801
|
gap: gap > 0 ? `${gap * 0.25}rem` : void 0,
|
|
1768
1802
|
flexGrow: typeof grow === "boolean" ? grow ? 1 : 0 : grow,
|
|
@@ -1773,6 +1807,7 @@ function ITFlex({
|
|
|
1773
1807
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1774
1808
|
Component,
|
|
1775
1809
|
{
|
|
1810
|
+
ref,
|
|
1776
1811
|
className: (0, import_clsx3.default)(
|
|
1777
1812
|
"flex",
|
|
1778
1813
|
directionMap[direction],
|
|
@@ -1783,14 +1818,17 @@ function ITFlex({
|
|
|
1783
1818
|
),
|
|
1784
1819
|
style: resolvedStyle,
|
|
1785
1820
|
onClick,
|
|
1821
|
+
onScroll,
|
|
1786
1822
|
children
|
|
1787
1823
|
}
|
|
1788
1824
|
);
|
|
1789
|
-
}
|
|
1825
|
+
});
|
|
1826
|
+
ITFlex.displayName = "ITFlex";
|
|
1827
|
+
var flex_default = ITFlex;
|
|
1790
1828
|
|
|
1791
1829
|
// src/components/atoms/stack/stack.tsx
|
|
1792
1830
|
var import_clsx4 = __toESM(require("clsx"), 1);
|
|
1793
|
-
var
|
|
1831
|
+
var import_react13 = require("react");
|
|
1794
1832
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1795
1833
|
var directionMap2 = {
|
|
1796
1834
|
row: "flex-row",
|
|
@@ -1831,7 +1869,7 @@ function ITStack({
|
|
|
1831
1869
|
as: Component = "div"
|
|
1832
1870
|
}) {
|
|
1833
1871
|
const hasDivider = divider !== void 0;
|
|
1834
|
-
const items =
|
|
1872
|
+
const items = import_react13.Children.toArray(children);
|
|
1835
1873
|
const resolvedStyle = {
|
|
1836
1874
|
gap: spacing > 0 ? `${spacing * 0.25}rem` : void 0,
|
|
1837
1875
|
...style
|
|
@@ -1848,9 +1886,9 @@ function ITStack({
|
|
|
1848
1886
|
className
|
|
1849
1887
|
),
|
|
1850
1888
|
style: resolvedStyle,
|
|
1851
|
-
children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1889
|
+
children: hasDivider ? items.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react13.Fragment, { children: [
|
|
1852
1890
|
child,
|
|
1853
|
-
index < items.length - 1 && (0,
|
|
1891
|
+
index < items.length - 1 && (0, import_react13.isValidElement)(divider) ? (0, import_react13.cloneElement)(divider, { key: `divider-${index}` }) : null
|
|
1854
1892
|
] }, index)) : children
|
|
1855
1893
|
}
|
|
1856
1894
|
);
|
|
@@ -1985,11 +2023,11 @@ function ITJsonRenderer({
|
|
|
1985
2023
|
if (typeof node === "string" || typeof node === "number") {
|
|
1986
2024
|
return node;
|
|
1987
2025
|
}
|
|
1988
|
-
if (
|
|
2026
|
+
if (import_react14.default.isValidElement(node)) {
|
|
1989
2027
|
return node;
|
|
1990
2028
|
}
|
|
1991
2029
|
if (Array.isArray(node)) {
|
|
1992
|
-
return node.map((child, idx) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2030
|
+
return node.map((child, idx) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react14.default.Fragment, { children: renderNode2(child) }, idx));
|
|
1993
2031
|
}
|
|
1994
2032
|
const { type, props = {}, children, text } = node;
|
|
1995
2033
|
const childContent = children !== void 0 ? renderNode2(children) : text;
|
|
@@ -2001,7 +2039,7 @@ function ITJsonRenderer({
|
|
|
2001
2039
|
case "card":
|
|
2002
2040
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ITCard, { ...props, children: childContent });
|
|
2003
2041
|
case "flex":
|
|
2004
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2042
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(flex_default, { ...props, children: childContent });
|
|
2005
2043
|
case "stack":
|
|
2006
2044
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ITStack, { ...props, children: childContent });
|
|
2007
2045
|
case "grid":
|
|
@@ -2014,7 +2052,7 @@ function ITJsonRenderer({
|
|
|
2014
2052
|
}
|
|
2015
2053
|
};
|
|
2016
2054
|
if (Array.isArray(json)) {
|
|
2017
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_clsx7.default)(className), children: json.map((n, idx) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_clsx7.default)(className), children: json.map((n, idx) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react14.default.Fragment, { children: renderNode2(n) }, idx)) });
|
|
2018
2056
|
}
|
|
2019
2057
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: (0, import_clsx7.default)(className), children: renderNode2(json) });
|
|
2020
2058
|
}
|
|
@@ -2022,13 +2060,13 @@ function ITJsonRenderer({
|
|
|
2022
2060
|
// src/hooks/useJsonRender.tsx
|
|
2023
2061
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2024
2062
|
function useJsonRender(json) {
|
|
2025
|
-
return (0,
|
|
2063
|
+
return (0, import_react15.useMemo)(() => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ITJsonRenderer, { json }), [json]);
|
|
2026
2064
|
}
|
|
2027
2065
|
var useJsonRender_default = useJsonRender;
|
|
2028
2066
|
|
|
2029
2067
|
// src/components/molecules/accordion/accordion.tsx
|
|
2030
2068
|
var import_clsx8 = __toESM(require("clsx"), 1);
|
|
2031
|
-
var
|
|
2069
|
+
var import_react16 = require("react");
|
|
2032
2070
|
var import_fa2 = require("react-icons/fa");
|
|
2033
2071
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2034
2072
|
function ITAccordion({
|
|
@@ -2041,7 +2079,7 @@ function ITAccordion({
|
|
|
2041
2079
|
className,
|
|
2042
2080
|
itemClassName
|
|
2043
2081
|
}) {
|
|
2044
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
2082
|
+
const [internalOpen, setInternalOpen] = (0, import_react16.useState)(defaultOpenIds);
|
|
2045
2083
|
const isControlled = openIds !== void 0;
|
|
2046
2084
|
const currentOpen = isControlled ? openIds : internalOpen;
|
|
2047
2085
|
const toggle = (id) => {
|
|
@@ -2264,7 +2302,7 @@ function ITBreadcrumbs({
|
|
|
2264
2302
|
}
|
|
2265
2303
|
|
|
2266
2304
|
// src/components/molecules/calendar/calendar.tsx
|
|
2267
|
-
var
|
|
2305
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
2268
2306
|
var import_date_fns = require("date-fns");
|
|
2269
2307
|
var import_clsx12 = require("clsx");
|
|
2270
2308
|
var import_tailwind_merge = require("tailwind-merge");
|
|
@@ -2296,8 +2334,8 @@ var ITCalendar = ({
|
|
|
2296
2334
|
}) => {
|
|
2297
2335
|
const { t, dateLocale } = useITTranslation();
|
|
2298
2336
|
const mode = modeProp || (onChange ? "month" : "week");
|
|
2299
|
-
const [currentDate, setCurrentDate] = (0,
|
|
2300
|
-
const [view, setView] = (0,
|
|
2337
|
+
const [currentDate, setCurrentDate] = (0, import_react17.useState)(value || /* @__PURE__ */ new Date());
|
|
2338
|
+
const [view, setView] = (0, import_react17.useState)("calendar");
|
|
2301
2339
|
const getVariantStyles = () => {
|
|
2302
2340
|
const v = variant || "primary";
|
|
2303
2341
|
return {
|
|
@@ -2307,7 +2345,7 @@ var ITCalendar = ({
|
|
|
2307
2345
|
"--calendar-today-text": `var(--color-${v})`
|
|
2308
2346
|
};
|
|
2309
2347
|
};
|
|
2310
|
-
(0,
|
|
2348
|
+
(0, import_react17.useEffect)(() => {
|
|
2311
2349
|
if (value) setCurrentDate(value);
|
|
2312
2350
|
}, [value]);
|
|
2313
2351
|
const shiftYear = (yearDelta) => {
|
|
@@ -2363,7 +2401,7 @@ var ITCalendar = ({
|
|
|
2363
2401
|
setCurrentDate(/* @__PURE__ */ new Date());
|
|
2364
2402
|
setView("calendar");
|
|
2365
2403
|
};
|
|
2366
|
-
const viewDays = (0,
|
|
2404
|
+
const viewDays = (0, import_react17.useMemo)(() => {
|
|
2367
2405
|
if (mode === "day") {
|
|
2368
2406
|
return [currentDate];
|
|
2369
2407
|
}
|
|
@@ -2382,13 +2420,13 @@ var ITCalendar = ({
|
|
|
2382
2420
|
height: `${duration / 60 * 80}px`
|
|
2383
2421
|
};
|
|
2384
2422
|
};
|
|
2385
|
-
const weekEvents = (0,
|
|
2423
|
+
const weekEvents = (0, import_react17.useMemo)(() => {
|
|
2386
2424
|
return events.filter((event) => {
|
|
2387
2425
|
const eventStart = typeof event.start === "string" ? (0, import_date_fns.parseISO)(event.start) : event.start;
|
|
2388
2426
|
return viewDays.some((day) => (0, import_date_fns.isSameDay)(day, eventStart));
|
|
2389
2427
|
});
|
|
2390
2428
|
}, [events, viewDays]);
|
|
2391
|
-
const monthDays = (0,
|
|
2429
|
+
const monthDays = (0, import_react17.useMemo)(() => {
|
|
2392
2430
|
const start = (0, import_date_fns.startOfWeek)((0, import_date_fns.startOfMonth)(currentDate), { weekStartsOn: 1 });
|
|
2393
2431
|
const end = (0, import_date_fns.endOfWeek)((0, import_date_fns.endOfMonth)(currentDate), { weekStartsOn: 1 });
|
|
2394
2432
|
return (0, import_date_fns.eachDayOfInterval)({ start, end });
|
|
@@ -2398,9 +2436,9 @@ var ITCalendar = ({
|
|
|
2398
2436
|
if (maxDate && (0, import_date_fns.isAfter)(date, (0, import_date_fns.startOfDay)(maxDate))) return true;
|
|
2399
2437
|
return false;
|
|
2400
2438
|
};
|
|
2401
|
-
const [dragStart, setDragStart] = (0,
|
|
2402
|
-
const [dragCurrent, setDragCurrent] = (0,
|
|
2403
|
-
const isDraggingRef =
|
|
2439
|
+
const [dragStart, setDragStart] = (0, import_react17.useState)(null);
|
|
2440
|
+
const [dragCurrent, setDragCurrent] = (0, import_react17.useState)(null);
|
|
2441
|
+
const isDraggingRef = import_react17.default.useRef(false);
|
|
2404
2442
|
const handleMouseDown = (date, e) => {
|
|
2405
2443
|
if (!onSelectRange) return;
|
|
2406
2444
|
e.stopPropagation();
|
|
@@ -2984,7 +3022,7 @@ function ITChip({
|
|
|
2984
3022
|
|
|
2985
3023
|
// src/components/molecules/chip-input/chip-input.tsx
|
|
2986
3024
|
var import_clsx16 = __toESM(require("clsx"), 1);
|
|
2987
|
-
var
|
|
3025
|
+
var import_react18 = require("react");
|
|
2988
3026
|
|
|
2989
3027
|
// src/utils/styles.ts
|
|
2990
3028
|
var import_clsx15 = __toESM(require("clsx"), 1);
|
|
@@ -3117,11 +3155,11 @@ function ITChipInput({
|
|
|
3117
3155
|
className
|
|
3118
3156
|
}) {
|
|
3119
3157
|
const { t } = useITTranslation();
|
|
3120
|
-
const [inputValue, setInputValue] = (0,
|
|
3121
|
-
const [localTouched, setLocalTouched] = (0,
|
|
3122
|
-
const [localError, setLocalError] = (0,
|
|
3123
|
-
const [isFocused, setIsFocused] = (0,
|
|
3124
|
-
const inputRef = (0,
|
|
3158
|
+
const [inputValue, setInputValue] = (0, import_react18.useState)("");
|
|
3159
|
+
const [localTouched, setLocalTouched] = (0, import_react18.useState)(false);
|
|
3160
|
+
const [localError, setLocalError] = (0, import_react18.useState)(void 0);
|
|
3161
|
+
const [isFocused, setIsFocused] = (0, import_react18.useState)(false);
|
|
3162
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
3125
3163
|
const inputTheme = theme.input || {};
|
|
3126
3164
|
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
3127
3165
|
const externalError = error !== void 0 && error !== false ? error === true ? t("field.required") : error : required && value.length === 0 ? t("field.required") : void 0;
|
|
@@ -3262,7 +3300,7 @@ function ITChipInput({
|
|
|
3262
3300
|
|
|
3263
3301
|
// src/components/molecules/dropdown-menu/dropdown-menu.tsx
|
|
3264
3302
|
var import_clsx17 = __toESM(require("clsx"), 1);
|
|
3265
|
-
var
|
|
3303
|
+
var import_react19 = require("react");
|
|
3266
3304
|
var import_react_dom = require("react-dom");
|
|
3267
3305
|
var import_fa6 = require("react-icons/fa");
|
|
3268
3306
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
@@ -3278,20 +3316,20 @@ function ITDropdownMenu({
|
|
|
3278
3316
|
}) {
|
|
3279
3317
|
const { t } = useITTranslation();
|
|
3280
3318
|
const resolvedTriggerLabel = triggerLabel ?? t("dropdownMenu.open");
|
|
3281
|
-
const [isOpen, setIsOpen] = (0,
|
|
3282
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
3283
|
-
const triggerRef = (0,
|
|
3284
|
-
const itemRefs = (0,
|
|
3319
|
+
const [isOpen, setIsOpen] = (0, import_react19.useState)(false);
|
|
3320
|
+
const [activeIndex, setActiveIndex] = (0, import_react19.useState)(-1);
|
|
3321
|
+
const triggerRef = (0, import_react19.useRef)(null);
|
|
3322
|
+
const itemRefs = (0, import_react19.useRef)([]);
|
|
3285
3323
|
const { panelRef, style: panelStyle } = useFloatingPanel(triggerRef, isOpen, {
|
|
3286
3324
|
estimatedHeight: Math.max(items.length * 40, 120),
|
|
3287
3325
|
matchWidth: false,
|
|
3288
3326
|
align: placement.endsWith("end") ? "end" : "start"
|
|
3289
3327
|
});
|
|
3290
|
-
const enabledIndexes = (0,
|
|
3328
|
+
const enabledIndexes = (0, import_react19.useMemo)(
|
|
3291
3329
|
() => items.map((item, i) => item.disabled ? -1 : i).filter((i) => i >= 0),
|
|
3292
3330
|
[items]
|
|
3293
3331
|
);
|
|
3294
|
-
(0,
|
|
3332
|
+
(0, import_react19.useEffect)(() => {
|
|
3295
3333
|
if (!isOpen) return;
|
|
3296
3334
|
function handleClickOutside(event) {
|
|
3297
3335
|
const target = event.target;
|
|
@@ -3302,7 +3340,7 @@ function ITDropdownMenu({
|
|
|
3302
3340
|
document.addEventListener("mousedown", handleClickOutside);
|
|
3303
3341
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
3304
3342
|
}, [isOpen, panelRef]);
|
|
3305
|
-
(0,
|
|
3343
|
+
(0, import_react19.useEffect)(() => {
|
|
3306
3344
|
if (isOpen) {
|
|
3307
3345
|
setActiveIndex(enabledIndexes[0] ?? -1);
|
|
3308
3346
|
requestAnimationFrame(() => {
|
|
@@ -3475,12 +3513,12 @@ function ITField({
|
|
|
3475
3513
|
}
|
|
3476
3514
|
|
|
3477
3515
|
// src/components/molecules/masked-input/masked-input.tsx
|
|
3478
|
-
var
|
|
3516
|
+
var import_react21 = require("react");
|
|
3479
3517
|
var import_clsx20 = __toESM(require("clsx"), 1);
|
|
3480
3518
|
|
|
3481
3519
|
// src/components/atoms/input/input.tsx
|
|
3482
3520
|
var import_clsx19 = __toESM(require("clsx"), 1);
|
|
3483
|
-
var
|
|
3521
|
+
var import_react20 = require("react");
|
|
3484
3522
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3485
3523
|
function ITInput({
|
|
3486
3524
|
name,
|
|
@@ -3521,12 +3559,12 @@ function ITInput({
|
|
|
3521
3559
|
const isNumberType = type === "number";
|
|
3522
3560
|
const isTextArea = type === "textarea";
|
|
3523
3561
|
const decimalPlaces = decimals ?? (currencyFormat ? 2 : 0);
|
|
3524
|
-
const [displayValue, setDisplayValue] = (0,
|
|
3525
|
-
const [isFocused, setIsFocused] = (0,
|
|
3526
|
-
const [hasSelectedAll, setHasSelectedAll] = (0,
|
|
3527
|
-
const [showPassword, setShowPassword] = (0,
|
|
3528
|
-
const [localTouched, setLocalTouched] = (0,
|
|
3529
|
-
const inputRef = (0,
|
|
3562
|
+
const [displayValue, setDisplayValue] = (0, import_react20.useState)("");
|
|
3563
|
+
const [isFocused, setIsFocused] = (0, import_react20.useState)(false);
|
|
3564
|
+
const [hasSelectedAll, setHasSelectedAll] = (0, import_react20.useState)(false);
|
|
3565
|
+
const [showPassword, setShowPassword] = (0, import_react20.useState)(false);
|
|
3566
|
+
const [localTouched, setLocalTouched] = (0, import_react20.useState)(false);
|
|
3567
|
+
const inputRef = (0, import_react20.useRef)(null);
|
|
3530
3568
|
const inputTheme = theme.input || {};
|
|
3531
3569
|
const getStyle = () => {
|
|
3532
3570
|
const style = inputFieldStyle(inputTheme, size);
|
|
@@ -3565,7 +3603,7 @@ function ITInput({
|
|
|
3565
3603
|
setHasSelectedAll(true);
|
|
3566
3604
|
}
|
|
3567
3605
|
};
|
|
3568
|
-
const formatValue = (0,
|
|
3606
|
+
const formatValue = (0, import_react20.useCallback)(
|
|
3569
3607
|
(val) => {
|
|
3570
3608
|
const num = typeof val === "string" ? parseFloat(val.replace(/,/g, "")) : val;
|
|
3571
3609
|
if (num == null || isNaN(num)) {
|
|
@@ -3584,14 +3622,14 @@ function ITInput({
|
|
|
3584
3622
|
},
|
|
3585
3623
|
[currencyFormat, decimalPlaces, formatNumberLocale]
|
|
3586
3624
|
);
|
|
3587
|
-
const unformatValue = (0,
|
|
3625
|
+
const unformatValue = (0, import_react20.useCallback)(
|
|
3588
3626
|
(val) => {
|
|
3589
3627
|
if (val == null) return "";
|
|
3590
3628
|
return String(val).replace(/,/g, "");
|
|
3591
3629
|
},
|
|
3592
3630
|
[]
|
|
3593
3631
|
);
|
|
3594
|
-
(0,
|
|
3632
|
+
(0, import_react20.useEffect)(() => {
|
|
3595
3633
|
if (!isFocused) {
|
|
3596
3634
|
if (isNumberType) {
|
|
3597
3635
|
if (formatNumber) {
|
|
@@ -4061,15 +4099,15 @@ function ITMaskedInput({
|
|
|
4061
4099
|
autoFocus = false
|
|
4062
4100
|
}) {
|
|
4063
4101
|
const { t } = useITTranslation();
|
|
4064
|
-
const containerRef = (0,
|
|
4065
|
-
const rawRef = (0,
|
|
4102
|
+
const containerRef = (0, import_react21.useRef)(null);
|
|
4103
|
+
const rawRef = (0, import_react21.useRef)(value ?? "");
|
|
4066
4104
|
const isControlled = value !== void 0;
|
|
4067
|
-
const [internalRaw, setInternalRaw] = (0,
|
|
4068
|
-
const [invalidPattern, setInvalidPattern] = (0,
|
|
4069
|
-
const rules = (0,
|
|
4070
|
-
const tokenCount = (0,
|
|
4105
|
+
const [internalRaw, setInternalRaw] = (0, import_react21.useState)(value ?? "");
|
|
4106
|
+
const [invalidPattern, setInvalidPattern] = (0, import_react21.useState)(false);
|
|
4107
|
+
const rules = (0, import_react21.useMemo)(() => parseMask(mask), [mask]);
|
|
4108
|
+
const tokenCount = (0, import_react21.useMemo)(() => rules.filter((r) => r.type === "token").length, [rules]);
|
|
4071
4109
|
const raw = isControlled ? value ?? "" : internalRaw;
|
|
4072
|
-
const display = (0,
|
|
4110
|
+
const display = (0, import_react21.useMemo)(() => format2(raw, rules, placeholderChar), [raw, rules, placeholderChar]);
|
|
4073
4111
|
const scheduleCaret = (caret) => {
|
|
4074
4112
|
const inputEl = containerRef.current?.querySelector("input");
|
|
4075
4113
|
if (!inputEl) return;
|
|
@@ -4133,7 +4171,7 @@ function ITMaskedInput({
|
|
|
4133
4171
|
|
|
4134
4172
|
// src/components/molecules/multi-select/multi-select.tsx
|
|
4135
4173
|
var import_clsx21 = __toESM(require("clsx"), 1);
|
|
4136
|
-
var
|
|
4174
|
+
var import_react22 = require("react");
|
|
4137
4175
|
var import_react_dom2 = require("react-dom");
|
|
4138
4176
|
var import_fa7 = require("react-icons/fa");
|
|
4139
4177
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
@@ -4163,32 +4201,32 @@ function ITMultiSelect({
|
|
|
4163
4201
|
className
|
|
4164
4202
|
}) {
|
|
4165
4203
|
const { t } = useITTranslation();
|
|
4166
|
-
const [isOpen, setIsOpen] = (0,
|
|
4167
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
4168
|
-
const [isFocused, setIsFocused] = (0,
|
|
4169
|
-
const [localTouched, setLocalTouched] = (0,
|
|
4170
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
4171
|
-
const containerRef = (0,
|
|
4172
|
-
const controlRef = (0,
|
|
4173
|
-
const inputRef = (0,
|
|
4174
|
-
const optionRefs = (0,
|
|
4175
|
-
const timeoutRef = (0,
|
|
4204
|
+
const [isOpen, setIsOpen] = (0, import_react22.useState)(false);
|
|
4205
|
+
const [searchTerm, setSearchTerm] = (0, import_react22.useState)("");
|
|
4206
|
+
const [isFocused, setIsFocused] = (0, import_react22.useState)(false);
|
|
4207
|
+
const [localTouched, setLocalTouched] = (0, import_react22.useState)(false);
|
|
4208
|
+
const [activeIndex, setActiveIndex] = (0, import_react22.useState)(-1);
|
|
4209
|
+
const containerRef = (0, import_react22.useRef)(null);
|
|
4210
|
+
const controlRef = (0, import_react22.useRef)(null);
|
|
4211
|
+
const inputRef = (0, import_react22.useRef)(null);
|
|
4212
|
+
const optionRefs = (0, import_react22.useRef)([]);
|
|
4213
|
+
const timeoutRef = (0, import_react22.useRef)(null);
|
|
4176
4214
|
const { panelRef, style: panelStyle } = useFloatingPanel(controlRef, isOpen, {
|
|
4177
4215
|
estimatedHeight: 260,
|
|
4178
4216
|
matchWidth: true
|
|
4179
4217
|
});
|
|
4180
|
-
const selectedOptions = (0,
|
|
4218
|
+
const selectedOptions = (0, import_react22.useMemo)(
|
|
4181
4219
|
() => options.filter((opt) => value.includes(opt[valueField])),
|
|
4182
4220
|
[options, value, valueField]
|
|
4183
4221
|
);
|
|
4184
|
-
const filteredOptions = (0,
|
|
4222
|
+
const filteredOptions = (0, import_react22.useMemo)(() => {
|
|
4185
4223
|
if (onSearch) return options;
|
|
4186
4224
|
if (!searchTerm) return options;
|
|
4187
4225
|
return options.filter(
|
|
4188
4226
|
(opt) => String(opt[labelField]).toLowerCase().includes(searchTerm.toLowerCase())
|
|
4189
4227
|
);
|
|
4190
4228
|
}, [options, searchTerm, onSearch, labelField]);
|
|
4191
|
-
(0,
|
|
4229
|
+
(0, import_react22.useEffect)(() => {
|
|
4192
4230
|
function handleClickOutside(event) {
|
|
4193
4231
|
const target = event.target;
|
|
4194
4232
|
if (!containerRef.current?.contains(target) && !panelRef.current?.contains(target)) {
|
|
@@ -4492,11 +4530,11 @@ function ITConfirmDialog({
|
|
|
4492
4530
|
}
|
|
4493
4531
|
|
|
4494
4532
|
// src/hooks/useElementSize.ts
|
|
4495
|
-
var
|
|
4533
|
+
var import_react23 = require("react");
|
|
4496
4534
|
function useElementSize() {
|
|
4497
|
-
const ref = (0,
|
|
4498
|
-
const [size, setSize] = (0,
|
|
4499
|
-
(0,
|
|
4535
|
+
const ref = (0, import_react23.useRef)(null);
|
|
4536
|
+
const [size, setSize] = (0, import_react23.useState)({ width: 0, height: 0 });
|
|
4537
|
+
(0, import_react23.useLayoutEffect)(() => {
|
|
4500
4538
|
const element = ref.current;
|
|
4501
4539
|
if (!element) return;
|
|
4502
4540
|
const update = () => {
|
|
@@ -4512,7 +4550,7 @@ function useElementSize() {
|
|
|
4512
4550
|
}
|
|
4513
4551
|
|
|
4514
4552
|
// src/hooks/useVirtualRows.ts
|
|
4515
|
-
var
|
|
4553
|
+
var import_react24 = require("react");
|
|
4516
4554
|
function useVirtualRows({
|
|
4517
4555
|
count,
|
|
4518
4556
|
rowHeight,
|
|
@@ -4520,15 +4558,15 @@ function useVirtualRows({
|
|
|
4520
4558
|
enabled = true,
|
|
4521
4559
|
resetKey
|
|
4522
4560
|
}) {
|
|
4523
|
-
const scrollRef = (0,
|
|
4524
|
-
const [scrollTop, setScrollTop] = (0,
|
|
4525
|
-
const [viewportHeight, setViewportHeight] = (0,
|
|
4526
|
-
const scrollToTop = (0,
|
|
4561
|
+
const scrollRef = (0, import_react24.useRef)(null);
|
|
4562
|
+
const [scrollTop, setScrollTop] = (0, import_react24.useState)(0);
|
|
4563
|
+
const [viewportHeight, setViewportHeight] = (0, import_react24.useState)(0);
|
|
4564
|
+
const scrollToTop = (0, import_react24.useCallback)(() => {
|
|
4527
4565
|
setScrollTop(0);
|
|
4528
4566
|
const element = scrollRef.current;
|
|
4529
4567
|
if (element) element.scrollTop = 0;
|
|
4530
4568
|
}, []);
|
|
4531
|
-
(0,
|
|
4569
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
4532
4570
|
if (!enabled) return;
|
|
4533
4571
|
const element = scrollRef.current;
|
|
4534
4572
|
if (!element) return;
|
|
@@ -4544,7 +4582,7 @@ function useVirtualRows({
|
|
|
4544
4582
|
observer.disconnect();
|
|
4545
4583
|
};
|
|
4546
4584
|
}, [enabled]);
|
|
4547
|
-
(0,
|
|
4585
|
+
(0, import_react24.useLayoutEffect)(() => {
|
|
4548
4586
|
if (!enabled) return;
|
|
4549
4587
|
const element = scrollRef.current;
|
|
4550
4588
|
if (element) element.scrollTop = 0;
|
|
@@ -4572,18 +4610,18 @@ function useVirtualRows({
|
|
|
4572
4610
|
|
|
4573
4611
|
// src/components/organisms/data-table/dataTable.tsx
|
|
4574
4612
|
var import_clsx27 = __toESM(require("clsx"), 1);
|
|
4575
|
-
var
|
|
4613
|
+
var import_react29 = __toESM(require("react"), 1);
|
|
4576
4614
|
var import_fa13 = require("react-icons/fa");
|
|
4577
4615
|
var import_md = require("react-icons/md");
|
|
4578
4616
|
|
|
4579
4617
|
// src/components/molecules/pagination/pagination.tsx
|
|
4580
|
-
var
|
|
4618
|
+
var import_react26 = __toESM(require("react"), 1);
|
|
4581
4619
|
var import_clsx24 = __toESM(require("clsx"), 1);
|
|
4582
4620
|
var import_fa10 = require("react-icons/fa");
|
|
4583
4621
|
|
|
4584
4622
|
// src/components/molecules/select/select.tsx
|
|
4585
4623
|
var import_clsx23 = __toESM(require("clsx"), 1);
|
|
4586
|
-
var
|
|
4624
|
+
var import_react25 = require("react");
|
|
4587
4625
|
var import_fa9 = require("react-icons/fa");
|
|
4588
4626
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
4589
4627
|
function ITSelect({
|
|
@@ -4605,8 +4643,8 @@ function ITSelect({
|
|
|
4605
4643
|
size = "md"
|
|
4606
4644
|
}) {
|
|
4607
4645
|
const { t } = useITTranslation();
|
|
4608
|
-
const [isFocused, setIsFocused] = (0,
|
|
4609
|
-
const [localTouched, setLocalTouched] = (0,
|
|
4646
|
+
const [isFocused, setIsFocused] = (0, import_react25.useState)(false);
|
|
4647
|
+
const [localTouched, setLocalTouched] = (0, import_react25.useState)(false);
|
|
4610
4648
|
const inputTheme = theme.input || {};
|
|
4611
4649
|
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
4612
4650
|
const isEmpty = value === void 0 || value === null || String(value).trim() === "";
|
|
@@ -4700,7 +4738,7 @@ var usePagination = ({
|
|
|
4700
4738
|
currentPage,
|
|
4701
4739
|
siblingCount = 1
|
|
4702
4740
|
}) => {
|
|
4703
|
-
return
|
|
4741
|
+
return import_react26.default.useMemo(() => {
|
|
4704
4742
|
const totalPageNumbers = siblingCount + 5;
|
|
4705
4743
|
if (totalPageNumbers >= totalPages) {
|
|
4706
4744
|
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
@@ -4877,7 +4915,7 @@ function ITPagination({
|
|
|
4877
4915
|
}
|
|
4878
4916
|
|
|
4879
4917
|
// src/components/molecules/search-select/search-select.tsx
|
|
4880
|
-
var
|
|
4918
|
+
var import_react27 = require("react");
|
|
4881
4919
|
var import_react_dom3 = require("react-dom");
|
|
4882
4920
|
var import_clsx25 = __toESM(require("clsx"), 1);
|
|
4883
4921
|
var import_fa11 = require("react-icons/fa");
|
|
@@ -4907,26 +4945,26 @@ function ITSearchSelect({
|
|
|
4907
4945
|
onClear
|
|
4908
4946
|
}) {
|
|
4909
4947
|
const { t } = useITTranslation();
|
|
4910
|
-
const [isOpen, setIsOpen] = (0,
|
|
4911
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
4912
|
-
const [isFocused, setIsFocused] = (0,
|
|
4913
|
-
const [localTouched, setLocalTouched] = (0,
|
|
4914
|
-
const containerRef = (0,
|
|
4915
|
-
const inputWrapperRef = (0,
|
|
4916
|
-
const timeoutRef = (0,
|
|
4948
|
+
const [isOpen, setIsOpen] = (0, import_react27.useState)(false);
|
|
4949
|
+
const [searchTerm, setSearchTerm] = (0, import_react27.useState)("");
|
|
4950
|
+
const [isFocused, setIsFocused] = (0, import_react27.useState)(false);
|
|
4951
|
+
const [localTouched, setLocalTouched] = (0, import_react27.useState)(false);
|
|
4952
|
+
const containerRef = (0, import_react27.useRef)(null);
|
|
4953
|
+
const inputWrapperRef = (0, import_react27.useRef)(null);
|
|
4954
|
+
const timeoutRef = (0, import_react27.useRef)(null);
|
|
4917
4955
|
const { panelRef, style: panelStyle } = useFloatingPanel(inputWrapperRef, isOpen, {
|
|
4918
4956
|
estimatedHeight: 260,
|
|
4919
4957
|
matchWidth: true
|
|
4920
4958
|
});
|
|
4921
|
-
const selectedOption = (0,
|
|
4959
|
+
const selectedOption = (0, import_react27.useMemo)(() => {
|
|
4922
4960
|
return options.find((opt) => opt[valueField] === value);
|
|
4923
4961
|
}, [options, value, valueField]);
|
|
4924
|
-
(0,
|
|
4962
|
+
(0, import_react27.useEffect)(() => {
|
|
4925
4963
|
if (!isFocused) {
|
|
4926
4964
|
setSearchTerm(selectedOption ? String(selectedOption[labelField]) : "");
|
|
4927
4965
|
}
|
|
4928
4966
|
}, [selectedOption, isFocused, labelField]);
|
|
4929
|
-
(0,
|
|
4967
|
+
(0, import_react27.useEffect)(() => {
|
|
4930
4968
|
function handleClickOutside(event) {
|
|
4931
4969
|
const target = event.target;
|
|
4932
4970
|
const inContainer = containerRef.current?.contains(target);
|
|
@@ -4939,7 +4977,7 @@ function ITSearchSelect({
|
|
|
4939
4977
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
4940
4978
|
}, []);
|
|
4941
4979
|
const selectedLabel = selectedOption ? String(selectedOption[labelField]) : "";
|
|
4942
|
-
const filteredOptions = (0,
|
|
4980
|
+
const filteredOptions = (0, import_react27.useMemo)(() => {
|
|
4943
4981
|
if (onSearch) return options;
|
|
4944
4982
|
if (!searchTerm || !isFocused || searchTerm === selectedLabel) return options;
|
|
4945
4983
|
return options.filter(
|
|
@@ -5110,7 +5148,7 @@ function ITSearchSelect({
|
|
|
5110
5148
|
|
|
5111
5149
|
// src/components/molecules/date-picker/datePicker.tsx
|
|
5112
5150
|
var import_clsx26 = __toESM(require("clsx"), 1);
|
|
5113
|
-
var
|
|
5151
|
+
var import_react28 = __toESM(require("react"), 1);
|
|
5114
5152
|
var import_react_dom4 = require("react-dom");
|
|
5115
5153
|
var import_fa12 = require("react-icons/fa");
|
|
5116
5154
|
var import_date_fns2 = require("date-fns");
|
|
@@ -5135,16 +5173,16 @@ function ITDatePicker({
|
|
|
5135
5173
|
range = false
|
|
5136
5174
|
}) {
|
|
5137
5175
|
const { t, formatDate: formatDateLocale } = useITTranslation();
|
|
5138
|
-
const [isOpen, setIsOpen] = (0,
|
|
5139
|
-
const [inputValue, setInputValue] = (0,
|
|
5140
|
-
const [isValidDate, setIsValidDate] = (0,
|
|
5141
|
-
const [internalRange, setInternalRange] = (0,
|
|
5142
|
-
const wrapperRef = (0,
|
|
5176
|
+
const [isOpen, setIsOpen] = (0, import_react28.useState)(false);
|
|
5177
|
+
const [inputValue, setInputValue] = (0, import_react28.useState)("");
|
|
5178
|
+
const [isValidDate, setIsValidDate] = (0, import_react28.useState)(true);
|
|
5179
|
+
const [internalRange, setInternalRange] = (0, import_react28.useState)([null, null]);
|
|
5180
|
+
const wrapperRef = (0, import_react28.useRef)(null);
|
|
5143
5181
|
const { panelRef, style: panelStyle } = useFloatingPanel(wrapperRef, isOpen, {
|
|
5144
5182
|
estimatedHeight: 360,
|
|
5145
5183
|
matchWidth: false
|
|
5146
5184
|
});
|
|
5147
|
-
const dateRange =
|
|
5185
|
+
const dateRange = import_react28.default.useMemo(() => {
|
|
5148
5186
|
if (range) {
|
|
5149
5187
|
if (Array.isArray(value)) return value;
|
|
5150
5188
|
return internalRange;
|
|
@@ -5152,7 +5190,7 @@ function ITDatePicker({
|
|
|
5152
5190
|
return [value instanceof Date ? value : null, null];
|
|
5153
5191
|
}, [value, range, internalRange]);
|
|
5154
5192
|
const [startDate, endDate] = dateRange;
|
|
5155
|
-
(0,
|
|
5193
|
+
(0, import_react28.useEffect)(() => {
|
|
5156
5194
|
if (range) {
|
|
5157
5195
|
if (startDate && endDate) {
|
|
5158
5196
|
setInputValue(`${formatDate(startDate)} - ${formatDate(endDate)}`);
|
|
@@ -5169,7 +5207,7 @@ function ITDatePicker({
|
|
|
5169
5207
|
}
|
|
5170
5208
|
}
|
|
5171
5209
|
}, [startDate, endDate, range]);
|
|
5172
|
-
(0,
|
|
5210
|
+
(0, import_react28.useEffect)(() => {
|
|
5173
5211
|
const handleClickOutside = (event) => {
|
|
5174
5212
|
const target = event.target;
|
|
5175
5213
|
const inWrapper = wrapperRef.current?.contains(target);
|
|
@@ -5464,11 +5502,11 @@ function ITDataTable({
|
|
|
5464
5502
|
footerStyle
|
|
5465
5503
|
}) {
|
|
5466
5504
|
const { t, locale } = useITTranslation();
|
|
5467
|
-
const [viewMode, setViewMode] = (0,
|
|
5505
|
+
const [viewMode, setViewMode] = (0, import_react29.useState)(defaultView || "table");
|
|
5468
5506
|
const { ref: rootRef, width: containerWidth } = useElementSize();
|
|
5469
|
-
const [data, setData] = (0,
|
|
5470
|
-
const [totalItems, setTotalItems] = (0,
|
|
5471
|
-
const [isLoading, setIsLoading] = (0,
|
|
5507
|
+
const [data, setData] = (0, import_react29.useState)([]);
|
|
5508
|
+
const [totalItems, setTotalItems] = (0, import_react29.useState)(0);
|
|
5509
|
+
const [isLoading, setIsLoading] = (0, import_react29.useState)(fetchOnMount);
|
|
5472
5510
|
const colorVars = {
|
|
5473
5511
|
...colors?.headerBg ? { "--color-table-headerBg": colors.headerBg } : {},
|
|
5474
5512
|
...colors?.headerText ? { "--color-table-headerText": colors.headerText } : {},
|
|
@@ -5489,7 +5527,7 @@ function ITDataTable({
|
|
|
5489
5527
|
const isStickyHeader = stickyHeader && isTableVirtual;
|
|
5490
5528
|
const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
|
|
5491
5529
|
const columnCount = columns.length;
|
|
5492
|
-
const pinnedMeta =
|
|
5530
|
+
const pinnedMeta = import_react29.default.useMemo(() => getPinnedColumnMeta(columns), [columns]);
|
|
5493
5531
|
const scrollOuterClass = isTableVirtual ? "relative min-h-[200px]" : "overflow-x-auto relative min-h-[200px]";
|
|
5494
5532
|
const {
|
|
5495
5533
|
currentPage,
|
|
@@ -5515,15 +5553,15 @@ function ITDataTable({
|
|
|
5515
5553
|
resetKey: `${currentPage}-${itemsPerPage}`
|
|
5516
5554
|
});
|
|
5517
5555
|
const windowData = isTableVirtual ? data.slice(startIndex, endIndex + 1) : data;
|
|
5518
|
-
const debounceTimerRef = (0,
|
|
5519
|
-
const hasFetchedRef = (0,
|
|
5520
|
-
const fetchDataRef = (0,
|
|
5556
|
+
const debounceTimerRef = (0, import_react29.useRef)(null);
|
|
5557
|
+
const hasFetchedRef = (0, import_react29.useRef)(false);
|
|
5558
|
+
const fetchDataRef = (0, import_react29.useRef)(fetchData);
|
|
5521
5559
|
fetchDataRef.current = fetchData;
|
|
5522
|
-
const externalFiltersRef = (0,
|
|
5560
|
+
const externalFiltersRef = (0, import_react29.useRef)(externalFilters);
|
|
5523
5561
|
externalFiltersRef.current = externalFilters;
|
|
5524
5562
|
const externalKey = JSON.stringify(externalFilters);
|
|
5525
5563
|
const computedTotalPages = Math.ceil(totalItems / itemsPerPage) || 1;
|
|
5526
|
-
const performFetch = (0,
|
|
5564
|
+
const performFetch = (0, import_react29.useCallback)(async () => {
|
|
5527
5565
|
setIsLoading(true);
|
|
5528
5566
|
try {
|
|
5529
5567
|
const response = await fetchDataRef.current({
|
|
@@ -5544,9 +5582,9 @@ function ITDataTable({
|
|
|
5544
5582
|
setIsLoading(false);
|
|
5545
5583
|
}
|
|
5546
5584
|
}, [currentPage, itemsPerPage, filters, sortConfig]);
|
|
5547
|
-
const performFetchRef = (0,
|
|
5585
|
+
const performFetchRef = (0, import_react29.useRef)(performFetch);
|
|
5548
5586
|
performFetchRef.current = performFetch;
|
|
5549
|
-
(0,
|
|
5587
|
+
(0, import_react29.useEffect)(() => {
|
|
5550
5588
|
if (!fetchOnMount && !hasFetchedRef.current) return;
|
|
5551
5589
|
if (debounceTimerRef.current) clearTimeout(debounceTimerRef.current);
|
|
5552
5590
|
debounceTimerRef.current = setTimeout(() => {
|
|
@@ -5985,7 +6023,7 @@ function ITDataTable({
|
|
|
5985
6023
|
|
|
5986
6024
|
// src/components/organisms/dialog/dialog.tsx
|
|
5987
6025
|
var import_react_dom5 = require("react-dom");
|
|
5988
|
-
var
|
|
6026
|
+
var import_react30 = require("react");
|
|
5989
6027
|
var import_fa15 = require("react-icons/fa");
|
|
5990
6028
|
|
|
5991
6029
|
// src/components/molecules/form-header/form-header.tsx
|
|
@@ -6111,9 +6149,9 @@ function ITDialog({
|
|
|
6111
6149
|
padded = true
|
|
6112
6150
|
}) {
|
|
6113
6151
|
const { t } = useITTranslation();
|
|
6114
|
-
const modalRef = (0,
|
|
6152
|
+
const modalRef = (0, import_react30.useRef)(null);
|
|
6115
6153
|
useClickOutside_default(modalRef, onClose);
|
|
6116
|
-
(0,
|
|
6154
|
+
(0, import_react30.useEffect)(() => {
|
|
6117
6155
|
const handleEscape = (event) => {
|
|
6118
6156
|
if (event.key === "Escape") {
|
|
6119
6157
|
onClose();
|
|
@@ -6195,7 +6233,7 @@ function ITDivider({
|
|
|
6195
6233
|
// src/components/organisms/drawer/drawer.tsx
|
|
6196
6234
|
var import_clsx29 = __toESM(require("clsx"), 1);
|
|
6197
6235
|
var import_fa16 = require("react-icons/fa");
|
|
6198
|
-
var
|
|
6236
|
+
var import_react31 = require("react");
|
|
6199
6237
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
6200
6238
|
function ITDrawer({
|
|
6201
6239
|
isOpen,
|
|
@@ -6208,7 +6246,7 @@ function ITDrawer({
|
|
|
6208
6246
|
style
|
|
6209
6247
|
}) {
|
|
6210
6248
|
const { t } = useITTranslation();
|
|
6211
|
-
const panelRef = (0,
|
|
6249
|
+
const panelRef = (0, import_react31.useRef)(null);
|
|
6212
6250
|
useClickOutside_default(panelRef, onClose);
|
|
6213
6251
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_jsx_runtime33.Fragment, { children: isOpen && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "fixed inset-0 z-[50] flex", children: [
|
|
6214
6252
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm transition-opacity" }),
|
|
@@ -6263,36 +6301,36 @@ function ITEmptyState({
|
|
|
6263
6301
|
}
|
|
6264
6302
|
|
|
6265
6303
|
// src/components/organisms/form-builder/formBuilder.tsx
|
|
6266
|
-
var
|
|
6304
|
+
var import_react36 = require("react");
|
|
6267
6305
|
|
|
6268
6306
|
// src/components/organisms/form-builder/formBuilder.context.tsx
|
|
6269
|
-
var
|
|
6307
|
+
var import_react32 = __toESM(require("react"), 1);
|
|
6270
6308
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
6271
|
-
var ITFormBuilderContext = (0,
|
|
6309
|
+
var ITFormBuilderContext = (0, import_react32.createContext)(void 0);
|
|
6272
6310
|
var ITFormBuilderProvider = ({
|
|
6273
6311
|
children,
|
|
6274
6312
|
value
|
|
6275
6313
|
}) => {
|
|
6276
|
-
const [fieldRegistry, setFieldRegistry] = (0,
|
|
6277
|
-
const registerField =
|
|
6314
|
+
const [fieldRegistry, setFieldRegistry] = (0, import_react32.useState)({});
|
|
6315
|
+
const registerField = import_react32.default.useCallback((name, config2) => {
|
|
6278
6316
|
setFieldRegistry((prev) => ({ ...prev, [name]: config2 }));
|
|
6279
6317
|
}, []);
|
|
6280
|
-
const unregisterField =
|
|
6318
|
+
const unregisterField = import_react32.default.useCallback((name) => {
|
|
6281
6319
|
setFieldRegistry((prev) => {
|
|
6282
6320
|
const next = { ...prev };
|
|
6283
6321
|
delete next[name];
|
|
6284
6322
|
return next;
|
|
6285
6323
|
});
|
|
6286
6324
|
}, []);
|
|
6287
|
-
const getFieldConfig =
|
|
6325
|
+
const getFieldConfig = import_react32.default.useCallback(
|
|
6288
6326
|
(name) => fieldRegistry[name],
|
|
6289
6327
|
[fieldRegistry]
|
|
6290
6328
|
);
|
|
6291
|
-
const getAllFieldConfigs =
|
|
6329
|
+
const getAllFieldConfigs = import_react32.default.useCallback(
|
|
6292
6330
|
() => Object.values(fieldRegistry),
|
|
6293
6331
|
[fieldRegistry]
|
|
6294
6332
|
);
|
|
6295
|
-
const contextValue =
|
|
6333
|
+
const contextValue = import_react32.default.useMemo(
|
|
6296
6334
|
() => ({
|
|
6297
6335
|
...value,
|
|
6298
6336
|
registerField,
|
|
@@ -6305,7 +6343,7 @@ var ITFormBuilderProvider = ({
|
|
|
6305
6343
|
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ITFormBuilderContext.Provider, { value: contextValue, children });
|
|
6306
6344
|
};
|
|
6307
6345
|
var useITFormBuilderContext = () => {
|
|
6308
|
-
const context = (0,
|
|
6346
|
+
const context = (0, import_react32.useContext)(ITFormBuilderContext);
|
|
6309
6347
|
if (!context) {
|
|
6310
6348
|
throw new Error("useITFormBuilderContext must be used within an ITFormBuilderProvider");
|
|
6311
6349
|
}
|
|
@@ -6313,12 +6351,12 @@ var useITFormBuilderContext = () => {
|
|
|
6313
6351
|
};
|
|
6314
6352
|
|
|
6315
6353
|
// src/components/organisms/form-builder/fieldRenderer.tsx
|
|
6316
|
-
var
|
|
6354
|
+
var import_react35 = require("react");
|
|
6317
6355
|
var import_clsx32 = __toESM(require("clsx"), 1);
|
|
6318
6356
|
|
|
6319
6357
|
// src/components/molecules/time-picker/timePicker.tsx
|
|
6320
6358
|
var import_clsx31 = __toESM(require("clsx"), 1);
|
|
6321
|
-
var
|
|
6359
|
+
var import_react33 = require("react");
|
|
6322
6360
|
var import_react_dom6 = require("react-dom");
|
|
6323
6361
|
var import_fa18 = require("react-icons/fa");
|
|
6324
6362
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
@@ -6339,12 +6377,12 @@ function ITTimePicker({
|
|
|
6339
6377
|
color = "primary"
|
|
6340
6378
|
}) {
|
|
6341
6379
|
const { t } = useITTranslation();
|
|
6342
|
-
const [isOpen, setIsOpen] = (0,
|
|
6343
|
-
const [inputValue, setInputValue] = (0,
|
|
6344
|
-
const [isValidTime, setIsValidTime] = (0,
|
|
6345
|
-
const wrapperRef = (0,
|
|
6346
|
-
const hoursRef = (0,
|
|
6347
|
-
const minutesRef = (0,
|
|
6380
|
+
const [isOpen, setIsOpen] = (0, import_react33.useState)(false);
|
|
6381
|
+
const [inputValue, setInputValue] = (0, import_react33.useState)(value || "");
|
|
6382
|
+
const [isValidTime, setIsValidTime] = (0, import_react33.useState)(true);
|
|
6383
|
+
const wrapperRef = (0, import_react33.useRef)(null);
|
|
6384
|
+
const hoursRef = (0, import_react33.useRef)(null);
|
|
6385
|
+
const minutesRef = (0, import_react33.useRef)(null);
|
|
6348
6386
|
const { panelRef: dropdownRef, style: panelStyle } = useFloatingPanel(
|
|
6349
6387
|
wrapperRef,
|
|
6350
6388
|
isOpen && !disabled,
|
|
@@ -6358,7 +6396,7 @@ function ITTimePicker({
|
|
|
6358
6396
|
const isThemeColor = color in theme.colors;
|
|
6359
6397
|
const highlightColor = isThemeColor ? theme.colors[color][50] : "#f3f4f6";
|
|
6360
6398
|
const activeColor = isThemeColor ? theme.colors[color][100] : "#e5e7eb";
|
|
6361
|
-
(0,
|
|
6399
|
+
(0, import_react33.useEffect)(() => {
|
|
6362
6400
|
setInputValue(value || "");
|
|
6363
6401
|
}, [value]);
|
|
6364
6402
|
const validateTime = (timeString) => {
|
|
@@ -6367,7 +6405,7 @@ function ITTimePicker({
|
|
|
6367
6405
|
};
|
|
6368
6406
|
const currentHour = validateTime(inputValue) ? inputValue.split(":")[0] : null;
|
|
6369
6407
|
const currentMinute = validateTime(inputValue) ? inputValue.split(":")[1] : null;
|
|
6370
|
-
(0,
|
|
6408
|
+
(0, import_react33.useEffect)(() => {
|
|
6371
6409
|
if (isOpen) {
|
|
6372
6410
|
setTimeout(() => {
|
|
6373
6411
|
if (hoursRef.current && currentHour) {
|
|
@@ -6574,26 +6612,26 @@ function ITTimePicker({
|
|
|
6574
6612
|
}
|
|
6575
6613
|
|
|
6576
6614
|
// src/components/organisms/form-builder/useFormBuilder.ts
|
|
6577
|
-
var
|
|
6615
|
+
var import_react34 = require("react");
|
|
6578
6616
|
var useFieldRules = (config2, dependentValues) => {
|
|
6579
6617
|
const { getFieldConfig } = useITFormBuilderContext();
|
|
6580
6618
|
const fieldConfig = getFieldConfig(config2.name) || config2;
|
|
6581
|
-
const isVisible = (0,
|
|
6619
|
+
const isVisible = (0, import_react34.useMemo)(() => {
|
|
6582
6620
|
if (!fieldConfig.renderWhen) return true;
|
|
6583
6621
|
return fieldConfig.renderWhen(dependentValues);
|
|
6584
6622
|
}, [fieldConfig, dependentValues]);
|
|
6585
|
-
const dynamicProps = (0,
|
|
6623
|
+
const dynamicProps = (0, import_react34.useMemo)(() => {
|
|
6586
6624
|
if (!fieldConfig.dynamicProps) return {};
|
|
6587
6625
|
return fieldConfig.dynamicProps(dependentValues);
|
|
6588
6626
|
}, [fieldConfig, dependentValues]);
|
|
6589
|
-
const isRequired = (0,
|
|
6627
|
+
const isRequired = (0, import_react34.useMemo)(() => {
|
|
6590
6628
|
if (typeof dynamicProps.required !== "undefined") return dynamicProps.required;
|
|
6591
6629
|
if (typeof fieldConfig.required === "function") {
|
|
6592
6630
|
return fieldConfig.required(dependentValues);
|
|
6593
6631
|
}
|
|
6594
6632
|
return !!fieldConfig.required;
|
|
6595
6633
|
}, [fieldConfig, dynamicProps.required, dependentValues]);
|
|
6596
|
-
const isDisabled = (0,
|
|
6634
|
+
const isDisabled = (0, import_react34.useMemo)(() => {
|
|
6597
6635
|
if (typeof dynamicProps.disabled !== "undefined") return dynamicProps.disabled;
|
|
6598
6636
|
if (typeof fieldConfig.disabled === "function") {
|
|
6599
6637
|
return fieldConfig.disabled(dependentValues);
|
|
@@ -6607,11 +6645,11 @@ var useFieldRules = (config2, dependentValues) => {
|
|
|
6607
6645
|
var import_fa19 = require("react-icons/fa");
|
|
6608
6646
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
6609
6647
|
function useAsyncOptions(options, deps) {
|
|
6610
|
-
const [resolved, setResolved] = (0,
|
|
6611
|
-
const [loading, setLoading] = (0,
|
|
6612
|
-
const optionsRef = (0,
|
|
6648
|
+
const [resolved, setResolved] = (0, import_react35.useState)([]);
|
|
6649
|
+
const [loading, setLoading] = (0, import_react35.useState)(false);
|
|
6650
|
+
const optionsRef = (0, import_react35.useRef)(options);
|
|
6613
6651
|
optionsRef.current = options;
|
|
6614
|
-
(0,
|
|
6652
|
+
(0, import_react35.useEffect)(() => {
|
|
6615
6653
|
const opts = optionsRef.current;
|
|
6616
6654
|
let cancelled = false;
|
|
6617
6655
|
if (typeof opts === "function") {
|
|
@@ -6655,13 +6693,13 @@ var ITFieldRenderer = ({
|
|
|
6655
6693
|
config2,
|
|
6656
6694
|
dependentValues
|
|
6657
6695
|
);
|
|
6658
|
-
(0,
|
|
6696
|
+
(0, import_react35.useEffect)(() => {
|
|
6659
6697
|
context.registerField(config2.name, config2);
|
|
6660
6698
|
return () => {
|
|
6661
6699
|
context.unregisterField(config2.name);
|
|
6662
6700
|
};
|
|
6663
6701
|
}, [config2.name]);
|
|
6664
|
-
const activeConfig = (0,
|
|
6702
|
+
const activeConfig = (0, import_react35.useMemo)(
|
|
6665
6703
|
() => ({
|
|
6666
6704
|
...config2,
|
|
6667
6705
|
...dynamicProps,
|
|
@@ -6687,7 +6725,7 @@ var ITFieldRenderer = ({
|
|
|
6687
6725
|
options,
|
|
6688
6726
|
[options, dependentValues]
|
|
6689
6727
|
);
|
|
6690
|
-
const handleChangeWrapper = (0,
|
|
6728
|
+
const handleChangeWrapper = (0, import_react35.useCallback)(
|
|
6691
6729
|
async (val) => {
|
|
6692
6730
|
const finalValue = val && typeof val === "object" && "target" in val ? val.target.value : val;
|
|
6693
6731
|
await context.setFieldValue(name, finalValue);
|
|
@@ -6898,7 +6936,7 @@ var ITFieldRenderer = ({
|
|
|
6898
6936
|
}
|
|
6899
6937
|
);
|
|
6900
6938
|
};
|
|
6901
|
-
var fieldRenderer_default = (0,
|
|
6939
|
+
var fieldRenderer_default = (0, import_react35.memo)(ITFieldRenderer);
|
|
6902
6940
|
|
|
6903
6941
|
// src/components/organisms/form-builder/formBuilder.tsx
|
|
6904
6942
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
@@ -6929,7 +6967,7 @@ function ITFormBuilder({
|
|
|
6929
6967
|
isSubmitting = false,
|
|
6930
6968
|
children
|
|
6931
6969
|
}) {
|
|
6932
|
-
const providerValue = (0,
|
|
6970
|
+
const providerValue = (0, import_react36.useMemo)(
|
|
6933
6971
|
() => ({
|
|
6934
6972
|
config: config2 || [],
|
|
6935
6973
|
values: values || {},
|
|
@@ -7081,7 +7119,7 @@ function ITFormBuilder({
|
|
|
7081
7119
|
}
|
|
7082
7120
|
|
|
7083
7121
|
// src/components/atoms/image/image.tsx
|
|
7084
|
-
var
|
|
7122
|
+
var import_react37 = require("react");
|
|
7085
7123
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
7086
7124
|
var ITImage = ({
|
|
7087
7125
|
src,
|
|
@@ -7090,7 +7128,7 @@ var ITImage = ({
|
|
|
7090
7128
|
fallback = "",
|
|
7091
7129
|
fit = "cover"
|
|
7092
7130
|
}) => {
|
|
7093
|
-
const [imageError, setImageError] = (0,
|
|
7131
|
+
const [imageError, setImageError] = (0, import_react37.useState)(false);
|
|
7094
7132
|
const { t } = useITTranslation();
|
|
7095
7133
|
const handleImageError = () => {
|
|
7096
7134
|
setImageError(true);
|
|
@@ -7165,7 +7203,7 @@ function ITInputNumber({
|
|
|
7165
7203
|
}
|
|
7166
7204
|
|
|
7167
7205
|
// src/components/organisms/navbar/navbar.tsx
|
|
7168
|
-
var
|
|
7206
|
+
var import_react38 = require("react");
|
|
7169
7207
|
var import_fa20 = require("react-icons/fa");
|
|
7170
7208
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
7171
7209
|
function ITNavbar({
|
|
@@ -7181,9 +7219,9 @@ function ITNavbar({
|
|
|
7181
7219
|
sidebarItems
|
|
7182
7220
|
}) {
|
|
7183
7221
|
const { t } = useITTranslation();
|
|
7184
|
-
const [isUserMenuOpen, setIsUserMenuOpen] = (0,
|
|
7185
|
-
const [expandedItems, setExpandedItems] = (0,
|
|
7186
|
-
const userMenuRef = (0,
|
|
7222
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react38.useState)(false);
|
|
7223
|
+
const [expandedItems, setExpandedItems] = (0, import_react38.useState)(/* @__PURE__ */ new Set());
|
|
7224
|
+
const userMenuRef = (0, import_react38.useRef)(null);
|
|
7187
7225
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
7188
7226
|
const toggleUserMenu = () => {
|
|
7189
7227
|
setIsUserMenuOpen(!isUserMenuOpen);
|
|
@@ -7618,7 +7656,7 @@ function ITPage(props) {
|
|
|
7618
7656
|
}
|
|
7619
7657
|
|
|
7620
7658
|
// src/components/atoms/popover/popover.tsx
|
|
7621
|
-
var
|
|
7659
|
+
var import_react39 = require("react");
|
|
7622
7660
|
var import_clsx35 = __toESM(require("clsx"), 1);
|
|
7623
7661
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
7624
7662
|
var positionClasses = {
|
|
@@ -7635,10 +7673,10 @@ function ITPopover({
|
|
|
7635
7673
|
onClose,
|
|
7636
7674
|
className
|
|
7637
7675
|
}) {
|
|
7638
|
-
const [internalOpen, setInternalOpen] = (0,
|
|
7676
|
+
const [internalOpen, setInternalOpen] = (0, import_react39.useState)(false);
|
|
7639
7677
|
const isControlled = controlledOpen !== void 0;
|
|
7640
7678
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
7641
|
-
const ref = (0,
|
|
7679
|
+
const ref = (0, import_react39.useRef)(null);
|
|
7642
7680
|
useClickOutside_default(ref, () => {
|
|
7643
7681
|
if (isControlled) onClose?.();
|
|
7644
7682
|
else setInternalOpen(false);
|
|
@@ -7766,7 +7804,7 @@ function ITRadioGroup({
|
|
|
7766
7804
|
|
|
7767
7805
|
// src/components/organisms/searchTable/searchTable.tsx
|
|
7768
7806
|
var import_clsx39 = __toESM(require("clsx"), 1);
|
|
7769
|
-
var
|
|
7807
|
+
var import_react40 = require("react");
|
|
7770
7808
|
|
|
7771
7809
|
// src/components/organisms/searchTable/components/SearchInput.tsx
|
|
7772
7810
|
var import_fa22 = require("react-icons/fa");
|
|
@@ -8257,7 +8295,7 @@ function ITSearchTable({
|
|
|
8257
8295
|
onCancel
|
|
8258
8296
|
}) {
|
|
8259
8297
|
const { t } = useITTranslation();
|
|
8260
|
-
const [itemsPerPage, setItemsPerPage] = (0,
|
|
8298
|
+
const [itemsPerPage, setItemsPerPage] = (0, import_react40.useState)(defaultItemsPerPage);
|
|
8261
8299
|
const { searchTerm, handleSearchChange, handleClearSearch } = useDebouncedSearch({
|
|
8262
8300
|
initialValue: searchTermInitial,
|
|
8263
8301
|
onSearch: (value) => {
|
|
@@ -8423,7 +8461,7 @@ function ITSegmentedControl({
|
|
|
8423
8461
|
}
|
|
8424
8462
|
|
|
8425
8463
|
// src/components/organisms/sidebar/sidebar.tsx
|
|
8426
|
-
var
|
|
8464
|
+
var import_react41 = require("react");
|
|
8427
8465
|
var import_clsx41 = __toESM(require("clsx"), 1);
|
|
8428
8466
|
var import_fa26 = require("react-icons/fa");
|
|
8429
8467
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
@@ -8464,12 +8502,12 @@ function ITSidebar({
|
|
|
8464
8502
|
}) {
|
|
8465
8503
|
const flat = useITFlatAppearance();
|
|
8466
8504
|
const { t } = useITTranslation();
|
|
8467
|
-
const [expandedItems, setExpandedItems] = (0,
|
|
8468
|
-
const [isHovering, setIsHovering] = (0,
|
|
8469
|
-
const sidebarRef = (0,
|
|
8470
|
-
const hoverTimeoutRef = (0,
|
|
8471
|
-
const leaveTimeoutRef = (0,
|
|
8472
|
-
(0,
|
|
8505
|
+
const [expandedItems, setExpandedItems] = (0, import_react41.useState)(/* @__PURE__ */ new Set());
|
|
8506
|
+
const [isHovering, setIsHovering] = (0, import_react41.useState)(false);
|
|
8507
|
+
const sidebarRef = (0, import_react41.useRef)(null);
|
|
8508
|
+
const hoverTimeoutRef = (0, import_react41.useRef)(null);
|
|
8509
|
+
const leaveTimeoutRef = (0, import_react41.useRef)(null);
|
|
8510
|
+
(0, import_react41.useEffect)(() => {
|
|
8473
8511
|
const hoverTimer = hoverTimeoutRef.current;
|
|
8474
8512
|
const leaveTimer = leaveTimeoutRef.current;
|
|
8475
8513
|
const handleMouseEnter = () => {
|
|
@@ -8496,7 +8534,7 @@ function ITSidebar({
|
|
|
8496
8534
|
if (leaveTimer) clearTimeout(leaveTimer);
|
|
8497
8535
|
};
|
|
8498
8536
|
}, [isCollapsed]);
|
|
8499
|
-
(0,
|
|
8537
|
+
(0, import_react41.useEffect)(() => {
|
|
8500
8538
|
const activeParents = /* @__PURE__ */ new Set();
|
|
8501
8539
|
navigationItems.forEach((item) => {
|
|
8502
8540
|
if (item.subitems && flattenSubItems(item.subitems).some((sub) => sub.isActive)) {
|
|
@@ -8911,7 +8949,7 @@ function ITSidebar({
|
|
|
8911
8949
|
}
|
|
8912
8950
|
|
|
8913
8951
|
// src/components/atoms/slide/slide.tsx
|
|
8914
|
-
var
|
|
8952
|
+
var import_react42 = require("react");
|
|
8915
8953
|
var import_clsx42 = __toESM(require("clsx"), 1);
|
|
8916
8954
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
8917
8955
|
function ITSlideToggle({
|
|
@@ -8928,8 +8966,8 @@ function ITSlideToggle({
|
|
|
8928
8966
|
className = ""
|
|
8929
8967
|
}) {
|
|
8930
8968
|
const isControlled = controlledIsOn !== void 0;
|
|
8931
|
-
const [internalIsOn, setInternalIsOn] = (0,
|
|
8932
|
-
(0,
|
|
8969
|
+
const [internalIsOn, setInternalIsOn] = (0, import_react42.useState)(initialState);
|
|
8970
|
+
(0, import_react42.useEffect)(() => {
|
|
8933
8971
|
if (isControlled) {
|
|
8934
8972
|
setInternalIsOn(controlledIsOn);
|
|
8935
8973
|
}
|
|
@@ -9113,7 +9151,7 @@ function ITStatCard({
|
|
|
9113
9151
|
}
|
|
9114
9152
|
|
|
9115
9153
|
// src/components/molecules/line-bar-chart/line-bar-chart.tsx
|
|
9116
|
-
var
|
|
9154
|
+
var import_react43 = require("react");
|
|
9117
9155
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
9118
9156
|
function ITLineBarChart({
|
|
9119
9157
|
data,
|
|
@@ -9122,6 +9160,8 @@ function ITLineBarChart({
|
|
|
9122
9160
|
barLabel,
|
|
9123
9161
|
lineColor = "#10b981",
|
|
9124
9162
|
barColor = "#3b82f6",
|
|
9163
|
+
showLine = true,
|
|
9164
|
+
showBars = true,
|
|
9125
9165
|
height = 240,
|
|
9126
9166
|
formatValue,
|
|
9127
9167
|
formatAxis,
|
|
@@ -9132,15 +9172,18 @@ function ITLineBarChart({
|
|
|
9132
9172
|
const resolvedBarLabel = barLabel ?? t("lineBarChart.barLabel");
|
|
9133
9173
|
const resolvedFormatAxis = formatAxis ?? ((value) => formatNumber(value, { notation: "compact", maximumFractionDigits: 1 }));
|
|
9134
9174
|
const resolvedFormatValue = formatValue ?? ((value) => formatNumber(value));
|
|
9135
|
-
const gradientId = (0,
|
|
9136
|
-
const [hover, setHover] = (0,
|
|
9175
|
+
const gradientId = (0, import_react43.useId)().replace(/[:]/g, "");
|
|
9176
|
+
const [hover, setHover] = (0, import_react43.useState)(null);
|
|
9137
9177
|
const width = 720;
|
|
9138
9178
|
const padding = { top: 16, right: 16, bottom: 28, left: 52 };
|
|
9139
9179
|
const plotWidth = width - padding.left - padding.right;
|
|
9140
9180
|
const plotHeight = height - padding.top - padding.bottom;
|
|
9141
|
-
const max = (0,
|
|
9142
|
-
() => Math.max(
|
|
9143
|
-
|
|
9181
|
+
const max = (0, import_react43.useMemo)(
|
|
9182
|
+
() => Math.max(
|
|
9183
|
+
...data.flatMap((d) => [showLine ? d.line : 0, showBars ? d.bar : 0]),
|
|
9184
|
+
1
|
|
9185
|
+
),
|
|
9186
|
+
[data, showLine, showBars]
|
|
9144
9187
|
);
|
|
9145
9188
|
const gridValues = [0, 0.25, 0.5, 0.75, 1].map((f) => max * f);
|
|
9146
9189
|
const step = data.length > 0 ? plotWidth / data.length : plotWidth;
|
|
@@ -9184,7 +9227,7 @@ function ITLineBarChart({
|
|
|
9184
9227
|
),
|
|
9185
9228
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("text", { x: padding.left - 8, y: y(value) + 3, textAnchor: "end", fontSize: 10, fill: "#94a3b8", children: resolvedFormatAxis(Math.round(value)) })
|
|
9186
9229
|
] }, i)),
|
|
9187
|
-
data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
9230
|
+
showBars && data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
9188
9231
|
"rect",
|
|
9189
9232
|
{
|
|
9190
9233
|
x: x(i) - barWidth / 2,
|
|
@@ -9197,8 +9240,8 @@ function ITLineBarChart({
|
|
|
9197
9240
|
},
|
|
9198
9241
|
`bar-${d.label}`
|
|
9199
9242
|
)),
|
|
9200
|
-
areaPath && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("path", { d: areaPath, fill: `url(#area-${gradientId})` }),
|
|
9201
|
-
data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
9243
|
+
showLine && areaPath && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("path", { d: areaPath, fill: `url(#area-${gradientId})` }),
|
|
9244
|
+
showLine && data.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
9202
9245
|
"polyline",
|
|
9203
9246
|
{
|
|
9204
9247
|
points: linePoints,
|
|
@@ -9209,7 +9252,7 @@ function ITLineBarChart({
|
|
|
9209
9252
|
strokeLinejoin: "round"
|
|
9210
9253
|
}
|
|
9211
9254
|
),
|
|
9212
|
-
data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
9255
|
+
showLine && data.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
9213
9256
|
"circle",
|
|
9214
9257
|
{
|
|
9215
9258
|
cx: x(i),
|
|
@@ -9236,12 +9279,12 @@ function ITLineBarChart({
|
|
|
9236
9279
|
role: "status",
|
|
9237
9280
|
children: [
|
|
9238
9281
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "text-[10px] font-semibold", style: { color: "#e2e8f0" }, children: active.label }),
|
|
9239
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("p", { className: "text-[11px] tabular-nums", style: { color: lineColor }, children: [
|
|
9282
|
+
showLine && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("p", { className: "text-[11px] tabular-nums", style: { color: lineColor }, children: [
|
|
9240
9283
|
resolvedLineLabel,
|
|
9241
9284
|
": ",
|
|
9242
9285
|
resolvedFormatValue(active.line)
|
|
9243
9286
|
] }),
|
|
9244
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("p", { className: "text-[11px] tabular-nums", style: { color: "#93c5fd" }, children: [
|
|
9287
|
+
showBars && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("p", { className: "text-[11px] tabular-nums", style: { color: "#93c5fd" }, children: [
|
|
9245
9288
|
resolvedBarLabel,
|
|
9246
9289
|
": ",
|
|
9247
9290
|
resolvedFormatValue(active.bar)
|
|
@@ -9250,11 +9293,11 @@ function ITLineBarChart({
|
|
|
9250
9293
|
}
|
|
9251
9294
|
),
|
|
9252
9295
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("ul", { className: "flex flex-wrap items-center gap-4 text-[11px]", style: { color: "#475569" }, children: [
|
|
9253
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("li", { children: [
|
|
9296
|
+
showLine && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("li", { children: [
|
|
9254
9297
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "h-2.5 w-2.5 rounded-sm", style: { background: lineColor }, "aria-hidden": true }),
|
|
9255
9298
|
resolvedLineLabel
|
|
9256
9299
|
] }),
|
|
9257
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("li", { children: [
|
|
9300
|
+
showBars && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("li", { children: [
|
|
9258
9301
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "h-2.5 w-2.5 rounded-sm", style: { background: barColor }, "aria-hidden": true }),
|
|
9259
9302
|
resolvedBarLabel
|
|
9260
9303
|
] })
|
|
@@ -9265,7 +9308,7 @@ var line_bar_chart_default = ITLineBarChart;
|
|
|
9265
9308
|
|
|
9266
9309
|
// src/components/molecules/table/table.tsx
|
|
9267
9310
|
var import_clsx45 = __toESM(require("clsx"), 1);
|
|
9268
|
-
var
|
|
9311
|
+
var import_react44 = __toESM(require("react"), 1);
|
|
9269
9312
|
var import_fa27 = require("react-icons/fa");
|
|
9270
9313
|
var import_md2 = require("react-icons/md");
|
|
9271
9314
|
var import_date_fns3 = require("date-fns");
|
|
@@ -9314,7 +9357,7 @@ function ITTable({
|
|
|
9314
9357
|
footerStyle
|
|
9315
9358
|
}) {
|
|
9316
9359
|
const { t, locale } = useITTranslation();
|
|
9317
|
-
const [viewMode, setViewMode] = (0,
|
|
9360
|
+
const [viewMode, setViewMode] = (0, import_react44.useState)(defaultView);
|
|
9318
9361
|
const { ref: rootRef, width: containerWidth } = useElementSize();
|
|
9319
9362
|
const colorVars = {
|
|
9320
9363
|
...colors?.headerBg ? { "--color-table-headerBg": colors.headerBg } : {},
|
|
@@ -9342,7 +9385,7 @@ function ITTable({
|
|
|
9342
9385
|
handleSort,
|
|
9343
9386
|
handleItemsPerPageChange
|
|
9344
9387
|
} = useTableState({ defaultItemsPerPage });
|
|
9345
|
-
const sortedData =
|
|
9388
|
+
const sortedData = import_react44.default.useMemo(() => {
|
|
9346
9389
|
const safeData = Array.isArray(data) ? data : [];
|
|
9347
9390
|
if (!sortConfig) return safeData;
|
|
9348
9391
|
return [...safeData].sort((a, b) => {
|
|
@@ -9432,7 +9475,7 @@ function ITTable({
|
|
|
9432
9475
|
const isStickyHeader = stickyHeader && isTableVirtual;
|
|
9433
9476
|
const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
|
|
9434
9477
|
const columnCount = columns.length;
|
|
9435
|
-
const pinnedMeta =
|
|
9478
|
+
const pinnedMeta = import_react44.default.useMemo(() => getPinnedColumnMeta(columns), [columns]);
|
|
9436
9479
|
const {
|
|
9437
9480
|
scrollRef,
|
|
9438
9481
|
startIndex,
|
|
@@ -9897,6 +9940,7 @@ function ITTable({
|
|
|
9897
9940
|
|
|
9898
9941
|
// src/components/atoms/textarea/textarea.tsx
|
|
9899
9942
|
var import_clsx46 = __toESM(require("clsx"), 1);
|
|
9943
|
+
var import_react45 = require("react");
|
|
9900
9944
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
9901
9945
|
var resizeMap = {
|
|
9902
9946
|
none: "resize-none",
|
|
@@ -9904,7 +9948,7 @@ var resizeMap = {
|
|
|
9904
9948
|
horizontal: "resize-x",
|
|
9905
9949
|
both: "resize"
|
|
9906
9950
|
};
|
|
9907
|
-
|
|
9951
|
+
var ITTextarea = (0, import_react45.forwardRef)(function ITTextarea2({
|
|
9908
9952
|
value,
|
|
9909
9953
|
onChange,
|
|
9910
9954
|
label,
|
|
@@ -9915,13 +9959,16 @@ function ITTextarea({
|
|
|
9915
9959
|
className,
|
|
9916
9960
|
name,
|
|
9917
9961
|
maxLength,
|
|
9918
|
-
resize = "vertical"
|
|
9919
|
-
|
|
9962
|
+
resize = "vertical",
|
|
9963
|
+
onKeyDown,
|
|
9964
|
+
autoFocus = false
|
|
9965
|
+
}, ref) {
|
|
9920
9966
|
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: (0, import_clsx46.default)("flex flex-col gap-1.5", className), children: [
|
|
9921
9967
|
label && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ITText, { as: "label", className: inputLabel(!!error), htmlFor: name, children: label }),
|
|
9922
9968
|
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
9923
9969
|
"textarea",
|
|
9924
9970
|
{
|
|
9971
|
+
ref,
|
|
9925
9972
|
id: name,
|
|
9926
9973
|
name,
|
|
9927
9974
|
value,
|
|
@@ -9930,6 +9977,8 @@ function ITTextarea({
|
|
|
9930
9977
|
rows,
|
|
9931
9978
|
disabled,
|
|
9932
9979
|
maxLength,
|
|
9980
|
+
onKeyDown,
|
|
9981
|
+
autoFocus,
|
|
9933
9982
|
className: (0, import_clsx46.default)(
|
|
9934
9983
|
"w-full border border-solid transition-all duration-200 rounded-lg px-3 py-2 text-sm outline-none",
|
|
9935
9984
|
"focus:ring-2",
|
|
@@ -9941,10 +9990,12 @@ function ITTextarea({
|
|
|
9941
9990
|
),
|
|
9942
9991
|
error && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(ITText, { as: "span", className: inputError, children: error })
|
|
9943
9992
|
] });
|
|
9944
|
-
}
|
|
9993
|
+
});
|
|
9994
|
+
ITTextarea.displayName = "ITTextarea";
|
|
9995
|
+
var textarea_default = ITTextarea;
|
|
9945
9996
|
|
|
9946
9997
|
// src/components/molecules/tabs/tabs.tsx
|
|
9947
|
-
var
|
|
9998
|
+
var import_react46 = require("react");
|
|
9948
9999
|
var import_clsx47 = require("clsx");
|
|
9949
10000
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
9950
10001
|
var ITTabs = ({
|
|
@@ -9955,7 +10006,7 @@ var ITTabs = ({
|
|
|
9955
10006
|
className = "",
|
|
9956
10007
|
containerClassName = ""
|
|
9957
10008
|
}) => {
|
|
9958
|
-
const [activeId, setActiveId] = (0,
|
|
10009
|
+
const [activeId, setActiveId] = (0, import_react46.useState)(defaultActiveId || items[0]?.id);
|
|
9959
10010
|
const handleTabClick = (id, disabled) => {
|
|
9960
10011
|
if (disabled) return;
|
|
9961
10012
|
setActiveId(id);
|
|
@@ -10055,7 +10106,7 @@ var positionStyles = {
|
|
|
10055
10106
|
|
|
10056
10107
|
// src/components/organisms/toast/toast.tsx
|
|
10057
10108
|
var import_clsx49 = __toESM(require("clsx"), 1);
|
|
10058
|
-
var
|
|
10109
|
+
var import_react47 = require("react");
|
|
10059
10110
|
var import_fa28 = require("react-icons/fa");
|
|
10060
10111
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
10061
10112
|
function ITToast({
|
|
@@ -10066,8 +10117,8 @@ function ITToast({
|
|
|
10066
10117
|
onClose
|
|
10067
10118
|
}) {
|
|
10068
10119
|
const { t } = useITTranslation();
|
|
10069
|
-
const [isVisible, setIsVisible] = (0,
|
|
10070
|
-
(0,
|
|
10120
|
+
const [isVisible, setIsVisible] = (0, import_react47.useState)(true);
|
|
10121
|
+
(0, import_react47.useEffect)(() => {
|
|
10071
10122
|
const timer = setTimeout(() => {
|
|
10072
10123
|
setIsVisible(false);
|
|
10073
10124
|
setTimeout(() => {
|
|
@@ -10133,7 +10184,7 @@ function ITToast({
|
|
|
10133
10184
|
}
|
|
10134
10185
|
|
|
10135
10186
|
// src/components/molecules/wysiwyg/wysiwyg.tsx
|
|
10136
|
-
var
|
|
10187
|
+
var import_react49 = require("react");
|
|
10137
10188
|
var import_clsx51 = __toESM(require("clsx"), 1);
|
|
10138
10189
|
var import_fa29 = require("react-icons/fa");
|
|
10139
10190
|
|
|
@@ -10149,7 +10200,7 @@ var toolbarActions = [
|
|
|
10149
10200
|
];
|
|
10150
10201
|
|
|
10151
10202
|
// src/components/atoms/tooltip/tooltip.tsx
|
|
10152
|
-
var
|
|
10203
|
+
var import_react48 = require("react");
|
|
10153
10204
|
var import_clsx50 = __toESM(require("clsx"), 1);
|
|
10154
10205
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
10155
10206
|
var positionClasses2 = {
|
|
@@ -10171,7 +10222,7 @@ function ITTooltip({
|
|
|
10171
10222
|
delay = 200,
|
|
10172
10223
|
className
|
|
10173
10224
|
}) {
|
|
10174
|
-
const [visible, setVisible] = (0,
|
|
10225
|
+
const [visible, setVisible] = (0, import_react48.useState)(false);
|
|
10175
10226
|
let timeout;
|
|
10176
10227
|
const handleMouseEnter = () => {
|
|
10177
10228
|
timeout = setTimeout(() => setVisible(true), delay);
|
|
@@ -10234,12 +10285,12 @@ function ITWysiwyg({
|
|
|
10234
10285
|
className
|
|
10235
10286
|
}) {
|
|
10236
10287
|
const { t } = useITTranslation();
|
|
10237
|
-
const editorRef = (0,
|
|
10238
|
-
const focusedRef = (0,
|
|
10239
|
-
const [active, setActive] = (0,
|
|
10288
|
+
const editorRef = (0, import_react49.useRef)(null);
|
|
10289
|
+
const focusedRef = (0, import_react49.useRef)(false);
|
|
10290
|
+
const [active, setActive] = (0, import_react49.useState)({});
|
|
10240
10291
|
const isLocked = disabled || readOnly;
|
|
10241
10292
|
const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
|
|
10242
|
-
const findAncestor = (0,
|
|
10293
|
+
const findAncestor = (0, import_react49.useCallback)(
|
|
10243
10294
|
(node, predicate) => {
|
|
10244
10295
|
const editor = editorRef.current;
|
|
10245
10296
|
if (!editor) return null;
|
|
@@ -10252,7 +10303,7 @@ function ITWysiwyg({
|
|
|
10252
10303
|
},
|
|
10253
10304
|
[]
|
|
10254
10305
|
);
|
|
10255
|
-
const isInlineTag = (0,
|
|
10306
|
+
const isInlineTag = (0, import_react49.useCallback)((el, tag) => {
|
|
10256
10307
|
if (tag === "STRONG" || tag === "B") {
|
|
10257
10308
|
return el.tagName === "STRONG" || el.tagName === "B";
|
|
10258
10309
|
}
|
|
@@ -10261,7 +10312,7 @@ function ITWysiwyg({
|
|
|
10261
10312
|
}
|
|
10262
10313
|
return el.tagName === tag;
|
|
10263
10314
|
}, []);
|
|
10264
|
-
const getTextNodesInRange = (0,
|
|
10315
|
+
const getTextNodesInRange = (0, import_react49.useCallback)((range) => {
|
|
10265
10316
|
const editor = editorRef.current;
|
|
10266
10317
|
if (!editor) return [];
|
|
10267
10318
|
const out = [];
|
|
@@ -10272,7 +10323,7 @@ function ITWysiwyg({
|
|
|
10272
10323
|
}
|
|
10273
10324
|
return out;
|
|
10274
10325
|
}, []);
|
|
10275
|
-
const placeCaretAtEnd = (0,
|
|
10326
|
+
const placeCaretAtEnd = (0, import_react49.useCallback)((target) => {
|
|
10276
10327
|
const editor = editorRef.current;
|
|
10277
10328
|
const sel = window.getSelection();
|
|
10278
10329
|
if (!editor || !sel) return;
|
|
@@ -10283,11 +10334,11 @@ function ITWysiwyg({
|
|
|
10283
10334
|
sel.addRange(range);
|
|
10284
10335
|
if (document.activeElement !== editor) editor.focus();
|
|
10285
10336
|
}, []);
|
|
10286
|
-
const emitChange = (0,
|
|
10337
|
+
const emitChange = (0, import_react49.useCallback)(() => {
|
|
10287
10338
|
const editor = editorRef.current;
|
|
10288
10339
|
if (editor) onChange?.(editor.innerHTML);
|
|
10289
10340
|
}, [onChange]);
|
|
10290
|
-
const updateActive = (0,
|
|
10341
|
+
const updateActive = (0, import_react49.useCallback)(() => {
|
|
10291
10342
|
const editor = editorRef.current;
|
|
10292
10343
|
const sel = window.getSelection();
|
|
10293
10344
|
const node = sel?.anchorNode ?? null;
|
|
@@ -10306,13 +10357,13 @@ function ITWysiwyg({
|
|
|
10306
10357
|
(prev) => JSON.stringify(prev) === JSON.stringify(next) ? prev : next
|
|
10307
10358
|
);
|
|
10308
10359
|
}, [findAncestor, isInlineTag]);
|
|
10309
|
-
const unwrapElement = (0,
|
|
10360
|
+
const unwrapElement = (0, import_react49.useCallback)((el) => {
|
|
10310
10361
|
const parent = el.parentNode;
|
|
10311
10362
|
if (!parent) return;
|
|
10312
10363
|
while (el.firstChild) parent.insertBefore(el.firstChild, el);
|
|
10313
10364
|
el.remove();
|
|
10314
10365
|
}, []);
|
|
10315
|
-
const applyInline = (0,
|
|
10366
|
+
const applyInline = (0, import_react49.useCallback)(
|
|
10316
10367
|
(tag, prepare) => {
|
|
10317
10368
|
const editor = editorRef.current;
|
|
10318
10369
|
const sel = window.getSelection();
|
|
@@ -10394,7 +10445,7 @@ function ITWysiwyg({
|
|
|
10394
10445
|
updateActive
|
|
10395
10446
|
]
|
|
10396
10447
|
);
|
|
10397
|
-
const normalizeBlocks = (0,
|
|
10448
|
+
const normalizeBlocks = (0, import_react49.useCallback)(() => {
|
|
10398
10449
|
const editor = editorRef.current;
|
|
10399
10450
|
if (!editor) return;
|
|
10400
10451
|
const children = Array.from(editor.childNodes);
|
|
@@ -10416,7 +10467,7 @@ function ITWysiwyg({
|
|
|
10416
10467
|
}
|
|
10417
10468
|
flush();
|
|
10418
10469
|
}, []);
|
|
10419
|
-
const convertLiToDiv = (0,
|
|
10470
|
+
const convertLiToDiv = (0, import_react49.useCallback)((li) => {
|
|
10420
10471
|
const list = li.parentElement;
|
|
10421
10472
|
if (!list || !list.parentNode) return;
|
|
10422
10473
|
const div = document.createElement("div");
|
|
@@ -10424,20 +10475,20 @@ function ITWysiwyg({
|
|
|
10424
10475
|
list.parentNode.insertBefore(div, list);
|
|
10425
10476
|
li.remove();
|
|
10426
10477
|
}, []);
|
|
10427
|
-
const cleanupEmptyLists = (0,
|
|
10478
|
+
const cleanupEmptyLists = (0, import_react49.useCallback)(() => {
|
|
10428
10479
|
const editor = editorRef.current;
|
|
10429
10480
|
if (!editor) return;
|
|
10430
10481
|
editor.querySelectorAll("ul, ol").forEach((list) => {
|
|
10431
10482
|
if (!list.querySelector("li")) list.remove();
|
|
10432
10483
|
});
|
|
10433
10484
|
}, []);
|
|
10434
|
-
const retagList = (0,
|
|
10485
|
+
const retagList = (0, import_react49.useCallback)((list, type) => {
|
|
10435
10486
|
if (!list.parentNode) return;
|
|
10436
10487
|
const nl = document.createElement(type);
|
|
10437
10488
|
while (list.firstChild) nl.appendChild(list.firstChild);
|
|
10438
10489
|
list.parentNode.replaceChild(nl, list);
|
|
10439
10490
|
}, []);
|
|
10440
|
-
const toggleList = (0,
|
|
10491
|
+
const toggleList = (0, import_react49.useCallback)(
|
|
10441
10492
|
(type) => {
|
|
10442
10493
|
const editor = editorRef.current;
|
|
10443
10494
|
const sel = window.getSelection();
|
|
@@ -10535,7 +10586,7 @@ function ITWysiwyg({
|
|
|
10535
10586
|
updateActive
|
|
10536
10587
|
]
|
|
10537
10588
|
);
|
|
10538
|
-
const clearFormatting = (0,
|
|
10589
|
+
const clearFormatting = (0, import_react49.useCallback)(() => {
|
|
10539
10590
|
const editor = editorRef.current;
|
|
10540
10591
|
const sel = window.getSelection();
|
|
10541
10592
|
if (!editor || !sel || sel.rangeCount === 0) return;
|
|
@@ -10569,7 +10620,7 @@ function ITWysiwyg({
|
|
|
10569
10620
|
emitChange,
|
|
10570
10621
|
updateActive
|
|
10571
10622
|
]);
|
|
10572
|
-
(0,
|
|
10623
|
+
(0, import_react49.useEffect)(() => {
|
|
10573
10624
|
const editor = editorRef.current;
|
|
10574
10625
|
if (!editor) return;
|
|
10575
10626
|
if (!focusedRef.current) {
|
|
@@ -10577,7 +10628,7 @@ function ITWysiwyg({
|
|
|
10577
10628
|
if (editor.innerHTML !== next) editor.innerHTML = next;
|
|
10578
10629
|
}
|
|
10579
10630
|
}, [value]);
|
|
10580
|
-
(0,
|
|
10631
|
+
(0, import_react49.useEffect)(() => {
|
|
10581
10632
|
const onSelectionChange = () => {
|
|
10582
10633
|
const editor = editorRef.current;
|
|
10583
10634
|
const sel = window.getSelection();
|
|
@@ -10716,12 +10767,12 @@ function ITWysiwyg({
|
|
|
10716
10767
|
}
|
|
10717
10768
|
|
|
10718
10769
|
// src/components/molecules/json-editor/json-editor.tsx
|
|
10719
|
-
var
|
|
10770
|
+
var import_react52 = require("react");
|
|
10720
10771
|
var import_clsx53 = __toESM(require("clsx"), 1);
|
|
10721
10772
|
var import_fa31 = require("react-icons/fa");
|
|
10722
10773
|
|
|
10723
10774
|
// src/components/molecules/json-editor/json-editor-tree.tsx
|
|
10724
|
-
var
|
|
10775
|
+
var import_react50 = require("react");
|
|
10725
10776
|
var import_clsx52 = __toESM(require("clsx"), 1);
|
|
10726
10777
|
var import_fa30 = require("react-icons/fa");
|
|
10727
10778
|
|
|
@@ -11206,9 +11257,9 @@ function ITCodeTreeView({
|
|
|
11206
11257
|
className
|
|
11207
11258
|
}) {
|
|
11208
11259
|
const { t } = useITTranslation();
|
|
11209
|
-
const root = (0,
|
|
11210
|
-
const [collapsed, setCollapsed] = (0,
|
|
11211
|
-
const rows = (0,
|
|
11260
|
+
const root = (0, import_react50.useMemo)(() => buildTree(value, "", [], 0), [value]);
|
|
11261
|
+
const [collapsed, setCollapsed] = (0, import_react50.useState)({});
|
|
11262
|
+
const rows = (0, import_react50.useMemo)(() => {
|
|
11212
11263
|
const result = [];
|
|
11213
11264
|
const isOpen = (node) => {
|
|
11214
11265
|
const explicit = collapsed[node.key];
|
|
@@ -11316,7 +11367,7 @@ function kindLabel(kind, t) {
|
|
|
11316
11367
|
}
|
|
11317
11368
|
|
|
11318
11369
|
// src/components/molecules/json-editor/useJsonEditorKeyboard.ts
|
|
11319
|
-
var
|
|
11370
|
+
var import_react51 = require("react");
|
|
11320
11371
|
var PAIRS = { "{": "}", "[": "]", '"': '"' };
|
|
11321
11372
|
var CLOSERS2 = /* @__PURE__ */ new Set(["}", "]", '"']);
|
|
11322
11373
|
function useJsonEditorKeyboard({
|
|
@@ -11325,7 +11376,7 @@ function useJsonEditorKeyboard({
|
|
|
11325
11376
|
readOnly = false,
|
|
11326
11377
|
applyEdit
|
|
11327
11378
|
}) {
|
|
11328
|
-
return (0,
|
|
11379
|
+
return (0, import_react51.useCallback)(
|
|
11329
11380
|
(event) => {
|
|
11330
11381
|
const textarea = textareaRef.current;
|
|
11331
11382
|
if (!textarea || readOnly) return;
|
|
@@ -11570,34 +11621,34 @@ function ITJSONEditor({
|
|
|
11570
11621
|
errorLine
|
|
11571
11622
|
}) {
|
|
11572
11623
|
const { t, formatNumber } = useITTranslation();
|
|
11573
|
-
const [viewMode, setViewMode] = (0,
|
|
11574
|
-
const [wrapLines, setWrapLines] = (0,
|
|
11575
|
-
const [indentSize, setIndentSize] = (0,
|
|
11576
|
-
const [withNumbers, setWithNumbers] = (0,
|
|
11577
|
-
const [withFolds, setWithFolds] = (0,
|
|
11578
|
-
const [copied, setCopied] = (0,
|
|
11579
|
-
const [foldedStarts, setFoldedStarts] = (0,
|
|
11580
|
-
const [caretLine, setCaretLine] = (0,
|
|
11581
|
-
const [lineHeight, setLineHeight] = (0,
|
|
11582
|
-
const [notice, setNotice] = (0,
|
|
11583
|
-
const canvasRef = (0,
|
|
11584
|
-
const textareaRef = (0,
|
|
11585
|
-
const highlightRef = (0,
|
|
11586
|
-
const fileInputRef = (0,
|
|
11587
|
-
const pendingSelection = (0,
|
|
11588
|
-
const editorId = (0,
|
|
11589
|
-
(0,
|
|
11624
|
+
const [viewMode, setViewMode] = (0, import_react52.useState)(mode ?? "text");
|
|
11625
|
+
const [wrapLines, setWrapLines] = (0, import_react52.useState)(wrapLinesProp);
|
|
11626
|
+
const [indentSize, setIndentSize] = (0, import_react52.useState)(Math.min(8, Math.max(0, indentSizeProp)));
|
|
11627
|
+
const [withNumbers, setWithNumbers] = (0, import_react52.useState)(showLineNumbers);
|
|
11628
|
+
const [withFolds, setWithFolds] = (0, import_react52.useState)(showFoldGutter);
|
|
11629
|
+
const [copied, setCopied] = (0, import_react52.useState)(false);
|
|
11630
|
+
const [foldedStarts, setFoldedStarts] = (0, import_react52.useState)([]);
|
|
11631
|
+
const [caretLine, setCaretLine] = (0, import_react52.useState)(1);
|
|
11632
|
+
const [lineHeight, setLineHeight] = (0, import_react52.useState)(21);
|
|
11633
|
+
const [notice, setNotice] = (0, import_react52.useState)(null);
|
|
11634
|
+
const canvasRef = (0, import_react52.useRef)(null);
|
|
11635
|
+
const textareaRef = (0, import_react52.useRef)(null);
|
|
11636
|
+
const highlightRef = (0, import_react52.useRef)(null);
|
|
11637
|
+
const fileInputRef = (0, import_react52.useRef)(null);
|
|
11638
|
+
const pendingSelection = (0, import_react52.useRef)(null);
|
|
11639
|
+
const editorId = (0, import_react52.useId)();
|
|
11640
|
+
(0, import_react52.useEffect)(() => {
|
|
11590
11641
|
if (mode !== void 0) setViewMode(mode);
|
|
11591
11642
|
}, [mode]);
|
|
11592
|
-
(0,
|
|
11643
|
+
(0, import_react52.useEffect)(() => {
|
|
11593
11644
|
setWrapLines(wrapLinesProp);
|
|
11594
11645
|
}, [wrapLinesProp]);
|
|
11595
|
-
(0,
|
|
11646
|
+
(0, import_react52.useEffect)(() => {
|
|
11596
11647
|
setIndentSize(Math.min(8, Math.max(0, indentSizeProp)));
|
|
11597
11648
|
}, [indentSizeProp]);
|
|
11598
|
-
const analysis = (0,
|
|
11599
|
-
const folds = (0,
|
|
11600
|
-
const validation = (0,
|
|
11649
|
+
const analysis = (0, import_react52.useMemo)(() => analyzeCode(value), [value]);
|
|
11650
|
+
const folds = (0, import_react52.useMemo)(() => findFoldRegions(value), [value]);
|
|
11651
|
+
const validation = (0, import_react52.useMemo)(() => {
|
|
11601
11652
|
if (!value.trim()) {
|
|
11602
11653
|
return {
|
|
11603
11654
|
isValid: true,
|
|
@@ -11615,37 +11666,37 @@ function ITJSONEditor({
|
|
|
11615
11666
|
};
|
|
11616
11667
|
}
|
|
11617
11668
|
}, [value, analysis.lineStarts]);
|
|
11618
|
-
(0,
|
|
11669
|
+
(0, import_react52.useEffect)(() => {
|
|
11619
11670
|
onParse?.(validation.parsed, validation.isValid, validation.error?.message);
|
|
11620
11671
|
}, [validation, onParse]);
|
|
11621
|
-
const foldedRegions = (0,
|
|
11672
|
+
const foldedRegions = (0, import_react52.useMemo)(() => {
|
|
11622
11673
|
if (!foldedStarts.length || !folds.length) return [];
|
|
11623
11674
|
return folds.filter((region) => foldedStarts.includes(region.startLine));
|
|
11624
11675
|
}, [folds, foldedStarts]);
|
|
11625
|
-
const hiddenLines = (0,
|
|
11676
|
+
const hiddenLines = (0, import_react52.useMemo)(() => {
|
|
11626
11677
|
const hidden = /* @__PURE__ */ new Set();
|
|
11627
11678
|
for (const region of foldedRegions) {
|
|
11628
11679
|
for (let line = region.startLine + 1; line <= region.endLine; line++) hidden.add(line);
|
|
11629
11680
|
}
|
|
11630
11681
|
return hidden;
|
|
11631
11682
|
}, [foldedRegions]);
|
|
11632
|
-
const closedByStart = (0,
|
|
11683
|
+
const closedByStart = (0, import_react52.useMemo)(() => {
|
|
11633
11684
|
const map = /* @__PURE__ */ new Map();
|
|
11634
11685
|
for (const region of foldedRegions) map.set(region.startLine, region.endLine);
|
|
11635
11686
|
return map;
|
|
11636
11687
|
}, [foldedRegions]);
|
|
11637
|
-
const visibleLines = (0,
|
|
11688
|
+
const visibleLines = (0, import_react52.useMemo)(
|
|
11638
11689
|
() => analysis.lines.filter((line) => !hiddenLines.has(line.number)),
|
|
11639
11690
|
[analysis.lines, hiddenLines]
|
|
11640
11691
|
);
|
|
11641
11692
|
const lineStarts = analysis.lineStarts;
|
|
11642
|
-
const nodeCount = (0,
|
|
11643
|
-
const maxDepth = (0,
|
|
11693
|
+
const nodeCount = (0, import_react52.useMemo)(() => countNodes(validation.parsed), [validation.parsed]);
|
|
11694
|
+
const maxDepth = (0, import_react52.useMemo)(
|
|
11644
11695
|
() => analysis.lines.reduce((deepest, line) => Math.max(deepest, line.depth), 0),
|
|
11645
11696
|
[analysis.lines]
|
|
11646
11697
|
);
|
|
11647
|
-
const byteSize = (0,
|
|
11648
|
-
(0,
|
|
11698
|
+
const byteSize = (0, import_react52.useMemo)(() => new Blob([value]).size, [value]);
|
|
11699
|
+
(0, import_react52.useEffect)(() => {
|
|
11649
11700
|
const measure = () => {
|
|
11650
11701
|
const textarea = textareaRef.current;
|
|
11651
11702
|
if (!textarea) return;
|
|
@@ -11667,14 +11718,14 @@ function ITJSONEditor({
|
|
|
11667
11718
|
const contentHeight = visibleLines.length * lineHeight;
|
|
11668
11719
|
const activeLine = validation.isValid ? caretLine : validation.error?.line ?? errorLine ?? caretLine;
|
|
11669
11720
|
const treeValue = validation.isValid ? validation.parsed : void 0;
|
|
11670
|
-
const restoreSelection = (0,
|
|
11721
|
+
const restoreSelection = (0, import_react52.useCallback)(() => {
|
|
11671
11722
|
const textarea = textareaRef.current;
|
|
11672
11723
|
const pending = pendingSelection.current;
|
|
11673
11724
|
if (!textarea || !pending) return;
|
|
11674
11725
|
const max = textarea.value.length;
|
|
11675
11726
|
textarea.setSelectionRange(Math.min(pending[0], max), Math.min(pending[1], max));
|
|
11676
11727
|
}, []);
|
|
11677
|
-
const consumePendingSelection = (0,
|
|
11728
|
+
const consumePendingSelection = (0, import_react52.useCallback)(() => {
|
|
11678
11729
|
if (!pendingSelection.current) return;
|
|
11679
11730
|
const pending = pendingSelection.current;
|
|
11680
11731
|
pendingSelection.current = null;
|
|
@@ -11686,10 +11737,10 @@ function ITJSONEditor({
|
|
|
11686
11737
|
textarea.setSelectionRange(Math.min(pending[0], max), Math.min(pending[1], max));
|
|
11687
11738
|
});
|
|
11688
11739
|
}, [restoreSelection]);
|
|
11689
|
-
(0,
|
|
11740
|
+
(0, import_react52.useLayoutEffect)(() => {
|
|
11690
11741
|
consumePendingSelection();
|
|
11691
11742
|
});
|
|
11692
|
-
const applyEdit = (0,
|
|
11743
|
+
const applyEdit = (0, import_react52.useCallback)(
|
|
11693
11744
|
(result) => {
|
|
11694
11745
|
pendingSelection.current = [result.selectionStart, result.selectionEnd];
|
|
11695
11746
|
onChange?.(result.value);
|
|
@@ -11712,19 +11763,19 @@ function ITJSONEditor({
|
|
|
11712
11763
|
readOnly,
|
|
11713
11764
|
applyEdit
|
|
11714
11765
|
});
|
|
11715
|
-
const handleKeyDown = (0,
|
|
11766
|
+
const handleKeyDown = (0, import_react52.useCallback)(
|
|
11716
11767
|
(event) => {
|
|
11717
11768
|
pendingSelection.current = null;
|
|
11718
11769
|
handleKeyDownRaw(event);
|
|
11719
11770
|
},
|
|
11720
11771
|
[handleKeyDownRaw]
|
|
11721
11772
|
);
|
|
11722
|
-
const syncCaret = (0,
|
|
11773
|
+
const syncCaret = (0, import_react52.useCallback)(() => {
|
|
11723
11774
|
const textarea = textareaRef.current;
|
|
11724
11775
|
if (!textarea) return;
|
|
11725
11776
|
setCaretLine(caretPosition(value, textarea.selectionStart, lineStarts).line);
|
|
11726
11777
|
}, [value, lineStarts]);
|
|
11727
|
-
const scrollCaretIntoView = (0,
|
|
11778
|
+
const scrollCaretIntoView = (0, import_react52.useCallback)(() => {
|
|
11728
11779
|
const textarea = textareaRef.current;
|
|
11729
11780
|
if (!textarea || wrapLines) return;
|
|
11730
11781
|
const { line } = caretPosition(value, textarea.selectionStart, lineStarts);
|
|
@@ -11736,11 +11787,11 @@ function ITJSONEditor({
|
|
|
11736
11787
|
if (highlightRef.current) highlightRef.current.scrollTop = textarea.scrollTop;
|
|
11737
11788
|
}
|
|
11738
11789
|
}, [value, lineStarts, lineHeight, wrapLines]);
|
|
11739
|
-
const flash = (0,
|
|
11790
|
+
const flash = (0, import_react52.useCallback)((message) => {
|
|
11740
11791
|
setNotice(message);
|
|
11741
11792
|
window.setTimeout(() => setNotice(null), 1800);
|
|
11742
11793
|
}, []);
|
|
11743
|
-
const applyTransform = (0,
|
|
11794
|
+
const applyTransform = (0, import_react52.useCallback)(
|
|
11744
11795
|
(transform) => {
|
|
11745
11796
|
if (!validation.isValid || validation.parsed === void 0) return;
|
|
11746
11797
|
try {
|
|
@@ -11755,7 +11806,7 @@ function ITJSONEditor({
|
|
|
11755
11806
|
},
|
|
11756
11807
|
[validation, indentSize, value, onChange, flash, t]
|
|
11757
11808
|
);
|
|
11758
|
-
const handleTransformHotkeys = (0,
|
|
11809
|
+
const handleTransformHotkeys = (0, import_react52.useCallback)(
|
|
11759
11810
|
(event) => {
|
|
11760
11811
|
if (!(event.altKey && event.shiftKey)) return;
|
|
11761
11812
|
const key = event.key.toLowerCase();
|
|
@@ -11794,7 +11845,7 @@ function ITJSONEditor({
|
|
|
11794
11845
|
reader.onerror = () => flash(t("jsonEditor.fileError"));
|
|
11795
11846
|
reader.readAsText(file);
|
|
11796
11847
|
};
|
|
11797
|
-
const jumpToLine = (0,
|
|
11848
|
+
const jumpToLine = (0, import_react52.useCallback)(
|
|
11798
11849
|
(line) => {
|
|
11799
11850
|
const textarea = textareaRef.current;
|
|
11800
11851
|
if (!textarea) return;
|
|
@@ -12279,7 +12330,7 @@ function EditorToggle({
|
|
|
12279
12330
|
}
|
|
12280
12331
|
|
|
12281
12332
|
// src/json-renderer/kernel/SchemaRenderer.tsx
|
|
12282
|
-
var
|
|
12333
|
+
var import_react56 = require("react");
|
|
12283
12334
|
|
|
12284
12335
|
// src/types/loader.types.ts
|
|
12285
12336
|
var sizeClasses = {
|
|
@@ -12590,7 +12641,7 @@ var AXZY_CATALOG_ENTRIES = [
|
|
|
12590
12641
|
},
|
|
12591
12642
|
{
|
|
12592
12643
|
type: "ITFlex",
|
|
12593
|
-
component:
|
|
12644
|
+
component: flex_default,
|
|
12594
12645
|
children: true,
|
|
12595
12646
|
summary: "Contenedor flex completo.",
|
|
12596
12647
|
props: {
|
|
@@ -12723,6 +12774,192 @@ var AXZY_EXCLUDED_TYPES = {
|
|
|
12723
12774
|
var axzyCatalog = createCatalog(AXZY_CATALOG_ENTRIES, AXZY_EXCLUDED_TYPES);
|
|
12724
12775
|
var axzyCatalogTypes = Object.keys(axzyCatalog.entries);
|
|
12725
12776
|
|
|
12777
|
+
// src/json-renderer/shared/errors.ts
|
|
12778
|
+
var JsonEngineError = class extends Error {
|
|
12779
|
+
constructor(code, message, path, hint) {
|
|
12780
|
+
super(`${code} ${path ? `en ${path}: ` : ""}${message}`);
|
|
12781
|
+
/** Código estable del catálogo de avisos. */
|
|
12782
|
+
__publicField(this, "code");
|
|
12783
|
+
/** Ruta del esquema donde se produjo. */
|
|
12784
|
+
__publicField(this, "path");
|
|
12785
|
+
/** Sugerencia accionable. */
|
|
12786
|
+
__publicField(this, "hint");
|
|
12787
|
+
this.name = "JsonEngineError";
|
|
12788
|
+
this.code = code;
|
|
12789
|
+
this.path = path;
|
|
12790
|
+
this.hint = hint;
|
|
12791
|
+
}
|
|
12792
|
+
/** Convierte el error en el aviso que consume la interfaz y el informe. */
|
|
12793
|
+
toIssue(severity = "error") {
|
|
12794
|
+
return {
|
|
12795
|
+
code: this.code,
|
|
12796
|
+
severity,
|
|
12797
|
+
message: this.message.replace(/^JR\d{3}\s?(en .*?: )?/, ""),
|
|
12798
|
+
path: this.path,
|
|
12799
|
+
hint: this.hint
|
|
12800
|
+
};
|
|
12801
|
+
}
|
|
12802
|
+
};
|
|
12803
|
+
function issue(code, message, path = "", options = {}) {
|
|
12804
|
+
return {
|
|
12805
|
+
code,
|
|
12806
|
+
severity: options.severity ?? "error",
|
|
12807
|
+
message,
|
|
12808
|
+
path,
|
|
12809
|
+
hint: options.hint
|
|
12810
|
+
};
|
|
12811
|
+
}
|
|
12812
|
+
|
|
12813
|
+
// src/json-renderer/shared/paths.ts
|
|
12814
|
+
function pushPath(path, segment) {
|
|
12815
|
+
return [...path, segment];
|
|
12816
|
+
}
|
|
12817
|
+
function formatPath(path) {
|
|
12818
|
+
let out = "";
|
|
12819
|
+
for (const segment of path) {
|
|
12820
|
+
if (typeof segment === "number") out += `[${segment}]`;
|
|
12821
|
+
else out += out ? `.${segment}` : segment;
|
|
12822
|
+
}
|
|
12823
|
+
return out;
|
|
12824
|
+
}
|
|
12825
|
+
function parsePath(rendered) {
|
|
12826
|
+
if (!rendered) return [];
|
|
12827
|
+
return rendered.split(/\.(?![^[]*])/).flatMap((part) => {
|
|
12828
|
+
const match = part.match(/^([^[\]]*)((?:\[\d+\])*)$/);
|
|
12829
|
+
if (!match) return [part];
|
|
12830
|
+
const [, key, indexes] = match;
|
|
12831
|
+
const segments = key ? [key] : [];
|
|
12832
|
+
for (const index of indexes.match(/\d+/g) ?? []) segments.push(Number(index));
|
|
12833
|
+
return segments;
|
|
12834
|
+
});
|
|
12835
|
+
}
|
|
12836
|
+
function readPath(source, path) {
|
|
12837
|
+
let cursor = source;
|
|
12838
|
+
for (const segment of path) {
|
|
12839
|
+
if (cursor === null || typeof cursor !== "object") return void 0;
|
|
12840
|
+
cursor = cursor[segment];
|
|
12841
|
+
}
|
|
12842
|
+
return cursor;
|
|
12843
|
+
}
|
|
12844
|
+
function hasPath(source, path) {
|
|
12845
|
+
if (path.length === 0) return true;
|
|
12846
|
+
const parent = readPath(source, path.slice(0, -1));
|
|
12847
|
+
if (parent === null || typeof parent !== "object") return false;
|
|
12848
|
+
return Object.prototype.hasOwnProperty.call(parent, path[path.length - 1]);
|
|
12849
|
+
}
|
|
12850
|
+
function propPath(nodePath, prop) {
|
|
12851
|
+
return pushPath(pushPath(nodePath, "props"), prop);
|
|
12852
|
+
}
|
|
12853
|
+
|
|
12854
|
+
// src/json-renderer/binding/resolveValue.ts
|
|
12855
|
+
var CLAVES_DE_RED = ["url", "endpoint", "href", "src"];
|
|
12856
|
+
var SUPPORTED_REFERENCES = ["$source", "$state", "$param"];
|
|
12857
|
+
function own(record, key) {
|
|
12858
|
+
return record !== void 0 && Object.prototype.hasOwnProperty.call(record, key);
|
|
12859
|
+
}
|
|
12860
|
+
function isDollarReference(value) {
|
|
12861
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
12862
|
+
return Object.keys(value).some((key) => key.startsWith("$"));
|
|
12863
|
+
}
|
|
12864
|
+
function referenceIssue(message, path, hint) {
|
|
12865
|
+
return issue("JR032", message, formatPath(path), { severity: "warning", hint });
|
|
12866
|
+
}
|
|
12867
|
+
function createBindingResolver(scope) {
|
|
12868
|
+
const readValue = (table, kind, key, path) => {
|
|
12869
|
+
if (own(table, key)) return table[key];
|
|
12870
|
+
scope.report(
|
|
12871
|
+
referenceIssue(
|
|
12872
|
+
`La referencia \`${kind}: "${key}"\` no tiene valor.`,
|
|
12873
|
+
path,
|
|
12874
|
+
kind === "$state" ? "Declara el valor en `state` del esquema." : "El host debe pasar el par\xE1metro en `params`."
|
|
12875
|
+
)
|
|
12876
|
+
);
|
|
12877
|
+
return void 0;
|
|
12878
|
+
};
|
|
12879
|
+
const resolveParams = (declared, path) => {
|
|
12880
|
+
const resolved = {};
|
|
12881
|
+
for (const [name, raw] of Object.entries(declared ?? {})) {
|
|
12882
|
+
if (!isDollarReference(raw)) {
|
|
12883
|
+
resolved[name] = raw;
|
|
12884
|
+
continue;
|
|
12885
|
+
}
|
|
12886
|
+
const [key] = Object.keys(raw).filter((candidate) => candidate.startsWith("$"));
|
|
12887
|
+
if (key === "$state" && typeof raw[key] === "string") {
|
|
12888
|
+
const value = readValue(scope.state, "$state", raw[key], path);
|
|
12889
|
+
if (value !== void 0) resolved[name] = value;
|
|
12890
|
+
} else if (key === "$param" && typeof raw[key] === "string") {
|
|
12891
|
+
const value = readValue(scope.params, "$param", raw[key], path);
|
|
12892
|
+
if (value !== void 0) resolved[name] = value;
|
|
12893
|
+
} else {
|
|
12894
|
+
scope.report(
|
|
12895
|
+
referenceIssue(
|
|
12896
|
+
"Un par\xE1metro de fuente solo admite valores, `$state` o `$param`.",
|
|
12897
|
+
path,
|
|
12898
|
+
"Las fuentes no se encadenan: declara la fuente sin referencias a otras fuentes."
|
|
12899
|
+
)
|
|
12900
|
+
);
|
|
12901
|
+
}
|
|
12902
|
+
}
|
|
12903
|
+
return resolved;
|
|
12904
|
+
};
|
|
12905
|
+
const failingLoader = (message, path, hint) => {
|
|
12906
|
+
scope.report(issue("JR030", message, formatPath(path), { severity: "error", hint }));
|
|
12907
|
+
return () => Promise.reject(new Error(message));
|
|
12908
|
+
};
|
|
12909
|
+
const sourceLoader = (name, path) => {
|
|
12910
|
+
if (!own(scope.data, name)) {
|
|
12911
|
+
return failingLoader(
|
|
12912
|
+
`La fuente \`${name}\` no est\xE1 declarada en \`data\`.`,
|
|
12913
|
+
path,
|
|
12914
|
+
"Decl\xE1rala en `data` del esquema con el `handler` que registra el host."
|
|
12915
|
+
);
|
|
12916
|
+
}
|
|
12917
|
+
const declared = scope.data[name];
|
|
12918
|
+
const claveDeRed = Object.keys(declared).find((clave) => CLAVES_DE_RED.includes(clave));
|
|
12919
|
+
if (claveDeRed) {
|
|
12920
|
+
scope.report(
|
|
12921
|
+
issue("JR031", `El esquema declara \`${claveDeRed}\` en la fuente "${name}": las fuentes no pueden pedir red.`, formatPath(path), {
|
|
12922
|
+
severity: "error",
|
|
12923
|
+
hint: "Una fuente solo nombra un `handler` que registra el host."
|
|
12924
|
+
})
|
|
12925
|
+
);
|
|
12926
|
+
return () => Promise.reject(new Error(`La fuente "${name}" no puede pedir red.`));
|
|
12927
|
+
}
|
|
12928
|
+
const handler = own(scope.handlers, declared.handler) ? scope.handlers[declared.handler] : void 0;
|
|
12929
|
+
if (typeof handler !== "function") {
|
|
12930
|
+
return failingLoader(
|
|
12931
|
+
`El handler \`${declared.handler}\` no est\xE1 registrado por el host.`,
|
|
12932
|
+
path,
|
|
12933
|
+
"El host debe registrarlo en `dataHandlers` del renderizador."
|
|
12934
|
+
);
|
|
12935
|
+
}
|
|
12936
|
+
const params = resolveParams(declared.params, path);
|
|
12937
|
+
return (query) => new Promise((resolve) => resolve(handler(query, params)));
|
|
12938
|
+
};
|
|
12939
|
+
const resolveReference = (ref, path) => {
|
|
12940
|
+
const keys = Object.keys(ref).filter((key2) => key2.startsWith("$"));
|
|
12941
|
+
const [key] = keys;
|
|
12942
|
+
if (keys.length !== 1 || !SUPPORTED_REFERENCES.includes(key) || typeof ref[key] !== "string") {
|
|
12943
|
+
scope.report(
|
|
12944
|
+
referenceIssue(
|
|
12945
|
+
`Referencia no soportada: ${keys.join(", ") || "sin operador"}.`,
|
|
12946
|
+
path,
|
|
12947
|
+
"Soportadas: `$source`, `$state` y `$param`. Los dem\xE1s operadores llegan con las acciones y las tablas."
|
|
12948
|
+
)
|
|
12949
|
+
);
|
|
12950
|
+
return void 0;
|
|
12951
|
+
}
|
|
12952
|
+
const name = ref[key];
|
|
12953
|
+
if (key === "$source") return sourceLoader(name, path);
|
|
12954
|
+
if (key === "$state") return readValue(scope.state, "$state", name, path);
|
|
12955
|
+
return readValue(scope.params, "$param", name, path);
|
|
12956
|
+
};
|
|
12957
|
+
return (value, path) => {
|
|
12958
|
+
if (isDollarReference(value)) return resolveReference(value, path);
|
|
12959
|
+
return scope.host ? scope.host(value, path) : value;
|
|
12960
|
+
};
|
|
12961
|
+
}
|
|
12962
|
+
|
|
12726
12963
|
// src/json-renderer/shared/limits.ts
|
|
12727
12964
|
var DEFAULT_LIMITS = {
|
|
12728
12965
|
maxNodes: 5e3,
|
|
@@ -12766,47 +13003,26 @@ function createLimitTracker(limits = DEFAULT_LIMITS) {
|
|
|
12766
13003
|
};
|
|
12767
13004
|
}
|
|
12768
13005
|
|
|
12769
|
-
// src/json-renderer/kernel/
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12775
|
-
super(`${code} ${path ? `en ${path}: ` : ""}${message}`);
|
|
12776
|
-
/** Código estable del catálogo de avisos. */
|
|
12777
|
-
__publicField(this, "code");
|
|
12778
|
-
/** Ruta del esquema donde se produjo. */
|
|
12779
|
-
__publicField(this, "path");
|
|
12780
|
-
/** Sugerencia accionable. */
|
|
12781
|
-
__publicField(this, "hint");
|
|
12782
|
-
this.name = "JsonEngineError";
|
|
12783
|
-
this.code = code;
|
|
12784
|
-
this.path = path;
|
|
12785
|
-
this.hint = hint;
|
|
12786
|
-
}
|
|
12787
|
-
/** Convierte el error en el aviso que consume la interfaz y el informe. */
|
|
12788
|
-
toIssue(severity = "error") {
|
|
12789
|
-
return {
|
|
12790
|
-
code: this.code,
|
|
12791
|
-
severity,
|
|
12792
|
-
message: this.message.replace(/^JR\d{3}\s?(en .*?: )?/, ""),
|
|
12793
|
-
path: this.path,
|
|
12794
|
-
hint: this.hint
|
|
12795
|
-
};
|
|
13006
|
+
// src/json-renderer/kernel/capabilities.ts
|
|
13007
|
+
function capacidadesRequeridas(requires) {
|
|
13008
|
+
if (requires === void 0 || requires === null) return [];
|
|
13009
|
+
if (typeof requires === "string") return requires === "" ? null : [requires];
|
|
13010
|
+
if (Array.isArray(requires) && requires.every((item) => typeof item === "string" && item !== "")) {
|
|
13011
|
+
return requires;
|
|
12796
13012
|
}
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
};
|
|
13013
|
+
return null;
|
|
13014
|
+
}
|
|
13015
|
+
function faltanCapacidades(requires, concedidas) {
|
|
13016
|
+
const requeridas = capacidadesRequeridas(requires);
|
|
13017
|
+
if (requeridas === null) return ["(requires no v\xE1lido)"];
|
|
13018
|
+
if (requeridas.length === 0) return [];
|
|
13019
|
+
const conjunto = new Set(concedidas ?? []);
|
|
13020
|
+
return requeridas.filter((capacidad) => !conjunto.has(capacidad));
|
|
12806
13021
|
}
|
|
12807
13022
|
|
|
12808
13023
|
// src/json-renderer/kernel/NodeBoundary.tsx
|
|
12809
|
-
var
|
|
13024
|
+
var import_react53 = __toESM(require("react"), 1);
|
|
13025
|
+
var NodeBoundary = class extends import_react53.default.Component {
|
|
12810
13026
|
constructor() {
|
|
12811
13027
|
super(...arguments);
|
|
12812
13028
|
__publicField(this, "state", { failed: false });
|
|
@@ -13153,55 +13369,14 @@ function isNodePending(node) {
|
|
|
13153
13369
|
}
|
|
13154
13370
|
|
|
13155
13371
|
// src/json-renderer/kernel/renderNode.tsx
|
|
13156
|
-
var
|
|
13372
|
+
var import_react55 = __toESM(require("react"), 1);
|
|
13157
13373
|
|
|
13158
|
-
// src/json-renderer/
|
|
13159
|
-
function
|
|
13160
|
-
return
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
for (const segment of path) {
|
|
13165
|
-
if (typeof segment === "number") out += `[${segment}]`;
|
|
13166
|
-
else out += out ? `.${segment}` : segment;
|
|
13167
|
-
}
|
|
13168
|
-
return out;
|
|
13169
|
-
}
|
|
13170
|
-
function parsePath(rendered) {
|
|
13171
|
-
if (!rendered) return [];
|
|
13172
|
-
return rendered.split(/\.(?![^[]*])/).flatMap((part) => {
|
|
13173
|
-
const match = part.match(/^([^[\]]*)((?:\[\d+\])*)$/);
|
|
13174
|
-
if (!match) return [part];
|
|
13175
|
-
const [, key, indexes] = match;
|
|
13176
|
-
const segments = key ? [key] : [];
|
|
13177
|
-
for (const index of indexes.match(/\d+/g) ?? []) segments.push(Number(index));
|
|
13178
|
-
return segments;
|
|
13179
|
-
});
|
|
13180
|
-
}
|
|
13181
|
-
function readPath(source, path) {
|
|
13182
|
-
let cursor = source;
|
|
13183
|
-
for (const segment of path) {
|
|
13184
|
-
if (cursor === null || typeof cursor !== "object") return void 0;
|
|
13185
|
-
cursor = cursor[segment];
|
|
13186
|
-
}
|
|
13187
|
-
return cursor;
|
|
13188
|
-
}
|
|
13189
|
-
function hasPath(source, path) {
|
|
13190
|
-
if (path.length === 0) return true;
|
|
13191
|
-
const parent = readPath(source, path.slice(0, -1));
|
|
13192
|
-
if (parent === null || typeof parent !== "object") return false;
|
|
13193
|
-
return Object.prototype.hasOwnProperty.call(parent, path[path.length - 1]);
|
|
13194
|
-
}
|
|
13195
|
-
function propPath(nodePath, prop) {
|
|
13196
|
-
return pushPath(pushPath(nodePath, "props"), prop);
|
|
13197
|
-
}
|
|
13198
|
-
|
|
13199
|
-
// src/json-renderer/catalog/resolve.ts
|
|
13200
|
-
function isSchemaReference(value) {
|
|
13201
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
13202
|
-
const keys = Object.keys(value);
|
|
13203
|
-
if (keys.length === 0) return false;
|
|
13204
|
-
return keys.some((key) => key === "i18n" || key.startsWith("$"));
|
|
13374
|
+
// src/json-renderer/catalog/resolve.ts
|
|
13375
|
+
function isSchemaReference(value) {
|
|
13376
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
13377
|
+
const keys = Object.keys(value);
|
|
13378
|
+
if (keys.length === 0) return false;
|
|
13379
|
+
return keys.some((key) => key === "i18n" || key.startsWith("$"));
|
|
13205
13380
|
}
|
|
13206
13381
|
function coerce(value, spec) {
|
|
13207
13382
|
switch (spec.kind) {
|
|
@@ -13335,11 +13510,457 @@ function resolveNode(node, catalog, path) {
|
|
|
13335
13510
|
return { ok: true, entry, props, actions, issues };
|
|
13336
13511
|
}
|
|
13337
13512
|
|
|
13513
|
+
// src/json-renderer/kernel/slots.ts
|
|
13514
|
+
var SLOT_TYPE = "slot";
|
|
13515
|
+
function isSlotNode(node) {
|
|
13516
|
+
return node.type === SLOT_TYPE;
|
|
13517
|
+
}
|
|
13518
|
+
function slotName(node) {
|
|
13519
|
+
const name = node.props?.name;
|
|
13520
|
+
return typeof name === "string" && name !== "" ? name : void 0;
|
|
13521
|
+
}
|
|
13522
|
+
|
|
13523
|
+
// src/json-renderer/form/FormNode.tsx
|
|
13524
|
+
var import_react54 = require("react");
|
|
13525
|
+
|
|
13526
|
+
// src/json-renderer/form/rules.ts
|
|
13527
|
+
var FORM_FIELD_KINDS = ["text", "email"];
|
|
13528
|
+
var EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
13529
|
+
function longitudDeclarada(value) {
|
|
13530
|
+
return typeof value === "number" && Number.isInteger(value) && value >= 0 ? value : void 0;
|
|
13531
|
+
}
|
|
13532
|
+
function readFormFields(declared, fieldsPath) {
|
|
13533
|
+
const issues = [];
|
|
13534
|
+
const fields = [];
|
|
13535
|
+
if (!Array.isArray(declared)) {
|
|
13536
|
+
issues.push(issue("JR021", "El formulario necesita `props.fields` como lista.", formatPath(fieldsPath), { severity: "error" }));
|
|
13537
|
+
return { fields, issues };
|
|
13538
|
+
}
|
|
13539
|
+
const nombres = /* @__PURE__ */ new Set();
|
|
13540
|
+
declared.forEach((raw, index) => {
|
|
13541
|
+
const fieldPath = [...fieldsPath, index];
|
|
13542
|
+
const campo = raw;
|
|
13543
|
+
if (!campo || typeof campo !== "object" || typeof campo.name !== "string" || campo.name === "") {
|
|
13544
|
+
issues.push(issue("JR021", "Un campo del formulario no declara `name`.", formatPath(fieldPath), { severity: "error" }));
|
|
13545
|
+
return;
|
|
13546
|
+
}
|
|
13547
|
+
if (nombres.has(campo.name)) {
|
|
13548
|
+
issues.push(issue("JR021", `El campo "${campo.name}" se repite.`, formatPath(fieldPath), { severity: "error" }));
|
|
13549
|
+
return;
|
|
13550
|
+
}
|
|
13551
|
+
let kind = "text";
|
|
13552
|
+
if (campo.kind !== void 0) {
|
|
13553
|
+
if (typeof campo.kind === "string" && FORM_FIELD_KINDS.includes(campo.kind)) {
|
|
13554
|
+
kind = campo.kind;
|
|
13555
|
+
} else {
|
|
13556
|
+
issues.push(
|
|
13557
|
+
issue("JR011", `Tipo de campo "${String(campo.kind)}" no admitido.`, formatPath(fieldPath), {
|
|
13558
|
+
severity: "warning",
|
|
13559
|
+
hint: `Admitidos: ${FORM_FIELD_KINDS.join(", ")}. Se usa "text".`
|
|
13560
|
+
})
|
|
13561
|
+
);
|
|
13562
|
+
}
|
|
13563
|
+
}
|
|
13564
|
+
const minLength = longitudDeclarada(campo.minLength);
|
|
13565
|
+
const maxLength = longitudDeclarada(campo.maxLength);
|
|
13566
|
+
for (const [clave, valor, declarada] of [["minLength", campo.minLength, minLength], ["maxLength", campo.maxLength, maxLength]]) {
|
|
13567
|
+
if (valor !== void 0 && declarada === void 0) {
|
|
13568
|
+
issues.push(issue("JR011", `\`${clave}\` debe ser un entero no negativo.`, formatPath(fieldPath), { severity: "warning", hint: "Se ignora." }));
|
|
13569
|
+
}
|
|
13570
|
+
}
|
|
13571
|
+
if (minLength !== void 0 && maxLength !== void 0 && minLength > maxLength) {
|
|
13572
|
+
issues.push(issue("JR021", `El campo "${campo.name}" tiene minLength mayor que maxLength.`, formatPath(fieldPath), { severity: "error" }));
|
|
13573
|
+
return;
|
|
13574
|
+
}
|
|
13575
|
+
nombres.add(campo.name);
|
|
13576
|
+
fields.push({ name: campo.name, kind, required: campo.required === true, minLength, maxLength, label: campo.label });
|
|
13577
|
+
});
|
|
13578
|
+
return { fields, issues };
|
|
13579
|
+
}
|
|
13580
|
+
function validateField(field, value) {
|
|
13581
|
+
const texto = value.trim();
|
|
13582
|
+
if (texto === "") return field.required ? "required" : void 0;
|
|
13583
|
+
if (field.minLength !== void 0 && texto.length < field.minLength) return "minLength";
|
|
13584
|
+
if (field.maxLength !== void 0 && texto.length > field.maxLength) return "maxLength";
|
|
13585
|
+
if (field.kind === "email" && !EMAIL.test(texto)) return "email";
|
|
13586
|
+
return void 0;
|
|
13587
|
+
}
|
|
13588
|
+
function validateForm(fields, values) {
|
|
13589
|
+
const errores = {};
|
|
13590
|
+
for (const field of fields) {
|
|
13591
|
+
const code = validateField(field, values[field.name] ?? "");
|
|
13592
|
+
if (code) errores[field.name] = code;
|
|
13593
|
+
}
|
|
13594
|
+
return errores;
|
|
13595
|
+
}
|
|
13596
|
+
|
|
13597
|
+
// src/json-renderer/form/FormNode.tsx
|
|
13598
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
13599
|
+
function valorDe(evento) {
|
|
13600
|
+
if (typeof evento === "string") return evento;
|
|
13601
|
+
return evento?.target?.value?.toString() ?? "";
|
|
13602
|
+
}
|
|
13603
|
+
function FormNode({ id, fields, submitLabel, onSubmit }) {
|
|
13604
|
+
const { t } = useITTranslation();
|
|
13605
|
+
const [values, setValues] = (0, import_react54.useState)({});
|
|
13606
|
+
const [errors, setErrors] = (0, import_react54.useState)({});
|
|
13607
|
+
const [intentado, setIntentado] = (0, import_react54.useState)(false);
|
|
13608
|
+
const mensaje = (code, campo) => t(`jsonRenderer.form.${code}`, { min: String(campo.minLength ?? 0), max: String(campo.maxLength ?? 0) });
|
|
13609
|
+
const enviar = () => {
|
|
13610
|
+
const encontrados = validateForm(fields, values);
|
|
13611
|
+
setIntentado(true);
|
|
13612
|
+
setErrors(encontrados);
|
|
13613
|
+
if (Object.keys(encontrados).length === 0) onSubmit?.(values);
|
|
13614
|
+
};
|
|
13615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { id, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(ITStack, { direction: "column", spacing: 3, alignItems: "stretch", children: [
|
|
13616
|
+
fields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
13617
|
+
ITInput,
|
|
13618
|
+
{
|
|
13619
|
+
name: field.name,
|
|
13620
|
+
label: field.label,
|
|
13621
|
+
type: field.kind === "email" ? "email" : "text",
|
|
13622
|
+
value: values[field.name] ?? "",
|
|
13623
|
+
touched: intentado,
|
|
13624
|
+
error: errors[field.name] ? mensaje(errors[field.name], field) : void 0,
|
|
13625
|
+
onChange: (evento) => {
|
|
13626
|
+
const valor = valorDe(evento);
|
|
13627
|
+
setValues((previo) => ({ ...previo, [field.name]: valor }));
|
|
13628
|
+
setErrors((previo) => {
|
|
13629
|
+
if (!previo[field.name]) return previo;
|
|
13630
|
+
const resto = { ...previo };
|
|
13631
|
+
delete resto[field.name];
|
|
13632
|
+
return resto;
|
|
13633
|
+
});
|
|
13634
|
+
}
|
|
13635
|
+
},
|
|
13636
|
+
field.name
|
|
13637
|
+
)),
|
|
13638
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(flex_default, { children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ITButton, { label: submitLabel ?? t("jsonRenderer.form.submit"), size: "sm", onClick: enviar }) })
|
|
13639
|
+
] }) });
|
|
13640
|
+
}
|
|
13641
|
+
|
|
13642
|
+
// src/json-renderer/actions/effects.ts
|
|
13643
|
+
var MAX_EFFECT_DEPTH = 5;
|
|
13644
|
+
var EFFECT_KEYS = ["toast", "navigate", "refresh", "openOverlay", "closeOverlay", "set"];
|
|
13645
|
+
var EFFECT_KEYS_DEL_HOST = ["toast", "navigate", "refresh", "openOverlay", "closeOverlay"];
|
|
13646
|
+
function leerResultado(ruta, resultado) {
|
|
13647
|
+
return ruta.split(".").reduce(
|
|
13648
|
+
(actual, clave) => actual && typeof actual === "object" ? actual[clave] : void 0,
|
|
13649
|
+
resultado
|
|
13650
|
+
);
|
|
13651
|
+
}
|
|
13652
|
+
function resolverResultado(valor, resultado) {
|
|
13653
|
+
if (!valor || typeof valor !== "object" || Array.isArray(valor)) return valor;
|
|
13654
|
+
const objeto = valor;
|
|
13655
|
+
if (typeof objeto.$result === "string") return leerResultado(objeto.$result, resultado) ?? "";
|
|
13656
|
+
if (objeto.params && typeof objeto.params === "object") {
|
|
13657
|
+
const params = Object.fromEntries(
|
|
13658
|
+
Object.entries(objeto.params).map(([clave, valorParam]) => [
|
|
13659
|
+
clave,
|
|
13660
|
+
resolverResultado(valorParam, resultado)
|
|
13661
|
+
])
|
|
13662
|
+
);
|
|
13663
|
+
return { ...objeto, params };
|
|
13664
|
+
}
|
|
13665
|
+
return valor;
|
|
13666
|
+
}
|
|
13667
|
+
function plantilla(texto, resultado) {
|
|
13668
|
+
return texto.replace(/\{([\w.]+)\}/g, (_, ruta) => {
|
|
13669
|
+
const valor = leerResultado(ruta, resultado);
|
|
13670
|
+
return valor === void 0 ? "" : String(valor);
|
|
13671
|
+
});
|
|
13672
|
+
}
|
|
13673
|
+
function efectosSueltos(declarada) {
|
|
13674
|
+
const sueltos = {};
|
|
13675
|
+
for (const clave of EFFECT_KEYS) {
|
|
13676
|
+
if (declarada[clave] !== void 0) sueltos[clave] = declarada[clave];
|
|
13677
|
+
}
|
|
13678
|
+
return Object.keys(sueltos).length > 0 ? sueltos : null;
|
|
13679
|
+
}
|
|
13680
|
+
function comprobarRegistro(efecto, context) {
|
|
13681
|
+
for (const clave of EFFECT_KEYS_DEL_HOST) {
|
|
13682
|
+
if (efecto[clave] === void 0) continue;
|
|
13683
|
+
if (typeof context.effects?.[clave] !== "function") {
|
|
13684
|
+
context.report(
|
|
13685
|
+
issue("JR040", `El host no implementa el efecto \`${clave}\`.`, formatPath(context.path), {
|
|
13686
|
+
severity: "warning",
|
|
13687
|
+
hint: "Reg\xEDstralo en `effects` del renderizador o quita el efecto del esquema."
|
|
13688
|
+
})
|
|
13689
|
+
);
|
|
13690
|
+
}
|
|
13691
|
+
}
|
|
13692
|
+
}
|
|
13693
|
+
function cumplirEfecto(efecto, context, resultado) {
|
|
13694
|
+
if (efecto.set && context.setState) {
|
|
13695
|
+
const cambios = {};
|
|
13696
|
+
for (const [clave, valor] of Object.entries(efecto.set)) {
|
|
13697
|
+
const conResultado = resolverResultado(valor, resultado);
|
|
13698
|
+
cambios[clave] = context.resolveRaw ? context.resolveRaw(conResultado, context.path) : conResultado;
|
|
13699
|
+
}
|
|
13700
|
+
context.setState(cambios);
|
|
13701
|
+
}
|
|
13702
|
+
const registro = context.effects;
|
|
13703
|
+
if (!registro) return;
|
|
13704
|
+
if (efecto.toast && registro.toast) {
|
|
13705
|
+
registro.toast({
|
|
13706
|
+
variant: efecto.toast.variant ?? "info",
|
|
13707
|
+
message: context.resolveText(resolverResultado(efecto.toast.message, resultado), context.path)
|
|
13708
|
+
});
|
|
13709
|
+
}
|
|
13710
|
+
if (typeof efecto.navigate === "string" && registro.navigate) {
|
|
13711
|
+
registro.navigate(plantilla(efecto.navigate, resultado));
|
|
13712
|
+
}
|
|
13713
|
+
if (typeof efecto.refresh === "string" && registro.refresh) registro.refresh(efecto.refresh);
|
|
13714
|
+
if (typeof efecto.openOverlay === "string" && registro.openOverlay) registro.openOverlay(efecto.openOverlay);
|
|
13715
|
+
if (efecto.closeOverlay !== void 0 && registro.closeOverlay) {
|
|
13716
|
+
registro.closeOverlay(typeof efecto.closeOverlay === "string" ? efecto.closeOverlay : void 0);
|
|
13717
|
+
}
|
|
13718
|
+
}
|
|
13719
|
+
function pasosDe(efectos, context) {
|
|
13720
|
+
const profundidad = context.depth ?? 0;
|
|
13721
|
+
return efectos.map((efecto) => {
|
|
13722
|
+
if (typeof efecto.action !== "string") {
|
|
13723
|
+
comprobarRegistro(efecto, context);
|
|
13724
|
+
return (resultado) => cumplirEfecto(efecto, context, resultado);
|
|
13725
|
+
}
|
|
13726
|
+
if (profundidad + 1 > MAX_EFFECT_DEPTH) {
|
|
13727
|
+
context.report(
|
|
13728
|
+
issue("JR042", `El encadenado de acciones supera ${MAX_EFFECT_DEPTH} niveles.`, formatPath(context.path), {
|
|
13729
|
+
severity: "error",
|
|
13730
|
+
hint: "Reduce los `then` anidados."
|
|
13731
|
+
})
|
|
13732
|
+
);
|
|
13733
|
+
return () => void 0;
|
|
13734
|
+
}
|
|
13735
|
+
const handler = context.resolveChained?.(efecto.action);
|
|
13736
|
+
if (!handler) {
|
|
13737
|
+
context.report(
|
|
13738
|
+
issue("JR040", `La acci\xF3n encadenada \`${efecto.action}\` no est\xE1 registrada por el host.`, formatPath(context.path), {
|
|
13739
|
+
severity: "error",
|
|
13740
|
+
hint: "Reg\xEDstrala en las acciones del renderizador o cambia el nombre en el esquema."
|
|
13741
|
+
})
|
|
13742
|
+
);
|
|
13743
|
+
return () => void 0;
|
|
13744
|
+
}
|
|
13745
|
+
const encadenada = wrapAction(handler, efecto, { ...context, depth: profundidad + 1 });
|
|
13746
|
+
return () => encadenada(efecto.args);
|
|
13747
|
+
});
|
|
13748
|
+
}
|
|
13749
|
+
function wrapAction(handler, action, context) {
|
|
13750
|
+
if (!action || typeof action !== "object") return handler;
|
|
13751
|
+
const declarada = action;
|
|
13752
|
+
const sueltos = efectosSueltos(declarada);
|
|
13753
|
+
const alTerminar = [...sueltos ? [sueltos] : [], ...Array.isArray(declarada.then) ? declarada.then : []];
|
|
13754
|
+
const alFallar = declarada.onError;
|
|
13755
|
+
if (alTerminar.length === 0 && !alFallar) return handler;
|
|
13756
|
+
const pasosOk = pasosDe(alTerminar, context);
|
|
13757
|
+
const pasoError = alFallar ? pasosDe([alFallar], context)[0] : void 0;
|
|
13758
|
+
const aplicar = (resultado) => pasosOk.forEach((paso) => paso(resultado));
|
|
13759
|
+
return (...args) => {
|
|
13760
|
+
let resultado;
|
|
13761
|
+
try {
|
|
13762
|
+
resultado = handler(...args);
|
|
13763
|
+
} catch {
|
|
13764
|
+
pasoError?.(void 0);
|
|
13765
|
+
return void 0;
|
|
13766
|
+
}
|
|
13767
|
+
if (resultado && typeof resultado.then === "function") {
|
|
13768
|
+
let resuelta = false;
|
|
13769
|
+
const limite = context.timeoutMs;
|
|
13770
|
+
const temporizador = limite !== void 0 && Number.isFinite(limite) ? setTimeout(() => {
|
|
13771
|
+
if (resuelta) return;
|
|
13772
|
+
resuelta = true;
|
|
13773
|
+
context.reportRuntime?.(
|
|
13774
|
+
issue("JR041", `La acci\xF3n excedi\xF3 ${limite} ms y se considera fallida.`, formatPath(context.path), {
|
|
13775
|
+
severity: "error",
|
|
13776
|
+
hint: "El host debe responder o rechazar la acci\xF3n a tiempo."
|
|
13777
|
+
})
|
|
13778
|
+
);
|
|
13779
|
+
pasoError?.(void 0);
|
|
13780
|
+
}, limite) : void 0;
|
|
13781
|
+
resultado.then(
|
|
13782
|
+
(valor) => {
|
|
13783
|
+
if (resuelta) return;
|
|
13784
|
+
resuelta = true;
|
|
13785
|
+
clearTimeout(temporizador);
|
|
13786
|
+
aplicar(valor);
|
|
13787
|
+
},
|
|
13788
|
+
() => {
|
|
13789
|
+
if (resuelta) return;
|
|
13790
|
+
resuelta = true;
|
|
13791
|
+
clearTimeout(temporizador);
|
|
13792
|
+
pasoError?.(void 0);
|
|
13793
|
+
}
|
|
13794
|
+
);
|
|
13795
|
+
return resultado;
|
|
13796
|
+
}
|
|
13797
|
+
aplicar(resultado);
|
|
13798
|
+
return resultado;
|
|
13799
|
+
};
|
|
13800
|
+
}
|
|
13801
|
+
|
|
13338
13802
|
// src/json-renderer/kernel/renderNode.tsx
|
|
13803
|
+
function effectContext(options, path, node) {
|
|
13804
|
+
return {
|
|
13805
|
+
effects: options.effects,
|
|
13806
|
+
path,
|
|
13807
|
+
resolveText: (value, valuePath) => textoDe(options.resolveValue ? options.resolveValue(value, valuePath) : value),
|
|
13808
|
+
report: (aviso) => options.issues.push(aviso),
|
|
13809
|
+
// Una acción encadenada desde un efecto se resuelve con el mismo `resolveAction` del host.
|
|
13810
|
+
resolveChained: (name) => options.resolveAction?.(node, "chain", { action: name }, path),
|
|
13811
|
+
timeoutMs: options.actionTimeoutMs,
|
|
13812
|
+
reportRuntime: options.onIssue,
|
|
13813
|
+
setState: options.setState,
|
|
13814
|
+
resolveRaw: (value, valuePath) => options.resolveValue ? options.resolveValue(value, valuePath) : value
|
|
13815
|
+
};
|
|
13816
|
+
}
|
|
13817
|
+
function nombreDeAccion(action) {
|
|
13818
|
+
const nombre = action?.action;
|
|
13819
|
+
return typeof nombre === "string" ? nombre : "(sin nombre)";
|
|
13820
|
+
}
|
|
13821
|
+
function isFormNode(node) {
|
|
13822
|
+
return node.type === "form";
|
|
13823
|
+
}
|
|
13824
|
+
function textoDe(value) {
|
|
13825
|
+
return typeof value === "string" || typeof value === "number" || typeof value === "boolean" ? String(value) : "";
|
|
13826
|
+
}
|
|
13339
13827
|
function childList(node) {
|
|
13340
13828
|
if (!node || node.children === void 0 || node.children === null) return [];
|
|
13341
13829
|
return Array.isArray(node.children) ? node.children : [node.children];
|
|
13342
13830
|
}
|
|
13831
|
+
function renderSlot(node, options) {
|
|
13832
|
+
const { path, issues, slots, resolveValue } = options;
|
|
13833
|
+
const name = slotName(node);
|
|
13834
|
+
if (!name) {
|
|
13835
|
+
issues.push(
|
|
13836
|
+
issue("JR011", "El slot no declara `props.name`.", formatPath(propPath(path, "name")), {
|
|
13837
|
+
severity: "error",
|
|
13838
|
+
hint: 'Declara el nombre que el host registr\xF3, por ejemplo { "type": "slot", "props": { "name": "resumen" } }.'
|
|
13839
|
+
})
|
|
13840
|
+
);
|
|
13841
|
+
return null;
|
|
13842
|
+
}
|
|
13843
|
+
const Component = slots && Object.prototype.hasOwnProperty.call(slots, name) ? slots[name] : void 0;
|
|
13844
|
+
if (!Component) {
|
|
13845
|
+
issues.push(
|
|
13846
|
+
issue("JR010", `El slot \`${name}\` no est\xE1 registrado por el host.`, formatPath(path), {
|
|
13847
|
+
severity: "error",
|
|
13848
|
+
hint: "El host debe registrarlo en `slots` del renderizador."
|
|
13849
|
+
})
|
|
13850
|
+
);
|
|
13851
|
+
return null;
|
|
13852
|
+
}
|
|
13853
|
+
const props = {};
|
|
13854
|
+
for (const [key, raw] of Object.entries(node.props ?? {})) {
|
|
13855
|
+
if (key === "name") continue;
|
|
13856
|
+
props[key] = resolveValue ? resolveValue(raw, path) : raw;
|
|
13857
|
+
}
|
|
13858
|
+
return import_react55.default.createElement(Component, { key: node.id ?? path.join("-"), ...props });
|
|
13859
|
+
}
|
|
13860
|
+
function renderForm(node, options) {
|
|
13861
|
+
const { path, issues, resolveValue, resolveAction } = options;
|
|
13862
|
+
const { fields: declarados, issues: avisos } = readFormFields(node.props?.fields, [...path, "props", "fields"]);
|
|
13863
|
+
issues.push(...avisos);
|
|
13864
|
+
const campos = declarados.map((campo, index) => {
|
|
13865
|
+
const etiqueta = resolveValue ? resolveValue(campo.label, [...path, "props", "fields", index]) : campo.label;
|
|
13866
|
+
return {
|
|
13867
|
+
name: campo.name,
|
|
13868
|
+
kind: campo.kind,
|
|
13869
|
+
required: campo.required,
|
|
13870
|
+
minLength: campo.minLength,
|
|
13871
|
+
maxLength: campo.maxLength,
|
|
13872
|
+
label: textoDe(etiqueta) || campo.name
|
|
13873
|
+
};
|
|
13874
|
+
});
|
|
13875
|
+
const textoEnvio = node.props?.submitLabel;
|
|
13876
|
+
const submitLabel = textoDe(resolveValue ? resolveValue(textoEnvio, path) : textoEnvio) || void 0;
|
|
13877
|
+
const accion = resolveAction?.(node, "onSubmit", node.props?.onSubmit, path);
|
|
13878
|
+
if (node.props?.onSubmit !== void 0 && typeof accion !== "function") {
|
|
13879
|
+
issues.push(
|
|
13880
|
+
issue("JR040", `La acci\xF3n "${nombreDeAccion(node.props.onSubmit)}" no est\xE1 registrada por el host.`, formatPath(propPath(path, "onSubmit")), {
|
|
13881
|
+
severity: "warning",
|
|
13882
|
+
hint: "Reg\xEDstrala en `resolveAction` del host. Sin ella, enviar el formulario no hace nada."
|
|
13883
|
+
})
|
|
13884
|
+
);
|
|
13885
|
+
}
|
|
13886
|
+
const conEfectos = accion ? wrapAction(accion, node.props?.onSubmit, effectContext(options, path, node)) : void 0;
|
|
13887
|
+
return import_react55.default.createElement(FormNode, {
|
|
13888
|
+
key: node.id ?? path.join("-"),
|
|
13889
|
+
id: node.id,
|
|
13890
|
+
fields: campos,
|
|
13891
|
+
submitLabel,
|
|
13892
|
+
onSubmit: conEfectos ? (valores) => conEfectos(valores) : void 0
|
|
13893
|
+
});
|
|
13894
|
+
}
|
|
13895
|
+
function prepararColumnas(columnas, node, options, path) {
|
|
13896
|
+
if (!Array.isArray(columnas)) return columnas;
|
|
13897
|
+
return columnas.map((columna, indice) => {
|
|
13898
|
+
if (!columna || typeof columna !== "object") return columna;
|
|
13899
|
+
const declarada = columna;
|
|
13900
|
+
if (declarada.type !== "actions" || !Array.isArray(declarada.rowActions)) return columna;
|
|
13901
|
+
const colPath = [...path, "props", "columns", indice];
|
|
13902
|
+
const botones = declarada.rowActions.flatMap((raw, indiceAccion) => {
|
|
13903
|
+
const accion = raw;
|
|
13904
|
+
const rutaAccion = [...colPath, "rowActions", indiceAccion];
|
|
13905
|
+
if (!accion || typeof accion.action !== "string" || accion.action === "") {
|
|
13906
|
+
options.issues.push(issue("JR021", "Un bot\xF3n de fila no declara `action`.", formatPath(rutaAccion), { severity: "error" }));
|
|
13907
|
+
return [];
|
|
13908
|
+
}
|
|
13909
|
+
const faltan = faltanCapacidades(accion.requires, options.capabilities);
|
|
13910
|
+
if (faltan.length > 0) {
|
|
13911
|
+
options.issues.push(
|
|
13912
|
+
issue("JR061", `El bot\xF3n de fila "${accion.action}" exige ${faltan.join(", ")}, que no est\xE1 concedido.`, formatPath(rutaAccion), {
|
|
13913
|
+
severity: "warning",
|
|
13914
|
+
hint: "Concede la capacidad con la prop `capabilities` del renderizador."
|
|
13915
|
+
})
|
|
13916
|
+
);
|
|
13917
|
+
return [];
|
|
13918
|
+
}
|
|
13919
|
+
const handler = options.resolveAction?.(node, `fila:${accion.action}`, accion, rutaAccion);
|
|
13920
|
+
if (typeof handler !== "function") {
|
|
13921
|
+
options.issues.push(
|
|
13922
|
+
issue("JR040", `La acci\xF3n de fila "${accion.action}" no est\xE1 registrada por el host.`, formatPath(rutaAccion), {
|
|
13923
|
+
severity: "warning",
|
|
13924
|
+
hint: "Reg\xEDstrala en `resolveAction` del host, o quita el bot\xF3n del esquema."
|
|
13925
|
+
})
|
|
13926
|
+
);
|
|
13927
|
+
return [];
|
|
13928
|
+
}
|
|
13929
|
+
const etiqueta = textoDe(options.resolveValue ? options.resolveValue(accion.label, rutaAccion) : accion.label);
|
|
13930
|
+
return [
|
|
13931
|
+
{
|
|
13932
|
+
clave: String(indiceAccion),
|
|
13933
|
+
etiqueta: etiqueta || accion.action,
|
|
13934
|
+
color: typeof accion.color === "string" ? accion.color : "secondary",
|
|
13935
|
+
variante: typeof accion.variant === "string" ? accion.variant : "outlined",
|
|
13936
|
+
ejecutar: wrapAction(handler, accion, effectContext(options, rutaAccion, node))
|
|
13937
|
+
}
|
|
13938
|
+
];
|
|
13939
|
+
});
|
|
13940
|
+
const copia = { ...declarada };
|
|
13941
|
+
delete copia.rowActions;
|
|
13942
|
+
const etiquetaColumna = textoDe(options.resolveValue ? options.resolveValue(copia.label, colPath) : copia.label);
|
|
13943
|
+
const Boton = ITButton;
|
|
13944
|
+
return {
|
|
13945
|
+
...copia,
|
|
13946
|
+
label: etiquetaColumna || String(copia.key ?? ""),
|
|
13947
|
+
actions: (fila) => import_react55.default.createElement(
|
|
13948
|
+
import_react55.default.Fragment,
|
|
13949
|
+
null,
|
|
13950
|
+
botones.map(
|
|
13951
|
+
(boton) => import_react55.default.createElement(Boton, {
|
|
13952
|
+
key: boton.clave,
|
|
13953
|
+
label: boton.etiqueta,
|
|
13954
|
+
size: "sm",
|
|
13955
|
+
variant: boton.variante,
|
|
13956
|
+
color: boton.color,
|
|
13957
|
+
onClick: () => boton.ejecutar(fila)
|
|
13958
|
+
})
|
|
13959
|
+
)
|
|
13960
|
+
)
|
|
13961
|
+
};
|
|
13962
|
+
});
|
|
13963
|
+
}
|
|
13343
13964
|
function renderNode(node, options) {
|
|
13344
13965
|
const { catalog, path, issues, renderChildren } = options;
|
|
13345
13966
|
if (!node || typeof node !== "object") {
|
|
@@ -13348,6 +13969,12 @@ function renderNode(node, options) {
|
|
|
13348
13969
|
if (isNodePending(node)) {
|
|
13349
13970
|
return options.pendingFallback ?? null;
|
|
13350
13971
|
}
|
|
13972
|
+
if (isSlotNode(node)) {
|
|
13973
|
+
return renderSlot(node, options);
|
|
13974
|
+
}
|
|
13975
|
+
if (isFormNode(node)) {
|
|
13976
|
+
return renderForm(node, options);
|
|
13977
|
+
}
|
|
13351
13978
|
const resolved = resolveNode(node, catalog, path);
|
|
13352
13979
|
issues.push(...resolved.issues);
|
|
13353
13980
|
if (!resolved.ok) {
|
|
@@ -13358,15 +13985,37 @@ function renderNode(node, options) {
|
|
|
13358
13985
|
for (const [name, value] of Object.entries(props)) {
|
|
13359
13986
|
finalProps[name] = options.resolveValue ? options.resolveValue(value, path) : value;
|
|
13360
13987
|
}
|
|
13988
|
+
if (node.type === "ITDataTable" && finalProps.columns !== void 0) {
|
|
13989
|
+
finalProps.columns = prepararColumnas(finalProps.columns, node, options, path);
|
|
13990
|
+
}
|
|
13361
13991
|
for (const [name, action] of Object.entries(actions)) {
|
|
13992
|
+
const faltan = faltanCapacidades(action?.requires, options.capabilities);
|
|
13993
|
+
if (faltan.length > 0) {
|
|
13994
|
+
issues.push(
|
|
13995
|
+
issue("JR061", `La acci\xF3n "${nombreDeAccion(action)}" exige ${faltan.join(", ")}, que no est\xE1 concedido.`, formatPath(propPath(path, name)), {
|
|
13996
|
+
severity: "warning",
|
|
13997
|
+
hint: "Concede la capacidad con la prop `capabilities` del renderizador. Sin ella, la acci\xF3n no se ejecuta."
|
|
13998
|
+
})
|
|
13999
|
+
);
|
|
14000
|
+
continue;
|
|
14001
|
+
}
|
|
13362
14002
|
const handler = options.resolveAction?.(node, name, action, path);
|
|
13363
|
-
if (typeof handler === "function")
|
|
14003
|
+
if (typeof handler === "function") {
|
|
14004
|
+
finalProps[name] = wrapAction(handler, action, effectContext(options, path, node));
|
|
14005
|
+
} else {
|
|
14006
|
+
issues.push(
|
|
14007
|
+
issue("JR040", `La acci\xF3n "${nombreDeAccion(action)}" no est\xE1 registrada por el host.`, formatPath(propPath(path, name)), {
|
|
14008
|
+
severity: "warning",
|
|
14009
|
+
hint: "Reg\xEDstrala en `resolveAction` del host, o quita la prop del esquema."
|
|
14010
|
+
})
|
|
14011
|
+
);
|
|
14012
|
+
}
|
|
13364
14013
|
}
|
|
13365
14014
|
const content = renderChildren ? renderChildren(node, path) : null;
|
|
13366
14015
|
const rawText = entry.text && node.text !== void 0 ? node.text : void 0;
|
|
13367
14016
|
const text = rawText === void 0 ? void 0 : options.resolveValue ? options.resolveValue(rawText, path) : rawText;
|
|
13368
14017
|
const children = content ?? text;
|
|
13369
|
-
const element =
|
|
14018
|
+
const element = import_react55.default.createElement(
|
|
13370
14019
|
entry.component,
|
|
13371
14020
|
{ ...finalProps, key: node.id ?? path.join("-"), id: node.id },
|
|
13372
14021
|
children
|
|
@@ -13422,7 +14071,7 @@ function countPendingNodes(schema) {
|
|
|
13422
14071
|
}
|
|
13423
14072
|
|
|
13424
14073
|
// src/json-renderer/kernel/SchemaRenderer.tsx
|
|
13425
|
-
var
|
|
14074
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
13426
14075
|
function renderTree(node, path, context, level) {
|
|
13427
14076
|
if (!node || typeof node !== "object") return null;
|
|
13428
14077
|
if (level > context.limits.maxDepth) return null;
|
|
@@ -13432,6 +14081,16 @@ function renderTree(node, path, context, level) {
|
|
|
13432
14081
|
issues.push(issue2);
|
|
13433
14082
|
context.onIssue?.(issue2);
|
|
13434
14083
|
};
|
|
14084
|
+
const faltan = faltanCapacidades(node.requires, context.capabilities);
|
|
14085
|
+
if (faltan.length > 0) {
|
|
14086
|
+
reportIssue(
|
|
14087
|
+
issue("JR060", `Falta la capacidad ${faltan.join(", ")} para pintar \`${node.type}\`.`, formatPath(path), {
|
|
14088
|
+
severity: "warning",
|
|
14089
|
+
hint: "El host debe conceder la capacidad con la prop `capabilities`, o el nodo debe declarar un `fallback`."
|
|
14090
|
+
})
|
|
14091
|
+
);
|
|
14092
|
+
return node.fallback ? renderTree(node.fallback, [...path, "fallback"], context, level + 1) : null;
|
|
14093
|
+
}
|
|
13435
14094
|
const issuesBefore = issues.length;
|
|
13436
14095
|
const element = renderNode(node, {
|
|
13437
14096
|
catalog: context.catalog,
|
|
@@ -13440,6 +14099,12 @@ function renderTree(node, path, context, level) {
|
|
|
13440
14099
|
resolveValue: context.resolveValue,
|
|
13441
14100
|
resolveAction: context.resolveAction,
|
|
13442
14101
|
pendingFallback: context.pendingFallback,
|
|
14102
|
+
slots: context.slots,
|
|
14103
|
+
effects: context.effects,
|
|
14104
|
+
actionTimeoutMs: context.limits.actionTimeoutMs,
|
|
14105
|
+
onIssue: context.onIssue,
|
|
14106
|
+
setState: context.setState,
|
|
14107
|
+
capabilities: context.capabilities,
|
|
13443
14108
|
renderChildren: (current, currentPath) => {
|
|
13444
14109
|
const children = childList(current);
|
|
13445
14110
|
if (children.length === 0) return void 0;
|
|
@@ -13452,7 +14117,7 @@ function renderTree(node, path, context, level) {
|
|
|
13452
14117
|
context.onIssue?.(issues[index]);
|
|
13453
14118
|
}
|
|
13454
14119
|
const fallback = node.fallback ? renderTree(node.fallback, [...path, "fallback"], context, level + 1) : context.pendingFallback ?? null;
|
|
13455
|
-
const wrapped = /* @__PURE__ */ (0,
|
|
14120
|
+
const wrapped = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
13456
14121
|
NodeBoundary,
|
|
13457
14122
|
{
|
|
13458
14123
|
path: path.join("."),
|
|
@@ -13474,43 +14139,84 @@ function ITSchemaRenderer({
|
|
|
13474
14139
|
schema,
|
|
13475
14140
|
catalog = axzyCatalog,
|
|
13476
14141
|
limits,
|
|
14142
|
+
params,
|
|
14143
|
+
dataHandlers,
|
|
14144
|
+
slots,
|
|
14145
|
+
effects,
|
|
14146
|
+
capabilities,
|
|
13477
14147
|
resolveValue,
|
|
13478
14148
|
resolveAction,
|
|
13479
14149
|
pendingFallback,
|
|
13480
14150
|
onIssue,
|
|
13481
14151
|
className
|
|
13482
14152
|
}) {
|
|
13483
|
-
const resolvedLimits = (0,
|
|
14153
|
+
const resolvedLimits = (0, import_react56.useMemo)(() => resolveLimits(limits), [limits]);
|
|
14154
|
+
const [escrito, setEscrito] = (0, import_react56.useState)({
|
|
14155
|
+
origen: schema,
|
|
14156
|
+
valores: {}
|
|
14157
|
+
});
|
|
14158
|
+
const valoresPantalla = (0, import_react56.useMemo)(
|
|
14159
|
+
() => ({ ...schema?.state ?? {}, ...escrito.origen === schema ? escrito.valores : {} }),
|
|
14160
|
+
[schema, escrito]
|
|
14161
|
+
);
|
|
14162
|
+
const escribirEstado = (0, import_react56.useCallback)(
|
|
14163
|
+
(cambios) => setEscrito((previo) => ({
|
|
14164
|
+
origen: schema,
|
|
14165
|
+
valores: { ...previo.origen === schema ? previo.valores : {}, ...cambios }
|
|
14166
|
+
})),
|
|
14167
|
+
[schema]
|
|
14168
|
+
);
|
|
13484
14169
|
const issues = [];
|
|
13485
14170
|
const nodeIds = /* @__PURE__ */ new Set();
|
|
13486
|
-
const audit = (0,
|
|
14171
|
+
const audit = (0, import_react56.useMemo)(
|
|
13487
14172
|
() => schema ? auditTree(schema, resolvedLimits) : null,
|
|
13488
14173
|
[schema, resolvedLimits]
|
|
13489
14174
|
);
|
|
13490
|
-
const context = (0,
|
|
14175
|
+
const context = (0, import_react56.useMemo)(
|
|
13491
14176
|
() => ({
|
|
13492
14177
|
catalog,
|
|
13493
14178
|
nodeIds,
|
|
13494
14179
|
limits: resolvedLimits,
|
|
13495
14180
|
issues,
|
|
13496
14181
|
onIssue,
|
|
13497
|
-
|
|
14182
|
+
// El binding escribe sus avisos (JR030, JR032) en el mismo array que el resto del render.
|
|
14183
|
+
resolveValue: createBindingResolver({
|
|
14184
|
+
data: schema?.data,
|
|
14185
|
+
state: valoresPantalla,
|
|
14186
|
+
params,
|
|
14187
|
+
handlers: dataHandlers,
|
|
14188
|
+
report: (aviso) => issues.push(aviso),
|
|
14189
|
+
host: resolveValue
|
|
14190
|
+
}),
|
|
13498
14191
|
resolveAction,
|
|
13499
|
-
pendingFallback
|
|
14192
|
+
pendingFallback,
|
|
14193
|
+
slots,
|
|
14194
|
+
effects,
|
|
14195
|
+
capabilities,
|
|
14196
|
+
setState: escribirEstado
|
|
13500
14197
|
}),
|
|
13501
14198
|
// `issues` es un array nuevo en cada render a propósito: acumular avisos
|
|
13502
14199
|
// entre renders duplicaría los avisos de esquemas que no han cambiado.
|
|
13503
14200
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
13504
|
-
[catalog, resolvedLimits, onIssue, resolveValue, resolveAction, pendingFallback]
|
|
14201
|
+
[schema, params, valoresPantalla, escribirEstado, dataHandlers, slots, effects, capabilities, catalog, resolvedLimits, onIssue, resolveValue, resolveAction, pendingFallback]
|
|
13505
14202
|
);
|
|
13506
|
-
const
|
|
14203
|
+
const faltanRaiz = schema ? faltanCapacidades(schema.requires, capabilities) : [];
|
|
14204
|
+
if (faltanRaiz.length > 0) {
|
|
14205
|
+
issues.push(
|
|
14206
|
+
issue("JR060", `Falta la capacidad ${faltanRaiz.join(", ")} para esta pantalla.`, "requires", {
|
|
14207
|
+
severity: "error",
|
|
14208
|
+
hint: "Concede la capacidad con la prop `capabilities` del renderizador."
|
|
14209
|
+
})
|
|
14210
|
+
);
|
|
14211
|
+
}
|
|
14212
|
+
const content = schema && faltanRaiz.length === 0 ? (Array.isArray(schema.content) ? schema.content : [schema.content]).filter(
|
|
13507
14213
|
(node) => Boolean(node) && typeof node === "object"
|
|
13508
14214
|
) : [];
|
|
13509
14215
|
const children = content.slice(0, resolvedLimits.maxNodes).map((node, index) => renderTree(node, ["content", index], context, 0)).filter(Boolean);
|
|
13510
14216
|
const collected = [...audit?.issues ?? [], ...issues];
|
|
13511
14217
|
const signature = collected.map((issue2) => `${issue2.code}:${issue2.path}`).join("|");
|
|
13512
|
-
const reported = (0,
|
|
13513
|
-
(0,
|
|
14218
|
+
const reported = (0, import_react56.useRef)("");
|
|
14219
|
+
(0, import_react56.useEffect)(() => {
|
|
13514
14220
|
const all = [...collected];
|
|
13515
14221
|
for (const id of nodeIds) {
|
|
13516
14222
|
if (!document.getElementById(id)) {
|
|
@@ -13529,7 +14235,159 @@ function ITSchemaRenderer({
|
|
|
13529
14235
|
for (const issue2 of all) onIssue(issue2);
|
|
13530
14236
|
}, [signature, onIssue]);
|
|
13531
14237
|
if (!schema || children.length === 0) return null;
|
|
13532
|
-
return className ? /* @__PURE__ */ (0,
|
|
14238
|
+
return className ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className, children }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_jsx_runtime76.Fragment, { children });
|
|
14239
|
+
}
|
|
14240
|
+
|
|
14241
|
+
// src/json-renderer/routing/routes.ts
|
|
14242
|
+
function joinRoutePath(parent, own2) {
|
|
14243
|
+
return [parent, typeof own2 === "string" ? own2 : ""].flatMap((part) => part.split("/")).filter((segment) => segment !== "").join("/");
|
|
14244
|
+
}
|
|
14245
|
+
var SEGMENT = /^(:[A-Za-z][A-Za-z0-9_]*|[A-Za-z0-9_.-]+)$/;
|
|
14246
|
+
function validateRoutes(input) {
|
|
14247
|
+
const errors = [];
|
|
14248
|
+
const document2 = input;
|
|
14249
|
+
if (!document2 || typeof document2 !== "object" || Array.isArray(document2)) {
|
|
14250
|
+
return [issue("JR020", "El documento de rutas debe ser un objeto.", "", { severity: "error" })];
|
|
14251
|
+
}
|
|
14252
|
+
if (typeof document2.version !== "number") {
|
|
14253
|
+
errors.push(issue("JR020", "El documento de rutas no declara `version`.", "version", { severity: "error" }));
|
|
14254
|
+
}
|
|
14255
|
+
if (!Array.isArray(document2.routes)) {
|
|
14256
|
+
errors.push(issue("JR020", "`routes` debe ser una lista.", "routes", { severity: "error" }));
|
|
14257
|
+
return errors;
|
|
14258
|
+
}
|
|
14259
|
+
const seen = /* @__PURE__ */ new Map();
|
|
14260
|
+
const visit = (route, path, parentPath, isRoot) => {
|
|
14261
|
+
if (!route || typeof route !== "object") {
|
|
14262
|
+
errors.push(issue("JR021", "La ruta no es un objeto.", path, { severity: "error" }));
|
|
14263
|
+
return;
|
|
14264
|
+
}
|
|
14265
|
+
if (typeof route.id !== "string" || route.id === "") {
|
|
14266
|
+
errors.push(issue("JR021", "La ruta no declara `id`.", path, { severity: "error" }));
|
|
14267
|
+
}
|
|
14268
|
+
if (route.path !== void 0 && route.path !== "") {
|
|
14269
|
+
const parts = typeof route.path === "string" ? route.path.split("/").filter(Boolean) : [];
|
|
14270
|
+
if (typeof route.path !== "string" || parts.some((segment) => !SEGMENT.test(segment))) {
|
|
14271
|
+
errors.push(issue("JR021", `El path "${String(route.path)}" no es v\xE1lido.`, `${path}.path`, { severity: "error", hint: "Usa segmentos con letras, d\xEDgitos, guiones o `:param`." }));
|
|
14272
|
+
}
|
|
14273
|
+
}
|
|
14274
|
+
const full = joinRoutePath(parentPath, route.path);
|
|
14275
|
+
if (isRoot && full === "") {
|
|
14276
|
+
errors.push(issue("JR021", "Una ruta ra\xEDz necesita `path`.", `${path}.path`, { severity: "error" }));
|
|
14277
|
+
}
|
|
14278
|
+
if (route.children !== void 0) {
|
|
14279
|
+
if (route.page !== void 0) {
|
|
14280
|
+
errors.push(issue("JR020", "Un grupo no lleva `page`: la pantalla va en sus hijos.", path, { severity: "error" }));
|
|
14281
|
+
}
|
|
14282
|
+
if (!Array.isArray(route.children)) {
|
|
14283
|
+
errors.push(issue("JR020", "`children` debe ser una lista.", `${path}.children`, { severity: "error" }));
|
|
14284
|
+
} else {
|
|
14285
|
+
route.children.forEach((child, index) => visit(child, `${path}.children[${index}]`, full, false));
|
|
14286
|
+
}
|
|
14287
|
+
} else {
|
|
14288
|
+
if (typeof route.page !== "string" || route.page === "") {
|
|
14289
|
+
errors.push(issue("JR020", "La ruta no declara `page`.", path, { severity: "error" }));
|
|
14290
|
+
}
|
|
14291
|
+
const key = `${full}?${JSON.stringify(Object.entries(route.query ?? {}).sort())}`;
|
|
14292
|
+
if (seen.has(key)) {
|
|
14293
|
+
errors.push(issue("JR020", `La ruta "${full || "/"}" se repite con la misma query (ya est\xE1 en ${seen.get(key)}).`, path, { severity: "error" }));
|
|
14294
|
+
} else {
|
|
14295
|
+
seen.set(key, path);
|
|
14296
|
+
}
|
|
14297
|
+
}
|
|
14298
|
+
const nav = route.nav;
|
|
14299
|
+
if (nav !== void 0 && (typeof nav !== "object" || nav === null || nav.label === void 0 || nav.label === null)) {
|
|
14300
|
+
errors.push(issue("JR021", "La entrada de men\xFA no declara `label`.", `${path}.nav`, { severity: "error" }));
|
|
14301
|
+
}
|
|
14302
|
+
};
|
|
14303
|
+
document2.routes.forEach((route, index) => visit(route, `routes[${index}]`, "", true));
|
|
14304
|
+
return errors;
|
|
14305
|
+
}
|
|
14306
|
+
function flattenRoutes(routes) {
|
|
14307
|
+
const flat = [];
|
|
14308
|
+
const visit = (route, parentPath, groups) => {
|
|
14309
|
+
const full = joinRoutePath(parentPath, route.path);
|
|
14310
|
+
if (route.children) {
|
|
14311
|
+
route.children.forEach((child) => visit(child, full, [...groups, route.id]));
|
|
14312
|
+
return;
|
|
14313
|
+
}
|
|
14314
|
+
if (typeof route.page !== "string") return;
|
|
14315
|
+
flat.push({
|
|
14316
|
+
id: route.id,
|
|
14317
|
+
segments: full === "" ? [] : full.split("/"),
|
|
14318
|
+
page: route.page,
|
|
14319
|
+
query: route.query ?? {},
|
|
14320
|
+
nav: route.nav,
|
|
14321
|
+
groups
|
|
14322
|
+
});
|
|
14323
|
+
};
|
|
14324
|
+
routes.forEach((route) => visit(route, "", []));
|
|
14325
|
+
return flat;
|
|
14326
|
+
}
|
|
14327
|
+
|
|
14328
|
+
// src/json-renderer/routing/match.ts
|
|
14329
|
+
function matchRoute(routes, segments, query = {}) {
|
|
14330
|
+
let best = null;
|
|
14331
|
+
let bestStatics = -1;
|
|
14332
|
+
let bestConstraints = -1;
|
|
14333
|
+
for (const route of routes) {
|
|
14334
|
+
if (route.segments.length !== segments.length) continue;
|
|
14335
|
+
const params = {};
|
|
14336
|
+
let statics = 0;
|
|
14337
|
+
let samePath = true;
|
|
14338
|
+
route.segments.forEach((expected, index) => {
|
|
14339
|
+
if (!samePath) return;
|
|
14340
|
+
if (expected.startsWith(":")) {
|
|
14341
|
+
params[expected.slice(1)] = segments[index];
|
|
14342
|
+
return;
|
|
14343
|
+
}
|
|
14344
|
+
statics += 1;
|
|
14345
|
+
samePath = expected === segments[index];
|
|
14346
|
+
});
|
|
14347
|
+
if (!samePath) continue;
|
|
14348
|
+
const constraints = Object.entries(route.query);
|
|
14349
|
+
if (!constraints.every(([key, value]) => query[key] === value)) continue;
|
|
14350
|
+
if (statics > bestStatics || statics === bestStatics && constraints.length > bestConstraints) {
|
|
14351
|
+
best = { route, params };
|
|
14352
|
+
bestStatics = statics;
|
|
14353
|
+
bestConstraints = constraints.length;
|
|
14354
|
+
}
|
|
14355
|
+
}
|
|
14356
|
+
return best;
|
|
14357
|
+
}
|
|
14358
|
+
function routeHref(route, params = {}) {
|
|
14359
|
+
const path = route.segments.map((segment) => segment.startsWith(":") ? params[segment.slice(1)] ?? segment : segment).join("/");
|
|
14360
|
+
const queryString = Object.entries(route.query).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&");
|
|
14361
|
+
return `/${path}${queryString ? `?${queryString}` : ""}`;
|
|
14362
|
+
}
|
|
14363
|
+
|
|
14364
|
+
// src/json-renderer/routing/navigation.ts
|
|
14365
|
+
function buildNavigationTree(routes) {
|
|
14366
|
+
const hrefs = new Map(flattenRoutes(routes).map((route) => [route.id, routeHref(route)]));
|
|
14367
|
+
const visit = (route, parentPath) => {
|
|
14368
|
+
const full = joinRoutePath(parentPath, route.path);
|
|
14369
|
+
if (route.children) {
|
|
14370
|
+
const children = route.children.flatMap((child) => visit(child, full));
|
|
14371
|
+
if (!route.nav) return children;
|
|
14372
|
+
return [toNode(route.id, route.nav, children, children.find((child) => child.href)?.href)];
|
|
14373
|
+
}
|
|
14374
|
+
if (!route.nav) return [];
|
|
14375
|
+
return [toNode(route.id, route.nav, void 0, hrefs.get(route.id))];
|
|
14376
|
+
};
|
|
14377
|
+
return routes.flatMap((route) => visit(route, ""));
|
|
14378
|
+
}
|
|
14379
|
+
function toNode(id, nav, children, href) {
|
|
14380
|
+
return {
|
|
14381
|
+
id,
|
|
14382
|
+
label: nav.label,
|
|
14383
|
+
icon: nav.icon,
|
|
14384
|
+
badge: nav.badge,
|
|
14385
|
+
href,
|
|
14386
|
+
...children ? { children } : {}
|
|
14387
|
+
};
|
|
14388
|
+
}
|
|
14389
|
+
function navContainsRoute(entry, routeId) {
|
|
14390
|
+
return entry.id === routeId || (entry.children?.some((child) => navContainsRoute(child, routeId)) ?? false);
|
|
13533
14391
|
}
|
|
13534
14392
|
|
|
13535
14393
|
// src/json-renderer/validation/validate.ts
|
|
@@ -13540,6 +14398,17 @@ function validateNodes(node, path, catalog, errors, warnings) {
|
|
|
13540
14398
|
return 0;
|
|
13541
14399
|
}
|
|
13542
14400
|
if (isNodePending(node)) return 1;
|
|
14401
|
+
if (node.type === "form") {
|
|
14402
|
+
const { issues: avisos } = readFormFields(node.props?.fields, [...path, "props", "fields"]);
|
|
14403
|
+
for (const item of avisos) (item.severity === "error" ? errors : warnings).push(item);
|
|
14404
|
+
return 0;
|
|
14405
|
+
}
|
|
14406
|
+
if (isSlotNode(node)) {
|
|
14407
|
+
if (!slotName(node)) {
|
|
14408
|
+
errors.push(issue("JR011", "El slot no declara `props.name`.", formatPath([...path, "props", "name"]), { severity: "error" }));
|
|
14409
|
+
}
|
|
14410
|
+
return 0;
|
|
14411
|
+
}
|
|
13543
14412
|
const resolved = resolveNode(node, catalog, path);
|
|
13544
14413
|
for (const item of resolved.issues) {
|
|
13545
14414
|
(item.severity === "error" ? errors : warnings).push(item);
|
|
@@ -13722,8 +14591,143 @@ function formatVocabularyForPrompt(contract) {
|
|
|
13722
14591
|
return lines.join("\n");
|
|
13723
14592
|
}
|
|
13724
14593
|
|
|
14594
|
+
// src/json-renderer/stream/useSchemaStream.ts
|
|
14595
|
+
var import_react57 = require("react");
|
|
14596
|
+
var VACIO = {
|
|
14597
|
+
tree: null,
|
|
14598
|
+
status: "complete",
|
|
14599
|
+
broken: false,
|
|
14600
|
+
pendingNodes: 0,
|
|
14601
|
+
streaming: false,
|
|
14602
|
+
text: "",
|
|
14603
|
+
issues: []
|
|
14604
|
+
};
|
|
14605
|
+
var grabaciones = /* @__PURE__ */ new WeakMap();
|
|
14606
|
+
function esAsyncIterable(value) {
|
|
14607
|
+
return value !== null && typeof value === "object" && typeof value[Symbol.asyncIterator] === "function";
|
|
14608
|
+
}
|
|
14609
|
+
async function* desdeReadable(readable) {
|
|
14610
|
+
const reader = readable.getReader();
|
|
14611
|
+
try {
|
|
14612
|
+
for (; ; ) {
|
|
14613
|
+
const { done, value } = await reader.read();
|
|
14614
|
+
if (done) return;
|
|
14615
|
+
yield value;
|
|
14616
|
+
}
|
|
14617
|
+
} finally {
|
|
14618
|
+
await reader.cancel().catch(() => void 0);
|
|
14619
|
+
}
|
|
14620
|
+
}
|
|
14621
|
+
function mensajeDe(error) {
|
|
14622
|
+
return error instanceof Error ? error.message : String(error);
|
|
14623
|
+
}
|
|
14624
|
+
function crearGrabacion(source) {
|
|
14625
|
+
const iterador = typeof source === "string" ? null : esAsyncIterable(source) ? source[Symbol.asyncIterator]() : desdeReadable(source)[Symbol.asyncIterator]();
|
|
14626
|
+
return {
|
|
14627
|
+
texto: typeof source === "string" ? source : "",
|
|
14628
|
+
iterador,
|
|
14629
|
+
terminado: typeof source === "string",
|
|
14630
|
+
error: null,
|
|
14631
|
+
avisos: [],
|
|
14632
|
+
activos: 0,
|
|
14633
|
+
ultimoValido: null,
|
|
14634
|
+
cerrada: false,
|
|
14635
|
+
cancelada: false
|
|
14636
|
+
};
|
|
14637
|
+
}
|
|
14638
|
+
function estadoDe(grab, streaming) {
|
|
14639
|
+
const parcial = parsePartialSchema(grab.texto);
|
|
14640
|
+
if (!parcial.broken && parcial.tree) grab.ultimoValido = parcial.tree;
|
|
14641
|
+
return {
|
|
14642
|
+
tree: parcial.broken ? grab.ultimoValido : parcial.tree,
|
|
14643
|
+
status: parcial.status,
|
|
14644
|
+
broken: parcial.broken,
|
|
14645
|
+
pendingNodes: parcial.pendingNodes,
|
|
14646
|
+
streaming,
|
|
14647
|
+
text: grab.texto,
|
|
14648
|
+
issues: [...grab.avisos]
|
|
14649
|
+
};
|
|
14650
|
+
}
|
|
14651
|
+
function cerrarGrabacion(grab) {
|
|
14652
|
+
if (grab.cerrada || grab.cancelada) return;
|
|
14653
|
+
grab.cerrada = true;
|
|
14654
|
+
if (grab.error !== null) {
|
|
14655
|
+
grab.avisos.push(issue("JR080", `El stream fall\xF3: ${grab.error}. Se conserva el \xFAltimo \xE1rbol v\xE1lido.`, "", { severity: "error" }));
|
|
14656
|
+
return;
|
|
14657
|
+
}
|
|
14658
|
+
const parcial = parsePartialSchema(grab.texto);
|
|
14659
|
+
if (parcial.broken || parcial.status !== "complete") {
|
|
14660
|
+
grab.avisos.push(
|
|
14661
|
+
issue("JR080", "El stream termin\xF3 con el JSON sin cerrar. Se conserva el \xFAltimo \xE1rbol v\xE1lido.", "", {
|
|
14662
|
+
severity: "warning",
|
|
14663
|
+
hint: "Revisa que el emisor cierre todas las llaves y corchetes."
|
|
14664
|
+
})
|
|
14665
|
+
);
|
|
14666
|
+
}
|
|
14667
|
+
}
|
|
14668
|
+
async function consumir(grab, cancelado, onTrozo) {
|
|
14669
|
+
while (!grab.terminado && grab.iterador) {
|
|
14670
|
+
let paso;
|
|
14671
|
+
try {
|
|
14672
|
+
paso = await grab.iterador.next();
|
|
14673
|
+
} catch (error) {
|
|
14674
|
+
grab.error = mensajeDe(error);
|
|
14675
|
+
grab.terminado = true;
|
|
14676
|
+
break;
|
|
14677
|
+
}
|
|
14678
|
+
if (paso.done) {
|
|
14679
|
+
grab.terminado = true;
|
|
14680
|
+
break;
|
|
14681
|
+
}
|
|
14682
|
+
grab.texto += String(paso.value);
|
|
14683
|
+
if (!cancelado()) onTrozo();
|
|
14684
|
+
if (cancelado()) return;
|
|
14685
|
+
}
|
|
14686
|
+
if (grab.terminado) cerrarGrabacion(grab);
|
|
14687
|
+
}
|
|
14688
|
+
function useSchemaStream(source) {
|
|
14689
|
+
const [estado, setEstado] = (0, import_react57.useState)(VACIO);
|
|
14690
|
+
(0, import_react57.useEffect)(() => {
|
|
14691
|
+
if (source === null || source === void 0) {
|
|
14692
|
+
setEstado(VACIO);
|
|
14693
|
+
return;
|
|
14694
|
+
}
|
|
14695
|
+
let registro;
|
|
14696
|
+
if (typeof source === "string") {
|
|
14697
|
+
registro = crearGrabacion(source);
|
|
14698
|
+
} else {
|
|
14699
|
+
const existente = grabaciones.get(source);
|
|
14700
|
+
registro = existente ?? crearGrabacion(source);
|
|
14701
|
+
if (!existente) grabaciones.set(source, registro);
|
|
14702
|
+
}
|
|
14703
|
+
registro.activos += 1;
|
|
14704
|
+
let cancelado = false;
|
|
14705
|
+
const proceso = consumir(
|
|
14706
|
+
registro,
|
|
14707
|
+
() => cancelado,
|
|
14708
|
+
() => setEstado(estadoDe(registro, true))
|
|
14709
|
+
);
|
|
14710
|
+
setEstado(estadoDe(registro, !registro.terminado));
|
|
14711
|
+
void proceso.then(() => {
|
|
14712
|
+
if (!cancelado) setEstado(estadoDe(registro, false));
|
|
14713
|
+
});
|
|
14714
|
+
return () => {
|
|
14715
|
+
cancelado = true;
|
|
14716
|
+
registro.activos -= 1;
|
|
14717
|
+
setTimeout(() => {
|
|
14718
|
+
if (registro.activos === 0 && !registro.terminado && registro.iterador) {
|
|
14719
|
+
registro.terminado = true;
|
|
14720
|
+
registro.cancelada = true;
|
|
14721
|
+
void registro.iterador.return?.(void 0);
|
|
14722
|
+
}
|
|
14723
|
+
}, 0);
|
|
14724
|
+
};
|
|
14725
|
+
}, [source]);
|
|
14726
|
+
return estado;
|
|
14727
|
+
}
|
|
14728
|
+
|
|
13725
14729
|
// src/components/organisms/dropfile/dropfile.tsx
|
|
13726
|
-
var
|
|
14730
|
+
var import_react58 = require("react");
|
|
13727
14731
|
var import_react_dropzone = require("react-dropzone");
|
|
13728
14732
|
var import_clsx54 = __toESM(require("clsx"), 1);
|
|
13729
14733
|
|
|
@@ -13753,11 +14757,12 @@ var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
|
|
|
13753
14757
|
})(UploadStatus || {});
|
|
13754
14758
|
|
|
13755
14759
|
// src/components/organisms/dropfile/dropfile.tsx
|
|
13756
|
-
var
|
|
14760
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
13757
14761
|
var ITDropfile = ({
|
|
13758
14762
|
onFileSelect,
|
|
13759
14763
|
onCancel,
|
|
13760
14764
|
onSubmit,
|
|
14765
|
+
autoUpload = false,
|
|
13761
14766
|
contentClassName,
|
|
13762
14767
|
containerClassName,
|
|
13763
14768
|
acceptedFileTypes = ["application/pdf" /* PDF */, "application/vnd.ms-excel" /* XLS */, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" /* XLSX */, "image/jpg" /* JPG */, "image/png" /* PNG */, "image/jpeg" /* JPEG */],
|
|
@@ -13770,15 +14775,15 @@ var ITDropfile = ({
|
|
|
13770
14775
|
modalTitle
|
|
13771
14776
|
}) => {
|
|
13772
14777
|
const { t } = useITTranslation();
|
|
13773
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
13774
|
-
const [selectedFile, setSelectedFile] = (0,
|
|
13775
|
-
const [fileType, setFileType] = (0,
|
|
13776
|
-
const [imagePreview, setImagePreview] = (0,
|
|
13777
|
-
const [isConfirmed, setIsConfirmed] = (0,
|
|
13778
|
-
const [internalUploadStatus, setInternalUploadStatus] = (0,
|
|
14778
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react58.useState)(false);
|
|
14779
|
+
const [selectedFile, setSelectedFile] = (0, import_react58.useState)(null);
|
|
14780
|
+
const [fileType, setFileType] = (0, import_react58.useState)(null);
|
|
14781
|
+
const [imagePreview, setImagePreview] = (0, import_react58.useState)(initialPreviewUrl || null);
|
|
14782
|
+
const [isConfirmed, setIsConfirmed] = (0, import_react58.useState)(false);
|
|
14783
|
+
const [internalUploadStatus, setInternalUploadStatus] = (0, import_react58.useState)(
|
|
13779
14784
|
initialPreviewUrl ? "subido" /* UPLOADED */ : "pendiente" /* PENDING */
|
|
13780
14785
|
);
|
|
13781
|
-
(0,
|
|
14786
|
+
(0, import_react58.useEffect)(() => {
|
|
13782
14787
|
if (initialPreviewUrl && !selectedFile) {
|
|
13783
14788
|
setImagePreview(initialPreviewUrl);
|
|
13784
14789
|
if (externalStatus === void 0) setInternalUploadStatus("subido" /* UPLOADED */);
|
|
@@ -13893,11 +14898,23 @@ var ITDropfile = ({
|
|
|
13893
14898
|
}
|
|
13894
14899
|
};
|
|
13895
14900
|
const { label, color, dotColor } = config2[status];
|
|
13896
|
-
return /* @__PURE__ */ (0,
|
|
13897
|
-
/* @__PURE__ */ (0,
|
|
13898
|
-
/* @__PURE__ */ (0,
|
|
14901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: `inline-flex items-center gap-2 px-2.5 py-1 rounded-full border ${color}`, children: [
|
|
14902
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: `w-2 h-2 rounded-full ${dotColor}` }),
|
|
14903
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { as: "span", className: "text-xs font-medium flex items-center gap-1.5", children: label })
|
|
13899
14904
|
] });
|
|
13900
14905
|
};
|
|
14906
|
+
const runAutoUpload = async (file) => {
|
|
14907
|
+
setIsConfirmed(true);
|
|
14908
|
+
setUploadStatus("subiendo" /* UPLOADING */);
|
|
14909
|
+
try {
|
|
14910
|
+
onFileSelect(file);
|
|
14911
|
+
await onSubmit?.(file);
|
|
14912
|
+
setUploadStatus("subido" /* UPLOADED */);
|
|
14913
|
+
} catch (error) {
|
|
14914
|
+
setUploadStatus("error" /* ERROR */);
|
|
14915
|
+
console.error("Error al subir archivo:", error);
|
|
14916
|
+
}
|
|
14917
|
+
};
|
|
13901
14918
|
const onDrop = (acceptedFiles) => {
|
|
13902
14919
|
const file = acceptedFiles[0];
|
|
13903
14920
|
if (file) {
|
|
@@ -13913,6 +14930,7 @@ var ITDropfile = ({
|
|
|
13913
14930
|
const previewUrl = URL.createObjectURL(file);
|
|
13914
14931
|
setImagePreview(previewUrl);
|
|
13915
14932
|
}
|
|
14933
|
+
if (autoUpload) void runAutoUpload(file);
|
|
13916
14934
|
} else {
|
|
13917
14935
|
alert(t("dropfile.fileTypeNotAllowed"));
|
|
13918
14936
|
setSelectedFile(null);
|
|
@@ -13927,12 +14945,12 @@ var ITDropfile = ({
|
|
|
13927
14945
|
accept: getAcceptedFileTypes(),
|
|
13928
14946
|
maxFiles: 1
|
|
13929
14947
|
});
|
|
13930
|
-
(0,
|
|
14948
|
+
(0, import_react58.useEffect)(() => {
|
|
13931
14949
|
const renderPDF = async () => {
|
|
13932
14950
|
};
|
|
13933
14951
|
renderPDF();
|
|
13934
14952
|
}, [selectedFile, fileType]);
|
|
13935
|
-
(0,
|
|
14953
|
+
(0, import_react58.useEffect)(() => {
|
|
13936
14954
|
return () => {
|
|
13937
14955
|
if (imagePreview) {
|
|
13938
14956
|
URL.revokeObjectURL(imagePreview);
|
|
@@ -13969,7 +14987,7 @@ var ITDropfile = ({
|
|
|
13969
14987
|
const handleDelete = () => {
|
|
13970
14988
|
handleCancel();
|
|
13971
14989
|
};
|
|
13972
|
-
(0,
|
|
14990
|
+
(0, import_react58.useEffect)(() => {
|
|
13973
14991
|
if (view === "button" && isConfirmed && uploadStatus === "subido" /* UPLOADED */) {
|
|
13974
14992
|
const timeout = setTimeout(() => {
|
|
13975
14993
|
setIsModalOpen(false);
|
|
@@ -13986,21 +15004,21 @@ var ITDropfile = ({
|
|
|
13986
15004
|
return () => clearTimeout(timeout);
|
|
13987
15005
|
}
|
|
13988
15006
|
}, [view, isConfirmed, uploadStatus, externalStatus, onStatusChange]);
|
|
13989
|
-
const headerRow = /* @__PURE__ */ (0,
|
|
13990
|
-
/* @__PURE__ */ (0,
|
|
13991
|
-
/* @__PURE__ */ (0,
|
|
15007
|
+
const headerRow = /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [
|
|
15008
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("label", { className: "block text-sm font-semibold text-secondary-700", children: [
|
|
15009
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(ITText, { as: "span", children: [
|
|
13992
15010
|
t("dropfile.upload"),
|
|
13993
15011
|
" "
|
|
13994
15012
|
] }),
|
|
13995
|
-
/* @__PURE__ */ (0,
|
|
15013
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(ITText, { as: "span", className: "text-secondary-400 font-normal text-xs", children: [
|
|
13996
15014
|
"(",
|
|
13997
15015
|
getFileExtensions(),
|
|
13998
15016
|
")"
|
|
13999
15017
|
] })
|
|
14000
15018
|
] }),
|
|
14001
|
-
showStatusBadge && selectedFile && /* @__PURE__ */ (0,
|
|
15019
|
+
showStatusBadge && selectedFile && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(StatusBadge, { status: uploadStatus })
|
|
14002
15020
|
] });
|
|
14003
|
-
const dropZoneOrPreview = /* @__PURE__ */ (0,
|
|
15021
|
+
const dropZoneOrPreview = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_jsx_runtime77.Fragment, { children: !selectedFile && !imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
14004
15022
|
"div",
|
|
14005
15023
|
{
|
|
14006
15024
|
...getRootProps(),
|
|
@@ -14010,41 +15028,41 @@ var ITDropfile = ({
|
|
|
14010
15028
|
${isDragActive ? "border-primary-500 bg-primary-50 scale-[1.01]" : "border-secondary-300 bg-white hover:border-primary-400 hover:bg-secondary-50"}
|
|
14011
15029
|
`,
|
|
14012
15030
|
children: [
|
|
14013
|
-
/* @__PURE__ */ (0,
|
|
14014
|
-
/* @__PURE__ */ (0,
|
|
15031
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("input", { ...getInputProps() }),
|
|
15032
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: `mb-3 p-3 rounded-full transition-colors duration-300 ${isDragActive ? "bg-primary-100" : "bg-secondary-100 group-hover:bg-primary-50"}`, children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14015
15033
|
"svg",
|
|
14016
15034
|
{
|
|
14017
15035
|
className: `w-6 h-6 transition-colors duration-300 ${isDragActive ? "text-primary-600" : "text-secondary-400 group-hover:text-primary-500"}`,
|
|
14018
15036
|
fill: "none",
|
|
14019
15037
|
viewBox: "0 0 24 24",
|
|
14020
15038
|
stroke: "currentColor",
|
|
14021
|
-
children: /* @__PURE__ */ (0,
|
|
15039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" })
|
|
14022
15040
|
}
|
|
14023
15041
|
) }),
|
|
14024
|
-
/* @__PURE__ */ (0,
|
|
15042
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "text-center space-y-1", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { as: "p", className: `text-sm font-medium transition-colors duration-300 ${isDragActive ? "text-primary-700" : "text-secondary-700"}`, children: isDragActive ? t("dropfile.dropHere") : t("dropfile.clickOrDrag") }) })
|
|
14025
15043
|
]
|
|
14026
15044
|
}
|
|
14027
|
-
) : /* @__PURE__ */ (0,
|
|
14028
|
-
/* @__PURE__ */ (0,
|
|
14029
|
-
/* @__PURE__ */ (0,
|
|
14030
|
-
/* @__PURE__ */ (0,
|
|
14031
|
-
/* @__PURE__ */ (0,
|
|
14032
|
-
/* @__PURE__ */ (0,
|
|
15045
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "w-full bg-white border border-secondary-200 rounded-xl shadow-sm overflow-hidden animate-fade-in", children: [
|
|
15046
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex items-center justify-between p-3 bg-secondary-50 border-b border-secondary-100", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center gap-3 overflow-hidden", children: [
|
|
15047
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "flex-shrink-0 w-8 h-8 rounded-lg bg-primary-100 flex items-center justify-center text-primary-600", children: selectedFile && fileType?.startsWith("image/") || !selectedFile && imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }) }),
|
|
15048
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "min-w-0", children: [
|
|
15049
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { as: "p", className: "text-xs font-medium text-secondary-900 truncate", title: selectedFile?.name || t("dropfile.imageLoaded"), children: selectedFile?.name || t("dropfile.imageLoaded") }),
|
|
15050
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { as: "p", className: "text-[10px] text-secondary-500", children: selectedFile ? (selectedFile.size / 1024 / 1024).toFixed(2) + " MB" : "" })
|
|
14033
15051
|
] })
|
|
14034
15052
|
] }) }),
|
|
14035
|
-
/* @__PURE__ */ (0,
|
|
15053
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: (0, import_clsx54.default)("relative bg-secondary-100 flex items-center justify-center", !contentClassName ? "max-h-[200px] min-h-[100px] overflow-auto" : contentClassName), children: selectedFile && fileType?.startsWith("image/") || !selectedFile && imagePreview ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14036
15054
|
"img",
|
|
14037
15055
|
{
|
|
14038
15056
|
src: imagePreview,
|
|
14039
15057
|
alt: t("dropfile.previewAlt"),
|
|
14040
15058
|
className: "w-full h-full object-contain max-h-[200px]"
|
|
14041
15059
|
}
|
|
14042
|
-
) : /* @__PURE__ */ (0,
|
|
14043
|
-
/* @__PURE__ */ (0,
|
|
14044
|
-
/* @__PURE__ */ (0,
|
|
15060
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "py-8 flex flex-col items-center text-secondary-400", children: [
|
|
15061
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("svg", { className: "w-10 h-10 mb-2 opacity-50", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z" }) }),
|
|
15062
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { as: "span", className: "text-xs", children: t("dropfile.noPreview") })
|
|
14045
15063
|
] }) }),
|
|
14046
|
-
/* @__PURE__ */ (0,
|
|
14047
|
-
/* @__PURE__ */ (0,
|
|
15064
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "px-3 py-2 bg-white border-t border-secondary-100 flex justify-end gap-2", children: !isConfirmed ? /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
15065
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14048
15066
|
ITButton,
|
|
14049
15067
|
{
|
|
14050
15068
|
type: "button",
|
|
@@ -14052,10 +15070,10 @@ var ITDropfile = ({
|
|
|
14052
15070
|
color: "secondary",
|
|
14053
15071
|
size: "sm",
|
|
14054
15072
|
onClick: handleCancel,
|
|
14055
|
-
children: /* @__PURE__ */ (0,
|
|
15073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { children: t("common.cancel") })
|
|
14056
15074
|
}
|
|
14057
15075
|
),
|
|
14058
|
-
/* @__PURE__ */ (0,
|
|
15076
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14059
15077
|
ITButton,
|
|
14060
15078
|
{
|
|
14061
15079
|
type: "button",
|
|
@@ -14063,13 +15081,13 @@ var ITDropfile = ({
|
|
|
14063
15081
|
color: "primary",
|
|
14064
15082
|
size: "sm",
|
|
14065
15083
|
onClick: handleConfirm,
|
|
14066
|
-
children: /* @__PURE__ */ (0,
|
|
14067
|
-
/* @__PURE__ */ (0,
|
|
14068
|
-
/* @__PURE__ */ (0,
|
|
15084
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
15085
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { children: t("common.confirm") }),
|
|
15086
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) })
|
|
14069
15087
|
] })
|
|
14070
15088
|
}
|
|
14071
15089
|
)
|
|
14072
|
-
] }) : /* @__PURE__ */ (0,
|
|
15090
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
|
|
14073
15091
|
ITButton,
|
|
14074
15092
|
{
|
|
14075
15093
|
type: "button",
|
|
@@ -14078,12 +15096,12 @@ var ITDropfile = ({
|
|
|
14078
15096
|
size: "sm",
|
|
14079
15097
|
onClick: handleDelete,
|
|
14080
15098
|
children: [
|
|
14081
|
-
/* @__PURE__ */ (0,
|
|
14082
|
-
/* @__PURE__ */ (0,
|
|
15099
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) }),
|
|
15100
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { children: t("common.delete") })
|
|
14083
15101
|
]
|
|
14084
15102
|
}
|
|
14085
15103
|
) }),
|
|
14086
|
-
uploadStatus === "subiendo" /* UPLOADING */ && /* @__PURE__ */ (0,
|
|
15104
|
+
uploadStatus === "subiendo" /* UPLOADING */ && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "px-4 pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "w-full bg-secondary-200 rounded-full h-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14087
15105
|
"div",
|
|
14088
15106
|
{
|
|
14089
15107
|
className: "bg-primary-600 h-1.5 rounded-full transition-all duration-1000 ease-out",
|
|
@@ -14096,8 +15114,8 @@ var ITDropfile = ({
|
|
|
14096
15114
|
] }) });
|
|
14097
15115
|
if (view === "button") {
|
|
14098
15116
|
const hasFile = Boolean(selectedFile || imagePreview);
|
|
14099
|
-
return /* @__PURE__ */ (0,
|
|
14100
|
-
/* @__PURE__ */ (0,
|
|
15117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_clsx54.default)("inline-block", containerClassName), children: [
|
|
15118
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
14101
15119
|
ITButton,
|
|
14102
15120
|
{
|
|
14103
15121
|
type: "button",
|
|
@@ -14105,20 +15123,20 @@ var ITDropfile = ({
|
|
|
14105
15123
|
color: hasFile ? "primary" : "secondary",
|
|
14106
15124
|
size: "sm",
|
|
14107
15125
|
onClick: () => setIsModalOpen(true),
|
|
14108
|
-
children: /* @__PURE__ */ (0,
|
|
14109
|
-
/* @__PURE__ */ (0,
|
|
14110
|
-
/* @__PURE__ */ (0,
|
|
14111
|
-
showStatusBadge && hasFile && /* @__PURE__ */ (0,
|
|
15126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "flex items-center gap-2 max-w-[220px]", children: [
|
|
15127
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) }),
|
|
15128
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITText, { className: "truncate", children: selectedFile?.name || (hasFile ? t("dropfile.fileLoaded") : buttonLabel ?? t("dropfile.upload")) }),
|
|
15129
|
+
showStatusBadge && hasFile && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(StatusBadge, { status: uploadStatus })
|
|
14112
15130
|
] })
|
|
14113
15131
|
}
|
|
14114
15132
|
),
|
|
14115
|
-
/* @__PURE__ */ (0,
|
|
15133
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(ITDialog, { isOpen: isModalOpen, onClose: () => setIsModalOpen(false), title: modalTitle ?? buttonLabel ?? t("dropfile.upload"), children: /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "w-full transition-all duration-300", children: [
|
|
14116
15134
|
headerRow,
|
|
14117
15135
|
dropZoneOrPreview
|
|
14118
15136
|
] }) })
|
|
14119
15137
|
] });
|
|
14120
15138
|
}
|
|
14121
|
-
return /* @__PURE__ */ (0,
|
|
15139
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: (0, import_clsx54.default)("w-full transition-all duration-300", containerClassName), children: [
|
|
14122
15140
|
headerRow,
|
|
14123
15141
|
dropZoneOrPreview
|
|
14124
15142
|
] });
|
|
@@ -14126,13 +15144,13 @@ var ITDropfile = ({
|
|
|
14126
15144
|
var dropfile_default = ITDropfile;
|
|
14127
15145
|
|
|
14128
15146
|
// src/components/templates/layout/layout.tsx
|
|
14129
|
-
var
|
|
15147
|
+
var import_react60 = require("react");
|
|
14130
15148
|
var import_clsx55 = __toESM(require("clsx"), 1);
|
|
14131
15149
|
|
|
14132
15150
|
// src/components/organisms/topbar/topbar.tsx
|
|
14133
15151
|
var import_fa32 = require("react-icons/fa");
|
|
14134
|
-
var
|
|
14135
|
-
var
|
|
15152
|
+
var import_react59 = require("react");
|
|
15153
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
14136
15154
|
function ITTopBar({
|
|
14137
15155
|
logo,
|
|
14138
15156
|
logoText,
|
|
@@ -14149,10 +15167,10 @@ function ITTopBar({
|
|
|
14149
15167
|
const flat = useITFlatAppearance();
|
|
14150
15168
|
const { t } = useITTranslation();
|
|
14151
15169
|
const initials = (userMenu?.userName ?? "").trim().split(/\s+/).slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
|
|
14152
|
-
const [isUserMenuOpen, setIsUserMenuOpen] = (0,
|
|
14153
|
-
const userMenuRef = (0,
|
|
15170
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = (0, import_react59.useState)(false);
|
|
15171
|
+
const userMenuRef = (0, import_react59.useRef)(null);
|
|
14154
15172
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
14155
|
-
return /* @__PURE__ */ (0,
|
|
15173
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14156
15174
|
"header",
|
|
14157
15175
|
{
|
|
14158
15176
|
className: `sticky top-0 z-40 transition-all duration-300 ${flat ? "" : "backdrop-blur-md"}`,
|
|
@@ -14161,9 +15179,9 @@ function ITTopBar({
|
|
|
14161
15179
|
borderBottom: "1px solid var(--it-topbar-border, rgba(15, 23, 42, 0.06))",
|
|
14162
15180
|
boxShadow: flat ? "none" : "var(--shadow-xs)"
|
|
14163
15181
|
},
|
|
14164
|
-
children: /* @__PURE__ */ (0,
|
|
14165
|
-
/* @__PURE__ */ (0,
|
|
14166
|
-
showMobileMenuButton && /* @__PURE__ */ (0,
|
|
15182
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `flex items-center justify-between px-6 lg:px-8 ${flat ? "h-[64px]" : "h-[72px]"}`, children: [
|
|
15183
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-5", children: [
|
|
15184
|
+
showMobileMenuButton && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14167
15185
|
"button",
|
|
14168
15186
|
{
|
|
14169
15187
|
type: "button",
|
|
@@ -14175,12 +15193,12 @@ function ITTopBar({
|
|
|
14175
15193
|
onMouseEnter: (e) => e.currentTarget.style.backgroundColor = "var(--it-topbar-user-hover, #f1f5f9)",
|
|
14176
15194
|
onMouseLeave: (e) => e.currentTarget.style.backgroundColor = "transparent",
|
|
14177
15195
|
onClick: onToggleMobileMenu,
|
|
14178
|
-
children: /* @__PURE__ */ (0,
|
|
15196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_fa32.FaBars, { className: "w-[1.125rem] h-[1.125rem]" })
|
|
14179
15197
|
}
|
|
14180
15198
|
),
|
|
14181
|
-
/* @__PURE__ */ (0,
|
|
14182
|
-
logo && /* @__PURE__ */ (0,
|
|
14183
|
-
logoText && /* @__PURE__ */ (0,
|
|
15199
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `items-center gap-3 ${hideBrandOnDesktop ? "flex lg:hidden" : "flex"}`, children: [
|
|
15200
|
+
logo && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "flex-shrink-0 drop-shadow-sm", children: logo }),
|
|
15201
|
+
logoText && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14184
15202
|
ITText,
|
|
14185
15203
|
{
|
|
14186
15204
|
as: "span",
|
|
@@ -14190,7 +15208,7 @@ function ITTopBar({
|
|
|
14190
15208
|
}
|
|
14191
15209
|
)
|
|
14192
15210
|
] }),
|
|
14193
|
-
navItems && navItems.length > 0 && /* @__PURE__ */ (0,
|
|
15211
|
+
navItems && navItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("nav", { className: "hidden md:flex ml-8 space-x-1 border-l pl-8", style: { borderColor: "var(--it-topbar-border, rgba(15, 23, 42, 0.06))" }, children: navItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14194
15212
|
"button",
|
|
14195
15213
|
{
|
|
14196
15214
|
onClick: () => onNavItemClick?.(item.id),
|
|
@@ -14204,19 +15222,19 @@ function ITTopBar({
|
|
|
14204
15222
|
e.currentTarget.style.color = "var(--it-topbar-text, #475569)";
|
|
14205
15223
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
14206
15224
|
},
|
|
14207
|
-
children: /* @__PURE__ */ (0,
|
|
14208
|
-
item.icon && /* @__PURE__ */ (0,
|
|
14209
|
-
/* @__PURE__ */ (0,
|
|
15225
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
15226
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "opacity-70", children: item.icon }),
|
|
15227
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ITText, { as: "span", children: item.label })
|
|
14210
15228
|
] })
|
|
14211
15229
|
},
|
|
14212
15230
|
item.id
|
|
14213
15231
|
)) })
|
|
14214
15232
|
] }),
|
|
14215
|
-
centerContent && /* @__PURE__ */ (0,
|
|
14216
|
-
(children || userMenu) && /* @__PURE__ */ (0,
|
|
15233
|
+
centerContent && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: `hidden lg:flex flex-1 min-w-0 items-center ${hideBrandOnDesktop ? "justify-start pr-4" : "justify-center px-4"}`, children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-full max-w-[420px]", children: centerContent }) }),
|
|
15234
|
+
(children || userMenu) && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
14217
15235
|
children,
|
|
14218
|
-
userMenu && /* @__PURE__ */ (0,
|
|
14219
|
-
/* @__PURE__ */ (0,
|
|
15236
|
+
userMenu && /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "relative", children: [
|
|
15237
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
14220
15238
|
"button",
|
|
14221
15239
|
{
|
|
14222
15240
|
type: "button",
|
|
@@ -14232,15 +15250,15 @@ function ITTopBar({
|
|
|
14232
15250
|
},
|
|
14233
15251
|
onClick: () => setIsUserMenuOpen(!isUserMenuOpen),
|
|
14234
15252
|
children: [
|
|
14235
|
-
/* @__PURE__ */ (0,
|
|
14236
|
-
userMenu.userImage ? /* @__PURE__ */ (0,
|
|
15253
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "relative", children: [
|
|
15254
|
+
userMenu.userImage ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14237
15255
|
"img",
|
|
14238
15256
|
{
|
|
14239
15257
|
className: "w-9 h-9 rounded-full object-cover ring-2 ring-white shadow-sm",
|
|
14240
15258
|
src: userMenu.userImage,
|
|
14241
15259
|
alt: t("common.userAvatar")
|
|
14242
15260
|
}
|
|
14243
|
-
) : flat && initials ? /* @__PURE__ */ (0,
|
|
15261
|
+
) : flat && initials ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14244
15262
|
"div",
|
|
14245
15263
|
{
|
|
14246
15264
|
"aria-hidden": "true",
|
|
@@ -14251,11 +15269,11 @@ function ITTopBar({
|
|
|
14251
15269
|
},
|
|
14252
15270
|
children: initials
|
|
14253
15271
|
}
|
|
14254
|
-
) : /* @__PURE__ */ (0,
|
|
14255
|
-
!flat && /* @__PURE__ */ (0,
|
|
15272
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "w-9 h-9 rounded-full bg-slate-100 flex items-center justify-center ring-2 ring-white shadow-sm", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_fa32.FaUserCircle, { className: "w-6 h-6", style: { color: "var(--it-topbar-icon, #94a3b8)" } }) }),
|
|
15273
|
+
!flat && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
14256
15274
|
] }),
|
|
14257
|
-
/* @__PURE__ */ (0,
|
|
14258
|
-
/* @__PURE__ */ (0,
|
|
15275
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: `hidden sm:flex flex-col py-0.5 ${flat ? "text-right" : "text-left"}`, children: [
|
|
15276
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14259
15277
|
ITText,
|
|
14260
15278
|
{
|
|
14261
15279
|
as: "span",
|
|
@@ -14264,7 +15282,7 @@ function ITTopBar({
|
|
|
14264
15282
|
children: userMenu.userName
|
|
14265
15283
|
}
|
|
14266
15284
|
),
|
|
14267
|
-
/* @__PURE__ */ (0,
|
|
15285
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14268
15286
|
ITText,
|
|
14269
15287
|
{
|
|
14270
15288
|
as: "span",
|
|
@@ -14277,7 +15295,7 @@ function ITTopBar({
|
|
|
14277
15295
|
]
|
|
14278
15296
|
}
|
|
14279
15297
|
),
|
|
14280
|
-
/* @__PURE__ */ (0,
|
|
15298
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
14281
15299
|
"div",
|
|
14282
15300
|
{
|
|
14283
15301
|
ref: userMenuRef,
|
|
@@ -14290,15 +15308,15 @@ function ITTopBar({
|
|
|
14290
15308
|
border: "1px solid var(--it-topbar-user-dropdown-border, #f1f5f9)"
|
|
14291
15309
|
},
|
|
14292
15310
|
children: [
|
|
14293
|
-
/* @__PURE__ */ (0,
|
|
14294
|
-
/* @__PURE__ */ (0,
|
|
14295
|
-
/* @__PURE__ */ (0,
|
|
15311
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "px-5 py-4 border-b", style: { borderColor: "var(--it-topbar-user-dropdown-border, #f1f5f9)", backgroundColor: "var(--it-topbar-user-bg, #f8fafc)" }, children: [
|
|
15312
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ITText, { as: "span", className: "block font-bold text-[0.9rem]", style: { color: "var(--it-topbar-user-text, #0f172a)" }, children: userMenu.userName }),
|
|
15313
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ITText, { as: "span", className: "block text-xs font-medium truncate mt-0.5", style: { color: "var(--it-topbar-user-subtitle, #64748b)" }, children: userMenu.userEmail })
|
|
14296
15314
|
] }),
|
|
14297
|
-
/* @__PURE__ */ (0,
|
|
15315
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("ul", { className: "py-2", children: userMenu.menuItems.map((m, i) => {
|
|
14298
15316
|
const isDestructive = m.label.toLowerCase().includes("salir") || m.label.toLowerCase().includes("cerrar") || m.label.toLowerCase().includes("logout");
|
|
14299
|
-
return /* @__PURE__ */ (0,
|
|
14300
|
-
i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ (0,
|
|
14301
|
-
/* @__PURE__ */ (0,
|
|
15317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("li", { className: "px-2", children: [
|
|
15318
|
+
i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "h-px bg-slate-100 my-1 mx-2" }),
|
|
15319
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
14302
15320
|
"button",
|
|
14303
15321
|
{
|
|
14304
15322
|
onClick: () => {
|
|
@@ -14313,7 +15331,7 @@ function ITTopBar({
|
|
|
14313
15331
|
onMouseLeave: (e) => {
|
|
14314
15332
|
e.currentTarget.style.backgroundColor = "transparent";
|
|
14315
15333
|
},
|
|
14316
|
-
children: /* @__PURE__ */ (0,
|
|
15334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(ITText, { as: "span", children: m.label })
|
|
14317
15335
|
}
|
|
14318
15336
|
)
|
|
14319
15337
|
] }, i);
|
|
@@ -14329,7 +15347,7 @@ function ITTopBar({
|
|
|
14329
15347
|
}
|
|
14330
15348
|
|
|
14331
15349
|
// src/components/templates/layout/layout.tsx
|
|
14332
|
-
var
|
|
15350
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
14333
15351
|
function ITLayout({
|
|
14334
15352
|
topBar,
|
|
14335
15353
|
sidebar,
|
|
@@ -14338,8 +15356,8 @@ function ITLayout({
|
|
|
14338
15356
|
contentClassName = "",
|
|
14339
15357
|
sidebarFullHeight = false
|
|
14340
15358
|
}) {
|
|
14341
|
-
const [internalCollapsed, setInternalCollapsed] = (0,
|
|
14342
|
-
const [mobileSidebarOpen, setMobileSidebarOpen] = (0,
|
|
15359
|
+
const [internalCollapsed, setInternalCollapsed] = (0, import_react60.useState)(true);
|
|
15360
|
+
const [mobileSidebarOpen, setMobileSidebarOpen] = (0, import_react60.useState)(false);
|
|
14343
15361
|
const flat = useITFlatAppearance();
|
|
14344
15362
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
14345
15363
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
@@ -14353,7 +15371,7 @@ function ITLayout({
|
|
|
14353
15371
|
else setMobileSidebarOpen((v) => !v);
|
|
14354
15372
|
};
|
|
14355
15373
|
const brand = sidebarFullHeight ? sidebar.brand ?? { logo: topBar.logo, text: topBar.logoText } : sidebar.brand;
|
|
14356
|
-
const topBarNode = /* @__PURE__ */ (0,
|
|
15374
|
+
const topBarNode = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
14357
15375
|
ITTopBar,
|
|
14358
15376
|
{
|
|
14359
15377
|
...topBar,
|
|
@@ -14366,9 +15384,9 @@ function ITLayout({
|
|
|
14366
15384
|
const desktopSidebar = (
|
|
14367
15385
|
// Full-height: the sidebar sits beside the top bar, so it needs to win the
|
|
14368
15386
|
// stacking order when the collapsed rail expands over the content on hover.
|
|
14369
|
-
/* @__PURE__ */ (0,
|
|
14370
|
-
/* @__PURE__ */ (0,
|
|
14371
|
-
/* @__PURE__ */ (0,
|
|
15387
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: `hidden lg:block relative h-full ${sidebarFullHeight ? "z-50" : "z-40"}`, children: [
|
|
15388
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: `${reservedWidth} h-full flex-shrink-0` }),
|
|
15389
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
14372
15390
|
ITSidebar,
|
|
14373
15391
|
{
|
|
14374
15392
|
...sidebar,
|
|
@@ -14381,17 +15399,17 @@ function ITLayout({
|
|
|
14381
15399
|
) })
|
|
14382
15400
|
] })
|
|
14383
15401
|
);
|
|
14384
|
-
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ (0,
|
|
15402
|
+
const mobileSidebar = mobileSidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
14385
15403
|
"div",
|
|
14386
15404
|
{
|
|
14387
15405
|
className: "lg:hidden fixed inset-0 z-[40] transition-opacity duration-300 backdrop-blur-sm bg-black/40",
|
|
14388
15406
|
onClick: () => setMobileSidebarOpen(false),
|
|
14389
|
-
children: /* @__PURE__ */ (0,
|
|
15407
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
14390
15408
|
"div",
|
|
14391
15409
|
{
|
|
14392
15410
|
className: "h-full w-fit flex transform transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)]",
|
|
14393
15411
|
onClick: (e) => e.stopPropagation(),
|
|
14394
|
-
children: /* @__PURE__ */ (0,
|
|
15412
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
14395
15413
|
ITSidebar,
|
|
14396
15414
|
{
|
|
14397
15415
|
...sidebar,
|
|
@@ -14408,16 +15426,16 @@ function ITLayout({
|
|
|
14408
15426
|
)
|
|
14409
15427
|
}
|
|
14410
15428
|
);
|
|
14411
|
-
const main = /* @__PURE__ */ (0,
|
|
15429
|
+
const main = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("main", { className: "flex-1 overflow-y-auto w-full custom-scrollbar relative z-0", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: (0, import_clsx55.default)("mx-auto w-full max-w-7xl px-4 sm:px-6 lg:px-8 py-6 h-full", contentClassName), children }) });
|
|
14412
15430
|
if (sidebarFullHeight) {
|
|
14413
|
-
return /* @__PURE__ */ (0,
|
|
15431
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
14414
15432
|
"div",
|
|
14415
15433
|
{
|
|
14416
15434
|
className: `flex h-screen overflow-hidden w-full relative ${className}`,
|
|
14417
15435
|
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
14418
15436
|
children: [
|
|
14419
15437
|
desktopSidebar,
|
|
14420
|
-
/* @__PURE__ */ (0,
|
|
15438
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: "flex flex-col flex-1 min-w-0 overflow-hidden", children: [
|
|
14421
15439
|
topBarNode,
|
|
14422
15440
|
main
|
|
14423
15441
|
] }),
|
|
@@ -14426,9 +15444,9 @@ function ITLayout({
|
|
|
14426
15444
|
}
|
|
14427
15445
|
);
|
|
14428
15446
|
}
|
|
14429
|
-
return /* @__PURE__ */ (0,
|
|
15447
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("div", { className: `flex flex-col h-screen overflow-hidden w-full ${className}`, children: [
|
|
14430
15448
|
topBarNode,
|
|
14431
|
-
/* @__PURE__ */ (0,
|
|
15449
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
14432
15450
|
"div",
|
|
14433
15451
|
{
|
|
14434
15452
|
className: "flex flex-1 overflow-hidden relative",
|
|
@@ -14445,9 +15463,9 @@ function ITLayout({
|
|
|
14445
15463
|
|
|
14446
15464
|
// src/components/molecules/stepper/stepper.tsx
|
|
14447
15465
|
var import_clsx56 = __toESM(require("clsx"), 1);
|
|
14448
|
-
var
|
|
15466
|
+
var import_react61 = require("react");
|
|
14449
15467
|
var import_fa33 = require("react-icons/fa");
|
|
14450
|
-
var
|
|
15468
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
14451
15469
|
function ITStepper({
|
|
14452
15470
|
steps,
|
|
14453
15471
|
currentStep,
|
|
@@ -14463,15 +15481,15 @@ function ITStepper({
|
|
|
14463
15481
|
color = "primary"
|
|
14464
15482
|
}) {
|
|
14465
15483
|
const { t } = useITTranslation();
|
|
14466
|
-
const [direction, setDirection] = (0,
|
|
14467
|
-
const contentRef = (0,
|
|
14468
|
-
const progressRef = (0,
|
|
15484
|
+
const [direction, setDirection] = (0, import_react61.useState)("next");
|
|
15485
|
+
const contentRef = (0, import_react61.useRef)(null);
|
|
15486
|
+
const progressRef = (0, import_react61.useRef)(null);
|
|
14469
15487
|
const isThemeColor = color in theme.colors;
|
|
14470
15488
|
const resolvedColor = isThemeColor ? theme.colors[color][500] : color;
|
|
14471
|
-
(0,
|
|
15489
|
+
(0, import_react61.useEffect)(() => {
|
|
14472
15490
|
onStepChange?.(currentStep);
|
|
14473
15491
|
}, [currentStep, onStepChange]);
|
|
14474
|
-
(0,
|
|
15492
|
+
(0, import_react61.useEffect)(() => {
|
|
14475
15493
|
const pct = currentStep / Math.max(1, steps.length - 1) * 100;
|
|
14476
15494
|
if (progressRef.current) {
|
|
14477
15495
|
progressRef.current.style.width = `${pct}%`;
|
|
@@ -14515,23 +15533,23 @@ function ITStepper({
|
|
|
14515
15533
|
const renderStepContent = (index, isCompleted) => {
|
|
14516
15534
|
const step = steps[index];
|
|
14517
15535
|
if (isCompleted) {
|
|
14518
|
-
return /* @__PURE__ */ (0,
|
|
15536
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_fa33.FaCheck, { className: "w-4 h-4" });
|
|
14519
15537
|
}
|
|
14520
15538
|
if (step.icon && useIcons) {
|
|
14521
|
-
return /* @__PURE__ */ (0,
|
|
15539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex items-center justify-center w-5 h-5", children: step.icon });
|
|
14522
15540
|
}
|
|
14523
|
-
return /* @__PURE__ */ (0,
|
|
15541
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ITText, { as: "span", className: "text-sm font-semibold", children: index + 1 });
|
|
14524
15542
|
};
|
|
14525
|
-
return /* @__PURE__ */ (0,
|
|
14526
|
-
/* @__PURE__ */ (0,
|
|
14527
|
-
/* @__PURE__ */ (0,
|
|
15543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: (0, import_clsx56.default)("w-full max-w-5xl mx-auto px-4", containerClassName), children: [
|
|
15544
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "relative mb-8", children: [
|
|
15545
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14528
15546
|
"div",
|
|
14529
15547
|
{
|
|
14530
15548
|
className: "absolute left-6 right-6 top-5 h-1 bg-secondary-200 rounded-full z-0",
|
|
14531
15549
|
"aria-hidden": true
|
|
14532
15550
|
}
|
|
14533
15551
|
),
|
|
14534
|
-
/* @__PURE__ */ (0,
|
|
15552
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14535
15553
|
"div",
|
|
14536
15554
|
{
|
|
14537
15555
|
ref: progressRef,
|
|
@@ -14539,11 +15557,11 @@ function ITStepper({
|
|
|
14539
15557
|
"aria-hidden": true
|
|
14540
15558
|
}
|
|
14541
15559
|
),
|
|
14542
|
-
/* @__PURE__ */ (0,
|
|
15560
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "flex items-start justify-between space-x-2 relative z-20", children: steps.map((step, idx) => {
|
|
14543
15561
|
const isActive = idx === currentStep;
|
|
14544
15562
|
const isCompleted = idx < currentStep;
|
|
14545
15563
|
const hasIcon = step.icon && useIcons;
|
|
14546
|
-
return /* @__PURE__ */ (0,
|
|
15564
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14547
15565
|
"button",
|
|
14548
15566
|
{
|
|
14549
15567
|
type: "button",
|
|
@@ -14553,8 +15571,8 @@ function ITStepper({
|
|
|
14553
15571
|
"aria-label": t("stepper.stepAria", { n: idx + 1, label: step.label }),
|
|
14554
15572
|
className: "flex-1 group",
|
|
14555
15573
|
title: step.label,
|
|
14556
|
-
children: /* @__PURE__ */ (0,
|
|
14557
|
-
/* @__PURE__ */ (0,
|
|
15574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
15575
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14558
15576
|
"div",
|
|
14559
15577
|
{
|
|
14560
15578
|
className: (0, import_clsx56.default)(
|
|
@@ -14568,7 +15586,7 @@ function ITStepper({
|
|
|
14568
15586
|
children: renderStepContent(idx, isCompleted)
|
|
14569
15587
|
}
|
|
14570
15588
|
),
|
|
14571
|
-
/* @__PURE__ */ (0,
|
|
15589
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14572
15590
|
ITText,
|
|
14573
15591
|
{
|
|
14574
15592
|
as: "span",
|
|
@@ -14586,7 +15604,7 @@ function ITStepper({
|
|
|
14586
15604
|
);
|
|
14587
15605
|
}) })
|
|
14588
15606
|
] }),
|
|
14589
|
-
/* @__PURE__ */ (0,
|
|
15607
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14590
15608
|
"div",
|
|
14591
15609
|
{
|
|
14592
15610
|
ref: contentRef,
|
|
@@ -14602,32 +15620,32 @@ function ITStepper({
|
|
|
14602
15620
|
children: steps[currentStep].content
|
|
14603
15621
|
}
|
|
14604
15622
|
),
|
|
14605
|
-
/* @__PURE__ */ (0,
|
|
14606
|
-
/* @__PURE__ */ (0,
|
|
15623
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex justify-between items-center mt-6", children: [
|
|
15624
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14607
15625
|
ITButton,
|
|
14608
15626
|
{
|
|
14609
15627
|
variant: "outlined",
|
|
14610
15628
|
color: "secondary",
|
|
14611
15629
|
disabled: currentStep === 0,
|
|
14612
15630
|
onClick: prevStep,
|
|
14613
|
-
children: /* @__PURE__ */ (0,
|
|
14614
|
-
/* @__PURE__ */ (0,
|
|
14615
|
-
/* @__PURE__ */ (0,
|
|
15631
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
15632
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_fa33.FaChevronLeft, {}),
|
|
15633
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ITText, { as: "span", children: t("common.back") })
|
|
14616
15634
|
] })
|
|
14617
15635
|
}
|
|
14618
15636
|
),
|
|
14619
|
-
/* @__PURE__ */ (0,
|
|
14620
|
-
/* @__PURE__ */ (0,
|
|
14621
|
-
/* @__PURE__ */ (0,
|
|
15637
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
15638
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ITText, { as: "div", className: "text-sm text-secondary-500 mr-2 hidden sm:block", children: t("stepper.stepOf", { current: currentStep + 1, total: steps.length }) }),
|
|
15639
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
14622
15640
|
ITButton,
|
|
14623
15641
|
{
|
|
14624
15642
|
variant: "solid",
|
|
14625
15643
|
color,
|
|
14626
15644
|
disabled: disableNext,
|
|
14627
15645
|
onClick: nextStep,
|
|
14628
|
-
children: /* @__PURE__ */ (0,
|
|
14629
|
-
/* @__PURE__ */ (0,
|
|
14630
|
-
currentStep === steps.length - 1 ? /* @__PURE__ */ (0,
|
|
15646
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
15647
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(ITText, { as: "span", children: currentStep === steps.length - 1 ? t("common.finish") : t("common.next") }),
|
|
15648
|
+
currentStep === steps.length - 1 ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_fa33.FaCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_fa33.FaChevronRight, {})
|
|
14631
15649
|
] })
|
|
14632
15650
|
}
|
|
14633
15651
|
)
|
|
@@ -14637,7 +15655,7 @@ function ITStepper({
|
|
|
14637
15655
|
}
|
|
14638
15656
|
|
|
14639
15657
|
// src/components/theme-provider/themeProvider.tsx
|
|
14640
|
-
var
|
|
15658
|
+
var import_react62 = require("react");
|
|
14641
15659
|
var import_md3 = require("react-icons/md");
|
|
14642
15660
|
|
|
14643
15661
|
// src/components/theme-provider/themePresets.ts
|
|
@@ -14815,7 +15833,7 @@ var PRESETS = [
|
|
|
14815
15833
|
];
|
|
14816
15834
|
|
|
14817
15835
|
// src/components/theme-provider/themeProvider.tsx
|
|
14818
|
-
var
|
|
15836
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
14819
15837
|
var STORAGE_KEY = "it-theme-palette";
|
|
14820
15838
|
var SHADOW_LEVELS = {
|
|
14821
15839
|
0: {
|
|
@@ -14918,7 +15936,7 @@ function ITThemeProvider({
|
|
|
14918
15936
|
appearance = "soft"
|
|
14919
15937
|
}) {
|
|
14920
15938
|
const { t } = useITTranslation();
|
|
14921
|
-
const [palette2, setPaletteState] = (0,
|
|
15939
|
+
const [palette2, setPaletteState] = (0, import_react62.useState)(() => {
|
|
14922
15940
|
const basePalette = {
|
|
14923
15941
|
...DEFAULT_PALETTE,
|
|
14924
15942
|
...theme2,
|
|
@@ -14944,8 +15962,8 @@ function ITThemeProvider({
|
|
|
14944
15962
|
}
|
|
14945
15963
|
return basePalette;
|
|
14946
15964
|
});
|
|
14947
|
-
const [isOpen, setIsOpen] = (0,
|
|
14948
|
-
const [customPresets, setCustomPresets] = (0,
|
|
15965
|
+
const [isOpen, setIsOpen] = (0, import_react62.useState)(false);
|
|
15966
|
+
const [customPresets, setCustomPresets] = (0, import_react62.useState)(() => {
|
|
14949
15967
|
try {
|
|
14950
15968
|
const saved = localStorage.getItem("it-theme-custom-presets");
|
|
14951
15969
|
return saved ? JSON.parse(saved) : [];
|
|
@@ -14954,8 +15972,8 @@ function ITThemeProvider({
|
|
|
14954
15972
|
return [];
|
|
14955
15973
|
}
|
|
14956
15974
|
});
|
|
14957
|
-
const [newPresetName, setNewPresetName] = (0,
|
|
14958
|
-
const [isSavingPreset, setIsSavingPreset] = (0,
|
|
15975
|
+
const [newPresetName, setNewPresetName] = (0, import_react62.useState)("");
|
|
15976
|
+
const [isSavingPreset, setIsSavingPreset] = (0, import_react62.useState)(false);
|
|
14959
15977
|
const handleSavePreset = () => {
|
|
14960
15978
|
if (!newPresetName.trim()) return;
|
|
14961
15979
|
const newPreset = {
|
|
@@ -14974,8 +15992,8 @@ function ITThemeProvider({
|
|
|
14974
15992
|
setCustomPresets(updated);
|
|
14975
15993
|
localStorage.setItem("it-theme-custom-presets", JSON.stringify(updated));
|
|
14976
15994
|
};
|
|
14977
|
-
const [resolvedTheme, setResolvedTheme] = (0,
|
|
14978
|
-
const [darkModeMode, setDarkModeMode] = (0,
|
|
15995
|
+
const [resolvedTheme, setResolvedTheme] = (0, import_react62.useState)("light");
|
|
15996
|
+
const [darkModeMode, setDarkModeMode] = (0, import_react62.useState)(
|
|
14979
15997
|
() => {
|
|
14980
15998
|
const saved = localStorage.getItem("it-theme-dark-mode");
|
|
14981
15999
|
if (saved === "light" || saved === "dark" || saved === "system") {
|
|
@@ -14984,7 +16002,7 @@ function ITThemeProvider({
|
|
|
14984
16002
|
return "system";
|
|
14985
16003
|
}
|
|
14986
16004
|
);
|
|
14987
|
-
(0,
|
|
16005
|
+
(0, import_react62.useEffect)(() => {
|
|
14988
16006
|
localStorage.setItem("it-theme-dark-mode", darkModeMode);
|
|
14989
16007
|
const applyDarkMode = (isDark) => {
|
|
14990
16008
|
if (isDark) {
|
|
@@ -15009,7 +16027,7 @@ function ITThemeProvider({
|
|
|
15009
16027
|
applyDarkMode(darkModeMode === "dark");
|
|
15010
16028
|
}
|
|
15011
16029
|
}, [darkModeMode]);
|
|
15012
|
-
(0,
|
|
16030
|
+
(0, import_react62.useEffect)(() => {
|
|
15013
16031
|
if (!showFab) {
|
|
15014
16032
|
setPaletteState({
|
|
15015
16033
|
...DEFAULT_PALETTE,
|
|
@@ -15019,7 +16037,7 @@ function ITThemeProvider({
|
|
|
15019
16037
|
});
|
|
15020
16038
|
}
|
|
15021
16039
|
}, [theme2, showFab]);
|
|
15022
|
-
(0,
|
|
16040
|
+
(0, import_react62.useLayoutEffect)(() => {
|
|
15023
16041
|
const root = document.documentElement;
|
|
15024
16042
|
const scale = typeof density === "number" && isFinite(density) ? Math.min(Math.max(density, 0.5), 1.5) : 1;
|
|
15025
16043
|
root.style.setProperty("--it-density", String(scale));
|
|
@@ -15029,12 +16047,12 @@ function ITThemeProvider({
|
|
|
15029
16047
|
root.style.fontSize = "";
|
|
15030
16048
|
};
|
|
15031
16049
|
}, [density]);
|
|
15032
|
-
(0,
|
|
16050
|
+
(0, import_react62.useLayoutEffect)(() => {
|
|
15033
16051
|
const root = document.documentElement;
|
|
15034
16052
|
root.setAttribute("data-it-appearance", appearance);
|
|
15035
16053
|
return () => root.removeAttribute("data-it-appearance");
|
|
15036
16054
|
}, [appearance]);
|
|
15037
|
-
(0,
|
|
16055
|
+
(0, import_react62.useLayoutEffect)(() => {
|
|
15038
16056
|
const root = document.documentElement;
|
|
15039
16057
|
const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
15040
16058
|
if (typeof radius === "number" && isFinite(radius)) {
|
|
@@ -15066,7 +16084,7 @@ function ITThemeProvider({
|
|
|
15066
16084
|
surfaceStyle?.remove();
|
|
15067
16085
|
};
|
|
15068
16086
|
}, [radius, shadow]);
|
|
15069
|
-
(0,
|
|
16087
|
+
(0, import_react62.useEffect)(() => {
|
|
15070
16088
|
const injectStyles = (obj, prefix = "") => {
|
|
15071
16089
|
Object.entries(obj).forEach(([key, val]) => {
|
|
15072
16090
|
if (typeof val === "object" && val !== null) {
|
|
@@ -16220,14 +17238,14 @@ function ITThemeProvider({
|
|
|
16220
17238
|
const isNested = colorKey.includes(".");
|
|
16221
17239
|
const label = isNested ? colorKey.split(".")[1] : colorKey;
|
|
16222
17240
|
const value = getNestedValue3(palette2, colorKey);
|
|
16223
|
-
return /* @__PURE__ */ (0,
|
|
17241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
16224
17242
|
"div",
|
|
16225
17243
|
{
|
|
16226
17244
|
className: "flex items-center justify-between p-3 rounded-xl border border-slate-100 dark:border-slate-800 bg-white dark:bg-slate-900/50 gap-3 hover:border-slate-200 dark:hover:border-slate-700 transition-colors",
|
|
16227
17245
|
children: [
|
|
16228
|
-
/* @__PURE__ */ (0,
|
|
16229
|
-
/* @__PURE__ */ (0,
|
|
16230
|
-
/* @__PURE__ */ (0,
|
|
17246
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center gap-3 flex-1 min-w-0", children: [
|
|
17247
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "relative w-10 h-10 rounded-xl border-2 border-slate-200 dark:border-slate-700 overflow-hidden cursor-pointer flex-shrink-0 shadow-sm hover:scale-105 transition-transform", children: [
|
|
17248
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16231
17249
|
"input",
|
|
16232
17250
|
{
|
|
16233
17251
|
type: "color",
|
|
@@ -16236,23 +17254,23 @@ function ITThemeProvider({
|
|
|
16236
17254
|
className: "absolute inset-0 opacity-0 cursor-pointer w-full h-full"
|
|
16237
17255
|
}
|
|
16238
17256
|
),
|
|
16239
|
-
/* @__PURE__ */ (0,
|
|
17257
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "w-full h-full", style: { backgroundColor: value } })
|
|
16240
17258
|
] }),
|
|
16241
|
-
/* @__PURE__ */ (0,
|
|
16242
|
-
/* @__PURE__ */ (0,
|
|
16243
|
-
/* @__PURE__ */ (0,
|
|
16244
|
-
/* @__PURE__ */ (0,
|
|
17259
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex flex-col min-w-0", children: [
|
|
17260
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITText, { as: "span", className: "text-xs font-bold text-slate-700 dark:text-slate-300 truncate capitalize", children: label.replace(/([A-Z])/g, " $1").trim() }),
|
|
17261
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center gap-2 mt-0.5", children: [
|
|
17262
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16245
17263
|
"span",
|
|
16246
17264
|
{
|
|
16247
17265
|
className: "w-3 h-3 rounded-full border border-slate-200 dark:border-slate-600",
|
|
16248
17266
|
style: { backgroundColor: value }
|
|
16249
17267
|
}
|
|
16250
17268
|
),
|
|
16251
|
-
/* @__PURE__ */ (0,
|
|
17269
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITText, { as: "span", className: "font-mono text-[11px] text-slate-400", children: value })
|
|
16252
17270
|
] })
|
|
16253
17271
|
] })
|
|
16254
17272
|
] }),
|
|
16255
|
-
/* @__PURE__ */ (0,
|
|
17273
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16256
17274
|
"input",
|
|
16257
17275
|
{
|
|
16258
17276
|
type: "text",
|
|
@@ -16271,14 +17289,14 @@ function ITThemeProvider({
|
|
|
16271
17289
|
isCustom
|
|
16272
17290
|
}) => {
|
|
16273
17291
|
const isSelected = JSON.stringify(preset.colors) === JSON.stringify(palette2);
|
|
16274
|
-
return /* @__PURE__ */ (0,
|
|
17292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
16275
17293
|
"button",
|
|
16276
17294
|
{
|
|
16277
17295
|
type: "button",
|
|
16278
17296
|
onClick: () => applyPreset(preset.colors),
|
|
16279
17297
|
className: `relative flex flex-col items-start p-2.5 rounded-xl border text-left transition-all group ${isSelected ? "border-primary-500 bg-primary-500/5 shadow-sm ring-1 ring-primary-500/20" : "border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900/50 hover:border-slate-300 dark:hover:border-slate-600"}`,
|
|
16280
17298
|
children: [
|
|
16281
|
-
isCustom && /* @__PURE__ */ (0,
|
|
17299
|
+
isCustom && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16282
17300
|
"span",
|
|
16283
17301
|
{
|
|
16284
17302
|
onClick: (e) => {
|
|
@@ -16287,11 +17305,11 @@ function ITThemeProvider({
|
|
|
16287
17305
|
},
|
|
16288
17306
|
className: "absolute top-1.5 right-1.5 opacity-0 group-hover:opacity-100 p-0.5 rounded-md hover:bg-danger-500/10 hover:text-danger-500 text-slate-400 dark:text-slate-500 cursor-pointer transition-all z-10",
|
|
16289
17307
|
title: t("themeProvider.designer.deletePreset"),
|
|
16290
|
-
children: /* @__PURE__ */ (0,
|
|
17308
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_md3.MdClose, { size: 12 })
|
|
16291
17309
|
}
|
|
16292
17310
|
),
|
|
16293
|
-
/* @__PURE__ */ (0,
|
|
16294
|
-
/* @__PURE__ */ (0,
|
|
17311
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITText, { as: "span", className: "text-xs font-semibold truncate w-full mb-1.5 pr-4 text-slate-700 dark:text-slate-300", children: PRESET_I18N_KEY[preset.name] ? t(PRESET_I18N_KEY[preset.name]) : preset.name }),
|
|
17312
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex gap-1", children: ["primary", "secondary", "ternary", "success"].map((c) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16295
17313
|
"span",
|
|
16296
17314
|
{
|
|
16297
17315
|
className: "w-3 h-3 rounded-full border border-black/10",
|
|
@@ -16303,7 +17321,7 @@ function ITThemeProvider({
|
|
|
16303
17321
|
}
|
|
16304
17322
|
);
|
|
16305
17323
|
};
|
|
16306
|
-
return /* @__PURE__ */ (0,
|
|
17324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
16307
17325
|
ITThemeContext.Provider,
|
|
16308
17326
|
{
|
|
16309
17327
|
value: {
|
|
@@ -16320,28 +17338,28 @@ function ITThemeProvider({
|
|
|
16320
17338
|
},
|
|
16321
17339
|
children: [
|
|
16322
17340
|
children,
|
|
16323
|
-
showFab && /* @__PURE__ */ (0,
|
|
17341
|
+
showFab && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16324
17342
|
"button",
|
|
16325
17343
|
{
|
|
16326
17344
|
onClick: () => setIsOpen((prev) => !prev),
|
|
16327
17345
|
className: "it-theme-fab it-theme-bounce",
|
|
16328
17346
|
style: { backgroundColor: "var(--color-primary)" },
|
|
16329
17347
|
"aria-label": t("themeProvider.fab.ariaLabel"),
|
|
16330
|
-
children: /* @__PURE__ */ (0,
|
|
17348
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_md3.MdPalette, { size: 28 })
|
|
16331
17349
|
}
|
|
16332
17350
|
),
|
|
16333
|
-
showFab && /* @__PURE__ */ (0,
|
|
17351
|
+
showFab && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16334
17352
|
ITDialog,
|
|
16335
17353
|
{
|
|
16336
17354
|
isOpen,
|
|
16337
17355
|
onClose: () => setIsOpen(false),
|
|
16338
17356
|
title: t("themeProvider.designer.title"),
|
|
16339
17357
|
useFormHeader: true,
|
|
16340
|
-
children: /* @__PURE__ */ (0,
|
|
16341
|
-
/* @__PURE__ */ (0,
|
|
16342
|
-
/* @__PURE__ */ (0,
|
|
16343
|
-
/* @__PURE__ */ (0,
|
|
16344
|
-
/* @__PURE__ */ (0,
|
|
17358
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex gap-6 h-[580px]", children: [
|
|
17359
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "w-64 flex-shrink-0 flex flex-col gap-5 overflow-y-auto pr-1", children: [
|
|
17360
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { children: [
|
|
17361
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITText, { as: "span", className: "text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500 mb-2.5 block", children: t("themeProvider.designer.appearance") }),
|
|
17362
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16345
17363
|
ITSegmentedControl,
|
|
16346
17364
|
{
|
|
16347
17365
|
options: [
|
|
@@ -16355,16 +17373,16 @@ function ITThemeProvider({
|
|
|
16355
17373
|
}
|
|
16356
17374
|
)
|
|
16357
17375
|
] }),
|
|
16358
|
-
/* @__PURE__ */ (0,
|
|
16359
|
-
/* @__PURE__ */ (0,
|
|
16360
|
-
/* @__PURE__ */ (0,
|
|
17376
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { children: [
|
|
17377
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex items-center justify-between mb-2.5", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITText, { as: "span", className: "text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500", children: t("themeProvider.designer.presets") }) }),
|
|
17378
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "grid grid-cols-2 gap-2", children: PRESETS.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(PresetCard, { preset }, preset.name)) })
|
|
16361
17379
|
] }),
|
|
16362
|
-
customPresets.length > 0 && /* @__PURE__ */ (0,
|
|
16363
|
-
/* @__PURE__ */ (0,
|
|
16364
|
-
/* @__PURE__ */ (0,
|
|
17380
|
+
customPresets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { children: [
|
|
17381
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITText, { as: "span", className: "text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500 mb-2.5 block", children: t("themeProvider.designer.myThemes") }),
|
|
17382
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "flex flex-col gap-1.5", children: customPresets.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(PresetCard, { preset, isCustom: true }, preset.name)) })
|
|
16365
17383
|
] }),
|
|
16366
|
-
isSavingPreset && /* @__PURE__ */ (0,
|
|
16367
|
-
/* @__PURE__ */ (0,
|
|
17384
|
+
isSavingPreset && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex flex-col gap-2 p-3 rounded-xl border border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-900/50", children: [
|
|
17385
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16368
17386
|
ITInput,
|
|
16369
17387
|
{
|
|
16370
17388
|
name: "presetName",
|
|
@@ -16382,8 +17400,8 @@ function ITThemeProvider({
|
|
|
16382
17400
|
}
|
|
16383
17401
|
}
|
|
16384
17402
|
),
|
|
16385
|
-
/* @__PURE__ */ (0,
|
|
16386
|
-
/* @__PURE__ */ (0,
|
|
17403
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex gap-2", children: [
|
|
17404
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16387
17405
|
ITButton,
|
|
16388
17406
|
{
|
|
16389
17407
|
label: t("themeProvider.designer.save"),
|
|
@@ -16394,7 +17412,7 @@ function ITThemeProvider({
|
|
|
16394
17412
|
className: "flex-1"
|
|
16395
17413
|
}
|
|
16396
17414
|
),
|
|
16397
|
-
/* @__PURE__ */ (0,
|
|
17415
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16398
17416
|
ITButton,
|
|
16399
17417
|
{
|
|
16400
17418
|
label: t("themeProvider.designer.cancelSave"),
|
|
@@ -16408,31 +17426,31 @@ function ITThemeProvider({
|
|
|
16408
17426
|
)
|
|
16409
17427
|
] })
|
|
16410
17428
|
] }),
|
|
16411
|
-
!isSavingPreset && /* @__PURE__ */ (0,
|
|
17429
|
+
!isSavingPreset && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16412
17430
|
ITButton,
|
|
16413
17431
|
{
|
|
16414
17432
|
variant: "outlined",
|
|
16415
|
-
icon: /* @__PURE__ */ (0,
|
|
17433
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_md3.MdPalette, { size: 14 }),
|
|
16416
17434
|
label: t("themeProvider.designer.saveCurrent"),
|
|
16417
17435
|
onClick: () => setIsSavingPreset(true),
|
|
16418
17436
|
size: "sm"
|
|
16419
17437
|
}
|
|
16420
17438
|
),
|
|
16421
|
-
/* @__PURE__ */ (0,
|
|
17439
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16422
17440
|
ITButton,
|
|
16423
17441
|
{
|
|
16424
17442
|
variant: "outlined",
|
|
16425
17443
|
color: "danger",
|
|
16426
|
-
icon: /* @__PURE__ */ (0,
|
|
17444
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_md3.MdRefresh, { size: 14 }),
|
|
16427
17445
|
label: t("themeProvider.designer.reset"),
|
|
16428
17446
|
onClick: resetTheme,
|
|
16429
17447
|
size: "sm"
|
|
16430
17448
|
}
|
|
16431
17449
|
)
|
|
16432
17450
|
] }),
|
|
16433
|
-
/* @__PURE__ */ (0,
|
|
16434
|
-
/* @__PURE__ */ (0,
|
|
16435
|
-
/* @__PURE__ */ (0,
|
|
17451
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITDivider, { orientation: "vertical" }),
|
|
17452
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex-1 flex flex-col min-w-0", children: [
|
|
17453
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16436
17454
|
tabs_default,
|
|
16437
17455
|
{
|
|
16438
17456
|
variant: "pill",
|
|
@@ -16440,7 +17458,7 @@ function ITThemeProvider({
|
|
|
16440
17458
|
{
|
|
16441
17459
|
id: "brand",
|
|
16442
17460
|
label: t("themeProvider.tabs.brand"),
|
|
16443
|
-
content: /* @__PURE__ */ (0,
|
|
17461
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 max-h-[480px] overflow-y-auto pr-2 mt-3", children: [
|
|
16444
17462
|
"primary",
|
|
16445
17463
|
"secondary",
|
|
16446
17464
|
"ternary",
|
|
@@ -16449,35 +17467,35 @@ function ITThemeProvider({
|
|
|
16449
17467
|
"info",
|
|
16450
17468
|
"alert",
|
|
16451
17469
|
"warning"
|
|
16452
|
-
].map((key) => /* @__PURE__ */ (0,
|
|
17470
|
+
].map((key) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ColorRow, { colorKey: key }, key)) })
|
|
16453
17471
|
},
|
|
16454
17472
|
{
|
|
16455
17473
|
id: "layout",
|
|
16456
17474
|
label: t("themeProvider.tabs.layout"),
|
|
16457
|
-
content: /* @__PURE__ */ (0,
|
|
17475
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 max-h-[480px] overflow-y-auto pr-2 mt-3", children: [
|
|
16458
17476
|
"layout.sidebarBg",
|
|
16459
17477
|
"layout.sidebarText",
|
|
16460
17478
|
"layout.navbarBg",
|
|
16461
17479
|
"layout.navbarText"
|
|
16462
|
-
].map((key) => /* @__PURE__ */ (0,
|
|
17480
|
+
].map((key) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ColorRow, { colorKey: key }, key)) })
|
|
16463
17481
|
},
|
|
16464
17482
|
{
|
|
16465
17483
|
id: "tables",
|
|
16466
17484
|
label: t("themeProvider.tabs.tables"),
|
|
16467
|
-
content: /* @__PURE__ */ (0,
|
|
17485
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 max-h-[480px] overflow-y-auto pr-2 mt-3", children: [
|
|
16468
17486
|
"table.headerBg",
|
|
16469
17487
|
"table.headerText",
|
|
16470
17488
|
"table.rowBg",
|
|
16471
17489
|
"table.rowText",
|
|
16472
17490
|
"table.rowHover"
|
|
16473
|
-
].map((key) => /* @__PURE__ */ (0,
|
|
17491
|
+
].map((key) => /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ColorRow, { colorKey: key }, key)) })
|
|
16474
17492
|
}
|
|
16475
17493
|
]
|
|
16476
17494
|
}
|
|
16477
17495
|
),
|
|
16478
|
-
/* @__PURE__ */ (0,
|
|
16479
|
-
/* @__PURE__ */ (0,
|
|
16480
|
-
/* @__PURE__ */ (0,
|
|
17496
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "flex items-center justify-end gap-3 mt-auto pt-4 border-t border-slate-100 dark:border-slate-800", children: [
|
|
17497
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(ITText, { as: "p", className: "text-[11px] text-slate-400 mr-auto", children: t("themeProvider.designer.autosave") }),
|
|
17498
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16481
17499
|
ITButton,
|
|
16482
17500
|
{
|
|
16483
17501
|
label: t("themeProvider.designer.close"),
|
|
@@ -16585,13 +17603,16 @@ var createValidationSchema = (fields) => Yup.object().shape(
|
|
|
16585
17603
|
auditTree,
|
|
16586
17604
|
axzyCatalog,
|
|
16587
17605
|
axzyCatalogTypes,
|
|
17606
|
+
buildNavigationTree,
|
|
16588
17607
|
buildVocabularyContract,
|
|
16589
17608
|
countPendingNodes,
|
|
17609
|
+
createBindingResolver,
|
|
16590
17610
|
createCatalog,
|
|
16591
17611
|
createLimitTracker,
|
|
16592
17612
|
createValidationSchema,
|
|
16593
17613
|
enMessages,
|
|
16594
17614
|
esMessages,
|
|
17615
|
+
flattenRoutes,
|
|
16595
17616
|
formatPath,
|
|
16596
17617
|
formatVocabularyForPrompt,
|
|
16597
17618
|
getCatalogEntry,
|
|
@@ -16602,7 +17623,10 @@ var createValidationSchema = (fields) => Yup.object().shape(
|
|
|
16602
17623
|
isLightColor,
|
|
16603
17624
|
isNodePending,
|
|
16604
17625
|
issue,
|
|
17626
|
+
joinRoutePath,
|
|
17627
|
+
matchRoute,
|
|
16605
17628
|
migrateSchema,
|
|
17629
|
+
navContainsRoute,
|
|
16606
17630
|
parsePartialSchema,
|
|
16607
17631
|
parsePath,
|
|
16608
17632
|
propPath,
|
|
@@ -16612,6 +17636,7 @@ var createValidationSchema = (fields) => Yup.object().shape(
|
|
|
16612
17636
|
resolveCssColor,
|
|
16613
17637
|
resolveLimits,
|
|
16614
17638
|
resolveNode,
|
|
17639
|
+
routeHref,
|
|
16615
17640
|
useClickOutside,
|
|
16616
17641
|
useDebouncedSearch,
|
|
16617
17642
|
useEditableRow,
|
|
@@ -16621,7 +17646,9 @@ var createValidationSchema = (fields) => Yup.object().shape(
|
|
|
16621
17646
|
useITThemeSafe,
|
|
16622
17647
|
useITTranslation,
|
|
16623
17648
|
useJsonRender,
|
|
17649
|
+
useSchemaStream,
|
|
16624
17650
|
useTableState,
|
|
17651
|
+
validateRoutes,
|
|
16625
17652
|
validateSchema
|
|
16626
17653
|
});
|
|
16627
17654
|
//# sourceMappingURL=index.cjs.map
|