@eifi1/ui-kit 0.48.1 → 0.48.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.
- package/README.md +4 -3
- package/dist/components/data-table-fit.d.ts +8 -1
- package/dist/components/data-table-fit.js +7 -1
- package/dist/components/data-table-fit.js.map +1 -1
- package/dist/components/data-table-groups.d.ts +3 -1
- package/dist/components/data-table-groups.js +11 -5
- package/dist/components/data-table-groups.js.map +1 -1
- package/dist/components/data-table-head.d.ts +8 -1
- package/dist/components/data-table-head.js +11 -3
- package/dist/components/data-table-head.js.map +1 -1
- package/dist/components/data-table-leading-row.d.ts +3 -1
- package/dist/components/data-table-leading-row.js +2 -1
- package/dist/components/data-table-leading-row.js.map +1 -1
- package/dist/components/data-table-row-actions.js +2 -2
- package/dist/components/data-table-row-actions.js.map +1 -1
- package/dist/components/data-table-row.d.ts +84 -0
- package/dist/components/data-table-row.js +261 -0
- package/dist/components/data-table-row.js.map +1 -0
- package/dist/components/data-table-selection.d.ts +3 -0
- package/dist/components/data-table-selection.js +12 -1
- package/dist/components/data-table-selection.js.map +1 -1
- package/dist/components/data-table-virtual.d.ts +98 -0
- package/dist/components/data-table-virtual.js +369 -0
- package/dist/components/data-table-virtual.js.map +1 -0
- package/dist/components/data-table.d.ts +40 -1
- package/dist/components/data-table.js +213 -218
- package/dist/components/data-table.js.map +1 -1
- package/dist/data-table.d.ts +1 -0
- package/dist/data-table.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/hooks/use-anchored-panel.js +2 -1
- package/dist/hooks/use-anchored-panel.js.map +1 -1
- package/dist/shell/app-shell.js +7 -1
- package/dist/shell/app-shell.js.map +1 -1
- package/package.json +1 -1
- package/src/components/data-table-fit.ts +17 -2
- package/src/components/data-table-groups.tsx +15 -4
- package/src/components/data-table-head.tsx +25 -2
- package/src/components/data-table-leading-row.tsx +4 -1
- package/src/components/data-table-row-actions.tsx +3 -2
- package/src/components/data-table-row.tsx +483 -0
- package/src/components/data-table-selection.ts +17 -1
- package/src/components/data-table-virtual.ts +547 -0
- package/src/components/data-table.tsx +291 -314
- package/src/data-table.ts +2 -0
- package/src/hooks/use-anchored-panel.ts +9 -1
- package/src/shell/app-shell.tsx +7 -1
package/src/data-table.ts
CHANGED
|
@@ -32,6 +32,8 @@ export type {
|
|
|
32
32
|
export { swipePlanRowActions } from "./components/data-table-row-actions";
|
|
33
33
|
// 0.48 (keksdose dev #605): a `groupBy` level (also `mobileGroupBy`'s) and the `loadMore` footer.
|
|
34
34
|
export type { DataTableGroupBy, DataTableLoadMore } from "./components/data-table-groups";
|
|
35
|
+
// 0.48.2 (keksdose dev #632): `virtualize`'s options.
|
|
36
|
+
export type { DataTableVirtualize } from "./components/data-table-virtual";
|
|
35
37
|
export * from "./components/data-table-cells";
|
|
36
38
|
export { useTableUrlState, readTableUrlState } from "./components/use-table-state";
|
|
37
39
|
export type {
|
|
@@ -76,6 +76,8 @@ export function readKeyboardInset({ minimum = MIN_KEYBOARD_PX }: KeyboardInsetOp
|
|
|
76
76
|
return inset >= minimum ? inset : 0;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
const UNMEASURED_VIEWPORT: ViewportBox = { top: 0, height: 0 };
|
|
80
|
+
|
|
79
81
|
function readViewport(): ViewportBox {
|
|
80
82
|
if (typeof window === "undefined") return { top: 0, height: 0 };
|
|
81
83
|
const vv = window.visualViewport;
|
|
@@ -356,7 +358,13 @@ export function useAnchoredPanel<T extends HTMLElement>(
|
|
|
356
358
|
options: AnchoredPanelOptions = {},
|
|
357
359
|
): AnchoredPanel {
|
|
358
360
|
const rect = useAnchoredRect(ref, open);
|
|
359
|
-
|
|
361
|
+
// Not read while rendering (0.48.2, keksdose K-052-2): in Chromium `visualViewport`'s
|
|
362
|
+
// geometry forces a style and layout pass on a dirty DOM, and every anchored panel —
|
|
363
|
+
// closed ones too — paid it on mount (a bulk bar's pickers appearing on the first
|
|
364
|
+
// ticked row of a long table paid a layout of the whole table). Nothing reads this
|
|
365
|
+
// before the layout effect below has filled it: `rect` is null until the panel is open
|
|
366
|
+
// and measured, and that same effect pass measures the viewport.
|
|
367
|
+
const [viewport, setViewport] = useState<ViewportBox>(UNMEASURED_VIEWPORT);
|
|
360
368
|
// A panel of rows wants room for the same number of rows at every text size; the gap
|
|
361
369
|
// and the edge margin are not text and stay px.
|
|
362
370
|
const { scale } = useTextSize();
|
package/src/shell/app-shell.tsx
CHANGED
|
@@ -564,7 +564,13 @@ export function AppShell({
|
|
|
564
564
|
// into the rest from a zero basis, and a window too short for the page's
|
|
565
565
|
// floor scrolls `<main>`. Every other page lays out as before. Below `md`
|
|
566
566
|
// the document scrolls and nothing fills.
|
|
567
|
-
|
|
567
|
+
// The children's `shrink-0` carries no `:has`: `flex-shrink` does nothing
|
|
568
|
+
// outside a flex container, and a `:has(…) > *` rule cost a style recalc of
|
|
569
|
+
// the whole page on every DOM insertion under it (17–45 ms per scrolled step
|
|
570
|
+
// of a `virtualize` table, 0.48.2). `[&&>*]` doubles the class, so it stays
|
|
571
|
+
// as specific as FillHeight's `has-[…]:flex-1` (whose `flex: 1` would set
|
|
572
|
+
// shrink 1) and, emitted after it, still wins.
|
|
573
|
+
"md:has-[[data-fill-height]]:flex md:has-[[data-fill-height]]:flex-col md:[&&>*]:shrink-0",
|
|
568
574
|
// Embedded there is no document scroll to lean on below `md` either.
|
|
569
575
|
embedded && "min-h-0 overflow-y-auto",
|
|
570
576
|
)}
|