@fayz-ai/admin 0.66.0 → 0.67.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.
@@ -19,7 +19,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
19
19
  import { useAuthStore } from '@fayz-ai/auth';
20
20
  import { create } from 'zustand';
21
21
  import { Loader2, MapPin, Package, Pencil, Building2, Trash2, Upload, Search, ArrowDown, ArrowUp, ArrowUpDown, Check, Download, AlertTriangle, X, Users, Plus, ExternalLink, Sparkles, Edit, Camera, ChevronLeft, ChevronRight, ChevronDown, Inbox, Copy, Eye, Star, Landmark, User, ImagePlus, Clock, FileText, CalendarDays, BarChart3, Tag, Truck, ShieldCheck, UserMinus, Mail, UserX, KeyRound, Globe2, Heart, Briefcase, Settings2 } from 'lucide-react';
22
- import { ModalTask, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Button, Checkbox, Card, getLucideIcon, Badge, useRowSelection, ListFilterBar, Dropdown, DropdownTrigger, Hint, cn, DropdownContent, DropdownLabel, DropdownItem, DropdownSeparator, RefreshButton, Pagination, PageHeaderActions, PageTabs, StatTiles, BulkActionBar, DataTable, toast, usePageTrailParent, navigateToCrumb, PageHeader, ConfirmDialog, Markdown, PhoneLink, Switch, Skeleton, useSaveBar, Tabs, TabsContent, CardContent, useBackHandler, SubpageHeader, Modal, ModalPortal, ModalOverlay, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalBody, ModalFooter, Avatar, AvatarImage, AvatarFallback, PersonAvatar, RowActions, TabsList, TabsTrigger, ICON_MAP, ViewTabs, CurrencyInput, MarkdownEditor, Textarea, PhoneField, SearchSelect } from '@fayz-ai/ui';
22
+ import { ModalTask, Input, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, Button, Checkbox, Card, getLucideIcon, Badge, useRowSelection, ListFilterBar, Dropdown, DropdownTrigger, Hint, cn, DropdownContent, DropdownLabel, DropdownItem, DropdownSeparator, RefreshButton, Pagination, PageHeaderActions, PageTabs, StatTiles, BulkActionBar, DataTable, usePageSize, toast, usePageTrailParent, navigateToCrumb, PageHeader, ConfirmDialog, Markdown, PhoneLink, Switch, Skeleton, useSaveBar, Tabs, TabsContent, CardContent, useBackHandler, SubpageHeader, Modal, ModalPortal, ModalOverlay, ModalContent, ModalHeader, ModalTitle, ModalDescription, ModalBody, ModalFooter, Avatar, AvatarImage, AvatarFallback, PersonAvatar, RowActions, TabsList, TabsTrigger, ICON_MAP, ViewTabs, CurrencyInput, MarkdownEditor, Textarea, PhoneField, SearchSelect } from '@fayz-ai/ui';
23
23
 
