@open-mercato/ui 0.6.8-develop.7100.1.fbf66fca35 → 0.7.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/.turbo/turbo-build.log +1 -1
- package/dist/ai/records/ActivityCard.js +3 -4
- package/dist/ai/records/ActivityCard.js.map +2 -2
- package/dist/ai/records/DealCard.js +3 -4
- package/dist/ai/records/DealCard.js.map +2 -2
- package/dist/ai/records/ProductCard.js +2 -3
- package/dist/ai/records/ProductCard.js.map +2 -2
- package/dist/backend/AppShell.js +106 -129
- package/dist/backend/AppShell.js.map +2 -2
- package/dist/backend/DataTable.js +9 -22
- package/dist/backend/DataTable.js.map +2 -2
- package/dist/backend/detail/NotesSection.js +20 -26
- package/dist/backend/detail/NotesSection.js.map +2 -2
- package/dist/backend/icons/lucideRegistry.generated.js +0 -4
- package/dist/backend/icons/lucideRegistry.generated.js.map +2 -2
- package/dist/backend/injection/useRegisteredComponent.js +6 -24
- package/dist/backend/injection/useRegisteredComponent.js.map +2 -2
- package/dist/backend/inputs/ComboboxInput.js +4 -8
- package/dist/backend/inputs/ComboboxInput.js.map +2 -2
- package/dist/backend/inputs/LookupSelect.js +9 -9
- package/dist/backend/inputs/LookupSelect.js.map +2 -2
- package/dist/backend/sidebar/SidebarCustomizationEditor.js +30 -36
- package/dist/backend/sidebar/SidebarCustomizationEditor.js.map +2 -2
- package/dist/backend/utils/crud.js.map +2 -2
- package/dist/backend/utils/useAutoDiscoveredFields.js +8 -4
- package/dist/backend/utils/useAutoDiscoveredFields.js.map +2 -2
- package/dist/primitives/alert.js +1 -1
- package/dist/primitives/alert.js.map +2 -2
- package/dist/primitives/icon-button.js +1 -20
- package/dist/primitives/icon-button.js.map +2 -2
- package/dist/primitives/pagination.js +9 -14
- package/dist/primitives/pagination.js.map +2 -2
- package/dist/primitives/rich-editor.js +7 -14
- package/dist/primitives/rich-editor.js.map +2 -2
- package/dist/utils/format.js +5 -5
- package/dist/utils/format.js.map +2 -2
- package/package.json +4 -5
- package/src/ai/parts/__tests__/ConfirmationCard.test.tsx +0 -2
- package/src/ai/records/ActivityCard.tsx +3 -4
- package/src/ai/records/DealCard.tsx +3 -4
- package/src/ai/records/ProductCard.tsx +2 -3
- package/src/backend/AppShell.tsx +58 -89
- package/src/backend/DataTable.tsx +12 -46
- package/src/backend/__tests__/AppShell.test.tsx +1 -162
- package/src/backend/__tests__/DataTable.render.test.tsx +0 -37
- package/src/backend/__tests__/NotesSection.test.tsx +0 -89
- package/src/backend/detail/NotesSection.tsx +67 -92
- package/src/backend/icons/lucideRegistry.generated.tsx +0 -4
- package/src/backend/injection/useRegisteredComponent.tsx +8 -49
- package/src/backend/inputs/ComboboxInput.tsx +5 -21
- package/src/backend/inputs/LookupSelect.tsx +14 -10
- package/src/backend/inputs/__tests__/ComboboxInput.test.tsx +0 -142
- package/src/backend/inputs/__tests__/LookupSelect.test.tsx +40 -63
- package/src/backend/sidebar/SidebarCustomizationEditor.tsx +11 -14
- package/src/backend/utils/__tests__/useAutoDiscoveredFields.groupLabels.test.tsx +59 -0
- package/src/backend/utils/crud.ts +0 -2
- package/src/backend/utils/useAutoDiscoveredFields.ts +10 -4
- package/src/primitives/__tests__/alert.test.tsx +1 -41
- package/src/primitives/__tests__/icon-button.test.tsx +0 -70
- package/src/primitives/__tests__/notification.test.tsx +1 -1
- package/src/primitives/__tests__/pagination.test.tsx +0 -54
- package/src/primitives/__tests__/rich-editor.test.tsx +0 -43
- package/src/primitives/alert.tsx +2 -5
- package/src/primitives/icon-button.tsx +1 -20
- package/src/primitives/pagination.tsx +9 -40
- package/src/primitives/rich-editor.tsx +4 -9
- package/src/utils/__tests__/format.test.ts +14 -27
- package/src/utils/format.ts +5 -10
- package/src/backend/__tests__/DataTable.cappedPagination.test.tsx +0 -122
- package/src/backend/__tests__/DataTable.headerWrap.test.tsx +0 -111
- package/src/backend/__tests__/useRegisteredComponent.identity.test.tsx +0 -305
|
@@ -1853,11 +1853,8 @@ function DataTable({
|
|
|
1853
1853
|
const paginationNode = React.useMemo(() => {
|
|
1854
1854
|
if (!pagination || pagination.total === 0) return null;
|
|
1855
1855
|
const { page, totalPages, onPageChange, durationMs, cacheStatus } = pagination;
|
|
1856
|
-
const totalIsCapped = pagination.totalIsCapped === true;
|
|
1857
|
-
const pageIsFull = data.length >= pagination.pageSize;
|
|
1858
1856
|
const startItem = (page - 1) * pagination.pageSize + 1;
|
|
1859
|
-
const endItem =
|
|
1860
|
-
const pageIsEmpty = data.length === 0;
|
|
1857
|
+
const endItem = Math.min(page * pagination.pageSize, pagination.total);
|
|
1861
1858
|
const effectiveDuration = typeof durationMs === "number" && Number.isFinite(durationMs) && durationMs >= 0 ? durationMs : measuredDurationMs ?? void 0;
|
|
1862
1859
|
const durationLabel = showQueryTime ? formatDurationLabel(effectiveDuration) : "";
|
|
1863
1860
|
const normalizedCacheStatus = cacheStatus === "hit" || cacheStatus === "miss" ? cacheStatus : null;
|
|
@@ -1890,8 +1887,6 @@ function DataTable({
|
|
|
1890
1887
|
page,
|
|
1891
1888
|
pageSize: pagination.pageSize,
|
|
1892
1889
|
total: pagination.total,
|
|
1893
|
-
totalIsCapped,
|
|
1894
|
-
hasNextPage: totalIsCapped ? pageIsFull : void 0,
|
|
1895
1890
|
onPageChange: (next) => {
|
|
1896
1891
|
onPageChange(next);
|
|
1897
1892
|
scrollTableIntoView();
|
|
@@ -1901,22 +1896,14 @@ function DataTable({
|
|
|
1901
1896
|
scrollTableIntoView();
|
|
1902
1897
|
} : void 0,
|
|
1903
1898
|
pageSizeOptions,
|
|
1904
|
-
formatPageInfo: () => {
|
|
1905
|
-
if (totalIsCapped) {
|
|
1906
|
-
if (pageIsEmpty) {
|
|
1907
|
-
return t("ui.dataTable.pagination.resultsCappedNoRows", "No further results past {total}", { total: pagination.total });
|
|
1908
|
-
}
|
|
1909
|
-
return durationLabel ? t("ui.dataTable.pagination.resultsCappedWithDuration", "Showing {start} to {end} of {total}+ results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.resultsCapped", "Showing {start} to {end} of {total}+ results", { start: startItem, end: endItem, total: pagination.total });
|
|
1910
|
-
}
|
|
1911
|
-
return durationLabel ? t("ui.dataTable.pagination.resultsWithDuration", "Showing {start} to {end} of {total} results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.results", "Showing {start} to {end} of {total} results", { start: startItem, end: endItem, total: pagination.total });
|
|
1912
|
-
},
|
|
1899
|
+
formatPageInfo: () => durationLabel ? t("ui.dataTable.pagination.resultsWithDuration", "Showing {start} to {end} of {total} results in {duration}", { start: startItem, end: endItem, total: pagination.total, duration: durationLabel }) : t("ui.dataTable.pagination.results", "Showing {start} to {end} of {total} results", { start: startItem, end: endItem, total: pagination.total }),
|
|
1913
1900
|
formatPageSizeLabel: (size) => `${size} ${t("ui.dataTable.pagination.perPage", "per page")}`,
|
|
1914
1901
|
"aria-label": t("ui.dataTable.pagination.navAriaLabel", "Table pagination"),
|
|
1915
1902
|
className: "flex-1"
|
|
1916
1903
|
}
|
|
1917
1904
|
)
|
|
1918
1905
|
] });
|
|
1919
|
-
}, [pagination,
|
|
1906
|
+
}, [pagination, showQueryTime, measuredDurationMs, scrollTableIntoView, t]);
|
|
1920
1907
|
const resolvedEntityIds = React.useMemo(() => {
|
|
1921
1908
|
if (Array.isArray(entityIds) && entityIds.length) {
|
|
1922
1909
|
const dedup = /* @__PURE__ */ new Set();
|
|
@@ -2049,10 +2036,10 @@ function DataTable({
|
|
|
2049
2036
|
return table.getAllLeafColumns().map((col) => ({
|
|
2050
2037
|
key: col.id,
|
|
2051
2038
|
label: resolveColumnLabel(col),
|
|
2052
|
-
group: "Columns",
|
|
2039
|
+
group: t("ui.columnChooser.defaultGroup", "Columns"),
|
|
2053
2040
|
alwaysVisible: !col.getCanHide()
|
|
2054
2041
|
}));
|
|
2055
|
-
}, [resolvedColumnChooserFields, table, resolveColumnLabel, columns]);
|
|
2042
|
+
}, [resolvedColumnChooserFields, table, resolveColumnLabel, columns, t]);
|
|
2056
2043
|
const visibleColumnKeys = React.useMemo(
|
|
2057
2044
|
() => table.getAllLeafColumns().filter((c) => c.getIsVisible()).map((c) => c.id),
|
|
2058
2045
|
[table, columnVisibility, columns]
|
|
@@ -2377,7 +2364,7 @@ function DataTable({
|
|
|
2377
2364
|
const shouldRenderHeader = hasTitle || renderToolbarInline || shouldRenderActionsWrapper || shouldRenderToolbarBelow;
|
|
2378
2365
|
const containerClassName = embedded ? "" : "rounded-lg border bg-card mx-1 sm:mx-2";
|
|
2379
2366
|
const headerWrapperClassName = embedded ? "pb-3" : "px-4 py-3 border-b";
|
|
2380
|
-
const headerContentClassName = "flex flex-col gap-2 sm:flex-row sm:
|
|
2367
|
+
const headerContentClassName = "flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between";
|
|
2381
2368
|
const toolbarWrapperClassName = embedded ? "mt-2" : "mt-3 pt-3 border-t";
|
|
2382
2369
|
const tableScrollWrapperClassName = embedded ? "" : "overflow-auto";
|
|
2383
2370
|
const virtualScrollRef = React.useRef(null);
|
|
@@ -2411,8 +2398,8 @@ function DataTable({
|
|
|
2411
2398
|
return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ jsxs("div", { ref: containerRef, className: containerClassName, "data-component-handle": resolvedReplacementHandle, children: [
|
|
2412
2399
|
shouldRenderHeader && /* @__PURE__ */ jsxs("div", { className: headerWrapperClassName, children: [
|
|
2413
2400
|
(hasTitle || shouldRenderActionsWrapper || renderToolbarInline) && /* @__PURE__ */ jsxs("div", { className: headerContentClassName, children: [
|
|
2414
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0
|
|
2415
|
-
shouldRenderActionsWrapper ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 min-h-[2.25rem]
|
|
2401
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 min-w-0", children: renderToolbarInline ? builtToolbar : titleContent }),
|
|
2402
|
+
shouldRenderActionsWrapper ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2 min-h-[2.25rem]", children: [
|
|
2416
2403
|
refreshButtonConfig ? /* @__PURE__ */ jsxs(
|
|
2417
2404
|
Button,
|
|
2418
2405
|
{
|
|
@@ -2577,7 +2564,7 @@ function DataTable({
|
|
|
2577
2564
|
return;
|
|
2578
2565
|
}
|
|
2579
2566
|
if (onRowClick) {
|
|
2580
|
-
onRowClick(row.original
|
|
2567
|
+
onRowClick(row.original);
|
|
2581
2568
|
} else if (defaultRowAction) {
|
|
2582
2569
|
if (defaultRowAction.href) {
|
|
2583
2570
|
router.push(defaultRowAction.href);
|