@fayz-ai/plugin-crm 0.32.15 → 0.32.17

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.
@@ -4,8 +4,8 @@ import { resolveSourceView } from './chunk-QJOLAGGN.js';
4
4
  import { CrmContextProvider, useCrmProvider, useCrmStore, useCrmConfig, formatCurrency } from './chunk-7V46TYYX.js';
5
5
  import * as React from 'react';
6
6
  import React__default, { useCallback, useMemo, useState, useEffect, useRef } from 'react';
7
- import { Archive, FileX2, FileCheck2, Send, FilePlus2, XCircle, Trophy, PhoneCall, MoveRight, Target, ArrowRightLeft, UserPlus, MapPin, MessageCircle, CheckSquare, FileText, Users, Mail, Phone, Filter, Globe, Check, ChevronRight, Plus, Settings, Tag, Briefcase, CircleDot, User, Download, CircleDashed, Search, Inbox, X, Play, Clock, Sparkles, Calendar, ArrowRight, MoreHorizontal, ChevronDown, Printer, Pencil, CircleCheckBig, Ban, Receipt, Package, CalendarClock, Loader2, Network, Building2, Star, Trash2, MessageSquareQuote, UserRound, CalendarDays, ThumbsDown, SignalHigh, CalendarRange, ChevronLeft, TrendingDown, UserCheck, AlertTriangle, Settings2, Repeat, Zap, Snowflake, Sun, Flame, Merge, Fingerprint, Paperclip, ImageOff, CircleAlert, Link2, CheckCircle2, SlidersHorizontal, ExternalLink, Clipboard, DollarSign, ThumbsUp, UserRoundPlus } from 'lucide-react';
8
- import { PageTransition, ModulePage, Button, useIsWide, PageHeaderActions, toast, FilterChip, MultiSelect, FilterMenu, FilterMenuRow, PersonAvatar, SubpageHeader, ListView, ConfirmDialog, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Textarea, ModalFooter, useSaveBar, SearchSelect, DatePicker, FilterPanel, FilterPanelField, RequiredFilter, Card, DataTable, Dropdown, DropdownTrigger, DropdownContent, DropdownItem, PhoneLink, ComingSoon, Switch, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, DashboardCanvas, PageViewBar, PersonPicker, cn, HeaderTabs, SheetBody, SheetFooter, Popover, PopoverTrigger, PopoverContent, getLucideIcon, DictateButton, DropdownLabel, DropdownSeparator, ModalDescription, normalizePhone } from '@fayz-ai/ui';
7
+ import { Archive, FileX2, FileCheck2, Send, FilePlus2, XCircle, Trophy, PhoneCall, MoveRight, Target, ArrowRightLeft, UserPlus, MapPin, MessageCircle, CheckSquare, FileText, Users, Mail, Phone, Filter, Globe, Check, ChevronRight, Plus, Settings, Tag, Briefcase, CircleDot, User, Download, CircleDashed, Search, Inbox, X, Play, Clock, Sparkles, Calendar, ArrowRight, MoreHorizontal, ChevronDown, Printer, Pencil, CircleCheckBig, Ban, Receipt, Package, CalendarClock, Loader2, Network, Building2, Star, Trash2, MessageSquareQuote, UserRound, CalendarDays, ThumbsDown, SignalHigh, CalendarRange, TrendingDown, UserCheck, AlertTriangle, Settings2, Repeat, Zap, Snowflake, Sun, Flame, Merge, Fingerprint, Paperclip, ImageOff, CircleAlert, Link2, CheckCircle2, SlidersHorizontal, ChevronLeft, ExternalLink, Clipboard, DollarSign, ThumbsUp, UserRoundPlus } from 'lucide-react';
8
+ import { PageTransition, ModulePage, Button, useIsWide, PageHeaderActions, toast, FilterChip, MultiSelect, FilterMenu, FilterMenuRow, PersonAvatar, SubpageHeader, ListView, ConfirmDialog, Modal, ModalContent, ModalHeader, ModalTitle, ModalBody, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Textarea, ModalFooter, useSaveBar, SearchSelect, DatePicker, FilterPanel, FilterPanelField, RequiredFilter, Card, DataTable, Dropdown, DropdownTrigger, DropdownContent, DropdownItem, PhoneLink, ComingSoon, Switch, TooltipProvider, Tooltip, TooltipTrigger, TooltipContent, DashboardCanvas, PageViewBar, Pagination, PersonPicker, cn, HeaderTabs, SheetBody, SheetFooter, Popover, PopoverTrigger, PopoverContent, getLucideIcon, DictateButton, DropdownLabel, DropdownSeparator, ModalDescription, normalizePhone } from '@fayz-ai/ui';
9
9
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
10
10
  import { usePluginRuntimeOptional, useTranslation, currentAppPath, navigateApp, useActiveTenantId, exportCSV, getCurrentLocale, appHref, getSupabaseClientOptional, loadMessageOverrides, resolveMessages, useActiveUnitId } from '@fayz-ai/core';
