@fayz-ai/plugin-financial 0.26.0 → 0.26.2

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.
@@ -6,7 +6,7 @@ import { FinancialContextProvider, useFinancialConfig, useFinancialStore, useFin
6
6
  import * as React14 from 'react';
7
7
  import React14__default, { useMemo, useCallback, useState, useEffect, useRef } from 'react';
8
8
  import { useTranslation, navigateApp, appHref, useUnitMode, useDataChanged, describeError, resolveCurrency, exportCSV, formatCurrency as formatCurrency$1 } from '@fayz-ai/core';
9
- import { PageTransition, ModulePage, Button, DashboardCanvas, ComingSoon, SubpageHeader, PageTabs, StatTiles, Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, ListView, Input, DatePicker, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, DataTable, DateRangeControl, PageHeaderActions, FilterPanel, FilterPanelField, SearchSelect, SegmentedControl, Card, Hint, RequiredFilter, FilterMenuRow, toast, printDocument, ChoiceList, Skeleton, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalBody, ModalFooter, Badge, AiActionButton, CurrencyInput, ModalFlow, useSaveBar, Switch, Textarea, RowActions, WizardSteps } from '@fayz-ai/ui';
9
+ import { PageTransition, ModulePage, Button, DashboardCanvas, ComingSoon, SubpageHeader, PageTabs, StatTiles, Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, ListView, Input, DatePicker, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, DataTable, DateRangeControl, usePageSize, PageHeaderActions, FilterPanel, FilterPanelField, SearchSelect, SegmentedControl, Card, Pagination, Hint, RequiredFilter, FilterMenuRow, toast, printDocument, ChoiceList, Skeleton, Modal, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalBody, ModalFooter, Badge, AiActionButton, CurrencyInput, ModalFlow, useSaveBar, Switch, Textarea, RowActions, WizardSteps } from '@fayz-ai/ui';
10
10
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import { useTenantPluginSettings, useModuleNavigation, usePluginOnboardingGate, usePermissionOptional, useModuleNavAccess, PluginOnboardingGateSkeleton, PluginSettingsPanel, ModuleActionBar, EntitlementGate, UpgradePrompt, parseViewId, GetStarted, PermissionGate, PageActions, useUnitFilter, adminNavigateTo, PersonLink, createOneShotAsk, useLookupCreate, createArchetypeLookup, OrderFormSkeleton, OrderFormView, OrderFormBlock, OrderFormItemsCard, OrderFormItemRow, OrderFormAddItemStep, useAgentSurface, shrinkForVision, toInlineFile } from '@fayz-ai/admin';
12
12
  import { DollarSign, Landmark, CreditCard, BookOpen, Check, ChevronRight, Wallet, Receipt, CalendarClock, Plus, Loader2, BadgeCheck, Gift, Pencil, Target, Settings, Play, ArrowRight, Users, RefreshCw, CloudDownload, ListChecks, Search, ChevronDown, ArrowRightLeft, Building2, Download, Paperclip, CircleDashed, CircleEllipsis, CircleCheckBig, CircleAlert, Ban, Printer, FileText, Camera, Sparkles, Link2, FileSearch, Undo2, Eye, TriangleAlert, Trash2, CheckCheck, X, Pause, ShoppingCart, Car, Home, Utensils, Zap, Film, HeartPulse, Dumbbell, Music, ShoppingBag, CircleDollarSign, ArrowLeft, FileDown, AlertTriangle } from 'lucide-react';
@@ -4904,6 +4904,7 @@ function ReconciliationView() {
4904
4904
  });
4905
4905
  const [appliedSearch, setAppliedSearch] = useState("");
4906
4906
  const [page, setPage] = useState(1);
4907
+ const [pageSize, setPageSize] = usePageSize("financial.reconciliation", PAGE_SIZE);
4907
4908
  const [result, setResult] = useState(null);
4908
4909
  const [loading, setLoading] = useState(false);
4909
4910
  const [candidatos, setCandidatos] = useState({});
@@ -4942,13 +4943,13 @@ function ReconciliationView() {
4942
4943
  search: appliedSearch || void 0,
4943
4944
  hideInvestments: applied.hideInvestments,
4944
4945
  page,
4945
- pageSize: PAGE_SIZE
4946
+ pageSize
4946
4947
  });
