@fayz-ai/admin 0.65.6 → 0.67.0
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/dist/{ConnectedUserProfile-E7USJRUE.js → ConnectedUserProfile-2PP755RY.js} +3 -3
- package/dist/{ConnectedUserProfile-E7USJRUE.js.map → ConnectedUserProfile-2PP755RY.js.map} +1 -1
- package/dist/{GettingStartedWidget-HMIJ3Y24.js → GettingStartedWidget-MYS25I5J.js} +4 -4
- package/dist/{GettingStartedWidget-HMIJ3Y24.js.map → GettingStartedWidget-MYS25I5J.js.map} +1 -1
- package/dist/{TeamTab-6RAULFLW.js → TeamTab-M5SAKV6M.js} +4 -4
- package/dist/{TeamTab-6RAULFLW.js.map → TeamTab-M5SAKV6M.js.map} +1 -1
- package/dist/{chunk-5WR62X2R.js → chunk-AIDRTAXD.js} +3 -3
- package/dist/{chunk-5WR62X2R.js.map → chunk-AIDRTAXD.js.map} +1 -1
- package/dist/{chunk-Y66JDL6I.js → chunk-EZWCZ4U5.js} +3 -3
- package/dist/{chunk-Y66JDL6I.js.map → chunk-EZWCZ4U5.js.map} +1 -1
- package/dist/{chunk-WPFZCYZL.js → chunk-HNU4H7FQ.js} +16 -2
- package/dist/chunk-HNU4H7FQ.js.map +1 -0
- package/dist/{chunk-U6ZCO2PS.js → chunk-PYTAPPG2.js} +3 -3
- package/dist/{chunk-U6ZCO2PS.js.map → chunk-PYTAPPG2.js.map} +1 -1
- package/dist/{chunk-7WNLL3F6.js → chunk-RLZCH4NU.js} +27 -50
- package/dist/chunk-RLZCH4NU.js.map +1 -0
- package/dist/components/connect/connector-map.generated.d.ts.map +1 -1
- package/dist/{connect-XKQJOWR7.js → connect-5ZSLYJAS.js} +4 -4
- package/dist/{connect-XKQJOWR7.js.map → connect-5ZSLYJAS.js.map} +1 -1
- package/dist/crud/CrudListView.d.ts +3 -1
- package/dist/crud/CrudListView.d.ts.map +1 -1
- package/dist/crud/CrudPage.d.ts.map +1 -1
- package/dist/crud/archetypes/OrderListView.d.ts +3 -1
- package/dist/crud/archetypes/OrderListView.d.ts.map +1 -1
- package/dist/index.js +21 -19
- package/dist/index.js.map +1 -1
- package/dist/ui.d.ts +2 -2
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-7WNLL3F6.js.map +0 -1
- package/dist/chunk-WPFZCYZL.js.map +0 -1
|
@@ -18,8 +18,8 @@ import { payeeAccountFields, usePluginRuntimeOptional, useActiveUnitId, unitDisa
|
|
|
18
18
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
19
19
|
import { useAuthStore } from '@fayz-ai/auth';
|
|
20
20
|
import { create } from 'zustand';
|
|
21
|
-
import { Loader2, MapPin, Package, Pencil, Building2, Trash2, Upload, Search, ArrowDown, ArrowUp, ArrowUpDown, Check, Download,
|
|
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, 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';
|
|
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, 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,
|
|
@@ -3159,51 +3160,20 @@ function CrudListView({
|
|
|
3159
3160
|
] }) : null;
|
|
3160
3161
|
const rows = items?.length ?? 0;
|
|
3161
3162
|
const totalItems = total > 0 ? total : rows;
|
|
3162
|
-
const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));
|
|
3163
3163
|
const podeHaverMais = rows >= pageSize;
|
|
3164
|
-
const
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3170
|
-
|
|
3171
|
-
|
|
3172
|
-
|
|
3173
|
-
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
onPageChange && (totalPages > 1 || podeHaverMais || page > 1) && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
|
|
3178
|
-
/* @__PURE__ */ jsx(
|
|
3179
|
-
Button,
|
|
3180
|
-
{
|
|
3181
|
-
variant: "bare",
|
|
3182
|
-
size: "bare",
|
|
3183
|
-
type: "button",
|
|
3184
|
-
"aria-label": t("crud.list.prevPage"),
|
|
3185
|
-
className: pagerBtn,
|
|
3186
|
-
disabled: page <= 1,
|
|
3187
|
-
onClick: () => onPageChange(page - 1),
|
|
3188
|
-
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-4 w-4" })
|
|
3189
|
-
}
|
|
3190
|
-
),
|
|
3191
|
-
/* @__PURE__ */ jsx("span", { className: "px-1 text-xs tabular-nums text-muted-foreground", children: totalIsEstimate ? t("crud.list.pageN", { page: page.toLocaleString() }) : t("crud.list.pageOf", { page: page.toLocaleString(), pages: totalPages.toLocaleString() }) }),
|
|
3192
|
-
/* @__PURE__ */ jsx(
|
|
3193
|
-
Button,
|
|
3194
|
-
{
|
|
3195
|
-
variant: "bare",
|
|
3196
|
-
size: "bare",
|
|
3197
|
-
type: "button",
|
|
3198
|
-
"aria-label": t("crud.list.nextPage"),
|
|
3199
|
-
className: pagerBtn,
|
|
3200
|
-
disabled: !temProxima,
|
|
3201
|
-
onClick: () => onPageChange(page + 1),
|
|
3202
|
-
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" })
|
|
3203
|
-
}
|
|
3204
|
-
)
|
|
3205
|
-
] })
|
|
3206
|
-
] }) : null;
|
|
3164
|
+
const tableFooter = !isInitialLoad && !isEmpty ? /* @__PURE__ */ jsx(
|
|
3165
|
+
Pagination,
|
|
3166
|
+
{
|
|
3167
|
+
page,
|
|
3168
|
+
pageSize,
|
|
3169
|
+
total: totalItems,
|
|
3170
|
+
onPageChange,
|
|
3171
|
+
onPageSizeChange,
|
|
3172
|
+
noun: (namePlural ?? t("crud.list.records")).toLowerCase(),
|
|
3173
|
+
totalIsEstimate: totalIsEstimate || total <= 0,
|
|
3174
|
+
hasMore: podeHaverMais && (totalIsEstimate || total <= 0)
|
|
3175
|
+
}
|
|
3176
|
+
) : null;
|
|
3207
3177
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-6", children: [
|
|
3208
3178
|
actions && (embedded ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center justify-end gap-3", children: actions }) : /* @__PURE__ */ jsx(PageHeaderActions, { children: actions })),
|
|
3209
3179
|
headerTabs && // The same band a module's sub-nav draws, closed by the hairline that
|
|
@@ -3620,6 +3590,7 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
|
|
|
3620
3590
|
const [activeFilters, setActiveFilters] = useState(initialFilters);
|
|
3621
3591
|
const activeFiltersRef = useRef(initialFilters());
|
|
3622
3592
|
const [page, setPage] = useState(1);
|
|
3593
|
+
const [pageSize, setPageSize] = usePageSize(`crud.${entityDef.name}`, PAGE_SIZE);
|
|
3623
3594
|
const pluralKey = entityDef.namePluralKey ?? entityDef.nameKey;
|
|
3624
3595
|
const namePlural = pluralKey ? t(pluralKey) : t("crud.list.records");
|
|
3625
3596
|
const navLabel = pluralKey ? t(pluralKey) : entityDef.namePlural ?? entityDef.name;
|
|
@@ -3653,6 +3624,11 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
|
|
|
3653
3624
|
setPage(next);
|
|
3654
3625
|
store.setQuery({ page: next });
|
|
3655
3626
|
}, [store]);
|
|
3627
|
+
const handlePageSizeChange = useCallback((next) => {
|
|
3628
|
+
setPageSize(next);
|
|
3629
|
+
setPage(1);
|
|
3630
|
+
store.setQuery({ page: 1, pageSize: next });
|
|
3631
|
+
}, [store, setPageSize]);
|
|
3656
3632
|
const [sort, setSort] = useState({
|
|
3657
3633
|
by: entityDef.defaultSort,
|
|
3658
3634
|
dir: entityDef.defaultSortDir ?? "asc"
|
|
@@ -3715,7 +3691,7 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
|
|
|
3715
3691
|
const currentOrgId = useOrganizationStore((s) => s.currentOrg?.id);
|
|
3716
3692
|
const guardImport = useLimitGuard(entityDef.limitKey ?? "");
|
|
3717
3693
|
useEffect(() => {
|
|
3718
|
-
if (currentOrgId) store.setQuery({ page: 1, pageSize
|
|
3694
|
+
if (currentOrgId) store.setQuery({ page: 1, pageSize, filters: activeFiltersRef.current });
|
|
3719
3695
|
}, [currentOrgId]);
|
|
3720
3696
|
const detailId = sub.startsWith("/") && sub.length > 1 && !sub.endsWith("/edit") && sub !== "/new" ? sub.slice(1).split("/")[0] : null;
|
|
3721
3697
|
useEffect(() => {
|
|
@@ -3926,8 +3902,9 @@ function CrudPage({ entityDef: rawEntityDef, useStore: useStore2, basePath, disp
|
|
|
3926
3902
|
total: store.total,
|
|
3927
3903
|
totalIsEstimate: store.totalIsEstimate,
|
|
3928
3904
|
page,
|
|
3929
|
-
pageSize
|
|
3905
|
+
pageSize,
|
|
3930
3906
|
onPageChange: handlePageChange,
|
|
3907
|
+
onPageSizeChange: handlePageSizeChange,
|
|
3931
3908
|
display,
|
|
3932
3909
|
emptyHint,
|
|
3933
3910
|
search: searchInput,
|
|
@@ -7885,5 +7862,5 @@ function CrudRecordModal({
|
|
|
7885
7862
|
}
|
|
7886
7863
|
|
|
7887
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 };
|
|
7888
|
-
//# sourceMappingURL=chunk-
|
|
7889
|
-
//# sourceMappingURL=chunk-
|
|
7865
|
+
//# sourceMappingURL=chunk-RLZCH4NU.js.map
|
|
7866
|
+
//# sourceMappingURL=chunk-RLZCH4NU.js.map
|