mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-21 10:28:44 +00:00
fix(grid): show exact total row count by default
This commit is contained in:
@@ -310,8 +310,10 @@ interface DataGridProps {
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<DataGridProps>(), {
|
||||
// Vue casts absent Boolean props to false unless the default is explicitly
|
||||
// undefined; omitted row-action limits must keep normal table-data editing.
|
||||
// Vue casts absent Boolean props to false unless a default is explicit.
|
||||
// Regular grids have exact totals; document stores opt into lower-bound totals.
|
||||
totalRowCountIsExact: true,
|
||||
// Omitted row-action limits must keep normal table-data editing.
|
||||
allowInsertRows: undefined,
|
||||
allowDeleteRows: undefined,
|
||||
});
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import DataGrid from "../DataGrid.vue";
|
||||
|
||||
type VuePropDefinition = { default?: unknown };
|
||||
type VueComponentWithProps = { props?: Record<string, VuePropDefinition> };
|
||||
|
||||
describe("DataGrid total row count exactness", () => {
|
||||
it("treats totals as exact unless a caller explicitly marks them as a lower bound", () => {
|
||||
const component = DataGrid as unknown as VueComponentWithProps;
|
||||
expect(component.props?.totalRowCountIsExact?.default).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user