11
11
  import { useModuleNavigation, usePluginOnboardingGate, useUnitStore, PluginOnboardingGateSkeleton, createViewRouter, ModuleActionBar, adminNavigateTo, PageActions, usePermissionOptional, usePersistedState, useScrollMemory, useLimitGuard, useCatalogedItemTypes, OrderFormSkeleton, OrderFormBlock, OrderFormView, OrderFormItemsCard, OrderFormItemRow, OrderFormAddItemStep, createArchetypeLookup, useRecordVisit, OrderDetailSkeleton, OrderDetailBlock, OrderDetailView, PersonLink, CrudFormSkeleton, CrudFormPage, CrudDetailSkeleton, CrudDetailPage, AskAIButton, KanbanBoard, InlineField, useUnitFilter, invalidateLimit, useAccessOptional, useOrganizationStore, getRailPage, RightRailPage, ContactPicker, useAgentSurface } from '@fayz-ai/admin';
@@ -2277,13 +2277,10 @@ function DealListView({ onOpenDeal }) {
2277
2277
  }
2278
2278
  }
2279
2279
  ], [currency, t]);
2280
- const totalPages = Math.max(1, Math.ceil(rows.length / PAGE_SIZE));
2281
2280
  const pageRows = useMemo(
2282
2281
  () => rows.slice((page - 1) * PAGE_SIZE, page * PAGE_SIZE),
2283
2282
  [rows, page]
2284
2283
  );
2285
- const from = rows.length === 0 ? 0 : (page - 1) * PAGE_SIZE + 1;
2286
- const to = Math.min(page * PAGE_SIZE, rows.length);
2287
2284
  const capped = deals.length >= LOAD_CAP;
2288
2285
  const segmentRules = useMemo(() => {
2289
2286
  const out = [];
@@ -2556,43 +2553,16 @@ function DealListView({ onOpenDeal }) {
2556
2553
  ] })
2557
2554
  }
2558
2555
  ),
2559
- !dealsLoading && rows.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 border-t border-border px-3 py-2", children: [
2560
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: t("crud.list.rangeCount", {
2561
- from: from.toLocaleString(currency.locale),
2562
- to: to.toLocaleString(currency.locale),
2563
- total: rows.length.toLocaleString(currency.locale),
2564
- entities: t("crm.deals.title").toLowerCase()
2565
- }) }),
2566
- totalPages > 1 && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
2567
- /* @__PURE__ */ jsx(
2568
- Button,
2569
- {
2570
- type: "button",
2571
- "aria-label": t("crud.list.prevPage"),
2572
- disabled: page <= 1,
2573
- onClick: () => setPage((p) => p - 1),
2574
- variant: "ghost",
2575
- size: "icon",
2576
- className: "h-7 w-7 rounded-md text-muted-foreground disabled:opacity-40",
2577
- children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
2578
- }
2579
- ),
2580
- /* @__PURE__ */ jsx("span", { className: "px-1 text-xs tabular-nums text-muted-foreground", children: t("crud.list.pageOf", { page: String(page), pages: String(totalPages) }) }),
2581
- /* @__PURE__ */ jsx(
2582
- Button,
2583
- {
2584
- type: "button",
2585
- "aria-label": t("crud.list.nextPage"),
2586
- disabled: page >= totalPages,
2587
- onClick: () => setPage((p) => p + 1),
2588
- variant: "ghost",
2589
- size: "icon",
2590
- className: "h-7 w-7 rounded-md text-muted-foreground disabled:opacity-40",
2591
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
2592
- }
2593
- )
2594
- ] })
2595
- ] })
2556
+ !dealsLoading && rows.length > 0 && /* @__PURE__ */ jsx(
2557
+ Pagination,
2558
+ {
2559
+ page,
2560
+ pageSize: PAGE_SIZE,
2561
+ total: rows.length,
2562
+ onPageChange: setPage,
2563
+ noun: t("crm.deals.title").toLowerCase()
2564
+ }
2565
+ )
2596
2566
  ] }),
2597
2567
  capped && /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground", children: t("crm.deals.capped", { count: String(LOAD_CAP) }) }),
2598
2568
  /* @__PURE__ */ jsx(
@@ -10208,5 +10178,5 @@ function CrmPage({ config, provider, store, registries }) {
10208
10178
  }
10209
10179
 
10210
10180
  export { CrmPage };
10211
- //# sourceMappingURL=CrmPage-BHJG2BZV.js.map
10212
- //# sourceMappingURL=CrmPage-BHJG2BZV.js.map
10181
+ //# sourceMappingURL=CrmPage-AQ3K22YL.js.map
10182
+ //# sourceMappingURL=CrmPage-AQ3K22YL.js.map