diff --git a/.gitignore b/.gitignore index 1bea4fc..f7db621 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ _build node_modules .vscode *.bc.js +web/brr_lwd_ui.css diff --git a/vendor/brr_lwd_ui/examples/virtual-table/brr_lwd_ui.css b/vendor/brr_lwd_ui/examples/virtual-table/brr_lwd_ui.css index 7e659d8..70260ac 100644 --- a/vendor/brr_lwd_ui/examples/virtual-table/brr_lwd_ui.css +++ b/vendor/brr_lwd_ui/examples/virtual-table/brr_lwd_ui.css @@ -76,17 +76,20 @@ html { border-left: 1px solid black; border-bottom: 1px solid black; + & .lwdui-lazy-table-content, + & .lwdui-lazy-table-content-wrapper, + & .lwdui-virtual-table-row { + display: grid; + grid-template-columns: subgrid; + grid-column: 1/-1; + } - & .lwdui-lazy-table-content-wrapper { - width: 100%; + & .lwdui-lazy-table-content-wrapper{ height: 100%; overflow: auto; } & .lwdui-virtual-table-row { - display: grid; - grid-template-columns: subgrid; - grid-column: 1/-1; padding: 0; overflow-x: auto; overflow-y: hidden; diff --git a/vendor/brr_lwd_ui/examples/virtual-table/main.ml b/vendor/brr_lwd_ui/examples/virtual-table/main.ml index 25cfcb4..ea186c4 100644 --- a/vendor/brr_lwd_ui/examples/virtual-table/main.ml +++ b/vendor/brr_lwd_ui/examples/virtual-table/main.ml @@ -5,22 +5,30 @@ open Brr_lwd_ui.Table let data = { - Virtual.total_items = Lwd.pure (*93_300*) 200; + Virtual.total_items = Lwd.pure 93_300; fetch = Lwd.pure (fun i -> - Console.log [ "Loading"; Jv.of_array Jv.of_int i ]; - Fut.ok (Array.map (fun i -> Some i) i)); + (* Console.log [ "Loading"; Jv.of_array Jv.of_int i ]; *) + Fut.ok (Array.map (fun i -> Some (i * i)) i)); render = Lwd.pure (fun i data -> [ `P (El.txt' (string_of_int i)); `P (El.txt' (string_of_int data)) ]); } let app = - let table = { columns = [| Columns.v "a" "5em" [ `P (El.txt' "toto") ] |] } in + let table = + { + columns = + [| + Columns.v "a" "5em" [ `P (El.txt' "id") ]; + Columns.v "a" "1fr" [ `P (El.txt' "square") ]; + |]; + } + in let table = { table; row_height = Em 5. } in let table = Virtual.make ~ui_table:table data in Elwd.div - ~at:Attrs.O.(v (`P (A (At.style (Jstr.v "height:15em"))))) + ~at:Attrs.O.(v (`P (A (At.style (Jstr.v "height:50vh"))))) [ `R table ] let _ = diff --git a/web/app.css b/web/app.css index fc91029..63cff3a 100644 --- a/web/app.css +++ b/web/app.css @@ -35,8 +35,8 @@ body { justify-items: stretch; align-items: stretch; - width: 100%; - height: 100%; + width: 100wv; + height: 100wh; & .item-list, & .playlist { @@ -129,4 +129,4 @@ body { background-repeat: no-repeat; background-position: center; } -} \ No newline at end of file +} diff --git a/web/dune b/web/dune index 5d735ee..f199ce9 100644 --- a/web/dune +++ b/web/dune @@ -11,3 +11,9 @@ (mode (promote (until-clean))) (files ../bin/db_worker/db_worker.bc.js)) + +(copy_files + (mode + (promote (until-clean))) + (alias default) + (files ../vendor/brr_lwd_ui/examples/virtual-table/brr_lwd_ui.css)) diff --git a/web/index.html b/web/index.html index ba4941c..fb4b259 100644 --- a/web/index.html +++ b/web/index.html @@ -5,6 +5,7 @@