4947
4948
  setResult(data);
4948
4949
  } finally {
4949
4950
  setLoading(false);
4950
4951
  }
4951
- }, [provider, applied, appliedSearch, page]);
4952
+ }, [provider, applied, appliedSearch, page, pageSize]);
4952
4953
  useEffect(() => {
4953
4954
  void load();
4954
4955
  }, [load]);
@@ -5067,9 +5068,6 @@ function ReconciliationView() {
5067
5068
  }
5068
5069
  const rows = result?.rows ?? [];
5069
5070
  const total = result?.total ?? 0;
5070
- const pages = Math.max(1, Math.ceil(total / PAGE_SIZE));
5071
- const firstRow = total === 0 ? 0 : (page - 1) * PAGE_SIZE + 1;
5072
- const lastRow = Math.min(page * PAGE_SIZE, total);
5073
5071
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
5074
5072
  /* @__PURE__ */ jsxs(PageHeaderActions, { children: [
5075
5073
  /* @__PURE__ */ jsx(PageActions, { actions: headerActions }),
@@ -5291,16 +5289,21 @@ function ReconciliationView() {
5291
5289
  ))
5292
5290
  ] }, bucket);
5293
5291
  }) }),
5294
- applied.accountId && total > 0 && /* @__PURE__ */ jsxs(Card, { className: "flex flex-wrap items-center gap-2 px-3 py-2", children: [
5295
- /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("financial.reconciliation.showing", { from: firstRow, to: lastRow, total }) }),
5296
- /* @__PURE__ */ jsxs("div", { className: "ml-auto flex items-center gap-1", children: [
5297
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", disabled: page <= 1 || loading, onClick: () => setPage(1), children: t("financial.reconciliation.first") }),
5298
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", disabled: page <= 1 || loading, onClick: () => setPage((p) => p - 1), children: t("financial.reconciliation.previous") }),
5299
- /* @__PURE__ */ jsx("span", { className: "px-2 text-xs text-muted-foreground", children: t("financial.reconciliation.pageOf", { page, pages }) }),
5300
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", disabled: page >= pages || loading, onClick: () => setPage((p) => p + 1), children: t("financial.reconciliation.next") }),
5301
- /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", disabled: page >= pages || loading, onClick: () => setPage(pages), children: t("financial.reconciliation.last") })
5302
- ] })
5303
- ] }),
5292
+ applied.accountId && total > 0 && /* @__PURE__ */ jsx(Card, { className: "overflow-hidden", children: /* @__PURE__ */ jsx(
5293
+ Pagination,
5294
+ {
5295
+ className: "border-t-0",
5296
+ page,
5297
+ pageSize,
5298
+ total,
5299
+ onPageChange: setPage,
5300
+ onPageSizeChange: (n) => {
5301
+ setPageSize(n);
5302
+ setPage(1);
5303
+ },
5304
+ disabled: loading
5305
+ }
5306
+ ) }),
5304
5307
  applied.accountId && result && total > 0 && /* @__PURE__ */ jsx(Hint, { label: t("financial.reconciliation.pageTotalsHint"), children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-3", children: [
5305
5308
  /* @__PURE__ */ jsx(TotalStat, { label: t("financial.reconciliation.pageCredits"), value: fmt(result.pageCredits), tone: "in" }),
5306
5309
  /* @__PURE__ */ jsx(TotalStat, { label: t("financial.reconciliation.pageDebits"), value: fmt(result.pageDebits), tone: "out" }),
@@ -6480,5 +6483,5 @@ function FinancialPage({ config: appConfig, provider, store, registries }) {
6480
6483
  }
6481
6484
 
6482
6485
  export { FinancialPage };
6483
- //# sourceMappingURL=FinancialPage-PGODULVH.js.map
6484
- //# sourceMappingURL=FinancialPage-PGODULVH.js.map
6486
+ //# sourceMappingURL=FinancialPage-EXFS4ADV.js.map
6487
+ //# sourceMappingURL=FinancialPage-EXFS4ADV.js.map