@axzydev/axzy_ui_system 1.3.1 → 1.3.3
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/README.md +6 -2
- package/dist/index.cjs +957 -554
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +191 -9
- package/dist/index.d.ts +191 -9
- package/dist/index.js +908 -505
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/App.tsx +150 -154
- package/src/components/molecules/table/table.doc.mdx +64 -21
- package/src/components/molecules/table/table.props.ts +81 -2
- package/src/components/molecules/table/table.stories.tsx +155 -0
- package/src/components/molecules/table/table.tsx +178 -36
- package/src/components/organisms/data-table/ITDataTable.doc.mdx +37 -3
- package/src/components/organisms/data-table/ITDataTable.stories.tsx +43 -0
- package/src/components/organisms/data-table/dataTable.props.ts +64 -0
- package/src/components/organisms/data-table/dataTable.tsx +241 -82
- package/src/components/organisms/sidebar/sidebar.doc.mdx +5 -0
- package/src/components/organisms/sidebar/sidebar.props.ts +5 -0
- package/src/components/organisms/sidebar/sidebar.stories.tsx +1 -1
- package/src/components/organisms/sidebar/sidebar.tsx +27 -7
- package/src/components/organisms/topbar/topbar.doc.mdx +3 -0
- package/src/components/organisms/topbar/topbar.props.ts +16 -0
- package/src/components/organisms/topbar/topbar.tsx +133 -98
- package/src/components/templates/layout/layout.doc.mdx +2 -0
- package/src/components/templates/layout/layout.tsx +7 -1
- package/src/components/templates/page/page.doc.mdx +8 -2
- package/src/components/templates/page/page.props.ts +11 -1
- package/src/components/templates/page/page.tsx +11 -1
- package/src/components/theme-provider/themePresets.ts +6 -0
- package/src/components/theme-provider/themeProvider.doc.mdx +1 -0
- package/src/components/theme-provider/themeProvider.props.ts +2 -0
- package/src/components/theme-provider/themeProvider.tsx +13 -2
- package/src/dev.css +58 -1
- package/src/hooks/useElementSize.ts +46 -0
- package/src/hooks/useVirtualRows.ts +123 -0
- package/src/index.ts +2 -0
- package/src/sandbox/LandingShowcase.tsx +654 -0
- package/src/sandbox/NotFoundShowcase.tsx +70 -0
- package/src/sandbox/TopbarSearch.tsx +85 -0
- package/src/sandbox/navigation.ts +148 -0
- package/src/sandbox/useHashRoute.ts +149 -0
- package/src/showcases/DataShowcases.tsx +321 -24
- package/src/showcases/PageShowcases.tsx +31 -0
- package/src/showcases/StructureShowcases.tsx +42 -4
- package/src/theme/theme.types.ts +2 -0
- package/src/types/table.types.ts +48 -0
- package/src/utils/styles.ts +12 -5
- package/src/utils/table.utils.ts +31 -0
package/dist/index.js
CHANGED
|
@@ -2032,6 +2032,34 @@ import { useRef as useRef4, useState as useState9 } from "react";
|
|
|
2032
2032
|
|
|
2033
2033
|
// src/utils/styles.ts
|
|
2034
2034
|
import clsx11 from "clsx";
|
|
2035
|
+
|
|
2036
|
+
// src/types/table.types.ts
|
|
2037
|
+
var variantStyles = {
|
|
2038
|
+
default: "",
|
|
2039
|
+
striped: "",
|
|
2040
|
+
bordered: "border border-gray-200"
|
|
2041
|
+
};
|
|
2042
|
+
var sizeStyles = {
|
|
2043
|
+
sm: "text-xs",
|
|
2044
|
+
md: "text-sm",
|
|
2045
|
+
lg: "text-lg"
|
|
2046
|
+
};
|
|
2047
|
+
var densityStyles = {
|
|
2048
|
+
compact: { header: "px-3 py-2", cell: "px-3 py-1.5", rowHeight: 33 },
|
|
2049
|
+
normal: { header: "px-4 py-4", cell: "px-4 py-3", rowHeight: 45 },
|
|
2050
|
+
comfortable: { header: "px-4 py-5", cell: "px-4 py-4", rowHeight: 53 }
|
|
2051
|
+
};
|
|
2052
|
+
var sizeLineHeights = { sm: 16, md: 20, lg: 28 };
|
|
2053
|
+
function getRowHeight(size, density) {
|
|
2054
|
+
return densityStyles[density].rowHeight - sizeLineHeights.md + sizeLineHeights[size];
|
|
2055
|
+
}
|
|
2056
|
+
var tableAlignClasses = {
|
|
2057
|
+
left: "text-left",
|
|
2058
|
+
center: "text-center",
|
|
2059
|
+
right: "text-right"
|
|
2060
|
+
};
|
|
2061
|
+
|
|
2062
|
+
// src/utils/styles.ts
|
|
2035
2063
|
function inputFieldStyle(inputTheme, size = "md", extra) {
|
|
2036
2064
|
const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
|
|
2037
2065
|
return {
|
|
@@ -2061,13 +2089,16 @@ var iconAbsoluteLeft = "absolute inset-y-0 left-0 flex items-center pl-3 z-10";
|
|
|
2061
2089
|
var iconAbsoluteRight = "absolute inset-y-0 right-0 flex items-center pr-3 z-10";
|
|
2062
2090
|
var tableContainer = "rounded-xl shadow-sm border border-secondary-200 overflow-hidden";
|
|
2063
2091
|
var tableHeaderRow = "bg-secondary-50 border-b border-secondary-200 text-xs uppercase tracking-wider font-semibold text-secondary-500";
|
|
2064
|
-
function tableHeaderCell(className) {
|
|
2065
|
-
return clsx11("
|
|
2092
|
+
function tableHeaderCell(className, density = "normal") {
|
|
2093
|
+
return clsx11(densityStyles[density].header, "align-top", className);
|
|
2066
2094
|
}
|
|
2067
2095
|
var tableBody = "divide-y divide-secondary-100";
|
|
2068
|
-
var tableRow = "hover:bg-secondary-50
|
|
2069
|
-
|
|
2070
|
-
|
|
2096
|
+
var tableRow = "hover:bg-[var(--color-table-rowHover,var(--color-secondary-50))] transition-colors duration-150 group";
|
|
2097
|
+
var tableRowClickable = "cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-inset";
|
|
2098
|
+
var tableCardClickable = "cursor-pointer rounded-lg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500";
|
|
2099
|
+
var tableCardHover = "hover:bg-[var(--color-table-rowHover,var(--color-secondary-50))] transition-colors duration-150";
|
|
2100
|
+
function tableCell(className, density = "normal") {
|
|
2101
|
+
return clsx11(densityStyles[density].cell, "align-middle", className);
|
|
2071
2102
|
}
|
|
2072
2103
|
var tableActionsCell = "flex items-center justify-center gap-2";
|
|
2073
2104
|
var tableCellText = "text-secondary-700 font-medium";
|
|
@@ -3484,21 +3515,88 @@ function ITConfirmDialog({
|
|
|
3484
3515
|
] });
|
|
3485
3516
|
}
|
|
3486
3517
|
|
|
3487
|
-
// src/
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
};
|
|
3518
|
+
// src/hooks/useElementSize.ts
|
|
3519
|
+
import { useLayoutEffect as useLayoutEffect2, useRef as useRef9, useState as useState14 } from "react";
|
|
3520
|
+
function useElementSize() {
|
|
3521
|
+
const ref = useRef9(null);
|
|
3522
|
+
const [size, setSize] = useState14({ width: 0, height: 0 });
|
|
3523
|
+
useLayoutEffect2(() => {
|
|
3524
|
+
const element = ref.current;
|
|
3525
|
+
if (!element) return;
|
|
3526
|
+
const update = () => {
|
|
3527
|
+
const rect = element.getBoundingClientRect();
|
|
3528
|
+
setSize({ width: rect.width, height: rect.height });
|
|
3529
|
+
};
|
|
3530
|
+
update();
|
|
3531
|
+
const observer = new ResizeObserver(update);
|
|
3532
|
+
observer.observe(element);
|
|
3533
|
+
return () => observer.disconnect();
|
|
3534
|
+
}, []);
|
|
3535
|
+
return { ref, width: size.width, height: size.height };
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
// src/hooks/useVirtualRows.ts
|
|
3539
|
+
import { useCallback as useCallback6, useLayoutEffect as useLayoutEffect3, useRef as useRef10, useState as useState15 } from "react";
|
|
3540
|
+
function useVirtualRows({
|
|
3541
|
+
count,
|
|
3542
|
+
rowHeight,
|
|
3543
|
+
overscan = 5,
|
|
3544
|
+
enabled = true,
|
|
3545
|
+
resetKey
|
|
3546
|
+
}) {
|
|
3547
|
+
const scrollRef = useRef10(null);
|
|
3548
|
+
const [scrollTop, setScrollTop] = useState15(0);
|
|
3549
|
+
const [viewportHeight, setViewportHeight] = useState15(0);
|
|
3550
|
+
const scrollToTop = useCallback6(() => {
|
|
3551
|
+
setScrollTop(0);
|
|
3552
|
+
const element = scrollRef.current;
|
|
3553
|
+
if (element) element.scrollTop = 0;
|
|
3554
|
+
}, []);
|
|
3555
|
+
useLayoutEffect3(() => {
|
|
3556
|
+
if (!enabled) return;
|
|
3557
|
+
const element = scrollRef.current;
|
|
3558
|
+
if (!element) return;
|
|
3559
|
+
const onScroll = () => setScrollTop(element.scrollTop);
|
|
3560
|
+
const measure = () => setViewportHeight(element.clientHeight);
|
|
3561
|
+
measure();
|
|
3562
|
+
setScrollTop(element.scrollTop);
|
|
3563
|
+
element.addEventListener("scroll", onScroll, { passive: true });
|
|
3564
|
+
const observer = new ResizeObserver(measure);
|
|
3565
|
+
observer.observe(element);
|
|
3566
|
+
return () => {
|
|
3567
|
+
element.removeEventListener("scroll", onScroll);
|
|
3568
|
+
observer.disconnect();
|
|
3569
|
+
};
|
|
3570
|
+
}, [enabled]);
|
|
3571
|
+
useLayoutEffect3(() => {
|
|
3572
|
+
if (!enabled) return;
|
|
3573
|
+
const element = scrollRef.current;
|
|
3574
|
+
if (element) element.scrollTop = 0;
|
|
3575
|
+
setScrollTop(0);
|
|
3576
|
+
}, [resetKey, enabled]);
|
|
3577
|
+
const valid = enabled && rowHeight > 0 && count > 0;
|
|
3578
|
+
const safeScrollTop = valid ? scrollTop : 0;
|
|
3579
|
+
const startIndex = valid ? Math.min(count - 1, Math.max(0, Math.floor(safeScrollTop / rowHeight) - overscan)) : 0;
|
|
3580
|
+
const endIndex = valid ? Math.min(
|
|
3581
|
+
count - 1,
|
|
3582
|
+
Math.ceil((safeScrollTop + viewportHeight) / rowHeight) + overscan
|
|
3583
|
+
) : Math.max(0, count - 1);
|
|
3584
|
+
const topSpacerHeight = valid ? startIndex * rowHeight : 0;
|
|
3585
|
+
const bottomSpacerHeight = valid ? Math.max(0, (count - 1 - endIndex) * rowHeight) : 0;
|
|
3586
|
+
return {
|
|
3587
|
+
scrollRef,
|
|
3588
|
+
startIndex,
|
|
3589
|
+
endIndex,
|
|
3590
|
+
topSpacerHeight,
|
|
3591
|
+
bottomSpacerHeight,
|
|
3592
|
+
scrollTop: safeScrollTop,
|
|
3593
|
+
scrollToTop
|
|
3594
|
+
};
|
|
3595
|
+
}
|
|
3498
3596
|
|
|
3499
3597
|
// src/components/organisms/data-table/dataTable.tsx
|
|
3500
3598
|
import clsx21 from "clsx";
|
|
3501
|
-
import { useState as
|
|
3599
|
+
import { useState as useState17, useEffect as useEffect7, useCallback as useCallback7, useRef as useRef11 } from "react";
|
|
3502
3600
|
import { FaCheck as FaCheck2, FaSpinner, FaTimes as FaTimes4, FaTable, FaThLarge } from "react-icons/fa";
|
|
3503
3601
|
import { MdOutlineSwapVert } from "react-icons/md";
|
|
3504
3602
|
|
|
@@ -3509,7 +3607,7 @@ import { FaChevronLeft as FaChevronLeft2, FaChevronRight as FaChevronRight3 } fr
|
|
|
3509
3607
|
|
|
3510
3608
|
// src/components/molecules/select/select.tsx
|
|
3511
3609
|
import clsx19 from "clsx";
|
|
3512
|
-
import { useState as
|
|
3610
|
+
import { useState as useState16 } from "react";
|
|
3513
3611
|
import { FaAngleDown } from "react-icons/fa";
|
|
3514
3612
|
import { jsx as jsx19, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3515
3613
|
function ITSelect({
|
|
@@ -3530,8 +3628,8 @@ function ITSelect({
|
|
|
3530
3628
|
readOnly = false,
|
|
3531
3629
|
size = "md"
|
|
3532
3630
|
}) {
|
|
3533
|
-
const [isFocused, setIsFocused] =
|
|
3534
|
-
const [localTouched, setLocalTouched] =
|
|
3631
|
+
const [isFocused, setIsFocused] = useState16(false);
|
|
3632
|
+
const [localTouched, setLocalTouched] = useState16(false);
|
|
3535
3633
|
const inputTheme = theme.input || {};
|
|
3536
3634
|
const isTouched = touched !== void 0 ? touched : localTouched;
|
|
3537
3635
|
const isEmpty = value === void 0 || value === null || String(value).trim() === "";
|
|
@@ -3802,6 +3900,14 @@ var formatCurrencyMX = (value) => {
|
|
|
3802
3900
|
var getNestedValue = (obj, path) => {
|
|
3803
3901
|
return path.split(".").reduce((acc, part) => acc && acc[part], obj);
|
|
3804
3902
|
};
|
|
3903
|
+
var ROW_CLICK_IGNORE_SELECTOR = 'button, a, input, select, textarea, [role="button"], [role="link"], [data-row-click-ignore]';
|
|
3904
|
+
function isInteractiveTarget(target, boundary = null) {
|
|
3905
|
+
if (!(target instanceof Element)) return false;
|
|
3906
|
+
const interactive = target.closest(ROW_CLICK_IGNORE_SELECTOR);
|
|
3907
|
+
if (!interactive) return false;
|
|
3908
|
+
if (boundary instanceof Node && interactive === boundary) return false;
|
|
3909
|
+
return true;
|
|
3910
|
+
}
|
|
3805
3911
|
|
|
3806
3912
|
// src/components/organisms/data-table/dataTable.tsx
|
|
3807
3913
|
import { Fragment as Fragment4, jsx as jsx21, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
@@ -3827,12 +3933,32 @@ function ITDataTable({
|
|
|
3827
3933
|
renderCard,
|
|
3828
3934
|
defaultView,
|
|
3829
3935
|
showVerticalBorder = true,
|
|
3830
|
-
verticalBorderClassname
|
|
3936
|
+
verticalBorderClassname,
|
|
3937
|
+
onRowClick,
|
|
3938
|
+
layout = "auto",
|
|
3939
|
+
density = "normal",
|
|
3940
|
+
autoCardBreakpoint = 0,
|
|
3941
|
+
virtualized = false,
|
|
3942
|
+
virtualizedMaxHeight = 400,
|
|
3943
|
+
rowHeight,
|
|
3944
|
+
overscan = 5,
|
|
3945
|
+
stickyHeader = false
|
|
3831
3946
|
}) {
|
|
3832
|
-
const [viewMode, setViewMode] =
|
|
3833
|
-
const
|
|
3834
|
-
const [
|
|
3835
|
-
const [
|
|
3947
|
+
const [viewMode, setViewMode] = useState17(defaultView || "table");
|
|
3948
|
+
const { ref: rootRef, width: containerWidth } = useElementSize();
|
|
3949
|
+
const [data, setData] = useState17([]);
|
|
3950
|
+
const [totalItems, setTotalItems] = useState17(0);
|
|
3951
|
+
const [isLoading, setIsLoading] = useState17(fetchOnMount);
|
|
3952
|
+
const isFixed = layout === "fixed";
|
|
3953
|
+
const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
|
|
3954
|
+
const effectiveView = forcedCards ? "cards" : viewMode;
|
|
3955
|
+
const hasColumnWidths = columns.some((col) => col.width != null);
|
|
3956
|
+
const tableLayoutClass = isFixed ? "w-full text-sm text-left text-secondary-600 transition-opacity duration-300" : "min-w-max w-full text-sm text-left text-secondary-600 transition-opacity duration-300";
|
|
3957
|
+
const isTableVirtual = virtualized && effectiveView === "table";
|
|
3958
|
+
const isStickyHeader = stickyHeader && isTableVirtual;
|
|
3959
|
+
const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
|
|
3960
|
+
const columnCount = columns.length;
|
|
3961
|
+
const scrollOuterClass = isTableVirtual ? "relative min-h-[200px]" : "overflow-x-auto relative min-h-[200px]";
|
|
3836
3962
|
const {
|
|
3837
3963
|
currentPage,
|
|
3838
3964
|
itemsPerPage,
|
|
@@ -3843,15 +3969,29 @@ function ITDataTable({
|
|
|
3843
3969
|
handleSort,
|
|
3844
3970
|
handleItemsPerPageChange
|
|
3845
3971
|
} = useTableState({ defaultItemsPerPage });
|
|
3846
|
-
const
|
|
3847
|
-
|
|
3848
|
-
|
|
3972
|
+
const {
|
|
3973
|
+
scrollRef,
|
|
3974
|
+
startIndex,
|
|
3975
|
+
endIndex,
|
|
3976
|
+
topSpacerHeight,
|
|
3977
|
+
bottomSpacerHeight
|
|
3978
|
+
} = useVirtualRows({
|
|
3979
|
+
count: data.length,
|
|
3980
|
+
rowHeight: resolvedRowHeight,
|
|
3981
|
+
overscan,
|
|
3982
|
+
enabled: isTableVirtual,
|
|
3983
|
+
resetKey: `${currentPage}-${itemsPerPage}`
|
|
3984
|
+
});
|
|
3985
|
+
const windowData = isTableVirtual ? data.slice(startIndex, endIndex + 1) : data;
|
|
3986
|
+
const debounceTimerRef = useRef11(null);
|
|
3987
|
+
const hasFetchedRef = useRef11(false);
|
|
3988
|
+
const fetchDataRef = useRef11(fetchData);
|
|
3849
3989
|
fetchDataRef.current = fetchData;
|
|
3850
|
-
const externalFiltersRef =
|
|
3990
|
+
const externalFiltersRef = useRef11(externalFilters);
|
|
3851
3991
|
externalFiltersRef.current = externalFilters;
|
|
3852
3992
|
const externalKey = JSON.stringify(externalFilters);
|
|
3853
3993
|
const computedTotalPages = Math.ceil(totalItems / itemsPerPage) || 1;
|
|
3854
|
-
const performFetch =
|
|
3994
|
+
const performFetch = useCallback7(async () => {
|
|
3855
3995
|
setIsLoading(true);
|
|
3856
3996
|
try {
|
|
3857
3997
|
const response = await fetchDataRef.current({
|
|
@@ -3872,7 +4012,7 @@ function ITDataTable({
|
|
|
3872
4012
|
setIsLoading(false);
|
|
3873
4013
|
}
|
|
3874
4014
|
}, [currentPage, itemsPerPage, filters, sortConfig]);
|
|
3875
|
-
const performFetchRef =
|
|
4015
|
+
const performFetchRef = useRef11(performFetch);
|
|
3876
4016
|
performFetchRef.current = performFetch;
|
|
3877
4017
|
useEffect7(() => {
|
|
3878
4018
|
if (!fetchOnMount && !hasFetchedRef.current) return;
|
|
@@ -3993,15 +4133,132 @@ function ITDataTable({
|
|
|
3993
4133
|
actionCol?.actions && /* @__PURE__ */ jsx21("div", { className: "flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-700", children: actionCol.actions(row) })
|
|
3994
4134
|
] });
|
|
3995
4135
|
};
|
|
3996
|
-
const segCtrlClass = (mode) => `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${
|
|
3997
|
-
|
|
4136
|
+
const segCtrlClass = (mode) => `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === mode ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`;
|
|
4137
|
+
const handleRowClick = (row) => (event) => {
|
|
4138
|
+
if (!onRowClick || isLoading || isInteractiveTarget(event.target, event.currentTarget)) return;
|
|
4139
|
+
onRowClick(row, event);
|
|
4140
|
+
};
|
|
4141
|
+
const handleRowKeyDown = (row) => (event) => {
|
|
4142
|
+
if (!onRowClick || isLoading) return;
|
|
4143
|
+
if (event.target !== event.currentTarget) return;
|
|
4144
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
4145
|
+
event.preventDefault();
|
|
4146
|
+
onRowClick(row, event);
|
|
4147
|
+
};
|
|
4148
|
+
const tableEl = /* @__PURE__ */ jsxs18(
|
|
4149
|
+
"table",
|
|
4150
|
+
{
|
|
4151
|
+
className: clsx21(
|
|
4152
|
+
tableLayoutClass,
|
|
4153
|
+
showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
|
|
4154
|
+
showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
|
|
4155
|
+
isLoading ? "opacity-50" : "opacity-100",
|
|
4156
|
+
variantStyles[variant],
|
|
4157
|
+
sizeStyles[size],
|
|
4158
|
+
className
|
|
4159
|
+
),
|
|
4160
|
+
style: isFixed ? { tableLayout: "fixed" } : void 0,
|
|
4161
|
+
"aria-rowcount": isTableVirtual ? data.length + 1 : void 0,
|
|
4162
|
+
children: [
|
|
4163
|
+
hasColumnWidths && /* @__PURE__ */ jsx21("colgroup", { children: columns.map((col) => /* @__PURE__ */ jsx21(
|
|
4164
|
+
"col",
|
|
4165
|
+
{
|
|
4166
|
+
style: col.width != null ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0
|
|
4167
|
+
},
|
|
4168
|
+
col.key
|
|
4169
|
+
)) }),
|
|
4170
|
+
/* @__PURE__ */ jsx21("thead", { children: /* @__PURE__ */ jsx21(
|
|
4171
|
+
"tr",
|
|
4172
|
+
{
|
|
4173
|
+
className: clsx21(tableHeaderRow, "dark:text-slate-200"),
|
|
4174
|
+
"aria-rowindex": isTableVirtual ? 1 : void 0,
|
|
4175
|
+
children: columns.map((col) => /* @__PURE__ */ jsx21(
|
|
4176
|
+
"th",
|
|
4177
|
+
{
|
|
4178
|
+
scope: "col",
|
|
4179
|
+
className: clsx21(
|
|
4180
|
+
tableHeaderCell(col.className, density),
|
|
4181
|
+
col.align && tableAlignClasses[col.align],
|
|
4182
|
+
isStickyHeader && "sticky top-0 z-10 bg-secondary-50"
|
|
4183
|
+
),
|
|
4184
|
+
style: col.minWidth != null || isStickyHeader ? {
|
|
4185
|
+
...col.minWidth != null ? { minWidth: `${col.minWidth}px` } : {},
|
|
4186
|
+
...isStickyHeader ? { backgroundColor: "var(--color-table-headerBg, #f8fafc)" } : {}
|
|
4187
|
+
} : void 0,
|
|
4188
|
+
children: /* @__PURE__ */ jsxs18("div", { className: isFixed ? "flex flex-col gap-3" : "flex flex-col gap-3 min-w-[150px]", children: [
|
|
4189
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4190
|
+
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
4191
|
+
col.sortable && col.type !== "actions" && /* @__PURE__ */ jsx21(
|
|
4192
|
+
"button",
|
|
4193
|
+
{
|
|
4194
|
+
onClick: () => handleSort(col.key),
|
|
4195
|
+
disabled: isLoading,
|
|
4196
|
+
className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"} disabled:opacity-50`,
|
|
4197
|
+
title: `Ordenar por ${col.label}`,
|
|
4198
|
+
children: /* @__PURE__ */ jsx21(MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
|
|
4199
|
+
}
|
|
4200
|
+
)
|
|
4201
|
+
] }),
|
|
4202
|
+
/* @__PURE__ */ jsx21("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
|
|
4203
|
+
] })
|
|
4204
|
+
},
|
|
4205
|
+
col.key
|
|
4206
|
+
))
|
|
4207
|
+
}
|
|
4208
|
+
) }),
|
|
4209
|
+
/* @__PURE__ */ jsx21("tbody", { className: clsx21(tableBody, "dark:divide-slate-700/30"), children: data.length > 0 ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
4210
|
+
isTableVirtual && topSpacerHeight > 0 && /* @__PURE__ */ jsx21("tr", { "aria-hidden": "true", style: { height: topSpacerHeight }, children: /* @__PURE__ */ jsx21("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) }),
|
|
4211
|
+
windowData.map((row, windowIndex) => {
|
|
4212
|
+
const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
|
|
4213
|
+
return /* @__PURE__ */ jsx21(
|
|
4214
|
+
"tr",
|
|
4215
|
+
{
|
|
4216
|
+
"aria-rowindex": isTableVirtual ? absoluteIndex + 2 : void 0,
|
|
4217
|
+
className: clsx21(
|
|
4218
|
+
tableRow,
|
|
4219
|
+
variant === "striped" && absoluteIndex % 2 === 0 && "bg-secondary-50/40 dark:bg-slate-800/20",
|
|
4220
|
+
onRowClick && !isLoading && tableRowClickable
|
|
4221
|
+
),
|
|
4222
|
+
tabIndex: onRowClick && !isLoading ? 0 : void 0,
|
|
4223
|
+
onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
|
|
4224
|
+
onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
|
|
4225
|
+
children: columns.map((col) => {
|
|
4226
|
+
const rawValue = getNestedValue2(row, col.key);
|
|
4227
|
+
const truncateTitle = col.truncate && (typeof rawValue === "string" || typeof rawValue === "number") ? String(rawValue) : void 0;
|
|
4228
|
+
return /* @__PURE__ */ jsx21(
|
|
4229
|
+
"td",
|
|
4230
|
+
{
|
|
4231
|
+
className: clsx21(
|
|
4232
|
+
tableCell(col.className, density),
|
|
4233
|
+
col.align && tableAlignClasses[col.align]
|
|
4234
|
+
),
|
|
4235
|
+
style: col.minWidth != null ? { minWidth: `${col.minWidth}px` } : void 0,
|
|
4236
|
+
title: truncateTitle,
|
|
4237
|
+
children: col.type === "actions" ? /* @__PURE__ */ jsx21("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ jsx21("div", { className: clsx21(tableCellText, col.truncate && "truncate"), children: renderCellContent(col, row) })
|
|
4238
|
+
},
|
|
4239
|
+
`${absoluteIndex}-${col.key}`
|
|
4240
|
+
);
|
|
4241
|
+
})
|
|
4242
|
+
},
|
|
4243
|
+
absoluteIndex
|
|
4244
|
+
);
|
|
4245
|
+
}),
|
|
4246
|
+
isTableVirtual && bottomSpacerHeight > 0 && /* @__PURE__ */ jsx21("tr", { "aria-hidden": "true", style: { height: bottomSpacerHeight }, children: /* @__PURE__ */ jsx21("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) })
|
|
4247
|
+
] }) : /* @__PURE__ */ jsx21("tr", { children: /* @__PURE__ */ jsx21("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: !isLoading && /* @__PURE__ */ jsxs18("div", { className: tableEmptyContent, children: [
|
|
4248
|
+
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
4249
|
+
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
4250
|
+
] }) }) }) })
|
|
4251
|
+
]
|
|
4252
|
+
}
|
|
4253
|
+
);
|
|
4254
|
+
return /* @__PURE__ */ jsxs18("div", { ref: rootRef, className: clsx21("space-y-4 w-full relative", containerClassName), children: [
|
|
3998
4255
|
/* @__PURE__ */ jsxs18("div", { className: tableContainer, style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
3999
4256
|
title && /* @__PURE__ */ jsxs18("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
4000
4257
|
/* @__PURE__ */ jsx21(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
|
|
4001
4258
|
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-3", children: [
|
|
4002
4259
|
isLoading && /* @__PURE__ */ jsx21("div", { className: "text-secondary-400", children: loadingIndicator || /* @__PURE__ */ jsx21(FaSpinner, { className: "animate-spin text-primary-500 text-xl" }) }),
|
|
4003
4260
|
/* @__PURE__ */ jsxs18("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
|
|
4004
|
-
/* @__PURE__ */ jsxs18("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
|
|
4261
|
+
/* @__PURE__ */ jsxs18("button", { onClick: () => setViewMode("table"), disabled: forcedCards, className: segCtrlClass("table"), children: [
|
|
4005
4262
|
/* @__PURE__ */ jsx21(FaTable, { size: 11 }),
|
|
4006
4263
|
"Table"
|
|
4007
4264
|
] }),
|
|
@@ -4013,7 +4270,7 @@ function ITDataTable({
|
|
|
4013
4270
|
] })
|
|
4014
4271
|
] }),
|
|
4015
4272
|
!title && /* @__PURE__ */ jsx21("div", { className: "flex justify-end px-4 pt-3", children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
|
|
4016
|
-
/* @__PURE__ */ jsxs18("button", { onClick: () => setViewMode("table"), className: segCtrlClass("table"), children: [
|
|
4273
|
+
/* @__PURE__ */ jsxs18("button", { onClick: () => setViewMode("table"), disabled: forcedCards, className: segCtrlClass("table"), children: [
|
|
4017
4274
|
/* @__PURE__ */ jsx21(FaTable, { size: 11 }),
|
|
4018
4275
|
"Table"
|
|
4019
4276
|
] }),
|
|
@@ -4022,50 +4279,34 @@ function ITDataTable({
|
|
|
4022
4279
|
"Cards"
|
|
4023
4280
|
] })
|
|
4024
4281
|
] }) }),
|
|
4025
|
-
/* @__PURE__ */ jsxs18("div", { className:
|
|
4282
|
+
/* @__PURE__ */ jsxs18("div", { className: scrollOuterClass, children: [
|
|
4026
4283
|
isLoading && /* @__PURE__ */ jsx21("div", { className: "absolute inset-0 z-20 flex items-center justify-center bg-white/40 backdrop-blur-[2px] transition-all duration-300", children: /* @__PURE__ */ jsx21("div", { className: "flex flex-col items-center gap-3 p-6 rounded-2xl shadow-xl border border-secondary-100 animate-in fade-in zoom-in duration-300", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: loadingIndicator || /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
4027
4284
|
/* @__PURE__ */ jsx21(FaSpinner, { className: "animate-spin text-primary-500 text-4xl" }),
|
|
4028
4285
|
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-sm font-semibold text-secondary-600 animate-pulse", children: "Cargando datos..." })
|
|
4029
4286
|
] }) }) }),
|
|
4030
|
-
|
|
4287
|
+
effectiveView === "cards" ? /* @__PURE__ */ jsx21("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: data.length > 0 ? data.map((row, i) => /* @__PURE__ */ jsx21(
|
|
4288
|
+
"div",
|
|
4289
|
+
{
|
|
4290
|
+
className: clsx21(tableCardHover, onRowClick && !isLoading && tableCardClickable),
|
|
4291
|
+
role: onRowClick && !isLoading ? "button" : void 0,
|
|
4292
|
+
tabIndex: onRowClick && !isLoading ? 0 : void 0,
|
|
4293
|
+
onClick: onRowClick && !isLoading ? handleRowClick(row) : void 0,
|
|
4294
|
+
onKeyDown: onRowClick && !isLoading ? handleRowKeyDown(row) : void 0,
|
|
4295
|
+
children: renderCard ? renderCard(row) : renderDefaultCard(row)
|
|
4296
|
+
},
|
|
4297
|
+
i
|
|
4298
|
+
)) : !isLoading && /* @__PURE__ */ jsxs18("div", { className: clsx21(tableEmptyContent, "py-12"), children: [
|
|
4031
4299
|
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
4032
4300
|
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
4033
|
-
] }) }) : /* @__PURE__ */
|
|
4034
|
-
"
|
|
4301
|
+
] }) }) : isTableVirtual ? /* @__PURE__ */ jsx21(
|
|
4302
|
+
"div",
|
|
4035
4303
|
{
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
isLoading ? "opacity-50" : "opacity-100",
|
|
4041
|
-
variantStyles[variant],
|
|
4042
|
-
sizeStyles[size],
|
|
4043
|
-
className
|
|
4044
|
-
),
|
|
4045
|
-
children: [
|
|
4046
|
-
/* @__PURE__ */ jsx21("thead", { children: /* @__PURE__ */ jsx21("tr", { className: clsx21(tableHeaderRow, "dark:text-slate-200"), children: columns.map((col) => /* @__PURE__ */ jsx21("th", { scope: "col", className: tableHeaderCell(col.className), children: /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 min-w-[150px]", children: [
|
|
4047
|
-
/* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between gap-2", children: [
|
|
4048
|
-
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
4049
|
-
col.sortable && col.type !== "actions" && /* @__PURE__ */ jsx21(
|
|
4050
|
-
"button",
|
|
4051
|
-
{
|
|
4052
|
-
onClick: () => handleSort(col.key),
|
|
4053
|
-
disabled: isLoading,
|
|
4054
|
-
className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"} disabled:opacity-50`,
|
|
4055
|
-
title: `Ordenar por ${col.label}`,
|
|
4056
|
-
children: /* @__PURE__ */ jsx21(MdOutlineSwapVert, { className: "w-4 h-4", "aria-hidden": "true" })
|
|
4057
|
-
}
|
|
4058
|
-
)
|
|
4059
|
-
] }),
|
|
4060
|
-
/* @__PURE__ */ jsx21("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
|
|
4061
|
-
] }) }, col.key)) }) }),
|
|
4062
|
-
/* @__PURE__ */ jsx21("tbody", { className: clsx21(tableBody, "dark:divide-slate-700/30"), children: data.length > 0 ? data.map((row, rowIndex) => /* @__PURE__ */ jsx21("tr", { className: clsx21(tableRow, variant === "striped" && "odd:bg-secondary-50/40 dark:odd:bg-slate-800/20"), children: columns.map((col) => /* @__PURE__ */ jsx21("td", { className: tableCell(col.className), children: col.type === "actions" ? /* @__PURE__ */ jsx21("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ jsx21("div", { className: tableCellText, children: renderCellContent(col, row) }) }, `${rowIndex}-${col.key}`)) }, rowIndex)) : /* @__PURE__ */ jsx21("tr", { children: /* @__PURE__ */ jsx21("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: !isLoading && /* @__PURE__ */ jsxs18("div", { className: tableEmptyContent, children: [
|
|
4063
|
-
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
4064
|
-
/* @__PURE__ */ jsx21(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
4065
|
-
] }) }) }) })
|
|
4066
|
-
]
|
|
4304
|
+
ref: scrollRef,
|
|
4305
|
+
className: "overflow-x-auto overflow-y-auto",
|
|
4306
|
+
style: { maxHeight: virtualizedMaxHeight },
|
|
4307
|
+
children: tableEl
|
|
4067
4308
|
}
|
|
4068
|
-
)
|
|
4309
|
+
) : tableEl
|
|
4069
4310
|
] })
|
|
4070
4311
|
] }),
|
|
4071
4312
|
/* @__PURE__ */ jsx21("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ jsx21(
|
|
@@ -4086,7 +4327,7 @@ function ITDataTable({
|
|
|
4086
4327
|
|
|
4087
4328
|
// src/components/molecules/date-picker/datePicker.tsx
|
|
4088
4329
|
import clsx22 from "clsx";
|
|
4089
|
-
import React5, { useEffect as useEffect8, useRef as
|
|
4330
|
+
import React5, { useEffect as useEffect8, useRef as useRef12, useState as useState18 } from "react";
|
|
4090
4331
|
import { createPortal as createPortal3 } from "react-dom";
|
|
4091
4332
|
import { FaCalendarAlt } from "react-icons/fa";
|
|
4092
4333
|
import { isBefore as isBefore2 } from "date-fns";
|
|
@@ -4110,11 +4351,11 @@ function ITDatePicker({
|
|
|
4110
4351
|
maxDate,
|
|
4111
4352
|
range = false
|
|
4112
4353
|
}) {
|
|
4113
|
-
const [isOpen, setIsOpen] =
|
|
4114
|
-
const [inputValue, setInputValue] =
|
|
4115
|
-
const [isValidDate, setIsValidDate] =
|
|
4116
|
-
const [internalRange, setInternalRange] =
|
|
4117
|
-
const wrapperRef =
|
|
4354
|
+
const [isOpen, setIsOpen] = useState18(false);
|
|
4355
|
+
const [inputValue, setInputValue] = useState18("");
|
|
4356
|
+
const [isValidDate, setIsValidDate] = useState18(true);
|
|
4357
|
+
const [internalRange, setInternalRange] = useState18([null, null]);
|
|
4358
|
+
const wrapperRef = useRef12(null);
|
|
4118
4359
|
const { panelRef, style: panelStyle } = useFloatingPanel(wrapperRef, isOpen, {
|
|
4119
4360
|
estimatedHeight: 360,
|
|
4120
4361
|
matchWidth: false
|
|
@@ -4339,7 +4580,7 @@ function ITDatePicker({
|
|
|
4339
4580
|
|
|
4340
4581
|
// src/components/organisms/dialog/dialog.tsx
|
|
4341
4582
|
import { createPortal as createPortal4 } from "react-dom";
|
|
4342
|
-
import { useEffect as useEffect9, useRef as
|
|
4583
|
+
import { useEffect as useEffect9, useRef as useRef13 } from "react";
|
|
4343
4584
|
import { FaRegTimesCircle } from "react-icons/fa";
|
|
4344
4585
|
|
|
4345
4586
|
// src/components/molecules/form-header/form-header.tsx
|
|
@@ -4476,7 +4717,7 @@ function ITDialog({
|
|
|
4476
4717
|
useFormHeader = false,
|
|
4477
4718
|
fullScreen = false
|
|
4478
4719
|
}) {
|
|
4479
|
-
const modalRef =
|
|
4720
|
+
const modalRef = useRef13(null);
|
|
4480
4721
|
useClickOutside_default(modalRef, onClose);
|
|
4481
4722
|
useEffect9(() => {
|
|
4482
4723
|
const handleEscape = (event) => {
|
|
@@ -4559,7 +4800,7 @@ function ITDivider({
|
|
|
4559
4800
|
// src/components/organisms/drawer/drawer.tsx
|
|
4560
4801
|
import clsx24 from "clsx";
|
|
4561
4802
|
import { FaTimes as FaTimes6 } from "react-icons/fa";
|
|
4562
|
-
import { useRef as
|
|
4803
|
+
import { useRef as useRef14 } from "react";
|
|
4563
4804
|
import { Fragment as Fragment6, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4564
4805
|
function ITDrawer({
|
|
4565
4806
|
isOpen,
|
|
@@ -4571,7 +4812,7 @@ function ITDrawer({
|
|
|
4571
4812
|
className,
|
|
4572
4813
|
style
|
|
4573
4814
|
}) {
|
|
4574
|
-
const panelRef =
|
|
4815
|
+
const panelRef = useRef14(null);
|
|
4575
4816
|
useClickOutside_default(panelRef, onClose);
|
|
4576
4817
|
return /* @__PURE__ */ jsx26(Fragment6, { children: isOpen && /* @__PURE__ */ jsxs22("div", { className: "fixed inset-0 z-[50] flex", children: [
|
|
4577
4818
|
/* @__PURE__ */ jsx26("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm transition-opacity" }),
|
|
@@ -4697,14 +4938,14 @@ function ITFlex({
|
|
|
4697
4938
|
import { useMemo as useMemo10 } from "react";
|
|
4698
4939
|
|
|
4699
4940
|
// src/components/organisms/form-builder/formBuilder.context.tsx
|
|
4700
|
-
import React6, { createContext as createContext2, useContext as useContext2, useState as
|
|
4941
|
+
import React6, { createContext as createContext2, useContext as useContext2, useState as useState19 } from "react";
|
|
4701
4942
|
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
4702
4943
|
var ITFormBuilderContext = createContext2(void 0);
|
|
4703
4944
|
var ITFormBuilderProvider = ({
|
|
4704
4945
|
children,
|
|
4705
4946
|
value
|
|
4706
4947
|
}) => {
|
|
4707
|
-
const [fieldRegistry, setFieldRegistry] =
|
|
4948
|
+
const [fieldRegistry, setFieldRegistry] = useState19({});
|
|
4708
4949
|
const registerField = React6.useCallback((name, config2) => {
|
|
4709
4950
|
setFieldRegistry((prev) => ({ ...prev, [name]: config2 }));
|
|
4710
4951
|
}, []);
|
|
@@ -4744,12 +4985,12 @@ var useITFormBuilderContext = () => {
|
|
|
4744
4985
|
};
|
|
4745
4986
|
|
|
4746
4987
|
// src/components/organisms/form-builder/fieldRenderer.tsx
|
|
4747
|
-
import { memo, useCallback as
|
|
4988
|
+
import { memo, useCallback as useCallback8, useEffect as useEffect12, useMemo as useMemo9, useState as useState22, useRef as useRef17 } from "react";
|
|
4748
4989
|
import clsx29 from "clsx";
|
|
4749
4990
|
|
|
4750
4991
|
// src/components/molecules/time-picker/timePicker.tsx
|
|
4751
4992
|
import clsx27 from "clsx";
|
|
4752
|
-
import { useEffect as useEffect10, useRef as
|
|
4993
|
+
import { useEffect as useEffect10, useRef as useRef15, useState as useState20 } from "react";
|
|
4753
4994
|
import { createPortal as createPortal5 } from "react-dom";
|
|
4754
4995
|
import { FaClock } from "react-icons/fa";
|
|
4755
4996
|
import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
@@ -4769,12 +5010,12 @@ function ITTimePicker({
|
|
|
4769
5010
|
variant = "primary",
|
|
4770
5011
|
color = "primary"
|
|
4771
5012
|
}) {
|
|
4772
|
-
const [isOpen, setIsOpen] =
|
|
4773
|
-
const [inputValue, setInputValue] =
|
|
4774
|
-
const [isValidTime, setIsValidTime] =
|
|
4775
|
-
const wrapperRef =
|
|
4776
|
-
const hoursRef =
|
|
4777
|
-
const minutesRef =
|
|
5013
|
+
const [isOpen, setIsOpen] = useState20(false);
|
|
5014
|
+
const [inputValue, setInputValue] = useState20(value || "");
|
|
5015
|
+
const [isValidTime, setIsValidTime] = useState20(true);
|
|
5016
|
+
const wrapperRef = useRef15(null);
|
|
5017
|
+
const hoursRef = useRef15(null);
|
|
5018
|
+
const minutesRef = useRef15(null);
|
|
4778
5019
|
const { panelRef: dropdownRef, style: panelStyle } = useFloatingPanel(
|
|
4779
5020
|
wrapperRef,
|
|
4780
5021
|
isOpen && !disabled,
|
|
@@ -5003,7 +5244,7 @@ function ITTimePicker({
|
|
|
5003
5244
|
}
|
|
5004
5245
|
|
|
5005
5246
|
// src/components/molecules/search-select/search-select.tsx
|
|
5006
|
-
import { useState as
|
|
5247
|
+
import { useState as useState21, useEffect as useEffect11, useRef as useRef16, useMemo as useMemo7 } from "react";
|
|
5007
5248
|
import { createPortal as createPortal6 } from "react-dom";
|
|
5008
5249
|
import clsx28 from "clsx";
|
|
5009
5250
|
import { FaSearch as FaSearch2, FaTimes as FaTimes7 } from "react-icons/fa";
|
|
@@ -5032,13 +5273,13 @@ function ITSearchSelect({
|
|
|
5032
5273
|
clearable = true,
|
|
5033
5274
|
onClear
|
|
5034
5275
|
}) {
|
|
5035
|
-
const [isOpen, setIsOpen] =
|
|
5036
|
-
const [searchTerm, setSearchTerm] =
|
|
5037
|
-
const [isFocused, setIsFocused] =
|
|
5038
|
-
const [localTouched, setLocalTouched] =
|
|
5039
|
-
const containerRef =
|
|
5040
|
-
const inputWrapperRef =
|
|
5041
|
-
const timeoutRef =
|
|
5276
|
+
const [isOpen, setIsOpen] = useState21(false);
|
|
5277
|
+
const [searchTerm, setSearchTerm] = useState21("");
|
|
5278
|
+
const [isFocused, setIsFocused] = useState21(false);
|
|
5279
|
+
const [localTouched, setLocalTouched] = useState21(false);
|
|
5280
|
+
const containerRef = useRef16(null);
|
|
5281
|
+
const inputWrapperRef = useRef16(null);
|
|
5282
|
+
const timeoutRef = useRef16(null);
|
|
5042
5283
|
const { panelRef, style: panelStyle } = useFloatingPanel(inputWrapperRef, isOpen, {
|
|
5043
5284
|
estimatedHeight: 260,
|
|
5044
5285
|
matchWidth: true
|
|
@@ -5266,9 +5507,9 @@ var useFieldRules = (config2, dependentValues) => {
|
|
|
5266
5507
|
import { FaSpinner as FaSpinner2 } from "react-icons/fa";
|
|
5267
5508
|
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5268
5509
|
function useAsyncOptions(options, deps) {
|
|
5269
|
-
const [resolved, setResolved] =
|
|
5270
|
-
const [loading, setLoading] =
|
|
5271
|
-
const optionsRef =
|
|
5510
|
+
const [resolved, setResolved] = useState22([]);
|
|
5511
|
+
const [loading, setLoading] = useState22(false);
|
|
5512
|
+
const optionsRef = useRef17(options);
|
|
5272
5513
|
optionsRef.current = options;
|
|
5273
5514
|
useEffect12(() => {
|
|
5274
5515
|
const opts = optionsRef.current;
|
|
@@ -5345,7 +5586,7 @@ var ITFieldRenderer = ({
|
|
|
5345
5586
|
options,
|
|
5346
5587
|
[options, dependentValues]
|
|
5347
5588
|
);
|
|
5348
|
-
const handleChangeWrapper =
|
|
5589
|
+
const handleChangeWrapper = useCallback8(
|
|
5349
5590
|
async (val) => {
|
|
5350
5591
|
const finalValue = val && typeof val === "object" && "target" in val ? val.target.value : val;
|
|
5351
5592
|
await context.setFieldValue(name, finalValue);
|
|
@@ -5807,7 +6048,7 @@ function ITGrid({
|
|
|
5807
6048
|
}
|
|
5808
6049
|
|
|
5809
6050
|
// src/components/atoms/image/image.tsx
|
|
5810
|
-
import { useState as
|
|
6051
|
+
import { useState as useState23 } from "react";
|
|
5811
6052
|
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
5812
6053
|
var ITImage = ({
|
|
5813
6054
|
src,
|
|
@@ -5815,7 +6056,7 @@ var ITImage = ({
|
|
|
5815
6056
|
className = "",
|
|
5816
6057
|
fallback = ""
|
|
5817
6058
|
}) => {
|
|
5818
|
-
const [imageError, setImageError] =
|
|
6059
|
+
const [imageError, setImageError] = useState23(false);
|
|
5819
6060
|
const handleImageError = () => {
|
|
5820
6061
|
setImageError(true);
|
|
5821
6062
|
};
|
|
@@ -5845,7 +6086,7 @@ var ITImage = ({
|
|
|
5845
6086
|
var image_default = ITImage;
|
|
5846
6087
|
|
|
5847
6088
|
// src/components/organisms/navbar/navbar.tsx
|
|
5848
|
-
import { useRef as
|
|
6089
|
+
import { useRef as useRef18, useState as useState24 } from "react";
|
|
5849
6090
|
import { FaChevronDown as FaChevronDown3, FaChevronRight as FaChevronRight4, FaUserCircle } from "react-icons/fa";
|
|
5850
6091
|
import { jsx as jsx36, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5851
6092
|
function ITNavbar({
|
|
@@ -5860,9 +6101,9 @@ function ITNavbar({
|
|
|
5860
6101
|
showSidebarOnMobile = false,
|
|
5861
6102
|
sidebarItems
|
|
5862
6103
|
}) {
|
|
5863
|
-
const [isUserMenuOpen, setIsUserMenuOpen] =
|
|
5864
|
-
const [expandedItems, setExpandedItems] =
|
|
5865
|
-
const userMenuRef =
|
|
6104
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = useState24(false);
|
|
6105
|
+
const [expandedItems, setExpandedItems] = useState24(/* @__PURE__ */ new Set());
|
|
6106
|
+
const userMenuRef = useRef18(null);
|
|
5866
6107
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
5867
6108
|
const toggleUserMenu = () => {
|
|
5868
6109
|
setIsUserMenuOpen(!isUserMenuOpen);
|
|
@@ -6301,11 +6542,13 @@ function ITPage(props) {
|
|
|
6301
6542
|
className,
|
|
6302
6543
|
children,
|
|
6303
6544
|
maxWidth = "7xl",
|
|
6304
|
-
noPadding = false
|
|
6545
|
+
noPadding = false,
|
|
6546
|
+
horizontalPadding = "px-4 sm:px-6 lg:px-8"
|
|
6305
6547
|
} = props;
|
|
6306
6548
|
const wrapperClass = clsx33(
|
|
6307
6549
|
"mx-auto w-full",
|
|
6308
|
-
!noPadding &&
|
|
6550
|
+
!noPadding && horizontalPadding,
|
|
6551
|
+
!noPadding && "py-6",
|
|
6309
6552
|
`max-w-${maxWidth}`,
|
|
6310
6553
|
"space-y-8",
|
|
6311
6554
|
className
|
|
@@ -6360,7 +6603,7 @@ function ITPage(props) {
|
|
|
6360
6603
|
}
|
|
6361
6604
|
|
|
6362
6605
|
// src/components/atoms/popover/popover.tsx
|
|
6363
|
-
import { useState as
|
|
6606
|
+
import { useState as useState25, useRef as useRef19 } from "react";
|
|
6364
6607
|
import clsx34 from "clsx";
|
|
6365
6608
|
import { jsx as jsx41, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
6366
6609
|
var positionClasses = {
|
|
@@ -6377,10 +6620,10 @@ function ITPopover({
|
|
|
6377
6620
|
onClose,
|
|
6378
6621
|
className
|
|
6379
6622
|
}) {
|
|
6380
|
-
const [internalOpen, setInternalOpen] =
|
|
6623
|
+
const [internalOpen, setInternalOpen] = useState25(false);
|
|
6381
6624
|
const isControlled = controlledOpen !== void 0;
|
|
6382
6625
|
const open = isControlled ? controlledOpen : internalOpen;
|
|
6383
|
-
const ref =
|
|
6626
|
+
const ref = useRef19(null);
|
|
6384
6627
|
useClickOutside_default(ref, () => {
|
|
6385
6628
|
if (isControlled) onClose?.();
|
|
6386
6629
|
else setInternalOpen(false);
|
|
@@ -6508,7 +6751,7 @@ function ITRadioGroup({
|
|
|
6508
6751
|
|
|
6509
6752
|
// src/components/organisms/searchTable/searchTable.tsx
|
|
6510
6753
|
import clsx38 from "clsx";
|
|
6511
|
-
import { useState as
|
|
6754
|
+
import { useState as useState26 } from "react";
|
|
6512
6755
|
|
|
6513
6756
|
// src/components/organisms/searchTable/components/SearchInput.tsx
|
|
6514
6757
|
import { FaSearch as FaSearch3 } from "react-icons/fa";
|
|
@@ -7001,7 +7244,7 @@ function ITSearchTable({
|
|
|
7001
7244
|
onSave,
|
|
7002
7245
|
onCancel
|
|
7003
7246
|
}) {
|
|
7004
|
-
const [itemsPerPage, setItemsPerPage] =
|
|
7247
|
+
const [itemsPerPage, setItemsPerPage] = useState26(defaultItemsPerPage);
|
|
7005
7248
|
const { searchTerm, handleSearchChange, handleClearSearch } = useDebouncedSearch({
|
|
7006
7249
|
initialValue: searchTermInitial,
|
|
7007
7250
|
onSearch: (value) => {
|
|
@@ -7164,7 +7407,7 @@ function ITSegmentedControl({
|
|
|
7164
7407
|
}
|
|
7165
7408
|
|
|
7166
7409
|
// src/components/organisms/sidebar/sidebar.tsx
|
|
7167
|
-
import { useEffect as useEffect13, useRef as
|
|
7410
|
+
import { useEffect as useEffect13, useRef as useRef20, useState as useState27 } from "react";
|
|
7168
7411
|
import { FaChevronDown as FaChevronDown4 } from "react-icons/fa";
|
|
7169
7412
|
import { jsx as jsx55, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
7170
7413
|
function ITSidebar({
|
|
@@ -7174,13 +7417,14 @@ function ITSidebar({
|
|
|
7174
7417
|
visibleOnMobile = false,
|
|
7175
7418
|
onItemClick,
|
|
7176
7419
|
onSubItemClick,
|
|
7177
|
-
subitemConnector = "dot"
|
|
7420
|
+
subitemConnector = "dot",
|
|
7421
|
+
header
|
|
7178
7422
|
}) {
|
|
7179
|
-
const [expandedItems, setExpandedItems] =
|
|
7180
|
-
const [isHovering, setIsHovering] =
|
|
7181
|
-
const sidebarRef =
|
|
7182
|
-
const hoverTimeoutRef =
|
|
7183
|
-
const leaveTimeoutRef =
|
|
7423
|
+
const [expandedItems, setExpandedItems] = useState27(/* @__PURE__ */ new Set());
|
|
7424
|
+
const [isHovering, setIsHovering] = useState27(false);
|
|
7425
|
+
const sidebarRef = useRef20(null);
|
|
7426
|
+
const hoverTimeoutRef = useRef20(null);
|
|
7427
|
+
const leaveTimeoutRef = useRef20(null);
|
|
7184
7428
|
useEffect13(() => {
|
|
7185
7429
|
const hoverTimer = hoverTimeoutRef.current;
|
|
7186
7430
|
const leaveTimer = leaveTimeoutRef.current;
|
|
@@ -7245,7 +7489,7 @@ function ITSidebar({
|
|
|
7245
7489
|
};
|
|
7246
7490
|
const isSidebarCollapsed = visibleOnMobile ? false : !isHovering && isCollapsed;
|
|
7247
7491
|
const sidebarWidth = isSidebarCollapsed ? "w-[88px]" : "w-[280px]";
|
|
7248
|
-
return /* @__PURE__ */
|
|
7492
|
+
return /* @__PURE__ */ jsxs43(
|
|
7249
7493
|
"aside",
|
|
7250
7494
|
{
|
|
7251
7495
|
ref: sidebarRef,
|
|
@@ -7264,196 +7508,215 @@ function ITSidebar({
|
|
|
7264
7508
|
WebkitBackdropFilter: "blur(12px)",
|
|
7265
7509
|
backdropFilter: "blur(12px)"
|
|
7266
7510
|
},
|
|
7267
|
-
children:
|
|
7268
|
-
/* @__PURE__ */
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7511
|
+
children: [
|
|
7512
|
+
header && !isSidebarCollapsed && /* @__PURE__ */ jsx55("div", { className: "px-4 pt-4 pb-1 flex-shrink-0", children: header }),
|
|
7513
|
+
/* @__PURE__ */ jsx55("nav", { "aria-label": "Componentes de la librer\xEDa", className: "flex-1 py-4 overflow-y-auto overflow-x-hidden custom-scrollbar px-4", children: /* @__PURE__ */ jsx55("ul", { className: "space-y-1", children: navigationItems.map((item) => {
|
|
7514
|
+
const hasSubmenu = !!item.subitems && item.subitems.length > 0;
|
|
7515
|
+
const submenuId = `it-sidebar-submenu-${item.id}`;
|
|
7516
|
+
return /* @__PURE__ */ jsxs43("li", { className: "relative group/navitem", children: [
|
|
7517
|
+
/* @__PURE__ */ jsxs43(
|
|
7518
|
+
"div",
|
|
7519
|
+
{
|
|
7520
|
+
role: "button",
|
|
7521
|
+
tabIndex: 0,
|
|
7522
|
+
"aria-label": item.label,
|
|
7523
|
+
"aria-expanded": hasSubmenu ? expandedItems.has(item.id) : void 0,
|
|
7524
|
+
"aria-controls": hasSubmenu ? submenuId : void 0,
|
|
7525
|
+
className: `flex items-center cursor-pointer
|
|
7272
7526
|
transition-all duration-300 ease-[cubic-bezier(0.2,0,0,1)]
|
|
7273
7527
|
rounded-xl relative overflow-visible
|
|
7274
7528
|
${isSidebarCollapsed ? "justify-center p-2 mb-1" : "justify-between px-3 py-2 mb-0.5"}
|
|
7275
7529
|
`,
|
|
7276
|
-
style: {
|
|
7277
|
-
backgroundColor: item.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7278
|
-
boxShadow: item.isActive ? "var(--shadow-xs)" : "none",
|
|
7279
|
-
border: item.isActive ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7280
|
-
},
|
|
7281
|
-
onMouseEnter: (e) => {
|
|
7282
|
-
if (!item.isActive) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
7283
|
-
},
|
|
7284
|
-
onMouseLeave: (e) => {
|
|
7285
|
-
if (!item.isActive) e.currentTarget.style.backgroundColor = "transparent";
|
|
7286
|
-
},
|
|
7287
|
-
onClick: () => handleItemClick(item),
|
|
7288
|
-
children: [
|
|
7289
|
-
item.isActive && !isSidebarCollapsed && /* @__PURE__ */ jsx55(
|
|
7290
|
-
"div",
|
|
7291
|
-
{
|
|
7292
|
-
className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
|
|
7293
|
-
style: { backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))", boxShadow: "0 0 10px var(--it-sidebar-active-icon, var(--color-primary-500))" }
|
|
7294
|
-
}
|
|
7295
|
-
),
|
|
7296
|
-
/* @__PURE__ */ jsxs43("div", { className: `flex items-center ${!isSidebarCollapsed ? "gap-2.5" : "justify-center"} relative z-10 w-full`, children: [
|
|
7297
|
-
item.icon && /* @__PURE__ */ jsx55(
|
|
7298
|
-
"div",
|
|
7299
|
-
{
|
|
7300
|
-
className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
|
|
7301
|
-
style: {
|
|
7302
|
-
color: item.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
|
|
7303
|
-
opacity: item.isActive ? 1 : 0.8,
|
|
7304
|
-
fontSize: item.isActive ? "1.12rem" : "1.05rem",
|
|
7305
|
-
filter: item.isActive ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
7306
|
-
},
|
|
7307
|
-
children: item.icon
|
|
7308
|
-
}
|
|
7309
|
-
),
|
|
7310
|
-
!isSidebarCollapsed && /* @__PURE__ */ jsx55(
|
|
7311
|
-
ITText,
|
|
7312
|
-
{
|
|
7313
|
-
as: "span",
|
|
7314
|
-
className: `transition-all duration-300 truncate tracking-wide`,
|
|
7315
|
-
style: {
|
|
7316
|
-
color: item.isActive ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
7317
|
-
fontSize: "0.8rem",
|
|
7318
|
-
fontWeight: item.isActive ? "600" : "500"
|
|
7319
|
-
},
|
|
7320
|
-
children: item.label
|
|
7321
|
-
}
|
|
7322
|
-
)
|
|
7323
|
-
] }),
|
|
7324
|
-
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ jsx55(
|
|
7325
|
-
"div",
|
|
7326
|
-
{
|
|
7327
|
-
className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
|
|
7328
|
-
style: { color: item.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-icon-color, var(--color-secondary-500))", opacity: 0.7 },
|
|
7329
|
-
children: /* @__PURE__ */ jsx55(FaChevronDown4, { className: "w-3 h-3" })
|
|
7330
|
-
}
|
|
7331
|
-
),
|
|
7332
|
-
item.badge && /* @__PURE__ */ jsx55(
|
|
7333
|
-
"span",
|
|
7334
|
-
{
|
|
7335
|
-
className: `
|
|
7336
|
-
absolute flex items-center justify-center font-bold shadow-md
|
|
7337
|
-
${isSidebarCollapsed ? "top-1 right-1 w-2.5 h-2.5 rounded-full ring-2 ring-white" : "right-3 top-1/2 transform -translate-y-1/2 px-1.5 py-0 text-[9px] rounded-full backdrop-blur-sm"}
|
|
7338
|
-
`,
|
|
7339
|
-
style: {
|
|
7340
|
-
backgroundColor: "var(--it-sidebar-badge-bg, var(--color-primary-500))",
|
|
7341
|
-
color: "var(--it-sidebar-badge-color, #ffffff)",
|
|
7342
|
-
boxShadow: isSidebarCollapsed ? "0 0 0 2px var(--it-sidebar-bg, var(--color-secondary-900))" : "none"
|
|
7343
|
-
},
|
|
7344
|
-
children: isSidebarCollapsed ? "" : item.badge
|
|
7345
|
-
}
|
|
7346
|
-
)
|
|
7347
|
-
]
|
|
7348
|
-
}
|
|
7349
|
-
),
|
|
7350
|
-
isSidebarCollapsed && /* @__PURE__ */ jsxs43(
|
|
7351
|
-
"div",
|
|
7352
|
-
{
|
|
7353
|
-
className: "absolute left-full top-0 ml-4 rounded-2xl opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-all duration-300 pointer-events-none z-[70] min-w-[220px] overflow-hidden -translate-x-2 group-hover/navitem:translate-x-0 shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)]",
|
|
7354
|
-
style: {
|
|
7355
|
-
backgroundColor: "var(--it-sidebar-bg, #ffffff)",
|
|
7356
|
-
border: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
7357
|
-
WebkitBackdropFilter: "blur(16px)",
|
|
7358
|
-
backdropFilter: "blur(16px)"
|
|
7359
|
-
},
|
|
7360
|
-
children: [
|
|
7361
|
-
/* @__PURE__ */ jsxs43("div", { className: "px-5 py-4 flex items-center gap-3 font-semibold border-b", style: { borderColor: "var(--it-sidebar-border, var(--color-secondary-200))", color: "var(--it-sidebar-active-color, var(--color-secondary-900))" }, children: [
|
|
7362
|
-
item.icon && /* @__PURE__ */ jsx55("span", { style: { color: "var(--it-sidebar-active-icon, var(--color-primary-500))" }, className: "text-xl drop-shadow-sm", children: item.icon }),
|
|
7363
|
-
/* @__PURE__ */ jsx55(ITText, { as: "span", className: "tracking-wide text-[15px]", children: item.label })
|
|
7364
|
-
] }),
|
|
7365
|
-
item.subitems && item.subitems.length > 0 ? /* @__PURE__ */ jsx55("div", { className: "py-2", children: item.subitems.map((subitem) => /* @__PURE__ */ jsxs43(
|
|
7366
|
-
"div",
|
|
7367
|
-
{
|
|
7368
|
-
className: `px-5 py-2.5 text-sm flex items-center gap-3 transition-colors relative`,
|
|
7369
|
-
children: [
|
|
7370
|
-
subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ jsx55(
|
|
7371
|
-
"div",
|
|
7372
|
-
{
|
|
7373
|
-
className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full",
|
|
7374
|
-
style: {
|
|
7375
|
-
backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
|
|
7376
|
-
boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
|
|
7377
|
-
}
|
|
7378
|
-
}
|
|
7379
|
-
),
|
|
7380
|
-
/* @__PURE__ */ jsx55("span", { className: `w-1.5 h-1.5 rounded-full transition-all ${subitem.isActive ? "scale-125" : ""}`, style: { backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))" } }),
|
|
7381
|
-
/* @__PURE__ */ jsx55(ITText, { as: "span", style: { color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))", fontWeight: subitem.isActive ? 600 : 500 }, children: subitem.label })
|
|
7382
|
-
]
|
|
7383
|
-
},
|
|
7384
|
-
subitem.id
|
|
7385
|
-
)) }) : /* @__PURE__ */ jsx55(ITText, { as: "div", className: "px-5 py-3 text-sm italic", style: { color: "var(--it-sidebar-label-color, var(--color-secondary-400))" }, children: "No hay submen\xFA" })
|
|
7386
|
-
]
|
|
7387
|
-
}
|
|
7388
|
-
),
|
|
7389
|
-
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ jsx55("div", { className: `overflow-hidden transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "max-h-[500px] opacity-100 mt-1" : "max-h-0 opacity-0"}`, children: /* @__PURE__ */ jsx55(
|
|
7390
|
-
"ul",
|
|
7391
|
-
{
|
|
7392
|
-
className: "ml-4 flex flex-col gap-0 py-0.5",
|
|
7393
|
-
style: {
|
|
7394
|
-
borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
|
|
7395
|
-
},
|
|
7396
|
-
children: item.subitems.map((subitem) => /* @__PURE__ */ jsx55("li", { className: "relative", children: /* @__PURE__ */ jsxs43(
|
|
7397
|
-
"button",
|
|
7398
|
-
{
|
|
7399
|
-
onClick: () => {
|
|
7400
|
-
if (subitem.action) subitem.action();
|
|
7401
|
-
if (onSubItemClick) onSubItemClick(subitem);
|
|
7402
|
-
},
|
|
7403
|
-
className: `flex items-center gap-2 w-full text-left px-3 py-1.5 rounded-xl transition-all duration-300`,
|
|
7404
7530
|
style: {
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
|
|
7408
|
-
fontWeight: subitem.isActive ? 600 : 500,
|
|
7409
|
-
letterSpacing: "0.01em",
|
|
7410
|
-
marginLeft: subitemConnector === "|" ? "-1px" : "0"
|
|
7531
|
+
backgroundColor: item.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7532
|
+
boxShadow: item.isActive ? "var(--shadow-xs)" : "none",
|
|
7533
|
+
border: item.isActive ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "1px solid transparent"
|
|
7411
7534
|
},
|
|
7412
7535
|
onMouseEnter: (e) => {
|
|
7413
|
-
if (!
|
|
7414
|
-
e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
7415
|
-
e.currentTarget.style.transform = "translateX(3px)";
|
|
7416
|
-
}
|
|
7536
|
+
if (!item.isActive) e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
7417
7537
|
},
|
|
7418
7538
|
onMouseLeave: (e) => {
|
|
7419
|
-
if (!
|
|
7420
|
-
|
|
7421
|
-
|
|
7539
|
+
if (!item.isActive) e.currentTarget.style.backgroundColor = "transparent";
|
|
7540
|
+
},
|
|
7541
|
+
onClick: () => handleItemClick(item),
|
|
7542
|
+
onKeyDown: (e) => {
|
|
7543
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
7544
|
+
e.preventDefault();
|
|
7545
|
+
handleItemClick(item);
|
|
7422
7546
|
}
|
|
7423
7547
|
},
|
|
7424
7548
|
children: [
|
|
7425
|
-
|
|
7549
|
+
item.isActive && !isSidebarCollapsed && /* @__PURE__ */ jsx55(
|
|
7426
7550
|
"div",
|
|
7427
7551
|
{
|
|
7428
|
-
className: "absolute left-0 top-1/
|
|
7429
|
-
style: {
|
|
7430
|
-
|
|
7431
|
-
|
|
7552
|
+
className: "absolute left-0 top-1/4 bottom-1/4 w-[3px] rounded-r-full transition-all",
|
|
7553
|
+
style: { backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))", boxShadow: "0 0 10px var(--it-sidebar-active-icon, var(--color-primary-500))" }
|
|
7554
|
+
}
|
|
7555
|
+
),
|
|
7556
|
+
/* @__PURE__ */ jsxs43("div", { className: `flex items-center ${!isSidebarCollapsed ? "gap-2.5" : "justify-center"} relative z-10 w-full`, children: [
|
|
7557
|
+
item.icon && /* @__PURE__ */ jsx55(
|
|
7558
|
+
"div",
|
|
7559
|
+
{
|
|
7560
|
+
className: `transition-all duration-300 flex-shrink-0 flex items-center justify-center`,
|
|
7561
|
+
style: {
|
|
7562
|
+
color: item.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, #9ca3af)",
|
|
7563
|
+
opacity: item.isActive ? 1 : 0.8,
|
|
7564
|
+
fontSize: item.isActive ? "1.12rem" : "1.05rem",
|
|
7565
|
+
filter: item.isActive ? "drop-shadow(0 0 8px rgba(255,255,255,0.2))" : "none"
|
|
7566
|
+
},
|
|
7567
|
+
children: item.icon
|
|
7568
|
+
}
|
|
7569
|
+
),
|
|
7570
|
+
!isSidebarCollapsed && /* @__PURE__ */ jsx55(
|
|
7571
|
+
ITText,
|
|
7572
|
+
{
|
|
7573
|
+
as: "span",
|
|
7574
|
+
className: `transition-all duration-300 truncate tracking-wide`,
|
|
7575
|
+
style: {
|
|
7576
|
+
color: item.isActive ? "var(--it-sidebar-active-color, #ffffff)" : "var(--it-sidebar-label-color, var(--color-secondary-300))",
|
|
7577
|
+
fontSize: "0.8rem",
|
|
7578
|
+
fontWeight: item.isActive ? "600" : "500"
|
|
7579
|
+
},
|
|
7580
|
+
children: item.label
|
|
7432
7581
|
}
|
|
7582
|
+
)
|
|
7583
|
+
] }),
|
|
7584
|
+
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ jsx55(
|
|
7585
|
+
"div",
|
|
7586
|
+
{
|
|
7587
|
+
className: `flex-shrink-0 transition-transform duration-300 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "rotate-180" : ""}`,
|
|
7588
|
+
style: { color: item.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-icon-color, var(--color-secondary-500))", opacity: 0.7 },
|
|
7589
|
+
children: /* @__PURE__ */ jsx55(FaChevronDown4, { className: "w-3 h-3" })
|
|
7433
7590
|
}
|
|
7434
7591
|
),
|
|
7435
|
-
|
|
7592
|
+
item.badge && /* @__PURE__ */ jsx55(
|
|
7436
7593
|
"span",
|
|
7437
7594
|
{
|
|
7438
|
-
className: `
|
|
7595
|
+
className: `
|
|
7596
|
+
absolute flex items-center justify-center font-bold shadow-md
|
|
7597
|
+
${isSidebarCollapsed ? "top-1 right-1 w-2.5 h-2.5 rounded-full ring-2 ring-white" : "right-3 top-1/2 transform -translate-y-1/2 px-1.5 py-0 text-[9px] rounded-full backdrop-blur-sm"}
|
|
7598
|
+
`,
|
|
7439
7599
|
style: {
|
|
7440
|
-
backgroundColor:
|
|
7441
|
-
|
|
7600
|
+
backgroundColor: "var(--it-sidebar-badge-bg, var(--color-primary-500))",
|
|
7601
|
+
color: "var(--it-sidebar-badge-color, #ffffff)",
|
|
7602
|
+
boxShadow: isSidebarCollapsed ? "0 0 0 2px var(--it-sidebar-bg, var(--color-secondary-900))" : "none"
|
|
7603
|
+
},
|
|
7604
|
+
children: isSidebarCollapsed ? "" : item.badge
|
|
7442
7605
|
}
|
|
7443
|
-
)
|
|
7444
|
-
/* @__PURE__ */ jsx55(ITText, { as: "span", className: "truncate", children: subitem.label })
|
|
7606
|
+
)
|
|
7445
7607
|
]
|
|
7446
7608
|
}
|
|
7447
|
-
)
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7609
|
+
),
|
|
7610
|
+
isSidebarCollapsed && /* @__PURE__ */ jsxs43(
|
|
7611
|
+
"div",
|
|
7612
|
+
{
|
|
7613
|
+
className: "absolute left-full top-0 ml-4 rounded-2xl opacity-0 invisible group-hover/navitem:opacity-100 group-hover/navitem:visible transition-all duration-300 pointer-events-none z-[70] min-w-[220px] overflow-hidden -translate-x-2 group-hover/navitem:translate-x-0 shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)]",
|
|
7614
|
+
style: {
|
|
7615
|
+
backgroundColor: "var(--it-sidebar-bg, #ffffff)",
|
|
7616
|
+
border: "1px solid var(--it-sidebar-border, var(--color-secondary-200))",
|
|
7617
|
+
WebkitBackdropFilter: "blur(16px)",
|
|
7618
|
+
backdropFilter: "blur(16px)"
|
|
7619
|
+
},
|
|
7620
|
+
children: [
|
|
7621
|
+
/* @__PURE__ */ jsxs43("div", { className: "px-5 py-4 flex items-center gap-3 font-semibold border-b", style: { borderColor: "var(--it-sidebar-border, var(--color-secondary-200))", color: "var(--it-sidebar-active-color, var(--color-secondary-900))" }, children: [
|
|
7622
|
+
item.icon && /* @__PURE__ */ jsx55("span", { style: { color: "var(--it-sidebar-active-icon, var(--color-primary-500))" }, className: "text-xl drop-shadow-sm", children: item.icon }),
|
|
7623
|
+
/* @__PURE__ */ jsx55(ITText, { as: "span", className: "tracking-wide text-[15px]", children: item.label })
|
|
7624
|
+
] }),
|
|
7625
|
+
item.subitems && item.subitems.length > 0 ? /* @__PURE__ */ jsx55("div", { className: "py-2", children: item.subitems.map((subitem) => /* @__PURE__ */ jsxs43(
|
|
7626
|
+
"div",
|
|
7627
|
+
{
|
|
7628
|
+
className: `px-5 py-2.5 text-sm flex items-center gap-3 transition-colors relative`,
|
|
7629
|
+
children: [
|
|
7630
|
+
subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ jsx55(
|
|
7631
|
+
"div",
|
|
7632
|
+
{
|
|
7633
|
+
className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full",
|
|
7634
|
+
style: {
|
|
7635
|
+
backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
|
|
7636
|
+
boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
|
|
7637
|
+
}
|
|
7638
|
+
}
|
|
7639
|
+
),
|
|
7640
|
+
/* @__PURE__ */ jsx55("span", { className: `w-1.5 h-1.5 rounded-full transition-all ${subitem.isActive ? "scale-125" : ""}`, style: { backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))" } }),
|
|
7641
|
+
/* @__PURE__ */ jsx55(ITText, { as: "span", style: { color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))", fontWeight: subitem.isActive ? 600 : 500 }, children: subitem.label })
|
|
7642
|
+
]
|
|
7643
|
+
},
|
|
7644
|
+
subitem.id
|
|
7645
|
+
)) }) : /* @__PURE__ */ jsx55(ITText, { as: "div", className: "px-5 py-3 text-sm italic", style: { color: "var(--it-sidebar-label-color, var(--color-secondary-400))" }, children: "No hay submen\xFA" })
|
|
7646
|
+
]
|
|
7647
|
+
}
|
|
7648
|
+
),
|
|
7649
|
+
!isSidebarCollapsed && item.subitems && item.subitems.length > 0 && /* @__PURE__ */ jsx55("div", { id: submenuId, role: "group", "aria-label": item.label, className: `overflow-hidden transition-all duration-400 ease-[cubic-bezier(0.2,0,0,1)] ${expandedItems.has(item.id) ? "max-h-[500px] opacity-100 mt-1" : "max-h-0 opacity-0"}`, children: /* @__PURE__ */ jsx55(
|
|
7650
|
+
"ul",
|
|
7651
|
+
{
|
|
7652
|
+
className: "ml-4 flex flex-col gap-0 py-0.5",
|
|
7653
|
+
style: {
|
|
7654
|
+
borderLeft: subitemConnector === "|" ? "1px solid var(--it-sidebar-border, var(--color-secondary-200))" : "none"
|
|
7655
|
+
},
|
|
7656
|
+
children: item.subitems.map((subitem) => /* @__PURE__ */ jsx55("li", { className: "relative", children: /* @__PURE__ */ jsxs43(
|
|
7657
|
+
"button",
|
|
7658
|
+
{
|
|
7659
|
+
"aria-current": subitem.isActive ? "page" : void 0,
|
|
7660
|
+
onClick: () => {
|
|
7661
|
+
if (subitem.action) subitem.action();
|
|
7662
|
+
if (onSubItemClick) onSubItemClick(subitem);
|
|
7663
|
+
},
|
|
7664
|
+
className: `flex items-center gap-2 w-full text-left px-3 py-1.5 rounded-xl transition-all duration-300`,
|
|
7665
|
+
style: {
|
|
7666
|
+
color: subitem.isActive ? "var(--it-sidebar-active-color, var(--color-secondary-900))" : "var(--it-sidebar-label-color, var(--color-secondary-600))",
|
|
7667
|
+
backgroundColor: subitem.isActive ? "var(--it-sidebar-active-bg, var(--color-secondary-50))" : "transparent",
|
|
7668
|
+
fontSize: "0.78rem",
|
|
7669
|
+
fontWeight: subitem.isActive ? 600 : 500,
|
|
7670
|
+
letterSpacing: "0.01em",
|
|
7671
|
+
marginLeft: subitemConnector === "|" ? "-1px" : "0"
|
|
7672
|
+
},
|
|
7673
|
+
onMouseEnter: (e) => {
|
|
7674
|
+
if (!subitem.isActive) {
|
|
7675
|
+
e.currentTarget.style.backgroundColor = "var(--it-sidebar-hover-bg, var(--color-secondary-100))";
|
|
7676
|
+
e.currentTarget.style.transform = "translateX(3px)";
|
|
7677
|
+
}
|
|
7678
|
+
},
|
|
7679
|
+
onMouseLeave: (e) => {
|
|
7680
|
+
if (!subitem.isActive) {
|
|
7681
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
7682
|
+
e.currentTarget.style.transform = "translateX(0)";
|
|
7683
|
+
}
|
|
7684
|
+
},
|
|
7685
|
+
children: [
|
|
7686
|
+
subitem.isActive && subitemConnector === "|" && /* @__PURE__ */ jsx55(
|
|
7687
|
+
"div",
|
|
7688
|
+
{
|
|
7689
|
+
className: "absolute left-0 top-1/3 bottom-1/3 w-[2.5px] rounded-r-full transition-all",
|
|
7690
|
+
style: {
|
|
7691
|
+
backgroundColor: "var(--it-sidebar-active-icon, var(--color-primary-500))",
|
|
7692
|
+
boxShadow: "0 0 6px color-mix(in srgb, var(--it-sidebar-active-icon, var(--color-primary-500)) 25%, transparent)"
|
|
7693
|
+
}
|
|
7694
|
+
}
|
|
7695
|
+
),
|
|
7696
|
+
subitemConnector === "dot" && /* @__PURE__ */ jsx55(
|
|
7697
|
+
"span",
|
|
7698
|
+
{
|
|
7699
|
+
className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-300 ${subitem.isActive ? "scale-125" : ""}`,
|
|
7700
|
+
style: {
|
|
7701
|
+
backgroundColor: subitem.isActive ? "var(--it-sidebar-active-icon, var(--color-primary-500))" : "var(--it-sidebar-icon-color, var(--color-secondary-400))"
|
|
7702
|
+
}
|
|
7703
|
+
}
|
|
7704
|
+
),
|
|
7705
|
+
/* @__PURE__ */ jsx55(ITText, { as: "span", className: "truncate", children: subitem.label })
|
|
7706
|
+
]
|
|
7707
|
+
}
|
|
7708
|
+
) }, subitem.id))
|
|
7709
|
+
}
|
|
7710
|
+
) })
|
|
7711
|
+
] }, item.id);
|
|
7712
|
+
}) }) })
|
|
7713
|
+
]
|
|
7451
7714
|
}
|
|
7452
7715
|
);
|
|
7453
7716
|
}
|
|
7454
7717
|
|
|
7455
7718
|
// src/components/atoms/slide/slide.tsx
|
|
7456
|
-
import { useState as
|
|
7719
|
+
import { useState as useState28, useEffect as useEffect14 } from "react";
|
|
7457
7720
|
import clsx40 from "clsx";
|
|
7458
7721
|
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
7459
7722
|
function ITSlideToggle({
|
|
@@ -7468,7 +7731,7 @@ function ITSlideToggle({
|
|
|
7468
7731
|
className = ""
|
|
7469
7732
|
}) {
|
|
7470
7733
|
const isControlled = controlledIsOn !== void 0;
|
|
7471
|
-
const [internalIsOn, setInternalIsOn] =
|
|
7734
|
+
const [internalIsOn, setInternalIsOn] = useState28(initialState);
|
|
7472
7735
|
useEffect14(() => {
|
|
7473
7736
|
if (isControlled) {
|
|
7474
7737
|
setInternalIsOn(controlledIsOn);
|
|
@@ -7633,7 +7896,7 @@ function ITStatCard({
|
|
|
7633
7896
|
|
|
7634
7897
|
// src/components/molecules/table/table.tsx
|
|
7635
7898
|
import clsx43 from "clsx";
|
|
7636
|
-
import React11, { useState as
|
|
7899
|
+
import React11, { useState as useState29 } from "react";
|
|
7637
7900
|
import {
|
|
7638
7901
|
FaCheck as FaCheck4,
|
|
7639
7902
|
FaSpinner as FaSpinner3,
|
|
@@ -7642,7 +7905,7 @@ import {
|
|
|
7642
7905
|
FaThLarge as FaThLarge2
|
|
7643
7906
|
} from "react-icons/fa";
|
|
7644
7907
|
import { MdOutlineSwapVert as MdOutlineSwapVert2 } from "react-icons/md";
|
|
7645
|
-
import { jsx as jsx59, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7908
|
+
import { Fragment as Fragment9, jsx as jsx59, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7646
7909
|
function ITTable({
|
|
7647
7910
|
columns,
|
|
7648
7911
|
data = [],
|
|
@@ -7655,9 +7918,24 @@ function ITTable({
|
|
|
7655
7918
|
renderCard,
|
|
7656
7919
|
defaultView = "table",
|
|
7657
7920
|
showVerticalBorder = true,
|
|
7658
|
-
verticalBorderClassname
|
|
7921
|
+
verticalBorderClassname,
|
|
7922
|
+
onRowClick,
|
|
7923
|
+
layout = "auto",
|
|
7924
|
+
density = "normal",
|
|
7925
|
+
autoCardBreakpoint = 0,
|
|
7926
|
+
virtualized = false,
|
|
7927
|
+
virtualizedMaxHeight = 400,
|
|
7928
|
+
rowHeight,
|
|
7929
|
+
overscan = 5,
|
|
7930
|
+
stickyHeader = false
|
|
7659
7931
|
}) {
|
|
7660
|
-
const [viewMode, setViewMode] =
|
|
7932
|
+
const [viewMode, setViewMode] = useState29(defaultView);
|
|
7933
|
+
const { ref: rootRef, width: containerWidth } = useElementSize();
|
|
7934
|
+
const isFixed = layout === "fixed";
|
|
7935
|
+
const forcedCards = autoCardBreakpoint > 0 && containerWidth > 0 && containerWidth < autoCardBreakpoint;
|
|
7936
|
+
const effectiveView = forcedCards ? "cards" : viewMode;
|
|
7937
|
+
const hasColumnWidths = columns.some((col) => col.width != null);
|
|
7938
|
+
const tableLayoutClass = isFixed ? "w-full text-sm text-left text-secondary-600" : "min-w-max w-full text-sm text-left text-secondary-600";
|
|
7661
7939
|
const {
|
|
7662
7940
|
currentPage,
|
|
7663
7941
|
itemsPerPage,
|
|
@@ -7737,6 +8015,24 @@ function ITTable({
|
|
|
7737
8015
|
(currentPage - 1) * itemsPerPage,
|
|
7738
8016
|
currentPage * itemsPerPage
|
|
7739
8017
|
);
|
|
8018
|
+
const isTableVirtual = virtualized && effectiveView === "table";
|
|
8019
|
+
const isStickyHeader = stickyHeader && isTableVirtual;
|
|
8020
|
+
const resolvedRowHeight = rowHeight ?? getRowHeight(size, density);
|
|
8021
|
+
const columnCount = columns.length;
|
|
8022
|
+
const {
|
|
8023
|
+
scrollRef,
|
|
8024
|
+
startIndex,
|
|
8025
|
+
endIndex,
|
|
8026
|
+
topSpacerHeight,
|
|
8027
|
+
bottomSpacerHeight
|
|
8028
|
+
} = useVirtualRows({
|
|
8029
|
+
count: currentData.length,
|
|
8030
|
+
rowHeight: resolvedRowHeight,
|
|
8031
|
+
overscan,
|
|
8032
|
+
enabled: isTableVirtual,
|
|
8033
|
+
resetKey: `${currentPage}-${itemsPerPage}`
|
|
8034
|
+
});
|
|
8035
|
+
const windowData = isTableVirtual ? currentData.slice(startIndex, endIndex + 1) : currentData;
|
|
7740
8036
|
const renderFilterInput = (col) => {
|
|
7741
8037
|
if (!col.filter) return null;
|
|
7742
8038
|
if (col.type === "boolean") {
|
|
@@ -7868,7 +8164,18 @@ function ITTable({
|
|
|
7868
8164
|
actionCol?.actions && /* @__PURE__ */ jsx59("div", { className: "flex items-center justify-end gap-2 pt-2 border-t border-slate-100 dark:border-slate-700", children: actionCol.actions(row) })
|
|
7869
8165
|
] });
|
|
7870
8166
|
};
|
|
7871
|
-
|
|
8167
|
+
const handleRowClick = (row) => (event) => {
|
|
8168
|
+
if (!onRowClick || isInteractiveTarget(event.target, event.currentTarget)) return;
|
|
8169
|
+
onRowClick(row, event);
|
|
8170
|
+
};
|
|
8171
|
+
const handleRowKeyDown = (row) => (event) => {
|
|
8172
|
+
if (!onRowClick) return;
|
|
8173
|
+
if (event.target !== event.currentTarget) return;
|
|
8174
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
8175
|
+
event.preventDefault();
|
|
8176
|
+
onRowClick(row, event);
|
|
8177
|
+
};
|
|
8178
|
+
return /* @__PURE__ */ jsx59("div", { ref: rootRef, className: clsx43("space-y-4 w-full", containerClassName), children: /* @__PURE__ */ jsxs46("div", { className: tableContainer, style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
7872
8179
|
title && /* @__PURE__ */ jsxs46("div", { className: "px-6 py-5 flex items-center justify-between", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: [
|
|
7873
8180
|
/* @__PURE__ */ jsx59(ITText, { as: "h2", className: "text-xl font-bold text-secondary-900 leading-tight", children: title }),
|
|
7874
8181
|
/* @__PURE__ */ jsxs46("div", { className: "flex items-center bg-slate-100 dark:bg-slate-800/80 rounded-lg p-0.5 border border-slate-200 dark:border-slate-700/50", children: [
|
|
@@ -7876,7 +8183,8 @@ function ITTable({
|
|
|
7876
8183
|
"button",
|
|
7877
8184
|
{
|
|
7878
8185
|
onClick: () => setViewMode("table"),
|
|
7879
|
-
|
|
8186
|
+
disabled: forcedCards,
|
|
8187
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "table" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
7880
8188
|
children: [
|
|
7881
8189
|
/* @__PURE__ */ jsx59(FaTable2, { size: 11 }),
|
|
7882
8190
|
"Table"
|
|
@@ -7887,7 +8195,7 @@ function ITTable({
|
|
|
7887
8195
|
"button",
|
|
7888
8196
|
{
|
|
7889
8197
|
onClick: () => setViewMode("cards"),
|
|
7890
|
-
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${
|
|
8198
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "cards" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
7891
8199
|
children: [
|
|
7892
8200
|
/* @__PURE__ */ jsx59(FaThLarge2, { size: 11 }),
|
|
7893
8201
|
"Cards"
|
|
@@ -7901,7 +8209,8 @@ function ITTable({
|
|
|
7901
8209
|
"button",
|
|
7902
8210
|
{
|
|
7903
8211
|
onClick: () => setViewMode("table"),
|
|
7904
|
-
|
|
8212
|
+
disabled: forcedCards,
|
|
8213
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "table" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
7905
8214
|
children: [
|
|
7906
8215
|
/* @__PURE__ */ jsx59(FaTable2, { size: 11 }),
|
|
7907
8216
|
"Table"
|
|
@@ -7912,7 +8221,7 @@ function ITTable({
|
|
|
7912
8221
|
"button",
|
|
7913
8222
|
{
|
|
7914
8223
|
onClick: () => setViewMode("cards"),
|
|
7915
|
-
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${
|
|
8224
|
+
className: `flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-semibold transition-all ${effectiveView === "cards" ? "bg-white dark:bg-slate-900 text-slate-900 dark:text-white shadow-sm border border-slate-200/50 dark:border-slate-700" : "text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-200"}`,
|
|
7916
8225
|
children: [
|
|
7917
8226
|
/* @__PURE__ */ jsx59(FaThLarge2, { size: 11 }),
|
|
7918
8227
|
"Cards"
|
|
@@ -7920,64 +8229,131 @@ function ITTable({
|
|
|
7920
8229
|
}
|
|
7921
8230
|
)
|
|
7922
8231
|
] }) }),
|
|
7923
|
-
|
|
8232
|
+
effectiveView === "cards" ? /* @__PURE__ */ jsx59("div", { className: "p-4 space-y-3 max-h-[400px] overflow-y-auto", children: currentData.length > 0 ? currentData.map((row, i) => /* @__PURE__ */ jsx59(
|
|
8233
|
+
"div",
|
|
8234
|
+
{
|
|
8235
|
+
className: clsx43(tableCardHover, onRowClick && tableCardClickable),
|
|
8236
|
+
role: onRowClick ? "button" : void 0,
|
|
8237
|
+
tabIndex: onRowClick ? 0 : void 0,
|
|
8238
|
+
onClick: onRowClick ? handleRowClick(row) : void 0,
|
|
8239
|
+
onKeyDown: onRowClick ? handleRowKeyDown(row) : void 0,
|
|
8240
|
+
children: renderCard ? renderCard(row) : renderDefaultCard(row)
|
|
8241
|
+
},
|
|
8242
|
+
i
|
|
8243
|
+
)) : /* @__PURE__ */ jsxs46("div", { className: clsx43(tableEmptyContent, "py-12"), children: [
|
|
7924
8244
|
/* @__PURE__ */ jsx59(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
7925
8245
|
/* @__PURE__ */ jsx59(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
7926
|
-
] }) }) : /* @__PURE__ */ jsx59(
|
|
7927
|
-
"
|
|
8246
|
+
] }) }) : /* @__PURE__ */ jsx59(
|
|
8247
|
+
"div",
|
|
7928
8248
|
{
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
{
|
|
7948
|
-
onClick: () => handleSort(col.key),
|
|
7949
|
-
className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"}`,
|
|
7950
|
-
title: `Ordenar por ${col.label}`,
|
|
7951
|
-
children: /* @__PURE__ */ jsx59(MdOutlineSwapVert2, { className: "w-4 h-4", "aria-hidden": "true" })
|
|
7952
|
-
}
|
|
7953
|
-
)
|
|
7954
|
-
] }),
|
|
7955
|
-
/* @__PURE__ */ jsx59("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
|
|
7956
|
-
] })
|
|
7957
|
-
},
|
|
7958
|
-
col.key
|
|
7959
|
-
)) }) }),
|
|
7960
|
-
/* @__PURE__ */ jsx59("tbody", { className: clsx43(tableBody, "dark:divide-slate-700/30"), children: currentData.length > 0 ? currentData.map((row, rowIndex) => /* @__PURE__ */ jsx59(
|
|
7961
|
-
"tr",
|
|
7962
|
-
{
|
|
7963
|
-
className: clsx43(tableRow, variant === "striped" && "odd:bg-secondary-50/40 dark:odd:bg-slate-800/20"),
|
|
7964
|
-
children: columns.map((col) => /* @__PURE__ */ jsx59(
|
|
7965
|
-
"td",
|
|
8249
|
+
ref: isTableVirtual ? scrollRef : void 0,
|
|
8250
|
+
className: isTableVirtual ? "overflow-x-auto overflow-y-auto" : "overflow-x-auto",
|
|
8251
|
+
style: isTableVirtual ? { maxHeight: virtualizedMaxHeight } : void 0,
|
|
8252
|
+
children: /* @__PURE__ */ jsxs46(
|
|
8253
|
+
"table",
|
|
8254
|
+
{
|
|
8255
|
+
className: clsx43(
|
|
8256
|
+
tableLayoutClass,
|
|
8257
|
+
showVerticalBorder && "[&_th]:border-r [&_th:last-child]:border-r-0 [&_td]:border-r [&_td:last-child]:border-r-0",
|
|
8258
|
+
showVerticalBorder && (verticalBorderClassname || "[&_th]:border-slate-100 dark:[&_th]:border-slate-700/30 [&_td]:border-slate-100 dark:[&_td]:border-slate-700/30"),
|
|
8259
|
+
variantStyles[variant],
|
|
8260
|
+
sizeStyles[size]
|
|
8261
|
+
),
|
|
8262
|
+
style: isFixed ? { tableLayout: "fixed" } : void 0,
|
|
8263
|
+
"aria-rowcount": isTableVirtual ? currentData.length + 1 : void 0,
|
|
8264
|
+
children: [
|
|
8265
|
+
hasColumnWidths && /* @__PURE__ */ jsx59("colgroup", { children: columns.map((col) => /* @__PURE__ */ jsx59(
|
|
8266
|
+
"col",
|
|
7966
8267
|
{
|
|
7967
|
-
|
|
7968
|
-
children: col.type === "actions" ? /* @__PURE__ */ jsx59("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ jsx59("div", { className: tableCellText, children: renderCellContent(col, row) })
|
|
8268
|
+
style: col.width != null ? { width: typeof col.width === "number" ? `${col.width}px` : col.width } : void 0
|
|
7969
8269
|
},
|
|
7970
|
-
|
|
7971
|
-
))
|
|
7972
|
-
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
8270
|
+
col.key
|
|
8271
|
+
)) }),
|
|
8272
|
+
/* @__PURE__ */ jsx59("thead", { children: /* @__PURE__ */ jsx59(
|
|
8273
|
+
"tr",
|
|
8274
|
+
{
|
|
8275
|
+
className: clsx43(tableHeaderRow, "dark:text-slate-200"),
|
|
8276
|
+
"aria-rowindex": isTableVirtual ? 1 : void 0,
|
|
8277
|
+
children: columns.map((col) => /* @__PURE__ */ jsx59(
|
|
8278
|
+
"th",
|
|
8279
|
+
{
|
|
8280
|
+
scope: "col",
|
|
8281
|
+
className: clsx43(
|
|
8282
|
+
tableHeaderCell(col.className, density),
|
|
8283
|
+
col.align && tableAlignClasses[col.align],
|
|
8284
|
+
isStickyHeader && "sticky top-0 z-10 bg-secondary-50"
|
|
8285
|
+
),
|
|
8286
|
+
style: col.minWidth != null || isStickyHeader ? {
|
|
8287
|
+
...col.minWidth != null ? { minWidth: `${col.minWidth}px` } : {},
|
|
8288
|
+
...isStickyHeader ? { backgroundColor: "var(--color-table-headerBg, #f8fafc)" } : {}
|
|
8289
|
+
} : void 0,
|
|
8290
|
+
children: /* @__PURE__ */ jsxs46("div", { className: isFixed ? "flex flex-col gap-3" : "flex flex-col gap-3 min-w-[150px]", children: [
|
|
8291
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex items-center justify-between gap-2", children: [
|
|
8292
|
+
/* @__PURE__ */ jsx59(ITText, { as: "span", className: "text-slate-900 dark:text-white font-bold", children: col.label }),
|
|
8293
|
+
col.sortable && col.type !== "actions" && /* @__PURE__ */ jsx59(
|
|
8294
|
+
"button",
|
|
8295
|
+
{
|
|
8296
|
+
onClick: () => handleSort(col.key),
|
|
8297
|
+
className: `p-1 rounded-md transition-colors ${sortConfig?.key === col.key ? "bg-secondary-200 text-secondary-900" : "hover:bg-secondary-200 text-secondary-400 hover:text-secondary-700"}`,
|
|
8298
|
+
title: `Ordenar por ${col.label}`,
|
|
8299
|
+
children: /* @__PURE__ */ jsx59(MdOutlineSwapVert2, { className: "w-4 h-4", "aria-hidden": "true" })
|
|
8300
|
+
}
|
|
8301
|
+
)
|
|
8302
|
+
] }),
|
|
8303
|
+
/* @__PURE__ */ jsx59("div", { className: "w-full", children: col.filter ? renderFilterInput(col) : null })
|
|
8304
|
+
] })
|
|
8305
|
+
},
|
|
8306
|
+
col.key
|
|
8307
|
+
))
|
|
8308
|
+
}
|
|
8309
|
+
) }),
|
|
8310
|
+
/* @__PURE__ */ jsx59("tbody", { className: clsx43(tableBody, "dark:divide-slate-700/30"), children: currentData.length > 0 ? /* @__PURE__ */ jsxs46(Fragment9, { children: [
|
|
8311
|
+
isTableVirtual && topSpacerHeight > 0 && /* @__PURE__ */ jsx59("tr", { "aria-hidden": "true", style: { height: topSpacerHeight }, children: /* @__PURE__ */ jsx59("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) }),
|
|
8312
|
+
windowData.map((row, windowIndex) => {
|
|
8313
|
+
const absoluteIndex = isTableVirtual ? startIndex + windowIndex : windowIndex;
|
|
8314
|
+
return /* @__PURE__ */ jsx59(
|
|
8315
|
+
"tr",
|
|
8316
|
+
{
|
|
8317
|
+
"aria-rowindex": isTableVirtual ? absoluteIndex + 2 : void 0,
|
|
8318
|
+
className: clsx43(
|
|
8319
|
+
tableRow,
|
|
8320
|
+
variant === "striped" && absoluteIndex % 2 === 0 && "bg-secondary-50/40 dark:bg-slate-800/20",
|
|
8321
|
+
onRowClick && tableRowClickable
|
|
8322
|
+
),
|
|
8323
|
+
tabIndex: onRowClick ? 0 : void 0,
|
|
8324
|
+
onClick: onRowClick ? handleRowClick(row) : void 0,
|
|
8325
|
+
onKeyDown: onRowClick ? handleRowKeyDown(row) : void 0,
|
|
8326
|
+
children: columns.map((col) => {
|
|
8327
|
+
const rawValue = getNestedValue(row, col.key);
|
|
8328
|
+
const truncateTitle = col.truncate && (typeof rawValue === "string" || typeof rawValue === "number") ? String(rawValue) : void 0;
|
|
8329
|
+
return /* @__PURE__ */ jsx59(
|
|
8330
|
+
"td",
|
|
8331
|
+
{
|
|
8332
|
+
className: clsx43(
|
|
8333
|
+
tableCell(col.className, density),
|
|
8334
|
+
col.align && tableAlignClasses[col.align]
|
|
8335
|
+
),
|
|
8336
|
+
style: col.minWidth != null ? { minWidth: `${col.minWidth}px` } : void 0,
|
|
8337
|
+
title: truncateTitle,
|
|
8338
|
+
children: col.type === "actions" ? /* @__PURE__ */ jsx59("div", { className: tableActionsCell, children: renderCellContent(col, row) }) : /* @__PURE__ */ jsx59("div", { className: clsx43(tableCellText, col.truncate && "truncate"), children: renderCellContent(col, row) })
|
|
8339
|
+
},
|
|
8340
|
+
`${absoluteIndex}-${col.key}`
|
|
8341
|
+
);
|
|
8342
|
+
})
|
|
8343
|
+
},
|
|
8344
|
+
absoluteIndex
|
|
8345
|
+
);
|
|
8346
|
+
}),
|
|
8347
|
+
isTableVirtual && bottomSpacerHeight > 0 && /* @__PURE__ */ jsx59("tr", { "aria-hidden": "true", style: { height: bottomSpacerHeight }, children: /* @__PURE__ */ jsx59("td", { colSpan: columnCount, style: { padding: 0, border: 0 } }) })
|
|
8348
|
+
] }) : /* @__PURE__ */ jsx59("tr", { children: /* @__PURE__ */ jsx59("td", { colSpan: columns.length, className: "px-6 py-12 text-center", children: /* @__PURE__ */ jsxs46("div", { className: tableEmptyContent, children: [
|
|
8349
|
+
/* @__PURE__ */ jsx59(ITText, { as: "span", className: "text-lg", children: "No se encontraron resultados" }),
|
|
8350
|
+
/* @__PURE__ */ jsx59(ITText, { as: "span", className: "text-sm mt-1", children: "Intenta ajustar los filtros" })
|
|
8351
|
+
] }) }) }) })
|
|
8352
|
+
]
|
|
8353
|
+
}
|
|
8354
|
+
)
|
|
7979
8355
|
}
|
|
7980
|
-
)
|
|
8356
|
+
),
|
|
7981
8357
|
/* @__PURE__ */ jsx59("div", { className: "rounded-b-xl px-6 py-4", style: { backgroundColor: "var(--color-table-rowBg, #ffffff)" }, children: /* @__PURE__ */ jsx59(
|
|
7982
8358
|
ITPagination,
|
|
7983
8359
|
{
|
|
@@ -8043,7 +8419,7 @@ function ITTextarea({
|
|
|
8043
8419
|
}
|
|
8044
8420
|
|
|
8045
8421
|
// src/components/molecules/tabs/tabs.tsx
|
|
8046
|
-
import { useState as
|
|
8422
|
+
import { useState as useState30 } from "react";
|
|
8047
8423
|
import { clsx as clsx45 } from "clsx";
|
|
8048
8424
|
import { jsx as jsx61, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
8049
8425
|
var ITTabs = ({
|
|
@@ -8054,7 +8430,7 @@ var ITTabs = ({
|
|
|
8054
8430
|
className = "",
|
|
8055
8431
|
containerClassName = ""
|
|
8056
8432
|
}) => {
|
|
8057
|
-
const [activeId, setActiveId] =
|
|
8433
|
+
const [activeId, setActiveId] = useState30(defaultActiveId || items[0]?.id);
|
|
8058
8434
|
const handleTabClick = (id, disabled) => {
|
|
8059
8435
|
if (disabled) return;
|
|
8060
8436
|
setActiveId(id);
|
|
@@ -8154,7 +8530,7 @@ var positionStyles = {
|
|
|
8154
8530
|
|
|
8155
8531
|
// src/components/organisms/toast/toast.tsx
|
|
8156
8532
|
import clsx47 from "clsx";
|
|
8157
|
-
import { useEffect as useEffect15, useState as
|
|
8533
|
+
import { useEffect as useEffect15, useState as useState31 } from "react";
|
|
8158
8534
|
import { FaTimesCircle as FaTimesCircle2, FaCheckCircle as FaCheckCircle2, FaExclamationTriangle as FaExclamationTriangle3, FaInfoCircle as FaInfoCircle2, FaTimes as FaTimes10 } from "react-icons/fa";
|
|
8159
8535
|
import { jsx as jsx63, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
8160
8536
|
function ITToast({
|
|
@@ -8164,7 +8540,7 @@ function ITToast({
|
|
|
8164
8540
|
position = "top-right",
|
|
8165
8541
|
onClose
|
|
8166
8542
|
}) {
|
|
8167
|
-
const [isVisible, setIsVisible] =
|
|
8543
|
+
const [isVisible, setIsVisible] = useState31(true);
|
|
8168
8544
|
useEffect15(() => {
|
|
8169
8545
|
const timer = setTimeout(() => {
|
|
8170
8546
|
setIsVisible(false);
|
|
@@ -8232,10 +8608,10 @@ function ITToast({
|
|
|
8232
8608
|
|
|
8233
8609
|
// src/components/molecules/wysiwyg/wysiwyg.tsx
|
|
8234
8610
|
import {
|
|
8235
|
-
useCallback as
|
|
8611
|
+
useCallback as useCallback9,
|
|
8236
8612
|
useEffect as useEffect16,
|
|
8237
|
-
useRef as
|
|
8238
|
-
useState as
|
|
8613
|
+
useRef as useRef21,
|
|
8614
|
+
useState as useState33
|
|
8239
8615
|
} from "react";
|
|
8240
8616
|
import clsx49 from "clsx";
|
|
8241
8617
|
import {
|
|
@@ -8260,7 +8636,7 @@ var toolbarActions = [
|
|
|
8260
8636
|
];
|
|
8261
8637
|
|
|
8262
8638
|
// src/components/atoms/tooltip/tooltip.tsx
|
|
8263
|
-
import { useState as
|
|
8639
|
+
import { useState as useState32 } from "react";
|
|
8264
8640
|
import clsx48 from "clsx";
|
|
8265
8641
|
import { jsx as jsx64, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
8266
8642
|
var positionClasses2 = {
|
|
@@ -8282,7 +8658,7 @@ function ITTooltip({
|
|
|
8282
8658
|
delay = 200,
|
|
8283
8659
|
className
|
|
8284
8660
|
}) {
|
|
8285
|
-
const [visible, setVisible] =
|
|
8661
|
+
const [visible, setVisible] = useState32(false);
|
|
8286
8662
|
let timeout;
|
|
8287
8663
|
const handleMouseEnter = () => {
|
|
8288
8664
|
timeout = setTimeout(() => setVisible(true), delay);
|
|
@@ -8335,12 +8711,12 @@ function ITWysiwyg({
|
|
|
8335
8711
|
toolbar = toolbarActions,
|
|
8336
8712
|
className
|
|
8337
8713
|
}) {
|
|
8338
|
-
const editorRef =
|
|
8339
|
-
const focusedRef =
|
|
8340
|
-
const [active, setActive] =
|
|
8714
|
+
const editorRef = useRef21(null);
|
|
8715
|
+
const focusedRef = useRef21(false);
|
|
8716
|
+
const [active, setActive] = useState33({});
|
|
8341
8717
|
const isLocked = disabled || readOnly;
|
|
8342
8718
|
const sizeConfig = inputSizeTokens[size] ?? inputSizeTokens.md;
|
|
8343
|
-
const findAncestor =
|
|
8719
|
+
const findAncestor = useCallback9(
|
|
8344
8720
|
(node, predicate) => {
|
|
8345
8721
|
const editor = editorRef.current;
|
|
8346
8722
|
if (!editor) return null;
|
|
@@ -8353,7 +8729,7 @@ function ITWysiwyg({
|
|
|
8353
8729
|
},
|
|
8354
8730
|
[]
|
|
8355
8731
|
);
|
|
8356
|
-
const isInlineTag =
|
|
8732
|
+
const isInlineTag = useCallback9((el, tag) => {
|
|
8357
8733
|
if (tag === "STRONG" || tag === "B") {
|
|
8358
8734
|
return el.tagName === "STRONG" || el.tagName === "B";
|
|
8359
8735
|
}
|
|
@@ -8362,7 +8738,7 @@ function ITWysiwyg({
|
|
|
8362
8738
|
}
|
|
8363
8739
|
return el.tagName === tag;
|
|
8364
8740
|
}, []);
|
|
8365
|
-
const getTextNodesInRange =
|
|
8741
|
+
const getTextNodesInRange = useCallback9((range) => {
|
|
8366
8742
|
const editor = editorRef.current;
|
|
8367
8743
|
if (!editor) return [];
|
|
8368
8744
|
const out = [];
|
|
@@ -8373,7 +8749,7 @@ function ITWysiwyg({
|
|
|
8373
8749
|
}
|
|
8374
8750
|
return out;
|
|
8375
8751
|
}, []);
|
|
8376
|
-
const placeCaretAtEnd =
|
|
8752
|
+
const placeCaretAtEnd = useCallback9((target) => {
|
|
8377
8753
|
const editor = editorRef.current;
|
|
8378
8754
|
const sel = window.getSelection();
|
|
8379
8755
|
if (!editor || !sel) return;
|
|
@@ -8384,11 +8760,11 @@ function ITWysiwyg({
|
|
|
8384
8760
|
sel.addRange(range);
|
|
8385
8761
|
if (document.activeElement !== editor) editor.focus();
|
|
8386
8762
|
}, []);
|
|
8387
|
-
const emitChange =
|
|
8763
|
+
const emitChange = useCallback9(() => {
|
|
8388
8764
|
const editor = editorRef.current;
|
|
8389
8765
|
if (editor) onChange?.(editor.innerHTML);
|
|
8390
8766
|
}, [onChange]);
|
|
8391
|
-
const updateActive =
|
|
8767
|
+
const updateActive = useCallback9(() => {
|
|
8392
8768
|
const editor = editorRef.current;
|
|
8393
8769
|
const sel = window.getSelection();
|
|
8394
8770
|
const node = sel?.anchorNode ?? null;
|
|
@@ -8407,13 +8783,13 @@ function ITWysiwyg({
|
|
|
8407
8783
|
(prev) => JSON.stringify(prev) === JSON.stringify(next) ? prev : next
|
|
8408
8784
|
);
|
|
8409
8785
|
}, [findAncestor, isInlineTag]);
|
|
8410
|
-
const unwrapElement =
|
|
8786
|
+
const unwrapElement = useCallback9((el) => {
|
|
8411
8787
|
const parent = el.parentNode;
|
|
8412
8788
|
if (!parent) return;
|
|
8413
8789
|
while (el.firstChild) parent.insertBefore(el.firstChild, el);
|
|
8414
8790
|
el.remove();
|
|
8415
8791
|
}, []);
|
|
8416
|
-
const applyInline =
|
|
8792
|
+
const applyInline = useCallback9(
|
|
8417
8793
|
(tag, prepare) => {
|
|
8418
8794
|
const editor = editorRef.current;
|
|
8419
8795
|
const sel = window.getSelection();
|
|
@@ -8495,7 +8871,7 @@ function ITWysiwyg({
|
|
|
8495
8871
|
updateActive
|
|
8496
8872
|
]
|
|
8497
8873
|
);
|
|
8498
|
-
const normalizeBlocks =
|
|
8874
|
+
const normalizeBlocks = useCallback9(() => {
|
|
8499
8875
|
const editor = editorRef.current;
|
|
8500
8876
|
if (!editor) return;
|
|
8501
8877
|
const children = Array.from(editor.childNodes);
|
|
@@ -8517,7 +8893,7 @@ function ITWysiwyg({
|
|
|
8517
8893
|
}
|
|
8518
8894
|
flush();
|
|
8519
8895
|
}, []);
|
|
8520
|
-
const convertLiToDiv =
|
|
8896
|
+
const convertLiToDiv = useCallback9((li) => {
|
|
8521
8897
|
const list = li.parentElement;
|
|
8522
8898
|
if (!list || !list.parentNode) return;
|
|
8523
8899
|
const div = document.createElement("div");
|
|
@@ -8525,20 +8901,20 @@ function ITWysiwyg({
|
|
|
8525
8901
|
list.parentNode.insertBefore(div, list);
|
|
8526
8902
|
li.remove();
|
|
8527
8903
|
}, []);
|
|
8528
|
-
const cleanupEmptyLists =
|
|
8904
|
+
const cleanupEmptyLists = useCallback9(() => {
|
|
8529
8905
|
const editor = editorRef.current;
|
|
8530
8906
|
if (!editor) return;
|
|
8531
8907
|
editor.querySelectorAll("ul, ol").forEach((list) => {
|
|
8532
8908
|
if (!list.querySelector("li")) list.remove();
|
|
8533
8909
|
});
|
|
8534
8910
|
}, []);
|
|
8535
|
-
const retagList =
|
|
8911
|
+
const retagList = useCallback9((list, type) => {
|
|
8536
8912
|
if (!list.parentNode) return;
|
|
8537
8913
|
const nl = document.createElement(type);
|
|
8538
8914
|
while (list.firstChild) nl.appendChild(list.firstChild);
|
|
8539
8915
|
list.parentNode.replaceChild(nl, list);
|
|
8540
8916
|
}, []);
|
|
8541
|
-
const toggleList =
|
|
8917
|
+
const toggleList = useCallback9(
|
|
8542
8918
|
(type) => {
|
|
8543
8919
|
const editor = editorRef.current;
|
|
8544
8920
|
const sel = window.getSelection();
|
|
@@ -8636,7 +9012,7 @@ function ITWysiwyg({
|
|
|
8636
9012
|
updateActive
|
|
8637
9013
|
]
|
|
8638
9014
|
);
|
|
8639
|
-
const clearFormatting =
|
|
9015
|
+
const clearFormatting = useCallback9(() => {
|
|
8640
9016
|
const editor = editorRef.current;
|
|
8641
9017
|
const sel = window.getSelection();
|
|
8642
9018
|
if (!editor || !sel || sel.rangeCount === 0) return;
|
|
@@ -8817,7 +9193,7 @@ function ITWysiwyg({
|
|
|
8817
9193
|
}
|
|
8818
9194
|
|
|
8819
9195
|
// src/components/organisms/dropfile/dropfile.tsx
|
|
8820
|
-
import { useState as
|
|
9196
|
+
import { useState as useState34, useEffect as useEffect17 } from "react";
|
|
8821
9197
|
import { useDropzone } from "react-dropzone";
|
|
8822
9198
|
import clsx50 from "clsx";
|
|
8823
9199
|
|
|
@@ -8847,7 +9223,7 @@ var UploadStatus = /* @__PURE__ */ ((UploadStatus2) => {
|
|
|
8847
9223
|
})(UploadStatus || {});
|
|
8848
9224
|
|
|
8849
9225
|
// src/components/organisms/dropfile/dropfile.tsx
|
|
8850
|
-
import { Fragment as
|
|
9226
|
+
import { Fragment as Fragment10, jsx as jsx66, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
8851
9227
|
var ITDropfile = ({
|
|
8852
9228
|
onFileSelect,
|
|
8853
9229
|
onCancel,
|
|
@@ -8863,12 +9239,12 @@ var ITDropfile = ({
|
|
|
8863
9239
|
buttonLabel = "Subir archivo",
|
|
8864
9240
|
modalTitle
|
|
8865
9241
|
}) => {
|
|
8866
|
-
const [isModalOpen, setIsModalOpen] =
|
|
8867
|
-
const [selectedFile, setSelectedFile] =
|
|
8868
|
-
const [fileType, setFileType] =
|
|
8869
|
-
const [imagePreview, setImagePreview] =
|
|
8870
|
-
const [isConfirmed, setIsConfirmed] =
|
|
8871
|
-
const [internalUploadStatus, setInternalUploadStatus] =
|
|
9242
|
+
const [isModalOpen, setIsModalOpen] = useState34(false);
|
|
9243
|
+
const [selectedFile, setSelectedFile] = useState34(null);
|
|
9244
|
+
const [fileType, setFileType] = useState34(null);
|
|
9245
|
+
const [imagePreview, setImagePreview] = useState34(initialPreviewUrl || null);
|
|
9246
|
+
const [isConfirmed, setIsConfirmed] = useState34(false);
|
|
9247
|
+
const [internalUploadStatus, setInternalUploadStatus] = useState34(
|
|
8872
9248
|
initialPreviewUrl ? "subido" /* UPLOADED */ : "pendiente" /* PENDING */
|
|
8873
9249
|
);
|
|
8874
9250
|
useEffect17(() => {
|
|
@@ -9090,7 +9466,7 @@ var ITDropfile = ({
|
|
|
9090
9466
|
] }),
|
|
9091
9467
|
showStatusBadge && selectedFile && /* @__PURE__ */ jsx66(StatusBadge, { status: uploadStatus })
|
|
9092
9468
|
] });
|
|
9093
|
-
const dropZoneOrPreview = /* @__PURE__ */ jsx66(
|
|
9469
|
+
const dropZoneOrPreview = /* @__PURE__ */ jsx66(Fragment10, { children: !selectedFile && !imagePreview ? /* @__PURE__ */ jsxs52(
|
|
9094
9470
|
"div",
|
|
9095
9471
|
{
|
|
9096
9472
|
...getRootProps(),
|
|
@@ -9133,7 +9509,7 @@ var ITDropfile = ({
|
|
|
9133
9509
|
/* @__PURE__ */ jsx66("svg", { className: "w-10 h-10 mb-2 opacity-50", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx66("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" }) }),
|
|
9134
9510
|
/* @__PURE__ */ jsx66(ITText, { as: "span", className: "text-xs", children: "Sin vista previa" })
|
|
9135
9511
|
] }) }),
|
|
9136
|
-
/* @__PURE__ */ jsx66("div", { className: "px-3 py-2 bg-white border-t border-secondary-100 flex justify-end gap-2", children: !isConfirmed ? /* @__PURE__ */ jsxs52(
|
|
9512
|
+
/* @__PURE__ */ jsx66("div", { className: "px-3 py-2 bg-white border-t border-secondary-100 flex justify-end gap-2", children: !isConfirmed ? /* @__PURE__ */ jsxs52(Fragment10, { children: [
|
|
9137
9513
|
/* @__PURE__ */ jsx66(
|
|
9138
9514
|
ITButton,
|
|
9139
9515
|
{
|
|
@@ -9216,24 +9592,26 @@ var ITDropfile = ({
|
|
|
9216
9592
|
var dropfile_default = ITDropfile;
|
|
9217
9593
|
|
|
9218
9594
|
// src/components/templates/layout/layout.tsx
|
|
9219
|
-
import { useState as
|
|
9595
|
+
import { useState as useState36 } from "react";
|
|
9220
9596
|
import clsx51 from "clsx";
|
|
9221
9597
|
|
|
9222
9598
|
// src/components/organisms/topbar/topbar.tsx
|
|
9223
9599
|
import { FaUserCircle as FaUserCircle2, FaBars } from "react-icons/fa";
|
|
9224
|
-
import { useRef as
|
|
9600
|
+
import { useRef as useRef22, useState as useState35 } from "react";
|
|
9225
9601
|
import { jsx as jsx67, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
9226
9602
|
function ITTopBar({
|
|
9227
9603
|
logo,
|
|
9228
9604
|
logoText,
|
|
9605
|
+
centerContent,
|
|
9229
9606
|
userMenu,
|
|
9607
|
+
children,
|
|
9230
9608
|
showMobileMenuButton,
|
|
9231
9609
|
onToggleMobileMenu,
|
|
9232
9610
|
navItems,
|
|
9233
9611
|
onNavItemClick
|
|
9234
9612
|
}) {
|
|
9235
|
-
const [isUserMenuOpen, setIsUserMenuOpen] =
|
|
9236
|
-
const userMenuRef =
|
|
9613
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = useState35(false);
|
|
9614
|
+
const userMenuRef = useRef22(null);
|
|
9237
9615
|
useClickOutside_default(userMenuRef, () => setIsUserMenuOpen(false));
|
|
9238
9616
|
return /* @__PURE__ */ jsx67(
|
|
9239
9617
|
"header",
|
|
@@ -9293,101 +9671,105 @@ function ITTopBar({
|
|
|
9293
9671
|
item.id
|
|
9294
9672
|
)) })
|
|
9295
9673
|
] }),
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
as: "span",
|
|
9329
|
-
className: "font-semibold text-[0.85rem] leading-tight",
|
|
9330
|
-
style: { color: "var(--it-topbar-user-text, #0f172a)" },
|
|
9331
|
-
children: userMenu.userName
|
|
9332
|
-
}
|
|
9333
|
-
),
|
|
9334
|
-
/* @__PURE__ */ jsx67(
|
|
9335
|
-
ITText,
|
|
9336
|
-
{
|
|
9337
|
-
as: "span",
|
|
9338
|
-
className: "text-[0.7rem] font-medium",
|
|
9339
|
-
style: { color: "var(--it-topbar-user-subtitle, #64748b)" },
|
|
9340
|
-
children: userMenu.userEmail
|
|
9341
|
-
}
|
|
9342
|
-
)
|
|
9343
|
-
] })
|
|
9344
|
-
]
|
|
9345
|
-
}
|
|
9346
|
-
),
|
|
9347
|
-
/* @__PURE__ */ jsxs53(
|
|
9348
|
-
"div",
|
|
9349
|
-
{
|
|
9350
|
-
ref: userMenuRef,
|
|
9351
|
-
className: `
|
|
9352
|
-
absolute right-0 mt-3 w-64 rounded-2xl shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] z-[70] overflow-hidden transform origin-top-right transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)]
|
|
9353
|
-
${isUserMenuOpen ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 -translate-y-2 pointer-events-none"}
|
|
9354
|
-
`,
|
|
9355
|
-
style: {
|
|
9356
|
-
backgroundColor: "var(--it-topbar-user-dropdown-bg, #ffffff)",
|
|
9357
|
-
border: "1px solid var(--it-topbar-user-dropdown-border, #f1f5f9)"
|
|
9358
|
-
},
|
|
9359
|
-
children: [
|
|
9360
|
-
/* @__PURE__ */ jsxs53("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: [
|
|
9361
|
-
/* @__PURE__ */ jsx67(ITText, { as: "span", className: "block font-bold text-[0.9rem]", style: { color: "var(--it-topbar-user-text, #0f172a)" }, children: userMenu.userName }),
|
|
9362
|
-
/* @__PURE__ */ jsx67(ITText, { as: "span", className: "block text-xs font-medium truncate mt-0.5", style: { color: "var(--it-topbar-user-subtitle, #64748b)" }, children: userMenu.userEmail })
|
|
9363
|
-
] }),
|
|
9364
|
-
/* @__PURE__ */ jsx67("ul", { className: "py-2", children: userMenu.menuItems.map((m, i) => {
|
|
9365
|
-
const isDestructive = m.label.toLowerCase().includes("salir") || m.label.toLowerCase().includes("cerrar") || m.label.toLowerCase().includes("logout");
|
|
9366
|
-
return /* @__PURE__ */ jsxs53("li", { className: "px-2", children: [
|
|
9367
|
-
i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ jsx67("div", { className: "h-px bg-slate-100 my-1 mx-2" }),
|
|
9674
|
+
centerContent && /* @__PURE__ */ jsx67("div", { className: "hidden lg:flex flex-1 min-w-0 items-center justify-center px-4", children: /* @__PURE__ */ jsx67("div", { className: "w-full max-w-[420px]", children: centerContent }) }),
|
|
9675
|
+
(children || userMenu) && /* @__PURE__ */ jsxs53("div", { className: "flex items-center gap-2", children: [
|
|
9676
|
+
children,
|
|
9677
|
+
userMenu && /* @__PURE__ */ jsxs53("div", { className: "relative", children: [
|
|
9678
|
+
/* @__PURE__ */ jsxs53(
|
|
9679
|
+
"button",
|
|
9680
|
+
{
|
|
9681
|
+
type: "button",
|
|
9682
|
+
className: "flex items-center gap-3 rounded-full pl-2 pr-4 py-1.5 transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)] border border-transparent hover:border-secondary-200",
|
|
9683
|
+
style: {
|
|
9684
|
+
backgroundColor: isUserMenuOpen ? "var(--it-topbar-user-hover, #f1f5f9)" : "transparent"
|
|
9685
|
+
},
|
|
9686
|
+
onMouseEnter: (e) => {
|
|
9687
|
+
if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "var(--it-topbar-user-hover, #f1f5f9)";
|
|
9688
|
+
},
|
|
9689
|
+
onMouseLeave: (e) => {
|
|
9690
|
+
if (!isUserMenuOpen) e.currentTarget.style.backgroundColor = "transparent";
|
|
9691
|
+
},
|
|
9692
|
+
onClick: () => setIsUserMenuOpen(!isUserMenuOpen),
|
|
9693
|
+
children: [
|
|
9694
|
+
/* @__PURE__ */ jsxs53("div", { className: "relative", children: [
|
|
9695
|
+
userMenu.userImage ? /* @__PURE__ */ jsx67(
|
|
9696
|
+
"img",
|
|
9697
|
+
{
|
|
9698
|
+
className: "w-9 h-9 rounded-full object-cover ring-2 ring-white shadow-sm",
|
|
9699
|
+
src: userMenu.userImage,
|
|
9700
|
+
alt: "Current user"
|
|
9701
|
+
}
|
|
9702
|
+
) : /* @__PURE__ */ jsx67("div", { className: "w-9 h-9 rounded-full bg-slate-100 flex items-center justify-center ring-2 ring-white shadow-sm", children: /* @__PURE__ */ jsx67(FaUserCircle2, { className: "w-6 h-6", style: { color: "var(--it-topbar-icon, #94a3b8)" } }) }),
|
|
9703
|
+
/* @__PURE__ */ jsx67("div", { className: "absolute bottom-0 right-0 w-2.5 h-2.5 bg-green-500 border-2 border-white rounded-full" })
|
|
9704
|
+
] }),
|
|
9705
|
+
/* @__PURE__ */ jsxs53("div", { className: "hidden sm:flex flex-col text-left py-0.5", children: [
|
|
9368
9706
|
/* @__PURE__ */ jsx67(
|
|
9369
|
-
|
|
9707
|
+
ITText,
|
|
9370
9708
|
{
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
},
|
|
9383
|
-
children:
|
|
9709
|
+
as: "span",
|
|
9710
|
+
className: "font-semibold text-[0.85rem] leading-tight",
|
|
9711
|
+
style: { color: "var(--it-topbar-user-text, #0f172a)" },
|
|
9712
|
+
children: userMenu.userName
|
|
9713
|
+
}
|
|
9714
|
+
),
|
|
9715
|
+
/* @__PURE__ */ jsx67(
|
|
9716
|
+
ITText,
|
|
9717
|
+
{
|
|
9718
|
+
as: "span",
|
|
9719
|
+
className: "text-[0.7rem] font-medium",
|
|
9720
|
+
style: { color: "var(--it-topbar-user-subtitle, #64748b)" },
|
|
9721
|
+
children: userMenu.userEmail
|
|
9384
9722
|
}
|
|
9385
9723
|
)
|
|
9386
|
-
] }
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9724
|
+
] })
|
|
9725
|
+
]
|
|
9726
|
+
}
|
|
9727
|
+
),
|
|
9728
|
+
/* @__PURE__ */ jsxs53(
|
|
9729
|
+
"div",
|
|
9730
|
+
{
|
|
9731
|
+
ref: userMenuRef,
|
|
9732
|
+
className: `
|
|
9733
|
+
absolute right-0 mt-3 w-64 rounded-2xl shadow-[0_10px_40px_-10px_rgba(0,0,0,0.15)] z-[70] overflow-hidden transform origin-top-right transition-all duration-200 ease-[cubic-bezier(0.2,0,0,1)]
|
|
9734
|
+
${isUserMenuOpen ? "scale-100 opacity-100 translate-y-0" : "scale-95 opacity-0 -translate-y-2 pointer-events-none"}
|
|
9735
|
+
`,
|
|
9736
|
+
style: {
|
|
9737
|
+
backgroundColor: "var(--it-topbar-user-dropdown-bg, #ffffff)",
|
|
9738
|
+
border: "1px solid var(--it-topbar-user-dropdown-border, #f1f5f9)"
|
|
9739
|
+
},
|
|
9740
|
+
children: [
|
|
9741
|
+
/* @__PURE__ */ jsxs53("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: [
|
|
9742
|
+
/* @__PURE__ */ jsx67(ITText, { as: "span", className: "block font-bold text-[0.9rem]", style: { color: "var(--it-topbar-user-text, #0f172a)" }, children: userMenu.userName }),
|
|
9743
|
+
/* @__PURE__ */ jsx67(ITText, { as: "span", className: "block text-xs font-medium truncate mt-0.5", style: { color: "var(--it-topbar-user-subtitle, #64748b)" }, children: userMenu.userEmail })
|
|
9744
|
+
] }),
|
|
9745
|
+
/* @__PURE__ */ jsx67("ul", { className: "py-2", children: userMenu.menuItems.map((m, i) => {
|
|
9746
|
+
const isDestructive = m.label.toLowerCase().includes("salir") || m.label.toLowerCase().includes("cerrar") || m.label.toLowerCase().includes("logout");
|
|
9747
|
+
return /* @__PURE__ */ jsxs53("li", { className: "px-2", children: [
|
|
9748
|
+
i === userMenu.menuItems.length - 1 && isDestructive && i > 0 && /* @__PURE__ */ jsx67("div", { className: "h-px bg-slate-100 my-1 mx-2" }),
|
|
9749
|
+
/* @__PURE__ */ jsx67(
|
|
9750
|
+
"button",
|
|
9751
|
+
{
|
|
9752
|
+
onClick: () => {
|
|
9753
|
+
m.onClick();
|
|
9754
|
+
setIsUserMenuOpen(false);
|
|
9755
|
+
},
|
|
9756
|
+
className: "block w-full text-left px-3 py-2.5 rounded-xl text-[0.875rem] font-medium transition-colors duration-150",
|
|
9757
|
+
style: { color: isDestructive ? "var(--color-danger-500)" : "var(--it-topbar-user-text, #334155)" },
|
|
9758
|
+
onMouseEnter: (e) => {
|
|
9759
|
+
e.currentTarget.style.backgroundColor = isDestructive ? "var(--color-danger-50)" : "var(--it-topbar-user-item-hover, #f8fafc)";
|
|
9760
|
+
},
|
|
9761
|
+
onMouseLeave: (e) => {
|
|
9762
|
+
e.currentTarget.style.backgroundColor = "transparent";
|
|
9763
|
+
},
|
|
9764
|
+
children: /* @__PURE__ */ jsx67(ITText, { as: "span", children: m.label })
|
|
9765
|
+
}
|
|
9766
|
+
)
|
|
9767
|
+
] }, i);
|
|
9768
|
+
}) })
|
|
9769
|
+
]
|
|
9770
|
+
}
|
|
9771
|
+
)
|
|
9772
|
+
] })
|
|
9391
9773
|
] })
|
|
9392
9774
|
] })
|
|
9393
9775
|
}
|
|
@@ -9403,8 +9785,8 @@ function ITLayout({
|
|
|
9403
9785
|
className = "",
|
|
9404
9786
|
contentClassName = ""
|
|
9405
9787
|
}) {
|
|
9406
|
-
const [internalCollapsed, setInternalCollapsed] =
|
|
9407
|
-
const [mobileSidebarOpen, setMobileSidebarOpen] =
|
|
9788
|
+
const [internalCollapsed, setInternalCollapsed] = useState36(true);
|
|
9789
|
+
const [mobileSidebarOpen, setMobileSidebarOpen] = useState36(false);
|
|
9408
9790
|
const isControlled = sidebar.isCollapsed !== void 0;
|
|
9409
9791
|
const desktopCollapsed = isControlled ? sidebar.isCollapsed : internalCollapsed;
|
|
9410
9792
|
const handleToggleCollapse = isControlled ? sidebar.onToggleCollapse ?? (() => {
|
|
@@ -9426,7 +9808,12 @@ function ITLayout({
|
|
|
9426
9808
|
style: { backgroundColor: layoutTokens.backgroundColor },
|
|
9427
9809
|
children: [
|
|
9428
9810
|
/* @__PURE__ */ jsxs54("div", { className: "hidden lg:block relative z-40 h-full", children: [
|
|
9429
|
-
/* @__PURE__ */ jsx68(
|
|
9811
|
+
/* @__PURE__ */ jsx68(
|
|
9812
|
+
"div",
|
|
9813
|
+
{
|
|
9814
|
+
className: `${desktopCollapsed ? "w-[88px]" : "w-[280px]"} h-full flex-shrink-0`
|
|
9815
|
+
}
|
|
9816
|
+
),
|
|
9430
9817
|
/* @__PURE__ */ jsx68("div", { className: "absolute top-0 left-0 h-full", children: /* @__PURE__ */ jsx68(
|
|
9431
9818
|
ITSidebar,
|
|
9432
9819
|
{
|
|
@@ -9558,7 +9945,7 @@ function ITLoader({
|
|
|
9558
9945
|
|
|
9559
9946
|
// src/components/molecules/stepper/stepper.tsx
|
|
9560
9947
|
import clsx52 from "clsx";
|
|
9561
|
-
import { useEffect as useEffect18, useRef as
|
|
9948
|
+
import { useEffect as useEffect18, useRef as useRef23, useState as useState37 } from "react";
|
|
9562
9949
|
import { FaChevronLeft as FaChevronLeft4, FaChevronRight as FaChevronRight5, FaCheck as FaCheck5 } from "react-icons/fa";
|
|
9563
9950
|
import { jsx as jsx70, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
9564
9951
|
function ITStepper({
|
|
@@ -9575,9 +9962,9 @@ function ITStepper({
|
|
|
9575
9962
|
maxContentHeight = "400px",
|
|
9576
9963
|
color = "primary"
|
|
9577
9964
|
}) {
|
|
9578
|
-
const [direction, setDirection] =
|
|
9579
|
-
const contentRef =
|
|
9580
|
-
const progressRef =
|
|
9965
|
+
const [direction, setDirection] = useState37("next");
|
|
9966
|
+
const contentRef = useRef23(null);
|
|
9967
|
+
const progressRef = useRef23(null);
|
|
9581
9968
|
const isThemeColor = color in theme.colors;
|
|
9582
9969
|
const resolvedColor = isThemeColor ? theme.colors[color][500] : color;
|
|
9583
9970
|
useEffect18(() => {
|
|
@@ -9754,7 +10141,7 @@ function ITStepper({
|
|
|
9754
10141
|
}
|
|
9755
10142
|
|
|
9756
10143
|
// src/components/theme-provider/themeProvider.tsx
|
|
9757
|
-
import { useState as
|
|
10144
|
+
import { useState as useState38, useEffect as useEffect19, useLayoutEffect as useLayoutEffect4 } from "react";
|
|
9758
10145
|
import { MdPalette, MdClose, MdRefresh } from "react-icons/md";
|
|
9759
10146
|
|
|
9760
10147
|
// src/components/theme-provider/themePresets.ts
|
|
@@ -9792,8 +10179,10 @@ var DEFAULT_PALETTE = {
|
|
|
9792
10179
|
// Slate-700
|
|
9793
10180
|
rowBg: "#ffffff",
|
|
9794
10181
|
// White
|
|
9795
|
-
rowText: "#1e293b"
|
|
10182
|
+
rowText: "#1e293b",
|
|
9796
10183
|
// Slate-800
|
|
10184
|
+
rowHover: "#f1f5f9"
|
|
10185
|
+
// Slate-100
|
|
9797
10186
|
}
|
|
9798
10187
|
};
|
|
9799
10188
|
var PRESETS = [
|
|
@@ -9818,7 +10207,8 @@ var PRESETS = [
|
|
|
9818
10207
|
headerBg: "#f1f5f9",
|
|
9819
10208
|
headerText: "#334155",
|
|
9820
10209
|
rowBg: "#ffffff",
|
|
9821
|
-
rowText: "#0f172a"
|
|
10210
|
+
rowText: "#0f172a",
|
|
10211
|
+
rowHover: "#1e293b"
|
|
9822
10212
|
}
|
|
9823
10213
|
}
|
|
9824
10214
|
},
|
|
@@ -9843,7 +10233,8 @@ var PRESETS = [
|
|
|
9843
10233
|
headerBg: "#fff1f2",
|
|
9844
10234
|
headerText: "#881337",
|
|
9845
10235
|
rowBg: "#ffffff",
|
|
9846
|
-
rowText: "#1c1212"
|
|
10236
|
+
rowText: "#1c1212",
|
|
10237
|
+
rowHover: "#fff1f2"
|
|
9847
10238
|
}
|
|
9848
10239
|
}
|
|
9849
10240
|
},
|
|
@@ -9868,7 +10259,8 @@ var PRESETS = [
|
|
|
9868
10259
|
headerBg: "#f0fdfa",
|
|
9869
10260
|
headerText: "#115e59",
|
|
9870
10261
|
rowBg: "#ffffff",
|
|
9871
|
-
rowText: "#042f2e"
|
|
10262
|
+
rowText: "#042f2e",
|
|
10263
|
+
rowHover: "#f0fdfa"
|
|
9872
10264
|
}
|
|
9873
10265
|
}
|
|
9874
10266
|
},
|
|
@@ -9893,7 +10285,8 @@ var PRESETS = [
|
|
|
9893
10285
|
headerBg: "#fefce8",
|
|
9894
10286
|
headerText: "#713f12",
|
|
9895
10287
|
rowBg: "#ffffff",
|
|
9896
|
-
rowText: "#292524"
|
|
10288
|
+
rowText: "#292524",
|
|
10289
|
+
rowHover: "#fefce8"
|
|
9897
10290
|
}
|
|
9898
10291
|
}
|
|
9899
10292
|
},
|
|
@@ -9918,7 +10311,8 @@ var PRESETS = [
|
|
|
9918
10311
|
headerBg: "#f0fdf4",
|
|
9919
10312
|
headerText: "#166534",
|
|
9920
10313
|
rowBg: "#ffffff",
|
|
9921
|
-
rowText: "#052e16"
|
|
10314
|
+
rowText: "#052e16",
|
|
10315
|
+
rowHover: "#f0fdf4"
|
|
9922
10316
|
}
|
|
9923
10317
|
}
|
|
9924
10318
|
}
|
|
@@ -10019,7 +10413,7 @@ function ITThemeProvider({
|
|
|
10019
10413
|
radius,
|
|
10020
10414
|
shadow
|
|
10021
10415
|
}) {
|
|
10022
|
-
const [palette2, setPaletteState] =
|
|
10416
|
+
const [palette2, setPaletteState] = useState38(() => {
|
|
10023
10417
|
const basePalette = {
|
|
10024
10418
|
...DEFAULT_PALETTE,
|
|
10025
10419
|
...theme2,
|
|
@@ -10045,8 +10439,8 @@ function ITThemeProvider({
|
|
|
10045
10439
|
}
|
|
10046
10440
|
return basePalette;
|
|
10047
10441
|
});
|
|
10048
|
-
const [isOpen, setIsOpen] =
|
|
10049
|
-
const [customPresets, setCustomPresets] =
|
|
10442
|
+
const [isOpen, setIsOpen] = useState38(false);
|
|
10443
|
+
const [customPresets, setCustomPresets] = useState38(() => {
|
|
10050
10444
|
try {
|
|
10051
10445
|
const saved = localStorage.getItem("it-theme-custom-presets");
|
|
10052
10446
|
return saved ? JSON.parse(saved) : [];
|
|
@@ -10055,8 +10449,8 @@ function ITThemeProvider({
|
|
|
10055
10449
|
return [];
|
|
10056
10450
|
}
|
|
10057
10451
|
});
|
|
10058
|
-
const [newPresetName, setNewPresetName] =
|
|
10059
|
-
const [isSavingPreset, setIsSavingPreset] =
|
|
10452
|
+
const [newPresetName, setNewPresetName] = useState38("");
|
|
10453
|
+
const [isSavingPreset, setIsSavingPreset] = useState38(false);
|
|
10060
10454
|
const handleSavePreset = () => {
|
|
10061
10455
|
if (!newPresetName.trim()) return;
|
|
10062
10456
|
const newPreset = {
|
|
@@ -10075,8 +10469,8 @@ function ITThemeProvider({
|
|
|
10075
10469
|
setCustomPresets(updated);
|
|
10076
10470
|
localStorage.setItem("it-theme-custom-presets", JSON.stringify(updated));
|
|
10077
10471
|
};
|
|
10078
|
-
const [resolvedTheme, setResolvedTheme] =
|
|
10079
|
-
const [darkModeMode, setDarkModeMode] =
|
|
10472
|
+
const [resolvedTheme, setResolvedTheme] = useState38("light");
|
|
10473
|
+
const [darkModeMode, setDarkModeMode] = useState38(
|
|
10080
10474
|
() => {
|
|
10081
10475
|
const saved = localStorage.getItem("it-theme-dark-mode");
|
|
10082
10476
|
if (saved === "light" || saved === "dark" || saved === "system") {
|
|
@@ -10120,7 +10514,7 @@ function ITThemeProvider({
|
|
|
10120
10514
|
});
|
|
10121
10515
|
}
|
|
10122
10516
|
}, [theme2, showFab]);
|
|
10123
|
-
|
|
10517
|
+
useLayoutEffect4(() => {
|
|
10124
10518
|
const root = document.documentElement;
|
|
10125
10519
|
const scale = typeof density === "number" && isFinite(density) ? Math.min(Math.max(density, 0.5), 1.5) : 1;
|
|
10126
10520
|
root.style.setProperty("--it-density", String(scale));
|
|
@@ -10130,7 +10524,7 @@ function ITThemeProvider({
|
|
|
10130
10524
|
root.style.fontSize = "";
|
|
10131
10525
|
};
|
|
10132
10526
|
}, [density]);
|
|
10133
|
-
|
|
10527
|
+
useLayoutEffect4(() => {
|
|
10134
10528
|
const root = document.documentElement;
|
|
10135
10529
|
const radiusTokens = ["xs", "sm", "md", "lg", "xl", "2xl", "3xl"];
|
|
10136
10530
|
if (typeof radius === "number" && isFinite(radius)) {
|
|
@@ -10198,6 +10592,7 @@ function ITThemeProvider({
|
|
|
10198
10592
|
let tableRowText = palette2.table.rowText;
|
|
10199
10593
|
let tableHeaderBg = palette2.table.headerBg;
|
|
10200
10594
|
let tableHeaderText = palette2.table.headerText;
|
|
10595
|
+
let tableRowHover = palette2.table.rowHover;
|
|
10201
10596
|
let navbarBg = palette2.layout.navbarBg;
|
|
10202
10597
|
let navbarText = palette2.layout.navbarText;
|
|
10203
10598
|
let sidebarBg = palette2.layout.sidebarBg;
|
|
@@ -10215,6 +10610,9 @@ function ITThemeProvider({
|
|
|
10215
10610
|
if (!isLightColor2(tableHeaderText)) {
|
|
10216
10611
|
tableHeaderText = `color-mix(in srgb, ${palette2.table.headerText} 20%, #f9fafb)`;
|
|
10217
10612
|
}
|
|
10613
|
+
if (isLightColor2(tableRowHover)) {
|
|
10614
|
+
tableRowHover = `color-mix(in srgb, ${palette2.table.rowHover} 12%, #1f2937)`;
|
|
10615
|
+
}
|
|
10218
10616
|
if (isLightColor2(navbarBg)) {
|
|
10219
10617
|
navbarBg = `color-mix(in srgb, ${palette2.layout.navbarBg} 8%, #111827)`;
|
|
10220
10618
|
}
|
|
@@ -10240,7 +10638,10 @@ function ITThemeProvider({
|
|
|
10240
10638
|
}
|
|
10241
10639
|
if (isLightColor2(tableHeaderText)) {
|
|
10242
10640
|
tableHeaderText = `color-mix(in srgb, ${palette2.table.headerText} 30%, #334155)`;
|
|
10243
|
-
} else if (!isLightColor2(tableHeaderText) && isVeryDarkColor(
|
|
10641
|
+
} else if (!isLightColor2(tableHeaderText) && isVeryDarkColor(tableHeaderText)) {
|
|
10642
|
+
}
|
|
10643
|
+
if (!isLightColor2(tableRowHover)) {
|
|
10644
|
+
tableRowHover = isVeryDarkColor(palette2.table.rowHover) ? "#f1f5f9" : `color-mix(in srgb, ${palette2.table.rowHover} 12%, #f8fafc)`;
|
|
10244
10645
|
}
|
|
10245
10646
|
if (!isLightColor2(navbarBg)) {
|
|
10246
10647
|
navbarBg = isVeryDarkColor(palette2.layout.navbarBg) ? "#ffffff" : `color-mix(in srgb, ${palette2.layout.navbarBg} 8%, #ffffff)`;
|
|
@@ -10450,6 +10851,7 @@ function ITThemeProvider({
|
|
|
10450
10851
|
--color-table-headerText: ${tableHeaderText} !important;
|
|
10451
10852
|
--color-table-rowBg: ${tableRowBg} !important;
|
|
10452
10853
|
--color-table-rowText: ${tableRowText} !important;
|
|
10854
|
+
--color-table-rowHover: ${tableRowHover} !important;
|
|
10453
10855
|
|
|
10454
10856
|
/* Native library variables integration */
|
|
10455
10857
|
--it-sidebar-bg: var(--color-sidebarBg);
|
|
@@ -10793,7 +11195,7 @@ function ITThemeProvider({
|
|
|
10793
11195
|
color: var(--color-table-rowText) !important;
|
|
10794
11196
|
}
|
|
10795
11197
|
tbody tr:hover {
|
|
10796
|
-
background-color:
|
|
11198
|
+
background-color: var(--color-table-rowHover) !important;
|
|
10797
11199
|
}
|
|
10798
11200
|
|
|
10799
11201
|
/* Animation for Saved Indicator */
|
|
@@ -11555,7 +11957,8 @@ function ITThemeProvider({
|
|
|
11555
11957
|
"table.headerBg",
|
|
11556
11958
|
"table.headerText",
|
|
11557
11959
|
"table.rowBg",
|
|
11558
|
-
"table.rowText"
|
|
11960
|
+
"table.rowText",
|
|
11961
|
+
"table.rowHover"
|
|
11559
11962
|
].map((key) => /* @__PURE__ */ jsx71(ColorRow, { colorKey: key }, key)) })
|
|
11560
11963
|
}
|
|
11561
11964
|
]
|