24
24
  function useSystemPermission() {
25
25
  const currentProfile = usePermissionsStore((s) => s.currentProfile);
@@ -2894,6 +2894,7 @@ function CrudListView({
2894
2894
  totalIsEstimate,
2895
2895
  page = 1,
2896
2896
  pageSize = 50,
2897
+ onPageSizeChange,
2897
2898
  onPageChange,
2898
2899
  display = "table",
2899
2900
  search,
@@ -3167,6 +3168,7 @@ function CrudListView({
3167
3168
  pageSize,
3168
3169
  total: totalItems,
3169
3170
  onPageChange,
3171
+ onPageSizeChange,
3170
3172
  noun: (namePlural ?? t("crud.list.records")).toLowerCase(),
3171
3173
  totalIsEstimate: totalIsEstimate || total <= 0,
3172
3174
  hasMore: podeHaverMais && (totalIsEstimate || total <= 0)
@@ -3588,6 +3590,7 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
3588
3590
  const [activeFilters, setActiveFilters] = useState(initialFilters);
3589
3591
  const activeFiltersRef = useRef(initialFilters());
3590
3592
  const [page, setPage] = useState(1);
3593
+ const [pageSize, setPageSize] = usePageSize(`crud.${entityDef.name}`, PAGE_SIZE);
3591
3594
  const pluralKey = entityDef.namePluralKey ?? entityDef.nameKey;
3592
3595
  const namePlural = pluralKey ? t(pluralKey) : t("crud.list.records");
3593
3596
  const navLabel = pluralKey ? t(pluralKey) : entityDef.namePlural ?? entityDef.name;
@@ -3621,6 +3624,11 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
3621
3624
  setPage(next);
3622
3625
  store.setQuery({ page: next });
3623
3626
  }, [store]);
3627
+ const handlePageSizeChange = useCallback((next) => {
3628
+ setPageSize(next);
3629
+ setPage(1);
3630
+ store.setQuery({ page: 1, pageSize: next });
3631
+ }, [store, setPageSize]);
3624
3632
  const [sort, setSort] = useState({
3625
3633
  by: entityDef.defaultSort,
3626
3634
  dir: entityDef.defaultSortDir ?? "asc"
@@ -3683,7 +3691,7 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
3683
3691
  const currentOrgId = useOrganizationStore((s) => s.currentOrg?.id);
3684
3692
  const guardImport = useLimitGuard(entityDef.limitKey ?? "");
3685
3693
  useEffect(() => {
3686
- if (currentOrgId) store.setQuery({ page: 1, pageSize: PAGE_SIZE, filters: activeFiltersRef.current });
3694
+ if (currentOrgId) store.setQuery({ page: 1, pageSize, filters: activeFiltersRef.current });
3687
3695
  }, [currentOrgId]);
3688
3696
  const detailId = sub.startsWith("/") && sub.length > 1 && !sub.endsWith("/edit") && sub !== "/new" ? sub.slice(1).split("/")[0] : null;
3689
3697
  useEffect(() => {
@@ -3894,8 +3902,9 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
3894
3902
  total: store.total,
3895
3903
  totalIsEstimate: store.totalIsEstimate,
3896
3904
  page,
3897
- pageSize: PAGE_SIZE,
3905
+ pageSize,
3898
3906
  onPageChange: handlePageChange,
3907
+ onPageSizeChange: handlePageSizeChange,
3899
3908
  display,
3900
3909
  emptyHint,
3901
3910
  search: searchInput,
@@ -7853,5 +7862,5 @@ function CrudRecordModal({
7853
7862
  }
7854
7863
 
7855
7864
  export { AddressFormModal, CrudCardGrid, CrudDetailPage, CrudDetailSkeleton, CrudFormPage, CrudFormSkeleton, CrudListView, CrudPage, CrudRecordModal, EntitlementGate, EntityLink, InlineEditor, InlineField, LimitGate, PermissionGate, RecordMetaFooter, RelatedListTab, TagChip, TagsField, UnitMembersTab, WidgetSlot, applyFieldRules, createCrudPage, createCrudStore, duplicateWrite, exportToCSV, fetchMyPersonRecord, findMyPersonCandidate, formatFieldValue, getCrudNavTabs, getPersonPath, getTabCountProviders, humanizeWriteError, invalidateRelationOptions, invalidateTabCounts, linkPersonToLogin, registerCrudNavTabs, registerEntityPath, registerTabCountProvider, unregisterTabCountProvider, useFieldRules, useHeaderAction, useHeaderActions, useInviteStore, useModuleAccess, useMyPersonId, usePersonTabCounts, useSystemPermission, useUnitFilter, useUnitSwitchingStore, useWidgetSurface };
7856
- //# sourceMappingURL=chunk-BFOH3AVP.js.map
7857
- //# sourceMappingURL=chunk-BFOH3AVP.js.map
7865
+ //# sourceMappingURL=chunk-RLZCH4NU.js.map
7866
+ //# sourceMappingURL=chunk-RLZCH4NU.js.map