Compare commits
2 Commits
v2.4.29
...
8f74efba97
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f74efba97 | ||
|
|
b9103c59f0 |
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "app-ts",
|
||||
"version": "2.4.29",
|
||||
"version": "2.4.30",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "app-ts",
|
||||
"version": "2.4.29",
|
||||
"version": "2.4.30",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@anthropic-ai/sdk": "^0.102.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "app-ts",
|
||||
"version": "2.4.29",
|
||||
"version": "2.4.30",
|
||||
"description": "",
|
||||
"main": "dist/server.js",
|
||||
"scripts": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,7 @@ import {
|
||||
LoadingState,
|
||||
FilterBar,
|
||||
Tabs,
|
||||
TabPanel,
|
||||
PageHeader,
|
||||
PageEnter,
|
||||
type DataColumn,
|
||||
@@ -706,7 +707,7 @@ export default function Invoices() {
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{activeTab === "received" ? (
|
||||
<TabPanel value="received" current={activeTab} sx={{ pt: 0 }}>
|
||||
<Suspense fallback={<LoadingState />}>
|
||||
<ReceivedInvoices
|
||||
statsMonth={statsMonth}
|
||||
@@ -715,7 +716,8 @@ export default function Invoices() {
|
||||
setUploadOpen={setReceivedUploadOpen}
|
||||
/>
|
||||
</Suspense>
|
||||
) : (
|
||||
</TabPanel>
|
||||
<TabPanel value="issued" current={activeTab} sx={{ pt: 0 }}>
|
||||
<>
|
||||
{renderKpi()}
|
||||
|
||||
@@ -808,7 +810,7 @@ export default function Invoices() {
|
||||
loading={deleting}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</TabPanel>
|
||||
</PageEnter>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,14 @@ import Typography from "@mui/material/Typography";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import { useAuth } from "../context/AuthContext";
|
||||
import Forbidden from "../components/Forbidden";
|
||||
import { Button, Tabs, PageHeader, PageEnter, LoadingState } from "../ui";
|
||||
import {
|
||||
Button,
|
||||
Tabs,
|
||||
TabPanel,
|
||||
PageHeader,
|
||||
PageEnter,
|
||||
LoadingState,
|
||||
} from "../ui";
|
||||
import OrdersReceived from "./ReceivedOrders";
|
||||
|
||||
const IssuedOrders = lazy(() => import("./IssuedOrders"));
|
||||
@@ -170,18 +177,19 @@ export default function Orders() {
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
{activeTab === "vydane" ? (
|
||||
<TabPanel value="vydane" current={activeTab} sx={{ pt: 0 }}>
|
||||
<Suspense fallback={<LoadingState />}>
|
||||
<IssuedOrders month={statsMonth} year={statsYear} />
|
||||
</Suspense>
|
||||
) : (
|
||||
</TabPanel>
|
||||
<TabPanel value="prijate" current={activeTab} sx={{ pt: 0 }}>
|
||||
<OrdersReceived
|
||||
month={statsMonth}
|
||||
year={statsYear}
|
||||
createOpen={createOpen}
|
||||
setCreateOpen={setCreateOpen}
|
||||
/>
|
||||
)}
|
||||
</TabPanel>
|
||||
</PageEnter>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
import { motion } from "framer-motion";
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
@@ -810,73 +809,67 @@ export default function ReceivedInvoices({
|
||||
<>
|
||||
{renderKpi()}
|
||||
|
||||
<motion.div
|
||||
initial={{ opacity: 0, y: 12 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ duration: 0.25, delay: 0.08 }}
|
||||
>
|
||||
<Card>
|
||||
<FilterBar>
|
||||
<Box sx={{ flex: "1 1 320px" }}>
|
||||
<TextField
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
placeholder="Hledat podle dodavatele nebo čísla faktury..."
|
||||
fullWidth
|
||||
/>
|
||||
</Box>
|
||||
</FilterBar>
|
||||
|
||||
{showListSkeleton ? (
|
||||
<LoadingState />
|
||||
) : (
|
||||
<DataTable<ReceivedInvoice>
|
||||
columns={columns}
|
||||
rows={invoices}
|
||||
rowKey={(inv) => inv.id}
|
||||
rowSx={rowSx}
|
||||
sortBy={sort}
|
||||
sortDir={order}
|
||||
onSort={handleSort}
|
||||
empty={
|
||||
search ? (
|
||||
<EmptyState title="Žádné faktury neodpovídají hledání." />
|
||||
) : (
|
||||
<EmptyState
|
||||
title="Žádné přijaté faktury v tomto měsíci."
|
||||
description={
|
||||
hasPermission("invoices.create")
|
||||
? "Nahrajte faktury tlačítkem výše."
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
<Card>
|
||||
<FilterBar>
|
||||
<Box sx={{ flex: "1 1 320px" }}>
|
||||
<TextField
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
placeholder="Hledat podle dodavatele nebo čísla faktury..."
|
||||
fullWidth
|
||||
/>
|
||||
)}
|
||||
{(listTotalsQuery.data?.length ?? 0) > 0 && (
|
||||
</Box>
|
||||
</FilterBar>
|
||||
|
||||
{showListSkeleton ? (
|
||||
<LoadingState />
|
||||
) : (
|
||||
<DataTable<ReceivedInvoice>
|
||||
columns={columns}
|
||||
rows={invoices}
|
||||
rowKey={(inv) => inv.id}
|
||||
rowSx={rowSx}
|
||||
sortBy={sort}
|
||||
sortDir={order}
|
||||
onSort={handleSort}
|
||||
empty={
|
||||
search ? (
|
||||
<EmptyState title="Žádné faktury neodpovídají hledání." />
|
||||
) : (
|
||||
<EmptyState
|
||||
title="Žádné přijaté faktury v tomto měsíci."
|
||||
description={
|
||||
hasPermission("invoices.create")
|
||||
? "Nahrajte faktury tlačítkem výše."
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)
|
||||
}
|
||||
/>
|
||||
)}
|
||||
{(listTotalsQuery.data?.length ?? 0) > 0 && (
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "flex-end",
|
||||
mt: 1.5,
|
||||
px: 1,
|
||||
gap: 1,
|
||||
color: "text.secondary",
|
||||
fontSize: "0.9rem",
|
||||
}}
|
||||
>
|
||||
<span>Celkem:</span>
|
||||
<Box
|
||||
sx={{
|
||||
display: "flex",
|
||||
justifyContent: "flex-end",
|
||||
mt: 1.5,
|
||||
px: 1,
|
||||
gap: 1,
|
||||
color: "text.secondary",
|
||||
fontSize: "0.9rem",
|
||||
}}
|
||||
component="span"
|
||||
sx={{ fontWeight: 700, color: "text.primary" }}
|
||||
>
|
||||
<span>Celkem:</span>
|
||||
<Box
|
||||
component="span"
|
||||
sx={{ fontWeight: 700, color: "text.primary" }}
|
||||
>
|
||||
{formatMultiCurrency(listTotalsQuery.data ?? [])}
|
||||
</Box>
|
||||
{formatMultiCurrency(listTotalsQuery.data ?? [])}
|
||||
</Box>
|
||||
)}
|
||||
</Card>
|
||||
</motion.div>
|
||||
</Box>
|
||||
)}
|
||||
</Card>
|
||||
|
||||
{/* Upload Modal */}
|
||||
<Modal
|
||||
|
||||
@@ -2,6 +2,8 @@ import type { ReactNode } from "react";
|
||||
import MuiTabs from "@mui/material/Tabs";
|
||||
import Tab from "@mui/material/Tab";
|
||||
import Box from "@mui/material/Box";
|
||||
import { keyframes } from "@mui/system";
|
||||
import type { SxProps, Theme } from "@mui/material/styles";
|
||||
|
||||
export interface TabDef {
|
||||
value: string;
|
||||
@@ -47,15 +49,26 @@ export function Tabs({
|
||||
);
|
||||
}
|
||||
|
||||
// The ONE tab-switch animation, app-wide: enter-only fade of the incoming
|
||||
// panel (M3 "clean fade" — old content drops instantly, no exit/slide; tabs
|
||||
// are too high-frequency for anything longer). Kept as a CSS animation so the
|
||||
// global prefers-reduced-motion kill switch in GlobalStyles neutralizes it.
|
||||
const panelEnter = keyframes({
|
||||
from: { opacity: 0, transform: "translateY(6px)" },
|
||||
to: { opacity: 1, transform: "none" },
|
||||
});
|
||||
|
||||
/** Renders children only when its value matches the current tab. */
|
||||
export function TabPanel({
|
||||
value,
|
||||
current,
|
||||
children,
|
||||
sx,
|
||||
}: {
|
||||
value: string;
|
||||
current: string;
|
||||
children: ReactNode;
|
||||
sx?: SxProps<Theme>;
|
||||
}) {
|
||||
if (value !== current) return null;
|
||||
return (
|
||||
@@ -63,7 +76,13 @@ export function TabPanel({
|
||||
role="tabpanel"
|
||||
id={panelId(value)}
|
||||
aria-labelledby={tabId(value)}
|
||||
sx={{ pt: 2.5 }}
|
||||
sx={[
|
||||
{
|
||||
pt: 2.5,
|
||||
animation: `${panelEnter} 0.2s cubic-bezier(0.16, 1, 0.3, 1)`,
|
||||
},
|
||||
...(Array.isArray(sx) ? sx : [sx]),
|
||||
]}
|
||||
>
|
||||
{children}
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user